Please ensure Javascript is enabled for purposes of website accessibility
Powered by Zoomin Software. For more details please contactZoomin

AVEVA Enterprise SCADA

Create a connection using the Trendview Business Logic Tier (BLT)

Create a connection using the Trendview Business Logic Tier (BLT)

  • Last UpdatedApr 24, 2025
  • 5 minute read

This section will take you through the process of creating a connection to the Trendview Business Logic Tier (BLT). this BLT is used to obtain data from both the RealTime database (RTDB) and Historical database. The following example illustrates how to create a connection to the Historical database using the Trendview BLT.

To create a connection to the Historical database

  1. Open your Microsoft Visual Studio project.

  2. Right-click the report, and select New Item > Add.

    The Add New Item window for the report appears.

  3. In the Add New Item window:

    1. In the left pane, select Report Project as a project template type.

    2. Select Report Wizard.

    3. Enter the name of your report in the Name field.

    4. Select Add.

    The Report Wizard opens.

    Embedded Image (65% Scaling) (LIVE)

  4. Select Next.

    The Select the Data Source page appears.

  5. In the Select the Data Source page:

    1. Select New data source.

    2. In the Name field, enter the name of the new data source.

    3. In the Type field, select the type of new data source.

    4. Select Edit.

    The Change Data Source dialog box appears.

  6. Select Microsoft SQL Server (SqlClient), and select OK.

    The Connection Properties dialog box appears.

  7. In the Connection Properties dialog box:

    1. In the Server name field, enter the name of the server that you want to connect to.

    2. Select Select or enter a database name, and enter or choose the database you want to connect to.

    3. Select OK.

    The Connection Properties dialog box closes and the Select the Data Source page appears again, this time with the Connection string window populated.

  8. Select Next.

    The Design the Query page appears.

  9. Select Query Builder.

    The Query Designer window opens.

  10. Using the "Trending Functions" table at the bottom of this section as a guide, enter the desired trending function in the Query Designer window.

  11. In the Query Designer window:

    1. Select the SQL check icon.

    2. Select OK.

    The Query Designer window closes and the Design the Query page appears again with the Query string field populated.

  12. Select Next.

    The Select the Report Type page appears.

  13. Select Tabular and select Next.

    The Design the Table page appears.

  14. Move the fields you specified in the Query Designer window to the Displayed fields list.

  15. Select Next.

    The Choose the Table Style page appears.

  16. Select the table style you want, and select Next.

    The Choose the Deployment Location page appears.

  17. In the Report server field, specify the location of the Reporting Services server.

  18. Select Next.

    The Completing the Wizard page appears.

  19. Enter in a name for your report in the Report name field and select Finish.

    The wizard closes.

  20. Navigate to the Report Data pane > Datasets.

  21. Right-click the dataset and select Dataset Properties.

    The Dataset Properties dialog box appears.

    Embedded Image (65% Scaling) (LIVE)

  22. In the Dataset Properties dialog box:

    1. Select the Parameters tab.

    2. Add any additional parameter names and values.

    3. Select OK.

  23. Select Preview to view your report.

    Trending Functions

    Microsoft SQL Query

    Time Format

    Output Time includes Field Time?

    Dynamic Trend resolution available?

    SELECT time, milliseconds, value, status

    FROM

    dbo.RTtrendWithResults(‘collect’, @pointname, ‘value’, @startDate, @endDate) AS go

    Unix Epoch Time

    No

    No

    *

    SELECT time, milliseconds, value, status, fieldTime, fieldMilliseconds

    FROM

    dbo.RTtrendWithFieldTime(‘collect’, @pointname, ‘value’, @startDate, @endDate) AS go

    Unix Epoch Time

    Yes

    No

    *

    SELECT time, milliseconds, value, status

    FROM

    dbo.RTtrendviewWithResults(‘collect’, @pointname, ‘value’, @startDate, @endDate) AS go

    String

    No

    No

    SELECT time, milliseconds, value, status, fieldTime, fieldMilliseconds

    FROM

    dbo.RTtrendviewWithFieldTime(‘collect’, @pointname, ‘value’, @startDate, @endDate) AS go

    String

    Yes

    No

    SELECT time, milliseconds, value, status

    FROM

    dbo.RTtrendWithDTR(‘collect’, @pointname, ‘value’, @startDate, @endDate, @dTResolution) AS go

    Unix Epoch Time

    No

    Yes

    SELECT time, milliseconds, value, status, fieldTime, fieldMilliseconds

    FROM

    dbo.RTtrendWithDTRFieldTime(‘collect’, @pointname, ‘value’, @startDate, @endDate, @dTResolution) AS go

    Unix Epoch Time

    Yes

    Yes

* If RealTime Add-On 7.7.1.79 or later has been installed on your system, these two procedures will fail. If this is the case, proceed as follows:

  • Use RTtrendWithDTR instead of RTtrendWithResults with a @dTResolution of 0.

  • Use RTtrendWithDTRFieldTime instead of RTtrendWithFieldTime with a @dTResolution of 0.

Related Links