LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

AO Buffer Write.vi and continuous generation

Hi,

I have a continuous AO generation application. I need to change the output
values, to do this I'm using "AO Buffer Write.vi".

I only update a portion of a buffer dependent on the value of the ouput
mark in the update progress cluster in AO Buffer Write.

Now I see that the updates seem to take a long time to cycle through, longer
the the cycle time for the buffer. I'm using 512 point buffer size, and
using an output rate of 1024 point/second. It seems to take several seconds
for the new values to get through the analogue output. Yet the 512 points
would have been output in 0.5 seconds. I'm using regeneration.

Any ideas on why this is so? And any ideas on how to stop this problem.


Thanks
0 Kudos
Message 1 of 2
(3,189 Views)
Peter,

I believe one of the problems you are running into is how many points you are writing at a time compared to the buffer size. The reason is that with continuous generation, also known as double-buffered generation, you are reusing the same memory buffer. As you are writing new data to be stored into that buffer, the other half of the buffer can take data out of the buffer to update the channels. Thus, the process acts like a bucket being filled with water while a spigot allows water to be let out of the bucket at the same time. When these actions are in balance, everything flows nicely.

Also, I suggest that you model your application after the Continuous Generation example in the LabVIEW >> Examples >> Daq >> anlogout >> anlogout.llb directory if you're no
t already doing so. You can see that the example has a My Data Generator.vi to create an array based on the size that you want to output each time the AO Write is called. On the first iteration, My Data Generator creates a data array big enough to fill the whole buffer (equal to buffer size). On subsequent iterations, it creates a data array half the buffer size. Thus, if you normally want to output 512 points, you may want to increase your buffer size and then output half of the buffer each time.

Regards,

Geneva L.
Applications Engineering
National Instruments
http://www.ni.com/ask
0 Kudos
Message 2 of 2
(3,189 Views)