02-06-2013 08:52 AM
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
Solved! Go to Solution.
02-06-2013 09:01 AM
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.
02-06-2013 09:03 AM
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.
02-06-2013 09:18 AM
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?
02-06-2013 09:23 AM
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.
02-06-2013 09:42 AM
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?
02-06-2013 09:54 AM
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.
02-06-2013 10:19 AM
Here's a picture of what Dennis is saying, perhaps this will help.
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
02-06-2013 10:23 AM
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.