RSS Feed

How to log historical data and/or alarms/events to a database in Microsoft SQL Server

September 3, 2013 | Lubos Malek

By default, both historical data and alarms/events are logged to file-based databases. If it is required that they be stored in a relational database instead, the following steps must be taken:


1. Choose an existing instance of SQL Server on the computer/network or install a new SQL Server instance. The installation files of Microsoft SQL Server Express Edition (which is for free) are part of Reliance Add-On Pack. After installing Reliance Add-On Pack, choose the respective item from the Reliance Add-On Pack folder in the Windows Start menu.


2. Run Reliance Design and open the project.


3. In the Project Options dialog (menu Project > Options…), configure an SQL connection to connect to your SQL server. Click the Edit Connection String button to bring up the Data Link Properties dialog. If SQL Server is installed on the same computer from Reliance Add-On Pack, no changes are necessary. When done, click the Test Connection button. If the configuration is correct, the "Test connection succeeded" message is displayed.


Project Options – SQL connection

Project Options – SQL connection


Data Link Properties dialog

Data Link Properties dialog


4. In the Data Table Manager (menu Managers > Data Table Manager), change the Database type property to SQL for all data tables that should be stored in a relational database.


Data Table Manager – Database type

Data Table Manager – Database type


5. In the Project Structure Manager (menu Managers > Project Structure Manager), select the previously configured SQL connection for the respective data tables.


Project Structure Manager – data tables – SQL connection

Project Structure Manager – Data tables – SQL connection


6. In the Project Structure Manager (menu Managers > Project Structure Manager), configure the alarm/event database properties: change the Database type property to SQL and select the previously configured SQL connection.


Project Structure Manager – Alarms/Events – database type and SQL connection

Project Structure Manager – Alarms/Events – Database type and SQL connection


An example project named LogDataToSQLServer is part of the Reliance 4 installation. The project is located in the Examples\Databases folder. The Examples folder can be accessed from the Reliance 4 folder on the Windows desktop. For more information on the project, please refer to the file named ProjectInfo_ENU.txt located in the project folder.


Question iconHaven't found what you were looking for? Use this form to inform us about it.

Support
Top