PREVNEXT

brandLogo: alt="EnergyLogo"


Importing Sql databases


You can use the Rdbms History Import component to import SQL data in order to create a NiagaraAX history based on remote SQL data. This history file import descriptor resides under the Sql Server History Device Extension of a SqlServerDatabase “device” on a RdbmsNetwork. You use the Rdbms History Import Manager view to Discover and Add import descriptors.

This import descriptor has properties “common” among all history import descriptors, such as Name, History Id, and so on. See “History Import properties” on page 141. See “Properties of history file import descriptors” in the NiagaraAX User Guide for other configuration properties.

Import Sql data

You must have administrative access to the SQL database (username and password) and the hosting server before you can complete the following procedure.

  1. In the NiagaraAX Workbench nav tree, under your station database (Config node), click on the Drivers node to display the network devices (if any).
  2. In NiagaraAX Workbench palette side bar, open the rdbSqlServer palette and copy and paste the RdbmsNetwork component under the Drivers node in the nav tree, as shown in Figure 5-6.
Figure 5-6 Adding the Rdbms Network driver
  1. In NiagaraAX Workbench nav bar, double-click on the RdbmsNetwork node.
    The Device Manager view displays.
  2. In the Device Manager view, click the New button at the bottom of the view.
    The New dialog box displays.
Figure 5-7 Adding the Sql Server device
  1. In the New dialog box, from the Type to Add drop-down list, choose Sql Server Database. and click the Ok button.
    The New Sql Database Import dialog box displays.
  2. In the New Sql dialog box, edit the following properties and click the Ok button when complete.
    • Name
      Type in a name to identify the database in NiagaraAX.
    • Type
      Make sure that the correct database type is selected in this field.
    • Enabled
      Select true.
    The SqlServerDatabase appears in the Device Manager view and in the Workbench nav tree.
Figure 5-8 SqlServerDatabase in the nav tree
  1. In the NiagaraAX Workbench nav tree, under the RdbmsNetwork node, double-click on the SqlServerDatabase device node.
    The SqlServerDatabase property sheet view displays, as shown in Figure 5-9.
Figure 5-9 SqlServerDatabase property sheet view
  1. In the SqlServerDatabase property sheet view, set all the fields according to the host server and database that you are targeting and click the Save button.
  2. In the nav tree, right-click on the Sql Server History Device Ext and select Views > Rdbms History Import Manager from the popup menu.
    The Rdbms History Import Manager displays.
  3. In the Rdbms History Import Manager view, click the Discover button.
    A discovery job runs and displays discovered database points in the top half of the view, as shown in Figure 5-10.
Figure 5-10 Discovered points
  1. In the Rdbms History Import Manager view, select the desired database table to import and click the Add button at the bottom of the view.

    Note: You can add multiple tables by selecting more than one entry in the Discovered (top) pane and then clicking the Add button.

    The Add dialog box displays, as shown in Figure 5-11, with fields of data that need to be reviewed and edited as necessary. The following fields are of particular importance:
    • Name

      The text in this field displays as the name of the import descriptor in the nav tree as well as in the descriptor’s property sheet.

    • History ID

      The text in this field defines the name and location of the history file that you create when importing the file.

    • Execution Time

      This field allows you to specify when imports are performed.

    • Value Facets

      Use this field to set the value facets (units) before importing the data. This defines the units that shortBrandName will use to analyze the data.

    • Time Zone

      Set this field to the appropriate time zone for the data.

    • Timestamp Column, Value Column, and Index Column

      IMPORTANT! These columns allow you to map the database tables columns to the corresponding history columns. These drop-down lists are automatically populated if you use the Discover process to create the import descriptor.

Figure 5-11 Rdbms Add dialog box
  1. In the Rdbms Add dialog box, click the Ok button.
    The Rdbms History Import Manager view displays with the new Table Import descriptor listed in the database pane. Also, the descriptor displays in the nav tree view under the SqlServerDatabase > Histories node.
  2. In the Rdbms File Import Manager view database pane, right-click the new descriptor and select Execute from the popup menu to complete the import.

    Note: An imported history with the exact same name can be appended to a real time log in Niagara.


shortBrandName
PREVNEXT