Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

How to generate an externally triggered analog output pulse with an amplitude that can vary from trigger to trigger?

Goal

 

I have an external trigger signal for an M-series PXI-6289 module and I would like to generate an analog output pulse each trigger. The amplitude of this pulse should be the cumulative sum of an analog input task running at a much higher frequency.

 

Problem

 

The M-series doesn't support retriggerable analog output natively but I was able to follow the example and use a counter to get the same behaviour. However, I can't see how to make it so the amplitude of the pulse in the example can be varied while the VI is running. I'm using LabVIEW 2011.

 

I'm a complete novice with DAQmx so I don't even know if what I want to do is feasible given the equipment I have. Any suggestions would be very much appreciated!

0 Kudos
Message 1 of 4
(5,017 Views)

 

Hi leodensian,

 

i guess you did something similar to the following example:

NI-DAQmx: Retriggerable Analog Output -- LabVIEW

http://www.ni.com/example/29787/en/

 

Iam not quite sure what exaclty you want to do when you say, the amplitude should be  the cumulative sum of an analog input task.

What kind of analog signal are you generating and what do you want to sum up? the amplitude or the number of until then generated output tasks? 

 

Greetings,

Blackhead

0 Kudos
Message 2 of 4
(4,966 Views)

Hi Blackhead,

 

Thanks for your response! Yes, that is the example I used to get the retriggerable analog output to work.

 

Basically I am working on a feedback system where the analog input is from a sensor measuring velocity and the analog output drives a device that acts on position. So I'd like to integrate the amplitude of the analog input (running with a sample rate of 200 Hz) since the most recent trigger in order to find the appropriate value to use for the analog output for the next trigger (the trigger period is about 3 Hz).

 

However, I can not see how to change the value of the analog output between triggers.

 

Best regards,

 

Leo

0 Kudos
Message 3 of 4
(4,959 Views)

Hi again Leo,

 

I have some information for your applicatinon: Generating the same data more than once is calles regeneration. You can configure NI-DAQmx to allow or disallow regeneration by setting the Regeneration Mode property.

When additionaly the Use Only Onboard Memory property is false, NI-DAQmx transfers data continuously from the host memory to the device buffer even though this data is not changing. Thus, if you write new data to the device after statring the tast, taht new data is generated and regenerated until you write new data.

 

I have a few Links regarding that topic:

 

Analog Output Regeneration in NI-DAQmx

http://www.ni.com/product-documentation/3874/en/

 

DAQmx AO Regeneration - Dynamically Updating User Buffer Data

http://www.ni.com/example/27148/en/

 

I hope combining the code you already have and something from here will help you out or give you a clue how to get going form here. 

 

Greetings,

Blackhead

0 Kudos
Message 4 of 4
(4,940 Views)