core

#### Miscellaneous Functions

ARCSEGMENTENDINDEX

This function returns the index number of the ending point of a specified arc segment from a scan: ARCSEGMENTENDINDEX(<ID>, <index>,<tol1>,<tol2>)

<ID> - The first parameter is a string value of the ID of the scan on which this function pulls out the index number of the ending point for the arc. This parameter can either be the ID in quotation marks or any expression that when coerced to type string ends up being the ID of a scan.

<index> - The second parameter is the index number for the arc from which you want to get the ending point number. This is a one-based value. For example, the arc index number would be 3 if you want the ending point number for the third arc in the scan.

<tol1> - The third parameter is the general feature tolerance. It is a maximum form error used to break up the scan into lines and arcs.

<tol2> - The fourth parameter is the refine tolerance. Generally, this tighter tolerance is used to drop points from either end of the feature until the form error of the segment is within this tolerance.

Once you have the Start and End indices for an arc, you can use these points inside a constructed feature to construct a separate arc feature. For a similar example, see "Example of a Line Feature Created from a Scan Segment".

ARCSEGMENTSTARTINDEX

This function returns the index number of the starting point of a specified arc segment from a scan: ARCSEGMENTSTARTINDEX(<ID>, <index>,<tol1>,<tol2>).

<ID> - The first parameter is a string value of the ID of the scan on which this function pulls out the index number of the start point for the arc. This parameter can either be the ID in quotation marks or any expression that when coerced to type string ends up being the ID of a scan.

<index> - The second parameter is the index number for the arc from which you want to get the start point number. This is a one-based value. For example, the arc index number would be 3 if you want the start point number for the third arc in the scan.

<tol1> - The third parameter is the general feature tolerance. It is a maximum form error used to break up the scan into lines and arcs.

<tol2> - The fourth parameter is the refine tolerance. Generally, this tighter tolerance is used to drop points from either end of the feature until the form error of the segment is within this tolerance.

There are two additional parameters, which control whether an identified arc segment in a scan is acceptable. These can only be changed with the PC-DMIS Settings Editor. Any arc segment with a radius less than the value for the MinimumArcSegmentRadiusInMM registry entry is rejected. The default value for this parameter is 2 mm. Similarly, any arc segment with a radius greater than the value for the MaximumArcSegmentRadiusInMM registry entry is rejected. The default value for this parameter is 2000 mm (it should not be necessary to change this value).

Once you have the Start and End indices for an arc, you can use these points inside a constructed feature to construct a separate arc feature. For a similar example, see "Example of a Line Feature Created from a Scan Segment".

EOF and EOL

For information on these functions, see "Checking for the End of a File or the End of a Line" in the "Using File Input / Output" chapter.

FUNCTION

Creates a function: FUNCTION((<PARAM1>, <PARAM2>…), <EXPRESSION>)

Creates a function that takes the number of parameters indicated by the parameter list and substitutes those parameters into the expression.

1. - The first item when using the FUNCTION keyword is the parameter list.

   - This list consists of parameter names separated by commas.

   - The parameter list is also surrounded by parenthesis.

   - The second item is the expression.

   - The expression contains the parameter names where the parameters should be substituted when the function is called.

For an example, see the "Generic Function Example" topic.

GETROTABDATA

This function returns the center, angular position, and vector values for the specified rotary table.

GETROTABDATA(<PARAMETER>[,<TABLE>])

The function returns the values for the following configurations:

- Single rotary table

- Dual (independent) rotary tables

- Stacked rotary tables

The data that the function returns matches the data in the Rotary Table Setup dialog box (Edit | Preferences | Rotary Table Setup). For more information about this dialog box, see "Defining the Rotary Table".

CENTER

- "CENTER" - Returns the rotary table's current XYZ center.

- "CENTER","V" - Returns the current XYZ center for rotary table V in a dual-table or stacked-table configuration.

- "CENTER","W" - Returns the current XYZ center for rotary table W in a dual-table or stacked-table configuration.

Examples:

ASSIGN/V1=GETROTABDATA("CENTER") | V1 is set to the rotary table's current XYZ center.
ASSIGN/V1=GETROTABDATA("CENTER","V") | V1 is set to the current XYZ center for rotary table V.
ASSIGN/V1=GETROTABDATA("CENTER","W") | V1 is set to the current XYZ center for rotary table W.

ANGULAR POSITION

- "ANGLE" - Returns the rotary table's current angular position.

- "ANGLE","V" - Returns the current angular position for rotary table V in a dual-table or stacked-table configuration.

- "ANGLE","W" - Returns the current angular position for rotary table W in a dual-table or stacked-table configuration.

