3
« on: March 19, 2020, 10:32:49 AM »
Hey All,
Thought someone else might benefit from what I've figured out so far...
I am working on a project using 3.99y, talking to a Unitronics PLC using MODBUSTCP
I am able to read MB's (bits) and MI's (integers), but have found that the addressing is different than other brands of PLC's.
In Unitronics the MB addressing starts at 0000h, so if I want to read MB143, then I have to convert the hex to decemal, the add the offset. 0000h = 0000 dec + 143, so in the PLCAddressValue I enter 1:0143 (the 1: being modbus call #01 read coils).
Outputs start at 4000h, so if I want to read O69, 4000h = 16384 + 69 = 16453, PLCAddressValue = 1:16453
MI's start at 0000h, so MI170 would have a PLCAddressValue of 3:0170 (the 3: being modbus call #03 Read Holding Registers)
But, now I have come to an issue that I have not yet figured out, hoping someone can help....
I want to read a string from the PLC, I have seen in a couple different posts where Archie has stated that starting in 3.99y, we have the ability to read a string using something like 40001@S10 in the PLCAddressValue of a BasicLabel (where the 10 is the number of bytes in the string).
When I try this using the above addressing scheme "3:0170@S5", I get a message saying "Input string was not in a correct format".
Anyone have any thoughts?
JohnR