NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

How to read .tsr files reports in .Net

Hi,

It is possible to read or convert tsr files to format (e.g. XML) in different environments than TestStand?

I have to read .tsr files reports in my .net application, but i can not found any encoding system for content decoding.

Best Regards,

Marti

 

0 Kudos
Message 1 of 6
(2,148 Views)

.TSR files are intended to be run through the process models and plugins using the Offline Results Processing Utility to create reports and populate databases.

 

Their format is intended for that purpose, and it would be awkward to use them for anything else. However, there is an API for reading them. See the ResultLog class in the TestStand API help.

 

ResultLog - NI

0 Kudos
Message 2 of 6
(2,124 Views)

Thanks a lot!

This is what i was looking for.

0 Kudos
Message 3 of 6
(2,097 Views)

Let me ask one more question.

I checked this API and ResultLog unfortunately is not class but interface:

 

public void Open(string Path)
{
throw new NotImplementedException();
}

public void Close()
{
throw new NotImplementedException();
}

public bool ReadNextRecord(out ResultLogRecordTypes resultLogRecordType, out int ExecutionId, out int ThreadId,
out PropertyObject[] objects)
{
throw new NotImplementedException();
}

public void SetReportPaths(PropertyObject pathStringArray)
{
throw new NotImplementedException();
}

public PropertyObject GetReportPaths()
{
throw new NotImplementedException();
}

public bool OnTheFly { get; }
public string Path { get; }
public bool ClosedWhenWritten { get; }
public string UniqueId { get; }
public double SecondsAtStartIn1970UniversalCoordinatedTime { get; }
public bool SimulateOnTheFly { get; set; }
public bool FileSavedWithFeaturesToggled { get; }

 

Do You have any example how to use it?

0 Kudos
Message 4 of 6
(2,080 Views)

If you look at the TestStand Help link that James_Grey posted, it shows methods that you should be able to use after creating an object of the ResultLog class type

https://www.ni.com/docs/en-US/bundle/teststand/page/tsapiref/reftopics/resultlog.htm

 

I would expect that you could then invoke the ResultLog.Open method and then ResultLog.ReadNextRecord to access the individual recorded results.

Jorr-El
Systems Engineer
Testeract: Automated Test Specialists
0 Kudos
Message 5 of 6
(2,067 Views)

I think the problem is that you need to get your ResultLog from Engine.NewResultLog.

 

The ResultLog class is used by the Offline Result Processing Utility. I don't have an installed version handy, but I think the source for that is provided at <TestStand>\Components\Models\TestStandModels\ORPU\.

 

However, it is large, complex, and not intended as an example.

Message 6 of 6
(2,064 Views)