开发者

Timing a simulation in a control loop

I have a labview vi which is in a c开发者_运维技巧ontrol loop with PID . I want to insert a timer for the simulation. It should display the time of the simulation and also use that time to make changes in the control loop. It is just a simple timer but I am not sure which one and how to use them. please help me


The simplest option, if it does what you need, is probably the 'Elapsed Time' Express VI.

Alternatively you can use the Get Date/Time in Seconds function. Read this function at the start of your simulation and pass the value in to your control loop (or read it on the first loop iteration and store the value in a shift register). Inside the loop, read the same function and subtract the value from the start value; that'll give you the elapsed time in seconds. If you want a display of this value just wire it to a numeric indicator. You can set the display format of the indicator to 'relative time' if you want to show hours, minutes and seconds.


The most natural option would be to use a Timed-loop, this allows you to detect whether your code can run in the supplied time and select a hardware time clock.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