Hey NI Experts,
I've tried to solve this on my own, now it's time to turn to the experts. All I am trying to do is send two different analog out signals at the same time on an NI 6731 PCI board. The timing doesn't have to be different or anything like that, I just need to send constant output voltages for a certain amount of time. I'm new to programing in c, so I'm sure my problem is a simple one, but I cannot find a direct answer.
I understand that I need to make my channel
Dev1/ao0:1 and I define my sample array as because previous threads have said I need one column for each channel.
// Data write parameters
float64 data[2][bufferSize];
for(;i<bufferSize;i++) {
data[0][i] = xvolt;
data[1][i] = yvolt;
}
Where bufferSize is 512 and xvolt and yvolt are different constants. But when I put it into
DAQmxErrChk (DAQmxBaseCreateTask("",&taskHandle));
DAQmxErrChk (DAQmxBaseCreateAOVoltageChan(taskHandle,chan,"",min,max,DAQmx_Val_Volts,NULL));
DAQmxErrChk (DAQmxBaseCfgSampClkTiming(taskHandle,"",sampleRate,DAQmx_Val_Rising,DAQmx_Val_ContSamps,samplesPerChan));
DAQmxErrChk (DAQmxBaseWriteAnalogF64(taskHandle,samplesPerChan,0,timeout,DAQmx_Val_GroupByChannel,data,&pointsWritten,NULL));
I get the error: "warning: passing argument 6 of ‘DAQmxBaseWriteAnalogF64’ from incompatible pointer type"
And when the code is executed, the DAQ card gives the yvolt value to both ao channels and ignores the xvolt data. Can you help me clear this up?
Thanks,
Mark