Hy everyone,
I've got a little problem.
I have a GUI including a stripchart and a start-, stop- and quit-button. My programm writes data to the PXI-4461 an acquires data continously with the PXI-4462. I'm using the DAQmxRegisterEveryNSamplesEvent() with creating a new thread for the called function.
When the user click the start-button, the programm initialize the hole system and starts writing data to the PXI buffer.
The DAQmxRegisterEveryNSampleEvent calls every 0.2s the function in the second thread. So that the user doesn't have a chance to click the stop-button. (because I'm printing continously data to/ on the StdioPort?)
I like the user to have the possibility to stop acquiring data at any time he/ she like to. (So I need to change the focus from the StdioPort to the GUI?)
And then, when the user click the stop-button, the system should wait for the second thread to complete and quit the GUI.
I tried to use ProcessSystemEvents, ProcessDrawEvents and CmtWaitForThreadPollFunctionToComplete. But it still doesn't work properly and I don't really know where to call ProcessSystemEvents. And with the thread I've got the problem, that the thread isn't in the DEFAULT_THREAD_POLL (I think) and I don't know how to get the PoolHandle.
Do you know anything?
Thanks for help, Heike