Omron NX-SID Series User Manual page 209

Machine automation controller
Hide thumbs Also See for NX-SID Series:
Table of Contents

Advertisement

Function Block Definitions and Instances
A function block consists of a function block definition that is made in advance and instances that are
used in the actual programs. All instances of a function block are based on the function block definition.
A function block definition consists of an algorithm and a local variable table.
 Function Block Instances
When you place an instance of a function block definition in a program or another function block, the
function block definition is treated as a part of that program or function block. Function block defini-
tions that are called from a program or another function block are called instances. Every instance of
a function block has an identifier known as an instance name associated with it, and every instance
uses memory.
You can use a single function block definition to create more than one instance. This allows you to
process different I/O data with the same function.
Instance name
Function block definition name
Instance name
Function block definition name
If you place instance names FB1_1 and FB1_2 for function block FB1 in the program, each instance
requires its own space in memory. Instances cannot be read from other programs or function blocks.
If an instance with the same name as another instance is placed in a different program or another
function block, that instance will operate as a completely separate instance.
Precautions for Correct Use
In the following conditions, a user-defined function block will cause an error during the program
check when the program is built.
• The same function block instance was called more than once in the POU.
• The instance of the function block was registered as a global variable.
NX-series Safety Control Unit User's Manual (Z930)
Program POU
FB1_1
FB1
Variable
declarations
Algorithm
FB1_2
FB1
Variable
declarations
Algorithm
Memory
Memory area
area reserved.
Memory for
instance
FB1_1
Memory for
instance
FB1_2
Memory area reserved.
7 Programming
7 - 9
7

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents