Serial Port Init

Initializes the selected serial port to the specified settings.

flow control etc. contains the following parameters.
input XON/XOFF is a software handshaking protocol you can use to avoid overflowing serial port buffers. The default value is FALSE.
input HW Handshake On the PC and SPARCstation, Input HW Handshake corresponds to Request To Send (RTS) handshaking. The default value is FALSE.
input alt HW HShk On the PC, Input alt HW HShk corresponds to Data Terminal Ready (DTR) handshaking. On the SPARCstation, this parameter is ignored. The default value is FALSE.
Output XON/XOFF is a software handshaking protocol you can use to avoid overflowing serial port buffers. The default value is FALSE.
Output HW Handshake On the PC and SPARCstation, Output HW Handshake corresponds to Clear to Send (CTS) handshaking. The default value is FALSE.
output alt HW HShk On the PC, Output alt HW HShk corresponds to Data Set Ready (DSR) handshaking. On the SPARCstation, this parameter is ignored. The default value is FALSE.
XOFF byte is the byte used for XOFF (^S). The default value is 0x13.
XON byte is the byte used for XON (^Q). The default value is 0x11.
parity error byte If the high byte is non-zero, the low byte is the character that is used to replace any parity errors found when parity is enabled. The default value is 0.
buffer size indicates the size of the input and output buffers the VI allocates for communication through the specified port. You might need to use larger buffers for large data transfers. The buffer size is in bytes.

The default value is 0.

port number varies by platform. The parameters for serial port numbers depend on the whether you use Macintosh, Windows, or Unix.

On the Macintosh, port 0 is the modem, using the drivers .ain and .aout. Port 1 is the printer, using the drivers .bin and .bout. You must install other boards, with the accompanying drivers, to get more ports on a Macintosh. Additional serial port numbers are assigned dynamically.

When you use the serial port VIs under Windows, port number can have the values in the following table.

0: COM1 5: COM6 10: LPT1
1: COM2 6: COM7 11: LPT2
2: COM3 7: COM8 12: LPT3
3: COM4 8: COM9 13: LPT4
4: COM5
Under Solaris 2, port 0 refers to /dev/cua/a, 1 to /dev/cua/b, and so on.

Because other vendor's serial port boards can have arbitrary device names, LabVIEW has developed an easy interface to keep the numbering of ports simple. A configuration option exists to tell LabVIEW how to address the serial ports. LabVIEW supports any board that uses standard UNIX devices. Some manufacturers suggest using cua rather than tty device nodes with their boards. LabVIEW can address both types of nodes.

The file .labviewrc contains the LabVIEW configuration options. Set the configuration option, labview.serialDevices, to the list of devices you intend to use to set the devices the serial port VIs use.

For example, the default is:

labview.serialDevices:/dev/ttya:/dev/ttyb:/dev/ttyc:...:/dev/ttyz.

Note  This requires that any third party serial board installation include a method of creating a standard /dev file (node) and that the user knows the name of that file.
baud rate is the rate of transmission. The default value is 9600.
data bits is the number of bits in the incoming data. The value of data bits is between five and eight. The default is 8.
stop bits is 0 for one stop bit, 1 for one-and-a-half stop bits, or 2 for two stop bits. The default is 1 bit.
parity is 0 for no parity, 1 for odd parity, 2 for even parity, 3 for mark parity, or 4 for space parity. The default value is 0.
error code is -1 if baud rate, data bits, stop bits, parity, or port number are out of range, or if the serial port could not be initialized. Check the values of baud rate, data bits, stop bits, parity, and port number. If these values are valid, verify that the serial port has been initialized.

You can connect error code to one of the error handler VIs, which describe the error and give you options on how to proceed when an error occurs.

Some error codes returned by the serial port VIs are platform-specific. Please refer to your system documentation for a list of error codes.