Example
Last updated
Last updated
This example Application demonstrates how to read asset telemetry data, the average motor current for pump 1, from a SQL Server Database using the TSA SQL Server Connector.
From the Properties blade of the Time Series Chart, select the Data Source tab.
Click the plus icon next to Data Source and then the plus icon next to Connection.
Select the TSA SQL Server Connector and enter a name for the connection. In this case, set the name to "TSA SQL Connection".
Enter the authentication details: the Server Instance, User Name, and Password. In this case, tick to use SQL Server authentication as a password is needed.
Select the database and click Save.
Select the Connection that was just created, enter the Data Source name, and select the entity to read. In this case, set the name to Chart Data and the entity to SimpleChart. Save the Data Source.
Note that the primary key is auto-populated once the entity is selected.
Repeat the above step to add another TSA SQL Data Source for the Hierarchy. In this case, set the name to Chart Hierarchy and the entity to SimpleTree. Save the Data Source.
Select the Data Sources we just added, configure the Block properties and save the Application.
Click the launch button to launch the application.
In this case, use the following values:
Data Source
Data Source
Chart Data
Data
Timestamp Expression
Timestamp
Hierarchy
Group By Asset
Ticked
Hierarchy
Asset Id Expression
Id
Hierarchy
Show Hierarchy
Ticked
Hierarchy
Data Source
Chart Hierarchy
Hierarchy
Id Expression
Id
Hierarchy
Name Expression
Text
Hierarchy
Parent Id Expression
Parent
Hierarchy
Resource Expression
IsResource
Select the asset telemetry data from the hierarchy that we want to display. In this cased select Mine 1 Dropdown, then Select Area 1 Dropdown, then Pump 1, then Motor Current, and then select Apply.
Observe that the average motor current data is returned from the SQL Server database for the selected period.
Application
C0mp|ex123
See the article for steps to import an Application.