NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

GetReportPath before MainSequence call

We are running 2012 with a flavor of the Sequential Model.  We are going to have the Report Path option set to "by expression" so we can set the folders based on Serial Number and other inputs we take from the operator at run time.  At the moment I'm duplicating this expression "by hand" just before the MainSequence call so that it will match the Report Options setting, but I don't like doing it this way.  I just found that the path gets calculated in Model Pugins - UUT Start in ModelSupport.seq which calls Model Plugin - UUT Start in NI_ReportGenerator.seq before Main Sequence, but it doesn't seem like this Path gets passed back out and it seems to get calculated again after Main Sequence is called in Model Plugin - UUT Done.

 

It seems like I'm overlooking something and the Report Path must be available before Main Sequence call even when using an expression. 

 

 

0 Kudos
Message 1 of 11
(5,508 Views)

Hey SmokeMonster,

 

There is a callback called GetReportFilePath which is called by the model plugin. This callback has a parameter containing the report file path, and is the recommended way to obtain this information in a sequence file.

 

By default in the report plugin, the GetReportFilePath sequence is called at the end of execution, in the model plugin's UUT Done sequence. If you wanted this callback to be called before MainSequence executes, you could modify the plugin. To do that, you'd want to open up the report plugin sequence file (located on my system at <TestStand Directory>\Components\Models\ModelPlugins\NI_ReportGenerator.seq). Then, if you go to the Model Plugin -- UUT Done sequence, you will see a step which calls the GenerateReportFilePath. You can select this step and copy it, and then go to the Model Plugin -- UUT Start sequence and paste it into that sequence. This will cause the GenerateReportFilePath callback to execute before the MainSequence in your client sequence file.

 

Hope that helps, and let us know if you need any more assistance!

0 Kudos
Message 2 of 11
(5,505 Views)

Note that the reason the report path is caclulated again after the UUT completes is that it might change. For example, the path might be confgured to depend on the status of the UUT.

 

 

0 Kudos
Message 3 of 11
(5,488 Views)

Hi Daniel,

 

I may be doing something wrong.  I dropped the GetReportFilePath call into Model Plugin - UUT Start in NI_ReportGenerator.seq just after the Determine Report File Path Expression If block.

 

I set a breakpoint in this sequence and can see that the report path is as I expect.  However, if I then drop a call to the SequentialModel.seq override in the model just before the MainSequence call the path is empty.  Btw, it seems strange to me that a sequence called GetReportFilePath would have a parameter called ReportFIlePath that is pass by value.

 

Edit:

 

Ok, so I see if I drop the GetReportFIlePath into my client sequence and put the breakpoint in there then the report I expect is magically appearing.  One thing is for certain that I am (as of this writing) clueless as to how this linkage happens.  If I look in NI_ReportGenerator.seq and SequentialModel.seq at this GetReportFilePath sequence it is empty.  And yet...when I drop it into my client empty the report path is there.  How does this happen?

 

Btw...because I have 6 people developing for me and 3 test stands to get these updates on, I try to minimize having to remember to do things like add sequence file callbacks to client files so that the report paths are properly available.  I prefer to make these things "behind the scenes" for them by putting things into the model when possible.  Is this possible or am I pretty much going to have to change sequence in ReportGen?

0 Kudos
Message 4 of 11
(5,474 Views)

Hey SmokeMonster,

 

The process model contains a sequence called GetReportFilePath which is configured as a callback (so it will appear in the list of callbacks in the client file). Since the report plugin also has s sequence with this name, TestStand automatically knows to call the GetReportFilePath sequence in the report plugin when that callback is used in the client ssequence file.

 

Generally speaking, the easiest way to get this information into the client file is to modify the plugin in the method described previously, and then just use the GetReportFilePath callback. Model plugins such as the report generation are a framework-level piece that you would want to be consistent across your various development machines, so I think modifying the plugin as we previously discussed would achieve the same results as putting any code in the model. Actually, it'd be a bit more difficult to do this in the model because we would need to navigate into the property hierarchy for the reporting model. The callback is much simpler.

 

Also, what are you using the report path for in your sequence? Seeing an example of how it's used might help us come up with a more appropriate workaround for your test system.

Message 5 of 11
(5,462 Views)

My developers get their updated source code via Team Foundation Server with a Get Latest command.  If I can get the code into the model file that sets the report path they have to do nothing anywhere (either at their desks where they develop, or at our three test stands).  Instead, they are having to go in and add callbacks to all of their client sequence files and have to copy paste updated NI_ReportGeneration files onto their machines (granted, we certainly could automate this but that is still brute force-ish in my mind).  If we are talking easy, why aren't accessor/setter sequences provided out of the box for some of these things that people clearly are interested in setting programmatically?  

 

Btw, we want the path ahead of Main Seqeuence so that any data they generated during the run that we don't want to go specifically into the report we can still put it in the same directory.

0 Kudos
Message 6 of 11
(5,410 Views)

Hey SmokeMonster,

 

It is possible to get the report information in the process model, but it's a bit less intuitive. You'd need to index into the array of model plugins and get the path from there. One thing to keep in mind about this approach is that it's dependent on the order of your plugins as configured on the Configure > Result Processing screen. If this will never change (for most developers, it doesn't) then there shouldn't be any problems. Otherwise, you could include a check to make sure it's the correct plugin.

 

The actual path to this data in the model  is going to start off as Locals.ModelPluginConfiguration.Plugins[0].PluginSpecific.RuntimeVariables. If you set a breakpoint in your Sequential model, you can navigate to this location at runtime and see the data associated with the plugin. Notice there is a "UUTReportFilePath" member inside the RuntimeVariables container. This UUTReportFilePath property has a comment which describes in which situations the path will be stored here. If it's not stored in this location, it'll be stored inside the PerSocket container as described in the comment.

 

 

I do think adding get/set functionality as you describe could be helpful for these situations. I wanted to point you to our TestStand Idea Exchange here: http://forums.ni.com/t5/NI-TestStand-Idea-Exchange/idb-p/teststandideas  Our R&D team monitors this forum and does include customer suggestions in future versions of the software. That would be a great place to submit this suggestion.

0 Kudos
Message 7 of 11
(5,382 Views)

Hi Daniel,

 

Thanks for your reply.  While I was waiting I think I have a solution that is workable for us that takes a minimal amount of modification to NI_ReportGenerator.seq.  I'm wondering, is there a quick and dirty way that I can have anything that points at this file (located in the default installation directories) to point to a different location for where this file will be?  I'm thinking , again, something I can edit in the model file that will point at this new location? 

0 Kudos
Message 8 of 11
(5,370 Views)

Hey SmokeMonster,

 

One simple way to do that would be to put your modified copy of the file in the <TestStand Public>\Components\Models\ModelPlugins, which on my computer is: C:\Users\Public\Documents\National Instruments\TestStand 2013\Components\Models\ModelPlugins.  If you leave the file named NI_ReportGenerator.seq, it will supercede the version of the report plugin stored in the <TestStand> directory. 

0 Kudos
Message 9 of 11
(5,356 Views)

But how is that being accomplished?  Via search directory paths or something more explicit in the model or model support side?

0 Kudos
Message 10 of 11
(5,351 Views)