P3: Basic PLC Program for SINUMERIK 840D sl
13.8 Structure and functions of the basic program
Basic Functions
892
Function Manual, 09/2011, 6FC5397-0BP40-2BA0
During PLC power-up, DB20 was generated with a length of 28 bytes:
The structure of the machine data used is specified in a UDT:
MD14514 $MN_USER_DATA_FLOAT[0]
123.456
GP Parameter (OB 100):
CALL FB 1, DB 7 (
MCPNum :=
1,
MCP1In :=
P#E0.0,
MCP1Out :=
P#A0.0,
MCP1StatSend :=
P#A8.0,
MCP1StatRec :=
P#A12.0,
MCP1BusAdr :=
6,
MCP1Timeout :=
S5T#700MS,
MCP1Cycl :=
S5T#200MS,
NCCyclTimeout :=
S5T#200MS,
NCRunupTimeout :=
S5T#50S;
BP parameters (to scan runtime):
l gp_par.UDInt;
//=4,
l gp_par.UDHex;
//=2,
l gp_par.UDReal;
//=1 )
DB 20
address
data
0.0
123
2.0
456
4.0
789
6.0
1011
8.0
b#16#12
9.0
b#16#AC
10.0
1.02
TYPE UDT 20
STRUCT
UDInt :
ARRAY [0 .. 3 ] OF INT ;
UDHex0 :
ARRAY [0 .. 15 ] OF BOOL ;
UDReal :
ARRAY [0 .. 0 ] OF REAL ;
//Description as field, for
// later expansions
END_STRUCT;
END_TYPE