Academic Company Events NI Developer Zone Support Solutions Products & Services Contact NI MyNI

Document Type: Tutorial
NI Supported: Yes
Publish Date: Sep 6, 2006


Feedback


Yes No

Related Categories

Related Links - Developer Zone

Related Links - Products and Services

How to Make Additional Unit and Unit Prefix Selections Available in the Numeric Limit Test Step Type

3 ratings | 2.67 out of 5
Print
When you select Edit Limits from the context menu of a Numeric Limit Test or Multiple Numeric Limit Test step, you will see two ring controls adjacent to the Units control, in the Edit Limits dialog box. These ring controls list standard units and unit prefixes, which you can select to describe the measurement type in your report. The <TestStand>\Components\NI\Language\<Language>\Units.ini file defines the units and unit prefixes available in the ring controls. To add units, unit prefixes, or modify the existing units and unit prefixes, you need to modify the Units.ini file. Before you modify the Units.ini file, copy this file to <TestStand>\Components\User\Language\<Language>\ directory. Make any modifications to the Units.ini file located in the <TestStand>\Components\User\Language\<Language>\ directory.

The first section of the Units.ini file, named [SCALE_CATEGORIES], contains keys that define the unit prefixes as shown in the example below.

[SCALE_CATEGORIES]
TAGS = "YOTTA ZETTA EXA PETA TERA GIGA MEGA KILO HECTO DECA DECI CENTI MILLI MICRO NANO PICO FEMTO ATTO ZEPTO YOCTO"
YOTTA = "yotta"
YOTTA_ABBREV = "Y"
YOTTA_COMMENT = "10e24"
ZETTA = "zetta"
ZETTA_ABBREV = "Z"
ZETTA_COMMENT = "10e21"

Following are four items that describe each unit prefix in this section.
  • Tag name—Example: "YOTTA"
  • Long name—Included in the report. Example: "yotta"
  • Short name—Can alternately be included in the report. Example: "Y"
  • Comment—Displayed to the user when selecting a prefix. Example: "10e24"
Note When you add a new prefix to the Units.ini file, you must add all four items for the unit prefix following the format above.

Notice that you must start by adding a unique tag name to the list of existing tags. Unique tag names are stored within the value of the TAGS key that appears on the first line after the section name. Tag names are enclosed within a single set of double quotes, and are separated from each other by a space. The order of the prefix tag names, in the TAGS key value, must match the order of appearance of the prefix keys that follow that TAGS key.

For example, after adding a new prefix with the tag name of "MYPREFIX", the contents of Units.ini would resemble the following:

TAGS = "YOTTA MYPREFIX ZETTA ..."
YOTTA = "yotta"
YOTTA_ABBREV = "Y"
YOTTA_COMMENT = "10e24"
MYPREFIX = "newname" (This is the name that will appear in the ring control.)
MYPREFIX_ABBREV = "new" (This is the abbreviation that will appear in the units control if you select to use the "short name".)
MYPREFIX_COMMENT = "explanation" (Any comment or explanation that appears at the right of the name.)
ZETTA = "zetta"

The second section of the Units.ini file, named [~UNIT_CATEGORIES], contains the keys that define the unit categories in which the units are divided. These categories appear as submenus when the user selects units for a step. You can add or modify a unit category by adding to or modifying these keys. Each of the key names is then used as a section name, which contains the units of that category. An example of this is shown below.

[~UNIT_CATEGORIES]
DISTANCE_CATEGORY = "Distance"
AREA_CATEGORY = "Area"

[~DISTANCE_CATEGORY]
METER = "meter"
METER_ABBREV = "m"
METER_COMMENT = "SI base unit"
INCH = "inch"
INCH_ABBREV = "in"

You can add any unit to a specific unit category or a new unit category by following the structure above. For example, the "DISTANCE_CATEGORY", shown in the ring control as "Distance" (DISTANCE_CATEGORY = "Distance"), has its units defined under the [~DISTANCE_CATEGORY] section. The keys under this section follow the same structure as the [SCALE_CATEGORIES] section, described earlier in this document.


3 ratings | 2.67 out of 5
Print

Reader Comments | Submit a comment »

 

Legal
This tutorial (this "tutorial") was developed by National Instruments ("NI"). Although technical support of this tutorial may be made available by National Instruments, the content in this tutorial may not be completely tested and verified, and NI does not guarantee its quality in any way or that NI will continue to support this content with each new revision of related products and drivers. THIS TUTORIAL IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND AND SUBJECT TO CERTAIN RESTRICTIONS AS MORE SPECIFICALLY SET FORTH IN NI.COM'S TERMS OF USE (http://ni.com/legal/termsofuse/unitedstates/us/).