I write a programm with VB6 for M series PCI DAQ card 6220.
here is the brief code:
'create a task
DAQmxErrChk DAQmxCreateTask(TaskName, hTask)
'create a channel
DAQmxErrChk DAQmxCreateAIVoltageChan(hTask, pChnANum, "", DAQmx_Val_RSE, -5, 5, DAQmx_Val_Volts, "")
'define sampleClock timing
DAQmxErrChk DAQmxCfgSampClkTiming(hTask, "", sampleRate, DAQmx_Val_Rising, DAQmx_Val_FiniteSamps, PointNum)
'start test
DAQmxErrChk DAQmxStartTask(hTask)
'read result
DAQmxErrChk DAQmxReadAnalogF64(hTask, 1000, timeout, DAQmx_Val_GroupByScanNumber, Data, PointNum, ReadNum, 0)
'stop test
DAQmxErrChk DAQmxStopTask(hTask)
'clear task
DAQmxErrChk DAQmxClearTask(hTask)
test parameters are : sample point per chan=1000 (as PointNum)
sample rate = 10000 (as sampleRate)
result Data count =1000 (as Data(1000) )
but when I run the propgram ,I got a error "buffer is too small for reading data."what's the problem?
^_^^_^