Examples:

ASSIGN/V2=GETROTABDATA("ANGLE") | V2 is set to the rotary table's current angular position.
ASSIGN/V2=GETROTABDATA("ANGLE","V") | V2 is set to the current angular position for rotary table V.
ASSIGN/V2=GETROTABDATA("ANGLE","W") | V2 is set to the current angular position for rotary table W.

VECTOR

- "VECTOR" - Returns the rotary table's current IJK vector.

- "VECTOR","V" - Returns the current IJK vector for rotary table V in a dual-table or stacked-table configuration.

- "VECTOR","W" - Returns the current IJK vector for rotary table W a dual-table or stacked-table configuration.

Examples:

ASSIGN/V3=GETROTABDATA("VECTOR") | V3 is set to the rotary table's current IJK vector.
ASSIGN/V3=GETROTABDATA("VECTOR","V") | V3 is set to the current IJK vector for rotary table V.
ASSIGN/V3=GETROTABDATA("VECTOR","W") | V3 is set to the current IJK vector for rotary table W.

The [TABLE] argument is optional. If you do not specify table V or W, PC-DMIS does one of the following:

- If you are using a single-table or stacked-table configuration, it returns the values for rotary table W.

- If you are using a dual-table configuration, it returns the values for the rotary table that is activated on the Active Rotary Table toolbar. For more information about the toolbar, see "Active Rotary Table Toolbar".

PC-DMIS has two internal table definitions to accommodate dual-table and stacked-table configurations. For a single-table configuration, the second table definition is not actually used. Because it does exist internally, an error will not occur if you specify table V in a single-table configuration; however, this is not recommended. The values that the function returns are not generally useful because the table does not actually exist.

IF

Conditional expression evaluation: IF(<EXPRESSION1>, <EXPRESSION2>, <EXPRESSION3>)

If expression1 evaluates to true (non-zero), then this function returns the value of expression2; otherwise, this function returns the value of expression3.

ISIOCHANNELSET

This expression takes two parameters. The first parameter indicates which I/O channel will be checked (the range of numbers that is available is based on the machine being used). The second parameter determines whether the software will query the Arm1 or Arm2 machine. If the second parameter is set to 1 (one), it will query the Arm2 controller. If the second parameter is not present (or is set to zero), then the IO Channel will query the Arm1 controller. The Arm1 controller is your only option if you are not in multiple arm mode.

If an invalid probe data type, tip id, probe file name, or channel number is supplied, the expression evaluates to 0.

Example:

ASSIGN/V4=ISIOCHANNELSET(3,0) | V4 will equal 1 (evaluate to true) when the channel is set, otherwise it will equal 0 (evaluate to false).

LINESEGMENTENDINDEX

This function returns the index number of the ending point of a specified line segment from a scan: LINESEGMENTENDINDEX(<ID>, <index>,<tol1>,<tol2>).

<ID> - The first parameter is a string value of the ID of the scan on which this function pulls out the index number of the ending point for the line segment. This parameter can either be the ID in quotation marks or any expression that when coerced to type string ends up being the ID of a scan.

<index> - The second parameter is the index number for the line segment from which you want to get the end point number. This is a one-based value. For example, the line segment index number would be 3 if you want the end point number for the third line in the scan.

<tol1> - The third parameter is the general feature tolerance. It is a maximum form error used to break up the scan into lines and arcs.

<tol2> - The fourth parameter is the refine tolerance. Generally, this tighter tolerance is used to drop points from either end of the feature until the form error of the segment is within this tolerance.

Once you have the Start and End indices for a line segment, you can use these points inside a constructed feature to construct a separate line feature. For an example, see "Example of a Line Feature Created from a Scan Segment".

LINESEGMENTSTARTINDEX

This returns the index number of the starting point of a specified line segment from a scan: LINESEGMENTSTARTINDEX(<ID>, <index>,<tol1>,<tol2>).

<ID> - The first parameter is a string value of the ID of the scan on which this function pulls out the index number of the start point for the line segment. This can either be the ID in quotation marks or any expression that when coerced to type string ends up being the ID of a scan.

<index> - The second parameter is the index number for the line segment from which you want to get the start point number. This is a one-based value. For example, the line segment index number would be 3 if you want the start point number for the third line in the scan.

<tol1> - The third parameter is the general feature tolerance. It is a maximum form error used to break up the scan into lines and arcs.

<tol2> - The fourth parameter is the refine tolerance. Generally, this tighter tolerance is used to drop points from either end of the feature until the form error of the segment is within this tolerance.

