LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

DAQmx with digital output waveform

Solved!
Go to solution

Hi all,

 

I am sending a digital waveform to a digital output with DAQmx. See my example VI.

 

Using this VI, first I send a waveform made from two values: T, F. This works and I can see the LED blink on and off in an even pattern. Then I send a waveform with four values: T, F, T, T. This also works. I see the LED blinking with more time spent on than off. Then I try to send a waveform with only two values: T,F again. It doesn't work now and I get an error "Onboard device memory underflow." I assume it's because now that I've sent it 4 values, it is expecting 4 again, not 2. But why? It was ok when I sent if 4 values after sending 2 but not the other way around? Is there any way I can make this work? I would prefer to not have to clear the task and create a new one every time I send a new waveform.

 

I have never used digital waveforms before, so sorry if I am missing something obvious.

0 Kudos
Message 1 of 5
(3,171 Views)

Hi there, 

 

Usually that "onboard device memory underflow" means that data is not being written fast enough to memory, and suggests a data underflow. Do you change the values it is expecting from 4 to 2 when you revert back to using 2?

 

Also, what device are you using? It is always helpful to know since each device has its own set of specifications.

 

Regards,

 

Andrea W.
ELP Engineer
National Instruments
0 Kudos
Message 2 of 5
(3,115 Views)

Oh yes, sorry, I am using NI 9474.

 

Yes I think that is the problem, I don't know how to tell it how many values to expect. Could you explain how to do this?

0 Kudos
Message 3 of 5
(3,113 Views)

I just tried using the "DAQmx Configure Output Buffer" VI each time to set it to expect to proper size, but the same thing happens as before. Is this not the right way to do it?

Capture1.PNG

 

For clarity, I am using an NI 9474 in a cDAQ-9178. I have no problems setting a waveform with 2 samples, then one with 4 samples, but then when I send a waveform with 2 samples after that, the digital output turns off instead of doing the waveform I sent and then I get this error when I stop:

Capture2.png

0 Kudos
Message 4 of 5
(3,103 Views)
Solution
Accepted by topic author prettypwnie

I have eventually found a solution to my problem. I got the idea from this lava thread: https://lavag.org/topic/9973-simultaneous-analog-and-digital-output-with-daqmx/

 

Basically I just needed to set this property "Use Only Onboard Memory" to true at the beginning of my program, then everything works great.

Capture.PNG

Message 5 of 5
(3,080 Views)