Data Management
Events
Using Calculated Event Properties
introduction with factry historian v8 0, we're bringing calculation scripts to docid 0ith2zlcais5yywhsdtje properties this feature allows you to develop more complex use cases in factry historian calculated event properties work similarly to docid\ opiodkgnngyjedx6zkg d (which apply to time series data), because they rely on one or more inputs, a tengo script, and they return an output this makes it a great feature for use cases such as calculating kpis calculating yields for material and energy calculating quality characteristics based on test results example case in this example case, we're exploring a typical use case in yeast production to calculate the efficiency and yield of the fermentation process fermentation is a batch process, which makes it an ideal use case for the events processing functionality in factry historian to verify the performance of the production batch once fermentation is done, we want to calculate the following properties yeast output in fermenter \[kg] (dry weight of produced yeast biomass; based on final spin test result & final volume in fermenter) yield in fermenter \[%] (yeast output in fermenter \[kg] / fed molasses \[kg]) yeast output (kg) yeast output will be calculated by taking a sample of the fermentation broth when the fermentation has ended, and determining the (dry) yeast content per volume of the broth this then needs to be multiplied with the final volume of broth in the fermenter when the fermentation ended, to obtain the total amount of yeast m {\text{yeast}} \\;=\\; \left( \frac{m {\text{sample,dry}}}{v {\text{sample}}} \right) \cdot v {\text{final}} yield in fermenter (%) the fermenter yield is a measure of how efficiently the carbon source (molasses, typically) has been "converted" to yeast biomass this will be calculated by dividing the yeast output by the fed molasses, on dry weight basis y {\text{fermenter}} \\;=\\; \frac{m {\text{yeast}}}{m {\text{molasses}}} let's get to work available data in the example case for our fermenter, we have the following measurements coming into factry historian from the scada system controlling the fermentation f1 batchid the batch id f1 programstep the plc program step f1 volume volume of material in the fermenter \[l] f1 molassetotal molasse feed totalizer \[kg] and our operators take a sample of the fermentation broth at the end of fermentation and determine the volume of it in the lab, as well as the dry matter content asset property configuration we configure our fermenter asset in the asset tree, together with its docid\ cr6hbrdsl8fsuvlvm20if fermenter 1 batchid > linked to f1 batchid measurement status > linked to f1 programstep measurement volume > linked to f1 volume measurement molasse feed totalizer > linked to f1 molassetotal measurement event configuration we configure a fermentation batch event type and configure the following properties batchid finalfermentervolume \[l] molassetotal \[l] finalsampledrymatter \[kg] finalsamplevolume \[l] yeastoutput \[kg] fermenteryield \[%] then we attach the fermentation batch event type to fermenter 1 in our asset tree, and configure "historian" as the detection mode to trigger the start and stop times of the fermentation batch event, based on the status asset property of the fermenter 1 asset once attached, we configure the event properties as such, with priority 0 batchid > batchid asset property, with 'first' as aggregation finalfermentervolume > volume, last molassetotal > molasse feed totalizer, last finalsampledrymatter > manual finalsamplevolume > manual the first 3 event properties are known in historian, because they are collected from the scada system we set these to detection mode historian because the last 2 are test results from the lab, we configure these with detectio mode manual manual entry form configuration to obtain the final sample dry matter and volume, we set up a docid\ e6zvm8l zlpfpchdtqu0h to enable the operator to enter those 2 values on the batch event manually once configured, the (lab) operator is presented with the interface as seen below, and enters the values for final sample dry matter and final sample volume calculated event properties configuration now we should have all data available to perform our calculations 3 values coming from scada, 2 values from manual entry we can now configure the final 2 event properties as calculated event properties on the fermentation batch event type yeastoutput we define yeastoutput with detection mode calculation, taking finalsampledrymatter , finalsamplevolume and finalfermentervolume as inputs we give this calculation priority 1, as it is dependent on finalfermentervolume (coming from historian) and finalsampledrymatter & finalsamplevolume, coming from the manual entry form we configured before once configured, yeastoutput will be calculated automatically in factry historian once all 3 input event properties are known fermenteryield we define fermenteryield with detection mode calculation, taking yeastoutput and molassetotal as inputs molassetotal comes from historian, and yeastoutput is itself a calculation we give this event property the priority 2 once both event properties are known, fermenteryield is calculated automatically by factry historian outcome using the setup above, factry historian's event processor will constantly process data in the background and calculate the yeastoutput and fermenteryield event properties in grafana, we can now easily display these batches using the https //grafana com/grafana/plugins/factry historian datasource/ by selecting the events tab, browsing the asset structure to select fermenter 1, and selecing the fermentation batch event you can see the example dashboard here https //demo factry io/d/df66nb5ez36rka/fermentation dashboard conclusion we believe this feature will unlock a lot of value for our users, who can now calculate kpis automatically using data coming from their control systems, and optionally from manual entry we can't wait to see what our users build with this functionality