NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Custom Report Expression in PARALLEL model

When I was using the sequential model, I was able to create a report name expression that contained runtime variables by including the $(UUTStatus) macro.

 

(If you don't use this, the expression is evaluated well BEFORE your sequence is called, and you may not have some variables defined.  By including the macro, TS evaluates the expression after your sequence has completed, and so you can use your own variables in the expression)

 

I am now using the parallel model, and I want to do the same.  However, the parallel model errors whenever I include a custom variable, and it fails at initialization.  It seems that even though I am including $(UUTStatus) the initialization is evaluating the expression and double checking for the existence of variables at init!  But I want to include information from the run in the file path.

 

Any ideas how to get this to play well?

This is ugly, but it works under the sequential model (I tried to break these down into smaller strings, but got errors every time, so it's just ugly)

 


Parameters.ReportOptions.ReportFileParallelModelExpression =
"\"c:\\\\TestData\\\\[$(UUT)]_[\"
+Str(RunState.Root.Parameters.TestSocket.StartDate.Year,\"%d\")+Str(RunState.Root.Parameters.TestSocket.StartDate.Month,\"%02d\")+Str(RunState.Root.Parameters.TestSocket.StartDate.MonthDay,\"%02d\")+\"_\"
+str(RunState.Root.Parameters.TestSocket.StartTime.Hours,\"%02d\")+str(RunState.Root.Parameters.TestSocket.StartTime.Minutes,\"%02d\")+str(RunState.Root.Parameters.TestSocket.StartTime.Seconds,\"%02d\")+\"]_[\"
+ runstate.root.Parameters.TestSocket.UUT.additionalData.prodStage+\"]\\\\[$(UUT)]_[\"
+Str(RunState.Root.Parameters.TestSocket.StartDate.Year,\"%d\")+Str(RunState.Root.Parameters.TestSocket.StartDate.Month,\"%02d\")+Str(RunState.Root.Parameters.TestSocket.StartDate.MonthDay,\"%02d\")+\"_\"
+str(RunState.Root.Parameters.TestSocket.StartTime.Hours,\"%02d\")+str(RunState.Root.Parameters.TestSocket.StartTime.Minutes,\"%02d\")+str(RunState.Root.Parameters.TestSocket.StartTime.Seconds,\"%02d\")+\"]_[\"
+ runstate.root.Parameters.TestSocket.UUT.additionalData.prodStage +\"]_REPORT_[$(TestSOCKET)_$(UUTStatus)].$(FileExtension)\""

 
Notice that I need to have "prodStage" set into the name of the output folder + filename, and this is determined by operator input.

 

Note to save time:
1) I cannot change the format of the path/filename.

2) I have tried to wait for the file output in some simple location and to copy it, there are reliability issues with that.

 

I really just need to solve this issue.

(I am also looking through modelsupport2.dll code to see where this might trip up, but the error is vague ("Possible System Error: Exception occurred".  Looking at model support code, it looks like it's handled just like the sequential model)

0 Kudos
Message 1 of 4
(666 Views)

Here is a simpler expression that also causes an error:

Parameters.ReportOptions.ReportFileParallelModelExpression =
"\"c:\\\\exoData\\\\DeviceTests\\\\[$(UUT)][$(UUTStatus)]\" + RunState.Root.Locals.STRING + \".$(FileExtension)\""

 

If I sub out the property with a string in \" \" quotes, it works fine.

0 Kudos
Message 2 of 4
(644 Views)

Please help.  I need a solution to create a file path of the following format with the parallel model...

 

c:\PATH\[SN012345]_[Static_Test_Name]_[20230701_131211]_[Static_Tag_Name]\[SN012345]_[Static_Test_Name]_[20230701_131211]_[Static_Tag_Name]_REPORT.XML

 

Ideally the "Static_Tag_Name" could be read from a variable set by the operator during Pre-UUT, but that's not a major concern right now.

 

Problems with the parallel model:  I cannot format the time correctly.  Using the macros ($(FileDay), etc), gets me this...

c:\PATH\[SN012345]_[Static_Test_Name]_[2023726_2 29 03 PM]_[Static_Tag_Name]\[SN012345]_[Static_Test_Name]_[2023726_2 29 03 PM]_[Static_Tag_Name]_REPORT.XML

 

I have tried to modify the expression to use variables in memory, but in parallel mode the expression won't validate before Pre-UUT-Loop if you have variables in the name (That is, I got this to work in Sequential Mode, but if you try and use sequential mode settings with a parallel mode report, you get problems)

0 Kudos
Message 3 of 4
(597 Views)
0 Kudos
Message 4 of 4
(580 Views)