Programming manual.
CNC 8070
1.
CREATING A PROGRAM.
Variables and constants.
·48·
(REF: 1709)
1.9 Variables and constants.
Constants.
They are fixed values that cannot be modified by program; constants are numbers in decimal,
binary and hexadecimal system and read-only tables and variables because their value
cannot be changed within a program.
Hexadecimal values are represented preceded by the $ symbol.
Variables.
The CNC has a number of internal variables that may be accessed from the user program,
from the PLC or from the interface.
User variables.
The user can create his own variables. These are read-write variables and are evaluated
during block preparation.
The mnemonics of the variables are the following. Replace the suffix name with the name
of the variable.
V.P.name - Local user variable.
V.S.name - Global user variable.
Local user variables may only be accessed from the program or subroutine where they have
been programmed. Global user variables will be shared by the program and the subroutines
of the channel.
Global user variables maintain their value after a reset.
Initialize the user variables.
Variables are deleted when the CNC is turned off and they can also be deleted from the part-
program using the #DELETE instruction. This statement may be used to initialize the global
and local variables stored in the CNC, even if they are not being used by the program. The
#DELETE instruction must always go with some variable; it must not be programmed alone
in the block.
Hexadecimal
$4A
Decimal
74
Binary
0100 1010
V.P.mylocalvar
V.S.myglobalvar
#DELETE V.P.localvar1
#DELETE V.S.globalvar1 V.S.globalvar2