LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Conditional Voltage Ramp

My goal is to ramp a voltage until a specific condition is met, and once it is met ramp the voltage downward at a different rate, what should my approach be?

 

I know how to create a ramp waveform with an array, but I need this to go on indefinitely until the condition is met so I don't see how an array could work with this.

 

Thanks a lot for the help

0 Kudos
Message 1 of 7
(3,936 Views)

Eventually you will run out of voltage.  So you can develop your ramp up from desired start to maximum capability of the voltage source, and when the 'condition' is met, then have your progam abort the ramp up (hint- for loop with a conditional terminal is one option), then you can develop your downward ramp.Hope this helps.

Good Luck.


Paul
0 Kudos
Message 2 of 7
(3,934 Views)

Example_VI_BD.png

Jim
You're entirely bonkers. But I'll tell you a secret. All the best people are. ~ Alice
For he does not know what will happen; So who can tell him when it will occur? Eccl. 8:7

Message 3 of 7
(3,913 Views)

Thanks a lot, that really helps.  Can you give me an example of what that might look like if the ramp patterns were sent to a DAQ for the voltage and the conditional terminals were associated with a condition involving electrical current values measured by the DAQ?  I'm a little confused as to how you connect the DAQ in the code, I haven't been able to find any tutorials that really deal with it.  I would think you use the DAQ assistant VI but none of the example programs I look at ever have that in them...

Thanks again for the help.

0 Kudos
Message 4 of 7
(3,890 Views)

Don't worry about the DAQ Assistant; the Example Finder is going to help you more.  I modified the Gen Voltage Update.vi to make this.  You'll need to incorporate a current measurement, but there are examples in Hardware Input and Output, DAQmx, Analog Generation, Current.

 

Gen Voltage Update_BD.png

Jim
You're entirely bonkers. But I'll tell you a secret. All the best people are. ~ Alice
For he does not know what will happen; So who can tell him when it will occur? Eccl. 8:7

Message 5 of 7
(3,862 Views)

What does the 10.00 attached to the DAQ write function do?  And also what is the difference between using a for loop with a conditional terminal and a while loop?

 

In the example you just posted there is no start task VI, why is that?  If I added in voltage and current inputs would I need to have start task VI's for them?

 

Thanks so much for the help.

 

 

0 Kudos
Message 6 of 7
(3,819 Views)

@phrygian wrote:

What does the 10.00 attached to the DAQ write function do?  


It "specifies the amount of time in seconds to wait for the VI to write all samples" (from the detailed help).


And also what is the difference between using a for loop with a conditional terminal and a while loop? 

Either is fine.  I chose to use a For Loop to make it more clear that the loop is iterating over the elements in the array.


In the example you just posted there is no start task VI, why is that?  If I added in voltage and current inputs would I need to have start task VI's for them?


There's an "auto start" terminal on the DAQmx Write vi that takes care if it for you (default value is TRUE).  The same will work if you add voltage and current tasks.

Jim
You're entirely bonkers. But I'll tell you a secret. All the best people are. ~ Alice
For he does not know what will happen; So who can tell him when it will occur? Eccl. 8:7

0 Kudos
Message 7 of 7
(3,802 Views)