LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Execution stops but VI doesn't?

Hi Folks,
 
I have a project here that doesn't want to stop after it has completed execution. When I hit the 'stop' button in my program, pull up the Perf/Mem profile, and I see that nothing is running, at least actively. If I turn on highlight execution, that does nothing. If I pause, the single step buttons are greyed.
 
Any thoughts? Sorry that I have to upload a screen-shot (mind the mess) but uploading the vi would likely be frowned upon. Can anyone spot any glaring problems? BTW the Terminate Execution case sequence is shown below the main state machine.
 
Kind Regards,
Jamie


Message Edited by 8bitbanger on 03-25-2008 08:25 AM
v2009 devel. w/RT
0 Kudos
Message 1 of 19
(3,647 Views)
PS - the 'Stop Program' button is greyed and disabled in all other states but 'Idle'. I have tried latched and switched actions.
 
 
Jamie
v2009 devel. w/RT
0 Kudos
Message 2 of 19
(3,644 Views)
your indicators are in an infinite loop
 
also, your event structure will wait until it has a last event to handle.  the loop it's in won't iterate again, but the event structure itself will wait until it has a chance to operate.  you can solve that by adding a blank timeout case of 100ms or whatever.


Message Edited by JeffOverton on 03-25-2008 09:33 AM
0 Kudos
Message 3 of 19
(3,634 Views)

Hi 8bitbanger,

did you try it with the "highlight function"? Which part doesn´t stop?

Mike

0 Kudos
Message 4 of 19
(3,627 Views)
@Jeff the "limit functions" loop runs only one time.
 
Mike
0 Kudos
Message 5 of 19
(3,624 Views)
Jamie,

It is hard to tell from the picture you posted because the scale makes everything small. I suspect that the problem is the event case in the loop in the upper left part of the image. The WideStop global (? I think) may be set but the loop will not iterate and test the stop until an event occurs. What other events are there besides the one shown? It might be best to create a Stop event case and put the Stop Program button in that case and set the global there.

I prefer to avoid global and local variables because of the possibility of race conditions. I usually use queues or Action Engines to pass data between parallel loops.

Lynn
0 Kudos
Message 6 of 19
(3,621 Views)

Hi Jeff,

Those lonesome indicators are just for future features: I just left them in to remind me.

Also I'm not sure that I understand what you mean Re: the case structure. It was my understanding that once called, the structure should execture the appropriate case, and once all outputs are satisfied, complete.

Mike: yes I tried the highlight execution (after stopping). Nothing happens. There is no execution actually going on, that I can see anyway. Yet the VI icon still says 'running'. I guess the problem is I don't know which part hasn't stopped. None of the sub-vi's on the attached panel indicate that they are running.

v2009 devel. w/RT
0 Kudos
Message 7 of 19
(3,619 Views)
I suggest you post the VI instead of the pictures. Looking at the jpg is very difficult to look at it. I find it very confusing.
0 Kudos
Message 8 of 19
(3,614 Views)
Hi Lynn,
 
FYI: Internet explorer is likely shrinking the image to fit your browser window. Hover over the image until you see the toolbar in the upper left. Look down in the lower-right corner, and you should see an 'expand image' button appear.
 
The event case up there handles some configuration vi's. Very basic, just functional VI's really. I was under the impression that the while loop encompassing the Event cast structure should execute in parallel with the others, continuously(?)
 
Your suggestion to configure the Stop boolean control as an event seems to be a good starting point.
 
Worth noting I am doing my best to work away from Global's and variables in general. It is getting better, this top-level VI was a nest of case structures.
 
Thanks kindly,
Jamie
v2009 devel. w/RT
0 Kudos
Message 9 of 19
(3,612 Views)
Just out of curiosity: Is there any reason you're using a shared variable as opposed to a "regular" global variable. I can see what you're trying to do, and it seems that a "regular" global variable would suffice, and be less overhead than a shared variable.
0 Kudos
Message 10 of 19
(3,601 Views)