Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Data aquisition locks computer

The following code causes my computer to lock up.  No response from anything, even Ctrl-Alt-Del.  I have to power off and back on.

#define

DAQ_BUFFER_SIZE 100 // size of buffer to allocate for data aquisition
#define DAQ_DATA_RATE 2000.0
// data collection frequency (Hz)
DAQmxErrChk (DAQmxCfgSampClkTiming(masterTaskHandle, "", DAQ_DATA_RATE, DAQmx_Val_Rising, DAQmx_Val_ContSamps, DAQ_BUFFER_SIZE));
DAQmxErrChk (DAQmxRegisterEveryNSamplesEvent(masterTaskHandle, DAQmx_Val_Acquired_Into_Buffer, DAQ_BUFFER_SIZE, 0, EveryNCallback,
this));

If I change the buffer size to 1000 and data rate to 1000, it works fine.  I need to be able to see the data at least 10 times per second real time.  I need to be able to record the data at 1KHz minimum.  I am reading 4 channels.

Windows XP, SP2
DAQmx 801
PXI-6031E card

 - les

 

0 Kudos
Message 1 of 2
(2,910 Views)
Hi Les,

Try running the example ContAcq-IntClk-EveryNSamplesEvent.c which is installed by default to C:\Program Files\National Instruments\NI-DAQ\Examples\DAQmx ANSI C\Events\Every N Samples.  I tried running this example with the parameters you specified (rate = 2000 Hz, buffer size = 100) on 4 channels of an E-Series board, and it worked fine for me.  Let us know if you have any problems with this example. 

Best regards,

Message Edited by Jarrod B. on 04-27-2006 11:33 AM

0 Kudos
Message 2 of 2
(2,896 Views)