LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

How To Clear Comm Error using CVI RS232 functions

Hello, I'm using CVI 7.0.0, and have a question about how can I clear a RS232 communication errors, using CVI RS232 function calls ?
GetCommStat and ReturnRS232Err functions can identify errors but how can one clear them ?
In SDK there is ClearCommError function, that can identify and clear the communctions error (break, parity, framing), is there a similar CVI RS232 function ?
 
Regards
0 Kudos
Message 1 of 4
(5,574 Views)
Is there a reason you need to explicitly clear the error state?  It will be cleared the next time a com function successfully completes.  If you need to clear the error state, you can just call some trivial com operation that you know will succeed, or you can call GetSystemComHandle to get the Windows handle to the open com port, then call ClearCommError.

Mert A.
National Instruments
0 Kudos
Message 2 of 4
(5,562 Views)
One test application that we developed, has about 10% failure rate due to some communication issues, I suspect that during DUT power-up, the Rx line of the COM port will inadvertenly recive some transitions, that might be interpreted as a start condition for a byte. This would generate a framing error, that I would like to clear after the power-up is complete, using the ClearCommError, to be sure that serial port traffic that will follow can be recieved.
 
Thanks for the tip
 
Regards
0 Kudos
Message 3 of 4
(5,533 Views)
I have seen this as well, poorly implemented devices will spurt out junk on the data lines when they power up, and it winds up goofing the computer's comm port.

I have always been able to get past it by clearing the input queue, maybe I was just lucky.

Menchar
0 Kudos
Message 4 of 4
(5,512 Views)