MP Fundamental Terms

 

About the MP Command Listing

The MP Command Listing is intended to provide detailed and specific information on each available command offered through Measurement Plan (MP) scripts. If you need to figure out what is expected as an input or return from a command, this is where you will find the answer. The Measurement Plan chapter of the SA Users Manual is also available and includes an overview of the MP Editor and the scripting process.

 

Additional Job Configuration

Additional Steps that should be considered when running MP:

 

Naming and Reference Structure for Items Within SA.

Referencing specific items or objects in the tree requires a naming sequence. We use the Collection:: Object:: Name convention (which can also include a ::type specification at the end) in order to provide a path to a specific instance of an item.

Items within an SA job file can be categorized as follows:

 

Data Types

Every argument has a data type. A data type indicates the type of information that an argument is expecting. You must feed an argument data of a compatible data type otherwise, SA will prevent the operation or the script will fail at runtime.

Basic Data Types Within MP Include:

 

Working with Variables

Most data types can also be designated as a variable. Variables allow you to define a name that is associated with a value. This allows you to refer to that value by name. The advantage of this is that while a script is running, you may change or overwrite the value of that variable, but anywhere you refer to it by name, you’ll always retrieve its current value.

Defined variables appear in the variables view panel. Some lists, such as Point Name Reference Lists and Collection Object Name Lists also support a special Ctr+Shift double click option to display a new panel with the names of the items defined in the variable while in debug mode.

A variable name can also be use to define a variable. This allows a placeholder variable to be established in a script that reference a specific name to retrieve the variable values.

 

Search and Selection Tools

Supported wild-characters include: ‘*’, ‘?’; sets: [a-z],

‘!’ negation

Examples include:

‘[a-g]l*i?n’ matches ‘florian’

‘[!abc]*e’ matches ‘smile’

‘[-z] matches ‘a’

Wildcard selection automatically adds an asterisk (*) at the beginning and end of your search text. Each search string is automatically wrapped as *search string*. This allows you to search for “P1” and find “AP123”. However, this may result in selection of more items than desired. To control this operation use the command Set Wild Card Asterisk Mode.

 

Loop Step Structures

Loops within SA are performed using the following step structure:

 

of the list has been reached. A comparison step also provides a means to jump back to the Get-ith step in order to retrieve the next element from the list.

 

Iterator Step Structures

Many command such as Get i-th Point Name From Point Name Ref List also have an (iterator) option. These steps have a built in counter and integer comparison. Each time the step is run the internal counter indexes by one and checks to see if it has reached the end of the list. If it has, it uses the “Step to Jump at End of List” argument to jump out of the loop.

A loop using an iterator is as simple as:

  1. Build a list

  2. Add a get i-th step with (iterator)

  3. Perform any operations you wish

  4. Jump to Get i-th to get the next element.

    This built in Iterator concept works great when an MP is executed a single time. It will not work correctly when a loop is set within a loop (nested loop) as an iterator will not reset once it reaches the end of the list.

 

Relative Paths

Command arguments that designate a directory support both absolute paths (“C:\Analyzer Data\MP Work\test.xit”) and relative paths (“.\test.xit”). Relative paths are both faster to type and allow a directory to be moved without breaking the MP path designation. Note that relative paths may also relate to the working directory, depending on the command, which may be the SA install directory unless specified using Set Working Directory.

“.\” designates the current directory.

If a relative path is provided and the MP is embedded, the path will be relative to the current SA file location. But, if executing an external MP the file that will be opened will be opened with respect to the MPs directory.

Relative paths can also be expanded relative to the current directory. For example, to access a text file in the directory (C:\Analyzer Data\MP Work\Fit\Nominals.txt) from an SA file running from “.\MP Work” folder you can enter:

“.\Fit\Nominals.txt “

This can be expanded further to browse up:

“..\” designates one folder above the current directory

Following the same example, a template file in “C:\Analyzer Data\Templates” could be accessed from C:\Analyzer Data\ MP Work using “..\Templates\MyTemplate.xit64”. To browse up two levels use “..\..\”.