# Inspection Commands

Inspection command is used to run measurement or gauging on found features and output the results. It supports two commands: MEA and MEAA. MEA command will run the requested task synchronously, MEAA command on the other hand runs task asynchronously.

## MEA/MEAA

Run measurement. This is the last command in a multi-step alignment sequence, and it assumes all features have been located successfully with preceding “LF” commands.

### Command String

The two commands share the same command format. The only difference is the command key.

Command string for MEA command:

MEA,<EncodedID>,<PartID>,<RequestData>[,<UserString>]

Command string for MEAA command:

MEAA,<EncodedID>,<PartID>,<RequestData>[,<UserString>]

Field | Arguments
--- | ---
<EncodedID> | Alignment task + Process Tag(2000)
<PartID> | Serial number of part if it has, or any string if it is consistent for one part (PartID used here should be the same as used in LF commands if they are from the same part)
<RequestData> | 0: return string only feedback OK/NG information 1: return string feedback OK/NG and measurement result values
[,<UserString>] | Optional, for user to customize some extra data

### Result String

When task runs successfully:

MEA/MEAA,<Status>,<Token>,<PartID>,<ResultStatus>,<DataCount>,[<Data1>,][<Data1>,] ...[<DataN>,] CR/LF

Field | Arguments
--- | ---
<Status> | 1: Task run successfully
<Token> | The Token identifying the corresponding command
<PartID> | PartID provided by command string
<ResultStatus> | 0: Measurement results are out of specs 1: Measurement results are within specs
[<DataCount>] | The count of measurement results
[<Data1>,][<Data1>,] ...[<DataN>,] | Each measurement result data, optional

When task fails:

MEA/MEAA,<Status>,<Token>,<PartID>

Field | Arguments
--- | ---
<Status> | ErrorCode: Task fails
<Token> | The Token identifying the corresponding command
<PartID> | PartID provided by command string