NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Getting TS report Name from CVI

Hi,
I want to write a programm in CVI that will return the Report name of the tests that TS was just running.
What object in TS holds the name of the report?
Thanks,
Moshik
0 Kudos
Message 1 of 12
(3,928 Views)
Hi Moshik,
 
When you say tests, I assume you mean step? If you mean step, the name of the step is held in the RunState.Step object.
 
Regardless, I think the knowledge base Getting the Name of Any TestStand Property Programmatically in TestStand will help you out. The second part of the knowledge base discusses how to access the name of a step using the TestStand API. There is a specific example of how to get the name of the step. You should be able to manipulate this code snippet to get other objects as well.
 
Matt M.
National Instruments
0 Kudos
Message 2 of 12
(3,907 Views)
Hi,
By tests I do mean steps - let me clarify:
I have a sequence called "sequence 1" which is built of step 1, step 2 and step 3.
After this sequence finishes it generates the xml report.
I would like to now how to find out the name of the report, using CVI (I am using the report format with the suffix of date and time).
The link you gave me is very helpfull for other things but I didn't see any indication regarding the Test report name.
Thanks,
Moshik
0 Kudos
Message 3 of 12
(3,910 Views)
Hi Moshik,
 
Sorry about the confusion. The report file name can be obtained from the report location property in the API object. The exact location is RunState.Report.Location. You can use the same knowledge base I linked to earlier to get this property in CVI.
 
For more information about using the TestStand API with CVI, you can look at Appendix B, Using TestStand ActiveX APIs in LabWindows/CVI, of the document Using LabWindows/CVI with TestStand. You can get to this document by opening TestStand, going to Help >> Search the TestStand Bookshelf... and then clicking the Using LabWindows/CVI with TestStand link.
 
For more information about what objects and properties are included in the TestStand API, you can look at the TestStand API Reference Poster. You can get to this reference by again going to Help >> Search the TestStand Bookshelf..., clicking the grey right arrow and then clicking on the link, TestStand API Reference Poster.
 
Matt Mueller
NI
0 Kudos
Message 4 of 12
(3,895 Views)
Hi,
I wrote this function:
 
__declspec(dllexport) void GetTSReportName(tTestData *testData)
{
 int Status = 0;
 ERRORINFO ErrorInfo;
 TSObj_Property CurrentSequence;
 char* SequenceReportName = NULL;
 
 Status = TS_PropertyGetPropertyObject (testData->seqContextCVI, &ErrorInfo,"RunState.Report.Location",0, &CurrentSequence);
 //TS_PropertyGetProperty (CurrentSequence, &ErrorInfo, TS_PropertyName, CAVT_CSTRING, &SequenceReportName);
 Status = TS_PropertyGetName(CurrentSequence, &ErrorInfo, &SequenceReportName);
 printf("Name is: %s\n",SequenceReportName);
}
 
I used it as the last step on my sequence and expected to see the report name printed but it wo'nt work.
It looks like it does not recognize the path "RunState.Report.Location"
Do you have any idea why it does not work?
Thanks,
Moshik
0 Kudos
Message 5 of 12
(3,879 Views)

Hi,

RunState.Report.Location is a string therefore all you need to do is use

char *ReportLocation = NULL;

TS_PropertyGetValString(testData->seqContextCVI, &ErrorInfo,"RunState.Report.Location",0, ReportLocation)

 

Regards

Ray Farmer

Message Edited by Ray Farmer on 11-21-2006 02:28 PM

Regards
Ray Farmer
0 Kudos
Message 6 of 12
(3,876 Views)
Hi Ray,
I tried what you suggested before and tried it again now.
The pointer that suppose to hold the name of the report is still NULL after calling
" TS_PropertyGetValString(testData->seqContextCVI, &ErrorInfo,"RunState.Report.Location",0, ReportLocation)"
Any ideas?
Thanks,
Moshik
0 Kudos
Message 7 of 12
(3,869 Views)

Hi,

Put a breakpoint on the step that calls your function then have a browse of the context in the SeqEditor to see what the runtime value is.

Regards

Ray Farmer

Regards
Ray Farmer
0 Kudos
Message 8 of 12
(3,866 Views)
Hi,
"RunState.Report" is empty. also there is no way to get to "RunState.Report.Location".
Thnaks,
Moshik
0 Kudos
Message 9 of 12
(3,859 Views)

Hi Moshik,

There is a ReportFilePath variable stored in the ProcessModel under the Locals. However, if you want to access this from your sequence file, it is accessible from RunState.Caller.Locals.ReportFilePath.

You should be able to use the same method described above to get to this variable in CVI.

Matt M.
NI

0 Kudos
Message 10 of 12
(3,846 Views)