Home
Lab Work: SCADA, OPC and Database Systems
Contents
1. H gskolen i Telemark Telemark University College Department of Electrical Engineering Information Technology and Cybernetics SCADA OPC and Database Systems HANS PETTER HALVORSEN 2012 08 20 SCADA SYSTEM Process Plant OPC l I Server Database Datalogging System Tag Data Alarms br of Technology Postboks 203 Kj lnes ring 56 N 3901 Porsgrunn Norway Tel 47 35575000 Fax 47 35 57 54 01 Preface In this Lab we will design our own SCADA system from scratch We will use SQL Server to store our Measurement data we get from a MatrikonOPC Server LabVIEW have built in features for communication with OPC We will use LabVIEW to create our GUI HMI As part of the SCADA system we will create an Alarm System as well Go to the following website for more background information about the Lab Work http home hit no hansha lab scada The purpose with this lab is to learn practical issues about the following topics in Industrial IT e SCADA systems e Control Systems e Human machine Interface HMI e Alarm Systems e OPC OPC Servers and OPC Clients e Database Systems such as Microsoft SQL Server e Structured Query Language SQL e Open Database Connectivity ODBC e Programming LabVIEW SQL etc Supervisory Control and Data Acquisition SCADA is an industrial control system monitoring and controlling a process A SCADA system consists of different modules syst
2. 6 Introduction to OPC 2 6 Write OPC Data You use the DataSocket Write VI for reading OPC data Example oc localhost Matrikon GPC Sinulatian Sav btoothed Wawes Intg Use a while loop in order to write to the OPC server continuously Example DakaSoacket Close opci flocalhoskiMatrikan OPC Simulation Saw boothed Waves Int4 G Lab Work SCADA OPC and Database Systems 3Database Communication in LabVIEW Here is a short introduction of how to communicate with a Database in LabVIEW For more information you should read the Tutorial Database Communication in LabVIEW 3 1 ODBC You may want to set up an ODBC Data Source which is a link to your Database system ODBC Data Source Administrator User DSH System DSN File DCH Drivers Tracing Connection Fooling About User Data Sources Driver Add dBASE Files Microsoft Access dBASE Driver dbf ni Excel Files Microsoft Excel Driver vs xlsx elem Remove MS Access Database Microsoft Access Driver TT mdb acedb SOL Server Configure Visio Database Samples Microsoft Access Driver TT mdb acedb K An ODBC User data source stores information about how to connect to the indicated data provider A User data source it only visible to you and can only be used on the current machine 3 2 SQL Toolkit have made a simple and easy to use SQL Toolkit The SQL Toolkit is available for download from the homepage
3. Alarm Configuration amp Alarm Data Important fields in an alarm handling system could be e Alarm id e Activation time e Acknowledge time e Type of alarm e Tag e Alarm limit e Text description e etc Lab Work SCADA OPC and Database Systems Database System 12 Database System The alarm system will be responsible for the warnings and the alarms in a monitoring and control system An alarm system contains different Alarms and Warnings like e Timeout no input from a sensor or another computer system within a specific amount of time e High High HH or Low Low LL alarm a critical alarm condition e High H or Low alarm L e O device errors e System device errors e etc Make sure your alarm tables and system can handle these kinds of alarms and warnings An Alarm System use different Alarm devices such as e Screen display the alarms e Keyboard alarm operations e Horn indicate an active alarm or security alarm e Lamp indicate an active alarm or an active alarm by blinking and an acknowledge alarm by a steady light e Printer logging of the alarm states e SMS e E mail e Etc Make use of one or more of these alarm devices in your Alarm Handling and Management System You should create one or more tables that set up the alarm configuration for a specific tag and one or more tables that store the alarms being generated even if you are not selecting the optional Alarm System task you shou
4. Die Yas Format Into String Bot Lab Work SCADA OPC and Database Systems 4Database System 4 1 Introduction In this Task we will design and create the Database System SCADA System Management System Monitoring System Alarm System Control E Process Plant Datalogging System 4 Database In this Assignment we will use Microsoft SQL Server as a repository for our data We will use Microsoft Visio to design our database system Note When defining your tables and columns so called Pascal notation is recommended i e each word should start with an uppercase e g Tagld item etc You should also avoid using plural and only stick to singular i e use Tag and not use Tags We can divide the tables needed to be created in different parts such as e Tag Configuration e Tag Data e Alarm Configuration e Alarm Data 10 11 e etc Example Tag Configuration The TAG table could e g have the following columns e Tagid int Primary Key Identity e TagName varchar e temld varchar e temUrl varchar e Description varchar e etc Create more tables and columns if necessary Tag Data Create one or more tables used for logging the Tag Values into the Database The following fields are important for an OPC Item e temid e Value e Timestamp e Status e g Active Not Active e Quality e g Good Bad e etc
5. Server Connection Options ee Other Network Computers Open the MatrikonOPC Explorer and connect to the MarikonOPC Server for Simulation MatrikonOPC Explorer continually updates the display for that group with real time data The data values appear in the list view on the right hand side of the OPC Explorer window Each item is listed along with its item ID access path active state value quality and timestamp 2 3 Write Data You may also write data to the OPC server Item ID Access Path Value ualit mi Random Boolean False Good non specific SUar e Waves Int a Good non specific write Values Deactivate Delete Del Export Items Alt Enker Properties v i H Note You cannot write to items that are set to be read only 2 4 OPC Client in LabVIEW Pee eee SE In order to communicate with an OPC server in LabVIEW you use the DataSocket VIs Lab Work SCADA OPC and Database Systems 5 Introduction to OPC cmon Select DataSacket 5 DataGocket O DataSocket cc DataSocket Read You use the DataSocket Read VI for reading OPC data Example DakaSocket Read Use a while loop in order to read the OPC Data continuously Example a DataGocket Open DakaSocket Read DakaSocket Clase op Mlocalhost Matrikon OPC Simulation Random Ink CS S E ae stop fi OE aan m m iE Lab Work SCADA OPC and Database Systems
6. of this lab When you install this toolkit the following palette is available in LabVIEW Database Communication in LabVIEW LO ou Hiem e aq EGL i EGL H EGL iy EGL d y z y SELECT HECUTE CLOSE SOL Open vi SQL Select vw SOL Execute vi SOL Close vi The SQL Toolkit contains the following VIs ZE SQL Open vi This VI open a connection to the database specified in the Connection string The connection string may be as follows SOL T ELECT SQL Select vi This VI get data from the database specified in the SQL Query The output is a D string array with data N l SQL Execute vi This VI executes a Query with no return Data e g an INSERT statement SAL CLOSE EN CSC CO W g SQL Close vi This VI Close the connection to the database opened by SQL Open vi The VIS can be used for both writing data to the database and reading data from the database Below we see some simple examples Reading Data from the Database My ODBC Data source GJ Open vi SOL Close vi Simple Error Handler vi 1 GL Sol i kal SL F SS Zi select from Tag order by TagName Writing Data to the Database Lab Work SCADA OPC and Database Systems Database Communication in LabVIEW My ODBC Data Source SOL Open vi SQL Execute vi SQL Clase vi Simple Error Handler vi SCL SLADA HEGUTE Ren insert into Tag TagWame IkemUrl TagDescriptian Values te
7. a good idea using e g ASP NET and C End of Task Lab Work SCADA OPC and Database Systems Hegskolen i Telemark Telemark University College Faculty of Technology Kj lnes Ring 56 N 3914 Porsgrunn Norway www hit no Hans Petter Halvorsen M Sc Telemark University College Department of Electrical Engineering Information Technology and Cybernetics E mail hans p halvorsen hit no Blog http home hit no hansha m m m
8. ems that together make the SCADA system e g e Database System e Management System e Control System e Datalogging System e Monitoring System e Alarm System e Report System In this assignment we will implement our own SCADA system from scratch in LabVIEW The Database will be created in SQL Server A SCADA system consists of many modules but our main focus will be to create the Database system and to create a simple Control System and Alarm System Table of Contents PCMAG E EE R AA E E causouss E A E A bani E ji MPEP COG EE iv 1 OTON E 1 a E RE 1 1 2 PO CSS DIE EE 2 2 Moda on TO E OPC EE 3 2 1 ViatriKONOPG Simulation SCRV EN sorei en Ee EEEE EEE 3 2 2 Matrikon PG EON CL EEN 3 2 3 WE DAT EE 4 VA OPECI M dn EAD TE 4 2 5 Roa OPC DI E 5 2 6 EE 6 3 Database Communication IN LADVIEW cccccsssssssseccccccceeeesseeccccesseeesseeecccessseeueeeececesssaeaaseeeseess 7 Bid AOD E 7 Be ee E 7 4 EY ACA ASS d BE 10 4 1 OAU oq EN 10 DD KEE 12 E ep BDE VA a 99 ee a eee eee ee eee 12 5 Control amp Dataloggeing Syste A ea aisnies tigen sceateniessbaaiciepceudsn EA E AE E S 13 5 1 HORU O E 13 DZ WSIS EE 13 Take CONTOS y E E E E EEE 13 V Table of Contents TK EIERE ee 15 6 EN ge A i 9 E a oN em ar Oe ee ee 16 6 1 Juttel Leg Le EE 16 DS EN 17 Task 4 Alarm LOeemechces titre eerie iadieen Maine eee 17 IEN de CR EEN 18 Lab Work SCADA OPC and Database Systems LIntroduction 1 1 SCADA In this assign
9. erver Download and use the SQL Toolkit available from the Homepage of this Lab Work SELECT HEGUTE rose SQL Open vi SQL Select vw SOL Execute vi SQL Close vi Note We will use LabVIEW to create this application but if you want an extra challenge you can use e g CH to implement the application End of Task Lab Work SCADA OPC and Database Systems 6Alarm System 6 1 Introduction In this Task we will create an Alarm System The Alarm System checks for Alarms and saves the Alarm information in your Database In addition you should have a User Interface that shows the Alarms SCADA System App 1 Matrikon u Process Wi Control Prue mR OPC App 2 5 SQL Database Datalogging La System gt i Tag Data App 3 i Alarm Alarms System Alarms Hn H L LL Trigger In this task you will create an Alarm Handling System in LabVIEW and use Microsoft SQL Server as the Alarm Repository Please read the Tutorial Database Communication in LabVIEW before you start this task Download and use the SQL Toolkit available from the Homepage of this Lab Work 16 17 Alarm System a SQL Open vi SQL Select vw SOL Execute vi SQL Close vi In this part you will extend your system with Alarm Handling You will need to create a system for logging alarms to a database and systems for viewing an operate on the alarms Sensors In an alarm system the use of col
10. he OPC items Bucket Brigade Real4 and Bucket Brigade Real8 for this PID Control You may want to use e g the built in PID functionality in LabVIEW PID Advanced vi is recommended P D PID Gain Sch PID Output R PID EGU to F PID Percenta Note You don t need to use the real process it is enough using a simulated model in this Task HMI Your HMI should consist of water tanks pumps pipes etc You may want to use the LabVIEW DSC Datalogging and Supervisory Control palette in LabVIEW in order to create your own HMI DSC Module sg Sch 2D Controls 3D Controls ej e Aarm Controls Trend Controls Statistical Pro Alarms Lab Work SCADA OPC and Database Systems 15 Control amp Datalogging System As part of the HMI you should illustrate in the User Interface when the process value is below the alarm limit Low Alarm or the process value is above the alarm limit High Alarm OPC Use the DataSocket VIs in LabVIEW for communication with the OPC Server DaktaSocket Select DataSacket 5 DataSocket O DataSocket C Use the MatrikonOPC Server for Simulation Note We will use LabVIEW to create this application but if you want an extra challenge you can use e g CH to implement the application End of Task Task 3 Datalogging Create a simple application in LabVIEW that reads the values from the OPC Server and store them in the SQL S
11. ld design the tables for the Alarm Handling 4 2 Tasks Task 1 Database System d A Ben NF J HO Design and create your tables for the SCADA system as illustrated above Tip Create a SQL Script that inserts these tables into your database End of Task Lab Work SCADA OPC and Database Systems 5Contro l amp Datalogging System 5 1 Introduction In this Task we will create a Control System using e g the built in PID function in LabVIEW The process data Process Value PV and Manipulated Value MV should be stored in the OPC Server SCADA System Management System Datalogging System Alarm System Control OPC System Server Report System Process Plant 5 2 Tasks Task 2 Control System l Create an Application in LabVIEW that controls the level in the Level Tank or the Temperature in an Air Heater Use standard PI D control 13 14 Control amp Datalogging System gt You need to create a HMI Human Machine Interface for your application gt The process data should be sent to the OPC Server You should write the Control Signal u and the Process Value y to the OPC Server so you need to establish these items in the OPC Server in advance Note Since MatrikonOPC Server for Simulation is just a demo OPC Server you cannot create your own OPC items you have to use on or more of the existing items that comes with the product Tip Use e g t
12. ment we will create a small scale SCADA application SCADA System App 1 Matrikon Process WiL Control App 2 K 8 SQL Database Pa system PZ Tag Data Datalogging App 3 j Trigger Alarm Alarms System Alarms pm H L LL We will focus on creating 3 different systems as shown in the figure The 3 different systems will be 1 Control System 2 Datalogging System 3 Alarm System Note These 3 systems shall be implemented as separate applications that in theory can be running on different computers We will use LabVIEW to create these systems but if you want an extra challenge you can use e g C to implement one or more of these systems 2 Introduction 1 2 Process Plant In this Assignment we will use a mathematical model of either the Level Tank or the Air Heater system Because focus in this assignment is not Data Acquisition we will only use a mathematical model in this assignment Below we see the Lab Equipment available for this assignment Level Tank Air Heater LM 900 LEVEL CONTROL SYSTEM Documents of how to use the Level Tank Air Heater and the USB 6008 DAQ device is available from http home hit no hansha e Level Tank http home hit no hansha equipment leveltank e Air Heater http home hit no hansha equipment airheater e USB 6008 http home hit no hansha equipment usb6008 Lab Work SCADA OPC and Database Systems 2Introduction to OPC Here is a short introduc
13. ors are important so make sure your system use colors according to standards for HMI and SCADA systems 6 2 Tasks Task 4 Alarm Logging Create a system for Alarm Logging and to save these alarms in the database system Tip You could implement Alarm Logging in your SCADA system by using a Database Trigger on the table that stores the Tag Data Start with checking e g Low Alarm process value is below a specified limit and High Alarm process value is above a specified limit Extend the system with more alarm types if you want to End of Task Lab Work SCADA OPC and Database Systems 18 Alarm System Task 5 Alarm List i gg Create an Alarm List application that shows all the alarms in the system The operator should be able to see the alarms and make some actions to these alarms i e the operator should have the possibility to acknowledge alarms The program could look something like this feel free to create your own User Interface gt Alarm System Alarm System vi Front Panel File Edit View Project Operate Tools Window Help weert Jesse i Filter Not Acknowledged v Order By Priority AlarmList L Alarmid TagDatald AlarmConfigId AlarmType Priority AlarmTime Description Acktime AckPerson Note We will use LabVIEW to create this application but if you want an extra challenge you can use e g CH to implement the application Creating the Alarm System as a web application is also
14. tion of how to communicate with OPC in LabVIEW For more information you should read the Tutorial OPC and Real Time Systems in LabVIEW 2 1 MatrikonOPC Simulation Server In this Lab Work you will use the MatrikonOPC Server for Simulation and MatrikonOPC Explorer For more information about this software see the OPC and Real Time Systems in LabVIEW Tutorial Install the software MatrikonOPC Simulation Server if you haven t already done it Link to download page is available from the homepage of this Lab Work Please read the documents available for the MatrikonOPC Server ror A Go through the Quick Start Guides and User Manuals e MatrikonOPC Server for Simulation Quick Start Guide e MatrikonOPC Server for Simulation User Manual e MatrikonOPC Explorer Quick Start Guide e MatrikonOPC Explorer User Manual They are available from the Start menu after the installation of the software 2 2 MatrikonOPC Explorer The MatrikonOPC Explorer is a test tool you can use to get data etc from different OPC Servers 4 Introduction to OPC oe MatrikonOPC Explorer Untitled File Server Group Item view Help S t aUl ep oa we ob gece Matrikon OPC Simulation 1 Localhost Pasza d Matrikon OPC Simulation 1 D M ik OPC Ge National Instruments WIOPCServers i atri on Ge National Instruments OPCFieldPoint 3 E National Instruments variable Engine 1 9 Network Neighborhood DC
Download Pdf Manuals
Related Search
Related Contents
3D Connexion HP XZ200 Owner's Manual 取扱説明書 (6.5MB) SR-888取扱説明書 Samsung WA10V5JEC/XST คู่มือการใช้งาน imprimer NiceLabel Pro Anwenderhandbuch La Lettre N.37 Mars/05 PDF DP-2310/3010/3510/4510/6010 Operating Instructions Copyright © All rights reserved.
Failed to retrieve file