LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Dynamic array

Solved!
Go to solution

Hi.

By using netDDE im acquiring more than hundred data from a plant. 

DDE Advise Check Multi.vi scans all channels but outputs only changed data using refnum as an index.

I was able to build a 2D array with refnum and changed data.

Actually i would like to build a dynamic array where:

1).data from new scan is the same as the previous if DDE Advise didnt output that data

2) data from new scan is updated 

Of course the size of the las array must be always the same i.e. the number of my data channels.

Does anybody have a smart way to do that?

Thank You very much

Antonio

 

0 Kudos
Message 1 of 7
(3,834 Views)

Hi Antonio,

initialize an array with the size you need, use the last valid value to initialize it. Update the changed values by reference and you should have what you want.

 

Mike

Message 2 of 7
(3,831 Views)

Ciao Mike and thank You for your fast replay.

Just another question, the core of my problem

How to update an initializzated array by using indexing?

 

Antonio

0 Kudos
Message 3 of 7
(3,814 Views)

Hi Antonio,

you can use a for loop. See the attached example please. You can do with the result what ever you want, for example add it to your 2d array.

 

Mike

0 Kudos
Message 4 of 7
(3,801 Views)

Hi Mike:

I tried the attacched vi.

But something strange is happening: at every loop the array size increases.

It seems like it add new element on array, and not change it.

What do you think?

 

Antonio

0 Kudos
Message 5 of 7
(3,790 Views)
Solution
Accepted by Yixiao-uncle

Hi Antonio,

change the "Insert into Array" function with "Replace Array Element".

 

Mike

Message 6 of 7
(3,786 Views)

..just Perfect.

 

Grazie

 

Antonio

0 Kudos
Message 7 of 7
(3,782 Views)