From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
01-29-2013 03:12 AM - edited 01-29-2013 03:13 AM
Hello,
I have a question about MODBUS/TCP.
I have to write individual BITS to a holding register. Unfortunally, holding registers only accept unsigned values (numbers).
Therefore I need to convert my bit value (e.g. 101000 > 5).
But now I want to write a single bit value, without touching the other bit values. I think I need some kind of MASK for this to tell LabVIEW which individual bits I want to write.
Example in attachement.
Does anyone have any experience with a MASK in MODBUS/TCP in LabVIEW?
I have found on the internet things about "Holding Register Bit Mask Writes" and that Function Code 22 should be used, but I do not know how this can be used in LabVIEW.
Info about a mask in MODBUS (top of page 3)
http://www.micronor.com/products/files/AN112/AN112_NIModbusTutorial.pdf
How a mask should be used in writing a register (section 4.3.4 Mask write register (FC 22))
http://www.rtaautomation.com/modbustcp/
Thanks
Arjen
Solved! Go to Solution.
01-29-2013 04:58 AM
01-29-2013 05:08 AM
Hello Ranjeet_Singh,
Thank you for your reply.
I have thought of that way of "fixing" it, but this solution will create extra (unnecesary) data traffic. It is not a nice solution.
There must be another way to do this ??
02-06-2013 08:50 AM - edited 02-06-2013 08:51 AM
Hello Arjennn,
Do you have the hardware available.
Have you already tried to work with the NI Modbus Library and taken a look at the examples?
Do you have the hardware available so that you can do some tests?