LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

clear an array after test

Solved!
Go to solution

Hi all

 

I've just been busy with a vi, and have worked out a way to test between two arrays, and output the missing numbers from the first array compared to the second. I take these numbers from two lists in separate text files. These lists are placed in arrays, and then compared against each other. The problem im dealing with is that after Labview has run once, it stores the values last collected, and places teh next ones on top of the previous, and therefore the arrays get bigger and bigger and bigger. I need the arrays to run once, clear, and then be able to run again giving new results. The difficulty is the text files will be changing all the time from an outside code, and the output array needs to keep up to date with the input arrays. This is my code so far.

Testarray.JPG

 

Thanks so much

Jingles

Testarray.JPG

0 Kudos
Message 1 of 3
(3,531 Views)
Solution
Accepted by topic author jingles

It looks like you've got a couple things going on that are causing the trouble.

 

First. Those feedback nodes- they are "Globally initialized" by default right click show initializer terminal and write an empty array to them (Alternately replace with shift register and initialize them to be empty.

 

Second. you can avoid the two loops by replacing them with an array size, multiply array elements and reshape array

 

Here is a PNG of both "fixes"1.png


"Should be" isn't "Is" -Jay
Message 2 of 3
(3,523 Views)

As Jeff already hinted, your code is very convoluted for such a simple taks and also thrashes the memory. Try to find an "in place" solution.

 

Why is there a representation mismatch at the end? Since you are reading and keeping only the integer parts, it seems useless to carry out the entire thing with DBL types.

 

 

0 Kudos
Message 3 of 3
(3,506 Views)