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
- Connect some RS232 equipment to your COM port
- Open RS232 signal detector.lvlib
- Open RS232 caling.vi
- Set COM parameters before running the vi
- Run the vi
- Observe the status of the signal lines in Signal lines
- Enter a command in string to write and hit Write
- Observe that TXD flashes green
- Any answere from the instrument is displayed in read string
- Observe that RXD flashes yellow
- Force DTR high or low by swithcing the drop down in Set DTR/RTS
- Observe that DTR state swithes
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