Rockwell Automation Publication 1756-UM001M-EN-P - February 2012 153
Develop Motion Applications Chapter 9
Figure 22 - Motion Control Instruction
Example
Here’s an example of a simple ladder diagram that homes, jogs, and moves an axis.
ATTENTION: Use the tag for the motion control operand of motion
instruction only once. Unintended operation of the control variables
may happen if you reuse of the same motion control tag in other
instructions.
If Initialize_Pushbutton = on and the axis = off (My_Axis_X.ServoActionStatus = off) then
the MSO instruction turns on the axis.
If Home_Pushbutton = on and the axis hasn’t been homed (My_Axis_X.AxisHomedStatus = off) then
the MAH instruction homes the axis.
If Jog_Pushbutton = on and the axis = on (My_Axis_X.ServoActionStatus = on) then
the MAJ instruction jogs the axis forward at 8 units/second.