Detailed Description
2.12 Block descriptions
PLC Basic Program Solution Line (P3 sl)
Function Manual, 08/2005 Edition, 6FC5397-0BP10-0BA0
2-133
Call example
Reading of a GUD variable with the name "GUDVAR1" as an integer variable
(see also table in FB 2: Assignment of NC data type in SIMATIC data type).
Call and parameterization of FB 5 with instance DB 111:
DATA_BLOCK DB GUDVAR //Assignment to symbol table
STRUC
GUDVar1 : STRING[32] := 'GUDVAR1'; //Name is defined by user
GUDVar1T :
STRUCT
SYNTAX_ID : BYTE ;
area_and_unit : byte;
column : word;
line : word;
block type : byte;
NO. OF LINES : BYTE ;
type : byte;
length : byte;
END_STRUCT;
END_STRUCT;
BEGIN
END_DATA_BLOCK
DATA_BLOCK DB 111 //Unassigned user DB, as instance for FB 5
FB 5
BEGIN
END_DATA_BLOCK
DATE_BLOCK 112 //Unassigned user DB, as instance for FB 3
FB 3
BEGIN
END_DATA_BLOCK
//A user-defined channel variable from channel 1 must be read
//with conversion into a variable pointer to allow subsequent writing of a variable.
Function FC "VariablenCall" : VOID
U I 7.7; //Unassigned machine control panel key
S M 100.0; //Activate req.
U M 100.1; //Done completed message
R M 100.0; //Terminate job
U I 7.6; //Manual error acknowledgment
U M 102.0; //Error pending
R M 100.0; //Terminate job
Call fb 5, db 111(