LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Modbus - read from multiple addresses?

Solved!
Go to solution

Hello.  I am using Modbus protocol to communicate to wireless modules via an access point.  A single slave module has 3 analog input points, with the addresses 0, 256, 257.  Is there a way to read all three in a single poll?  I can currently read the first one, with a starting address of 0.  Then read the other two with a starting address of 256.  I'm just wondering whether there is a more efficient way to do this in a single poll, rather than two separate polls.

0 Kudos
Message 1 of 3
(4,483 Views)
Solution
Accepted by topic author stacey54

No.  You can only read multiple address if they are consecutive, like the 256 and 257 addresses are.

0 Kudos
Message 2 of 3
(4,469 Views)

RavensFan is correct that you can only read consecutive address' but depending on your product there may be a way to do what you want..

Many products have a system for reassigning particular address' to predefined consecutive range.

 

A typical implementation might be able to do this with ten address' and say something like.

Address 2000 to 2009 are used to store the address' of the ten items you want to be able to read consecutively and address' 2010 to 2019 are where you would then read the items from.

 

So to combine our two examples

You would assign 0 to address 2000, 256 to 2001 and 257 to 2002.

You would then read 3 items starting at address 2010.

This would return the three items in one read.

 

Read your manual carefully, you might have this fairly common feature. 

—Ben
Prevent your computer from sleeping programmatically!
Use Power Requests
Download from GitHub

Message 3 of 3
(4,442 Views)