11-25-2011 10:29 AM
Hello,
I am trying to save a 4D Array (Array[4000] [3] [20] [5]) of UINT in a File. I can do it through "write in binary File". But then I can´t load it. I know I can transform my Array down to 1D Array of 1.200.000 Elements (4000*3*20*5) of UINT. When I load it, I have to transform it back (with a lot of "for-looping") back to 4D. But is there an easier way of doing that?
I was not able to find a solution in this forum - I am sorry if I made a new thread if there is already a solution in this forum.
Best regards
Solved! Go to Solution.
11-25-2011 11:01 AM
Use Reshape Array. It is expandable to as many dimensions as you need. First convert the 4D array to 1D to write the data to the file. After reading the 1D array from the file, use Reshape again to restore the 4D format.
The Write to Binary File will accept any data format. The Read Binary File will read data from any file. If you tell it what the data format is, it will interpret it for you. It works for me for a small test 4D array. Read the detailed help for more information.
Lynn
11-25-2011 11:14 AM - edited 11-25-2011 11:15 AM
As Lynn said, there should be no extra code required.
When writing, make sure that "prepend size" is true (true is default) and when reading, wire an empty 4D array of the correct representation to the "data type" input.
(I also assume that your LabVIEW version is not extremely ancient)