Variables and calculation of variables

A complete list of additional functions is contained in the overview of commands in the Appendix under Variable programming (V.).

Here, variables mean on the one hand an internal datum of the decoder with fixed name assignment; on the other hand they refer to self-defined variables whose designation is essentially freely selectable. With the exception of external variables (V.E...), their validity and utilisation are limited exclusively to a particular NC channel.

The general syntax is:



indicates access to the variables


Defines the global data designation:



represents axis-specific variables



represents spindle-specific variables


represents inter-axis, globally valid variables


represents external variables


represents self-defined, non-inter-program non-global variables


represents self-defined, non-inter-program local variables


specifies the data name


e.g. the index if a distinction must be made between several identical data.



Programming axis identification

The last identification code represents the axis code of axis-specific and several group-specific variables. Here, the designations

                                             ".X" or "[0]"

                                             ".Y" or "[1]"

                                             ".Z" or "[2]"

must be selectively used if the name "X" is assigned to the axis with the index 0, the name "Y" is assigned to the axis with the index 1 and the name "Z" is assigned to the axis with index 2 in the channel parameter list.



Absolute value of the Xaxis:

V.A.ABS.X or V.A.ABS[0]

Analogous to spindle-specific variables, the spindle names or the corresponding indices must be used as listed in the channel parameter synchronisation mode.

                                             ".S" or "[0]"

                                             ".S2" or "[1]” etc.



Logical axis number of the Sspindle:

Logical axis number of the Sspindle:

                    V.SPDL.LOG_AX_NR.S or V.SPDL.LOG_AX_NR[0]

Programing Example


The lines N20/N30 cause a linear interpolation in X direction by the value of the variables V.A.BZP.Y, i.e. the reference point offset in Y direction.

N10 G92 X0 Y40 Z0

(Reference point offset)

N20 G91 G01 F1000 XV.A.BZP.Y

N30 XV.A.BZP[1]

(here: axis index 1 == Y )

N40 M30

The content can be read by all variables and a value can also be assigned to several of them. The access type is firmly given for each variable, however generally only a reading access is allowed. Because for most of the variables a writing access is not practical.

Programing Example


Here, the 2nd zero offset vector for the axis with the index 1 is assigned the value 100:

N10 V.G.NP[2].V[1] = 100


The EXIST function (see Section Arithmetic expressions <expr>) checks whether a variable exists at all.

Programing Example


The EXIST request for an axis-specific variable checks whether a specific axis is found at all in the NC channel.

N10 G90 Y0


N30 X-10

(X axis exists in channel, move to position –10)


N50 #CALL AX [X,1,0]

(X axis does not exists in channel, first request axis)




Before access to an external variable, a check is made whether access is possible at all:

N10 G90 Y0


N30 XV.E.POS_1

(Move X axis to position POS_1)


N50 #MSG ["V.E.POS_1 not found!"]

(Output message and stop)

N55 M0