LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 
Reply

Ramp generating using NI 6211

Solved!
Go to solution

Ramp generating using NI 6211

I am very new to Labview and I need some help here. Part of my aim is to generate a ramp signal for my scanner.

I searched the forum and found an answer which is not a bad fit for my aim (attached below). I have two questions: 

1. according to my understanding, the ramp by sample vi does not have anything to do with the infinite or finite samples, only DAQmx timing vi determines that. So if I change the finite samples to continuous samples, theoretically I should get the infinite ramps until I stop it. Is that right?

2. If I want the ramp (down part) goes down gradually (in this example, the down part is a purely vertical line, which means the voltage will go down from +10 v to 0v very quickly. And this will lead to mechanical problems to my scanner. ) How should I change the code?

 

Welcome to any suggestion! I appreciate the help in advance!

 

Penny

0 Kudos
Message 1 of 7
(666 Views)

Re: Ramp generating using NI 6211

I searched the forum and found an answer which is not a bad fit for my aim (attached below). I have two questions: 

1. according to my understanding, the ramp by sample vi does not have anything to do with the infinite or finite samples, only DAQmx timing vi determines that. So if I change the finite samples to continuous samples, theoretically I should get the infinite ramps until I stop it. Is that right?

Yes, the DAQmx timing determines the timing for the output. That is taken from the dt of the waveform. For a continous output you have to change your VI, esp. you'll need a loop where you can stop your output. I suggest that you have a look at the examples in the NI example finder, there should be something for continous analog output there (cannot look up for myself currently as I don't have DAQmx installed).

2. If I want the ramp (down part) goes down gradually (in this example, the down part is a purely vertical line, which means the voltage will go down from +10 v to 0v very quickly. And this will lead to mechanical problems to my scanner. ) How should I change the code?

You could add another down ramp. How to do this? Look up in one of your old threads, you already got that answer...

 

Regards, Jens

Kudos are welcome...
0 Kudos
Message 2 of 7
(613 Views)
Highlighted

Re: Ramp generating using NI 6211

If you look in the Waveform Palette on the Block Diagram, you'll see a series of VIs to generate Analog Waveforms.  One of these is a Triangle Wave, with equal Rising and Falling phases.  It generates a Continuous Waveform, ideal for driving a Continuous AO DAQ function (you just need one of these connected to your DAQ Write inside your While Loop -- the Generator can be set to "remember where it left off" and generate the next bunch of points in another Waveform).

 

Bob Schor

0 Kudos
Message 3 of 7
(585 Views)

Re: Ramp generating using NI 6211

Thank you, Bob! The problem is the equal rising and falling time is maybe not what I want. So I guess triangle signal may not be ideal in this situation.

 

0 Kudos
Message 4 of 7
(572 Views)

Re: Ramp generating using NI 6211

Thank you, Jens!

I have updated my vi and attached a screenshot.

My current question is: since I want continous ramp, so I have a for loop for it and a waveform vi to observe in the front panel. However, I dont see the ramp continuously going. So how can I make sure that the ramp is continuous instead of being generated only once?

 

Thank you!

Capture.JPGCapture1.JPG

0 Kudos
Message 5 of 7
(570 Views)
Solution
Accepted by topic author Penny001
01-05-2018 09:38 AM

Re: Ramp generating using NI 6211

Don't confuse your front panel indicators with the behavior of the DAQ device.  Your VI only executes once, thus only the buildup of the single triangle wave is shown.  But your DAQmx is set for Continuous Samples and wait forever, so the DAQ card should be outputting that waveform over and over again.

 

One problem you have is that the only way to stop the program is to abort the VI and that means the DAQ task clear will never execute.

0 Kudos
Message 6 of 7
(555 Views)

Re: Ramp generating using NI 6211

Thank you very much for the answer! I used an oscilloscope to read the signal I generated. It's continuous ramp!

 

0 Kudos
Message 7 of 7
(536 Views)