+ All Categories
Home > Documents > Datacard CE Series Instant Issuance System

Datacard CE Series Instant Issuance System

Date post: 22-Feb-2022
Category:
Upload: others
View: 18 times
Download: 0 times
Share this document with a friend
82
Datacard ® CE Series Instant Issuance System CPX Protocol and Setup Manual March 2014 Part No. 527283-001 Rev. C
Transcript
Page 1: Datacard CE Series Instant Issuance System

Datacard® CE Series™

Instant Issuance SystemCPX Protocol and Setup Manual

March 2014

Part No. 527283-001 Rev. C

Page 2: Datacard CE Series Instant Issuance System

NoticePlease do not attempt to operate or repair this equipment without adequate training. Any use, operation, or repair you perform that is not in accordance with the information contained in this documentation is at your own risk.

Proprietary NoticeAll drawings and information herein are the property of DataCard Corporation. All unauthorized use and reproduction is prohibited.

Trademark AcknowledgmentsDatacard is a registered trademark and service mark of DataCard Corporation in the United States and other countries.

CE System is a trademark of DataCard Corporation.

Windows is a registered trademark of Microsoft Corporation.

All other product names are the property of their respective owners.

Datacard Group11111 Bren Road WestMinnetonka, MN 55343-9015Phone: 952-933-1223Fax: 952-933-7971www.datacard.com

© 2012–2014 DataCard Corporation. All rights reserved.Printed in the United States of America.

ii

Page 3: Datacard CE Series Instant Issuance System

Revision Log CE Series CPX Protocol and Setup Guide

Revision Date Description of Changes

A June 2012 First release of this document

B January 2013 General updates

C March 2014 Updates for new features and font support

iii

Page 4: Datacard CE Series Instant Issuance System

iv

Page 5: Datacard CE Series Instant Issuance System

Contents

Chapter 1: Introduction ____________________________________________________________ 1Introduction to This Manual _____________________________________________________ 1

Intended Audience ________________________________________________________ 1Use of This Manual __________________________________________________________ 1

Error and Status Messages ______________________________________________________ 2Definitions, Acronyms, and Abbreviations _______________________________________ 3

Chapter 2: Protocol and Data Format _______________________________________________ 5CPX Data Format/Protocol______________________________________________________ 5ENQ/NAK Protocol _____________________________________________________________ 5Communications Data Format __________________________________________________ 8

Changing Control Codes __________________________________________________ 12Formatting Embossing Line Location Commands ____________________________ 13

Example_______________________________________________________________ 13Inverted MasterCard Font—#FC8# _____________________________________ 15

Formatting Data Blocks ________________________________________________________ 15Embossing Only_______________________________________________________________ 16Embossing and OCR Print Data Format _________________________________________ 16Embossing with Magnetic Stripe Data __________________________________________ 17Formatting Extended Line Locations ____________________________________________ 17

Sample Template Block ____________________________________________________ 18Sample Data Block ________________________________________________________ 18

Single-Wire Smart Card ________________________________________________________ 19Smart Card Application Protocol Data Unit _____________________________ 19APDU Message Command-Response Pair _______________________________ 19Smart Card Single-Wire Solution Using CPX Protocol ______________________ 20

