Motion Group Stop (MGS)

This information applies to the
CompactLogix
5370,
ControlLogix
5570,
Compact GuardLogix
5370,
GuardLogix
5570,
Compact GuardLogix
5380,
CompactLogix
5380,
CompactLogix
5480,
ControlLogix
5580, and
GuardLogix
5580 controllers.
The Motion Group Stop (MGS) instruction initiates a stop of all motion in progress on all axes in the specified group by a method configured individually for each axis or as a group via the Stop Mode of the MGS instruction. If the MGS Stop Mode is specified as Programmed, each axis in the group is stopped according to the configured Programmed Stop Mode axis attribute. This is the same stopping mechanism that is employed by the Logix Operating System when there is a Logix controller state change. This Programmed Stop Mode attribute currently provides five different methods of stopping an axis:
  • Fast Stop
  • Fast Disable
  • Hard Disable
  • Fast Shutdown
  • Hard Shutdown
Alternatively, an explicit Stop Mode may be selected by using the MGS instruction. If a Stop Mode of Fast Disable is selected, all axes in the group stop with Fast Disable behavior. When the motion of all the axes in the group has been brought to a stop, the Process Complete (PC) bit is set in the control structure.
  • This is a transitional instruction. Follow these steps when using it:
    • In ladder logic, insert an instruction to toggle the rung-condition-in from false to true each time the instruction should execute.
    • In a Structured Text routine, insert a condition for the instruction to cause it to execute only on a transition.
Available Languages
Ladder Diagram
MGS_LD_avail_v31
Function Block
This instruction is not available in function block.
Structured Text
MGS(Group,MotionControl, StopMode);
Operands
Ladder Diagram and Structured Text
Operand
Type
Format
Description
Group
MOTION_GROUP
Tag
Name of the group of axes to perform operation on
Motion Control
MOTION_INSTRUCTION
Tag
Structure used to access instruction status parameters.
Stop Mode
UDINT
Immediate
Controls how the axes in the group are stopped. Select one of the following methods:
0 = Programmed - each axis is stopped according to how the individual axis has been configured.
1 = Fast Stop - each axis in the group is decelerated at the Maximum Deceleration rate and the stopped axis is left in the Servo Active state.
2 = Fast Disable - each axis in the group is decelerated at the Maximum Deceleration rate and the stopped axis is placed in the Axis Ready state.
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
StopMode
programmed
faststop
fastdisable
0
1
2
MOTION_INSTRUCTION Structure
Mnemonic
Description
.DN (Done) Bit 29
It is set when the group Programmed Stop has been successfully initiated for all axes in the group.
.ER (Error) Bit 28
It is set to indicate that the instruction detected an error, such as if you specified an unconfigured group.
.IP (In Process) Bit 26
It is set on positive rung transition and cleared after the Motion Group Stop is complete.
.PC (Process Complete) Bit 27
It is set after all the axes in group have been successfully brought to a stop according to each axis’ Programmed Stop Mode configuration.
Description
With the Stop Mode parameter set for Programmed, the MGS instruction brings motion for all of the axes in the specified group to a stop according to the configured Programmed Stop Mode for each axis. If the axis has both single axis motion moves and coordinated moves occurring, the MGS stops the single axis motion using the axis’ maximum deceleration rate and stops the coordinated  axes motion using the coordinate system’s maximum deceleration rate. A trapezoidal profile is always used for the deceleration regardless of the programmed profile type.
The MGS instruction initiates the same programmed stopping action that is automatically applied when the processor’s operating system changes operating mode (for example, Run Mode to Program Mode). This is particularly useful in designing custom motion fault handlers.
If the MGS Stop Mode parameter is set to Fast Stop, each axis in the group is forced to perform a Fast Stop process, regardless of the configured Programmed Stop Mode. Each axis in the group is decelerated at the Maximum Deceleration rate and, once stopped, the axis is left in the Servo Active state.
If the MGS Stop Mode parameter is set to Fast Disable, each axis in the group is forced to perform a Fast Disable process, regardless of the configured Programmed Stop Mode. Each axis in the group is decelerated at the Maximum Deceleration rate and, once stopped, placed into the Axis Ready (servo inactive and drive disabled) state.
The MGS instruction currently supports five Programmed Stop Action modes:
  • Fast Stop
  • Fast Disable
  • Hard Disable
  • Fast Shutdown
  • Hard Shutdown
