Академический Документы
Профессиональный Документы
Культура Документы
Version: V2.0.0
Dear Customers:
Thanks for your trust and support! We try best to provide you comprehensive service and technical
support.
This manual will introduce How to use API of SAAT-800 series Reader, so that your integrated software
can communicate, configure reader parameter, control the command of reader reading tags, and
information of tags returned. Please consult our technical support if you have problems of using products.
Welcome to contact us for any feedback and suggestion.
This manual is suitable for the following readers:
The manual is supposed that the user already owns basic RFID and computer knowledge, so that related
terms such as RFID, RF and Ethernet is not described in details, the users can search and inquire
reference, or consult our technical department.
Warning
If violate the signed operation method or usage environment, which will do damage to health or
devices.
Advice
2 Files........................................................................................................................ 1
I
1.1 Send "Read UID Code" Command: ............................................................................. 14
II
Part I
The Methods of Calling API
2 Files
API Functions including the following files:
RFIDAPI.dll
RFIDAPI.lib
RFIDAPIEXPORT.h
1
Part II
Connect Reader
//Function: upload through parameter, this function is used for the ethernet app. configuration of computer and
//Parameter:
For example, the IP of reader is 192.168.0.238, port is 7086, call the function as below:
HANDLE hp;
if(!SAAT_TCPInit(&hp,”192.168.0.238”,7086) )
return false;
//Function: create connection based on COM Port, USB or Ethernet, or any other expansion port.
//Parameter:
2
if(!SAAT_Open(hp))
return false;
//Parameter:
HANDLE hp;
if(!SAAT_COMInit (&hp,0,”COM1”,7086) )
return false;
//Parameter:
3
Calling method as below:
if(!SAAT_Open(hp))
return false;
4
Part III
6C Tag Operation
//Parameter:
// nAntenna: the operating antenna code(0 antenna loop, 1 antenna1, 2 antenna2, 3 antenna3, 4 antenna4)
// 00:for the tag EPC code, reader sends only once to host and requests host "return confirmation data".
// 01":reader uploads all the collected EPC code to host and doesn't request host to "return confirmation
data"; till host sends "close function" command the reader will stop reading EPC code; this operation mode is
commonly used.
// nTagCount: estimated simultaneous reading quantity; predict the required max. tag quantity in working
environment, designed as 250pcs while the real reading quantity is more than 500pcs.
bool SAAT_6CReadEPCCode ( void *pHandle,unsigned char nAntenna, unsigned char nType, unsigned char
nTagCount)
if(!SAAT_6CReadEPCCode(hp,antenna,0x01,1))
return false;
5
//3.3 Receive EPC code command
//Function: this function is used for receiving the EPC code returned from reader; there may be multiple EPC codes
are returned.
//Parameter:
// nAntenna the antenna port no. which has got EPC code
// nEPCLen incoming, it's length of pEPCData; outgoing, it's length of EPC data, usually is 12.
int SAAT_6CRevEPCMsg (void *pHandle, unsigned char* nAntenna, unsigned char* pEPCData, unsigned char*
nEPCLen)
ZeroMemory(pEPCData,200);
int readEPCSucceed=SAAT_6CRevEPCMsg(hp,&antenna,pEPCData,&pEPCLength);
if(1 == readEPCSucceed)
printf("%02x",pEPCData[i]);
printf("\n");
Notice:
To receive tag please use thread to call, to avoid blocking host interface.
The receive tag thread should not occupy CPU; it's better that tag ID would be stored in buffer area first,
to avoid interfering reading efficiency.
6
2 Write EPC Code
Before writing EPC code, please connect reader first, using the following function:
//Parameter:
// pAccessPWD the access password for operating tag, default password is 4bytes 0
bool SAAT_6CWriteEPCCode ( void* pHandle, unsigned char nAntenna, unsigned char nType, unsigned char
For example, the written tag ID is 112233445566778899001122, using antenna1 to write and calling as
below:
int i = 0;int j = 0;
sscanf_s(szTmp.GetBufferSetLength(2),"%02x",btEpcCode+j);
0x01,//antenna port is 1
m_szEpcData.GetLength()/2);//write in 12 bytes
if (bRet)
printf("Succeeded in writing");
7
}
else
printf("Failed to write");
Before read 6C tag user bank, please connect the reader first; using the function:
//Function: the function is used for reading ISO18000-6C tag user bank
//Parameter:
// nToReadLen the length of reading tag data bank, double word read/write, length is the read bytes,
and so on.
// nDataLen incoming: length of UserData; outgoing: length of the read data bank
If using antenna1, start address 0 and read 2 double words data, read data time-out period 1s, then call
as below:
unsigned int nReadLen = 2;//data length of tag data bank, double words read/write, length is 1 and read 2 bytes, length
8
unsigned int nWaitTime = 1000;//read data time-out period(measured as ms, i.e. 1s=1000ms)
unsigned int nRealRealLen = 9000;//incoming: length of UserData, outgoing: length of the read data bank
btAntennaNum,
nAddr,
nReadLen,
nWaitTime,
UserData,
&nRealRealLen);
if( bRet )
printf("%02x ",UserData[i]);
printf("\r\n");
else
printf(szMsg);
Before writing 6C tag user data, please connect reader first; using the functions below:
//////////////////////////////////////////////////////////////////
//Function: use this function to write ISO18000-6C tag USER Bank Data
//Parameter:
9
// nType operation type, it is 0
// pAccessPWD the access password for operating on tag, default password is 4-byte 0
// pToWriteLen incoming: length of user data which is written in tag; outgoing: real length of user data
int nWaitTime,
If use antenna1, on start address 0 writing two double bytes data, time-out period for writing is 3s, call
functions as below:
unsigned int nWaitTime =3000;//time when writing data(measured by ms, i.e. 1s=1000ms)
unsigned int pToWriteLen = 4;//incoming: length of the available for writing user data; outgoing: length of the real
btAntennaNum,
nType,
btTagPwd,
nAddr,
3000,
pWriteData,
&pToWriteLen);
if (!bRet)
10
{
printf(szMsg);
else
printf("write in succeeded\r\n");
// Parameter:
// nAntenna the operating antenna no. (0 antenna loop, 1 antenna1, 2 antenna2, 3 antenna3, 4 antenna4)
// operating mode:
// 00:the reader uploads the same TID code to host only once, and requires host to "return confirmation
data"
// 01:the reader uploads all the read tag TID code to host without requiring host to "return confirmation
data", until host release "close amplifier" command the reader stops reading TID code.
// nTagCount: estimated simultaneous reading quantity; predict the required max. tag quantity in
working environment, designed as 250pcs while the real reading quantity is more than 500pcs
bool SAAT_6CReadTIDCode ( void *pHandle,unsigned char nAntenna, unsigned char nType, unsigned char
nTagCount)
if(!SAAT_6CReadTIDCode(hp,antenna,0x01,1))
11
return false;
//Parameter:
int SAAT_6CRevTIDMsg (void *pHandle, unsigned char* nAntenna, unsigned char* pEPCData, unsigned char*
nEPCLen)
ZeroMemory(pTIDData,200);
int readTIDSucceed=SAAT_6CRevTIDMsg(hp,&antenna,pTIDData,&pTIDLength);
if(1 == readTIDSucceed)
printf("%02x",pTIDData[i]);
printf("\n");
Notice:
12
To receive tag please use thread to call, to avoid blocking host interface.
The receive tag thread should not occupy CPU; it's better that tag ID would be stored in buffer area first,
to avoid interfering reading efficiency.
13
Part IV
6B Tag Operation
//Parameter:
// Operation mode:
// 00:for the tag UID code, reader sends only once of the same code to host and requests host "return
confirmation data".
// 01:reader uploads all the collected UID code to host and doesn't request host to "return confirmation
data"; till host sends "close function" command the reader will stop reading EPC code; this operation mode is
commonly used.
if(!SAAT_6BReadUIDCode (hp,antenna,0x01))
return false;
14
//Function: this function will start the operation to receive tag UID code returned from reader.
//Parameter:
//Return Value: 1 operation succeeded; 0 operation failed; 2 the HR package which reader returns
int SAAT_6BRevUIDMsg (void *pHandle, unsigned char* nAntenna, unsigned char* pUIDData, unsigned char*
nUIDLen)
Calling as below:
ZeroMemory(pUIDData,200);
int readUIDSucceed=SAAT_6BRevUIDMsg(hp,&antenna,pUIDData,&pUIDLength);
if(1 == readUIDSucceed)
printf("%02x",pUIDData[i]);
printf("\n");
Notice:
To receive tag please use thread to call, to avoid blocking host interface.
The receive tag thread should not occupy CPU; it's better that tag ID would be stored in buffer area first,
to avoid interfering reading efficiency.
15
Part V
Stop Reading
Under reading status, if it is required to stop reading, call the following function:
//Function: this function is used to notify reader stop executing current running command.
//Parameter:
16
Part VI Disconnect Reader
When it is required to disconnect reader, call the following function:
//Parameter:
17
Part VII
Get Error Message
Use this function to acquire the error message which reader returns:
//parameter:
Calling as following:
18