Presentation is loading. Please wait.

Presentation is loading. Please wait.

TUTORIAL Ethernet PLC's Improve Oxygen Consumption ISA Expo/2001Houston, Texas Water & Wastewater Industry DivisionTuesday, September 11, 2001 1 Brad.

Similar presentations


Presentation on theme: "TUTORIAL Ethernet PLC's Improve Oxygen Consumption ISA Expo/2001Houston, Texas Water & Wastewater Industry DivisionTuesday, September 11, 2001 1 Brad."— Presentation transcript:

1

2 TUTORIAL Ethernet PLC's Improve Oxygen Consumption ISA Expo/2001Houston, Texas Water & Wastewater Industry DivisionTuesday, September 11, 2001 1 Brad S. Carlberg, P.E. BSC Engineering brad.carlberg@bsc-engineering.com

3 ISA Expo/2001Houston, Texas Water & Wastewater Industry DivisionTuesday, September 11, 2001 2 This tutorial has 5 parts: PART 1:The Anoxic / Oxic Process PART 2A:PLC Programming Basics PART 2B:HMI Programming Basics PART 2C:Excel Spreadsheets & Visual Basic PART3:Conclusions & Acknowledgements PART4:Q & A

4 ISA Expo/2001Houston, Texas Water & Wastewater Industry DivisionTuesday, September 11, 2001 3 TUTORIAL Part 1 The Anoxic / Oxic Process: A “Real-World” Plant Application

5 The Anoxic/Oxic Process Modifications project was commissioned in the Spring of 2001 in Pensacola, Florida. ISA Expo/2001Houston, Texas Water & Wastewater Industry DivisionTuesday, September 11, 2001 4 The Anoxic/Oxic Process The wastewater flows into each of the five parallel anoxic/oxic (A/O) trains (which are each 40’ x 200’ rectangular concrete “pools”) where the oxygen is added and the streams are vigorously mixed to remove the biological nutrients using a mass of microscopic plant and animal life that "eat" the organic solids in the wastewater. The Anoxic/Oxic Process is part of the Secondary Treatment of the municipal sewage. It is here that oxygen is added to the waste stream.

6 ISA Expo/2001Houston, Texas Water & Wastewater Industry DivisionTuesday, September 11, 2001 5 A biological nitrogen cycle (where nitrogen in wastewater is removed by becoming N2 gas) is performed using primary effluent for the influent to the A/O process. It is possible to feed the influent to each of the five trains using the five, respective anoxic mixers, mixers, and surface aerators. The process makes use of an anoxic zone where a biological mass of organisms splits oxygen away from the nitrate molecule. The process releases nitrogen from the treated wastewater. Then in the oxic zones, air bubbles into the mix and is used by the organisms to form a collection of suspended particles or floc which are continuously removed further down the process in the secondary clarifiers. The Nitrogen Cycle

7 Effluent NH 4 -N and NO 3 -N concentrations were formulated with four parameters: ISA Expo/2001Houston, Texas Water & Wastewater Industry DivisionTuesday, September 11, 2001 6  Equivalent ratio of alkalinity to ammonia in influent  Equivalent ratio of alkalinity to substrate to ammonia  Ratio of influent to the anoxic cell  Recycle Ratio We can increase the efficiency of the nitrogen removal by optimizing these factors.

8 ISA Expo/2001Houston, Texas Water & Wastewater Industry DivisionTuesday, September 11, 2001 7 Mixed Liquor RecycleThe anoxic cells are located prior to the oxic cells as shown in the figure below. Nitrates are returned to the anoxic cells from the oxic cells via the mixed liquor recycle line. Train Picture

9 Use of BacteriaThe biological treatment of wastewater is performed by means of different cultures of bacteria that are found everywhere in Nature and are consequently quite harmless. The aim of the Anoxic/Oxic process is to create the best possible living conditions for the special groups of natural bacteria, Nitrifying and Denitrifying Bacteria, which are used to remove NITROGEN from the wastewater. ISA Expo/2001Houston, Texas Water & Wastewater Industry DivisionTuesday, September 11, 2001 8 The purpose of Denitrifying Bacteria is to take up organic matter using the Nitrifying Bacteria’s NITRATE as energy source. This results in GASEOUS NITROGEN, which is completely harmless (78% of the atmosphere consists of nitrogen). Contrary to Nitrifying Bacteria, Denitrifying Bacteria can only work when there is NO FREE OXYGEN present - we call this ANOXIC or ANAEROBIC conditions.

10 The purpose of Nitrifying Bacteria is to convert the content of AMMONIA in the raw wastewater into NITRATE. ISA Expo/2001Houston, Texas Water & Wastewater Industry DivisionTuesday, September 11, 2001 9 Nitrifying Bacteria and Denitrifying Bacteria are in the same aeration basin. Nitrifying Bacteria can only work when there is plenty of oxygen in the wastewater - also referred to as oxic or aerobic conditions. Since Nitrifying Bacteria NEEDS Oxygen and Denitrifying Bacteria DISLIKES Oxygen, Denitrifying Bacteria only acts in the ANOXIC CELLS, and when oxygen is introduced into the wastewater stream in the OXIC CELLS, Nitrifying Bacteria converts ammonia into nitrate to give Denitrifying Bacteria something to work with. The process that is called NITRIFICATION. B ut Nitrifying Bacteria and Denitrifying Bacteria CANNOT work in the same conditions.

