# CommandArgs

When the application receives a command string, an object of type CommandArgs is created in the CommandHandler script. This object contains all the data needed to execute the task correctly. Some of the data that is encoded includes the task execution mode, current stage position received in the command string etc. Additional information can be added to the object using the CommandArgs.SetCustomArgs method. Every task has a Command subtask which is used to receive CommandArgs settings from Task Scheduler.

The table below shows main properties of the CommandArgs class and their equivalent with Command String.

Name | Description | Command String
--- | --- | ---
CommandFromPLC | Command received from PLC/Robot | Command String itself
StepID | StepID associated with the command | StepID decoded from EncodedID
CommandName | The name of requested task | Decoded from StepID
PositionIndex | Acquisition position index. This parameter will be used when a camera or set of cameras, captures images of a part at different physical locations | Decoded from StepID
ExecutionMode | Acquire: Perform acquisition only AcquireAndProcessImage: Acquire and process image ProcessImage: Do not acquire and process only | Decoded from EncodedID
AlignmentOperation | Specify if the pose computer is receiving training data or data to be used for alignment, or if the feature finder is extracting training data or run-time data for alignment Train: Pose computer is receiving training data, or feature finder is extracting training data Align: Pose computer is receiving data for aligning parts | Decoded based on CommandKey: TT or TA command are for Train, LF, LFA or LFGP commands are for Align
HECalibrationOperation | Specify hand-eye calibration operations ClearAndAccumulateFeatures: Accumulate features after clearing accumulator AccumulateFeatures: Accumulate features ComputeResults: Compute hand-eye calibration results AccumulateFeaturesAndComputeResults: Compute hand-eye calibration results | Decoded based on CommandKey: HEB command will set operation as ClearAndAccumulateFeatures, HE command will set as AccumulateFeatures; HEE command will set as ComputeResults. When Vision Guided mode is used for hand-eye calibration, those parameters will be set by hand-eye calibration loop task automatically.
ErrorCode | Error code associated with the command | ErrorCode is generated by the vision system, and then stored here and at last forwarded to external device when there is any error happens.
SerialNumber | Serial number of part | Equals to PartID specified in LF, LFA, GP, GPA, LFGP, MEA, MEAA, LFMEA, MGP, MGPA or LFMGP command. For other commands, it's an empty string.
OtherArgs | Other Info, like current x, y, theta value of motion or any other user defined content set using the method CommandArgs.SetOtherArgs | Saves current pose of motion device that specified in parameters of command string
Token | A unique identifier for the command argument | An ID generated by vision system for any input Command String