05-24-2018 05:42 PM
Hello everyone,
I'm not sure what a problem is and how to name it so please excuse my confusing subject. Basically, I had a subVI which converts a 2D string array into a 1D string array and also eliminate unwanted elements in the 1D array. So I called that subvi in another vi where the input is a 2D string array which has different column sizes:
a b c
d e
f
so LV automatically fills in the blank with either empty string or "0" if the array is a double array.
Since I have two different arrays, I want the subvi to be executed simultaneously, but every time I run this vi, the array outputs from my convert2Dto1Darray keep appending on the results from the previous run rather than update the output arrays even though in that subvi I created an invoke node for both input and output arrays to programmatically reinitialize the arrays to their default values which are an empty array.
It did some research on simultaneous run on subvi and has set shared clone reentrant execution on the subvi, but it didn't fix the problem.
Any help would be greatly appreciated!
MV
Solved! Go to Solution.
05-24-2018 06:24 PM
The shift register is uninitialized, so it keeps data from previous runs. Feed an empty array in to initialize it.
05-24-2018 06:36 PM
Fixed! Thank you so much Gregoryj!!
05-24-2018 06:39 PM
Please attach the actual VI instead of pictures and snippets. Your entire code seems extremely convoluted With way too much duplicate and inefficient code, but yest, the uninitialized shift register is the main cause of your observed problem.
LabVIEW does NOT support "ragged" arrays, so all rows (or columns res.) of a 2D array are the same length.
05-24-2018 07:38 PM
What I want to do is to load multiple csv files, then compare the data in those csv data in pairs, say that I have 3 csv files (can be more than 3)
first.csv
second.csv
third.csv
I need to compute the differences of the data in first and second, first and third, second and third, then compare the three differences with the threshold (come from sampling bunch of data), output the ones that lower than thresholds and their associated file names to a table.
I know the way I code is hard to follow but I can't think of any better way to do this.
MV
05-25-2018 10:38 AM
05-25-2018 12:07 PM
Hi altenbach,
Sorry for not posting that missing vi. I hesitated to include that vi because it's still under construction and super super messy. I've been getting headache about that vi for a few days. Anyways thank you so so much for all the helpful feedback and suggestion! My main vi has been simplified DRAMATICALLY with the conditional tunnel method and as you suggested, finally I found the way to combine the operation of the two for loops in one. It was so obvious and easy but somehow I couldn't see it
Thanks again!
MV