LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

sweep voltage in bidirection

I have a program which I can use for seeping voltage between -3 to +3 voltage. I want to modify for -3 to +3 to -3. I am attaching the .vi file. Please suggest me how can I do so?

Thnaks

0 Kudos
Message 1 of 4
(2,858 Views)

Well, your program takes the number of steps and sets a for loop to run this many times. To go up and then down you will need twice as many steps, so multiply this by two before feeding to the 'N' teminal.

 

In the loop you keep track of current value in a shift register and add the step value each time. You will need to add the step value for the first half of the cycle (increasing) and then subtract it for the second half (decreasing). Decide which half you are in by comparing the 'i' value to the number of steps, and if greater you need to choose the subtract rather than the add. You can use a case statement or a 'Select' vi to make the choice.

0 Kudos
Message 2 of 4
(2,837 Views)

Personally, I would use the Ramp Pattern.vi to create two arrays (one for ramping up and another for ramping down), but combine them to get your full profile.  You then just autoindex on that array for your set points.  It would make things a lot simpler for you.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 3 of 4
(2,821 Views)

+1 Crossrulz.  Even easier is to reverse the original array assuming you always want to return to the start point. 

RampUp&Down.png

LabVIEW Pro Dev & Measurement Studio Pro (VS Pro) 2019 - Unfortunately now moving back to C#, .NET, Python due to forced change to subscription model by NI. 8^{
Message 4 of 4
(2,807 Views)