Tags form the basic building blocks to transform raw data from data sources to actional information. Before data is contextualised and sliced into time bucket to create KPI's, we might want to preform pre-aggregate functions on the raw data.
This is where tags come into play. Think about creating rules around cleansing data due to quality changes, filtering out bands, filtering on equipment/machine state or even more complex rules relating to data points in more than one data source.
Tags and Tag calculations gives you a normalized data set of raw tag data, from multiple sources, to preform calculation like:
- Filtering out bad quality of data. i.e. data that does not have an OPC quality code of 192
- Remove outliners from data. i.e. remove data greater or less than a set of control setpoints. (Band filtering)
- Mix data from an Industrial Historian and an MES solution to filter data based on the fact that the piece of equipment is scheduled to be active or not.
These examples can be downloaded from the link below and imported to your model to experiment with.
Create a Tag
Tags can be created by dragging a namespace item into the Information Model onto a Metric or Event. This will look at your settings in the default settings bar. Make sure your default is set to create tags for this operation to work:
Else, the tag icon in the Flow Zone can be used to create tags by dragging and placing the Tag Icon in the Flow Zone onto a Metric or Event.
Notice what has happened …
When you dropped the tag onto the metric or Event, Flow created a measure, of type tag, for you. By default, the name of the measure is the same as the tag used to create the measure from the specific data source.
Also, notice how the icon describes a few of the measure’s properties:
Measure Editor
A double-click operation on the new measure to open its Editor to configure certain properties of the measure.
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.)
Data Preview
By default, the Data Preview section will show a chart of the raw data for the last 30 minutes. In this case, the Start and End of Period has been adjusted to display both the raw data chart and grid views for the last 3 days.
To hide/display the Chart or Grid views, toggle the respective buttons in the top left of the Data Preview.
Notice the information provided in the grid:
- Timestamp – the data & time at which the raw value was retrieved.
- Duration – the duration (since the last data point, or since the start of the period if this is the first data point) in milliseconds.
- Value – the formatted raw value retrieved from the Data Source.
*Note - Flow does not duplicate/store data that is retrieved by a tag (Raw tag data). The data is retrieved and kept in memory to populate the Data Preview Grids and Charts
Retrieval
Expand the "Retrieval" section. Notice that this section contains information about the tag you dragged across from the Historian Namespace.
- Data Source - the name of the Data Source from which you dragged and dropped the tag.
- Tag – the "Historian" tag for which raw data is retrieved (this was populated during the drag n’ drop action, but can be edited if required, another tag can also be dragged over this textbox). If the data source is a SQL, this will be replaced with a Query textbox
Dependents
This section displays any other objects in your Flow System that depend on this measure. Examples include:
- Other tags that use this tag in calculations
- Measures that may use this tag in aggregations
- Pass-through charts
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.
Next steps would be to used tags to aggregate Measures, provide start and end triggers to events, create calculated tags, preform tag transforms, display tag data on the Pass-through chart and pass through raw data from the underlying data source to other systems using the Flow Public API.