Hi,
I have MODBUS register 405000 to 405005 (6 registers) that needs to write value in each register using FUNCTION 16 (multiple register writes). Is there anyone knows how to implement it in Citect.
Thanks in advance
Felix
Hi,
I have MODBUS register 405000 to 405005 (6 registers) that needs to write value in each register using FUNCTION 16 (multiple register writes). Is there anyone knows how to implement it in Citect.
Thanks in advance
Felix
Check out the Modnet help page:
PresetMultiRegistersOnly |
Forces the use of only function code 16 (multiple registers) for register writes. This function code setting is normal for a Class 0 Modbus TCP/IP device. With this parameter, you can set different values for specific I/O devices or groups of I/O devices. See Device/group-specific Parameters. |
0 - function code 6 and 16 1 - function code 16 only |
1 |
Thanks Eric, does it mean that when I write data in series of consecutive registers will use FUNCTION 16.
TagWrite("Tag1",20)
TagWrite("Tag2",21)
TagWrite("Tag3",22)
TagWrite("Tag4",23)
TagWrite("Tag5",24)
TagWrite("Tag6",25)
Felix
Thanks Eric, does it mean that when I write data in series of consecutive registers will use FUNCTION 16.
TagWrite("Tag1",20)
TagWrite("Tag2",21)
TagWrite("Tag3",22)
TagWrite("Tag4",23)
TagWrite("Tag5",24)
TagWrite("Tag6",25)
Felix
If you set the PresetMultiRegistersOnly parameter, then it should. If you don't set that parameter, then you'd have to test it to know for sure. TagWrite() sends an individual write to the I/O server, so I don't know if they would get grouped together. It's better to just write directly to the tags without TagWrite() and the writes will be sent to the I/O server together:
Tag1 = 20;
Tag2 = 21;
Tag3 = 22;
etc.
Thanks Eric, I will test it.
Felix Custodio Did you manage to test it?
not yet, waiting the actual device to arrive