Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Generating multiple ramp pattern

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?

0 Kudos
Message 1 of 13
(5,011 Views)

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...

0 Kudos
Message 2 of 13
(5,010 Views)
OK, so I see that I can control the number of ramps I get, I can live with the 1 second delay, but I would really like to eliminate the first ramp (which seems to be more of a ramp and a spike) and only get the latter ramps which happen 1 second later. Any ideas on how to eliminate that?
0 Kudos
Message 3 of 13
(5,007 Views)

Hello lindope,

 

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.

 

Best,

Adam
Academic Product Manager
National Intruments
0 Kudos
Message 4 of 13
(4,973 Views)

hi,

 

I'm looking for multiple ramp design, like the one I posted here (http://forums.ni.com/t5/Multifunction-DAQ/Generating-multiple-ramps-problem/m-p/2020266#M71270). My problem is, I need to have different steps of ramps and I need them to starts together.

 

regards,

Yan.

0 Kudos
Message 5 of 13
(4,651 Views)

Hi Mystogan,

 

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.

 

Regards,

Tommy G.
Product Manager - Search, My Account, and Chat
0 Kudos
Message 6 of 13
(4,630 Views)

hi tommy,

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".

 

regards,

Yan.

0 Kudos
Message 7 of 13
(4,628 Views)

Hi Yan!

 

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!

Peter E
Applications Engineer
National Instruments
0 Kudos
Message 8 of 13
(4,603 Views)

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.

 

Possible causes:

Desired value is not supported for this property. The property value may be invalid because it is in conflict with another property.

Feature: SampleTakt.Rate
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.

 

testramp.png

 

 

Download All
0 Kudos
Message 9 of 13
(4,592 Views)

Hi Mystogan,

 

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.

Peter E
Applications Engineer
National Instruments
0 Kudos
Message 10 of 13
(4,575 Views)