NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Example overriding sequential PreUUT

Is my simple example of overriding PreUUT correct?

 

Here is what I did:

 

  • created a new sequence
  • double clicked on the sequential model link near the bottom left corner of the application window
  • dragged the sequential model's PreUUT to the template pane
  • dragged the PreUUT sequence to the Sequences' pane of "sample overriding PreUUT.seq" (attached)

 

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

0 Kudos
Message 1 of 9
(6,018 Views)

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,

Amanda B.
Applications Engineer
National Instruments
0 Kudos
Message 2 of 9
(6,001 Views)

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:

 

preUUT.PNG

 

What are the implications of just deleting Call DoPreUUT?

 

 

0 Kudos
Message 3 of 9
(5,990 Views)

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,

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

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?

0 Kudos
Message 5 of 9
(5,983 Views)

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,

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

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:

  • Store the UUT.SerialNumber parameter
  • Store the Parameters.ContinueTesting flag

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.

0 Kudos
Message 7 of 9
(5,947 Views)

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,

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

This link talks about each of the model callbacks in the sequential model:

 

http://zone.ni.com/reference/en-XX/help/370052N-01/tsfundamentals/infotopics/sequential_model_callba...

 

Hope this helps,

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