How to Establish an SQL Connection to an SQL Database

 

Establishing an SQL Connection Between a Controller and a Database

Overview

To establish a connection between a controller and an SQL database, you have to execute the steps described in this chapter. Steps that are specific to the different SQL database types are described in detail in the following chapters.

Establishing an SQL Connection

Step

Action

Remark

1

Set up the PC on which you intend to install the SQL Gateway.

Configure the firewall in order to allow SQL data traffic on the TCP/IP port (by default, 3457).

2

Set up your SQL database.

Make sure that your database is created with an SQL client supported by the SQL Gateway. For more information, see the list of compatible SQL clients in the chapters How to Configure a Connection to a <name> Database.

3

Install the SQL Gateway by double-clicking the Setup.exe file from the SQL Gateway installation and following the instructions on screen.

4

Configure the SQL connection to the SQL database in the SQL Gateway Console.

Refer to the detailed description of this step for the different SQL database types in the chapters How to Configure a Connection to a <name> Database.

5

In EcoStruxure Machine Expert, create an application for SQL data transfer using the SqlRemoteAccess library.

Refer to the programming examples in the chapter How to Transfer Data Via SQL Gateway Between SoMachine and Any Database of the SqlRemoteAccess Library Guide.

6

Download the EcoStruxure Machine Expert application for SQL data transfer to the controller.

Refer to the Downloading an Application chapter of the EcoStruxure Machine Expert Programming Guide.

7

Start the EcoStruxure Machine Expert application for SQL data transfer in the controller.

Result: The SQL connection between the controller and the SQL database is established via the SQL Gateway if the individual components have been configured correctly. If the connection is not established, verify the configuration and refer to the chapter Troubleshooting.

Refer to the Running Applications chapter of the EcoStruxure Machine Expert Programming Guide.