How to pass double data to analog output pin of DAQ

조회 수: 1 (최근 30일)
A R
A R 2020년 3월 3일
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에서 Analog Input and Output에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by