Top Banner
- IN02 - RSBizWare Historian Advanced Lab Lab 1 Time-Series Data Collection and Reporting Presenter: Todd Smith RSBizWare Historian Product Manager
64

DE14_DeviceNetAndDeviceLogixForIndustrialControl.pdf

Nov 18, 2015

Download

Documents

Para verificación de redes devicenet
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
  • - IN02 -

    RSBizWare Historian Advanced Lab

    Lab 1

    Time-Series Data Collection and Reporting

    Presenter: Todd SmithRSBizWare Historian Product Manager

  • RSTechED 2005 Rockwell Software 3 of 64

    Historian Advanced Lab 1 Time-Series DataCollection and Reporting

    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

  • 4 of 64 RSTechED 2005 Rockwell Software

    Reporting on Time-Series Data...............................................................................................53

    Start the Collection of Data........................................................................................................ 53

    Create a Time-Series Report Object .......................................................................................... 55

    Enhance Report Performance ................................................................................................... 57

    Discussion: Comparing Trending Formats...........................................................................62

    Narrow Time-Series Advantages ............................................................................................... 62

    Wide Time-Series Advantages .................................................................................................. 62

    Notes........................................................................................................................................63

  • RSTechED 2005 Rockwell Software 5 of 64

    Before you begin

    Historian specializes in retrieving and reporting data for trending analysis. This time-centric datacan be stored in the Production Server database or in any accessible Microsoft SQL Server orOracle database. This lab will examine some of the tools and options available to collect andstore this kind of data.

    Tools & prerequisites

    This lab assumes the lab computer has the following software installed and properly configured:

    Microsoft Windows 2003 Server Standard Edition

    Microsoft Internet Explorer 6.0 (SP1 or higher)

    Microsoft SQL Server 2000 Standard Edition (SP3a or higher)

    RSBizWare 8.0

    FactoryTalk 2.0.10

    The BizBikes RSView32 project, RSSql configuration, and BizBikes database from theRSBizWare 8.0 CD restored according to the provided instructions

    RSView32 7.2

    Activation licenses for appropriate software. This lab requires an RSSql license in addition tothe Historian licenses.

    2 script files from the RSTechEd CD

  • 6 of 64 RSTechED 2005 Rockwell Software

    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 theProduction 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 singlechart object

    Compare the advantages of narrow versus wide time-series data storage

  • RSTechED 2005 Rockwell Software 7 of 64

    Overview

    What is time-series data?

    A time-series data record contains the value of a specific data point, the time the data value wascollected, and a means to identify where the data came from. Each record can optionally containthe RSSql quality rating of the data value.

    In this example, Flow Rate, Pressure, and Temperature values are plotted over time. Thetemperature values collected with bad quality are indicated by backwards slash \ marks. Thetemperature 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. Thisdata 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 differenttime 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 resultsets contain very large numbers of data records

  • 8 of 64 RSTechED 2005 Rockwell Software

    How is time-series data stored?

    Time-series data is stored in either a narrow, wide, or compressed format.

    Narrow formatWith narrow time-series data, every record contains at least three columns: adata value, a timestamp, and a numeric value used to look-up a text description of the data andthe engineering units in which the values are measured.

    Historian uses a default narrow format table called RSDataPointSample for storing time-seriesdata. However, as you will see in this lab, it can log data to other narrow format tables that youcreate.

    Wide formatWith wide time-series data, every record contains a timestamp and columns fordifferent 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 thecapability to configure data collection to such a table. However, you can create a wide table anduse 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 Historianinterpret foreign tables as time-series data.

    Compressed formatCompressed time-series data is similar to the narrow format in that eachrecord contains data for a single data point. However, unlike narrow format records, acompressed record contains binary arrays that hold blocks of data values and their correspondingtimestamps and collection quality values. Each record also contains the start and end times thatthe data values span as well as the min and max data values stored in the array.

    How can time-series data be included in reports?

    An RSBizWare report data source is created using the RSBizWare Production Client. The reportdata source identifies the following about the data:

    The format of the time-series data (narrow, wide, or compressed)

    The name of the table where the data is stored

  • RSTechED 2005 Rockwell Software 9 of 64

    The name of the table that stores the text descriptions of the data points and the engineeringunits in which the values are measured.

    The time-series report object is a Historian ActiveX control that can be inserted into HTMLdocuments, HMI projects, and so on to display the values of one or more reporting tags. As youwill see in the lab, Historian is capable of reporting on time-series data from different tables on thesame chart.

  • 10 of 64 RSTechED 2005 Rockwell Software

    Collecting and Storing Time-Series Data

    In this section, you will create an external database and configure RSBizWare to be able to reportfrom the data in those tables. Next you will modify the existing BizBikes RSSql configuration bygiving it a new ODBC enterprise connector to log data to the external database. Then you will gothrough the process of creating narrow and wide time-series database tables and configuring thecollection of the data to be stored in those tables.

    Create a database to store time-series data

    Creating an SQL Server database and login account

    To create an SQL Server database and login account, do the following:

    1. From the Windows Start menu select Programs > Microsoft SQL Server > EnterpriseManager. Expand the Databases folder under Microsoft SQL Servers > SQL Server Group >(local) (Windows NT) item.

    2. Right-click the Databases folder and select New Database from the shortcut menu.

  • RSTechED 2005 Rockwell Software 11 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 fromthe shortcut menu.

  • 12 of 64 RSTechED 2005 Rockwell Software

    5. On the New Login dialog box, enter ExternalData for the Name. Click the SQL ServerAuthentication option. Specify ExternalData as the SQL Server Authentication Password.Select the Time-Series Data database from the Database list.

  • RSTechED 2005 Rockwell Software 13 of 64

    6. Click the Database Access tab. Select the Time-Series Data database as the database tobe accessed by this login. Then check the db_owner check box in the list of Database roles.

    7. Click OK and confirm the password ExternalData for this login.

    8. Exit the SQL Server Enterprise Manager application.

  • 14 of 64 RSTechED 2005 Rockwell Software

    Creating an ODBC connection to SQL Server

    To create an ODBC connection to an SQL Server for the Production Server to use whenaccessing this database, do the following:

    1. From the Windows Start menu select Settings > Control Panel, select AdministrativeTools, and then select Data Sources (ODBC). Select the System DSN tab and click Add.

    2. Select SQL Server as the driver and click Finish.

  • RSTechED 2005 Rockwell Software 15 of 64

    3. Specify ExternalData in the Name box, RSBizWare External Data Storage in theDescription box, and (local) in the Server list. Click Next.

    4. Select With SQL Server authentication and enter ExternalData for the Login ID andPassword. (This is the SQL Server login account / and password configured earlier.) ClickNext.

  • 16 of 64 RSTechED 2005 Rockwell Software

    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 followingTEST COMPLETED SUCCESSFULLY! message:

    7. Click OK and then click OK on the ODBC Data Source Administrator dialog box.

  • RSTechED 2005 Rockwell Software 17 of 64

    Creating an RSBizWare external data source

    To create an RSBizWare external data source, do the following:

    1. From the Windows Start menu select Programs > Rockwell Software > RSBizWare >RSBizWare Enterprise Manager. Expand the Server Manager item.

    2. If prompted, login using the default administrator account:

    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 ExternalData Sources item under the Production Server item.

  • 18 of 64 RSTechED 2005 Rockwell Software

    4. Click Add on the bottom left hand side. Then type the following property values for theexternal data source: Server DSN: ExternalData Description: RSBizWare external data storage User: ExternalData Password: ExternalData

    5. Click the Test Connection button. You should get a Connection Succeeded message. ClickOK for that message and then click OK on the Data Source Properties dialog box. Youshould now see the following entry in the list of external data sources:

  • RSTechED 2005 Rockwell Software 19 of 64

    Enhance the BizBikes RSSql configuration to log to the externaldata source

    In this section you will create an enterprise connection for the RSSql configuration that connectsto the external data source and register the ODBC enterprise connector for use in Historian datacollection.

    Create a connector for the RSSql configuration that connects tothe external data store

    1. In the RSBizWare Enterprise Manager, Expand the RSSql Configurations item and theRSSql item. Right-click the BizBikesOnline item and select Add a Connector from theshortcut menu.

  • 20 of 64 RSTechED 2005 Rockwell Software

    2. On the Add RSSql Connector dialog box, select ODBC from the Connector Type list if it is notalready selected. Enter the name of your computer as the Connector Host and a user nameand password with Administrator privileges. Then click Done.

    Register the ODBC enterprise connector for use in Historian datacollection

    1. If the Production Server item is not already expanded, open it and expand the DataCollection folder under it. Right-click the BizBikesOnline item and select RegisterConnector from the shortcut menu.

    2. Click Next on the first dialog box of the RSSql to RSBizWare Registration Wizard.

  • RSTechED 2005 Rockwell Software 21 of 64

    3. On the Enterprise Connection Database Settings dialog box, select the ODBC connector andclick Configure.

    4. On the Enterprise Connection Settings dialog box, select ExternalData from the ODBC DSNlist 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.

  • 22 of 64 RSTechED 2005 Rockwell Software

    Create a narrow time-series database table and configure datacollection

    In this section you will create a narrow time-series database table and a narrow time-series reportdata source and use an Historian wizard to configure data collection.

    Create a narrow time-series database table

    1. Launch the Microsoft Query Analyzer from the Windows Start menu by selecting Programs> Microsoft SQL Server > Query Analyzer. Enter ExternalData for the Login name andPassword and click OK.

    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 aslisted here, but you should be able to find it.) Open the NarrowTimeSeries.sql file. Thefollowing should appear in your Query Analyzer query window:

    3. Execute this query by selecting Query > Execute from the menu. You will get a messagesaying that the command completed successfully. Exit the Query Analyzer application.

  • RSTechED 2005 Rockwell Software 23 of 64

    Create a narrow time-series report data source

    1. Launch the RSBizWare Production Client from the Windows Start menu by selectingPrograms > Rockwell Software > RSBizWare > RSBizWare Production Client.

    2. Select the Configure > Reporting > Report Data Sources, Objects, and Filters from themenu. Then click Add under the Report Data Sources area on the Configure Report DataSources, Objects, and Filters dialog box.

    This will launch the Report Data Source Configuration wizard.

    3. Click Next on the first dialog box of this wizard. On the next dialog box, you are asked toenter a name for your report data source. Enter External Narrow Time-Series and clickNext.

  • 24 of 64 RSTechED 2005 Rockwell Software

    4. On the Choose a Database Table or View dialog box, you must select a data source and thenselect a table or view from within that data source. Select RSBizWare external data storagefrom the list, select the Narrow_Time_Series table from the list of tables and views, and clickNext.

    5. On the Column Selection dialog box, click the >> button to select all columns and click Next.

  • RSTechED 2005 Rockwell Software 25 of 64

    6. On the Time Selection toolbar dialog box, select DateAndTimeStamp from the list and clickNext.

    7. On the Time-series Format dialog box, select the Narrow Format option and click Next.

  • 26 of 64 RSTechED 2005 Rockwell Software

    8. On the Match Time-series Columns dialog box, you must identify the functions of each of thecolumns in your data table. When you click the value in the Time-series usecolumn, a list will appear. Assign the following uses to the Fields: DataPointId: Data Point Ids DateAndTimeStamp: Timestamp Milliseconds: Milliseconds Value: Value Quality: QualityClick Next.

  • RSTechED 2005 Rockwell Software 27 of 64

    9. On the Data Point Configuration Table dialog box, you are asked to select a database tableto act as the configuration table. The configuration table maps the numeric Data Point Idvalues with the text data point description and engineering units columns. You did not createa 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 theConfigure Report Data Sources, Report Objects, and Filters dialog box.

  • 28 of 64 RSTechED 2005 Rockwell Software

    Use the Historian Time-Series Data Collection wizard toconfigure data collectionTo generate data for the Narrow_Time_Series table, you will run the BizBikes RSView32application, which simulates a production system.

    1. Too configure the collection of data from an RSView32 application, the application must berunning. If the BizBikes application is not already running, follow these steps to launch it:

    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 theC:\BizBikes\RSView32\BizBikes.rsv file.

    Click the Run Mode tab and then click Run Project.

    2. To configure the data collection, return to the RSBizWare Production Client.

  • RSTechED 2005 Rockwell Software 29 of 64

    3. From the Production Client menu, select Configure > Historian > Time-Series DataCollection. The Time-Series Data Collection Wizard will appear. Click Next.

  • 30 of 64 RSTechED 2005 Rockwell Software

    4. Identify the report data source, the RSSql configuration to be used for collecting data, and theenterprise connector to be used by that configuration.

    The Historian Data Point Default and Historian Data Point Compressed options are usedwhen configuring data collection of data for the default normal time-series and defaultcompressed time-series data sources. Since you will be using the data source youcreated earlier, select the Advanced option and select External Narrow Time-Seriesfrom the Advanced list.

    Since only one RSSql configuration has been registered with the Production Server foruse in collecting Historian data, the BizBikesOnline configuration will be pre-selected inthe 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.

  • RSTechED 2005 Rockwell Software 31 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.

  • 32 of 64 RSTechED 2005 Rockwell Software

    7. You might see a progress bar as the tag list is generated from the FactoryTalk DirectoryServer. Then, the (RSSql) FactoryTalk Data Point dialog box will appear.

    8. Select the data points to be collected.

    Select the Paint folder from the Folders list. 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).

  • RSTechED 2005 Rockwell Software 33 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 theContains option.

    The list of data points will be filtered to show only the ones recently added for the PAINTworkcell.

    11. Select all of the data points and click Select.

  • 34 of 64 RSTechED 2005 Rockwell Software

    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 Transactiondialog box will appear. Change the Scan Rate from 1 to 5 seconds and then click Next.

  • RSTechED 2005 Rockwell Software 35 of 64

    14. Accept all of the default values on the RSSql Transaction Settings dialog box and click Next.

  • 36 of 64 RSTechED 2005 Rockwell Software

    15. On the Summary dialog box, click Create to create the RSSql transactions that will collectdata from these data points.

    16. Click Finish on the final dialog box of the wizard. The RSSql configuration is now configuredto collect the selected data points and store them in the External Narrow Time-Seriesdatabase table.

  • RSTechED 2005 Rockwell Software 37 of 64

    Create a wide time-series database table and configure datacollection

    In this section you will create a wide time-series database table and report data source and useRSSql to configure the collection of data.

    Create a wide time-series database table

    1. Launch the Microsoft Query Analyzer. From the Windows Start menu select Programs >Microsoft SQL Server > Query Analyzer. Enter ExternalData for the Login name andPassword and click OK.

    2. Select File > Open from the menu and browse to the IN02 > Lab 1 > Scripts folder on theRSTechEd CD. Open the WideTimeSeries.sql file. The following should appear in yourQuery Analyzer query window:

  • 38 of 64 RSTechED 2005 Rockwell Software

    3. Execute this query by selecting Query > Execute. You will get a message saying that thecommand completed successfully. Exit the Query Analyzer application.

  • RSTechED 2005 Rockwell Software 39 of 64

    Create a wide time-series report data source

    1. Launch the RSBizWare Production Client if it is not already running (from the Windows Startmenu select Programs > Rockwell Software > RSBizWare > RSBizWare ProductionClient).

    2. Select Configure > Reporting > Report Data Sources, Objects, and Filters from themenu. Then click the Add button in the Report Data Sources area of the Configure ReportData Sources, Objects, and Filters dialog box.

    3. This will launch the Report Data Source Configuration wizard. Click Next.

  • 40 of 64 RSTechED 2005 Rockwell Software

    4. On the Report Data Source Name dialog box, you must enter a name for your report datasource. Enter the name External Wide Time-Series and click Next.

  • RSTechED 2005 Rockwell Software 41 of 64

    5. Next you must select a data source and then select a table or view from within that datasource. Select the RSBizWare external data storage from the database list, select theWide_Time_Series table from the list of tables and views, and then click Next.

  • 42 of 64 RSTechED 2005 Rockwell Software

    6. On the Column Selection dialog box, click the >> button to select all columns, and then clickNext.

    7. On the Time Selection Toolbar dialog box, select the DateAndTimeStamp column from thelist and then click Next.

  • RSTechED 2005 Rockwell Software 43 of 64

    8. On the Time-series Format dialog box, select the Wide Format option, and then click Next.

  • 44 of 64 RSTechED 2005 Rockwell Software

    9. On the Match Time-series Columns dialog box, you must identify the functions of each of thecolumns in your data table. When you click the value in the Time-series Use column,a list will appear. Assign the following uses to the Fields: DateAndTimeStamp: Timestamp Milliseconds: Milliseconds Quality: Quality MixSpeed: Data Point TankTemp: Data Point CoolTemp: Data Point MotionMax: Data PointThen click Next.

  • RSTechED 2005 Rockwell Software 45 of 64

    10. On the Data Point Configuration Table dialog box, you must select a database table to act asthe configuration table. The configuration table maps the data point column numbers with thetext data point description and engineering units columns. You did not create a configurationtable 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 ConfigureReport Data Sources, Report Objects, and Filters dialog box.

  • 46 of 64 RSTechED 2005 Rockwell Software

    Use RSSql to configure the collection of data

    Historian does not provide a time-series data collection wizard for wide time-series data sourceslike it does for narrow time-series data sources. To configure wide time-series data collection, youmust use the RSSql client. This section will cover how the existing BizBikes RSSql configurationcan be modified to collect data for the wide time-series table created earlier.

    1. Close the RSBizWare Production Client. Having both the Production Client and RSSql openat 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, right-click 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 DirectoryServer. Then, the (RSSql) FactoryTalk Data Point dialog box will appear.

  • RSTechED 2005 Rockwell Software 47 of 64

    5. Select the data points to be collected.

    Select the Paint folder from the Folder list.Select the CoolTemp tag from the Contents of /::Paint list and click the Add Selected

    Tag(s) button.Select the MotionMax tag from the Contents of /::Paint list and click the Add Selected

    Tag(s) button.

    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 theODBC item and select Define Data Object from the shortcut menu.

  • 48 of 64 RSTechED 2005 Rockwell Software

    8. On the Data Object Definition dialog box, give the new data object a name by enteringWide_Data_Logger in the Name list. You also need to specify which DSN to use to connectto 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 ConnectionName list with a value of ExternalData. Specify ExternalData for the User Name andPassword boxes. Test the database connection by clicking the Test button.

    10. Click OK on the Connection Succeeded message, and then click Apply and Close.

  • RSTechED 2005 Rockwell Software 49 of 64

    11. On the ODBC Data Object Definition dialog box, the Database Connection list will be set toExternalData. Select ExternalData.Wide_Time_Series from the Table list.

    12. Double-click each of the entries in the Database Columns list in order to move them to theData Object Columns list. Then, click Apply and Close to return to the main RSSql dialogbox.

    13. Select Define > Transaction from the menu. Enter Wide_Data_Transaction in theTransaction Name list. Select Wide_Data_Logger from the Data Object Name list.

  • 50 of 64 RSTechED 2005 Rockwell Software

    14. Right-click the DateAndTimeStamp column and select Bind Expression from the shortcutmenu.

    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. Inthe Expression Editor, click the MTransTimestamp() button for the Milliseconds column.

  • RSTechED 2005 Rockwell Software 51 of 64

    16. On the Transaction Definition dialog box, double-click MixSpeed in the list of Data ObjectColumns. The Filter and Select Data Points (drag & drop enabled) dialog box will appear onthe right. Scroll down through the Data Point list until you see the four data points configuredfor the Paint workcell. Select the FT.RSViewBizBikes.Paint_MixSpeed data point. Drag itover to the left and drop it on the MixSpeed Data Object Column. This will bind the datapoint to the data object column.

    17. Repeat the drag and drop procedure to bind the TankTemp, CoolTemp, and MotionMaxdata points to the corresponding Data Object Columns. Close the Filter and Select DataPoints dialog box when completed.

    18. On the Transaction Definition dialog box, click the Trigger / Storage button.

  • 52 of 64 RSTechED 2005 Rockwell Software

    19. On the Trigger And Storage Parameters dialog box, change the Scan Rate to 5 and selectthe Seconds option. Then click OK to close the Trigger And Storage Parameters dialogbox.

    20. On the Transaction Definition dialog box, click the Enabled option under Transaction Status.Then, click Apply and Close.

    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 thesame database record in the Wide_Time_Series table in the Time-Series Data SQL Serverdatabase.

    21. Close the RSSql client.

  • RSTechED 2005 Rockwell Software 53 of 64

    Reporting on Time-Series Data

    In this section you will start data collection, create a time-series report object, and enhance theperformance of the report.

    Start the Collection of Data

    1. To configure the collection of data from an RSView32 application, that application must berunning. If the BizBikes application is not already running, follow these steps to launch it (youshould have already completed this step on page 28):

    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 theC:\BizBikes\RSView32\BizBikes.rsv file.

    Click the Run Mode tab and then click the Run Project button.

  • 54 of 64 RSTechED 2005 Rockwell Software

    2. From the main BizBikes dialog box, click the Remote Areas button on the toolbar. Then clickthe Paint button on the pop-up menu.

    3. From the Paint Process dialog box, click the button. Leave the RSView32project running. Launch the RSBizWare Production Client from the Windows Start menu byselecting Programs > Rockwell Software > RSBizWare > RSBizWare Production Client.

    4. Select Configure > RSSql Configurations from the menu. Click Start on the RSSqlConfigurations dialog box.

    Close the RSSql Configurations dialog box by clicking on the Close button.

  • RSTechED 2005 Rockwell Software 55 of 64

    Create a Time-Series Report Object

    1. From the Production Client, select File > New Report from the menu. Insert a time-seriesreport object into the report by selecting Insert > Time-Series Trend Chart from the menu.Click Yes when asked if you want to author the report as the user admin.

    2. On the Configure Time-Series Report Object dialog box, enter External Time-Series Data inthe Report Object Name box. Expand the Reporting Tags by Data Source item in theReport Tags Available tree. Expand the External Narrow Time-Series and External WideTime-Series items. Double-click the (External Wide Time-Series) MixSpeed reporting tagand double-click the (External Narrow Time-Series) FT.RSViewBizBikes.Paint_TankTempreporting tag.

    3. Click OK to close the Configure Time-Series Report Object dialog box.

    .

  • 56 of 64 RSTechED 2005 Rockwell Software

    4. Click the Preview Mode button ( ) button to preview the report object.

    This report object shows that reporting tags from multiple, external time-series data sourcesthat can be included on the same chart even if those report data sources are a mixedcollection of narrow and wide time-series tables.

  • RSTechED 2005 Rockwell Software 57 of 64

    Enhance Report Performance

    It will not take long before the reporting performance begins to seriously degrade for reportobjects with reporting tags from the newly created external time-series tables. Follow these stepsto create an index on each data table.

    1. From the Windows Start menu select Programs > Microsoft SQL Server > EnterpriseManager. Expand the Time-Series Data folder under the Microsoft SQL Servers > SQLServer Group > (local) (Windows NT) > Databases folder. Click the Tables item. The list oftables in this database will appear on the right.

    2. In the list of database tables, right-click the Narrow_Time_Series table and select the AllTasks > Manage Indexes from the shortcut menu.

  • 58 of 64 RSTechED 2005 Rockwell Software

    3. Click the New button on the Manage Indexes dialog box.

  • RSTechED 2005 Rockwell Software 59 of 64

    4. On the Create New Index dialog box, enter an index name like Narrow Index in the Indexname list. Check the DataPointId and DateAndTimeStamp column check boxes, and thenclick OK.

    Because queries of narrow time-series data are frequently based on the Data Point Id andTimestamp values, they should be included in the tables index. Click Close on the ManageIndexes 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.

  • 60 of 64 RSTechED 2005 Rockwell Software

    6. Click New on the Manage Indexes dialog box.

  • RSTechED 2005 Rockwell Software 61 of 64

    7. On the Create New Index dialog box, enter Wide Index in the Index name box. Check theDateAndTimeStamp column check box, and then click OK.

    Because queries of wide time-series data are frequently based on the Timestamp value, itshould be included in the tables index. There is no Data Point Id used with wide time-seriesdata 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.

  • 62 of 64 RSTechED 2005 Rockwell Software

    Discussion: Comparing Trending Formats

    Narrow and wide time-series storage formats have contrasting advantages and disadvantages.This section lists the advantages of each method to help you decide when each format is best foryour application.

    Narrow Time-Series Advantages A narrow time-series database record is typically smaller than a wide time-series record. A

    wide time-series record often contains many data value columns while a narrow time-seriesrecord only has one data value column. When large numbers of records are queried for asingle reporting tag, the result set size in bytes will typically be larger and less efficient for widetime-series data compared to narrow time-series data. In these cases, the narrow time-seriesqueries will be more efficient and faster than queries of wide time-series data.

    Historian has a built-in wizard to configure narrow time-series data collection. Configuring widetime-series data collection requires the RSSql client and thus requires a RSSql license.

    Narrow time-series data collection is ideal for unscheduled data points. If you want to collectdata point values when they change, you definitely want to store them in a narrow format. Itwould be very inefficient to store multiple data point values in a wide format every time any ofthe values changes.

    Wide Time-Series Advantages Logging scheduled data points can be much more efficient with a wide time-series format. If

    you are collecting 100 values every minute, a wide time-series format would only require onedatabase write every minute versus 100 database writes every minute. Even though the widerecord is much larger than the narrow, the wide record is much smaller than the combined 100narrow records.

    A wide time-series report data source can be configured with a derived field column. Thiscolumn could be a value that is a function of two or more other data point values.

    If it is important to compare different reporting tags collected by the same transaction, you canonly do this with wide time-series records. Data points collected in a narrow format cannotalways be associated one-for-one with other data points based on timestamp, even if the datapoints are scheduled and collected at the same rate.

  • RSTechED 2005 Rockwell Software 63 of 64

    Notes

  • 64 of 64 RSTechED 2005 Rockwell Software