NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Modifying report header in model file

Hi,

 

I am quite new to Teststand and hence need some help in getting a solution to this. I have  to pass some addtional data , a value of a variable declared in client sequence file to the Report header section . I am aware of doing this by using callbacks such as Pre-UUT and Modify report header. I don't wish to use a call back in the Main sequence file/client file . Is there way i can do this process model file? In the process model file just after the Main sequence call back, i would like to pass the value of this variable(local variable in main seq ) to the Report header . Is there any possible way of doing this?

 

 

Thanks

Arijit

0 Kudos
Message 1 of 6
(4,748 Views)

Which version of TestStand are you using?  It makes a huge difference.  In the newer versions this is done in the Plug-In.  In the older versions you could just modify the report header directly in your Process Model.

 

Regards,

jigg
CTA, CLA
testeract.com
~Will work for kudos and/or BBQ~
0 Kudos
Message 2 of 6
(4,734 Views)

I am using Teststand 2013

0 Kudos
Message 3 of 6
(4,730 Views)

Because you are using Plug-Ins I recommend you understand them first by reading this document: https://www.ni.com/docs/en-US/bundle/teststand/page/process-model-plug-in-architecture.html

 

It depends on which type of report you are generating but I will assume it is either HTML, XML or ATML.  If this is the case, and you are positive that you cannot override the ModifyReportHeader callback in the client, then here is the way to go about it-

 

First I recommend copying the NI_ReportGenerator plugin and creating your own plugin.  Although this isn't necessary it is wise because then you can still fall back on the native one if needed.

 

Once you do this then in the ModifyReportHeader callback sequence you can edit the header by editing Parameters.ReportHeader.  I just tested this and it works.

 

The trick is getting your data from MainSequence to this sequence.  You have several options.  You can queue it up in a step just after MainSequence and dequeue it in ModifyReportHeader.  Or you can add it as an attribute to the UUT variable (which gets passed to the UUT Done plugin entry point).  Either way you need to somehow precondition everything so that when you run a client that doesn't have the extra header info it doesn't error out.

 

Hope this helps.  Let me know if you have any quesitons or concerns.

 

Honestly, the easist way to do this is just simply override the ModifyReportHeader callback in your client.

 

Cheers,

jigg
CTA, CLA
testeract.com
~Will work for kudos and/or BBQ~
0 Kudos
Message 4 of 6
(4,719 Views)

Hi,

 

Thanks for sharing the link. Below is the summary what i had tried doing:

 

1. I used statements such as

Parameters.UUT.AdditionalData.SetValString("Manufacturer.Name",1,"National Instruments")

Parameters.UUT.AdditionalData.SetFlags("",0,PropFlags_IncludeInReport)

 

to pass additional data in report header.

 

2. These statement calls where placed in Modelplug in -UUT start sequence and it works fine.

 

Now if i look at the process model file/model-plug in, where exactly i can put statements mentioned above to pass data after Main sequence callback?

I tried this by adding those statements in Modelplugin-UUT done, but it is not working. I have to pass data after executing the Client sequence file, this data is nothing but a numeric value which will indicate the number of passed steps in the Client sequence file.

 

 

0 Kudos
Message 5 of 6
(4,702 Views)

I'm wondering why you cannot override the ModifyReportHeader callback in your client?  Seriously, your life would be so much easier if you could do this.

 

However, if you are set on not doing this then, like I stated before, the trick is getting the data from MainSequence to the ModifyReportHeader in the plug-in sequence file.

 

To be honest the simplest way (but kind of a hack) would be to use TemporaryGlobals.

 

As the last step in your MainSequence place the following statement in a Statement Step:

RunState.Engine.TemporaryGlobals.SetValNumber("NumPassedSteps", 1, Locals.NumPassedSteps)

 

Locals.NumPassedSteps would be the variable that stores the value you want in the report header.

 

Then in ModifyReportHeader sequence in the model Plug-In sequence file you can access the TemporaryGlobal by doing:

RunState.Engine.TemporaryGlobals.NumPassedSteps

 

I recommend that you precondition any step that accesses this with a PropertyExists API call so you don't get runtime errors on the clients that aren't creating this.

 

Hope this helps,

jigg
CTA, CLA
testeract.com
~Will work for kudos and/or BBQ~
0 Kudos
Message 6 of 6
(4,691 Views)