Linuxdept (Customer) asked a question.
Modbus Connection Issue
Basically all im trying to do is send data and retrieve Modbus data Via External Software, but at the moment using Cmd line and 3rd party Software. sometimes it works Fine other Times it Doesn't work at all , especially if you make changes to your program and do a stop mode download and start the program again.
What device are you trying to communicate with?
i am going from a PC to a Productivity 2000
I would double check the Productivity CPU modbus server settings located under File --> Project Settings --> Modbus Server Settings if you haven't done so already.
I would guess exception handling is on and you are trying to read either a non-existing modbus address or only 1 register of a modbus tag that is assigned to 2 consecutive modbus registers.
Edit: Sorry I see you are doing a write.
I tested doing a single register write to a tag that has 2 consecutive modbus addresses mapped and received the same exception response. I'm using a 3rd party software similar to what you are doing (qModMaster).
Using multiple holding register write (FC16 I believe?) I was able to do so with the cpu in both stop and run mode.
Well Ive Found out that if you only do runtime Download it's fine
Not sure what the expected behavior for a Tag-Based PLC as a Modbus Server when the PLC is in PROGRAM mode.
Illegal Data Address (0x02) Exception Response may be 100% valid (I don't know for sure of the actual implementation). The Tag may be mapped to a Modbus Address only when the PLC is in RUN mode (again, I don't know for sure of the actual implementation).
Since you are doing a FC6, which is a WRITE Single Holding Register, and the PLC is in PROGRAM mode, that mapping in the PLC can change 100 times (imagine if it was mapped to physical output), the client/master may need to be aware that those writes may not be doing what you think they are doing.