NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

TestStand 2012 Change: the UUT data type now contains a new "part number" field

TestStand Users,

 

Many TestStand users have expressed a desire for a part number field in the UUT container, so that they can store both a serial number and part number when identifying UUTs. In TestStand 2012, the default UUT type used in the preUUT callback of the process model contains a new PartNumber field to address these applications.  

 

2012-08-10_164258.png

 

In the interest of backwards compatibility, the default serial number entry dialog has not been modified to provide an input for this field.  You can modify the existing dialog using the modelsupport2 project, which contains the source code for the TestStand model dialogs.  The code is located here:

 

<TestStand>\Components\Models\TestStandModels\modelsupport2.cws

 

As with any modification of TestStand files, be sure to create a copy in the public directory before making any changes, and only modify the copy.

Al B.
Staff Software Engineer - TestStand
CTA/CLD
0 Kudos
Message 1 of 19
(6,455 Views)

Hi,

 

I need to add several more fields to the UUT container. There's a tutorial at http://www.ni.com/white-paper/3429/en  that says to modify the UUT type.

 

I'm looking at an old project of mine from 1/2007 and instead of modifying the UUT type, I replaced all instances of the UUT type with a ** different ** UUT container type that added fields to the existing UUT type. I recall at the time there was an application note or something that recommended not to modify the UUT type that ships with TestStand because everything would break when you upgraded TestStand and changed the installed type back to the original UUT. I even discussed it with an AE.

 

I'm a little apprehensive about replacing all instances of the UUT type with some My.UUT type in TestStand 2012 now because of the plug-ins, there's a lot more places to change it. Is it now recommended to change the UUT type? I understand I would add fields only, not subtract any. Thanks.

 

cc

0 Kudos
Message 2 of 19
(6,208 Views)

Hey DowNow,

 

As that tutorial mentions (and Al also mentioned this in his post), it's always a good idea to make a copy of the files before editing them. In the case of the tutorial, it recommends modifying a copy of the process model files. I would suggest doing as the tutorial says and working with a copy of the process model files rather than the original. Then, just modify the UUT type to add your fields.

0 Kudos
Message 3 of 19
(6,180 Views)

Hi DowNow,

 

While the new models do introduce additional model files, you can still update your UUT type successfully without too much modification.  I recommend modifying the existing type over trying to map everything to a new type or instance of a type. As long as you are only adding properties, I would suggest the following procedure:

 

  1. Close TestStand, then copy the contents of the models directory (default is C:\Program Files\National Instruments\TestStand 2012\Components\Models) in TestStand public models directory(default is C:\Users\Public\Documents\National Instruments\TestStand 2012\Components\Models), and apply modifications only to the public copy.  TestStand will load the public copy by default.
  2. Open all model files and plug-ins from the public location containing the UUT type
    • Models: sequentialModel.seq, ParallelModel.seq, BatchModel.seq, ModelSupport.seq
    • Plugins: NI_ReportGenerator.seq, NI_DatabaseLogger.seq, NI_OfflineResultsGenerator
  3. Make your changes to the type in any of the files, and choose to increment the version when you save.  The other model files should now show as modified.  Save all the model files.

 

Al B.
Staff Software Engineer - TestStand
CTA/CLD
Message 4 of 19
(6,163 Views)

Thanks for the procedure! It's helpful.

cc

0 Kudos
Message 5 of 19
(6,154 Views)

Did this addition also add a "part number" macro for use in the Report File path expression?  If not does anyone have a suggestion on how to get the part number into the report file name without post-processing?

 

Thanks,

 

Kevin


 
0 Kudos
Message 6 of 19
(6,049 Views)

Hi kwkengineer!

 

You can customize the Report File Pathname a lot of ways! The Report Options dialog box (in 2012) is under the Configure menu. You can tweak the format there and see an example file name to get it the way you want, then script it in the "ReportOptions" sequence file callback using a statement. Here are all of the options for the report, which have corresponding properities in the API.

 

For example,I would want the part number, but not the date and time, and I wouldn't worry about unique file names because I only do one test an hour. I would probably use the following statements:

 

Parameters.ReportOptions.NewFileNameForEachUUT = True

Parameters.ReportOptions.IncludeTimes = False

Parameters.ReportOptions.ForceFileNameToBeUnique = False

 

Note that the Parameters.ReportOptions object is only available in the ReportOptions callback.

 

Hope this helps!

 

Regards,

 

Alexandra

 

National Instruments
Applications Engineer
0 Kudos
Message 7 of 19
(6,021 Views)

So to be clear.  You are saying there is not a <UUT_PartNumber> macro  Like the other macros defined here.  And there is not a way for me to add new macros that can be used in the Report Options dialog box.

 

My only option is to change the fle path from within the ReportOptions callback.

0 Kudos
Message 8 of 19
(6,017 Views)

Hi kwkengineer,

 

You are correct that there are currently no plans to add a <PartNumber> macro for the report file pathname expressions, and there is no easy way to add custom macros (it would require modifications to the modelsupport2 support dll). However, you are not limited to using the macros to define report expressions.  For example, you can add the part number to the path by accessing the property directly (bold added for emphasis):

 

"<ClientFileDir>\\<ClientFileName>_Report[<FileTime>][<FileDate>]<Unique>" + Runstate.Root.Locals.UUT.PartNumber +".<FileExtension>"

The use of runstate.root ensures that we are looking at the model entry point to access the property.  If you would like to propose the addition of new macros (or the ability to easily add custom macros), please post a suggestion on the TestStand idea exchange.

 

Hopefully this clarifies things!

 

 

Al B.
Staff Software Engineer - TestStand
CTA/CLD
0 Kudos
Message 9 of 19
(6,005 Views)

awesome....didn't think about trying to access it directly...Thanks!

0 Kudos
Message 10 of 19
(5,997 Views)