KL5151, KL5152 - Incremental Encoder Interface
Home


Foreword

Foreword
Foreword
Additional information
•
Notes on the documentation
•
Safety instructions
•
Documentation issue status


Notes on the documentation

Foreword [image] Notes on the documentation
Notes on the documentation
Intended audience
This description is only intended for the use of trained specialists in control and automation engineering who are familiar with the applicable national standards.
It is essential that the documentation and the following notes and explanations are followed when installing and commissioning these components.
It is the duty of the technical personnel to use the documentation published at the respective time of each installation and commissioning.
The responsible staff must ensure that the application or use of the products described satisfy all the requirements for safety, including all the relevant laws, regulations, guidelines and standards.
Disclaimer
The documentation has been prepared with care. The products described are, however, constantly under development.
We reserve the right to revise and change the documentation at any time and without prior announcement.
No claims for the modification of products that have already been supplied may be made on the basis of the data, diagrams and descriptions in this documentation.
Trademarks
Beckhoff®, TwinCAT®, EtherCAT®, Safety over EtherCAT®, TwinSAFE®, XFC® and XTS® are registered trademarks of and licensed by Beckhoff Automation GmbH.
Other designations used in this publication may be trademarks whose use by third parties for their own purposes could violate the rights of the owners.
Patent Pending
The EtherCAT Technology is covered, including but not limited to the following patent applications and patents: EP1590927, EP1789857, DE102004044764, DE102007017835 with corresponding applications or registrations in various other countries.
The TwinCAT Technology is covered, including but not limited to the following patent applications and patents: EP0851348, US6167425 with corresponding applications or registrations in various other countries.
EtherCAT® is registered trademark and patented technology, licensed by Beckhoff Automation GmbH, Germany
Copyright
© Beckhoff Automation GmbH & Co. KG, Germany.
The reproduction, distribution and utilization of this document as well as the communication of its contents to others without express authorization are prohibited.
Offenders will be held liable for the payment of damages. All rights reserved in the event of the grant of a patent, utility model or design.


Safety instructions

Foreword [image] Safety instructions
Safety instructions
Safety regulations
Please note the following safety instructions and explanations!
Product-specific safety instructions can be found on following pages or in the areas mounting, wiring, commissioning etc.
Exclusion of liability
All the components are supplied in particular hardware and software configurations appropriate for the application. Modifications to hardware or software configurations other than those described in the documentation are not permitted, and nullify the liability of Beckhoff Automation GmbH & Co. KG.
Personnel qualification
This description is only intended for trained specialists in control, automation and drive engineering who are familiar with the applicable national standards.
Description of symbols
In this documentation the following symbols are used with an accompanying safety instruction or note. The safety instructions must be read carefully and followed without fail!
DANGER
Serious risk of injury!
Failure to follow the safety instructions associated with this symbol directly endangers the life and health of persons.
WARNING
Risk of injury!
Failure to follow the safety instructions associated with this symbol endangers the life and health of persons.
CAUTION
Personal injuries!
Failure to follow the safety instructions associated with this symbol can lead to injuries to persons.
Attention
Damage to the environment or devices
Failure to follow the instructions associated with this symbol can lead to damage to the environment or equipment.
Note
Tip or pointer
This symbol indicates information that contributes to better understanding.


Documentation issue status

Foreword [image] Documentation issue status
Documentation issue status
Version
Comment
2.2.0
▪
Notes about operation of KL5151-000 (KL5151-0050) as one channel up/down counter extended
2.1.0
▪
Technical data updated
▪
Product overview updated
▪
KS2000 settings updated
▪
Wiring and contact assignment extended
2.0.0
▪
Migration
▪
Update revision status
1.3.0
▪
Technical data updated
▪
ATEX notes added
▪
Extended temperature range for KL5151-0000
▪
Description of control and status bytes of the KL5151-0021 corrected
1.2.0
▪
Introduction updated
▪
Description of the parameterization of the KL5151 by means of KS2000 configuration software updated.
▪
Register description updated
▪
Mounting description expanded
▪
KL5151-0021 added
▪
KL5151-0050 renamed and now available as KL5152-0000
1.1.0
▪
Description of the process images expanded
▪
Mapping tables added
1.0
▪
KL5151-0050 added
▪
Description of the parameterization of the KL5151 by means of KS2000 configuration software added.
0.1
Preliminary version (KL5151-0000 only)
Firmware and hardware versions
Documentation Version | KL5151-0000 |  | KL5151-0021 |  | KL5152-0000 (KL5151-0050)
 | Firmware | Hardware | Firmware | Hardware | Firmware | Hardware
2.2.0 | 4E | 09 | 14 | 09 | 4E | 09
2.1.0 | 4E | 09 | 14 | 09 | 4E | 09
2.0.0 | 4E | 09 | 14 | 09 | 4E | 09
1.3.0 | 4C | 07 | 13 | 07 | 4C | 07
1.2.0 | 4C | 07 | 13 | 07 | 4C | 07
1.1.0 | 3A | 02 | - | - | 3A | 02
1.0 | 3A | 02 |  |  | 3A | 02
0.1 | 3A | 00 |  |  | - | -
The firmware and hardware versions (delivery state) can be taken from the serial number printed on the side of the terminal.
Syntax of the serial number
Structure of the serial number: WW YY FF HH
WW - week of production (calendar week)
YY - year of production
FF - firmware version
HH - hardware version
Example with ser. no.: 35 04 3A 02:
35 - week of production 35
04 - year of production 2004
3A - firmware version 3A
02 - hardware version 02


Product overview

Product overview
Product overview
Additional information
•
KL5151-0000 - Introduction
•
KL5151-0021 - Introduction
•
KL5152-0000 (KL5151-0050) - Introduction
•
Technical data


KL5151-0000 - Introduction

Product overview [image] KL5151-0000 - Introduction
KL5151-0000 - Introduction
KL5151-0000
The KL5151-0000 Bus Terminal is an interface with 24 V inputs for the direct connection of incremental encoders. A 32 bit counter with a quadrature decoder and a 32 bit latch for the zero pulse can be read, set or enabled.
The KL5151-0000 Bus Terminal can also be used as an up/down counter (32 bit). For this input A works as counter input. Input B sets the counting direction. Input C has to be HIGH to enable the counter functionality
LED indicators
LED | Function
Ch. A | Lights up when a signal is present at input A.
Ch. B | Lights up when a signal is present at input B.
Ch. C | Lights up when a signal is present at input C (zero input).
Gate / Latch | Lights up when a signal is present at the gate/latch input.


KL5151-0021 - Introduction

Product overview [image] KL5151-0021 - Introduction
KL5151-0021 - Introduction
KL5151-0021
The KL5151-0021 Bus Terminal is an interface with 24 V inputs for the direct connection of incremental encoders. A 32 bit counter with a quadrature decoder and a 32 bit latch for the zero pulse can be read, set or enabled.
The KL5151-0021 Bus Terminal has an additional comparator output.
LED indicators
LED | Function
Ch. A | Lights up when a signal is present at input A.
Output | Lights up when the comparator output is switched on.
Ch. B | Lights up when a signal is present at input B.
Ch. C | Lights up when a signal is present at input C (zero input).
Gate / Latch | Lights up when a signal is present at the gate/latch input.
Operation
Referencing
Enter the reference value for referencing via the output double word DataOUT1 and set bits CB1.0 (EnLatchC) and CB1.2 (SetCnt) in the control byte. The reference value is now adopted by the counter on a rising edge at input C.
Measuring the workpiece
At the beginning of the measurement the filter value is preset in the filter register R0.
Then set the release bit CB1.1 (EnMeas) in the control byte. If a plate has been successfully measured, the terminal sets bit SB1.1 (MeasDone) in the status byte.
The measurement begins on an appropriate edge. If the level already exists, only the position of the end of the board is determined. The start of the measurement is then taken as the start of the board.
Post-forming sawing
The output has a rise time of 10 µs and a 40 µs delay due to the optocoupler.


KL5152-0000 (KL5151-0050) - Introduction

Product overview [image] KL5152-0000 (KL5151-0050) - Introduction
KL5152-0000 (KL5151-0050) - Introduction
KL5152-0000 (KL5151-0050)
The KL5152-0000 (KL5151-0050) Bus Terminal is an interface with 24 V inputs for the direct connection of two incremental encoders. The terminal can optionally be used as a single-channel or two-channel device.
Note
Operation as a one channel up/down counter
The KL5152-0000 (KL5151-0050) Bus Terminal can also be used as a one channel up/down counter (32 bit). For this input A1 works as counter input. Input B1 sets the counting direction. Input A2 has to be HIGH to enable the counter functionality.
Operation as a two channel counter is not possible!
LED indicators
Signal LED | Function | Encoder
Ch. A1 | Lights up when a signal is present at input A1. | 1
Ch. B1 | Lights up when a signal is present at input B1.
Ch. A2 | Lights up when a signal is present at input A2. | 2
Ch. B2 | Lights up when a signal is present at input B2.


Technical data

Product overview [image] Technical data
Technical data
Technical data | KL5151-0000 | KL5151-0021 | KL5152-0000 (KL5151-0050)
Sensor inputs (channels) | 1 |  | 2 (as encoder interface) 1 (as counter)
Encoder connection | A, B, C, Gate, 24 V |  | Channel 1: A1, B1 Channel 2: A2, B2
Encoder operating voltage | 24 VDC
Operation as encoder interface | 1 x 32 bit binary |  | 2 x 32 bit binary
Operation as counter | 1 x 32 bit binary | - | 1 x 32 bit binary
Limit frequency | 100 kHz
Quadrature decoder | 4-fold evaluation
Commands | read, set, latching, Compare function for setting the output (KL5151-0021 only)
Supply voltage | 24 VDC (-15%/+20%)
Comparator output | 0 | 1 | 0
Current consumption from the power contacts | Typically 100 mA (without sensor load current)
Bit width in the K-bus I/O | 4 x 16 bit user data, 1 x 8 bit control/status
Bit width in the input process image | 2 data words, 1 status byte |  | compact | complete
 |  |  | 4 data words | 4 data words, 2 status bytes
