Measurement Studio for VC++

cancel
Showing results for 
Search instead for 
Did you mean: 

Repeatedly starting/stopping task causes Onboard device memory overflow

Solved!
Go to solution

Hi Sheldon,

 

Just a technicality in wording, but are you starting a task, stopping the task, and then clearing the task as well before creating a new task?  Start and Stop Task.vi do control the task, but it still leaves the resources reserved until you call Clear Task.vi.

 

If you are looking to add an artificial amount of time into your program, you can use a state machine or sequence structure in your code to implement a timed wait while the progam completes one task and begins another, have you tried this out yet?  This may help out the buffer issues without closing/exiting the program. 

Kyle A.
National Instruments
Senior Applications Engineer
0 Kudos
Message 11 of 15
(4,316 Views)

I am now using NI USB 6008 and I had the same error -200361 :Onboard device memory overflow. However, I noticed that the error occured only when I tried to config the timing, for example uing "DAQmx Timing.vi". If I just run the device without Timing, at max speed I guess, there is NO error, no matter how long I run or switch on/off many times.

This may solve the problem but I can't tell how fast the device's sample rate is because I don't know the exact value of dt. I know the maximum sample rate of the NI USB 6008 is 10kS/s, but when I measure a sine wave signal at a preset frequency and set dt = 0.0001 second (equivalent to 10kS/s), I got the frequency of the sine wave only half of the right value. To have the correct frequency value, I had to set dt = 0.00005, and that means the sampling rate is 20kS/s. That makes me really confused ! Did I make something wrong ? or the device is defect ?

0 Kudos
Message 12 of 15
(4,131 Views)

 

Hi Kyle,

 

I do call Start, Stop and Clear task.

 

I have tried adding a wait function after calling Stop and Clear task but the buffer overflow error still happens randomly.

 

I will have to create a test program that only starts and stops/clears tasks and then post the code here to see if anyone can help.

 

Sheldon

0 Kudos
Message 13 of 15
(4,129 Views)
Solution
Accepted by topic author c++Programmer

 

I have fixed the problem by calling DAQmxClearTask only, now I am able to restart the task without a buffer overflow error.

0 Kudos
Message 14 of 15
(3,972 Views)

It's a simple thing that for eg if a processor of a computer has low capacity the processing and switching between multiple acitivities is slow. But if it is has more capacity its faster. Same goes here also.

 

Natalia

www.groffr.com

0 Kudos
Message 15 of 15
(3,953 Views)