Sie sind auf Seite 1von 17

FactoryTalk View SE

ODBC Data Logging

Name – Jerry O’Sullivan


Title – Senior Systems Engineer
Date – 13 DEC 2018

PUBLIC

Copyright © 2018 Rockwell Automation, Inc. All Rights Reserved. 1


Introduction
Hello! Welcome to ODBC Data Logging with FactoryTalk View SE.
My name is Jerry O’Sullivan. I am a Senior Systems Engineer at
Rockwell Automation.
I’ve been with Rockwell since November, 1999. In that time I have
worked in the Systems Support, Information software, and HMI
software groups. I am currently with the Application Support group.

PUBLIC Copyright © 2018 Rockwell Automation, Inc. All Rights Reserved. 2


Agenda

Overview of FactoryTalk View SE Data Logging

Installing an Instance of SQL Server Express 2014

Creating a Database in SQL Management Studio

Configuring Datalogging, Creating an ODBC Datasource, Creating Tables.

Questions

PUBLIC Copyright © 2018 Rockwell Automation, Inc. All Rights Reserved. 3


Objectives
In this session, you will learn how to:
 Install an instance of SLQ Server Express 2014
 Create a SQL Database and ODBC Data Source for use with
FactoryTalk View SE Data logging.
 Create a FactoryTalk View SE Datalog model and configure it to
log to an ODBC database.
 Manage logged data.

PUBLIC Copyright © 2018 Rockwell Automation, Inc. All Rights Reserved. 4


Environment

 FactoryTalk View SE version 10.00.00


 Windows 10 Enterprise (64-bit)
 Microsoft SQL Server Express 2014 (64-Bit)
 SQLSRV32.DLL version 10.00.17134.01

PUBLIC Copyright © 2018 Rockwell Automation, Inc. All Rights Reserved. 5


About Data Logging
Data log is a FactoryTalk View component that collects and stores tag
values. Logged data can be stored in an internal file set, or an ODBC-
compliant database, and can be:

 Shown in trends. To show historical data in a trend, assign a tag from


a data log model to a pen.
 Archived for future use.
 Analyzed using any ODBC-compatible reporting software

PUBLIC Copyright © 2018 Rockwell Automation, Inc. All Rights Reserved. 6


Gathering Tag Data in Data Log Models
A data log model defines which tags to log data for, when to log the data,
and where to log the data.
In the Data Log Models editor, you also specify the format of the log files
(file set, or ODBC), and when to create and delete the files (also called
records).
A single data log model can log data for up to 10,000 tags.

PUBLIC Copyright © 2018 Rockwell Automation, Inc. All Rights Reserved. 7


Gathering Tag Data in Data Log Models
Using multiple data log models

At run time, up to 20 data log models can run simultaneously on each


FactoryTalk View SE Server.

Use multiple data log models to:


 Store related information in separate file sets.
 Log groups of tags at different rates.
 Log groups of tags based on events.

PUBLIC Copyright © 2018 Rockwell Automation, Inc. All Rights Reserved. 8


Data Log Storage Formats
Logged data is stored either in an internal file set or in
an ODBC-compliant database. Each data log file set
includes files for storing numeric values (either integers
or floating point values), text, and tag names.

PUBLIC Copyright © 2018 Rockwell Automation, Inc. All Rights Reserved. 9


Data Log Storage Formats
Internal File Set

Internal file sets store tag values in proprietary-format


(.dat) files. The data can be displayed in trends. The
files can be viewed, converted, and saved with the
FactoryTalk File Viewer utility.

See Answer ID 823751 - FactoryTalk View Studio: File


Viewer Utility for more detailed information.

PUBLIC Copyright © 2018 Rockwell Automation, Inc. All Rights Reserved. 10


Data Log Storage Formats
ODBC

If you log tag values to an ODBC database, you can


view the data in trends, or use third-party, ODBC-
compliant tools to analyze and create reports from the
data.
If the ODBC database becomes unavailable,
FactoryTalk View logs the data to backup files in
proprietary format (.obf). These files can also be
viewed, converted, and saved using the FactoryTalk
File Viewer utility.

PUBLIC Copyright © 2018 Rockwell Automation, Inc. All Rights Reserved. 11


ODBC Database Storage Format and
Schemas
Use the ODBC database format to store data using an ODBC data source
such as Oracle, Microsoft SQL Server, or Microsoft Access.
The ODBC format stores data in up to three tables:
 Float table stores analog and digital tag values.
 String table (optional) stores string tag values.
 Tag table (optional) stores tag names in an index so that they can be
referenced using a 2- or 4-byte numeric field (rather than a 40-byte
character field) in the float and string tables.

PUBLIC Copyright © 2018 Rockwell Automation, Inc. All Rights Reserved. 12


Creating Data Log Models
In the Data Log Models editor, you can create data log
models that specify:
 Which log file format to use.
 Where to store data log file sets (primary or
secondary paths).
 When to create and delete log files.
 Which actions will trigger logging.
 Which tag values will be logged.

PUBLIC Copyright © 2018 Rockwell Automation, Inc. All Rights Reserved. 13


Installing an Instance of SQL Server

PUBLIC Copyright © 2018 Rockwell Automation, Inc. All Rights Reserved. 14


Appendix A – Format for ODBC Tables
Format for ODBC float and string tables
This Column Contains SQL data Length
type
DateAndTime The date and time the tag values were logged. SQL_DATETIME Driver dependent
Millitm The millisecond time the tag values were logged. SQL_SMALLINT, or 4
SQL_INTEGER
TagIndex, or The index number for the tag. The tag name that corresponds to SQL_SMALLINT, or 2 or
this number is listed in the tag name table. SQL_INTEGER 4

TagName If the tag name table is not used, the tag name appears in this SQL_VARCHAR, or 255
column SQL_CHAR
Val The analog or digital value of the tag. SQL_DOUBLE, or 8, or
SQL_INTEGER, or 4, or
SQL_SMALLINT 2
The string value of the tag. SQL_VARCHAR, or 82
SQL_CHAR
Status Blank if communications are working properly. E if a communication SQL_VARCHAR, or 1
error occurred while FactoryTalk View was trying to acquire the tag SQL_CHAR
value. S if the tag value is stale; that is, if the value has been
acquired before, but has not been updated. U if the tag is
uninitialized.
Marker Internal tag marker. SQL_VARCHAR, or
SQL_CHAR

PUBLIC Copyright © 2018 Rockwell Automation, Inc. All Rights Reserved. 15


Appendix A – Format for ODBC Tables
Format for ODBC tag table

This Contains SQL data Length


Column type
TagName The tag name. SQL_VARCHAR, 255
or SQL_CHAR
TagIndex The index number assigned to the tag name. SQL_SMALLINT, or 2 or
SQL_INTEGER 4
TagType The tag type: SQL_SMALLINT 1
2 for Analog tag
3 for Digital tag
4 for String tag

TagDataType The tag data type: SQL_SMALLINT 2


-1 for Integer
0 for Long
1 for Float
2 for String

PUBLIC Copyright © 2018 Rockwell Automation, Inc. All Rights Reserved. 16


Questions?

PUBLIC

www.rockwellautomation.com

Copyright © 2018 Rockwell Automation, Inc. All Rights Reserved. 17

Das könnte Ihnen auch gefallen