NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Changing 'DisableReportGeneration' boolean at runtime results in Macros error...

Solved!
Go to solution

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

 

CropperCapture[16].Png

Message Edited by Believer on 08-21-2009 05:07 PM
TestStand 4.2.1, LabVIEW 2009, LabWindows/CVI 2009
0 Kudos
Message 1 of 7
(4,325 Views)

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 

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
0 Kudos
Message 2 of 7
(4,304 Views)

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

TestStand 4.2.1, LabVIEW 2009, LabWindows/CVI 2009
0 Kudos
Message 3 of 7
(4,292 Views)

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.

 

CropperCapture[24].Png

TestStand 4.2.1, LabVIEW 2009, LabWindows/CVI 2009
0 Kudos
Message 4 of 7
(4,291 Views)

OK - one last finding if anyone is interested.

The error is generated by calling DetermineReportFilePathNameExpr in modelsupport2.dll

 

CropperCapture[25].Png

 

 

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.

 

 

 CropperCapture[26].Png

 

TestStand 4.2.1, LabVIEW 2009, LabWindows/CVI 2009
0 Kudos
Message 5 of 7
(4,288 Views)
Solution
Accepted by topic author Believer

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

Message 6 of 7
(4,282 Views)

Hi Anand,

 

Thank you for looking into this and coming up with the workaround so quickly.

That solves my problem.

 

Thanks again,

 

Ronnie

TestStand 4.2.1, LabVIEW 2009, LabWindows/CVI 2009
0 Kudos
Message 7 of 7
(4,274 Views)