Mitsubishi Electric MELSEC iQ-R Series Programming Manual page 24

Hide thumbs Also See for MELSEC iQ-R Series:
Table of Contents

Advertisement

Instances
■ Instances
An instance is a label assigned to realize a function block definition. Multiple instances can be created from one function block
definition.
The following figure shows the instance structure.
FB1 definition
Ladder program (FB1)
bLabel0
INCP wLabel0
Local label definition (FB1)
Label name
Data type
bLabel0
BIT
wLabel0
WORD
Reserved area (FB1)
Area
Local label area
Local latch label area
(Since the label area is secured in units of four words, three-word areas (padding size) are secured in the above example.)
■ Creating instances
A function block needs to be instantiated to be used in programs.
By creating instances, a function block can be called and executed by a program block or another function block.
Declare instances with global labels or local labels.
Label type
Global label
*1
Local label
*1 Local labels can be declared as the local labels of a program block or function block. Local labels cannot be declared in a function.
3 PROGRAM ORGANIZATION UNITS
22
3.3 Function Blocks (FB)
Latch
Creating instance A
from FB1 definition
Size
48 words
16 words
Creating instance B
from FB1 definition
(same area size as
instance A)
Instance type
Global FB
Local FB
Instance A of FB1
Local label area
bLabel0
Padding size
3 words
Reserved area 48 words
Local latch label area
wLabel0
Padding size
3 words
Reserved area16 words
Instance B of FB1
Local label area
Local latch label area
Total area size 52 words
Total area size 20 words
Class
VAR_GLOBAL
VAR

Advertisement

Table of Contents
loading

Table of Contents