System for commanding a robot (70, 100) by a programmable logic controller, PLC, comprising the programmable logic controller, wherein the PLC comprises: • at least two function blocks (12, 14, 16, 18) with at least one respective input for triggering (22, 24, 26, 28) an execution of a belonging PLC function and at least one respective output (62, 44, 46) indicating the status of the respective function block (12, 14, 16, 18), whereas each function block (12, 14, 16, 18) corresponds to a movement segment (92, 94, 96, 98) of a movement path of the robot (70, 100) to be commanded, • a robot controller interface which is adapted to orchestrate a PLC function block (12, 14, 16, 18) currently in execution into a robot command (54, 56, 58, 60, 62, 64, 74, 76, 78), • a command queue, which is adapted to store respective orchestrated robot commands (54, 56, 58, 60, 62, 64, 74, 76, 78) for sending them sequentially to the robot (70, 100) for sequentially execution, characterized in that • the command queue is adapted to keep at least the lastly executed robot command within its memory, • the command queue is adapted to store additionally the information, whether a robot command (54, 56, 58, 60, 62, 64, 74, 76, 78) • has not yet been executed (waiting), • is currently in execution (active) or • has been executed (done), • the system is adapted to control a backwards motion of the robot (70, 100) along the movement path by stopping the execution of not yet executed robot commands for forward motion and by sequentially resending the at least one executed robot command stored in the command queue in a contrawise sequence to the robot (70,100) by using the PLC and • the system is adapted to delete all not yet executed robot commands for forward motion from the command queue in case of a backward motion. • at least two function blocks (12, 14, 16, 18) with at least one respective input for triggering (22, 24, 26, 28) an execution of a belonging PLC function and at least one respective output (62, 44, 46) indicating the status of the respective function block (12, 14, 16, 18), whereas each function block (12, 14, 16, 18) corresponds to a movement segment (92, 94, 96, 98) of a movement path of the robot (70, 100) to be commanded, • a robot controller interface which is adapted to orchestrate a PLC function block (12, 14, 16, 18) currently in execution into a robot command (54, 56, 58, 60, 62, 64, 74, 76, 78), • a command queue, which is adapted to store respective orchestrated robot commands (54, 56, 58, 60, 62, 64, 74, 76, 78) for sending them sequentially to the robot (70, 100) for sequentially execution, • the command queue is adapted to keep at least the lastly executed robot command within its memory, • the command queue is adapted to store additionally the information, whether a robot command (54, 56, 58, 60, 62, 64, 74, 76, 78) • has not yet been executed (waiting), • is currently in execution (active) or • has been executed (done), • has not yet been executed (waiting), • is currently in execution (active) or • has been executed (done), • the system is adapted to control a backwards motion of the robot (70, 100) along the movement path by stopping the execution of not yet executed robot commands for forward motion and by sequentially resending the at least one executed robot command stored in the command queue in a contrawise sequence to the robot (70,100) by using the PLC and • the system is adapted to delete all not yet executed robot commands for forward motion from the command queue in case of a backward motion.