LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Set then reset

Hi

Im working on a VI where im collecting data using a DAQ assistant and a trigger-task. Another VI has to "detect" when new data is collected. Is it possible to set a flag (shared variable) at the start of an while-loop, then collect the data, and then reset the variable at the end of the while loop...

I want the data-collecting VI to ping each time new data is recorded like so: ________||_________

Hope you understand what i meen...
0 Kudos
Message 1 of 4
(2,803 Views)
Look at the synchronization functions. Notifiers or semaphores may be what you are looking for. Or if you send the data from the DAQ VI via a queue and read the data in the analysis VI by dequeuing with a timeout, you will get the new data as soon as it is available. If timed out? is true, then no new data was available within the timeout period.

Lynn
0 Kudos
Message 2 of 4
(2,797 Views)
It's fairly easy to do this by just checking the value every quarter-second or so, but I'm still not clear on how to do this while the loop isn't firing (i.e. while an event structure is waiting for an event to fire).

The latter method is what you want, right? I'm still working on that myself, unfortunately.
0 Kudos
Message 3 of 4
(2,796 Views)
Thanks for the tips. nothing i could get to work anyway...

Why does everything has to be so difficult in LabVIEW? All i want to do is (written in C fx):

while(1)
{
    // Wait for new data

    SharedVariable = 1;

    // Collect new data

    SharedVariable = 0;
}

Oh well... gotta keep trying Smiley Happy
0 Kudos
Message 4 of 4
(2,774 Views)