NI TestStand

Showing results for 
Search instead for 
Did you mean: 

Process XML data from LV

Go to solution

Hi, BRAND SPANKING NEW GUY here, with what is probably a quite Newb question:


Levelset: LabView & TestStand 2014


In Labview, I have a VI that takes data from an XML file, processes it, and spits out another XML File

The Output is:

Name, Raw Score, Grade

In Test stand, I want to run the VI, Take the output file, and report

Name  Grade, Pass(/Fail) based on the raw score... < 60 = Fail

All I have been able to do successfully is to create a report with all the elements from the output XML (1 element per line)




1. Is there a way to create a report with more then 1 element reporting per line?


Name: John

Score: 100

Grade: A

Name: Fido

Score: 50

Grade: F



John, A, Pass

Fido, F, Fail



2. How do I read & USE the XML data, producing an element that was not in the XML?


0 Kudos
Message 1 of 7
Accepted by topic author Pat.McCarthy

Let's say you have LabVIEW code that creates 3 arrays for Name, Raw Score, and Grade by doing the parsing that it seems you are already able to do.


In TestStand, you use a For loop to get each element of the 3 arrays.  Then, you have a None adapter step that is a Numeric Limit Test.  The Data Source for this step is the Raw Score and set the limits to be less than 60.  In the post expression, you could add the line Step.Name = Name[i] + ", " + Grade[i].  (i is the  index of your For loop.)


I don't think I understand what you're getting at with your second question.


Pulido Technologies LLC

Message 2 of 7

I think this may help with that other part:


For example, say my current report is






Class Grade Report [Out]:


   Class Grade Report [Out][0]:



Tom Jones





   Class Grade Report [Out][1]:



Johan Dough






I would like to render it differently, like this: (Some sort of multi-variable formatting structure perhaps?)






Class Grade Report [Out]:



Tom Jones       77.325           C        Pass


Johan Dough  55.075           F         Fail

0 Kudos
Message 3 of 7

What you propose changing looks like it could be done by modifying the stylesheet for your XML file.  And really, I don't think this part of your question has anything to do with TestStand.


Pulido Technologies LLC

0 Kudos
Message 4 of 7

Ummmm... The file In question is the TestStand stock report.......


Part 1: handle data from LabView currently being sent to an XML file

Method: LabView passes 3 arrays to TestStand. Who cares how labview does it's XML output file...

Test Stand does the processing in a loop to get all elements

(Done... well, I have a place to begin to work)


Part 2: Have Test Stand display the results in the stock report

Part2a - can the stock report be modified in some fashion


0 Kudos
Message 5 of 7

To me it doesn't sound like you really want to change the data, just the way it is displayed, which is controlled by the stylesheet, not TestStand.  It looks like you might be using report.xsl; I would try changing to horizontal.xsl and see if some minor modifications to horizontal.xsl gets you what you need.


You could modify reportgen_xml.seq, but that only modifies how data is saved as an XML file, not how it's displayed when converted to HTML.


Pulido Technologies LLC


Message 6 of 7

In the end, I got what I needed by relying on LabView.

I used it to concatenate the data I needed into 1 string, then passed that out as a simple array that teststand could report


The above was all an attempt to solve a challenge posed to me (Yes, I was told I could use the forum if I got stuck)

In the end, my mentor was pleased with the result. So, I thank you for pointing me in the right directions



Oh, Also did a dive into XSL StyleSheets... That was interesting... (Kind of the way it is "Interesting" to watch a car crash but....)

0 Kudos
Message 7 of 7