Posts: 215
Threads: 65
Joined: Sep 2015
Reputation:
0
I have some do not understand?
above marked "mb: setslave (0)" but the bottom stating "mb: setslave (10)"?
Meaning it differently?
mb: writeregisters (4, 255) - set to 255 red
mb: writeregisters (5, 127) - set to 127 green
mb: writeregisters (6, 50) - set to 50 blue
mb: writeregisters (7, 80) -
And 4,5,6,7 value here is what? This value must be taken from the production?
Maybe someone did this!, You can help me? I am very grateful!
Posts: 1784
Threads: 6
Joined: Jul 2015
Reputation:
119
03.12.2016, 09:24
(This post was last modified: 03.12.2016, 09:33 by Erwin van der Zwart.)
Hi,
The first part set a default slave to address 10 by a broadcast command so be sure to have only 1 device connected when you write the address to device, when all devices have a new final address you can connect them all together and use 2nd script to control them by using there new adresses.
4, 5, 6, 7 are the modbus registers in the connected modbus device.
I would advice you to read the manual of the device as all modbus registers are explained there.
BR,
Erwin