# Read-write tag

## Read/Write tag

### Read/write tag (unlocked)

| MemBank                       | Read | Write |
| ----------------------------- | ---- | ----- |
| EPC(Bank1)                    | √    | √     |
| TID(unique identifier)(Bank2) | √    | ×     |
| USER(Bank3)                   | √    | √     |
| Reserved(Bank0)               | √    | ×     |

*<mark style="color:yellow;">**Before reading and writing tags, you need to take inventory of tags and select the tags to be modified.**</mark>*

### Read tag

1. After entering the read/write page, first select the MemBank that needs to be read and write.
2. Select "Read Card". The default password is 00000000. If the tag has set an access password, please change it to the correct password.
3. Enter the address and number of blocks to read.
4. The EPC/TID length is determined according to the actual tag datasheet. Some tags don't include User due to cost.

* Read EPC

  * EPC Bank: CRC-16+PC(Protocol Control)+EPC(n), reading EPC should start from address 2, and the block depends on the EPC length.
  * Contains type and length, EPC length calculation:
    * Address 1,Block 1; PC=3000.
    * Example of 96bit tag，PC=3000,3000(Hex) -> 0011000000000000(Binary),Take the first five digits,00110 -> 6(Decimal) .
    * (96/8 = 12 byte = 6word)
  * e.g.：EPC: "E200410062212001142160370B"(24 word),
    * Adderess: 2

    * Block: 6(1Block = 2byte = 4word)

  > Therefore, writing to EPC cannot only modify the EPC value, but also needs to write the EPC length. Tag attribute settings provide EPC changes, and EPC can be quickly modified from Tag attribute settings.

* Read TID
  * TID  Bank: Tag type(UHF are all E2.)+IC Mfg +IC model +Factory Programming Unique ID(64-bit)
  * e.g：TID: "E2003412017DFF0003EA370B"(24 word),
    * Adderess: 0
    * Block: 6(1Block = 2byte = 4word)

* Read User
  * User: The default data in the area is 0. If the tag does not contain User, an error will be reported directly when inventory.
  * User reading is the same as above.

* Read Reserved

### &#x20;Write tag

1. After entering the read/write page, first select the MemBank that needs to be read and write.
2. Select "Write Card", The default password is 00000000. If the tag has set an access password, please change it to the correct password.
3. Input the address, number of blocks, and content to be read.

* Write EPC
  * > It is not recommended to modify the EPC here. You need to write the PC value (EPC length) first, and then write the EPC.
  * > Refer to the tag attribute settings to change the EPC.
* Write User
  * e.g.: Write 20230521 to user Bank.
  * Address:0
  * Block:2
  * Content:20230521
  * > loop: Test for repeated writes.
* Write Reserved
  * > It is not recommended to write Reserved here.
  * > Refer to the tag attribute settings.

### Read\&Write tag video

Read EPC->Read TID->Read USER->Write USER(12345678)->Read the content written to USER.

{% embed url="<https://youtu.be/NRCfL0fwnhk>" %}
