LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Stop a sequence with a callback

Hello,

I have a piece of code which establish a communication with a GSM-modem. To start the communication a command from a menu must be chosen. Afterwards a new panel is opened, showing the state of the communication.

Now I want to interrupt the communication with an Escape button on this panel. The problem is, that the program does not react ifa mouse clock is made on the button, unless he communication process is finished.

How can I solve this problem?

Thank you

Michael
0 Kudos
Message 1 of 2
(2,635 Views)
If you communication is synchronous (one function that blocks and doesn't return until the comm is over) then you will have to do it in another thread and use multithreaded programming. See the white paper on multithreaded programming in CVI under cvi\bin\MultithreadingOverview.pdf.

If the communication is asynchronous and you are calling it in a loop, you can insert a call to ProcessSystemEvents() in the loop and it will continue to process messages and respond to the UI.

Best Regards,

Chris Matthews
National Instruments
Message 2 of 2
(2,635 Views)