05-18-2010 04:52 PM
I want to generate multiple ramps determined by the user. I put a ramp pattern generator in a while loop with a control to count the increments.
I am outputting to a PCI-6251.
Any iteration number less than 1081 I only get 1 ramp. Any iteration number I over 1081 I get 1 ramp and then 1 second later N number of ramps (where N = I - 1081).
e.g. if I set the iteration number to 1083 I get 1 ramp and 2 more 1 seconds later, if I set the number to 1086 I get 1 ramp then 5 ramps 1 second later.
Is this typical? or is there some way to be more precise?
05-18-2010 05:03 PM
The above data was while Samples = 100 (Period of ramp = 1 ms)
If I change Samples = 200 (period = 2 ms) then the behavior is the same but with 541 iterations instead of 1081.
e.g. I = 543 1 ramp then 2 ramps 1 second later. hmmm...
05-18-2010 05:38 PM
05-19-2010 11:16 AM
Would it be possible to post a diagram or image of what you would like to accomplish with your analog output? I am confused as to what you mean by multiple ramps, and a picture or image might clear things up. Also, screenshots of what you are seeing as your outputs can be helpful as well.
06-08-2012 05:10 AM
I'm looking for multiple ramp design, like the one I posted here (http://forums.ni.com/t5/Multifunction-DAQ/Generati
06-11-2012 03:07 PM
Are you getting any errors with your code right now? If so, what errors are you getting? Give this example code below a try with what you are trying to do. With this example, you can adjust the starting and ending values and the amount of seconds each ramp lasts. However, you cannot change the number of samples since this value needs to be the same for each channel you are writing to.
The attached Code is provided As Is. It has not been tested or validated as a product, for use in a deployed application or system, or for use in hazardous environments. You assume all risks for use of the Code and use of the Code is subject to the Sample Code License Terms which can be found at: http://ni.com/samplecodelicense.
06-11-2012 03:27 PM
thanks for response.
I have labview 2010, can you please re-upload for 2010 version. The problem I'm getting: I cant generate 3 ramps with different samples, once I got "The specified resource is reserved".
06-12-2012 10:58 AM
I have attached the file for LabVIEW 2010. I read through your other forum post and it looks like you have done some good research!
As you have found before, you cannot have multiple DAQmx Analog Output (AO) tasks running on the same device.
When using a single DAQmx task to accomplish this, unfortunately you cannot have three different analog outputs with a different number of samples. While you cannot have a different number of samples, you can however change the end, start, and duration parameters in the attached example.
Because this is an older forum and you posted a new thread elsewhere, your question will get better visibility on the newer thread. I would recommend focusing any additional questions you may have on the other thread.
Have a great day!
06-15-2012 08:31 AM
hi Peter, thanks for response.
But somehow I couldn't work on your Mult-Ramps.vi. Came up with this error:
Error -200077 DAQmx Timing property node is at (arg 5) in DAQmx Timing (Sample Clock) vi: 1 - occurred> Mult-Ramps.vi.
Desired value is not supported for this property. The property value may be invalid because it is in conflict with another property.
Requested value: 0.000000
Valid values start with: 22.250739e-309
Valid values end with: 10.0e6
Task Name: _unnamedTask <2A219>
I'm not sure what to do with that.
But, I've thought an idea to use a simple counter to start together, and put them in an array. But the time is somehow not exactly real time, there is small delay when I run the program.
06-18-2012 02:16 PM
If you decrease the number of samples for each of the channels down to 4, this should get rid of the error you are seeing and it will run correctly.
You are correct, if you use the counter method that you mentioned, it will not be in real time. This is because with this counter method, everything is software timed and therefore completely dependent on the operating system and its control of the processor.