I am trying to run one VI that acts as an intermediate interface (it is not the main interface, a subvi to the main interface) and when I press the Start Test (see pic 1 ) it will start to aquire data and display it. Now when it is displaying, it will also open a subvi to display the gages (see pic).
the gages subvi opens on the second monitor and the intermediate interface is on the other monitor. This works great, until I try to stop the test, using the stop test button (attached to the stop of the wqhile loop).
It seems like the focus of the vi is switching rapidly from the interface and the gage vi and not allowing me to stop the test using the stop test button (or any other button for that matter). I have to abort in order to stop taking data. Even in highlight execution mode, I cannot click the stop button 9it never depresses when i click the mouse on it)
do I need to use the Vi server or some other dynamic caller to load the subvi in order to accomplish my task, or will my current setup work with some modifications? Is my vi flawed in that I cant stop the data aquire while loop using the button in an event structure (will it read teh stop test button only when it enters the event and not again??) and i need to stop it progmatically instead of the button.
It is difficult to tell for sure from the picture - too many parts that I cannot access - but I will toss out a some suggestions.
It might be better to move the acquisition outside the event structure. As a general rule you don't want anything inside the structure which will take more time to execute than the shortest time between events. (Also, check to see if Disable Panel until Case completes is selected in the Event setup). Make it a parallel loop which gets a "Start Test" command from the event structure via a queue. Put the Stop button in a Stop: Value Changed event case and send the "Stop" command via the same queue.
Similarly, send data and the Stop command to the Gage Display VI via another queue. The Gage Display VI would also run as a parallel, independent loop. That way, acquisition and display timing are independent of each other.
Some people use the error generated by the release of the queues as a Stop flag. I prefer to send a formal "Stop" command and often have a status queue in the reverse direction that infomrs the main loop that the subsidiary loops have stopped before the main loop quits.