LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Is there a way to write data to xml that can give me the following format - I can not get it with = signs etc

<?xml version="1.0" encoding="utf-8" ?>

 

<Machine  CreatedDate="06/09/2010" MachineSN="AAAA3" HEADTYPE="green" HEADSN="Head1"  LENS="LEN1" TEST="TEST1" TESTERS="10134194">

 

  <Amp Value="18">

    <TempTest Value="Head1">39</TempTest>

  </Amp>

 

  <Amp Value="20">

    <TempTest Value="Head1">132</TempTest>

  </Amp>

 

 

  <Amp Value="22">

    <TempTest Value="Head1">43</TempTest>

  </Amp>

 

</Machine>

0 Kudos
Message 1 of 7
(3,052 Views)

Those are called XML-attributes, I don't know about the native LabVIEW interface, but the JKI-easy XML toolkit has the ability to read and write those attributes.

 

Ton

Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
Nederlandse LabVIEW user groep www.lvug.nl
My LabVIEW Ideas

LabVIEW, programming like it should be!
0 Kudos
Message 2 of 7
(3,038 Views)

You can also do this with the XML functions. See the example I posted in this thread: http://forums.ni.com/t5/LabVIEW/XML-Attribute/m-p/791538

0 Kudos
Message 3 of 7
(3,024 Views)

hi,

Thank you for your help, I seemed to miss the attributes!!! It should satisfy my needs I will try it out

Thanks once again

0 Kudos
Message 4 of 7
(3,001 Views)

Hi,

I have another question that I have not managed to do - How can I convert a bundle (graph) to XML? Is it possible to put an XML element in a for loop - will it add a new child every time? I think that I could do that if it is possible instead of converting a bundle to XML?

0 Kudos
Message 5 of 7
(2,993 Views)

If you are using the XML Parser VIs then you need to create your own schema and you need to use the XML Parser functions to create the necessary nodes. If you use the Flatten to XML functions then these use the LabVIEW schema, and the cluster is automatically converted to XML.

 

As for your question regarding children, you can create the nodes any way you want. Yes, you can use a loop to create multiple children for a node. Please refer to the documentation on the XML Parser VIs if you are using them. There are also examples that ship with LabVIEW.

0 Kudos
Message 6 of 7
(2,986 Views)

The flatten to XML is not good enough for my needs, I will take your advise and learn more about the parsers, thank you for the help

0 Kudos
Message 7 of 7
(2,982 Views)