Siemens SINUMERIK 840D sl Function Manual page 866

Hide thumbs Also See for SINUMERIK 840D sl:
Table of Contents

Advertisement

P3: Basic PLC program for SINUMERIK 840D sl
13.10 Structure and functions of the basic program
BP parameters (to scan runtime):
During PLC power-up, DB20 was generated with a length of 28 bytes:
DB20
Address
0.0
2.0
4.0
6.0
8.0
9.0
10.0
The structure of the machine data used is specified in a UDT:
TYPE UDT20
STRUCT
END_STRUCT;
END_TYPE
Note
ARRAY OF BOOL are always sent to even-numbered addresses. For this reason, an array
range of 0 to 15 must generally be selected in the UDT definition or all Boolean variables
specified individually.
Although only a REAL value is used initially in the example, a field (with one element) has
been created for the variable. This ensures that extensions can be made easily in the future
without the symbolic address being modified.
Symbolic accesses
An entry is made in the symbol table to allow data access in symbolic form:
Symbol
UData
866
l gp_par.UDInt;
l gp_par.UDHex;
l gp_par.UDReal;
Data
123
456
789
1011
b#16#12
b#16#AC
1.234560e+02
UDInt :
ARRAY [0 .. 3] OF INT;
UDHex0 :
ARRAY [0 .. 15]OF BOOL;
UDReal :
ARRAY [0 .. 0] OF REAL;
Operand
DB20
//=4,
//=2,
//=1 )
//Description as field, for
// later expansions
Data type
UDT20
Function Manual, 01/2015, 6FC5397-0BP40-5BA2
Basic Functions

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Sinumerik 828dSinumerik 840de sl

Table of Contents