08/2005 Expanding the Operator Interface (BE1)
3 Syntax
© Siemens AG, 2005. All rights reserved
SINUMERIK 840D sl/840D/840Di/810D HMI Installation and Start-Up Guide (IAM) – 08/2005 Edition
BE1/3-85
IF REG[5] == 1
REG[7] = VAR1
ELSE
IF REG[5] == 2
REG[7] = VAR2
ELSE
IF REG[5] == 3
REG[7] = VAR3
ELSE
IF REG[5] == 4
REG[7] = VAR4
ENDIF
ENDIF
ENDIF
ENDIF
END_CHANGE
3.6.4 Subprograms
Repeatedly used configuring instructions or others, which define the process for a
particular operation can be configured in subprograms. Subprograms can be
loaded into the main program or other subprograms at any time and executed as
often as necessary, i.e., the instructions they contain do not need to be configured
repeatedly. The definition blocks of the screen forms/softkey menu constitute a
main program.
Subprogram: Define
Subprograms are identified by the block identifier //B and terminated with //END in
a configuration file. Several subprograms can be defined under each block
identifier. A block is structured in the following way:
//B(Block name)
SUB (identifier)
...
END_SUB
[SUB(identifier)
...
END_SUB]
...
//END
where:
Block name Name of block identifier
Identifier Name of subprogram
Note
Variables programmed in subprograms must be defined in the screen form in
which these subprograms are called.