LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Linear Voltage Ramp (Analog)

I am trying to build a voltage ramp to control a laser.  It has to be able to do +/- 5v, control number of samples, frequency and once it reaches the end voltage I need it to reset back to its start voltage with ramping back down.  I can get at least a ramp using the daq assistant and the ramp generator but the hard part for me is getting the program to stop at the end voltage then reset to a user desired voltage.  I am using the NI cDAQ-9172 device with module 9263 for the voltage.
0 Kudos
Message 1 of 26
(8,033 Views)

Hi B Man,

 

My advice is to stay away from using the DAQAssistant.It is much more limited in functionality than creating a DAQmx analog output task. Using an analog output task you can control this a couple ways. One way is to perform this action with software timing. In this case you can write a new single peiod of a sine wave to the output each iteration of the loop. You initialize an array that stores voltage values that will corrospond to the "ramp" you'd like to use for the amplitude of your sine wave output, and each iteration of the loop input the next voltage value of the array into the amplitude input of the generate sine VI. The output of this VI will be a waveform that is fed into the DAQmx write.vi. Attatched is a simple example that I wrote that loosely demonstrates this idea. In order to get the full functionality you're looking for, you will have to manipulate this example.

 

If you are looking for the output to ramp back down from the maximum voltage value in the array, you can have a case structure that checks to see if you're at your max voltage and then indexes through the array backwards, or simply uses another array that has the ramp signal that is ramping down. This should get you started.

 

Chris N White

High Speed Products Group 

Message 2 of 26
(7,995 Views)

Hi Chris,  I am trying to get similar functionality (ramping a voltage waveform) so I tried your example.  For some reason, it doesn't seem to be writing to my analog output channel, though it appears to be creating the waveform correctly within the vi.  Should this example be functional as-is or am I doing something wrong? 

 

Thanks!

 

Blake

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

If the VI is working, except for writing to your analog channel,

chances are you configured your writing function incorrectly.

 

Double check that you have your VI writing to the correct channel, parity, baud rate, stop bits, etc.... 

Cory K
Message 4 of 26
(7,926 Views)

HI Blake,

 

You were right about the VI that I posted there were a couple little bugs. I fixed them and this version of the VI should work right out of the box. You can vary the amplitude of the sine wave by changing the value of the square wave amplitude. You can also change the amount of time that it takes to ramp up by changing the values of Fs and #s in the square wave sampling info section. The only thing that you need to do is make sure that the ratio of Fs and #s for the square wave is 1. 

Message 5 of 26
(7,894 Views)

Hi!

I study Biomedical Engineering at Baskent University in Turkey. I have a  project with labview and i need help.
It's about a ramp generator in labview.They want two outputs triangle and saw-tooth The teachers never teached labview and I have no idea about this software.I am trying to learn but I believe I can't make this out without help. if you help me with with this i will appriciate so much.

 

I am very desperate please help me.

 

With my all respect..

Osman Onur ERDOGAN

Message Edited by Siyah on 12-18-2008 05:39 AM
Message Edited by Siyah on 12-18-2008 05:41 AM
0 Kudos
Message 6 of 26
(7,780 Views)
I recomend that you  start your own thread Siyah. This way you will get more help. It only a tipSmiley Happy
  


Besides which, my opinion is that Express VIs Carthage must be destroyed deleted
(Sorry no Labview "brag list" so far)
0 Kudos
Message 7 of 26
(7,770 Views)
In our school teachers even professors dont know anything about this software.But they gave this project anyway they are very cruel but i have nothing to do about that.Thats why i am searching for help.this project is very important for me.If i can't pass i will repeat whole term.
0 Kudos
Message 8 of 26
(7,758 Views)

You have to fill in some more details. Use the list as a template

1) Frequnce

2) Amplitude

3) Duration

4) Exsisting hardware on your computer

5) Everything else that will give us an understanding of your project



Besides which, my opinion is that Express VIs Carthage must be destroyed deleted
(Sorry no Labview "brag list" so far)
0 Kudos
Message 9 of 26
(7,749 Views)

thanks so much for your concern.Its a new project i will post tomorrow all details.If you look at it tomorrow i will really apriciate.

Thanks very much again.

0 Kudos
Message 10 of 26
(7,745 Views)