How to pass double data to analog output pin of DAQ

2 次查看(过去 30 天)
Hi, I am using USB 205 MCC DAQ. It has 2 analog output pins. I want to transmit 2 data's, 1x256 data to analog output pin 1 and 1x12 data to analog output pin 2. I tried transmitting 1x256 data to analog output pin using a mex file and It works well
int ch1 = 0;
int Row1, Col1;
int Chan1, ExitFlag;
int NumAOChans, dummy1;
float EngUnits, voltsSent;
int ChannelType1 = ANALOGOUTPUT;
char rangeName[RANGENAMELEN];
for (i=0;i<N;i++)
{
// mexPrintf("\nThe output is %f",data[i]);
ULStat = cbAOut(BoardNum, Chan1, Range, data[i]);
ULStat = cbAIn(BoardNum, Chan, Range, &data[i]);
// mexPrintf("\nThe output is %f",data[i]);
bb[i] = data[i];
}
I tried changing the channel number in the above code, but that crashes matlab.The above code is from Universal Library C program examples. I dont know how to transmit the second data to analog output pin 2. How to change the channel number in the mex program?

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Periodic Waveform Generation 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by