NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Is there a way to call a Callback's Parent sequence?

Solved!
Go to solution

I would like to add some extra logic to the error handler of my test sequence. In particular, I would like to create a SequenceFilePostStepRuntimeError callback that sends the error as an email to specific addresses. The sending an email part is not a problem. What IS a problem, is that I would rather not have to re-write the TestStand error dialog. Is there any I can write a callback sequence that will carry out my code AND then call the default behaviour?

0 Kudos
Message 1 of 7
(3,800 Views)
Solution
Accepted by shew82

I'm pretty sure you will still see the error message pop up even if you override that callback.  At least I did!

 

Have you tested it out?  Just throw down the callback and place your email code in there and then have a step in your MainSequence generate an error.

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

You know what, I didnt actually try it! I was going from experience overriding other callbacks (e.g. Pre/Post UUT)... I'll give it a go in the morning and see how it turns out!

0 Kudos
Message 3 of 7
(3,789 Views)

I know that with model callbacks when you override them then the default behavior goes away.  I think though that in this case it is important to have the error pop up so they left it.

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

Thanks jigg - you were right, I was looking for something that didnt exist, and the default behaviour was what I needed in this case!

 

...although, it would be nice to be able to add stuff to the model callbacks before or after the built-in logic so that we could add to the call back behaviour, rather than just replace it...

0 Kudos
Message 5 of 7
(3,764 Views)

There is a way to do that.....sort of.

 

If you open your process model and look for the green sequences (those are the callbacks).  Find the one you want to place in your client sequence file.  Right click on it and select Sequence Properties...  Click the Model tab and you will see an option called "Copy Steps and Locals when Creating an Overriding Sequence".  You can read about it in the help but basically with that checked whenever you override the callback it copys all the steps to your sequence file and behaves exactly the same.  Then in the overriding sequence in your client you should be able to add "code" wherever you want to get the behavior you want.

 

The problem with this is that now you have what I call a "dirty" process model in that it is no longer the one that ships with TestStand.  This isn't a bad thing except that you now have to keep track of yet another file.

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

Yeah, we're trying to avoid messing with the TestStand Process Models... but either way, good to know that it is there if we go that route in the future.

 

(we have considered developing our own custom process model, but the time and effort required in designing such a thing have made it prohibitive)

0 Kudos
Message 7 of 7
(3,754 Views)