Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

How can I output several simultaneous buffered waveforms with NI-DAQmx

I am using a PCI 6229 card and NI-DAQmq in LabWindows CVI 7.1. I can not figure out how
to implement waveform generation in four channels simultaneously. This has to be buffered wavefrom
generation with internal clock timing.
Are there any simple examples done without using the daq assistant that I can see to learn how to use the
NI-DAQmx functions?.
I need to write a number of periods on four waveforms, while I count digital pulses.

Many thanks,
Fundadero.
0 Kudos
Message 1 of 4
(2,929 Views)
Hello Fundadero,
You might want to take a look at the example finder in CVI. Go to Help>>Find Examples, then navigate to Hardware Input and Output>>DAQmx>>Analog Generation>>Voltage. The one that might interest you the most is called ContGen-IntClk.prj. To use this with more than one channel, use a channel string like Dev1/ao0:3, that will use channels 0 through 3. Hope this helps.
-Alan A.
0 Kudos
Message 2 of 4
(2,918 Views)
Alan,
Thank you for your help. I did look at that example and played with the number of analog outputs.
But It was not clear how to modify this example in order to perform buffered analog output
with updates corresponding to one of the internal clocks. I will output two sinchronous analog waveforms
and use the other two analog outputs to update their voltage on demand to control y and z positions.
The two synchronous waveforms, are AO_0 : a voltage staircase, 256 steps increasing from V1 to V2, 2ms duration steps , followed by 256 steps decreasing back from V2 to V1 (controls the x axis position). The second waveform, is a sequence of 256/n smaller staircases, with step durations of n*2ms, spanning a voltage range from 0.0 to 1.0 volts.
It turns out that I could do this in the traditional NIDAQ but I am struggling to migrate it to the NI-DAQmx platform, and I could not resolve this with the example that you suggested.
Do you have any more suggestions after I described what I am trying to do?
I will very much appreciate it.

Many thanks

Fundadero
0 Kudos
Message 3 of 4
(2,898 Views)
Hello Fundadero,
In the example I mentioned, the 'data' variable contains the values to write, which is an array of floats. The parameter called data layout, which I believe is 'DAQmx_Val_GroupByChannel' determines how the data from that array is grouped. Simply load your values for all of your channels into that array, then call the write function. You might want to use a finite example, as opposed to a continuous. Also, if you want to do a continuous, you can also call the write function within the loop, so you can continue to update the output data while you program is running.
-Alan A.
0 Kudos
Message 4 of 4
(2,869 Views)