10-12-2022 06:13 AM
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
10-12-2022 10:48 AM
.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.
10-13-2022 06:10 AM
Thanks a lot!
This is what i was looking for.
10-13-2022 09:01 AM
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?
10-13-2022 10:52 AM
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.
10-13-2022 10:58 AM
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.