There is an additional parameter that controls whether an identified line segment in a scan is acceptable. This can only be changed with the PC-DMIS Settings Editor. Any line segment of a length less than the value for the MinimumLineSegmentLengthInMM registry entry is rejected. The default value for this parameter is 2 mm.

Once you have the Start and End indices for a line segment, you can use these points inside a constructed feature to construct a separate line feature. See "Example of a Line Feature Created from a Scan Segment" for an example.

PROBEDATA

This function returns data about the current or specified probe : PROBEDATA(<OPTPROBEDATATYPE>, <OPTTIPID>, <OPTPROBEFILENAME>)

This function takes up to three optional parameters. You only need to provide commas between the parameters if you use more than one parameter. You do not need to use commas between empty parameters. For example, to obtain the current probe's diameter you would use ASSIGN/V1=PROBEDATA("DIAM").

OPTPROBEDATATYPE - Optional parameter which specifies what probe data the expression should return. If this parameter is not supplied, the current tip ID is returned. This parameter is of type string. Any expression that evaluates to a valid string expression can be put in the first expression slot. Valid string expressions (not case sensitive) for the first parameter include the following. These are string expressions and should be inside double quotation marks:

"Offset" - Measured tip X,Y,Z offset. Returns type point.

"Vector" - Tip Vector. Returns type point.

"A" - Tip A Angle. Returns type double.

"B" - Tip B Angle. Returns type double.

"Diam" or "Diameter" - Measured tip diameter. The first four letters are required "Diam", but could include more letters up to the full name of "Diameter". Returns type double.

"Thick" or "Thickness" - Measured tip thickness. The first five letters are required "Thick", but could include more letters up to the full name of "Thickness". Returns type double.

"Date" - Date the tip was last qualified. Returns type string.

"Time" - Time the tip was last qualified. Returns type string.

"ID" - Tip ID. Default parameter. Returns type string.

"PrbRdv" - The probe's radial deviation. Returns type double.

"Standarddeviation" - The probe's standard deviation. Returns type double.

"C" - The C angle of a CW43 light probe head. Returns type integer.

Adding a "T" in front of "Offset", "Diameter", or "Thickness" returns the theoretical information (for example, TOFFSET, TDIAMETER, and TTHICKNESS).

OPTTIPID - This optional parameter specifies the tip to be used when obtaining the probe data specified in the first expression. If not supplied, the current tip is used. This parameter should be type string.

OPTPROBEFILENAME - This optional parameter specifies the probe filename to be used in obtaining the probe data. If this is not supplied, the current probe file is used.

Examples:

ASSIGN/V1=PROBEDATA() | V1 is set to current tip id (i.e. "T1A0B0")
ASSIGN/V2=PROBEDATA("TOFFSET","T1A45B0") | V2 is set to the theoretical probe offset for the tip T1A45B0
ASSIGN/V3=PROBEDATA("Date","T1A90B90","MYPROB") | V3 is set to a string representing the date tip T1A90B90of the probe file MYPROB was last qualified.

SETROTABDATA

This function sets the center or vector to the new input value: SETROTABDATA(<PARAMETER>,<NewValue>[,<TABLE>])
This function works in the following configurations:

- Single rotary table

- Dual (independent) rotary tables

- Stacked rotary tables

CENTER

- "CENTER",<NewValue> - Sets the rotary table's XYZ center to the new value.

- "CENTER",<NewValue>,"V" - Sets the XYZ center for rotary table V in a dual-table or stacked-table configuration to the new value.

- "CENTER",<NewValue>,"W" - Sets the XYZ center for rotary table W in a dual-table or stacked-table configuration to the new value.

Examples:

ASSIGN/V1=SETROTABDATA("CENTER",NewValue) | V1 is a return code (1=success, 0=failure).
ASSIGN/V1=SETROTABDATA("CENTER",NewValue,"V") | V1 is a return code (1=success, 0=failure).
ASSIGN/V1=SETROTABDATA("CENTER",NewValue,"W") | V1 is a return code (1=success, 0=failure).

VECTOR

- "VECTOR",<NewValue> - Sets the rotary table's IJK vector to the new value.

- "VECTOR",<NewValue>,"V" - Sets the IJK vector for rotary table V in a dual-table or stacked-table configuration to the new value.

- "VECTOR",<NewValue>,"W" - Sets the IJK vector for rotary table W a dual-table or stacked-table configuration to the new value.

Examples:

ASSIGN/V2=SETROTABDATA("VECTOR",NewValue) | V2 is a return code (1=success, 0=failure).
ASSIGN/V2=SETROTABDATA("VECTOR",NewValue,"V") | V2 is a return code (1=success, 0=failure).
ASSIGN/V2=SETROTABDATA("VECTOR",NewValue,"W") | V2 is a return code (1=success, 0=failure).

