MC_Stop (FB)¶
FUNCTION_BLOCK MC_Stop
MC_Stop
places the axis in the stopping state.
As a result, currently running motions of function block
instances are aborted.
(The only exception is a running MC_Stop
instance, which is not
aborted. Instead, the just started MC_Stop
instance returns an error.)
As long as the axis is in the stopping state, no other instance can
execute a motion on it.
If the axis reaches the velocity value zero, the Done
output is set
to TRUE
. As long as the Execute
input is TRUE
, the axis
remains in the stopping state.
If Execute
goes to FALSE
and the Done
output is TRUE
,
the axis enters the standstill state.
Hint
In versions before CODESYS V3.5 SP4, the behavior was such that the axis went from stopping to standstill as soon as the velocity value reached zero.
Example
Use ofMC_Stop
The illustration shows how theFB2
instance of the typeMC_Stop
is combined with theFB1
instance of the type MC_MoveVelocity.
The rotary axis is ramped down by
FB2
.The axis does not execute any motion commands as long as
FB2.Execute
isTRUE
.
FB1
outputs an error message indicating that theFB2
instance is active.![]()
- InOut:
Scope
Name
Type
Comment
Inout
Axis
Reference to the axis
Input
Execute
BOOL
TRUE
: Starts execution on rising edge.Deceleration
LREAL
Maximum deceleration, positive, in [u/s²]
Jerk
LREAL
Maximum jerk, positive, in [u/s³]
Output
Done
BOOL
TRUE
: The axis has reached the velocity 0.Busy
BOOL
TRUE
: Function block is in operation.Error
BOOL
TRUE
: An error has occurred.ErrorID
SMC_ERROR
Error identification