Академический Документы
Профессиональный Документы
Культура Документы
Lab 1
Time-Series Data Collection and Reporting
Presenter: Todd Smith
RSBizWare Historian Product Manager
Time-Series Data
Contents
Before you begin .......................................................................................................................5
Tools & prerequisites................................................................................................................... 5
In this lab ...................................................................................................................................6
Overview....................................................................................................................................7
What is time-series data? ............................................................................................................ 7
How is time-series data stored?................................................................................................... 8
How can time-series data be included in reports? ........................................................................ 8
Collecting and Storing Time-Series Data ...............................................................................10
Create a database to store time-series data............................................................................... 10
Enhance the BizBikes RSSql configuration to log to the external data source ...................19
Create a connector for the RSSql configuration that connects to the external data store ............ 19
Register the ODBC enterprise connector for use in Historian data collection.............................. 20
Create a narrow time-series database table and configure data collection .........................22
Create a narrow time-series database table............................................................................... 22
Create a narrow time-series report data source ......................................................................... 23
Use the Historian Time-Series Data Collection wizard to configure data collection ..................... 28
Create a wide time-series database table and configure data collection .............................37
Create a wide time-series database table .................................................................................. 37
Create a wide time-series report data source............................................................................. 39
Use RSSql to configure the collection of data ............................................................................ 46
3 of 64
4 of 64
5 of 64
In this lab
In this lab, you learn how to:
Create data storage tables for wide and narrow time-series data
Configure an external data source that allows Historian to view the data from outside of the
Production Servers database
Create time-series report data sources
Use Historian to configure the collection of narrow time-series data
Use RSSql to configure the collection of wide time-series data
Create a time-series report that combines data from the different data sources on a single
chart object
Compare the advantages of narrow versus wide time-series data storage
6 of 64
Overview
In this example, Flow Rate, Pressure, and Temperature values are plotted over time. The
temperature values collected with bad quality are indicated by backwards slash \ marks. The
temperature values collected with uncertain quality are indicated by horizontal slash | marks.
Only data identified as time-series can be displayed on a Historian time-series data object. This
data object has these unique capabilities:
You can include different reporting tags on the same chart
Each reporting tag can be scaled to its own relative Y axis
A relative X axis can be configured to compare reporting tag values collected during different
time windows
You can annotate the chart with user comments
You can display data collected with RSSqls data-compression enterprise connector
It takes advantage of the Production Servers ability to display sampled data when the result
sets contain very large numbers of data records
7 of 64
Historian uses a default narrow format table called RSDataPointSample for storing time-series
data. However, as you will see in this lab, it can log data to other narrow format tables that you
create.
Wide formatWith wide time-series data, every record contains a timestamp and columns for
different reporting tag values collected at the same time.
Historian does not use any wide format tables for data collection by default, nor does it have the
capability to configure data collection to such a table. However, you can create a wide table and
use RSSql to log data to it (this requires a separate RSSql license). Once the data is in the table,
Historian can recognize it as time-series data. This technique can also be used to have Historian
interpret foreign tables as time-series data.
Compressed formatCompressed time-series data is similar to the narrow format in that each
record contains data for a single data point. However, unlike narrow format records, a
compressed record contains binary arrays that hold blocks of data values and their corresponding
timestamps and collection quality values. Each record also contains the start and end times that
the data values span as well as the min and max data values stored in the array.
8 of 64
The name of the table that stores the text descriptions of the data points and the engineering
units in which the values are measured.
The time-series report object is a Historian ActiveX control that can be inserted into HTML
documents, HMI projects, and so on to display the values of one or more reporting tags. As you
will see in the lab, Historian is capable of reporting on time-series data from different tables on the
same chart.
9 of 64
2. Right-click the Databases folder and select New Database from the shortcut menu.
10 of 64
3. Enter Time-Series Data for the database name and click OK.
.
4. Expand the Security folder and then right-click the Logins item and select New Login from
the shortcut menu.
11 of 64
5. On the New Login dialog box, enter ExternalData for the Name. Click the SQL Server
Authentication option. Specify ExternalData as the SQL Server Authentication Password.
Select the Time-Series Data database from the Database list.
12 of 64
6. Click the Database Access tab. Select the Time-Series Data database as the database to
be accessed by this login. Then check the db_owner check box in the list of Database roles.
13 of 64
14 of 64
3. Specify ExternalData in the Name box, RSBizWare External Data Storage in the
Description box, and (local) in the Server list. Click Next.
4. Select With SQL Server authentication and enter ExternalData for the Login ID and
Password. (This is the SQL Server login account / and password configured earlier.) Click
Next.
15 of 64
5. Click Next on the next dialog box and Finish on the dialog box after that.
6. On the last dialog box, click the Test Data Source button. You should see the following
TEST COMPLETED SUCCESSFULLY! message:
7. Click OK and then click OK on the ODBC Data Source Administrator dialog box.
16 of 64
User: admin
Password admin2
Server localhost (a keyword for the current machine); you could also use the IP address
or name of the computer.
Click Login.
3. Expand the Servers item and then expand the Production Server item. Click the External
Data Sources item under the Production Server item.
17 of 64
4. Click Add on the bottom left hand side. Then type the following property values for the
external data source:
User: ExternalData
Password: ExternalData
5. Click the Test Connection button. You should get a Connection Succeeded message. Click
OK for that message and then click OK on the Data Source Properties dialog box. You
should now see the following entry in the list of external data sources:
18 of 64
19 of 64
2. On the Add RSSql Connector dialog box, select ODBC from the Connector Type list if it is not
already selected. Enter the name of your computer as the Connector Host and a user name
and password with Administrator privileges. Then click Done.
2. Click Next on the first dialog box of the RSSql to RSBizWare Registration Wizard.
20 of 64
3. On the Enterprise Connection Database Settings dialog box, select the ODBC connector and
click Configure.
4. On the Enterprise Connection Settings dialog box, select ExternalData from the ODBC DSN
list and enter ExternalData for the User Name and Password. Click OK.
5. Click Next to advance to the last dialog box of the RSSql to RSBizWare Registration Wizard.
Click Finish to complete the wizard.
21 of 64
2. Select File > Open and browse to the IN02 > Lab 1> Scripts folder on the RSTechEd CD
(this file may be located on the desktop and/or the directory structure may not be the same as
listed here, but you should be able to find it.) Open the NarrowTimeSeries.sql file. The
following should appear in your Query Analyzer query window:
3. Execute this query by selecting Query > Execute from the menu. You will get a message
saying that the command completed successfully. Exit the Query Analyzer application.
22 of 64
23 of 64
4. On the Choose a Database Table or View dialog box, you must select a data source and then
select a table or view from within that data source. Select RSBizWare external data storage
from the list, select the Narrow_Time_Series table from the list of tables and views, and click
Next.
5. On the Column Selection dialog box, click the >> button to select all columns and click Next.
24 of 64
6. On the Time Selection toolbar dialog box, select DateAndTimeStamp from the list and click
Next.
7. On the Time-series Format dialog box, select the Narrow Format option and click Next.
25 of 64
8. On the Match Time-series Columns dialog box, you must identify the functions of each of the
columns in your data table. When you click the <None> value in the Time-series use
column, a list will appear. Assign the following uses to the Fields:
DateAndTimeStamp: Timestamp
Milliseconds: Milliseconds
Value: Value
Quality: Quality
Click Next.
26 of 64
9. On the Data Point Configuration Table dialog box, you are asked to select a database table
to act as the configuration table. The configuration table maps the numeric Data Point Id
values with the text data point description and engineering units columns. You did not create
a configuration table before because the wizard can be used to do this automatically.
Click Create Configuration Table to create this table. Then click Next.
10. On the last dialog box, click Finish to exit from the wizard. Then click Close to exit from the
Configure Report Data Sources, Report Objects, and Filters dialog box.
27 of 64
Launch the RSView32 application. From the Windows Start menu select Programs >
Rockwell Software > RSView32 > RSView32 Works.
Select File > Open from the menu and browse to and open the
C:\BizBikes\RSView32\BizBikes.rsv file.
Click the Run Mode tab and then click Run Project.
28 of 64
3. From the Production Client menu, select Configure > Historian > Time-Series Data
Collection. The Time-Series Data Collection Wizard will appear. Click Next.
29 of 64
4. Identify the report data source, the RSSql configuration to be used for collecting data, and the
enterprise connector to be used by that configuration.
The Historian Data Point Default and Historian Data Point Compressed options are used
when configuring data collection of data for the default normal time-series and default
compressed time-series data sources. Since you will be using the data source you
created earlier, select the Advanced option and select External Narrow Time-Series
from the Advanced list.
Since only one RSSql configuration has been registered with the Production Server for
use in collecting Historian data, the BizBikesOnline configuration will be pre-selected in
the RSSql Configuration list and cannot be changed.
Since the ODBC enterprise connector was configured to access the external data store,
select it from the RSSql Enterprise Connection list.
Click Next.
30 of 64
5. On the From RSSql Data Points to Historian Reporting Tags dialog box, click Add.
6. On the Select RSSql Data Points dialog box, click Add/Edit Points.
31 of 64
7. You might see a progress bar as the tag list is generated from the FactoryTalk Directory
Server. Then, the (RSSql) FactoryTalk Data Point dialog box will appear.
Select the MixSpeed tag from the Contents of /::Paint list and click Add Selected
Tag(s).
Select TankTemp tag from the Contents of /::Paint list and click Add Selected Tag(s).
32 of 64
9. Click Apply and then click Close to exit the (RSSql) FactoryTalk Data Point dialog box.
10. On the Select RSSql Data Points dialog box, enter PAINT in the Text box then click the
Contains option.
The list of data points will be filtered to show only the ones recently added for the PAINT
workcell.
11. Select all of the data points and click Select.
33 of 64
12. On the From RSSql Data Points to Historian Reporting Tags dialog box, click Next.
13. Because all of the selected data points were scheduled, the RSSql Scheduled Transaction
dialog box will appear. Change the Scan Rate from 1 to 5 seconds and then click Next.
34 of 64
14. Accept all of the default values on the RSSql Transaction Settings dialog box and click Next.
35 of 64
15. On the Summary dialog box, click Create to create the RSSql transactions that will collect
data from these data points.
16. Click Finish on the final dialog box of the wizard. The RSSql configuration is now configured
to collect the selected data points and store them in the External Narrow Time-Series
database table.
36 of 64
2. Select File > Open from the menu and browse to the IN02 > Lab 1 > Scripts folder on the
RSTechEd CD. Open the WideTimeSeries.sql file. The following should appear in your
Query Analyzer query window:
37 of 64
3. Execute this query by selecting Query > Execute. You will get a message saying that the
command completed successfully. Exit the Query Analyzer application.
38 of 64
3. This will launch the Report Data Source Configuration wizard. Click Next.
39 of 64
4. On the Report Data Source Name dialog box, you must enter a name for your report data
source. Enter the name External Wide Time-Series and click Next.
40 of 64
5. Next you must select a data source and then select a table or view from within that data
source. Select the RSBizWare external data storage from the database list, select the
Wide_Time_Series table from the list of tables and views, and then click Next.
41 of 64
6. On the Column Selection dialog box, click the >> button to select all columns, and then click
Next.
7. On the Time Selection Toolbar dialog box, select the DateAndTimeStamp column from the
list and then click Next.
42 of 64
8. On the Time-series Format dialog box, select the Wide Format option, and then click Next.
43 of 64
9. On the Match Time-series Columns dialog box, you must identify the functions of each of the
columns in your data table. When you click the <None> value in the Time-series Use column,
a list will appear. Assign the following uses to the Fields:
DateAndTimeStamp: Timestamp
Milliseconds: Milliseconds
Quality: Quality
44 of 64
10. On the Data Point Configuration Table dialog box, you must select a database table to act as
the configuration table. The configuration table maps the data point column numbers with the
text data point description and engineering units columns. You did not create a configuration
table before because the wizard can be used to do this automatically.
Click the Create Configuration Table button to create this table, and then click Next.
11. On the last dialog box, click Finish to exit the wizard. Then click Close to exit the Configure
Report Data Sources, Report Objects, and Filters dialog box.
45 of 64
1.
Close the RSBizWare Production Client. Having both the Production Client and RSSql open
at the same time can cause display refresh problems.
2.
Launch the RSSql client application. From the Windows Start menu select Programs >
Rockwell Software > RSSql > RSSql.
3.
Expand the BizBikesOnline item and the Transaction/Control Manager item. Then, rightclick the FT item and select Define Data Points from the shortcut menu.
4.
You might see a progress bar as the tag list is generated from the FactoryTalk Directory
Server. Then, the (RSSql) FactoryTalk Data Point dialog box will appear.
46 of 64
5.
6.
Click Apply and then click Close to exit the (RSSql) FactoryTalk Data Point dialog box.
7.
On the main RSSql dialog box, expand the ODBC_Connectors item. Then, right-click the
ODBC item and select Define Data Object from the shortcut menu.
47 of 64
8.
On the Data Object Definition dialog box, give the new data object a name by entering
Wide_Data_Logger in the Name list. You also need to specify which DSN to use to connect
to the external database. Select the browse button ( ) next to the Database Connection list.
9.
Select ExternalData from the System DSN list. This will automatically fill the Connection
Name list with a value of ExternalData. Specify ExternalData for the User Name and
Password boxes. Test the database connection by clicking the Test button.
10. Click OK on the Connection Succeeded message, and then click Apply and Close.
48 of 64
11. On the ODBC Data Object Definition dialog box, the Database Connection list will be set to
12. Double-click each of the entries in the Database Columns list in order to move them to the
Data Object Columns list. Then, click Apply and Close to return to the main RSSql dialog
box.
13. Select Define > Transaction from the menu. Enter Wide_Data_Transaction in the
Transaction Name list. Select Wide_Data_Logger from the Data Object Name list.
49 of 64
14. Right-click the DateAndTimeStamp column and select Bind Expression from the shortcut
menu.
15. Click the TransTimestamp() button, and then click OK to close the Expression Editor.
Repeat the process of using the Expression Editor to configure the Milliseconds column. In
the Expression Editor, click the MTransTimestamp() button for the Milliseconds column.
50 of 64
16. On the Transaction Definition dialog box, double-click MixSpeed in the list of Data Object
Columns. The Filter and Select Data Points (drag & drop enabled) dialog box will appear on
the right. Scroll down through the Data Point list until you see the four data points configured
for the Paint workcell. Select the FT.RSViewBizBikes.Paint_MixSpeed data point. Drag it
over to the left and drop it on the MixSpeed Data Object Column. This will bind the data
point to the data object column.
17. Repeat the drag and drop procedure to bind the TankTemp, CoolTemp, and MotionMax
data points to the corresponding Data Object Columns. Close the Filter and Select Data
Points dialog box when completed.
18. On the Transaction Definition dialog box, click the Trigger / Storage button.
51 of 64
19. On the Trigger And Storage Parameters dialog box, change the Scan Rate to 5 and select
the Seconds option. Then click OK to close the Trigger And Storage Parameters dialog
box.
20. On the Transaction Definition dialog box, click the Enabled option under Transaction Status.
The BizBikes RSSql configuration is now configured to collect the MixSpeed, TankTemp,
CoolTemp, and MotionMax data points every five seconds and store their values to the
same database record in the Wide_Time_Series table in the Time-Series Data SQL Server
database.
21. Close the RSSql client.
52 of 64
Launch the RSView32 application. From the Windows Start menu select Programs >
Rockwell Software > RSView32 > RSView32 Works.
Select File > Open from the menu and browse to and open the
C:\BizBikes\RSView32\BizBikes.rsv file.
Click the Run Mode tab and then click the Run Project button.
53 of 64
2. From the main BizBikes dialog box, click the Remote Areas button on the toolbar. Then click
the Paint button on the pop-up menu.
Close the RSSql Configurations dialog box by clicking on the Close button.
54 of 64
55 of 64
This report object shows that reporting tags from multiple, external time-series data sources
that can be included on the same chart even if those report data sources are a mixed
collection of narrow and wide time-series tables.
56 of 64
2. In the list of database tables, right-click the Narrow_Time_Series table and select the All
Tasks > Manage Indexes from the shortcut menu.
57 of 64
58 of 64
4. On the Create New Index dialog box, enter an index name like Narrow Index in the Index
name list. Check the DataPointId and DateAndTimeStamp column check boxes, and then
click OK.
Because queries of narrow time-series data are frequently based on the Data Point Id and
Timestamp values, they should be included in the tables index. Click Close on the Manage
Indexes dialog box.
5. In the list of database tables, right-click the Wide_Time_Series table and select All Tasks >
Manage Indexes from the shortcut menu.
59 of 64
60 of 64
7. On the Create New Index dialog box, enter Wide Index in the Index name box. Check the
DateAndTimeStamp column check box, and then click OK.
Because queries of wide time-series data are frequently based on the Timestamp value, it
should be included in the tables index. There is no Data Point Id used with wide time-series
data like there is with narrow time-series data.
Click Close on the Manage Indexes dialog box.
Queries on the data from these tables should run more efficiently now.
61 of 64
62 of 64
Notes
63 of 64
64 of 64