Step through Query, RN16, ACK, EPC, QueryRep, and session-flag behavior in an EPC Gen2 inventory round.
animation
rfid
epc-gen2
networking
short-range
interactive
Learner-ready EPC Gen2 inventory workbench showing reader commands, random tag slot choices, RN16 replies, ACK selection, EPC backscatter, QueryRep slot advance, Q tuning, and common RFID inventory caveats.
EPC Gen2UHF RFIDInventoryAnti-collision
See how a reader turns a crowd of passive tags into one EPC at a time.
EPC Gen2 inventory starts with a reader Query, lets tags choose random slots, listens for an RN16 reply, ACKs one tag, receives its EPC, and then advances the frame with QueryRep. Use the controls to see why Q, RF reliability, and session flags matter.
0/12Tags inventoried in this session
Round 1Inventory frame currently being explored
Q=4Frame size is 16 slots
Slot 0Active reader opportunity
QueryCurrent protocol moment
TrySelect Balanced shelf with 12 tags and Q=4 for 16 slots, then advance one event.
ObserveQuery, RN16, ACK, and EPC appear only for singleton slots; collisions return no decodable EPC and alter Adaptive Q. Step confirms this readout.
ExplainTags choose slots after Query, and the reader acknowledges one RN16 before receiving that tag's EPC data. Step exposes this mechanism.
A passive UHF RFID reader powers nearby tags and asks the matching tags to identify themselves. Each successful tag sends an EPC value, usually shown as the item identifier.
Why not ask all tags at once?
If several tags backscatter at the same time, their replies overlap. EPC Gen2 uses random slots so the reader can find empty slots, collisions, and single-tag replies.
What should you try first?
Press Step and watch one slot. Then change Q: too small gives collisions; too large wastes time in empty slots; near the active tag population is usually better.
Scenario
This is the number of powered tags matching the current inventory selection.
The teaching model caps Q at 7 for readability. The EPC Gen2 standard allows a wider Q range.
A single tag can still be missed if orientation, range, metal, liquid, or interference weakens the backscatter.
Adaptive Q is shown as a practical reader strategy, not as a full vendor-specific algorithm.
Controls
1. QueryReader starts a frame
2. ChooseTags choose slots
3. RN16Slot-zero tag replies
4. ACK/EPCReader selects one tag
5. QueryRepReader advances slot
Start with a Query.
The reader selects the session and target, announces Q, and creates a frame of slots. Matching tags pick a random slot counter.
QueryReader sets session, target, and Q.Q=4Slot choiceTags load counters from 0 to 2^Q - 1.12 tagsRN16Only tags whose counter is zero should reply.waitingACK + EPCReader ACKs one RN16, then receives PC/EPC/CRC.noneQueryRepRemaining tags decrement slot counters.slot 0
Current frame slots
Step through each reader opportunity. Green means one EPC read, red means collision, grey means empty.
Diagnosis: first frame ready
Step through the first few slots before changing Q. Early empty or collision outcomes are normal in a random frame.
0Successful EPC reads this round
0Collision slots seen
0Empty slots seen
12Tags still active in the session
Reader event log
Command Quick Reference
Query: starts or restarts an inventory round with a selected session, target, and Q.
ACK: echoes the RN16 from one successfully decoded tag.
QueryRep: advances to the next slot by decrementing counters in participating tags.
Tag Reply Quick Reference
RN16: a temporary 16-bit random number used for the reader to address one reply.
PC/EPC/CRC: the identified tag returns protocol-control bits, EPC data, and a CRC after ACK.
Inventoried flag: a successful tag changes flag state and becomes quiet for that session/target.
Q Tuning Quick Reference
Frame size: slots = 2^Q.
Too small: many collisions; increase Q.
Too large: many empty slots; decrease Q or accept slower inventory.
Guided practice
Use Balanced shelf and press Step event until one EPC is read. Name each command in order.
Switch to Frame too small. Count collisions after half the frame. Explain why Q should increase.
Switch to Frame too large. Count empty slots. Explain why a large frame can slow inventory even when it avoids collisions.
Use Weak RF edge. Find a slot with only one tag but no EPC read, and separate RF loss from anti-collision logic.
Technical accuracy notes
This is a teaching model
The workbench shows the inventory sequence and main outcomes. It does not model every Gen2 timing field, modulation option, command bit, memory bank, or vendor Q algorithm.
Q is not a tag count
Q chooses a frame size. A good Q is related to the active population, but a reader observes only empty, collision, loss, and successful slots.
Collision evidence is limited
A collision tells the reader that more than one signal overlapped. It does not reveal the exact number of colliding tags in that slot.
ACK selects an RN16
After a clean RN16, the reader ACKs that value. The tag then backscatters protocol-control bits, EPC bits, and a CRC in the simplified sequence shown here.
Session flags silence tags
A successfully inventoried tag changes its inventoried flag for the selected session/target. It is not permanently silent; persistence depends on the session behavior.
Throughput has a ceiling
Ideal slotted ALOHA peaks near 1/e successful replies per slot when the offered load is near one. Practical read rate also depends on command timings and RF conditions.
Primary source links
Use these sources when checking terminology, command sequence, and standard boundaries.