NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Passing Step information from process Model to C# TestExecutive

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?

 

0 Kudos
Message 1 of 6
(3,123 Views)

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).

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
0 Kudos
Message 2 of 6
(3,087 Views)

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#?

 

0 Kudos
Message 3 of 6
(3,083 Views)

You have to cast the reference to step (or whatever you expect it to be).

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
0 Kudos
Message 4 of 6
(3,080 Views)

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);

 

 

0 Kudos
Message 5 of 6
(3,077 Views)

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);

 

 

0 Kudos
Message 6 of 6
(3,075 Views)