Quantcast
Channel: LabWindows/CVI topics
Viewing all articles
Browse latest Browse all 5339

Problem with DAQ data acquisition suddenly stops

$
0
0
I wrote a CVI program to acquire the I2S data using Labwindows. Three data lines, namely bitclock, lrclock, and data are connect between the I2S device and the NI USB-6356. The program works well with TAS2552 to get the I2S data, left channel is the voltage and the right channel is the current of the speaker load. When I changed TAS2552 with another audio amplifier board, the program always stopped after several acquiring several frames, sometimes the program could work more than one minute, and sometimes it could only acquiring one or two seconds of data then stopped working. I watched the I2S data and the clock data from the oscilloscope, they seemed nothing wrong. The digital data buffer length is 2048*32+64 for continuous mode. Sample rate is 48 kHz. Each time the DAQ buffer is full, function I2S_decode will decode the I2S data. The digital acquisition is configured as following sentences: digiSampsPerBuf=2048*64; analSampsPerBuf=2048; long digiBuf[2048*32+64]; long decoBuf[2048*2] DAQmxCreateTask("",&SAMP_DigInput); DAQmxCreateDIChan(SAMP_DigInput,digital_chn,"",DAQmx_Val_ChanForAllLines); DAQmxCfgSampClkTiming(SAMP_DigInput,ex_digi_clock,SampleRate*64,DAQmx_Val_Rising,DAQmx_Val_ContSamps,digiSampsPerBuf*3*BUF_NUM); DAQmxRegisterEveryNSamplesEvent(SAMP_DigInput,DAQmx_Val_Acquired_Into_Buffer,digiSampsPerBuf,0,DigiCallback,NULL); The callback function is as follows int CVICALLBACK DigiCallback(TaskHandle SAMPTask, int32 everyNsamplesEventType, uInt32 nSamples, void *callbackData) { int32 sread,bread; if(frames==0) { DAQmxReadDigitalLines(SAMPTask,digiSampsPerBuf,10.0,DAQmx_Val_GroupByScanNumber,(uInt8*)(digiBuf+64),digiSampsPerBuf*2,&sread,&bread,0); memcpy(digiBuf,digiBuf+2048*32,64*4); } else { memcpy(digiBuf,digiBuf+2048*32,64*4); DAQmxReadDigitalLines(SAMPTask,digiSampsPerBuf,10.0,DAQmx_Val_GroupByScanNumber,(uInt8*)(digiBuf+64),digiSampsPerBuf*2,&sread,&bread,0); } I2S_decode((uInt8*)digiBuf,decoBuf,analSampsPerBuf,i2sBits); return 0; } So anyone could give me some suggestion as to why the program would suddenly stop when acquiring I2S data from the second device. Many thanks!

Viewing all articles
Browse latest Browse all 5339

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>