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.

Communication with Cross Point XM3 Card Reader 1:

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

Connecting the card reader

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

Communication with Cross Point XM3 Card Reader 2:

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:

Communication with Cross Point XM3 Card Reader 3: Communication with Cross Point XM3 Card Reader 4:

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.