Example

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.

Refer to configuration to understand all configuration options of this Connector.

Step 1: Add the Connection

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.

Step 1: Add the Connection

Select the TSA SQL Server Connector and enter a name for the connection. In this case, set the name to "TSA SQL Connection".

Step 1b: Add the Connection 2

Step 2: Configure Server

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.

Step 2: Configure Server

Step 3: Configure Database

Select the database and click Save.

Step 3: Configure Database

Step 4: Use the Connection

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.

Step 4: Use the Connection

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.

Step 4b: Use the Connection 2

Step 5: Use the Data Sources

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:

Accordian
Property
Value

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

Step 5a: Use the Data Sources
Step 5b: Use the Data Sources 2

Step 6: Results

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.

Step 6a: Results - criteria selection

Observe that the average motor current data is returned from the SQL Server database for the selected period.

Step 6b: Results - output

Files

File
Link
Security Key

Application

C0mp|ex123

See the Import, Export, and Clone - XMPro article for steps to import an Application.

Last updated