LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

two timed loops

I would like to make a program for switching valve during data aquisition via DAQmx.
A timed looop is for data aquisition.
B loop is for switching after 10 sec.
 
B loop should check if elasped 10 sec in a delay time (maybe faster or equal to the delay of A loop).
 
How do I record the synchronized data value correctly in the time of switching?
am I right to use two timed loop for my purpose?


메시지가 05-28-2008 07:08 AM에 labmaster에 의해 편집되었음
0 Kudos
Message 1 of 8
(3,261 Views)
Hi labmaster,
i think you can do it with only one loop. You can count the elapsed time and switch the value after 10 sec.
Mike
Message 2 of 8
(3,256 Views)
Here's an example of what Mike was saying
 


Message Edited by JeffOverton on 05-28-2008 08:23 AM
Message 3 of 8
(3,251 Views)

Thank you.

I didn't describe my intention in detail.

The conditions for duration time (10 sec) are applied in several times.

on -> off -> on -> off.

0 Kudos
Message 4 of 8
(3,225 Views)
In Jeff's screenshot, in the False case a wire should pass through from left shift register to the unwired tunnel of the case structure to the right shift register.
 
Beyond that, why don't you think his code does what you want.  He just summarized the valve switching code with a comment.  That code can switch on to off or off to on.  You could maintain the current status of the valve in another shift register and swap the value in that case.  That could be a NOT function acting on a boolean value for a digital output.


Message Edited by Ravens Fan on 05-28-2008 09:24 PM
Message 5 of 8
(3,218 Views)
Dear, Ravens Fan
"why don't you think his code does what you want"
You had better not teach me.
However, originally, I asked the parallel structure of two timed loop about synchronization and controlling.
My code is used to controlling both digital output and DAC as well as some complex routine.
0 Kudos
Message 6 of 8
(3,203 Views)
You could even pull the > boolean value to run your switching.  And the DAQ reads and such can all happen in the same loop.  There's no need for a second.
0 Kudos
Message 7 of 8
(3,177 Views)
An example of how Ravens Fan suggested you could run your valve system
 


Message Edited by JeffOverton on 05-29-2008 09:05 AM
Message 8 of 8
(3,168 Views)