📖HomeBack ClearSCADA 2010 R1 provides new functionality that allows a link to be established to an external database. Once that link is established, ClearSCADA can query the remote database table for information or update the data in the remote table. Once setup, the table appears to users like any other table and can be used through the standard query mechanisms ClearSCADA provides e.g. lists, embedded lists on mimics, client side script, logic etc.
Configure the DSN
To communicate with MySQL, ClearSCADA requires a DSN to be configured. From the Control Panel, select Administrative Tools and then Data Sources (ODBC).
On the System DSN tab, select Add.
Choose the MySQL Driver (note that the name may vary depending on which MySQL version you have installed).
Fill in the details of the connection to match your MySQL server.
You can test the link is configured correctly by pressing Test. Once all is working OK, press OK to close the dialog, and then close the ODBC Administrator.
Configuring the Link in ClearSCADA
The Linked ODBC table connection is configured in the server config dialog in the section SQL Query Configuration -> Linked ODBC Tables.
Server Config Linked Tables.png
Right click on the white space in the right hand side of the screen and select the option "Add Linked ODBC Table". Fill out the form with details to match your MySQL Server.
Add Linked ODBC Table.png
Table Name - this is the name you will use within ClearSCADA. This can be any name of your choice.
Connection String - this references the DSN you created to communicate with MySQL. It should always be of the form DSN=dsn_name where dsn_name is the name of the DSN you configured.
User Name - the username of a valid user in MySQL who has access to the appropriate database.
Password - the password to match the User Name configured.
Source Catalog - the name of the database in MySQL (referred to in MySQL as the Schema).
Source Schema - leave blank.
Source Table - the name of the table in the database you wish to.
Click OK to close the dialog and then apply the changes by right clicking on the system name in the tree on the left hand side and select Apply Changes.
Testing the Link
SELECT * FROM TableName
where TableName is the name you assigned to the table in the Table Name field above.