LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

change 2D array in 3D array and send back

Solved!
Go to solution

HEllo,

 

I have simple problem but dificult for me.

A have 3D array of data 12 pages with 4x 10 array od data, descibing my sensor in different situation.

 

I need to calibrate sensor in each situation and I have to take out 2D array from 3D array, change 2D array and remember as new 3D array and use it later.

 

I understand that all pages must be equal dimension which is not ideal for me but I can live with that.

For some reason attached VI does not work right.

 

Thanks

 

Sasa

 

 

0 Kudos
Message 1 of 5
(2,528 Views)

You don't say in which way it "does not work right", but I can take a few wild guesses.

 

 

  1. You have a race condition because the various numerics are read right after each iteration, so even if you change them later and press e.g. "add", the stale value is read from the tunnel. These terminals belong inside the event structure so they are read only after the event triggers.
  2. Your "Lookup" control is located outside the main loop, so even though you write to a local variable of it, the data in the tunnel is still stale, because the control only gets read once at program start. Again, the terminal belongs inside.
  3. It would be better to keep the lookup data in a shift register.
  4. You don't need to transpose twice. Simply wire the "kolona" to the lower index to operate on columns.

 

0 Kudos
Message 2 of 5
(2,507 Views)
0 Kudos
Message 3 of 5
(2,499 Views)

Thank you. This look as god solution for this.

I modified in sense that I can measure during event waiting and when I found god value I remember it to the 3D array.

I try to add table so that I can see visualy my coloumn index eg I will color later. When I change the column value I loose all values, even if my event for column is empty.

 

Any idea ?

 

Regards

0 Kudos
Message 4 of 5
(2,463 Views)
Solution
Accepted by topic author sasko

You need to wire the 3D array across in all event cases. Else it resets to default (=empty array) whenever an unwired event case executes.

0 Kudos
Message 5 of 5
(2,453 Views)