ST_RFID_AccessData
If a read or write command is to be executed, it is necessary to specify the input structure stAccessData.
This structure specifies how many and which data should be read and where these should be stored, or how many and which data are to be written.
TYPE ST_RFID_AccessData :
STRUCT
(* access specific parameters *)
pData : POINTER TO BYTE; (* pointer to write data or free space for read data *)
iDataSize : UINT; (* length of data buffer in Bytes *)
iStartBlock : UINT; (* attend that the UserDataStartBlock which is not obligatory 0 is added automatically. *)
iBlockCount : UINT; (* condition: Blockcount*Blocksize=Datasize *)
iBlockSize : UINT := 1; (* in Bytes *)
iUserDataStartBlock : UINT := 0; (* depending on the transponder type its user data memory starts with block index 0 or higher *)
(* The upper parameter iStartBlock depends on the iUserDataStartBlock. The used StartBlock is iStartBlock+iUserDataStartBlock. *)
(* Different RFID Readers can differ in their interpretation of the first block. *)
iReserved : UINT;
END_STRUCT
END_TYPE
Name | Description |
---|---|
pData | The pointer pData points to the data to be written or to the free memory location for the data to be read. |
iDataSize | Specifies the size of the data in bytes to be written/read. |
iStartBlock | Specifies the first block index from which data is to be read from or written to the transponder memory. However, different RFID reader models sometimes interpret this index differently. Example: Upon a read command with start index 0, reader A returns the first block of user data and reader B the serial number. |
iBlockCount | Specifies the number of blocks that are to be read or written. |
iBlockSize | The block size of the user data (in bytes) can be specified by the variable iBlockSize. Depending on the transponder and the RFID reader model, only certain settings are possible here (e.g. 8, 4 or 1 byte is common). This should be ascertained in advance from the transponder information and tested. The variable iBlockSize is similarly to be selected in correspondence with the setting in the RFID reader configuration. Otherwise it is sometimes possible that access to the transponder or the evaluation of the received data cannot take place. |
iUserDataStartBlock | With the variable iUserDataStartBlock the start block (as index of blocks) of the user data can optionally be specified on the transponder. Note the block size (iBlockSize). |
![]() | Access by different RFID readers to the same transponder If different RFID readers are to access the same transponder, then access to the transponder memory must be tested in advance. It is possible that a reader model stores the data blocks on the transponder in a rotated byte order compared to another reader model. Or a reader model sees the entire memory area in reverse order compared to another reader model. The readable memory size of the transponder can also vary slightly between different reader models. This depends additionally on the transponder type. The TwinCAT RFID library has no influence on this. The user must select the above input parameters accordingly. |
Requirements
Development Environment |
Target Platform |
PLC Libraries to include |
---|---|---|
TC3.1.4013 |
PC or CX (x86, x64) |
Tc2_RFID |