11-16-2007 07:16 AM
Hi josh,
I tried to access step result through .NET but not found any solution. I tried with the following code .
PropertyObject
objPropSeq;objPropSeq = ObjSeq.AsPropertyObject();
if (objPropSeq.Exists("RunState.Step.DataSource", 0)){
bool value = objPropSeq.GetValBoolean("RunState.Step.Result.PassFail", 0);}
11-16-2007 07:16 AM
Hi josh,
I tried to access step result through .NET but not found any solution. I tried with the following code .
PropertyObject
objPropSeq;objPropSeq = ObjSeq.AsPropertyObject();
if (objPropSeq.Exists("RunState.Step.DataSource", 0)){
bool value = objPropSeq.GetValBoolean("RunState.Step.Result.PassFail", 0);}
11-16-2007 12:50 PM
11-16-2007 08:19 PM
11-16-2007 10:18 PM
ObjExe.ResultStatus ( ObjExe is object of Execution).
regards
rkk
11-17-2007 12:20 AM
Hi josh,
I used following method to execute sequence file. can you tell me is it correct methdod?
1)
ObjExe = ObjEngine.NewExecution(ObjSeqFile, ObjSeq.Name, ObjSeqFile, false, ExecutionTypeMask.ExecTypeMask_Normal,
objPropertyObj, System.Type.Missing, System.Type.Missing); // ObjExe = Object of Execution
2) To read Step result status
PropertyObject
objPropSeq; objPropSeq = ObjSeq.AsPropertyObject();strStepResult = ObjStep.ResultStatus; // always it is empty string.
if (objPropSeq.Exists("Step.Result", 0)) // always Exists == flase{
string strValue = objPropSeq.GetValString("Step.Result.Status", 0);}
Please explain me how to get each step result status. Josh I am in trouble, please help me out.
regards
RKK
11-19-2007 10:09 AM
rkk,
What are you trying to accomplish? Most of your questions from before were creating a sequence programatically. Now you want to run that sequence as well.
What is your overall goal?
If you tell me what you are trying to accomplish, I can help you much more effectively.
Depending on what you are trying to accomplish, we can approach this in a few ways. Though if you are going to be executing a sequence, generally the easiest way to do it is to use the TestStand UI Controls. These are pre-built ActiveX controls that encompass much of the common functionality that you could want for executing a sequence. I would suggest that you look at the C# code that you can find in the <TestStand>\UserInterfaces\NI\Simple\CSharp folder. I would also reccomend reading Chapter 9 of the TestStand reference manual. It covers User Interfaces in much more detail.
11-19-2007 10:39 AM
ObjExe = ObjEngine.NewExecution(ObjSeqFile, ObjSeq.Name, ObjSeqFile, false, ExecutionTypeMask.ExecTypeMask_Normal,
objPropertyObj, System.Type.Missing, System.Type.Missing); // ObjExe = Object of Execution
Here, after execution of above line I used following line to record the result
string strResult = ObjExe.ResultStatus. // Here I could record last step result of sequence. Actually I want record each step result.
And also I used string strResult = ObjStep.ResultStatus // Always shows empty result.
Please explain me how to do that?
regards
RKK
11-19-2007 10:55 AM
rkk,
The information you are looking for is stored in the Locals.ResultList array. After a step is run, that step's result container is put into this array. You *might* be able to recover it by simply accessing that array via a lookup string.
However, the problem you are trying to solve is how to get information from a running sequence back to a GUI. The best way to accomplish this is by posting UI messages from your sequence and handling them in your GUI. I recommend you do a search on this forum for UIMessages. You will find a lot of help on how to use them.
I understand that you don't want to use the TestStand GUI controls for your display. However, the three manager controls can still run a sequence without displaying any information. I think that this will be a better idea than the way you are doing it.
11-19-2007 11:39 AM