Mitsubishi Electric MELSEC Q Series Structured Programming Manual page 36

Fundamentals
Hide thumbs Also See for MELSEC Q Series:
Table of Contents

Advertisement

(3) Creating instances
When using function blocks, create instances to reserve internal variables.
Variables can be called from programs and other function blocks by creating instances for
function blocks.
To create an instance, declare as a label in a global label or local label of POU that uses
function blocks. Same function blocks can be instantiated with different names in a single
POU.
D10
D11
D12
D10
D11
D12
Function blocks perform operations using internal variables assigned to each instance.
4.2 POUs
4-12
4.2.8 Functions, function blocks, and operators
Instance A
Function block
D6200
Input label1
D6203
Output label
D6201
Input label2
D6202
D6204
Input label3
Local label
Uses same internal variables
for same instances
Instance A
Function block
D6200
Input label1
D6203
Output label
D6201
Input label2
D6202
D6204
Input label3
Local label
If the same function is called in the circuit multiple times, the value of internal
variables or output variables is overwritten everytime the function is called. To
hold the value of internal variables or output variables when the function is called,
edit programs to use function blocks or to save the values as different valuables.
D13
D6210
D10
Input label1
D13
D6211
D11
Input label1
D6212
D12
Input label1
Uses different internal variables
for different instances
Instance B
Function block
D6213
Output label
D13
D6214
Local label

Advertisement

Table of Contents
loading

This manual is also suitable for:

Melsec l seriesMelsec-f

Table of Contents