It is easy in LabVIEW 7. Use the flatten to XML function.
The result is an XML respresentation of the cluster as follows
my cluster
3
Numeric
1.00000E-6
Numeric 2
1234.89543
String
the string data
The only drawback I see is that doubles are formatted with only 5 digits
precision, kind of useless for what I want to do.
Bill Watts wrote:
> I need to find a way to output my cluster of indicators (string and
> numeric) values (Over 100) that is stored in a global vi, to an ASCII
> (not binary) text file. Ideally I'd like to be able to write the
> cluster element name and value(s).
>
> i.e.:
>
> Indicator Labels, Indicator Values
>
> Test 1 Upper Limit, 100 (Numeric)
> File Path, c:\Test.txt (String)
> Channels, 100, 200, 300, 400 (Array)
>
> The flatten to string gives a binary output, as does the Write (data)
> File vi. The Write Characters To File vi won't accept the cluster
> format (unless I first flatten to string ? which gives be a binary
> output) , neither will the Write To Spreadsheet File vi.
>
> I have gone through the laborious effort of connecting every cluster
> element to a separate indicator in a separate vi, labeling each
> indicator to the same name as the cluster elements. I was surprised
> that the indicator didn't take on the name of the cluster element, as
> I created the indicator by left clicking to the option menu. If that
> worked I was hoping that I could then create an attribute node that
> would have the label text, unfortunately the attribute node will only
> access the caption (which is not set), not the label.
>
> Even if the attribu
te method worked, I'd end up with a massive amount
> of wiring. There's got to be a better way.
>
> I thought this was going to be trivial.
>
> Bill