Overview
The RS232 signal detect.vi reads and returns the status of the RS232 serial lines.
Description
The vi calls an instr property node with Modem Line Settings. The status of the lines are displayed in a color coded cluster of booleans. Yellow represents an incoming signal, green represents an outgoing signal. Light color represents ON state, dark color OFF. You can force the DTR and RTS lines to ON or OFF. The Receive Data (RXD) and Transmit Data (TXD) lines status are not detected by the vi but transfered from the calling vi. The calling vi will read the port and call the sub vi with RXD = TRUE if data were received. The calling vi will call the sub vi with TXD = TRUE if the calling vi is about to send data.
A calling vi is attached to illustrate how the sub vi can be intergated with code.
Steps to Implement or Execute Code
Requirements
Software: Labview 8.5
Hardware: PC
Additional Images or Views
RS232 signal detector.vi front panel
RS232 signal detector.vi block diagram
Call parameters:
COM Port - COM port number
Set DTR/RTS - Cluster of wanted DTR and RTS settings
0: Set to off
1: Set to on
2: Ignore. Don't change state
RXD/TXD - Current status of receive and transmit lines
Error In - Calling vi's COM port error status
Return parameters:
COM Port 2 - Same as COM Port
Signal lines - Cluster of signal lines status
Error Out - COM Port error status
RS232 Calling vi.vi front panel
RS232 Calling vi.vi block diagram
Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.