LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

How to check if receiving data from serial port

Hi,
 
Basically i have a programed so that i received data from the serial port using InstallComCallback(). In my interface i hv an led for incoming data...which lits when i start receiving data and stops when i stop reading data from comport......but say for example someone pulls the serial cable out or something....i would like the led to go off........i am hving trouble with that.... i tried using GetComStat() but no luck, maybe i am not using it correctly....
 
hope someone can help me out.
 
Thanks
 
k1_ke
0 Kudos
Message 1 of 4
(4,291 Views)
RS232Error=OpenComConfig();
RS232Error- find the corrcet error code for port not open / port errors..
 
..may be it helps
0 Kudos
Message 2 of 4
(4,281 Views)

Try: GetComLineStatus()

Function help says:

Hardware-specific information about the status of the selected port.

The status word is comprised of individual bits, each with a different meaning. This parameter is filled in with a combination of the following values:

Name Value Description
kRS_CTS_ON 0x10 The CTS (clear-to-send) signal is on.
kRS_DSR_ON 0x20 The DSR (data-set-ready) signal is on.
kRS_RING_ON 0x40 The ring indicator signal is on.
kRS_RLSD_ON 0x80 The RLSD (receive-line-signal-detect) signal is on.

Check if you see anything change on the DSR line when you disconnect the cable. If not that line is not in the cable.

0 Kudos
Message 3 of 4
(4,266 Views)
Hi guys,
 
Thanks for the replies. Well i had looked at those options but didnt use them because just incase the serial cable been used didnt have all the handshaking capabities and yeah i had also forgotton to mention that in my previous post.
 
But overall thanks for the help! i was able to solve my problem though.....i just made my own routine with my messege pops
 
Thanks
 
k1_ke
0 Kudos
Message 4 of 4
(4,256 Views)