11 ISA Expo/2001Houston, Texas Water & Wastewater Industry DivisionTuesday, September 11, 2001 10 Since "fresh" wastewater is continually introduced into the ANOXIC CELLS of each aeration train, the concentration of ammonia is kept high, so that the Denitrifying Bacteria can take up organic matter. The supply of OXYGEN must be closely controlled so that nitrifying bacteria will convert almost all of the AMMONIA in the wastewater. This means that Nitrifying Bacteria can take a well-deserved rest. When the wastewater stream is recycled to the anoxic cell, the Denitrifying Bacteria start taking up organic matter. The Denitrifying Bacteria use the Oxygen in the Nitrate as fuel and instead releases GASEOUS NITROGEN and water. Then as the flow moves on to the OXIC CELLS, oxygen is added to "feed" the Nitrifying Bacteria. In this way the two types of bacteria work together acting on the wastewater stream using the two alternate methods.

12 Factors Effecting Process Performance ISA Expo/2001Houston, Texas Water & Wastewater Industry DivisionTuesday, September 11, 2001 11  Configuration and volume of anoxic and oxic cells  Addition points and proportions of oxygen addition  Supplementation of carbon source (such as methanol) to enhance the denitrification rate  Amount of wastewater treated per day  Water temperature and concentration of the bacteria to the process The factors which influence the process performance of nitrogen removal are:

13 The process incorporates second and third anoxic cells into the treatment scheme in order to meet the effluent limitations using four measured variables: ISA Expo/2001Houston, Texas Water & Wastewater Industry DivisionTuesday, September 11, 2001 12 Biological Oxygen Demand (BOD) Suspended Solids (SS) Total Nitrogen (TN) Total Phosphorous (TP)

14 ISA Expo/2001Houston, Texas Water & Wastewater Industry DivisionTuesday, September 11, 2001 13 The principles of advanced biological treatment are not at all complicated. The balance and sequence of events, however, require perfect control and understanding. Therefore, the plant control functions are performed in the programmable logic controller (PLC) which monitors and controls flows, opens and closes valves, starts and stops pumps and monitors and controls the pump speeds, and communicates with the Human Machine Interface (HMI) process computer.

15 ISA Expo/2001Houston, Texas Water & Wastewater Industry DivisionTuesday, September 11, 2001 14 The HMI allows the operators to view the process in real-time and via past, archived process trends and, when necessary, make process changes. The HMI also allows advanced control and decision-making to be implemented. A local control panel is located adjacent to the aeration basin so that, in the unlikely event of an automated system failure, plant staff can continue the operation with manual process controls.

16 ISA Expo/2001Houston, Texas Water & Wastewater Industry DivisionTuesday, September 11, 2001 15

17 Train Details ISA Expo/2001Houston, Texas Water & Wastewater Industry DivisionTuesday, September 11, 2001 16 Details about a particular Train can be viewed by selecting the Train from the Menu on the bottom of each display. When a specific Train is selected, the specific Train display will be called up and details about the selected Train will be displayed on the new display.

18 ISA Expo/2001Houston, Texas Water & Wastewater Industry DivisionTuesday, September 11, 2001 17 Selecting A Control Level For Oxygen AdditionFor the Oxygen addition in the Anoxic / Oxic Process there is a corresponding touch target (by touching either the valve or the flowmeter) to change control levels on the popup that replaces the menu on the bottom of each display. When one of these touch targets is selected, the popup will appear at the bottom of the display containing the various control levels available for the Oxygen flow control. To change control levels, select the desired control level from the popup. After a control level has been selected the PLC control program will place the flow controller in the appropriate mode and start taking applicable setpoint to the flow controller.

19 ISA Expo/2001Houston, Texas Water & Wastewater Industry DivisionTuesday, September 11, 2001 18

20 ISA Expo/2001Houston, Texas Water & Wastewater Industry DivisionTuesday, September 11, 2001 19 The operator can at any time set the flow controller back to AUTO or MAN or any other mode without having to use the Summary display to take it off control. The PLC control program will not automatically put it back into either Ratio or Cascade. Important Note:

21 Control LevelsThe following control levels are available for Oxygen: ISA Expo/2001Houston, Texas Water & Wastewater Industry DivisionTuesday, September 11, 2001 20 Oxygen Control Levels  Cascade from Cell 3 Dissolved Oxygen probe  Ratio from Discharge flow  Auto/Manual Control

22 ISA Expo/2001Houston, Texas Water & Wastewater Industry DivisionTuesday, September 11, 2001 21 Oxygen Advanced Control Cascade from Dissolved Oxygen The Oxygen addition is controlled by receiving a remote setpoint from the Cell 3 Entrance Dissolved Oxygen signal. Ratio from Discharge flow The PLC control program changes the Oxygen flow setpoint to maintain a constant Train Discharge flow PV. The Train Discharge flow PV is read from the magnetic flow transmitter.

23 ISA Expo/2001Houston, Texas Water & Wastewater Industry DivisionTuesday, September 11, 2001 22

24 ISA Expo/2001Houston, Texas Water & Wastewater Industry DivisionTuesday, September 11, 2001 23

25 ISA Expo/2001Houston, Texas Water & Wastewater Industry DivisionTuesday, September 11, 2001 24