The [TABLE] argument is optional. If you do not specify table V or W, PC-DMIS does one of the following:

- If you are using a single-table or stacked-table configuration, it sets the new value for rotary table W.

- If you are using a dual-table configuration, it sets the new value for the rotary table that is activated on the Active Rotary Table toolbar. For more information about the toolbar, see "Active Rotary Table Toolbar".

PC-DMIS has two internal table definitions to accommodate dual-table and stacked-table configurations. For a single-table configuration, the second table definition is not actually used. Because it does exist internally, an error will not occur if you specify table V in a single-table configuration; however, this is not recommended. The values that the function sets are not generally useful because the table does not actually exist.

TUTORELEMENT

This function takes one parameter, either a number or a string (a string would be the ID of a feature).

TUTORELEMENT(<PARAMETER>)

This function works with the variable type, Structures. For explanations of structure and sub-elements, see "Structures".

Examples:

ASSIGN/E=TUTORELEMENT(1) | Creates a single Tutor Element Structure
ASSIGN/WM=TUTORELEMENT(n) | For any number over 1, this creates an array of n Tutor Element Structures
ASSIGN/CIR1E=TUTORELEMENT("CIR1") | Copies Data from feature CIR1 into the Tutor Element Structures.

The TutorElement structure currently has the following sub-elements:

Sub-Element | Description
ID | String of the Feature's ID
TYPE | INTEGER (FTYPE)
X, Y, Z | X, Y, and Z coordinate values
PR | Polar Radius
PA | Polar Angle
CX | I
CY | J
CZ | K
DM | Diameter 1
DM2 | Diameter 2
DS | Distance from the origin
A | Angle
AXY | Angle in the XY plane
AYZ | Angle in the YZ plane
AZX | Angle in the ZX plane
F | Form Error
SDEV | Standard Deviation
TP | Position

QUALTOOLDATA

This function returns data about the current or specified calibration tool. It has this syntax:

QUALTOOLDATA(<TOOLINFO>, <TOOLID>, <FACENUMBER>)

This function takes up to three parameters. It needs at least one parameter to return any data:

The first parameter, <TOOLINFO>, is a string that specifies the type of information to return about the calibration tool. If you don't pass this parameter, this function returns the name of the current or specified calibration tool.

- "CTE" or "COEFFICIENTOFTHERMALEXPANSION" - Either one of these strings returns the coefficient of thermal expansion as a double value.

- "DIAM" - This string returns the diameter of the tool as a double value.

- "ID" - This string returns the name of the tool as a string value.

- "LENGTH" - This string acts the same as "DIAM". It also returns the diameter of the tool as a double value.

- "OVERRIDEIJK" - This string returns the search override IJK vector as a point value.

- "POLYDIAM" - This string returns the diameter of the specified polyhedral face as a double value.

- "POLYIJK" - This string returns the IJK vector of the specified polyhedral face as a point value.

- "POLYXYZ" - This string returns the XYZ center of the specified polyhedral face as a point value.

- "SHANKIJK" - This string returns the IJK vector of the shank as a point value.

- "TYPE" - This string returns the type of tool as an integer value (0 for a sphere, 1 for an Arm2 sphere, 2 for a polyhedral, 3 for an Arm2 polyhedral).

- "WIDTH" - This parameter is no longer used.

- "XYZ" - This string returns the XYZ location of the tool as a point value.

The second parameter, <TOOLID>, is a string that specifies the name for the calibration tool for which you would like to receive information. If you don't pass this parameter, PC-DMIS assumes you want information from the current calibration tool. The string is not case sensitive.

The third parameter, <FACENUMBER>, is a parameter that you only need when you work with a polyhedral calibration tool and only when the first parameter is "POLYXYZ", "POLYIJK", or "POLYDIAM". This is an integer value that specifies the face of the polyhedral tool to use in order to obtain data.

Examples:

ASSIGN/VDIAM=QUALTOOLDATA("DIAM","SPHERE_1_IN") | Gives the variable VDIAM the diameter of the tool SPHERE_1_IN.
ASSIGN/VID=QUALTOOLDATA("ID") | Gives the variable VID the current tool's name.
ASSIGN/VTYPE=QUALTOOLDATA("TYPE") | Gives the variable VTYPE the current tool's type.
ASSIGN/VPOLYDIAM=QUALTOOLDATA("POLYDIAM","POLYTEST",3) | Gives the variable VPOLYDIAM the diameter of face 3 on the polyhedral tool, POLYTEST.