Implicit subroutine calls (G80–G89/G800..)

Syntax:

G80 G89 [ [<Val1>,<Val2>, - ,<Val50>] ]

Subroutine call

non-modal

or in addition

G800 -G8xx [ [<Val1>,<Val2>, - ,<Val50>] ]

Subroutine call

non-modal

G80-G8x / G800–G8xx

When programming G80–G89, G800– G80–G89 and G800-G839**, an assigned global subroutine is implicitly called and executed. The default names of these subroutines can be configured either in the channel parameters P-CHAN-00160 - P-CHAN-00169 and P-CHAN-00187 or defined during program runtime using the command #FILE NAME.

If no program name is saved when G80–G89, G800–G819 and G800-G839** are programmed, the error message ID 20131 "Unknown G function" is generated. The global subroutine is called only once; this means G80–G89, G800–G819 and G800-G839** have no modal effect.

<Val1>, - ,<Val50>

Optionally, a maximum of 50 transfer parameters (mathematical expressions in REAL format) can be bracketed in a fixed sequence to supply a subroutine (cycle). The parameters are separated by commas. Gaps in the sequence must be marked by consecutive commas ", ,".

By specifying transfer parameters, the subroutine call is handled as a cycle call according to the rules for cycles.

In analogy to cycle programming, the parameters can be read out in the subroutine using @Px accesses. There is a fixed assignment between the parameter and the @Px read access (e.g. @P1 reads parameter value 1, @P2 reads parameter value 2 and so on). Subroutines called in this way can also use the additionally extended cycle syntax with the @ character. The variable V.G.@P[i].VALID in the subroutine (cycle) determines a parameter is programmed (valid).

**Extended to 40 calls (G800 – G839) as of V3.1.3079.23

A G80–G89 and G800.. is always executed as the last action at block end. This means that axis motions are programmed in the same NC block. They are always executed before the global subroutine is called.

Programing Example

prg_example

Implicit subroutine calls (G80–G89/G8xx)

Assume the global subroutine g80_cycle.nc is called for G80:

N10 #FILE NAME[ G80="g80_up_test.nc" ]

Nx ..    

N30 G80        Call g80_up_test.nc as global subroutine

:

Assume the global subroutine g80_up_test.nc is called for G815:

..

N10 #FILE NAME[ G815="g815_up_test.nc" ]    

Nx ..    

N30 G815        Call g815_up_test.nc as global subroutine

:

G85 calls the global subroutine cycle_test.nc with parameters:

N10 #FILE NAME[ G85="cycle_test.nc" ]

Nx ..    

N30 G85 [10,2, ,15,-3, ,5]     Call cycle_test.nc as global subroutine

Example 2:

G803[5, @P1, @P2, @P3]

The meaning of the line above:

G803[@P1=5, @P2=@P1, @P3=@P2, @P4=@P3]

The result: all transferred parameters have the same value: 5