Examples Of Register Communication; Example 1: Reading The Firmware Version From Register 9 - Beckhoff KL3224 Documentation

Table of Contents

Advertisement

Sample 1:
Reading of register 8 in the BK2000 with a KL3202 and the end terminal:
If the following bytes are transferred from the controller to the terminal,
Byte
Byte 3
Name
DataOUT 1
Value
0xXX
The terminal returns the following type identifier (0x0CF82 corresponds to unsigned integer 3202)
Byte
Byte 3
Name
DataIN 1
Value
0x0C
Sample 2:
Writing of register 31 in the BK2000 with an intelligent terminal and the end terminal:
If the following bytes (code word) are transferred from the controller to the terminal,
Byte
Byte 3
Name
DataOUT 1
Value
0x12
The code word is set, and the terminal returns the register address with bit 7 for register access as
acknowledgment.
Byte
Byte 3
Name
DataIN 1
Value
0x00
5.7

Examples of Register Communication

The numbering of the bytes in the examples corresponds to the display without word alignment.
5.7.1

Example 1: reading the firmware version from Register 9

Output Data
Byte 0: Control byte
0x89 (1000 1001
)
bin
Explanation:
• Bit 0.7 set means: Register communication switched on.
• Bit 0.6 not set means: reading the register.
• Bits 0.5 to 0.0 specify the register number 9 with 00 1001
• The output data word (byte 1 and byte 2) has no meaning during read access. To change a register,
write the required value into the output word.
Input Data (answer of the Bus Terminal)
Byte 0: Status byte
0x89
Explanation:
KL3224
Byte 2
DataOUT 0
0xXX
Byte 2
DataIN 0
0x82
Byte 2
DataOUT 0
0x35
Byte 2
DataIN 0
0x00
Byte 1: DataOUT1, high byte
0xXX
Byte 1: DataIN1, high byte
0x33
Version: 2.0.0
Access from the user program
Byte 1
Not used
0xXX
Byte 1
Not used
0x00
Byte 1
Not used
0xXX
Byte 1
Not used
0x00
Byte 2: DataOUT1, low byte
0xXX
.
bin
Byte 2: DataIN1, low byte
0x41
Byte 0
Control byte
0x88
Byte 0
Status byte
0x88
Byte 0
Control byte
0xDF
Byte 0
Status byte
0x9F
35

Advertisement

Table of Contents
loading

Table of Contents