26 ISA Expo/2001Houston, Texas Water & Wastewater Industry DivisionTuesday, September 11, 2001 25

27 The following control levels are available for the Recycle flow: ISA Expo/2001Houston, Texas Water & Wastewater Industry DivisionTuesday, September 11, 2001 26 The PLC control program changes the Recycle flow setpoint to maintain a constant ratio of the Train Discharge flow PV by adjusting the Mixed Liquor Recycle pump speed. The Train Discharge flow PV is read from the magnetic flow transmitter.  Ratio from Discharge flow  Auto-Manual Control

28 ISA Expo/2001Houston, Texas Water & Wastewater Industry DivisionTuesday, September 11, 2001 27

29 ISA Expo/2001Houston, Texas Water & Wastewater Industry DivisionTuesday, September 11, 2001 28

30 The following control levels are available for the PD Blowers:  Timed Mode  Dissolved Oxygen Mode  Manual Mode ISA Expo/2001Houston, Texas Water & Wastewater Industry DivisionTuesday, September 11, 2001 29 In Dissolved Oxygen (DO) Mode, the following control levels are available for the PD Blowers:  Low Dissolved Oxygen point to Start PD Blower  High Dissolved Oxygen point to Stop PD Blower In Timed Mode, he following control levels are available for the PD Blowers:  Minutes to be running  Minutes to be stopped

31 Motor Popup The following information is available for each motor control from the respective motor popup: ISA Expo/2001Houston, Texas Water & Wastewater Industry DivisionTuesday, September 11, 2001 30  Tagname and Description  Start / Stop Pushbutton  Motor Running / Stopped Status Colored (Red / Green) Box  Alarm Reset / Normal Pushbutton  Remote / Local Indication from H-O-A switch in field

32 Aerator Control Motor Popup Like all motors, the following information is available for the Aerator motor control from the motor popup: ISA Expo/2001Houston, Texas Water & Wastewater Industry DivisionTuesday, September 11, 2001 31 Additionally, the Aerators all have popups for the speed control:  Speed Control  Tagname and Description  Start / Stop Pushbutton  Motor Running / Stopped Status Colored (Red / Green) Box  Alarm Reset / Normal Pushbutton  Remote / Local Indication from H-O-A switch in field

33 ISA Expo/2001Houston, Texas Water & Wastewater Industry DivisionTuesday, September 11, 2001 32

34 ISA Expo/2001Houston, Texas Water & Wastewater Industry DivisionTuesday, September 11, 2001 33

35 Motor Popup Surface Aerator Control The following information is available for motor control from the motor popup: ISA Expo/2001Houston, Texas Water & Wastewater Industry DivisionTuesday, September 11, 2001 34  Tagname and Description  Start / Stop Pushbutton  Alarm Reset Pushbutton  Remote / Local Indication from H-O-A switch in field  Speed Control  Dissolved Oxygen High and Low Setpoints

36 ISA Expo/2001Houston, Texas Water & Wastewater Industry DivisionTuesday, September 11, 2001 35

37 ISA Expo/2001Houston, Texas Water & Wastewater Industry DivisionTuesday, September 11, 2001 36

38 ISA Expo/2001Houston, Texas Water & Wastewater Industry DivisionTuesday, September 11, 2001 37

39 Lower Explosive Level (L.E.L.) ISA Expo/2001Houston, Texas Water & Wastewater Industry DivisionTuesday, September 11, 2001 38  Each train has a digital input that tells whether the combustible gas is detected  ALL of the train oxygen supply valves will be CLOSED if ANY train has combustible detected. The following information is available for the Lower Explosive Level (L.E.L.) system:

40 ISA Expo/2001Houston, Texas Water & Wastewater Industry DivisionTuesday, September 11, 2001 39

41 This trend display is used to allow the operators to view the histories of the process values. The trend data can also be saved to a CSV (comma-separated-value) file and archived to the hard drive of the personal computer of the operator console. The data can then be pulled into another program (like Microsoft Excel). Trending ISA Expo/2001Houston, Texas Water & Wastewater Industry DivisionTuesday, September 11, 2001 40

42 ISA Expo/2001Houston, Texas Water & Wastewater Industry DivisionTuesday, September 11, 2001 41

43 The configuration of the human machine interface (HMI) has been done in such a way so that there is a look and feel of a "traditional DCS". The key features are: ISA Expo/2001Houston, Texas Water & Wastewater Industry DivisionTuesday, September 11, 2001 42 Like a DCS  A touch target to call up one of 14 generic popup for each point type that replaces the menu on the bottom of the display for every dynamic item on any graphic display.  Internal point tags (Indirect Analog, Indirect Discrete, IO Message; Memory Discrete, Memory Integer, and Memory Message) are used in the popups instead of "hard-coding" the specific "real-world" tags into an individual popup displays Analog Input, HIC (or Analog Output), PID (or Analog Composite), PID WITH AUTO & CASCADE & RATIO, PID WITH AUTO & RATIO, Digin, Motor Status, DigOut, Motor (or Digital Composite), Motor with ILock and Perm, Numeric, Set Timers, Alarm Detail, and Alarm Tags.

