Overview
This examples tests any serial COM port installed on the machine.
Description
This LabVIEW VI verifies the operation of your serial port hardware. You will need LabVIEW, standard 9-pin serial cable, and some wire or a paperclip. Connect the serial cable to your serial port and then short the transmit and receive pins of the cable with the wire. For an RS-232 cable you must short pin 2 to pin 3. For an RS-485 cable you must short pin 4 to pin 8 and pin 5 to pin 9.
Once everything is connected and your cable is shorted, run the Loopback.VI. This sends out a string and if your hardware is working correctly then you should receive that same message back.
Requirements
Hardware: PC/Laptop with Serial COM port (RS-232 or RS-422/485), Serial cable (RS-232 or RS-422/485) Software: LabVIEW Full Development System 2012 or compatible, NI-VISA
Steps to Implement or Execute Code
Additional Information or References
VI Code Screenshot*
*The NIVerified version of this code simply flattens the sequence structure for readability. Rewriting this to use the newer VISA Serial API is still recommended.
**The code for this example has been edited to meet the new Community Example Style Guidelines.**
Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.
Hi there!
I see you used some vi's in the serial.llb file in C:\Program Files\National Instruments\LabVIEW 2010\vi.lib\Instr\serial.llb. But I wonder how can you find all of them because they do not appear on the functions palette. Do we have some way to get them all displayed in the function palette. I tried copying them to the user library folder but it doesn't work.
Thanks!
These VIs use the old serial port LabVIEW drivers. They really should be rewritten using the VISA drivers instead.