Cycles as global or local subroutines (Call L | LL CYCLE)

Cycles are available in the NC kernel in the form of global or local subroutines and permit special machining operations such as deep hole drilling or pocket milling. The machining task defined in the cycle is described in general form. When the cycle is invoked, the data is supplied when the transfer parameters are assigned.

A cycle is programmed independently of the currently valid plane (G17, G18, G19) and independently of the axis names configured in the NC channel. Only the direction from which machining should be executed in the current plane must be specified at cycle call. In the cycle, access can be made to an encapsulated group of parameters of its own. They are assigned values at cycle call.

A special syntax characterised by the "@" character is available for this purpose. This character is used in cycle programming 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 its own NC block without any further NC commands. The syntax consists of a global or local subroutine call with additional specification of cycle-dependent transfer parameters.

Syntax:

L | LL CYCLE [ NAME=<cycle> [MODAL_MOVE / MODAL_BLOCK] @P1=.. @P200=.. { \ } ]

NAME=<cycle>

Name of cycle (file name)

MODAL_MOVE

(MODAL, old syntax)

Modal cycle call. The cycle is again executed implicitly after every further NC block in the main program containing motion commands.

MODAL_BLOCK

Modal cycle call. The cycle is again executed implicitly after every further NC block in the active NC program.

 

With the following NC commands, the implicit block-modal cycle call is suppressed:

 

  • Blank lines, comment lines
  • Subroutine calls (L, LL, M6, G8xx).
  • $ commands ($GOTO, $IF, $FOR etc...)
  • Program end M functions (M2, M30, M17, M29)

 

 

 

 

The modal effect of MODAL_MOVE / _BLOCK is deselected by the NC command #DISABLE MODAL CYCLE.

@Pxx=..

List of transfer parameters.

A maximum of 200 @Pxx parameters of type REAL or STRING (as of V3.3079.25) can be transferred. Write and read accesses are only allowed within a cycle. The @Pxx parameters can be assigned direct values, any variables, P parameters and mathematical expressions.

\

Separator ("Backslash") for programming the command over multiple lines

Transfer parameters - @P parameter

Attention

attention

A cycle is a self-contained NC program unit with a defined machining task. It is advisable to avoid nested calls of cycles because there is a danger of assigning transfer parameters several times.

Notice

notice

Depending on the version, the processing lines of the cycle are masked or visible in the default setting in the running NC program or in single-block mode during the execution of a cycle in the display. When the display is off, only the cycle call is displayed during this time.

This feature is switchable by the channel parameter P-CHAN-00211.

Definitions required before cycle call:

Deselecting a modal cycle

A modal acting cycle (keyword MODAL_MOVE or MODAL_BLOCK in the cycle call) is deselected with the following NC command. The command must be programmed on its own in the NC block.

Syntax:

#DISABLE MODAL CYCLE

Available cycles:

The following cycles are available:

Programing Example

prg_example

Available cycles

The example below of a cycle call for drilling (drill.cyc) presents various parameter assignment parameter.

The drill.cyc drilling cycle requires the following transfer parameters:

@P1

Position of the retraction 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=drilling.cyc @P1=110 @P2=100 @P3=4 @P4=40]

..

or by specifying a relative drilling depth @P5:

..

Nxx L CYCLE [NAME=drilling.cyc @P1=110 @P2=100 @P3=4 @P5=60]

..

Cycle call with variables:

Variables must be defined and assigned values before cycle call.

..

#VAR

V.L.RPL = 110

V.L.WPL = 100

V.L.SDST = 4

V.L.DEP = 50

#ENDVAR

Nxx L CYCLE [NAME=drilling.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 cycle call.

..

Nxx P10 = 110

Nxx P11 = 100

Nxx P15 = 4

Nxx P17 = 50

Nxx L CYCLE [NAME=drilling.cyc @P1= P10 @P2=P11 @P3=P15 @P4=P17]

..

Cycle call with mathematical expressions:

..

Nxx P20 = 100

Nxx L CYCLE [NAME=drilling.cyc @P1= 10+P20 @P2=2*50 @P3=5-1 @P4=P20/2]

..

Cycle call with constant; any sequence of parameters in brackets:

..

Nxx L CYCLE [@P4=40 NAME=drilling.cyc @P2=100 @P3=4 @P1=110]

..

Cycle call with constant values; cycle should have a modal effect:

..

Nxx L CYCLE [NAME=drilling.cyc @P1=110 @P2=100 @P3=4 @P4=40 MODAL_MOVE]

..

[Example:]

%drill_main

N05 T1 D1

N10 M06

N15 G53 G17 G90 M3 S300 F200 S300

N16 G0 X0 Y0 Z0

N20 Z110

N30 X40 Y40 (drill position 1)

N40 L CYCLE [NAME=drilling.cyc @P1=110 @P2=100 @P3=2 @P4=55 MODAL_MOVE]

N50 X60 Y60 (drill position 2 and implicit cycle call because it is modal)

N60 X100 Y60 (drill position 3 and implicit cycle call because it is modal)

N70 X100 Y20 (drill position 4 and implicit cycle call because it is modal)

#DISABLE MODAL CYCLE

N80 X0 Y0 M5

N100 M30

Notice

notice

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. For this purpose, the cycle has the option of using 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 1: Axes in the cycle

Nxx G91 @X=@P1 @Y=@P2 @Z=@P3 F1000 G01

By analogy, so-called "neutral centre point coordinates" are available for programming circles. Meanings:

@I always the centre point coordinate in the first main axis

@J always the centre point coordinate in the second main axis

@K  always the centre point coordinate in the second main axis

Example 2: Circle in the cycle

Nxx G91 G02 @X=@P1 @Y=@P2 @I=@P4 @J=@P5 F1000

To remain independent from the spindle name configured during spindle programming, the main spindle can always be addressed in the cycle by the neutral spindle name @S.

@S  always the main spindle

Example 3: Spindle in the cycle

Nxx @S=1000 M3 (main spindle cw at 1000 rpm)

Example 4: Check @P parameter

Transferred @P parameters can be checked by the functions IS_STRING and IS_NUMBER.

%L cycle

( Check variables)

$IF IS_STRING[@P1] == TRUE

#MSG["Text: %s",@P1]

$ELSE

#MSG["Error no String"]

$ENDIF

$IF IS_NUMBER[@P2] == TRUE

#MSG["Number: %f",@P2]

$ELSE

#MSG["Error not a number"]

$ENDIF

M17

% Main

LL CYCLE [NAME=cycle @P1 ="String1" @P2=12.34]

M30