Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

How to generete from the two analog output channels in NiDaqmx?

I have an application made in NiDaq, now I have NiDaqmx, in mi application I'm using the WFM_Group_Control, WFM_Group_Setup to generete from the two analog output channels at the same time, how can I do this in NiDaqmx?
0 Kudos
Message 1 of 11
(5,317 Views)
The place to start is (almost) always the examples. Try Cont Gen Voltage Wfm-Int Clk-Non Regeneration.vi or the appropriate corresponding vi with regeneration.

This is for one channel. You will need to modify in a few places, in particular to create two channels instead of one and to pipe the analog waveform vi an array of two waveforms instead of one (it is polymorphic).
0 Kudos
Message 2 of 11
(5,307 Views)
Thank you so much for your help, but I have an other question, How do I pipe the analog waveform an array of two wavefoms??
0 Kudos
Message 3 of 11
(5,297 Views)
See attached.

I made two channels using a string list (there's another way, but I forget it) and I changed the write waveform vi to handle an array of waveforms (select appopriate vi from drop down list).
Message 4 of 11
(5,293 Views)

Thank you so much for your help and time, but I still have a problem, I'm not using Labview, I'm using C++, what Nidaqmx function can use to do that?? to pipe the analog waveform.

0 Kudos
Message 5 of 11
(5,285 Views)

Hi elenac,

I'm attaching a modified example that comes with NI-DAQmx in c:\...\Program Files\National Instruments\NI-DAQ\Examples\DAQmx ANSI C\Analog Out\Generate Voltage\Cont Gen Volt Wfm-Int Clk.  The important function is DAQmxCreateAOVoltageChan where you have to change the channel string from "Dev1/ao0" to "Dev1/ao0:1".  Hope this helps.

Regards,

ErinB.

NI Mexico

0 Kudos
Message 6 of 11
(5,264 Views)
That's great, thank you so much, but I'm still having problems, I did all this but, how do I set the data to be two waveforms??
0 Kudos
Message 7 of 11
(5,255 Views)

You need to generate the data for the two waveforms in one of 2 ways:

1) Group by channel (non-interleaved) - the data buffer looks like {i(0), i(1),..., i(N), j(0), j(1), ... , j(N)} where i is Channel 1's data and j is Channel 2's data.

2) Group by sample (interleaved) - the data buffer looks like {i(0), j(0), i(1), j(1), ... , i(N), j(N)} where i is Channel 1's data and j is Channel 2's data.

The example that I attached has a data buffer of 2000 points.  The first 1000 points are AO0's data and the last 1000 points are AO1's data.  The parameter DAQmx_GroupbyChannel is passed to the function DAQmxWriteAnalogF64 to indicate that the data is organized according to option #1 described above.

The data buffer always has the size N*X where N is the number of samples per channel passed to the parameter sampsPerChanToAcquire of the function DAQmxCfgSampClkTiming and X is the number of channels in the task.

Hope this helps.

Regards,

ErinB.

NI Mexico

 

0 Kudos
Message 8 of 11
(5,245 Views)
Thank you so much, this solve my problem ...
0 Kudos
Message 9 of 11
(5,235 Views)

Hi,

Can someone send me an image of this vi as i cannot run this vi on labview 7

Thanks

nirav

0 Kudos
Message 10 of 11
(5,023 Views)