beautypg.com

Register communication – BECKHOFF KL3041 User Manual

Page 18

background image

Register Description

16

KL304x and KL305x


Register communication

Register access via
process data exchange
Bit 7=1

bin

: Register mode

If bit 7 of the control byte is set, then the first two bytes of the user data are
not used for exchanging process data, but are written into or read from the
terminal's register set.

Bit 6=0

bin

: read

Bit 6=1

bin

: write

Bit 6 of the control byte specifies 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 then be taken from 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 0 to 5: Address

The address of the register that is to be addressed is entered into bits 0 to
5 of the control byte.

Control byte in
register mode


MSB

REG=1

W/R

A5

A4

A3

A2

A1

A0


REG = 0

bin

: Process data exchange

REG = 1

bin

: Access to register structure

W/R = 0

bin

: Read register

W/R = 1

bin

: Write register

A5 to A0 = Register address
Address bits A5 to A0 can be used to address a total of 64 registers.

0

63

Terminal´s

register set

64 words

Control-/

status byte

User data

K-Bus

If control bit 7=0: input/output

If control bit 7=1:

register-

configuration

C/S-bit 7

If control bit 7=1:

adress in the control bit 0-5

If control bit 6=0: read

If control bit 6=1: write

Complex bus terminal

To the bus coupler

H

H

L

L

2 or mors bytes


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).

This manual is related to the following products: