Programming
The loop condition is coupled to the real-time variable V.RTG.LOOP.ENABLED. The real-time loop is programmed by the following command.
Syntax: | |
#RT WHILE [ [MODULO] ]
#RT ENDWHILE | |
| |
MODULO | (optional) at the end of the loop, the “dist_prog_start” function is reset to the start value of the real-time loop. If this parameter is not programmed, this variable is continuously incremented. See Comparison chart in display data. |
The loop condition is programmed using the syntax of the real-time cycles.
Syntax: |
#RT CYCLE [DEF] [[ ID =.. ] SCOPE =.. END_ACTION =..] ;…Instructions #RT CYCLE END |
DEF | Realtime cycle is only defined but not started yet. |
ID=.. | Unambiguous identifier of the realtime cycle, see Note. |
SCOPE | For validity, see Validity. Permissible identifiers are BLOCK, PROG or GLOBAL. |
END_ACTION | Behaviour at end of the real-time cycle, see Action at end. Permissible identifiers are MOVE_ABORT or MOVE_CONT. |
In the following programming example, the loop condition is coupled to the value of the external variable V.E.RtLoopEnable in a real-time cycle.
In the parameter P-EXTV-00005 the external variable must be parameterised as synchronous.
Programming Example
Real-time loop with external variable as loop condition
Programming Example
Real-time loop with variable geometry
This example shows a real-time loop which has a variable geometry due to the command #OPTIONAL EXECUTION ON/OFF [SIMULATE]. The geometry in #OPTIONAL EXECUTION ON/OFF [SIMULATE] can be enabled or disabled by the simulate_motion control unit during machining. It is also possible to enable other NC commands such as M functions with #OPTIONAL EXECUTION ON/OFF [SIMULATE].