NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

TestStand UUT Serial Number Question

How would I setup TestStand to allow me to read a programmed serial number off of a UUT and if it is unavailable (ie Len<8 digits) it will then prompt you for UUT S/N? I only want it to prompt for the UUT serial number if the UUT did not have it already programmed into the unit.

 

Right now I have it working by modifying the TestStand SequentialModel.seq by reading the serial number prior to Pre-UUT step (via custom external C DLL function) and if Len<8 it runs Pre-UUT but if Len=8 then it skips Pre-UUT and sets Locals.UUT.SerialNumber within the SequentialModel.seq to the read serial number. However, the problem with this is that if the UUT is dead or I can't functionally read the serial number TestStand errors out but because I am running under the SequentialModel.seq and it is not into the test sequence yet TestStand just locks up with no errors/failures given and I have to Ctrl+Alt+Del.

 

I guess if there was a way to have TestStand completely ignore any external DLL errors or failures for my read serial number steps within SequentialModel.seq I could then just handle the "dead unit scenario" in my regular test sequence. However, I am not sure if using the SequentialModel.seq in this way is really the best way to go about this in the first place.

 

Thanks in advance for your thoughts.

0 Kudos
Message 1 of 5
(4,663 Views)

Override the PreUUT callback from your client and then copy the code from the process model to your client.  Then put your custom code (reading from the UUT) right before the dialog and precondition the dialog with the results from your custom code.

0 Kudos
Message 2 of 5
(4,662 Views)

Whenever the PreUUT callback runs it automatically pops up an enter S/N dialog box. How would I modify that so it would not pop up that dialog box unless the read serial number does not meet criteria? What variable do I set after I read the serial number in in Pre-UUT callback step? Runstate.Root.Locals.UUT.SerialNumber?   

0 Kudos
Message 3 of 5
(4,657 Views)

You would put the code before the dialog.  I have created a simple example that demonstrates what I'm talking about.  Basically you could replace the Message Popup step with your logic code that determines to popup the Serial Number dialog.

0 Kudos
Message 4 of 5
(4,652 Views)

I agree that your custom code should go in the PreUUT Callback, before the default dialog.

 

You need to handle the case if the UUT is dead or returns an error when you try to read the serial number. It's not really an error, it's a UUT failure. You could trap the error and not let the TestSTand standard error dialog pop up, inspect the error code to verify it is one of your dead unit conditions, and then use a conditional statement to call some step(s) that sets the sequence to UUT Fail and jumps to the PostUUT callback. In general you'd want to indcate a Fail and then prompt Next UUT. This is the default flow of Test UUTs in the Sequential Model.

cc

0 Kudos
Message 5 of 5
(4,644 Views)