NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Relocating report file path at runtime

Solved!
Go to solution

Hi all,

 

I'm using parallelmodel to test DUT in parallel.

In the PreMainSequence, I connect to the DUT in order to ask its SN and PN.

And I set these 2 parameters in this sequence by : 

RunState.Root.Parameters.ModelData.TestSockets[RunState.TestSockets.MyIndex].UUT.SerialNumber = Locals.SerialNumber

RunState.Root.Parameters.ModelData.TestSockets[RunState.TestSockets.MyIndex].UUT.PartNumber = Locals.PartNumber

 

I'd like to store report file in the directory Root\PN\SN\Report.xml

for that, I setup XML report model with : 

Root\\$(UUTPartNum)\\$(UUT)\\Report[$(FileTime)][$(FileDate)]$(Unique).$(FileExtension)"

 

When I test, the report file is stored in : 

Root\Empty_UUT_PartNum\Empty_UUT_SerialNo\Report[16 13 44][29 11 2018].xml

 

So it means that PN/SN settings has been made too late.

 

How can I proceed, please?

If possible, without modifying ReportModel

 

Thanks for your help.

0 Kudos
Message 1 of 10
(2,865 Views)

Hi maxmont,

 

If memory serves me correctly, the ReportOptions callback is where those parameters are actually read in. So, if you try to set the path later than that, the path has already been committed and there isn't a mechanism (at least that I can think of) that allows for reconfiguration of the report path after that point. Are you able to try moving your DUT identification and path setting code to the Report Options callback? I think the main challenge here will be the fact that the test sockets aren't initialized at that point, so this may be a bit tricky depending on your architecture.

Regards,
0 Kudos
Message 2 of 10
(2,776 Views)

Hi all,

I work again on this topic since 2018.

And I didn't find the best solution.

in fact, it's possible to change report file path in "ReportOptions"callback. But in my case, at this step i don't know the S/N and P/N of the UUT.

S/N and P/N are readen into the UUT during MainSequence.

 

I see only one solution. Moving generated reports at the end the test process.

But I don't see where and when I can do that.

I don't see any model plugin callback which is fired at the end.

 

Does someone be able to help me, please?

 

Thanks in advance for your help.

 

 

0 Kudos
Message 3 of 10
(2,546 Views)

In your expression for the file path, you can use strings such as "$(UUT)"

These are all detailed in the link below:

https://zone.ni.com/reference/en-XX/help/370052W-01/tsref/infotopics/specifyreportfilepath_byexpress...

0 Kudos
Message 4 of 10
(2,529 Views)

I know that. But it's not possible in my case.

Report generator build report file path to early in "Model Plugin - UUT Start"

At the time, the UUT is not connected and I don't read S/N and P/N.

I set S/N and P/N in main sequence but the report file is already generated.

 

 

0 Kudos
Message 5 of 10
(2,518 Views)

What if in PostUUT, you use the report file path that's already generated, and then save that into the path that you want?  You could then delete the TestStand generated file.

0 Kudos
Message 6 of 10
(2,497 Views)

Thanks for your idea.

As I undesrtand report generation is asynchronous of test sequence.

So are we sure that in PostUUT callback the report is generated completely?

0 Kudos
Message 7 of 10
(2,485 Views)

I can answer to my question : 

I checked and PostUUT callback is raised before report file generation if report is configured as "New Thread Yes"

If I configure report as "New Thread No", it's working.

 

If I go in this solution, what is the contraint of generate the report in the same thread than sequence execution?

 

Thanks for your help

0 Kudos
Message 8 of 10
(2,477 Views)

I don't know of any constraints.  In my own work, I usually have to do something to the report in PostUUT, such as printing.  I've never had issues; I never set report generation to be in a new thread.

0 Kudos
Message 9 of 10
(2,462 Views)
Solution
Accepted by topic author maxmont

Finally,

I'm using PostUUT callback to move all report files at the end of the tests process.

To be sure that "New thead" option is disable, in ModelPluginConfiguration, I disable it for all reports with : 

Locals.CurrentPlugin.Base.NewThread = False in a foreach loop "Parameters.ModelPluginConfiguration.Plugins"

 

 

0 Kudos
Message 10 of 10
(2,444 Views)