Write Multiple Coils VI
- Updated2024-11-20
- 2 minute(s) read
Writes values to contiguous coils. The maximum number of coils this VI can write is 1,968.

Inputs/Outputs
Modbus master in
—
Modbus master in specifies the reference to the Modbus master instance. Use the Create Master Instance VI to create a Modbus master instance.
starting address
—
starting address specifies the initial address for the write operation. Valid values are between 0 and 65,535, where 65,535 is the maximum number. The address that this VI writes is 0-based, meaning that the address numbering convention for the Modbus slave starts at 0.
coil values
—
coil values specifies the coil values you want to write. The number of coils you specify must be between 1 and 1,968, where 1,968 is the maximum number. After you specify a value for coil values, check the value you specify for starting address. Ensure that you do not use this VI to write 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 master out
—
Modbus master out returns a duplicate of Modbus master in.
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 Write Multiple Coils VI.
Modbus master in
—
starting address
—
coil values
—
error in (no error)
—
Modbus master out
—
error out
—