NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

How to Refer to a StationGlobal Variable in an XSL Report File?

Hi,
I am trying to add new information, like the part number (PN), to the header of the TestStand report. However, I’ve tried several approaches, and none have been successful. Here’s what I’ve done so far:

 

What I Tried:
Adding the following snippet to the XSL file:

 

<td style="font-weight:normal;">Test PN</td>
<td>
              <xsl:value-of select="StationGlobals/Test_PN"/>
</td>

 

Attempting this alternative:

 

<td style="font-weight:normal;">Test PN</td>
<td>
              <xsl:value-of select="$StationGlobals.Test_PN"/>
</td>

 

Issue:
The new field "Test PN" appears in the report header, but its value is always empty.
I encounter this error for the second method:
"A reference to variable or parameter 'StationGlobals.Test_PN' cannot be resolved."

 

How can I correctly reference a StationGlobal variable in the XSL report file?
What configuration steps are required to ensure that the StationGlobal variables are included in the XML report?


Any guidance or examples would be greatly appreciated! Thank you in advance for your help.

0 Kudos
Message 1 of 4
(109 Views)

I'm absolutely no specialist on XSL files... sorry if my question is naive....

 

The XML you are appliying the XSL to does contain the tags and values you are referring to, doesnt it?

0 Kudos
Message 2 of 4
(92 Views)

In all the latest versions of TestStand, Part Number will already go in the Report Header if it's filled in.

 

In a PreUUT or PreBatch callback, you can just fill in the PartNumber in Parameters.UUT.PartNumber with the string you want and then it will go on the report without changing the XSL.

 

For other things in the  Header, you can just use the Parameters.UUT.AdditionalData. Anything in here will also be put in the header. It will use the name of the variable as the first element in the header table, and the value as the second. You would use expressions like this in PreUUT to add to this:

 

Parameters.UUT.AdditionalData.SetValString("TEST PROCEDURE", 1, FileGlobals.TestProcedure),
Parameters.UUT.AdditionalData.SetFlags("TEST PROCEDURE", 0, PropFlags_IncludeInReport),

 

That would add the the table element "TEST PROCEDURE" with my value from the fileglobals.

0 Kudos
Message 3 of 4
(80 Views)

Thank you so much, this is helpful

0 Kudos
Message 4 of 4
(47 Views)