Digital I/O

cancel
Showing results for 
Search instead for 
Did you mean: 

Long delay when writing digital pattern - DAQmx, PCI6534

I'm updating my application to use DAQmx for digital pattern generation on a PCI6534 in the hope that it will solve the memory leak problems that I've been suffering from [see this thread - never resolved].

I can write patterns succesfully using the DAQmx api, but am having problems updating them. Specifically, I'm outputting a pattern at 1MHz, 10^5 samples long (total 100ms) and have the board set to continously regenerate the pattern. This works fine. I want to change the running pattern without interrupting it so I call WriteMultiSamplePort() with the new data. The pattern does update, but only after a long delay (about 7-8 seconds, quite repeatable).

Has anybody seen this ? Any ideas how to fix it ? I'm pretty sure I'm trying to do something possible, as it used to work using traditional NI-DAQ.

Thanks in advance for any help,

Jony Hudson
0 Kudos
Message 1 of 3
(3,750 Views)

@Jony Hudson wrote:


I can write patterns succesfully using the DAQmx api, but am having problems updating them. Specifically, I'm outputting a pattern at 1MHz, 10^5 samples long (total 100ms) and have the board set to continously regenerate the pattern. This works fine. I want to change the running pattern without interrupting it so I call WriteMultiSamplePort() with the new data. The pattern does update, but only after a long delay (about 7-8 seconds, quite repeatable).



Hi Jony,

The PCI-6534 has a large onboard FIFO (32 megabytes). Because you've configured your application to continuously regenerate the pattern, the FIFO fills up with your pattern repeatedly. Assuming that you're using all 32-bits of the data port, this explains why it takes about eight seconds for a write to show up on the I/O connector. (32MB / 4 bytes per sample / 1 Mhz = ~8.4 seconds). If you want your updates to come out sooner, a good way of doing this is to tell DAQmx to not use all of the onboard FIFO with the DAQmx Buffer : Output : Onboard Buffer Size property.

For example, if you want your updates to come out after a quarter second, you can set this property to about 250,000 samples. DAQmx will coerce this value to a value that the hardware supports. (You can query the property to see what value DAQmx picked)

Good Luck,

Jeff
Message 2 of 3
(3,716 Views)
Jeff,

you're a superhero ! Thanks.

I'd noticed that the time was suspiciously commensurate with the 32MB buffer size, but wasn't sure what to do to change the buffer size. What you suggest hits the spot exactly.

Thanks once again,

Jony
0 Kudos
Message 3 of 3
(3,706 Views)