LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to built XML data using labview?

Hello Everyone,

 

I'm trying to built an XML data as shown in the figure. The XML file will have a customized data which we required for our project.

 

Well, I've tried many ways which was not helping me till now. And i cannt obtain the XML result shown in the figure.

Here I attach my original code.

 

Kindly someone suggest to built such an XML file. 

 

Thanks in Advance.

Regards

 

XML data.png

 

<?xml version="1.0" encoding="UTF-8" ?><bts version="1.0">

 <cmd>inquire</cmd>

 <list count = "1">

  <inquire ip="127.0.0.1" devtype="25" devid="54" subdevid="1" chlid="1" aux="0">true</inquire>

 </list>

</bts>

Download All
0 Kudos
Message 1 of 5
(997 Views)
dd
0 Kudos
Message 2 of 5
(928 Views)

Hi Gaolong,

 

you forgot to attach all those subVIs…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 3 of 5
(912 Views)

Honestly there is nothing special about XML except for the header and tag rules it's just a text file.

 

Creating one just comes down to a bunch of String manipulation.

 

Right off the top of my head I would probably have the XML header and footer somewhat hard coded, maybe in a text file so they can be updated without code changes.

 

I would build a string for each line using the standard number to string methods if numeric values from the test must be inserted into the XML.

 

Then write each line to a text file as I go, save it with a .XML extension and you are done. 

 

Don't worry about the indentation as that is just to make it more human readable.

 

 

========================
=== Engineer Ambiguously ===
========================
0 Kudos
Message 4 of 5
(869 Views)

Jumpod_0-1686887975406.png


You can find them in the labview example.
your xml is more basic than show in the sample.

 

please set this as ANSWER or KUDO this post, if it help you.


Message 5 of 5
(837 Views)