Each axis may be configured to use any of these five stop modes. This table describes the effect of each these five stopping modes as they apply to an individual axis in the specified group.
Mode
Description
Fast Stop
For an axis configured for a Fast Stop the MGS instruction initiates a controlled stop much like that initiated by an MAS instruction. In this case the Motion Group Stop (MGS) instruction brings the axis motion to a controlled stop without disabling the axis servo loop. It is useful when a fast decelerated stop the axis is desired with servo control retained.
The MGS instruction uses the configured Maximum Deceleration of the axis to stop only the single axis motion.
The coordinated move portion of the axis uses the coordinated system configured Maximum Deceleration to stop the axis.
If the coordinate system contains orientation axes, configured Maximum Orientation Deceleration is used to stop orientation axes.
When a Fast Stop is used to stop a Motion Drive Start (MDS) instruction, the Direct Command feature is disabled. Additionally, the affected axis decelerates to a stop using its ramp deceleration.
Fast Disable
For an axis configured for a Fast Disable the MGS instruction initiates a controlled stop much like that initiated by an MAS instruction with the exception that the drive is disabled when the axis comes to a stop. Use MGS when a fast decelerated stop the axis is desired before the drive is disabled.
The MGS instruction uses the configured Maximum Deceleration of the axis to stop only the single axis motion.
The coordinated move portion of the axis uses the coordinated system configured Maximum Deceleration to stop the axis.
If the coordinate system contains orientation axes, configured Maximum Orientation Deceleration is used to stop orientation axes.
CIP Motion
When a Fast Disable is issued and a Direct Velocity command is issued via the MDS instruction, the CIP axis is disabled when all planned motion is stopped. However, in this case, the drive device continues coasting or stopping according to its Stop Action selection.
Hard Disable
For an axis configured for a Hard Disable the MGS instruction initiates the equivalent of an MSF instruction to the axis. This action immediately turns the appropriate axis drive output off, and disables the servo loop. Depending on the drive configuration, this may result in the axis coasting to a stop but offers the quickest disconnect of drive output power.
When a Hard Disable is used to stop a Motion Drive Start (MDS) instruction, the Direct Command feature is disabled. Additionally, the affected axis is immediately disabled.
Fast Shutdown
For an axis configured for a Fast Shutdown, the MGS instruction initiates a Fast Stop and then applies the equivalent of a Motion Axis Shutdown (MASD) instruction to the axis. This action turns the appropriate axis driver output OFF, disables the servo loop, opens any associated motion module’s OK contacts, and places the axis into the Shutdown state.
When a Fast Shutdown is used to stop a Motion Drive Start (MDS) instruction, the Direct Command feature is disabled. Additionally, the affected axis decelerates to a stop using its ramp deceleration is immediately shutdown.
Hard Shutdown
For an axis configured for a Hard Shutdown the MGS instruction initiates the equivalent of an Motion Axis Shutdown (MASD) instruction to the axis. This action turns the appropriate axis drive output OFF, disables the servo loop, opens any associated motion module OK contacts, and places the axis into the Shutdown state. Depending on the drive configuration, this may result in the axis coasting to a stop but offers the quickest disconnect of Drive power via the OK contacts.
To successfully execute a MGS instruction, the targeted group must be configured.
When a Hard Shutdown is used to stop a Motion Drive Start (MDS) instruction, the Direct Command feature is disabled. Additionally, the affected axis is immediately shutdown.
IMPORTANT:
The instruction execution may take multiple scans to execute because it requires multiple coarse updates to complete the request. The Done (.DN) bit is not set immediately, but only after the request is completed.
In addition to the ways the various stopping modes affect the Motion Drive Start (MDS) instruction were described in the previous table, all these modes also clear the MDS In Process (.IP) bit and clear the DirectVelocityControlStatus bit in the Motion Status attribute.
This is a transitional instruction:
  • In relay ladder, toggle Rung-condition-in from false to true each time the instruction should execute.
Master Driven Speed Control (MDSC) and the MGS Instruction
If an MGS is issued when in Master Driven Mode, a switch is made to Time Driven Mode and the axes are stopped in Time Driven Mode.
The IP bit of the Master Driven Axis Control (MDAC) and Master Driven Coordinate Control (MDCC) instructions are reset.
The AC bit of the MDAC and MDCC instructions are reset when the axis is stopped as the group is shutdown.
The status bit CalculatedDataAvailable in an active motion instruction status word for an MAM, MCLM or MCCM instruction is cleared when an MCS is executed (goes IP). The CalculatedData is not recomputed.
The MGS instruction clears the pending Master Axis for all future single and coordinated motion instructions.
Affects Math Status Flags
No
Major/Minor Faults
None specific to this instruction. See
Common Attributes
for operand related faults.
Execution
Ladder Diagram
Condition/State
Action Taken
Prescan
The .EN, .DN, .ER, and .IP bits are cleared to false.
Rung-condition-in is false
The .EN bit is cleared to false if either the .DN or .ER bit is true.
Rung-condition-in is true
The .EN bit is set to true and the instruction executes.
Postscan
N/A
Structured Text
Condition/State
Action Taken
Prescan
See Prescan in the Ladder Diagram table.
Normal execution
See Rung-condition-in is false, followed by rung is true in the Ladder Diagram table.
Postscan
See Postscan in the Ladder Diagram table.
Status Bits
MGS Changes to Single Axis Status Bits
If the Stop Type is
Then
NOT All
The instruction clears the Motion Status bit for the motion process that you stopped.
All
The instruction clears all Motion Status bits.
Bit Name
State
Meaning
MoveStatus
FALSE
Axis is not Moving.
JogStatus
FALSE
Axis is not Jogging.
GearingStatus
FALSE
Axis is not Gearing.
HomingStatus
FALSE
Axis is not Homing.
StoppingStatus
TRUE
Axis is not Stopping.
PositionCamStatus
FALSE
Axis is not Position Camming.
TimeCamStatus
FALSE
Axis is not Time Camming.
PositionCamPendingStatus
FALSE
Axis does not have a Position Cam Pending.
TimeCamPendingStatus
FALSE
Axis does not have a Time Cam Pending.
GearingLockStatus
FALSE
Axis is not in a Gear Locked condition.
PositionCamLockStatus
FALSE
Axis is not in a Cam Locked condition.
DirectVelocityControlStatus
FALSE
Axis is not under Direct Velocity Control.
DirectTorqueControlStatus
FALSE
Axis is not under Direct Torque Control.
Example
When the input conditions are true, the controller stops motion on all axes in group1. After the controller stops all motion, the axes are inhibited.
Ladder Diagram
MGS_LD_ex_v31
Structured Text
MGS(Motion,MGG_1,Programmed);
Provide Feedback
Have questions or feedback about this documentation? Please submit your feedback here.