cardexchange technical webinar
TRANSCRIPT
CardExchange Interactive Demonstration
Presented by: Mark Phelan – Group Development & Integration Manager
Start Time: 9.15am
Shortly before the start time shown above, the presenter will arrive. Please hold until then.
o Can you hear me?
• If not, please advise via the question panel
o Questions + feedback
• Send in via the panel as you think of them
• Invite input at the end of each Section
• Off-line discussions
o Presentation Slides: Available on request
Formalities
Contents
• Mappings
• Managing data
• Custom designer functions with Python
• Contactless encoding
• Your questions
This webinar is intended as a look at more advanced techniques that can be used within CardExchange. It assumes some understanding of the basic usage of the software, but assistance can be given on all aspects if required.
Mappings
A mapping is the link for a variable data item.
Mappings fall in to one of these categories:
VisibleAn item that appears on the card layout
StorageSomething that is written to the DB during printing
MagneticData written to a magstripe on the card
ContactlessInformation written to a smartcard during printing
Mappings
Each data item needs to be configured so that CardExchange knows what information should be recorded or displayed.
CardExchange can use the following data sources:
•.NET function (some external code to produce data)•Concatenation of various data•Database column•Manual data entry•Environment variable (such as the username / PC name)•Counter•Print Date•Variable Image/Photo•Card Preview Image
Mappings
.NET Functions
Relies on vb.net code, which can be called to perform external actions when the card is previewed or printed.
Examples of code we have written:
-To calculate an expiry date based on the current date and the yeargroup of a student-Produce a specific barcode format for a library system-To check if a user’s photo exists and if not download it from an external system and store it on the disk.
The use of scripts in this way is normally reserved for more complex tasks that cannot be carried out with the built-in functionality.
Mappings
Manual Data Entry
This mapping type has a couple of different uses:
-Prompting for some information from the operator prior to printing-Setting a fixed value to be stored in the database for all cards-Prompting for confirmation prior to each print
It’s useful for creating “adhoc cards” where a database may not be in use – eg for visitors/contractors the details can simply be keyed in.
Managing Data
Database views vs. tablesViews are typically “read-only” and may require the use of triggers to store any information, or a separate table.
Dropdown selections for data itemsWhere a choice of data on the card needs to be made the operator can be given a dropdown box to select from.
Storing a print counterUseful for keeping track of how many cards have been issued to each user.
Writing to multiple databasesIf cards are used with disparate systems separate links can be created – only one database can be the “read” source.
Working without a database of users
Managing Data
Dropdown selections for data items
You need a data source configured for this to work, however it can simply be a table in a file or DB that records printed cards.
Dropdown options can be stored in a table/database
… or simply a pre-defined list
Managing Data
Storing a print counter
To track issue numbers for each user, a column is required to hold the counter for each user.
When configuring the database connection, you must select a column to be incremented each time a card is printed as a Storage Item:
Managing Data
Working without a DB of users
Where cards need to be produced on-the-fly, there are numerous ways to quickly create cards without having a pre-defined list of user details.
-Use manual data entry- Prompts for relevant data items, some of which can be
configured to not be left blank-Configure the DB to add new records
- Adding rows to the table isn’t quite as intuitive but allows for storing of information for future re-printing
-Alter the card design- Requires launching the card designer software and making
changes, then saving and printing.
Custom designer functions
Uses a .NET implementation of Python called IronPython- Not all Python functions are supported- Allows use of some .net assemblies- Perfect for calculating or manipulating data
Examples of usage:Changing the format of texteg. “surname, forename” to “forename surname”
Calculating an expiry date
Changing colours of objects/text based on data values
Calculating checksums/barcodes
Custom designer functions
When writing Python observe the use of indentations (tabs or spaces) as it’s crucial to the correct execution of the code.
Any syntax errors will be reported in the “content” tab of the properties window. Simply click any text object that is linked to a script to view any errors.
To show text based on the output of a script, create a text object and set the value to be “Script”. Match the script name to the function name:
Custom designer functions
A simple example - First initial from a forename
def firstChar(text): return text[:1]
Custom designer functions
Insert a new text fieldSet the type to “Script”Configure the value to be FunctionName(VariableData)Configure the named variable to link to a database field
Custom designer functions
Highlighting if a user is under 18 based on their date of birth:
This function will return the words “U18” to be shown on the card, or nothing if the individual is over the age of 18.
import datetime, time, System
def isUnder18(dob): dob = System.DateTime.Parse(dob) today = System.DateTime.Today age = today.Year - dob.Year if (age < 18): return "U18" else: return None
Custom designer functions
Generate an Expiry Date:
def expiryDate(): import datetime now = datetime.datetime.now() from datetime import timedelta diff = datetime.timedelta(days=(365*2)) future = now + diff return future.strftime("%d/%m/%Y")
Custom designer functions
Reversing order of name
def FlipName(name): nameTokens=name.split(',',1) return (nameTokens[1]+' '+nameTokens[0]).strip()
Custom designer functions
Using functions to change colours
Use the “Expressions” tab to customise attributes for objects such as colour, border, font, etc.
Create a function that returns the appropriate data, such as an HTML colour code (32-bit ARGB, eg #FFFF0000 for red)
def u18Colour(dob): dob = System.DateTime.Parse(dob) today = System.DateTime.Today age = today.Year - dob.Year if (age < 18): return "#FFFF0000" else: return "#FF000000"
Contactless Encoding
Mifare Classic & DESfire - Overview
Classic – memory is split in to “sectors”, each sector contains a series of blocks. Each block is 16 bytes.
In 1K cards there are 16 sectors, each contains 4 blocks.One of these holds the access keys giving 48 usable bytes for data in each sector. 16 sectors x 4 blocks x 16 bytes = 1024 bytes = 1K
In 4K cards there are 32 sectors with 4 blocks and the last 8 sectors contain 16 blocks. (32 sectors x 4 blocks x 16 bytes) + (8 sectors x 16 blocks x 16 bytes) = 4096 bytes = 4K
Contactless Encoding
Mifare Classic & DESfire - Overview
DESfire – memory is managed by using applications, each having a unique ID. Think of each application as a folder on a hard drive.Each application then has numbered files, each contains data.
There are various encryption methods that can be utilised, along with numerous keys to protect the card, application, and files and provide read or write access.
Card can have 2K, 4K or 8K of memory
Mifare Classic cards typically have a 4 or 7-byte serial number hard-coded (regardless of 1K or 4K capacity).
Mifare DESfire cards have a 7-byte serial number.
Contactless Encoding
How CardExchange manages encoding
Most printer manufacturers now fit OEM modules from 3rd parties to handle the encoding of cards during printing.
CardExchange communicates with the encoders via the Windows Smartcard Service.
All encoding is performed via USB connection, so the printer must be local to a Windows PC.
CardExchange offers a “Print Server” to allow remote clients to print & encode via the network.
Contactless Encoding
How CardExchange manages encoding
Contactless encoding has two main tasks:
-To read the chip serial number-To write to the card’s internal memory (or to read from it if the cards are pre-encoded)
The chip serial number is often used as a unique identifier for each card and cardholder. It is useful to record this information at the time of print (even if it is not to be used immediately) as it will ensure future use of the card is simple.
The cards internal memory can be utilised to store data – such as a unique ID for each individual (such as a staff/student number) or other details like their name or date of birth.
www.ait.co.uk/support
Email: [email protected]
Call: 0113 273 0300
Thank You
For more information, how-to guides and support: