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:
- MS - Move the card to a certain area of the printer.
- >WB - Communicate directly with the installed smart card encoder.
- ME - Eject the card from the printer.
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:
>WB 1 1 FF 01 C5 01 19 BC
>WB 1 1 FF 10 23 00 96 00 00 38 38 38 38 38 38 38 38 38 38 38 38 76 98
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:
- FF is the start of header (SOH) character which is required before any encoder commands are sent.
- 10 is the hexadecimal size of the data to be sent to the encoder. The size is measured starting at timeout value (00 96 in our case) and ending at the CRC (76 98 in our case). For our example, this results in 16 digits = 0x10 hexadecimal digits.
- 23 is the operation code. Each operation code tells the encoder to perform a different action. Operation code 23 tells the encoder to write to EPC memory.
- 00 96 is the hexadecimal timeout value, in milliseconds. 96 hexadecimal converts to 150 decimal, meaning that we will use a timeout of 0.15 seconds.
- 00 00 are parameters which are reserved for future use.
- 38 38 38 38 38 38 38 38 38 38 38 38 is the hexadecimal representation of the ascii data which we are trying to encode. In our case, this will result in the string '888888888888' being encoded.
- 76 98 is the checksum for this command. The Mercury 5e Developer's Guide explains how to calculate the CRC on page 48.
>ME: This command ejects the UHF card from the card printer.
Sending Pure EPCL to Zebra Card Printer Read More>>