LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Binding a Shared Varable to multiple MODBUS registers

Solved!
Go to solution

A simple question, but can't seem to find an answer:

I have a project library with a serial MODBUS i/o server setup. In this library I have several shared variables that are bound to registers on the remote device through the MODBUS protocol, and this works fine if each variable is bound to read a single register (e.g. Modbus1\D400001). What is the appropriate syntax to bind a single shared variable to multiple consectutive registers? If I set the Shared Variable type to "Array of UInt32" can I specify something along the lines of Modbus1\D400001-D400100 ? So far this doesn't seem to be working, or at least hasn't displayed anything when creating an array indicator and binding this shared variable to the indicator. Thanks,

 

  --David

 

Sorry, forgot to mention this is LabView 9.0.1 with the DSC module.

0 Kudos
Message 1 of 6
(3,688 Views)
Solution
Accepted by topic author Underscore_c

Hi Underscore_c, 

Take a look at this help document:

http://zone.ni.com/reference/en-XX/help/371618E-01/lvmve/dsc_modbus_using/

This document should also be in your LabVIEW help.  You'll notice that you can call an array of registers by preceding the address by "A". 

 

For example, 

A400008L8 is an array of values of length 8.  

 

There is an example called "Modbus Datatype Extension" that should get you started in the right direction. 

 

Dave T.

National Instruments
FlexRIO & R-Series Product Support Engineer
Message 2 of 6
(3,652 Views)

Ah, I knew I was missing something simple. Thanks!

0 Kudos
Message 3 of 6
(3,650 Views)

"For example, 

A400008L8 is an array of values of length 8.  

 

There is an example called "Modbus Datatype Extension" that should get you started in the right direction. "

 

I'm using LV2011, but i can't find where to set the length of the arry. I need to use the array of booleans. By default the number of coil is 1976. But i only see "1". And when i'm writing an array of 10 booleans to the addrress, i got an error.

 

Can you kindly point me to he right direction.

 

Thanks in advanced!

0 Kudos
Message 4 of 6
(3,570 Views)

Can you post a screen shot of where you are creating variables bound to the coils? It sounds like you are selecting a single coil instead of a group (array) of coils. 

 

I/O items in the range shown below are valid for 1-D arrays of booleans

 

image.png

 

Are you binding a variable to coils in this range?

 

-Nick-

Nick C | Software Project Manager - LabVIEW Real-Time | National Instruments
0 Kudos
Message 5 of 6
(3,557 Views)

Sorry, i forgot to update the post. I found the way to access array of coil. By acessing the address of the bound network variable  from A000001L1 to A000001L10.

 

Cheers!

Thanks for the help!

0 Kudos
Message 6 of 6
(3,549 Views)