Commands___________________________________________________________________ 21Data Match Compare (#CMP#) ___________________________________________ 21Counters (#CNT#) _________________________________________________________ 22Current (#CUR#) __________________________________________________________ 22Starting Data Block (#DCC#) ______________________________________________ 22Formatting Embossing Line Location Data (#DCL#) _________________________ 22DES Mode Status and Selection (#DES#) ____________________________________ 23

Command Structure ___________________________________________________ 23Output Command Selection ___________________________________________ 23Return Status Values ___________________________________________________ 23Example_______________________________________________________________ 24

Embossing Data Format (#EMB#)___________________________________________ 24Emboss and Encoding (#ENC#) ____________________________________________ 25Ending Data Block (#END#)________________________________________________ 25Return Error Status (#ERR#) _________________________________________________ 26Font Changing Commands (#FC1# to #FC11#)_____________________________ 26Smart Card Position (#FED#X) ______________________________________________ 27Throat Gap (#GAP#) ______________________________________________________ 27

v

Page 6: Datacard CE Series Instant Issuance System

Communications Data Format (#GRD#0/#GTW#0) _________________________ 28Hopper Selection (#HOP#)_________________________________________________ 28Key Lock Open (#KEY#) ___________________________________________________ 28Message Wait (#MSG#) ___________________________________________________ 29OCR Indent (#OCR#)______________________________________________________ 29Reject Card (#REJ#)_______________________________________________________ 29Reset the System (#RST#) __________________________________________________ 29Retry Magstripe Counter (#RTE#) ___________________________________________ 30Secure Data Block (#SDA#)________________________________________________ 30Secure Options and Keys (#SEC#)__________________________________________ 31

Command Structure ___________________________________________________ 31Reset DES Key (Non-Secured Mode) ____________________________________ 31

Secure Random Key Set (#SKE#) ___________________________________________ 32Secure Read Stripe Data (#SRK#) __________________________________________ 33Get System Information (#SYS#) ____________________________________________ 33Turn Topper Off (#TOF#) ___________________________________________________ 34Turn Topper On (#TON#)___________________________________________________ 34Read Magnetic Stripe Track (#TRK#)________________________________________ 35Return CPX Version (#VER#)________________________________________________ 35Write Only Once Hico Stripe (#WOH#)______________________________________ 36

System Option Controls________________________________________________________ 36Topping Area _________________________________________________________________ 37Financial Card Passwords _____________________________________________________ 37

Send a Financial Password _________________________________________________ 38Set a New Financial Password ______________________________________________ 39

Encryption Option_____________________________________________________________ 40Security ______________________________________________________________________ 41

Triple DES with CBC ________________________________________________________ 41Level (1) Key Management ________________________________________________ 42Level (2) Key Management (Future Option) _________________________________ 42

Chapter 3: Electrical Interface Description _________________________________________ 43CPX Interface_________________________________________________________________ 43

LAN Support Hardware ____________________________________________________ 43LAN Software Usage _______________________________________________________ 43

Precidia Ethernet-to-Serial Port Setup ___________________________________________ 44

Appendix A: Sample Line Traces ________________________________________________ A-1CPX Sample Line Traces _____________________________________________________ A-1Send Line Locations _________________________________________________________ A-1Send Encode Data Only _____________________________________________________ A-1Emboss Data________________________________________________________________ A-2CPX+ Read Internal Counters ________________________________________________ A-2

Read CE System Counters ________________________________________________ A-2Returned from CE System _________________________________________________ A-2

vi

Page 7: Datacard CE Series Instant Issuance System

CPX Read Track Data from Magnetic Stripe___________________________________ A-2Feed Card into CE System ________________________________________________ A-2Read and Return Track Command ________________________________________ A-3Return Track (1-2) on Card ________________________________________________ A-3Reject the Card __________________________________________________________ A-3Financial Password _______________________________________________________ A-3

CPX Example Network Test Program__________________________________________ A-3

Appendix B: Sample C Language Drivers _________________________________________ B-1Sample Listings for CPX Protocol ______________________________________________ B-1Sample Card Data ___________________________________________________________ B-1

Appendix C: Hexadecimal/Decimal/ASCII Conversion ___________________________ C-1

Appendix D: Testing and CPX Application________________________________________ D-1Testing Tools ________________________________________________________________ D-1

CPX Simulator ____________________________________________________________ D-1CPX Demo Program to CE System _________________________________________ D-2Debugging CPX Using the Audit Logs ______________________________________ D-3CPX.cfg Settings File for CPX Application___________________________________ D-4

Option Settings to Control CPX _______________________________________________ D-4

Appendix E: Tactile Identifier Mark Conversion ____________________________________ E-1

vii

Page 8: Datacard CE Series Instant Issuance System

viii

Page 9: Datacard CE Series Instant Issuance System

Chapter 1: Introduction

This chapter introduces this manual and terms used for communications 

on the CE Series Instant Issuance System.

Introduction to This ManualThis manual is intended to provide basic guidelines for communicating directly with a CE 

Series Instant Issuance System configured with standard Ethernet or an optional, external 

RS‐232C protocol converter communications interface.

For a CE System to produce cards in an online environment, it and the host computer 

must be able to communicate with each other. For this communication to take place, 

three elements are necessary:

• The CE System and the host computer must be physically connected, usually by 

means of a wire or cable from the host computer to the interface connection on the 

CE System.

• The CE System and the host computer must be able to communicate using a common 

protocol. A protocol is a method by which the host and the CE System agree when to 

communicate. The CE System must inform the host when it is not ready to accept 

data.

• The host computer must send data to the CE System using the correct data format. 

The data format is the set of commands understood by the CE System through which 

it performs the necessary functions for card processing.

Intended AudienceThis manual is intended for use by customers who need basic guidelines for 

communicating from a host computer to a Datacard CE System using the CPX data 

format.

Use of This ManualThis manual describes the critical components of communication with the CE System. 

Each of the elements is treated separately, but all are required for successful 

communication and processing of embossing data. 

CE Instant Issuance System CPX Protocol and Setup Manual Page 1

Page 10: Datacard CE Series Instant Issuance System

This manual contains the following chapters to help you understand data formatting:

• Chapter 1: Introduction, provides general information about this manual. It also 

contains a list of definitions, acronyms, and abbreviations used throughout the 

manual.

• Chapter 2: Protocol and Data Format, contains information about functions and 

features, and includes figures that demonstrate data flow between the host 

computer and a CE System.

• Chapter 3: Electrical Interface Description, contains information about interface 

requirements for connecting a PC to a CE System.

• Appendix A: Sample Line Traces, provides common examples of code.

• Appendix B: Sample C Language Drivers, contains sample listings written in C 

language.

• Appendix C: Hexadecimal/Decimal/ASCII Conversion, contains a hexadecimal/

decimal/ASCII conversion chart.

• Appendix D: Testing and CPX Application, describes testing tools and the control 

settings used for CPX.

• Appendix E: Tactile Identifier Mark Conversion, provides a conversion chart for 

sending Braille (Tactile Identification Mark) data to the printer.

The Datacard CE System recognizes data sent in 8‐bit extended ASCII code. If the user's 

host device sends data in another coding format (for example, EBCDIC), you must use a 

data communications adapter between the host device and the CE System to convert the 

host data to ASCII. For a direct link between the host and the CE System, the host must 

generate the proper ASCII codes in CPX format.

Error and Status MessagesRefer to your printer’s User’s Guide for a discussion of the error and status messages that 

display on the printer’s front LCD panel.

Page 2 Introduction

Page 11: Datacard CE Series Instant Issuance System

Definitions, Acronyms, and AbbreviationsThe following definitions, acronyms, and abbreviations help in understanding this manual 

and the use of the protocol.

Term Definition

ACK (06 hex) A control character sent to ACKnowledge that a transmission block has been received or that the receiver is now ready to receive data.

ANSI American National Standards Institute; the principal standards development body in the USA.

ASCII American Standard Code for Information Interchange, pronounced "asky." A seven‐bit plus parity code established by ANSI to achieve compatibility between data services.

Binary Refers to a numbering system in which the base is two and the digits 0 and 1 are used.

Bit Contraction of Binary Digit, which is the smallest unit of information in a binary computer system.

BPS Bits Per Second, a measure of the data transmission rate in a communications system.

CAN (18 hex) Cancel Command.

CP8 RTS modem‐controlled protocol for a CP8 chip card application only.

CPX Datacard proprietary protocol.

Data format The set of commands sent to the system, which result in card processing functions

EIA Electronics Industries Association. A standards organization in the USA, specializing in the electrical and functional characteristics of electronic equipment.

ENQ (05 hex) Enquiry (Status Poll).

EOT (04 hex) End Of Transmission. An ASCII transmission control code used to indicate the end of a transmission. This is also used in some of the DCC embossing protocols.

ETX (03 hex) End of Text.

Full‐Duplex Simultaneous, two‐way, independent transmission in both directions.

Half‐Duplex Transmission in either direction, but not simultaneously.

Handshaking Exchange of predetermined signals between two devices to establish a connection. Usually part of a communications protocol.

Host Port Ethernet port for Embossers.

NAK (15 hex) Negative Acknowledge (also busy status).

Pound‐Pound Datacard communications data format that supports the standard protocols but has no support for error status. Pound‐Pound allows standard connections to the host program without changes and has support for external black box (327x , etc.)‐type interfaces. (Pound‐Pound gets its name from the unique commands sent to the embosser: for example, #EMB# #DCC#, #ENC#.) 

Protocol A formal set of rules used between two communicating systems to ensure the orderly exchange of data. Examples include: XonXoff, Enq/Nak (polling), and modem control.

CE Instant Issuance System CPX Protocol and Setup Manual Page 3

Page 12: Datacard CE Series Instant Issuance System

RS‐232C Recommended Standard number 232 of the EIA for serial communications between computing devices.

Serial A transmission mode in which information bits are sent sequentially on a single data channel.

Simplex Data transmission in one direction only.

SOH (01 hex) Start Of Header. An ASCII transmission control code used to indicate the beginning of a heading of an information message.

STX (02 hex) Start of text character.

SUB (1A hex) Sub control character used with XON‐XOFF enhanced protocol to signal an embossing error.

Throttle A method used to control the amount of data received or the starting and stopping of transmissions between two computer devices. This is the same as pacing.

Term Definition

Page 4 Introduction

Page 13: Datacard CE Series Instant Issuance System

Chapter 2: Protocol and Data Format

This chapter describes the data communications protocol and data 

format for the Datacard CE Instant Issuance System.

CPX Data Format/ProtocolThe CPX definition includes both a data format and a data protocol. The Pound‐Pound 

format defines the specific set of commands used to personalize the card. For example: 

• Emboss

• Indent

• Read and write to a magnetic stripe

• Match data on a magnetic stripe

• Read and write to a smart card

• Pause message for a single card

A protocol normally is used to indicate the status of the card system to the host—busy or 

not busy. CPX uses the Enq/Nak protocol described below. In addition to a standard 

response to poll, CPX also is capable of returning a one‐byte response to the host 

indicating the status of card processing. This data is used by the host application.

ENQ/NAK ProtocolThe user can poll the CE System with an ENQ character at a maximum rate/poll of two 

seconds. If the poll rate is exceeded, embossing errors may occur. Table 2‐1, Status Codes 

Returned for Status Poll (ENQ‐05h), shows the status codes returned by a Poll (ENQ‐05h) 

command. The command returns a C (card complete) status when a good card has 

passed into the output hopper without any errors. Line location commands, or any other 

type of commands that do not make a card, do not return a C. The next poll returns an A 

(ready for next card) status.

CPX protocol does not remake cards if an error occurs. The host must resend 

the data to remake the card.

A Hexadecimal/Decimal/ASCII Conversion chart is provided in Appendix C to 

help in developing your application.

CE Instant Issuance System CPX Protocol and Setup Manual Page 5

Page 14: Datacard CE Series Instant Issuance System

Table 2-1: Status Codes Returned for Status Poll (ENQ-05h)

ASCII Condition Card Status CE System Error Code

A Command Acknowledge Ready for Data Command. No changes.

B X or Y Stepper Error Card rejected (attempt). 127

b Waiting for Operator Keypad Entry

No card processed. 120,123,124

C Card Complete A good card was embossed and is in the output hopper.

No changes (card was placed in the output hopper).

D Wheel Stepper Error Card rejected. 137

E Topper Foil Break No card processed. 144

G Card Feed Error Card is in input hopper or magnetic stripe module.

102,111,128,130

H Magnetic Stripe Error Card rejected. 105,106,107,108

I Printer Error Printer error 109,110,118,119

J Reject Stacker Full No card processed. 133

K Output Stacker Full No card processed. 132

L Memory Failure Memory Error 103,104,121

M Interlock Open Card processing stops. Hardware reset issued, which clears card when cover is closed.

113,114,139,141,142,150,151

N Topper Jam  Card jammed in Topper module or topper temperature failure. Operator assistance required.

129

O Stacker Error Card position unknown. May be in output hopper or inside the machine.

131

P System Error No card processed. 125,140,149

Q OCR Ribbon Not in Position Card rejected. 135,136,138

R Embossing Limits Exceeded No card processed. 126

T Comm Failure Transmission Error

No card processed. Default for all not listed errors.

U Comm Failure Data Format Error

No card processed. 100,101,116,117,122

V Comm Failure Buffer Over‐run Error

No card processed.

W Pre‐encode read Error Card is inside magnetic stripe module.

Page 6 Protocol and Data Format

Page 15: Datacard CE Series Instant Issuance System

Figure 2‐1 shows the communication control for host systems, and the error code that is 

returned when decoded from the CE System.

The CPX system has the following characteristics for a host polling the CE System with an 

ENQ Poll command.

• NAK status is returned when the CE System is busy.

• No status is returned unless a Poll (ENQ) is received.

• The CAN power‐up reset control is ignored.

• Maximum data block size is 2K.

• Block timeout is 20 seconds from start of first text character until the end of the text 

is found.

• The system allows 20‐seconds between the start of text character (#) and the end of 

all data character (@) before a Comm Transmit error is displayed.

X Pre‐encode data match Error Card is inside magnetic stripe module.

Y Topper Error Topper card failure. 143,145,146,147,148

Z Input Hopper Empty No card processed. 112

NAK Busy Making Card  CE System Not Ready.

ASCII Condition Card Status CE System Error Code

CE Instant Issuance System CPX Protocol and Setup Manual Page 7

Page 16: Datacard CE Series Instant Issuance System

Figure 2-1: Normal Communications Protocol (ENQ) Status Messages (CPX)

Communications Data FormatPound‐Pound (##) Format: The following data format information applies to the 

Datacard proprietary CE System command set.

The syntax for the pound‐pound format is a three‐character mnemonic surrounded by a 

pound (#) symbol. The end of transmission is signaled with the "@" or End of All Data 

Code. Quotation marks (") are used to designate the end of line. These control codes 

(#, @ and ") may be changed. Pound‐pound format uses ASCII printable characters to 

communicate to a CE System. Carriage returns can be inserted into the data block with 

no effect. This form is highly desirable in host systems that cannot handle control codes. 

The CE System searches for the first pound (#) escape code to signal the start of data 

(STX). It continues to receive data until the end (@) character is received. 

Event CE System « Host Comments

CE System ready to receive data

DTR/RTS ON

Host sends (ENQ status) ENQ

CE System sends ready status A CE System ready. Not busy

Host sends emboss data command

#EMB#

Host sends (ENQ status) ENQ Host polls CE System until not busy status.

CE System sends not ready status

NAK

Host sends (ENQ status) ENQ

CE System sends not ready status

NAK

Host sends (ENQ status) ENQ

CE System sends card complete

C Card is stacked.

Host sends (ENQ status) ENQ

CE System sends ready status A Ready for next card.

Page 8 Protocol and Data Format

Page 17: Datacard CE Series Instant Issuance System

The CE System acknowledges only one data block at a time (no spooling of records within 

a data block is supported).

Table 2‐2, Data Format Commands, lists all the commands that are used by the Pound‐

Pound format to make a card. Refer to “Commands” on page 21 for descriptions and 

examples of the commands.

Table 2-2: Data Format Commands

Previous Datacard printers (such as 150i, 280, 310E, 450, and SE48) have 

different features and options. The CPX Pound‐Pound data format command 

set is not identical for all models. Consequently, if you have applications 

written for other Datacard systems, they may require changes for use with the 

CE System.

Code Description

" End of line code. (You can change this character; refer to “Changing Control Codes” on page 12.)

# Escape code. (You can change this character; refer to “Changing Control Codes” on page 12.)

#CMP# Automatic compare of magnetic stripe data before embossing.

#CNT# Returns CE System internal counters.

#CUR# DCJ option to select unique current track for multiple‐stripe data tracks. The CE System ignores this command.

#DCC# Device Control: Card data follows.

#DCL# Device Control: Line Locations data follows. Code is allowed in line locations only.

#DES# DES mode setup and status.

#EMB# Emboss data follows.

#ENC# Encode data follows (magnetic stripe).

#END# End of data block. Ignore all subsequent data until end of all data code.

#ERR# Returns expanded data regarding an error condition displayed on the CE System display.

#FC1# Change to font 1 (Emboss Standard Gothic, front, 10 characters per inch). Code is allowed in line locations block only.

#FC2# Change to font 2 (Emboss Farrington 7B, front, 7 characters per inch). Code is allowed in line locations block only.

#FC3# Change to font 3 (Indent OCRB, back, 10 characters per inch). Code is allowed in line locations block only.

#FC4# Change to font 4 (Indent MasterCard slanted, back, OCR 14 characters per inch).

CE Instant Issuance System CPX Protocol and Setup Manual Page 9

Page 18: Datacard CE Series Instant Issuance System

#FC5# Change to font 5 (Indent OCRB Size IV, front, 7 characters per inch).

#FC6# Change to font 6 (Indent MasterCard Slanted, front, 14 characters per inch). 

#FC7# Change to font 7 (Indent OCRB, front, 10 characters per inch).

#FC8# Change to font 8 (Indent MasterCard Inverted, back, 7 characters per inch).

#FC9 Change to font 9 (Indent Helvetica, front, 14 characters per inch, white ribbon). 

#FC10# Change to font 10 (Indent Helvetica, front, 14 characters per inch, black ribbon)

#FC11# Change to font 11 (Tactile Identifier Mark)

#FED#X Feed card and transported to module X (0=stripe, 1=front chip, 2=back chip). If X is missing, the default is 0.

#GAP# The CE System ignores this command.

#GRD#0 Selects data and Template (0).

#GTW#0 Template write (0). 

#HOP# Select Hopper No. 1 to 6. This applies to a system with the multi‐hopper option.

#KEY# Activates the CE System front panel cover solenoid.

#MSG# Outputs message to LCD and waits for a key.

#OCR# OCR indent data follows. This command is not used with the CE System; refer to #FC3# above.

#REJ# Reject card.

#RST# Reset the system and check for Out of Cards or Foil.

#RTE# Retries Counter Select for magnetic stripe.

#SDA# DES encrypted secure data block follows.

#SEC# Secure options and DES encryption keys follows.

#SKE# Secure random key set (future option, not currently available on CE Systems).

#SRK# Secure read stripe data.

#SYS# Returns software versions and VPD data.

#TOF# Turns topping OFF.

#TON# Turns topping ON. (If topping is ON, must fall in acceptable topping area.)

#TRK# Reads magnetic stripe data and return to the host.

#VER# Returns the CPX model number, protocol, software number and revision.

#WOH#  Write Only Once Hico stripe flag. The CE System ignores this command (150i only).

((( Start of reprogramming code sequence. (Refer to “Changing Control Codes” on page 12.) This code cannot be sent as embossing data.

Code Description

Page 10 Protocol and Data Format

Page 19: Datacard CE Series Instant Issuance System

(CAN) Control code to reset CE System after a message prompt.

))) End of reprogramming code sequence (Refer to “Changing Control Codes” on page 12.) This code cannot be sent as embossing data.

@ End of all data code. The system requires one to be present at end of transmission. (You can change this character; refer to “Changing Control Codes” on page 12.)

~0 Sends financial password.

~1 Sets financial password.

Block ID A six‐digit code, which may be used at the beginning of a data block to aid in identifying the block in the event an error occurs and the block must be recalled.

C00yx Magstripe Current Select/Topper Table Select. y=Magstripe current, 0=default, 1=25 MA Low Co., 5=150MA High Co. x=Topper Table Select (0=off, [1‐8]=on color select)Note: If current is set to 2, 3, or 4, High Co current is used. The CE System ignores the current selection.

CR, LF, Null PAD characters, 00, 0D, 0A.

Sp Space code (20 ASCII).

Not all the functions defined in Table 2‐2, Data Format Commands, are available 

with every Datacard product. The list may be expanded as necessary for some 

systems, for control of special options and new features.

Code Description

CE Instant Issuance System CPX Protocol and Setup Manual Page 11

Page 20: Datacard CE Series Instant Issuance System

Changing Control CodesYou can define control codes so users who cannot send the specified default characters 

for these codes may select others to perform the required functions.

To change a control code, transmit the following code sequence:

(((ABC)))AAAAAA

In this example, ((( is the start of the sequence (28 hex) and ))) is the end of the sequence 

(29 hex). The A character represents the end of all data code (normally the end 

character—@—must appear six times at the end of the data). The B character represents 

the end of the line (normally "). The C character represents the escape code. Normally 

the pound character (#) is used. When changing these codes, almost any ASCII characters 

may replace them.

The end of data code (@), end of line code (") and the escape code (#) all are unique and 

must not be defined with any of the following illegal control code characters:

• Letters A through Z or a through z*

• Numbers 0 through 9

• Parentheses “(“ or “)”

• Apostrophe “ ' “

• Space

* Valid Control Codes to use in hexadecimal are: 01, 02, 03, 04, 07, 08, 09, 0B, 0C, 12, 14, 

16, 17, 19, 1A, 1C, 1D, and 1E.

Undefined CE System operations may result on some CE System models if the 

above codes are changed as a routine task in the user's application program. 

The CE System defaults to original codes if power is lost.

Page 12 Protocol and Data Format

Page 21: Datacard CE Series Instant Issuance System

Formatting Embossing Line Location CommandsLine locations tell the system the parameters used to emboss the card—the horizontal 

and vertical position of embossing, the card size, and the font to be used for each line 

(7 CPI, 10 CPI, Indent, etc.) Line location data needs to be transmitted to the CE System 

only once when initially setting up or when changing card formats. The system retains 

the line location information in its RAM memory. It remains intact until the card format is 

changed on power up.

Example

An example of a line location data block format is shown in Figure 2‐2, “Line Locations 

Data Block”. This example shows the location of 3 lines of characters on a CR80 card 

(specified by the 08 card size code in the example). Line 1 is to be OCR characters (7 per 

inch), and lines 2 and 3 are embossed alphanumeric characters (10 per inch). As in all 

location data blocks, the units used are thousands of an inch (0.001). The codes are 

explained in “Data Format Commands” on page 9. Figure 2‐5, “Card with Embossed Data” 

on page 24, illustrates where these lines would appear on the finished card.

* The CE System recognizes only the data between the first pound (#) character and the ending at (@) character in a given data string.

** This code cannot be sent as embossing data.

*** Enter an 8‐byte character for OCR Indent MasterCard option to select dual margins. The first 4 bytes are the emboss margin and the last 4 bytes are the indent margin.

Figure 2-2: Line Locations Data Block

Optional Block ID* Line Location Data Follows Card Size**0 0 1 0 3 1 # D C L # 0 8

Left Margin*** Line 1 Font Change Line Location 10 4 0 0 Sp 1 # F C 2 # 0 9 5 0

Line 2 Font Change Line Location 2 Line 3 Sp 2 # F C 1 # 0 6 7 8 Sp 3

Font Change Line Location 3 End of Data Block# F C 1 # 0 4 3 0 # E N D #

End of All Data@ @ @ @ @ @

CE Instant Issuance System CPX Protocol and Setup Manual Page 13

Page 22: Datacard CE Series Instant Issuance System

The following describes the line locations data block shown in Figure 2‐2.

• Optional Block ID: This 6‐digit code allows the host system to locate the data block. It 

is not used by the embosser.

• #DCL#: This field identifies this block of data as a line location block.

• 08: This field defines the card size as CR80 (2.125 X 3.375 inches).

• 0400: This field defines the left margin of all the lines on the card. This is measured in 

thousands of an inch, measured from the left edge of the card to the middle of the 

first character on a line (0400 = .400 inches).

• SP: Space character (20 hex).

Line 1 characteristics:

• #FC2#: Defines the font on line one (Font Change 2). Font 1 normally is defined 

as 10 CPI Standard Gothic embossing type. Font 2 normally is defined as 7 CPI 

Farrington 7B embossing type. It is numeric only and appears as the account 

number on most credit cards. 

• 0950: Defines the vertical position of line one. This is measured in thousands of 

an inch, measured from the bottom edge of the card to the middle of the 

character on this particular line (0950 = 0.950 inches).

• SP: Space character (20 hex).

Line 2 characteristics:

• #FC1#: Line two is defined as Font 1.

• 0678: Defines the vertical position of line two (0678 =0.678 inches).

• SP: Space character (20 hex).

Line 3 characteristics:

• #FC1#: Line three is defined as Font 1.

• 0430: Defines the vertical position of line three (0430 = 0.430 inches).

• #END#: Defines the end of the data block.

• @@@@@@: Pad characters. Inserting 6 @ (40 hex) characters at the end of 

each data block allows the CE System time to respond to the host that the block 

of data just received is either a good block (A) or a not good block (NAK).

Line numbers must be in sequential order.

Page 14 Protocol and Data Format

Page 23: Datacard CE Series Instant Issuance System

Inverted MasterCard Font—#FC8#

The margins and line locations are set as text viewed on the card. To set up the card, turn 

it around and set up the horizontal and vertical line locations.

Formatting Data BlocksCard data is formatted differently for each process to be performed by the CE System. 

The following examples show the following types of card operation: embossing only, 

embossing with OCR indent printing, and embossing with magnetic stripe encoding. Each 

example includes coding, an explanation of any codes not yet described, and an 

illustration of what the finished card looks like.

In each example, it is assumed that the line locations are those described in Figure 2‐2, 

“Line Locations Data Block” on page 13. Line locations should be transmitted to the CE 

System before embossing data is sent.

CE Instant Issuance System CPX Protocol and Setup Manual Page 15

Page 24: Datacard CE Series Instant Issuance System

Embossing OnlyThe following data string shows line location coding for embossing only.

#DCL#080400 1#FC2#1085 2#FC1#0678 3#FC1#0430#END#@@@@@@

The following shows the card data coding.

#DCC##EMB#019632”MARY L. RITGER”ROOM 395#END#@@@@@@

Embossing and OCR Print Data FormatIf your CE System is equipped with the optional OCR Indent module, this example 

illustrates the additional codes required for adding a line of OCR indent print characters 

on the reverse side of the card (indent on the front of the card is done the same way). 

Additional line locations also must be formatted and sent to the CE System prior to the 

card data. The emboss data remains the same as in the first example. The following data 

string shows line location coding. Figure 2‐3, “Card with Embossing and OCR Indent” 

shows the final card. The codes used are described in Table 2‐2, Data Format Commands.

#DCL#080400 1#FC2#0843 2#FC1#0678 3#FC1#0430 4#FC3#1000#END#@@@@@@

The following shows the card data coding.

#DCC##EMB#019632”MARY L. RITGER”ROOM 395”A1032956”#END#@@@@@@

Figure 2-3: Card with Embossing and OCR Indent

All data in the following strings is contained on one line.

All data in this string is contained on one line.

All data in this string is contained on one line.

All data in this string is contained on one line.

019632

ROOM 395

MARY L. RITGER

Front of Card 0.400 inch

0.430 inch 0.678 inch

0.843 inch

Back of Card

A1032956

1.000 inch

44530-3

Page 16 Protocol and Data Format

Page 25: Datacard CE Series Instant Issuance System

Embossing with Magnetic Stripe DataThe following data string shows line location coding with magnetic stripe data.

Encode: 

IATA = MARY

ABA  = 123456

#DCC###EMB#019632”MARY L. RITGER”ROOM395”A1032956”#ENC#%MARY? ;123456?#END#@

Formatting Extended Line LocationsThe CE System also can use an inline card template command (#GTW#) in place of the 

#DCL# command to define where the information is placed on the card. The most 

common application is when you need to define multiple left margins on the card. The 

template uses the following general rules.

The zero (0) template is a RAM‐only template used if the host application sends a card 

template for each card. Ten different parameters are defined for each field; however, the 

CE System only uses four of them: Type, ID, Horizontal, and Vertical. Each line ending with 

a new line code defines one line of emboss or encode data. This is the only template 

syntax supported on the CE System.

All values are entered in decimal, ending with a comma. The format is shown below:

Type ID Horz Vert0004,0001,0350,0950,0000,0000,0000,0000,0000,”0004,0001,0750,0687,0000,0000,0000,0000,0000,”0004,0001,0750,0489,0000,0000,0000,0000,0000,”0004,0001,0550,0225,0000,0000,0000,0000,0000,”#END#@@@@@@

t, i, h, v:

• t = Type (4=emboss, 5=encode) *

• i = ID number

• 1 = Emboss Standard Gothic—Front, 10 CPI 

• 2 = Emboss Farrington 7B—Front, 7 CPI 

• 3 = Indent OCRB—Back, 10 CPI 

• 4 = Indent MasterCard Slanted—Back, 14 CPI

• 5 = Indent OCRB Size IV—Front, 7 CPI

• 6 = Indent MasterCard Slanted—Front, 14 CPI

• 7 = Indent OCRB—Front, 10 CPI

• 8 = Indent MasterCard Inverted—Back, 7 CPI

• 9 = Indent Helvetica—Front, 14 CPI (white ribbon)

• 10 = Indent Helvetica—Front, 14 CPI (black ribbon)

• 11 = Tactile Identification Mark

CE Instant Issuance System CPX Protocol and Setup Manual Page 17

Page 26: Datacard CE Series Instant Issuance System

• h = Horz Position in 0.001 inch increments from the left edge of the card to the 

center of the emboss character (0.200 is minimum).

• v = Vert Position in .0001 inch increments from the bottom of the card to the center 

of the emboss font (0.950 maximum and 0.150 minimum).

* Type = 0, 1, 2: Graphics control codes reserved for graphics characters. Ignored by the 

CE System.

Sample Template Block#DCL##GTW#0”0004,0002,0401,0843,0000,0000,0000,0000,0000”0004,0001,0401,0489,0000,0000,0000,0000,0000”0004,0001,0401,0332,0000,0000,0000,0000,0000”0005,0002,0000,0000,0000,0000,0000,0000,0000”#END#@@@@@@

Sample Data Block#DCC##GRD#0”1222 3333 3333 3333”01/03”PAT DOE”;1234567890124118?”#END#@@@@@@

Figure 2-4: Card Sample

All field entries are required in a line location block.

0.332

54740cpx

BLANK CARD CORPORATION

1222 3333 3333 3333

GOOD THRU

PAT DOE

01/03 VISA

0.843

0.489

0.401

Page 18 Protocol and Data Format

Page 27: Datacard CE Series Instant Issuance System

Single-Wire Smart Card

CPX commands that allow you to program a smart card—#ATR#, #APD#, #APD#1#—are 

used when the smart card reader is connected using a single‐wire interface. 

Smart Card Application Protocol Data Unit

In the context of smart cards, an application protocol data unit (APDU) is the communication unit between a smart card reader and a smart card. The structure of the APDU is defined by ISO/IEC 7816‐4: Organization, security and commands for interchange.

APDU Message Command-Response Pair

There are two categories of APDUs: command APDUs and response APDUs. A command 

APDU is sent by the reader to the card—it contains a mandatory 4‐byte header (CLA, INS, 

P1, P2) and from 0 to 255 bytes of data. A response APDU is sent by the card to the 

reader—it contains a mandatory 2‐byte status word and from 0 to 256 bytes of data.

This is a future CPX option and is not currently supported on the CE System.

The following sections provide an overview of single‐wire smart card processing. 

Command APDU:

Field name Length (bytes) Description

CLA 1 Instruction class—indicates the type of command; for example, interindustry or proprietary

INS 1 Instruction code—indicates the specific command; for example, "write data"

P1,P2 2 Instruction parameters for the command; for example, the offset into the file at which to write the data

Lc 0, 1 or 3 Encodes the number (Nc) of bytes of command data to follow

Command data Nc Nc bytes of data

Le 0, 1, 2 or 3 Encodes the maximum number (Ne) of response bytes expected

Response APDU:

Response data Nr (at most Ne) Response data

SW1‐SW2(Response trailer)

2 Command processing status; for example, 90 00 (hexadecimal) indicates success

CE Instant Issuance System CPX Protocol and Setup Manual Page 19

Page 28: Datacard CE Series Instant Issuance System

Smart Card Single-Wire Solution Using CPX Protocol

The following allows a host to connect to a smart card using a single‐wire solution. 

All commands return a Response. If no data is returned for ATR, it is an error condition. 

All data is sent and received as 2‐byte ASCII hex data.

1. Select ATR for Contact or Contactless card.

2. Issue an APDU transmit command #APD# to program the card.

This solution is not PC/SC‐compliant and requires the host to change its 

applications to support the CE System..

Send CPX command Response CPX command Description

#DCC##ATR#0#END#@ #DCC##ATR#3F4050…#END#@ Answer to reset Contact 

#DCC##ATR#1#END#@ #DCC##ATR#3F4050…#END#@ Answer to reset Contactless

#DCC##APD#00A040….#END#@ #DCC##APD#9000#END#@ APDU transmit data commands

Page 20 Protocol and Data Format

Page 29: Datacard CE Series Instant Issuance System

CommandsThe following commands control the operation of the CE System.

Data Match Compare (#CMP#)A data match compare routine is used to read magnetic stripe data before writing to the 

magnetic stripe. This routine verifies if data matches a given value. Only one track of data 

is allowed for the data match compare routine. A wild card character ( ! = 21 Hex) is used 

to match any single character.

The following example shows how to compare data in the ABA track and then, if a match 

is found, to emboss and re‐encode the card.

The host sends the following:

#DCC##CMP#;00000000?#EMB#PAT DOE#ENC#;12345?#END#@@@@@@

The CE System reads the ABA track. If a match is found (0000000), the CE System re‐

encodes the ABA track of the card (12345) and embosses it (PAT DOE). If a Read error or 

Data Match error occurs, the card remains in the magnetic stripe module and a status is 

returned to the host. The host must issue a #REJ# command or process the card with new 

emboss or magnetic stripe data.

The following data string causes the CE System to compare character positions 5 to 9 in 

the ABA field:

#DCC##CMP#;!!!!5678!!?#EMB#PAT DOE#ENC#;12345?#END#@@@@@@

If a match is found, the CE System re‐encodes and then embosses the card. If a Read error 

or Data Match error occurs, the card remains inside the magnetic stripe module and a 

status is returned to the host. The host must issue a #REJ# command or process the card 

with new emboss or magnetic stripe data.

All data in this string is contained on one line.

All data in this string is contained on one line.

CE Instant Issuance System CPX Protocol and Setup Manual Page 21

Page 30: Datacard CE Series Instant Issuance System

Counters (#CNT#)Counters allow the host to read the internal counters of total cards produced, good 

cards, and rejected cards.

Host Data:

#DCC##CNT##END#@@@@@@

Return Data:

#DCC##CNT#1688”1669”19”0”0”0”0”0”0”0”0”0”0”0”0”0”0”0”0”0”0”0”0”0”0”0”#END#@

This provides the following information:

Current (#CUR#)

Starting Data Block (#DCC#)Data blocks start with the #DCC# command and end with the #END# command for all 

data type commands. Refer to "Formatting Data Blocks" on page 15.

Formatting Embossing Line Location Data (#DCL#)Line locations tell the system where the data should be placed on a card. Refer to 

“Formatting Embossing Line Location Commands” on page 13.

The host system should allow for future counter values of up to a maximum of 

25 counters.

Total Cards

Good Cards Rejects For Future Use

1688 1669 19 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

The #CUR# command is ignored on the CE System.

Page 22 Protocol and Data Format

Page 31: Datacard CE Series Instant Issuance System

DES Mode Status and Selection (#DES#)This command is used to set and return DES options and to set the DES encoding method.

Command Structure#DCC##DES#a”#END#@ Send Command

#DCC##DES#b”c”d”#END#@ Return Status

Output Command Selection

Return Status Values

The DES option defaults to single DES each time the CE System is restarted.

a Description

0 Default or read DES option

1 Use single DES mode*

2 Use triple DES 3 CBC mode

* The DES option defaults to single DES when the system is restarted.

b Description

0 DES option disabled

1 DES enabled

c Description

0 DES not locked

1 DES locked

d Description

0 Single DES used

1 Triple DES used

CE Instant Issuance System CPX Protocol and Setup Manual Page 23

Page 32: Datacard CE Series Instant Issuance System

Example

The following forces DES to triple DES. The return status shows that DES is enabled, 

locked, and triple DES selected.

#DCC##DES#2#END#@#DCC##DES#1”1”1” #END#@

Embossing Data Format (#EMB#)This command immediately precedes all emboss data, with each line ending in a new line 

code (“). The font used for each line is established by a host‐transmitted line location 

block or a template (refer to “Formatting Extended Line Locations” on page 17 or 

“Formatting Embossing Line Location Commands” on page 13). The commands are 

described in Table 2‐2, Data Format Commands.

Figure 2-5: Card with Embossed Data

All data in this string is contained on one line.

019632

ROOM 395

MARY L. RITGER

Front of Card

44530-2

Page 24 Protocol and Data Format

Page 33: Datacard CE Series Instant Issuance System

Emboss and Encoding (#ENC#)The following example shows the format for adding magnetic stripe data (ABA encoding 

3594319, field separator, 25689) to a card. The embossed data would appear on the card 

as shown in Figure 2‐5 “Card with Embossed Data”, with the addition of a magnetic stripe 

on the opposite side of the card (not illustrated). Figure 2‐4 “Card Sample”, describes the 

additional magnetic stripe codes.

#DCC#019632”MARY L. RITGER”ROOM 395” #ENC#ST_SENT3594319FS25689END_SENT#END#@@@@@@

Table 2-3: Magnetic Stripe Encoding Characters

Ending Data Block (#END#)Data blocks start with a #DCC# command and end with a #END# command for all data 

type commands. Refer to “Formatting Data Blocks” on page 15.

Refer to Table 2‐3, Magnetic Stripe Encoding Characters, for the correct character 

for the start and end sentinels (ST_SENT and END_SENT). All data in this string is 

contained on one line.

If you are making financial cards, you must activate the printer before sending 

commands. Refer to your printer’s Installation and Administrator’s Guide for 

complete information about activation.

Code Description IATA ABA TTS

ST_SENT Start Sentinel: Prefix character for magnetic stripe data. TTS requires a two‐character code.

2516 (%) 3B16 (;) 5F163B16 (_;)

END_SENT End Sentinel: Denotes the end of magnetic stripe data.

316 (%) 3F16 (?) 3F16 (?)

FS Field Separator: Used to separate data fields

5E16 (^) 3D16 (=) 3D16 (=) Field Separator3A16 (:) Account Separator

Data Type User data Alphanumeric Numeric Numeric

Field Size Maximum

Maximum allowed characters between Start and End Sentinel.

76 37 104

CE Instant Issuance System CPX Protocol and Setup Manual Page 25

Page 34: Datacard CE Series Instant Issuance System

Return Error Status (#ERR#)This command allows the host system to get more detailed error code information than 

the one‐byte status code that is normally returned. The command returns the same error 

codes in hex as those that display on the CE System front panel. The following example 

shows how the host can read the last error code message on the front panel of the CE 

System. Issue this command after the CE System status is set to “A,” ready for the next 

data block. If no errors are found, an error code of “0” is returned.

Host Data:

#DCC##ERR##END#@

Return Data (Card hopper empty–112) error found:

#DCC##ERR#112”#END#@

Font Changing Commands (#FC1# to #FC11#)The following table shows the commands to change the font characteristics:

Table 2-4: Font Changing Commands

Command Font Description

#FC1# Change to font 1 (Emboss Standard Gothic, front, 10 characters per inch). Code is allowed in line locations block only.

#FC2# Change to font 2 (Emboss Farrington 7B, front, 7 characters per inch). Code is allowed in line locations block only.

#FC3# Change to font 3 (Indent OCRB, back, 10 characters per inch). Code is allowed in line locations block only.

#FC4# Change to font 4 (Indent MasterCard Slanted, back, 14 characters per inch).

#FC5# Change to font 5 (Indent OCRB Size IV, front, 7 characters per inch).

#FC6# Change to font 6 (Indent MasterCard Slanted, front, 14 characters per inch).

#FC7# Change to font 7 (Indent OCRB, front 10 characters per inch).

#FC8# Change to font 8 (Indent MasterCard Inverted, back, 7 characters per inch).

#FC9# Change to font 9 (Indent Helvetica, front, 14 characters per inch, white ribbon).

#FC10# Change to font 10 (Indent Helvetica, front, 14 characters per inch, black ribbon).

#FC11# Change to font 11 (Tactile Identifier Mark)

Page 26 Protocol and Data Format

Page 35: Datacard CE Series Instant Issuance System

Smart Card Position (#FED#X)An optional parameter, X, for the #FED#X command specifies the smart card head 

position as follows:

• 0 or no parameter = Pass through the smart card module.

• 1* = Smart card front head location (refer to Figure 2‐6, “Feed Card to Front 

Position”).

• 2* = Smart card back head location (refer to Figure 2‐7, “Feed Card to Back Position” 

below).

• 3* = Smart card contactless position.

* The CE System has a fixed mechanical head location.

To move the card into the smart card front/rear locations, the host issues one of the 

commands in Figure 2‐6, “Feed Card to Front Position”or Figure 2‐7, “Feed Card to Back 

Position”.

If the card was not picked, a Card Feed Error status (“G”) is returned.

When the card is in position, the CPX protocol returns a Ready status (“A”).

Figure 2-6: Feed Card to Front Position

Figure 2-7: Feed Card to Back Position

Throat Gap (#GAP#)

Card Data Follows Feed Card to Front Position# D C C # # F E D # 1

End of Data Block End of All Data# E N D # @ @ @ @ @

Card Data Follows Feed Card to Front Position# D C C # # F E D # 2

End of Data Block End of All Data# E N D # @ @ @ @ @

The #GAP# command is ignored on the CE System.

CE Instant Issuance System CPX Protocol and Setup Manual Page 27

Page 36: Datacard CE Series Instant Issuance System

Communications Data Format (#GRD#0/#GTW#0)Another method to send emboss and encode data to the CE System uses only the #GRD# 

and #GTW# commands. The host must send a #GTW# with a #GRD# command using 

template number (0) only. The sample card in Figure 2‐4, “Card Sample”, shows how a 

user can make the card by sending the #DCL# line location block followed by the #DCC# 

block to make a card. The data can be in any order. Fixed data in #DCL# emboss/encode 

data is not supported.

• Font number, horizontal and vertical options are used only with the emboss data.

• Encode data does not use any font types.

Example: Emboss 3 lines and 1 encode track on track number 2. Refer to Figure 2‐4 "Card 

Sample" on page 18.

Hopper Selection (#HOP#)The #HOP# command is used to select the input hopper (from 1 to 6) for multi‐hopper 

support.

The following example shows the Host Data to select hopper 2 with Emboss Data:

#DCC##HOP#2#EMB#AlanMeilac##END#@

Key Lock Open (#KEY#)The #KEY# command energizes the CE System solenoid. You then have 15 seconds to 

open the front cover before the solenoid is de‐energized. (Refer to your printer’s 

Installation and Administrator’s Guide for more information.) 

Host Data:

#DCC##KEY##END#@@@@

When the command is issued, the host should poll the CE System with the ENQ poll, 

which returns a (NAK) busy status until the solenoid is released. This takes fifteen 

seconds, and then an “A” status is returned.

This format option is used by the Datacard CE System Card Printer Driver for 

Windows.

Page 28 Protocol and Data Format

Page 37: Datacard CE Series Instant Issuance System

Message Wait (#MSG#)Message Wait tells the system to wait for a card to be placed in the exception slot. The 

#MSG# command is used with the CE System data block. A 24‐byte maximum message is 

sent to the display, and you must press a key on the front panel before the card is made.

Host Data:

#DCC##MSG#Insert Single Card #CMP#ST_SENT1234567+!!END_SENT#EMB#12345#ENC#;01?#END#@@@@@@

When a key is pressed, the card is fed into the CE System from the input hopper. The 

card’s magnetic stripe is read, compared to the number 1234567+, embossed with 

12345, and then encoded with 01 on the ABA track.

OCR Indent (#OCR#)Used on earlier model embossers to print indent data using the #FC3# command. This 

command has been replaced in the CE System CPX Protocol/Format by #FC3#.

Reject Card (#REJ#)After the data is read, the host can send the normal emboss and magnetic stripe data in 

#DCC# format or issue a #REJ# command to reject the card. Refer to "Read Magnetic 

Stripe Track (#TRK#)" on page 35.

Reset the System (#RST#)This option clears any front panel error codes and attempts to reset the following 

conditions:

• Transport error

• Card empty

• Reject full

• Stacker door

• Interlock open

• Topper foil empty

All data in this string is contained on one line. This data causes the CE System to 

display the following message:

Insert Single Card

Press any key to continue.

To cancel the #MSG# from the host system, the host can send a CAN (18 Hex) to the 

host port. The CE System returns “A” to indicate it is ready for the next data block.

CE Instant Issuance System CPX Protocol and Setup Manual Page 29

Page 38: Datacard CE Series Instant Issuance System

If no errors are found, a Ready status (“A”) is returned. If any errors occurred, a one‐byte 

status error message other than “A” is returned to the host.

Host Data: 

#DCC##RST##END#@@@@

Retry Magstripe Counter (#RTE#)The #RTE# command allows the host system to select the retries counter for the 

magnetic stripe when an error occurs. You can specify from 0 to 8 retries. A value greater 

than 8 defaults to 0. A value of zero causes the magnetic stripe system to do a write 

followed by only one read (no retries). A value greater than 0 causes the magnetic stripe 

unit to execute a write, then a read multiple times if encode compare errors occur. The 

retry counter decrements with each attempt until the card is encoded successfully or 

rejected. If the Write Only Once option is set, the retries only read the card.

Host Data: 

#DCC##RTE#0#END#@@@@

Secure Data Block (#SDA#)The #SDA# command is used with encryption to tell the CE System that the data that 

follows has been encrypted by the host application. The system performs decryption of 

the host data using the key previously configured in the system. The encrypted data 

starts with the first character after the #SDA# command and ends with the last character 

before the #END# command. Encrypted data can include any CPX commands. The 

example below shows how card data was modified for use with the #SDA# command.

If the DES key does not match the host DES key, the CE System returns a Communications 

Failure Data Format Error (“U”). This error requires that the host send a #SEC# command 

to reset the DES keys. You can encrypt #GRD# data or other #DCC# commands.

Use this option to check card and topping supplies without picking a card. It also 

tests options normally set at power up, including topper on/off, magstripe retries, 

write only once, and Hico/Loco settings.

Sample ## DATA BLOCK Encrypted ## DATA BLOCK Sample DES Key in Hex

#DCC##EMB#1234567890”#ENC#;1234567890?#END#@

#DCC##SDA# 3F07EC5EFD9D964A857E1BDCABEE4C4396F1D5ECACE0424E7403F9CD1C9174E450111B425FDE3F9#END#@

0123456789ABCDEF

Page 30 Protocol and Data Format

Page 39: Datacard CE Series Instant Issuance System

The host application must perform the following steps to make encrypted data:

1. Remove the #DCC# and #END#@ from the normal data block.

2. Add null characters to the end of a block to ensure that the block size is a multiple of 

8 bytes. (The block size in the above example is 33. You need to add 7 nulls to get to 

40 bytes.)

3. Run DES encryption on data between the #DCC# block and #END# block using the 

corresponding key data.

4. Convert the data to 2‐byte ASCII Hex codes. In the example, the encrypted data = 80 

bytes.

5. Add #DCC##SDA# and DES data ending with #END#@@@.

Secure Options and Keys (#SEC#)The #SEC# command is sent in encrypted form to initiate or terminate secure mode, or to 

transmit a new encryption key. The command is sent unencrypted when used to reset the 

system to the default key. 

Command Structure#DCC##SEC#x”new key in Hex”#END@

This command should only be set ONCE to initialize the CE System. The command 

produces a format error if you attempt to send it in non‐encrypted mode, except for the 

“2” reset DES key command. Because data is encrypted, new keys do not display in 

plaintext.

Example Encrypted Mode: (uses last DES key)

#DCC##SDA#3EFF010001010… (#SEC# command is encrypted form based on default DES key)#END#@

Reset DES Key (Non-Secured Mode)#DCC##SEC#2#END#@

The reset DES key option sets the default key equal to ‘DATACARD.’

Remove CR and LF control codes, if used, or dummy pads between #EMB# 

and #END# data.

x Description

0 System is not locked.

1 Locked encryption #ENC# data required.

2 Reset CE System back to its default DES key.

CE Instant Issuance System CPX Protocol and Setup Manual Page 31

Page 40: Datacard CE Series Instant Issuance System

Secure Random Key Set (#SKE#)

Power up requires a key command from the host to generate a DES key. The command is 

similar to the #TRK# and #CNT# commands used with the CE System in that data is 

returned to the host from the system. The DES key is created from two keys by running 

an internal function.

To make a DES‐type key, the host takes the input key and the output key and runs an 

internal function, which creates a true DES‐type key. This command can be sent for every 

card if you want to create a new DES key for each card.

The following examples show how the #SKE# command works internally to take key 1 

(the input key) and create the output key 2. Both keys are used to make a standard DES 

key for the #SDA# secure data command.

The system creates a random number using the timer, and then uses an XOR function on 

the number with key data to create the DES key. The DES key then is used with the #SDA# 

secure data function.

The system performs an encryption of the random number to create the output key 2. 

The random number DES key is based off the key 1 data and a random number lookup 

table.

*Private key—The private key option is used to create the random number table that is 

unique for this option. It is entered as the 8‐digit code level (1) security option.

This is a future CPX option and is not currently supported on CE Systems.

Input Key 64-bit Random Number Output Key 64-bit Random Number

#DCC##SKE#0123456789ABCDEF#END#@ #DCC##SKE#4EF294227AC7762#END#@

DES Key* Key 1 from Host #SKE#Random Data from CE System

A214305E3EFD61A1 0123456789ABCDEF A3377539B756AC4E

Random Number DES Key* Key 2 sent to Host #SKE#

Random Data from CE System

548943596103C7D1 04EF294227AD7762 A3377539B756AC4E

Page 32 Protocol and Data Format

Page 41: Datacard CE Series Instant Issuance System

The process flow of how the CPX application works with the SECURE.EXE program is 

shown below. All files in the CE System are stored in a RAM disk drive, which is reset each 

time the printer is restarted.

Secure Read Stripe Data (#SRK#)This command is similar to the #TRK# command but reads the stripe data and returns it 

in encrypted format. If encryption is not enabled, a “U” error status is returned. The data 

from the #SDA# contains Track 1, 2, and 3 data read from the card in encrypted format. 

The host application must decrypt the data.

Example:

#DCC##SRK##END#@#DCC#SRK##SDA#….#END#@ Data is returned in encrypted format.

Get System Information (#SYS#)This command is used to find firmware versions and system Vital Product Data (VPD). 

This includes FRU (Field Replaceable Unit) assembly numbers and serial numbers. It also 

provides the system’s serial number, which is required by Datacard to enable processing 

of financial cards. The #SYS# command returns 12 fields for the host, each separated by a 

new line code.

The six‐hopper option appears in the system information controls under Input/Output 

Fru controls. The field is blank if only one hopper is used. Use the #HOP# command to 

select Input Hopper number 1 to 6. 

Host Output Return Data Internal Process Flow

#DCC##SKE#0123456789ABCDEF#END#@

#DCC##SKE#04EF294227AD7762#END#@

CE System CPX creates a program called “SECURE.EXE 2” that returns key 2 data in file “SECURE.KE2”. Key 1 data is stored in file “SECURE.KE1”.

#SDA#0”…#END#@ CE System CPX creates a program called “SECURE.EXE 5 1” that takes the #SDA# data and returns the decrypted data in file “SECURE.DEC” using the .KE1 and .KE2 files as keys.

System Information

Model/Protocol CEM/CPX‐DES

CPX Appl Rev.  506535 Rev U

Serial No. E00196

Magstripe Fru MagstripeISO

CE Instant Issuance System CPX Protocol and Setup Manual Page 33

Page 42: Datacard CE Series Instant Issuance System

Host Data:

#DCC##SYS##END#@@@@

Typical Host Response:

#DCC##SYS#CEM/CPX_DES”556228 Rev J”00999”123456789A 00999”123456789B 00999”#END#@@@@

Turn Topper Off (#TOF#)This command turns the topper off. Refer to “System Option Controls” on page 36 for an 

alternate method to turn the topper off.

Turn Topper On (#TON#)This command turns the topper on.

Emboss Fru E1.1.30‐0

Smart Card Fru SmartCard

Topper Fru

Input/Output Fru SixHoppers (Blank if using a single hopper)

Indent Fru

Board No.

Firmware No. D3.12.22.65534

Transport Fru

System Fru May 30 2012

System Information

Page 34 Protocol and Data Format

Page 43: Datacard CE Series Instant Issuance System

Read Magnetic Stripe Track (#TRK#)This command differs from the Compare command #CMP# in that the CE System returns 

encoded data from the card for the host application to examine prior to card processing. 

The magnetic stripe read data is returned in pound‐pound format. The data is returned in 

order by track: Track 1 data, Track 2 data, and then Track 3 data.

A #FED# command must be issued before the #TRK# command to move the card into the 

magnetic stripe module. Refer to the following command sequence for applications 

requiring a read‐before‐write routine:

#DCC##TRK##END#@@@@@@

The following is the read stripe response if only ABA track data is read:

#DCC##TRK#;012345?#END# @

The following is the read track response when no data is found:

#DCC##TRK##END# @

After the data is read, the host can send the normal emboss and magnetic stripe data in 

#DCC# format or issue a #REJ# command to reject the card.

Return CPX Version (#VER#)This command returns the current CE System version of the software running the CPX 

application. The status includes two lines. Line 1 is the model number followed by the 

protocol. Line 2 includes a 6‐digit number followed by a revision letter.

Host Data:

#DCC##VER##END#@

Return Data (the example shows Rev H Release):

#DCC##VER# CE111/CPX ”553675 Rev H”

CE Instant Issuance System CPX Protocol and Setup Manual Page 35

Page 44: Datacard CE Series Instant Issuance System

Write Only Once Hico Stripe (#WOH#)

This command limits the stripe unit to write to the card only once, because a JCB Hico 

stripe can only be written once. The card is destroyed if an attempt is made to rewrite 

data. A value of one (1) turns this option on. A value of zero (0) turns this option off. If the 

retry counter is set to zero, this command has no effect on the magnetic stripe system. 

Host Data:

#DCC##WOH#1”#RET#3”#END#@Write Read Read Read Read

#DCC##WOH#0”#RET#3”#END#@Write Read Write Read Write Read Write Read

System Option ControlsThe following examples turn the topper ON and OFF and also change the foil color.

#DCL# 080400 (font change) C0000#END#@@@@@@ (Turns Topper OFF)

#DCL# 080400 (font change) C0001#END#@@@@@@ (Turns Topper ON, color = 1)

#DCL# 080400 (font change) C0002#END#@@@@@@ (Turns Topper ON, color = 2)

This command is not used by the CE System. If issued, it is ignored.

Page 36 Protocol and Data Format

Page 45: Datacard CE Series Instant Issuance System

Topping AreaA Topping Limits error occurs if topping is ON and the emboss data sent is outside of the 

topping range. Figure 2‐8, “Acceptable Topping Area” shows the acceptable topping area.

Figure 2-8: Acceptable Topping Area

Financial Card Passwords

The CE System allows you to specify two passwords that restrict the generation of the 

following types of financial cards:

• AMEX™

• Diners/JCB™

• Visa®

• MasterCard™

• Discover™

We recommend that you turn off the password option for the CE System by 

modifying the CPX configuration file. Refer to CPX.cfg Settings File for CPX 

Application on page D‐4.

3.375"

0.15 inchto center ofcharacter Acceptable Topping Area

54740d39

0.2 inchto center ofcharacter

0.95 inchto center ofcharacter

0.2 inchto center ofcharacter

CE Instant Issuance System CPX Protocol and Setup Manual Page 37

Page 46: Datacard CE Series Instant Issuance System

If the password requirements are not met, an attempt to write a particular set of account 

numbers on the ABA track (75 BPI, Track 2, ABA start sentinels) causes the magnetic 

stripe module to return a data error. Refer to the printer’s User’s Guide for a complete list 

of error codes.

When shipped from DataCard Corporation, the CE System is deactivated. To activate the 

system, you must contact Datacard for an activation code specific to your system based 

on the serial number. Refer to your printer’s Installation and Administrator’s Guide for 

information about activating the system. The system remains enabled even if powered 

off.

If the password option is set to on, a financial password is required to encode the card. 

Embossing is not blocked directly, although an encode error usually causes immediate 

rejection of the card.

Additionally, a default password must be sent by the host to the CE System to enable 

initial financial card production. After this is done, you may change the host password at 

any time. Any hex character (00‐7F) can be used as a password character except the tilde 

(~ or 0X7E).

When the password function is enabled, the host password must be sent after any 

system reset (as for power up) to enable financial card production. It may be sent as 

often as desired. We recommend that you send the password as the first data set in the 

line location block or data block. If it is sent incorrectly, the financial accounts are blocked 

even if they were previously opened successfully. Ideally, the host application should 

account for inadvertent power cycling of the CE System in the host password strategy. 

Options include resending the host password automatically with the first record after the 

host recognizes that the CE System has been returned to online status. Alternatively, the 

host password may be sent with every card. An algorithm may be used within the host 

application to change the password to meet security requirements.

Send a Financial PasswordTo send a financial password, use the following syntax:

“~0LnDATACARD”

where:

• ~ is a one‐byte ASCII tilde character.

• 0 is a one‐byte ASCII zero character.

• Ln is equal to the number of characters of the password expressed in ASCII code 

(1–16 characters, 1 byte). In this case: 8 (08 in hex).

• Send password (1–16 characters, 1 byte). In this case the password is DATACARD.

Page 38 Protocol and Data Format

Page 47: Datacard CE Series Instant Issuance System

The following example sends the password DATACARD:

The CE System responds with an ACK if the password is accepted or NAK if the password 

is incorrect.

Example of sent password in Visual Basic:

Sub Set_Password ()‘Password using Vbasic for CE system example.dim line$dim ack$line$=”~0”+CHR$(08)+”DATACARD”MSCOMM1.OUTPUT= line$ ‘output passwordAck$ = MSCOMM1.INPUTif ack$=chr$(06) then‘good passwordendifif ack$=chr$(15) then‘bad passwordendifEnd Sub

Set a New Financial Password

To set a new financial password, use the following syntax:

“~1LoOLDPASSLnNEWPASS”

where:

• ~ is a one‐byte ASCII tilde character.

• 1 is a one‐byte ASCII one character.

• Lo is equal to the number of characters of the old password expressed in ASCII code 

(1–16 characters, 1 byte). In this case: 7 (07 in hex).

• Old password (OLDPASS).

• Ln is the length of the new password (1–16 characters, 1 byte). In this case: 7 (07 in 

hex).

• New password (NEWPASS).

7E 30 08 44 41 54 41 43 41 52 44 Hex Representation

~ 0 bs D A T A C A R D ASCII data sent

Refer to Financial Password on page A‐3 for a sample line trace.

We recommend that you change the password using its own data block.

CE Instant Issuance System CPX Protocol and Setup Manual Page 39

Page 48: Datacard CE Series Instant Issuance System

The following example changes the password (OLDPASS) to the new password 

(NEWPASS):

The CE System responds with an ACK if the password is good and a NAK if the password is 

incorrect.

Encryption OptionThe encryption option replaces the financial card password, allowing banks to comply 

with an encryption standard for doing bankcards on a CE System. This method is more 

secure than the financial password option because the password is not sent in plaintext 

for every card. Also, live bank data is not seen on the host port.

The main reason for encrypting the data is that the magnetic stripe data from the host 

contains a CID number encoded on the magnetic stripe. This number is based on the 

account number and expiration date. Using this number, anyone can make duplicate 

financial or bankcards.

The CPX‐CE8XX Demo Tool (Part Number 506645‐001) supports testing the encryption 

option.

The CE System encryption option has the following features:

• Requires that all CPX commands be sent in secure encrypted mode for encode stripe 

data.

• Uses standard DES single key or triple DES‐CBC.

• Replaces the password option.

• Provides two levels of management.

7E 31 07 4F 49 44 50 41 53 53 07 4E 45 57 50 41 53 53 Hex Representation

~ 1 Bel O L D P A S S Bel N E W P A S S ASCII Data Sent

Page 40 Protocol and Data Format

Page 49: Datacard CE Series Instant Issuance System

SecurityWhen shipped from DataCard Corporation, the password function is set to a default 

password. After the system is activated, you may change the password at any time.

Table 2-5: DES Encryption Examples

Triple DES with CBCThis method of encryption offers an increase in security over single DES method.

• Encrypt with key1, decrypt with key2, and then encrypt with key1.

• Cipher Feedback mode (CBC) uses an 8‐byte initialization vector (IV).

• A total of 24 bytes is used: key1, key2, IV.

• The #SDA# encrypted data uses single or triple DES based on the #DES# mode 

selected.

#SEC#2#END#@ (Resets keys to defaults)Static unsigned char key1[8] = {0x44,0x41,0x54,0x41,0x43,0x41,0x52,0x44); //datacardStatic unsigned char key2[8] = {0x44,0x41,0x54,0x41,0x43,0x41,0x52,0x44); //datacardStatic unsigned char cbc_iv [8] = {0xfe,0xdc,0xba,0x98,0x76,0x54,0x32,0x10}; // Initialization vector.#SEC#x”New Keys In Hex”#END#@

When you want to change the keys using the #SEC# command, you send 24 bytes for 

key1, key2, and IV.

We recommend that you turn off the password option for the CE System by 

modifying the CPX configuration file. Refer to CPX.cfg Settings File for CPX 

Application on page D‐4.

DES Key Data Output

0123456789ABCDEF 0123456789ABCDEF 56CC09E7CFDC4CEF

0123456789ABCDEF 0123456789ABCDE7 C95744256A5ED31D

0123456789ABCDEF 0123456789ABCDEF0123456789ABCDEF

56CC09E7CFDC4CEF56CC09E7CFDC4CEF

If you do not want to change key2 or the IV, send 8 bytes to change key1 only. 

Send 16 bytes to change key1 and key2.

CE Instant Issuance System CPX Protocol and Setup Manual Page 41

Page 50: Datacard CE Series Instant Issuance System

Keyboard entry of the DES key only changes key1. For example, if you key in number 

(01234567):

Static unsigned char key1[8] = {0x30,31,32,0x33,0x34,0x35,0x36,0x37); // Keyboard 

Entry.

Static unsigned char key2[8] = {0x44,0x41,0x54,0x41,0x43,0x41,0x52,0x44); //Not 

Changed

Static unsigned char cbc_iv [8] = {0xfe,0xdc,0xba,0x98,0x76,0x54,0x32,0x10}; // Not 

Changed

Level (1) Key ManagementThe DES key must be numeric only, up to 8 digits. The DES key is set to ‘DATACARD’ when 

a CE System is shipped from the factory. Use the #SEC# host command to enter new DES 

keys.

Level (2) Key Management (Future Option)

In this option, the DES keys are generated for each card transaction. A new key is created 

for every transaction. The DES keys are generated by using two random numbers to 

create a final DES key. The DES keys are created from the host system input and CE 

System output. Setup of default DES keys is not used in this method.

The CE System does not currently support this option.

Page 42 Protocol and Data Format

Page 51: Datacard CE Series Instant Issuance System

Chapter 3: Electrical Interface Description

This chapter describes the Datacard CE Series Instant Issuance System 

electrical interface.

CPX InterfaceThe CE System is designed to be used with a network connection.

LAN Support HardwareThe CE System has one RJ11 Ethernet connection running 10‐baseT and 100‐baseT and 

both running half or full duplex.

LAN Software Usage• CPX protocol runs TCP/IP protocol as a server function, which can function under a 

Windows socket command.

• The host application needs to run CPX status and data commands while using send 

and receive Windows socket commands. This follows all CPX serial transmit and 

receive command functions.

• Connect to the CE System using port 15000 only as a client.

• Only one user can connect to the CE System at a time. Once the connection is made, 

the application needs to release the connection before another user can access the 

CE System.

• You can view the IP address of the CE System on the front panel LCD display.

CE Instant Issuance System CPX Protocol and Setup Manual Page 43

Page 52: Datacard CE Series Instant Issuance System

Precidia Ethernet-to-Serial Port SetupDo the following if you also communicate with a non‐CE System printer using the serial 

port.

1. Use Putty or a Terminal Emulation program and set Baud=9600, 8‐bit None.

2. Connect a null modem cable from the serial port on the printer to the PC serial port.

3. Press the Reset button on the printer for 3 seconds.

4. Use Ethernet port = 0.0.0.0, which runs DHCP if running on a network server. Set a 

static IP address = 192.168.1.2 if doing a direct connection to the printer. 

5. Plug the Ethernet cable into the printer.

A display message displays:

Precidia Ether232Duo Configuration v5.00.02

Device Settings:

1) Serial Port #1: Transparent

2) Serial Port #2: disabled

3) Ethernet: 0.0.0.0 

*) Save Current Configuration 

‐) Exit Configuration (no save) 

$) Security Settings 

#) System Settings 

?) Refresh this Screen 

Change which option? –  Set to 1

1. Set Port COM1 to 9600 8‐bit none.

2. Set Remote IP to Printer IP printer port.

3. Set Remote port to 15000

4. Set Protocol to (Transparent, TCP client)

5. Press the (*) key to save the settings. Then power down and restart the printer.

Page 44 Electrical Interface Description

Page 53: Datacard CE Series Instant Issuance System

Device Settings Serial Port #1 Settings

1) Serial Port #1: Transparent A) Protocol: Transparent (cln)

2) Serial Port #2: disabled B) Port Setting: 9600 bps 8N1[no]

C) Connection Control: Automatic

3) Ethernet: 0.0.0.0 

D) Local Port: 0

E) Remote IP: 172.16.36.129

F) Remote Port: 15000

G) Fallback IP: 0.0.0.0

H) Fallback Port: 0

I) Fallback Drop Time: 0

*) Save Current Configuration J) Packet Prefix: none 

‐) Exit Configuration (no save) K) Max Inter‐Char Delay: 0 

$) Security Settings  L) Preferred Packet Size: 0

#) System Settings 

?) Refresh this Screen  M) Initial String: (not set)

Precidia Ether232Duo Configuration v5.00.02

CE Instant Issuance System CPX Protocol and Setup Manual Page 45

Page 54: Datacard CE Series Instant Issuance System

Page 46 Electrical Interface Description

Page 55: Datacard CE Series Instant Issuance System

Appendix A: Sample Line Traces

CPX Sample Line Traces

Send Line LocationsDTE: e 000001#DCL#080400 1#FC2#0950 2#FC1#0678 3#FC1#0430#END#@@@@@@e n n q q

DCE: A

Send Encode Data OnlyDTE: e 000001#DCC##ENC#%B1234 5678 9012 3456^DOE/JANE^9901? n q

DCE: A

DTC: ;1234567890123=9901?#END#@@@@@@e e e e e e e n n n n n n n q q q q q q qDCE: n n n n n C A C = Card OK, a a a a ano errors k k k k k

The poll rate for ENQ to the CE System must equal 2 seconds. Do not poll faster 

than 2 seconds for any CE model.

CE Instant Issuance System CPX Protocol and Setup Manual Page A-1

Page 56: Datacard CE Series Instant Issuance System

Emboss DataDTE: e 000001#DCC##EMB#1234 5678 9012 3456"JANE DOE"WABASH CANNONS n q

DCE: A

DTE: "#END#@@@@@@e e e n n n q q q

DCE: n n GG = Feed error found a a k k

CPX+ Read Internal CountersRead CE System Counters

DTE: e 000001#DCC##CNT##END#@@@@@ n q

Returned from CE SystemDCE: A #DCC#DTE:

DCE: #CNT#1688”1669”19”0”0”0”0”0”0”0”0”0”0”0”0”0”0”0”0”0”0”0”0”0”0”0#END#@ A

DTE: e n q

CPX Read Track Data from Magnetic StripeFeed Card into CE System

DTE: e 000001#DCC##FED#0#END#@@@@@@@@ n q

DCE: AA = Command complete,Card inside magneticstripe module

Page A-2 Sample Line Traces

Page 57: Datacard CE Series Instant Issuance System

Read and Return Track CommandDTE: e 000001#DCC##TRK##END#@@@@@@@@c n r q

DCE: A

Return Track (1-2) on CardDCE: #DCC##TRK#%ALAN MEILACH?;1234567890?#END#@ A ADTE: e e n n q q

Reject the CardDTE: 000001#DCC##REJ##END#@@@@@@@@ce e e e e e rn n n n n n q q q q q q

DCE: n n n n n A a a a a a k k k k k

Financial PasswordThe password must be sent every time the CE System is started.

DTE: ~0BDATACARD s

DCE: A* C K

* The CE System returns ACK if the password is accepted or NAK if the password is 

incorrect.

CPX Example Network Test ProgramThe following Visual Basic program uses Microsoft Winsock ActiveX Control 6.0. Perform 

the following steps to test the network:

1. Create a new Visual Basic project Form1.

2. Add Winsock active X control to Form1. Make sure the name of control is called 

Winsock.

3. Create a Command1 button on Form 1.

4. Copy the code below into the Command1 button.

5. Change the ip$ address to the CE System address.

CE Instant Issuance System CPX Protocol and Setup Manual Page A-3

Page 58: Datacard CE Series Instant Issuance System

6. Run the program. The CPX test pass displays along with the CPX status returned from 

the machine.

Private Sub Command1_Click()Dim b$Dim t&Dim ip$Dim out$Dim retriesOn Error GoTo err1retries = 3ip$ = "172.16.8.5" ' Ip address for port to CE870 unit.Winsock.Connect ip$, "15000" 'using IP to connect to server port=15000 t& = Timer + 1 '1 second wait after connection While Timer < t& ret = DoEvents() Wend

While retries <> 0 Winsock.SendData Chr$(5) 'sends the ENQ POLL CHARACTER. t& = Timer + 3 '3 second wait poll While Timer < t& If Winsock.BytesReceived <> 0 Then Call Winsock.GetData(b$, vbString, 1) MsgBox "CPX TEST PASS STATUS(" & b$ & ")" Winsock.Close 'exit lan connection Exit Sub End If ret = DoEvents() Wend retries = retries - 1 Wenderr1: MsgBox "CPX Test Failure" Winsock.CloseEnd Sub

Page A-4 Sample Line Traces

Page 59: Datacard CE Series Instant Issuance System

Appendix B: Sample C Language Drivers

Sample Listings for CPX Protocol

Sample Card Data/*Sample CPX protocol for CE System. File will run on an IBM PC or compatible.*//*Com1:baud = 9600, 8bit, no parity*//*ToolsTurbo (C) Version 2.0*/

#include <stdio.h>#include <string.h>#include "serial.h"#include "timer.h"#include <conio.h>

/*Left margin =0 .4" line (1) = 7 cpi. at 0.950 inch from bottom.*//*line (2) = 10 cpi. at 0.678 inch from bottom.*//*line (3) = 10 cpi. at 0.430 inch from bottom.*/

Static character dcc_line_loc[] = {/*Line location for emboss data*/"00000#DCL#080400 1#FC2#1085 2#FC1#0678 3#FC1#0430 #END#@@@@@@"};

static char card_emb_1[]={/*Emboss data*/"1 23456789 0123\nJANE DOE\nWABASH CANNONS\n"};

static char card_enc_1[]={/*Encode data*/"%B1234567890123^DOE/JANE^9901? ;1234567890123=9901?"};

static char card_cmp_1[]={/*Compare account number only! = ignore data*/";1234567890123=!!!!?"/*Check ABA track 2 only*/};

Do not use the following characters in the data: ) ( # ! or @. These characters are 

reserved for the CE Series CPX protocol. Change the data below to fit the application. 

Example: This could make a file load a line location block.

CE Instant Issuance System CPX Protocol and Setup Manual Page B-1

Page 60: Datacard CE Series Instant Issuance System

static char except_card[]={"Insert Exception Card"};/*CE System message. Key wait*/

#define FALSE 0#define TRUE ~FALSE#define ENQ 5/*Poll CE System command*/#define CAN 0x18/*Reset Embosser command*/

/*Internal Status Codes To Build Error Table*/

#define EOL '"'/*End Of Line code for CE System Embosser*/#define RSP_220_SIZE 32#define RSP_DATA_ERR RSP_220_SIZE-1#define RSP_TIME_ERR RSP_220_SIZE-2

#define ONE_SEC_TICK 18#define POLL_CNT 3/*Try 3 times for time-out or illegal data*/#define POLL_SEC 2#define DATA_MATCH_ERR 22#define DATA_READ_ERR 21/*Can't read or missing track data*/#define BUSY_TIME_POLL 60/*Not used. 60 Seconds stop fatal error*/#define TEMP_TIME_POLL 240/*Not used. 4 Min time-out for temp error*/#define OUT_220_CNT 26/*Display from 1 to 26 counters*/

/*CPX Output Command Controls*/

unsigned char sendbuf[1024];unsigned char respbuf[4];unsigned char mesg_buf[1024];

int timerflag;char key_code;void init_com(void);void exit_com(void);void time_out_proc(void);void delay_sec(int sec);void poll_check(char *rsp,int cardtype);void sample_card_1(void);void sample_card_2(void);void sample_card_3(void);void sample_card_4(void);void display_counters(void);

/*New for Citibank commands check*/

void test_lcd_msg(void);void test_pmt_msg(void);

/*Embossing special commands.*/

static char no_data[] = {NULL};/*Empty string no data used*/

static char dcc_rej_card[] = { "00000#DCC##REJ##END#@@@@@"/*Reject command*/};

static char cnt_220_status[] = { "00000#DCC##CNT##END#@@@@@"/*Get CE System counters*/};

Page B-2

Page 61: Datacard CE Series Instant Issuance System

/*Data Format Strings Controls*/

static char *dcc_emb_tbl[] = { "000001#DCC#",/*STX control dummy search code Not used*/ "#MSG#",/*Message table follows CE System only*/ "#CMP#",/*Emboss data follows if used*/ "#EMB#",/*Emboss data follows if used*/ "#ENC#",/*Encode data if used*/ "#END#@@@@@@"/*End of the data block*/};

/*Valid Characters From CE System CPX Protocol*/

static char dcc_err_rsp[] = { 'A', XOFF,NAK,'a','b','B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y','Z', '[‘,’]’,\0'};

/*Convert CPX Protocols To Internal 4 Byte Status Codes*//*4 Byte Status*//*0 = Status(ACK, NAK ,XOFF = Busy)*//*1 = Error Number(0 TO 40)*//*2 = Card Was Made0 = No Card Processed*//*1 = Card Error*//*2 = Card Was Made*/

/*3 = Embosser State0 = Error Recoverable*//*1 = Needs Operator*//*2 = Ready For Next Card*/

static char city_err_rsp[RSP_220_SIZE][4]={ {XON,0,0,0},/*A*/ {XOFF,0,0,0},/*XOFF Embossing card*/ {XOFF,0,0,0},/*NAK Embossing card*/ {XOFF,1,0,0},/*A topper temp warning*/ {XOFF,2,0,0},/*B waiting for card*/ {NAK,1,1,0},/*B*/ {ACK,0,2,2},/*C*/ {NAK,2,1,0},/*D*/ {NAK,3,1,1},/*E*/ {NAK,4,0,1},/*F*/ {NAK,5,1,1},/*G*/ {NAK,6,1,0},/*H*/ {NAK,7,0,1},/*I*/ {NAK,8,0,1},/*J*/ {NAK,9,0,1},/*K*/ {NAK,10,0,1},/*L*/ {NAK,11,1,1},/*M*/ {NAK,12,1,1},/*N*/ {NAK,13,1,1},/*O*/ {NAK,14,0,1},/*P*/ {NAK,15,1,1},/*Q*/ {NAK,16,0,1},/*R*/ {NAK,17,0,1},/*S*/ {NAK,18,0,0},/*T*/ {NAK,19,0,1},/*U*/ {NAK,20,0,0},/*V*/ {NAK,21,1,0},/*W*/ {NAK,22,1,0},/*X*/ {NAK,23,1,0},/*Y*/ {NAK,24,0,1},/*Z*/

CE Instant Issuance System CPX Protocol and Setup Manual Page B-3

Page 62: Datacard CE Series Instant Issuance System

{NAK,25,1,1},/*Time-out error*/ {NAK,26,1,1}/*Data invalid response*/};

static char *card_rsp_code[3]={ "No Card Processed", "Card was Processed", "Card Made No Errors"};

static char *counter_table[]={ "Total Cards ", "Good Cards ", "Bad Cards ", static char *embosser_state[]={ "Automatic Recovery of Error", "Need Operator Help!!!", "Ready For Next Card"};

static char *xoff_busy_table[3] = { "Embosser Busy ",/*00 = NAK, XOFF*/ "Heating Topper Module",/*01 = a*/ "Waiting for a Card "};/*02 = b*/static char *emboss_err_table[27] = { "OK",/*00 = A*/ "Vertical/Horizontal Stepper Error",/*01 = B*/ "Wheel Stepper Error",/*02 = D*/ "Topper Foil Low",/*03 = E*/ "OCR Ribbon Low",/*04 = F*/ "Card Feed Error",/*05 = G*/ "Magnetic Stripe Error",/*06 = H*/ "Printer Off-line",/*07 = I*/ "Reject Card Output Full",/*08 = J*/ "Card Output Full",/*09 = K*/ "Memory Error",/*10 = L*/ "Interlock Open",/*11 = M*/ "Topper Jam Error",/*12 = N*/ "Card Exit Error",/*13 = O*/ "System Error",/*14 = P*/ "OCR Ribbon Position",/*15 = Q*/ "Embossing Limits Exceeded",/*16 = R*/ "Carriage Limits Exceeded",/*17 = S*/ "Comm Failure Transmit Error",/*18 = T*/ "Comm Failure Data Format Error",/*19 = U*/ "Comm Failure Buffer Overrun Error",/*20 = V*/ "Pre-Encode Card Read Error",/*21 = W*/ "Pre-Encode Data Match Error",/*22 = X*/ "Topper Error",/*23 = Y*/ "Card Input Hopper Empty",/*24 = Z*/ “Graphic Error”,/*2X = [*/ “Graphics Supply Error”,/*2X = ]*/ "No Response Time-out",/*25 = Time out error*/

"Data Invalid Response"/*26 = Data invalid response*/};

void main (void){ int ch; int ret;

Page B-4

Page 63: Datacard CE Series Instant Issuance System

clrscr(); /*Clear the display*/ init_com();/*Init COM1:*/ printf("Sample card driver for CPX protocol."); printf("\n\nPress any key to begin space = CE System counters.\n"); key_code=getch(); /*Get character from the keyboard*/while ((key_code !=0x1b)) { if (key_code == ' ') {display_counters();/*Display CE System counters*/ key_code = 0x1b;}else { sample_card_1();/*Emboss card*/ sample_card_2();/*Emboss/encode a card*/ sample_card_3();/*Encode a card*/ sample_card_4();/*Compare data on stripe then emboss/encode the data*/ }}

/*All done exit from main loop*/

clrscr();/*Clear the display*/ exit_com();}

/*Display the Embossers response to a make card command.*/

void display_response(char *respbuf){ printf("Status:%s\nCards:%s\nEmbosser:%s\n", emboss_err_table[respbuf[1]], card_rsp_code[respbuf[2]], embosser_state[respbuf[3]]); if (respbuf[2]==1) { printf("\nCard Error inside system please remove"); printf("\nPress any key to continue\n"); getch();/*Get character from the keyboard*/ } else if (respbuf[2] == 2) { printf("\nCard in Output Stacker Please Remove"); delay_sec(5);/*Delay to show error*/ } else delay_sec(5);/*Delay to show no card processed*/

}

/*Display the Embossers warning response if used.*/

void display_warning(char *respbuf){ gotoxy(1,12); printf("Busy Status: %s\n",xoff_busy_table[respbuf[1]]);}

/*Display the Embossers CE System counters for future use.*/

void display_counters(){ char counter[10]; char msg_buf[4]; int key,i,j,k; int rev;

CE Instant Issuance System CPX Protocol and Setup Manual Page B-5

Page 64: Datacard CE Series Instant Issuance System

rev= 1; while (rev != 00) { clrscr();/*Clear screen*/ rev = send_emb_cmd (cnt_CE870_status, strlen (cnt_220_status), &msg_buf,2); msg_buf[2] = 0;/*Last status error no card processed*/ if (rev != 00) { printf("\n Will Retry to connect to CE System\n"); display_response(msg_buf); } } mesg_buf[0]=NULL; printf(" CE Status Counters\n\n\n"); j = 10; for (i=0;i < OUT_220_CNT; i++) { k=0; while ((mesg_buf[j] !=EOL)&& (k < 9)) { counter[k]=mesg_buf[j];

j++; k++; } j++; counter[k]=NULL; if (i > 12) gotoxy(40,i-12+3); else gotoxy(1,i+4); printf("%s=%s",counter_table[i],&counter); }

gotoxy(1,20); printf("\n\nPress any key to Continue\n"); key=getch();/*Get character from the keyboard*/ if (key == '\033') { exit_com(); printf("\n\nProgram aborted by operator.\n"); exit(0); }}

/*Sample output card routines to CE System Embosser (card1) (emboss only).*/

void sample_card_1(void){ int ret= 0; while (ret != 02) { clrscr();/*Clear screen*/ printf("CARD (1) EMBOSS\n%s\n\n", &card_emb_1); ret = make_card(&card_emb_1, &no_data, &no_data, &no_data, &respbuf); if (ret!=02) printf("\n Will Retry to make card\n"); display_response(respbuf); }}

/*Sample output card routines to CE System Embosser (card2)*//*(emboss and encode the card data)*/

void sample_card_2(void)

Page B-6

Page 65: Datacard CE Series Instant Issuance System

{ int ret = 0;

while (ret != 02) { clrscr();/*Clear screen*/

printf("CARD (2) EMBOSS\n%s\nENCODE:%s\n\n", &card_emb_1,&card_enc_1); ret = make_card(&card_emb_1, &card_enc_1, &no_data, &no_data, &respbuf); if (ret!=02) printf("\n Will Retry to make card\n"); display_response(respbuf); }}

/*Sample output card routines to CE System Embosser (card3)*//*(encode the card data only)*/

void sample_card_3(void){ int ret = 0;

clrscr();/*Clear screen*/ while (ret != 02) { printf("CARD (3) ENCODE: %s\n\n", card_enc_1); ret = make_card(&no_data, &card_enc_1, &no_data,&no_data, &respbuf); if (ret!=02) printf("\n Will Retry to make card\n"); display_response(respbuf); }}

/*Sample output card routines to CE System Embosser (card4)*//*(read the stripe data on the card)*//*If the data matches the compare string. (emboss/encode card)*//*else if the data does not match the card is rejected.*/

void sample_card_4(void){ int ret = 0; clrscr(); printf("\n\nData Match Sample Card"); printf("\n\nTake Card(3) with Encode data and return to input Hopper"); printf("\nIf the Data Matches the card will be embossed/encoded"); printf("\nPress <F1> key on CE System Embosser to start\n\n"); delay_sec(5);/*Delay to show*/ while (ret != 02) { clrscr(); printf("CARD (4) \nCOMPARE:%s\nEMBOSS\n%s\nENCODE:%s\n\n", &card_cmp_1, &card_emb_1, &card_enc_1); ret = make_card(&card_emb_1, &card_enc_1, &card_cmp_1, &except_card, &respbuf);

CE Instant Issuance System CPX Protocol and Setup Manual Page B-7

Page 66: Datacard CE Series Instant Issuance System

if (ret!=02) printf("\n Will Retry to make card\n"); display_response(respbuf); }}

/*Make card routine (CE System CPX protocol).*//*Inputs:*//*(Set option to a null string if not used)*//*Emboss string = Emboss lines end with \n)*//*Encode string = track1, track2, track3 encode data.*//*Compare string = track1, track2, track3 to compare data.*//*Use a (!) character to ignore data character.*//*Message string = output message to CE System 40 bytes then wait for key.*/

/*rspbuf[] = 4 byte status code returned*//*rspbuf[0]=STATUS(ACK = No error, NAK = Error found)*//*rspbuf[1]ERROR NUMBER(0 TO 40)*//*rspbuf[2]CARD STATUS0 = No card processed*//*1 = Card error*//*Card was made*//*rspbuf[3]EMBOSSER STATUS0 = CE System Recoverable error.*//*1 = Needs operator*//*2 = Ready for next card*/

int make_card (char *emb_data, char *enc_data, char *cmp_data, char *msg_data, char *rsp_buf){ int rev; int j; unsigned char rej_buf[4];/*Reject card response buffer*/

/*First thing to do is send the line location block to the CE System*/

rev = send_emb_cmd (dcc_line_loc, strlen (dcc_line_loc), rsp_buf,0); if (rev != 0) { rsp_buf[2] = 0;/*Last status error no card processed*/ rsp_buf[3] = 1;/*Need help*/ return 0; }/*Build the emboss data buffer*/

strcpy (sendbuf, dcc_emb_tbl[0]);/*#DCC#*/ if (strlen (msg_data) != 0) {/*Message data*/ strcat (sendbuf, dcc_emb_tbl[1]); strcat (sendbuf, msg_data); } if (strlen (cmp_data) != 0) {/*Compare data*/ strcat (sendbuf, dcc_emb_tbl[2]); strcat (sendbuf, cmp_data); } if (strlen (emb_data) != 0) {/*Emboss data*/ strcat (sendbuf, dcc_emb_tbl[3]); j = strlen (sendbuf); strcat (sendbuf, emb_data);

Page B-8

Page 67: Datacard CE Series Instant Issuance System

/*Convert new line or cr to CE System end of line*/

while (sendbuf[j] != '\0') { if (sendbuf[j] == '\n') sendbuf[j] = EOL; else if (emb_data[j] == '\r') sendbuf[j] = EOL; j++; } } if (strlen (enc_data) != 0) {/*Encode data*/ strcat (sendbuf, dcc_emb_tbl[4]); strcat (sendbuf, enc_data); } strcat (sendbuf, dcc_emb_tbl[6]);/*End of data*//*Send the card data to the CE System*/

rev = send_emb_cmd (sendbuf, strlen (sendbuf), rsp_buf,1); if (rsp_buf[1] == DATA_MATCH_ERR || rsp_buf[1] == DATA_READ_ERR) {

/*Future, you could read the card but for now will just reject it.*//*Example: #TRK# command could read the track data at this point.*/

rev = send_emb_cmd (dcc_rej_card, strlen (dcc_rej_card), &rej_buf,0); if (rej_buf[0] != XON) rsp_buf[3]=1;/*Card reject error*/ } return rsp_buf[2];/*Return card status*/

}

/*Send a command to the Embosser in (CE System data block form)*//*Returns 0 = Command Executed, - 1 = Command not completed*//*Inputs = send_cmd = #DCC# command*//*len = size of buffer*//*rsp_buf = 4 byte status return*//*type = 0 #DCC# command 1 = card data needs 'c' response*//*2 = message is returned*/

int send_emb_cmd (char *send_cmd, int len, char *rsp_buf,int card_type){ int i;

poll_check(rsp_buf,0);/*Embosser must be XON status to send card*/ if (rsp_buf[0] == NAK) return(-1); if ((rsp_buf[0] != XON) && (rsp_buf[0] !=ACK)) { movmem(&city_err_rsp[RSP_DATA_ERR],rsp_buf,4);/*Out of sequence*/ return(-1); }

/*Output command code to CE System*/

for (i=0; i < len; ++i )

CE Instant Issuance System CPX Protocol and Setup Manual Page B-9

Page 68: Datacard CE Series Instant Issuance System

writeserial(send_cmd[i]);/*COM1: Output character*/

/*Wait for response to command is done*/ for (i=0; i <5; ++i ) {/*Check for XON maximum 5 times*/ poll_check(rsp_buf,card_type);/*Embosser must be XON status to send card*/ if ((card_type== 2) && (rsp_buf[0]==XON)) return(0); if ((card_type== 0) && (rsp_buf[0]==XON)) return(0); if (rsp_buf[0] == ACK) return(0); if (rsp_buf[0] == NAK) return(-1); } movmem(&city_err_rsp[RSP_DATA_ERR],rsp_buf,4);/*Out of sequence*/

return(-1);}

/*Poll the Embosser to get the current status.*/

void poll_check(char *rsp_buf,int card_type){ int mesg_flg; int poll_flg; int warn_cnt; int i; int j; int key; char *ptr; char char_220; warn_cnt=0; for (j = 0; j <= POLL_CNT; j++ ) { if (card_type!=2) { clear_serial_queue();/*COM1: Clear all data in input buffer*/

/*Poll CE System Every 2 Seconds For 3 Times or Error*/

writeserial(ENQ);/*COM1: Send character*/ } poll_flg=TRUE; mesg_flg=FALSE; card_type=0; i =0; while ((mesg_flg == TRUE) || (poll_flg==TRUE)) { poll_flg=FALSE; timerflag = FALSE;/*IBM clock interrupt control*/ ticker = POLL_SEC * ONE_SEC_TICK; key = '\0';

/*Com1: input_char_ready check to see if character found*/

while ((!input_char_ready()) && (timerflag == FALSE)) { if (kbhit()) { if ((key = getch()) == '\033')/*ESC key*/ break; } } if (key == '\033') { exit_com(); printf("\n\nProgram aborted by operator.\n"); exit(0); }

Page B-10

Page 69: Datacard CE Series Instant Issuance System

if (timerflag == FALSE) { char_220 = readserial();/*COM1: read character from buffer*/ if (mesg_flg == TRUE) { mesg_buf[i]=char_220; i++; if (char_220=='@') { mesg_flg=FALSE; mesg_buf[i]=NULL; i = RSP_TIME_ERR; } } else if (char_220 == '#') { i = 0; mesg_flg=TRUE; mesg_buf[i]=char_220; i++; } else if ((ptr = strchr(dcc_err_rsp,char_220)) != NULL) i = (int)(ptr - dcc_err_rsp); else i = RSP_DATA_ERR; } else { mesg_flg = FALSE; i = RSP_TIME_ERR; } } movmem(&city_err_rsp[i], rsp_buf, 4); if (rsp_buf[0] == XOFF){ j =0;/*Busy, reset the poll*/ delay_sec(1);/*Keep the poll rate at 1 second*/ warn_cnt++; if (warn_cnt==5) {/*Every 5 seconds check*/ display_warning(rsp_buf);/*Display warning message*/ warn_cnt=0; } } else if ((rsp_buf[0]==ACK) || (rsp_buf[0]==XON)) return; else if ((rsp_buf[1]!=26) && (rsp_buf[1]!=25))/*Retry for time-out or invalid response*/ return; }}

void init_com(void){ intercept_timer(time_out_proc);/*IBM sets up clock interrupt call*/ initserialport();/*COM1: init com, 9600, 8, N, DTR, RTS = ON*/}

void exit_com(void){

clear_serial_queue();/*COM1: Clear serial com*/ restore_serialint();/*Return for DOS exit*/ restore_timer();/*Return for DOS exit*/}

void time_out_proc(void)/*IBM clock Interrupt call*/

CE Instant Issuance System CPX Protocol and Setup Manual Page B-11

Page 70: Datacard CE Series Instant Issuance System

{ timerflag = TRUE;/*When ticker = 0 then set this flag*/}

void delay_sec(int sec)/*Time delay in seconds*/{ timerflag = FALSE; ticker = sec * ONE_SEC_TICK; while (timerflag == FALSE);}

Page B-12

Page 71: Datacard CE Series Instant Issuance System

Appendix C: Hexadecimal/Decimal/ASCII Conversion

HEX Decimal ASCII HEX Decimal ASCII HEX Decimal ASCII HEX Decimal ASCII

00 000 NUL 20 032 SP 40 064 @ 60 096 `

01 001 SOH 21 033 ! 41 065 A 61 097 a

02 002 STX 22 034 “ 42 066 B 62 098 b

03 003 ETX 23 035 # 43 067 C 63 099 c

04 004 EOT 24 036 $ 44 068 D 64 100 d

05 005 ENQ 25 037 % 45 069 E 65 101 e

06 006 ACK 26 038 & 46 070 F 66 102 f

07 007 BEL 27 039 ‘ 47 071 G 67 103 g

08 008 BS 28 040 ( 48 072 H 68 104 h

09 009 HT 29 041 ) 49 073 I 69 105 i

0A 010 LF 2A 042 * 4A 074 J 6A 106 j

0B 011 VT 2B 043 + 4B 075 K 6B 107 k

0C 012 FF 2C 044 , 4C 076 L 6C 108 l

0D 013 CR 2D 045 ‐ 4D 077 M 6D 109 m

0E 014 SO 2E 046 . 4E 078 N 6E 110 n

0F 015 SI 2F 047 / 4F 079 O 6F 111 o

10 016 DLE 30 048 0 50 080 P 70 112 p

11 017 DC1 31 049 1 51 081 Q 71 113 q

12 018 DC2 32 050 2 52 082 R 72 114 r

13 019 DC3 33 051 3 53 083 S 73 115 s

14 020 DC4 34 052 4 54 084 T 74 116 t

15 021 NAK 35 053 5 55 085 U 75 117 u

16 022 SYN 36 054 6 56 086 V 76 118 v

17 023 ETB 37 055 7 57 087 W 77 119 w

18 024 CAN 38 056 8 58 088 X 78 120 x

CE Instant Issuance System CPX Protocol and Setup Manual Page C-1

Page 72: Datacard CE Series Instant Issuance System

19 025 EM 39 057 9 59 089 Y 79 121 y

1A 026 SUB 3A 058 : 5A 090 Z 7A 122 z

1B 027 ESC 3B 059 ; 5B 091 [ 7B 123 {

1C 028 PS 3C 060 < 5C 092 \ 7C 124 |

1D 029 GS 3D 061 = 5D 093 ] 7D 125 }

1E 030 RS 3E 062 > 5E 094 ^ 7E 126 ~

1F 031 US 3F 063 ? 5F 095 _ 7F 127 DEL

Page C-2

Page 73: Datacard CE Series Instant Issuance System

Appendix D: Testing and CPX Application

Testing ToolsTesting tools can be found on the Datacard PartnerPage.

• The CE8XX CPX Simulator is used to simulate a CPX protocol without a DPCL2 printer 

(PN: 506535‐001).

• The CPX‐CE8XX Demo tool is used to send CPX commands to the CE System printer 

(PN: 506645‐001).

CPX Simulator1. To connect to a CE System printer, select the DPCL Used check box.

• Select the TCP/IP box to use the Ethernet connection. Enter the printer’s IP 

address.

• The CE System does not have a serial port. If you deselect TCP/IP and select a 

serial port, you must use a protocol converter box.

If DPCL is not selected, only a protocol converter box can be used.

2. Click Connect. You now can send CPX data.

The Card Data shows what the card looks like.

CE Instant Issuance System CPX Protocol and Setup Manual Page D-1

Page 74: Datacard CE Series Instant Issuance System

CPX Demo Program to CE SystemThis program is similar to the 150i Demo Program (550602) but is designed for the CE 

System CPX version. It uses current standard SE48 and 150i CPX commands to make a 

card. You need to set how you want to interface to the printer. The default TCP/IP port for 

a CPX application is 15000.

Page D-2

Page 75: Datacard CE Series Instant Issuance System

Debugging CPX Using the Audit Logs1. Set FilterDevelopment to Error mode. This allows you to collect CPX logs.

2. Retrieved logs include CE System log information, followed by emboss information, 

followed by CPX logs

26: 0d 00h 03m 15.332s [JOB_____NOTICE ] Resolved condition 0-JobSucceeded Notice 29/30 "hostname".757398.0.0Reset Log0: 0d 00h 04m 06.082s [PERSO___DEBUG ] embDiagTest.cpp-647 -LOG FILE-Action Type= 28 Log File= 0: 0d 00h 05m 37.153s [PERSO___DEBUG ] embDiagTest.cpp-647 -LOG FILE-Action Type= 28 Log File= Reloading syslogd...[ OK ]Reloading klogd...[ OK ]26: 0d 00h 04m 23.913s cpx: CPX FILE ERROR=COMM Port Failure26: 0d 00h 04m 23.918s cpx: ********************CPX Powerup Message***********************26: 0d 00h 04m 23.922s cpx: CE870/CPX-DES26: 0d 00h 04m 23.934s cpx: 506535 Rev U 26: 0d 00h 04m 23.938s cpx: BuildCodeDate=May 22 2012 11:08:4426: 0d 00h 04m 23.947s cpx: ********************CPX End Powerup Message***********************26: 0d 00h 04m 23.957s cpx: The Client 192.168.1.115 is connected...

CPX logs:

• Reside in the printer under /var/dpcl/save/log/extra.log 

• Contain debug log information and any error code information.

• Are combined with the OpenCard, panel, and other application logs.

CE Instant Issuance System CPX Protocol and Setup Manual Page D-3

Page 76: Datacard CE Series Instant Issuance System

CPX.cfg Settings File for CPX ApplicationTo upload or download the CPX.cfg file, use the CPX Card Demo Program. Select 

Setup > Download Default CPX.CFG to reset the printer to its default settings.

The CPX.cfg file stores CPX options. You can change the file using the CPX demo tool under Setup > Upload CPX.CFG File or Setup > Download CPX.CFG File. The file contains a text file that can be used to set CPX option changes as needed. 

/* Standard WHEEL(USA) KIT 553675-801 12.13.05 */[init]format=0 ;[0]CPX-#DCC# [1]Open You can select Open or CPX formatpassword=0 ;[0]On [1]Off Used to set the Password option on or off for magstripe.

/* escape codes */commesc=035 ;35-#commnl=034 ;34-"commend=064 ;64-@

[150i_tbl] Used to change the default fonts (3) and font(4) to another indent type font.font3=3 ;font convert font4=4

/* Defaut line-locations */[emb_line_01]font=2horz=0400vert=0840

[password_1] contains Password options for the printer.

[test]testcard=0 ; Set to 1 so on power up a CPX testcard is made.monitor=0 ;[0] Off [1] Card [2] Comm. [3] Stripe Used for software debugging.

[end] /* end of config file */

Option Settings to Control CPXTo use CPX controls, the following options need to be set in production mode.

1. CPX Enabled  Used when the printer is changed from factory mode. Allows Port 

15000 to be open.

2. DPCL, DPCL2 Enabled  CPX requires the DPCL and DPCL2 options to be enabled.

3. Plugin Disabled  Plug in takes over the DPCL controls required by CPX.

4. Remake Disabled  Remakes are not allowed with the CPX protocol.

We recommend that you turn off the Password option for the CE System. Set 

password=1 [Off] in the CPX.cfg file.

Page D-4

Page 77: Datacard CE Series Instant Issuance System

Embosser Settings Default Embosser Settings Default

ActivityLogExternal Enabled DTCPrintModule Enabled

ActivityLogInternal Enabled DTCPunch Enabled

AutoDuplex Enabled DTCRejectHopper Enabled

CardPresent Enabled DTCSingleFeed Enabled

Color300x300 Enabled DTCTransport Enabled

Color300x600 Enabled EmbossModule Enabled

CPX Enabled EmbossModuleEmboss Enabled

DPCL Enabled EmbossModuleExpected Enabled

DPCL2 Enabled EmbossModuleIndent Enabled

DPCL2Secure Enabled EmbossModuleTop Enabled

DPCLSecure Enabled Ethernet Enabled

DPM Enabled FactoryMode Enabled

DPMSecure Enabled LCDColor Enabled

DTC40vBoost Enabled LCDPanel Enabled

DTCBarcode Enabled MagstripeAamvaEncoding Enabled

DTCBoardVersion3 Enabled MagstripeSaflokEncoding Enabled

DTCDuplex Enabled MagstripeTimeloxEncodin Enabled

DTCICDualiDeAbcm Enabled MagstripeVingEncoding Enabled

DTCInputHopper Enabled ManualDuplex Enabled

DTCLocks Enabled Monochrome300x1200 Enabled

DTCMagstripeISO Enabled Monochrome300x300 Enabled

DTCMagstripeJIS Enabled Monochrome300x600 Enabled

DTCOutputHopper Enabled Plugin Disabled

DTCPrintHead Enabled Remake Disabled

SingleFeed Enabled

CE Instant Issuance System CPX Protocol and Setup Manual Page D-5

Page 78: Datacard CE Series Instant Issuance System

Page D-6

Page 79: Datacard CE Series Instant Issuance System

Appendix E: Tactile Identifier Mark Conversion

Embosser font 11 allows you to emboss up to three Braille (Tactile Identifier Mark or TIM) 

characters on a card. Braille uses a 6‐dot format to represent letters, numbers, and 

combinations of sounds. 

The Braille characters are expressed as a sequence of numbers that indicate the position 

of the dots, with dots 1–3 in the left column, and dots 4–6 in the right column.

The CE system uses a single emboss character to form each dot. Up to three 6‐dot 

characters can be embossed in any allowed location on the card.

The vertical and horizontal spacing between the embossed dots is 0.091 in (2.3 mm). The 

distance between characters is 0.240 in (6.1 mm).

Because there isn’t a one‐to‐one correlation between the ASCII value and the Braille 

character, use the following conversion table to map your ASCII data to the Braille 

characters. The table includes the dot sequence for each character and its binary 

representation.

Some characters must be sent as an ASCII sequence because they are reserved XML 

characters. In addition, some characters have more than one valid value. All are 

shown in the following table.

CE Instant Issuance System CPX Protocol and Setup Manual Page E-1

Page 80: Datacard CE Series Instant Issuance System

ASCII (dec) ASCII (hex)ASCII (char)

Braille Dots (dec)

Braille Dots (bin) Cell Meaning

32 20 (space) (none) 00000000 (space)

33 21 ! 2-3-4-6 00101110 the

38-113-117-111-116-59

26-71-75-6F-74-3B

&quot; 5 00010000 (contraction)

35 23 # 3-4-5-6 00111100 (number prefix)

36 24 $ 1-2-4-6 00101011 ed

37 25 % 1-4-6 00101001 sh

38-97-109-112-59

26-61-6D-70-3B

&amp; 1-2-3-4-6 00101111 and

38-97-112-111-115-59

26-97-70-6F-73-3B

&apos; 3 00000100 ‘

40 28 ( 1-2-3-5-6 00110111 of

41 29 ) 2-3-4-5-6 00111110 with

42 2A * 1-6 00100001 ch

43 2B + 3-4-6 00101100 ing

44 2C , 6 00100000 (uppercase prefix)

45 2D - 3-6 00100100 -

46 2E . 4-6 00101000 (italic prefix)

47 2F / 3-4 00001100 st

48 30 0 3-5-6 00110100 “

49 31 1 2 00000010 ,

50 32 2 2-3 00000110 ;

51 33 3 2-5 00010010 :

52 34 4 2-5-6 00110010 .

53 35 5 2-6 00100010 en

54 36 6 2-3-5 00010110 !

Page E-2

Page 81: Datacard CE Series Instant Issuance System

55 37 7 2-3-5-6 00110110 ( or )

56 38 8 2-3-6 00100110 “ or ?

57 39 9 3-5 00010100 in

58 3A : 1-5-6 00110001 wh

59 3B ; 5-6 00110000 (letter prefix)

124 7C | 1-2-6 00100011 gh

61 3D = 1-2-3-4-5-6 00111111 for

126 7E ~ 3-4-5 00011100 ar

63 3F ? 1-4-5-6 00111001 th

64 40 @ 4 00001000 (accent prefix)

65 or 97 41 or 61 A or a 1 00000001 a

66 or 98 42 or 62 B or b 1-2 00000011 b

67 or 99 43 or 63 C or c 1-4 00001001 c

68 or 100 44 or 64 D or d 1-4-5 00011001 d

69 or 101 45 or 65 E or e 1-5 00010001 e

70 or 102 46 or 66 F or f 1-2-4 00001011 f

71 or 103 47 or 67 G or g 1-2-4-5 00011011 g

72 or 104 48 or 68 H or h 1-2-5 00010011 h

73 or 105 49 or 69 I or i 2-4 00001010 i

74 or 106 4A or 6A J or j 2-4-5 00011010 j

75 or 107 4B or 6B K or k 1-3 00000101 k

76 or 108 4C or 6C L or l 1-2-3 00000111 l

77 or 109 4D or 6D M or m 1-3-4 00001101 m

78 or 110 4E or 6E N or n 1-3-4-5 00011101 n

79 or 111 4F or 6F O or o 1-3-5 00010101 o

ASCII (dec) ASCII (hex)ASCII (char)

Braille Dots (dec)

Braille Dots (bin) Cell Meaning

CE Instant Issuance System CPX Protocol and Setup Manual Page E-3

Page 82: Datacard CE Series Instant Issuance System

80 or 112 50 or 70 P or p 1-2-3-4 00001111 p

81 or 113 51 or 71 Q or q 1-2-3-4-5 00011111 q

82 or 114 52 or 72 R or r 1-2-3-5 00010111 r

83 or 115 53 or 73 S or s 2-3-4 00001110 s

84 or 116 54 or 74 T or t 2-3-4-5 00011110 t

85 or 117 55 or 75 U or u 1-3-6 00100101 u

86 or 118 56 or 76 V or v 1-2-3-6 00100111 v

87 or 119 57 or 77 W or w 2-4-5-6 00111010 w

88 or 120 58 or 78 X or x 1-3-4-6 00101101 x

89 or 121 59 or 79 Y or y 1-3-4-5-6 00111101 y

90 or 122 5A or 7A Z or z 1-3-5-6 00110101 z

91 5B [ 2-4-6 00101010 ow

92 5C \ 1-2-5-6 00110011 ou

93 5D ] 1-2-4-5-6 00111011 er

94 5E ^ 4-5 00011000 (contraction)

95 5F _ 4-5-6 00111000 (contraction)

ASCII (dec) ASCII (hex)ASCII (char)

Braille Dots (dec)

Braille Dots (bin) Cell Meaning

Page E-4


Recommended