44  A single generic trend display to trend ALL "trendable" (archived) points: Alarm Management ISA Expo/2001Houston, Texas Water & Wastewater Industry DivisionTuesday, September 11, 2001 43 An operator can acknowledge or silence either (a)An individual alarm (b)A page of alarms (c)ALL alarms Alarms can be sorted by (a)Alarm Group (b)Priority (c)Acknowledged or Unacknowledged  A "Distributed Alarm Summary" has been used to give better alarm management tools: Up to eight trend pens on the trend display. The operator picks which values to trend by "clicking" in the center of the trend display. The trend data can be sent to a "comma-separated-value" (CSV) file so that the data can be evaluated on another computer or with another program.

45 ISA Expo/2001Houston, Texas Water & Wastewater Industry DivisionTuesday, September 11, 2001 44

46 The Anoxic/Oxic Process Modifications Control System is designed to monitor, facilitate control, and improve the efficiency of the Anoxic / Oxic Process operation. This paper describes the controls and features associated with this package. ISA Expo/2001Houston, Texas Water & Wastewater Industry DivisionTuesday, September 11, 2001 45 The Control Summary Display provides access to the controls for each of the Treatment Trains. This display is the primary interface to the controls and the display that is most used by the operator. Conclusions

47 ISA Expo/2001Houston, Texas Water & Wastewater Industry DivisionTuesday, September 11, 2001 46 The following control levels are available for Oxygen: 1. Cascade from Dissolved Oxygen 2. Ratio from Discharge flow 3. Auto-Manual Control The following control levels are available for the Recycle flow: 1. Ratio from Discharge flow 2. Auto-Manual Control The following control levels are available for the PD Blowers: 3. Timed Mode 2. Dissolved Oxygen Mode 3. Manual Mode Conclusions

48 ISA Expo/2001Houston, Texas Water & Wastewater Industry DivisionTuesday, September 11, 2001 47 Following the commissioning of the ethernet-based PLC's Oxygen consumption was significantly reduced. The advanced controls allow the operators to leave the process alone and continue to optimally treat the sewage. Conclusions

49 Following the commissioning of the ethernet-based PLC's Anoxic/Oxic Process Modifications Control System, the efficiency of the Anoxic / Oxic Process operation improved and the Oxygen consumption was significantly reduced by implementing Cascade control of Oxygen from the Dissolved Oxygen probes. ISA Expo/2001Houston, Texas Water & Wastewater Industry DivisionTuesday, September 11, 2001 48 Summary The PD Blowers ran in Timed Mode and/or or Dissolved Oxygen Mode to keep the oxygen level in the acceptable range for the anoxic cell allowing the recycle flow to operate optimally. The Mixed Liquor Recycle variable-frequency pumps controlled the flow based on a ratio from Discharge flow allowing the recycle flow to operate optimally. The advanced controls allow the operators to leave the process alone and continue to optimally treat the sewage.

50 The smooth commissioning would not have been possible without the joint efforts of the construction electricians of Total Electric and assistance from Phoenix Construction. In particular, Don Martin, the Total Electric Lead Electrician, Mike Brown, Phoenix Construction Project Manger, and David Glaze, Project Superintendent. Field instrumentation calibration assistance also came from "the IC Doctor", David Chasteen. ISA Expo/2001Houston, Texas Water & Wastewater Industry DivisionTuesday, September 11, 2001 49 Acknowledgements Further, the advanced control of this control system upgrade would not have been used without a concerted effort from the operators, technicians, and engineering staff of the Escambia County Utilities Authority's Main Street Wastewater treatment plant. In particular; Larry Scott, Terry Platz, Carney Hamilton, and Steve Holcomb. Finally, it would not have been possible for me to complete this project without assistance from ABB Instrumentation Systems Project Manager Dan Kennedy.

51 ISA Expo/2001Houston, Texas Water & Wastewater Industry DivisionTuesday, September 11, 2001 50 TUTORIAL Part 2A PLC Programming Basics

52 ISA Expo/2001Houston, Texas Water & Wastewater Industry DivisionTuesday, September 11, 2001 51 Separate parts of the process have been organized into a separate “SECTION” PLC Program Organization Each “SECTION” can be any of the IEC programming types: Ladder (LD) Structured Text (ST) Instruction List (IL) Function Blocks (FB) Sequential Function Charts (SFC)

53 ISA Expo/2001Houston, Texas Water & Wastewater Industry DivisionTuesday, September 11, 2001 52

54 ISA Expo/2001Houston, Texas Water & Wastewater Industry DivisionTuesday, September 11, 2001 53

55 ISA Expo/2001Houston, Texas Water & Wastewater Industry DivisionTuesday, September 11, 2001 54 I/O Map On-Line PLC Diagnostics PLC Status PLC Simulator Ethernet (TCP/IP) Address

56 ISA Expo/2001Houston, Texas Water & Wastewater Industry DivisionTuesday, September 11, 2001 55

57 ISA Expo/2001Houston, Texas Water & Wastewater Industry DivisionTuesday, September 11, 2001 56

58 ISA Expo/2001Houston, Texas Water & Wastewater Industry DivisionTuesday, September 11, 2001 57

59 ISA Expo/2001Houston, Texas Water & Wastewater Industry DivisionTuesday, September 11, 2001 58

60 ISA Expo/2001Houston, Texas Water & Wastewater Industry DivisionTuesday, September 11, 2001 59

