LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

3D string array to file

How can I write a 3D string array to file?
0 Kudos
Message 1 of 5
(3,232 Views)
First convert 3D array to spreadsheet string, then write to file. To extract from file, read from file and convert spreadsheet string to 3D array. Sorted. I have included a LV 6.0 vi showing writing and reading from file for you.

I hope this helps!

Kim
0 Kudos
Message 2 of 5
(3,232 Views)
sascha:

You could do this a lot of different ways.

The first and most obvious thing that comes to my mind is that you can
think about a 3D array as an array of 2D arrays. (For that matter a
2D array is an array of 1D arrays.)

Thus you could use a for loop to index your 3D array down to 2D and
then perform multiple writes to write each 2D array "element" of this
array of 2D arrays to disk. You would probably want to write some
sort of header which defines how many dimensions there are in the
array so that whatever reads it back later will have an easier time
reading it back. (Otherwise you'd have to implement EOF handling for
the read back portion.)

To read it back you just use the same logic but build a 3D array using
a 2D read inside a for loop.

Dou
glas De Clue
LabVIEW developer (looking for a job... 😞
ddeclue@bellsouth.net




sascha.sickel@iav.de (SaschaS) wrote in message news:...
> How can I write a 3D string array to file?
0 Kudos
Message 3 of 5
(3,232 Views)
I would just like to add...if you dont want to be able to read (by eye) the file very easily you can wire the 3D array directly to the write to file function, without converting to spreadsheet string first. This is actually slightly more efficient on memory, but the file is alot harder to read (by eye).

Kim
0 Kudos
Message 4 of 5
(3,232 Views)
This helped me also. Thanks! 🐵
0 Kudos
Message 5 of 5
(3,232 Views)