6-7
6 Programming
NJ-series CPU Unit Software User’s Manual (W501)
6-2 POUs (Program Organization Units)
6
6-2-3 Differences between Programs, Functions, and Function Blocks
The hierarchical relationships between programs, functions, and function blocks are shown in the fol-
lowing figure.
]
Programs consist of a local variable table and an algorithm.
You can use any function or function block in the algorithm of a program.
You cannot call programs from other POUs.
6-2-3 Differences between Programs, Functions, and Function Blocks
Item POU type Programs Function blocks Functions
Execution method
Executed upon execu-
tion of assigned task.
Called from a pro-
gram or another func-
tion block.
Called from a pro-
gram, function, or
function block.
Algorithm
Any instructions Supported. Supported. Not supported.
User-defined functions Supported. Supported. Supported.
User-defined function
blocks
Supported. Supported. Not supported.
Execution condition
Executed each period. Executed each period.
Specify the execution
condition with an input
variable.
Specify the execution
condition with the EN
input.
6-2-4 Details on Programs
Program Structure
Task
Program 1
Program 2
Functions
Functions
Function blocks
Functions
Function blocks
FUN
FB
Local variable table
Program
Algorithm
Assigned.
Task
Program
Program