Bit width in the output process image | 2 data words, 1 control byte |  | 2 data words, 2 control bytes, 2 filler bytes | 4 data words, 2 control bytes
Power supply for electronic | via the K-bus
Current consumption from K-bus | typically 50 mA
Weight | approx. 50 g
Dimensions (W x H x D) | approx. 15 mm x 100 mm x 70 mm
Mounting | on 35 mm mounting rail conforms to EN 60715
Pluggable wiring | at all KSxxxx series terminals
Permissible ambient temperature range during operation | -25°C ... +60°C | 0°C ... + 55°C
Permissible ambient temperature range during storage | -40°C ... + 85°C | -25°C ... + 85°C
Permissible relative humidity | 95%, no condensation
Vibration/shock resistance | conforms to EN 60068-2-6 / EN 60068-2-27
EMC immunity/emission | conforms to EN 61000-6-2 / EN 61000-6-4
Protection class | IP20
Installation position | variable
Approval | CE, cULus, ATEX | CE, cULus, ATEX


Mounting and wiring

Mounting and wiring
Mounting and wiring
Additional information
•
Installation on mounting rails
•
Connection
•
ATEX - Special conditions (standard temperature range)
•
ATEX - Special conditions (extended temperature range)
•
ATEX Documentation


Installation on mounting rails

Mounting and wiring [image] Installation on mounting rails
Installation on mounting rails
WARNING
Risk of electric shock and damage of device!
Bring the bus terminal system into a safe, powered down state before starting installation, disassembly or wiring of the Bus Terminals!
Assembly
Attaching on mounting rail
The Bus Coupler and Bus Terminals are attached to commercially available 35 mm mounting rails (DIN rails according to EN 60715) by applying slight pressure:
1.
First attach the Fieldbus Coupler to the mounting rail.
2.
The Bus Terminals are now attached on the right-hand side of the Fieldbus Coupler. Join the components with tongue and groove and push the terminals against the mounting rail, until the lock clicks onto the mounting rail.
If the Terminals are clipped onto the mounting rail first and then pushed together without tongue and groove, the connection will not be operational! When correctly assembled, no significant gap should be visible between the housings.
Note
Fixing of mounting rails
The locking mechanism of the terminals and couplers extends to the profile of the mounting rail. At the installation, the locking mechanism of the components must not come into conflict with the fixing bolts of the mounting rail. To mount the mounting rails with a height of 7.5 mm under the terminals and couplers, you should use flat mounting connections (e.g. countersunk screws or blind rivets).
Disassembly
Disassembling of terminal
Each terminal is secured by a lock on the mounting rail, which must be released for disassembly:
1.
Pull the terminal by its orange-colored lugs approximately 1 cm away from the mounting rail. In doing so for this terminal the mounting rail lock is released automatically and you can pull the terminal out of the bus terminal block easily without excessive force.
2.
Grasp the released terminal with thumb and index finger simultaneous at the upper and lower grooved housing surfaces and pull the terminal out of the bus terminal block.
Connections within a bus terminal block
The electric connections between the Bus Coupler and the Bus Terminals are automatically realized by joining the components:
▪
The six spring contacts of the K-Bus/E-Bus deal with the transfer of the data and the supply of the Bus Terminal electronics.
▪
The power contacts deal with the supply for the field electronics and thus represent a supply rail within the bus terminal block. The power contacts are supplied via terminals on the Bus Coupler (up to 24 V) or for higher voltages via power feed terminals.
Note
Power Contacts
During the design of a bus terminal block, the pin assignment of the individual Bus Terminals must be taken account of, since some types (e.g. analog Bus Terminals or digital 4-channel Bus Terminals) do not or not fully loop through the power contacts. Power Feed Terminals (KL91xx, KL92xx or EL91xx, EL92xx) interrupt the power contacts and thus represent the start of a new supply rail.
PE power contact
The power contact labeled PE can be used as a protective earth. For safety reasons this contact mates first when plugging together, and can ground short-circuit currents of up to 125 A.
Power contact on left side
Attention
Possible damage of the device
Note that, for reasons of electromagnetic compatibility, the PE contacts are capacitatively coupled to the mounting rail. This may lead to incorrect results during insulation testing or to damage on the terminal (e.g. disruptive discharge to the PE line during insulation testing of a consumer with a nominal voltage of 230 V). For insulation testing, disconnect the PE supply line at the Bus Coupler or the Power Feed Terminal! In order to decouple further feed points for testing, these Power Feed Terminals can be released and pulled at least 10 mm from the group of terminals.
WARNING
Risk of electric shock!
The PE power contact must not be used for other potentials!


Connection

Mounting and wiring [image] Connection
Connection
Additional information
•
Connection system
•
Wiring
•
Shielding
•
KL5151-0000 - Contact assignment
•
KL5151-0021 - Contact assignment
•
KL5152-0000 (KL5151-0050) - Contact assignment


Connection system

Mounting and wiring [image] Connection [image] Connection system
Connection system
WARNING
Risk of electric shock and damage of device!
Bring the bus terminal system into a safe, powered down state before starting installation, disassembly or wiring of the Bus Terminals!
Overview
The Bus Terminal system offers different connection options for optimum adaptation to the respective application:
▪
The terminals of ELxxxx and KLxxxx series with standard wiring include electronics and connection level in a single enclosure.
▪
The terminals of ESxxxx and KSxxxx series feature a pluggable connection level and enable steady wiring while replacing.
▪
The High Density Terminals (HD Terminals) include electronics and connection level in a single enclosure and have advanced packaging density.
Standard wiring (ELxxxx / KLxxxx)
Standard wiring
The terminals of ELxxxx and KLxxxx series have been tried and tested for years.
They feature integrated screwless spring force technology for fast and simple assembly.
Pluggable wiring (ESxxxx / KSxxxx)
Pluggable wiring
The terminals of ESxxxx and KSxxxx series feature a pluggable connection level.
The assembly and wiring procedure is the same as for the ELxxxx and KLxxxx series.
The pluggable connection level enables the complete wiring to be removed as a plug connector from the top of the housing for servicing.
The lower section can be removed from the terminal block by pulling the unlocking tab.
Insert the new component and plug in the connector with the wiring. This reduces the installation time and eliminates the risk of wires being mixed up.
The familiar dimensions of the terminal only had to be changed slightly. The new connector adds about 3 mm. The maximum height of the terminal remains unchanged.
A tab for strain relief of the cable simplifies assembly in many applications and prevents tangling of individual connection wires when the connector is removed.
Conductor cross sections between 0.08 mm2 and 2.5 mm2 can continue to be used with the proven spring force technology.
The overview and nomenclature of the product names for ESxxxx and KSxxxx series has been retained as known from ELxxxx and KLxxxx series.
High Density Terminals (HD Terminals)
High Density Terminals
The Bus Terminals from these series with 16 terminal points are distinguished by a particularly compact design, as the packaging density is twice as large as that of the standard 12 mm Bus Terminals. Massive conductors and conductors with a wire end sleeve can be inserted directly into the spring loaded terminal point without tools.
Note
Wiring HD Terminals
The High Density (HD) Terminals of the ELx8xx and KLx8xx series doesn't support pluggable wiring.
Ultrasonically "bonded" (ultrasonically welded) conductors
Note
Ultrasonically “bonded" conductors
It is also possible to connect the Standard and High Density Terminals with ultrasonically "bonded" (ultrasonically welded) conductors. In this case, please note the tables concerning the wire-size width below!


Wiring

Mounting and wiring [image] Connection [image] Wiring
Wiring
WARNING
Risk of electric shock and damage of device!
Bring the bus terminal system into a safe, powered down state before starting installation, disassembly or wiring of the Bus Terminals!
Terminals for standard wiring ELxxxx/KLxxxx and for pluggable wiring ESxxxx/KSxxxx
Connecting a cable on a terminal point
Up to eight terminal points enable the connection of solid or finely stranded cables to the Bus Terminal. The terminal points are implemented in spring force technology. Connect the cables as follows:
1.
Open a terminal point by pushing a screwdriver straight against the stop into the square opening above the terminal point. Do not turn the screwdriver or move it alternately (don't toggle).
2.
The wire can now be inserted into the round terminal opening without any force.
3.
The terminal point closes automatically when the pressure is released, holding the wire securely and permanently.
See the following table for the suitable wire size width.
Terminal housing | ELxxxx, KLxxxx | ESxxxx, KSxxxx
Wire size width (single core wires) | 0.08 ... 2.5 mm2 | 0.08 ... 2.5 mm2
Wire size width (fine-wire conductors) | 0.08 ... 2.5 mm2 | 0,08 ... 2.5 mm2
Wire size width (conductors with a wire end sleeve) | 0.14 ... 1.5 mm2 | 0.14 ... 1.5 mm2
Wire stripping length | 8 ... 9 mm | 9 ... 10 mm
High Density Terminals (HD Terminals) with 16 terminal points
The conductors of the HD Terminals are connected without tools for single-wire conductors using the direct plug-in technique, i.e. after stripping the wire is simply plugged into the terminal point. The cables are released, as usual, using the contact release with the aid of a screwdriver. See the following table for the suitable wire size width.
Terminal housing | High Density Housing
Wire size width (single core wires) | 0.08 ... 1.5 mm2
Wire size width (fine-wire conductors) | 0.25 ... 1.5 mm2
Wire size width (conductors with a wire end sleeve) | 0.14 ... 0.75 mm2
Wire size width (ultrasonically “bonded" conductors) | only 1.5 mm2
Wire stripping length | 8 ... 9 mm


Shielding

Mounting and wiring [image] Connection [image] Shielding
Shielding
Note
Shielding
Encoder, analog sensors and actors should always be connected with shielded, twisted paired wires.


KL5151-0000 - Contact assignment

Mounting and wiring [image] Connection [image] KL5151-0000 - Contact assignment
KL5151-0000 - Contact assignment
WARNING
Risk of injury through electric shock and damage to the device!
Bring the Bus Terminals system into a safe, de-energized state before starting mounting, disassembly or wiring of the Bus Terminals.
KL5151-0000
Contact assignment
Terminal point
No.
In the encoder interface operating mode*
connection for
In the counter operating mode*
connection for
A
1
Input A
Counter input
+24 V
2
Power contact +24 V (internally connected to terminal point 6)
0 V
3
Power contact 0 V (internally connected to terminal point 7)
C
4
Input C or
zero input (in case bit 0 (EnLatchC) is set in the control byte, a rising edge at this input causes the current counter value to be saved in the latch register as a reference mark).
Counter enable (gate input for the counter operating mode)
B
5
Input B
Counting direction:
high = down
low = up
+24 V
6
Power contact +24 V (internally connected to terminal point 2)
0 V
7
Power contact 0 V (internally connected to terminal point 3)
Gate/Latch
8
Gate input or
Latch input: if
▪
bit 3 (EnLatchRise) is set in the control byte, a rising edge
▪
bit 4 (EnLatchFall) is set in the control byte, a falling edge
at this input causes the current counter value to be saved in the latch register as a reference mark.
no function
*) The operating mode is set with bit R32.15 of the feature register.


KL5151-0021 - Contact assignment

Mounting and wiring [image] Connection [image] KL5151-0021 - Contact assignment
KL5151-0021 - Contact assignment
WARNING
Risk of injury through electric shock and damage to the device!
Bring the Bus Terminals system into a safe, de-energized state before starting mounting, disassembly or wiring of the Bus Terminals.
KL5151-0021
Contact assignment
Terminal point
No.
Connection for
A
1
Input A
Output
2
Comparator output
0 V
3
Power contact 0 V (internally connected to terminal point 7)
C
4
Input C or
zero input (in case bit 0 (EnLatchC) is set in the control byte, a rising edge at this input causes the current counter value to be saved in the latch register as a reference mark).
B
5
Input B
+24 V
6
Power contact +24 V
0 V
7
Power contact 0 V (internally connected to terminal point 3)
Gate/Latch
8
Gate input or
Latch input: if
▪
bit 3 (EnLatchRise) is set in the control byte, a rising edge
▪
bit 4 (EnLatchFall) is set in the control byte, a falling edge
at this input causes the current counter value to be saved in the latch register as a reference mark.


KL5152-0000 (KL5151-0050) - Contact assignment

Mounting and wiring [image] Connection [image] KL5152-0000 (KL5151-0050) - Contact assignment
KL5152-0000 (KL5151-0050) - Contact assignment
WARNING
Risk of injury through electric shock and damage to the device!
Bring the Bus Terminals system into a safe, de-energized state before starting mounting, disassembly or wiring of the Bus Terminals.
KL5152-0000 (KL5151-0050)
Contact assignment
Terminal point | No. | In the encoder interface operating mode* connection for | In the counter operating mode* connection for
A1 | 1 | Input A for encoder 1 | Counter input
+24 V | 2 | Power contact +24 V (internally connected to terminal point 6)
0 V | 3 | Power contact 0 V (internally connected to terminal point 7)
A2 | 4 | Input A for encoder 2 | Counter enable (gate input for the counter operating mode)
B1 | 5 | Input B for encoder 1 | Counting direction: high = down low = up
+24 V | 6 | Power contact +24 V (internally connected to terminal point 2)
0 V | 7 | Power contact 0 V (internally connected to terminal point 3)
B2 | 8 | Input B for encoder 2 | no function
*) The operating mode is set with bit R32.15 of the feature register.


ATEX - Special conditions (standard temperature range)

Mounting and wiring [image] ATEX - Special conditions (standard temperature range)
ATEX - Special conditions (standard temperature range)
WARNING
Observe the special conditions for the intended use of Beckhoff fieldbus components with standard temperature range in potentially explosive areas (directive 94/9/EU)!
•
The certified components are to be installed in a suitable housing that guarantees a protection class of at least IP54 in accordance with EN 60529! The environmental conditions during use are thereby to be taken into account!
•
If the temperatures during rated operation are higher than 70°C at the feed-in points of cables, lines or pipes, or higher than 80°C at the wire branching points, then cables must be selected whose temperature data correspond to the actual measured temperature values!
•
Observe the permissible ambient temperature range of 0 to 55°C for the use of Beckhoff fieldbus components standard temperature range in potentially explosive areas!
•
Measures must be taken to protect against the rated operating voltage being exceeded by more than 40% due to short-term interference voltages!
•
The individual terminals may only be unplugged or removed from the Bus Terminal system if the supply voltage has been switched off or if a non-explosive atmosphere is ensured!
•
The connections of the certified components may only be connected or disconnected if the supply voltage has been switched off or if a non-explosive atmosphere is ensured!
•
The fuses of the KL92xx/EL92xx power feed terminals may only be exchanged if the supply voltage has been switched off or if a non-explosive atmosphere is ensured!
•
Address selectors and ID switches may only be adjusted if the supply voltage has been switched off or if a non-explosive atmosphere is ensured!
Standards
The fundamental health and safety requirements are fulfilled by compliance with the following standards:
▪
EN 60079-0:2012+A11:2013
▪
EN 60079-15:2010
Marking
The Beckhoff fieldbus components with standard temperature range certified for potentially explosive areas bear one of the following markings:
II 3G KEMA 10ATEX0075 X Ex nA IIC T4 Gc Ta: 0 … 55°C
or
II 3G KEMA 10ATEX0075 X Ex nC IIC T4 Gc Ta: 0 … 55°C


ATEX - Special conditions (extended temperature range)

Mounting and wiring [image] ATEX - Special conditions (extended temperature range)
ATEX - Special conditions (extended temperature range)
WARNING
Observe the special conditions for the intended use of Beckhoff fieldbus components with extended temperature range (ET) in potentially explosive areas (directive 94/9/EU)!
•
The certified components are to be installed in a suitable housing that guarantees a protection class of at least IP54 in accordance with EN 60529! The environmental conditions during use are thereby to be taken into account!
•
If the temperatures during rated operation are higher than 70°C at the feed-in points of cables, lines or pipes, or higher than 80°C at the wire branching points, then cables must be selected whose temperature data correspond to the actual measured temperature values!
•
Observe the permissible ambient temperature range of -25 to 60°C for the use of Beckhoff fieldbus components with extended temperature range (ET) in potentially explosive areas!
•
Measures must be taken to protect against the rated operating voltage being exceeded by more than 40% due to short-term interference voltages!
•
The individual terminals may only be unplugged or removed from the Bus Terminal system if the supply voltage has been switched off or if a non-explosive atmosphere is ensured!
•
The connections of the certified components may only be connected or disconnected if the supply voltage has been switched off or if a non-explosive atmosphere is ensured!
•
The fuses of the KL92xx/EL92xx power feed terminals may only be exchanged if the supply voltage has been switched off or if a non-explosive atmosphere is ensured!
•
Address selectors and ID switches may only be adjusted if the supply voltage has been switched off or if a non-explosive atmosphere is ensured!
Standards
The fundamental health and safety requirements are fulfilled by compliance with the following standards:
▪
EN 60079-0:2012+A11:2013
▪
EN 60079-15:2010
Marking
The Beckhoff fieldbus components with extended temperature range (ET) certified for potentially explosive areas bear the following marking:
II 3G KEMA 10ATEX0075 X Ex nA IIC T4 Gc Ta: -25 … 60°C
or
II 3G KEMA 10ATEX0075 X Ex nC IIC T4 Gc Ta: -25 … 60°C


ATEX Documentation

Mounting and wiring [image] ATEX Documentation
ATEX Documentation
Note
Notes about operation of the Beckhoff terminal systems in potentially explosive areas (ATEX)
Pay also attention to the continuative documentation

Notes about operation of the Beckhoff terminal systems in potentially explosive areas (ATEX)

that is available in the download area of the Beckhoff homepage http:\\www.beckhoff.com!


Configuration software KS2000

Configuration software KS2000
Configuration software KS2000
Additional information
•
KS2000 - Introduction
•
Parameterization with KS2000
•
Settings


KS2000 - Introduction

Configuration software KS2000 [image] KS2000 - Introduction
KS2000 - Introduction
The KS2000 configuration software permits configuration, commissioning and parameterization of bus couplers, of the affiliated bus terminals and of Fieldbus Box Modules. The connection between bus coupler / Fieldbus Box Module and the PC is established by means of the serial configuration cable or the fieldbus.
KS2000 configuration software
Configuration
You can configure the Fieldbus stations with the Configuration Software KS2000 offline. That means, setting up a terminal station with all settings on the couplers and terminals resp. the Fieldbus Box Modules can be prepared before the commissioning phase. Later on, this configuration can be transferred to the terminal station in the commissioning phase by means of a download. For documentation purposes, you are provided with the breakdown of the terminal station, a parts list of modules used and a list of the parameters you have modified. After an upload, existing fieldbus stations are at your disposal for further editing.
Parameterization
KS2000 offers simple access to the parameters of a fieldbus station: specific high-level dialogs are available for all bus couplers, all intelligent bus terminals and Fieldbus Box modules with the aid of which settings can be modified easily. Alternatively, you have full access to all internal registers of the bus couplers and intelligent terminals. Refer to the register description for the meanings of the registers.
Commissioning
The KS2000 software facilitates commissioning of machine components or their fieldbus stations: Configured settings can be transferred to the fieldbus modules by means of a download. After a login to the terminal station, it is possible to define settings in couplers, terminals and Fieldbus Box modules directly online. The same high-level dialogs and register access are available for this purpose as in the configuration phase.
The KS2000 offers access to the process images of the bus couplers and Fieldbus Box modules.
▪
Thus, the coupler's input and output images can be observed by monitoring.
▪
Process values can be specified in the output image for commissioning of the output modules.
All possibilities in the online mode can be used in parallel with the actual fieldbus mode of the terminal station. The fieldbus protocol always has the higher priority in this case.


Parameterization with KS2000

Configuration software KS2000 [image] Parameterization with KS2000
Parameterization with KS2000
Connect the configuration interface of your fieldbus coupler with the serial interface of your PC via the configuration cable and start the KS2000 configuration software.
Click on the Login button. The configuration software will now load the information for the connected fieldbus station.
In the example shown, this is
▪
a BK9000 Ethernet coupler
▪
a KL1xx2 digital input terminal
▪
a KL5151-0000 incremental encoder terminal
▪
a KL9010 bus end terminal
Display of the fieldbus station in KS2000
The left-hand KS2000 window displays the terminals of the fieldbus station in a tree structure.
The right-hand KS2000 window contains a graphic display of the fieldbus station terminals.
In the tree structure of the left-hand window, click on the plus-sign next to the terminal whose parameters you wish to change (item 2 in the example).
KS2000 tree branches for channel 1 of the KL5151
For the KL5151, the branches Register, Settings and ProcData are displayed:
▪
Register permits direct access to the registers of the KL5151.
▪
Under Settings you find dialog boxes for parameterizing the KL5151.
▪
ProcData displays the KL5151 process data.


Settings

