From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Buffered Event Counting

Hey-

 

 

I have a question using Buffered event counting. I have created the attached VI to control position and record the count at each position. I have arrays of X and Y positions in volts that I would like to Analog Output at a rate of at least 2500 positions per second. I am using a DAQ- 6259 and am using a sample clock to control the rate at which each position is output.  I want to use the same clock to then record the count at each position using a counter/timer channel. Since i would like to do this at rates of well over 2500 Samp/s I believe I need to buffer both the positions out and the value of the counter at each position. 

 

The problem I am having with the following  VI is that i thought i was creating a sortof buffer array called Data with the Size of "Samples" and that would output to the array called counts every time it was full (or reached the size limit).  However, at the end of the program both "Data" and "Counts" are the same size, which is the value of "Samples".  How can i create a buffer to collect the value of the counter each position most efficiently? Eventually there will be a large # of positions to move to and counts to record (about 1,000,000). For now i am just working with about 20,000. Speed is critical. thanks

 

t.r.

0 Kudos
Message 1 of 2
(2,208 Views)

One thing that I see - it looks like your loop is only running once if Error = FALSE and Stop = FALSE. Get rid of the invert on the output of the OR function.

 

Another thing you want to do is pre-allocate the size of the Counts array shift register and use "Replace Array Subset" instead of "Build Array" to add data to your array. You'll have to keep track of where you are in the pre-allocated array.

 

Good Luck!

 

 

0 Kudos
Message 2 of 2
(2,169 Views)