FB_ProductBuffer_NoArray_TCK is a FIFO-style product buffer for a PLC, that:
TIME_TCK)TimeDelay) per productTriggerMovement := TRUE) once the delay has passedTriggerFeedback := TRUE) before processing the next productAll of this happens without arrays, using STRUCTs with fixed entries like _0, _1, … _9.
| Name | Type | Description |
|---|---|---|
SensorInput |
BOOL |
Digital input from the product detection sensor |
TimeDelay |
TIME |
The wait time required per product before triggering movement |
SystemTime |
TIME |
The current PLC runtime time (from TIME_TCK) |
TriggerFeedback |
BOOL |
External signal indicating the current movement is complete |
TriggerMovement |
BOOL |
Output signal to start a movement |
ProductCount |
INT |
The number of currently buffered products waiting to be processed |
| Variable | Purpose |
|---|---|
StartTimes._x |
Timestamp of when a product was added to buffer slot _x |
Actives._x |
Flag indicating whether slot _x is active (has a product) |
InsertIndex |
Index of where the next product should be added (0–9, wraps around) |
PrevSensor |
Stores the previous sensor value for edge detection |
MovementActive |
TRUE when a movement is in progress |
Elapsed |
Time difference (in ms) between SystemTime and product StartTime |
F SensorInput AND NOT PrevSensor THEN