Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Spectre

Pages: [1]
1
Seems like I found a solution. So the way my PLC does adressing (and probably any Codesys based PLC) 0 - 31999 is the OUTPUT Register and 32000-63999 is the INPUT Register from the PLCs perspective. While Coils can have address 0 - 32767 for OUTPUT and 32768 - 65353 as INPUT. So lets say I have a Coil on address 18 as OUTPUT. Then I would have to input Modbus function code 00019 (function code followed by address +1) to R/W.

Here is where I got confused. So lets say an INPUT Coil, it would get assigned a really high address like 33000, it would simply add another digit to the Modbus addressing. So to access this Coil I would have to use Modbus function code 133001 (function code 1 followed by address +1). I'm pretty sure I tried this before, but it seem to be working now. So I consider at least this part of the project solved. Thanks a lot Archie and Godra for help.

Edit: Forgot to add one thing. You also have to create a "Generic Modbus Master" and connect it to the PLC through Modbus TCP. No idea why, maybe to tell the PLC to act as slave? It wasn't necessary when I did it with the library function block however.

2
Hello Archie, I tried reading watchdog status with a DigitalPanelMeter and a Basic Label, and it returned the value -1 (see image).

I'm not really sure what to make of it, as it's not listed as a possible return value in the datasheet. I also am able to read for instance "Hardware Version" in section 9.2.3.3 with address 64021 in AHMI as 464022 and return the value "4". Same with Firmware version, it returns an "8". So I'm clearly able to read something.

Godra, higher addresses yield same result, "Illegal data value". I am somewhat aware how the function codes correlates. I'm just unaware how the addressing does. So when my Modbus address is "Register: 0 Bit: 0" I'm not sure what that means. But I understand that if I want to read it, I would have to preceed it by a 4, just don't know the rest.

3
Thanks for replies guys. I will try with a basic label and try different adresses. And yes, I also found the addressing to be very strange indeed. Will be trying some things in the meantime and update if I figure anything out.

Edit: I tried with a basic label and different addresses.

00001 gives "Illega function"
10001 gives "Illegal data address"
20001 gives "Invalid Address 20001 - Invalid first digit in address" obviously
30001 gives "Slave device failure"
40001 gives "Illegal data value" as usual

According to tech support the way the PLC does addressing is:

PFC-OUT 0-31999: FC3, FC4, FC23, FC66
PFC-IN 32000-63999: FC3, FC4, FC6, FC16, FC23, FC66

Not really sure how this correlates to the way AdvancedHMI does its addressing, but I came across this thread.

http://www.plctalk.net/qanda/showthread.php?t=114288

4
Hi. I'm using a Wago PFC100 PLC for a project I'm doing and I want to communicate with AdvancedHMI through Modbus TCP.

I'm not an expert when it comes to Modbus, but I know a little. My main problem is understanding how the mapping of Modbus variables work in e!COCKPIT and how it correlates to the way AdvancedHMI maps function codes. I have managed to get Modbus communication working by following a step by step guide (https://www.youtube.com/watch?v=XZiqyO1s6YM) using some function blocks, but I'm fairly certain it should be possible to do it simpler than that.

I haven't done any configuration of the PLC in regards to port access. I'm using a static IP I've assigned to it. But I assume the default Modbus port is 502 which I've configured in the ModbusTCP driver.

Attached are some images with information I thought could be relevant. I have for instance mapped a WORD which is assigned Register 0: Bit 0 in e!COCKPIT, but I'm not sure how that correlates to Modicon addressing. I've also set up a DigitalPanelMeter to try and read this variable.

Any suggestions or help is appreciated. Thank you in advance.

Pages: [1]