NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Passing Report Text to process Model

Solved!
Go to solution

Hi - i want to replace the fail banner in the sequential model with the Failed Step report text, some kind of LabVIEW dialog.  Is there an easy way to grab that from within the process model?  I can access the text in the subsequence of main with Locals.ResultList[GetNumElements( Locals.ResultList)-1].ReportText) and copy to a local or a parameter, but I can't seem to pass it to the Process model.  I could use a Station Global, but that's not right.  Using parameters to call the subsequence means I have to do that all over my test.  And, even then I have the variable at the main sequence level and not the model. 

 

This can't be an unusual situation.  Am I over complicating it? 

 

TS 2017

LV 2018

W10

0 Kudos
Message 1 of 8
(2,674 Views)

If it's me, I am using the PostUUT callback from the model, but then I'm making a custom window with text that's populated from FileGlobals.ReportText (or whatever you want to name it).  I populate FileGlobals.ReportText in SequenceFilePostStepFailure and get the step's report text in that callback.

0 Kudos
Message 2 of 8
(2,627 Views)

Thanks so much - one forgets all those handy engine callbacks that don't show up on the list until you add them.  So I can find the report text in the process model which I can easily add to my fail dialog, but it is indexed as in Parameters.Result.TS.SequenceCall.ResultList[0].TS.SequenceCall.ResultList[1].ReportText.  Is there a way to obtain the indicies I am interested in (i.e. the failing step index) of the result list from within the process model callback?  Thanks again 
 

0 Kudos
Message 3 of 8
(2,618 Views)

To get the ReportText in SequenceFilePostStepFailure, I would use Parameters.Step.Result.ReportText

0 Kudos
Message 4 of 8
(2,616 Views)

Thanks but unfortunately that doesn't apply to the sub test (see attached)  unless I can set the upper level report text to the subtest report text in my test sequence?  But that would make everybody who uses the model have to add code to their test sequences. I am hoping to show "Test 2 failed" in the fail dialog in this case for example. Thx!TS Parameters.png

0 Kudos
Message 5 of 8
(2,611 Views)

If the step fails, then all parent sequences will also fail.

 

Let's say that you want to change the ReportText for the originating call in MainSequence, but the failing step is embedded in a subsequence (or many).  

 

In SequenceFilePostStepFailure, you could check if the step type is not a sequence call, something like Parameters.Step.StepType.Name!="SequenceCall".  If that's true, save the report text for that step in a fileglobal.

 

Then, when NameOf(RunState.Caller.RunState.Sequence)=="MainSequence", you can set that reporttext to the earlier FileGlobal.

 

You might have to play around with this a little more, but I think I'm close to what you need.

 

0 Kudos
Message 6 of 8
(2,609 Views)

Cool thanks for your help.  Looks like there are a few ways to do this.  That sequencefilestepfailure callback is key

0 Kudos
Message 7 of 8
(2,600 Views)
Solution
Accepted by topic author ET

This did the trick

TS Parameters.png

0 Kudos
Message 8 of 8
(2,586 Views)