Live / Historical Data#
Estimated time to read: 6 minutes
Live data is computing data that is still relevant and is observable in real-time. This type of data enables you to be proactive and take immediate action to prevent problems before they happen. It also provides you with the necessary tools to respond with greater speed and accuracy to the needs of your industry.
Historical data is collected data about past events and circumstances pertaining to a particular subject. This type of data allows you to track improvements over time and better understand your business and how it is evolving.
Note
Historical data includes most data generated either manually or automatically within a company.
Being able to access, work with, and process live and historical data gives you the upper hand to better manage production on a daily basis and in the future. It means you have more information at your disposal, and this makes for a better understanding of your segment.
The image below is an example of how live data can be visualized:
Overview#
This document will provide a quick guide for the configuration of a mechanism that enables retrieving information from the events entering the system in real time or to fetch historical data recorded in the past.
Setting Up Live Data / Historical Data#
In order to be able to use the Live Data / Historical Data feature, it is necessary to follow the following steps:
- Create the UI Page and Configure the Event Data Source
- Plug in Widgets to visualize the events information
Create the UI Page#
The UI Pages used for Live Data / Historical Data are normal UI Pages with the added functionality of an Event Data Source which must be created and added.
Configure the Event Data Source#
In this example, the Data Source is being configured to subscribe to an IoT Event Definition named EquipmentData. The structure of this example event is the following:
{
"AppProperties": {
"EventDefinition": "EquipmentData",
"EventTime": "2020-08-12T20:17:46.384Z",
"ApplicationName": "ConnectIoTSimulator",
},
"Data": {
"Temp": 20,
"Humidity": 45
},
"SysProperties": {
"EventId": "1600795819339901352",
"EnqueueTime": "2020-09-22T17:30:19.385Z",
"UserName": "CMF\\producttest",
"HostName": "VM-DSM03",
"IPAddress": "::ffff:10.24.16.33"
}
To set up an event data source in the UI Page editor, go to the Data Source tab in the UI Page settings:
You can access additional settings of the Data Source by clicking the Settings button in the same tab:
Here are the specific properties of the Event Data Source:
| Parameter | Description | Example |
|---|---|---|
| Retrieve History Data | Set to true to fetch historical data, false otherwise | True |
| Update Using Real Time | Set to true to subscribe to real time data | True |
| Timestamp Path | The path to the timestamp property in the event | AppProperties.EventTime |
| IoT Event Definition | The IoT Event Definition to retrieve information from | EquipmentData |
| Time Interval to Load | The time interval to be used to retrieve historical data | 2 Hours |
| Filter Collection | A Filter Collection constructed to filter the results in the real time subscription or historical data | Data.Humidity > 10 |
Table: Specific properties of Event Data Source
Note
To access these properties it is necessary to access the extended Data Source Settings by clicking Settings
Event Data Source Outputs#
The specific outputs of this data source are the following:
| Parameter | Description |
|---|---|
| realTimeData | Contains the object (event) received via real time subscription |
| historicData | Contains the collection of objects (events) fetched via Historical Data |
Table: Specific outputs of Event Data Source
Visualization Widgets#
The Event Data Source is responsible for fetching the information that can be fed to the different Widgets in the MES system through the available Data Source Outputs. The following sections exemplify the usage and configuration of the Live Data Widget to display the information provided by the DataSource from the previous section.
Live Data Widget Configuration#
Add the Live Data Widget to the UI Page and then proceed to the configuration panels:
Layout#
Configuration of the Time (X) and Values (Y) axes is performed in this panel.
X axis important configuration entries#
| Parameter | Description | Example |
|---|---|---|
| Time Scale | The X axis scale displayed in the graph | 2 Minutes |
| Data Path | Path to the property in the object containing the timestamp of the event | AppProperties.EventTime |
Table: X axis important configuration entries
Y axis important configuration entries#
| Parameter | Description | Example |
|---|---|---|
| Minimum | The Y Axis minimum scale value | 0 |
| Maximum | The Y Axis maximum scale value | 100 |
| Data Path | Path to the property in the object containing the information of the event to display | Data |
Table: Y axis important configuration entries
In this example we are setting up the Live Data Widget with an X scale of 2 minutes and Y scale from 0 to 100. The widget will fetch the information to display in the X axis from the property AppProperties.EventTime and the information to display in the Y axis from the property Data.
Chart Series#
Several different series can be added, displaying different values to be displayed. In this example we are configuring two Chart Series:
- Humidity
- Series will be displayed in red color and will show information available in the object property
Data.Humidity
- Series will be displayed in red color and will show information available in the object property
- Temperature
- Series will be displayed in blue color and will show information available in the object property
Data.Temperature
- Series will be displayed in blue color and will show information available in the object property
Series Configuration#
In the next table the most important settings of these series are displayed:
| Parameter | Description | Example |
|---|---|---|
| Name | Series name | Temperature Series |
| Color | Series display color | - |
| Extra Data Path | A Data path can be specified here so that multiple series can be created for the same event. This will be appended to the Data Path of the Layout Settings | Temperature |
| Series Units | Units of this Series | ºC |
Table: Series configuration settings
Since we specified Data as the Data path in the layout panel, in this series the information will be retrieved from the property Data.Temperature.
Inputs#
The next table displays the specific inputs of the Live Data Widget. These inputs will be available for each series:
| Parameter | Description |
|---|---|
| value | Receives a single value and displays it |
| values | Receives an array of values and displays it |
| pastValues | Receives an array of values with past timestamps displays it |
Table: Live Data Widget inputs
To complete the configuration, set the connections between the Event Data Source outputs and Live Data Widget inputs such as what is shown below:








