LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

successful using GetComLineStatus() ?

Has anyone been successful in sensing an externally applied voltage from the PC side of a COM port using GetComLineStatus() ?
Specifically, I would like to sense anytime there -5V is applied to the Ring Detect on a PC COM port, (pin 9, of DB9). kRS_RING_ON or 0x40 is the return status I am looking for when using GetComLineStatus() according to the function panel help. I have also tried using the InstallComCallback and then look for a LWRS_RING, (ring signal detected) event in the callback. Neither approach results in a response. Any Ideas?
0 Kudos
Message 1 of 9
(4,320 Views)
What version of CVI are you using?

-Logan S.
0 Kudos
Message 2 of 9
(4,306 Views)
CVI5.5.1 I also have newer versions, but I am constrained to use the older version to support existing factory testsets.
0 Kudos
Message 3 of 9
(4,306 Views)
Are you designing a multi-thread application?

Logan S.
0 Kudos
Message 4 of 9
(4,286 Views)
No, This is a single threaded app.

I have seen some success using the comcallback construct in captureing some com events. However, not the events I am expecting. i.e., I am applying signal ground to pin 5, and -5Vdc to pin 9 (ring indicator). I am expecting to see a LWRS_RING comEvent when I do this, but there is none. I wonder if my PC (a standard dell pentium III desktop, with two standard comports) has defined a ring indication differently than the standard rs232, RJ9 connector pinout for PC modem definition? In any case, a source code excerpt is attached showing three switch statments, each looking at something different: GetComStat(), GetComLineStatus, and eventMask (callback event data)
0 Kudos
Message 5 of 9
(4,270 Views)
Sorry for the cryptic responses earlier - there are known issues with the GetComLineStatus() function in multithreaded applications in CVI 5.5 that were corrected CVI 6.0, but as you are working in a single thread that should not be an issue. Would you try re-posting the sample application? For some reason it didn't go through last time.
0 Kudos
Message 6 of 9
(4,265 Views)
Logan,

This is not a complete application. Just a function, initially established by a call to InstallComCallback (COMPORT, mask, 0, 0, Comm_Event_Capture_Func, 0); Prototyped as:

void CVICALLBACK Comm_Event_Capture_Func (int portNo,int eventMask,void *callbackData);

If the attachment for the callback function does not go through, let me know, I am somewhat new to using the message boards, I would paste the text of the .c here, but am limited to 5000 characters per post...

Rick
0 Kudos
Message 7 of 9
(4,261 Views)
Sorry for the delay... I'm still checking on this for you, I'll post again as soon as I have something. Any progress on your end?
0 Kudos
Message 8 of 9
(4,228 Views)
This computer wouldn't happen to be Windows 95 would it?

There is a known bug with the Ring event in W95 that causes it not to be trapped. If CVI wraps this API, or if you are using the API directly, then this could be part of your problem.

http://support.microsoft.com/default.aspx?scid=kb;en-us;137862


Orlan
0 Kudos
Message 9 of 9
(4,210 Views)