Take turns ROUND ROBIN
Picks the next ready slot after the last one picked.
SEL2 · Bay2
Cands3
VAL1
| Tag | After two scans |
|---|---|
| Dock | EN 1 SEL 2 VAL 1 ERR 0 RES 0 |
How it works
A true rung picks. A false rung picks nothing, but new requests still join the line and .SEL is 0.
How it's used
Use it to share work evenly, so each waiting place gets a turn. It moves on every scan the rung is true, so pulse it with an ONS to pick once.
Global.Bay1CallXIC
Global.Dock.Bay1.REQOTE
Global.Bay2CallXIC
Global.Dock.Bay2.REQOTE
Global.Bay3CallXIC
Global.Dock.Bay3.REQOTE
Global.PickXIC
SEL2 · Bay2
Cands3
VAL1
Global.Dock.VALXIC
Source2
Dest2
| Tag | Value |
|---|---|
| Bay1Call | 1 |
| Bay2Call | 1 |
| Bay3Call | 1 |
| Pick | 1 |
| Dock | EN 1 SEL 2 VAL 1 ERR 0 RES 0 |
| NextBay | 2 |
All three bays are calling and Pick has been on for two scans. Each scan picks the next bay in turn: Bay1, then Bay2.
In practice
Take turns: picks the next requested, available slot after the last one picked.
Configuration
- One rung per bay writes Dock.Bay1.REQ, and Dock.Bay1.RDY where the bay can take work; then XIC Dock.VAL with MOVE Dock.SEL to the destination.
Limits and status
- .SEL is the 1-based candidate; 0 means none. .ERR holds the reason code.
- Renaming a candidate renames its members everywhere.
- Renaming the tag or changing its candidates starts the selection over.
- Algorithms instructions are learning aids for deterministic selection. They are not safety-rated or certified, and they do not plan paths, avoid collisions or control motion. This is not a safety function.
Operands
| Operand | Data type | Read or write |
|---|---|---|
| Tag | ALGORITHM | Reads and writes |
Common mistakes
- Assuming Selected is zero-basedSelected is a 1-based slot, or 0 for none. Use Valid before moving it to a destination.