LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Gradual increase in voltage output

Solved!
Go to solution

I am using LabJack U12's EAnalogOut.vi to set the U12's AO0 to 4 volts. The instantaneous change in voltage output is causing problems with the motor I am using, so I ask: does anyone have insight into how I could program that into the current diagram. It needs to gradually move up to 4 volts when first executed in the while loop, and then gradually down to 2.5 volts.

 

 True.png

0 Kudos
Message 1 of 3
(2,977 Views)
Solution
Accepted by topic author OriBre1

Instead of having a value of 4 go right into the analog output VI, you need to have your loop change the value in smaller steps.  Have wait function in that loop.  Use a shift register to feed into it and increment that shift register in small steps.  Between the wait timer and the number of steps and size of steps you define will determin how long it takes to ramp to 4 volts.  And of course more steps with smaller increments will be a smoother ramp.

Message 2 of 3
(2,958 Views)

Also, note that within your loop you don't know if the AO or AI will happen first.  I suggest you wire the error cluster output from 1 to the error cluster input of the other.

 

You could also use the error cluster dataflow to replace your frame structure.  Dataflow can be a little tricky for new LabVIEW programmers, but it is important to understand what controls the order of execution in a LabVIEW program.

 

Looking at our examples you will see that we always pass the error cluster from call to call.  And in while loops we watch the error cluster so that if there is an error it stops the loop.  Right now you have no error handling.

Message 3 of 3
(2,917 Views)