10-24-2009 07:22 PM
I'm very new to Labview and trying to get some code working. I have some data that I'm reading 128 bytes at a time in a FOR loop. I would like to build up that data so that at the end of the loop I have an array of 1024 elements. I have tried using build array with concatenate turned on and a single input but it just results in the data in my destination array being overwritten each time the loop executes.
Is there a VI that does what I want directly, or what is a way to get what I'm after?
Thank you.
10-24-2009 07:44 PM
I am guessing that a shift register is the missing element in your attempt, although I often use the reshape array route myself.
10-24-2009 08:48 PM - edited 10-24-2009 08:49 PM
Or...

10-26-2009 01:13 PM
10-26-2009 01:24 PM
phabib wrote:
Thank you. I was missing the shift register. Being a C programmer, I expected the array to persist in my loop. I did not realize I had to do something special to save the value and re-introduce it for the start of each iteration.
Good!
There are many subtle things that look what we knew from C but are diferenent. Yes a static local is like Shift Register IF it is not initialized.
Please read (when you have some time) this Nugget on a code structure we often use in LabVIEW (called an Action Engine) to share data across multiple threads without having to go to explicitly using mutexes.
The other thing I should make sure you hear early on is "controls/indicators" and locals are NOT like locals in C. In LV the wires are un-labeled variables.
Ben