Read Coils VI
- Updated2024-11-20
- 3 minute(s) read
Reads values of contiguous coils.

Inputs/Outputs
Modbus slave in
—
Modbus slave in specifies the reference to the Modbus slave instance. Use the Create Slave Instance VI to create a Modbus slave instance.
starting address
—
starting address specifies the initial address for the read operation. Valid values are between 0 and 65,535, where 65,535 is the maximum number. The address that this VI reads is 0-based, meaning that the address numbering convention for the Modbus slave starts at 0.
number of coils
—
number of coils specifies the number of coils you want to read. Valid values are between 1 and 65,536, where 65,536 is the maximum number. After you specify a value for number of coils, check the value you specify for starting address. Ensure that you do not use this VI to read the value of a coil whose address is larger than 65,535. Otherwise, LabVIEW returns error code -389113.
error in (no error)
—
error in describes error conditions that occur before this node runs. This input provides standard error in functionality.
Modbus slave out
—
Modbus slave out returns a duplicate of Modbus slave in.
coil values
—
coil values returns the coil values.
error out
—
error out contains error information. This output provides standard error out functionality. |
Examples
Refer to the Modbus Library.lvproj in the labview\examples\Data Communication\Modbus\ModbusLibrary directory for an example of using the Read Coils VI.
Modbus slave in
—
starting address
—
error in (no error)
—
Modbus slave out
—
coil values
—
error out
—