3 Function Construction
3.2 Labels
29
FXCPU Structured Programming Manual
(Application Functions)
1
O
utlin
e
2
Function Li
st
3
Functi
on
Cons
tructi
on
4
Ho
w t
o R
ea
d
Explanati
on of
Func
tions
5
Appl
ie
d
Functions
6
Stan
dard
Functi
on
Blocks
A
Correspondence
be
tw
een Dev
ice
s
an
d A
ddres
ses
3.2
Labels
Label types
Labels are classified into two types, global and local.
• Global labels can be used in program components and function blocks.
• Local labels can be used only in declared program blocks.
Label class
The label class indicates how each label can be used from which program component.
The table below shows label classes.
Label definition
It is necessary to define a label to use the label.
An error will occur when a program in which labels are not defined is converted (compiled).
• When defining a global label, set the label name, class and data type, and assigns a device.
• When defining a local label, set the label name, class and data type.
You do not have to specify devices for local labels. Assignment of devices is automatically executed
during compiling.
In the example below, the label "VAR_D10" is set for the function "BOOL_TO_STR_E".
• When using "VAR_D10" as a global label
Set the class, label name, data type and device (or address).
• When using "VAR_D10" as a local label
Set the class, label name and data type.
Class
Description
Applicable program component
Program
block
Function
Function
block
VAR_GLOBAL
Common label available in all program components
3
3
VAR_GLOBAL_CONSTANT Common constant available in all program components
3
3
VAR
Label available within declared program components, and not
available in any other program component
3
3
3
VAR_CONSTANT
Constant available within declared program components, and
not available in any other program component
3
3
3
VAR_INPUT
Label which receives a value, and cannot be changed in
program components
3
3
VAR_OUTPUT
Label output from a function block
3
VAR_IN_OUT
Local label which receives a value, outputs it from a program
component, and can be changed in program components
3
BOOL_TO_STR_E
EN
ENO
VAR_D10
X000
_BOOL
M0