01-19-2017 11:25 AM
I want to pass step information back to the C# Test Executive.
I've created an instance of the ProcessModelPostReultListEntry callback which includes an Acive action step tp Post a UIMessage with RunState.Caller.Step as the activeXDataParam.
I know I should be doing something with e.uiMsg.ActiveXData but I'm not sure if this is valid or how to access the individual step properties if it is. (Measured value, upper/lower limits etc)?
Any ideas?
01-20-2017 01:58 AM
I think you should get used to use proper TS terms so that everyone can understand what you are looking for.
For instance, when you talk about 'test executive', I ASSUME that you do refer to "custom user interface".
It sounds to me that you either removed the step list (Execution Manager) from the UI or you disabled tracing in your station configuration. I think that reverting to default can already answer your request.
If it does not, posting (custom) UI Messages from the sequence execution is indeed the recommended approach.
You have to hook up the UserMessage callback from the AppMgr in your C# code to collect these messages. Then you simply switch according to the event ID (number).
01-20-2017 03:37 AM
Thanks Norbert_B,
Yes you are right, I meant the C# Full version custom user interface.
I haven't removed anything from the user interface, just added a list control to populate tests only.
I have added the User Message callback function and this works successfully with sending individual numbers or strings. What I was asking if it is OK to pass RunState.Caller.Step from the process model (since it's the calling step info I want) via activeXDataParam of the PostUIMessageEx activeX action step and what C# functions to use to access the Step properties in the user interface. If e.uiMsg.ActiveXData is of type object, how do I get to its step properties in C#?
01-20-2017 04:43 AM
You have to cast the reference to step (or whatever you expect it to be).
01-20-2017 06:36 AM
Thanks Norbert_b
I figured some of that out and can access some of the Step properties but access to the Result properties still eludes me. Is that a different object?
Step step_reference = e.uiMsg.ActiveXData as Step;
string step_name = step_reference.Name;
string status = step_reference.ResultStatus;
PropertyObject LastStepRes = step_reference.LastStepResult;
double lower_limit = LastStepRes.GetValNumber("Limits.Low", 0);
double upper_limit = LastStepRes.GetValNumber("Limits.High", 0);
string comparison_type = LastStepRes.GetValString("Comp", 0);
01-20-2017 07:02 AM
O.K. Got it now...Thanks for your help Norbert_b got me in the right direction...
Step step_reference = (Step)e.uiMsg.ActiveXData;
string step_name = step_reference.Name;
string status = step_reference.ResultStatus;
PropertyObject StepPropertyObj = step_reference.AsPropertyObject();
double lower_limit = StepPropertyObj.GetValNumber("Limits.Low",0);
double upper_limit = StepPropertyObj.GetValNumber("Limits.High",0);
double measurement = StepPropertyObj.GetValNumber("Result.Numeric",0);
string comparison_type = StepPropertyObj.GetValString( "Comp", 0);
string units = StepPropertyObj.GetValString("Result.Units",0);