NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Getting steps properties in c#

I have q question regarding getting step properties.

 

I get step in UIMessageEvent:

 

step = e.uiMsg.Thread.GetSequenceContext(0, out frameid).PreviousStep

 

I can see everything I need while debiugging in Visual Studio:

 

mikeccc_0-1692793839275.png

 

But when I try reading (i.e. 'Comment') using usual way, I have an error: Unknown variable or property name 'Comment'. Error accessing item 'Comment':

 

step.AsPropertyObject().GetValString("Comment",0);

 

I must do something wrong.

 

Thanks

Mike

 

 

0 Kudos
Message 1 of 4
(845 Views)

You have already received the UI message, so I don't think you will refuse to send a Parameters. Step. Comment message through the callback function of the TS process model (such as ProcessModelPostStep) in stringDataParam. That's right, this is the comment string for each step you need. Every time you run a step, the message mechanism will automatically send it to you, and all you need to do is just parse it out.

 

The UI message and callback function of TS will make it easier for you to obtain this information.

0 Kudos
Message 2 of 4
(813 Views)

I couldn't make it working.

 

Can't send Parameters. Step. Comment

 

Can you provide example?

 

Thanks!

0 Kudos
Message 3 of 4
(752 Views)

My mistake!

the correct variable name is:

Parameters.Step.AsPropertyObject.Comment

I confirm that this can be received, as shown in the following figure

11.PNG

0 Kudos
Message 4 of 4
(728 Views)