NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

TestStand 2012 Change: the UUT data type now contains a new "part number" field

 

As UUT.PartNumber is now part of the UUT data type with TestStand 2012 can we have a Macro added to allow this to be used for the result file name (or is there an undocumented one already)?

 

Also I would suggest using the PropertyExists function in the result path expression so it will work with any process model (including those that may not have the variable in this path.  So :

 

"<ClientFileDir>\\<ClientFileName>_Report[<FileTime>][<FileDate>]<Unique>" + (PropertyExists("Runstate.Root.Locals.UUT.PartNumber") ?  Runstate.Root.Locals.UUT.PartNumber : "" )+".<FileExtension>"

 

Regards,

 

Chris

0 Kudos
Message 11 of 19
(2,466 Views)

Hi Chris,

 

We appreciate the feedback!  Adding this macro is under consideration for a later release.

Al B.
Staff Software Engineer - TestStand
CTA/CLD
0 Kudos
Message 12 of 19
(2,453 Views)

Hey Chris,

 

In the meantime, you could use the following workaround to add the part number field to your report file name:

 

1. Select to specify report path by expression

2. For sequential model, use the following:   PropertyExists("Parameters.UUT.PartNumber")?Parameters.UUT.PartNumber:"")

For batch/parallel test socket, you can use:   PropertyExists("Parameters.TestSocket.UUT.PartNumber")?Parameters.TestSocket.UUT.PartNumber:"")

 

 

As Al mentioned, adding a macro is under consideration for a later release, but for now, you can use the above process to get the functionality.

0 Kudos
Message 13 of 19
(2,435 Views)

I'm trying to use the PartNumber field in TestStand 2013 with Specify Report File Path by Expression to store results in a PartNumber specific sub-folder.

 

Here is what I use:

 

"C:\\Sonus\\Reports\\" + (PropertyExists("Runstate.Root.Locals.UUT.PartNumber") ?  (RunState.Root.Locals.UUT.PartNumber + "\\") : "" ) + "[SN_<UUT>][<FileYear> <FileMonth> <FileDay>][<FileTime>][<UUTStatus>].<FileExtension>"

 

Using the sequential model and Test UUTs, this expression works fine IF I define a PartNumber.

 

If I don't define a PartNumber, HTML reports are created in the parent folder (as I would expect), but when I select Stop to end Test UUTs I get a TestStand run-time error.

 

Specifically:

 

Details:

The precondition for the step 'Read Entire Socket Report' could not be evaluated.
Error in argument 1, 'Parameters.ModelPlugin.PluginSpecific.RuntimeVariables.PerSocket[RunState.TestSockets.MyIndex].Path', in call to the expression function 'FindFile'.
Pathname is invalid.

Error Code:

-17204; Pathname is invalid.

Location:

Step 'Read Entire Socket Report' of sequence 'Model Plugin - End' in 'NI_ReportGenerator.seq'

 

So the expression works, but NI_ReportGenerator.seq fails if Runstate.Root.Locals.UUT.PartNumber does not exist.

 

 


Now is the right time to use %^<%Y-%m-%dT%H:%M:%S%3uZ>T
If you don't hate time zones, you're not a real programmer.

"You are what you don't automate"
Inplaceness is synonymous with insidiousness

0 Kudos
Message 14 of 19
(2,306 Views)

You have to make sure that your partnumber does not contain any characters that are invalid in a path.  Just taking the part number as entered by the user could cause the issues you are having depending on the part number value.

Chris 

0 Kudos
Message 15 of 19
(2,295 Views)

@ChrisAtNSN wrote:

You have to make sure that your partnumber does not contain any characters that are invalid in a path.



My part numbers will come from a LabVIEW Combo Box that I will control. There will be only valid folder names.

 

The expression actually works with the exception that if the UUT.PartNumber is not defined (not all of my sequences will include the part number), the NI provided NI_ReportGenerator.seq throws a run-time error; but only after I try to stop execution. I can run multiple UUTs with distinct serial numbers and generate reports, the run-time error only occurs after stopping the sequence.

 

 


Now is the right time to use %^<%Y-%m-%dT%H:%M:%S%3uZ>T
If you don't hate time zones, you're not a real programmer.

"You are what you don't automate"
Inplaceness is synonymous with insidiousness

0 Kudos
Message 16 of 19
(2,288 Views)

So, after setting a breakpoint in the offending NI sequence and looking at my expression, I discovered that UUT.PartNumber always evaluated as TRUE (the property always present); so even when UUT.PartNumber was empty, the logic added an additional "\" creating an invalid path.

 

I added an AND to check if the length of UUT.PartNumber was > 0 and was able to fix the problem.

 

"C:\\Sonus\\Reports\\" + (PropertyExists("Runstate.Root.Locals.UUT.PartNumber") && Len(RunState.Root.Locals.UUT.PartNumber) > 0 ?  (RunState.Root.Locals.UUT.PartNumber + "\\") : "" )  + "[SN_<UUT>][<FileYear> <FileMonth> <FileDay>][<FileTime>][<UUTStatus>].<FileExtension>"

 


Now is the right time to use %^<%Y-%m-%dT%H:%M:%S%3uZ>T
If you don't hate time zones, you're not a real programmer.

"You are what you don't automate"
Inplaceness is synonymous with insidiousness

0 Kudos
Message 17 of 19
(2,272 Views)

I'm picking up an effor that has been idle for a year or more where a previous programmer added a few fields to the UUT container everywhere it appears (I think) as mentioned in previous posts, but these new fields don't appear anywhere in our report files so I know something is left to be implemented.

 

Basically, we want to add a handful of rows to what displays in the header of ATML reports.  Is there a built in way to do this once the fields have been added to the UUT container?

 

Thanks

0 Kudos
Message 18 of 19
(2,157 Views)

Hi SmokeMonster,

 

If you navigate to "Configure >> Result Processing" and select the crossed wrench and hammer icon on the line item for your ATML report you will see the Report Options dialog.  In the dialog, it lists the style sheet which is being used to generate the header for the report. You will want to navigate to that location (mine is at C:\Program Files (x86)\National Instruments\TestStand 2014\Components\Models\TestStandModels\ATML\StyleSheets) and make a copy of that file.  You will have to edit the xml code in that style sheet and save it with a new file name.  Then, in your report options, change the style sheet to the newly formatted style sheet. Here's  fourm post that deals with editing the ATML header:

 

Customizing ATML report header

http://forums.ni.com/t5/NI-TestStand/Customizing-ATML-report-header/td-p/2155572

 

and another which deals with doing the same for XML headers"

 

How to modify a TestStand XML Report Header

http://digital.ni.com/public.nsf/allkb/17ABBD0BF2A60D908625774200798869

 

 

Regards,
0 Kudos
Message 19 of 19
(2,136 Views)