LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

ramp up, and then down

Hi there guys,

I'm creating a voltage ramper and can quite easily put together a VI which, having been given the Start, Stop and Step Size parameters, will calculate the number of steps and quite happily ramp itself up or down depending on the values input by the user.  However, I actually need to ramp up, and then back down again in the same sweep (i.e. -100 V to 100 V, and then back from 100 V to -100V).

I'm toying with the idea of using a comparison function, which will switch the sign of the step (that is, from, say + 1 V per step to - 1 V per step) once the first half of the sweep has been completed, but feel that this may not be terrible efficient (or, for that matter, good).

Anyone have any better ideas?  I'll be grateful for anything you can come up with.

(I'm using LabView 7.1 Express by the way).

0 Kudos
Message 1 of 6
(3,662 Views)
Create an array of the steps on the first pass. Use the Reverse 1D Array function and play back the steps in reverse order.

Lynn
Message 2 of 6
(3,662 Views)
I like Lynn's suggestion of reversing the array. There is a function in LV called Ramp Pattern, the reversing of the array could be executed directly after this function.

Good work!

Stuart
0 Kudos
Message 3 of 6
(3,642 Views)
Thanks guys, I'll give that one a go.  I assume you mean I should use auto-indexing in the first FOR loop to create an array, reverse this array, and then feed this array into the 'ramp down' FOR loop?

Nio
0 Kudos
Message 4 of 6
(3,631 Views)
The neat thing about the ramp function, is that it outputs an array.  Just reverse it and build the full array (select "concantinate" on the contex menu if it gives you a 2D array).


Message Edited by jasonhill on 06-02-2006 09:20 AM

Message 5 of 6
(3,622 Views)
Nice work Jason!!
0 Kudos
Message 6 of 6
(3,617 Views)