取消
显示结果 
搜索替代 
您的意思是: 

Loop Time

Hi,
 
I am trying to make a simple vi that every n seconds does an action.
Thus, i want to monitor the time, and when te specified seconds are elapsed, the program takes action.
Can somebody tell me how to program it, with the CPU usage in mind!!!
 
Thank you very much,
Jeroen
 
 
0 项奖励
1 条消息(共 7 条)
3,862 次查看
Try the Timed Loop structure.
0 项奖励
2 条消息(共 7 条)
3,860 次查看
    If you want the period to vary dinamically you can do this sending the value to a "period" node on the right side of the timed loop.
Paul
Mechatronic engineer
Lima-Perú
0 项奖励
3 条消息(共 7 条)
3,844 次查看

You can use

-the "Wait until Next ms Multiple" but not the "Wait ms" (see Labview help for the difference)

-A event structure with a timeout.

 -A timed Loop.

0 项奖励
4 条消息(共 7 条)
3,842 次查看
Hi!
   What level of accuracy do you need? If you loosely need to execute task each second, use (as said above) "wait until next ms multiple".  If you have to wait many seconds (say, some minutes, some hours), maybe it's better and cleaner to do your action when time elapsed since last execution is n minutes.  You can do this in a loop that periodically (each second, for example) get system time, and compute time elapsed from last iteration.

   If you have RealTime, just use timed loop.

   But please, clearify how loose is timing requirement!

graziano
0 项奖励
5 条消息(共 7 条)
3,838 次查看
And for another option, just drop the Elapsed Time function into a loop and wire a case statement to the Time Has Elapsed output.
0 项奖励
6 条消息(共 7 条)
3,834 次查看
Thanks for all the reply's!!!!
 
Well, i have a certain begin value(temperature), that i want substract with a value, each n seconds. The user or program can change the time, because it depends on the diffrent condition.
Thus, you can see it as a simulation. You have a certain temperature in a chamber, you left the door opened, so you can change the time of my program to calculate the temperature after n seconds.
I think this application isn't time critical, but if it was, i can use the time loop sturcture.
So il will post my program as soon i am ready with it.
 
Thanks,
Jeroen
 
0 项奖励
7 条消息(共 7 条)
3,780 次查看