NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Control date and time format in report filenames independently of regional format of computer

Hi

 

We are trying to make the timestamps in the filenames of our TestStand xml reports follow the ISO standard regardless of the regional settings of the PC.

 

Good example:

2023-01-28_08 43 53_Demo Test Station - Main Sequence File_123_Failed.xml

 

Bad examples:

30 01 2023_19 40 56_Demo Test Station - Main Sequence File_123_Error.xml

12 15 2022_3 08 40 PM_Demo Test Station - Main Sequence File_123_Terminated.xml

 

One suggested solution is to use the ReportOptions callback:

https://forums.ni.com/t5/NI-TestStand/conditional-report-file-path/td-p/2892864

 

But a problem arises when running multiple DUTs in the same UUT loop. The Report Options callback executes only once, before the UUT loop. The result is that all DUT reports have the same timestamp.

 

SebastianBengtsson_0-1675870829943.png

 

I have searched online but not found solutions yet.

We do have our own sequential process model sequence file at our disposal to edit as needed.

I have tried to find out how and where to edit the process model but I have not yet found any good solutions.

 

I would be happy to hear if anyone has tips and suggestions.

 

Best regards,

Sebastian Bengtsson

 

0 Kudos
Message 1 of 5
(1,835 Views)

Hi Sebastian,

Have you tried adding the macro for UUT Serial Number? ...   $(UUT) at the Report File Path Expression

When you add it, it will create a new report for each UUT that runs, at least with the original Sequence Model

 

I tried to guess using it with your FileName Convention at  "Specify Report File Path by Expression" / "Report File Path" will be something like: 

 

"$(ClientFileDir)\\$(FileTime)_$(FileDate)_$(ClientFileName)_$(UUT)_" + Str(!RunState.SequenceFailed) + "_$(Unique).$(FileExtension)"

 

LFBaute_0-1675958161786.png

 

Actually when you add it you will see diagram at the bottom part change as:

LFBaute_1-1675958312636.png

 

Configure / Result Processing.../ Options... / Report File Path Name / Generate Report File Path / Specify Report File Path by Expression

CLA, CTA
0 Kudos
Message 2 of 5
(1,788 Views)

Hi LFBaute

 

Thanks for your reply.

Yes, this is my expression:

 

"$(TestStandPublicDir)\\CompanyName\\TestStandReports\\$(FileYear)$(FileMonth)\\$(FileDate)_$(FileTime)_$(ClientFileName)_$(UUT)_$(UUTStatus)$(Unique).$(FileExtension)"

 

This works well, except for the fact that the macros for date and time works differently in different parts of the world.

For example, some computers use AM/PM and some do not.

Our current solution is to make sure that the regional settings in Windows 10 are the same on all computers. 

This is not a sustainable solution for us.

It would be preferred to be able to control the formatting of the file name.

 

By the way, we are using TestStand 2019 and LabVIEW 2018.

 

Best regards,

Sebastian Bengtsson

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

Ill take a look at time format, 

 

Regarding "The result is that all DUT reports have the same timestamp."

Were you able to generate reports with different timestamp?

 

 

CLA, CTA
0 Kudos
Message 4 of 5
(1,743 Views)

Yes, the macros work well. The reports all have different timestamps, as expected.

My earlier attempt was to not use the macros, and instead format the filename programmatically in the ReportOptions callback according to the marked solution here:

https://forums.ni.com/t5/NI-TestStand/conditional-report-file-path/td-p/2892864

This did work well as long as the operator only tested one DUT per "TestUUTs".

As mentioned, this callback is only called once before the UUT loop.

Since I need the UUT loop to work, I had to scrap that solution attempt.

0 Kudos
Message 5 of 5
(1,736 Views)