LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

array storage

requirement: In a labview vi and inside a while loop I want to insert a row of data, at a particular indexed location, to a fixed size and pre-existing array.

The "Insert Into Array" would seem the obvious widget to use but labview won't let me connect the output array pin to the n-dimension array input pin.

I've also tried creating/initialising an array outside the while loop but each time round the loop it sucks in the inital blank array, wipng the previously inserted values.

What's the solution? Do I need to use a CIN as a work around?

TIA
0 Kudos
Message 1 of 6
(3,556 Views)
TIA,
I am not sure what you mean by output pin and input pin. Are you try to connect the output of the 'insert into array' to its own input? Could you try explain further the probelm please.
Also, if you want to use an array outside the loop, you can use a flag to make sure that only on the first run does it take in the blank array.
however, i would like to hear more about the probelm?

Alan
0 Kudos
Message 2 of 6
(3,556 Views)
Hi TIA,
I hope I understood your problem.
I attach an example that shows how to insert a row in a 2D array of DBL and update its content.
Let me know,

Alberto
Message 3 of 6
(3,556 Views)
Insert into Array resizes the array to insert a new row (or element).
Replace Array Subset replaces a row (or element) without changing the size of the array.
If you're working with an array within a loop, you need to use a shift register. A shift register lets you continue to modify your array within the loop, with each iteration seeing the data from the previous iteration. Without the shift register, each iteration sees the initial value passed in from outside the loop. Right-click on the border on either side of the loop and select Add Shift Register.
See the attached LabView 6.1 example.
Message 4 of 6
(3,556 Views)
Huge thanks to Alberto and ALS. Both of the supplied examples show the solution to the problem, shift registers! It now works. 🙂
0 Kudos
Message 5 of 6
(3,556 Views)
ps, thanks also to gillie for the initial reply.
0 Kudos
Message 6 of 6
(3,556 Views)