Cycles as global sub-routines (Call L CYCLE)
Cycles are available in the NC kernel in the form of sub-routines and enable special machining operations such as deep hold drilling or pocket milling. The machining task defined in the cycle is described in a general form. When the cycle is invoked, the data is supplied on assignment of the transfer parameters.
A cycle is programmed independently of the currently valid plane (G17, G18, G19) and independently of the axis names configured in the NC channel. In the cycle, you can access encapsulated group of parameters of your own. These are assigned values when the cycle is invoked.
Special syntax, which is characterised by the "@" character, is available for this purpose. In cycle programming, this character is used in combination with:
@Pxx Transfer parameter in the cycle call and the cycle
@X, @Y, @Z Main axes in the cycle
@I, @J, @K Centre point coordinates in the cycle
@S Main spindle in the cycle
The cycle call must be programmed in a separate NC block without any further NC commands. The syntax consists of a global subroutine call with additional specification of the cycle-dependent transfer parameters.
L CYCLE [NAME=<cycle_name> [MODAL] @P1=<expr>
.. @P30=<expr> ]
NAME=<cycle_name> Name of cycle (file name)
MODAL Modal cycle call. After every further NC block in the main program that contains movement commands, the cycle is implicitly executed again.
The modal effect is cancelled by the NC command #DISABLE MODAL CYCLE.
@P1<expr>... List of the transfer parameters.
... @P30<expr> A maximum of 30 @Pxx parameters of the REAL type can be passed on. Write and read access is only allowed within a cycle. The @Pxx parameters can be assigned direct values, any variables, P parameters and mathematical expressions.
Within bracketing, no order is required for specifying the key words and transfer parameters. During programming, users only need to know which @Pxx parameters have to be assigned for the cycle called.
Parameters that are not needed can be omitted. On calling, @Pxx parameters that are not programmed are initialised with 0 (zero). Weather a parameter is programmed (valid), can be checked in cycle by the variable V.G.@P[i].VALID. The transfer parameters remain up to the programmed call of another cycle.
Transfer parameters programmed in the cycle call, but not used in the cycle itself, are ignored.
Notice | |
A cycle is a self-contained NC program unit with a defined machining task. It is advisable, to avoid the nested calls of cycles, because there is the danger of multiple setting of transfer parameters. |
Depending on the version, in the default setting display of the cycle's executed lines is on or off during execution of a cycle in the running NC program or in the single block mode. When display is off, only the cycle call is displayed during this time. |
Definitions required before cycle call:
- Modal G functions and circle geometries and the currently active feed rate (F word) active before cycle call are retained beyond the cycle. This feature can be changed with channel parameter [1]-51.
- Modal G functions that are programmed in combination with axis names (e.g. G92, G98, G99, G100, G112, G130, etc.) are not restored if they were programmed in the cycle itself.
- The machining plane (G17, G18, G19) should be defined in the higher-level NC program before cycle call. In drilling cycles, the axis perpendicular to this plane is the axis in which the drilling operation is performed and in milling cycles it is the feed axis for the depth.
- Any tool geometry compensation (e.g. length compensation) must also be selected before the cycle is invoked.
- The values required for the feed rate, the spindle speed and the spindle rotation direction must be defined in the higher-level NC program, unless there are corresponding transfer parameters in the cycle.
- The spindle commands programmed in the cycles always refer to the active main spindle of the NC channel. Make sure that this main spindle has been defined before the cycle call.
- The starting position for a corresponding drilling or milling operation and the tool's orientation must always be moved to before the cycle is invoked in the higher-level NC program.
Cancelling a modal cycle
A modally acting cycle (key word MODAL in the cycle call) is cancelled with the following NC command. The command must be programmed on its own in the NC block.
#DISABLE MODAL CYCLE
Available cycles |
For the machining tasks
- Drilling
- Thread tapping
- Helical mill drilling
- Pocket milling
parameter-definable cycles are available. For more information about programming and use see the functional description "Cycles" (CNC cycles).
Programming examples
The various parameter assignment possibilities are presented below with reference to the example of a cycle call for drilling (drill.cyc).
The drill.cyc drilling cycle requires the following transfer parameters:
@P1 -> Position of the return plane (absolute)
@P2 -> Position of the machining plane (absolute)
@P3 -> Safety distance (unsigned)
@P4 -> Final drilling depth (absolute) or
@P5 -> Final drilling depth relative to the machining plane (unsigned)
Cycle call with constant values:
..
Nxx L CYCLE [NAME=drill.cyc @P1=110 @P2=100 @P3=4 @P4=40]
..
or with specification of a relative drilling depth @P5:
..
Nxx L CYCLE [NAME=drill.cyc @P1=110 @P2=100 @P3=4 @P5=60]
..
Cycle call with variables:
The variables must be defined and assigned values before the cycle call.
..
#VAR
V.L.RPL = 110
V.L.WPL = 100
V.L.SDST = 4
V.L.DEP = 50
#ENDVAR
Nxx L CYCLE [NAME=drill.cyc @P1= V.L.RPL @P2=V.L.WPL @P3=V.L.SDST @P4=V.P.DEP]
..
Cycle call with P parameters:
The parameters must be defined and assigned values before the cycle call.
..
Nxx P10 = 110
Nxx P11 = 100
Nxx P15 = 4
Nxx P17 = 50
Nxx L CYCLE [NAME=drill.cyc @P1= P10 @P2=P11 @P3=P15 @P4=P17]
..
Cycle call with mathematical expressions:
..
Nxx P20 = 100
Nxx L CYCLE [NAME=drill.cyc @P1= 10+P20 @P2=2*50 @P3=5-1 @P4=P20/2]
..
Cycle call with constant values, any sequence of parameters in brackets:
..
Nxx L CYCLE [@P4=40 NAME=drill.cyc @P2=100 @P3=4 @P1=110]
..
Cycle call with constant values, cycle is to have a modal effect:
..
Nxx L CYCLE [NAME=drill.cyc @P1=110 @P2=100 @P3=4 @P4=40 MODAL]
..
Example
%drill_main
N05 T1 D1
N10 M06
N15 X0 Y0 Z0 G0 G90 F200 S300 M3 G53 G17
N20 Z110
N30 X40 Y40 (drilling 1)
N40 L CYCLE [NAME=drill.cyc MODAL @P1=110 @P2=100 @P3=2 @P4=55]
N50 X60 Y60 (drilling 2 and implicit cycle call because it is modal)
N60 X100 Y60 (drilling 3 and implicit cycle call because it is modal)
N70 X100 Y20 (drilling 4 and implicit cycle call because it is modal)
#DISABLE MODAL CYCLE
N80 X0 Y0 M5
N100 M30
Notes on creating cycles |
As far as possible, cycles must be programmed as generally valid and independently of the axis names currently used in the NC channel and the definition of planes. To this end, in the cycle there is a possibility of using the plane-independent "neutral axis names " @X, @Y and @Z for the first three main axes. Meanings:
@X -> always the first main axis
@Y-> always the second main axis
@Z-> always the third main axis
Example: axes in the cycle
Nxx G91 @X=@P1 @Y=@P2 @Z=@P3 F1000 G01
By analogy, so-called "neutral center point coordinates" are available when programming circles. Meanings:
@I -> always the center point coordinate in the first main axis
@J -> always the center point coordinate in the second main axis
@K -> always the center point coordinate in the third main axis
Example: circle in the cycle
Nxx G91 G02 @X=@P1 @Y=@P2 @I=@P4 @J=@P5 F1000
To also be independent from the configured spindle name during spindle programming, in the cycle the main spindle can always be addressed with the neutral spindle name @S.
@S -> always the main spindle
Example: spindle in the cycle
Nxx @S=1000 M3 (main spindle cw with 1000 rpm)