61 ISA Expo/2001Houston, Texas Water & Wastewater Industry DivisionTuesday, September 11, 2001 60

62 ISA Expo/2001Houston, Texas Water & Wastewater Industry DivisionTuesday, September 11, 2001 61

63 ISA Expo/2001Houston, Texas Water & Wastewater Industry DivisionTuesday, September 11, 2001 62

64 ISA Expo/2001Houston, Texas Water & Wastewater Industry DivisionTuesday, September 11, 2001 63 Structured Text was used here, NOT Ladder Programming for Motors The PLC DOES NOT CARE, Structured Text Functions EXACTLY the same as Ladder! Use what you’re comfortable with!

65 ISA Expo/2001Houston, Texas Water & Wastewater Industry DivisionTuesday, September 11, 2001 64

66 ISA Expo/2001Houston, Texas Water & Wastewater Industry DivisionTuesday, September 11, 2001 65

67 ISA Expo/2001Houston, Texas Water & Wastewater Industry DivisionTuesday, September 11, 2001 66 IEC Function Blocks Used Here Programming for Analogs & PID

68 ISA Expo/2001Houston, Texas Water & Wastewater Industry DivisionTuesday, September 11, 2001 67

69 ISA Expo/2001Houston, Texas Water & Wastewater Industry DivisionTuesday, September 11, 2001 68

70 ISA Expo/2001Houston, Texas Water & Wastewater Industry DivisionTuesday, September 11, 2001 69

71 ISA Expo/2001Houston, Texas Water & Wastewater Industry DivisionTuesday, September 11, 2001 70

72 ISA Expo/2001Houston, Texas Water & Wastewater Industry DivisionTuesday, September 11, 2001 71

73 ISA Expo/2001Houston, Texas Water & Wastewater Industry DivisionTuesday, September 11, 2001 72 Sequential Function Charts were used here Higher-Level Control SFC’s lend themselves well to (as the name would imply) sequential processes Three Important components in SFC’s: Transitions Steps Jumps The status of the process can be viewed as a flow chart

74 ISA Expo/2001Houston, Texas Water & Wastewater Industry DivisionTuesday, September 11, 2001 73

75 ISA Expo/2001Houston, Texas Water & Wastewater Industry DivisionTuesday, September 11, 2001 74

76 ISA Expo/2001Houston, Texas Water & Wastewater Industry DivisionTuesday, September 11, 2001 75 PLC - HMI Communication A “PLC Heartbeat” is traditionally used to monitor the PLC - HMI Communication; sometimes called a”Watchdog Timer” Call it whatever you want but the PLC & HMI check each other with the PLC turning ON (or OFF) a switch AND then the the HMI turning OFF (or ON) the switch; if either “dies” then that switch doesn’t change state and an alarm alerts the operator.

77 ISA Expo/2001Houston, Texas Water & Wastewater Industry DivisionTuesday, September 11, 2001 76

78 ISA Expo/2001Houston, Texas Water & Wastewater Industry DivisionTuesday, September 11, 2001 77

79 ISA Expo/2001Houston, Texas Water & Wastewater Industry DivisionTuesday, September 11, 2001 78 TUTORIAL Part 2B HMI Programming

80 ISA Expo/2001Houston, Texas Water & Wastewater Industry DivisionTuesday, September 11, 2001 79 Ethernet (TCP/IP) I/O Driver The Ethernet (TCP/IP) I/O Driver allows the HMI to communicate with the PLC (In this case, the driver is called MBENET.EXE) The PLC has an ethernet module in one of the slots that has a “CAT5/RJ-45” receptacle for the ethernet cable The PC running the HMI has an ethernet module (Network Interface Card) in one of its slots that has a “CAT5/RJ-45” receptacle for the ethernet cable

81 ISA Expo/2001Houston, Texas Water & Wastewater Industry DivisionTuesday, September 11, 2001 80

82 ISA Expo/2001Houston, Texas Water & Wastewater Industry DivisionTuesday, September 11, 2001 81 Operator Screens & Popup Displays The display is laid out in 3 sections: Upper -Security & Alarm Window Middle-Main Operator Screens Lower-Menu & Popup Displays

83 ISA Expo/2001Houston, Texas Water & Wastewater Industry DivisionTuesday, September 11, 2001 82

84 ISA Expo/2001Houston, Texas Water & Wastewater Industry DivisionTuesday, September 11, 2001 83 Scripting There are 6 types of “Scripts”: Application Scripts Key Scripts Condition Scripts Data Change Scripts Quick Function Scripts ActiveX Event Scripts

85 ISA Expo/2001Houston, Texas Water & Wastewater Industry DivisionTuesday, September 11, 2001 84

86 ISA Expo/2001Houston, Texas Water & Wastewater Industry DivisionTuesday, September 11, 2001 85 Access Names The “Access Names” Must be configured to allow the PLC - HMI communications. Note that the “Application/Topic” is the same as the I/O Driver! The “computer name” is the name of the PC that the HMI is running on (brad_s_carlberg in this case)!

87 ISA Expo/2001Houston, Texas Water & Wastewater Industry DivisionTuesday, September 11, 2001 86

88 ISA Expo/2001Houston, Texas Water & Wastewater Industry DivisionTuesday, September 11, 2001 87

