FactoryTalk View SE Data logging in MS-SQL

Published on May18, 2025 | Category: sql
Share this article:

Microsoft SQL Server (MS-SQL) is database management system. It can be installed on Windows and Linux operating systems and can be accessed through a variety of client tools and programming interfaces. MS-SQL used to store and retrieve data from a database. In industrial PLC and SCADA application we used MS-SQL for storing data of our process like alarm, event, history, tag value, process variable etc. MS-SQL provides data integration, data analysis, data reporting, security, scalability, and high availability, making it suitable for critical applications and process. You can also connect your MS-SQL data base with other software. MS-SQL supports a wide range of programming languages, including SQL, T-SQL, .NET, C#, and Visual Basic.MS SQL is available in Express, Standard, Enterprise, and Developer editions. We use express editions in this article link for download is given below of this article. for more information about factorytalk view datalogging visit link

Factorytalk View SE ODBC database storage

ODBC is Open Database Connectivity, it is used for accessing and write data in different type of DBMS like MySQL, Oracle, and Microsoft SQL Server etc. It was developed by Microsoft to provide a common way for Windows-based applications to access data from a variety of database management systems. With the help of ODBC we can execute functions like connecting to a database, executing SQL statements, fetching results, and managing transactions. ODBC is widely used in the industry two version available 64 bit and 32 bit.

img/Data logging in MSSQL/Factorytalk View SE ODBC database storage.webp

Create Database In MS-SQL Server For FactoryTalk View For Data logging

before proceed download and install MS-SQL Server Express edition. It is a free edition of SQL Server, ideal for development and production for desktop, web, and small server applications. if you have any difficulty for installation write a comment below. After installation of MS-SQL Server Express edition follow these steps for creating a database

img/Data logging in MSSQL/create database in mssql server for FactoryTalk View for Datalogging.webp

How To Connect SQL Server In Factorytalk View For Datalogging

open your FactoryTalk view studio and then In FactoryTalk View Studio, in the Explorer window, open the Data Log folder. Right-click the Data Log Models icon, and then select New. now datalog model editor will open your screen we already discuss file set storage format in this article we discuss only sql and ODBC server connectivity with FactoryTalk view studio.for Connecting SQL server to FactoryTalk View Application Data logging select storage format as ODBC data source.

img/Data logging in MSSQL/How To Connect SQL server in FactoryTalk View for Datalogging.webp

Factorytalk View ODBC Tables Name

when you select storage format as ODBC data source you see three tables name Tag table, string table and float table. The ODBC format stores data in up to three tables:

The ODBC tables are created with the default names TagTable, FloatTable, and StringTable. In the Data Log Models editor, you can change these names before creating the tables, or you can specify the names of different tables but i recommend use name as it is.

img/Data logging in MSSQL/factorytalk view ODBC tables name.webp

How To Log Data To ODBC Data Sources In Factorytalk View Se

You can store logged data in an existing ODBC data source, or you can create a new ODBC data source. for creating a new ODBC data source follow these steps

  • Creating a new ODBC data source FactoryTalk view se To create a new ODBC data source, click the browse (...) button next to the ODBC Data Source text box.
  • img/Data logging in MSSQL/how to Log data to ODBC data sources in factorytalk view se.webp

  • Select the System Data Source tab. Use an existing DSN or select New to create a new one. For a new DSN(Data Source Name)
  • img/Data logging in MSSQL/Select the System Data Source tab.webp

  • Select System Data Source. And click next
  • img/Data logging in MSSQL/Select System Data Source.webp

  • select sql server and click next. And next pop window click finish
  • img/Data logging in MSSQL/select sql server and click next.webp

  • Enter a Name and Description of your DSN. Select Server (always select server where you create a database). sometimes server not listed so enter manually. And Click Next
  • img/Data logging in MSSQL/Enter a Name and Description of your DSN.webp

  • select authentication mode of your DSN. you can choose windows authentication or sql server authentication. Use same credentials as your database server. after click next
  • img/Data logging in MSSQL/select autohantication mode of your DSN.webp

  • select database which we created beginning of article.(plcblogdatalog). If you not select database than by default it logged data in maser database. Click next and then finish.
  • img/Data logging in MSSQL/select database.webp

  • after finising above step test your data source if successfully connected than move to following step otherwise write a comment or send a mail so i can help you.
  • img/Data logging in MSSQL/test The DSN configured.webp

  • after successfully test The DSN configured should now be set as the ODBC Data Source select your dsn and click ok.
  • img/Data logging in MSSQL/ODBC Data Source select your dsn.webp

  • press create table button for creating table in your database. When commend completed a message will pop up "ODBC table were successfully created".
  • img/Data logging in MSSQL/press create table button for creating table.webp

    ODBC backup path for datalog in FactoryTalk view studio

    you can set backup path for your ODBC data source. Select enable ODBC backup path than set absolute or relative path. backup files prevents to loss of any type of data if database server is not reachable or not accessible so the backup file take a backup if required you can restore these data by using backup file.

    img/Data logging in MSSQL/ODBC backup path for datalog in factorytalk view studio.webp

    Purge Old Records From The Database In Factorytalk View Studio Datalog

    in file management tab help to delete old records from the database using standard relational database tools or SQL queries. You can also set up FactoryTalk View to delete records in the ODBC database after a specified time. select time when you want to delete old record in file management tab.

    img/Data logging in MSSQL/purge old records from the database in factorytalk view studio datalog.webp

    Specify When To Store Data In Factorytalk View Studio Datalog

    use log trigger tab to define when data logged into database. you can store data periodically, when specific value occur or on demand. in periodic trigger data store in data base at specific time interval. in on change value store at specific value. On demand data store when particular even come.

    img/Data logging in MSSQL/Specify when to store data in factorytalk view studio datalog.webp

    How To add tag in ODBC Data source| FactoryTalk Data Log Model

    Use Tag in Modal Tab to Add Tag in Datalog Model. The Tags In Model Tab To Specify Which Tags Will Be Scanned For Data. A Data Log Model Can Contain Up To 10,000 Tags. Browse Tag And Add To Datalog Model. All Type Of Tag You Can Use For Data Logging.

    img/data log model/how to select data for data logging in factorytalk data log model.webp

    Save ODBC Data Source Factorytalk Data Log Model

    after all setting in data log model press ok and set the component name of datalog model. this component you can use for event, manually or automatic data logging etc.

    img/data log model/set component name of of data log model.webp

    Start Data Logging In FactoryTalk Datalog Model

    to start data logging in factory talkview datalog model you can use command line DataLogOn than data model name as DataLogOn 'plcblog' or right click on datalog model component and click to start.

    img/Data logging in MSSQL/Start Data Logging In Factorytalk Datalog Model.webp

    Stop Data Logging In FactoryTalk Datalog Model

    to stop data logging in factory talkview datalog model you can use command line DataLogOFF than data model name as DataLogOFF 'plcblog' or right click on datalog model component and click to STOP.

    img/Data logging in MSSQL/Stop Data Logging In Factorytalk Datalog Model.webp

    check your datalogging in ms-sql server

    img/Data logging in MSSQL/check your datalogging in ms-sql server.webp

    open miscrosoft sql server management studio and select your database and open your table you see your all three table are created Format for ODBC tag table. Open Float table and following is format of ODBC float and string tables