31
Function Block Specifications
Section 2-1
2-1-2 Function Block Elements
The following table shows the items that must be entered by the user when
defining function blocks.
Function Block
Definition Name
Each function block definition has a name. The names can be up to 64 char-
acters long and there are no prohibited characters. The default function block
name is FunctionBlock@, where @ is a number (assigned in order).
Language Select either ladder programming language or structured text (ST language).
Note (1) For details on ST language, refer to SECTION 5 Structured Text (ST)
Language Specifications in Part 2: Structured Text (ST).
(2) When nesting, function blocks using ST language and ladder language
can be combined freely (version 6.0 and higher only).
Variable Definitions Define the operands and variables used in the function block definition.
Variable Names • Variable names can be up to 30,000 characters long.
• Variables name cannot contain spaces or any of the following characters:
!“ #$%&‘()=-~^\|‘@{[+;*:}]<,>.?/
• Variable names cannot start with a number (0 to 9).
• Variable names cannot contain two underscore characters in a row.
•
The following characters cannot be used to indicate addresses in I/O
memory.
A, W, H (or HR), D (or DM), E (or EM), T (or TIM), C (or CNT) followed
by the numeric value (word address)
Item Description
Function block
definition name
The name of the function block definition
Language The programming language used in the function block defini-
tion. Select ladder programming or structured text
Variable definitions Variable settings, such as operands and return values,
required when the function block is executed
• Type (usage) of the variable
• Name of the variable
• Data type of the variable
• Initial value of the variable
Algorithm Enter the programming logic in ladder or structured text.
• Enter the programming logic using variables.
• Input constants directly without registering in variables.
Comment Function blocks can have comments.
CLOCK PULSE
EN ENO
(BOOL) (BOOL)
ON_TIME
(INT)
OFF_TIME
(INT)
Function block definition name