![](cnclst.gif) | MBAP Header is a cluster containing the transaction ID and Unit ID. This is additional information not usually required for a MODBUS transaction.
Transaction Identifier—This identifier is for transaction pairing; the MODBUS server copies the request transaction identifier in the response.
Unit Identifier—This field is for intra-system routing purposes. It typically communicates to a MODBUS serial line slave through a gateway between an Ethernet TCP-IP network and a MODBUS serial line. The MODBUS client sets this field in the request, and the server response must return this field with the same value. |
![](c.gif) | TCP Connection Refnum in is a network connection refnum that uniquely identifies the TCP connection. Use TCP Open Connection.vi to open a TCP connection. |
![](cu16.gif) | Starting Address is the first address location of the input register to read. This address is sometimes referred to as offset. Refer to your device's documentation to find the input register address mapping.
Be sure to specify the correct address in the MODBUS device configuration software for the register you want to use in LabVIEW. In most MODBUS device configuration software, you must enter a name for the register you want to use. Per MODBUS convention, the register address of the slave device is calculated by subtracting 1 from the register name that you specify in the master device configuration software. The MODBUS LabVIEW library expects register addresses, not register names, so you may need to subtract 1 from the address you defined in the MODBUS device configuration software. For example, a register name defined as 2 in a MODBUS configuration device translates to register address 1 in the Holding Registers table of the LabVIEW MODBUS library, as shown below.
MODBUS Device | Holding Register Name = 2 |
LabVIEW | Holding Register Address = 1 |
|
![](cu16.gif) | Quantity represents how many input registers to read from the slave. The VI returns the input register at Starting Address and each following input register up to Quantity. For example, if Starting Address is 0 and Quantity is 4, the VI reads input registers from the slave at address 0, 1, 2, and 3. |
![](cu32.gif) | Timeout specifies the maximum time period, in milliseconds, that the VI waits for the slave's response before throwing an error. |
![](ccclst.gif) |
error in describes error conditions that occur before this VI or function runs. The default is no error. If an error occurred before this VI or function runs, the VI or function passes the error in value to error out. If an error occurs while this VI or function runs, the VI or function runs normally and sets its own error status in error out. Use the Simple Error Handler or General Error Handler VIs to display the description of the error code. Use error in and error out to check errors and to specify execution order by wiring error out from one node to error in of the next node.
![](cbool.gif) |
status is TRUE (X) if an error occurred before this VI or function ran or FALSE (checkmark) to indicate a warning or that no error occurred before this VI or function ran. The default is FALSE.
|
![](ci32.gif) |
code is the error or warning code. The default is 0. If status is TRUE, code is a negative error code. If status is FALSE, code is 0 or a warning code. |
![](cstr.gif) |
source identifies where an error occurred. The source string includes the name of the VI that produced the error, what inputs are in error, and how to eliminate the error. |
|
![](iaprn.gif) | TCP Connection Refnum (dup) can be an input to another MODBUS VI, or you can close it using TCP Close Connection.vi. |
![](i1du16.gif) | Input Registers represents the data read from the slave. |
![](iu8.gif) | Exception Code is nonzero if a MODBUS error has occurred. The exception code mapping is as follows:
0 | No error |
1 | Illegal function |
2 | Illegal data address |
3 | Illegal data value |
4 | Failure in associated device |
5 | Acknowledge |
6 | Busy, rejected message |
7 | NAK—Negative acknowledge |
For more information about these error codes, refer to your device's documentation. |
![](icclst.gif) |
error out contains error information. If error in indicates that an error occurred before this VI or function ran, error out contains the same error information. Otherwise, it describes the error status that this VI or function produces. Right-click the error out front panel indicator and select Explain Error from the shortcut menu for more information about the error.
![](ibool.gif) |
status is TRUE (X) if an error occurred or FALSE (checkmark) to indicate a warning or that no error occurred.
|
![](ii32.gif) |
code is the error or warning code. If status is TRUE, code is a nonzero error code. If status is FALSE, code is 0 or a warning code. |
![](istr.gif) |
source describes the origin of the error or warning and is, in most cases, the name of the VI or function that produced the error or warning. |
|