From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

I have an application where I need to compare two arrays, call them A and B. Each can be changed in size and

content. A is the primary array and is the master in terms of size and information. B is the slave and can be changed via operator input. How do I compare these arrays and implement the changes from both arrays into the primary array A programatically?
0 Kudos
Message 1 of 3
(2,569 Views)
content. A is the primary array and is the master in terms of size and information. B is the slave and can be changed via operator input. How do I compare these arrays and implement the changes from both arrays into the primary array A programatically?comparing two arrays is easy. Simply wire both arrays to the comparator (=).
You can then select compare aggregates (right mouse click on the = function)to see if the are different at all. You can also feed the array of booleans to the "or array elements" function in the boolean palette to see if any change is occuring.
Changes can be applied in a for loop or by replacing the primary array with the secondary.
greetings from the Netherlands
0 Kudos
Message 2 of 3
(2,569 Views)
content. A is the primary array and is the master in terms of size and information. B is the slave and can be changed via operator input. How do I compare these arrays and implement the changes from both arrays into the primary array A programatically?Take care with different array sizes. If you have two arrays with different
sizes and all elements are the same (for example [0,0,0,0] and [0,0,0]) the
comparison (=) of the two aggregates will be false.
If you compare the elements of those arrays you will receive an array with
the lenght 3 with [true,true,true].

Max

-> max.weiss@gmx.de / max@web.de <-
-> Max Weiß * Eulenweg 2 * 76356 Weingarten * Germany <-
-> Fax: 0180 505254775181 * Tel: 0175 1228001 * DB 8 MWE <-
0 Kudos
Message 3 of 3
(2,569 Views)