LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Execution stops but VI doesn't?

If I had control over removing the file later I would certainly upload it. Unfortunately I must leave that to 'last resort', although I realize I need to help you for you to help me(!).
 
Thanks for the quick responses!
v2009 devel. w/RT
0 Kudos
Message 11 of 19
(1,226 Views)
That's a good question. That variable was a regular Global up until a few days ago, when I attended an NI-Basics-II course. The instructor said that if we really needed/wanted to use a Global variable, he would suggest just using the Single-Scope. His reasoning was that they can easily be converted to network-published down the road if needed via the Project manager. I *specifically* asked if the Single-Scope variables incurred any additional memory/overhead and he said 'no'.
 
This project will eventually be converted to a RT target so it seemed like a good idea to try out something simple I hadn't used before.
 
 
v2009 devel. w/RT
0 Kudos
Message 12 of 19
(1,217 Views)
Jamie,

I am using Safari, and found an expansion tool after I wrote.

The while loop with the event case only iterates when an event occurs. If there is a timeout event as someone suggested, then the loop will iterate when the timeout expires, otherwise it will sit and wait for an event. The loop does execute in parallel with the others, but like all LV elements, it uses dataflow to determine execution. If no event occurs, no "data flows" and nothing happens. The event case was introduced to provide a means of responding to user actions (like pushing a button or entering data) without requiring CPU resources to continually poll the controls.

Lynn
0 Kudos
Message 13 of 19
(1,216 Views)
Lynn,
 
Ah, this was a gross mis-understanding of the event structure then. I knew that it relied on the events generated by Windows; however I thought it was a matter of 'polling for events' rather than 'polling for data'.
 
I think the timeout would be better served for some other purpose. I have simply added a case for the stop boolean. Within I read the control, write to WideStop, and pass the bool out a tunel to the while loop's Stop terminal.
 
All executes well! Thanks so much guys/gals, you've been great!
v2009 devel. w/RT
0 Kudos
Message 14 of 19
(1,213 Views)


8bitbanger wrote:
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(?)

No, Lynn is correct here. That's your problem.
 
Your event loop only iterates when the event fires. For this loop to stop, three things must happen:
  1. The global stop must turn TRUE.
  2. One of the events must fire, allowing the loop to go to the next iteration. Since you are reading the global in parallel to the event structure, the loop will iterate once more because long ago at the beginning od the current iteration when the global value was read it was still FALSE. In the next iteration, it will read the TRUE and make the loop ready to stop once all code in it has completed.
  3. One of the event must fire once more so the event structure can complete and the loop can stop.

Solution: create an event for value change of the stop button and wire the new value from the event terminal to the termination terminal. Now this terminal received a fresh value from inside the event case.

EDIT: Ahh, you solved the problem already. 🙂


Message Edited by altenbach on 03-25-2008 07:18 AM
0 Kudos
Message 15 of 19
(1,210 Views)
Ha, sorry! I'm sure it wasn't in vein, as someone else will likely have it this problem.
 
To the next person: the above wiring was the problem.
 
Below is a solution:
 
Where I *was* reading the control, further down the program, I now replaced with a Single-Scope.
 
I am still interested in the subject of the Global vs Single-Scope vars and their overheat/caveats, but I'll search around rather than cluttering the thread.
 
Kindly,
Jamie
 
v2009 devel. w/RT
0 Kudos
Message 16 of 19
(1,202 Views)
PS - do I need to check a 'Question Answered' button or something similar to close the thread? I don't see any.
v2009 devel. w/RT
0 Kudos
Message 17 of 19
(1,191 Views)
No, there's no "Question Answered" button. Here discussions go on forever. Smiley Very Happy
Message 18 of 19
(1,162 Views)
OTOH, once you have a certain number of posts, you can rate answers. 🙂
Message 19 of 19
(1,148 Views)