89 ISA Expo/2001Houston, Texas Water & Wastewater Industry DivisionTuesday, September 11, 2001 88 Indirect Tags “Indirect Tags” were used here to minimize the number of popup displays. This is especially useful in HMI’s with many tags. ONLY 12 popup displays are reused throughout the HMI. This gives the HMI a “DCS-Like” Look & Feel

90 ISA Expo/2001Houston, Texas Water & Wastewater Industry DivisionTuesday, September 11, 2001 89 Popup Display Types The tag point type determines which popup display to use: Analog Input HIC (or Analog Output) PID (or Analog Composite) PID WITH AUTO & CASCADE & RATIO PID WITH AUTO & RATIO Digin Motor Status DigOut Motor (or Digital Composite) Motor with ILock and Perm Numeric Set Timers Alarm Detail Alarm Tags

91 ISA Expo/2001Houston, Texas Water & Wastewater Industry DivisionTuesday, September 11, 2001 90

92 ISA Expo/2001Houston, Texas Water & Wastewater Industry DivisionTuesday, September 11, 2001 91

93 ISA Expo/2001Houston, Texas Water & Wastewater Industry DivisionTuesday, September 11, 2001 92

94 ISA Expo/2001Houston, Texas Water & Wastewater Industry DivisionTuesday, September 11, 2001 93 Bars, Buttons & Sliders By choosing to use indirect tags we complicate the Bar Graphs, Buttons, & Sliders in the popup displays. Different scales need to be used for different engineering unit ranges

95 ISA Expo/2001Houston, Texas Water & Wastewater Industry DivisionTuesday, September 11, 2001 94

96 ISA Expo/2001Houston, Texas Water & Wastewater Industry DivisionTuesday, September 11, 2001 95

97 ISA Expo/2001Houston, Texas Water & Wastewater Industry DivisionTuesday, September 11, 2001 96 Popup Displays The next two pages shows how the individual popup displays use the indirect tags

98 ISA Expo/2001Houston, Texas Water & Wastewater Industry DivisionTuesday, September 11, 2001 97

99 ISA Expo/2001Houston, Texas Water & Wastewater Industry DivisionTuesday, September 11, 2001 98

100 ISA Expo/2001Houston, Texas Water & Wastewater Industry DivisionTuesday, September 11, 2001 99 Adding a “Touch Target” to a Display 2.Tell which tags to use 3.Tell which popup display to call up What kind of point type is it? 3 Steps: 1.Tell which scale to use (if it’s an analog point type)

101 ISA Expo/2001Houston, Texas Water & Wastewater Industry DivisionTuesday, September 11, 2001 100

102 ISA Expo/2001Houston, Texas Water & Wastewater Industry DivisionTuesday, September 11, 2001 101

103 ISA Expo/2001Houston, Texas Water & Wastewater Industry DivisionTuesday, September 11, 2001 102 TUTORIAL Part 2C Excel Spreadsheets & Visual Basic

104 ISA Expo/2001Houston, Texas Water & Wastewater Industry DivisionTuesday, September 11, 2001 103 A “CHEAP & DIRTY” HMI With Excel The 4 key parameters are: To communicate with the PLC: Use \\brad_s_carlberg\mbenet|ANOXIC_OXIC!’plcregister’ Excel uses “peeks” & “pokes” to read from & write to a PLC or HMI To communicate with the HMI: \\brad_s_carlberg\view|Tagname!’tagname’ computer name application topic item

105 ISA Expo/2001Houston, Texas Water & Wastewater Industry DivisionTuesday, September 11, 2001 104

106 ISA Expo/2001Houston, Texas Water & Wastewater Industry DivisionTuesday, September 11, 2001 105

107 ISA Expo/2001Houston, Texas Water & Wastewater Industry DivisionTuesday, September 11, 2001 106

108 ISA Expo/2001Houston, Texas Water & Wastewater Industry DivisionTuesday, September 11, 2001 107

109 ISA Expo/2001Houston, Texas Water & Wastewater Industry DivisionTuesday, September 11, 2001 108 Excel Macros “Request” Macro to read values “Poke” Macro to write values A Sample Excel Macro

