Interruption and Continuation of Movements
The Robotics_Interrupt_Continue.project sample project described here is located in the installation directory of CODESYS under ..\CODESYS SoftMotion\Examples.
This example shows how commanded movements can be interrupted with the SMC_GroupInterrupt function block and resumed at a later time with the SMC_GroupContinue function block. The axis group can perform any movement between interruption and continuation.
Structure of the application
The application consists of a simple state machine in the PLC_PRG program and a trace to easily track the state transitions.
First, the axes and axis group are enabled. (
STATE_POWER_ON)Then, two movements,
moveLinearAandmoveLinearB, are commanded with blending. (STATE_START_MOVING)As soon as the second movement is active (when blending begins), the movement is interrupted. The cause could be, for example, that a tool defect has been detected.
(STATE_INTERRUPT)A relative PTP movement is performed in the positive Z-direction, for example, to replace the tool after the defect.
(STATE_INTERMEDIATE_MOVEMENT)Before resuming, the system returns to the position where the original movement was interrupted. (
STATE_GET_CONTINUE_POS/STATE_MOVE_TO_CONTINUE_POS)The original movement is resumed.
(STATE_CONTINUE)
Usage
Compile the created program and log in. To track the different states, you can download the trace to the controller. Start the application.
