Notes on the documentation

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 following notes and explanations are followed when installing and commissioning these components.

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.
For that reason the documentation is not in every case checked for consistency with performance data, standards or other characteristics.
In the event that it contains technical or editorial errors, we retain the right to make alterations at any time and without warning.
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® and XFC® 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 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.

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.


Communication with Cross Point XM3 Card Reader

Beckhoff Knowledge Base: Communication with Cross Point XM3 Card Reader

Introduction

In this example it is shown how to establish a communication between TwinCAT and the Cross Point XM3 Card Reader (www.crosspoint.nl).
It contains just some basic funtions, that are necessary to integrate the XM3 Card Reader into an application.

TwinCAT cyclically queries the card reader for a card. If a card is recognized, TwinCAT checkes the validity of the card ID. Accordingly a LED at the card reader lights up or a signal-peep can be heard. The possible opening of a door could be realized with the help of a digital output terminal (e.g. KL2622).

Prerequisites

  • Microsoft Windows 2000/XP/2003/CE
  • TwinCAT PLC (version 2.10 or higher)
  • TwinCAT PLC Serial Communication Library
  • BC9000 with KL6021, KL9512 and KL9010.
  • Knowledge in programming with TwinCAT PLC-Control
  • Cross Point XM3 Card Reader

Connecting the card reader

Connect your XM3 Card Reader as shown in the following graphic:

The KL9512 is used to provide a 12V DC power suply for the XM3 Card Reader.

Adjustment of the terminals

Please set up the KL6021 terminal (with the help of the KS2000 software or register communication) as shown below:

  • 5 mapped data bytes
  • half duplex
  • 9600 baud
  • 8 data bits
  • no parity
  • 1 stop bit

Example for Communication

The following example is related to the sample application "Cross Point Sample.zip". The XM3 Card Reader has in this case the address 1:

Function block | XM3 command | Request to XM3 (in HEX) | Response from XM3 (in HEX) | Signification
FB_XM3_SetLED | CM1 | 01 04 02 F8 | FE FE FF | Green LED on
FB_XM3_SetLED | CM1 | 01 04 04 FE | FE FE FF | Red LED on
FB_XM3_SetLED | CM1 | 01 04 00 FA | FE FE FF | All LEDs off
FB_XM3_SetBeep | CM2 | 01 05 02 F9 | FE FE FF | Peep on
FB_XM3_SetBeep | CM2 | 01 05 08 F3 | FE FE FF | Peep off
FB_XM3_SetBeep | CM2 | 01 05 00 FB | FE FE FF | Muting all sounds
FB_XM3_GetCardId | EC3 | 01 0B 03 9A 01 00 6D | FE FB 08 1A 00 00 00 00 00 00 00 E8 | Querying for a card (in this case: no card recognized)
FB_XM3_GetCardId | EC3 | 01 0B 03 9A 01 00 6D | FE FB 08 1A 00 88 52 00 00 00 80 B2 | Querying for a card (in this case: card recognized)
FB_XM3_GetCardId | EN2 | 01 03 FD | FE FC D0 00 52 88 F7 01 01 FF FE FE FF | Reading out the card ID (in this case: 00 52 88)

Note: More information about the RS485-protocol of the XM3 Card Reader can be obtained from Cross Point (www.crosspoint.nl).

Sample application

The creation of the PLC program is recorded in the following sample:

Cross Point Sample.zip

Note: This sample is created for the busterminal controller series BC.