LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

read data at 3/4 of loop time

hello
i want to have a loop with a defined time. at the 3/4 elapsed time i want to read data and do an average from the data values.
whats the best way?
0 Kudos
Message 1 of 7
(3,147 Views)
hope it will help.

you should use a time loop which you find under structures. Than I would insert into that loop a sequence structure. the first sequence of that structure is to wait until 3 / 4 of the time. The second sequence is whatever you want.

the time loop restarts automatically after the specified period.just double-click on the edge of the loop and set the period time in ms.
For example with Period 10000ms the loop restarts after 10s again all the time and you get your data every 7,5s after the loop started.

best regards
Message 2 of 7
(3,147 Views)
Use a loop running 4 times as fast and containing a case statement. During iterations 0, 1, 2 do nothing. In iteration 3 read the data. This is a very simple state machine which calls the idle state three times and the read state once. With this structure it is easy to modify the behavior by changing when the read state is called or adding states.

Lynn
0 Kudos
Message 3 of 7
(3,147 Views)
i dont exactly understand what you mean. if i have a case structure with 4 steps and i do nothing at the first second and third one the cases were running as fast as he can.

i specefy my question.
if i had atime loop for 10 seconds i want to read data (for 200ms) at second 7,5.
and after reading the data the loop continous till the time of 10 seconds.
it is very important that the loop time is not more than 10 seconds.
0 Kudos
Message 4 of 7
(3,147 Views)
is it possible for you to make a small
example in lv7.0?
thanks
0 Kudos
Message 5 of 7
(3,147 Views)
i wait 7.5 seconds and do my measures. how can i guaranty that the loop time is exactly 10 seconds.
0 Kudos
Message 6 of 7
(3,147 Views)
Please listen carefully. I don not know which LabView(LV) version you are using. But LV 7 owns a time structure which does exactly what you want. You just have to realize my way.

Take a time structure and put a sequence structure in it.
Into the first sequence you put a wait until function.This function you have to connect with a constant (or control) and type in your preffered time. In your case 7500 (ms). In the second sequence of that sequence structure you can apply your program code to read out whatever you want.

The last step you have to do is to set the period time of the time loop.Enter 10000 for that and activate the option "keep periods". The time loop exactly times one iteration to 10seconds and only after 7,5s your code wil
l be executed.

try it out

best regards
0 Kudos
Message 7 of 7
(3,147 Views)