P3: Basic PLC Program for SINUMERIK 840D sl
13.13 Block descriptions
Call example 1
Read a GUD variable from channel 1 with the name "GUDVAR1" (type definition of the variables: INTEGER).
The user-defined variable should be converted in a 10-byte variable pointer for the subsequent writing with the
F3 (see also the table "Assignment of the data types" in "FB 2: Read GET NC variable [Page 933] ").
Call and parameterization of FB 5 with instance DB 111:
// Data block for GUD variable
DATA_BLOCK DB_GUDVAR
STRUCT
GUDVar1 : STRING[32] := 'GUDVAR1';
GUDVar1Token :
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
//Unassigned user DB, as instance for FB 5
DATA_BLOCK DB 111
FB 5
BEGIN
END_DATA_BLOCK
//Unassigned user DB, as instance for FB 3
DATA_BLOCK DB 112
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 this variable.
Function FC "VariablenCall" : VOID
974
//Assignment to symbol table
//Name is defined by user
Function Manual, 09/2011, 6FC5397-0BP40-2BA0
Basic Functions