1
Support Questions / Re: Modbus mapping in e!COCKPIT and "Illegal Data Value" problem
« on: February 04, 2020, 09:31:54 AM »
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.
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.