LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to write a 3D array to file(spreadsheet) and read it back later as a 3D array.

How to write a 3D array to file(spreadsheet) and read it back later as a 3D array.
0 Kudos
Message 1 of 5
(11,521 Views)
There's a couple of ways. If you use Write To Spreadsheet.vi, put it inside a for loop and wire the 3D array to the 2D data input. You'll write your data in 2D chunks. You'll also want to write some header information such as number of rows per 2D write and the number of "pages" written (size of third dimension). To read it back, use Read From Spreadsheet.vi inside of a for loop. Use the header information to determine number of rows to read, to specify the start of read offset, and the number of times to run the for loop. If you wire the all rows output through the for loop, you'll have a 3D array. Another way to do it is to write to a separate Excel worksheet for each 2D page.
0 Kudos
Message 2 of 5
(11,520 Views)
The "Array to Spreadsheet String" and "Spreadsheet String to Array"
functions support N-dimensional arrays.
Make your own VIs to convert the array to string and write the string to
file and read it back.

Jean-Pierre Drolet

"Sukidi" a écrit dans le message news:
506500000008000000A0260000-993342863000@exchange.ni.com...
> How to write a 3D array to file(spreadsheet) and read it back later as
> a 3D array.


LabVIEW, C'est LabVIEW

0 Kudos
Message 3 of 5
(11,520 Views)
> How to write a 3D array to file(spreadsheet) and read it back later as
> a 3D array.

Try this way:
Write to file by 'Write File' function (set boolean 'header?' to TRUE) and
read this by Read File wit connected to input 'byte stream type' constant 3D
data array (you can copy your 3D data indicator or control to diagram - it
will be changed to constant).
It's very good way to wite and read 'user formated' clusters so will work
with 3D arrays too I hope.

best regards
Zbigniew StS
Message 4 of 5
(11,520 Views)
hi, I am encountering the same problem of saving and retrieving 3D arrays.
Since my 3D array is way too huge, 101x181x2500, so if I:
1)try to save it as multiple 2D spreadsheet files, it would be too many;
2)try to use "array to spreadsheet string", LabVIEW popped the msg that "not enough memory" (PS: why??? I have no other windows threading running)
3)try to save all the 2D arrays into a single spreadsheet file by setting "append to existing file". All the 2D's goes to a single sheet ... and would not be able to display completely when the file is opened.

I do want to try the way save all 2D's into a single Excel spreadsheet file but have each sheet to have only a 2D array. Could anyone tell me how to write up the header to make this?

Many thanks.
(refer to my post by http://forums.ni.com/ni/board/message?board.id=170&message.id=100309#M100309 if you have a second)
0 Kudos
Message 5 of 5
(11,480 Views)