Mitsubishi Electronics FXCPU Video Game Controller User Manual


 
44
3 Configuration of Instruction
3.2 Labels
FXCPU Structured Programming Manual
[Basic & Applied Instruction]
3.2 Labels
Types of labels
Labels are either global labels or local labels.
Global labels are available for use in program blocks and function blocks.
Local labels are available for use only in a declared program part.
Label classes
The label classes indicate how they are used in which program parts.
The table below shows the label classes.
Definition of labels
Before using a label, the label needs to be defined. An error is generated if attempting to convert (compile) a
program where the label is not defined.
Where defining a global label, the label name, class, data type and device are interrelated.
Where defining a local label, the label name, class and data type are set.
The user does not have to specify a device when using a local label. A device is allocated automatically
during the compilation.
The following is an example of setting the label Var_dint1 and Var_dint2 of a DMOV instruction.
When using as a global label:
Set the class, label name and data type and device or address.
Label class Descriptions
Program parts available for use
Program
block
Function
Function
block
VAR_GLOBAL A common label that can be used in all program parts. 33
VAR_GLOBAL_CONSTANT A common constant that can be used in all program parts. 33
VAR
A label used within declared program parts. It cannot be used
in other program parts.
333
VAR_CONSTANT
A constant used within declared program parts. It cannot be
used in other program parts.
333
VAR_INPUT
A label that receives values. It cannot be changed within
program parts.
33
VAR_OUTPUT A label for output from a function block. 3
VAR_IN_OUT
A local label that receives values and outputs from a program
part.
3
DMOV
EN
s
ENO
d
X000
Var_dint1 Var_dint2