Connect to a Wonderware Historian database

Configure a connection to a Wonderware Historian database in order to save historical data.

Before you begin this task, you should have the address or host name of the Wonderware Historian database server, as well as appropriate credentials (i.e., user name and password) to access that database. You must also have a task worksheet (e.g., a Trend worksheet) open for editing.

To configure the connection to a Wonderware Historian database:

  1. In the header of the task worksheet, make sure Wonderware Historian is selected as the history format, and then click Historian Configuration. The Wonderware Historian dialog box is displayed.
    Figure 1. Wonderware Historian dialog box
    Web Studio Help databases configuration wonderwarehistorian Connect to a Wonderware Historian database

  2. In the Server box, type the host name or IP address and port number of the Historian database server. For example, HistorianDBServer:123. The port number is optional. If you did not change the port number in the Historian database settings, you can omit it here and the default (port 32568) will be used. Otherwise, the port number must match the one that is specified in the Historian database settings.

    Also, you can configure a tag name in curly brackets (e.g., {MyServer}) in order to change this setting during run time. See “Reload” below.

  3. In the User and Password boxes, type your credentials to access the Historian database. You can configure a tag name in curly brackets for User (e.g., {MyUser}) in order to change this setting during run time. See “Reload” below.
  4. In the Prefix box, type a prefix that will be added to the tags saved in the Historian database in order to keep them grouped together. For example, if you are configuring the connection for Trend worksheet TREND001, you could make that the prefix as well. This setting is optional, but if you do not specify a prefix, the tags will be not be grouped together in the database and therefore might be difficult to find. Also, you can configure a tag name in curly brackets (e.g., {MyPrefix}) in order to change this setting during run time. See “Reload” below.
  5. Select the Enable store and forward check box if you want to store historical data when the connection is unavailable and then forward the stored data when the connection is restored. The historical data are saved in your project folder (on the project runtime server). Please note that this can consume a large amount of drive space if the connection is unavailable for a long time.
  6. In the Run-time group, in the Status box, type the name of a project tag (Integer type) that will receive codes describing the status of the connection during run time. This setting is optional.
  7. In the Run-time group, in the Reload box, type the name of a project tag that will trigger reloads of the connection settings. When the value of this tag changes, the connection settings above will be reloaded. For those settings, you can configure tag names in curly brackets (e.g., {MyServer}) in order to change the settings during run time. The connection to the Historian database is updated only when the settings are reloaded, and the settings are reloaded only when the value of the specified tag changes. This is to make sure that all of the settings are changed together rather than one at a time.
  8. In the Gateway group, in the Host and Port boxes, type the host name or IP address and port number of the ADO.NET database gateway (StADOSvr). The default value for Host is 127.0.0.1 (a.k.a. localhost), because the project runtime server and the database gateway are typically hosted on the same computer.
  9. Click OK to save the settings and close the dialog box.
As mentioned above, the ADO.NET database gateway is typically hosted on the same computer that hosts the IWS project runtime server and does not require additional configuration. However, there are some things to consider when you develop your IWS project to connect to a Wonderware Historian database. The Historian database interface requires Microsoft .NET Framework 4, which is not included in older versions of Microsoft Windows. Therefore, when you run your project, it might not be able to connect to the Historian database. If that happens, check whether the framework is installed and turned on (Control Panel > Programs > Programs and Features > Turn Windows features on or off), and if it is not, do one of the following:
  • Download and install the framework (www.microsoft.com/download/details.aspx?id=17718); or
  • Install and run the database gateway on another computer — perhaps the computer that hosts the Historian database server itself — and then change the Gateway settings above to specify that computer.

The first option might not be feasible if the computer is a Windows Embedded device; depending on how the device is configured and what version of Windows Embedded it runs, it might not be possible to install the framework separately. In many cases, the device’s OS image must be configured to include the framework, and that is typically done by the manufacturer of the device. Please consult the manufacturer’s documentation.

If you choose the second option, you must include the Historian client library (aahClientManaged.dll) in the same folder with the other database gateway files. For more information about how to install and run the database gateway on another computer, see Studio Database Gateway.

Connect to a Wonderware Historian database