Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

modbus slave address verses starting address

I am just starting to learn to use serial communication in LabVIEW, as I need to read data (and use it to trigger other devices) from a non-NI device (MidNite Solar Classic 200-being used to monitor output from a Wind Turbine and a battery that it's charging) that has a serial connection.  I got an example of reading serial from http://zone.ni.com/devzone/cda/epd/p/id/6153#0requirements (see attached image), which uses the LabVIEW modbus library from http://zone.ni.com/devzone/cda/epd/p/id/4756#0requirements.  I have a few questions though, just for gettting started:

 

 

1.  What is the difference between the Slave Address and the Starting Address?  I've got register addresses for each type of data coming from the device, such as 4115, the average battery voltage, but I don't know which to input the register address into--the Slave Address input or the the Starting Address input.  And what do I put in the other input, then?

2.  Is there a way that LabVIEW will let me get data from multiple addresses at one time, and if so, can I jump around from, say, register 4115 to 4120, or do I have to get addresses all in a row, like 4115-4120?

3.  If I'm just trying to read registers that are read-only, would it be correct to use the "Read Input Registers" Function Code, or should I be using something else?  I noticed other read-related options for Function code are:  "Read Discrete Inputs", "Read Holding Registers", and "Read Coils".  I'm not sure what each of these means, especially the "Read Coils".

 

I'd really appreciate any help anyone can give me on this.

0 Kudos
Message 1 of 2
(3,086 Views)

Hi,

 

You really should read some ModBus documents to get a better knowledge of ModBus. Try here and here.

 

The short answers to your questions:

 

1. You can address different ModBus slaves through one interface channel. Therefore you will need a address for each slave. Within a slave you can access registers with a certain start address.

 

2. You can read multiple registers but only as one block. You specify the start address of a register and the number of registers you want to read.

 

3. You can read one input register or multi (holding) registers. In ModBus you have bits (coils or inputs)  and registers (logical and physical)

 

If you refer to a ModBus address as 4115 you must know want the source tells you. Is it ModBus address 4115 or is use function 4 to read address 115. In the latter case you should decrease the address by one.

 

Kees

0 Kudos
Message 2 of 2
(3,058 Views)