Copyright 2008 Unitech Electronics Co., Ltd. All rights reserved. Unitech is a registered trademark of Unitech Electronics Co., Ltd.
40
Copyright 2008 Unitech Electronics Co., Ltd. All rights reserved. Unitech is a registered trademark of Unitech Electronics Co., Ltd.
41
are summarized in the tables below. The general syntax for commands is as follows:
Command String – General Syntax
<ESC><’M’><n>< n> Track #CR
Command String - Example
<ESC><’M’> ‘9’ ‘ 9’ 1 CR
Table B.1 – Magnetic Card Read Command Strings – general form
The ESC-M command turns on the power to the MC Reader
•
The next two bytes, <nn> are used to set the MC reader’s timer. “01” through “99”
•
are valid timer settings and “00” disables the timer.
The printer aborts and transmits the time-out error message, if the operator fails to
•
swipe a card within the time period set by the host application.
On timeout printer aborts the swipe process, transmits timeout error message and
•
turns off the <READING> LED.
A good magnetic card swipe automatically terminates the read process.
•
Magnetic Card Command String
Description
ESC – M - nn - 1 – CR (CR = Enter)
Read Track1 only
ESC – M - nn - 2 – CR
Read Track2 only
ESC – M - nn - 3 – CR
Read Track3 only
ESC – M - nn - 4 – CR
Read Track1 and Track2 simultaneously
ESC – M - nn - 5 – CR
Read Track2 and Track3 simultaneously
ESC – M - nn - 6 – CR
Read Tracks 1,2 and 3 simultaneously
ESC – C
Cancel MC Read process
nn = ASCII “01” through “99” seconds
nn = “00” disables the MC reader timer
Table B.2 – Magnetic Card Read Command Strings - Details
B.3.0 Magnetic Card Data Output Format
The track data retrieved from a magnetic card is transmitted to the host in
•
ISO7811 ASCII format as summarized in the table below.
The first four characters (“%/1/”) flag the track number, the track data follows the
•
flag string, terminated with ‘?’-CR-LF.
‘%;+’ are the track start sentinel characters, While ‘?’ is the end of track sentinel
•
character.
If no data is available for a track that data field will be empty. If an Error is
•
encountered on any track a single ‘E’ will be the output for that tracks data field.
Track1
Track 2
Track 3
%/1/
Data
?CRLF
;/2/
Data
?CRLF
+/3/
Data
?CRLF
Table B.3 - ISO 7811 ASCII Format
B.4.0 Magnetic Card Read Error Messages
The characters <%> and <E> preface all error messages. Following these two
characters is a comma, the error number in ASCII (01 through 99), another comma,
English description of the error encountered and finally CR-LF terminating the <Error
Message> string. The syntax is as follows:
Error Message ( General Form) <%><E>, nn , Error text in ASCII, <CR> <LF>
Table B.4 – Error Message – General Form
Where nn is error number encountered. The printer may transmit Four (4) types of
Read Error messages. The following messages terminated with CR-LF are returned
by the firmware:
Error #
Error Message Transmitted
05
Time-out Expired
07
Invalid Track Number
08
Unsupported Track Selected
09
Cancel Request
Table B.5 – Error Message – Specific Examples
B.5.0 Interfacing to the Magnetic Card Reader
This section details the software steps required to access the MC reader from a
•