LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

treat an event and doesn´t return until it is treated

Hi,

 

When my program is running inside this functions:

 

CmtScheduleThreadPoolFunction (DEFAULT_THREAD_POOL_HANDLE, Myfunction, (void *) &DataMyfunction, &threadID);
CmtWaitForThreadPoolFunctionCompletion(DEFAULT_THREAD_POOL_HANDLE,threadID,OPT_TP_PROCESS_EVENTS_WHILE_WAITING);

 

and when an event occurs (like a SRQ set by an instrument) I treat it through this function:

 

ViStatus _VI_FUNCH SRQ_Callback(ViSession vi, ViEventType etype, ViEvent eventContext, ViAddr userHandle);

 

but the behaviour is not like i expected.
I expect that when an event occur
and the execution goes into SRQ_Callback function,
i would like the execution not return to the next sentence
before the event until SRQ_Callback returns.

 

But what happens is that execution go into SRQ_Callback function,
returns to the next sentence before the event, go back to the SRQ_Callback function,
and so on...

 

like two threads running in parallel and sharing the microprocessor.

 

What must i do, when an event occur,
the execution goes into SRQ_Callback function and doesn´t
return until this function finish?

 

thanks

 

 

0 Kudos
Message 1 of 1
(2,577 Views)