Register communication

Register access via process data exchange

  • Bit 7=1bin: Register mode
    If bit 7 of the control byte is set, the first two bytes of the user data are not used for process data exchange but written into the register set of the terminal or read from it.
  • Bit 6=0bin: read, bit 6=1bin: write
    Bit 6 of the control bytes is used to specify whether a register should be read or written. If bit 6 is not set, then a register is read out without modifying it. The value can be found in the input process image.
    If bit 6 is set, then the user data is written into a register. As soon as the status byte has supplied an acknowledgement in the input process image, the procedure is completed (see example).
    • Bit 6=0: A register is read without changing it. The value can be found in the input process image.
    • Bit 6=1: The user data are written into a register. The process is complete once the status byte in the input process image has returned an acknowledgment (see example).
  • Bit 0 to 5: Address
    The address of the register to be addressed is entered in bits 0 to 5 of the control byte

Control byte in register mode (REG=1)

MSB

REG=1

W/R

A5

A4

A3

A2

A1

A0

 

REG = 0bin: Process data exchange
REG = 1bin: Access to register structure

W/R = 0bin: Read register
W/R = 1bin: Write register

A5..A0 = register address
Addresses A5...A0 can be used to address a total of 64 registers.

Register communication 1:
ControByte_RegisterMode

 

The control or status byte occupies the lowest address of a logical channel. The corresponding register values are located in the following 2 data bytes. (The BK2000 is an exception: here, an unused data byte is inserted after the control or status byte, and the register value is therefore placed on a word boundary).

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

Byte 2

Byte 1

Byte 0

Name

DataOUT 1

DataOUT 0

Not used

Control byte

Value

0xXX

0xXX

0xXX

0x88

The terminal returns the following type identifier (0x0CF82 corresponds to unsigned integer 3202)

Byte

Byte 3

Byte 2

Byte 1

Byte 0

Name

DataIN 1

DataIN 0

Not used

Status byte

Value

0x0C

0x82

0x00

0x88

 

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

Byte 2

Byte 1

Byte 0

Name

DataOUT 1

DataOUT 0

Not used

Control byte

Value

0x12

0x35

0xXX

0xDF

The code word is set, and the terminal returns the register address with bit 7 for register access as acknowledgment.

Byte

Byte 3

Byte 2

Byte 1

Byte 0

Name

DataIN 1

DataIN 0

Not used

Status byte

Value

0x00

0x00

0x00

0x9F