Motion Configuration Instructions 
 
  Rockwell Automation Publication MOTION-RM002H-EN-P-February 2018  325 
Ladder Diagram and Structured Text 
Operand  Type  Format  Description 
Axis  AXIS_SERVO 
AXIS_SERVO_DRIVE 
Tag  Name of the axis to perform operation on. 
Motion Control  MOTION_INSTRUCTI
ON 
Tag  Structure used to access instruction status 
parameters. 
Diagnostic Test  UDINT  Immediate  Selects the specific test for the motion 
module to run: 
0 = motor/encoder hookup test 
1 = encoder hookup test 
2 = encoder marker test 
Observed 
Direction 
BOOLEAN  Immediate  Sets the direction of the test motion. Select 
either: 
0 = forward 
1 = reverse 
See Structured Text Syntax for more information on the syntax of expressions 
within structured text.   
For the operands that require you to select from available options, enter your 
selection as: 
This Operand  Has These Options Which You 
Enter as Text  Or Enter as a Number 
DiagnosticTest  motor_encoder 
encoder 
marker 
0 
1 
2 
ObservedDirection  forward 
reverse 
0 
1 
MOTION_INSTRUCTION Structure 
Mnemonic  Description 
.EN (Enable) Bit 31  It is set when the rung makes a false-to-true transition and remains set 
until the servo message transaction is completed and the rung goes false. 
.DN (Done) Bit 29  It is set after the hookup test apply process has been successfully executed. 
.ER (Error) Bit 28  It is set to indicate that the instruction detected an error, such as if you 
specified an unconfigured axis. 
Description 
The MAHD instruction is used to execute a series of computations resulting in 
values for the Encoder Polarity and Servo Polarity configuration bit parameters of 
the specified axis. As part of work performed by MAHD, these resultant 
configuration bit parameters are applied to the motion module so that the axis is 
ready for full servo operation. This instruction is designed to follow execution of 
the Motion Run Hookup Diagnostics (MRHD) instruction which generates axis