Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Can the 6229 card do this

I want to be able to run a pattern continuously, except the initial portion I only want to run once. Is there a way to load a pattern into the memory so when it runs again it starts at an arbitrary sample instead of the beginning of the pattern?
0 Kudos
Message 1 of 2
(2,493 Views)

No, not directly.  You'd have to manage this yourself.  I thought about this before when I thought I might need to do something similar.  I haven't implemented it yet, but I think the basic concept is solid.

 

I like to break up the output buffer.into thirds to help provide a little leeway.  The idea goes like this:

1. Size the buffer to hold "N" complete cycles of the continuous pattern.   I would choose a big enough "N" that the initial pattern fills

only about 1/3 of the buffer.

2. Fill the buffer with the initial pattern plus whatever portion of the continuous pattern you need to "pad it out" to the end.  Know where you left off.

3. Wait until about 2/3 of the buffer has been output.  Then write 1/3 of the buffer worth of the continuous pattern.  This data will be overwriting the initial pattern starting at the beginning of the memory buffer.  Be sure to start the pattern from where you left off in step 2.

4. Wait for another 1/3 of the buffer to be output, then write the next 1/3.  Repeat (if necessary) to update the final 1/3 of the buffer.

5. Now it should just keep regenerating and you don't have to write anything again.

 

Note that by following this "rule of thirds", you will begin writing at a point 1/3 buffer in front of the next sample to output and you will end writing at a point 1/3 buffer behind it.  This buys you a little bit of leeway on getting the timing right.

 

For a very fast output, the buffer may need to be pretty big.  If it were up to me, I'd aim for a buffer length of at least 1.5 seconds, so that you still get a 0.5 second leeway.

 

-Kevin P

ALERT! LabVIEW's subscription-only policy came to an end (finally!). Unfortunately, pricing favors the captured and committed over new adopters -- so tread carefully.
0 Kudos
Message 2 of 2
(2,485 Views)