NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

report file sequential model expression

Solved!
Go to solution

Greetings Everyone,

 

     I am trying to create a way to place the reports that are generated by TestStand into a good place that will be easy for anyone to retrieve.  I've figured out with the help of searching this forum, a way of saving the reports to a "Passed" or "Failed" folder.

 

     Here is my situation, most of the code that I've written has multiple sides to it.  For instance, one program will test the circuit card at three different levels.  What I would like to do is send the Pass/Fail data to a specific directory with regards to that particular level of testing.  I tried using an If..Then statement in the Reports Options callback for Statement setting the "ReportFileSequentialModelExpressions" field, but I get ActiveX errors.  I tried creating a FileGlobals with specific paths in a If..Then at the beginning of my MainSequence, but that didn't work either.

 

     What I really want to do is be able to save the reports to C:\Temp\Stage1\Failed, C:\Temp\Stage1\Passed, C:\Temp\Stage2\Failed, C:\Temp\Stage2\Passed, C:\Temp\Final\Failed and C:\Temp\Final\Passed.  Is this possible or am I wishing too much.  Thank you all for your consideration with this question.

 

Regards,

 

Scott

    

0 Kudos
Message 1 of 5
(3,713 Views)

What version of TestStand are you using?

 

Assuming you're using the SequentialProcessModel you'll want to take a look at Locals.ReportFilePath in that process model. The default behavior is to configure the report file path BEFORE the test executes. Which means that overriding the usual callbacks won't buy you much because you're wanting to write to a specific directory based on the results of the test.

 

So, you have a few options:

 

  1. If you're using TestStand 2010 take a look at the 'Specifying Report File Paths by Expression' in the TestStand Help. There is an option for using the <UUTStatus> as part of the file name in Configure->Report Options. You can also point to a variable that could change based on other conditions.
  2. Add a callback before the Write UUT Report step in the process model that will pass in Locals.ReportFilePath based on the results of the test and then override that callback in your client sequence file.
  3. Change the TestReport callback by adding a pass/fail parameter and report file path parameter similar to step 2, just using an existing callback.
CTA, CLA, MTFBWY
0 Kudos
Message 2 of 5
(3,698 Views)

Hi snowpunter,

 

     Thank you for your reply.  Sorry that I didn't mention that I'm using TestStand 2010.

 

     Option 1 that you describe, I understand that as I figured that out first and have that working.

 

     It seems that option 2 would probably work for me.  Let me understand this a little bit since this is still very NEW to me. You are talking about adding a callback before "Write UUT Report".  Looking at the SequentialModel.seq, I find that in "Test UUTs" and "Single Pass" sequences just after sequence call "Remove Root Tag from XML Report" the ActiveX/COM Action, Write UUT Report", Is this the section of the process model that you are talking about and what specific callback would I use for this?  How do I tie the Locals.ReportFilePath in the SequentialModel.seq to the variable I’d like to use in the main sequence?  I have a Message Popup at the beginning of my main sequence that asks the operator to choose the test that they wish to perform and the variable will be set at that point that I wish to use in sending the report to the appropriate place.   

 

     Look forward to your next reply.  Thank you.

 

Regards,

 

Scott

0 Kudos
Message 3 of 5
(3,691 Views)

If the idea of callbacks is new I'd point you to Chapter 10 in the TestStand Reference Manual, this DevZone article and the three examples in the Examples/Callbacks folder for TestStand.

 

Short answer, the process model contains the variable used to store the report file path. The client sequence file you are running needs to get a user input to that variable. This is what callbacks are for.

CTA, CLA, MTFBWY
Message 4 of 5
(3,687 Views)
Solution
Accepted by Scott754

Greetings snowpunter,

 

     Thank you for the reply and sorry that I hadn't replied sooner, but I needed some time to review the information that you provided.

 

     It helped me out and I found a solution that works repeatedly.  Basically I added one line to the SequentialModel.seq file and a few Locals and a StationGlobals to my Client File.  After figuring out the flow of the SequentialModel.seq during execution of the Client File I came up with this.

 

     I added the following line between "Post UUT Callback" and "Test Report Callback" in the SequentialModel.seq file, f(x) Statement-> "Locals.ReportOption.ReportFileSequentialModelExpression = StationGlobals.SpecifyByExpression".  In the Client File I made the StationGlobals.SpecifyByExpression equal the Locals variable that is set when the user selects the test that they wish to perform.  The result is exactly what I was looking for.

 

     Thanks again for your asistance.

 

Regards,

 

Scott

0 Kudos
Message 5 of 5
(3,663 Views)