📦 ProductBuffer V3 – Eklund


🔎 Overview

The ProductBuffer V3 is a Siemens PLC Function Block (FB) designed to track products on a conveyor using an encoder and a start sensor.

It manages multiple products simultaneously and automatically determines when a product has reached the configured trigger distance.


⚙️ Functionality


🔢 Data Structure

Product entry (struct)

STRUCT ST_Product
    Active          : BOOL;   // Product active in buffer
    StartPosition   : DINT;   // Encoder value at detection
    CurrentDistance : DINT;   // Distance traveled
    Triggered       : BOOL;   // TRUE once trigger distance reached
END_STRUCT

Buffer (array)

VAR
    ProductBuffer : ARRAY[0..12] OF ST_Product;
END_VAR


🖧 FB Inputs / Outputs