问:AI_ContReadChannel函数中的InBuf参数的数据格式 是 D11...D0,C3...C0,那么我怎么样才能把D11...D0从中取出来?还是说InBuf[]中就已经存储的是转换以后的数据?谢谢
答:先把数据取回来再对数组统一处理。
函数原型:
I16 AI_ContReadChannel (U16 CardNumber, U16 Channel,
U16 AdRange, U16 *Buffer, U32 ReadCount,
F32 SampleRate, U16 SyncMode);
Description:
Buffer : An integer array to contain the acquired data.
Buffer must has a length equal to or greater
than the value of parameter ReadCount.
If double-buffered mode is enabled, this buffer
is of no use, you can ignore this argument.
//...若采用non-double-buffer mode...
#define ChNo 0
#define AdRange AD_B_5_V
#define SampLen 2048 //读取样点数
#define SampRate 20000.000f
U16 InBuf[SampLen];
......
AI_ContReadChannel(CardID, ChNo,AdRange,InBuf,
SampLen,SampleRate,SYNC_ASYNC);
......
for(i=0;i<SampLen;i++)
InBuf[i] /= 16;//<==>InBuf[i]>>=4;
有奖活动 | |
---|---|
【有奖活动】分享技术经验,兑换京东卡 | |
话不多说,快进群! | |
请大声喊出:我要开发板! | |
【有奖活动】EEPW网站征稿正在进行时,欢迎踊跃投稿啦 | |
奖!发布技术笔记,技术评测贴换取您心仪的礼品 | |
打赏了!打赏了!打赏了! |