Plc programming – Lenze ETC Motion Control User Manual
Page 394

PLC programming
Library
Memory access functions
8.8
8.8.4
l
394
EDSTCXN EN 2.0
At the beginning of DB2 in range 1 of %MW2.0 to %MW2.16 there are 10
BYTE, 2 WORD, 3 DINT and 1 LREAL. In range 2 of %MW2.128 to %MW2.158
there are 5 WORD, 8 DWORD and 5 WORD in the order stated. The definition
is given as follows:
DEFDATATYPES(1,’10b2w3d1l’)
DEFDATATYPES(2,’5w8d10w’)
If a message interface in DB2 is used between PLC and HMI and the messages
use different data types than WORD, additional adaptations are required.
For this purpose the ETC has two type−related functions:
GET_BYTE
PUT_BYTE
GET_WORD
PUT_WORD
GET_INT
PUT_INT
GET_DWORD
PUT_DWORD
GET_DINT
PUT_DINT
GET_REAL
PUT_REAL
GET_LREAL
PUT_LREAL
The functions GET_... read the corresponding data type from the address
stated and carry out the necessary byte swapping for the HMI. The functions
PUT_... write the corresponding data type swapped to the address stated.
Condition for the data to arrive correctly at the HMI when using the above
functions is the definition of the user data of the messsage as byte via
DEFDATATYPES. For the standard HMI this looks as follows:
DEFDATATYPES(1,’96w4w52b2w’); (* 96 WORD, 4 WORD, 52 BYTE, 2 WORD *)
DEFDATATYPES(2,’32w4w52b2w’); (* 32 WORD, 4 WORD, 52 BYTE, 2 WORD *)
The definition results from the definition of the data in DB2 which are
transferred between ETC−MMI and the PLC:
Data word
Name
Direction
000.00 – 015.15
016.00 – 079.15
080.00 – 095.15
096.00 – 096.15
097.00 – 097.15
098.00 – 125.15
126.00 – 126.15
127.00 – 127.15
128.00 – 143.15
144.00 – 159.15
160.00 – 160.15
161.00 – 161.15
162.00 – 189.15
190.00 – 190.15
191.00 – 191.15
States (256 Bits)
Displays (64 data word)
Notices/static errors (256 Bits)
Message buffer: acknowledgment counter
Message buffer: counter 1
Message buffer: User data (28 data words)
Message buffer: counter 2
PLC monitoring running
States (256 Bits)
Keys (256 Bits)
Message buffer: receipt counter
Message buffer: counter 1
Message buffer: User data (28 data word)
Message buffer: counter 2
ETC−MMI monitoring running
PLC
→
HMI
PLC
→
HMI
PLC
→
HMI
PLC
→
HMI
PLC
→
HMI
PLC
→
HMI
PLC
→
HMI
PLC
→
HMI
PLC
←
HMI
PLC
←
HMI
PLC
←
HMI
PLC
←
HMI
PLC
←
HMI
PLC
←
HMI
PLC
←
HMI
Example