开发包ZKRFID105.docx
《开发包ZKRFID105.docx》由会员分享,可在线阅读,更多相关《开发包ZKRFID105.docx(38页珍藏版)》请在冰豆网上搜索。
![开发包ZKRFID105.docx](https://file1.bdocx.com/fileroot1/2023-7/4/d8b7cbb4-58c8-4e14-a325-021ec38a3361/d8b7cbb4-58c8-4e14-a325-021ec38a33611.gif)
开发包ZKRFID105
ZK_RFID105.DLLDynamicLinkLibrary
User’sGuideV1.2
1.OperationSystemRequirement:
1
2.FunctionList:
1
2.1)GeneralFunction:
1
2.2)EPCC1-G2Function:
1
2.3)18000-6BFunction:
3
3.FunctionExplanation:
4
3.1)GeneralFunction:
4
3.1.1)AutoOpenComPort():
4
3.1.2)OpenComPort():
5
3.1.3)CloseComPort():
6
3.1.4)CloseSpecComPort():
6
3.1.5)GetReaderInformation():
6
3.1.6)WriteComAdr():
7
3.1.7)WriteScanTime():
7
3.1.8)SetPowerDbm():
8
3.1.9)Writedfre():
8
3.1.10)Writebaud():
8
3.2)EPCC1-G2Function:
9
3.2.1)Inventory_G2():
9
3.2.2)ReadCard_G2():
10
3.2.3)WriteCard_G2():
10
3.2.4)EraseCard_G2():
11
3.2.5)SetCardProtect_G2():
12
3.2.6)DestroyCard_G2():
13
3.2.7)WriteEPC_G2():
14
3.2.8)SetReadProtect_G2():
14
3.2.9)SetMultiReadProtect_G2():
15
3.2.10)RemoveReadProtect_G2():
15
3.2.11)CheckReadProtected_G2():
15
3.2.12)SetEASAlarm_G2():
16
3.2.13)CheckEASAlarm_G2():
17
3.2.14)LockUserBlock_G2():
17
3.2.15)WriteBlock_G2():
18
3.3)18000-6BFunction:
19
3.3.1)Inventory_6B():
19
3.3.2)Inventory2_6B():
19
3.3.3)ReadCard_6B():
20
3.3.4)WriteCard_6B():
20
3.3.5)CheckLock_6B():
21
3.3.6)LockByte_6B():
21
4.ReturnValueDefinition22
5.ErrorCodeDefinition23
ZK_RFID105.DLLisadynamiclinklibrarydesignedtofacilitateEPCC1-G2and18000-6BprotocolUHFtagapplicationsoftwaredevelopment.
1.OperationSystemRequirement:
WINDOWS2000/XP
2.FunctionList:
ZK_RFID105.DLLincludesthefollowingfunctions:
2.1)GeneralFunction:
1)LongWINAPIAutoOpenComPort(long*Port,unsignedchar*ComAdr,unsignedcharBaud,long*FrmHandle);
2)LongWINAPIOpenComPort(longPort,unsignedchar*ComAdr,unsignedcharBaud,long*FrmHandle);
3)LongWINAPICloseComPort(void);
4)FunctionlongWINAPICloseSpecComPort(longFrmHandle);
5)LongWINAPIGetReaderInformation(unsignedchar*ComAdr,unsignedchar*VersionInfo,unsignedchar*ReaderType,unsignedchar*TrType,unsignedchar*dmaxfre,unsignedchar*dminfre,unsignedchar*powerdBm,unsignedchar*ScanTime,longFrmHandle);
6)LongWINAPIWriteComAdr(unsignedchar*ComAdr,unsignedchar*ComAdrData,longFrmHandle);
7)LongWINAPIWriteScanTime(unsignedchar*ComAdr,unsignedchar*ScanTime,longFrmHandle);
8)LongWINAPISetPowerDbm(unsignedchar*ComAdr,unsignedchar*power,longFrmHandle);
9)LongWINAPIWritedfre(unsignedchar*ComAdr,unsignedchar*dmaxfre,unsignedchar*dminfre,longFrmHandle);
10)LongWINAPIWritebaud(unsignedchar*ComAdr,unsignedchar*baud,longFrmHandle);
2.2)EPCC1-G2Function:
1)LongWINAPIInventory_G2(unsignedchar*ComAdr,unsignedcharAdrTID,unsignedcharLenTID,unsignedcharTIDFlag,unsignedchar*EPClenandEPC,long*Totallen,long*CardNum,longFrmHandle);
2)LongWINAPIReadCard_G2(unsignedchar*ComAdr,unsignedchar*EPC,unsignedcharMem,unsignedcharWordPtr,unsignedcharNum,unsignedchar*Password,unsignedchar*Data,unsignedcharEPClength,long*errorcode,longFrmHandle);
3)LongWINAPIWriteCard_G2(unsignedchar*ComAdr,unsignedchar*EPC,unsignedcharMem,unsignedcharWordPtr,unsignedcharWritedatalen,unsignedchar*Writedata,unsignedchar*Password,longWrittenDataNum,unsignedcharEPClength,long*errorcode,longFrmHandle);
4)LongWINAPIEraseCard_G2(unsignedchar*ComAdr,unsignedchar*EPC,unsignedcharMem,unsignedcharWordPtr,unsignedcharNum,unsignedchar*Password,unsignedcharEPClength,long*errorcode,longFrmHandle);
5)LongWINAPISetCardProtect_G2(unsignedchar*ComAdr,unsignedchar*EPC,unsignedcharselect,unsignedcharsetprotect,unsignedchar*Password,unsignedcharEPClength,long*errorcode,longFrmHandle);
6)LongWINAPIDestroyCard_G2(unsignedchar*ComAdr,unsignedchar*EPC,unsignedchar*Password,unsignedcharEPClength,long*errorcode,longFrmHandle);
7)LongWINAPIWriteEPC_G2(unsignedchar*ComAdr,unsignedchar*Password,unsignedchar*WriteEPC,unsignedcharWriteEPClen,long*errorcode,longFrmHandle);
8)LongWINAPISetReadProtect_G2(unsignedchar*ComAdr,unsignedchar*EPC,unsignedchar*Password,unsignedcharEPClength,long*errorcode,longFrmHandle);
9)LongWINAPISetMultiReadProtect_G2(unsignedchar*ComAdr,unsignedchar*Password,long*errorcode,longFrmHandle);
10)LongWINAPIRemoveReadProtect_G2(unsignedchar*ComAdr,unsignedchar*Password,long*errorcode,longFrmHandle);
11)LongWINAPICheckReadProtected_G2(unsignedchar*ComAdr,unsignedchar*readpro,long*errorcode,longFrmHandle);
12)LongWINAPISetEASAlarm_G2(unsignedchar*ComAdr,unsignedchar*EPC,unsignedchar*Password,unsignedcharEAS,unsignedcharEPClength,long*errorcode,longFrmHandle);
13)LongWINAPICheckEASAlarm_G2(unsignedchar*ComAdr,long*errorcode,longFrmHandle);
14)LongWINAPILockUserBlock_G2(unsignedchar*ComAdr,unsignedchar*EPC,unsignedchar*Password,unsignedcharBlockNum,unsignedcharEPClength,long*errorcode,longFrmHandle);
15)LongWINAPIWriteBlock_G2(unsignedchar*ComAdr,unsignedchar*EPC,unsignedcharMem,unsignedcharWordPtr,unsignedcharWritedatalen,unsignedchar*Writedata,unsignedchar*Password,longWrittenDataNum,unsignedcharEPClength,long*errorcode,longFrmHandle);
2.3)18000-6BFunction:
1)LongWINAPIInventory_6B(unsignedchar*ComAdr,unsignedchar*ID_6B,longFrmHandle);
2)LongWINAPIInventory2_6B(unsignedchar*ComAdr,unsignedchar*Condition,unsignedcharStartAddress,unsignedcharmask,unsignedcharConditionContent,unsignedchar*ID_6B,long*Cardnum,longFrmHandle);
3)LongWINAPIReadCard_6B(unsignedchar*ComAdr,unsignedchar*ID_6B,unsignedcharStartAddress,unsignedcharNum,unsignedchar*Data,long*errorcode,longFrmHandle);
4)LongWINAPIWriteCard_6B(unsignedchar*ComAdr,unsignedchar*ID_6B,unsignedcharStartAddress,unsignedchar*Writedata,unsignedcharWritedatalen,int*writtenbyte,long*errorcode,longFrmHandle);
5)LongWINAPILockByte_6B(unsignedchar*ComAdr,unsignedchar*ID_6B,unsignedcharAddress,long*errorcode,longFrmHandle);
6)LongWINAPICheckLock_6B(unsignedchar*ComAdr,unsignedchar*ID_6B,unsignedcharAddress,unsignedchar*ReLockState,long*errorcode,longFrmHandle);
3.FunctionExplanation:
3.1)GeneralFunction:
3.1.1)AutoOpenComPort():
Functiondescription:
Thisfunctionisusedtoautomaticallydetectthecommunicationportunoccupiedbyotherapplicationandattachedwithareader.Thefunctiontrytoestablishtheconnectionbetweenthem.Theprotocolparametersare57600bps,8databits,1startbit,1stopbit,noparitybit.
Iftheconnectionisestablishedsuccessfully,thefunctionwillopenthecommunicationportandreturnavalidhandle,otherwisethefunctionwillreturnanerrorcodewithainvalidhandle(valueas-1).
Usage:
LongWINAPIAutoOpenComPort(long*Port,unsignedchar*ComAdr,unsignedcharBaud,longFrmHandle);
Parameter:
Port:
Pointedtothecommunicationportnumber(COM1~COM9)thatthereaderisdetectedandconnected.
ComAdr:
Pointedtotheaddressofthereader.
Whenusingbroadcastingaddress0xFFasComAdrtocallthefunction,theportnumbertowhichthereaderisdetectedandtheaddressofthereaderwillbewritedbacktoparameterPortandComAdr;
Whenusingadesignatedaddress0x00~0xFEasComAdrtocallthefunction,theportnumbertowhichthereaderwiththespecifiedaddressisdetectedwillbewritedbacktoparameterPort.
ConstantsCOM1~COM9aredefinedasfollows:
#defineCOM11
#defineCOM22
#defineCOM33
#defineCOM44
#defineCOM55
#defineCOM66
#defineCOM77
#defineCOM88
#defineCOM99
Baud:
Thisvaluesetthebaudrateoftheserialcommunicationcontrol.
baudrate
Actualbaudrate
0
9600bps
1
19200bps
2
38400bps
4
56000bps
5
57600bps
6
115200bps
FrmHandle:
Pointedtothecommunicationhandlewhichisbindingwiththecommunicationportopenedsuccessfully.Theapplicationsoftwareshouldusethishandletomanipulatethereaderconnectedtotheport.
Returns:
Zerovaluewhensuccessfully,non-zerovaluewhenerroroccurred.
3.1.2)OpenComPort():
Functiondescription:
Thisfunctionisusedtoestablishtheconnectionbetweenthereaderandaspecifiedcommunicationport.Theprotocolparametersare57600bps,8databits,1startbit,1stopbit,noparitybit.
Usage:
LongWINAPIOpenComPort(longPort,unsignedchar*ComAdr,unsignedcharBaud,longFrmHandle);
Parameter:
Port:
CommunicationportnumberwhichisaconstantfromCOM1toCOM9
definedasfollowing:
#defineCOM11
#defineCOM22
#defineCOM33
#defineCOM44
#defineCOM55
#defineCOM66
#defineCOM77
#defineCOM88
#defineCOM99
Baud:
Thisvaluesetthebaudrateoftheserialcommunicationcontrol.
baudrate
Actualbaudrate
0
9600bps
1
19200bps
2
38400bps
4
56000bps
5
57600bps
6
115200bps
ComAdr:
Pointedtotheaddressofthereader.
Whenusingbroadcastingaddress0xFFasComAdrtocallthefunction,theaddressofthereaderwillbewritedbacktoparameterComAdr;
Whenusingadesignatedaddress0x00~0xFEasComAdrtocallthefunction,thefunctionwilldetectwhetheraspecifiedaddressreaderisconnectedtothedesignagedcommunicationport.
FrmHandle:
Pointedtothecommunicationhandlewhichisbindingwiththecommunicationportopenedsuccessfully.Theapplicationsoftwareshouldusethishandletomanipulatethereaderconnectedtotheport.
Returns:
Zerovaluewhensuccessfully,non-zerovaluewhenerroroccurred.
3.1.3)CloseComPort():
Functiondescription:
Thisfunctionisusedtodisconnectthereaderandreleasethecorrespondingcommunicationportresources.Insomedevelopmentenv