NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

How to auto-increment UUT Serial Number in TestStand 3.5

Hi,
 
I'm trying to customize a client's environment so that the dialog for the UUT serial number would start at say "1", and auto-increment each time during the "Test UUT's" execution. Ideally, I'd write out a .ini file to remember the last value for a particular sequence file, but that's extra creit. For now, I'd be happy to start at "1" and increment for each UUT.
 
Does anyone have any example code or ideas about how to do this in LabVIEW?
 
Do I need to edit the process model, or the Pre-UUT Callback, or both?
 
Thanks in advance, this forum is great!
 
 
0 Kudos
Message 1 of 7
(5,185 Views)

Hi gnange,

You have a couple of options here. With both options that I am going to mention, you would need to override the PreUUT callback.  Also, since you are going to be keeping track of a global serial number, I would suggest creating a fileglobal variable to constantly poll and update that represents your serial number. Since the implementations of the serial number are of type string, anytime you increment this value, you first need to change this value to a numeric, then add one, and then change it back to a string.  

First off, by default the serial number GUI that popups is caused by the modelsupport2 dll found in the C:\Program Files\National Instruments\TestStand 3.5\Components\User\Models\TestStandModels (if you have copied over your models folder which I stronlgy recommend). This dll was built using LabWindows/CVI.  If you have CVI installed, you could edit that CVI project so it grabs the fileglobal variable, populates the serial box entry with that variable that has been incremented, and then go on from there. Once you have edited the code, rebuild the dll. 

The other option is to create your own dialog box with LabVIEW. This maybe an easier option for you if you are familiar with LabVIEW.  Just make sure that you pass in your sequence context to your VI so you can access that fileglobal to autopopulate the serial box entry. If you do decide to go this route, make sure to update the Parameters.ContinueTesting variable.

Hope this gives you ideas on your options.

Best Regards

Jonathan N.
National Instruments
0 Kudos
Message 2 of 7
(5,158 Views)
Hi gnange,
 
Here is the expression statement that converts the serial number string to a number, increments its, converts it back to a string and then stores the variable.
 

FileGlobals.UUTSerial = Str(Val(FileGlobals.UUTSerial) + 1)

Hope this helps!

Best Regards,

Jonathan N.
National Instruments
0 Kudos
Message 3 of 7
(5,150 Views)

Thanks Jonathan. Your phone support last week really helped me get kick started.

I actually ended up doing a pure LabVIEW solution for this. I'll post it to this forum message once I get caught up on my client's project. Essentially, you need to Override the PreUUT callback, pass in the sequence context, create a FileGlobal, and increment it in your LabVIEW callback. It took me a while to understand what I assumed to be a simple mechanism. My experience with the old Test Executive toolkit came in handy here, but I must say that the new TestStand API is quite daunting, but I am quickly coming up to speed. Thanks Again!

0 Kudos
Message 4 of 7
(5,131 Views)

Hi,

I'm new to TestStand and is performing an to-buy-or-not evaluation.

My need is similar to this thread owner - it can be described as follows:

1) Serial number is picked from a database where serialNumber is defined as unique and autoinc.

2) When the test sequence is started it shall pick first free serial number and "feed" Teststand with it. This is described in this thread.

3) The testing of an UUT can start. When finished, test result and data is stored to database. After that  we can start all over with  1) again

The questions:

- Is Teststand using the same variable for serial number (Fileglobal.serial... something) through all situations like teststeps, report, logging etc.

- Do I need Labview /CVI to redefine to default behaviour with the prompt for serial number?

I  want to prompt, but with my own serial number displayed. Optionally I want to use an barcode scanner to read the serial number, then check with database if the number is unique. If ok, we can continue.

Regards

Magnus

 

 

 

 

 

 

0 Kudos
Message 5 of 7
(4,816 Views)

Hi,

Yes

Seeing as you are going to use a barcode scanner to obtain the serial, you could use the MessagePopup step to display and prompt the user, you can you the database steps to do your querying, so there's a good chance you dont need to use LabVIEW/ CVI/ C++/ VB/ C# ..

Regards

Ray Farmer

Regards
Ray Farmer
0 Kudos
Message 6 of 7
(4,795 Views)
Hey Magnus,

Both of Ray's points are correct.  However, I wanted to give more little more detailed answer to your second question. You do not need LabVIEW or CVI to redefine the default behavior for the serial number prompt.  As Ray mentioned you can use the Message Popup step from TestStand, but in general, people use an external development environment to create their own dialogs for TestStand. The MessagePopup step in TestStand is easy to use, but it can be limited in functionality if you need to perform additional actions. The beauty of TestStand is that you can create your dialog in .NET, LabVIEW, CVI, C++, Activex, or any language that can just create a DLL and still use it in TestStand. You are most likely going to have to use an external development environment to get the barcode scanner working anyway unless you have a DLL you can call into to perform the functions you need.
Pat P.
Software Engineer
National Instruments
0 Kudos
Message 7 of 7
(4,781 Views)