Configuration software KS2000 [image] Settings
Settings
The dialog mask for the parameterization of the KL5151-0000 or KL5152-0000 (KL5151-0050) can be found under Settings.
Settings via KS2000
Operation mode
Counter mode active (R32.15)
For KL5151-0000 and KL5152-0000 (KL5151-0050) you can activate counter mode here (default: inactive). When counter mode is activated, the terminals operate as a 32 bit up/down counter. The counting direction (up-/down) is set by the level at input B.
Note
Operation of KL5152-0000 (KL5151-0050) as one channel counter
Because for operation of KL5152-0000 (KL5151-0050) as a counter the A2 connector is used to enable the counter (gate), the operation as a two channel counter is not possible.
Display whole process image (R32.6)
Meaningful operation of the KL5151-0000 is only possible with the full process image (default: active)!
The KL5152-0000 (KL5151-0050) is factory-set to the small (compact) process image. You can activate evaluation of the full process image for the KL5152-0000 (KL5151-0050) here.
A positive level at the gate locks the counter (R32.5)
You can lock the counter by applying a positive level to the gate input (default: inactive).
A negative level at the gate locks the counter (R32.4)
You can lock the counter by applying a negative level to the gate input (default: inactive).


Access from the user program

Access from the user program
Access from the user program
Additional information
•
KL5151-0000
•
KL5151-0021
•
KL5152-0000 (KL5150-0050)
•
Register


KL5151-0000

Access from the user program [image] KL5151-0000
KL5151-0000
Additional information
•
Process image
•
Control and status bytes
•
Mapping


Process image

Access from the user program [image] KL5151-0000 [image] Process image
Process image
In the process image, the KL5151-0000 is represented with 5 bytes of input and output data. These are organized as follows:
Format | Input data | Output data
Byte | SB | CB
Double word | DataIN | DataOUT
Key
SB: Status byte
CB: Control byte
DataIN: The current value of the 32-bit counter, or the one stored in the latch (the selection is made with bit CB1.1 of the control byte)
DataOUT: Value specified for the 32 bit counter
▪
Please refer to the Mapping page for the allocation of the bytes and words to the addresses of the controller.
▪
The meaning of the control and status bytes is explained on the Control and Status bytes page.
Note
No compact process image
Operation of the KL5151-0000 with compact process image (without control and status bytes) is not possible, since the control and status bytes are required for useful process data operation of the terminal. Even if you adjust your Bus Coupler to the compact process image, the KL5151-0000 will still be represented with its complete process image!


Control and status bytes

Access from the user program [image] KL5151-0000 [image] Control and status bytes
Control and status bytes
Channel 1
Process data mode
Control byte 1 in process data mode
Control byte 1 (CB1) is located in the output image, and is transmitted from the controller to the terminal.
Bit | CB1.7 | CB1.6 | CB1.5 | CB1.4 | CB1.3 | CB1.2 | CB1.1 | CB1.0
Name | RegAccess | - | RS_CNT_LAT | EnLatchFall | EnLatchRise | SetCnt | ReadLatch | EnLatchC
Key
Bit | Name | Description
CB1.7 | RegAccess | 0bin |  | Register communication off (process data mode)
CB1.6 | - | reserved
CB1.5 | RS_CNT_LAT* | 1bin | The counter is set to zero by an active edge at the latch input. Bits CB1.4, CB1.3 and CB1.0 specify which edge of the latch signal is active.
CB1.4 | EnLatchFall* | 1bin | The falling edge of the latch input is active. The counter value is stored in the latch register at the first external latch impulse after the EnLatchFall bit becomes true. The subsequent pulses do not have any effect on the latch register.
CB1.3 | EnLatchRise* | 1bin | The rising edge of the latch input is active. The counter value is stored in the latch register on the first external latch pulse after the EnLatchRise bit becomes true (this has priority over EnLatchFall). The subsequent pulses do not have any effect on the latch register.
CB1.2 | SetCnt | A rising edge at SetCnt will set the counter to the 32 bit value that is written by the controller into the process output data.
CB1.1 | ReadLatch | 0bin | The current value of the 32 bit counter is mapped to the process input data.
 |  | 1bin | The 32 bit value stored in the latch counter is mapped to the process input data.
CB1.0 | EnLatchC* | 1bin | The rising edge of the zero input (input C) is active. The counter value is stored in the latch register at the first external latch impulse after the EnLatchC bit becomes true. The subsequent pulses do not have any effect on the latch register. (see note below)
*) Does not apply to KL5152-0000 (KL5151-0050), since the latch input and zero input are not available in this case. Always set bits CB1.5, CB1.4, CB1.3 and CB1.0 of the KL5152-0000 (KL5151-0050) to 0bin!
Note
EnLatchC or EnLatchRise and EnLatchFall?
If bit CB1.0 (EnLatchC) is set, bit CB1.3 (EnLatchRise) and bit CB1.4 (EnLatchFall) must not be set, otherwise you cannot know which event has caused a counter value to be stored in the latch.
Status byte 1 in process data mode
The status byte 1 (SB1) is located in the input image, and is transmitted from terminal to the controller.
Bit | SB1.7 | SB1.6 | SB1.5 | SB1.4 | SB1.3 | SB1.2 | SB1.1 | SB1.0
Name | RegAccess | - | - | StGate | StLatchC | SetCnt | ReadLatch | ValLatchC
Key
Bit
Name
Description
SB1.7
RegAccess
0bin
Acknowledgement for process data mode
SB1.6
-
reserved
SB1.5
-
reserved
SB1.4
StGate
KL5151-0000: Status of the external gate/latch input
KL5152-0000 (KL5151-0050): reserved
SB1.3
StLatchC
KL5151-0000: Status of the zero input (input C)
KL5152-0000 (KL5151-0050): reserved
SB1.2
SetCnt
Acknowledgement that the data for setting the counter has been adopted by the terminal.
SB1.1
ReadLatch
0bin
The current value of the 32 bit counter has been mapped to the process data.
1bin
The 32 bit value stored in the latch counter has been mapped to the process data.
SB1.0
ValLatchC*
1bin
A zero-point latch has occurred: a rising edge at the zero input (input C) has caused the current counter value to be stored in the latch register as a reference mark.
Subsequent pulses do not have any effect on the latch register. To reactivate the gate/latch input you must:
▪
set bit 0 (EnLatchC) in the control byte to 0bin.
▪
wait until this change has been acknowledged by resetting bit 0 (ValLatchC) in the status byte.
▪
set bit 0 (EnLatchC) in the control byte to 1bin again.
*) Does not apply to KL5152-0000 (KL5151-0050), since the latch input and zero input are not available in this case.
Register communication
Control byte 1 in register communication
Control byte 1 (CB1) is located in the output image, and is transmitted from the controller to the terminal.
Bit | CB1.7 | CB1.6 | CB1.5 | CB1.4 | CB1.3 | CB1.2 | CB1.1 | CB1.0
Name | RegAccess | R/W | Reg. no.
Key
Bit | Name | Description
CB1.7 | RegAccess | 1bin | Register communication switched on
CB1.6 | R/W | 0bin | Read access
 |  | 1bin | Write access
CB1.5 to CB1.0 | Reg. no. | Register number: Enter the number of the register that you - want to read with input data word 0 or - write to with output data word 0.
CAUTION
No valid process data during the register communication!
It is not possible to access the data registers during register communication! Process data that may still be displayed is not valid!
Status byte 1 in register communication
The status byte 1 (SB1) is located in the input image, and is transmitted from terminal to the controller.
Bit | SB1.7 | SB1.6 | SB1.5 | SB1.4 | SB1.3 | SB1.2 | SB1.1 | SB1.0
Name | RegAccess | R | Reg. no.
Key
Bit | Name | Description
SB1.7 | RegAccess | 1bin | Acknowledgement for register access
SB1.6 | R | 0bin | Read access
SB1.5 to SB1.0 | Reg. no. | Number of the register that was read or written.
Channel 2 (KL5152-0000 and KL5151-0050 only)
The control and status bytes of channel 2 (CB2 and SB2) have the same structure as the control and status bytes of channel 1.


Mapping

Access from the user program [image] KL5151-0000 [image] Mapping
Mapping
The Bus Terminals occupy addresses within the process image of the controller. The assignment of process data (input and output data) and parameterization data (control and status bytes) to the control addresses is called mapping. The type of mapping depends on:
▪
the fieldbus system used
▪
the terminal type
▪
the parameterization of the Bus Coupler such as
- Intel or Motorola format
- word alignment switched on or off
The Bus Couplers (BKxxxx, LCxxxx) and Bus Terminal Controllers (BCxxxx, BXxxxx) are supplied with certain default settings. The default setting can be changed with the KS2000 configuration software or with a master configuration software (e.g. TwinCAT System Manager or ComProfibus).
The following tables show the mapping depending on different conditions. For information about the contents of the individual bytes please refer to the pages Process image and Control and status byte.
Complete evaluation
Control and status bytes can be accessed.
Complete evaluation in Intel format
Default mapping for CANopen, CANCAL, DeviceNet, ControlNet, Modbus, RS232 and RS485 coupler.
Parameterization of the Bus Coupler | Address | Input data |  | Output data
 | Word offset | High byte | Low byte | High byte | Low byte
Complete evaluation: n/a Motorola format: no Word alignment: no | 0 | DataIN D0 | SB | DataOUT D0 | CB
 | 1 | DataIN D2 | DataIN D1 | DataOUT D2 | DataOUT D1
 | 2 | reserved | DataIN D3 | reserved | DataOUT D3
Complete evaluation in Motorola format
Parameterization of the Bus Coupler | Address | Input data |  | Output data
 | Word offset | High byte | Low byte | High byte | Low byte
Complete evaluation: n/a Motorola format: yes Word alignment: no | 0 | DataIN D3 | SB | DataOUT D3 | CB
 | 1 | DataIN D1 | DataIN D2 | DataOUT D1 | DataOUT D2
 | 2 | reserved | DataIN D0 | reserved | DataOUT D0
Complete evaluation in Intel format with word alignment
Default mapping for EtherCAT, Lightbus and Ethernet coupler as well as Bus Terminal Controllers (BCxxxx, BXxxxx).
Parameterization of the Bus Coupler | Address | Input data |  | Output data
 | Word offset | High byte | Low byte | High byte | Low byte
Complete evaluation: n/a Motorola format: no Word alignment: yes | 0 | reserved | SB | reserved | CB
 | 1 | DataIN D1 | DataIN D0 | DataOUT D1 | DataOUT D0
 | 2 | DataIN D3 | DataIN D2 | DataOUT D3 | DataOUT D2
Complete evaluation in Motorola format with word alignment
Parameterization of the Bus Coupler | Address | Input data |  | Output data
 | Word offset | High byte | Low byte | High byte | Low byte
Complete evaluation: n/a Motorola format: yes Word alignment: yes | 0 | reserved | SB1 | reserved | CB1
 | 1 | DataIN D2 | DataIN D3 | DataOUT D2 | DataOUT D3
 | 2 | DataIN D0 | DataIN D1 | DataOUT D0 | DataOUT D1
