NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

How to switch report-DLL in modell?

Hello,

i am using TestStand 2014SP1.

When i click in the menue-bar on Configure + "Result Processing" then i can select in a popup between Report,Database or Offline.

Currently Report is selected. There i click on the options-icon on the right side.

 

Question is now:

In the model I want to switch between two different layouts (default layout or from a custom dll).

Is this possible? Or is the only way to change report-settings in this popup-form?

 

Thanks

0 Kudos
Message 1 of 8
(3,940 Views)

Hi,

 

from my limited experience I think one way to do this would be to copy the modelsupport2.dll source code to <Teststand public>\components\Models\teststandmodels

 

make changes to to the copied version of c_report.c and rebuild the modelsupport2.dll using CVI

 

If you now want to swap between the two options you could use the dll version for the customised report and the sequence file versions for the standard version.

 

One step up would be to add a flag (standard or custom) to the c-code modifications which you hand over as an argument to the dll. Now create a new report plugin based on the original report plugin and make the flag customisable in the additional options.

 

Best regards

 

Mathis

Message 2 of 8
(3,936 Views)

Hi,

if i understand you correct you mean:

Modify the existing modelsupport2.dll so that it can handle both kinds of report-layouts which can be selected over a new argument.

 

>Now create a new report plugin based on the original report plugin and make the flag customisable in the additional options.

How can i do this? (You mean an additional entry in the "Result Processing" where i have currently Report, Database and Offline Results File?

 

And if i would have there an additional entry how can i select (enable) the cosseponding via teststep/statement-command?

 

Thanks

0 Kudos
Message 3 of 8
(3,933 Views)

Hi,

 

copy <Teststand dir>\components\models\modelplugins

to <Teststand public>\components\models\modelplugins

 

open the NI_reportGenerator.seq create a new sequence "Model Plugin - Configure Additional Options" (you need to match that exactly). Add a dialogue in this new sequence writing which reporting mode to use to a file global.

 

Go through the dll calls in the plugin and make sure that they get updated to hand over the additional argument from the file global.

 

In the Configure | "result processing" you will now have two configure boxes. The standard options and the additional options

 

If you want to create a plugin from scratch (or want to see what other sequences you can create to further customise your plugin):

Configure | result processing | show more options | Advanced ... | Create new process model plugin ...

 

Best regards

 

Mathis

Message 4 of 8
(3,929 Views)

Thaks for detailed description for way to modify the existing DLL.

 

If i would go the way to "Create new process model plugin ."  Then there would be a fourth entry in Configure + ResultProcessing.

How can i switch beetween the different plugins to enable/disable it?

 

Finally i need to switch in the modell between the two report-types.

RunState.IsEditor = true

{

//enable default reporting

}

else

{

//enable modified reporting

}

 

Thanks

0 Kudos
Message 5 of 8
(3,924 Views)

You can simply delete any sequences that you don't need.

 

If the choice between the two logging modes is that simple you could simply include the check in the "Model Plugin - Initialize" sequence and modify the file global there. File global is particularly helpful as it is confined to the plugin sequence file ... no risk of inadvertantly changing it elsewhere.

 

edit: I would always recommend adapting/extending existing plugins (or for what that is worth: also process models) rather than starting from scratch. NI has put years of development and bug fixing into those ... nothing you or me could catch up with in a couple of days 😉

 

edit2: I didn't fully understand the question at first. The plugins are auto loaded from the Teststand and public folders. If there are plugins with identical name in both folders the customised version in public gets used. If you rename an identically named sequence it will get loaded in addition to the other plugin it was previously overriding. If you want to override a built in plugin you will need to match the name of that. If you want to remove a custom plugin you will need to remove it from the public folder.

0 Kudos
Message 6 of 8
(3,919 Views)

But HOW would i select the needed plugin in the ifthenelse-part?

 

Currently there is the default Report "Report" which has the enabled [X] flag.

Later there will be another entry "Report_Modified".

 

Now i need an command to disable the default Report und enable the modified Report.

 

Thx

 

0 Kudos
Message 7 of 8
(3,914 Views)

I wouldn't use two plugins. Rather than having two plugins, one handling each case, I would have one plugin which is automatically determining in which mode it should run (or if need be, make it customisable through additional options).

 

The plugin is then simply calling the dll in the appropriate mode.

 

Btw this way you could also just use an external dll rather than modifying the modelsupport2.dll. Match each plugin dll call with it's modelsupport2.dll counterpart. Simply determine which mode the report generation should use and then put pre-conditions on all dll calls.

0 Kudos
Message 8 of 8
(3,912 Views)