Mitsubishi Electric MELSEC iQ-R Series Programming Manual page 28

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

Advertisement

■ Example
The following figure shows an example where the function block initial values are used.
[Defining FB]
FB1
[Creating instances]
FB1
Creating
instances from
FB1
(1) The common initial values are set for all the instances.
(2) The individual initial values can be set for each instance.
(3) If the individual initial values are not set, the common ones will be used.
EN and ENO
In the same way as a function, EN (enable input) and ENO (enable output) can also be appended to a function block to control
execution processing.
Page 16 EN and ENO
When the instance of a function to which EN/ENO has been appended is called, an actual argument must be assigned to EN.
Creating programs
The program of a function block can be created by using the engineering tool.
[Navigation window]  [FB/FUN]  Right-click  [Add New Data]
The created program is stored in the FB/FUN file.
[CPU Parameter]  [Program Setting]  [FB/FUN File Setting]
Up to 64 programs can be stored in one FB/FUN file.
For details on program creation, refer to the following.
Item
How to create function programs
Number of FB/FUN files that can be written to a CPU module
■ Types of program
There are two types of function blocks and the program of each function block type is stored in different ways.
• Macro type function block
• Subroutine type function block
For details, refer to the following.
Page 27 Operation overview
The above cannot be selected for module function blocks, standard functions, and standard function blocks.
3 PROGRAM ORGANIZATION UNITS
26
3.3 Function Blocks (FB)
Local label definition (FB1)
Label
Initial
Data type
name
value
AAA
BIT
TRUE
BBB
INT
0
CCC
INT
65535
Initial value setting (FB1_a)
FB1_a
Label
name
FB1
AAA
BBB
CCC
Initial value setting (FB1_b)
FB1_b
Label
name
FB1
AAA
BBB
CCC
Initial value setting (FB1_c)
FB1_c
Label
name
FB1
AAA
BBB
CCC
(1)
Data type Initial
value
BIT
FALSE
INT
100
INT
20000
Data type Initial
value
BIT
FALSE
INT
200
INT
3500
Data type Initial
value
BIT
TRUE
INT
0
INT
65535
Reference
 GX Works3 Operating Manual
 MELSEC iQ-R CPU Module User's Manual (Startup)
Setting initial value of FB definition
Setting initial value of instances
(2)
(3)

Advertisement

Table of Contents
loading

Table of Contents