110 ISA Expo/2001Houston, Texas Water & Wastewater Industry DivisionTuesday, September 11, 2001109 Sub PokeMacro() MsgBox Application.NetworkTemplatesPath Channel = Application.DDEInitiate(app:="\\brad_s_carlberg\VIEW", topic:="Tagname") 'This opens a DDE channel to View 'Application.DDEPoke Channel, "Temperature1", Worksheets("Sheet1").Range("A1") 'Puts value from R1C1 into Temperature1 'Application.DDEPoke Channel, "DDEReal", Worksheets("Sheet1").Range("A2") 'Puts value from R1C1 into Temperature1 'Application.DDEPoke Channel, "DDEInteger", Worksheets("Sheet1").Range("A3") 'Puts value from R1C1 into Temperature1 Application.DDETerminate Channel 'This terminates the DDE channel End Sub Sub RequestMacro() Channel = Application.DDEInitiate(app:="\\brad_s_carlberg\VIEW", topic:="Tagname") 'This opens a DDE channel to View Worksheets("Sheet1").Range("C4") = Application.DDERequest(Channel, "$Hour") Worksheets("Sheet1").Range("C5") = Application.DDERequest(Channel, "$Minute") Worksheets("Sheet1").Range("C6") = Application.DDERequest(Channel, "$Second") Worksheets("Sheet1").Range("C9") = Application.DDERequest(Channel, "$day") Worksheets("Sheet1").Range("C10") = Application.DDERequest(Channel, "$date") Worksheets("Sheet1").Range("C11") = Application.DDERequest(Channel, "$datestring") Worksheets("Sheet1").Range("C12") = Application.DDERequest(Channel, "$datetime") Worksheets("Sheet1").Range("C13") = Application.DDERequest(Channel, "$date") Worksheets("Sheet1").Range("C14") = Application.DDERequest(Channel, "$month") Worksheets("Sheet1").Range("C15") = Application.DDERequest(Channel, "$year") Worksheets("Sheet1").Range("C16") = Application.DDERequest(Channel, "$time") Worksheets("Sheet1").Range("C17") = Application.DDERequest(Channel, "$timestring") Worksheets("Sheet1").Range("C18") = Application.DDERequest(Channel, "$applicationversion") Worksheets("Sheet1").Range("C19") = Application.DDERequest(Channel, "$startddeconversations") Worksheets("Sheet1").Range("C20") = Application.DDERequest(Channel, "$accesslevel") Worksheets("Sheet1").Range("C21") = Application.DDERequest(Channel, "$alarmlogging") Worksheets("Sheet1").Range("C22") = Application.DDERequest(Channel, "$applicationchanged") Worksheets("Sheet1").Range("C23") = Application.DDERequest(Channel, "$configureusers") Worksheets("Sheet1").Range("C24") = Application.DDERequest(Channel, "$changepassword") Worksheets("Sheet1").Range("C25") = Application.DDERequest(Channel, "$InactivityTimeout") Worksheets("Sheet1").Range("C26") = Application.DDERequest(Channel, "$InactivityWarning") Worksheets("Sheet1").Range("C27") = Application.DDERequest(Channel, "$LogicRunning") Worksheets("Sheet1").Range("C28") = Application.DDERequest(Channel, "$OperatorEntered") Worksheets("Sheet1").Range("C29") = Application.DDERequest(Channel, "$Operator") Worksheets("Sheet1").Range("C30") = Application.DDERequest(Channel, "$PasswordEntered") Application.DDETerminate Channel 'This terminates the DDE channel End Sub

111 ISA Expo/2001Houston, Texas Water & Wastewater Industry DivisionTuesday, September 11, 2001 110 Visual Basic “Roll Your Own” HMI - Much More powerful than Excel Key Parameters: \\computer name\application|topic!item I/O Emulator - MBPlusSimulate.exe Can “Read From” & “Write To” PLC and/or HMI

112 ISA Expo/2001Houston, Texas Water & Wastewater Industry DivisionTuesday, September 11, 2001111

113 ISA Expo/2001Houston, Texas Water & Wastewater Industry DivisionTuesday, September 11, 2001112

114 ISA Expo/2001Houston, Texas Water & Wastewater Industry DivisionTuesday, September 11, 2001113 Dim PauseTime, Start, Finish, TotalTime As Integer ' Declare variables Private Sub txtAIT_332A_SCALED_Change() On Error GoTo PokeAIT_332AError txtAIT_332A_SCALED.LinkMode = 0 PauseTime = 1000 ' Set duration. Start = Timer ' Set start time. Do While Timer < Start + PauseTime txtAIT_332A_SCALED.Text = Int((3 * Rnd) + 20) ' Generate random value between 20 and 23. txtAIT_332A_SCALED.LinkTopic = "\\brad_s_carlberg\View|Tagname" txtAIT_332A_SCALED.LinkItem = "AIT_332A_SCALED" txtAIT_332A_SCALED.LinkMode = 2 txtAIT_332A_SCALED.LinkPoke txtAIT_332A_SCALED.LinkMode = 0 DoEvents ' Yield to other processes. Loop Finish = Timer ' Set end time. TotalTime = Finish - Start ' Calculate total time. PokeAIT_332AError: Select Case Err Case 282 MsgBox "Foreign Application " & txtAIT_332A_SCALED.LinkTopic & " did not respond to a DDE initiate" Case 286 MsgBox "Timeout waiting for a response" Case 292 MsgBox "DDE conversation closed or changed" Case 293 MsgBox "DDE method attempted without DDE channel open" Case 297 MsgBox "Can't set LinkMode; invalid link topic" Case Else End Select Resume Next End Sub

115 ISA Expo/2001Houston, Texas Water & Wastewater Industry DivisionTuesday, September 11, 2001114 Private Sub txtAIT_346A_SCALED_Change() On Error GoTo PokeAIT_346AError txtAIT_346A_SCALED.LinkMode = 0 PauseTime = 1000 ' Set duration. Start = Timer ' Set start time. Do While Timer < Start + PauseTime txtAIT_346A_SCALED.Text = Int((3 * Rnd) + 15) ' Generate random value between 15 and 18. txtAIT_346A_SCALED.LinkTopic = "\\brad_s_carlberg\View|Tagname" txtAIT_346A_SCALED.LinkItem = "AIT_346A_SCALED" txtAIT_346A_SCALED.LinkMode = 2 txtAIT_346A_SCALED.LinkPoke txtAIT_346A_SCALED.LinkMode = 0 DoEvents ' Yield to other processes. Loop Finish = Timer ' Set end time. TotalTime = Finish - Start ' Calculate total time. PokeAIT_346AError: Select Case Err Case 282 MsgBox "Foreign Application " & txtAIT_346A_SCALED.LinkTopic & " did not respond to a DDE initiate" Case 286 MsgBox "Timeout waiting for a response" Case 292 MsgBox "DDE conversation closed or changed" Case 293 MsgBox "DDE method attempted without DDE channel open" Case 297 MsgBox "Can't set LinkMode; invalid link topic" Case Else End Select Resume Next End Sub

