Access from the user program
KL1xxx
45
Version: 1.0.0
5
Access from the user program
5.1
Examples of Register Communication
The numbering of the bytes in the examples corresponds to the display without word alignment.
5.1.1
Example 1: reading the firmware version from Register 9
Output Data
Byte 0: Control byte
Byte 1: DataOUT1, high byte
Byte 2: DataOUT1, low byte
0x89 (1000 1001
bin
)
0xXX
0xXX
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
bin
.
• 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
Byte 1: DataIN1, high byte
Byte 2: DataIN1, low byte
0x89
0x33
0x41
Explanation:
• The terminal returns the value of the control byte as a receipt in the status byte.
• The terminal returns the firmware version 0x3341 in the input data word (byte 1 and byte 2). This is to
be interpreted as an ASCII code:
◦ ASCII code 0x33 represents the digit 3
◦ ASCII code 0x41 represents the letter A
The firmware version is thus 3A.
5.1.2
Example 2: Writing to an user register
Code word
In normal mode all user registers are read-only with the exception of Register 31. In order to deacti-
vate this write protection you must write the code word (0x1235) into Register 31. If a value other
than 0x1235 is written into Register 31, write protection is reactivated. Please note that changes to
a register only become effective after restarting the terminal (power-off/power-on).
I. Write the code word (0x1235) into Register 31.
Output Data
Byte 0: Control byte
Byte 1: DataOUT1, high byte
Byte 2: DataOUT1, low byte
0xDF (1101 1111
bin
)
0x12
0x35
Explanation:
• Bit 0.7 set means: Register communication switched on.
• Bit 0.6 set means: writing to the register.
Содержание KL1 Series
Страница 1: ...Documentation KL1xxx Digital input terminals 24 V DC 1 0 0 2020 05 08 Version Date...
Страница 2: ......
Страница 9: ...Product overview KL1xxx 9 Version 1 0 0 2 2 KL1002 KL1012 Introduction Fig 1 KL1002 Fig 2 KL1012...
Страница 13: ...Product overview KL1xxx 13 Version 1 0 0 2 3 KL1104 KL1114 Introduction Fig 5 KL1104 Fig 6 KL1114...
Страница 16: ...Product overview KL1xxx 16 Version 1 0 0 2 4 KL1402 KL1412 Introduction Fig 8 KL1402 Fig 9 KL1412...
Страница 19: ...Product overview KL1xxx 19 Version 1 0 0 2 5 KL1404 KL1414 KL1434 Introduction Fig 11 KL1404 Fig 12 KL1414...
Страница 25: ...Product overview KL1xxx 25 Version 1 0 0 Fig 18 KL1488 Fig 19 KL1498...
Страница 29: ...Product overview KL1xxx 29 Version 1 0 0 2 7 KL1862 KL1862 0010 KL1872 Introduction Fig 22 KL1862 Fig 23 KL1872...