Seems like it's being overly complicated. Two choices:
If the resolution is such that the array isn't enormous, then use a shift register of array type UDT that contains whatever info is needed for a board. That UDT can be populated at the beginning or any stage along the way with additional info.
If the resolution is such that the array becomes unwieldy, create an array of the total possible boards in transit instead. Same UDT, except an additional field holds the current position. Every array element is then updated every X counts with a simple ADD. You could do it with a virtual axis tied to the encoder and use the motion event trigger which is going to be in the 2ms range. Then the eject trigger points are just comparing current position element of the UDT.
If the resolution is such that the array isn't enormous, then use a shift register of array type UDT that contains whatever info is needed for a board. That UDT can be populated at the beginning or any stage along the way with additional info.
If the resolution is such that the array becomes unwieldy, create an array of the total possible boards in transit instead. Same UDT, except an additional field holds the current position. Every array element is then updated every X counts with a simple ADD. You could do it with a virtual axis tied to the encoder and use the motion event trigger which is going to be in the 2ms range. Then the eject trigger points are just comparing current position element of the UDT.

