P3: Basic PLC Program for SINUMERIK 840D sl
13.13 Block descriptions
Basic Functions
Function Manual, 09/2011, 6FC5397-0BP40-2BA0
1001
Call example
As far as the time is concerned, the basic program must be executed before other interrupt-driven user
programs. It is, therefore, called first in OB 40.
The following example contains the standard declarations for OB 40 and the call for the basic program.
13.13.13 FC 5: GP_DIAG Basic program, diagnostic alarm, and module failure
Function
Module defects and module failures are detected in this section of the basic program.
The FC5 block parameter can be used to define whether the PLC is to be placed in Stop mode. The PLC is
placed in STOP mode only for incoming events. Exceptions of the parameter "PLC-Stop" are the Profibus-MCPs
parameterized at FB 1 (must be connected to the DP1 Bus).
ORGANIZATION_BLOCK OB 40
VAR_TEMP
OB40_EV_CLASS :
BYTE ;
OB40_STRT_INF :
BYTE ;
OB40_PRIORITY :
BYTE ;
OB40_OB_NUMBR :
BYTE ;
OB40_RESERVED_1 :
BYTE ;
OB40_MDL_ID :
BYTE ;
OB40_MDL_ADDR :
INT;
OB40_POINT_ADDR :
DWORD;
OB40_DATE_TIME :
DATE_AND_TIME;
//Assigned to basic program
GP_IRFromNCK : BOOL ;
//Interrupt by NCK for user
GP_TM : BOOL ;
//Tool management
GP_InPosition : ARRAY [1..3] OF BOOL;
//Axis-oriented for positioning,
//Indexing axes, spindles
GP_AuxFunction : ARRAY [1..10] OF BOOL;
//Channel-oriented for auxiliary functions
GP_FMBlock : ARRAY [1..10] OF BOOL;
//Currently not used
//Further local user data may be defined from this point onwards
END_VAR
BEGIN
CALL FC 3;
//INSERT USER PROGRAM HERE
END_ORGANIZATION_BLOCK