Jump to content

write choosing bit in holding register


Recommended Posts

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

Link to comment

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 by Rolf Kalbermatter
Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.