Legend
Complete evaluation: In addition to the process data, the control and status bytes are also mapped into the address space.
Motorola format: Motorola or Intel format can be set.
Word alignment: In order for the word address range to commence at a word boundary, empty bytes are inserted into the process image as appropriate.
SB: Status byte (appears in the input process image)
CB: Control byte (appears in the output process image)
DataIN D0: Input double word, lowest significant data byte
DataIN D1: Input double word, ...
DataIN D2: Input double word, ...
DataIN D3: Input double word, highest significant data byte
DataOUT D0: Output double word, lowest significant data byte
DataOUT D1: Output double word, ...
DataOUT D2: Output double word, ...
DataOUT D3: Output double word, highest significant data byte
reserved: This byte occupies process data memory, although it has no function.
Compact evaluation
Note
No compact process image
Operation of the KL5151-0000 with compact process image (without control and status bytes) is not possible, since the control and status bytes are required for useful process data operation of the terminal. Even if you adjust your Bus Coupler to the compact process image, the KL5151-0000 will still be represented with its complete process image!


KL5151-0021

Access from the user program [image] KL5151-0021
KL5151-0021
Additional information
•
Process image
•
Control and status bytes


Process image

Access from the user program [image] KL5151-0021 [image] Process image
Process image
In the process image, the KL5151-0021 is represented with 5 bytes of input and output data. These are organized as follows:
Format | Input data | Output data
Byte | SB1 | CB1
Double word | DataIN1 | DataOUT1
Byte | SB2 | CB2
Double word | DataIN2 | DataOUT2
Key
SB1: Status byte 1
CB1: Control byte 1
SB1: Status byte 2 (not used)
CB1: Control byte 2 (not used)
DataIN1: The current value of the 32-bit counter, or the one stored in the latch (the selection is made with bit CB1.1 of the control byte)
DataOUT1: Compare value for setting the comparator output (enabled by bit CB1.6 of the control byte).
DataIN2: 32-bit latch
DataOUT2: Compare value for resetting the comparator output
▪
The meaning of the control and status bytes is explained on the Control and Status bytes page.
Note
No compact process image
Operation of the KL5151-0021 with compact process image (without control and status bytes) is not possible, since the control and status bytes are required for useful process data operation of the terminal. Even if you adjust your Bus Coupler to the compact process image, the KL5151-0021 will still be represented with its complete process image!


Control and status bytes

Access from the user program [image] KL5151-0021 [image] Control and status bytes
Control and status bytes
Control byte 1 and status byte 1
Process data mode
Control byte 1 in process data mode
Control byte 1 (CB1) is located in the output image, and is transmitted from the controller to the terminal.
Bit | CB1.7 | CB1.6 | CB1.5 | CB1.4 | CB1.3 | CB1.2 | CB1.1 | CB1.0
Name | RegAccess | EnComp | SetOut | ReadLatchN | ReadLatchP | SetCnt | EnMeas | EnLatchC
Key
Bit | Name | Description
CB1.7 | RegAccess | 0bin | Register communication off (process data mode)
CB1.6 | EnComp | 0bin | Compare function for setting and resetting the output not enabled
 |  | 1bin | Compare function for setting and resetting the output enabled
CB1.5 | SetOut | 0bin | sets output manually to 0 V | SetOut only functions if EnComp = 0bin
 |  | 1bin | sets output manually to 24 V
CB1.4 | ReadLatchN | 1bin | Read the negative edge
CB1.3 | ReadLatchP | 1bin | Read the positive edge
CB1.2 | SetCnt | A rising edge at SetCnt will set the counter to the 32 bit value that is written by the controller into the process output data.
CB1.1 | EnMeas | 0bin | Workpiece measurement enabled | If the workpiece measurement is enabled, it is read via CB1.3 and CB1.4 and saved in two latch values.
 |  | 1bin | Workpiece measurement not enabled
CB1.0 | EnLatchC | 1bin | The rising edge of the zero input (input C) is active. The counter value is stored in the latch register at the first external latch impulse after the EnLatchC bit becomes true. The subsequent pulses do not have any effect on the latch register. (see note below)
Note
EnLatchC or EnLatchRise and EnLatchFall?
If bit CB1.0 (EnLatchC) is set, bit CB1.3 (EnLatchRise) and bit CB1.4 (EnLatchFall) must not be set, otherwise you cannot know which event has caused a counter value to be stored in the latch.
Status byte 1 in process data mode
The status byte 1 (SB1) is located in the input image, and is transmitted from terminal to the controller.
Bit | SB1.7 | SB1.6 | SB1.5 | SB1.4 | SB1.3 | SB1.2 | SB1.1 | SB1.0
Name | RegAccess | - | StOut | StGate | StLatchC | SetCnt | MeasDone | ValLatchC
Key
Bit
Name
Description
SB1.7
RegAccess
0bin
Acknowledgement for process data mode
SB1.6
-
reserved
SB1.5
StOut
0bin
Status of the output is 0 V
1bin
Status of the output is 24 V
SB1.4
StGate
Status of the external gate/latch input
SB1.3
StLatchC
Status of the zero input (input C)
SB1.2
SetCnt
Acknowledgement that the data for setting the counter has been adopted by the terminal.
SB1.1
MeasDone
1bin
Measurement done
SB1.0
ValLatchC
1bin
A zero-point latch has occurred: a rising edge at the zero input (input C) has caused the current counter value to be stored in the latch register as a reference mark.
Subsequent pulses do not have any effect on the latch register. To reactivate the gate/latch input you must:
▪
set bit 0 (EnLatchC) in the control byte to 0bin.
▪
wait until this change has been acknowledged by resetting bit 0 (ValLatchC) in the status byte.
▪
set bit 0 (EnLatchC) in the control byte to 1bin again.
Register communication
Control byte 1 in register communication
Control byte 1 (CB1) is located in the output image, and is transmitted from the controller to the terminal.
Bit | CB1.7 | CB1.6 | CB1.5 | CB1.4 | CB1.3 | CB1.2 | CB1.1 | CB1.0
Name | RegAccess | R/W | Reg. no.
Key
Bit | Name | Description
CB1.7 | RegAccess | 1bin | Register communication switched on
CB1.6 | R/W | 0bin | Read access
 |  | 1bin | Write access
CB1.5 to CB1.0 | Reg. no. | Register number: Enter the number of the register that you - want to read with input data word 0 or - write to with output data word 0.
CAUTION
No valid process data during the register communication!
It is not possible to access the data registers during register communication! Process data that may still be displayed is not valid!
Status byte 1 in register communication
The status byte 1 (SB1) is located in the input image, and is transmitted from terminal to the controller.
Bit | SB1.7 | SB1.6 | SB1.5 | SB1.4 | SB1.3 | SB1.2 | SB1.1 | SB1.0
Name | RegAccess | R | Reg. no.
Key
Bit | Name | Description
SB1.7 | RegAccess | 1bin | Acknowledgement for register access
SB1.6 | R | 0bin | Read access
SB1.5 to SB1.0 | Reg. no. | Number of the register that was read or written.
Control byte 2 and status byte 2
Control byte 2 and status byte 2 (CB2 and SB2) are not used.


KL5152-0000 (KL5150-0050)

Access from the user program [image] KL5152-0000 (KL5150-0050)
KL5152-0000 (KL5150-0050)
Additional information
•
Process image
•
Control and status bytes
•
Mapping


Process image

Access from the user program [image] KL5152-0000 (KL5150-0050) [image] Process image
Process image
The terminal can be operated with variously sized process images:
▪
compact process image
▪
compact process image on Bus Coupler that is set to complete process image (e.g. Lightbus)
▪
complete process image
The compact process image is activated in the delivery condition of the KL5151-0050. The size of the process image can be specified through bit R32.6 of the feature register.
Control byte, status byte and mapping
▪
The meaning of the control and status bytes is explained on the Control and Status bytes page.
▪
Please refer to the Mapping page for the allocation of the bytes and words to the addresses of the controller.
Compact process image
For operation with compact process image, you must configure your Bus Coupler to compact mapping and bit R32.6 of the feature register of the KL5151-0050 must be 1bin.
The KL5151-0050 is represented in the compact process image with 8 bytes of input data and 8 bytes of output data. These are organized as follows:
Input data |  | Output data
Format | Contents | Format | Contents
Double word | DataIN1 | Byte | CB1PD
 |  | Byte | reserved
 |  | Byte | CB2PD
 |  | Byte | reserved
Double word | DataIN2 | Double word | DataOUT
Key
CB1PD: Control byte for process data operation of channel 1
CB2PD: Control byte for process data operation of channel 2
DataIN1: The current value of the 32-bit counter 1, or the one stored in the latch (the selection is made with bit CB1.1 of the control byte 1)
DataIN2: The current value of the 32-bit counter 2, or the one stored in the latch (the selection is made with bit CB2.1 of the control byte 2)
DataOUT: 32 bit specification of the value for counter 1 and counter 2
Note
No register communication possible
In this configuration the control bytes are suitable only for process data operation. Register communication is not possible!
Complete process image
For operation with complete process image, you must configure your Bus Coupler to complete mapping and bit R32.6 of the feature register of the KL5151-0050 must be 0bin.
The KL5151-0050 is represented in the complete process image with 10 bytes of input data and 10 bytes of output data. These are organized as follows:
Input data |  | Output data
Format | Contents | Format | Contents
Byte | SB1 | Byte | CB1
Double word | DataIN1 | Double word | DataOUT1
Byte | SB2 | Byte | CB2
Double word | DataIN2 | Double word | DataOUT2
Key
SB1: Status byte for channel 1
SB2: Status byte for channel 2
CB1: Control byte for channel 1
CB2: Control byte for channel 2
DataIN1: The current value of the 32-bit counter 1, or the one stored in the latch (the selection is made with bit CB1.1 of the control byte 1)
DataIN2: The current value of the 32-bit counter 2, or the one stored in the latch (the selection is made with bit CB2.1 of the control byte 2)
DataOUT1: 32 bit specification of the value for counter 1
DataOUT2: 32 bit specification of the value for counter 2
Note
Register communication possible
In this configuration you can use the control and status bytes alternatively for register communication or process data operation.
Compact process image on Bus Coupler that is set to complete process image
If the KL5151-0050 is operated on a Bus Coupler that is set by default to complete process image (e.g. Lightbus), but bit R32.6 of the feature register is 1bin, the following process image results:
Input data |  | Output data
Format | Contents | Format | Contents
Byte | SB1RC | Byte | CB1RC
Double word | DataIN1 | Byte | CB1PD
 |  | Byte | reserved
 |  | Byte | CB2PD
 |  | Byte | reserved
