LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

DAQmx Stoping and restarting a DO task (underflow error)

Hello,

 

I have a DO (waveform) task of finite sample. I would like to configure the task, commit it and finally, starting it when a user fires an event.

I would also want to restart the generation if the user fire the event again.

 

So, when the task is over, I stop it and wait to restart it.

 

Everything works fine the first time, but I always get an underflow error the second time (error -200621).

 

I checked the buffer and it is still full. Even if I rewrite the data to the buffer using the DAQmx write VI, I get the error.

 

I'm using a cDAQ-9178 and a 9401 DIO module.

 

I have attached  screenshot of my code.

 

Thanks in advance.

0 Kudos
Message 1 of 4
(3,090 Views)

Hi vgravel-

 

     Are you saying that f you remove the DAQmx Write and DAQmx Control Task.vi, you still get the error?  Which version of DAQmx do you have?  What about the sample rate - if you lower that, do you get the same error?

 

     You also said that you checked the buffer - do you mean that you checked the buffer after writing data do it?  You are preloading the buffer before you ever write it in this program, so what you are seeing may be expected.

 

     Sorry for all the questions.  Hopefully this will help us narrow down the cause of the error.

Gary P.
Applications Engineer
National Instruments
0 Kudos
Message 2 of 4
(3,029 Views)

Hello Gary,

 

First, thanks for helping me with this issue!

 

I've attached two more screenshots to help you visualize what I did. As you can see, after the task finish the first time it is executed, the number of space available in the buffer is 0. So I assume that the data is readu to be written again...

 

I also took off the second "DAQmx Write.vi" and "DAQmx Control Task.vi" without seeing any difference.

 

I'm using DAQmx 9.2.2

 

Thanks,

Vincent

Download All
0 Kudos
Message 3 of 4
(3,023 Views)

Hello vgravel,

 

Thank you for your response. Please include an attachment of your VI. 

 

Best regards,

 

Ali M

Applications Engineer

National Instruments

www.ni.com/support

0 Kudos
Message 4 of 4
(2,962 Views)