LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how to save a cluster into a spreadsheet file ot text file

Hello

 

im new at labview, so im sorry if the question is too simple

 

How can I save a cluster to spreadsheet or text file, i saw it can be easely saved into a binary

 

but i have no knowladge to work with binary

 

thank in advance

0 Kudos
Message 1 of 9
(20,576 Views)
One simple way to do it is to use the Flatten to XML function. This will use the LabVIEW schema to generate a string that you can write to a text file. OpenG also has functions that will convert a cluster to a string that you can write to a text file. As for a spreadsheet, that may not be the most suitable or straightforward way to do it. What is the structure of the cluster?
0 Kudos
Message 2 of 9
(20,566 Views)

Hi,

 

I am also currently facing the same problem.

I'm trying to write a cluster of 3 elements( 1 string and 2 integers) into a spreadsheet or text file, which i can access outside of labview.

How can I go about in doing this?

Thanks

0 Kudos
Message 3 of 9
(19,966 Views)

I would unbundle the elements and use Format to String to create a line for the CSV/tab delimited file.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 4 of 9
(19,961 Views)

however, mine is actually an array of clusters, and i'm trying to send this into a text file in the format as shown in the attach file.

 

Any idea to go about in this?


my purpose is when I change the value in the input array of cluster, it will update on the test file itself.

Currently my method is keep importing the values of the inputs into the file without appending.

 

 

0 Kudos
Message 5 of 9
(19,951 Views)

This is basically what crossrulz was saying. You just need to loop through your elements now instead of having a single element. Bad idea though, to save on every value change. You should give the user a save button. No need to write to a file every time a value changes. Could you imagine if every program you had was writing to a file every time a single value in the config was updated! It's a bit of overkill. However, because it's what you requested, it's what I have shown in this example.

 

 

0 Kudos
Message 6 of 9
(19,942 Views)
Spoiler
test.png

 

Message 7 of 9
(19,918 Views)

Nice...

 

In an avoidance of MAX I built an array of clusters which allows a settings tab to dynamically select and configure a subset of PXI counter behaviors (count, measure frequency, super easy to expand) and my intent was to save off profiles to a human readable/editable file.

 

You saved me at least half an hour.  I will return the favor one day.

 

thanks,

-methods

0 Kudos
Message 8 of 9
(13,468 Views)

Test Results:

* The human readable output in the spoiler above came out perfect, good exercise for regular expressions, but hard to scale with a monster cluster as you have to grind into the fussy.

 

* The XLM functions are insanely simple.  Data string not so human readable...  but you can read the XML *good enough* to get you out of a pinch.  

 

Flatten to XML wins in my case for being so insanely clean.  Who knew you could feed an array of clusters into a yellow box and get on with your business :-).

 

HumanRead.jpg

 

thanks,

-methods

 

EDIT:  of course both ways

HumanReadFull.jpg

Message 9 of 9
(13,462 Views)