1 Attachment(s)
MODRTU32 - Preset Multiple Registers (FC 16)
<div>Dear Forum Community,</div><div><br></div><div><br></div><div>I am using MODRTU32 driver in order to integrate some IED's in MODBUS TCP/IP. To execute commands I need to write two registers at the same time and when I create a new variable I only find the option 'Preset Single Register (FC 6)'. Is there a possibility to implement commands using Function Code 16 (Preset Multiple Registers) or similar? Or What about another MODBUS driver like MODBUS_ENERGY? <br><br></div><div>I am sharing IED documentation about MODBUS commands.</div><div><br>Zenon version: Energy Edition 8.00 SP 0 Build 52082</div><div><br></div><div><br></div><div>I would appreciate your help. Thank you in advance.</div><div><br></div><div>Jose Alejandro</div>
Re: MODRTU32 - Preset Multiple Registers (FC 16)
Hi Jose_Alejandro,<br><br>Thanks for the post and welcome to the forum!<br><br>Typically you would use the driver object type "Holding Register". Variables based of this driver object type cause the driver to use function code 3 for read requests and function code 16 for write requests. <br><br>When you want to write multiple registers in a single request, you will need to activate the blockwrite function of the driver, in the project.ini file. (see the driver help for more information)<br><br>Note that writing multiple registers in one request using the blockwrite feature, will only work for registers that have consecutive offsets. Also, it will only work up to a maximum of 123 consecutive registers in one request.<br><br>"Preset Single Register (FC6)" is a special driver object type that uses function code 6 for compatibility with devices that do not support FC16. Variables based on this driver object type, are write only variables.<br><br><br>The modbus_energy driver has the driver object type "register" which also uses function code 3 for reading and 16 for writing. The modbus_energy driver als supports the blockwrite feature.<br><br>Best regards,<br>Mark<br><br>