How to Encode UHF Contactless Cards with EPCL
Article ID: 84856021
Topic or Information
Using the EPCL Programming Language to encode UHF RFID Cards
EPCL Programming Language used with P330i and P430i Performance Class Zebra Card Printers
Zebra's P330i and P430i card printers feature an optional Ultra High Frequency (UHF) RFID encoder which can be used to read and write to 900 MHz UHF cards. Through tools such as CardStudio, SC Verification Tool, and the Performance and Value Class SDK (all available via search at www.zebra.com), a user can readily control the ThingMagic Mercury 5e encoder to begin encoding. When developing a custom application, it is encouraged to use the UHF portion of the Performance and Value Class SDK as it provides a consistent, easily-understood, and up-to-date API to work with encoding. In the event that you cannot use the SDK for UHF encoding, EPCL (the P330i/P430i native control language) can be utilized. Here we explain some basic EPCL commands needed to perform UHF encoding. It is greatly encouraged that you download the ThingMagic Mercury 5e Developer's Guide (available online) as it is the definitive source of information for the encoder commands used here.
For the purposes of EPCL, only three commands are needed to communicate with a ThingMagic Mercury 5e UHF encoder:
Here we show an example of these commands in action. The following EPCL command set will encode the data '888888888888' to a NXPG2XM or Monza-4 card in the EPC memory bank:
Explanation of Commands
MS 5: This command moves the UHF card from the feeder to the encoder.
>WB 1 1 FF 01 C5 01 19 BC: The command >WB is an EPCL command that allows us to send data to the smart card encoder. The first two parameters (1 and 1) indicate that we will be speaking to the ThingMagic Mercury 5e UHF encoder. The remaining parameters are encoder-specific commands that prepare the Mercury 5e module for encoding. We send the parameters as ascii pairs representing the hexadecimal value to be sent to the encoder.
>WB 1 1 FF 10 23 00 96 00 00 38 38 38 38 38 38 38 38 38 38 38 38 76 98: This command performs the actual encoding of our data '888888888888'. Again we use >WB as an EPCL command that allows us to send data to the smart card encoder. The parameters one and one indicate that we will be speaking with the ThingMagic Mercury 5e encoder. The following breakdown, paraphrased from the Mercury 5e Developer's Guide, explains each remaining parameter:
>ME: This command ejects the UHF card from the card printer.
Sending Pure EPCL to Zebra Card Printer Read More>>
- P430i Card Printer
- P330i Card Printer