Detailed description
2.12 Block descriptions
Power Line Basic PLC Program (P3)
Function Manual, 08/2005 Edition, 6FC5397-0BP10-0BA0
2-147
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
//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
I 7.7; //Unassigned machine control panel key
S M 100.0; //Activate req.
V M 100.1; //Done completed message
R M 100.0; //Terminate job
V I 7.6; //Manual error acknowledgment
V M 102.0; //Error pending
R M 100.0; //Terminate job
Call fb 5, db 111(
Req := M 100.0, //Starting edge for
reading
Addr := GUDVAR.GUDVar1,
Area := B#16#2, //Channel variable
Unit := B#16#1, //Channel 1