Byte | SB2RC | Byte | CB2RC
Double word | DataIN2 | Double word | DataOUT
Key
SB1RC: Status byte for register communication with channel 1
SB2RC: Status byte for register communication with channel 2
CB1RC: Control byte for register communication with channel 1
CB2RC: Control byte for register communication with channel 2
CB1PD: Control byte for process data operation of channel 1
CB2PD: Control byte for process data operation of channel 2
DataIN1: The current value of the 32-bit counter 1, or the one stored in the latch (the selection is made with bit CB1.1 of the control byte 1)
DataIN2: The current value of the 32-bit counter 2, or the one stored in the latch (the selection is made with bit CB2.1 of the control byte 2)
DataOUT: 32 bit specification of the value for counter 1 and counter 2
Note
Register communication possible
In this configuration you have different control and status bytes for register communication and process data operation. These are only suitable for the respectively specified purpose!
You can switch from process data operation to register communication with bit 7 of the control byte for register communication.
Bit 7 of the control byte for process data operation is not evaluated.


Control and status bytes

Access from the user program [image] KL5152-0000 (KL5150-0050) [image] Control and status bytes
Control and status bytes
Channel 1
Process data mode
Control byte 1 in process data mode
Control byte 1 (CB1) is located in the output image, and is transmitted from the controller to the terminal.
Bit | CB1.7 | CB1.6 | CB1.5 | CB1.4 | CB1.3 | CB1.2 | CB1.1 | CB1.0
Name | RegAccess | - | RS_CNT_LAT | EnLatchFall | EnLatchRise | SetCnt | ReadLatch | EnLatchC
Key
Bit | Name | Description
CB1.7 | RegAccess | 0bin | Register communication off (process data mode)
CB1.6 | - | reserved
CB1.5 | RS_CNT_LAT* | 1bin | The counter is set to zero by an active edge at the latch input. Bits CB1.4, CB1.3 and CB1.0 specify which edge of the latch signal is active.
CB1.4 | EnLatchFall* | 1bin | The falling edge of the latch input is active. The counter value is stored in the latch register at the first external latch impulse after the EnLatchFall bit becomes true. The subsequent pulses do not have any effect on the latch register.
CB1.3 | EnLatchRise* | 1bin | The rising edge of the latch input is active. The counter value is stored in the latch register on the first external latch pulse after the EnLatchRise bit becomes true (this has priority over EnLatchFall). The subsequent pulses do not have any effect on the latch register.
CB1.2 | SetCnt | A rising edge at SetCnt will set the counter to the 32 bit value that is written by the controller into the process output data.
CB1.1 | ReadLatch | 0bin | The current value of the 32 bit counter is mapped to the process input data.
 |  | 1bin | The 32 bit value stored in the latch counter is mapped to the process input data.
CB1.0 | EnLatchC* | 1bin | The rising edge of the zero input (input C) is active. The counter value is stored in the latch register at the first external latch impulse after the EnLatchC bit becomes true. The subsequent pulses do not have any effect on the latch register. (see note below)
*) Does not apply to KL5152-0000 (KL5151-0050), since the latch input and zero input are not available in this case. Always set bits CB1.5, CB1.4, CB1.3 and CB1.0 of the KL5152-0000 (KL5151-0050) to 0bin!
Note
EnLatchC or EnLatchRise and EnLatchFall?
If bit CB1.0 (EnLatchC) is set, bit CB1.3 (EnLatchRise) and bit CB1.4 (EnLatchFall) must not be set, otherwise you cannot know which event has caused a counter value to be stored in the latch.
Status byte 1 in process data mode
The status byte 1 (SB1) is located in the input image, and is transmitted from terminal to the controller.
Bit | SB1.7 | SB1.6 | SB1.5 | SB1.4 | SB1.3 | SB1.2 | SB1.1 | SB1.0
Name | RegAccess | - | - | StGate | StLatchC | SetCnt | ReadLatch | ValLatchC
Key
Bit
Name
Description
SB1.7
RegAccess
0bin
Acknowledgement for process data mode
SB1.6
-
reserved
SB1.5
-
reserved
SB1.4
StGate
KL5151-0000: Status of the external gate/latch input
KL5152-0000 (KL5151-0050): reserved
SB1.3
StLatchC
KL5151-0000: Status of the zero input (input C)
KL5152-0000 (KL5151-0050): reserved
SB1.2
SetCnt
Acknowledgement that the data for setting the counter has been adopted by the terminal.
SB1.1
ReadLatch
0bin
The current value of the 32 bit counter has been mapped to the process data.
1bin
The 32 bit value stored in the latch counter has been mapped to the process data.
SB1.0
ValLatchC*
1bin
A zero-point latch has occurred: a rising edge at the zero input (input C) has caused the current counter value to be stored in the latch register as a reference mark.
Subsequent pulses do not have any effect on the latch register. To reactivate the gate/latch input you must:
▪
set bit 0 (EnLatchC) in the control byte to 0bin.
▪
wait until this change has been acknowledged by resetting bit 0 (ValLatchC) in the status byte.
▪
set bit 0 (EnLatchC) in the control byte to 1bin again.
*) Does not apply to KL5152-0000 (KL5151-0050), since the latch input and zero input are not available in this case.
Register communication
Control byte 1 in register communication
Control byte 1 (CB1) is located in the output image, and is transmitted from the controller to the terminal.
Bit | CB1.7 | CB1.6 | CB1.5 | CB1.4 | CB1.3 | CB1.2 | CB1.1 | CB1.0
Name | RegAccess | R/W | Reg. no.
Key
Bit | Name | Description
CB1.7 | RegAccess | 1bin | Register communication switched on
CB1.6 | R/W | 0bin | Read access
 |  | 1bin | Write access
CB1.5 to CB1.0 | Reg. no. | Register number: Enter the number of the register that you - want to read with input data word 0 or - write to with output data word 0.
CAUTION
No valid process data during the register communication!
It is not possible to access the data registers during register communication! Process data that may still be displayed is not valid!
Status byte 1 in register communication
The status byte 1 (SB1) is located in the input image, and is transmitted from terminal to the controller.
Bit | SB1.7 | SB1.6 | SB1.5 | SB1.4 | SB1.3 | SB1.2 | SB1.1 | SB1.0
Name | RegAccess | R | Reg. no.
Key
Bit | Name | Description
SB1.7 | RegAccess | 1bin | Acknowledgement for register access
SB1.6 | R | 0bin | Read access
SB1.5 to SB1.0 | Reg. no. | Number of the register that was read or written.
Channel 2 (KL5152-0000 and KL5151-0050 only)
The control and status bytes of channel 2 (CB2 and SB2) have the same structure as the control and status bytes of channel 1.


Mapping

Access from the user program [image] KL5152-0000 (KL5150-0050) [image] Mapping
Mapping
The Bus Terminals occupy addresses within the process image of the controller. The assignment of process data (input and output data) and parameterization data (control and status bytes) to the control addresses is called mapping. The type of mapping depends on:
▪
the fieldbus system used
▪
the terminal type
▪
the parameterization of the Bus Coupler such as
- compact or full evaluation
- Intel or Motorola format
- word alignment switched on or off
▪
the parameterization of the KL5152-0000 (KL5151-0050) to compact or complete evaluation (bit R32.6 of the feature register)
The Bus Couplers (BKxxxx, LCxxxx) and Bus Terminal Controllers (BCxxxx, BXxxxx) are supplied with certain default settings. The default setting can be changed with the KS2000 configuration software or with a master configuration software (e.g. TwinCAT System Manager or ComProfibus).
The following tables show the mapping depending on different conditions. For information about the contents of the individual bytes please refer to the pages Process image and Control and status byte.
Compact evaluation
For operation with compact process image, you must configure your Bus Coupler to compact mapping and bit R32.6 of the feature register of the KL5152-0000 (KL5151-0050) must be 1bin.
In this configuration the control bytes are suitable only for process data operation. Register communication is not possible!
Compact evaluation in Intel format
Default mapping for CANopen, CANCAL, DeviceNet, ControlNet, Modbus, RS232 and RS485 coupler
Parameterization of the Bus Coupler | Address | Input data |  | Output data
 | Word offset | High byte | Low byte | High byte | Low byte
Complete evaluation: no Motorola format: no Word alignment: n/a | 0 | DataIN1 D1 | DataIN1 D0 | reserved | CB1PD
 | 1 | DataIN1 D3 | DataIN1 D2 | reserved | CB2PD
 | 2 | DataIN2 D1 | DataIN2 D0 | DataOUT D1 | DataOUT D0
 | 3 | DataIN2 D3 | DataIN2 D2 | DataOUT D3 | DataOUT D2
Compact evaluation in Motorola format
Default mapping for PROFIBUS and Interbus coupler
Parameterization of the Bus Coupler | Address | Input data |  | Output data
 | Word offset | High byte | Low byte | High byte | Low byte
Complete evaluation: no Motorola format: yes Word alignment: n/a | 0 | DataIN1 D2 | DataIN1 D3 | CB2PD | reserved
 | 1 | DataIN1 D0 | DataIN1 D1 | CB1PD | reserved
 | 2 | DataIN2 D2 | DataIN2 D3 | DataOUT D2 | DataOUT D3
 | 3 | DataIN2 D0 | DataIN2 D1 | DataOUT D0 | DataOUT D1
Complete evaluation
For operation with complete process image, you must configure your Bus Coupler to complete mapping and bit R32.6 of the feature register of the KL5151-0050 must be 0bin.
In this configuration you can use the control and status bytes alternatively for register communication or process data operation.
Complete evaluation in Intel format
Parameterization of the Bus Coupler | Address | Input data |  | Output data
 | Word offset | High byte | Low byte | High byte | Low byte
Complete evaluation: yes Motorola format: no Word alignment: no | 0 | DataIN1 D0 | SB1 | DataOUT1 D0 | CB1
 | 1 | DataIN1 D2 | DataIN1 D1 | DataOUT1 D2 | DataOUT1 D1
 | 2 | SB2 | DataIN1 D3 | CB2 | DataOUT1 D3
 | 3 | DataIN2 D1 | DataIN2 D0 | DataOUT2 D1 | DataOUT2 D0
 | 4 | DataIN2 D3 | DataIN2 D2 | DataOUT2 D3 | DataOUT2 D2
