ST_RFID_AccessData

TYPE ST_RFID_AccessData :
STRUCT
    (* access specific parameters *)
    pData               : DWORD;        (* 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

If a read or write command is to be executed, it is necessary to specify the input structure stAccessData.
This structure is used to specify how many and which data are to be read and where they are to be stored, or how many and which data are to be written.

pData

The pointer pData points to the data to be written or to the free storage space 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.

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.

ST_RFID_AccessData 1:

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 one reader model stores the data blocks in a reversed byte order on the transponder 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 RFID library does not affect this. The user must select the above input parameters accordingly.

The possible block size depends on the transponder type. Depending on the transponder, its first blocks can be reserved for system data, such as the serial number. The user data area can accordingly begin at index 0 or also at a higher value. If this is the case, the variable iUserDataStartBlock can be used to specify this additional parameter and to leave the actual index iStartBlock as it is. Both values are added together internally.
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.

iUserDataStartBlock

With the variable iUserDataStartBlock the start block (as index of blocks) of the user data can be specified on the transponder.
Note the block size.