I am trying to make the program wait until an anolog in task finishes. So I use a loop to see whether the task is done.
Do
DAQmxErrChk DAQmxIsTaskDone(taskHandle, taskFlag)
taskFlag= Not taskFlag
DoEvents
Loop While (taskFlag)
The program works fine until I unload the mainform - an windows pops out saying that VB6.0 encounter a problem and will be closed.
I want to see what's wrong here so I delete the loop and let the next DAQmxReadAnalogF64 function wait infinite time. Then the program works fine except the program will be freezed for a long time since I'm recording the voltage for 1000s.
Then I put just the DAQmxErrChk DAQmxIsTaskDone(taskHandle, taskFlag) sentence in and found VB6.0 will be crashed even before the program finishes. I don't know what this function could possibly do to crash VB6.0.
Thanks a lot!