LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Making a AO signal rise over time

Solved!
Go to solution

Greetings,
I'm new to LabView and trying to make some simple programs.
I want a voltage signal to rise from 0 - 5 V in 20sec.
For my first program I added a slider and connected that to the DAQ Assistant so that I could manually control the voltage between 0 and 5V.
Could anyone help me with this problem?

 

Thanks

0 Kudos
Message 1 of 9
(2,646 Views)

You can use the Ramp Pattern function to create your array and then pass it into a for loop with your DAQmx Write and delay inside. The for loop will autoindex the array and the DAQmx Write will output each voltage, step by step each iteration and the delay will determine the time between steps.

0 Kudos
Message 2 of 9
(2,640 Views)

I would make a ramp pattern (Ramp Pattern VI under Signal Processing->Signal Generation) and then feed that into an analog output.  If you don't care about exact timing, just use a FOR loop to write your individual samples at whatever rate you choose.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 3 of 9
(2,638 Views)

Part of it already works, thanks!
But I don't quite understand the sample thing. The standard "samples" of is 128.
I want the signal to rise from 0 to 5v in 20sec. What variable should I change then?

0 Kudos
Message 4 of 9
(2,629 Views)

That's pretty basic arithmetic. The number of samples is your step size. The time it takes to do the entire ramp is number of samples times the delay at each step. Change one or both.

0 Kudos
Message 5 of 9
(2,625 Views)

Sorry but I still don't quite understand.
I understand that changing the samples also changes the time needed. But how do I know how much time corresponds with 1 sample?
Am I able to make 1 sample correspond with 1 sec in real time?

0 Kudos
Message 6 of 9
(2,617 Views)

The time is entirely up to you. As you can see from the output of the ramp function, all that you get is a numeric array. There is NO timing information in the ramp. You set the time per sample by wiring x number of seconds into the Delay function or x number of milliseconds into the Wait (ms) function that goes inside the loop.

Message 7 of 9
(2,606 Views)
Solution
Accepted by topic author Innervision

Here's a picture of what Dennis is saying, perhaps this will help.

 

Output Ramp.png

 

I've labelled everything on the diagram so you can search for specific help if you need.

 

We also have some basic tutorials available here: http://www.ni.com/gettingstarted/labviewbasics/ and training here: http://ni.com/self-paced-training

 

 

Message 8 of 9
(2,597 Views)

Thanks for all the help! That's exactly what I needed to get start learning!
I've only started practicing with LabVIEW yesterday, so I need to get used to all the terminology and all the different functions.

0 Kudos
Message 9 of 9
(2,591 Views)