LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Multiple analog output task

Solved!
Go to solution

Thank you very much. It was a great help. 🙂

0 Kudos
Message 11 of 13
(1,618 Views)

You're welcome! Smiley Happy

It would be great if you can mark the most relevant answer as solution to better help future readers of this thread.



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
0 Kudos
Message 12 of 13
(1,608 Views)

Hello,

 

just a simple example to generate a sinus on 2 output channels:

 


    DAQmxCreateTask("",&taskHandleCH1_2);
    DAQmxCreateAOVoltageChan(taskHandleCH1_2,"Dev1/ao0:1","",-10.0,10.0,DAQmx_Val_Volts,NULL);
    DAQmxCfgSampClkTiming (taskHandleCH1_2, "",Frequency * Samples, DAQmx_Val_Rising, DAQmx_Val_ContSamps, Samples);

    //Sinus on channel1

    SineWave (Samples, Amplitude , 1.0/ (double)Samples, &Phase, Sinus);

    //Sinus on channel2
    SineWave (Samples, Amplitude , 1.0/ (double)Samples, &Phase, Sinus+Samples);
  
    /*********************************************/
    // DAQmx Write Code
    /*********************************************/
    // Channel 1 and 2
    DAQmxWriteAnalogF64 (taskHandleCH1_2, Samples, 0, 10.0, DAQmx_Val_GroupByChannel,
                         Sinus, NULL, NULL);


    /*********************************************/
    // DAQmx Start Code
    /*********************************************/
    DAQmxStartTask(taskHandleCH1_2);

 

I just test this with ni pxi4461 and it works fine.

0 Kudos
Message 13 of 13
(1,603 Views)