NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Runtime: Get absolute ReportDirectory Specified by an expression (SpecifyByExpression)

Situation:

- My report options are set to SpecifyByExpression and as expression:

  "P:\\Data_Log\\<FileYear>\\<ClientFileName>\\<UUT>[<FileDate>][<FileTime>]_<UUTStatus>.<FileExtension>"

- In my sequence I generate pictures(.png) from measurements using this example:

  How to Insert a LabVIEW Control Image into a TestStand Report

  This example gets the path from the NI Teststand automation API: RunState.Report->Report->TempFileDirectory

- On that moment RunState.Root.Locals.Report is empty and

  RunState.Root.Locals.ReportOptions.Directory is the default: U:\

 

Problem:

This generates the picture in the temporary directory and I want it to be created in the final report directory.

I want to convert the expression to an absolute path and if possible without the extension (otherwise I just add the .png)

 

Any sugestions?

0 Kudos
Message 1 of 5
(3,312 Views)

If you use and Expression to determine the location of the report then there is some extra code that gets executed in your entry point. 

 

The path you want is: RunState.Root.Locals.ReportFilePath.  You will then have to trim off the name of the file to get the directory.

 

Hope this helps,

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

Thank you for your reply jiggawax,

however in my case this is not true: during runtime RunState.Root.Locals.ReportFilePath contains the TEMP path.

I've checked this with and without On-The-Fly Reporting

I know that there is also a parameter called: RunState.Root.Locals.ReportOptions.UseTemporaryFile but this is even False....

I have ran the sequence with test UUT's

 

I hope this extra info rings a bell...

 

0 Kudos
Message 3 of 5
(3,291 Views)

That's odd because RunState.Root.Locals.ReportFilePath gave me the expression path and....

 

RunState.Root.Locals.ReportOptions.Directory gave me the default path.

 

If you look in the Process Model in Test UUTs you will see the step that is setting that variable.  It is called Determine Report File Path Expression.  It is embedded in an If statement.  There is also another one later on but that's only if you used the new file for each uut option.  Try putting a breakpoint in there and see if that step is actually getting called.

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

I have found de bug(ger), thank you.

 

I indeed followed the process model (sequential) in C:\Program Files\National Instruments\TestStand 2010\Components\Models\TestStandModels

After Test UUT's->Determine Report File Path Expression   the reportpath was, as odd as it was, indeed the temporary directory.

 

However... some further in the sequence (after Mainsequence Callback) there was another file path generation step dependant on the UUTstatus (passed/failed/terminated)

(at the first reportpath step there was also something mentioned about UUTStatus)

I have the macro <UUTStatus> defined in my expression, so that rang a bell.

 

I removed the macro from my expression and now as you mentioned my reportpath is correct!

 

Afterwards this is logical because earlier the path can't be known.

 

Conclusion: don't use <UUTStatus> if you want to use the reportpath...

 

 

0 Kudos
Message 5 of 5
(3,276 Views)