^RF — RFID Read or Write
Plain English
Reads from or writes to the **RFID inlay** embedded in a smart label, addressing a specific memory bank on a Gen2 tag. `o=W` (write — written `^RFW,…` in shorthand; this is **not a separate command**, just `^RF` with the operation parameter set to `W`) takes the data from the next `^FD` and **encodes it into the tag** during print — the printed media moves under the RFID encoder, the inlay is energised, the new value is committed; `o=R` (read — `^RFR,…`) **retrieves** the bank contents and stores them in the print field for use elsewhere in the format. The `b` parameter selects which Gen2 memory bank to address: `0` EPC (the scannable identifier — most common write target), `1` TID (Tag ID — read-only chip serial, factory-locked), `2` USER (free-form bytes, optional on the inlay), `3` RESERVED (kill and access passwords). Pair with a preceding `^RS` (RFID Setup) to declare the protocol/region/retry policy — `^RF` alone uses defaults that may not match the encoder.
When to use
For Gen2 RFID encoding: write to bank `0` (EPC) for SGTIN/serialised inventory tags, bank `2` (USER) for application-specific payloads, bank `3` (RESERVED) for kill/access passwords (encode once, lock with `^RZ`/`^HL`). Always send `^RS` first to set protocol, encoder type, and retry/void behaviour — without it, write-failures may not void the label and you ship blank inlays. **`^FD` data length MUST align with `n` exactly:** for `f=H` (hex format) the `^FD` payload must contain `2 × n` hex characters (each byte = 2 hex chars); for `f=A` (ASCII) it must contain exactly `n` characters. A 14- or 18-char hex `^FD` paired with `n=8` is a silent encoder error — the inlay either rejects the partial write or accepts misaligned bytes that won't scan correctly. Likewise `p` (offset) + `n` (count) must stay within the bank's byte range (EPC = 12 bytes max for SGTIN-96; USER size is inlay-dependent). For diagnostics use `^HV`/`~HL` to read tag state back to host.
Syntax
^RFo,f,b,n,p
Parameters
| Parameter | Description |
|---|---|
o | Operation: `W` write into bank, `R` read from bank |
f | Data format: `A` ASCII, `H` hexadecimal (most common — EPCs are hex-encoded), `E` EPC (96-bit EPC structure) |
b | Memory bank: `0` EPC (scannable ID), `1` TID (read-only chip serial), `2` USER (free-form payload), `3` RESERVED (kill/access passwords) |
n | Number of bytes to read or write — must match the bank capacity (e.g. 12 for SGTIN-96 EPC). Default 1. |
p | Starting byte offset within the bank. `0` for full-bank operations; non-zero only for partial updates. Default 0. |
Example
^XA ^RS8 ^RFW,H,0,12,0 ^FD3034257BF7194E4000001A85^FS ^XZ
Configure Gen2 protocol via `^RS8`, then write a 12-byte SGTIN-96 EPC into bank `0` (EPC) starting at byte offset `0`, no password offset. **Alignment check:** `n=12` bytes × `f=H` hex format = exactly **24 hex characters required in `^FD`** — and the `^FD` here (`3034257BF7194E4000001A85`) is exactly 24 chars. A 22- or 26-char `^FD` with this header would silently produce a bad encode. `^RFW` is shorthand for `^RF` with `o=W`, not a separate command.