## Branching On an Error

On Error dialog box

The Insert | Flow Control Command | On Error command can be used to tell PC-DMIS what action to take in the case that a machine Error occurs.

PC-DMIS tracks these error conditions:

- Unexpected Probe Hit

- Missed Probe Hit

- Reflector Not Found (used with the Tracker in PC-DMIS Portable)

For each of these error conditions, these possible actions can be taken:

- Jump to a label

- Set a variable's value to one

- Do nothing

- Skip command

By default, all part programs start with the action for both types of errors set to the third option (Do nothing). The action mode for each error type can be changed throughout the program.

Example: If during execution, PC-DMIS encounters an ON ERROR/ Unexpected Hit / Jump To Label command, any unexpected hits that occur after that point in the program will cause execution to jump to the specified label. The action to 'Set a Variable’s value to one causes the variable to be set as soon as the specified error type occurs. This value of the variable can then be tested using an IF statement to cause execution to jump to a new point in the part program.

The Edit window command line for the ON ERROR option reads:
ONERROR/UNEXPECTED_HIT, mode ID
or,
ONERROR/PROBE_MISS, mode ID
or,
ONERROR/REFLECTOR_NOT_FOUND, mode ID

To use the ON ERROR command:

1. Select On Error. The On Error dialog box will appear.

2. Select either Unexpected Probe Hit or Missed Probe Hit from the Error Type drop-down list.

3. Select one of the following Error Mode options to define what action should take place.

4. Click the OK button to apply the ON ERROR option. The Cancel button will close the On Error dialog box without applying any changes.

More:

Error Type

Error Mode

Supported Interfaces