10-14-2019 06:46 AM
Hello everybody,
I have a 3-D complex array (eventually it can have higher order) and I need to save and, using another VI, read this array. The solution I found here in the forum was use the Binary File VI's.
Now I am having trouble to recover the N-dimentional array after I open with the Read Binary File VI. The output array have the correct dimension, but all the information are concentred in only one dimension (as it was a 1-D array).
I can't resize the array, because in the original aplications the sizes is not know a priori and also the original array have a lot of elements, so sometimes when I use the resize array VI, my computer doesn't have enough memory to complete the operation.
I synthesized how I am saving and reading in the VI attached here (LabVIEW 2015).
I hope anyone can help me.
Thank you all in advance
Frederico
Solved! Go to Solution.
10-14-2019 07:39 AM
10-14-2019 08:08 AM
Hi GerdW
Thank you for your message!
Do you mean only change for True the input in the "prepend array" in Write Binary File VI?
It doesn't retourn the array I am expecting.
Regards
10-14-2019 08:25 AM
10-14-2019 09:05 AM
Frederico,
I've taken the liberty of rewriting your VI (using LabVIEW 2018, but I suspect the results will be similar in earlier versions). I've simplified some of the steps by using defaults, didn't use some functions (like Deny Access, as I assumed you were not multi-tasking here), and used the Prepend Array Size so that LabVIEW would be able to reassemble the Array knowing the order and size of its dimensions. By writing and testing a little Demo routine such as this, I was able to remind myself of some "facts" about multi-dimension Array I/O I had forgotten (I've rarely used more than 2 dimensions in an array).
Here is my VI:
The first part is essentially your code, but with the Prepend Array Size switch turned on. Assuming there are no Errors, I re-open the file, ignore the file size, and tell it to read in a 3D Complex Array, namely the thing that I wrote! And guess what -- it returns a 3D Array, which I then compare (using Equal?) and ensure that all of the (3-D array of) Booleans are True, meaning I read in an exact copy of the Array I wrote out.
Bob Schor
P.S. -- For a little more fun, try writing more than one 3D array, and then attempting to read them in "all at once" (instead of one-at-a-time). Be sure to look at what comes out -- hint, it is not a 3D Array, and is also not a 4D Array (try to understand why NI/LabVIEW chose this reasonably-logical Data Structure for this output).