Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Ramp a value to a target value at a specified rate.

Hi,

 

I am trying to reach a target value at a specified rate (say at the rate of 0.2 per minute until it reaches 10) without inserting the loop time delay vi. I do not want to delay the loop time. I need the loop to run as fast as it can for my PID control.

 

I have written the vi for increasing the variable to the target value but it seems I am missing something. I tested the logic in debug mode and the logic seems good to me but when I run the vi the target value is reached instantaneously.

 

I have attached the vi, can someone please tell me what am I missing here?

 

Thanks.

0 Kudos
Message 1 of 5
(3,370 Views)

Good Afternoon sharmaa,

 

Is this ramp the setpoint for the PID control or is it an independent function?  If it is independent, put the ramp and the PID in parallel loops so they can run at their own rates.

 

Either way, you can use the iteration count to decide when to change the output value because you know how fast the loop will run.

 

If you are using Emulation mode as your debug mode, then the timing will not accurate because it only tests logic.

0 Kudos
Message 2 of 5
(3,343 Views)

Hi AE Charlie,

 

Thank you for your reply.

 

The ramp is the setpoint for the PID control.

 

How will I know how fast the Loop is going to run unless I have a timing VI? Is there a way? If so please do let me know. I am new to Labview. I wanted to avoid the timing VI in the loop, but if I have to place that there then I can do as you have suggested.

 

Thanks,

Aashish 

 

 

0 Kudos
Message 3 of 5
(3,328 Views)

Good Morning Aashish,

 

You will need to use a timing VI or a Timed Loop (in the Structures palette) to set how fast the loop is running.

 

If you want the loop to run as fast as possible and simply monitor the loop rate, you can use the tick count (ms) VI.  There are very few cases when you would want a loop on your PC VI without some kind of timing.  Timing VIs allow your computer to properly assign resources so that all programs can run smoothly together.

Message 4 of 5
(3,318 Views)
Thanks a lot. I think I wll use one of the timing VIs then.
0 Kudos
Message 5 of 5
(3,298 Views)