12-03-2009 05:44 PM
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.
Solved! Go to Solution.
12-03-2009 06:59 PM
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.
12-04-2009 09:54 AM
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.