LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

task is done as condition for while loop stop


Hello everyone,
now I'm completely desperate, so please give me a hint...

There is a DAQ task and a while loop which has to start execution before the task (data generation) is triggered. Now how can I let the loop know when the task is done and stop it? If I wire the "task done?" terminal from the "DAQmx Is Task Done.vi" into the loop, it doesn't start execution, because it expects this missing input. I tried it with an event structure, but it seems not to recodnize the value change of "task done?" outside the loop. I tried registering that as a dynamic event, but it didn't work either; it doesn't make things better that I don't know a lot about dynamic events... Does anyone have an idea how to solve that thing?

Best regards,

Mitja
0 Kudos
Message 1 of 3
(2,601 Views)

The easiest way is to use a local variable. Create an indicator from the Task Done output, right click that indicator and select Create>>Local Variable and now you can use this to read the value of the indicator inside the loop. Once the task will finish, it will become T and stop the loop. You need to remember to reset it to F before you start running the loop, so it doesn't stop your loop the next time you run the VI.

Other options include using this indicator, but using the Value(signaling) property to update it (this will trigger a Value Change event), or some more advanced things like queues and semaphores. As said, the easiest would be the local variable.

To learn more about LabVIEW, I suggest you try searching this site and google for LabVIEW tutorials. Here and here are a couple you can start with. You can also contact your local NI office and join one of their courses.
In addition, I suggest you read the LabVIEW style guide and the LabVIEW user manual (Help>>Search the LabVIEW Bookshelf).


___________________
Try to take over the world!
0 Kudos
Message 2 of 3
(2,587 Views)
Thanks for the answer!

I'm sorry about asking boring questions without reading some more tutorials, but I intended to use Labview for writing a (presumably) not very complicated application, and I hoped the six-hours-course would be enough for that... By the way, it says exactly one sentence about local variables. Probably with some more reading before starting work I would have saved time, but you never now before, right? On the other hand, by learning-by-doing you learn a lot about how labview does NOT work. 🙂
Thanks agait for your advice, it seems to work now exactly as it should.



0 Kudos
Message 3 of 3
(2,580 Views)