Measurement Studio for VB6

cancel
Showing results for 
Search instead for 
Did you mean: 

daqmxistaskdone crashes VB6.0

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!
0 Kudos
Message 1 of 2
(6,983 Views)

Hi yanjiang,

Are you stopping and closing you task after it’s completed its acquisition/generation? Not doing this can result in errors. In order to help solve the problem, could you please post the code for your task and screen shots of the error messages?

Have a great day!

Ryan D.
District Sales Manager for Boston & Northern New England
National Instruments
0 Kudos
Message 2 of 2
(6,971 Views)