P3: Basic PLC Program for SINUMERIK 840D sl
13.13 Block descriptions
Basic Functions
Function Manual, 09/2011, 6FC5397-0BP40-2BA0
995
Declaration of the function
Structure for ring buffer
FUNCTION_BLOCK FB 29
VAR_INPUT
Func
: INT ;
//Function number: 0 = No function,
//1 = Signal recorder, 2 = Data trigger
Signal_1
: BOOL ;
//Start of brake test
Signal_2
: BOOL ;
Signal_3
: BOOL ;
Signal_4
: BOOL ;
Signal_5
: BOOL ;
Signal_6
: BOOL ;
Signal_7
: BOOL ;
Signal_8
: BOOL ;
NewCycle
: BOOL ;
Var1
: BYTE ;
Var2
: INT;
Var3
: INT;
BufDB
: INT;
ClearBuf
: BOOL ;
DataAdr
: POINTER;
//Area pointer to testing word
TestVal
: WORD ;
//Value for triggering
AndMask
: WORD ;
//AND mask to the testing word
END_VAR
VAR_OUTPUT
TestIsTrue
: BOOL ;
END_VAR
VAR_IN_OUT
BufAddr
: INT;
END_VAR
TITLE =
//Ring buffer DB for FB 29
VERSION : 1.0
STRUCT
Field: ARRAY [0 .. 249 ] OF STRUCT
//can be any size of this struct
Cycle : INT ;
//Delta cycle to last storage in buffer
Signal_1 : BOOL ;
//Signal names same as FB 29
Signal_2 : BOOL ;
Signal_3 : BOOL ;
Signal_4 : BOOL ;