LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

ramp a voltage and/or current to a Fieldpoint.

I have a program that uses a %power number and a time to create a ramp using Fieldpoint. I cannot figure out a way to simply tell the fieldpoint AO module to increase the output over a set amount of time until the setpoint is reached. This should be a simple function, but I am having a terrible time with it.

Example: 25% power over a 2 minute period. At the end of the ramp, I want the power to hold at its current postion. So using a voltage output, I would increase the voltage over 2 minutes until an output of 2.5v is present.

How do I communicate that to labview and fieldpoint??
0 Kudos
Message 1 of 10
(3,914 Views)
There is a VI called Ramp Pattern on the Signal Processing>Signal Generation palette (not in base version). Specify a start and end value and number of samples, and it will create an array. Since you want to specify time, you'll have to determine how big your step size should be. So if you want to step it every second, you calculate the number of samples required for the overall time. At every second for two minutes, you'll have 120 samples. If you want to step it every 500ms, you'll have 240 samples Once the array is created, then pass if to a for loop with your AO in it. Have a wait inside wired to your step size (i.e. 1 second).
Message 2 of 10
(3,900 Views)
Thank you for your help. That is close to what I wanted, but still one problems remains. This ramp function is a small portion of a larger application. By using the FOR loop, my program gets "stuck" in that FOR loop until it is complete, which means that none of my other functions execute until the FOR loop finishes. Is it possible to do this same thing without the use of a loop? My overall application is in a while loop, possibly I could somehow use it?
0 Kudos
Message 3 of 10
(3,886 Views)
Of course. The ramp pattern could be outside the while loop and with each iteration you could send a new value to the hardware. You could wire the iteration terminal of the while loop to an index array function or you could autoindex the ramp array through the while loop.
Message 4 of 10
(3,882 Views)
That is still not really an option for me. I am using Event driven programming where I have an event structure inside a while loop. If the loop terminates, the entire application terminates with it. So I can't do much outside of the loop. The data for the ramp is not available until one of the events is executed. I need to ramp the voltage from within the while loop, and allow other operations in the loop to execute at the same time (ie. timer, and hardware indicators) I will also have multiple ramps that need to be generated. The program is running consecutive steps where the power ramp may change with each step, or stay the same.
0 Kudos
Message 5 of 10
(3,871 Views)
Then you can create the ramp in one of the events and pass it to another event or other part of the while loop via a shift register. There are other mechanisms to pass data. There are queues and even local variables. If you post your VI, someone could probably give you exact details on how to implement it.
0 Kudos
Message 6 of 10
(3,860 Views)
I have posted my VI. I know it isn't very pretty, but I am unexperienced and just trying to muddle my way through this program. The Ramp function needs to take place in the "timeout" section of the event structure and automatically update with the current step #. This program will run unattended for 2-3 days at a time.
0 Kudos
Message 7 of 10
(3,856 Views)
Hi mdstitt,

By implementing the code that Dennis created for you into your VI, you can't use the Auto Indexing feature of the For Loop, as shown in his example. Instead, use the Index Array function connected to an index value that only increases when the Event Loop times out:



Please try out this solution and let us know your results, thanks.

Have fun!

Message Edited by Philip C. on 06-13-2005 09:53 PM

- Philip Courtois, Thinkbot Solutions

Thinkbot Solutions
0 Kudos
Message 8 of 10
(3,852 Views)
This still will not work. If the ramp VI is outside of the loop, it will never get the values which are generated by another event inside the loop. I also need to automatically generate a new ramp at the beginning of another step, which will have new values for time, begin, and end points. I cannot have any of this functionality outside of my overall loop, but it will not work inside the loop. I think I need to pursue other options for ramping rather than the Ramp VI, or I need to stop programming because I obviously do not know what I am doing!
0 Kudos
Message 9 of 10
(3,842 Views)
I don't think you need to give up yet. As I said, you could put the ramp inside the event that generates the values you need and pass the array to another event with a shift register. You could pass the start/stop values via a shift register to the event where you want to do the actual ramping and have ramp VI there. You could pass the start/stop values or the array to a separate while loop with a queue or local variable. The separate while loop would do tha actual ramping. A separate while loop would have the advantage of running in parallel to your main event loop. Your main event loop would continue to run and respond while the secondaray while loop is busy sending out the ramp.
Message 10 of 10
(3,839 Views)