When you are working on a SCADA platform, you are mostly required to log data in a database for control and monitoring purposes. Without database linking, there is no point in buying such expensive SCADA systems. In today’s times, if you have data of the whole plant every minute, then you will be able to adaptly control your factory operation swiftly. One such SCADA system used widely is FactoryTalk View Studio of Rockwell Automation. In this post, we will see how to link FactoryTalk View Studio Site Edition with the SQL server for data logging.
FactoryTalk Studio and SQL Server for Data Logging
You will require the below software to do this step:
- FactoryTalk View Studio Site Edition (any latest version or usually more than 12.0 as preferred)
- Microsoft SQL Server
- ODBC Data Sources
Now, let us start this linking process seeing everything step by step:
- The very first step is to install an SQL server and keep it ready with an instance. For security purposes, use SQL server authentication, which requires entering a username and password. We will use this authentication only for further activities. Remember to save the credentials in the SQL server, once it has been entered.
- In SQL Server, create a database named REPORT. In that database, create three tables – FloatTable, StringTable, and TagTable. This step ensures that your SQL server configuration is complete. Refer to the below image for creating columns inside each of these tables:



- Next, we will configure the SCADA program. In the FTV Studio SE, in the data log model, create a model named REPORT. In this data model, there are five tabs – setup, paths, file management, log triggers, and tags in the model. Refer to the below image for more details.

- Let us see the first tab – setup. This tab is used to connect to an ODBC data source and provide SQL authentication credentials. Refer to the below image. Here, you need to first define an ODBC data source. The steps are –
A] After clicking the box near the ODBC data source, go to the system data source.
B] Click new.
C] Click system data source and hit next.
D] Click SQL server and hit finish.
E] Write the name as REPORT, assign the server path of your PC, and hit next.
F] Click with SQL server authentication and enter your SQL server credentials.
G] Click change the default database to REPORT (the one you created in SQL earlier) and hit next.
H] Click Finish.
I] Once done, your ODBC data source has been created. You can test the source after clicking finish by clicking the test data source button. Now, assign this source in the field of ODBC data source in the image shown. Assign a tag table, float table, and string table, which will show when you click their corresponding boxes (will be created once your ODBC has been linked).
J] Tick login required and enter your user ID and password.
H] Click the Ok button.

- Now, in the second and third tab of paths and file management, it is not required to configure, as it is by default.
- In the fourth tab of log triggers, there are three options – periodic (which logs in fixed intervals you set), on change (which logs when a tag value changes), and on-demand (which logs based on a logic written in SCADA event). Select your desired style.
- In the fifth tab of tags in the model, configure the tags you need to log in SQL server.
- With this step, your datalog model configuration has been done.
- Now, you will have to call or start the service of this datalog model when the backup runs. So, create a macro named startup and write the following syntax – DATALOGON REPORT. This will start your datalog model named report that you created earlier. Once started, it will remain on.

- Once done, your SCADA backup too has been configured. So, everything has been configured properly, you can now run the backup and see that data logs in the SQL server in the following way shown below:


So, as long as SCADA is running, data will be logged in SQL server. In this way, we saw how to link FactoryTalk Studio and SQL server for data logging.
Read Next:
- PID in Studio 5000 Function Blocks
- Door Lock with Delay PLC Exercise Problem
- PLC Program for Daily Alarm using Real-Time Clock
- Produced Tags and Consumed Tags in Studio 5000
- PLC Emergency Stop Example Programming Tutorial