I have just gotten my USB-6210. I'm trying to learn DAQmx commands & techniques. I know the device works - I have downloaded & used some NI example programs. Now I'm trying to figure out how to use it with tasks created in Measurement&AutomationExplorer. I can't figure out why the following causes VB 6.0 to crash & close out with no error messages or any warning at all. Most perplexing is that the program bombs when executing the very last statement! - which is a simple string command. Any clue as to what's going on?
Call DAQmxErrChk(DAQmxLoadTask(TaskName, TaskHandle))
Tsec = Timer
Call DAQmxErrChk(DAQmxStartTask(TaskHandle))
Do
Call DAQmxErrChk(DAQmxIsTaskDone(TaskHandle, TaskDone))
DoEvents
Loop Until TaskDone = True
TsecForDone = Timer - Tsec
Call DAQmxErrChk(DAQmxReadAnalogF64(TaskHandle, DAQmx_Val_Auto, 10, DAQmx_Val_GroupByScanNumber, Data(0), 300, TrueNbrReadsPerColor, Null))
Do
Call DAQmxErrChk(DAQmxIsTaskDone(TaskHandle, TaskDone))
DoEvents
Loop Until TaskDone = True
Call StopTask
TsecForTransfer = Timer - Tsec - TsecForDone
Txt = "Sec For Done: " + Format(TsecForDone, "00.000") + vbCrLf