Academic Company Events NI Developer Zone Support Solutions Products & Services Contact NI MyNI

Document Type: Example Program
NI Supported: Yes
Publish Date: Sep 6, 2006


Feedback


Yes No

Related Categories

Related Links - Developer Zone

Related Links - Products and Services

Serial Communication for LabVIEW 6.1

36 ratings | 3.39 out of 5
Print

Downloads

Filename: serial_61.llb
Requirements: View

The following examples demonstrate basic and advanced serial communication features such as reading from and writing to serial ports, setting and detecting breaks in the data line, performing diagnostic tests on your ports, and setting transceiver control modes when using a National Instruments RS-485 product.

Basic Serial Read and Write.vi - This example performs a Serial Port Read, a Serial Port Write, or a combination of these actions. The user selects the actions (read or write) on the front panel. If both are selected, the VI will write the data first, read data, and then close the VISA session that is opened to the port. This VI will wait until the specified number of bytes is received at the port. Only the number of bytes specified will be read.

Basic Serial Write and Read (2 Port).vi - This example opens two VISA resources and configures one COM port to perform a write operation and the other COM port to perform a read operation. Like the Basic Serial Write and Read VI, this VI allows you perform diagnostic tests on your ports. You can connect two of the ports using a null modem cable, which effectively connects one port's RX lines to the other port's TX lines.

Advanced Serial Read and Write.vi - This example performs a Serial Port Read, a Serial Port Write, or a combination of these actions while setting some advanced serial features like buffer size, termination characters, and XON/XOFF flow control.

Set Break.vi - This example illustrates how to introduce a break in the data line during serial communication. The VISA Serial Break VI is used to introduce a break in the data line. This VI can be run alongside the "Detect Break Event.vi" to monitor the breaks.

Detect Break Event.vi - This example illustrates how to detect a break in the data line during serial communication. This VI can be run alongside the "Set Break.vi" to introduce the breaks.

Troubleshooting Serial Line Monitor.vi - This example allows the user to monitor the states of the serial lines and to control the states of the DTR and RTS lines. This example is intended for troubleshooting purposes.

NI RS-485 Transceiver Control.vi - This example sets the RS-485 transceiver control modes for the specified port and performs a Serial Port Read, a Serial Port Write, or a combination of these actions. Note: This example will work only with National Instruments RS-485 interfaces.

Requirements


Filename: serial_61.llb

Software Requirements


Application Software: LabVIEW Full Development System 6.1
Language(s): LabVIEW

 
36 ratings | 3.39 out of 5
Print

Reader Comments | Submit a comment »

This library will help figure out how to set the property nodes for a serial port. the default termination character for most serial port transactions is a return, 0X0A. This library shows you how to change that.
- shirt@mtest.teradyne.com - Jul 10, 2004

 

Legal
This example program (this "program") was developed by a National Instruments ("NI") Applications Engineer. Although technical support of this program may be made available by National Instruments, this program may not be completely tested and verified, and NI does not guarantee its quality in any way or that NI will continue to support this program with each new revision of related products and drivers. THIS EXAMPLE PROGRAM IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND AND SUBJECT TO CERTAIN RESTRICTIONS AS MORE SPECIFICALLY SET FORTH IN NI.COM'S TERMS OF USE (http://ni.com/legal/termsofuse/unitedstates/us/).