application note Protein Purification Control Software UNICORN MS SQL Server Integration Introduction Market requirements today are focused on solutions that deliver optimal performce in terms of: Time to market Cost efficiency Reliability d high quality Large pharmaceutical production plts contain my components that must work smoothly together. One key element in plt architecture is the information magement strategy. The problem of trsferring the various components into integrated plt becomes obvious when different components speak different lguages. However, if a unified lguage is used trslation becomes unnecessary d efficiency increases. OPC provides this kind of unified communication lguage among modules in a process plt. OPC is a stdard specification that allows data magement from y data source within a production environment. OPC defines a stdard set of interfaces allowing the creation of a client/server model where y OPC client (y application interested in data) c communicate with y OPC server (y application providing data). UNICORN supports the following OPC stdards: Security Data Access (DA) Alarms & Events (A&E) Historical Data Access (HDA) Any OPC client c communicate with y OPC server (local or remote) since the interfaces required for communication are guarteed to be the same for all servers. A local OPC server is a server found on the same machine as the OPC client, a remote OPC server is a server found on a different machine th the OPC client. Objective This application note describes how UNICORN Run Time Data c be viewed d stored to a database by a third party application by using OPC as communication platform. Products used For this application note, we chose the following: A. Terravic Corporation as a vendor for OPC Client. The software used is Visual OPC Test Office Ver 3.0 (VOPCTO) B. Microsoft SQL Server 2000 C. Windows 2000 or 2000 Server Operating System D. UNICORN 4.11 E. ÄKTAFPLC The OPC Client d OPC Server are located in separate PC's. Table 1. shows the setup used for this application note. The PC's communicate via TCP/IP. Table 1. PC 1 PC 2 Visual OPC Test Office ver 3.0 (VOPCTO) MS SQL Server 2000 Win 2000 or 2000 Server OS UNICORN 4.11 with ÄKTAFPLC WIN 2000 OS Implementation In this example VOPCTO is used to read UNICORN data d store them in the MS SQL Server Database. VOPCTO supports both the OPC Data Access d OPC Alarms & Event Servers. Note: This procedure assumes the user is familiar with the VOPCTO program d MS SQL Server 2000 database. 04-0030-59 AA, 2004-04 p1
1 Create Tag d Alarm tables within a Database This step will create two tables that will store UNICORN data. One table for Data d one for Alarms d Events. 1.1 Launch MS SQL, Start Programs Microsoft SQL Server Enterprise Mager. User controls the type of the database, location, d the table name. One table is needed to write tag data d one table is needed to write alarm condition data. The table name is user defined, however, the table field names d data types are not user defined. A SQL files to create SQL Server tag d alarm tables are shown below. No matter which database is used, the tag d alarm tables have predefined structures. Tag Table CREATE TABLE Tags (TagKeyID char(22) PRIMARY KEY, TagItemID char(50), TagAccessPath char(50), TagValue char(255), TagQuality char(50), TagType char(30), TagConical char(30), TagRights char(5), TagTimestamp char(30), TagServer char(100), TagActive char(5)); Alarm Table CREATE TABLE Alarms (AlarmKeyID char(22) PRIMARY KEY, AlarmSource char(50), AlarmTimestamp char(30), AlarmMessage char(255), AlarmCategory char(100), AlarmSeverity char(10), AlarmAttributes char(255), AlarmCondition char(50), AlarmSubcondition char(50), AlarmChgeMask char(255), AlarmNewState char(255), AlarmQuality char(50), AlarmAckReq char(5), AlarmActiveTime char(30), AlarmCookie char(25), AlarmActorID char(100), AlarmServer char(100), AlarmType char(25)); Fig 1. 1.2 Expd (as shown in Figure 1) d right click Table d click New Table. 1.3 Enter the table information as shown in the Tag Table (Fig 2). For this example: The Tag table name is FPLCF300_DATA The Alarm table name is FPLCF300_ALARM The database name is Unicorn_SQL Fig 2. 1.4 Click the save button d type in the file name (FPLCF300_DATA). 1.5 Repeat steps 1.2 to 1.4 for Alarm Table (FPLCF300_ALARM). 04-0030-59 AA, 2004-04 p2
2 Setup ODBC connection in the Control Pel to the Database This step configures Database connectivity so that VOPCTO c access the tables created in Step 1. 2.1 Start Settings Control Pel Administrative Tools. 2.2 Double click Data Sources (ODBC) icon. 2.3 Select System DSN tab, d click Add button. 2.4 Select SQL Server driver from the list, click Finish. 2.5 Enter Unicorn_SQL for Name d select 6938CD641941 (where 6938CD641941 is the name of the computer where SQL server resides) for Server from the drop down list. (Fig 3). Click Next. Fig 4. 3 Configure Database VOPCTO This step configures VOPCTO to select which database to use d the name of the table to which data will be written. 3.1 Launch VOPCTO Program, Start Programs VisualOPCTest Visual OPCTest Office. 3.2 From Main menu, File Options Trsfer tab. 3.3 Type in the information as shown below d click OK. Fig 3. 2.6 Select the following check boxes: With Windows NT Authentication Connect to SQL Server 2.7 Click Next, click Next again. 2.8 Click OK d verify that Unicorn_SQL appear in the Name windows (Fig 4). Click OK to complete the step. Fig 5. 04-0030-59 AA, 2004-04 p3
4 Connect to OPC Server within VOPCTO This step connects VOPCTO to the UNICORN OPC Server (Data Access d Alarm & Events Servers), creates groups, adds tags to groups, d creates event subscriptions. 4.1 From the VOPCTO main menu, click Servers Connect to Server 4.2 Expd REMOTE d navigate to find STATION1 (name of PC where UNICORN OPC Server resides). 4.3 Double click STATION1 to display available OPC Server (Fig 6). Fig 7. 4.8 Type in Group name (example: Group1) d click OK. 4.9 Right click DA1\\STATION1\..., select Browse Server Address Space All. This will list all UNICORN item groups on the lower right windows from which user c select items to be store in database. 4.10 Click the + sign to expd the items. 4.11 Right click the item d select Add Item to Group1. The selected item will now appear on the upper windows (Fig 8). Fig 6. 4.4 Select OpcUNI0.opcDA2ServerS0.1 Connect Server 4.5 Select OpcUNI0.opcAE1ServerS0.1 Connect Server 4.6 The two items selected will appear on the lower left windows: (Fig 7) DA1\\STATION1\ OpcUNI0.opcDA2ServerS0.1 AE1\\STATION1\ OpcUNI0.opcAE1ServerS0.1 4.7 Right click DA1\\STATION1\.., select Add Private Group (Fig 7). Fig 8. 4.12 Repeat for all other items. 4.13 Right click AE1\\STATION1\..., select Create Event Subscription. 04-0030-59 AA, 2004-04 p4
5 Connecting VOPCTO to Database This step connects VOPCTO to the Database (the two tables created in step 1) 5.1 Main menu, Trsfer Tags Database Connect to Tags Database. 5.2 Main menu, Trsfer Alarms Database Connect to Alarms Database. 6 Select Tags to be written to Database This step selects which Data Access items will be written to the Database. 6.1 Click the Tags tab. 6.2 In the Tags View, highlight a tag or multiple tags. 6.3 Main menu, Trsfer Item Database Trsfer Start Item Database Trsfer. 6.4 A circular icon (red or green) with a dot inside will indicate that the tag will be written to the Database. 7 Select Alarm Conditions to be written to Database This step selects which Alarms & Event items will be written to the Database. 7.1 Click the Alarm tab. 7.2 In the Alarms View, highlight on a condition event or multiple condition events. 7.3 From main menu, Trsfer Condition Database Trsfer Start Condition Database Trsfer. 7.4 A C icon (with or without border) with a dash inside will indicate that the condition will be written to the Alarms database. 8 Stop Trsferring data or alarm conditions to Database This step shows how to stop collecting data in Database 8.1 Highlight the items. 8.2 Main menu, Trsfer Item Database Trsfer End Item Database Trsfer (For Data). 8.3 Main menu, Trsfer Condition Database Trsfer End Condition Database Trsfer (For Alarm). Fig 9. For further information: Asia Pacific Tel: +852 2811 8693 Fax: +852 2811 5251 Australasia Tel: +61 2 9899 0999 Fax: +61 2 9899 7511 Austria Tel: 01 57 606 16 19 Fax: 01 57 606 16 27 Belgium Tel: 0800 73 888 Fax: 03 272 1637 Cada Tel: 1 800 463 5800 Fax: 1 800 567 1008 Central, East, South East Europe Tel: +43 1 982 3826 Fax: +43 1 985 8327 Denmark Tel: 45 16 2400 Fax: 45 16 2424 Finld & Baltics Tel: +358 (0)9 512 3940 Fax: +358 (0)9 512 394 39 Frce Tel: 0169 35 67 00 Fax: 0169 41 9677 Germy Tel: 0761 4903 401 Fax: 0761 4903 405 Italy Tel: 02 27322 1 Fax: 02 27302 212 Jap Tel: 81 3 5331 9336 Fax: 81 3 5331 9370 Latin America Tel: +55 11 3933 7300 Fax: +55 11 3933 7306 Middle East d Africa Tel: +30 2 10 96 00 687 Fax: +30 2 10 96 00 693 Netherlds Tel: 0165 580 410 Fax: 0165 580 401 Norway Tel: 2318 5800 Fax: 2318 6800 Portugal Tel: 21 417 7035 Fax: 21 417 3184 Russi & other C.I.S. & N.I.S. Tel: +7 (095) 232 0250,956 1137 Fax: +7 (095) 230 6377 South East Asia Tel: 60 3 8024 2080 Fax: 60 3 8024 2090 Spain Tel: 93 594 49 50 Fax: 93 594 49 55 Sweden Tel: 018 612 19 00 Fax: 018 612 19 10 Switzerld Tel: 0848 8028 12 Fax: 0848 8028 13 UK Tel: 0800 616 928 Fax: 0800 616 927 USA Tel: +1 800 526 3593 Fax: +1 877 295 8102 Licensing information A license for the commercial use of GST gene fusion vectors must be obtained from Chemicon International Incorporated, 28820 Single Oak Drive, Temecula, CA 92590, USA. ÄKTAFPLC d UNICORN are trademarks of Amersham Biosciences Limited. Windows d Microsoft are trademarks of Microsoft Corporation. Amersham d Amersham Biosciences are trademarks of Amersham plc. All goods d services are sold subject to the terms d conditions of sale of the compy within the Amersham Biosciences group that supplies them. A copy of these terms d conditions is available on request. Amersham Biosciences UK Limited, Amersham Place, Little Chalfont, Buckinghamshire HP7 9NA, Engld. Amersham Biosciences AB, Björkgat 30, SE-751 84 Uppsala, Sweden. Amarsham Biosciences Corp., 800 Centennial Avenue, PO Box 1327, Piscataway NJ 08855, USA. Amersham Biosciences Europe GmbH, Munzinger Strasse 9, D-79111 Freiburg, Germy. Amersham Biosciences KK, Sken Bldg. 3-25-1, Hyakunincho Amersham Shinjuku-ku, Tokyo 169-0073, Jap. Amersham plc 2004 All rights reserved. 04-0030-59 AA, 2004-04 p5