Create Master Instance VI

LabVIEW 2017 Datalogging and Supervisory Control Module Help

Edition Date: March 2017

Part Number: 371618K-01

»View Product Info
Download Help (Windows Only)

Owning Palette: Modbus Master VIs

Requires: DSC Module or Real-Time Module

Creates a serial or TCP Modbus master instance. You must manually select the polymorphic instance to use.

You can use the Modbus master instance to perform read and write operations on Modbus slaves. The default read and write operation timeout is 5,000 ms. You can use the Property Node or the Set Timeouts VI to change the timeout.

Examples

Use the pull-down menu to select an instance of this VI.

Create Master Instance (Serial)

serial type specifies the type of data transmission through serial ports.

0RTU (default)—Uses the Remote Terminal Unit (RTU), which is a binary data unit, to send data.
1ASCII—Uses human-readable characters to send data.
unit ID specifies the identification of the Modbus slave with which you want to communicate. The Modbus slave can be a Modbus slave you create or a third-party Modbus slave. If you want to communicate with a third-party Modbus slave, check the documentation for the Modbus slave to find its unit ID.
VISA resource name specifies the resource you want to open.
baud rate specifies the baud rate of the Modbus slave with which you want to communicate. The Modbus slave can be a Modbus slave you create or a third-party Modbus slave. If you want to communicate with a third-party Modbus slave, check the documentation for the Modbus slave to find its baud rate. The default is 9,600.
error in describes error conditions that occur before this node runs. This input provides standard error in functionality.
parity specifies the parity of the Modbus slave with which you want to communicate. The Modbus slave can be a Modbus slave you create or a third-party Modbus slave. If you want to communicate with a third-party Modbus slave, check the documentation for the Modbus slave to find its parity.

0None—Specifies to use no parity bit. If you specify None for parity, the number of stop bits indicating the end of a frame is 2.
1Odd—Specifies to use odd parity. If you specify Odd for parity, the number of stop bits indicating the end of a frame is 1.5.
2Even (default)—Specifies to use even parity. If you specify Even for parity, the number of stop bits indicating the end of a frame is 1.5.
flow control specifies the flow control of the Modbus slave with which you want to communicate. The Modbus slave can be a Modbus slave you create or a third-party Modbus slave. If you want to communicate with a third-party Modbus slave, check the documentation for the Modbus slave to find its flow control.

0None (default)—Does not use flow control. The transfer mechanism assumes buffers on both sides of the connection to be large enough to hold all data transferred.
1XON/XOFF—Uses the XON and XOFF characters to perform flow control. When the receiving buffer is almost full, the transfer mechanism controls the input flow by sending XOFF. When the buffer receives XOFF, the transfer mechanism controls the output flow by suspending transmission.
2RTS/CTS—Uses the RTS output signal and the CTS input signal to perform flow control. When the receiving buffer is almost full, the transfer mechanism controls the input flow by unasserting the RTS signal. When the buffer unasserts the CTS signal, the transfer mechanism controls the output flow by suspending the transmission.
3XON/XOFF and RTS/CTS—Uses the XON and XOFF characters, the RTS output signal, and the CTS input signal to perform flow control. When the receiving buffer is almost full, the transfer mechanism controls the input flow by sending XOFF and unasserting the RTS signal. When the buffer receives XOFF, the transfer mechanism controls the output flow by suspending transmission.
4DTR/DSR—Uses the DTR output signal and the DSR input signal to perform flow control. When the receiving buffer is almost full, the transfer mechanism controls the input flow by unasserting the DTR signal. When the buffer unasserts the DSR signal, the transfer mechanism controls the output flow by suspending the transmission.
5XON/XOFF and DTR/DSR—Uses the XON and XOFF characters, the DTR output signal, and the DSR input signal to perform flow control. When the receiving buffer is almost full, the transfer mechanism controls the input flow by sending XOFF and unasserting the DTR signal. When the buffer receives XOFF and unasserts the DSR signal, the transfer mechanism controls the output flow by suspending transmission.
serial master instance returns a serial Modbus master instance.
error out contains error information. This output provides standard error out functionality.

Create Master Instance (TCP)

address specifies the TCP/IP address of the Modbus slave with which you want to communicate. The Modbus slave can be a Modbus slave you create or a third-party Modbus slave. If you want to communicate with a third-party Modbus slave, check the documentation for the Modbus slave to find its address.
port specifies the TCP port of the Modbus slave with which you want to communicate. The Modbus slave can be a Modbus slave you create or a third-party Modbus slave. If you want to communicate with a third-party Modbus slave, check the documentation for the Modbus slave to find its port. The default is 502.
error in describes error conditions that occur before this node runs. This input provides standard error in functionality.
TCP master instance returns a TCP Modbus master instance.
error out contains error information. This output provides standard error out functionality.

Examples

Refer to the following VIs for examples of using the Create Master Instance VI:

  • labview\examples\Data Communication\Modbus\ModbusLibrary\Modbus Library.lvproj
  • labview\examples\Data Communication\Modbus\Redundant Modbus Masters\Redundant Modbus Masters.lvproj

WAS THIS ARTICLE HELPFUL?

Not Helpful