Quantcast
Channel: Measurement Studio for VC++ topics
Viewing all articles
Browse latest Browse all 660

How to generate two voltage waveform under the internal clock as analog output using PCIe6363

$
0
0

Hello, I use the PCIe6363 and BNC2110 to generate the continued voltage waveform under the internal clock as my analog output.I have test the sample example "Cont Gen Volt Wfm-Int Clk" from the path C:\Users\Public\Documents\National Instruments\NI-DAQ\Examples\DAQmx ANSI C\Analog Out\Generate Voltage, it works well to generate the voltage waveform, but when I want to generate two analog outputs in the program such that the Dev1/ao0 and Dev1/ao1 under the internal clock at the same time, it returns error which is DAQmx Error: The specified resource is reserved, the operation could not be completed as specified.

In the program what I have done is just to copy the sample example and add another virtual channel, as follows:

// Configure the tasks
DAQmxErrChk (DAQmxCreateTask("",&TaskHandle0));
DAQmxErrChk (DAQmxCreateTask("",&TaskHandle1));

// Setting the two virtual channels
DAQmxErrChk(DAQmxCreateAOVoltageChan(TaskHandle0,"Dev1/ao0","",-10.0,10.0,DAQmx_Val_Volts,NULL));
DAQmxErrChk(DAQmxCreateAOVoltageChan(TaskHandle1,"Dev1/ao1","",-10.0,10.0,DAQmx_Val_Volts,NULL));
DAQmxErrChk(DAQmxCfgSampClkTiming(TaskHandle0,"",1000,DAQmx_Val_Rising,DAQmx_Val_ContSamps,1000));
DAQmxErrChk(DAQmxCfgSampClkTiming(TaskHandle1,"",1000,DAQmx_Val_Rising,DAQmx_Val_ContSamps,1000));

// Write code
DAQmxErrChk(DAQmxWriteAnalogF64(TaskHandle0,1000,0,10.0,DAQmx_Val_GroupByChannel,data,NULL,NULL));
DAQmxErrChk(DAQmxWriteAnalogF64(TaskHandle1,1000,0,10.0,DAQmx_Val_GroupByChannel,data,NULL,NULL));
// Start Code
DAQmxErrChk (DAQmxStartTask(TaskHandle0));
DAQmxErrChk (DAQmxStartTask(TaskHandle1));

So I want to what is problem in the program or what I should do to generate two analog outs in the same time under the internal clock.

Thanks!!!


Viewing all articles
Browse latest Browse all 660

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>