M1 Optional stop

At this point, the interpretation of the program code and the motion is interrupted if the user requests the optional stop within the evaluation time period. The optional stop signal must be withdrawn for continued travel. To do so, the G-code import is used to insert the call of a CallFunction with index 1 at the position of the M1 command. No path event is used. The user must program the time of the evaluation in CallFunction 1 both via an evaluation condition and via the signal of the optional stop. CallFunction 1 of the optional stop command is called as soon as the program interpreter reaches the command with the program pointer.

The optional stop functionality can be imported as an IEC code example, and the example can be adjusted and used. See also chapter Call functions for G-code.

The following G-code example shows the import of the M1 command:

G1 X0 Y0

G1 X350

M1

G1 Y350

G1 Y0

M30

Not going further than the configured lead-in, the SRL program interpreter continuously reads new commands, which may vary, just like the running time of the preceding commands, which mainly depends on the running duration of the preceding path segments. This may cause the signal that requests the optional stop to be interpreted too early or too late. Therefore, the user is required to specify an evaluation condition that reflects the time at which the signal that requests the optional stop is to be interpreted. As such, the user can use information from the robot UI to determine that the signal is being interpreted if, for instance, a certain remaining number of path segments, a certain residual length, or a residual time period has been reached up to the target point. If the evaluation conditions are not met, the user code must return the value "FALSE" in the CallFunction (CallF = FALSE). In this case, the program interpreter remains on the CallFunction command and continues to review the evaluation condition.

If the evaluation condition is met, the user must return the inverted signal for requesting the optional stop in CallFunction 1. The "TRUE" value of this signal means that the optional stop was requested. The "FALSE" value means that the application is being enabled for continued travel.

In the following example, the number of remaining path segments is selected as a condition for the evaluation time period. Only when the motion being carried out has arrived at the last path segment is the signal of the optional stop evaluated. Beforehand, the status of the signal is ignored. In this case, the SRL-BOOL variable with Index 82 is used as a signal source for requesting the optional stop. At this point, the user can also use other conditions or inputs (digital inputs/outputs).

Alternatively, the following conditions illustrated as examples can also be used to define the evaluation time period:

  • If a certain distance for reaching the target point is not reached:
  • Interface_Robot.Prg.OUT.lrRemainingDistance > 100.0
  • If a certain time period for reaching the target point does not elapse:
  • Interface_Robot.Prg.OUT.lrRemainingTime > 100.0
  • Via an SRL variable that was set via a condition in SRL or a PathEvent:
  • NOT Interface_Robot.PrgVar.axBoolValues[81]