LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Parsing XML Files in LabVIEW

Hello,

 

Currently, I am trying to Parse attached XML File generated from Test Stand using Easy XML which contains TWO Test Results from Two different sequences. Please find the attached VI, which I am using. I have tried different options to parse both the Test Results by changing cluster constant as mentioned in below snapshot. Can you please let me know where I am going wrong? Thanks.

 

Regards,
Karthik

Download All
0 Kudos
Message 1 of 12
(9,430 Views)

I think you didn't attach the XML file(s). You instead attached a docx file with screenshots of the XML files in Notepad++. We can't use those to test the VI. Can you upload the actual XML files you want processed?


GCentral
0 Kudos
Message 2 of 12
(9,399 Views)

Hello Cbutcher, Thanks for your response. Please find the attached XML file. Also, I have observed that not all the values are generated from the XML to Cluster in the VI. Let me know your comments. Thanks.

 

Regards,

Karthik 

0 Kudos
Message 3 of 12
(9,371 Views)

What's not working?

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 4 of 12
(9,357 Views)

There are several XML "packages" for LabVIEW.  All that I've tested are "self-consistent", that is, if you generate XML from LabVIEW structures, you can parse that XML and get the structures back.  However, I'm less sure that they are "cross-consistent".  In particular, the code generated by TestStand might not be exactly the same "flavor" of XML as JKI's EasyXML.

 

Have you tried reading your XML file with NI's XML functions?  [Too bad you don't have a smaller, simpler example ...].

 

Bob Schor

0 Kudos
Message 5 of 12
(9,350 Views)

Hello Bill, Currently, the XML file generated from Test Stand contain results of two test sequences executed in Parallel. While I am parsing, I am able to parse the data related to only one test sequence (Not all elements). I am unable to parse the data for another test sequence which is available in the same XML file. I had tried to change the Cluster constant to match the XML format, but I did not have any luck parsing both the test results from the XML file. Thanks for your support.

 

Karthik

 

0 Kudos
Message 6 of 12
(9,331 Views)

For me, reading an xml file with anything is a slow and tedious effort and I just have to keep chugging away until I finally get it right.  It sounds like you mostly have it right, because if you can read one test, you are very close to reading them all.  It could be almost as simple as putting your code in a loop.

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 7 of 12
(9,325 Views)

Hope the file you have shared is not the proper XML Formatted data.

For well XML Formatted data you can use http://xmlgrid.net/

Which will give you parsed data and even xpath can be generated using that tool.

----------------------------------------------------------------------------------------------------------------
Palanivel Thiruvenkadam | பழனிவேல் திருவெங்கடம்
LabVIEW™ Champion |Certified LabVIEW™ Architect |Certified TestStand Developer

Kidlin's Law -If you can write the problem down clearly then the matter is half solved.
-----------------------------------------------------------------------------------------------------------------
Message 8 of 12
(9,316 Views)

@Karthik_Moog wrote:

Hello Bill, Currently, the XML file generated from Test Stand contain results of two test sequences executed in Parallel. While I am parsing, I am able to parse the data related to only one test sequence (Not all elements). I am unable to parse the data for another test sequence which is available in the same XML file. I had tried to change the Cluster constant to match the XML format, but I did not have any luck parsing both the test results from the XML file. Thanks for your support.

 

Karthik

 


What is basically missing is that you need to have an array of tr:ResultSet and label this array trc:TestResults. Also, since you have the JKI Easy XML toolkit it would be much simpler to directly use the Easy Read XML File vi.

Using Easy Read XML File.png

Ben64

Message 9 of 12
(9,294 Views)

@ben64 wrote:

@Karthik_Moog wrote:

Hello Bill, Currently, the XML file generated from Test Stand contain results of two test sequences executed in Parallel. While I am parsing, I am able to parse the data related to only one test sequence (Not all elements). I am unable to parse the data for another test sequence which is available in the same XML file. I had tried to change the Cluster constant to match the XML format, but I did not have any luck parsing both the test results from the XML file. Thanks for your support.

 

Karthik

 


What is basically missing is that you need to have an array of tr:ResultSet and label this array trc:TestResults. Also, since you have the JKI Easy XML toolkit it would be much simpler to directly use the Easy Read XML File vi.

Using Easy Read XML File.png

Ben64


I was close.  😄

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 10 of 12
(9,277 Views)