From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

Trouble with cDAQ + NI-9263 + C# multiple channels

Solved!
Go to solution

Hello,

I am having trouble generating a waveform for AO0 (sine wave) and AO1 (cosine wave) respectively. 

I can generate any waveform on a single channel, but generating waveforms to multiple channels eludes me.

Code:

EnJoneer_0-1670867421390.png

I tried using AnalogMultiChannelWriter but I couldn't get the multidimensional double[,] set up correctly..

Anyone have advice for how to proceed? Is there an NI example? I couldn't find one in my local ...\National Instruments\NI-DAQ\Examples folder.

 

Thanks in advance,

Jon

0 Kudos
Message 1 of 7
(1,649 Views)

You need to put both channels in the same task and use the N-Channel writer instead of a single channel.

Santhosh
Soliton Technologies

New to the forum? Please read community guidelines and how to ask smart questions

Only two ways to appreciate someone who spent their free time to reply/answer your question - give them Kudos or mark their reply as the answer/solution.

Finding it hard to source NI hardware? Try NI Trading Post
0 Kudos
Message 2 of 7
(1,638 Views)

I'm not finding the "N-Channel writer"... 

I tried using "NationalIstruments.DAQmx.AnalogMultiChannelWriter" but this proved not to be so intuitive.

Which class are you referring to?

0 Kudos
Message 3 of 7
(1,629 Views)

Yeah, that one, NationalInstruments.DAQmx.AnalogMultiChannelWriter

 

I am not so familiar with C# but know from LabVIEW APIs for DAQmx.

Santhosh
Soliton Technologies

New to the forum? Please read community guidelines and how to ask smart questions

Only two ways to appreciate someone who spent their free time to reply/answer your question - give them Kudos or mark their reply as the answer/solution.

Finding it hard to source NI hardware? Try NI Trading Post
0 Kudos
Message 4 of 7
(1,596 Views)

Does anyone have an example of how to set up the multidimensional waveform for the 'AnalogMultiChannelWriter' class method 'WriteMultiSample'?

 

0 Kudos
Message 5 of 7
(1,564 Views)
Solution
Accepted by topic author EnJoneer

I figured it out. My multidimensional array was being populated in the wrong order. 

This works:

EnJoneer_0-1671112462644.png

 

0 Kudos
Message 6 of 7
(1,532 Views)

 

Can cRIO 9039 + 9263 work with measurement studio? It seems like my computer cannnot connect the cRIO successfully?    When I am running the examples, it always got stuck?   Could someone help me?

0 Kudos
Message 7 of 7
(1,215 Views)