The text of a manual · part 9 of 11
HT Series/PA Series/RH Series Programming Manual, pages 77 to 86
Pages 77 to 86 of 98
The original document is the PDF (1.2 MB). This is its text as extracted, unedited; tables and drawings read best in the PDF, and each page heading opens it at that page.
For the Unitech HT660 and Unitech HT680
Page 77
9.5.6 Tag Inventory Operation Description: Executes a tag inventory for all tags of interest. If the selection Criteria and post-singulation is specified, tags will be partitioned first. Function Call: void RFIDInventory(RFID_INVENTORY stInventory, LPACCESS_STATUS lpAccessStatus, BOOL bBlock = FALSE, int nTimeout = 3000); Parameters: stInventory – Inventory operation parameters. lpAccessStatus - Contain the operation result, use in block mode; bBlock – Block mode. nTimeout – Timeout for the access operation, use in block mode. Returns: None
9.5.7 Tag Read Operation Description: Read one or more 16-bit words from any of a tag's memory banks. While a read may be used to retrieve a set of tags EPC data, if the EPC is the only desired data, performing an inventory operation is more efficient. (Read may only be performed on 16-bit word boundaries and for multiples of 16-bit words) if one or more of the memory words specified by the offset/count combinaion do not exist or are read-locked, the read from the tag fails. Function Call: void RFIDTagRead(RFID_READ stRead, LPACCESS_STATUS lpAccessStatus, BOOL bBlock = FALSE, int nTimeout = 3000); void RFIDTagReadEx(RFID_READ_EX stReadEx, LPACCESS_STATUS lpAccessStatus, BOOL bBlock = FALSE, int nTimeout = 3000); Parameters: stRead/stReadEx – read operation parameters lpAccessStatus - Contain the operation result. Use in block mode; bBlock - Block mode. nTimeout - Timeout for the access operation, use in block mode. Returns: None
9.5.8 Tag Write Operation Description: Write one or more 16-bit words to he specified memory bank. (Write could only beginning at the specified 16-bit offset. maximum number of 16-bit word to be written is 8). If wants to write more than eight 16-bit words data to a tag a one time, please use RFIDTagWriteEx. Function Call: void RFIDTagWrite(RFID_WRITE stWrite, LPACCESS_STATUS lpAccessStatus, BOOL bBlock = FALSE, int nTimeout = 3000); void RFIDTagWriteEx(RFID_WRITE_EX stWriteEx, LPACCESS_STATUS lpAccessStatus, int nTimeout = 3000); Parameters: stWrite/stWriteEx – write operation parameters lpAccessStatus - Contain the operation result. Use in block mode; bBlock - Block mode. nTimeout - Timeout for the access operation, use in block mode. Returns: None
77 -
Page 78
9.5.9 Modify EPC Operation Description: Modify the target tag's EPC. Function Call: void RFIDTagWriteEPC(RFID_WRITE_EPC stEPC, LPACCESS_STATUS lpAccessStatus, int nTimeout = 3000); Parameters: stEPC – Contain Modify EPC operation parameters . lpAccessStatus - Contain the operation result. nTimeout - Timeout for the access operation. Returns: None
9.5.10 Tag Kill Operation Description: Kill the tags of interest. Function Call: void RFIDTagKill(RFID_KILL stKill, LPACCESS_STATUS lpAccessStatus, BOOL bBlock = FALSE, int nTimeout = 3000); void RFIDTagKillEx(RFID_KILL_EX stKillEx, LPACCESS_STATUS lpAccessStatus, BOOL bBlock = FALSE, int nTimeout = 3000); Parameters: stKill/stKillEx – Kill operation parameter. lpAccessStatus - Contain the operation result. Use in block mode; bBlock - Block mode. nTimeout - Timeout for the access operation, use in block mode. Returns: RFID_STATUS
9.5.11 Tag Lock Operation Description: Execute a tag lock(setting a tag's access permissions). Function Call: void RFIDTagLock(RFID_LOCK stLock, LPACCESS_STATUS lpAccessStatus, BOOL bBlock = FALSE, int nTimeout = 3000); void RFIDTagLockEx(RFID_LOCK_EX stLockEx, LPACCESS_STATUS lpAccessStatus, BOOL bBlock, int nTimeout); Parameters: stLock/stLockEx – Lock operation parameter. lpAccessStatus - Contain the operation result. Use in block mode; bBlock - Block mode. nTimeout - Timeout for the access operation, use in block mode. Returns: RFID_STATUS
9.5.12 Tag Pre-singulation Operation Description: Configures the tag-selection criteria for the ISO 18000-6C select command, this command should be issued prior to any tag access operation. The tag-selection criteria will stay in effect until the next call of tag-selection criteria. Function Call: RFID_STATUS RFIDTagSelectCriteria(RFID_SELECT_CRITERIA *pCriteria, int *pnCount, BOOL bSet = TRUE); Parameters: pCriteria – Contain the tag-selection criteria parameters pnCount – The number of criteria. This value must be between 0 and 8, inclusive. When set to 0 the tag-selection criteria will be deleted. bSet – TRUE set the tag-selection criteria parameters; FALSE retrieve the tag-select criteria parameters. Returns: RFID_STATUS 78 -
Page 79
9.5.13 Tag Post Singulation Operation Description: Configures the post-singulation match criteria to be used by the RFID radio module. An application can use post-singulation to filter tags, based upon all or part of the tag's EPC. The post-singualtion match criteria will stay in effect until the next call of post-singulation.(All the tag's access operation will apply to the which has been singulated only.) Function Call: RFID_STATUS RFIDTagPostSingulation(RFID_POST_SINGULATION *pCriteria, int *pnCount, BOOL bSet = TRUE); Parameters: pCriteria – Contain post-singulation match criteria parameters. pnCount – The number of criteria. When set the post-singulation match criteria this value must be 1; When delete the post-singulation match criteria this value must be 0; bSet – TRUE set the post-singulation parameters; FALSE retrieve the post-singulation parameters. Returns: RFID_STATUS
9.5.14 Tag Query Group Operation Description: Specifies which tag group will have subsequent access operations applied to it. Function Call: RFID_STATUS RFIDTagQueryGroup(RFID_18K6C_TAG_GROUP *pGroup, BOOL bSet = TRUE); Parameters: pGroup – Contain the parameters of specifying the tag group. bSet – TRUE specify the tag group. FALSE retrieves the tag group. Returns: RFID_STATUS
9.5.15 Set Current Singulation Algorithm Description: Select the current singulation algorithms. Based upon usage scenarios, different singulation algorithms(i.e. Q-adustment) may be desired. Function Call: RFID_STATUS RFIDSingulationAlgorithm( RFID_18K6C_SINGULATION_ALGORITHM *pAlgorithm, BOOL bSet = TRUE); Parameters: pAlgorithm – The valid singulation algorityms bSet – TRUE set the current singulation algorithm FALSE retrieves the current singulation algorithm. Returns: RFID_STATUS
9.5.16 Specifying Singulation Algorithm Parameters Description: Allow the application to configure the settings for a particular singulation algorithm. Function Call: RFID_STATUS RFIDSingulationAlgorithmParameters( RFID_18K6C_SINGULATION_ALGORITHM algorithm, void *pParms, BOOL bSet = TRUE); Parameters: algorithm – The singulation algorithm to be configured. pParms – A pointer to a structure that contains the singulation algorithm parameters. bSet – Set or Retrieve the specify singulation alogrithm parameters. Returns: RFID_STATUS
79 -
Page 80
9.5.17 Cancelling a Tag Operation Description: Stops a currently-executing tag operation on a RFID Reader. Function Call: RFID_STATUS RFIDCancelOperation (); Parameters: None Returns: RFID_STATUS
9.5.18 Aborting a Tag Operation Description: Terminate a tag operation immediately. Any response packet will be discarded. Function Call: RFID_STATUS RFIDAbortOperation (); Parameters: None Returns: RFID_STATUS
9.5.19 Clear RFID Reader Module’s Error State Description: Clear the error state for the RFID Reader module MAC firmware. Function Call: RFID_STATUS RFIDClearError (); Parameters: None Returns: RFID_STATUS
9.5.20 Ability of Hold or Discard the Duplicate Tags Description: Hold or discard the duplicate tags when inventory. Call this function before inventory. Function Call: RFID_STATUS RFIDEnableDuplicate(BOOL bEnable = TRUE); Parameters: bEnable – TRUE hold the duplicate tags. FALSE discard the duplicate tags Returns: RFID_STATUS
9.6 Other APIs 9.6.1 Get RFID Reader’s Firmware Version Description: Get RFID Reader’s library and Firmware version. Function Call: RFID_STATUS RFID MacGetVersion(char *pszVer); Parameters: pszVer - Contains the RFID Reader's library and Firmware version. Returns: RFID_STATUS
80 -
Page 81
9.7 Structure of the Library 9.7.1 RFID_ANTENNA_PORT_CONFIG Description: The configuration parameters for a logical antenna port. Define: typedef struct { INT32U length; INT32U powerLevel; INT32U dwellTime; INT32U numberInventoryCycles; INT32U physicalRxPort; INT32U physicalTxPort; INT32U antennaSenseThreshold; } RFID_ANTENNA_PORT_CONFIG; Fields: length - The length of the structure in bytes. Must be set to by the application to sizeof(RFID_ANTENNA_PORT_CONFIG) powerLevel - The power level for the logical antenna port's physical transmit antenna. This value is specified in 0.1 (i.e., 1/10th) dBm. the value must between 0 and 300 and, 280 is The most appropriate value. dwellTime - The number of milliseconds to spend on this antenna port during a cycle. Zero indicates that antenna usage will be ontrolled by the numberInventoryCycles field. numberInventoryCycles - The number of inventory rounds to perform with this antenna port. Zero indicates that the antenna usage will be controlled by the dwellTime field. physicalRxPort - he underlying physical receive antenna port associated with the logical antenna port. Must be between 0 and 3, inclusive. physicalTxPort - The underlying physical transmit antenna port associated with the logical antenna port. Must be between 0 and 3, inclusive. antennaSenseThreshold - The measured resistance, specified in ohms. Note: *In version 1.0 physicalRxPort and physicalTxPort's value must be the same. *dwellTime and numberInventoryCycles can not both be zero. *length field must be fill with the length of the structure before call the config function.
81 -
Page 82
9.7.2 ACCESS_STATUS Description: Contain the information of the tag operation result. Define: typedef struct ACCESS_STATUS_TAG{ FILETIME ftStartTime; FILETIME ftEndTime; INT32U dwResponseMode; INT32U dwOperationMode; INT16U unCommand; DWORD dwErrorCode; DWORD dwStatus; INT16U unAntennas } ACCESS_STATUS, *LPACCESS_STATUS; Fields: ftStartTime – Time of the Tag operation start ftEndTime – Time of the Tag operation end dwResponseMode – Operation Response data reporting mode can be Compat or Normal. dwOperationMode – Working mode of the RFID Reader module can be continuous or noncontinuous. dwErrorCode – If tag operation failed this field contains the error code. Zero indicates no error. dwStatus – Return by the Tag operation function indicate the library status and error codes. Zero indicates no error. unAntennas – The amount of antennas.
9.7.3 ANTENNA_STATUS Description: Contains the information of the antenna that take effect in the tag operation executed. Define: typedef struct ANTENNA_STATUS_TAG{ FILETIME ftStartTime; FILETIME ftEndTime; INT16U unAntenna; DWORD dwErrorCode; DWORD dwStatus; INT16U unCount } ANTENNA_STATUS, *LPANTENNA_STATUS; Fields: ftStartTime – Time of this antenna start to execute Tag operation. ftEndTime – Time of this antenna finish execute Tag operation. unAntenna – Antenna No. unCount – The number of tag this antenna returns.
82 -
Page 83
9.7.4 ACCESS_DATA Description: Contain access data of the tag return by the antenna. Define: typedef struct ACCESS_ DATA _TAG{ INT16U unEPCLength; INT16U unRSSI; //The receive signal strength BYTE pnEPC[68]; //PC + EPC + CRC INT16U unDataLength; BYTE pnData[256]; //Access data or access Status } ACCESS_DATA, *LPACCESS_DATA; Fields: unEPCLength–The length of the EPC(include PC and CRC) unRSSI – The receive signal strength. pnEPC[68] – Data of EPC(2 bytes PC + EPC + 2 bytes CRC). unDataLength – Access Data length. pnData[256] – Data retrieve from Tag of write to Tag.
9.7.5 RFID_INVENTORY Description: Inventory operation parameters. Define: typedef struct RFID_INVENTORY_TAG { HWND hWnd; //Parent window RFIDPROC lpfnStartProc; RFIDPROC lpfnStopProc; }RFID_INVENTORY; Fields: hWnd – The parent window which issue the Tag operation. lpfnStartProc – Application-defined callback function. Thre RFID Reader Interface call this function before execute Tag operation. lpfnStopProc – Application-defined callback function. Thre RFID Reader Interface call this function after finished Tag operation.
83 -
Page 84
9.7.6 RFID_READ Description: Tag Read Operation parameters. Define: typedef struct RFID_READ_TAG { HWND hWnd; //Parent window RFIDPROC lpfnStartProc; RFIDPROC lpfnStopProc; RFID_18K6C_MEMORY_BANK bank; INT16U offset; INT16U count; INT32U accessPassword; }RFID_READ; Fields: hWnd - The Parent window which issue the Tag operation. lpfnStartProc - Application-defined callback function. The RFID Reader Interface call this function before execute Tag operation. lpfnStopProc - Application-defined callback function. The RFID Reader Interface call this function after finished Tag operation. bank – The memory bank from which to read. offset – The offset of the first 16-bit word to read from the specified memory bank. count – The number of 16-bit words to read.(If this value zero and bank is EPC, the read returns the contents of the EPC starting at the 16-bit word specified by offset through the end of the EPC.This value must be in the range 1 to 255, inclusive.) accessPassword – The access passowrd for the tags. A value of zero indicates no access password.
9.7.7 RFID_READ_EX Description: Tag read extension function’s parameter. Define: typedef struct RFID_READ_EX_TAG { HWND hWnd; //Parent window RFIDPROC lpfnStartProc; RFIDPROC lpfnStopProc; RFID_18K6C_MEMORY_BANK bank; INT16U offset; INT16U count; BYTE accessPassword[8]; }RFID_READ_EX; Fields: hWnd - the same as RFID_READ. lpfnStartProc – the same as RFID_READ; lpfnStopProc – the same as RFID_READ; bank – the same as RFID_READ; offset – the same as RFID_READ; count – the same as RFID_READ; accessPassword[8] – The access passowrd for the tags. It’s 8 bytes' hex char(0~f).
84 -
Page 85
9.7.8 RFID_WRITE Description: Tag write operation’s parameter. Define: typedef struct RFID_WRITE_TAG { HWND hWnd; //Parent window RFIDPROC lpfnStartProc; RFIDPROC lpfnStopProc; BOOL32 verify; INT32U verifyRetryCount; RFID_18K6C_MEMORY_BANK bank; INT32U accessPassword; INT16U offset; INT16U count; Int16U pnData[8]; }RFID_WRITE; Fields: hWnd – The parent window which issue the Tag operation. lpfnStartProc - Application-defined callback function. The RFID Reader Interface call this function before execute Tag operation. lpfnStopProc - Application-defined callback function. The RFID Reader Interface call this function after finished Tag operation. verify – A flag that indicates if the data written to the tag should be read back from the tag to verify that it was successfully written. A non-zero value indicates that the tag's memory should be read to verify. verifyRetryCount – The maximum number of times the write should be retried if the writeverify failure. This value must be between 0 and 7. accessPassword – The access password for the tags. A value of zero indicates no access password. bank – The memory bank from which to read. offset – The offset of the first 16-bit word to read from the specified memory bank. count – The number of 16-bit words to read.(If this value zero and bank is EPC, the read returns the contents of the EPC starting at the 16-bit word specified by offset through the end of the EPC.This value must be in the range 1 to 8, inclusive.) pnData[8] – Contains the data to be written to the tag's specified memory bank. The highorder byte of pnData[n] is written to the tag's memory-bank byte at 16-bit offset(offset + n). The low-order byte is write to the next byte.
85 -
Page 86
9.7.9 RFID_WRITE_EX Description: Tag write extension function's parameter. Define: typedef struct RFID_WRITE_EX_TAG { HWND hWnd; //Parent window RFIDPROC lpfnStartProc; RFIDPROC lpfnStopProc; BOOL32 verify; INT32U verifyRetryCount; BYTE accessPassword[8]; //password is 8 bytes’ hex char(0~f) BYTE pnEPC[64]; RFID_18K6C_MEMORY_BANK bank; INT16U offset; INT16U count; Int16U pnData[256]; //data to be writen(hex chars) }RFID_WRITE_EX; Fields: hWnd – the same as RFID_WRITE lpfnStartProc - the same as RFID_WRITE lpfnStopProc - the same as RFID_WRITE verify – the same as RFID_WRITE verifyRetryCount – the same as RFID_WRITE accessPassword[8] – The access passowrd for the tags. It’s 8 bytes' hex char(0~f) pnEPC[64] – EPC of the specify tag to be writed to. If this parameter is NULL, the data will be written to the tags in the field. Otherwise data will be written to the tag specify by the EPC. bank – the same as RFID_WRITE offset – the same as RFID_WRITE count – the same as RFID_WRITE pnData[256] – Contains the data to be written to the tag's specified memory bank(HEX chars' string).
9.7.10 RFID_WRITE_EPC Description: The structure of Modify a tag’s EPC. Define: typedef struct RFID_WRITE_EPC_TAG { HWND hWnd; //Parent window RFIDPROC lpfnStartProc; RFIDPROC lpfnStopProc; BOOL32 verify; INT32U verifyRetryCount; BYTE accessPassword[8]; BYTE pnOldEPC[64]; INT16U tagType; BYTE pnNewEPC[64]; }RFID_WRITE_EPC; Fields: hWnd - the same as RFID_WRITE. lpfnStartProc – the same as RFID_WRITE lpfnStopProc – the same as RFID_WRITE verify – the same as RFID_WRITE verifyRetryCount – the same as RFID_WRITE accessPassword[8] – the same as RFID_WRITE_EX pnOldEPC[64] – the old EPC of the tag to be modify tagType – Reserve for future use. PnNewEPC[64] – the new EPC of the target tag. 86 -