Bytes At Serial Port

Returns in byte count the number of bytes in the input buffer of the serial port indicated in port number.

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.
byte count is the number of bytes currently queued up in the serial port buffer.
If error code is non-zero, an error occurred. 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.