Complete evaluation in Motorola format
Parameterization of the Bus Coupler | Address | Input data |  | Output data
 | Word offset | High byte | Low byte | High byte | Low byte
Complete evaluation: yes Motorola format: yes Word alignment: no | 0 | DataIN1 D3 | SB1 | DataOUT1 D3 | CB1
 | 1 | DataIN1 D1 | DataIN1 D2 | DataOUT1 D1 | DataOUT1 D2
 | 2 | SB2 | DataIN1 D0 | CB2 | DataOUT1 D0
 | 3 | DataIN2 D2 | DataIN2 D3 | DataOUT2 D2 | DataOUT2 D3
 | 4 | DataIN2 D0 | DataIN2 D1 | DataOUT2 D0 | DataOUT2 D1
Complete evaluation in Intel format with word alignment
Parameterization of the Bus Coupler | Address | Input data |  | Output data
 | Word offset | High byte | Low byte | High byte | Low byte
Complete evaluation: yes Motorola format: no Word alignment: yes | 0 | reserved | SB1 | reserved | CB1
 | 1 | DataIN1 D1 | DataIN1 D0 | DataOUT1 D1 | DataOUT1 D0
 | 2 | DataIN1 D3 | DataIN1 D2 | DataOUT1 D3 | DataOUT1 D2
 | 3 | reserved | SB2 | reserved | CB2
 | 4 | DataIN2 D1 | DataIN2 D0 | DataOUT2 D1 | DataOUT2 D0
 | 5 | DataIN2 D3 | DataIN2 D2 | DataOUT2 D3 | DataOUT2 D2
Complete evaluation in Motorola format with word alignment
Parameterization of the Bus Coupler | Address | Input data |  | Output data
 | Word offset | High byte | Low byte | High byte | Low byte
Complete evaluation: yes Motorola format: yes Word alignment: yes | 0 | reserved | SB1 | reserved | CB1
 | 1 | DataIN1 D2 | DataIN1 D3 | DataOUT1 D2 | DataOUT1 D3
 | 2 | DataIN1 D0 | DataIN1 D1 | DataOUT1 D0 | DataOUT1 D1
 | 3 | reserved | SB2 | reserved | CB2
 | 4 | DataIN2 D2 | DataIN2 D3 | DataOUT2 D2 | DataOUT2 D3
 | 5 | DataIN2 D0 | DataIN2 D1 | DataOUT2 D0 | DataOUT2 D1
Compact process image on Bus Coupler that is set to complete process image
If the KL5152-0000 (KL5151-0050) is operated on a Bus Coupler that is set by default to complete process image (e.g. Lightbus), but bit R32.6 of the feature register is 1bin (default setting), the following process image results:
In this configuration you have different control and status bytes for register communication and process data operation. These are only suitable for the respectively specified purpose!
Intel format
Parameterization of the Bus Coupler | Address | Input data |  | Output data
 | Word offset | High byte | Low byte | High byte | Low byte
Complete evaluation: yes Motorola format: no Word alignment: no | 0 | DataIN1 D0 | SB1RC | CB1PD | CB1RC
 | 1 | DataIN1 D2 | DataIN1 D1 | CB2PD | reserved
 | 2 | SB2RC | DataIN1 D3 | CB2RC | reserved
 | 3 | DataIN2 D1 | DataIN2 D0 | DataOUT D1 | DataOUT D0
 | 4 | DataIN2 D3 | DataIN2 D2 | DataOUT D3 | DataOUT D2
Motorola format
Parameterization of the Bus Coupler | Address | Input data |  | Output data
 | Word offset | High byte | Low byte | High byte | Low byte
Complete evaluation: yes Motorola format: yes Word alignment: no | 0 | DataIN1 D3 | SB1RC | reserved | CB1RC
 | 1 | DataIN1 D1 | DataIN1 D2 | reserved | CB2PD
 | 2 | SB2RC | DataIN1 D0 | CB2RC | CB1PD
 | 3 | DataIN2 D2 | DataIN2 D3 | DataOUT D2 | DataOUT D3
 | 4 | DataIN2 D0 | DataIN2 D1 | DataOUT D0 | DataOUT D1
Intel format with word alignment
Default mapping for EtherCAT, Lightbus and Ethernet coupler as well as Bus Terminal Controllers (BCxxxx, BXxxxx)
Parameterization of the Bus Coupler | Address | Input data |  | Output data
 | Word offset | High byte | Low byte | High byte | Low byte
Complete evaluation: yes Motorola format: no Word alignment: yes | 0 | reserved | SB1RC | reserved | CB1RC
 | 1 | DataIN1 D1 | DataIN1 D0 | reserved | CB1PD
 | 2 | DataIN1 D3 | DataIN1 D2 | reserved | CB2PD
 | 3 | reserved | SB2RC | reserved | CB2RC
 | 4 | DataIN2 D1 | DataIN2 D0 | DataOUT D1 | DataOUT D0
 | 5 | DataIN2 D3 | DataIN2 D2 | DataOUT D3 | DataOUT D2
Motorola format with word alignment
Parameterization of the Bus Coupler | Address | Input data |  | Output data
 | Word offset | High byte | Low byte | High byte | Low byte
Complete evaluation: yes Motorola format: yes Word alignment: yes | 0 | reserved | SB1RC | reserved | CB1RC
 | 1 | DataIN1 D2 | DataIN1 D3 | CB2PD | reserved
 | 2 | DataIN1 D0 | DataIN1 D1 | CB1PD | reserved
 | 3 | reserved | SB2RC | reserved | CB2RC
 | 4 | DataIN2 D2 | DataIN2 D3 | DataOUT D2 | DataOUT D3
 | 5 | DataIN2 D0 | DataIN2 D1 | DataOUT D0 | DataOUT D1
Key
Complete evaluation: In addition to the process data, the control and status bytes are also mapped into the address space.
Motorola format: Motorola or Intel format can be set.
Word alignment: In order for the channel address range to commence at a word boundary, empty bytes are inserted into the process image as appropriate.
SB n: Status byte for channel n (appears in the input process image).
CB n: Control byte for channel n (appears in the output process image).
SB n PD: Status byte for channel n, to be used only for process data operation (appears in the input process image)
CB n PD: Control byte for channel n, to be used only for process data operation (appears in the output process image)
SB n RC: Status byte for channel n, to be used only for register communication (appears in the input process image)
CB n RC: Control byte for channel n, to be used only for register communication (appears in the output process image)
DataIN n D0: Channel n, input double word, lowest significant data byte
DataIN n D1: Channel n, input double word, ...
DataIN n D2: Channel n, input double word, ...
DataIN n D3: Channel n, input double word, highest significant data byte
DataOUT n D0: Channel n, output double word, lowest significant data byte
DataOUT n D1: Channel n, output double word, ...
DataOUT n D2: Channel n, output double word, ...
DataOUT n D3: Channel n, output double word, highest significant data byte
reserved: This byte occupies process data memory, although it has no function.


Register

Access from the user program [image] Register
Register
Additional information
•
Register overview
•
Register description
•
Examples of Register Communication


Register overview

Access from the user program [image] Register [image] Register overview
Register overview
Register | Comment |  | Default value |  | R/W | Memory
R0 | KL5151-0021: | Filter register | 0x0000 | 0dec | R/W | RAM
 | other types: | reserved | - | - | - | -
R1 to R5 | reserved |  | - | - | - | -
R6 | Diagnostic register (not used) |  | 0x0000 | 0dec | R | RAM
R7 | Command register (not used) |  | 0x0000 | 0dec | R/W | RAM
R8 | Terminal description | KL5151-0000: | 0x141F | 5151dec | R | ROM
 |  | KL5151-0023:
 |  | KL5151-0050:
 |  | KL5152-0000: | 0x1420 | 5152dec
R9 | Firmware version |  | e.g. 0x3341 | e.g. 3AASCII | R | ROM
R10 | Multiplex shift register |  | 0x0228 | 552dec | R | ROM
R11 | Signal channels | KL5151-0000: | 0x0128 | 296dec | R | ROM
 |  | KL5151-0023: | 0x0150 | 336dec
 |  | KL5151-0050: | 0x0228 | 552dec
 |  | KL5152-0000:
R12 | Minimum data length | KL5151-0000: | 0x2828 | 10280dec | R | ROM
 |  | KL5151-0023: | 0x5050 | 20560dec
 |  | KL5151-0050: | 0xA8A8 | 43176dec
 |  | KL5152-0000:
R13 | Data type |  | 0x0006 | 6dec | R | ROM
R14 | reserved |  | - | - | - | -
R15 | Alignment register |  | variable | variable | R/W | RAM
R16 | Hardware version |  | e.g. 0x0000 | e.g. 0dec | R/W | SEEROM/RAM
R17 to R30 | reserved |  | - | - | - | -
R29 | Terminal type Special identifier | KL5151-0000: | 0x0000 | 0dec | R | ROM
 |  | KL5151-0023: | 0x0017 | 23dec
 |  | KL5151-0050: | 0x0032 | 50dec
 |  | KL5152-0000: | 0x0000 | 0dec
R31 | Code word register |  | 0x0000 | 0dec | R/W | RAM
R32 | Feature register | KL5151-0000: | 0x0000 | 0dec | R/W | SEEROM/RAM
 |  | KL5151-0023: | 0x0000 | 0dec
 |  | KL5151-0050: | 0x00C0 | 192dec
 |  | KL5152-0000:
R33 to R34 | reserved |  | - | - | - | -
R35 | KL5151-0021 | Filter default | 0x0000 | 0dec | R/W | SEEROM/RAM
 | other types | reserved | - | - | - | -
R36 to R63 | reserved |  | - | - | - | -


Register description

