02-27-2011 09:41 PM
Hi,
I have a program where I need it in such a way that every time the buffer is full the time values in the buffer are written to an array. The array should be a 2D array with each column being the times in the buffer when it became full. The program that needs to modified is the buffer.vi. The recent History BUffer 1 contains a functional global variable buffer. Thanks.
02-28-2011 06:39 AM
The AE looks good, but i'd recommend setting Read as default command so you dont accidentally empty it.
It sounds to me like you could use a Build array each time the buffer is filled, and afterwards transpose the whole array. That should result in each fill of the buffer being 1 column.
/Y
02-28-2011 11:11 AM
Thanks for the response. I am not sure how to do the read as default command. I tried building the array but I am getting an error that says I am connecting two different lines, source is 32 bit integer while the array is a 2d void array error. Can you please change the Buffer vi and show me how it's done? Thanks.
03-02-2011 12:56 PM
Hi,
Could you tell me what excatly you are trying to place in the array? If there are two different data types, you will either need to convert one or instead build a cluster. An array can only contain one type of data, whereas a cluster is more flexible. You could also build to separate arrays and then combine them into a cluster. Hope this helps!
Jon S
03-02-2011 01:48 PM
There's really no need for the 2 loops, you can easily do it in 1, but here goes:
- Remove the Buffer full and Stop Local variables from the 1st loop.
- Create a Shift register in the 2nd loop which run through the Case.
- In the True case, grab the Array from the Buffer.vi, build array with the shift register and then initialize the AE.
- In the False case you just wire through.
- After the 2nd loop, you connect a Transpose Array to the shift register and create an indicator.
- Try and post the result.
/Y
03-03-2011 12:03 PM
Hi,
How does this look? Everytime the buffer is full, it writes to an array that stores the data in the buffer. It uses only one while loop. Hope this sends you in the right direction!
Jon S