User's Manual

Elatec GmbH
Page 31 of 44
7.2.5.1.1 Generally Available Transponder Operations
byte TagSearch(byte &IDData, byte &IDBitCnt, byte &TagType)
Search a transponder. This function behaves similar on different types of transponder readers, but not
identical.
Parameter:
byte &IDData Reference to a bit field (in fact an array of bytes), which receives the ID
data.
byte &IDBitCnt Number of valid bits(!), the ID consists of.
byte &TagType Type of tag, which has been found.
Return: If a transponder has been found, the return value is TRUE, otherwise it is
FALSE.
The following table shows, how data is stored in the given array of bytes:
Maximum length
of ID (bits)
Maximum length
of ID (bytes)
IDBitCnt is always
a multiple of 8 bits
Multi125 64 8 Yes
Mifare 56 7 Yes
HID Prox 128 16 No
HID iClass 128 16 Yes
Legic 128 16 Yes
If IDBitCnt is a multiple of 8 bits, then the number of involved bytes simply can be calculated by
following formula:
IDByteCnt = IDBitCnt/8;
If IDBitCnt is not a multiple of 8 bits, then the number of involved bytes can be calculated by a
somewhat more complicated formula:
IDByteCnt = (IDBitCnt+7)/8;
The second formula can be used in general but occupies somewhat more program space.
byte TagRead(byte Address, byte ByteCnt, byte &Data)
Read data from a selected transponder.
Parameters:
byte Address The address within the address space of the transponder.
byte ByteCnt Number of bytes to read.
byte &Data Reference to an array of bytes, where the read data will be stored.
Return: If the operation was successful, the return value is TRUE, otherwise it is
FALSE.