A use case for the function block FB_FlowEstimation is the estimation of a flow of products on a conveyor.
The method used to generate the products in the application is not relevant for the flow estimation. For example, it could be a vision system sending information to the controller or a software trigger generated in the program, based on a time period.
From a flow estimation point of view, it is important that every time a new product is detected, the Notify method of FB_FlowEstimation is also called to signal it to the function block.
The table includes the main steps required to use the function block:
Step |
Action |
---|---|
1 |
Define an instance of the function block:
|
2 |
Set the desired time period that will be used for the estimation; the value must be strictly positive. In this case, the time period is set to 1000 ms.
This must be done at least once before calling an Update. |
3 |
At runtime, the Update method must be called at every cycle to keep the estimation updated.
The first time, Update is called after the initialization of the function block or after the call of the Reset method, the internal timer starts to count. |
4 |
At runtime, the Notify method must be called each time a new product is detected. The input i_udiNumberOfObjects specifies how many objects must be notified.
|
5 |
The estimated flow value is available in the property lrAverageFlowPerMinute. This value is based on the number of already evaluated time periods, described by udiNumberOfTimePeriods. |