08-21-2009 07:05 PM - edited 08-21-2009 07:07 PM
Hi Everyone,
In the SinglePass model I wish to alert the user if Report generation is disabled and give the opportunity to turn it on for this sequence run.
This is done as the last step in the Get Report Options sequence.
To turn it back on, I write False to: Parameters.ReportOptions.DisableReportGeneration
But then TestStand balks a few steps later with the error: "List of macros used by expression of report file path cannot be modified during execution".
Any ideas what I am doing wrong? All I have changed is a boolean in the ReportOptions container parameter. Is this not legal?
Thanks,
Ronnie
Solved! Go to Solution.
08-24-2009 02:38 AM
Ronnie,
i don't know what the reason for the error is. But i recommend you not to alter the process model just for this single feature.
Why?
Altering the process model has a direct effect on every sequence you execute with it. So probably this is unwanted. Additionally, you maybe bind the process model to certain sequences/user interfaces. This is not recommended by any means!
What then?
Since DisableReportGeneration is fetched in before your MainSequence from the process model but used during TestReport Callback, you have plenty of time to check/change this value. You even can include a step in your MainSequence....
I'd rather recommend you to use process model callbacks like PreUUT to handle this. But be careful: In regard to the sequence you use to check/change this value, so changes you lookup string!
hope this helps,
Norbert
08-24-2009 10:28 AM
Hi Norbert,
Thanks for your advice, but believe me, I'm not altering the process model for this feature alone.
The design is indeed for every sequence, and so the Process Model is much changed to accomplish
what we want. It's one of the strengths of TestStand as you know.
That said, the error about macros seems unrepresentative of the issue at hand.
Would you be able to direct this post to someone at NI who has actually worked on this part?
Thanks,
Ronnie
08-24-2009 10:44 AM
Doing some more investigation I discovered that the error occurs if I modify the variable anytime after the ReadReportOptionsDefaultsExpr call.
So perhaps I have to modify the CVI call instead.
08-24-2009 11:17 AM
OK - one last finding if anyone is interested.
The error is generated by calling DetermineReportFilePathNameExpr in modelsupport2.dll
Tracing down into the CVI module, the code erroneously decides that I've changed the file path macro,
just because I changed the Parameters.ReportOptions.DisableReportGeneration variable. Simply not true.
08-24-2009 11:33 AM
Believer,
I agree that the "Macro list change" check should not error out when you enabled report generation. This is a bug and we will fix it in a future version of TestStand.
As a workaround, in report options callback, you can add an expression to set "Parameters.ReportOptions.CheckIfMacroListIsUnchanged" to False whenever you enabled ReportGeneration.
Hope this helps
Regards
Anand Jain
National Instruments
08-24-2009 11:54 AM
Hi Anand,
Thank you for looking into this and coming up with the workaround so quickly.
That solves my problem.
Thanks again,
Ronnie