MB Serial Init.vi

Modbus LabVIEW VI

MB Serial Init.vi

Initializes the serial port specified by VISA resource name to the specified settings. Wire data to the VISA resource name input to determine the polymorphic instance to use or manually select the instance.

Mode is used to select which type of MODBUS frame to use. For MB Serial Init.vi, this affects the number of data bits the serial port uses.

RTU Data is represented in binary format (8 data bits).

ASCII
Data is represented in ASCII, so it is human readable (7 data bits).

VISA resource name specifies the resource to be opened. This control also specifies the session and class. For more information about VISA resource names, refer to the NI-VISA Help.
Baud Rate is the rate of transmission. The default is 9600.
Parity specifies the parity used for every frame to be transmitted or received. This input accepts the following values:
0 No parity (default)
1 Odd parity
2 Even parity
3 Mark parity
4 Space parity
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.
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.
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.
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.
Flow Control sets the type of control the transfer mechanism uses. This input accepts the following values:
0 None (default)—The transfer mechanism does not use flow control. Buffers on both sides of the connection are assumed to be large enough to hold all data transferred.
1 XON/XOFF—The transfer mechanism uses the XON and XOFF characters to perform flow control. The transfer mechanism controls input flow by sending XOFF when the receive buffer is nearly full, and it controls the output flow by suspending transmission when XOFF is received.
2 RTS/CTS—The transfer mechanism uses the RTS output signal and the CTS input signal to perform flow control. The transfer mechanism controls input flow by unasserting the RTS signal when the receive buffer is nearly full, and it controls output flow by suspending the transmission when the CTS signal is unasserted.
3 XON/XOFF and RTS/CTS—The transfer mechanism uses the XON and XOFF characters and the RTS output signal and CTS input signal to perform flow control. The transfer mechanism controls input flow by sending XOFF and unasserting the RTS signal when the receive buffer is nearly full, and it controls the output flow by suspending transmission when XOFF is received and the CTS is unasserted.
4 DTR/DSR—The transfer mechanism uses the DTR output signal and the DSR input signal to perform flow control. The transfer mechanism controls input flow by unasserting the DTR signal when the receive buffer is nearly full, and it controls output flow by suspending the transmission when the DSR signal is unasserted.
5 XON/XOFF and DTR/DSR—The transfer mechanism uses the XON and XOFF characters and the DTR output signal and DSR input signal to perform flow control. The transfer mechanism controls input flow by sending XOFF and unasserting the DTR signal when the receive buffer is nearly full, and it controls the output flow by suspending transmission when XOFF is received and the DSR signal is unasserted.
Timeout specifies the maximum time period, in milliseconds, that the VI waits for the slave's response before throwing an error.
VISA resource name out is the resource to which a VISA session is opened and its class. The class matches that of the VISA resource name input. For more information about VISA resource names, refer to the NI-VISA Help.
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.
status is TRUE (X) if an error occurred or FALSE (checkmark) to indicate a warning or that no error occurred.
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.
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.