116 ISA Expo/2001Houston, Texas Water & Wastewater Industry DivisionTuesday, September 11, 2001115 Private Sub txtFIT_321A_SCALED_Change() On Error GoTo PokeFIT_321AError txtFIT_321A_SCALED.LinkMode = 0 PauseTime = 1000 ' Set duration. Start = Timer ' Set start time. Do While Timer < Start + PauseTime txtFIT_321A_SCALED.Text = Int((10 * Rnd) + 120) ' Generate random value between 120 and 130. txtFIT_321A_SCALED.LinkTopic = "\\brad_s_carlberg\View|Tagname" txtFIT_321A_SCALED.LinkItem = "FIT_321A_SCALED" txtFIT_321A_SCALED.LinkMode = 2 txtFIT_321A_SCALED.LinkPoke txtFIT_321A_SCALED.LinkMode = 0 DoEvents ' Yield to other processes. Loop Finish = Timer ' Set end time. TotalTime = Finish - Start ' Calculate total time. PokeFIT_321AError: Select Case Err Case 282 MsgBox "Foreign Application " & txtFIT_321A_SCALED.LinkTopic & " did not respond to a DDE initiate" Case 286 MsgBox "Timeout waiting for a response" Case 292 MsgBox "DDE conversation closed or changed" Case 293 MsgBox "DDE method attempted without DDE channel open" Case 297 MsgBox "Can't set LinkMode; invalid link topic" Case Else End Select Resume Next End Sub

117 ISA Expo/2001Houston, Texas Water & Wastewater Industry DivisionTuesday, September 11, 2001116 Private Sub txtFIT_341A_SCALED_Change() On Error GoTo PokeFIT_341AError txtFIT_341A_SCALED.LinkMode = 0 PauseTime = 1000 ' Set duration. Start = Timer ' Set start time. Do While Timer < Start + PauseTime txtFIT_341A_SCALED.Text = Int((3 * Rnd) + 18) ' Generate random value between 18 and 21. txtFIT_341A_SCALED.LinkTopic = "\\brad_s_carlberg\View|Tagname" txtFIT_341A_SCALED.LinkItem = "FIT_341A_SCALED" txtFIT_341A_SCALED.LinkMode = 2 txtFIT_341A_SCALED.LinkPoke txtFIT_341A_SCALED.LinkMode = 0 DoEvents ' Yield to other processes. Loop Finish = Timer ' Set end time. TotalTime = Finish - Start ' Calculate total time. PokeFIT_341AError: Select Case Err Case 282 MsgBox "Foreign Application " & txtFIT_341A_SCALED.LinkTopic & " did not respond to a DDE initiate" Case 286 MsgBox "Timeout waiting for a response" Case 292 MsgBox "DDE conversation closed or changed" Case 293 MsgBox "DDE method attempted without DDE channel open" Case 297 MsgBox "Can't set LinkMode; invalid link topic" Case Else End Select Resume Next End Sub

118 ISA Expo/2001Houston, Texas Water & Wastewater Industry DivisionTuesday, September 11, 2001117 Private Sub txtFIT_343A_SCALED_Change() On Error GoTo PokeFIT_343AError txtFIT_343A_SCALED.LinkMode = 0 PauseTime = 1000 ' Set duration. Start = Timer ' Set start time. Do While Timer < Start + PauseTime txtFIT_343A_SCALED.Text = Int((1 * Rnd) + 3) ' Generate random value between 3 and 4. txtFIT_343A_SCALED.LinkTopic = "\\brad_s_carlberg\View|Tagname" txtFIT_343A_SCALED.LinkItem = "FIT_343A_SCALED" txtFIT_343A_SCALED.LinkMode = 2 txtFIT_343A_SCALED.LinkPoke txtFIT_343A_SCALED.LinkMode = 0 DoEvents ' Yield to other processes. Loop Finish = Timer ' Set end time. TotalTime = Finish - Start ' Calculate total time. PokeFIT_343AError: Select Case Err Case 282 MsgBox "Foreign Application " & txtFIT_343A_SCALED.LinkTopic & " did not respond to a DDE initiate" Case 286 MsgBox "Timeout waiting for a response" Case 292 MsgBox "DDE conversation closed or changed" Case 293 MsgBox "DDE method attempted without DDE channel open" Case 297 MsgBox "Can't set LinkMode; invalid link topic" Case Else End Select Resume Next End Sub

119 ISA Expo/2001Houston, Texas Water & Wastewater Industry DivisionTuesday, September 11, 2001118 TUTORIAL Part 4 Questions & Answers


Download ppt "TUTORIAL Ethernet PLC's Improve Oxygen Consumption ISA Expo/2001Houston, Texas Water & Wastewater Industry DivisionTuesday, September 11, 2001 1 Brad."

Similar presentations


Ads by Google