Measurement Studio for VB6

cancel
Showing results for 
Search instead for 
Did you mean: 

DAQmxWaitUntilTaskDone Overflow Error

Solved!
Go to solution

Lately, I've been running into an issue with the DAQmxWaitUntilTaskDone command.

I'm putting together a program that generates a square waveform (of sorts), and I find that, if I leave the program running for a day or so, I get an overflow error on the DAQmxWaitUntilTaskDone command. I've tried using different values (including -1) for the TimeToWait value, but I keep getting the same error. What might cause this?

 

This is my code thus far. FWIW, I'm using an NI-6259.

 

190     publicStatus = DAQmxCreateTask("", taskHandle)
200     taskIsRunning = True 
       
        ' Add a digital output channel to the task.
210     publicStatus = DAQmxCreateDOChan(taskHandle, "Dev2/port0/line8:16", "", DAQmx_Val_ChanForAllLines)
        ' Configure sample clock timing for and external signal
220     publicStatus = DAQmxStartTask(publicOutputPulseTaskHandle)
230     publicStatus = DAQmxCfgSampClkTiming(taskHandle, "Ctr0InternalOutput", 1000000#, DAQmx_Val_Rising, DAQmx_Val_AcquisitionType_FiniteSamps, numSamplesToWrite)
    
        ' Write array of values  
240     publicStatus = DAQmxWriteDigitalLines(taskHandle, numSamplesInArray, False, -1, DAQmx_Val_GroupByChannel, writeArray(0, 0), sampsPerChanWritten, ByVal 0&)
    
        ' Start the task running, and write to the digital lines.
250     publicStatus = DAQmxStartTask(taskHandle)
            
        ' Wait until generation is complete

260     publicStatus = DAQmxWaitUntilTaskDone(taskHandle, TimeToWait) 
270     publicStatus = DAQmxClearTask(taskHandle)
280     publicStatus = DAQmxStopTask(publicOutputPulseTaskHandle)

 

Does it look like there's anything wrong with my code?

0 Kudos
Message 1 of 8
(7,413 Views)

One thing I forgot to mention: this code is run multiple times (low hundreds) during normal operation of the program it's part of.

0 Kudos
Message 2 of 8
(7,404 Views)

Just did a bit more testing: I find that I get the overflow error when I set the TimeToWait variable too low. This is raises the question: why do I get this error when I have the TimeToWait variable set to -1?

0 Kudos
Message 3 of 8
(7,402 Views)

Hey Armando83,

 

Which overflow specifically do you receive? It seems to me like this could be a buffer overflow issue...

 

 

0 Kudos
Message 4 of 8
(7,391 Views)

There are multiple kinds of overflow errors? I've just been getting Error 6.

0 Kudos
Message 5 of 8
(7,383 Views)

Hey Armando83,

 

Are you able to post a screenshot of this error?

 

Thanks,

0 Kudos
Message 6 of 8
(7,375 Views)
Solution
Accepted by topic author Armando83

Courtney, I did a bit more investigating, and it turns out it was a networking issue that was tripping me up. The code itself was okay, and wasn't causing any problems.

 

Thank you, though, for your help.

0 Kudos
Message 7 of 8
(7,363 Views)

Hey Armando83,

 

I'm very glad you got it up and running!

 

 

0 Kudos
Message 8 of 8
(7,356 Views)