LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how can I, depending on the elemnts of an array, write into the same array

Hi everyone, to make this a little clearer, consider a 2*2 I8 array, many y objective is the following:

 

1) connect the array to the case structure, and depending on a specific case that's value of element of indeces (0,0), write over the same array in this way

 

 

1 0

 2 3 

for example, note that in (0,0) there's 1, so my decision is to make the array (same array) as:

 

0 0

2 3

any ideas?

Thanks.

T. A.
0 Kudos
Message 1 of 4
(2,706 Views)
Keep the array in a shift register or feedback node, then use "replace array subset" to replace the value of a certain element.
Message 2 of 4
(2,699 Views)

Use shift register as in place the array in a for while loop and add the shift registers, by the way, should I add the array itself inside the loop or should I add its local variable?

Thanks.

T. A.
0 Kudos
Message 3 of 4
(2,677 Views)

toniaz wrote:

... should I add the array itself inside the loop or should I add its local variable?


The array data is in the shift register or wire!

 

Any controls or indicators of the array just lets you interface to it via the front panel. Don't use controls or indicators as data storage via local variables, that's not the right way.

 

 

Here's a very simple demo (LV 8.0) that shows one possibility how to do this. See if it makes sense. 🙂

 

 

 

Message 4 of 4
(2,652 Views)