Implicit subroutine calls (G80–G89/G800-G819)

G80 G89 [ [<Val1>,<Val2>, - ,<Val50>] ]            Subroutine call                             (non-modal)

or in addition

G800 G819 [ [<Val1>,<Val2>, - ,<Val50>] ]            Subroutine call                             (non-modal)

G8x / G8xx

When programming G80–G89 and G800-G819, 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 and G800-G819 are programmed, the error message P-ERR-20131 "Unknown G function" is generated. The global subroutine is called only once; this means G80–G89 and G800-G819 have no modal effect.

<Val1>, - ,<Val50>

Optionally, a maximum of 50 transfer parameters (mathematic 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 ",,".

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. Use the variable V.G.@P[i].VALID in the subroutine (cycle) to determine whether a parameter is programmed (valid).

A G80–G89 and G800-G819 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


Implicit subroutine calls (G80–G89/G800-G819)

The global subroutine is called for G80:

N10 #FILE NAME[ G80="" ]

Nx ..    

N30 G80        Call as global subroutine


Assume the global subroutine is called for G815:


N10 #FILE NAME[ G815="" ]    

Nx ..    

N30 G815        Call as global subroutine


G85 calls the global subroutine with parameters:

N10 #FILE NAME[ G85="" ]

Nx ..    

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