10-21-2011 01:30 AM
Strange, I can not find any example in the teststand folder.
I would have expected it in the "callbacks" folder, but even a "ReportOptions" search in de examples folder gives not the right result.
Google brings me to this post and for the rest not very helpful results... (that is the disadvantage of google's interactive search engine)
I have attached what I am trying to achieve (a stripped version of it)
About your second-last post: I think I have that already: I only have 1 sequence file (in the original 1 I do have more sequences however)
Should I also call the ReportOptions callback in my mainsequence? Or are the static parameters automatically overwritten?
10-23-2011 09:21 AM
Hi,
the problem with your setup is that when ReportOptions is called by the engine the static values will be passed to the ReportOptions sequence which will over write any values you have stored in Parameters.ReportOptions inside the ReportOprions sequence. Then in you statement which contains RunState.Root.Locals.Parameters.ReportOptions = Parameters.ReportOptions, all you are doing is effectively writing back the original values.
Try putting you setup into a locals within ReportOptions sequence eg Locals.ReportOptions. Then in your Statement step all you need to do is Parameters.ReportOptions=Locals.ReportOptions.
The next problem is your expression in ReportFileSequentialModelExpression because FileGlobals.OrderNumber is not available in GetReportOptions which calls the ReportOptions.
Therefore, you have to build up your string in the ReportOption Seqquence such that
Parameter.ReportFileSequentialModelExpression = Parameters.ReportFileSequentialModelExpression + FileGlobals.OrderNumber + <the remainder of the string>.
Or instead store OrderNumber in StationGlobals.
Hope this helps you
10-24-2011 01:17 AM
Thank you for your reply, this indeed seems to work (I will accept it, when I tested it at the operator machine).
But it solves at least the problems on the developer machine.
Quote: the problem with your setup is that when ReportOptions is called by the engine the static values will be passed to the ReportOptions sequence which will over write any values you have stored in Parameters.ReportOptions
Ok.... Do you know by any chance why NI has chosen fo such an aproach?
In my eyes it is more logical if "parameters" are also used as User-defined parameters.... now they have zero use, right? (they are just overwritten with the static ones)
I moved my Ordernr to StationGlobals and now my sequence indeed runs.
(I think this gives more clarity than building my expression in 2 steps...)
Again, thanks a lot
11-15-2011 01:05 AM
Sorry for the late acception....
In the mean time I found a linked problem: Include runtime info in report file path --> that person has sought the solution in overwriting the runtime version of ReportOptions.
For him that works the best because he wants to alter his reportname dependant on a step in the mainsequence.
(A step resulting in F, P, or M that needs to be added before the report name)
I cross-link his solution as well so you can use what works for you best:
His (ArtyBear's) solution:
First, the ReportOptions callback can't add runtime info to the ReportOptions variable, because the callback gets called before the UUT number is entered (i.e. before the pre_uut callback).
Modifying the basename property, as suggested above, did not work for me, but the following similar code did work:
RunState.Root.Locals.ReportOptions.ReportFileSequentialModelExpression = "\"<ClientFileDir>\\\\TestStand Results\\\\" + Locals.Mode + "Test_<ClientFileName>_Report_PN<UUT>_<UUTStatus>_<Unique>.<FileExtension>\""
There are two gotchas:
1. The first you might notice is the double-escaping of the string. The ReportFileSequentialModelExpression is a string value, and, apparently, it must contain a value that can be evaluated as a string. So it needs extra quotes, which are escaped (\"), and then the escaped backslash needs to be doubled, so that the resulting string has an escaped backslash.
2. The other gotcha is with the macros in the string (e.g. <UUT>, <Unique>, etc.). If they are entered in the "Report Options" dialog, then they must exist in the ReportFileSequentialModelExpression. Otherwise. TestStand gives the following error:
Details: List of macros used by expression of report file path cannot be modified during execution.
Code: -17500; Operation Failed.
Location: Step 'Determine Report File Path Expression' of sequence 'Test UUTs' in 'SequentialModel.Seq'
If you needed to change which macros are used, you may be able to do so using the ReportOptions callback, since it gets called so early in the execution. If that works, you may need to update the Parameters.ReportOptions.ReportPathMacroListString variable to contain all of the macros that you'll use during runtime. Kudos to anyone who verifies this possibility.
I hope that helps others who are looking for this capability.
11-15-2011 03:29 AM
For me the solution of Artybear does not work because I use RunState.Root.Locals.ReportFilePath to determine a folder.
ArtyBear alters RunState.Root.Locals.ReportOptions.ReportFileSequentialModelExpression, but the ReportFilePath is not automatically updated.