Function Blocks
Reduce Coding Errors
Data Protection
Improved Reusability with
Variable Programming
Creating Libraries
Compatible with
Multiple Languages
1-2-3
Function Block Structure
Function Block
Definitions
8
Coding mistakes can be reduced because blocks that have already been
debugged can be reused.
The variables in the function block cannot be accessed directly from the out-
side, so the data can be protected. (Data cannot be changed unintentionally.)
The function block's I/O is entered as variables, so it isn't necessary to change
data addresses in a block when reusing it.
Processes that are independent and reusable (such as processes for individ-
ual steps, machinery, equipment, or control systems) can be saved as func-
tion block definitions and converted to library functions.
The function blocks are created with variable names that are not tied to actual
addresses, so new programs can be developed easily just by reading the def-
initions from the file and placing them in a new program.
Mathematical expressions can be entered in structured text (ST) language.
Function blocks consist of function block definitions that are created in
advance and function block instances that are inserted in the program.
Function block definitions are the programs contained in function blocks. Each
function block definition contains the algorithm and variable definitions, as
shown in the following diagram.
Function Block Definition
Example: CLOCK PULSE
Algorithm
Variable definitions
1. Algorithm
Standardized programming is written with variable names rather than real I/O
memory addresses. In the CX-Programmer, algorithms can be written in
either ladder programming or structured text.
Example: CLOCK PULSE
1. Algorithm
tim_b
TIMX tim_a OFF_TIME
tim_a
TIMX tim_b ON_TIME
ENO
2. Variable Definitions
Usage
Name
Type
Internal
tim_a
TIMER
Internal
tim_b
TIMER
Input
ON_TIME
INT
OFF_TIME
INT
Input
Section 1-2
Need help?
Do you have a question about the CX-PROGRAMMER 5.0-FUNCTION BLOCK OPERATION and is the answer not in the manual?