07-12-2011 08:40 AM
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.
Thanks so much
Jingles
Solved! Go to Solution.
07-12-2011 09:01 AM
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"
07-12-2011 09:48 AM
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.