oplc m Posted July 2, 2022 Report Share Posted July 2, 2022 hello there : I'm using Modbus io server (rt LabVIEW 2021) to read and write bits in holding register by using bound variable like (400101.1 and 400102.1) the first variable is for reading and second for writing but i have problem in write although I choose write access but no response but in reading I didn't have any terrible so what can i do to make write in this way . best regards Quote Link to comment
Rolf Kalbermatter Posted July 3, 2022 Report Share Posted July 3, 2022 (edited) What code do you use? What device? Your address seems to indicate the Modbus decimal addressing scheme. Most LabVIEW ModBus libraries I know of use however the more computer savy hexedecimal naming scheme with explicit register mode selection. This means you need to remove the first digit from your address (the number 4) and decrement the remaining address by one to get a zero based address. However Modbus Function Code 4 is a (Read Input Registers) operation and there is no (Write Input Register operation as it would not make any sense to write to an input. Read Holding Register would be an address starting with 3 and Write Holding Register would start with 6. So when using the NI Modbus library for instance in order to read your Modbus address 40001 you would need to use the Read Modbus function, selecting the Input Register group and passing an address of 0. There is no possibility to write to the input registers. For Holding Registers the Modbus address would be 30001 for reading and 60001 for writing. And when using the LabVIEW Modbus library you would select the Read and Write function respectively, selecting the Holding register and passing an address of 0. Edited July 3, 2022 by Rolf Kalbermatter Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.