Process data exchange

Process data

The KL5121 terminal occupies 6 bytes in the coupler’s input process image and 6 bytes in the output process image. There are two logical channels: data channel 0 and data channel 1.

Data channel 0

Data channel 0 consists of control byte 0, input data word 0, status byte 0 and output data word 0.
Enables for the output functions are communicated through channel 0, and status information is read in. Parameter data can also be accessed.

Controller output data

CT-0: Control byte 0
D0-0, D1-0: the terminal’s input data word 0

Controller input data

ST-0: Status byte 0
D0-0, D1-0: the terminal’s output data word 0

Control byte 0

Control byte 0 is only used for register access

MSB

REG = 0

 

 

 

 

 

 

 

Status byte 0

The state of the inputs can be read through status byte 0.

REG = 0

ERROR_BIT (reserved)

 

 

 

A_INPUT

B_INPUT

LATCH_INPUT

Output data word 0

The current counter value is read in output data word 0 of the terminal. The terminal supplies the output data word 0.

Bit no.

Meaning

Bit 0 - 15

Current encoder counter state

Input data word 0

Input data word 0 of the terminal is used for channel-specific enables. A nibble of the data word is reserved for each channel.

Channel 1

Nibble

Meaning

0000

No enable is present. If the automatic switching function was previously active, it is reset, so that if a workpiece has already been picked up it will not be processed further when the automatic function becomes active again.

0001

Enable for the automatic switching function

0111

Enable for the "glue nozzle test". If the automatic switching function was previously active it is interrupted, and is continued again when there is a change of operation mode, provided that the enable is not reset (e.g. from 0001 to 0111 to 0001)

0011

Output to high level. Interruption of the switching function if it was previously active.

0101

Output to low level. Interruption of the switching function if it was previously active.

The other nibbles for channels 2 - 4 are occupied similarly.

Data channel 1

Data channel 1 transfers the switch values to the terminal. They are temporarily stored in the terminal’s RAM. Access to this data set is identical to access to the terminal’s register set.

Controller output data

CT-1: Control byte 1
D0-1, D1-1: input data word 1 of the terminal

Controller input data

ST-1: Status byte 1
D0-1, D1-1: output data word 1 of the terminal

Control byte 1

Control byte 1 is transmitted from the controller to the terminal, and is used for access to the output table.

Bit no.

 

Meaning

Bit 0 - 5

000000-111111

Address bits A0 to A5 of the output table

Bit 6

0/1

0: Read
1: Write

Bit 7

0/1

Table bit
This bit must be set for table accesses. If the controller sees a falling edge in the terminal here, evaluation of the output table is started, so that, if sorting or other tasks are necessary, they will be performed.

Status byte 1

Status byte 1 is transmitted from the terminal to the controller.

Bit no.:

 

Meaning

Bit 0 - 5

000000-111111

Address bits A0 to A5 of the output table

Bit 6

0/1

don´t care

Bit 7

1

Acknowledge for table access

Output data word 1

Output data word AW1 returns the addressed table entry when a table is accessed.

Bit no.

Meaning

Bit 0 - 15

Content of the addressed table entry

Input data word 1

Input data word EW1 is entered into the table during a write access by the controller.

Bit no.

Meaning

Bit 0 - 15

Entry in the output table

Output table

The appropriate values for the corresponding function must be entered into the output table (max. 60 switching values).

Index

Entry

0

Number N of entries for the first output

1

Number M of entries for the second output

2

Number O of entries for the third output

3

Number P of entries for the fourth output

4

Switch value 1 channel 1

 

N+4

Switch value N channel 1

N+5

Switch value 1 channel 2

...

 

N+M+4

Switch value M channel 2

N+M+5

Switch value 1 channel 3

 

N+M+O+4

Switch value O channel 3

N+M+O+5

Switch value 1 channel 4

 

 

N+M+O+P+4

Switch value P channel 4