04-02-2015 04:35 PM
Is my simple example of overriding PreUUT correct?
Here is what I did:
The goal of the exercise was to make the assignment: Parameters.UUT.PartNumber= "ABC123". My understanding is that this needs to happen in the PreUUT sequence, and then it will show up in reports.
Thanks.
StephenB
04-03-2015 09:18 AM
Hello stephenb2,
I would take a look at the article below:
http://zone.ni.com/reference/en-XX/help/370052N-01/tsexamples/infotopics/callbacks_preuut/
It will explain about about overriding PreUUT callbacks, as well as direct you to where to find examples.
Best regards,
04-03-2015 04:06 PM
Unfortunately, that example seems to be present in TS 2014, but I have 2013.
I did look at the example for overriding the parallel model's PreUUT but found it hard to understand. It does not start with creating a sequence from scratch. It does not explain how the PreUUT sequence makes it to the sequence pane in the first place. It is also lacking the Call DoPreUUT sequence (see below). Where did that go?
When I do File->New, an empty sequence file is created. This sequence only contains an empty main sequence. I believe it does have a PreUUT sequence, but that is brought in implicitly from the sequential model. Do I have that right so far?
I can add a PreUUT by Edit->Sequence File Callbacks and adding PreUUT.
It comes with a sequence named Call DoPreUUT inside it:
What are the implications of just deleting Call DoPreUUT?
04-03-2015 04:42 PM
When you create a new sequence file the only model callback created for you automatically is MainSequence. Any other model callbacks need to be explicitly added by you.
The recommended way for adding a callback is to simply go to Edit>>Sequence File Callbacks and adding the desired callbacks in that dialog.
What you did by copying over from the model directly (or rather through the Template pane) is just fine. It will work as well.
You can delete the Call DoPreUUT step without any implications other than you will lose the dialog.
With the PreUUT callback there are 2 things you need to be aware of. Populated the UUT.SerialNumber parameter and populated the Parameters.ContinueTesting flag. This flag is used inside of the SequentialModel to determine whether or not to abort testing in the Test UUTs execution entry point.
Here is a whitepaper on callbacks: http://www.ni.com/white-paper/6605/en/
Some questions to ask when overriding callbacks:
What is the purpose of the callback?
What does the caller of the callback expect me to do? (e.g. set the ContinueTesting flag)
Hope this helps,
04-03-2015 05:03 PM
Awesome, very helpful answer.
One question though, it appears that when I have my blank sequence from file->new, I still get the IdentifyUUT dialog (I assume from PreUUT from the model) when I do Execute->Test UUTs. Why is that?
04-03-2015 05:42 PM
Read my link on callbacks. It should explain why in there.
But if you are too lazy keep reading here: 🙂
The way that a process model works is that it calls a model callback (i.e. PreUUT) from within itself. Unless......the callback exists in the client sequence file (i.e. the one you created). It just so happens that the PreUUT callback inside of the process model contains the dialog you are talking about. When you add the callback to your client sequence file then the behavior will do what is in your client sequence file. This is why it is called "Overriding." Because you are changing the default behavior of the process model.
Hope this makes sense,
04-06-2015 10:13 AM
Just trying this out on an empty sequence created by file->new:
Single pass: goes straight to passes test and terminates
Test UUTs: has UUT serial number dialog, passes, and asks for next UUT
After Edit->Sequence File Callbacks, insert the PreUUT, and remove the Call DoPreUUT:
Single Pass: same
Test UUTs: no serial number dialog, only a pass dialog which repeats. PreUUT overridden.
I think I'm getting it now. Thanks for the help.
The two items you mentioned that come from the PreUUT that need to be dealt with:
Good tips. Is this documented somewhere? When I browse the sequential model I cannot go into the Call DoPreUUT sequence. It would be nice if I could go into the sequence for DoPreUUT, copy its steps, paste them into my custom PreUUT, and tweak something.
04-06-2015 10:59 AM
DoPreUUT is in the process model. It is a normal sequence down at the bottom. Just look down there.
They are calling it dynamically like that so the client can work with any model.
Regards,
04-06-2015 11:02 AM
This link talks about each of the model callbacks in the sequential model:
Hope this helps,