Posts: 57
Threads: 15
Joined: Feb 2020
Reputation:
0
Hi! I ask for your help, I am a beginner.
I am using LM as Slave via script.
When I try to write an integer value in my PLC to an integer register (uint16 in LM), I cannot do it. But if I write a floating point value to this register, then an integer value is written.
When I test in Modbus Poll, I have the status “illegal data address” Slave LM.
is it an offset problem? What should I do?
Posts: 4938
Threads: 28
Joined: Aug 2017
Reputation:
225
It might help if you show us the slave script.
------------------------------
Ctrl+F5
Posts: 4938
Threads: 28
Joined: Aug 2017
Reputation:
225
You have done everything correct here. I assume the objects 3/1/1 and 3/1/2 are 2 byte unsigned integer?
------------------------------
Ctrl+F5
Posts: 8071
Threads: 43
Joined: Jun 2015
Reputation:
471
Which address are you using from ModBus side? You can only use 0 and 1 because you have 2 registers defined.
Posts: 57
Threads: 15
Joined: Feb 2020
Reputation:
0
please, can you test this script in some Modbus Server? do you get an "illegal data address" too?
"illegal data address" : The data address received in the query is not an allowable address for the server (or slave). More specifically, the combination of reference number and transfer length is invalid.
Posts: 4938
Threads: 28
Joined: Aug 2017
Reputation:
225
This script was used in many projects and nobody had this issue. Try reading register 1.
------------------------------
Ctrl+F5
Posts: 57
Threads: 15
Joined: Feb 2020
Reputation:
0
yes-yes! i totally agree with you. i see how many people use it. i only want to understand where is my issues. i can read and write values via modbus server but with errors.
Posts: 4938
Threads: 28
Joined: Aug 2017
Reputation:
225
The issue is somewhere in config of your PLC.
PS. LM is modbus server here, your PLC is client.
------------------------------
Ctrl+F5