LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I write a cluster of an array to a file that can be looked at with other applications?

I have a cluster of array that are different data types. How do I write this to a file, so that other applications can read it, i.e. notepad etc?
0 Kudos
Message 1 of 4
(2,700 Views)
It kind of depends on what you're looking for. You could use the built-in "Write to XML" functions, or head over to the OpenG libraries and use their "Write INI Cluster" (writes a cluster to .ini file format).
0 Kudos
Message 2 of 4
(2,690 Views)
XML and INI files would be most useful - especially if you're going to read this information as settings, or even in some sort of web application.  If you're going to be reading these values using excel, you may want to consider using the Write to File vi and using either return characters or commas to separate values.

To do this, open a reference to a file, and using a for loop iterate through each of the values of the array.  Using the Write to File vi, write the value of the array and append either a new line character (\n) or a comma.

To get started, just open the Example Finder (Help -> Find Examples ...) and look for File I/O examples.
TheDillo
0 Kudos
Message 3 of 4
(2,667 Views)

Each elements of the array has a cluster of different data. It is unbundled and separated by a comma , then converted to a string. It is indexed out to a CSV array and then written to a spreadsheet file. The spreadsheet file reads it and outputs a CSV array. This is then going into for loop to reassemble the string output to its original clustered data representation. The iterations puts the clusters back into the array at the correct indexed position.hint: the for loop is the key to manipulating the array data...this VI is like an egg to a chicken and chicken to an egg, whatever came first?

0 Kudos
Message 4 of 4
(2,279 Views)