From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

How to set the report path in a model plugin

Solved!
Go to solution

I am trying to figure out how to set the report path in a process model plug-in. I can seem to figure out how to get access to it. It seems like this would be a reasonable thing to do since the plug-ins are for results processing. Does anyone know how to do this? We typically use the Sequential process model but I am trying to keep my plug-in as independent of that as possible. 

 

Thanks.

0 Kudos
Message 1 of 5
(4,389 Views)

a) Where do want to set the report path from? For an NI report plugin, you can overide the GetReportFilePath model callback in a client sequence file.

 

b) Are you writing your own plugin? If so, what report file path are you trying to alter? One for your plug-in, or for an instance or instances of the NI report plugin?

0 Kudos
Message 2 of 5
(4,384 Views)

I would prefer not to do it in a sequence file callback. I want things to be consistent. I do have my own plugin and we create our own results folder for other stuff and I would like to make it so that if we used NI reporting (which we don't always do) that its report would be in the same folder as our other results files.

 

Thanks.

0 Kudos
Message 3 of 5
(4,382 Views)
Solution
Accepted by topic author Skeptical

If I understand, you want your plug-in, when enabled, to alter the settings of any other instances of the NI report plug-in such that their reports share the same directory as your plug-in is configured to use.

If so, your plug-in can access and modify the settings of all other plug-in instances. All instances are passed to all plug-in entries point in the plugins array sub-property of the ModelConfiguration parameter. You can iterate through this array. Any element of the array with a Base.SequenceFilename equal to "NI_ReportGenerator.seq" is an instance of the NI report plug-in. Its report options are stored in the element under PluginSpecific.Options.

 

You can change the report options to what ever you want. Note that the ReportOptions model callback is called from the Initialize model-plugin entry point, so you might want to ensure that your changes are applied after that, so they aren't overwritten. To do that, you could make your changes in the the Initialize entry point of your plug-in, and ensure that your plugin runs last. To make it run last, you could set the FileGlobals.ModelPluginComponentDescription.Default.Base.RunOrder in your plug-in file to a value greater than 0, such as 1.0 (see TestStand Help>>Fundamentals>>Process Model Architecture>>Process Model Plug-in Architecture>>Structure of Plug-in Sequence Files>>Model Plug-in Entry Points>>Order of Entry Point Execution at Run Time).

Message 4 of 5
(4,378 Views)

Thanks. I'm new to using plug-ins and this was very helpful.

0 Kudos
Message 5 of 5
(4,373 Views)