NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Complete a report path

I'm was trying to programmatically complete the report path.

The log is saved correctly if I define the list below in the de callback "ReportOptions":

Parameters.ReportOptions.ReportFileSequentialModelExpression = "\"C:\\\\DataLog\\\\<FileYear>\\\\" + FileGlobals.ProductCode + "\\\\<UUTStatus>\\\\<UUT>_Report[<FileDate>][<FileTime>]<Unique>.<FileExtension>\""

 

But what I want to do is to complete the "Parameters.ReportOptions.ReportFileSequentialModelExpression"(which is "C:\\DataLog") with "\\<FileYear>\\" + FileGlobals.ProductCode + "\\<UUTStatus>\\<UUT>_Report[<FileDate>][<FileTime>]<Unique>.<FileExtension>\""

 

Something rough like below would be in the "ReportOptions":

Parameters.ReportOptions.ReportFileSequentialModelExpression += "\\<FileYear>\\" + FileGlobals.ProductCode + "\\<UUTStatus>\\<UUT>_Report[<FileDate>][<FileTime>]<Unique>.<FileExtension>\""

 

 

0 Kudos
Message 1 of 12
(6,053 Views)

Hi InspectorGadget,

 

Which version of TS are you using? I will attach a sequence for TS 2014 that uses a FileGlobal called CustomReportOptions which sets all the ReportOptions manually. This is then set within the ReportOptions callback.

 

You can use the macros listed within the "ReportPathMacroListString" within the "ReportFileSequentialModelExpression". A full list of possible macros can be found by searching for "macros" within TS help. These must be contained within the macro list string property in order to be used within the file name. 

 

I hope this helps, let me know how it goes.

 

Pete Woodward

Certified LabVIEW Architect
0 Kudos
Message 2 of 12
(5,968 Views)

Hello PWoodward,

 

I use TS2014, forgot to mention this.

 

What I want to do is set 'c:\test' in de second tab of the 'Report Options'.

In the test sequence I want to define the rest of the path.

 

Parameters.ReportOptions = "C:\\test".

Fileglobals.AdditiveString = "\\Report $(UUT)$(Unique).xml"

 

Parameters.ReportOptions += Fileglobals.AdditiveString

 

gr,

0 Kudos
Message 3 of 12
(5,951 Views)

Hi InspectorGadget,

 

So I just modified the following:

 

FileGlobals.ReportOptions.ReportFileSequentialModelExpression = C:\\Test

FileGlobals.AdditiveString = "\\Report $(UUT)$(Unique).xml"

 

I then changed the ReportOptions Callback to:

Set Custom Report Options (as before)

Append string: Locals.AppendedString = Parameters.ReportOptions.ReportFileSequentialModelExpression + FileGlobals.AdditiveString

Set File path: Parameters.ReportOptions.ReportFileSequentialModelExpression ="\"" + Locals.AppendedString + "\""

 

Note the "\"" will add the quotation marks that the expression string requires in order to run. This throws up a warning on starting the UUT but it works as intended.

 

Kind regards

Pete

Certified LabVIEW Architect
0 Kudos
Message 4 of 12
(5,945 Views)

Hello PWoonward,

 

When running I get a red exclamation mark, and the test stops.

Below is de expression I use(my post before this had some faults).

 

Locals.Local = Parameters.ReportOptions.ReportFileSequentialModelExpression,

Parameters.ReportOptions.ReportFileSequentialModelExpression = "\"" + Locals.Local + "\\\\<FileYear>\\\\" + FileGlobals.ProductCodeNIS + "\\\\<UUTStatus>\\\\<UUT>_Report[<FileDate>][<FileTime>]<Unique>.<FileExtension>" + "\""

0 Kudos
Message 5 of 12
(5,939 Views)

Hi InspectorGadget,

 

You will want to use the macros as $(FileYear) , $(UUTStatus) etc as the system has changed for the later versions of TS. These also need to be included in the macro list within the ReportOptions Parameters.

 

Try making these changes, if it doesn't work could you attach your sequence so I could take a look please? Or a simplified version of the sequence which uses the callback.

 

Many thanks

Pete

Certified LabVIEW Architect
0 Kudos
Message 6 of 12
(5,937 Views)

PWoodward,

 

I have tried C:\\logs, C:\\\\logs and C:\\\\\\\\logs, as an expresssion in the report path set in the second tab of report options.

 

This works.

Locals.Local = "C:\\\\logs",

Parameters.ReportOptions.ReportFileSequentialModelExpression = "\"" + Locals.Local + "\\\\$(FileYear)\\\\" + FileGlobals.ProductCodeNIS + "\\\\$(UUTStatus)\\\\$(UUT)_Report[$(FileDate)][$(FileTime)]$(Unique).$(FileExtension)" + "\""

 

This does not work.

Locals.Local = Parameters.ReportOptions.ReportFileSequentialModelExpression,

Parameters.ReportOptions.ReportFileSequentialModelExpression = "\"" + Locals.Local + "\\\\$(FileYear)\\\\" + FileGlobals.ProductCodeNIS + "\\\\$(UUTStatus)\\\\$(UUT)_Report[$(FileDate)][$(FileTime)]$(Unique).$(FileExtension)" + "\""

0 Kudos
Message 7 of 12
(5,931 Views)

Hi InspectorGadget,

 

I expect that the original  Parameters.ReportOptions.ReportFileSequentialModelExpression  has quotation marks (") within it, this causes problems when we combine the strings later on as it takes it as a literal string of "C:\\logs" instead of C:\\logs. 

 

But it is good that you have a working version now, I hope it serves you well.

 

Pete

Certified LabVIEW Architect
Message 8 of 12
(5,928 Views)

PWoodmark,

 

The lower has to work, how do I remove the quotation marks from "Parameters.ReportOptions.ReportFileSequentialModelExpression"?

 

Locals.Local = Parameters.ReportOptions.ReportFileSequentialModelExpression,

Parameters.ReportOptions.ReportFileSequentialModelExpression = "\"" + Locals.Local + "\\\\$(FileYear)\\\\" + FileGlobals.ProductCodeNIS + "\\\\$(UUTStatus)\\\\$(UUT)_Report[$(FileDate)][$(FileTime)]$(Unique).$(FileExtension)" + "\""

0 Kudos
Message 9 of 12
(5,923 Views)

Hi InspectorGadget,

 

Parameters.ReportOptions.ReportFileSequentialModelExpression = C:\\test (without the quoation marks)

 

This will cause a syntax error as it expects there to be quotation marks, under the step settings, go to run options, at the bottom tick the "ignore run-time errors"

 

This should allow you to use the expression correctly, let me know how it goes.

 

Pete

 

Certified LabVIEW Architect
0 Kudos
Message 10 of 12
(5,916 Views)