Arrays and Buffers

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

TagDirectionTypeDefaultDescription
In_AdvanceInputBOOL0Advance the conveyor one position toward the left end
In_ReverseInputBOOL0Reverse the conveyor one position toward the right end
In_RightEntryInputBOOL0Part waiting at the right end, position 0
In_LeftEntryInputBOOL0Part waiting at the left end, position 7
In_ResetInputBOOL0Clear every tracked position
Sts_LeftEndOutputBOOL0Part pushed off position 7 this scan
Sts_RightEndOutputBOOL0Part pushed off position 0 this scan
Ref_PositionsInOutDINT[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