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 FALSE and the Done output is TRUE, the axis enters the standstill state.
Notice
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 the zero level and the Done output thus went TRUE.
Example
Use of MC_Stop
The illustration shows how the FB2 instance of the type MC_Stop is combined with the FB1 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 is TRUE.
FB1 outputs an error message indicating that the FB2 instance is active.
InOut:
Scope |
Name |
Type |
Initial |
Comment |
Inout |
Axis |
Reference to axis |
||
Input |
Execute |
BOOL |
FALSE |
TRUE: Starts execution. |
Deceleration |
LREAL |
0 |
Deceleration
|
|
Jerk |
LREAL |
0 |
Jerk always positive in [u/s³] |
|
Output |
Done |
BOOL |
FALSE |
TRUE: Axis has reached the velocity 0. |
Busy |
BOOL |
FALSE |
TRUE: Function block is in operation. |
|
Error |
BOOL |
FALSE |
TRUE: Error has occurred. |
|
ErrorID |
SMC_ERROR |
0 |
Error identification |