
Publication 1753-PM001A-EN-P - November 2005
8-4 Create User-Defined Function Blocks
Declare variables
Variable declaration defines the connecting points of the function
block. There are tabs for these types of variables.
Valid data types for variables are: BOOL, BYTE, DINT, DWORD, INT,
LREAL, REAL, SINT, TIME, UDINT, UINT, USINT, WORD. The default
type is BOOL.
The controller handles REAL values as float values and LREAL values
as double values.
To declare a variable, choose the tab for the type of variable from the
user-defined FBD editor. Right-click in any blank area and choose
New Variable.
Use this tab To define
VAR an internal variable without type limitations.
You can also define the attribute:
CONST a constant value that cannot be changed by logic
VAR_INPUT an input variable, which is also displayed on the block.
VAR_OUTPUT an output variable, which is also displayed on the block.
VAR_EXTERNAL
a global variable that can also be used and edited within
function blocks or functions. Value changes are also visible
to the outside.
ACTION an action block.
Action blocks describe what action should be performed and
which behavior should trigger it.
Komentarze do niniejszej Instrukcji