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 Center および File ExchangeAnalog Input and Output についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by