LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

peculiar behavior from event-driven queued state machine

I did put a probe on the notifier in the subroutine.  That's how I know that it's not being registered.  It does register in the relevant case in the main VI.  Go figure.

The bottom loop in the subroutine has to stop when the upper loop stops.  The upper loop will stop if either the current finishes ramping, an error occurs, or it receives a notifier from the main VI.  The upper loop writes to an additional notifier when it stops.  The bottom loop receives that notification and terminates.  So there are actually two notifiers in the upper loop...it's receiving one and writing another.  It seemed preferable to having local variables all over the place, as the same notifier can easily be used in the different execution cases and local variables tend to get messy in state machines.

Now that I think about it a bit further, I suppose I could put the continuous DAQ in a separate loop and perhaps use a queue or something to pass the relevant values into the subroutine for the necessary value checks.  At the moment a resource competition won't exist because those tasks are used only in the Get Data loop and in the subroutine, and the subroutine is only called from the Drivers On and Set Current cases in the main VI.  If the main VI is in one of those cases, then by definition it can't be in the Get Data loop.  But I do see and acknowledge your point.

Thanks again,

d

0 Kudos
Message 11 of 11
(411 Views)