LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

timing probelm..

Hi All.
my question might be so basic but it confuses me. As u can see from attached file, i have a ramping machine. After each output of the machine, i wait certain time (wait milisecond vi in the flat structure) and write new value. So total time interval between 2 output should be addition of value that is in the flat structure and timing value of the main loop. But, for instance,  when i set both of them to 10 sec,  time interval between 2 outputs are not 20 sec. that is 10 sec! which confuses me.
could u please have a look, what is the problem?
thanks
0 Kudos
Message 1 of 9
(4,292 Views)
Hi looser,

both 'wait' operations run in parallel, as there is no data dependency between them...
You have to define when to wait for 10s for the first time and when for the next time!

Good advice:
Create a subvi containing a wait function and additionally error in/out. You will need this very often - in your example you can use this two times!

Message Edited by GerdW on 04-20-2007 05:02 PM

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 9
(4,275 Views)
The delay in the flat sequence changes how long it takes to execute a single iteration of the code inside the while loop.  The other delay controls the minimum delay between iterations of the loop.  The two times are not cumulative. 
 
Remove the delay inside the flat sequence.  You don't need it.  Adjust the other delay to the desired time interval.
0 Kudos
Message 3 of 9
(4,271 Views)
I thought that when inserted middle of the 2 other vis,  the wait milisecond in the flat structure with eroor cluster behaves like a vi which waits between 2 other vis. This is actually what i want to do.  i modified the attached file showing my intention..
Is it not proper?
thanks
0 Kudos
Message 4 of 9
(4,261 Views)
but i used the erroor cluster to avoid parallel execution. What i thought is  that first, the one which is in the flat structure is executed , and whenever first iteration finishes then other one is executed..
isnt it in this way?
0 Kudos
Message 5 of 9
(4,260 Views)
Your lower Wait statement will start as soon as the iteration of the loop starts and will run in parallel with all the other code above it.
The loop iteration is done once everything in it has finished, so unless the upper code takes more than 10 seconds, the loop rate will be entirely determined by the lower wait.
 
Run your VI with execution highlighting and you'll probably see. It's all in the dataflow! 🙂

Message Edited by altenbach on 04-20-2007 09:36 AM

0 Kudos
Message 6 of 9
(4,260 Views)
then, what is the trick so as to set a certain time between 2 vis as processing in the code, as determining the loop rate with lower timing?
0 Kudos
Message 7 of 9
(4,252 Views)
No, your upper code is correct and will introduce a 1sec delay between writing and reading. The datadependency of the erro cluster together with the sequence frames will force the correct sequential execution order. I am just clarifying that the total loop time will not be the sum of the two timers as you initially thought in the first post.
 
For simplicity, you can use a single multiframe sequence. BTW, the sequence frame you have all the way in the left in your loop serves no purpose because dataflow determines the same execution order.

Message Edited by altenbach on 04-20-2007 10:54 AM

Message 8 of 9
(4,241 Views)
thanks Altenbach.

0 Kudos
Message 9 of 9
(4,226 Views)