Access from the user program [image] Register [image] Register description
Register description
R0: Filter register (KL5151-0021 only)
Workpiece lengths are only valid if they are longer than the lengths specified here (specified in increments).
R6: Diagnostic register
Is not used
R7: Command register
Is not used
R8: Terminal description
Register R8 contains the terminal identifier in hexadecimal coding.
KL5151-0000: 0x141F (5151dec)
KL5151-0023: 0x141F (5151dec)
KL5151-0050: 0x141F (5151dec)
KL5152-0000: 0x1420 (5152dec)
R9: Firmware version
Register R9 contains the firmware revision level of the terminal in hexadecimal coding, e.g. 0x3341. This is to be interpreted as an ASCII code:
- ASCII code 0x33 represents the digit 3
- ASCII code 0x41 represents the letter A
So the firmware version is 3A in this example.
R10: Shift register length
0x0228
R11: Number of signal channels
KL5151-0000: 0x0128 (296dec)
KL5151-0023: 0x0150 (336dec)
KL5151-0050: 0x0228 (552dec)
KL5152-0000: 0x0228 (552dec)
R12: Minimum data length
KL5151-0000: 0x2828 (10280dec)
KL5151-0023: 0x5050 (20560dec)
KL5151-0050: 0xA8A8 (43176dec)
KL5152-0000: 0xA8A8 (43176dec)
R13: Data type
Register R13 contains the data type of the Bus Terminal. 0x0006 represents a special function.
R15: Alignment register
The terminal in the Bus Coupler is set to a byte limit with the bits of the alignment register.
R16: Hardware version number
Register R16 contains the hardware revision level of the terminal in hexadecimal coding, e.g. 0x0000 (0dec).
R29: Terminal type - special identification
KL5151-0000: 0x0000 (0dec)
KL5151-0023: 0x0017 (23dec)
KL5151-0050: 0x0032 (50dec)
KL5152-0000: 0x0000 (0dec)
User register
The user registers of the terminal can be written by the user program in order to change the characteristics of the terminal at run-time.
R31: Code word register
▪
If you write values into the user registers without previously having entered the user code word (0x1235) in the code word register, these values are only stored in the RAM registers, but not in the EPROM registers and are therefore lost if the terminal is restarted.
▪
If you write values into the user registers and have previously entered the user code word (0x1235) in the code word register, these values are stored in the RAM registers and in the EPROM registers and are therefore retained if the terminal is restarted.
The code word is reset if the terminal is restarted.
R32: Feature register (KL5151-0000, KL5151-0050, KL5152-0000)
The feature register specifies a variety of properties for the terminal.
Bit | Feature | Value | Explanation | Default
R32.15 | OperationMode | 0bin | Encoder interface | 0bin
 |  | 1bin | One channel counter (32-bit up/down)
R32.14 | - | reserved |  | 0bin
... | ... | ... |  | ...
R32.8 | - | reserved |  | 0bin
R32.7 | - | reserved |  | KL5151-0000: 0bin KL5151-0021: 0bin KL5151-0050: 1bin KL5152-0000: 1bin
R32.6 | enCompact ProcessImage | 0bin | KL5151-0050, KL5152-0000: complete process image with status and control bytes KL5151-0000: complete process image with status and control byte | KL5151-0000: 0bin KL5151-0021: 0bin KL5151-0050: 1bin KL5152-0000: 1bin
 |  | 1bin | KL5151-0050, KL5152-0000: Compact process image without status byte but with control byte KL5151-0000: Compact process image without status byte and without control byte Useful operation of the KL5151-0000 with compact process image is not possible, since the control byte is required for the control of the counter and the latch!
R32.5 | enPosGateLock | 0bin | A positive level at the gate input does not lock the counter. | 0bin
 |  | 1bin | A positive level at the gate input locks the counter.
R32.4 | enNegGateLock | 0bin | A negative level at the gate input does not lock the counter. | 0bin
 |  | 1bin | A negative level at the gate input locks the counter.
R32.3 | - | reserved |  | 0bin
... | ... | ... |  | ...
R32.0 | - | reserved |  | 0bin
Note
Operation of KL5152-0000 (KL5151-0050) as one channel counter
Because for operation of KL5152-0000 (KL5151-0050) as a counter the A2 connector is used to enable the counter (gate), the operation as a two channel counter is not possible.
R32: Feature register (KL5151-0021)
The feature register specifies a variety of properties for the terminal.
Bit | Feature | Value | Explanation | Default
R32.15 | - | reserved |  | 0bin
R32.14 | B_MES_INV | 0bin | determine the positive edge first, then the negative | 0bin
 |  | 1bin | carry out an inverted measurement: i.e. determine the negative edge first, then the positive
R32.13 | - | reserved |  | 0bin
... | ... | ... |  | ...
R32.0 | - | reserved |  | 0bin
R35: Filter default (KL5151-0021 only)
The value stored here is entered after a reset of the terminal in register R0 (specified in increments).


Examples of Register Communication

Access from the user program [image] Register [image] Examples of Register Communication
Examples of Register Communication
The numbering of the bytes in the examples corresponds to the display without word alignment.
Additional information
•
Example 1: reading the firmware version from Register 9
•
Example 2: Writing to an user register


Example 1: reading the firmware version from Register 9

Access from the user program [image] Register [image] Examples of Register Communication [image] Example 1: reading the firmware version from Register 9
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 1001bin) | 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 1001bin.
▪
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.


Example 2: Writing to an user register

Access from the user program [image] Register [image] Examples of Register Communication [image] Example 2: Writing to an user register
Example 2: Writing to an user register
Note
Code word
In normal mode all user registers are read-only with the exception of Register 31. In order to deactivate 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 1111bin) | 0x12 | 0x35
Explanation:
▪
Bit 0.7 set means: Register communication switched on.
▪
Bit 0.6 set means: writing to the register.
▪
Bits 0.5 to 0.0 specify the register number 31 with 01 1111bin.
▪
The output data word (byte 1 and byte 2) contains the code word (0x1235) for deactivating write protection.
Input Data (answer of the bus terminal)
Byte 0: Status byte | Byte 1: DataIN1, high byte | Byte 2: DataIN1, low byte
0x9F (1001 1111bin) | 0xXX | 0xXX
Explanation:
▪
The terminal returns a value as a receipt in the status byte that differs only in bit 0.6 from the value of the control byte.
▪
The input data word (byte 1 and byte 2) is of no importance after the write access. Any values still displayed are invalid!
II. Read Register 31 (check the set code word)
Output Data
Byte 0: Control byte | Byte 1: DataOUT1, high byte | Byte 2: DataOUT1, low byte
0x9F (1001 1111bin) | 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 31 with 01 1111bin.
▪
The output data word (byte 1 and byte 2) has no meaning during read access.
Input Data (answer of the bus terminal)
Byte 0: Status byte | Byte 1: DataIN1, high byte | Byte 2: DataIN1, low byte
0x9F (1001 1111bin) | 0x12 | 0x35
Explanation:
▪
The terminal returns the value of the control byte as a receipt in the status byte.
▪
The terminal returns the current value of the code word register in the input data word (byte 1 and byte 2).
III. Write to Register 32 (change contents of the feature register)
Output data
Byte 0: Control byte | Byte 1: DataIN1, high byte | Byte 2: DataIN1, low byte
0xE0 (1110 0000bin) | 0x00 | 0x02
Explanation:
▪
Bit 0.7 set means: Register communication switched on.
▪
Bit 0.6 set means: writing to the register.
▪
Bits 0.5 to 0.0 indicate register number 32 with 10 0000bin.
▪
The output data word (byte 1 and byte 2) contains the new value for the feature register.
CAUTION
Observe the register description!
The value of 0x0002 given here is just an example!
The bits of the feature register change the properties of the terminal and have a different meaning, depending on the type of terminal. Refer to the description of the feature register of your terminal (chapter Register description) regarding the meaning of the individual bits before changing the values.
Input data (response from the Bus Terminal)
Byte 0: Status byte | Byte 1: DataIN1, high byte | Byte 2: DataIN1, low byte
0xA0 (1010 0000bin) | 0xXX | 0xXX
Explanation:
▪
The terminal returns a value as a receipt in the status byte that differs only in bit 0.6 from the value of the control byte.
▪
The input data word (byte 1 and byte 2) is of no importance after the write access. Any values still displayed are invalid!
IV. Read Register 32 (check changed feature register)
Output Data
Byte 0: Control byte | Byte 1: DataOUT1, high byte | Byte 2: DataOUT1, low byte
0xA0 (1010 0000bin) | 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 indicate register number 32 with 10 0000bin.
▪
The output data word (byte 1 and byte 2) has no meaning during read access.
Input Data (answer of the bus terminal)
Byte 0: Status byte | Byte 1: DataIN1, high byte | Byte 2: DataIN1, low byte
0xA0 (1010 0000bin) | 0x00 | 0x02
Explanation:
▪
The terminal returns the value of the control byte as a receipt in the status byte.
▪
The terminal returns the current value of the feature register in the input data word (byte 1 and byte 2).
V. Write Register 31 (reset code word)
Output Data
Byte 0: Control byte | Byte 1: DataOUT1, high byte | Byte 2: DataOUT1, low byte
0xDF (1101 1111bin) | 0x00 | 0x00
Explanation:
▪
Bit 0.7 set means: Register communication switched on.
▪
Bit 0.6 set means: writing to the register.
▪
Bits 0.5 to 0.0 specify the register number 31 with 01 1111bin.
▪
The output data word (byte 1 and byte 2) contains 0x0000 for reactivating write protection.
Input Data (answer of the bus terminal)
Byte 0: Status byte | Byte 1: DataIN1, high byte | Byte 2: DataIN1, low byte
0x9F (1001 1111bin) | 0xXX | 0xXX
Explanation:
▪
The terminal returns a value as a receipt in the status byte that differs only in bit 0.6 from the value of the control byte.
▪
The input data word (byte 1 and byte 2) is of no importance after the write access. Any values still displayed are invalid!


Appendix

Appendix
Appendix
Additional information
•
Support and Service


Support and Service

Appendix [image] Support and Service
Support and Service
Beckhoff and their partners around the world offer comprehensive support and service, making available fast and competent assistance with all questions related to Beckhoff products and system solutions.
Beckhoff's branch offices and representatives
Please contact your Beckhoff branch office or representative for local support and service on Beckhoff products!
The addresses of Beckhoff's branch offices and representatives round the world can be found on her internet pages:
http://www.beckhoff.com
You will also find further documentation for Beckhoff components there.
Beckhoff Headquarters
Beckhoff Automation GmbH & Co. KG
Huelshorstweg 20
33415 Verl
Germany
Phone: | +49(0)5246/963-0
Fax: | +49(0)5246/963-198
e-mail: | info@beckhoff.com
Beckhoff Support
Support offers you comprehensive technical assistance, helping you not only with the application of individual Beckhoff products, but also with other, wide-ranging services:
▪
support
▪
design, programming and commissioning of complex automation systems
▪
and extensive training program for Beckhoff system components
Hotline: | +49(0)5246/963-157
Fax: | +49(0)5246/963-9157
e-mail: | support@beckhoff.com
Beckhoff Service
The Beckhoff Service Center supports you in all matters of after-sales service:
▪
on-site service
▪
repair service
▪
spare parts service
▪
hotline service
Hotline: | +49(0)5246/963-460
Fax: | +49(0)5246/963-479
e-mail: | service@beckhoff.com