LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

InstallComCallback and EV_EVENT2

Hi,

 

I have a problem with InstallComCallback and special events generated by the port driver.

I'm controlling a FTDI-based device by using a virtual com port driver and the RS-232 library functions from CVI. I want to use a com-callback for a special event (EV_EVENT2) which is generated by the driver on surprise removal of the device. But InstallComCallback() doesn't accept it and returns 'invalid argument'.

So I tried to call GetSystemComHandle() and use the Windows API function WaitCommEvent(). But the documentation of WaitCommEvent() told me, that WaitCommEvent() does not return until the specified event occurs if the com port wasn't opened with FILE_FLAG_OVERLAPPED. But it seems to be opened without this flag by OpenComConfig(), so WaitCommEvent() doesn't return and my whole application stopped.

Are there any suggestions how I can handle this event without replacing all RS-232 library functions with the Windows API calls?

 

Best regards,

 

Martin Schmidt

0 Kudos
Message 1 of 2
(3,194 Views)

Hi Martin

 

I found several informations about using the ComCallback:

 

Using the RS232 Library InstallComCallback Function to Handle Events  

 

Otherway, to catch events that occur when you remove a serial device requires that you use Windows-based functionality to catch Windows events.

 

Hope that helps.

 

Kind regards

Pixar

0 Kudos
Message 2 of 2
(3,164 Views)