5 Understanding Programming
5-46
CJ2 CPU Unit Software User’s Manual
Use the following formula as a guide to the number of steps used by function blocks.
Note Memory will not be used for the number of instruction steps in the function block definition (p) in the second
and later instances when the same function block definition is created in multiple locations (i.e., for multiple
instances). Therefore, in the above equation, the number of instruction steps in the function block definition
(p) is not multiplied by the number of instances.
Example
Five input symbols with a 1-word (INT) data type, five output symbols with a 1-word (INT) data type, and
a function block definition with 100 steps:
Number of steps for 1 instance = 57 + (5 + 5) × 6 steps + 100 steps + 27 steps = 244 steps
If the function block is written in the standard text language, the actual number of steps cannot be cal-
culated. The number of instruction steps in a function block definition can be checked in the properties
of the function block definition.
Additional Information
For function block specifications, notation methods, and input procedures, refer to the CX-Pro-
grammer Operation Manual: Function Blocks and Structured Text (Cat. No. W447).
Calculating the Number of Steps Used by Function Blocks
Number of steps used
= Number of instances × (Call part size m + I/O parameter transfer part size n × Number of parameters) + Num-
ber of instruction steps in the function block definition p (See note.)
Items Number of steps
m Call part 57 steps
n I/O parameter transfer
part
The data types are
indicated in parenthe-
ses.
1-bit (BOOL) input symbol or output symbol 6 steps
1-word (INT, UINT, WORD) input symbol or output sym-
bol
6 steps
2-word (DINT, UDINT, DWORD, REAL) input symbol or
output symbol
6 steps
4-word (LINT, ULINT, LWORD, LREAL) input symbol or
output symbol
12 steps
I/O symbols 18 steps
p Number of instruction
steps in function block
definition
The total number of instruction steps (same as standard user program) + 27
steps.