Result
Understand how to create an hourly measure from a Flow tag using the "Flow Zone"
Tutorial steps
- Drag a measure onto the Flow Zone – Drag and Drop a tag from the model view onto the Flow Zone to create an hourly measure
- Deploy the measure – by performing a deploy operation
- Confirm data processing – confirm data had been backfilled and the correct aggregation method been processed by using the process view
You are going to create an hourly measure for the Boiler Temperature under the "Steam" folder in your Flow Model. In the previous tutorial, you created a tag, which retrieves raw data points from the data source. Now, you are going to create a measure that gives you the average temperature every hour.
Unlike a tag, which can have many values per hour (e.g. if the tag changes every 1s, there will be 3600 values in a tag per hour), an hourly measure will only have one value per hour.
Drag the "Temperature" tag that you created in the previous tutorial onto the "Hourly" icon in the "Flow Zone"
Notice what has happened …
When you dropped the tag onto the Flow Zone, Flow created another measure for you. By default, the name of the measure is the same as the "source" measure. The interval type depends on which icon in the Flow Zone you dropped the source measure onto. In this case, you have created an Hourly measure.
Also, notice how the icon describes a few of the measure’s properties:
You should see an orange disk appear on the measure and recursively up the model tree. Like in the deployment view, this orange disk indicates that there are undeployed objects in that branch.
Deploy the Measure
The measure has been created, but it is not "Deployed" (i.e. it is not running). To get it to run, you need to "Deploy" it.
Right-click on it and select "Deploy".
The Engine you deployed earlier will now start processing this measure. The Engine will go and collect summary information from the Historian for every hour back to the Backfill date and time, catch up to "now", and then continue to process every hour from now on.
If you select the "Deployment" view tab, you will notice the new Metric is allocated to the Engine for processing. If more than one engine was configured in a distributed architecture, you could deploy your metric to any of those engines.
Measure Editor
Let’s have a look at what is happening behind the scenes. Double-click on the new measure to open its Editor …
General Properties
The top section of the Measure Editor displays a few general properties for the Measure:
- Description – Measure description (in this case, the description was pulled through from the Historian tag’s description)
- Format – report format used to display the summary values (in this case, 1 decimal place)
- Unit – unit of measure (in this case, the unit of measure was pulled through from the Historian tag’s engineering unit. This is why we didn’t need to set the Default Unit of Measure.)
- Backfill – the date and time used by the Engine to go back in history and retrieve the summary information from the Historian
Context
By default, the Context section will show a chart of the summarized information relating to the measure. In this case, the chart displays the last 12 hours of average Boiler Temperature in ˚C for each hour. The vertical cursor line represents the following states:
- Green - the measure is running. The cursor represents the last successful processing time.
- Red - the measure is running, but has been "Backfilled". The cursor will turn Green as soon as the Engine accepts the Backfill date.
- Black - the measure is not running (i.e. it has been undeployed).
The same information can be displayed in a grid. Select the Grid tab …
Notice the information provided in the grid:
- Period Start – the start of the time period (in this case the start of the reporting hour).
- Period End – the end of the time period.
- Value – the formatted summary value retrieved from the Historian.
- Quality – the OPC Quality of the data used to produce the summary value (192 = Good, 0 = Bad)
- Duration – the duration of the time period in milliseconds.
- Preferred – indicates whether this version of the value for the time period is used for reporting.
- Version – the version of the value for this time period.
- Captured – date and time when the value was actually retrieved / calculated / edited.
- User – indicates if and who made changes to the measure value via the Flow Server.
Select the Properties tab …
The "Context" section contains configuration relating to what context the measure’s values are summarized against. In this case, you will notice the "Production" calendar has already been added to this measure’s context. Being an hourly measure, the Engine will process it against the "Production" calendar’s definition for hourly time periods. In this case, the "Production" calendar’s hourly time periods are standard hours (e.g. 06:00 to 07:00), but you could have set the calendar up for hours to start at 15 minutes past the hour (e.g. 06:15 to 07:15).
Notice that a default "Refresh Offset" of 60 seconds has been configured for this calendar context. This means that Flow will only attempt to get the current hour’s summary information from the Historian 60 seconds after the hour is completed. More than one "Refresh Offset" can be configured if required.
Projected Time Buckets
Revert to the General Properties Section. Flow allows you to project a measure into the future by a number of intervals. By default, a measure will be set to have no projected time buckets (i.e. 0 periods into the future). By setting the "Projected" property of a measure to a positive integer value will set the measure to process into the future. Notice that the chart in the "Context" section will show the "future" periods in the green shaded area.
Projected measures are useful for information relating to plans or predictive calculations. For this tutorial, leave the "Projected" value as 0 periods.
Retrieval
Expand the "Retrieval" section. Notice that this section contains information about the tag you are retrieving data from/through. On the left hand side, you can see the name of the tag that this hourly measure is using (the "source" tag)
- Aggregation – this determines how the detailed data being retrieved by the tag (i.e. high-resolution data) should be summarized into an hourly value for reporting purposes. By default, Flow uses the average aggregation method.
- Scaling Factor – this is a factor that the resultant summarized value is multiplied by in the case where scaling is required (e.g. simple unit of measure scaling).
Dependants
This section displays any other objects in your Flow System that depend on this measure. Examples include:
- Other measures that may use this measure in calculations or aggregations
- Reports
- Forms
Change Log
This section displays a change log for this specific measure, from creation to deployment. Any changes that are made to the measure’s configuration will be logged here.