Track an Indexing Conveyor
hard
Tracks which positions of an indexing conveyor hold a part as it advances and reverses.
What it teaches
An indexing conveyor moves every position at once, empty or not, so a queue does not fit: the gaps are real. Keep the eight positions as bits 0 to 7 of one word, laid out the way the Binary radix shows them: position 0 at the right, position 7 at the left. An advance shifts the pattern one place to the left. Each end has its own entry sensor: In_RightEntry rides in at position 0 on an advance, In_LeftEntry at position 7 on a reverse. The bit pushed off the far end is the part that left, and it must not linger above bit 7.
Parameters
| Tag | Direction | Type | Default | Description |
|---|---|---|---|---|
| In_Advance | Input | BOOL | 0 | Advance the conveyor one position toward the left end |
| In_Reverse | Input | BOOL | 0 | Reverse the conveyor one position toward the right end |
| In_RightEntry | Input | BOOL | 0 | Part waiting at the right end, position 0 |
| In_LeftEntry | Input | BOOL | 0 | Part waiting at the left end, position 7 |
| In_Reset | Input | BOOL | 0 | Clear every tracked position |
| Sts_LeftEnd | Output | BOOL | 0 | Part pushed off position 7 this scan |
| Sts_RightEnd | Output | BOOL | 0 | Part pushed off position 0 this scan |
| Ref_Positions | InOut | DINT[1] | — | One word shown in Binary: bit 0 is position 0 at the right end, bit 7 is position 7 at the left end |
Required behavior
- Ref_Positions[0] is the conveyor as bits 0 to 7: position 0 is bit 0 at the right end, position 7 is bit 7 at the left end. The caller may preload it.
- A rising In_Advance shifts every position one step left and brings In_RightEntry in at position 0. A rising In_Reverse shifts one step right and brings In_LeftEntry in at position 7.
- Sts_LeftEnd is 1 only on the scan an advance pushes an occupied position 7 off. Sts_RightEnd is 1 only on the scan a reverse pushes an occupied position 0 off.
- A part pushed off is gone. Keep the word within 0 through 255.
- A held request acts once. If both rise together, advance wins.
- In_Reset clears the word and both outputs and wins over movement. A request held through reset must drop and rise again.