LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

PCI-6341 Analog Output Rolling Buffer

Solved!
Go to solution

At present I'm using the PCI-6341 Analog Output to control the driver of an external piece of kit.

I preload the FIFO with up to 8191 values, then clock them out via a hardware TTL signal.

In future I would like to use more than 8191 values per experiment, is there a way to implement a rolling buffer?

The process is relatively slow, I clock out the values as 2 or 3 kHz.

 

initialise_AnalogOutputFIFO.jpg

0 Kudos
Message 1 of 4
(1,505 Views)
Solution
Accepted by topic author bmann2000

Well, one simple way is to stop the task, call DAQmx Timing.vi to redefine the buffer with a larger # of samples, fill the buffer with samples, and re-start the task.

 

The other way is to configure DAQmx Timing.vi for *continuous* sampling.  Then it becomes your responsibility to feed it new data fast enough that it never wraps around to where it's about to output the same data a 2nd time.  That'll cause your task to error out.  Note: if you feed it data before there's room to put it without overwriting earlier data that was never D/A converted, the DAQmx Write call will block and wait until there *is* room before writing the data and returning execution flow to you.

 

 

-Kevin P

0 Kudos
Message 2 of 4
(1,477 Views)

@bmann2000 wrote:

At present I'm using the PCI-6341 Analog Output to control the driver of an external piece of kit.

I preload the FIFO with up to 8191 values, then clock them out via a hardware TTL signal.

In future I would like to use more than 8191 values per experiment, is there a way to implement a rolling buffer?

The process is relatively slow, I clock out the values as 2 or 3 kHz.

 

 


With the 6341 you can make the task retriggerable. Use a DAQmx Trigger property node and select start -> more -> Retriggerable and set to TRUE. Let the sample clock set to finite and on each trigger it will write to the output the content of the buffer (according the number of finite sample is equal to the buffer size and that the time to generate these samples is equal to the trigger signal period).

 

Ben64 

--------------------------------------------------
The best way to say thanks is to give kudos!
0 Kudos
Message 3 of 4
(1,471 Views)

Many thanks, that would work for us.  The whole process is waiting on position feedback before the next Analog Outputs are required. It will be fine if it waits for space to become available in the in the buffer.

0 Kudos
Message 4 of 4
(1,440 Views)