LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Save number to array each time it changes

I have a number that changes it's value, it keeps the previous value until changed again. How can I store these values in an array? I only want the value once, not the samples where the number has the same previous value. This number indicator is placed inside a while loop. See small picture.
 
-Christian

Message Edited by Christian_nor on 12-15-2005 04:22 AM

0 Kudos
Message 1 of 3
(2,650 Views)
Hi Christian:

You can place a Case Structure in which TRUE condition has an InsertIntoArray function.

That's not the most elegant solution as InsertIntoArray must not be inside a loop, but it works for you.

If you know how many changes will be, you can preallocate an array of that size, and the ReplaceArraySubSet.

Hope it helps,

Aitortxo
CLD
Aitortxo.
0 Kudos
Message 2 of 3
(2,641 Views)

Hi,

Look at this VI

I used events to detect value change of number and store the old values

If you want to store the new values,  wire 'new value' data node in the event to insert array instead of 'old value' data node

Regards

Dev

 

0 Kudos
Message 3 of 3
(2,639 Views)