Technical Support Telephone 440-646-5800 Technical Support Fax 440-646-5801 World Wide Web www.software.rockwell.com 2005 Rockwell Software Inc. All rights reserved. Printed in USA. This manual and any accompanying Rockwell Software products are copyrighted by Rockwell Software Inc. Any reproduction and/or distribution without prior written consent from Rockwell Software Inc. is strictly prohibited. Please refer to the license agreement for details.
Copyright Notice
Trademark Notices
The Rockwell Software and RSBizWare logos are registered trademarks of Rockwell Software Inc. FactoryTalk and RSBizWare eProcedure are registered trademarks of Rockwell Software Inc. RSBizWare Batch, RSBizWare MaterialTrack, RSBizWare BatchCampaign, RSBizWare Historian, RSBizWare BatchHistorian, RSBizWare Batch Archiver, RSBizWare Scheduler, RSAssetSecurity, PhaseManager, RSTune, and RSLoop Optimizer are trademarks of Rockwell Software Inc. Logix5000, RSLogix 5000, and ProcessLogix are trademarks and ControlLogix is a registered trademark of Rockwell Automation. All other trademarks are the property of their respective holders and are hereby acknowledged.
Warranty
This Rockwell Software product is warranted in accord with the product license. The products performance will be affected by system configuration, the application being performed, operator control, and other related factors. This products implementation may vary among users. This manual is as up-to-date as possible at the time of printing; however, the accompanying software may have changed since that time. Rockwell Software reserves the right to change any information contained in this manual or the software at anytime without prior notice. The instructions in this manual do not claim to cover all the details or variations in the equipment, procedure, or process described, nor to provide directions for meeting every possible contingency during installation, operation, or maintenance.
Modified: July 18, 2005 3:29 pm
ii
Contents
1 Introducing the Batch Archiver
Document Organization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . System Architecture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Implementation Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Creating the RDBMS Database . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Configuring the Data Source Name . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Creating the ODBC Connect String . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Configuring the Reporting Option . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Configuring the Batch Archiver Service . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
1
1 1 2 4 4 4 4 4 4
9
10 10 11 14 15 15 16
19
19 22 22 23 24 24 24 25 26
iii
29
29 29 29 31 31 38
39
39 39 40 40 40 41 41 41 42
43 v
iv
Document Organization
The information presented in this document should minimize the effort required to archive the batch data to a database. This manual presents the following subjects:
Introduction to the Archiver Working with Electronic Batch Records Creating a Data Source Using the Archiver Creating a Custom Archiver Using the Windows Event Log Archiver Setup for RSBizWare BatchHistorian Users
Overview
The Batch Archiver collects data from the electronic batch record files (.evt files) generated by the Batch Server and stores the data in a specified Open Database Connectivity (ODBC)-compliant relational database. Rockwell Automation recommends using a high-performance database such as SQL Server or Oracle due to the superior robustness and performance of these products.
The Batch Archiver requires an ODBC-compliant database that supports stored procedures, such as SQL Server 2000 or Oracle8i/9i. Database platforms that do not provide stored procedure support, such as Access 95, cannot be used with the Batch Archiver.
The Batch Server creates an electronic batch record for every batch on the Batch List. While these files may be viewed with a word processor or spreadsheet, many plants have implemented one of the many commercially available Relational Database Management System (RDBMS) software packages. The Archiver collects data from each electronic batch record file and places it in the specified RDBMS database, allowing you to store the electronic batch record data in this format.
You can configure the Archiver to archive batch data to the RDBMS database in either of two ways:
When using End-of-Batch archiving, the Archiver inserts records into the RDBMS database when a batch is removed from the batch list. In this case, the Batch Archiver runs as a software program and is initiated by the Batch Server. When using Incremental archiving, the Batch Archiver inserts records into the RDBMS database on a pre-defined schedule. In this case, the Archiver runs as a Windows service. You can configure the archiving time interval in the Equipment Editor Server Options dialog box. (See Configuring the Reporting Option for more information.) When the operator creates a control recipe, the Batch Server adds the electronic batch record file name to the Archivers work queue file (Archque.txt). After the Archiver successfully inserts all of the electronic batch records into the database, it removes the electronic batch record file name from the work queue file. The Archiver does not delete the electronic batch record file unless it is specifically configured to do so. If the Archiver cannot successfully insert each item from the electronic batch record file, it does not remove the file name from the Archivers work queue file. Every time the Archiver runs, it attempts to insert the records from each file listed in the queue into the RDBMS database. In this manner, the Archiver attempts to store the data at a later time in the event of a failure. This mechanism ensures that failures such as networking problems do not result in a loss of archived data.
If the system fails while the Archiver is in the process of inserting a files records, the Archiver does not remember where it was in the record insertion process. When the Archiver is restarted, it attempts to insert all of the files records, which may result in duplicate records in the target database. When the Archiver is configured to run at the end of a batch, the Batch Server runs the Archiver as a Windows IDLE_PRIORITY process. If the system is busy, the Archiver is superseded by higher-priority functions, which slows the archiving process.
System Architecture
You can configure the Archiver to run as a software program (for end-of-batch archiving) or as a Windows service (for incremental archiving). The Archiver uses ODBC (Open Database Connectivity) technology to communicate with any of several ODBC-compliant databases. Table creation scripts are provided for Oracle and Microsoft SQL Server. (See Creating a Data Source for more information.)
The following diagram illustrates the sequence of events that occur when the Batch Server initiates the Archiver to insert batch record data into your RDBMS database.
1. The operator or MES
Operator/MES Archiver Queue ArchQue.txt 1 4 Recipe Execution (Batch Server) 3 2 *.evt files 9 6 5 Archiver
name of the electronic batch record to the electronic batch record directory file, EventDir.txt.
4. The Batch Server
7 8
incrementally writes to the Archivers queue file, ArchQue.txt. The data in this file consists of the path to the electronic batch record file, and if the batch is removed from the batch list, a tab and the word REMOVED follows the file name.
ODBC
list, the Batch Server initiates the Archiver. For End-of-Batch archiving, the Archiver runs as a software program and the Archiver service must be disabled.
For Incremental archiving, the Archiver runs as a Windows service on a pre-defined schedule. The service must be enabled at all times during batch processing. 6. The Archiver reads the ArchQue.txt file for the name of the electronic batch record file
Implementation Overview
Implementing the Batch Archiver involves five distinct steps:
Creating the RDBMS database Configuring a Data Source name for the RDBMS database Creating the ODBC database connect string Configuring the Batch reporting option in the Equipment Editors Server Options dialog box Configuring the Batch Archiver service
The first three steps are covered in the Creating a Data Source chapter. The last two steps are discussed in the Implementing the Batch Archiver chapter.
Description
AMNT_TO_CHARGE
Event
Recipe Value
PValue
50
EU
GALLONS
To see whether a level (e.g., operation) became active, look through the Description column and find the phrase Operation Started, Step Activated, etc. The EU column will contain the word Phase if the step activated is a phase.
Example:
Recipe
12:TPROC\TUP:1\TRANCT:1-1 12:TPROC\TUP:1\TRANCT:1\CHARGE:1-1 12:TPROC\TUP:1\TRANCT:1\CHARGE:1-1
Description
Step Activated State Changed: State Changed:
PValue
CHARGE:1 RUNNING COMPLETE
EU
Phase
Phase
ICE_CREAM CHARGEA CHARGEA
To evaluate a transfer of control, you will find entries showing the continuous phases involved becoming active and idle in turn. However, only the final continuous phase will show that it completed. In other words, if a transfer of control involved three instances of the same phase running in sequence, the first would start and become idle, then the second would start and become idle, and finally the third would start and become complete. The following example shows the state changes of an entire operation that contains a transfer of control operation in which a RECIRC phase occurs both before and after a transition:
Recipe
12:TPROC\TUP:1\TRANCT:1-1 12:TPROC\TUP:1\TRANCT:1-1 12:TPROC\TUP:1\TRANCT:1-1 12:TPROC\TUP:1\TRANCT:1-1 12:TPROC\TUP:1\TRANCT:1-1 12:TPROC\TUP:1\TRANCT:1\RECIRC:2-1 12:TPROC\TUP:1\TRANCT:1\CHARGE:1-1 12:TPROC\TUP:1\TRANCT:1\RECIRC:2-1 12:TPROC\TUP:1\TRANCT:1\CHARGE:1-1 12:TPROC\TUP:1\TRANCT:1\CHARGE:1-1 12:TPROC\TUP:1\TRANCT:1-1 12:TPROC\TUP:1\TRANCT:1-1 12:TPROC\TUP:1\TRANCT:1\CHARGE:1-1 12:TPROC\TUP:1\TRANCT:1-1 12:TPROC\TUP:1\TRANCT:1\RECIRC:3-1 12:TPROC\TUP:1\TRANCT:1\RECIRC:3-1 12:TPROC\TUP:1\TRANCT:1\RECIRC:3-1 12:TPROC\TUP:1\TRANCT:1-1 12:TPROC\TUP:1\TRANCT:1\CHRG_B:1-1 12:TPROC\TUP:1\TRANCT:1\CHRG_B:1-1 12:TPROC\TUP:1\TRANCT:1\CHRG_B:1-1 12:TPROC\TUP:1\TRANCT:1\RECIRC:3-1 12:TPROC\TUP:1\TRANCT:1-1 12:TPROC\TUP:1\TRANCT:1\CHRG_B:1-1 12:TPROC\TUP:1\TRANCT:1-1
Description
Operation Started State Changed: Step Activated Step Activated Step Deactivated State Changed: State Changed: State Changed: State Changed: State Changed: Step Activated Step Activated State Changed: Step Deactivated State Changed: Owner Changed: Attribute Change Step Deactivated State Changed: State Changed: State Changed: State Changed: Step Activated State Changed: Step Deactivated
PValue
0 RUNNING RECIRC:2 CHARGE:1 Initial Step IDLE IDLE RUNNING RUNNING COMPLETE CHARGE_B:1 RECIRC:3 IDLE CHARGE:1 RUNNING PROGRAM PAUSED off RECIRC:2 IDLE RUNNING COMPLETE COMPLETE Terminal Step IDLE CHARGE_B:1
EU
Phase
Phase Phase
RECIRC1 CHARGEA
RECIRC1 CHARGEA RECIRC1 CHARGEA CHARGEA Phase Phase CHARGEB RECIRC1 CHARGEA Phase CHARGEA RECIRC1 RECIRC1 RECIRC1 Phase RECIRC1 CHARGEB CHARGEB CHARGEB RECIRC1
Recipe
12:TPROC\TUP:1\TRANCT:1\RECIRC:3-1 12:TPROC\TUP:1\TRANCT:1-1 12:TPROC\TUP:1\TRANCT:1-1 12:TRNPROC\TRANUP:1-1 12:TPROC\TUP:1\TRANCT:1-1
Description
State Changed: Step Deactivated State Changed: Step Activated Operation Done
PValue
IDLE RECIRC:3 COMPLETE Terminal Step 0
EU
Phase
RECIRC1
Phase
RECIRC1
Creating the RDBMS database Configuring a Data Source name for the RDBMS database Creating the ODBC database connect string
While you can archive Batch data to a variety of Relational Database Management System (RDBMS) software packages, Rockwell Automation recommends using SQL Server or Oracle. The instructions contained within this document are specific to these two applications.
The Batch Archiver requires an ODBC-compliant database that supports stored procedures, such as SQL Server 2000 or Oracle8i/9i. Database platforms that do not provide stored procedure support, such as Access 95, cannot be used with the Batch Archiver.
CREATING
THE
RDBMS DATABASE
The first step to implementing the Batch Archiver is to create the RDBMS database where the Archiver will archive data from the event journals (.evt files). Scripts to create the SQL Server and Oracle databases (with a default database table name of BATCHHIS) are provided in the C:\Program Files\Rockwell Software\Batch\History folder. CONFIGURING
THE
After generating the database where the Archiver will archive data, the second step requires configuring a Date Source name for the RDBMS database. The Data Source name functions as an alias for the database used by the Archiver. The Date Source name may be produced in one of two ways:
While the Date Source name may be manually created using ODBC, the instructions in this chapter specifically use the Archiver Setup application to create both the Date Source name and the ODBC database connect string. CREATING
THE
In addition to creating the Date Source name, the Archiver Setup application also creates the ODBC Connect String. The Archiver uses the ODBC Connect String to locate the
appropriate RDBMS database for archiving data. Once created, the ODBC Connect String is stored in the BatchArc.ini file. OTHER REQUIRED STEPS After creating the data source for SQL Server or Oracle, the next implementation steps involve configuring the Batch Archiver appropriately for Incremental or End-of-Batch archiving. This involves configuring the Equipment Editor Server Options as well as the Batch Archiver service. These instructions are included in the next chapter, Implementing the Batch Archiver.
10
3. Click New. The Create New Data Source dialog box opens. 4. Select System Data Source (applies to this machine only), and then click Next. 5. From the Select a driver for which you want to set up a data source area, scroll down and select SQL Server, click Next, and then click Finish. The Create a New Data Source to SQL Server dialog box opens. 6. In the Name box, type a name for the data source (such as Batch Archiver). 7. In the Description box, type a description of the data source (such as RSBizWare Batch Historical Data). 8. From the Server list, select the SQL Server to which you want to connect (if the SQL Server is on this machine, select local), and then click Next.
When using Incremental Archiving, the user account assigned to the Batch Archiver service must be granted login access to SQL Server and must have permission to insert data into the BATCHHIS table.
11
When using End-of-Batch Archiving, the user account assigned to the Batch Server must be granted access to the BatchHistory database on the SQL Server and must have permission to insert data into the BATCHHIS table. The Batch Servers user account must be a member of the local Administrators group on the SQL Server computer.
9. Select how SQL Server should verify the authenticity of the login ID as follows:
If you are not using Batch Archiver in conjunction with BatchHistorian, select With Windows NT authentication using the network login ID. If you are using Batch Archiver in conjunction with BatchHistorian, select With SQL Server authentication using a login ID and password entered by the user.
The login ID specified must be that of the user who created the RSBizWare database. (See Creating a Data Source for BatchHistorian for more information.)
10. Make sure Connect to SQL Server to obtain default settings for the additional configuration options is selected, and then click Next. 11. Select the database file name as follows:
If you are not using Batch Archiver in conjunction with BatchHistorian, check the Change the default database to box, and select BatchHistory from the pull-down list If you are using Batch Archiver in conjunction with BatchHistorian, select the name of the appropriate RSBizWare database, not the Batch History database. (See Creating a Data Source for BatchHistorian for more information.)
12. Select Use ANSI quoted identifiers and Use ANSI nulls, paddings, and warnings, and then click Next.
12
13. Select Perform translation for character data, and then click Finish. The ODBC Microsoft SQL Server Setup dialog box opens.
14. Click Test Data Source. The results display in the Test Results area. 15. If the test is successful, click OK to close the SQL Server ODBC Data Source Test window. If the test is not successful, consult your system administrator.
13
16. Click OK to exit the ODBC Microsoft SQL Server Setup dialog box, and return to the Select Data Source dialog box.
17. Select the Machine Data Source tab. Select the new data source as shown above, and then click OK.
It is highly recommended that the Oracle Server software runs on a separate computer than the Batch Server and the Batch Archiver applications.
Oracle Client Installation: For the client computer, install Oracle 9i Client and select the Administrator option. The Oracle Client software can reside on the same computer with Batch Server and the Archiver software.
So that an ODBC data source can be created to connect with Oracle, you must install an Oracle Client on the same computer as the Archiver.
14
1. On the Oracle Client computer, transfer a copy of the C:\Program Files\Rockwell Software\Batch\History folder to the Oracle Server computer. 2. At the root directory on the Oracle Server computer, create a folder named ORACLEARCHIVER. 3. Copy the contents of the History folder to the ORACLEARCHIVER folder. 4. Run create_ora_db.bat from the ORACLEARCHIVER folder. The script may take up to 15 minutes to complete. 5. Reboot the computer.
15
1. Click the Start button, point to Programs > Rockwell Software > RSBizWare > Batch, and then select Archiver Setup. The Select Data Source dialog box opens. 2. Select the Machine Data Source tab.
3. Click New. The Create New Data Source dialog box opens. 4. Select System Data Source, and then click Next. 5. Select Oracle9 ODBC Driver 9.2.0.6 (SQORA32.dll), and then click Next.
You must use ODBC driver version 9.2.0.6. Although Oracle installs ODBC driver version 9.2.0.1 during installation of Oracle 9i, this version will not correctly transfer timestamp data.
6. Verify that the data source information is correct, and click Finish to create the data source. The Oracle9 ODBC Driver Setup dialog box opens. 7. In the Data Source Name box, type a name for the data source.
16
9. Click OK to return to the Select Data Source dialog box. 10. Select the Machine Data Source tab, and then double-click the Oracle data source. The Oracle9 ODBC Driver Connect dialog box opens 11. In the Service Name, User Name, and Password boxes, type openmes.
12. Click OK. The Batch Archiver can now begin archiving records to the specified database.
17
18
Configuring the Batch reporting option in the Equipment Editors Server Options dialog box Configuring the Batch Archiver service
THE
CONFIGURING
REPORTING OPTION
The next step to implementing the Batch Archiver involves configuring the reporting option. This is done on the Batch Reporting tab in the Equipment Editors Server Options dialog box. There are three reporting options that can involve the Batch Archiver:
Archiver (End-of-Batch) The Batch Server initiates the Batch Archiver when a
CONFIGURING
The final step for the Batch Archiver implementation is configuring the Archiver service. Configuring the service is a function of the selected reporting option.
Archiver (End-of-Batch) The Batch Archiver service must be disabled since the
Batch Server initiates the Batch Archiver when a batch is removed from the batch list.
Archiver (Incremental) Since the Batch Archiver runs as a service on a periodic interval, the Batch Archiver service must be assigned a Windows 2003 user name and the service must be enabled.
19
4. In the Reporting Application area, select either Archiver (End-of-Batch) or Archiver (Incremental). 5. In the Table Name box, type the name of the data table where the batch data is archived. The default table name created by the supplied scripts is BATCHHIS. 6. If Archiver (Incremental) is selected, enter the time period between active archiving in the Incremental Period box, and then select Minutes or Seconds. The minimum setting is 5 seconds. The maximum is 9999 minutes.
If a value outside of this range is entered, the Archiver will run in 5-minute incremental periods.
The database connect string is automatically entered in the Database Connect String box. This was configured when the Archiver Setup function created the database connect string.
20
MaterialTrack Filters are only displayed if MaterialTrack is installed. eProcedure Filters are only displayed if eProcedure is installed.
8. Select the data that you want to archive from the Batch event journal files (.evt).
You cannot filter out data added to the Batch event journal files (.evt) by the ADDEVENT execute.
The date format used for the event journal files LclTime is YYYY.MM.DD HH:MM:SS and is not configurable, regardless of the language being used.
9. Click OK. (See the RSBizWare Batch Administrators Guide for more information on the Server Options dialog box.)
21
1. Click the Start button, point to Programs > Administrative Tools, and then select Services. The Services dialog box opens.
2. Double-click Batch Archiver. The Batch Archiver Properties (Local Computer) dialog box opens to the General tab.
22
3. Select the Log On tab. The Batch Server account specified during installation is the default account. 4. Click Browse. The Select User dialog box opens. 5. Locate and select the desired Batch Archiver user account. Click OK to close the Select User dialog box. 6. In the Password box, type the password for the Archiver user account, type the password again in the Confirm password box, and then click OK. A message displays stating that the user account has the Log On As A Service right. 7. Click OK, and then close the Services dialog box.
If the Archiver inserts data into a database on another computer and you wish to use Trusted Security, the Archiver service must run in a domain account that is assigned the appropriate privileges within the database program. The benefit of using Trusted Security is that you only need to create one set of accounts. (See the RSBizWare Batch Administrator's Guide for information on creating user accounts.)
23
1. Click the Start button, point to Programs > Administrative Tools, and then select Services. The Services dialog box opens. 2. From the Services list, double-click Batch Archiver. The Batch Archiver Properties (Local Computer) dialog box opens to the General tab. 3. From the Startup Type list, select Disabled. 4. Click OK, and then close the Services dialog box.
24
5. In the Maximum Records Per Transaction box, type 75. This results in a maximum of 75 records written and committed to the database in each transaction. By minimizing the number of round trip requests from the Batch Archiver to the database, performance is improved. However, it is important to note that performance will vary; 75 should be used as a starting point and adjusted either up or down based upon the results observed.
If you enter a value of 0, the minimum value that can be entered in the Maximum Records Per Transaction field, all records will be committed in a single transaction. This value should only be used for End-of-Batch archiving. The maximum value that can be entered in the Maximum Records Per Transaction field is 10000. However, the maximum number of records that can be successfully archived in a single transaction depends on your computers capabilities and may be significantly less than 10000. If you encounter Time Out messages in the batcharc.log, you must reduce the value in the Maximum Records Per Transaction field. These settings are merely guidelines and vary depending on the number of events generated per batch, the batch duration, etc.
6. In the Incremental Period box, enter 10 (or more) and select Minutes. This should be set to an incremental period that is high enough to ensure a significant number of records are generated so that when the Batch Archiver runs it will pick up at least the number or records specified in the Maximum Records Per Transaction field. For example, if the batches running only generate 50 records and the Maximum Records Per Transaction is set to 75 then the incremental period should be increased. Conversely, if 500 records are generated every 10 minutes then it may be advantageous to set the incremental period lower.
This value is set higher by default for BatchHistorian users primarily because considerably more database-side processing time is required to evaluate and parse each and every record, along with inserting data into the BatchHistorian tables. Having the Archiver send more records to the database (i.e. 1000) in each transaction, higher performance results in terms of the total records transferred per second.
4. In the Reporting Application area, select Archiver (Incremental). 5. In the Maximum Records Per Transaction box, type 1. 6. In the Incremental Period box, enter 5 (or more) and select Minutes. This ensures that events generated are written and committed to the database as quickly as possible. It also allows the data to be available at or near the time the event data is actually generated, which allows you to retrieve data more quickly for reporting and analysis purposes.
This configuration is usually not the most efficient in obtaining the maximum number of records transferred per archival incremental period; however, it will make the data available as quickly as possible.
26
1. Click the Start button, point to Programs > Rockwell Software > RSBizWare > Batch, and then select Batch Service Manager. The Batch Service Manager dialog box opens.
2. Click Select Computer. The Select Computer dialog box opens. 3. Select the name of the computer where the Batch Archiver service is installed. Click OK. The Select Computer dialog box closes.
Select the computer first because the Batch Service Manager needs to determine the available services on the selected computer.
4. From the Service list, select Batch Archiver. 5. Once Batch Archiver is selected, you can start, stop, pause, or restart the Archiver service using the appropriate command buttons.
Clicking the Pause button causes the Incremental Archiver to pause after processing the active .evt file. Click the Start button to resume Incremental Archiving.
6. Click OK.
27
28
C, C++, or Visual Basic application batch (.bat) file command (.cmd) file
ArchQue.txt File
Keep the ArchQue.txt file locked while it is open and keep it open for only a few seconds. If the queue file is held open for more than a few seconds, the Batch Server cannot add entries to the queue as other control recipes are created.
The archive queue file, ArchQue.txt, contains a list of electronic batch record files. The line format within the list contains the path and file name of the electronic batch record file. The path name can use either UNC names or local path names, depending on how the
29
journal project directory is defined in the Equipment Editor Server Options dialog box as shown here.
If the batch is removed from the batch list, a tab character (\t) and the word REMOVED follows the file name. Each electronic batch record file is listed in a single record delimited with Carriage Return / Line Feed (CR/LF). LINE FORMAT (UNC) \\computer_name\sharename\path_to_journal_file \t REMOVED{CR/LF}
Example
\\station1\BATCHCTL\SAMPLEDEMO1\journals\123.evt \t REMOVED{CR/LF} \\station1\BATCHCTL\SAMPLEDEMO1\journals\124.evt \t REMOVED{CR/LF} \\station1\BATCHCTL\SAMPLEDEMO1\journals\125.evt {CR/LF}
30
Field Type datetime NULL datetime NULL varchar(12) NULL varchar(255) NULL varchar(1000) NULL
Description Time event is recorded in Greenwich Mean Time Local time event is recorded Unique identifier assigned by the Batch Server Alpha Batch ID The recipe element that was executing at the time of the electronic batch record entry. The field contents appear as:
<UniqueID>:[<Procedure >\][<Unit Procedure>:Instance\] <Operation>:InstanceLoopCounter
The data in the brackets is optional, depending on the recipe level. Descript Event PValue DescriptAPI varchar(255) NULL varchar(155) NULL varchar(255) NULL varchar(255) NULL Description of PValue data Event type triggering the record Value reported to the electronic batch record Description of PValue data Yellow Paint Material Tracking / Material Bound / Material Unbound 50 Engineering Units
See Spanish Translation of DescriptAPI, EventAPI, and PValueAPI EventAPI varchar(155) NULL Event type triggering the record Report
31
Field Name
Field Type
Description
Example
See Spanish Translation of DescriptAPI, EventAPI, and PValueAPI PValueAPI varchar(255) NULL Value reported to the electronic batch record 50
See Spanish Translation of DescriptAPI, EventAPI, and PValueAPI EU Area varchar(255) NULL varchar(155) NULL varchar(155) NULL varchar(155) NULL varchar(155) NULL datetime NULL varchar(85) NULL varchar(50) NULL varchar(155) NULL varchar(50) NULL varchar(255) NULL varchar(255) NULL varchar(255) NULL Engineering units associated with Pvalue Area model name in batch equipment configuration where batch was executed Process cell in Batch equipment configuration Unit name in Batch equipment configuration Name of the phase generating the record Last date the batch report was printed Computer name/Windows user name Phase class description Common name of the material Inventory control system material ID used to track the material Name assigned to a lot of material ID assigned to a distributed portion of a lot Containers name where material and lot were distributed, or where material and lot are stored YELLOWPAINT 31 GALLONS THE_PAINT_COMPANY
32
Description Unique ID used as a key to allow grouping of separate event entries all resulting from a single material addition Used for event journal signatures by Batchsig program to detect changes in .evt file. Information stored here is a hexadecimal or a single spaced character. Tag indicating information reported to SAP Unique identifier assigned to the record when it is added to the database Number of times an active eProcedure control step has been reactivated HTML for completed eProcedure instruction steps
Example 100
Signature
varchar(255) NULL
ERP_Flag RecordNo
31
int
ntext
<FORM> Add a CIP Batch to the Batch List. Click OK when done. </FORM>
SQL Server columns that have a field type of ntext only retrieve 256 characters of data at a time using a standard SELECT statement. To retrieve all the data use the READTEXT function. (See How to Display All Instruction HTML Data from an SQL Database for more information.) SignatureID int A 32-bit unsigned integer that uniquely identifies a Signature Request within the batch system. A 32-bit unsigned integer that uniquely identifies an Action within the batch system. An Action is a queued Execute command to the Batch Server that is pending one or more Signature completions prior to being performed. 1
ActionID
int
33
FROM AN
SQL
If you are archiving data to an SQL database, you must use the READTEXT function to retrieve all data in the Instruction HTML column for a specified record number. The following steps provide a sample query and explain how to modify the query that will produce an .html file for viewing in a browser: 1. In Query Analyzer go to the Tools > Options > Results tab and clear the Print column headers (*) option. Click Apply and then OK to close the dialog box. 2. From the Query menu, select Results to File. 3. Copy the following example query into a blank query window:
/* -- Displays the contents of a text column in a 255-character wide query window -- @txtptrval is the text pointer value for the specified text column -- @offsetval is the offset value and represents the starting -- position within a text column -- @bufferval represents the amount of text to put in the row -- in this case, it is set to 255 because isql/w only displays -- 255 characters in a row -- @maxval is the full length of the entire text column */ BEGIN SET NOCOUNT ON DECLARE @txtptrval VARBINARY(16), @offsetval INT, @bufferval INT, @maxval INT SELECT @txtptrval = TEXTPTR(bhbatchhis.InstructionHTML) FROM bhbatchhis WHERE recordno = '5817' SELECT @offsetval = 0 SELECT @bufferval = 255 SELECT @maxval = DATALENGTH(bhbatchhis.InstructionHTML) / 2-1 FROM bhbatchhis WHERE recordno = '5817'
34
-- Last chunk, reduce buffer size to the nChars remaining IF (@offsetval + @bufferval) > @maxval BEGIN SELECT @bufferval = @maxval - @offsetval --PRINT 'Last chuck... buffer size remaining is:' --PRINT '------' --PRINT @bufferval END WHILE @offsetval < @maxval BEGIN READTEXT bhbatchhis.InstructionHTML @txtptrval @offsetval @bufferval --PRINT 'Data started at character position' --PRINT @offsetval SELECT @offsetval = @offsetval + @bufferval --PRINT 'Data ended at character position' --PRINT @offsetval --PRINT ' ' -- Last chunk, reduce buffer size to the get the last nChars remaining IF (@offsetval + @bufferval) > @maxval SELECT @bufferval = @maxval - @offsetval + 1 END SET NOCOUNT OFF END
4. In the query, edit the WHERE clause to specify the recordno for which you want to view the InstructionHTML. 5. Run the query and save the results to a file name, such as Output.html.
Be sure to specify the .html extension, change the Save as type to All Files (*.*), and change the File Format to ANSI.
35
6. In Windows Explorer, double-click the .html file to view the actual HTML in your browser. SPANISH TRANSLATION
OF
DESCRIPTAPI, EVENTAPI,
AND
PVALUEAPI
On a Spanish Batch system, the following values in the DescriptAPI, EventAPI, and PValueAPI columns are translated into English:
Column DescriptAPI Values Translated into English Unit Procedure Started Operation Started Version Version Date Author Product Code Product Description Class of Instance Recipe Type Area Model File Name Area Model Validated Against Validation Time File Name
36
Column EventAPI
Values Translated into English System Message Recipe Value Report State Change Mode Change Mode Command Recipe Value Change Bind Creation Bind Unbind Recipe Header State Command Prompt Prompt Response COMMENT Event File Name Material Tracking
PValueAPI
RUNNING IDLE COMPLETE STOPPED ABORTED First Available Bind Prompt Bind Beginning of Batch End of Batch
37
4. Select User-defined (End of Batch). 5. In the Executable file box, use the browse button to locate the .exe file. 6. In the Initialization file box, use the browse button to locate the .ini file. 7. Click OK. (See the RSBizWare Batch Administrators Guide for more information on the Server Options dialog box.)
38
What is BatchHistorian?
RSBizWare BatchHistorian extends the capability of RSBizWare Batch and RSBizWare Historian to provide web-based reporting and analysis of batch data. Once the Batch Archiver is configured to store batch data created by RSBizWare Batch to the RSBizWare production database, stored procedures assimilate the data into various tables within the RSBizWare relational database. You can then use the RSBizWare reporting environment to create reports for analysis of batch data. As an add-on to Historian, BatchHistorian shares the same reporting environment as other RSBizWare modules. Reports are authored using the RSBizWare Production Client. BatchHistorian adds a new RSBizWare report object, the Batch Analysis Chart, to the Production Clients report object toolbar. The Production Client allows you to drop report objects onto your report, along with text, graphics, etc., and lets you arrange the objects for the desired layout. Additionally, RSBizWare includes several sample reports that can be used as is or as a basis for creating your own reports. Advanced designers can use the BatchHistorian and BATCHHIS table schema information to further customize their reports. (See Collecting BatchHistorian Data in the BatchHistorian User's Guide for more information.) Users can view reports easily from a web browser such as Microsoft Internet Explorer. Each BatchHistorian server also contains a license for an RSBizWare Historian Server with a specific number of tags. This means that in addition to reporting on batch data created by RSBizWare Batch, process data points can be collected directly from the factory control system and stored in the RSBizWare database for analysis. For more information on BatchHistorian, see the RSBizWare BatchHistorian Users Guide.
39
RSBizWare system Data Source name in the Batch Archiver Setup and specify the BHBatchHis Table name in the Equipment Editor.
All RSBizWare Batch users previously archiving data to a BatchHis Table must perform these steps to ensure proper connectivity and data storage.
1. Open Batch Archiver Setup by selecting Programs > Rockwell Software > RSBizWare > Batch > Archiver Setup from the Windows Start menu. The Select Data Source dialog box displays. 2. Click the Machine Data Source tab. 3. Select the valid RSBizWare Data Source name (DSN). 4. Click OK.
40
you will be using BatchHistorian. If you forgot to select this option during installation, you will need to select the following archiver event filters in the Equipment Editor.
If you are using BatchHistorian with multiple batch servers, special Archiver event filter settings are provided in the BatchHistorian Users Guide.
Response Recipe Header Recipe Parameter Deviation Recipe Value Recipe Value Change Report Parameter Deviation
State Change State Command Unit Bind Unit Creation Bind Unit Unbind
Archiver (Incremental) Maximum Records Per Transaction = 1000 Incremental Period = 5 Minutes
41
The minimum value that can be entered in the Maximum Records Per Transaction field is 0 and the maximum is 10000. However, the maximum number of records that can be successfully archived in a single transaction depends on the capabilities of your computer, and may be significantly less than 10000. If you encounter Time Out messages in the batcharc log, reduce the value in the Maximum Records Per Transaction field. If you enter a value of 0, all records will be committed in a single transaction at the end of the batch.
Archiver (Incremental) Maximum Records Per Transaction = 10 Incremental Period = 1 minute or less.
These values ensure that events are processed, stored, and committed to the database as quickly as possible, making this data available for prompt retrieval.
These settings are a guideline and may vary depending on the number of events generated per batch, the duration of the batch, etc.
42
43
Description Category of the event ID of the event Description of the event File name and line number from the Archivers source code that generated the entry
The following Archiver events can be entered in the Windows event log:
Category Start Start Start Start Start Start Start Start Shutdown Setup Event 1001 1002 1003 1004 1005 1006 3001 3002 4001 5001 Description Batch Archiver Service started successfully in incremental mode Batch Archiver Process started successfully in non-incremental mode Batch Archiver failed to start; see the BATCHARC.LOG file for more information Batch Archiver failed to open the BATCHARC.LOG file Service handler not installed Bad Service Request Batch Archiver Service paused Batch Archiver Service continuing Batch Archiver Service shutting down Batch Archiver setup; new connect string = <new string>
44
INDEX
Index
Symbols
.evt files 1
D
data source 39 database schema 31 types to use 1 database connection string 39 verify 40
A
ADDEVENT execute 21 Archiver database schema 31 running 26 system architecture 2 Archiver event filters for BatchHistorian 40 Archiver service assign user account to 22 enabling 23 archiving end-of-batch 3 incremental 3 non-incremental 3 ArchQue.txt File 29
E
electronic batch records 1 description 5 interpretation examples 5 end-of-batch archiving 3 configuring 24 event filters for Batch 41 for BatchHistorian 40 for MaterialTrack 41 event journal 5 Event Log entries 43 execute ADDEVENT 21
B
Batch event filters 41 Batch Service Manager 26 batcharc.ini file 40 BatchHistorian 10 archiver event filters 40
F
filters for BatchHistorian 40
C
configuring custom archiver 29 end-of-batch archiving 24 incremental archiving 22 optimal record transfer 24 the server 19 creating a data source Oracle 14 SQL 10
I
incremental archiving 3 configuring 22
M
MaterialTrack event filters 41
N
non-incremental archiving 3
O
optimal data access 25 optimal performance configuring Archiver for 24 data access 25 record transfer 24 optimal record transfer 24 optimum data access recommendations for BatchHistorian 42 Oracle database creating a data source 14
S
server configuration 19 service manager 26 SQL database creating a data source 10 system architecture 2 system failure 2
U
user account for Archiver service 22
R
reporting options 19 configuring 19 reporting values for optimal performance SQL Server only 41
W
Windows Event Log 43
vi
INDEX
vii