11-27-2008 02:20 AM
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
Solved! Go to Solution.
11-27-2008 02:44 AM
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
11-27-2008 04:17 AM
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
11-27-2008 05:52 AM
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
11-27-2008 06:43 AM
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
11-27-2008 06:48 AM
Hi Antonio,
change the "Insert into Array" function with "Replace Array Element".
Mike
11-27-2008 06:51 AM
..just Perfect.
Grazie
Antonio