NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Get Step Name

Hello,

I'm using TS 2014 and custom  OI GUI on C#. 

I've implemented  UIMsg_ModelState_TestingComplete  and successfully get status of my  <Stop On Fail>  test sequence by calling uiMsg.StringData.

In case the sequence is failed I'd like to display the name of the failed step. How can I do this?

Thanks

0 Kudos
Message 1 of 11
(5,071 Views)

Where do you want to display it at?  In a popup?  Or just on a form control?  Or in the Status Bar?

jigg
CTA, CLA
testeract.com
~Will work for kudos and/or BBQ~
0 Kudos
Message 2 of 11
(5,021 Views)

You should work throught the Black UI example contained here.

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

I'm going to display it on the DataGridView form control 

0 Kudos
Message 4 of 11
(5,011 Views)

Hi airspan,

 

Have you had a chance to look through the example Norbert linked to?

 

Justin

Applications Engineer

National Instruments

0 Kudos
Message 5 of 11
(4,990 Views)

I'm not well versed in C# but have you seen this: https://stackoverflow.com/questions/479329/how-to-bind-a-liststring-to-a-datagridview-control

 

I think what you need to do is in the UI Message callback set your datagridview to a dataset that contains the name of the failed step. 

jigg
CTA, CLA
testeract.com
~Will work for kudos and/or BBQ~
0 Kudos
Message 6 of 11
(4,986 Views)

To be a little more specific:

 

If you are dead set on using that UI message you referenced then you would get the ActiveXDataParam as the sequence context.  This will then give you access to the MainSequence result list.  You would need to recurse through that and look for the step that caused the failure.  Once you have that step or steps then you would create a List that can become the dataset for your DataViewGrid.

jigg
CTA, CLA
testeract.com
~Will work for kudos and/or BBQ~
0 Kudos
Message 7 of 11
(4,985 Views)

To add to jigg's reply with the dead set to this UI Message:

It is not sufficient to identify the first failing step. You have to verify that this step was causing the sequence to fail (step setting: Step Failure Causes Sequence Failure).

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

My problem is getting access to MainSequence result list. I didn't understand what exactly I have to do...

0 Kudos
Message 9 of 11
(4,964 Views)

There are 2 ways to get access to the MainSequence result list.

 

ThisContext.Locals.ResultList[0].TS.SequenceCall.ResultList

 

OR

 

RunState.Sequence.Main["MainSequence Callback"].LastStepResult

 

Hope this helps,

jigg
CTA, CLA
testeract.com
~Will work for kudos and/or BBQ~
0 Kudos
Message 10 of 11
(4,959 Views)