TUTORIAL Ethernet PLC's Improve Oxygen Consumption ISA Expo/2001Houston, Texas Water & Wastewater...

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

Transcript of TUTORIAL Ethernet PLC's Improve Oxygen Consumption ISA Expo/2001Houston, Texas Water & Wastewater...

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

TUTORIAL

Ethernet PLCs ImproveOxygen Consumption

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 1

Brad S Carlberg PE

BSC Engineering

bradcarlbergbsc-engineeringcom

>

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 2

This tutorial has 5 partsPART 1 The Anoxic Oxic Process

PART 2A PLC Programming Basics

PART 2B HMI Programming Basics

PART 2C Excel Spreadsheets amp Visual Basic

PART3 Conclusions amp Acknowledgements

PART4 Q amp A

>
>

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 3

TUTORIAL

Part 1

The Anoxic Oxic Process

A ldquoReal-Worldrdquo Plant Application

The AnoxicOxic Process Modifications project was commissioned in the Spring of 2001 in Pensacola Florida

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 4

The AnoxicOxic Process

The wastewater flows into each of the five parallel anoxicoxic (AO) trains (which are each 40rsquo x 200rsquo rectangular concrete ldquopoolsrdquo) 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 AnoxicOxic Process is part of the Secondary Treatment of the municipal sewage It is here that oxygen is added to the waste stream

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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 AO 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

Effluent NH4-N and NO3-N concentrations were formulated with four parameters

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 6

middot Equivalent ratio of alkalinity to ammonia in influent

middot Equivalent ratio of alkalinity to substrate to ammonia

middot Ratio of influent to the anoxic cellmiddot Recycle Ratio

We can increase the efficiency of the nitrogen removal by optimizing these factors

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 7

Mixed Liquor Recycle The 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

Use of Bacteria The 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 AnoxicOxic 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 Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 8

The purpose of Denitrifying Bacteria is to take up organic matter using the Nitrifying Bacteriarsquos 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

The purpose of Nitrifying Bacteria is to convert the content of AMMONIA in the raw wastewater into NITRATE

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

But Nitrifying Bacteria and Denitrifying Bacteria CANNOT work in the same conditions

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

Factors Effecting Process Performance

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 11

middot Configuration and volume of anoxic and oxic cells

middot Addition points and proportions of oxygen addition

middot Supplementation of carbon source (such as methanol) to enhance the denitrification rate

middot Amount of wastewater treated per day

middot Water temperature and concentration of the bacteria to the process

The factors which influence the process performance of nitrogen removal are

The process incorporates second and third anoxic cells into the treatment scheme in order to meet the effluent limitations using four measured variables

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 12

Biological Oxygen Demand (BOD)

Suspended Solids (SS)

Total Nitrogen (TN)

Total Phosphorous (TP)

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 15

Train Details

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 17

Selecting A Control Level For Oxygen Addition For 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 18

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

Control Levels The following control levels are available for Oxygen

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 20

Oxygen Control Levels

Cascade from Cell 3 Dissolved Oxygen probe

Ratio from Discharge flow

AutoManual Control

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 22

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 23

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 24

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 25

The following control levels are available for the Recycle flow

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 27

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 28

The following control levels are available for the PD Blowers Timed Mode

Dissolved Oxygen Mode

Manual Mode

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

Motor Popup

The following information is available for each motor control from the respective motor popup

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

Aerator Control Motor Popup

Like all motors the following information is available for the Aerator motor control from the motor popup

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 32

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 33

Motor Popup Surface Aerator Control

The following information is available for motor control from the motor popup

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 35

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 36

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 37

Lower Explosive Level (LEL)

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 38

Each train has a digital input that tells whether thecombustible 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 (LEL) system

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 39

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 Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 40

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 41

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 Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 42

Like a DCS

middot 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

middot 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 amp CASCADE amp RATIO PID WITH AUTO amp RATIO Digin Motor Status DigOut Motor (or Digital Composite) Motor with ILock and Perm Numeric Set Timers Alarm Detail and Alarm Tags

middot A single generic trend display to trend ALL trendable (archived) points

Alarm Management

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

middot A Distributed Alarm Summary has been used to give better alarm management tools

bull Up to eight trend pens on the trend display

bull The operator picks which values to trend by clicking in the center of the trend

display

bull 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 44

The AnoxicOxic 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 Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 46

The following control levels are available for Oxygen1 Cascade from Dissolved Oxygen

2 Ratio from Discharge flow3 Auto-Manual Control

The following control levels are available for the Recycle flow1 Ratio from Discharge flow

2 Auto-Manual Control

The following control levels are available for the PD Blowers3 Timed Mode

2 Dissolved Oxygen Mode3 Manual Mode

Conclusions

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 47

Following the commissioning of the ethernet-based PLCs Oxygen consumption was significantly reduced

The advanced controls allow the operators to leave the process alone and continue to optimally treat the sewage

Conclusions

Following the commissioning of the ethernet-based PLCs AnoxicOxic 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 Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 48

Summary

The PD Blowers ran in Timed Mode andor 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

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 Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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 Authoritys 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 50

TUTORIAL

Part 2A

PLC Programming Basics

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 51

Separate parts of the process have been organized into a separate ldquoSECTIONrdquo

PLC Program Organization

Each ldquoSECTIONrdquo can be any of the IEC programming types

bull Ladder (LD)bull Structured Text (ST)

bull Instruction List (IL)

bull Function Blocks (FB)bull Sequential Function Charts (SFC)

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 52

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 53

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 54

IO Map

On-Line PLC Diagnostics

PLC Status

PLC Simulator

Ethernet (TCPIP) Address

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 55

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 56

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 57

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 58

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 59

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 60

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 61

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 62

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 63

Structured Text was used hereNOT Ladder

Programming for Motors

The PLC DOES NOT CAREStructured Text Functions EXACTLY

the same as LadderUse what yoursquore comfortable with

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 64

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 65

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 66

IEC Function Blocks Used Here

Programming for Analogs amp PID

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 67

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 68

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 69

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 70

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 71

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 72

Sequential Function Charts were used here

Higher-Level Control

bull SFCrsquos lend themselves well to (as the name would imply) sequential processes

bull Three Important components in SFCrsquosbull Transitionsbull Stepsbull Jumps

bull The status of the process can be viewed as a flow chart

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 73

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 74

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 75

PLC - HMI Communication

A ldquoPLC Heartbeatrdquo is traditionally used to monitor the PLC - HMI Communication sometimes called ardquoWatchdog Timerrdquo

Call it whatever you want but the PLC amp 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 ldquodiesrdquo then that switch doesnrsquot change state and an alarm alerts the operator

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 76

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 77

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 78

TUTORIAL

Part 2B

HMI Programming

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 79

Ethernet (TCPIP) IO Driver

The Ethernet (TCPIP) IO Driver allows the HMI to communicate with the PLC (In this case the driver is called MBENETEXE)

The PLC has an ethernet module in one of the slots that has a ldquoCAT5RJ-45rdquo 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 ldquoCAT5RJ-45rdquo receptacle for the ethernet cable

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 80

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 81

Operator Screens amp Popup Displays

The display is laid out in 3 sections

bull Upper - Security amp Alarm Windowbull Middle- Main Operator Screens bull Lower - Menu amp Popup Displays

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 82

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 83

Scripting

There are 6 types of ldquoScriptsrdquobull Application Scriptsbull Key Scriptsbull Condition Scriptsbull Data Change Scriptsbull Quick Function Scriptsbull ActiveX Event Scripts

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 84

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 85

Access Names

The ldquoAccess Namesrdquo Must be configured to allow the PLC - HMI communications

Note that the ldquoApplicationTopicrdquo is the same as the IO Driver

The ldquocomputer namerdquo is the name of the PC that the HMI is running on (brad_s_carlberg in this case)

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 86

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 87

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 88

Indirect Tags

ldquoIndirect Tagsrdquo were used here to minimize the number of popup displays

This is especially useful in HMIrsquos with many tags

ONLY 12 popup displays are reused throughout the HMI

This gives the HMI a ldquoDCS-Likerdquo Look amp Feel

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 89

Popup Display TypesThe tag point type determines which popup display to use

Analog InputHIC (or Analog Output)PID (or Analog Composite)

bull PID WITH AUTO amp CASCADE amp RATIObull PID WITH AUTO amp RATIO

Diginbull Motor Status

DigOutMotor (or Digital Composite)

bull Motor with ILock and PermNumericSet TimersAlarm DetailAlarm Tags

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 90

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 91

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 92

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 93

Bars Buttons amp Sliders

By choosing to use indirect tags we complicate the Bar Graphs Buttons amp Sliders in the popup displays

Different scales need to be used for different engineering unit ranges

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 94

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 95

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 96

Popup Displays

The next two pages shows how the individual popup displays use the indirect tags

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 97

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 98

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 99

Adding a ldquoTouch Targetrdquo to a Display

2 Tell which tags to use

3 Tell which popup display to call upWhat kind of point type is it

3 Steps1 Tell which scale to use (if itrsquos an analog point type)

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 100

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 101

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 102

TUTORIAL

Part 2C

Excel Spreadsheets

amp

Visual Basic

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 103

A ldquoCHEAP amp DIRTYrdquo HMI With Excel

The 4 key parameters are

To communicate with the PLCUse brad_s_carlbergmbenet|ANOXIC_OXICrsquoplcregisterrsquo

Excel uses ldquopeeksrdquo amp ldquopokesrdquo to read from amp write to a PLC or HMI

To communicate with the HMIbrad_s_carlbergview|Tagnamersquotagnamersquo

bull computer namebull applicationbull topicbull item

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 104

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 105

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 106

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 107

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 108

Excel Macros

bull ldquoRequestrdquo Macro to read values

bull ldquoPokerdquo Macro to write values

bull A Sample Excel Macro

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 109

Sub PokeMacro()MsgBox ApplicationNetworkTemplatesPathChannel = ApplicationDDEInitiate(app=brad_s_carlbergVIEW topic=Tagname) This opens a DDE channel to ViewApplicationDDEPoke Channel Temperature1 Worksheets(Sheet1)Range(A1) Puts value from R1C1 into Temperature1ApplicationDDEPoke Channel DDEReal Worksheets(Sheet1)Range(A2) Puts value from R1C1 into Temperature1ApplicationDDEPoke Channel DDEInteger Worksheets(Sheet1)Range(A3) Puts value from R1C1 into Temperature1ApplicationDDETerminate Channel This terminates the DDE channelEnd SubSub RequestMacro()Channel = ApplicationDDEInitiate(app=brad_s_carlbergVIEW topic=Tagname) This opens a DDE channel to ViewWorksheets(Sheet1)Range(C4) = ApplicationDDERequest(Channel $Hour)Worksheets(Sheet1)Range(C5) = ApplicationDDERequest(Channel $Minute)Worksheets(Sheet1)Range(C6) = ApplicationDDERequest(Channel $Second)Worksheets(Sheet1)Range(C9) = ApplicationDDERequest(Channel $day)Worksheets(Sheet1)Range(C10) = ApplicationDDERequest(Channel $date)Worksheets(Sheet1)Range(C11) = ApplicationDDERequest(Channel $datestring)Worksheets(Sheet1)Range(C12) = ApplicationDDERequest(Channel $datetime)Worksheets(Sheet1)Range(C13) = ApplicationDDERequest(Channel $date)Worksheets(Sheet1)Range(C14) = ApplicationDDERequest(Channel $month)Worksheets(Sheet1)Range(C15) = ApplicationDDERequest(Channel $year)Worksheets(Sheet1)Range(C16) = ApplicationDDERequest(Channel $time)Worksheets(Sheet1)Range(C17) = ApplicationDDERequest(Channel $timestring)Worksheets(Sheet1)Range(C18) = ApplicationDDERequest(Channel $applicationversion)Worksheets(Sheet1)Range(C19) = ApplicationDDERequest(Channel $startddeconversations)Worksheets(Sheet1)Range(C20) = ApplicationDDERequest(Channel $accesslevel)Worksheets(Sheet1)Range(C21) = ApplicationDDERequest(Channel $alarmlogging)Worksheets(Sheet1)Range(C22) = ApplicationDDERequest(Channel $applicationchanged)Worksheets(Sheet1)Range(C23) = ApplicationDDERequest(Channel $configureusers)Worksheets(Sheet1)Range(C24) = ApplicationDDERequest(Channel $changepassword)Worksheets(Sheet1)Range(C25) = ApplicationDDERequest(Channel $InactivityTimeout)Worksheets(Sheet1)Range(C26) = ApplicationDDERequest(Channel $InactivityWarning)Worksheets(Sheet1)Range(C27) = ApplicationDDERequest(Channel $LogicRunning)Worksheets(Sheet1)Range(C28) = ApplicationDDERequest(Channel $OperatorEntered)Worksheets(Sheet1)Range(C29) = ApplicationDDERequest(Channel $Operator)Worksheets(Sheet1)Range(C30) = ApplicationDDERequest(Channel $PasswordEntered)ApplicationDDETerminate Channel This terminates the DDE channelEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 110

Visual Basic

ldquoRoll Your Ownrdquo HMI - Much More powerful than Excel

Key Parameters computer nameapplication|topicitem

IO Emulator - MBPlusSimulateexe

Can ldquoRead Fromrdquo amp ldquoWrite Tordquo PLC andor HMI

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 111

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 112

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 113

Dim PauseTime Start Finish TotalTime As Integer Declare variables

Private Sub txtAIT_332A_SCALED_Change()On Error GoTo PokeAIT_332AErrortxtAIT_332A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtAIT_332A_SCALEDText = Int((3 Rnd) + 20) Generate random value between 20 and 23txtAIT_332A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtAIT_332A_SCALEDLinkItem = AIT_332A_SCALEDtxtAIT_332A_SCALEDLinkMode = 2txtAIT_332A_SCALEDLinkPoketxtAIT_332A_SCALEDLinkMode = 0 DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total time

PokeAIT_332AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtAIT_332A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 114

Private Sub txtAIT_346A_SCALED_Change()On Error GoTo PokeAIT_346AErrortxtAIT_346A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtAIT_346A_SCALEDText = Int((3 Rnd) + 15) Generate random value between 15 and 18txtAIT_346A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtAIT_346A_SCALEDLinkItem = AIT_346A_SCALEDtxtAIT_346A_SCALEDLinkMode = 2txtAIT_346A_SCALEDLinkPoketxtAIT_346A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeAIT_346AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtAIT_346A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 115

Private Sub txtFIT_321A_SCALED_Change()On Error GoTo PokeFIT_321AErrortxtFIT_321A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtFIT_321A_SCALEDText = Int((10 Rnd) + 120) Generate random value between 120 and 130txtFIT_321A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_321A_SCALEDLinkItem = FIT_321A_SCALEDtxtFIT_321A_SCALEDLinkMode = 2txtFIT_321A_SCALEDLinkPoketxtFIT_321A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total time

PokeFIT_321AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_321A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume Next

End Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 116

Private Sub txtFIT_341A_SCALED_Change()On Error GoTo PokeFIT_341AErrortxtFIT_341A_SCALEDLinkMode = 0 PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTime

txtFIT_341A_SCALEDText = Int((3 Rnd) + 18) Generate random value between 18 and 21

txtFIT_341A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_341A_SCALEDLinkItem = FIT_341A_SCALEDtxtFIT_341A_SCALEDLinkMode = 2txtFIT_341A_SCALEDLinkPoketxtFIT_341A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeFIT_341AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_341A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 117

Private Sub txtFIT_343A_SCALED_Change()On Error GoTo PokeFIT_343AErrortxtFIT_343A_SCALEDLinkMode = 0 PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTime

txtFIT_343A_SCALEDText = Int((1 Rnd) + 3) Generate random value between 3 and 4

txtFIT_343A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_343A_SCALEDLinkItem = FIT_343A_SCALEDtxtFIT_343A_SCALEDLinkMode = 2txtFIT_343A_SCALEDLinkPoketxtFIT_343A_SCALEDLinkMode = 0 DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeFIT_343AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_343A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 118

TUTORIAL

Part 4

Questions

amp

Answers

  • Slide 1
  • Slide 2
  • Slide 3
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Slide 8
  • Slide 9
  • Slide 10
  • Slide 11
  • Slide 12
  • Slide 13
  • Slide 14
  • Slide 15
  • Slide 16
  • Slide 17
  • Slide 18
  • Slide 19
  • Slide 20
  • Slide 21
  • Slide 22
  • Slide 23
  • Slide 24
  • Slide 25
  • Slide 26
  • Slide 27
  • Slide 28
  • Slide 29
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
  • Slide 34
  • Slide 35
  • Slide 36
  • Slide 37
  • Slide 38
  • Slide 39
  • Slide 40
  • Slide 41
  • Slide 42
  • Slide 43
  • Slide 44
  • Slide 45
  • Slide 46
  • Slide 47
  • Slide 48
  • Slide 49
  • Slide 50
  • Slide 51
  • Slide 52
  • Slide 53
  • Slide 54
  • Slide 55
  • Slide 56
  • Slide 57
  • Slide 58
  • Slide 59
  • Slide 60
  • Slide 61
  • Slide 62
  • Slide 63
  • Slide 64
  • Slide 65
  • Slide 66
  • Slide 67
  • Slide 68
  • Slide 69
  • Slide 70
  • Slide 71
  • Slide 72
  • Slide 73
  • Slide 74
  • Slide 75
  • Slide 76
  • Slide 77
  • Slide 78
  • Slide 79
  • Slide 80
  • Slide 81
  • Slide 82
  • Slide 83
  • Slide 84
  • Slide 85
  • Slide 86
  • Slide 87
  • Slide 88
  • Slide 89
  • Slide 90
  • Slide 91
  • Slide 92
  • Slide 93
  • Slide 94
  • Slide 95
  • Slide 96
  • Slide 97
  • Slide 98
  • Slide 99
  • Slide 100
  • Slide 101
  • Slide 102
  • Slide 103
  • Slide 104
  • Slide 105
  • Slide 106
  • Slide 107
  • Slide 108
  • Slide 109
  • Slide 110
  • Slide 111
  • Slide 112
  • Slide 113
  • Slide 114
  • Slide 115
  • Slide 116
  • Slide 117
  • Slide 118
Page 2: TUTORIAL Ethernet PLC's Improve Oxygen Consumption ISA Expo/2001Houston, Texas Water & Wastewater Industry DivisionTuesday, September 11, 2001 1 Brad.

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 2

This tutorial has 5 partsPART 1 The Anoxic Oxic Process

PART 2A PLC Programming Basics

PART 2B HMI Programming Basics

PART 2C Excel Spreadsheets amp Visual Basic

PART3 Conclusions amp Acknowledgements

PART4 Q amp A

>
>

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 3

TUTORIAL

Part 1

The Anoxic Oxic Process

A ldquoReal-Worldrdquo Plant Application

The AnoxicOxic Process Modifications project was commissioned in the Spring of 2001 in Pensacola Florida

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 4

The AnoxicOxic Process

The wastewater flows into each of the five parallel anoxicoxic (AO) trains (which are each 40rsquo x 200rsquo rectangular concrete ldquopoolsrdquo) 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 AnoxicOxic Process is part of the Secondary Treatment of the municipal sewage It is here that oxygen is added to the waste stream

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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 AO 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

Effluent NH4-N and NO3-N concentrations were formulated with four parameters

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 6

middot Equivalent ratio of alkalinity to ammonia in influent

middot Equivalent ratio of alkalinity to substrate to ammonia

middot Ratio of influent to the anoxic cellmiddot Recycle Ratio

We can increase the efficiency of the nitrogen removal by optimizing these factors

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 7

Mixed Liquor Recycle The 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

Use of Bacteria The 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 AnoxicOxic 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 Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 8

The purpose of Denitrifying Bacteria is to take up organic matter using the Nitrifying Bacteriarsquos 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

The purpose of Nitrifying Bacteria is to convert the content of AMMONIA in the raw wastewater into NITRATE

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

But Nitrifying Bacteria and Denitrifying Bacteria CANNOT work in the same conditions

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

Factors Effecting Process Performance

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 11

middot Configuration and volume of anoxic and oxic cells

middot Addition points and proportions of oxygen addition

middot Supplementation of carbon source (such as methanol) to enhance the denitrification rate

middot Amount of wastewater treated per day

middot Water temperature and concentration of the bacteria to the process

The factors which influence the process performance of nitrogen removal are

The process incorporates second and third anoxic cells into the treatment scheme in order to meet the effluent limitations using four measured variables

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 12

Biological Oxygen Demand (BOD)

Suspended Solids (SS)

Total Nitrogen (TN)

Total Phosphorous (TP)

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 15

Train Details

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 17

Selecting A Control Level For Oxygen Addition For 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 18

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

Control Levels The following control levels are available for Oxygen

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 20

Oxygen Control Levels

Cascade from Cell 3 Dissolved Oxygen probe

Ratio from Discharge flow

AutoManual Control

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 22

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 23

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 24

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 25

The following control levels are available for the Recycle flow

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 27

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 28

The following control levels are available for the PD Blowers Timed Mode

Dissolved Oxygen Mode

Manual Mode

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

Motor Popup

The following information is available for each motor control from the respective motor popup

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

Aerator Control Motor Popup

Like all motors the following information is available for the Aerator motor control from the motor popup

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 32

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 33

Motor Popup Surface Aerator Control

The following information is available for motor control from the motor popup

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 35

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 36

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 37

Lower Explosive Level (LEL)

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 38

Each train has a digital input that tells whether thecombustible 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 (LEL) system

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 39

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 Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 40

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 41

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 Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 42

Like a DCS

middot 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

middot 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 amp CASCADE amp RATIO PID WITH AUTO amp RATIO Digin Motor Status DigOut Motor (or Digital Composite) Motor with ILock and Perm Numeric Set Timers Alarm Detail and Alarm Tags

middot A single generic trend display to trend ALL trendable (archived) points

Alarm Management

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

middot A Distributed Alarm Summary has been used to give better alarm management tools

bull Up to eight trend pens on the trend display

bull The operator picks which values to trend by clicking in the center of the trend

display

bull 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 44

The AnoxicOxic 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 Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 46

The following control levels are available for Oxygen1 Cascade from Dissolved Oxygen

2 Ratio from Discharge flow3 Auto-Manual Control

The following control levels are available for the Recycle flow1 Ratio from Discharge flow

2 Auto-Manual Control

The following control levels are available for the PD Blowers3 Timed Mode

2 Dissolved Oxygen Mode3 Manual Mode

Conclusions

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 47

Following the commissioning of the ethernet-based PLCs Oxygen consumption was significantly reduced

The advanced controls allow the operators to leave the process alone and continue to optimally treat the sewage

Conclusions

Following the commissioning of the ethernet-based PLCs AnoxicOxic 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 Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 48

Summary

The PD Blowers ran in Timed Mode andor 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

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 Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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 Authoritys 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 50

TUTORIAL

Part 2A

PLC Programming Basics

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 51

Separate parts of the process have been organized into a separate ldquoSECTIONrdquo

PLC Program Organization

Each ldquoSECTIONrdquo can be any of the IEC programming types

bull Ladder (LD)bull Structured Text (ST)

bull Instruction List (IL)

bull Function Blocks (FB)bull Sequential Function Charts (SFC)

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 52

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 53

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 54

IO Map

On-Line PLC Diagnostics

PLC Status

PLC Simulator

Ethernet (TCPIP) Address

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 55

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 56

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 57

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 58

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 59

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 60

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 61

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 62

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 63

Structured Text was used hereNOT Ladder

Programming for Motors

The PLC DOES NOT CAREStructured Text Functions EXACTLY

the same as LadderUse what yoursquore comfortable with

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 64

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 65

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 66

IEC Function Blocks Used Here

Programming for Analogs amp PID

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 67

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 68

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 69

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 70

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 71

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 72

Sequential Function Charts were used here

Higher-Level Control

bull SFCrsquos lend themselves well to (as the name would imply) sequential processes

bull Three Important components in SFCrsquosbull Transitionsbull Stepsbull Jumps

bull The status of the process can be viewed as a flow chart

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 73

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 74

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 75

PLC - HMI Communication

A ldquoPLC Heartbeatrdquo is traditionally used to monitor the PLC - HMI Communication sometimes called ardquoWatchdog Timerrdquo

Call it whatever you want but the PLC amp 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 ldquodiesrdquo then that switch doesnrsquot change state and an alarm alerts the operator

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 76

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 77

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 78

TUTORIAL

Part 2B

HMI Programming

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 79

Ethernet (TCPIP) IO Driver

The Ethernet (TCPIP) IO Driver allows the HMI to communicate with the PLC (In this case the driver is called MBENETEXE)

The PLC has an ethernet module in one of the slots that has a ldquoCAT5RJ-45rdquo 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 ldquoCAT5RJ-45rdquo receptacle for the ethernet cable

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 80

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 81

Operator Screens amp Popup Displays

The display is laid out in 3 sections

bull Upper - Security amp Alarm Windowbull Middle- Main Operator Screens bull Lower - Menu amp Popup Displays

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 82

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 83

Scripting

There are 6 types of ldquoScriptsrdquobull Application Scriptsbull Key Scriptsbull Condition Scriptsbull Data Change Scriptsbull Quick Function Scriptsbull ActiveX Event Scripts

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 84

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 85

Access Names

The ldquoAccess Namesrdquo Must be configured to allow the PLC - HMI communications

Note that the ldquoApplicationTopicrdquo is the same as the IO Driver

The ldquocomputer namerdquo is the name of the PC that the HMI is running on (brad_s_carlberg in this case)

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 86

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 87

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 88

Indirect Tags

ldquoIndirect Tagsrdquo were used here to minimize the number of popup displays

This is especially useful in HMIrsquos with many tags

ONLY 12 popup displays are reused throughout the HMI

This gives the HMI a ldquoDCS-Likerdquo Look amp Feel

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 89

Popup Display TypesThe tag point type determines which popup display to use

Analog InputHIC (or Analog Output)PID (or Analog Composite)

bull PID WITH AUTO amp CASCADE amp RATIObull PID WITH AUTO amp RATIO

Diginbull Motor Status

DigOutMotor (or Digital Composite)

bull Motor with ILock and PermNumericSet TimersAlarm DetailAlarm Tags

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 90

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 91

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 92

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 93

Bars Buttons amp Sliders

By choosing to use indirect tags we complicate the Bar Graphs Buttons amp Sliders in the popup displays

Different scales need to be used for different engineering unit ranges

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 94

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 95

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 96

Popup Displays

The next two pages shows how the individual popup displays use the indirect tags

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 97

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 98

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 99

Adding a ldquoTouch Targetrdquo to a Display

2 Tell which tags to use

3 Tell which popup display to call upWhat kind of point type is it

3 Steps1 Tell which scale to use (if itrsquos an analog point type)

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 100

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 101

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 102

TUTORIAL

Part 2C

Excel Spreadsheets

amp

Visual Basic

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 103

A ldquoCHEAP amp DIRTYrdquo HMI With Excel

The 4 key parameters are

To communicate with the PLCUse brad_s_carlbergmbenet|ANOXIC_OXICrsquoplcregisterrsquo

Excel uses ldquopeeksrdquo amp ldquopokesrdquo to read from amp write to a PLC or HMI

To communicate with the HMIbrad_s_carlbergview|Tagnamersquotagnamersquo

bull computer namebull applicationbull topicbull item

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 104

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 105

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 106

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 107

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 108

Excel Macros

bull ldquoRequestrdquo Macro to read values

bull ldquoPokerdquo Macro to write values

bull A Sample Excel Macro

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 109

Sub PokeMacro()MsgBox ApplicationNetworkTemplatesPathChannel = ApplicationDDEInitiate(app=brad_s_carlbergVIEW topic=Tagname) This opens a DDE channel to ViewApplicationDDEPoke Channel Temperature1 Worksheets(Sheet1)Range(A1) Puts value from R1C1 into Temperature1ApplicationDDEPoke Channel DDEReal Worksheets(Sheet1)Range(A2) Puts value from R1C1 into Temperature1ApplicationDDEPoke Channel DDEInteger Worksheets(Sheet1)Range(A3) Puts value from R1C1 into Temperature1ApplicationDDETerminate Channel This terminates the DDE channelEnd SubSub RequestMacro()Channel = ApplicationDDEInitiate(app=brad_s_carlbergVIEW topic=Tagname) This opens a DDE channel to ViewWorksheets(Sheet1)Range(C4) = ApplicationDDERequest(Channel $Hour)Worksheets(Sheet1)Range(C5) = ApplicationDDERequest(Channel $Minute)Worksheets(Sheet1)Range(C6) = ApplicationDDERequest(Channel $Second)Worksheets(Sheet1)Range(C9) = ApplicationDDERequest(Channel $day)Worksheets(Sheet1)Range(C10) = ApplicationDDERequest(Channel $date)Worksheets(Sheet1)Range(C11) = ApplicationDDERequest(Channel $datestring)Worksheets(Sheet1)Range(C12) = ApplicationDDERequest(Channel $datetime)Worksheets(Sheet1)Range(C13) = ApplicationDDERequest(Channel $date)Worksheets(Sheet1)Range(C14) = ApplicationDDERequest(Channel $month)Worksheets(Sheet1)Range(C15) = ApplicationDDERequest(Channel $year)Worksheets(Sheet1)Range(C16) = ApplicationDDERequest(Channel $time)Worksheets(Sheet1)Range(C17) = ApplicationDDERequest(Channel $timestring)Worksheets(Sheet1)Range(C18) = ApplicationDDERequest(Channel $applicationversion)Worksheets(Sheet1)Range(C19) = ApplicationDDERequest(Channel $startddeconversations)Worksheets(Sheet1)Range(C20) = ApplicationDDERequest(Channel $accesslevel)Worksheets(Sheet1)Range(C21) = ApplicationDDERequest(Channel $alarmlogging)Worksheets(Sheet1)Range(C22) = ApplicationDDERequest(Channel $applicationchanged)Worksheets(Sheet1)Range(C23) = ApplicationDDERequest(Channel $configureusers)Worksheets(Sheet1)Range(C24) = ApplicationDDERequest(Channel $changepassword)Worksheets(Sheet1)Range(C25) = ApplicationDDERequest(Channel $InactivityTimeout)Worksheets(Sheet1)Range(C26) = ApplicationDDERequest(Channel $InactivityWarning)Worksheets(Sheet1)Range(C27) = ApplicationDDERequest(Channel $LogicRunning)Worksheets(Sheet1)Range(C28) = ApplicationDDERequest(Channel $OperatorEntered)Worksheets(Sheet1)Range(C29) = ApplicationDDERequest(Channel $Operator)Worksheets(Sheet1)Range(C30) = ApplicationDDERequest(Channel $PasswordEntered)ApplicationDDETerminate Channel This terminates the DDE channelEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 110

Visual Basic

ldquoRoll Your Ownrdquo HMI - Much More powerful than Excel

Key Parameters computer nameapplication|topicitem

IO Emulator - MBPlusSimulateexe

Can ldquoRead Fromrdquo amp ldquoWrite Tordquo PLC andor HMI

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 111

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 112

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 113

Dim PauseTime Start Finish TotalTime As Integer Declare variables

Private Sub txtAIT_332A_SCALED_Change()On Error GoTo PokeAIT_332AErrortxtAIT_332A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtAIT_332A_SCALEDText = Int((3 Rnd) + 20) Generate random value between 20 and 23txtAIT_332A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtAIT_332A_SCALEDLinkItem = AIT_332A_SCALEDtxtAIT_332A_SCALEDLinkMode = 2txtAIT_332A_SCALEDLinkPoketxtAIT_332A_SCALEDLinkMode = 0 DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total time

PokeAIT_332AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtAIT_332A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 114

Private Sub txtAIT_346A_SCALED_Change()On Error GoTo PokeAIT_346AErrortxtAIT_346A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtAIT_346A_SCALEDText = Int((3 Rnd) + 15) Generate random value between 15 and 18txtAIT_346A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtAIT_346A_SCALEDLinkItem = AIT_346A_SCALEDtxtAIT_346A_SCALEDLinkMode = 2txtAIT_346A_SCALEDLinkPoketxtAIT_346A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeAIT_346AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtAIT_346A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 115

Private Sub txtFIT_321A_SCALED_Change()On Error GoTo PokeFIT_321AErrortxtFIT_321A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtFIT_321A_SCALEDText = Int((10 Rnd) + 120) Generate random value between 120 and 130txtFIT_321A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_321A_SCALEDLinkItem = FIT_321A_SCALEDtxtFIT_321A_SCALEDLinkMode = 2txtFIT_321A_SCALEDLinkPoketxtFIT_321A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total time

PokeFIT_321AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_321A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume Next

End Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 116

Private Sub txtFIT_341A_SCALED_Change()On Error GoTo PokeFIT_341AErrortxtFIT_341A_SCALEDLinkMode = 0 PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTime

txtFIT_341A_SCALEDText = Int((3 Rnd) + 18) Generate random value between 18 and 21

txtFIT_341A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_341A_SCALEDLinkItem = FIT_341A_SCALEDtxtFIT_341A_SCALEDLinkMode = 2txtFIT_341A_SCALEDLinkPoketxtFIT_341A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeFIT_341AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_341A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 117

Private Sub txtFIT_343A_SCALED_Change()On Error GoTo PokeFIT_343AErrortxtFIT_343A_SCALEDLinkMode = 0 PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTime

txtFIT_343A_SCALEDText = Int((1 Rnd) + 3) Generate random value between 3 and 4

txtFIT_343A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_343A_SCALEDLinkItem = FIT_343A_SCALEDtxtFIT_343A_SCALEDLinkMode = 2txtFIT_343A_SCALEDLinkPoketxtFIT_343A_SCALEDLinkMode = 0 DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeFIT_343AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_343A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 118

TUTORIAL

Part 4

Questions

amp

Answers

  • Slide 1
  • Slide 2
  • Slide 3
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Slide 8
  • Slide 9
  • Slide 10
  • Slide 11
  • Slide 12
  • Slide 13
  • Slide 14
  • Slide 15
  • Slide 16
  • Slide 17
  • Slide 18
  • Slide 19
  • Slide 20
  • Slide 21
  • Slide 22
  • Slide 23
  • Slide 24
  • Slide 25
  • Slide 26
  • Slide 27
  • Slide 28
  • Slide 29
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
  • Slide 34
  • Slide 35
  • Slide 36
  • Slide 37
  • Slide 38
  • Slide 39
  • Slide 40
  • Slide 41
  • Slide 42
  • Slide 43
  • Slide 44
  • Slide 45
  • Slide 46
  • Slide 47
  • Slide 48
  • Slide 49
  • Slide 50
  • Slide 51
  • Slide 52
  • Slide 53
  • Slide 54
  • Slide 55
  • Slide 56
  • Slide 57
  • Slide 58
  • Slide 59
  • Slide 60
  • Slide 61
  • Slide 62
  • Slide 63
  • Slide 64
  • Slide 65
  • Slide 66
  • Slide 67
  • Slide 68
  • Slide 69
  • Slide 70
  • Slide 71
  • Slide 72
  • Slide 73
  • Slide 74
  • Slide 75
  • Slide 76
  • Slide 77
  • Slide 78
  • Slide 79
  • Slide 80
  • Slide 81
  • Slide 82
  • Slide 83
  • Slide 84
  • Slide 85
  • Slide 86
  • Slide 87
  • Slide 88
  • Slide 89
  • Slide 90
  • Slide 91
  • Slide 92
  • Slide 93
  • Slide 94
  • Slide 95
  • Slide 96
  • Slide 97
  • Slide 98
  • Slide 99
  • Slide 100
  • Slide 101
  • Slide 102
  • Slide 103
  • Slide 104
  • Slide 105
  • Slide 106
  • Slide 107
  • Slide 108
  • Slide 109
  • Slide 110
  • Slide 111
  • Slide 112
  • Slide 113
  • Slide 114
  • Slide 115
  • Slide 116
  • Slide 117
  • Slide 118
Page 3: TUTORIAL Ethernet PLC's Improve Oxygen Consumption ISA Expo/2001Houston, Texas Water & Wastewater Industry DivisionTuesday, September 11, 2001 1 Brad.

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 3

TUTORIAL

Part 1

The Anoxic Oxic Process

A ldquoReal-Worldrdquo Plant Application

The AnoxicOxic Process Modifications project was commissioned in the Spring of 2001 in Pensacola Florida

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 4

The AnoxicOxic Process

The wastewater flows into each of the five parallel anoxicoxic (AO) trains (which are each 40rsquo x 200rsquo rectangular concrete ldquopoolsrdquo) 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 AnoxicOxic Process is part of the Secondary Treatment of the municipal sewage It is here that oxygen is added to the waste stream

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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 AO 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

Effluent NH4-N and NO3-N concentrations were formulated with four parameters

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 6

middot Equivalent ratio of alkalinity to ammonia in influent

middot Equivalent ratio of alkalinity to substrate to ammonia

middot Ratio of influent to the anoxic cellmiddot Recycle Ratio

We can increase the efficiency of the nitrogen removal by optimizing these factors

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 7

Mixed Liquor Recycle The 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

Use of Bacteria The 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 AnoxicOxic 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 Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 8

The purpose of Denitrifying Bacteria is to take up organic matter using the Nitrifying Bacteriarsquos 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

The purpose of Nitrifying Bacteria is to convert the content of AMMONIA in the raw wastewater into NITRATE

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

But Nitrifying Bacteria and Denitrifying Bacteria CANNOT work in the same conditions

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

Factors Effecting Process Performance

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 11

middot Configuration and volume of anoxic and oxic cells

middot Addition points and proportions of oxygen addition

middot Supplementation of carbon source (such as methanol) to enhance the denitrification rate

middot Amount of wastewater treated per day

middot Water temperature and concentration of the bacteria to the process

The factors which influence the process performance of nitrogen removal are

The process incorporates second and third anoxic cells into the treatment scheme in order to meet the effluent limitations using four measured variables

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 12

Biological Oxygen Demand (BOD)

Suspended Solids (SS)

Total Nitrogen (TN)

Total Phosphorous (TP)

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 15

Train Details

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 17

Selecting A Control Level For Oxygen Addition For 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 18

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

Control Levels The following control levels are available for Oxygen

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 20

Oxygen Control Levels

Cascade from Cell 3 Dissolved Oxygen probe

Ratio from Discharge flow

AutoManual Control

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 22

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 23

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 24

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 25

The following control levels are available for the Recycle flow

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 27

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 28

The following control levels are available for the PD Blowers Timed Mode

Dissolved Oxygen Mode

Manual Mode

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

Motor Popup

The following information is available for each motor control from the respective motor popup

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

Aerator Control Motor Popup

Like all motors the following information is available for the Aerator motor control from the motor popup

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 32

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 33

Motor Popup Surface Aerator Control

The following information is available for motor control from the motor popup

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 35

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 36

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 37

Lower Explosive Level (LEL)

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 38

Each train has a digital input that tells whether thecombustible 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 (LEL) system

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 39

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 Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 40

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 41

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 Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 42

Like a DCS

middot 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

middot 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 amp CASCADE amp RATIO PID WITH AUTO amp RATIO Digin Motor Status DigOut Motor (or Digital Composite) Motor with ILock and Perm Numeric Set Timers Alarm Detail and Alarm Tags

middot A single generic trend display to trend ALL trendable (archived) points

Alarm Management

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

middot A Distributed Alarm Summary has been used to give better alarm management tools

bull Up to eight trend pens on the trend display

bull The operator picks which values to trend by clicking in the center of the trend

display

bull 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 44

The AnoxicOxic 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 Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 46

The following control levels are available for Oxygen1 Cascade from Dissolved Oxygen

2 Ratio from Discharge flow3 Auto-Manual Control

The following control levels are available for the Recycle flow1 Ratio from Discharge flow

2 Auto-Manual Control

The following control levels are available for the PD Blowers3 Timed Mode

2 Dissolved Oxygen Mode3 Manual Mode

Conclusions

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 47

Following the commissioning of the ethernet-based PLCs Oxygen consumption was significantly reduced

The advanced controls allow the operators to leave the process alone and continue to optimally treat the sewage

Conclusions

Following the commissioning of the ethernet-based PLCs AnoxicOxic 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 Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 48

Summary

The PD Blowers ran in Timed Mode andor 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

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 Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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 Authoritys 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 50

TUTORIAL

Part 2A

PLC Programming Basics

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 51

Separate parts of the process have been organized into a separate ldquoSECTIONrdquo

PLC Program Organization

Each ldquoSECTIONrdquo can be any of the IEC programming types

bull Ladder (LD)bull Structured Text (ST)

bull Instruction List (IL)

bull Function Blocks (FB)bull Sequential Function Charts (SFC)

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 52

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 53

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 54

IO Map

On-Line PLC Diagnostics

PLC Status

PLC Simulator

Ethernet (TCPIP) Address

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 55

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 56

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 57

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 58

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 59

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 60

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 61

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 62

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 63

Structured Text was used hereNOT Ladder

Programming for Motors

The PLC DOES NOT CAREStructured Text Functions EXACTLY

the same as LadderUse what yoursquore comfortable with

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 64

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 65

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 66

IEC Function Blocks Used Here

Programming for Analogs amp PID

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 67

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 68

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 69

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 70

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 71

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 72

Sequential Function Charts were used here

Higher-Level Control

bull SFCrsquos lend themselves well to (as the name would imply) sequential processes

bull Three Important components in SFCrsquosbull Transitionsbull Stepsbull Jumps

bull The status of the process can be viewed as a flow chart

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 73

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 74

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 75

PLC - HMI Communication

A ldquoPLC Heartbeatrdquo is traditionally used to monitor the PLC - HMI Communication sometimes called ardquoWatchdog Timerrdquo

Call it whatever you want but the PLC amp 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 ldquodiesrdquo then that switch doesnrsquot change state and an alarm alerts the operator

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 76

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 77

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 78

TUTORIAL

Part 2B

HMI Programming

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 79

Ethernet (TCPIP) IO Driver

The Ethernet (TCPIP) IO Driver allows the HMI to communicate with the PLC (In this case the driver is called MBENETEXE)

The PLC has an ethernet module in one of the slots that has a ldquoCAT5RJ-45rdquo 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 ldquoCAT5RJ-45rdquo receptacle for the ethernet cable

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 80

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 81

Operator Screens amp Popup Displays

The display is laid out in 3 sections

bull Upper - Security amp Alarm Windowbull Middle- Main Operator Screens bull Lower - Menu amp Popup Displays

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 82

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 83

Scripting

There are 6 types of ldquoScriptsrdquobull Application Scriptsbull Key Scriptsbull Condition Scriptsbull Data Change Scriptsbull Quick Function Scriptsbull ActiveX Event Scripts

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 84

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 85

Access Names

The ldquoAccess Namesrdquo Must be configured to allow the PLC - HMI communications

Note that the ldquoApplicationTopicrdquo is the same as the IO Driver

The ldquocomputer namerdquo is the name of the PC that the HMI is running on (brad_s_carlberg in this case)

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 86

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 87

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 88

Indirect Tags

ldquoIndirect Tagsrdquo were used here to minimize the number of popup displays

This is especially useful in HMIrsquos with many tags

ONLY 12 popup displays are reused throughout the HMI

This gives the HMI a ldquoDCS-Likerdquo Look amp Feel

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 89

Popup Display TypesThe tag point type determines which popup display to use

Analog InputHIC (or Analog Output)PID (or Analog Composite)

bull PID WITH AUTO amp CASCADE amp RATIObull PID WITH AUTO amp RATIO

Diginbull Motor Status

DigOutMotor (or Digital Composite)

bull Motor with ILock and PermNumericSet TimersAlarm DetailAlarm Tags

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 90

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 91

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 92

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 93

Bars Buttons amp Sliders

By choosing to use indirect tags we complicate the Bar Graphs Buttons amp Sliders in the popup displays

Different scales need to be used for different engineering unit ranges

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 94

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 95

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 96

Popup Displays

The next two pages shows how the individual popup displays use the indirect tags

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 97

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 98

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 99

Adding a ldquoTouch Targetrdquo to a Display

2 Tell which tags to use

3 Tell which popup display to call upWhat kind of point type is it

3 Steps1 Tell which scale to use (if itrsquos an analog point type)

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 100

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 101

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 102

TUTORIAL

Part 2C

Excel Spreadsheets

amp

Visual Basic

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 103

A ldquoCHEAP amp DIRTYrdquo HMI With Excel

The 4 key parameters are

To communicate with the PLCUse brad_s_carlbergmbenet|ANOXIC_OXICrsquoplcregisterrsquo

Excel uses ldquopeeksrdquo amp ldquopokesrdquo to read from amp write to a PLC or HMI

To communicate with the HMIbrad_s_carlbergview|Tagnamersquotagnamersquo

bull computer namebull applicationbull topicbull item

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 104

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 105

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 106

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 107

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 108

Excel Macros

bull ldquoRequestrdquo Macro to read values

bull ldquoPokerdquo Macro to write values

bull A Sample Excel Macro

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 109

Sub PokeMacro()MsgBox ApplicationNetworkTemplatesPathChannel = ApplicationDDEInitiate(app=brad_s_carlbergVIEW topic=Tagname) This opens a DDE channel to ViewApplicationDDEPoke Channel Temperature1 Worksheets(Sheet1)Range(A1) Puts value from R1C1 into Temperature1ApplicationDDEPoke Channel DDEReal Worksheets(Sheet1)Range(A2) Puts value from R1C1 into Temperature1ApplicationDDEPoke Channel DDEInteger Worksheets(Sheet1)Range(A3) Puts value from R1C1 into Temperature1ApplicationDDETerminate Channel This terminates the DDE channelEnd SubSub RequestMacro()Channel = ApplicationDDEInitiate(app=brad_s_carlbergVIEW topic=Tagname) This opens a DDE channel to ViewWorksheets(Sheet1)Range(C4) = ApplicationDDERequest(Channel $Hour)Worksheets(Sheet1)Range(C5) = ApplicationDDERequest(Channel $Minute)Worksheets(Sheet1)Range(C6) = ApplicationDDERequest(Channel $Second)Worksheets(Sheet1)Range(C9) = ApplicationDDERequest(Channel $day)Worksheets(Sheet1)Range(C10) = ApplicationDDERequest(Channel $date)Worksheets(Sheet1)Range(C11) = ApplicationDDERequest(Channel $datestring)Worksheets(Sheet1)Range(C12) = ApplicationDDERequest(Channel $datetime)Worksheets(Sheet1)Range(C13) = ApplicationDDERequest(Channel $date)Worksheets(Sheet1)Range(C14) = ApplicationDDERequest(Channel $month)Worksheets(Sheet1)Range(C15) = ApplicationDDERequest(Channel $year)Worksheets(Sheet1)Range(C16) = ApplicationDDERequest(Channel $time)Worksheets(Sheet1)Range(C17) = ApplicationDDERequest(Channel $timestring)Worksheets(Sheet1)Range(C18) = ApplicationDDERequest(Channel $applicationversion)Worksheets(Sheet1)Range(C19) = ApplicationDDERequest(Channel $startddeconversations)Worksheets(Sheet1)Range(C20) = ApplicationDDERequest(Channel $accesslevel)Worksheets(Sheet1)Range(C21) = ApplicationDDERequest(Channel $alarmlogging)Worksheets(Sheet1)Range(C22) = ApplicationDDERequest(Channel $applicationchanged)Worksheets(Sheet1)Range(C23) = ApplicationDDERequest(Channel $configureusers)Worksheets(Sheet1)Range(C24) = ApplicationDDERequest(Channel $changepassword)Worksheets(Sheet1)Range(C25) = ApplicationDDERequest(Channel $InactivityTimeout)Worksheets(Sheet1)Range(C26) = ApplicationDDERequest(Channel $InactivityWarning)Worksheets(Sheet1)Range(C27) = ApplicationDDERequest(Channel $LogicRunning)Worksheets(Sheet1)Range(C28) = ApplicationDDERequest(Channel $OperatorEntered)Worksheets(Sheet1)Range(C29) = ApplicationDDERequest(Channel $Operator)Worksheets(Sheet1)Range(C30) = ApplicationDDERequest(Channel $PasswordEntered)ApplicationDDETerminate Channel This terminates the DDE channelEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 110

Visual Basic

ldquoRoll Your Ownrdquo HMI - Much More powerful than Excel

Key Parameters computer nameapplication|topicitem

IO Emulator - MBPlusSimulateexe

Can ldquoRead Fromrdquo amp ldquoWrite Tordquo PLC andor HMI

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 111

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 112

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 113

Dim PauseTime Start Finish TotalTime As Integer Declare variables

Private Sub txtAIT_332A_SCALED_Change()On Error GoTo PokeAIT_332AErrortxtAIT_332A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtAIT_332A_SCALEDText = Int((3 Rnd) + 20) Generate random value between 20 and 23txtAIT_332A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtAIT_332A_SCALEDLinkItem = AIT_332A_SCALEDtxtAIT_332A_SCALEDLinkMode = 2txtAIT_332A_SCALEDLinkPoketxtAIT_332A_SCALEDLinkMode = 0 DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total time

PokeAIT_332AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtAIT_332A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 114

Private Sub txtAIT_346A_SCALED_Change()On Error GoTo PokeAIT_346AErrortxtAIT_346A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtAIT_346A_SCALEDText = Int((3 Rnd) + 15) Generate random value between 15 and 18txtAIT_346A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtAIT_346A_SCALEDLinkItem = AIT_346A_SCALEDtxtAIT_346A_SCALEDLinkMode = 2txtAIT_346A_SCALEDLinkPoketxtAIT_346A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeAIT_346AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtAIT_346A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 115

Private Sub txtFIT_321A_SCALED_Change()On Error GoTo PokeFIT_321AErrortxtFIT_321A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtFIT_321A_SCALEDText = Int((10 Rnd) + 120) Generate random value between 120 and 130txtFIT_321A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_321A_SCALEDLinkItem = FIT_321A_SCALEDtxtFIT_321A_SCALEDLinkMode = 2txtFIT_321A_SCALEDLinkPoketxtFIT_321A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total time

PokeFIT_321AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_321A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume Next

End Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 116

Private Sub txtFIT_341A_SCALED_Change()On Error GoTo PokeFIT_341AErrortxtFIT_341A_SCALEDLinkMode = 0 PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTime

txtFIT_341A_SCALEDText = Int((3 Rnd) + 18) Generate random value between 18 and 21

txtFIT_341A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_341A_SCALEDLinkItem = FIT_341A_SCALEDtxtFIT_341A_SCALEDLinkMode = 2txtFIT_341A_SCALEDLinkPoketxtFIT_341A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeFIT_341AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_341A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 117

Private Sub txtFIT_343A_SCALED_Change()On Error GoTo PokeFIT_343AErrortxtFIT_343A_SCALEDLinkMode = 0 PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTime

txtFIT_343A_SCALEDText = Int((1 Rnd) + 3) Generate random value between 3 and 4

txtFIT_343A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_343A_SCALEDLinkItem = FIT_343A_SCALEDtxtFIT_343A_SCALEDLinkMode = 2txtFIT_343A_SCALEDLinkPoketxtFIT_343A_SCALEDLinkMode = 0 DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeFIT_343AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_343A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 118

TUTORIAL

Part 4

Questions

amp

Answers

  • Slide 1
  • Slide 2
  • Slide 3
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Slide 8
  • Slide 9
  • Slide 10
  • Slide 11
  • Slide 12
  • Slide 13
  • Slide 14
  • Slide 15
  • Slide 16
  • Slide 17
  • Slide 18
  • Slide 19
  • Slide 20
  • Slide 21
  • Slide 22
  • Slide 23
  • Slide 24
  • Slide 25
  • Slide 26
  • Slide 27
  • Slide 28
  • Slide 29
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
  • Slide 34
  • Slide 35
  • Slide 36
  • Slide 37
  • Slide 38
  • Slide 39
  • Slide 40
  • Slide 41
  • Slide 42
  • Slide 43
  • Slide 44
  • Slide 45
  • Slide 46
  • Slide 47
  • Slide 48
  • Slide 49
  • Slide 50
  • Slide 51
  • Slide 52
  • Slide 53
  • Slide 54
  • Slide 55
  • Slide 56
  • Slide 57
  • Slide 58
  • Slide 59
  • Slide 60
  • Slide 61
  • Slide 62
  • Slide 63
  • Slide 64
  • Slide 65
  • Slide 66
  • Slide 67
  • Slide 68
  • Slide 69
  • Slide 70
  • Slide 71
  • Slide 72
  • Slide 73
  • Slide 74
  • Slide 75
  • Slide 76
  • Slide 77
  • Slide 78
  • Slide 79
  • Slide 80
  • Slide 81
  • Slide 82
  • Slide 83
  • Slide 84
  • Slide 85
  • Slide 86
  • Slide 87
  • Slide 88
  • Slide 89
  • Slide 90
  • Slide 91
  • Slide 92
  • Slide 93
  • Slide 94
  • Slide 95
  • Slide 96
  • Slide 97
  • Slide 98
  • Slide 99
  • Slide 100
  • Slide 101
  • Slide 102
  • Slide 103
  • Slide 104
  • Slide 105
  • Slide 106
  • Slide 107
  • Slide 108
  • Slide 109
  • Slide 110
  • Slide 111
  • Slide 112
  • Slide 113
  • Slide 114
  • Slide 115
  • Slide 116
  • Slide 117
  • Slide 118
Page 4: TUTORIAL Ethernet PLC's Improve Oxygen Consumption ISA Expo/2001Houston, Texas Water & Wastewater Industry DivisionTuesday, September 11, 2001 1 Brad.

The AnoxicOxic Process Modifications project was commissioned in the Spring of 2001 in Pensacola Florida

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 4

The AnoxicOxic Process

The wastewater flows into each of the five parallel anoxicoxic (AO) trains (which are each 40rsquo x 200rsquo rectangular concrete ldquopoolsrdquo) 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 AnoxicOxic Process is part of the Secondary Treatment of the municipal sewage It is here that oxygen is added to the waste stream

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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 AO 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

Effluent NH4-N and NO3-N concentrations were formulated with four parameters

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 6

middot Equivalent ratio of alkalinity to ammonia in influent

middot Equivalent ratio of alkalinity to substrate to ammonia

middot Ratio of influent to the anoxic cellmiddot Recycle Ratio

We can increase the efficiency of the nitrogen removal by optimizing these factors

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 7

Mixed Liquor Recycle The 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

Use of Bacteria The 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 AnoxicOxic 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 Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 8

The purpose of Denitrifying Bacteria is to take up organic matter using the Nitrifying Bacteriarsquos 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

The purpose of Nitrifying Bacteria is to convert the content of AMMONIA in the raw wastewater into NITRATE

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

But Nitrifying Bacteria and Denitrifying Bacteria CANNOT work in the same conditions

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

Factors Effecting Process Performance

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 11

middot Configuration and volume of anoxic and oxic cells

middot Addition points and proportions of oxygen addition

middot Supplementation of carbon source (such as methanol) to enhance the denitrification rate

middot Amount of wastewater treated per day

middot Water temperature and concentration of the bacteria to the process

The factors which influence the process performance of nitrogen removal are

The process incorporates second and third anoxic cells into the treatment scheme in order to meet the effluent limitations using four measured variables

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 12

Biological Oxygen Demand (BOD)

Suspended Solids (SS)

Total Nitrogen (TN)

Total Phosphorous (TP)

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 15

Train Details

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 17

Selecting A Control Level For Oxygen Addition For 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 18

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

Control Levels The following control levels are available for Oxygen

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 20

Oxygen Control Levels

Cascade from Cell 3 Dissolved Oxygen probe

Ratio from Discharge flow

AutoManual Control

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 22

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 23

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 24

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 25

The following control levels are available for the Recycle flow

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 27

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 28

The following control levels are available for the PD Blowers Timed Mode

Dissolved Oxygen Mode

Manual Mode

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

Motor Popup

The following information is available for each motor control from the respective motor popup

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

Aerator Control Motor Popup

Like all motors the following information is available for the Aerator motor control from the motor popup

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 32

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 33

Motor Popup Surface Aerator Control

The following information is available for motor control from the motor popup

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 35

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 36

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 37

Lower Explosive Level (LEL)

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 38

Each train has a digital input that tells whether thecombustible 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 (LEL) system

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 39

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 Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 40

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 41

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 Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 42

Like a DCS

middot 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

middot 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 amp CASCADE amp RATIO PID WITH AUTO amp RATIO Digin Motor Status DigOut Motor (or Digital Composite) Motor with ILock and Perm Numeric Set Timers Alarm Detail and Alarm Tags

middot A single generic trend display to trend ALL trendable (archived) points

Alarm Management

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

middot A Distributed Alarm Summary has been used to give better alarm management tools

bull Up to eight trend pens on the trend display

bull The operator picks which values to trend by clicking in the center of the trend

display

bull 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 44

The AnoxicOxic 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 Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 46

The following control levels are available for Oxygen1 Cascade from Dissolved Oxygen

2 Ratio from Discharge flow3 Auto-Manual Control

The following control levels are available for the Recycle flow1 Ratio from Discharge flow

2 Auto-Manual Control

The following control levels are available for the PD Blowers3 Timed Mode

2 Dissolved Oxygen Mode3 Manual Mode

Conclusions

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 47

Following the commissioning of the ethernet-based PLCs Oxygen consumption was significantly reduced

The advanced controls allow the operators to leave the process alone and continue to optimally treat the sewage

Conclusions

Following the commissioning of the ethernet-based PLCs AnoxicOxic 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 Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 48

Summary

The PD Blowers ran in Timed Mode andor 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

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 Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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 Authoritys 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 50

TUTORIAL

Part 2A

PLC Programming Basics

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 51

Separate parts of the process have been organized into a separate ldquoSECTIONrdquo

PLC Program Organization

Each ldquoSECTIONrdquo can be any of the IEC programming types

bull Ladder (LD)bull Structured Text (ST)

bull Instruction List (IL)

bull Function Blocks (FB)bull Sequential Function Charts (SFC)

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 52

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 53

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 54

IO Map

On-Line PLC Diagnostics

PLC Status

PLC Simulator

Ethernet (TCPIP) Address

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 55

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 56

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 57

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 58

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 59

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 60

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 61

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 62

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 63

Structured Text was used hereNOT Ladder

Programming for Motors

The PLC DOES NOT CAREStructured Text Functions EXACTLY

the same as LadderUse what yoursquore comfortable with

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 64

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 65

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 66

IEC Function Blocks Used Here

Programming for Analogs amp PID

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 67

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 68

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 69

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 70

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 71

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 72

Sequential Function Charts were used here

Higher-Level Control

bull SFCrsquos lend themselves well to (as the name would imply) sequential processes

bull Three Important components in SFCrsquosbull Transitionsbull Stepsbull Jumps

bull The status of the process can be viewed as a flow chart

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 73

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 74

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 75

PLC - HMI Communication

A ldquoPLC Heartbeatrdquo is traditionally used to monitor the PLC - HMI Communication sometimes called ardquoWatchdog Timerrdquo

Call it whatever you want but the PLC amp 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 ldquodiesrdquo then that switch doesnrsquot change state and an alarm alerts the operator

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 76

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 77

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 78

TUTORIAL

Part 2B

HMI Programming

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 79

Ethernet (TCPIP) IO Driver

The Ethernet (TCPIP) IO Driver allows the HMI to communicate with the PLC (In this case the driver is called MBENETEXE)

The PLC has an ethernet module in one of the slots that has a ldquoCAT5RJ-45rdquo 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 ldquoCAT5RJ-45rdquo receptacle for the ethernet cable

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 80

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 81

Operator Screens amp Popup Displays

The display is laid out in 3 sections

bull Upper - Security amp Alarm Windowbull Middle- Main Operator Screens bull Lower - Menu amp Popup Displays

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 82

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 83

Scripting

There are 6 types of ldquoScriptsrdquobull Application Scriptsbull Key Scriptsbull Condition Scriptsbull Data Change Scriptsbull Quick Function Scriptsbull ActiveX Event Scripts

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 84

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 85

Access Names

The ldquoAccess Namesrdquo Must be configured to allow the PLC - HMI communications

Note that the ldquoApplicationTopicrdquo is the same as the IO Driver

The ldquocomputer namerdquo is the name of the PC that the HMI is running on (brad_s_carlberg in this case)

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 86

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 87

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 88

Indirect Tags

ldquoIndirect Tagsrdquo were used here to minimize the number of popup displays

This is especially useful in HMIrsquos with many tags

ONLY 12 popup displays are reused throughout the HMI

This gives the HMI a ldquoDCS-Likerdquo Look amp Feel

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 89

Popup Display TypesThe tag point type determines which popup display to use

Analog InputHIC (or Analog Output)PID (or Analog Composite)

bull PID WITH AUTO amp CASCADE amp RATIObull PID WITH AUTO amp RATIO

Diginbull Motor Status

DigOutMotor (or Digital Composite)

bull Motor with ILock and PermNumericSet TimersAlarm DetailAlarm Tags

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 90

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 91

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 92

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 93

Bars Buttons amp Sliders

By choosing to use indirect tags we complicate the Bar Graphs Buttons amp Sliders in the popup displays

Different scales need to be used for different engineering unit ranges

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 94

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 95

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 96

Popup Displays

The next two pages shows how the individual popup displays use the indirect tags

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 97

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 98

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 99

Adding a ldquoTouch Targetrdquo to a Display

2 Tell which tags to use

3 Tell which popup display to call upWhat kind of point type is it

3 Steps1 Tell which scale to use (if itrsquos an analog point type)

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 100

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 101

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 102

TUTORIAL

Part 2C

Excel Spreadsheets

amp

Visual Basic

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 103

A ldquoCHEAP amp DIRTYrdquo HMI With Excel

The 4 key parameters are

To communicate with the PLCUse brad_s_carlbergmbenet|ANOXIC_OXICrsquoplcregisterrsquo

Excel uses ldquopeeksrdquo amp ldquopokesrdquo to read from amp write to a PLC or HMI

To communicate with the HMIbrad_s_carlbergview|Tagnamersquotagnamersquo

bull computer namebull applicationbull topicbull item

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 104

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 105

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 106

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 107

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 108

Excel Macros

bull ldquoRequestrdquo Macro to read values

bull ldquoPokerdquo Macro to write values

bull A Sample Excel Macro

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 109

Sub PokeMacro()MsgBox ApplicationNetworkTemplatesPathChannel = ApplicationDDEInitiate(app=brad_s_carlbergVIEW topic=Tagname) This opens a DDE channel to ViewApplicationDDEPoke Channel Temperature1 Worksheets(Sheet1)Range(A1) Puts value from R1C1 into Temperature1ApplicationDDEPoke Channel DDEReal Worksheets(Sheet1)Range(A2) Puts value from R1C1 into Temperature1ApplicationDDEPoke Channel DDEInteger Worksheets(Sheet1)Range(A3) Puts value from R1C1 into Temperature1ApplicationDDETerminate Channel This terminates the DDE channelEnd SubSub RequestMacro()Channel = ApplicationDDEInitiate(app=brad_s_carlbergVIEW topic=Tagname) This opens a DDE channel to ViewWorksheets(Sheet1)Range(C4) = ApplicationDDERequest(Channel $Hour)Worksheets(Sheet1)Range(C5) = ApplicationDDERequest(Channel $Minute)Worksheets(Sheet1)Range(C6) = ApplicationDDERequest(Channel $Second)Worksheets(Sheet1)Range(C9) = ApplicationDDERequest(Channel $day)Worksheets(Sheet1)Range(C10) = ApplicationDDERequest(Channel $date)Worksheets(Sheet1)Range(C11) = ApplicationDDERequest(Channel $datestring)Worksheets(Sheet1)Range(C12) = ApplicationDDERequest(Channel $datetime)Worksheets(Sheet1)Range(C13) = ApplicationDDERequest(Channel $date)Worksheets(Sheet1)Range(C14) = ApplicationDDERequest(Channel $month)Worksheets(Sheet1)Range(C15) = ApplicationDDERequest(Channel $year)Worksheets(Sheet1)Range(C16) = ApplicationDDERequest(Channel $time)Worksheets(Sheet1)Range(C17) = ApplicationDDERequest(Channel $timestring)Worksheets(Sheet1)Range(C18) = ApplicationDDERequest(Channel $applicationversion)Worksheets(Sheet1)Range(C19) = ApplicationDDERequest(Channel $startddeconversations)Worksheets(Sheet1)Range(C20) = ApplicationDDERequest(Channel $accesslevel)Worksheets(Sheet1)Range(C21) = ApplicationDDERequest(Channel $alarmlogging)Worksheets(Sheet1)Range(C22) = ApplicationDDERequest(Channel $applicationchanged)Worksheets(Sheet1)Range(C23) = ApplicationDDERequest(Channel $configureusers)Worksheets(Sheet1)Range(C24) = ApplicationDDERequest(Channel $changepassword)Worksheets(Sheet1)Range(C25) = ApplicationDDERequest(Channel $InactivityTimeout)Worksheets(Sheet1)Range(C26) = ApplicationDDERequest(Channel $InactivityWarning)Worksheets(Sheet1)Range(C27) = ApplicationDDERequest(Channel $LogicRunning)Worksheets(Sheet1)Range(C28) = ApplicationDDERequest(Channel $OperatorEntered)Worksheets(Sheet1)Range(C29) = ApplicationDDERequest(Channel $Operator)Worksheets(Sheet1)Range(C30) = ApplicationDDERequest(Channel $PasswordEntered)ApplicationDDETerminate Channel This terminates the DDE channelEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 110

Visual Basic

ldquoRoll Your Ownrdquo HMI - Much More powerful than Excel

Key Parameters computer nameapplication|topicitem

IO Emulator - MBPlusSimulateexe

Can ldquoRead Fromrdquo amp ldquoWrite Tordquo PLC andor HMI

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 111

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 112

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 113

Dim PauseTime Start Finish TotalTime As Integer Declare variables

Private Sub txtAIT_332A_SCALED_Change()On Error GoTo PokeAIT_332AErrortxtAIT_332A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtAIT_332A_SCALEDText = Int((3 Rnd) + 20) Generate random value between 20 and 23txtAIT_332A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtAIT_332A_SCALEDLinkItem = AIT_332A_SCALEDtxtAIT_332A_SCALEDLinkMode = 2txtAIT_332A_SCALEDLinkPoketxtAIT_332A_SCALEDLinkMode = 0 DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total time

PokeAIT_332AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtAIT_332A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 114

Private Sub txtAIT_346A_SCALED_Change()On Error GoTo PokeAIT_346AErrortxtAIT_346A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtAIT_346A_SCALEDText = Int((3 Rnd) + 15) Generate random value between 15 and 18txtAIT_346A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtAIT_346A_SCALEDLinkItem = AIT_346A_SCALEDtxtAIT_346A_SCALEDLinkMode = 2txtAIT_346A_SCALEDLinkPoketxtAIT_346A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeAIT_346AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtAIT_346A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 115

Private Sub txtFIT_321A_SCALED_Change()On Error GoTo PokeFIT_321AErrortxtFIT_321A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtFIT_321A_SCALEDText = Int((10 Rnd) + 120) Generate random value between 120 and 130txtFIT_321A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_321A_SCALEDLinkItem = FIT_321A_SCALEDtxtFIT_321A_SCALEDLinkMode = 2txtFIT_321A_SCALEDLinkPoketxtFIT_321A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total time

PokeFIT_321AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_321A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume Next

End Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 116

Private Sub txtFIT_341A_SCALED_Change()On Error GoTo PokeFIT_341AErrortxtFIT_341A_SCALEDLinkMode = 0 PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTime

txtFIT_341A_SCALEDText = Int((3 Rnd) + 18) Generate random value between 18 and 21

txtFIT_341A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_341A_SCALEDLinkItem = FIT_341A_SCALEDtxtFIT_341A_SCALEDLinkMode = 2txtFIT_341A_SCALEDLinkPoketxtFIT_341A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeFIT_341AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_341A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 117

Private Sub txtFIT_343A_SCALED_Change()On Error GoTo PokeFIT_343AErrortxtFIT_343A_SCALEDLinkMode = 0 PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTime

txtFIT_343A_SCALEDText = Int((1 Rnd) + 3) Generate random value between 3 and 4

txtFIT_343A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_343A_SCALEDLinkItem = FIT_343A_SCALEDtxtFIT_343A_SCALEDLinkMode = 2txtFIT_343A_SCALEDLinkPoketxtFIT_343A_SCALEDLinkMode = 0 DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeFIT_343AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_343A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 118

TUTORIAL

Part 4

Questions

amp

Answers

  • Slide 1
  • Slide 2
  • Slide 3
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Slide 8
  • Slide 9
  • Slide 10
  • Slide 11
  • Slide 12
  • Slide 13
  • Slide 14
  • Slide 15
  • Slide 16
  • Slide 17
  • Slide 18
  • Slide 19
  • Slide 20
  • Slide 21
  • Slide 22
  • Slide 23
  • Slide 24
  • Slide 25
  • Slide 26
  • Slide 27
  • Slide 28
  • Slide 29
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
  • Slide 34
  • Slide 35
  • Slide 36
  • Slide 37
  • Slide 38
  • Slide 39
  • Slide 40
  • Slide 41
  • Slide 42
  • Slide 43
  • Slide 44
  • Slide 45
  • Slide 46
  • Slide 47
  • Slide 48
  • Slide 49
  • Slide 50
  • Slide 51
  • Slide 52
  • Slide 53
  • Slide 54
  • Slide 55
  • Slide 56
  • Slide 57
  • Slide 58
  • Slide 59
  • Slide 60
  • Slide 61
  • Slide 62
  • Slide 63
  • Slide 64
  • Slide 65
  • Slide 66
  • Slide 67
  • Slide 68
  • Slide 69
  • Slide 70
  • Slide 71
  • Slide 72
  • Slide 73
  • Slide 74
  • Slide 75
  • Slide 76
  • Slide 77
  • Slide 78
  • Slide 79
  • Slide 80
  • Slide 81
  • Slide 82
  • Slide 83
  • Slide 84
  • Slide 85
  • Slide 86
  • Slide 87
  • Slide 88
  • Slide 89
  • Slide 90
  • Slide 91
  • Slide 92
  • Slide 93
  • Slide 94
  • Slide 95
  • Slide 96
  • Slide 97
  • Slide 98
  • Slide 99
  • Slide 100
  • Slide 101
  • Slide 102
  • Slide 103
  • Slide 104
  • Slide 105
  • Slide 106
  • Slide 107
  • Slide 108
  • Slide 109
  • Slide 110
  • Slide 111
  • Slide 112
  • Slide 113
  • Slide 114
  • Slide 115
  • Slide 116
  • Slide 117
  • Slide 118
Page 5: TUTORIAL Ethernet PLC's Improve Oxygen Consumption ISA Expo/2001Houston, Texas Water & Wastewater Industry DivisionTuesday, September 11, 2001 1 Brad.

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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 AO 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

Effluent NH4-N and NO3-N concentrations were formulated with four parameters

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 6

middot Equivalent ratio of alkalinity to ammonia in influent

middot Equivalent ratio of alkalinity to substrate to ammonia

middot Ratio of influent to the anoxic cellmiddot Recycle Ratio

We can increase the efficiency of the nitrogen removal by optimizing these factors

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 7

Mixed Liquor Recycle The 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

Use of Bacteria The 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 AnoxicOxic 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 Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 8

The purpose of Denitrifying Bacteria is to take up organic matter using the Nitrifying Bacteriarsquos 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

The purpose of Nitrifying Bacteria is to convert the content of AMMONIA in the raw wastewater into NITRATE

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

But Nitrifying Bacteria and Denitrifying Bacteria CANNOT work in the same conditions

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

Factors Effecting Process Performance

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 11

middot Configuration and volume of anoxic and oxic cells

middot Addition points and proportions of oxygen addition

middot Supplementation of carbon source (such as methanol) to enhance the denitrification rate

middot Amount of wastewater treated per day

middot Water temperature and concentration of the bacteria to the process

The factors which influence the process performance of nitrogen removal are

The process incorporates second and third anoxic cells into the treatment scheme in order to meet the effluent limitations using four measured variables

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 12

Biological Oxygen Demand (BOD)

Suspended Solids (SS)

Total Nitrogen (TN)

Total Phosphorous (TP)

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 15

Train Details

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 17

Selecting A Control Level For Oxygen Addition For 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 18

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

Control Levels The following control levels are available for Oxygen

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 20

Oxygen Control Levels

Cascade from Cell 3 Dissolved Oxygen probe

Ratio from Discharge flow

AutoManual Control

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 22

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 23

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 24

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 25

The following control levels are available for the Recycle flow

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 27

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 28

The following control levels are available for the PD Blowers Timed Mode

Dissolved Oxygen Mode

Manual Mode

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

Motor Popup

The following information is available for each motor control from the respective motor popup

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

Aerator Control Motor Popup

Like all motors the following information is available for the Aerator motor control from the motor popup

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 32

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 33

Motor Popup Surface Aerator Control

The following information is available for motor control from the motor popup

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 35

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 36

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 37

Lower Explosive Level (LEL)

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 38

Each train has a digital input that tells whether thecombustible 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 (LEL) system

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 39

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 Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 40

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 41

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 Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 42

Like a DCS

middot 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

middot 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 amp CASCADE amp RATIO PID WITH AUTO amp RATIO Digin Motor Status DigOut Motor (or Digital Composite) Motor with ILock and Perm Numeric Set Timers Alarm Detail and Alarm Tags

middot A single generic trend display to trend ALL trendable (archived) points

Alarm Management

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

middot A Distributed Alarm Summary has been used to give better alarm management tools

bull Up to eight trend pens on the trend display

bull The operator picks which values to trend by clicking in the center of the trend

display

bull 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 44

The AnoxicOxic 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 Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 46

The following control levels are available for Oxygen1 Cascade from Dissolved Oxygen

2 Ratio from Discharge flow3 Auto-Manual Control

The following control levels are available for the Recycle flow1 Ratio from Discharge flow

2 Auto-Manual Control

The following control levels are available for the PD Blowers3 Timed Mode

2 Dissolved Oxygen Mode3 Manual Mode

Conclusions

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 47

Following the commissioning of the ethernet-based PLCs Oxygen consumption was significantly reduced

The advanced controls allow the operators to leave the process alone and continue to optimally treat the sewage

Conclusions

Following the commissioning of the ethernet-based PLCs AnoxicOxic 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 Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 48

Summary

The PD Blowers ran in Timed Mode andor 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

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 Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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 Authoritys 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 50

TUTORIAL

Part 2A

PLC Programming Basics

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 51

Separate parts of the process have been organized into a separate ldquoSECTIONrdquo

PLC Program Organization

Each ldquoSECTIONrdquo can be any of the IEC programming types

bull Ladder (LD)bull Structured Text (ST)

bull Instruction List (IL)

bull Function Blocks (FB)bull Sequential Function Charts (SFC)

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 52

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 53

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 54

IO Map

On-Line PLC Diagnostics

PLC Status

PLC Simulator

Ethernet (TCPIP) Address

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 55

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 56

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 57

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 58

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 59

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 60

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 61

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 62

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 63

Structured Text was used hereNOT Ladder

Programming for Motors

The PLC DOES NOT CAREStructured Text Functions EXACTLY

the same as LadderUse what yoursquore comfortable with

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 64

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 65

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 66

IEC Function Blocks Used Here

Programming for Analogs amp PID

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 67

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 68

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 69

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 70

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 71

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 72

Sequential Function Charts were used here

Higher-Level Control

bull SFCrsquos lend themselves well to (as the name would imply) sequential processes

bull Three Important components in SFCrsquosbull Transitionsbull Stepsbull Jumps

bull The status of the process can be viewed as a flow chart

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 73

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 74

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 75

PLC - HMI Communication

A ldquoPLC Heartbeatrdquo is traditionally used to monitor the PLC - HMI Communication sometimes called ardquoWatchdog Timerrdquo

Call it whatever you want but the PLC amp 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 ldquodiesrdquo then that switch doesnrsquot change state and an alarm alerts the operator

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 76

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 77

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 78

TUTORIAL

Part 2B

HMI Programming

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 79

Ethernet (TCPIP) IO Driver

The Ethernet (TCPIP) IO Driver allows the HMI to communicate with the PLC (In this case the driver is called MBENETEXE)

The PLC has an ethernet module in one of the slots that has a ldquoCAT5RJ-45rdquo 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 ldquoCAT5RJ-45rdquo receptacle for the ethernet cable

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 80

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 81

Operator Screens amp Popup Displays

The display is laid out in 3 sections

bull Upper - Security amp Alarm Windowbull Middle- Main Operator Screens bull Lower - Menu amp Popup Displays

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 82

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 83

Scripting

There are 6 types of ldquoScriptsrdquobull Application Scriptsbull Key Scriptsbull Condition Scriptsbull Data Change Scriptsbull Quick Function Scriptsbull ActiveX Event Scripts

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 84

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 85

Access Names

The ldquoAccess Namesrdquo Must be configured to allow the PLC - HMI communications

Note that the ldquoApplicationTopicrdquo is the same as the IO Driver

The ldquocomputer namerdquo is the name of the PC that the HMI is running on (brad_s_carlberg in this case)

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 86

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 87

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 88

Indirect Tags

ldquoIndirect Tagsrdquo were used here to minimize the number of popup displays

This is especially useful in HMIrsquos with many tags

ONLY 12 popup displays are reused throughout the HMI

This gives the HMI a ldquoDCS-Likerdquo Look amp Feel

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 89

Popup Display TypesThe tag point type determines which popup display to use

Analog InputHIC (or Analog Output)PID (or Analog Composite)

bull PID WITH AUTO amp CASCADE amp RATIObull PID WITH AUTO amp RATIO

Diginbull Motor Status

DigOutMotor (or Digital Composite)

bull Motor with ILock and PermNumericSet TimersAlarm DetailAlarm Tags

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 90

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 91

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 92

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 93

Bars Buttons amp Sliders

By choosing to use indirect tags we complicate the Bar Graphs Buttons amp Sliders in the popup displays

Different scales need to be used for different engineering unit ranges

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 94

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 95

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 96

Popup Displays

The next two pages shows how the individual popup displays use the indirect tags

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 97

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 98

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 99

Adding a ldquoTouch Targetrdquo to a Display

2 Tell which tags to use

3 Tell which popup display to call upWhat kind of point type is it

3 Steps1 Tell which scale to use (if itrsquos an analog point type)

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 100

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 101

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 102

TUTORIAL

Part 2C

Excel Spreadsheets

amp

Visual Basic

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 103

A ldquoCHEAP amp DIRTYrdquo HMI With Excel

The 4 key parameters are

To communicate with the PLCUse brad_s_carlbergmbenet|ANOXIC_OXICrsquoplcregisterrsquo

Excel uses ldquopeeksrdquo amp ldquopokesrdquo to read from amp write to a PLC or HMI

To communicate with the HMIbrad_s_carlbergview|Tagnamersquotagnamersquo

bull computer namebull applicationbull topicbull item

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 104

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 105

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 106

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 107

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 108

Excel Macros

bull ldquoRequestrdquo Macro to read values

bull ldquoPokerdquo Macro to write values

bull A Sample Excel Macro

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 109

Sub PokeMacro()MsgBox ApplicationNetworkTemplatesPathChannel = ApplicationDDEInitiate(app=brad_s_carlbergVIEW topic=Tagname) This opens a DDE channel to ViewApplicationDDEPoke Channel Temperature1 Worksheets(Sheet1)Range(A1) Puts value from R1C1 into Temperature1ApplicationDDEPoke Channel DDEReal Worksheets(Sheet1)Range(A2) Puts value from R1C1 into Temperature1ApplicationDDEPoke Channel DDEInteger Worksheets(Sheet1)Range(A3) Puts value from R1C1 into Temperature1ApplicationDDETerminate Channel This terminates the DDE channelEnd SubSub RequestMacro()Channel = ApplicationDDEInitiate(app=brad_s_carlbergVIEW topic=Tagname) This opens a DDE channel to ViewWorksheets(Sheet1)Range(C4) = ApplicationDDERequest(Channel $Hour)Worksheets(Sheet1)Range(C5) = ApplicationDDERequest(Channel $Minute)Worksheets(Sheet1)Range(C6) = ApplicationDDERequest(Channel $Second)Worksheets(Sheet1)Range(C9) = ApplicationDDERequest(Channel $day)Worksheets(Sheet1)Range(C10) = ApplicationDDERequest(Channel $date)Worksheets(Sheet1)Range(C11) = ApplicationDDERequest(Channel $datestring)Worksheets(Sheet1)Range(C12) = ApplicationDDERequest(Channel $datetime)Worksheets(Sheet1)Range(C13) = ApplicationDDERequest(Channel $date)Worksheets(Sheet1)Range(C14) = ApplicationDDERequest(Channel $month)Worksheets(Sheet1)Range(C15) = ApplicationDDERequest(Channel $year)Worksheets(Sheet1)Range(C16) = ApplicationDDERequest(Channel $time)Worksheets(Sheet1)Range(C17) = ApplicationDDERequest(Channel $timestring)Worksheets(Sheet1)Range(C18) = ApplicationDDERequest(Channel $applicationversion)Worksheets(Sheet1)Range(C19) = ApplicationDDERequest(Channel $startddeconversations)Worksheets(Sheet1)Range(C20) = ApplicationDDERequest(Channel $accesslevel)Worksheets(Sheet1)Range(C21) = ApplicationDDERequest(Channel $alarmlogging)Worksheets(Sheet1)Range(C22) = ApplicationDDERequest(Channel $applicationchanged)Worksheets(Sheet1)Range(C23) = ApplicationDDERequest(Channel $configureusers)Worksheets(Sheet1)Range(C24) = ApplicationDDERequest(Channel $changepassword)Worksheets(Sheet1)Range(C25) = ApplicationDDERequest(Channel $InactivityTimeout)Worksheets(Sheet1)Range(C26) = ApplicationDDERequest(Channel $InactivityWarning)Worksheets(Sheet1)Range(C27) = ApplicationDDERequest(Channel $LogicRunning)Worksheets(Sheet1)Range(C28) = ApplicationDDERequest(Channel $OperatorEntered)Worksheets(Sheet1)Range(C29) = ApplicationDDERequest(Channel $Operator)Worksheets(Sheet1)Range(C30) = ApplicationDDERequest(Channel $PasswordEntered)ApplicationDDETerminate Channel This terminates the DDE channelEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 110

Visual Basic

ldquoRoll Your Ownrdquo HMI - Much More powerful than Excel

Key Parameters computer nameapplication|topicitem

IO Emulator - MBPlusSimulateexe

Can ldquoRead Fromrdquo amp ldquoWrite Tordquo PLC andor HMI

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 111

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 112

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 113

Dim PauseTime Start Finish TotalTime As Integer Declare variables

Private Sub txtAIT_332A_SCALED_Change()On Error GoTo PokeAIT_332AErrortxtAIT_332A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtAIT_332A_SCALEDText = Int((3 Rnd) + 20) Generate random value between 20 and 23txtAIT_332A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtAIT_332A_SCALEDLinkItem = AIT_332A_SCALEDtxtAIT_332A_SCALEDLinkMode = 2txtAIT_332A_SCALEDLinkPoketxtAIT_332A_SCALEDLinkMode = 0 DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total time

PokeAIT_332AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtAIT_332A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 114

Private Sub txtAIT_346A_SCALED_Change()On Error GoTo PokeAIT_346AErrortxtAIT_346A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtAIT_346A_SCALEDText = Int((3 Rnd) + 15) Generate random value between 15 and 18txtAIT_346A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtAIT_346A_SCALEDLinkItem = AIT_346A_SCALEDtxtAIT_346A_SCALEDLinkMode = 2txtAIT_346A_SCALEDLinkPoketxtAIT_346A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeAIT_346AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtAIT_346A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 115

Private Sub txtFIT_321A_SCALED_Change()On Error GoTo PokeFIT_321AErrortxtFIT_321A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtFIT_321A_SCALEDText = Int((10 Rnd) + 120) Generate random value between 120 and 130txtFIT_321A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_321A_SCALEDLinkItem = FIT_321A_SCALEDtxtFIT_321A_SCALEDLinkMode = 2txtFIT_321A_SCALEDLinkPoketxtFIT_321A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total time

PokeFIT_321AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_321A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume Next

End Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 116

Private Sub txtFIT_341A_SCALED_Change()On Error GoTo PokeFIT_341AErrortxtFIT_341A_SCALEDLinkMode = 0 PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTime

txtFIT_341A_SCALEDText = Int((3 Rnd) + 18) Generate random value between 18 and 21

txtFIT_341A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_341A_SCALEDLinkItem = FIT_341A_SCALEDtxtFIT_341A_SCALEDLinkMode = 2txtFIT_341A_SCALEDLinkPoketxtFIT_341A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeFIT_341AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_341A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 117

Private Sub txtFIT_343A_SCALED_Change()On Error GoTo PokeFIT_343AErrortxtFIT_343A_SCALEDLinkMode = 0 PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTime

txtFIT_343A_SCALEDText = Int((1 Rnd) + 3) Generate random value between 3 and 4

txtFIT_343A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_343A_SCALEDLinkItem = FIT_343A_SCALEDtxtFIT_343A_SCALEDLinkMode = 2txtFIT_343A_SCALEDLinkPoketxtFIT_343A_SCALEDLinkMode = 0 DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeFIT_343AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_343A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 118

TUTORIAL

Part 4

Questions

amp

Answers

  • Slide 1
  • Slide 2
  • Slide 3
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Slide 8
  • Slide 9
  • Slide 10
  • Slide 11
  • Slide 12
  • Slide 13
  • Slide 14
  • Slide 15
  • Slide 16
  • Slide 17
  • Slide 18
  • Slide 19
  • Slide 20
  • Slide 21
  • Slide 22
  • Slide 23
  • Slide 24
  • Slide 25
  • Slide 26
  • Slide 27
  • Slide 28
  • Slide 29
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
  • Slide 34
  • Slide 35
  • Slide 36
  • Slide 37
  • Slide 38
  • Slide 39
  • Slide 40
  • Slide 41
  • Slide 42
  • Slide 43
  • Slide 44
  • Slide 45
  • Slide 46
  • Slide 47
  • Slide 48
  • Slide 49
  • Slide 50
  • Slide 51
  • Slide 52
  • Slide 53
  • Slide 54
  • Slide 55
  • Slide 56
  • Slide 57
  • Slide 58
  • Slide 59
  • Slide 60
  • Slide 61
  • Slide 62
  • Slide 63
  • Slide 64
  • Slide 65
  • Slide 66
  • Slide 67
  • Slide 68
  • Slide 69
  • Slide 70
  • Slide 71
  • Slide 72
  • Slide 73
  • Slide 74
  • Slide 75
  • Slide 76
  • Slide 77
  • Slide 78
  • Slide 79
  • Slide 80
  • Slide 81
  • Slide 82
  • Slide 83
  • Slide 84
  • Slide 85
  • Slide 86
  • Slide 87
  • Slide 88
  • Slide 89
  • Slide 90
  • Slide 91
  • Slide 92
  • Slide 93
  • Slide 94
  • Slide 95
  • Slide 96
  • Slide 97
  • Slide 98
  • Slide 99
  • Slide 100
  • Slide 101
  • Slide 102
  • Slide 103
  • Slide 104
  • Slide 105
  • Slide 106
  • Slide 107
  • Slide 108
  • Slide 109
  • Slide 110
  • Slide 111
  • Slide 112
  • Slide 113
  • Slide 114
  • Slide 115
  • Slide 116
  • Slide 117
  • Slide 118
Page 6: TUTORIAL Ethernet PLC's Improve Oxygen Consumption ISA Expo/2001Houston, Texas Water & Wastewater Industry DivisionTuesday, September 11, 2001 1 Brad.

Effluent NH4-N and NO3-N concentrations were formulated with four parameters

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 6

middot Equivalent ratio of alkalinity to ammonia in influent

middot Equivalent ratio of alkalinity to substrate to ammonia

middot Ratio of influent to the anoxic cellmiddot Recycle Ratio

We can increase the efficiency of the nitrogen removal by optimizing these factors

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 7

Mixed Liquor Recycle The 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

Use of Bacteria The 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 AnoxicOxic 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 Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 8

The purpose of Denitrifying Bacteria is to take up organic matter using the Nitrifying Bacteriarsquos 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

The purpose of Nitrifying Bacteria is to convert the content of AMMONIA in the raw wastewater into NITRATE

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

But Nitrifying Bacteria and Denitrifying Bacteria CANNOT work in the same conditions

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

Factors Effecting Process Performance

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 11

middot Configuration and volume of anoxic and oxic cells

middot Addition points and proportions of oxygen addition

middot Supplementation of carbon source (such as methanol) to enhance the denitrification rate

middot Amount of wastewater treated per day

middot Water temperature and concentration of the bacteria to the process

The factors which influence the process performance of nitrogen removal are

The process incorporates second and third anoxic cells into the treatment scheme in order to meet the effluent limitations using four measured variables

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 12

Biological Oxygen Demand (BOD)

Suspended Solids (SS)

Total Nitrogen (TN)

Total Phosphorous (TP)

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 15

Train Details

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 17

Selecting A Control Level For Oxygen Addition For 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 18

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

Control Levels The following control levels are available for Oxygen

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 20

Oxygen Control Levels

Cascade from Cell 3 Dissolved Oxygen probe

Ratio from Discharge flow

AutoManual Control

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 22

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 23

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 24

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 25

The following control levels are available for the Recycle flow

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 27

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 28

The following control levels are available for the PD Blowers Timed Mode

Dissolved Oxygen Mode

Manual Mode

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

Motor Popup

The following information is available for each motor control from the respective motor popup

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

Aerator Control Motor Popup

Like all motors the following information is available for the Aerator motor control from the motor popup

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 32

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 33

Motor Popup Surface Aerator Control

The following information is available for motor control from the motor popup

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 35

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 36

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 37

Lower Explosive Level (LEL)

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 38

Each train has a digital input that tells whether thecombustible 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 (LEL) system

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 39

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 Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 40

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 41

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 Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 42

Like a DCS

middot 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

middot 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 amp CASCADE amp RATIO PID WITH AUTO amp RATIO Digin Motor Status DigOut Motor (or Digital Composite) Motor with ILock and Perm Numeric Set Timers Alarm Detail and Alarm Tags

middot A single generic trend display to trend ALL trendable (archived) points

Alarm Management

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

middot A Distributed Alarm Summary has been used to give better alarm management tools

bull Up to eight trend pens on the trend display

bull The operator picks which values to trend by clicking in the center of the trend

display

bull 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 44

The AnoxicOxic 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 Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 46

The following control levels are available for Oxygen1 Cascade from Dissolved Oxygen

2 Ratio from Discharge flow3 Auto-Manual Control

The following control levels are available for the Recycle flow1 Ratio from Discharge flow

2 Auto-Manual Control

The following control levels are available for the PD Blowers3 Timed Mode

2 Dissolved Oxygen Mode3 Manual Mode

Conclusions

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 47

Following the commissioning of the ethernet-based PLCs Oxygen consumption was significantly reduced

The advanced controls allow the operators to leave the process alone and continue to optimally treat the sewage

Conclusions

Following the commissioning of the ethernet-based PLCs AnoxicOxic 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 Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 48

Summary

The PD Blowers ran in Timed Mode andor 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

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 Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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 Authoritys 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 50

TUTORIAL

Part 2A

PLC Programming Basics

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 51

Separate parts of the process have been organized into a separate ldquoSECTIONrdquo

PLC Program Organization

Each ldquoSECTIONrdquo can be any of the IEC programming types

bull Ladder (LD)bull Structured Text (ST)

bull Instruction List (IL)

bull Function Blocks (FB)bull Sequential Function Charts (SFC)

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 52

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 53

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 54

IO Map

On-Line PLC Diagnostics

PLC Status

PLC Simulator

Ethernet (TCPIP) Address

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 55

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 56

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 57

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 58

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 59

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 60

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 61

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 62

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 63

Structured Text was used hereNOT Ladder

Programming for Motors

The PLC DOES NOT CAREStructured Text Functions EXACTLY

the same as LadderUse what yoursquore comfortable with

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 64

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 65

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 66

IEC Function Blocks Used Here

Programming for Analogs amp PID

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 67

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 68

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 69

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 70

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 71

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 72

Sequential Function Charts were used here

Higher-Level Control

bull SFCrsquos lend themselves well to (as the name would imply) sequential processes

bull Three Important components in SFCrsquosbull Transitionsbull Stepsbull Jumps

bull The status of the process can be viewed as a flow chart

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 73

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 74

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 75

PLC - HMI Communication

A ldquoPLC Heartbeatrdquo is traditionally used to monitor the PLC - HMI Communication sometimes called ardquoWatchdog Timerrdquo

Call it whatever you want but the PLC amp 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 ldquodiesrdquo then that switch doesnrsquot change state and an alarm alerts the operator

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 76

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 77

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 78

TUTORIAL

Part 2B

HMI Programming

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 79

Ethernet (TCPIP) IO Driver

The Ethernet (TCPIP) IO Driver allows the HMI to communicate with the PLC (In this case the driver is called MBENETEXE)

The PLC has an ethernet module in one of the slots that has a ldquoCAT5RJ-45rdquo 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 ldquoCAT5RJ-45rdquo receptacle for the ethernet cable

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 80

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 81

Operator Screens amp Popup Displays

The display is laid out in 3 sections

bull Upper - Security amp Alarm Windowbull Middle- Main Operator Screens bull Lower - Menu amp Popup Displays

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 82

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 83

Scripting

There are 6 types of ldquoScriptsrdquobull Application Scriptsbull Key Scriptsbull Condition Scriptsbull Data Change Scriptsbull Quick Function Scriptsbull ActiveX Event Scripts

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 84

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 85

Access Names

The ldquoAccess Namesrdquo Must be configured to allow the PLC - HMI communications

Note that the ldquoApplicationTopicrdquo is the same as the IO Driver

The ldquocomputer namerdquo is the name of the PC that the HMI is running on (brad_s_carlberg in this case)

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 86

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 87

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 88

Indirect Tags

ldquoIndirect Tagsrdquo were used here to minimize the number of popup displays

This is especially useful in HMIrsquos with many tags

ONLY 12 popup displays are reused throughout the HMI

This gives the HMI a ldquoDCS-Likerdquo Look amp Feel

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 89

Popup Display TypesThe tag point type determines which popup display to use

Analog InputHIC (or Analog Output)PID (or Analog Composite)

bull PID WITH AUTO amp CASCADE amp RATIObull PID WITH AUTO amp RATIO

Diginbull Motor Status

DigOutMotor (or Digital Composite)

bull Motor with ILock and PermNumericSet TimersAlarm DetailAlarm Tags

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 90

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 91

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 92

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 93

Bars Buttons amp Sliders

By choosing to use indirect tags we complicate the Bar Graphs Buttons amp Sliders in the popup displays

Different scales need to be used for different engineering unit ranges

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 94

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 95

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 96

Popup Displays

The next two pages shows how the individual popup displays use the indirect tags

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 97

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 98

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 99

Adding a ldquoTouch Targetrdquo to a Display

2 Tell which tags to use

3 Tell which popup display to call upWhat kind of point type is it

3 Steps1 Tell which scale to use (if itrsquos an analog point type)

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 100

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 101

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 102

TUTORIAL

Part 2C

Excel Spreadsheets

amp

Visual Basic

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 103

A ldquoCHEAP amp DIRTYrdquo HMI With Excel

The 4 key parameters are

To communicate with the PLCUse brad_s_carlbergmbenet|ANOXIC_OXICrsquoplcregisterrsquo

Excel uses ldquopeeksrdquo amp ldquopokesrdquo to read from amp write to a PLC or HMI

To communicate with the HMIbrad_s_carlbergview|Tagnamersquotagnamersquo

bull computer namebull applicationbull topicbull item

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 104

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 105

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 106

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 107

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 108

Excel Macros

bull ldquoRequestrdquo Macro to read values

bull ldquoPokerdquo Macro to write values

bull A Sample Excel Macro

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 109

Sub PokeMacro()MsgBox ApplicationNetworkTemplatesPathChannel = ApplicationDDEInitiate(app=brad_s_carlbergVIEW topic=Tagname) This opens a DDE channel to ViewApplicationDDEPoke Channel Temperature1 Worksheets(Sheet1)Range(A1) Puts value from R1C1 into Temperature1ApplicationDDEPoke Channel DDEReal Worksheets(Sheet1)Range(A2) Puts value from R1C1 into Temperature1ApplicationDDEPoke Channel DDEInteger Worksheets(Sheet1)Range(A3) Puts value from R1C1 into Temperature1ApplicationDDETerminate Channel This terminates the DDE channelEnd SubSub RequestMacro()Channel = ApplicationDDEInitiate(app=brad_s_carlbergVIEW topic=Tagname) This opens a DDE channel to ViewWorksheets(Sheet1)Range(C4) = ApplicationDDERequest(Channel $Hour)Worksheets(Sheet1)Range(C5) = ApplicationDDERequest(Channel $Minute)Worksheets(Sheet1)Range(C6) = ApplicationDDERequest(Channel $Second)Worksheets(Sheet1)Range(C9) = ApplicationDDERequest(Channel $day)Worksheets(Sheet1)Range(C10) = ApplicationDDERequest(Channel $date)Worksheets(Sheet1)Range(C11) = ApplicationDDERequest(Channel $datestring)Worksheets(Sheet1)Range(C12) = ApplicationDDERequest(Channel $datetime)Worksheets(Sheet1)Range(C13) = ApplicationDDERequest(Channel $date)Worksheets(Sheet1)Range(C14) = ApplicationDDERequest(Channel $month)Worksheets(Sheet1)Range(C15) = ApplicationDDERequest(Channel $year)Worksheets(Sheet1)Range(C16) = ApplicationDDERequest(Channel $time)Worksheets(Sheet1)Range(C17) = ApplicationDDERequest(Channel $timestring)Worksheets(Sheet1)Range(C18) = ApplicationDDERequest(Channel $applicationversion)Worksheets(Sheet1)Range(C19) = ApplicationDDERequest(Channel $startddeconversations)Worksheets(Sheet1)Range(C20) = ApplicationDDERequest(Channel $accesslevel)Worksheets(Sheet1)Range(C21) = ApplicationDDERequest(Channel $alarmlogging)Worksheets(Sheet1)Range(C22) = ApplicationDDERequest(Channel $applicationchanged)Worksheets(Sheet1)Range(C23) = ApplicationDDERequest(Channel $configureusers)Worksheets(Sheet1)Range(C24) = ApplicationDDERequest(Channel $changepassword)Worksheets(Sheet1)Range(C25) = ApplicationDDERequest(Channel $InactivityTimeout)Worksheets(Sheet1)Range(C26) = ApplicationDDERequest(Channel $InactivityWarning)Worksheets(Sheet1)Range(C27) = ApplicationDDERequest(Channel $LogicRunning)Worksheets(Sheet1)Range(C28) = ApplicationDDERequest(Channel $OperatorEntered)Worksheets(Sheet1)Range(C29) = ApplicationDDERequest(Channel $Operator)Worksheets(Sheet1)Range(C30) = ApplicationDDERequest(Channel $PasswordEntered)ApplicationDDETerminate Channel This terminates the DDE channelEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 110

Visual Basic

ldquoRoll Your Ownrdquo HMI - Much More powerful than Excel

Key Parameters computer nameapplication|topicitem

IO Emulator - MBPlusSimulateexe

Can ldquoRead Fromrdquo amp ldquoWrite Tordquo PLC andor HMI

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 111

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 112

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 113

Dim PauseTime Start Finish TotalTime As Integer Declare variables

Private Sub txtAIT_332A_SCALED_Change()On Error GoTo PokeAIT_332AErrortxtAIT_332A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtAIT_332A_SCALEDText = Int((3 Rnd) + 20) Generate random value between 20 and 23txtAIT_332A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtAIT_332A_SCALEDLinkItem = AIT_332A_SCALEDtxtAIT_332A_SCALEDLinkMode = 2txtAIT_332A_SCALEDLinkPoketxtAIT_332A_SCALEDLinkMode = 0 DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total time

PokeAIT_332AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtAIT_332A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 114

Private Sub txtAIT_346A_SCALED_Change()On Error GoTo PokeAIT_346AErrortxtAIT_346A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtAIT_346A_SCALEDText = Int((3 Rnd) + 15) Generate random value between 15 and 18txtAIT_346A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtAIT_346A_SCALEDLinkItem = AIT_346A_SCALEDtxtAIT_346A_SCALEDLinkMode = 2txtAIT_346A_SCALEDLinkPoketxtAIT_346A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeAIT_346AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtAIT_346A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 115

Private Sub txtFIT_321A_SCALED_Change()On Error GoTo PokeFIT_321AErrortxtFIT_321A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtFIT_321A_SCALEDText = Int((10 Rnd) + 120) Generate random value between 120 and 130txtFIT_321A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_321A_SCALEDLinkItem = FIT_321A_SCALEDtxtFIT_321A_SCALEDLinkMode = 2txtFIT_321A_SCALEDLinkPoketxtFIT_321A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total time

PokeFIT_321AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_321A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume Next

End Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 116

Private Sub txtFIT_341A_SCALED_Change()On Error GoTo PokeFIT_341AErrortxtFIT_341A_SCALEDLinkMode = 0 PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTime

txtFIT_341A_SCALEDText = Int((3 Rnd) + 18) Generate random value between 18 and 21

txtFIT_341A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_341A_SCALEDLinkItem = FIT_341A_SCALEDtxtFIT_341A_SCALEDLinkMode = 2txtFIT_341A_SCALEDLinkPoketxtFIT_341A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeFIT_341AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_341A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 117

Private Sub txtFIT_343A_SCALED_Change()On Error GoTo PokeFIT_343AErrortxtFIT_343A_SCALEDLinkMode = 0 PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTime

txtFIT_343A_SCALEDText = Int((1 Rnd) + 3) Generate random value between 3 and 4

txtFIT_343A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_343A_SCALEDLinkItem = FIT_343A_SCALEDtxtFIT_343A_SCALEDLinkMode = 2txtFIT_343A_SCALEDLinkPoketxtFIT_343A_SCALEDLinkMode = 0 DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeFIT_343AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_343A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 118

TUTORIAL

Part 4

Questions

amp

Answers

  • Slide 1
  • Slide 2
  • Slide 3
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Slide 8
  • Slide 9
  • Slide 10
  • Slide 11
  • Slide 12
  • Slide 13
  • Slide 14
  • Slide 15
  • Slide 16
  • Slide 17
  • Slide 18
  • Slide 19
  • Slide 20
  • Slide 21
  • Slide 22
  • Slide 23
  • Slide 24
  • Slide 25
  • Slide 26
  • Slide 27
  • Slide 28
  • Slide 29
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
  • Slide 34
  • Slide 35
  • Slide 36
  • Slide 37
  • Slide 38
  • Slide 39
  • Slide 40
  • Slide 41
  • Slide 42
  • Slide 43
  • Slide 44
  • Slide 45
  • Slide 46
  • Slide 47
  • Slide 48
  • Slide 49
  • Slide 50
  • Slide 51
  • Slide 52
  • Slide 53
  • Slide 54
  • Slide 55
  • Slide 56
  • Slide 57
  • Slide 58
  • Slide 59
  • Slide 60
  • Slide 61
  • Slide 62
  • Slide 63
  • Slide 64
  • Slide 65
  • Slide 66
  • Slide 67
  • Slide 68
  • Slide 69
  • Slide 70
  • Slide 71
  • Slide 72
  • Slide 73
  • Slide 74
  • Slide 75
  • Slide 76
  • Slide 77
  • Slide 78
  • Slide 79
  • Slide 80
  • Slide 81
  • Slide 82
  • Slide 83
  • Slide 84
  • Slide 85
  • Slide 86
  • Slide 87
  • Slide 88
  • Slide 89
  • Slide 90
  • Slide 91
  • Slide 92
  • Slide 93
  • Slide 94
  • Slide 95
  • Slide 96
  • Slide 97
  • Slide 98
  • Slide 99
  • Slide 100
  • Slide 101
  • Slide 102
  • Slide 103
  • Slide 104
  • Slide 105
  • Slide 106
  • Slide 107
  • Slide 108
  • Slide 109
  • Slide 110
  • Slide 111
  • Slide 112
  • Slide 113
  • Slide 114
  • Slide 115
  • Slide 116
  • Slide 117
  • Slide 118
Page 7: TUTORIAL Ethernet PLC's Improve Oxygen Consumption ISA Expo/2001Houston, Texas Water & Wastewater Industry DivisionTuesday, September 11, 2001 1 Brad.

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 7

Mixed Liquor Recycle The 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

Use of Bacteria The 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 AnoxicOxic 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 Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 8

The purpose of Denitrifying Bacteria is to take up organic matter using the Nitrifying Bacteriarsquos 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

The purpose of Nitrifying Bacteria is to convert the content of AMMONIA in the raw wastewater into NITRATE

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

But Nitrifying Bacteria and Denitrifying Bacteria CANNOT work in the same conditions

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

Factors Effecting Process Performance

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 11

middot Configuration and volume of anoxic and oxic cells

middot Addition points and proportions of oxygen addition

middot Supplementation of carbon source (such as methanol) to enhance the denitrification rate

middot Amount of wastewater treated per day

middot Water temperature and concentration of the bacteria to the process

The factors which influence the process performance of nitrogen removal are

The process incorporates second and third anoxic cells into the treatment scheme in order to meet the effluent limitations using four measured variables

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 12

Biological Oxygen Demand (BOD)

Suspended Solids (SS)

Total Nitrogen (TN)

Total Phosphorous (TP)

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 15

Train Details

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 17

Selecting A Control Level For Oxygen Addition For 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 18

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

Control Levels The following control levels are available for Oxygen

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 20

Oxygen Control Levels

Cascade from Cell 3 Dissolved Oxygen probe

Ratio from Discharge flow

AutoManual Control

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 22

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 23

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 24

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 25

The following control levels are available for the Recycle flow

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 27

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 28

The following control levels are available for the PD Blowers Timed Mode

Dissolved Oxygen Mode

Manual Mode

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

Motor Popup

The following information is available for each motor control from the respective motor popup

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

Aerator Control Motor Popup

Like all motors the following information is available for the Aerator motor control from the motor popup

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 32

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 33

Motor Popup Surface Aerator Control

The following information is available for motor control from the motor popup

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 35

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 36

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 37

Lower Explosive Level (LEL)

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 38

Each train has a digital input that tells whether thecombustible 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 (LEL) system

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 39

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 Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 40

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 41

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 Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 42

Like a DCS

middot 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

middot 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 amp CASCADE amp RATIO PID WITH AUTO amp RATIO Digin Motor Status DigOut Motor (or Digital Composite) Motor with ILock and Perm Numeric Set Timers Alarm Detail and Alarm Tags

middot A single generic trend display to trend ALL trendable (archived) points

Alarm Management

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

middot A Distributed Alarm Summary has been used to give better alarm management tools

bull Up to eight trend pens on the trend display

bull The operator picks which values to trend by clicking in the center of the trend

display

bull 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 44

The AnoxicOxic 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 Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 46

The following control levels are available for Oxygen1 Cascade from Dissolved Oxygen

2 Ratio from Discharge flow3 Auto-Manual Control

The following control levels are available for the Recycle flow1 Ratio from Discharge flow

2 Auto-Manual Control

The following control levels are available for the PD Blowers3 Timed Mode

2 Dissolved Oxygen Mode3 Manual Mode

Conclusions

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 47

Following the commissioning of the ethernet-based PLCs Oxygen consumption was significantly reduced

The advanced controls allow the operators to leave the process alone and continue to optimally treat the sewage

Conclusions

Following the commissioning of the ethernet-based PLCs AnoxicOxic 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 Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 48

Summary

The PD Blowers ran in Timed Mode andor 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

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 Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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 Authoritys 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 50

TUTORIAL

Part 2A

PLC Programming Basics

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 51

Separate parts of the process have been organized into a separate ldquoSECTIONrdquo

PLC Program Organization

Each ldquoSECTIONrdquo can be any of the IEC programming types

bull Ladder (LD)bull Structured Text (ST)

bull Instruction List (IL)

bull Function Blocks (FB)bull Sequential Function Charts (SFC)

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 52

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 53

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 54

IO Map

On-Line PLC Diagnostics

PLC Status

PLC Simulator

Ethernet (TCPIP) Address

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 55

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 56

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 57

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 58

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 59

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 60

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 61

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 62

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 63

Structured Text was used hereNOT Ladder

Programming for Motors

The PLC DOES NOT CAREStructured Text Functions EXACTLY

the same as LadderUse what yoursquore comfortable with

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 64

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 65

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 66

IEC Function Blocks Used Here

Programming for Analogs amp PID

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 67

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 68

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 69

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 70

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 71

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 72

Sequential Function Charts were used here

Higher-Level Control

bull SFCrsquos lend themselves well to (as the name would imply) sequential processes

bull Three Important components in SFCrsquosbull Transitionsbull Stepsbull Jumps

bull The status of the process can be viewed as a flow chart

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 73

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 74

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 75

PLC - HMI Communication

A ldquoPLC Heartbeatrdquo is traditionally used to monitor the PLC - HMI Communication sometimes called ardquoWatchdog Timerrdquo

Call it whatever you want but the PLC amp 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 ldquodiesrdquo then that switch doesnrsquot change state and an alarm alerts the operator

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 76

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 77

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 78

TUTORIAL

Part 2B

HMI Programming

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 79

Ethernet (TCPIP) IO Driver

The Ethernet (TCPIP) IO Driver allows the HMI to communicate with the PLC (In this case the driver is called MBENETEXE)

The PLC has an ethernet module in one of the slots that has a ldquoCAT5RJ-45rdquo 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 ldquoCAT5RJ-45rdquo receptacle for the ethernet cable

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 80

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 81

Operator Screens amp Popup Displays

The display is laid out in 3 sections

bull Upper - Security amp Alarm Windowbull Middle- Main Operator Screens bull Lower - Menu amp Popup Displays

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 82

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 83

Scripting

There are 6 types of ldquoScriptsrdquobull Application Scriptsbull Key Scriptsbull Condition Scriptsbull Data Change Scriptsbull Quick Function Scriptsbull ActiveX Event Scripts

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 84

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 85

Access Names

The ldquoAccess Namesrdquo Must be configured to allow the PLC - HMI communications

Note that the ldquoApplicationTopicrdquo is the same as the IO Driver

The ldquocomputer namerdquo is the name of the PC that the HMI is running on (brad_s_carlberg in this case)

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 86

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 87

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 88

Indirect Tags

ldquoIndirect Tagsrdquo were used here to minimize the number of popup displays

This is especially useful in HMIrsquos with many tags

ONLY 12 popup displays are reused throughout the HMI

This gives the HMI a ldquoDCS-Likerdquo Look amp Feel

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 89

Popup Display TypesThe tag point type determines which popup display to use

Analog InputHIC (or Analog Output)PID (or Analog Composite)

bull PID WITH AUTO amp CASCADE amp RATIObull PID WITH AUTO amp RATIO

Diginbull Motor Status

DigOutMotor (or Digital Composite)

bull Motor with ILock and PermNumericSet TimersAlarm DetailAlarm Tags

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 90

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 91

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 92

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 93

Bars Buttons amp Sliders

By choosing to use indirect tags we complicate the Bar Graphs Buttons amp Sliders in the popup displays

Different scales need to be used for different engineering unit ranges

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 94

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 95

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 96

Popup Displays

The next two pages shows how the individual popup displays use the indirect tags

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 97

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 98

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 99

Adding a ldquoTouch Targetrdquo to a Display

2 Tell which tags to use

3 Tell which popup display to call upWhat kind of point type is it

3 Steps1 Tell which scale to use (if itrsquos an analog point type)

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 100

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 101

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 102

TUTORIAL

Part 2C

Excel Spreadsheets

amp

Visual Basic

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 103

A ldquoCHEAP amp DIRTYrdquo HMI With Excel

The 4 key parameters are

To communicate with the PLCUse brad_s_carlbergmbenet|ANOXIC_OXICrsquoplcregisterrsquo

Excel uses ldquopeeksrdquo amp ldquopokesrdquo to read from amp write to a PLC or HMI

To communicate with the HMIbrad_s_carlbergview|Tagnamersquotagnamersquo

bull computer namebull applicationbull topicbull item

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 104

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 105

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 106

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 107

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 108

Excel Macros

bull ldquoRequestrdquo Macro to read values

bull ldquoPokerdquo Macro to write values

bull A Sample Excel Macro

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 109

Sub PokeMacro()MsgBox ApplicationNetworkTemplatesPathChannel = ApplicationDDEInitiate(app=brad_s_carlbergVIEW topic=Tagname) This opens a DDE channel to ViewApplicationDDEPoke Channel Temperature1 Worksheets(Sheet1)Range(A1) Puts value from R1C1 into Temperature1ApplicationDDEPoke Channel DDEReal Worksheets(Sheet1)Range(A2) Puts value from R1C1 into Temperature1ApplicationDDEPoke Channel DDEInteger Worksheets(Sheet1)Range(A3) Puts value from R1C1 into Temperature1ApplicationDDETerminate Channel This terminates the DDE channelEnd SubSub RequestMacro()Channel = ApplicationDDEInitiate(app=brad_s_carlbergVIEW topic=Tagname) This opens a DDE channel to ViewWorksheets(Sheet1)Range(C4) = ApplicationDDERequest(Channel $Hour)Worksheets(Sheet1)Range(C5) = ApplicationDDERequest(Channel $Minute)Worksheets(Sheet1)Range(C6) = ApplicationDDERequest(Channel $Second)Worksheets(Sheet1)Range(C9) = ApplicationDDERequest(Channel $day)Worksheets(Sheet1)Range(C10) = ApplicationDDERequest(Channel $date)Worksheets(Sheet1)Range(C11) = ApplicationDDERequest(Channel $datestring)Worksheets(Sheet1)Range(C12) = ApplicationDDERequest(Channel $datetime)Worksheets(Sheet1)Range(C13) = ApplicationDDERequest(Channel $date)Worksheets(Sheet1)Range(C14) = ApplicationDDERequest(Channel $month)Worksheets(Sheet1)Range(C15) = ApplicationDDERequest(Channel $year)Worksheets(Sheet1)Range(C16) = ApplicationDDERequest(Channel $time)Worksheets(Sheet1)Range(C17) = ApplicationDDERequest(Channel $timestring)Worksheets(Sheet1)Range(C18) = ApplicationDDERequest(Channel $applicationversion)Worksheets(Sheet1)Range(C19) = ApplicationDDERequest(Channel $startddeconversations)Worksheets(Sheet1)Range(C20) = ApplicationDDERequest(Channel $accesslevel)Worksheets(Sheet1)Range(C21) = ApplicationDDERequest(Channel $alarmlogging)Worksheets(Sheet1)Range(C22) = ApplicationDDERequest(Channel $applicationchanged)Worksheets(Sheet1)Range(C23) = ApplicationDDERequest(Channel $configureusers)Worksheets(Sheet1)Range(C24) = ApplicationDDERequest(Channel $changepassword)Worksheets(Sheet1)Range(C25) = ApplicationDDERequest(Channel $InactivityTimeout)Worksheets(Sheet1)Range(C26) = ApplicationDDERequest(Channel $InactivityWarning)Worksheets(Sheet1)Range(C27) = ApplicationDDERequest(Channel $LogicRunning)Worksheets(Sheet1)Range(C28) = ApplicationDDERequest(Channel $OperatorEntered)Worksheets(Sheet1)Range(C29) = ApplicationDDERequest(Channel $Operator)Worksheets(Sheet1)Range(C30) = ApplicationDDERequest(Channel $PasswordEntered)ApplicationDDETerminate Channel This terminates the DDE channelEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 110

Visual Basic

ldquoRoll Your Ownrdquo HMI - Much More powerful than Excel

Key Parameters computer nameapplication|topicitem

IO Emulator - MBPlusSimulateexe

Can ldquoRead Fromrdquo amp ldquoWrite Tordquo PLC andor HMI

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 111

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 112

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 113

Dim PauseTime Start Finish TotalTime As Integer Declare variables

Private Sub txtAIT_332A_SCALED_Change()On Error GoTo PokeAIT_332AErrortxtAIT_332A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtAIT_332A_SCALEDText = Int((3 Rnd) + 20) Generate random value between 20 and 23txtAIT_332A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtAIT_332A_SCALEDLinkItem = AIT_332A_SCALEDtxtAIT_332A_SCALEDLinkMode = 2txtAIT_332A_SCALEDLinkPoketxtAIT_332A_SCALEDLinkMode = 0 DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total time

PokeAIT_332AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtAIT_332A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 114

Private Sub txtAIT_346A_SCALED_Change()On Error GoTo PokeAIT_346AErrortxtAIT_346A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtAIT_346A_SCALEDText = Int((3 Rnd) + 15) Generate random value between 15 and 18txtAIT_346A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtAIT_346A_SCALEDLinkItem = AIT_346A_SCALEDtxtAIT_346A_SCALEDLinkMode = 2txtAIT_346A_SCALEDLinkPoketxtAIT_346A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeAIT_346AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtAIT_346A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 115

Private Sub txtFIT_321A_SCALED_Change()On Error GoTo PokeFIT_321AErrortxtFIT_321A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtFIT_321A_SCALEDText = Int((10 Rnd) + 120) Generate random value between 120 and 130txtFIT_321A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_321A_SCALEDLinkItem = FIT_321A_SCALEDtxtFIT_321A_SCALEDLinkMode = 2txtFIT_321A_SCALEDLinkPoketxtFIT_321A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total time

PokeFIT_321AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_321A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume Next

End Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 116

Private Sub txtFIT_341A_SCALED_Change()On Error GoTo PokeFIT_341AErrortxtFIT_341A_SCALEDLinkMode = 0 PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTime

txtFIT_341A_SCALEDText = Int((3 Rnd) + 18) Generate random value between 18 and 21

txtFIT_341A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_341A_SCALEDLinkItem = FIT_341A_SCALEDtxtFIT_341A_SCALEDLinkMode = 2txtFIT_341A_SCALEDLinkPoketxtFIT_341A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeFIT_341AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_341A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 117

Private Sub txtFIT_343A_SCALED_Change()On Error GoTo PokeFIT_343AErrortxtFIT_343A_SCALEDLinkMode = 0 PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTime

txtFIT_343A_SCALEDText = Int((1 Rnd) + 3) Generate random value between 3 and 4

txtFIT_343A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_343A_SCALEDLinkItem = FIT_343A_SCALEDtxtFIT_343A_SCALEDLinkMode = 2txtFIT_343A_SCALEDLinkPoketxtFIT_343A_SCALEDLinkMode = 0 DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeFIT_343AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_343A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 118

TUTORIAL

Part 4

Questions

amp

Answers

  • Slide 1
  • Slide 2
  • Slide 3
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Slide 8
  • Slide 9
  • Slide 10
  • Slide 11
  • Slide 12
  • Slide 13
  • Slide 14
  • Slide 15
  • Slide 16
  • Slide 17
  • Slide 18
  • Slide 19
  • Slide 20
  • Slide 21
  • Slide 22
  • Slide 23
  • Slide 24
  • Slide 25
  • Slide 26
  • Slide 27
  • Slide 28
  • Slide 29
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
  • Slide 34
  • Slide 35
  • Slide 36
  • Slide 37
  • Slide 38
  • Slide 39
  • Slide 40
  • Slide 41
  • Slide 42
  • Slide 43
  • Slide 44
  • Slide 45
  • Slide 46
  • Slide 47
  • Slide 48
  • Slide 49
  • Slide 50
  • Slide 51
  • Slide 52
  • Slide 53
  • Slide 54
  • Slide 55
  • Slide 56
  • Slide 57
  • Slide 58
  • Slide 59
  • Slide 60
  • Slide 61
  • Slide 62
  • Slide 63
  • Slide 64
  • Slide 65
  • Slide 66
  • Slide 67
  • Slide 68
  • Slide 69
  • Slide 70
  • Slide 71
  • Slide 72
  • Slide 73
  • Slide 74
  • Slide 75
  • Slide 76
  • Slide 77
  • Slide 78
  • Slide 79
  • Slide 80
  • Slide 81
  • Slide 82
  • Slide 83
  • Slide 84
  • Slide 85
  • Slide 86
  • Slide 87
  • Slide 88
  • Slide 89
  • Slide 90
  • Slide 91
  • Slide 92
  • Slide 93
  • Slide 94
  • Slide 95
  • Slide 96
  • Slide 97
  • Slide 98
  • Slide 99
  • Slide 100
  • Slide 101
  • Slide 102
  • Slide 103
  • Slide 104
  • Slide 105
  • Slide 106
  • Slide 107
  • Slide 108
  • Slide 109
  • Slide 110
  • Slide 111
  • Slide 112
  • Slide 113
  • Slide 114
  • Slide 115
  • Slide 116
  • Slide 117
  • Slide 118
Page 8: TUTORIAL Ethernet PLC's Improve Oxygen Consumption ISA Expo/2001Houston, Texas Water & Wastewater Industry DivisionTuesday, September 11, 2001 1 Brad.

Use of Bacteria The 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 AnoxicOxic 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 Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 8

The purpose of Denitrifying Bacteria is to take up organic matter using the Nitrifying Bacteriarsquos 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

The purpose of Nitrifying Bacteria is to convert the content of AMMONIA in the raw wastewater into NITRATE

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

But Nitrifying Bacteria and Denitrifying Bacteria CANNOT work in the same conditions

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

Factors Effecting Process Performance

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 11

middot Configuration and volume of anoxic and oxic cells

middot Addition points and proportions of oxygen addition

middot Supplementation of carbon source (such as methanol) to enhance the denitrification rate

middot Amount of wastewater treated per day

middot Water temperature and concentration of the bacteria to the process

The factors which influence the process performance of nitrogen removal are

The process incorporates second and third anoxic cells into the treatment scheme in order to meet the effluent limitations using four measured variables

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 12

Biological Oxygen Demand (BOD)

Suspended Solids (SS)

Total Nitrogen (TN)

Total Phosphorous (TP)

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 15

Train Details

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 17

Selecting A Control Level For Oxygen Addition For 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 18

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

Control Levels The following control levels are available for Oxygen

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 20

Oxygen Control Levels

Cascade from Cell 3 Dissolved Oxygen probe

Ratio from Discharge flow

AutoManual Control

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 22

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 23

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 24

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 25

The following control levels are available for the Recycle flow

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 27

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 28

The following control levels are available for the PD Blowers Timed Mode

Dissolved Oxygen Mode

Manual Mode

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

Motor Popup

The following information is available for each motor control from the respective motor popup

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

Aerator Control Motor Popup

Like all motors the following information is available for the Aerator motor control from the motor popup

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 32

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 33

Motor Popup Surface Aerator Control

The following information is available for motor control from the motor popup

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 35

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 36

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 37

Lower Explosive Level (LEL)

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 38

Each train has a digital input that tells whether thecombustible 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 (LEL) system

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 39

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 Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 40

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 41

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 Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 42

Like a DCS

middot 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

middot 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 amp CASCADE amp RATIO PID WITH AUTO amp RATIO Digin Motor Status DigOut Motor (or Digital Composite) Motor with ILock and Perm Numeric Set Timers Alarm Detail and Alarm Tags

middot A single generic trend display to trend ALL trendable (archived) points

Alarm Management

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

middot A Distributed Alarm Summary has been used to give better alarm management tools

bull Up to eight trend pens on the trend display

bull The operator picks which values to trend by clicking in the center of the trend

display

bull 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 44

The AnoxicOxic 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 Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 46

The following control levels are available for Oxygen1 Cascade from Dissolved Oxygen

2 Ratio from Discharge flow3 Auto-Manual Control

The following control levels are available for the Recycle flow1 Ratio from Discharge flow

2 Auto-Manual Control

The following control levels are available for the PD Blowers3 Timed Mode

2 Dissolved Oxygen Mode3 Manual Mode

Conclusions

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 47

Following the commissioning of the ethernet-based PLCs Oxygen consumption was significantly reduced

The advanced controls allow the operators to leave the process alone and continue to optimally treat the sewage

Conclusions

Following the commissioning of the ethernet-based PLCs AnoxicOxic 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 Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 48

Summary

The PD Blowers ran in Timed Mode andor 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

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 Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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 Authoritys 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 50

TUTORIAL

Part 2A

PLC Programming Basics

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 51

Separate parts of the process have been organized into a separate ldquoSECTIONrdquo

PLC Program Organization

Each ldquoSECTIONrdquo can be any of the IEC programming types

bull Ladder (LD)bull Structured Text (ST)

bull Instruction List (IL)

bull Function Blocks (FB)bull Sequential Function Charts (SFC)

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 52

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 53

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 54

IO Map

On-Line PLC Diagnostics

PLC Status

PLC Simulator

Ethernet (TCPIP) Address

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 55

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 56

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 57

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 58

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 59

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 60

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 61

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 62

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 63

Structured Text was used hereNOT Ladder

Programming for Motors

The PLC DOES NOT CAREStructured Text Functions EXACTLY

the same as LadderUse what yoursquore comfortable with

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 64

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 65

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 66

IEC Function Blocks Used Here

Programming for Analogs amp PID

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 67

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 68

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 69

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 70

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 71

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 72

Sequential Function Charts were used here

Higher-Level Control

bull SFCrsquos lend themselves well to (as the name would imply) sequential processes

bull Three Important components in SFCrsquosbull Transitionsbull Stepsbull Jumps

bull The status of the process can be viewed as a flow chart

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 73

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 74

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 75

PLC - HMI Communication

A ldquoPLC Heartbeatrdquo is traditionally used to monitor the PLC - HMI Communication sometimes called ardquoWatchdog Timerrdquo

Call it whatever you want but the PLC amp 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 ldquodiesrdquo then that switch doesnrsquot change state and an alarm alerts the operator

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 76

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 77

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 78

TUTORIAL

Part 2B

HMI Programming

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 79

Ethernet (TCPIP) IO Driver

The Ethernet (TCPIP) IO Driver allows the HMI to communicate with the PLC (In this case the driver is called MBENETEXE)

The PLC has an ethernet module in one of the slots that has a ldquoCAT5RJ-45rdquo 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 ldquoCAT5RJ-45rdquo receptacle for the ethernet cable

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 80

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 81

Operator Screens amp Popup Displays

The display is laid out in 3 sections

bull Upper - Security amp Alarm Windowbull Middle- Main Operator Screens bull Lower - Menu amp Popup Displays

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 82

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 83

Scripting

There are 6 types of ldquoScriptsrdquobull Application Scriptsbull Key Scriptsbull Condition Scriptsbull Data Change Scriptsbull Quick Function Scriptsbull ActiveX Event Scripts

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 84

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 85

Access Names

The ldquoAccess Namesrdquo Must be configured to allow the PLC - HMI communications

Note that the ldquoApplicationTopicrdquo is the same as the IO Driver

The ldquocomputer namerdquo is the name of the PC that the HMI is running on (brad_s_carlberg in this case)

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 86

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 87

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 88

Indirect Tags

ldquoIndirect Tagsrdquo were used here to minimize the number of popup displays

This is especially useful in HMIrsquos with many tags

ONLY 12 popup displays are reused throughout the HMI

This gives the HMI a ldquoDCS-Likerdquo Look amp Feel

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 89

Popup Display TypesThe tag point type determines which popup display to use

Analog InputHIC (or Analog Output)PID (or Analog Composite)

bull PID WITH AUTO amp CASCADE amp RATIObull PID WITH AUTO amp RATIO

Diginbull Motor Status

DigOutMotor (or Digital Composite)

bull Motor with ILock and PermNumericSet TimersAlarm DetailAlarm Tags

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 90

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 91

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 92

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 93

Bars Buttons amp Sliders

By choosing to use indirect tags we complicate the Bar Graphs Buttons amp Sliders in the popup displays

Different scales need to be used for different engineering unit ranges

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 94

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 95

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 96

Popup Displays

The next two pages shows how the individual popup displays use the indirect tags

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 97

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 98

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 99

Adding a ldquoTouch Targetrdquo to a Display

2 Tell which tags to use

3 Tell which popup display to call upWhat kind of point type is it

3 Steps1 Tell which scale to use (if itrsquos an analog point type)

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 100

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 101

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 102

TUTORIAL

Part 2C

Excel Spreadsheets

amp

Visual Basic

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 103

A ldquoCHEAP amp DIRTYrdquo HMI With Excel

The 4 key parameters are

To communicate with the PLCUse brad_s_carlbergmbenet|ANOXIC_OXICrsquoplcregisterrsquo

Excel uses ldquopeeksrdquo amp ldquopokesrdquo to read from amp write to a PLC or HMI

To communicate with the HMIbrad_s_carlbergview|Tagnamersquotagnamersquo

bull computer namebull applicationbull topicbull item

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 104

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 105

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 106

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 107

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 108

Excel Macros

bull ldquoRequestrdquo Macro to read values

bull ldquoPokerdquo Macro to write values

bull A Sample Excel Macro

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 109

Sub PokeMacro()MsgBox ApplicationNetworkTemplatesPathChannel = ApplicationDDEInitiate(app=brad_s_carlbergVIEW topic=Tagname) This opens a DDE channel to ViewApplicationDDEPoke Channel Temperature1 Worksheets(Sheet1)Range(A1) Puts value from R1C1 into Temperature1ApplicationDDEPoke Channel DDEReal Worksheets(Sheet1)Range(A2) Puts value from R1C1 into Temperature1ApplicationDDEPoke Channel DDEInteger Worksheets(Sheet1)Range(A3) Puts value from R1C1 into Temperature1ApplicationDDETerminate Channel This terminates the DDE channelEnd SubSub RequestMacro()Channel = ApplicationDDEInitiate(app=brad_s_carlbergVIEW topic=Tagname) This opens a DDE channel to ViewWorksheets(Sheet1)Range(C4) = ApplicationDDERequest(Channel $Hour)Worksheets(Sheet1)Range(C5) = ApplicationDDERequest(Channel $Minute)Worksheets(Sheet1)Range(C6) = ApplicationDDERequest(Channel $Second)Worksheets(Sheet1)Range(C9) = ApplicationDDERequest(Channel $day)Worksheets(Sheet1)Range(C10) = ApplicationDDERequest(Channel $date)Worksheets(Sheet1)Range(C11) = ApplicationDDERequest(Channel $datestring)Worksheets(Sheet1)Range(C12) = ApplicationDDERequest(Channel $datetime)Worksheets(Sheet1)Range(C13) = ApplicationDDERequest(Channel $date)Worksheets(Sheet1)Range(C14) = ApplicationDDERequest(Channel $month)Worksheets(Sheet1)Range(C15) = ApplicationDDERequest(Channel $year)Worksheets(Sheet1)Range(C16) = ApplicationDDERequest(Channel $time)Worksheets(Sheet1)Range(C17) = ApplicationDDERequest(Channel $timestring)Worksheets(Sheet1)Range(C18) = ApplicationDDERequest(Channel $applicationversion)Worksheets(Sheet1)Range(C19) = ApplicationDDERequest(Channel $startddeconversations)Worksheets(Sheet1)Range(C20) = ApplicationDDERequest(Channel $accesslevel)Worksheets(Sheet1)Range(C21) = ApplicationDDERequest(Channel $alarmlogging)Worksheets(Sheet1)Range(C22) = ApplicationDDERequest(Channel $applicationchanged)Worksheets(Sheet1)Range(C23) = ApplicationDDERequest(Channel $configureusers)Worksheets(Sheet1)Range(C24) = ApplicationDDERequest(Channel $changepassword)Worksheets(Sheet1)Range(C25) = ApplicationDDERequest(Channel $InactivityTimeout)Worksheets(Sheet1)Range(C26) = ApplicationDDERequest(Channel $InactivityWarning)Worksheets(Sheet1)Range(C27) = ApplicationDDERequest(Channel $LogicRunning)Worksheets(Sheet1)Range(C28) = ApplicationDDERequest(Channel $OperatorEntered)Worksheets(Sheet1)Range(C29) = ApplicationDDERequest(Channel $Operator)Worksheets(Sheet1)Range(C30) = ApplicationDDERequest(Channel $PasswordEntered)ApplicationDDETerminate Channel This terminates the DDE channelEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 110

Visual Basic

ldquoRoll Your Ownrdquo HMI - Much More powerful than Excel

Key Parameters computer nameapplication|topicitem

IO Emulator - MBPlusSimulateexe

Can ldquoRead Fromrdquo amp ldquoWrite Tordquo PLC andor HMI

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 111

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 112

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 113

Dim PauseTime Start Finish TotalTime As Integer Declare variables

Private Sub txtAIT_332A_SCALED_Change()On Error GoTo PokeAIT_332AErrortxtAIT_332A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtAIT_332A_SCALEDText = Int((3 Rnd) + 20) Generate random value between 20 and 23txtAIT_332A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtAIT_332A_SCALEDLinkItem = AIT_332A_SCALEDtxtAIT_332A_SCALEDLinkMode = 2txtAIT_332A_SCALEDLinkPoketxtAIT_332A_SCALEDLinkMode = 0 DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total time

PokeAIT_332AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtAIT_332A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 114

Private Sub txtAIT_346A_SCALED_Change()On Error GoTo PokeAIT_346AErrortxtAIT_346A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtAIT_346A_SCALEDText = Int((3 Rnd) + 15) Generate random value between 15 and 18txtAIT_346A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtAIT_346A_SCALEDLinkItem = AIT_346A_SCALEDtxtAIT_346A_SCALEDLinkMode = 2txtAIT_346A_SCALEDLinkPoketxtAIT_346A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeAIT_346AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtAIT_346A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 115

Private Sub txtFIT_321A_SCALED_Change()On Error GoTo PokeFIT_321AErrortxtFIT_321A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtFIT_321A_SCALEDText = Int((10 Rnd) + 120) Generate random value between 120 and 130txtFIT_321A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_321A_SCALEDLinkItem = FIT_321A_SCALEDtxtFIT_321A_SCALEDLinkMode = 2txtFIT_321A_SCALEDLinkPoketxtFIT_321A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total time

PokeFIT_321AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_321A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume Next

End Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 116

Private Sub txtFIT_341A_SCALED_Change()On Error GoTo PokeFIT_341AErrortxtFIT_341A_SCALEDLinkMode = 0 PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTime

txtFIT_341A_SCALEDText = Int((3 Rnd) + 18) Generate random value between 18 and 21

txtFIT_341A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_341A_SCALEDLinkItem = FIT_341A_SCALEDtxtFIT_341A_SCALEDLinkMode = 2txtFIT_341A_SCALEDLinkPoketxtFIT_341A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeFIT_341AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_341A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 117

Private Sub txtFIT_343A_SCALED_Change()On Error GoTo PokeFIT_343AErrortxtFIT_343A_SCALEDLinkMode = 0 PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTime

txtFIT_343A_SCALEDText = Int((1 Rnd) + 3) Generate random value between 3 and 4

txtFIT_343A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_343A_SCALEDLinkItem = FIT_343A_SCALEDtxtFIT_343A_SCALEDLinkMode = 2txtFIT_343A_SCALEDLinkPoketxtFIT_343A_SCALEDLinkMode = 0 DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeFIT_343AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_343A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 118

TUTORIAL

Part 4

Questions

amp

Answers

  • Slide 1
  • Slide 2
  • Slide 3
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Slide 8
  • Slide 9
  • Slide 10
  • Slide 11
  • Slide 12
  • Slide 13
  • Slide 14
  • Slide 15
  • Slide 16
  • Slide 17
  • Slide 18
  • Slide 19
  • Slide 20
  • Slide 21
  • Slide 22
  • Slide 23
  • Slide 24
  • Slide 25
  • Slide 26
  • Slide 27
  • Slide 28
  • Slide 29
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
  • Slide 34
  • Slide 35
  • Slide 36
  • Slide 37
  • Slide 38
  • Slide 39
  • Slide 40
  • Slide 41
  • Slide 42
  • Slide 43
  • Slide 44
  • Slide 45
  • Slide 46
  • Slide 47
  • Slide 48
  • Slide 49
  • Slide 50
  • Slide 51
  • Slide 52
  • Slide 53
  • Slide 54
  • Slide 55
  • Slide 56
  • Slide 57
  • Slide 58
  • Slide 59
  • Slide 60
  • Slide 61
  • Slide 62
  • Slide 63
  • Slide 64
  • Slide 65
  • Slide 66
  • Slide 67
  • Slide 68
  • Slide 69
  • Slide 70
  • Slide 71
  • Slide 72
  • Slide 73
  • Slide 74
  • Slide 75
  • Slide 76
  • Slide 77
  • Slide 78
  • Slide 79
  • Slide 80
  • Slide 81
  • Slide 82
  • Slide 83
  • Slide 84
  • Slide 85
  • Slide 86
  • Slide 87
  • Slide 88
  • Slide 89
  • Slide 90
  • Slide 91
  • Slide 92
  • Slide 93
  • Slide 94
  • Slide 95
  • Slide 96
  • Slide 97
  • Slide 98
  • Slide 99
  • Slide 100
  • Slide 101
  • Slide 102
  • Slide 103
  • Slide 104
  • Slide 105
  • Slide 106
  • Slide 107
  • Slide 108
  • Slide 109
  • Slide 110
  • Slide 111
  • Slide 112
  • Slide 113
  • Slide 114
  • Slide 115
  • Slide 116
  • Slide 117
  • Slide 118
Page 9: TUTORIAL Ethernet PLC's Improve Oxygen Consumption ISA Expo/2001Houston, Texas Water & Wastewater Industry DivisionTuesday, September 11, 2001 1 Brad.

The purpose of Nitrifying Bacteria is to convert the content of AMMONIA in the raw wastewater into NITRATE

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

But Nitrifying Bacteria and Denitrifying Bacteria CANNOT work in the same conditions

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

Factors Effecting Process Performance

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 11

middot Configuration and volume of anoxic and oxic cells

middot Addition points and proportions of oxygen addition

middot Supplementation of carbon source (such as methanol) to enhance the denitrification rate

middot Amount of wastewater treated per day

middot Water temperature and concentration of the bacteria to the process

The factors which influence the process performance of nitrogen removal are

The process incorporates second and third anoxic cells into the treatment scheme in order to meet the effluent limitations using four measured variables

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 12

Biological Oxygen Demand (BOD)

Suspended Solids (SS)

Total Nitrogen (TN)

Total Phosphorous (TP)

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 15

Train Details

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 17

Selecting A Control Level For Oxygen Addition For 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 18

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

Control Levels The following control levels are available for Oxygen

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 20

Oxygen Control Levels

Cascade from Cell 3 Dissolved Oxygen probe

Ratio from Discharge flow

AutoManual Control

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 22

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 23

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 24

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 25

The following control levels are available for the Recycle flow

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 27

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 28

The following control levels are available for the PD Blowers Timed Mode

Dissolved Oxygen Mode

Manual Mode

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

Motor Popup

The following information is available for each motor control from the respective motor popup

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

Aerator Control Motor Popup

Like all motors the following information is available for the Aerator motor control from the motor popup

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 32

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 33

Motor Popup Surface Aerator Control

The following information is available for motor control from the motor popup

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 35

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 36

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 37

Lower Explosive Level (LEL)

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 38

Each train has a digital input that tells whether thecombustible 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 (LEL) system

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 39

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 Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 40

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 41

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 Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 42

Like a DCS

middot 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

middot 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 amp CASCADE amp RATIO PID WITH AUTO amp RATIO Digin Motor Status DigOut Motor (or Digital Composite) Motor with ILock and Perm Numeric Set Timers Alarm Detail and Alarm Tags

middot A single generic trend display to trend ALL trendable (archived) points

Alarm Management

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

middot A Distributed Alarm Summary has been used to give better alarm management tools

bull Up to eight trend pens on the trend display

bull The operator picks which values to trend by clicking in the center of the trend

display

bull 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 44

The AnoxicOxic 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 Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 46

The following control levels are available for Oxygen1 Cascade from Dissolved Oxygen

2 Ratio from Discharge flow3 Auto-Manual Control

The following control levels are available for the Recycle flow1 Ratio from Discharge flow

2 Auto-Manual Control

The following control levels are available for the PD Blowers3 Timed Mode

2 Dissolved Oxygen Mode3 Manual Mode

Conclusions

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 47

Following the commissioning of the ethernet-based PLCs Oxygen consumption was significantly reduced

The advanced controls allow the operators to leave the process alone and continue to optimally treat the sewage

Conclusions

Following the commissioning of the ethernet-based PLCs AnoxicOxic 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 Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 48

Summary

The PD Blowers ran in Timed Mode andor 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

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 Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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 Authoritys 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 50

TUTORIAL

Part 2A

PLC Programming Basics

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 51

Separate parts of the process have been organized into a separate ldquoSECTIONrdquo

PLC Program Organization

Each ldquoSECTIONrdquo can be any of the IEC programming types

bull Ladder (LD)bull Structured Text (ST)

bull Instruction List (IL)

bull Function Blocks (FB)bull Sequential Function Charts (SFC)

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 52

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 53

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 54

IO Map

On-Line PLC Diagnostics

PLC Status

PLC Simulator

Ethernet (TCPIP) Address

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 55

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 56

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 57

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 58

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 59

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 60

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 61

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 62

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 63

Structured Text was used hereNOT Ladder

Programming for Motors

The PLC DOES NOT CAREStructured Text Functions EXACTLY

the same as LadderUse what yoursquore comfortable with

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 64

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 65

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 66

IEC Function Blocks Used Here

Programming for Analogs amp PID

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 67

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 68

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 69

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 70

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 71

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 72

Sequential Function Charts were used here

Higher-Level Control

bull SFCrsquos lend themselves well to (as the name would imply) sequential processes

bull Three Important components in SFCrsquosbull Transitionsbull Stepsbull Jumps

bull The status of the process can be viewed as a flow chart

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 73

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 74

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 75

PLC - HMI Communication

A ldquoPLC Heartbeatrdquo is traditionally used to monitor the PLC - HMI Communication sometimes called ardquoWatchdog Timerrdquo

Call it whatever you want but the PLC amp 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 ldquodiesrdquo then that switch doesnrsquot change state and an alarm alerts the operator

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 76

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 77

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 78

TUTORIAL

Part 2B

HMI Programming

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 79

Ethernet (TCPIP) IO Driver

The Ethernet (TCPIP) IO Driver allows the HMI to communicate with the PLC (In this case the driver is called MBENETEXE)

The PLC has an ethernet module in one of the slots that has a ldquoCAT5RJ-45rdquo 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 ldquoCAT5RJ-45rdquo receptacle for the ethernet cable

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 80

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 81

Operator Screens amp Popup Displays

The display is laid out in 3 sections

bull Upper - Security amp Alarm Windowbull Middle- Main Operator Screens bull Lower - Menu amp Popup Displays

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 82

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 83

Scripting

There are 6 types of ldquoScriptsrdquobull Application Scriptsbull Key Scriptsbull Condition Scriptsbull Data Change Scriptsbull Quick Function Scriptsbull ActiveX Event Scripts

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 84

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 85

Access Names

The ldquoAccess Namesrdquo Must be configured to allow the PLC - HMI communications

Note that the ldquoApplicationTopicrdquo is the same as the IO Driver

The ldquocomputer namerdquo is the name of the PC that the HMI is running on (brad_s_carlberg in this case)

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 86

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 87

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 88

Indirect Tags

ldquoIndirect Tagsrdquo were used here to minimize the number of popup displays

This is especially useful in HMIrsquos with many tags

ONLY 12 popup displays are reused throughout the HMI

This gives the HMI a ldquoDCS-Likerdquo Look amp Feel

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 89

Popup Display TypesThe tag point type determines which popup display to use

Analog InputHIC (or Analog Output)PID (or Analog Composite)

bull PID WITH AUTO amp CASCADE amp RATIObull PID WITH AUTO amp RATIO

Diginbull Motor Status

DigOutMotor (or Digital Composite)

bull Motor with ILock and PermNumericSet TimersAlarm DetailAlarm Tags

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 90

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 91

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 92

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 93

Bars Buttons amp Sliders

By choosing to use indirect tags we complicate the Bar Graphs Buttons amp Sliders in the popup displays

Different scales need to be used for different engineering unit ranges

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 94

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 95

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 96

Popup Displays

The next two pages shows how the individual popup displays use the indirect tags

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 97

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 98

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 99

Adding a ldquoTouch Targetrdquo to a Display

2 Tell which tags to use

3 Tell which popup display to call upWhat kind of point type is it

3 Steps1 Tell which scale to use (if itrsquos an analog point type)

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 100

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 101

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 102

TUTORIAL

Part 2C

Excel Spreadsheets

amp

Visual Basic

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 103

A ldquoCHEAP amp DIRTYrdquo HMI With Excel

The 4 key parameters are

To communicate with the PLCUse brad_s_carlbergmbenet|ANOXIC_OXICrsquoplcregisterrsquo

Excel uses ldquopeeksrdquo amp ldquopokesrdquo to read from amp write to a PLC or HMI

To communicate with the HMIbrad_s_carlbergview|Tagnamersquotagnamersquo

bull computer namebull applicationbull topicbull item

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 104

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 105

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 106

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 107

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 108

Excel Macros

bull ldquoRequestrdquo Macro to read values

bull ldquoPokerdquo Macro to write values

bull A Sample Excel Macro

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 109

Sub PokeMacro()MsgBox ApplicationNetworkTemplatesPathChannel = ApplicationDDEInitiate(app=brad_s_carlbergVIEW topic=Tagname) This opens a DDE channel to ViewApplicationDDEPoke Channel Temperature1 Worksheets(Sheet1)Range(A1) Puts value from R1C1 into Temperature1ApplicationDDEPoke Channel DDEReal Worksheets(Sheet1)Range(A2) Puts value from R1C1 into Temperature1ApplicationDDEPoke Channel DDEInteger Worksheets(Sheet1)Range(A3) Puts value from R1C1 into Temperature1ApplicationDDETerminate Channel This terminates the DDE channelEnd SubSub RequestMacro()Channel = ApplicationDDEInitiate(app=brad_s_carlbergVIEW topic=Tagname) This opens a DDE channel to ViewWorksheets(Sheet1)Range(C4) = ApplicationDDERequest(Channel $Hour)Worksheets(Sheet1)Range(C5) = ApplicationDDERequest(Channel $Minute)Worksheets(Sheet1)Range(C6) = ApplicationDDERequest(Channel $Second)Worksheets(Sheet1)Range(C9) = ApplicationDDERequest(Channel $day)Worksheets(Sheet1)Range(C10) = ApplicationDDERequest(Channel $date)Worksheets(Sheet1)Range(C11) = ApplicationDDERequest(Channel $datestring)Worksheets(Sheet1)Range(C12) = ApplicationDDERequest(Channel $datetime)Worksheets(Sheet1)Range(C13) = ApplicationDDERequest(Channel $date)Worksheets(Sheet1)Range(C14) = ApplicationDDERequest(Channel $month)Worksheets(Sheet1)Range(C15) = ApplicationDDERequest(Channel $year)Worksheets(Sheet1)Range(C16) = ApplicationDDERequest(Channel $time)Worksheets(Sheet1)Range(C17) = ApplicationDDERequest(Channel $timestring)Worksheets(Sheet1)Range(C18) = ApplicationDDERequest(Channel $applicationversion)Worksheets(Sheet1)Range(C19) = ApplicationDDERequest(Channel $startddeconversations)Worksheets(Sheet1)Range(C20) = ApplicationDDERequest(Channel $accesslevel)Worksheets(Sheet1)Range(C21) = ApplicationDDERequest(Channel $alarmlogging)Worksheets(Sheet1)Range(C22) = ApplicationDDERequest(Channel $applicationchanged)Worksheets(Sheet1)Range(C23) = ApplicationDDERequest(Channel $configureusers)Worksheets(Sheet1)Range(C24) = ApplicationDDERequest(Channel $changepassword)Worksheets(Sheet1)Range(C25) = ApplicationDDERequest(Channel $InactivityTimeout)Worksheets(Sheet1)Range(C26) = ApplicationDDERequest(Channel $InactivityWarning)Worksheets(Sheet1)Range(C27) = ApplicationDDERequest(Channel $LogicRunning)Worksheets(Sheet1)Range(C28) = ApplicationDDERequest(Channel $OperatorEntered)Worksheets(Sheet1)Range(C29) = ApplicationDDERequest(Channel $Operator)Worksheets(Sheet1)Range(C30) = ApplicationDDERequest(Channel $PasswordEntered)ApplicationDDETerminate Channel This terminates the DDE channelEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 110

Visual Basic

ldquoRoll Your Ownrdquo HMI - Much More powerful than Excel

Key Parameters computer nameapplication|topicitem

IO Emulator - MBPlusSimulateexe

Can ldquoRead Fromrdquo amp ldquoWrite Tordquo PLC andor HMI

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 111

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 112

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 113

Dim PauseTime Start Finish TotalTime As Integer Declare variables

Private Sub txtAIT_332A_SCALED_Change()On Error GoTo PokeAIT_332AErrortxtAIT_332A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtAIT_332A_SCALEDText = Int((3 Rnd) + 20) Generate random value between 20 and 23txtAIT_332A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtAIT_332A_SCALEDLinkItem = AIT_332A_SCALEDtxtAIT_332A_SCALEDLinkMode = 2txtAIT_332A_SCALEDLinkPoketxtAIT_332A_SCALEDLinkMode = 0 DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total time

PokeAIT_332AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtAIT_332A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 114

Private Sub txtAIT_346A_SCALED_Change()On Error GoTo PokeAIT_346AErrortxtAIT_346A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtAIT_346A_SCALEDText = Int((3 Rnd) + 15) Generate random value between 15 and 18txtAIT_346A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtAIT_346A_SCALEDLinkItem = AIT_346A_SCALEDtxtAIT_346A_SCALEDLinkMode = 2txtAIT_346A_SCALEDLinkPoketxtAIT_346A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeAIT_346AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtAIT_346A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 115

Private Sub txtFIT_321A_SCALED_Change()On Error GoTo PokeFIT_321AErrortxtFIT_321A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtFIT_321A_SCALEDText = Int((10 Rnd) + 120) Generate random value between 120 and 130txtFIT_321A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_321A_SCALEDLinkItem = FIT_321A_SCALEDtxtFIT_321A_SCALEDLinkMode = 2txtFIT_321A_SCALEDLinkPoketxtFIT_321A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total time

PokeFIT_321AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_321A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume Next

End Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 116

Private Sub txtFIT_341A_SCALED_Change()On Error GoTo PokeFIT_341AErrortxtFIT_341A_SCALEDLinkMode = 0 PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTime

txtFIT_341A_SCALEDText = Int((3 Rnd) + 18) Generate random value between 18 and 21

txtFIT_341A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_341A_SCALEDLinkItem = FIT_341A_SCALEDtxtFIT_341A_SCALEDLinkMode = 2txtFIT_341A_SCALEDLinkPoketxtFIT_341A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeFIT_341AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_341A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 117

Private Sub txtFIT_343A_SCALED_Change()On Error GoTo PokeFIT_343AErrortxtFIT_343A_SCALEDLinkMode = 0 PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTime

txtFIT_343A_SCALEDText = Int((1 Rnd) + 3) Generate random value between 3 and 4

txtFIT_343A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_343A_SCALEDLinkItem = FIT_343A_SCALEDtxtFIT_343A_SCALEDLinkMode = 2txtFIT_343A_SCALEDLinkPoketxtFIT_343A_SCALEDLinkMode = 0 DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeFIT_343AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_343A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 118

TUTORIAL

Part 4

Questions

amp

Answers

  • Slide 1
  • Slide 2
  • Slide 3
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Slide 8
  • Slide 9
  • Slide 10
  • Slide 11
  • Slide 12
  • Slide 13
  • Slide 14
  • Slide 15
  • Slide 16
  • Slide 17
  • Slide 18
  • Slide 19
  • Slide 20
  • Slide 21
  • Slide 22
  • Slide 23
  • Slide 24
  • Slide 25
  • Slide 26
  • Slide 27
  • Slide 28
  • Slide 29
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
  • Slide 34
  • Slide 35
  • Slide 36
  • Slide 37
  • Slide 38
  • Slide 39
  • Slide 40
  • Slide 41
  • Slide 42
  • Slide 43
  • Slide 44
  • Slide 45
  • Slide 46
  • Slide 47
  • Slide 48
  • Slide 49
  • Slide 50
  • Slide 51
  • Slide 52
  • Slide 53
  • Slide 54
  • Slide 55
  • Slide 56
  • Slide 57
  • Slide 58
  • Slide 59
  • Slide 60
  • Slide 61
  • Slide 62
  • Slide 63
  • Slide 64
  • Slide 65
  • Slide 66
  • Slide 67
  • Slide 68
  • Slide 69
  • Slide 70
  • Slide 71
  • Slide 72
  • Slide 73
  • Slide 74
  • Slide 75
  • Slide 76
  • Slide 77
  • Slide 78
  • Slide 79
  • Slide 80
  • Slide 81
  • Slide 82
  • Slide 83
  • Slide 84
  • Slide 85
  • Slide 86
  • Slide 87
  • Slide 88
  • Slide 89
  • Slide 90
  • Slide 91
  • Slide 92
  • Slide 93
  • Slide 94
  • Slide 95
  • Slide 96
  • Slide 97
  • Slide 98
  • Slide 99
  • Slide 100
  • Slide 101
  • Slide 102
  • Slide 103
  • Slide 104
  • Slide 105
  • Slide 106
  • Slide 107
  • Slide 108
  • Slide 109
  • Slide 110
  • Slide 111
  • Slide 112
  • Slide 113
  • Slide 114
  • Slide 115
  • Slide 116
  • Slide 117
  • Slide 118
Page 10: TUTORIAL Ethernet PLC's Improve Oxygen Consumption ISA Expo/2001Houston, Texas Water & Wastewater Industry DivisionTuesday, September 11, 2001 1 Brad.

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

Factors Effecting Process Performance

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 11

middot Configuration and volume of anoxic and oxic cells

middot Addition points and proportions of oxygen addition

middot Supplementation of carbon source (such as methanol) to enhance the denitrification rate

middot Amount of wastewater treated per day

middot Water temperature and concentration of the bacteria to the process

The factors which influence the process performance of nitrogen removal are

The process incorporates second and third anoxic cells into the treatment scheme in order to meet the effluent limitations using four measured variables

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 12

Biological Oxygen Demand (BOD)

Suspended Solids (SS)

Total Nitrogen (TN)

Total Phosphorous (TP)

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 15

Train Details

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 17

Selecting A Control Level For Oxygen Addition For 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 18

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

Control Levels The following control levels are available for Oxygen

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 20

Oxygen Control Levels

Cascade from Cell 3 Dissolved Oxygen probe

Ratio from Discharge flow

AutoManual Control

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 22

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 23

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 24

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 25

The following control levels are available for the Recycle flow

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 27

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 28

The following control levels are available for the PD Blowers Timed Mode

Dissolved Oxygen Mode

Manual Mode

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

Motor Popup

The following information is available for each motor control from the respective motor popup

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

Aerator Control Motor Popup

Like all motors the following information is available for the Aerator motor control from the motor popup

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 32

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 33

Motor Popup Surface Aerator Control

The following information is available for motor control from the motor popup

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 35

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 36

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 37

Lower Explosive Level (LEL)

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 38

Each train has a digital input that tells whether thecombustible 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 (LEL) system

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 39

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 Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 40

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 41

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 Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 42

Like a DCS

middot 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

middot 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 amp CASCADE amp RATIO PID WITH AUTO amp RATIO Digin Motor Status DigOut Motor (or Digital Composite) Motor with ILock and Perm Numeric Set Timers Alarm Detail and Alarm Tags

middot A single generic trend display to trend ALL trendable (archived) points

Alarm Management

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

middot A Distributed Alarm Summary has been used to give better alarm management tools

bull Up to eight trend pens on the trend display

bull The operator picks which values to trend by clicking in the center of the trend

display

bull 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 44

The AnoxicOxic 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 Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 46

The following control levels are available for Oxygen1 Cascade from Dissolved Oxygen

2 Ratio from Discharge flow3 Auto-Manual Control

The following control levels are available for the Recycle flow1 Ratio from Discharge flow

2 Auto-Manual Control

The following control levels are available for the PD Blowers3 Timed Mode

2 Dissolved Oxygen Mode3 Manual Mode

Conclusions

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 47

Following the commissioning of the ethernet-based PLCs Oxygen consumption was significantly reduced

The advanced controls allow the operators to leave the process alone and continue to optimally treat the sewage

Conclusions

Following the commissioning of the ethernet-based PLCs AnoxicOxic 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 Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 48

Summary

The PD Blowers ran in Timed Mode andor 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

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 Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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 Authoritys 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 50

TUTORIAL

Part 2A

PLC Programming Basics

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 51

Separate parts of the process have been organized into a separate ldquoSECTIONrdquo

PLC Program Organization

Each ldquoSECTIONrdquo can be any of the IEC programming types

bull Ladder (LD)bull Structured Text (ST)

bull Instruction List (IL)

bull Function Blocks (FB)bull Sequential Function Charts (SFC)

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 52

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 53

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 54

IO Map

On-Line PLC Diagnostics

PLC Status

PLC Simulator

Ethernet (TCPIP) Address

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 55

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 56

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 57

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 58

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 59

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 60

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 61

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 62

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 63

Structured Text was used hereNOT Ladder

Programming for Motors

The PLC DOES NOT CAREStructured Text Functions EXACTLY

the same as LadderUse what yoursquore comfortable with

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 64

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 65

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 66

IEC Function Blocks Used Here

Programming for Analogs amp PID

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 67

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 68

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 69

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 70

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 71

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 72

Sequential Function Charts were used here

Higher-Level Control

bull SFCrsquos lend themselves well to (as the name would imply) sequential processes

bull Three Important components in SFCrsquosbull Transitionsbull Stepsbull Jumps

bull The status of the process can be viewed as a flow chart

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 73

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 74

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 75

PLC - HMI Communication

A ldquoPLC Heartbeatrdquo is traditionally used to monitor the PLC - HMI Communication sometimes called ardquoWatchdog Timerrdquo

Call it whatever you want but the PLC amp 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 ldquodiesrdquo then that switch doesnrsquot change state and an alarm alerts the operator

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 76

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 77

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 78

TUTORIAL

Part 2B

HMI Programming

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 79

Ethernet (TCPIP) IO Driver

The Ethernet (TCPIP) IO Driver allows the HMI to communicate with the PLC (In this case the driver is called MBENETEXE)

The PLC has an ethernet module in one of the slots that has a ldquoCAT5RJ-45rdquo 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 ldquoCAT5RJ-45rdquo receptacle for the ethernet cable

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 80

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 81

Operator Screens amp Popup Displays

The display is laid out in 3 sections

bull Upper - Security amp Alarm Windowbull Middle- Main Operator Screens bull Lower - Menu amp Popup Displays

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 82

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 83

Scripting

There are 6 types of ldquoScriptsrdquobull Application Scriptsbull Key Scriptsbull Condition Scriptsbull Data Change Scriptsbull Quick Function Scriptsbull ActiveX Event Scripts

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 84

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 85

Access Names

The ldquoAccess Namesrdquo Must be configured to allow the PLC - HMI communications

Note that the ldquoApplicationTopicrdquo is the same as the IO Driver

The ldquocomputer namerdquo is the name of the PC that the HMI is running on (brad_s_carlberg in this case)

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 86

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 87

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 88

Indirect Tags

ldquoIndirect Tagsrdquo were used here to minimize the number of popup displays

This is especially useful in HMIrsquos with many tags

ONLY 12 popup displays are reused throughout the HMI

This gives the HMI a ldquoDCS-Likerdquo Look amp Feel

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 89

Popup Display TypesThe tag point type determines which popup display to use

Analog InputHIC (or Analog Output)PID (or Analog Composite)

bull PID WITH AUTO amp CASCADE amp RATIObull PID WITH AUTO amp RATIO

Diginbull Motor Status

DigOutMotor (or Digital Composite)

bull Motor with ILock and PermNumericSet TimersAlarm DetailAlarm Tags

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 90

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 91

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 92

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 93

Bars Buttons amp Sliders

By choosing to use indirect tags we complicate the Bar Graphs Buttons amp Sliders in the popup displays

Different scales need to be used for different engineering unit ranges

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 94

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 95

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 96

Popup Displays

The next two pages shows how the individual popup displays use the indirect tags

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 97

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 98

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 99

Adding a ldquoTouch Targetrdquo to a Display

2 Tell which tags to use

3 Tell which popup display to call upWhat kind of point type is it

3 Steps1 Tell which scale to use (if itrsquos an analog point type)

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 100

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 101

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 102

TUTORIAL

Part 2C

Excel Spreadsheets

amp

Visual Basic

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 103

A ldquoCHEAP amp DIRTYrdquo HMI With Excel

The 4 key parameters are

To communicate with the PLCUse brad_s_carlbergmbenet|ANOXIC_OXICrsquoplcregisterrsquo

Excel uses ldquopeeksrdquo amp ldquopokesrdquo to read from amp write to a PLC or HMI

To communicate with the HMIbrad_s_carlbergview|Tagnamersquotagnamersquo

bull computer namebull applicationbull topicbull item

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 104

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 105

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 106

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 107

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 108

Excel Macros

bull ldquoRequestrdquo Macro to read values

bull ldquoPokerdquo Macro to write values

bull A Sample Excel Macro

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 109

Sub PokeMacro()MsgBox ApplicationNetworkTemplatesPathChannel = ApplicationDDEInitiate(app=brad_s_carlbergVIEW topic=Tagname) This opens a DDE channel to ViewApplicationDDEPoke Channel Temperature1 Worksheets(Sheet1)Range(A1) Puts value from R1C1 into Temperature1ApplicationDDEPoke Channel DDEReal Worksheets(Sheet1)Range(A2) Puts value from R1C1 into Temperature1ApplicationDDEPoke Channel DDEInteger Worksheets(Sheet1)Range(A3) Puts value from R1C1 into Temperature1ApplicationDDETerminate Channel This terminates the DDE channelEnd SubSub RequestMacro()Channel = ApplicationDDEInitiate(app=brad_s_carlbergVIEW topic=Tagname) This opens a DDE channel to ViewWorksheets(Sheet1)Range(C4) = ApplicationDDERequest(Channel $Hour)Worksheets(Sheet1)Range(C5) = ApplicationDDERequest(Channel $Minute)Worksheets(Sheet1)Range(C6) = ApplicationDDERequest(Channel $Second)Worksheets(Sheet1)Range(C9) = ApplicationDDERequest(Channel $day)Worksheets(Sheet1)Range(C10) = ApplicationDDERequest(Channel $date)Worksheets(Sheet1)Range(C11) = ApplicationDDERequest(Channel $datestring)Worksheets(Sheet1)Range(C12) = ApplicationDDERequest(Channel $datetime)Worksheets(Sheet1)Range(C13) = ApplicationDDERequest(Channel $date)Worksheets(Sheet1)Range(C14) = ApplicationDDERequest(Channel $month)Worksheets(Sheet1)Range(C15) = ApplicationDDERequest(Channel $year)Worksheets(Sheet1)Range(C16) = ApplicationDDERequest(Channel $time)Worksheets(Sheet1)Range(C17) = ApplicationDDERequest(Channel $timestring)Worksheets(Sheet1)Range(C18) = ApplicationDDERequest(Channel $applicationversion)Worksheets(Sheet1)Range(C19) = ApplicationDDERequest(Channel $startddeconversations)Worksheets(Sheet1)Range(C20) = ApplicationDDERequest(Channel $accesslevel)Worksheets(Sheet1)Range(C21) = ApplicationDDERequest(Channel $alarmlogging)Worksheets(Sheet1)Range(C22) = ApplicationDDERequest(Channel $applicationchanged)Worksheets(Sheet1)Range(C23) = ApplicationDDERequest(Channel $configureusers)Worksheets(Sheet1)Range(C24) = ApplicationDDERequest(Channel $changepassword)Worksheets(Sheet1)Range(C25) = ApplicationDDERequest(Channel $InactivityTimeout)Worksheets(Sheet1)Range(C26) = ApplicationDDERequest(Channel $InactivityWarning)Worksheets(Sheet1)Range(C27) = ApplicationDDERequest(Channel $LogicRunning)Worksheets(Sheet1)Range(C28) = ApplicationDDERequest(Channel $OperatorEntered)Worksheets(Sheet1)Range(C29) = ApplicationDDERequest(Channel $Operator)Worksheets(Sheet1)Range(C30) = ApplicationDDERequest(Channel $PasswordEntered)ApplicationDDETerminate Channel This terminates the DDE channelEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 110

Visual Basic

ldquoRoll Your Ownrdquo HMI - Much More powerful than Excel

Key Parameters computer nameapplication|topicitem

IO Emulator - MBPlusSimulateexe

Can ldquoRead Fromrdquo amp ldquoWrite Tordquo PLC andor HMI

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 111

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 112

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 113

Dim PauseTime Start Finish TotalTime As Integer Declare variables

Private Sub txtAIT_332A_SCALED_Change()On Error GoTo PokeAIT_332AErrortxtAIT_332A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtAIT_332A_SCALEDText = Int((3 Rnd) + 20) Generate random value between 20 and 23txtAIT_332A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtAIT_332A_SCALEDLinkItem = AIT_332A_SCALEDtxtAIT_332A_SCALEDLinkMode = 2txtAIT_332A_SCALEDLinkPoketxtAIT_332A_SCALEDLinkMode = 0 DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total time

PokeAIT_332AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtAIT_332A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 114

Private Sub txtAIT_346A_SCALED_Change()On Error GoTo PokeAIT_346AErrortxtAIT_346A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtAIT_346A_SCALEDText = Int((3 Rnd) + 15) Generate random value between 15 and 18txtAIT_346A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtAIT_346A_SCALEDLinkItem = AIT_346A_SCALEDtxtAIT_346A_SCALEDLinkMode = 2txtAIT_346A_SCALEDLinkPoketxtAIT_346A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeAIT_346AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtAIT_346A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 115

Private Sub txtFIT_321A_SCALED_Change()On Error GoTo PokeFIT_321AErrortxtFIT_321A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtFIT_321A_SCALEDText = Int((10 Rnd) + 120) Generate random value between 120 and 130txtFIT_321A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_321A_SCALEDLinkItem = FIT_321A_SCALEDtxtFIT_321A_SCALEDLinkMode = 2txtFIT_321A_SCALEDLinkPoketxtFIT_321A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total time

PokeFIT_321AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_321A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume Next

End Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 116

Private Sub txtFIT_341A_SCALED_Change()On Error GoTo PokeFIT_341AErrortxtFIT_341A_SCALEDLinkMode = 0 PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTime

txtFIT_341A_SCALEDText = Int((3 Rnd) + 18) Generate random value between 18 and 21

txtFIT_341A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_341A_SCALEDLinkItem = FIT_341A_SCALEDtxtFIT_341A_SCALEDLinkMode = 2txtFIT_341A_SCALEDLinkPoketxtFIT_341A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeFIT_341AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_341A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 117

Private Sub txtFIT_343A_SCALED_Change()On Error GoTo PokeFIT_343AErrortxtFIT_343A_SCALEDLinkMode = 0 PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTime

txtFIT_343A_SCALEDText = Int((1 Rnd) + 3) Generate random value between 3 and 4

txtFIT_343A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_343A_SCALEDLinkItem = FIT_343A_SCALEDtxtFIT_343A_SCALEDLinkMode = 2txtFIT_343A_SCALEDLinkPoketxtFIT_343A_SCALEDLinkMode = 0 DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeFIT_343AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_343A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 118

TUTORIAL

Part 4

Questions

amp

Answers

  • Slide 1
  • Slide 2
  • Slide 3
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Slide 8
  • Slide 9
  • Slide 10
  • Slide 11
  • Slide 12
  • Slide 13
  • Slide 14
  • Slide 15
  • Slide 16
  • Slide 17
  • Slide 18
  • Slide 19
  • Slide 20
  • Slide 21
  • Slide 22
  • Slide 23
  • Slide 24
  • Slide 25
  • Slide 26
  • Slide 27
  • Slide 28
  • Slide 29
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
  • Slide 34
  • Slide 35
  • Slide 36
  • Slide 37
  • Slide 38
  • Slide 39
  • Slide 40
  • Slide 41
  • Slide 42
  • Slide 43
  • Slide 44
  • Slide 45
  • Slide 46
  • Slide 47
  • Slide 48
  • Slide 49
  • Slide 50
  • Slide 51
  • Slide 52
  • Slide 53
  • Slide 54
  • Slide 55
  • Slide 56
  • Slide 57
  • Slide 58
  • Slide 59
  • Slide 60
  • Slide 61
  • Slide 62
  • Slide 63
  • Slide 64
  • Slide 65
  • Slide 66
  • Slide 67
  • Slide 68
  • Slide 69
  • Slide 70
  • Slide 71
  • Slide 72
  • Slide 73
  • Slide 74
  • Slide 75
  • Slide 76
  • Slide 77
  • Slide 78
  • Slide 79
  • Slide 80
  • Slide 81
  • Slide 82
  • Slide 83
  • Slide 84
  • Slide 85
  • Slide 86
  • Slide 87
  • Slide 88
  • Slide 89
  • Slide 90
  • Slide 91
  • Slide 92
  • Slide 93
  • Slide 94
  • Slide 95
  • Slide 96
  • Slide 97
  • Slide 98
  • Slide 99
  • Slide 100
  • Slide 101
  • Slide 102
  • Slide 103
  • Slide 104
  • Slide 105
  • Slide 106
  • Slide 107
  • Slide 108
  • Slide 109
  • Slide 110
  • Slide 111
  • Slide 112
  • Slide 113
  • Slide 114
  • Slide 115
  • Slide 116
  • Slide 117
  • Slide 118
Page 11: TUTORIAL Ethernet PLC's Improve Oxygen Consumption ISA Expo/2001Houston, Texas Water & Wastewater Industry DivisionTuesday, September 11, 2001 1 Brad.

Factors Effecting Process Performance

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 11

middot Configuration and volume of anoxic and oxic cells

middot Addition points and proportions of oxygen addition

middot Supplementation of carbon source (such as methanol) to enhance the denitrification rate

middot Amount of wastewater treated per day

middot Water temperature and concentration of the bacteria to the process

The factors which influence the process performance of nitrogen removal are

The process incorporates second and third anoxic cells into the treatment scheme in order to meet the effluent limitations using four measured variables

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 12

Biological Oxygen Demand (BOD)

Suspended Solids (SS)

Total Nitrogen (TN)

Total Phosphorous (TP)

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 15

Train Details

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 17

Selecting A Control Level For Oxygen Addition For 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 18

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

Control Levels The following control levels are available for Oxygen

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 20

Oxygen Control Levels

Cascade from Cell 3 Dissolved Oxygen probe

Ratio from Discharge flow

AutoManual Control

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 22

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 23

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 24

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 25

The following control levels are available for the Recycle flow

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 27

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 28

The following control levels are available for the PD Blowers Timed Mode

Dissolved Oxygen Mode

Manual Mode

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

Motor Popup

The following information is available for each motor control from the respective motor popup

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

Aerator Control Motor Popup

Like all motors the following information is available for the Aerator motor control from the motor popup

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 32

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 33

Motor Popup Surface Aerator Control

The following information is available for motor control from the motor popup

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 35

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 36

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 37

Lower Explosive Level (LEL)

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 38

Each train has a digital input that tells whether thecombustible 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 (LEL) system

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 39

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 Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 40

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 41

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 Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 42

Like a DCS

middot 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

middot 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 amp CASCADE amp RATIO PID WITH AUTO amp RATIO Digin Motor Status DigOut Motor (or Digital Composite) Motor with ILock and Perm Numeric Set Timers Alarm Detail and Alarm Tags

middot A single generic trend display to trend ALL trendable (archived) points

Alarm Management

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

middot A Distributed Alarm Summary has been used to give better alarm management tools

bull Up to eight trend pens on the trend display

bull The operator picks which values to trend by clicking in the center of the trend

display

bull 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 44

The AnoxicOxic 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 Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 46

The following control levels are available for Oxygen1 Cascade from Dissolved Oxygen

2 Ratio from Discharge flow3 Auto-Manual Control

The following control levels are available for the Recycle flow1 Ratio from Discharge flow

2 Auto-Manual Control

The following control levels are available for the PD Blowers3 Timed Mode

2 Dissolved Oxygen Mode3 Manual Mode

Conclusions

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 47

Following the commissioning of the ethernet-based PLCs Oxygen consumption was significantly reduced

The advanced controls allow the operators to leave the process alone and continue to optimally treat the sewage

Conclusions

Following the commissioning of the ethernet-based PLCs AnoxicOxic 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 Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 48

Summary

The PD Blowers ran in Timed Mode andor 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

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 Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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 Authoritys 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 50

TUTORIAL

Part 2A

PLC Programming Basics

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 51

Separate parts of the process have been organized into a separate ldquoSECTIONrdquo

PLC Program Organization

Each ldquoSECTIONrdquo can be any of the IEC programming types

bull Ladder (LD)bull Structured Text (ST)

bull Instruction List (IL)

bull Function Blocks (FB)bull Sequential Function Charts (SFC)

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 52

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 53

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 54

IO Map

On-Line PLC Diagnostics

PLC Status

PLC Simulator

Ethernet (TCPIP) Address

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 55

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 56

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 57

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 58

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 59

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 60

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 61

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 62

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 63

Structured Text was used hereNOT Ladder

Programming for Motors

The PLC DOES NOT CAREStructured Text Functions EXACTLY

the same as LadderUse what yoursquore comfortable with

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 64

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 65

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 66

IEC Function Blocks Used Here

Programming for Analogs amp PID

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 67

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 68

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 69

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 70

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 71

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 72

Sequential Function Charts were used here

Higher-Level Control

bull SFCrsquos lend themselves well to (as the name would imply) sequential processes

bull Three Important components in SFCrsquosbull Transitionsbull Stepsbull Jumps

bull The status of the process can be viewed as a flow chart

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 73

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 74

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 75

PLC - HMI Communication

A ldquoPLC Heartbeatrdquo is traditionally used to monitor the PLC - HMI Communication sometimes called ardquoWatchdog Timerrdquo

Call it whatever you want but the PLC amp 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 ldquodiesrdquo then that switch doesnrsquot change state and an alarm alerts the operator

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 76

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 77

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 78

TUTORIAL

Part 2B

HMI Programming

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 79

Ethernet (TCPIP) IO Driver

The Ethernet (TCPIP) IO Driver allows the HMI to communicate with the PLC (In this case the driver is called MBENETEXE)

The PLC has an ethernet module in one of the slots that has a ldquoCAT5RJ-45rdquo 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 ldquoCAT5RJ-45rdquo receptacle for the ethernet cable

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 80

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 81

Operator Screens amp Popup Displays

The display is laid out in 3 sections

bull Upper - Security amp Alarm Windowbull Middle- Main Operator Screens bull Lower - Menu amp Popup Displays

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 82

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 83

Scripting

There are 6 types of ldquoScriptsrdquobull Application Scriptsbull Key Scriptsbull Condition Scriptsbull Data Change Scriptsbull Quick Function Scriptsbull ActiveX Event Scripts

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 84

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 85

Access Names

The ldquoAccess Namesrdquo Must be configured to allow the PLC - HMI communications

Note that the ldquoApplicationTopicrdquo is the same as the IO Driver

The ldquocomputer namerdquo is the name of the PC that the HMI is running on (brad_s_carlberg in this case)

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 86

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 87

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 88

Indirect Tags

ldquoIndirect Tagsrdquo were used here to minimize the number of popup displays

This is especially useful in HMIrsquos with many tags

ONLY 12 popup displays are reused throughout the HMI

This gives the HMI a ldquoDCS-Likerdquo Look amp Feel

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 89

Popup Display TypesThe tag point type determines which popup display to use

Analog InputHIC (or Analog Output)PID (or Analog Composite)

bull PID WITH AUTO amp CASCADE amp RATIObull PID WITH AUTO amp RATIO

Diginbull Motor Status

DigOutMotor (or Digital Composite)

bull Motor with ILock and PermNumericSet TimersAlarm DetailAlarm Tags

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 90

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 91

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 92

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 93

Bars Buttons amp Sliders

By choosing to use indirect tags we complicate the Bar Graphs Buttons amp Sliders in the popup displays

Different scales need to be used for different engineering unit ranges

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 94

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 95

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 96

Popup Displays

The next two pages shows how the individual popup displays use the indirect tags

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 97

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 98

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 99

Adding a ldquoTouch Targetrdquo to a Display

2 Tell which tags to use

3 Tell which popup display to call upWhat kind of point type is it

3 Steps1 Tell which scale to use (if itrsquos an analog point type)

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 100

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 101

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 102

TUTORIAL

Part 2C

Excel Spreadsheets

amp

Visual Basic

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 103

A ldquoCHEAP amp DIRTYrdquo HMI With Excel

The 4 key parameters are

To communicate with the PLCUse brad_s_carlbergmbenet|ANOXIC_OXICrsquoplcregisterrsquo

Excel uses ldquopeeksrdquo amp ldquopokesrdquo to read from amp write to a PLC or HMI

To communicate with the HMIbrad_s_carlbergview|Tagnamersquotagnamersquo

bull computer namebull applicationbull topicbull item

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 104

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 105

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 106

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 107

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 108

Excel Macros

bull ldquoRequestrdquo Macro to read values

bull ldquoPokerdquo Macro to write values

bull A Sample Excel Macro

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 109

Sub PokeMacro()MsgBox ApplicationNetworkTemplatesPathChannel = ApplicationDDEInitiate(app=brad_s_carlbergVIEW topic=Tagname) This opens a DDE channel to ViewApplicationDDEPoke Channel Temperature1 Worksheets(Sheet1)Range(A1) Puts value from R1C1 into Temperature1ApplicationDDEPoke Channel DDEReal Worksheets(Sheet1)Range(A2) Puts value from R1C1 into Temperature1ApplicationDDEPoke Channel DDEInteger Worksheets(Sheet1)Range(A3) Puts value from R1C1 into Temperature1ApplicationDDETerminate Channel This terminates the DDE channelEnd SubSub RequestMacro()Channel = ApplicationDDEInitiate(app=brad_s_carlbergVIEW topic=Tagname) This opens a DDE channel to ViewWorksheets(Sheet1)Range(C4) = ApplicationDDERequest(Channel $Hour)Worksheets(Sheet1)Range(C5) = ApplicationDDERequest(Channel $Minute)Worksheets(Sheet1)Range(C6) = ApplicationDDERequest(Channel $Second)Worksheets(Sheet1)Range(C9) = ApplicationDDERequest(Channel $day)Worksheets(Sheet1)Range(C10) = ApplicationDDERequest(Channel $date)Worksheets(Sheet1)Range(C11) = ApplicationDDERequest(Channel $datestring)Worksheets(Sheet1)Range(C12) = ApplicationDDERequest(Channel $datetime)Worksheets(Sheet1)Range(C13) = ApplicationDDERequest(Channel $date)Worksheets(Sheet1)Range(C14) = ApplicationDDERequest(Channel $month)Worksheets(Sheet1)Range(C15) = ApplicationDDERequest(Channel $year)Worksheets(Sheet1)Range(C16) = ApplicationDDERequest(Channel $time)Worksheets(Sheet1)Range(C17) = ApplicationDDERequest(Channel $timestring)Worksheets(Sheet1)Range(C18) = ApplicationDDERequest(Channel $applicationversion)Worksheets(Sheet1)Range(C19) = ApplicationDDERequest(Channel $startddeconversations)Worksheets(Sheet1)Range(C20) = ApplicationDDERequest(Channel $accesslevel)Worksheets(Sheet1)Range(C21) = ApplicationDDERequest(Channel $alarmlogging)Worksheets(Sheet1)Range(C22) = ApplicationDDERequest(Channel $applicationchanged)Worksheets(Sheet1)Range(C23) = ApplicationDDERequest(Channel $configureusers)Worksheets(Sheet1)Range(C24) = ApplicationDDERequest(Channel $changepassword)Worksheets(Sheet1)Range(C25) = ApplicationDDERequest(Channel $InactivityTimeout)Worksheets(Sheet1)Range(C26) = ApplicationDDERequest(Channel $InactivityWarning)Worksheets(Sheet1)Range(C27) = ApplicationDDERequest(Channel $LogicRunning)Worksheets(Sheet1)Range(C28) = ApplicationDDERequest(Channel $OperatorEntered)Worksheets(Sheet1)Range(C29) = ApplicationDDERequest(Channel $Operator)Worksheets(Sheet1)Range(C30) = ApplicationDDERequest(Channel $PasswordEntered)ApplicationDDETerminate Channel This terminates the DDE channelEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 110

Visual Basic

ldquoRoll Your Ownrdquo HMI - Much More powerful than Excel

Key Parameters computer nameapplication|topicitem

IO Emulator - MBPlusSimulateexe

Can ldquoRead Fromrdquo amp ldquoWrite Tordquo PLC andor HMI

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 111

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 112

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 113

Dim PauseTime Start Finish TotalTime As Integer Declare variables

Private Sub txtAIT_332A_SCALED_Change()On Error GoTo PokeAIT_332AErrortxtAIT_332A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtAIT_332A_SCALEDText = Int((3 Rnd) + 20) Generate random value between 20 and 23txtAIT_332A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtAIT_332A_SCALEDLinkItem = AIT_332A_SCALEDtxtAIT_332A_SCALEDLinkMode = 2txtAIT_332A_SCALEDLinkPoketxtAIT_332A_SCALEDLinkMode = 0 DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total time

PokeAIT_332AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtAIT_332A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 114

Private Sub txtAIT_346A_SCALED_Change()On Error GoTo PokeAIT_346AErrortxtAIT_346A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtAIT_346A_SCALEDText = Int((3 Rnd) + 15) Generate random value between 15 and 18txtAIT_346A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtAIT_346A_SCALEDLinkItem = AIT_346A_SCALEDtxtAIT_346A_SCALEDLinkMode = 2txtAIT_346A_SCALEDLinkPoketxtAIT_346A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeAIT_346AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtAIT_346A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 115

Private Sub txtFIT_321A_SCALED_Change()On Error GoTo PokeFIT_321AErrortxtFIT_321A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtFIT_321A_SCALEDText = Int((10 Rnd) + 120) Generate random value between 120 and 130txtFIT_321A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_321A_SCALEDLinkItem = FIT_321A_SCALEDtxtFIT_321A_SCALEDLinkMode = 2txtFIT_321A_SCALEDLinkPoketxtFIT_321A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total time

PokeFIT_321AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_321A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume Next

End Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 116

Private Sub txtFIT_341A_SCALED_Change()On Error GoTo PokeFIT_341AErrortxtFIT_341A_SCALEDLinkMode = 0 PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTime

txtFIT_341A_SCALEDText = Int((3 Rnd) + 18) Generate random value between 18 and 21

txtFIT_341A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_341A_SCALEDLinkItem = FIT_341A_SCALEDtxtFIT_341A_SCALEDLinkMode = 2txtFIT_341A_SCALEDLinkPoketxtFIT_341A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeFIT_341AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_341A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 117

Private Sub txtFIT_343A_SCALED_Change()On Error GoTo PokeFIT_343AErrortxtFIT_343A_SCALEDLinkMode = 0 PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTime

txtFIT_343A_SCALEDText = Int((1 Rnd) + 3) Generate random value between 3 and 4

txtFIT_343A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_343A_SCALEDLinkItem = FIT_343A_SCALEDtxtFIT_343A_SCALEDLinkMode = 2txtFIT_343A_SCALEDLinkPoketxtFIT_343A_SCALEDLinkMode = 0 DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeFIT_343AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_343A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 118

TUTORIAL

Part 4

Questions

amp

Answers

  • Slide 1
  • Slide 2
  • Slide 3
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Slide 8
  • Slide 9
  • Slide 10
  • Slide 11
  • Slide 12
  • Slide 13
  • Slide 14
  • Slide 15
  • Slide 16
  • Slide 17
  • Slide 18
  • Slide 19
  • Slide 20
  • Slide 21
  • Slide 22
  • Slide 23
  • Slide 24
  • Slide 25
  • Slide 26
  • Slide 27
  • Slide 28
  • Slide 29
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
  • Slide 34
  • Slide 35
  • Slide 36
  • Slide 37
  • Slide 38
  • Slide 39
  • Slide 40
  • Slide 41
  • Slide 42
  • Slide 43
  • Slide 44
  • Slide 45
  • Slide 46
  • Slide 47
  • Slide 48
  • Slide 49
  • Slide 50
  • Slide 51
  • Slide 52
  • Slide 53
  • Slide 54
  • Slide 55
  • Slide 56
  • Slide 57
  • Slide 58
  • Slide 59
  • Slide 60
  • Slide 61
  • Slide 62
  • Slide 63
  • Slide 64
  • Slide 65
  • Slide 66
  • Slide 67
  • Slide 68
  • Slide 69
  • Slide 70
  • Slide 71
  • Slide 72
  • Slide 73
  • Slide 74
  • Slide 75
  • Slide 76
  • Slide 77
  • Slide 78
  • Slide 79
  • Slide 80
  • Slide 81
  • Slide 82
  • Slide 83
  • Slide 84
  • Slide 85
  • Slide 86
  • Slide 87
  • Slide 88
  • Slide 89
  • Slide 90
  • Slide 91
  • Slide 92
  • Slide 93
  • Slide 94
  • Slide 95
  • Slide 96
  • Slide 97
  • Slide 98
  • Slide 99
  • Slide 100
  • Slide 101
  • Slide 102
  • Slide 103
  • Slide 104
  • Slide 105
  • Slide 106
  • Slide 107
  • Slide 108
  • Slide 109
  • Slide 110
  • Slide 111
  • Slide 112
  • Slide 113
  • Slide 114
  • Slide 115
  • Slide 116
  • Slide 117
  • Slide 118
Page 12: TUTORIAL Ethernet PLC's Improve Oxygen Consumption ISA Expo/2001Houston, Texas Water & Wastewater Industry DivisionTuesday, September 11, 2001 1 Brad.

The process incorporates second and third anoxic cells into the treatment scheme in order to meet the effluent limitations using four measured variables

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 12

Biological Oxygen Demand (BOD)

Suspended Solids (SS)

Total Nitrogen (TN)

Total Phosphorous (TP)

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 15

Train Details

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 17

Selecting A Control Level For Oxygen Addition For 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 18

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

Control Levels The following control levels are available for Oxygen

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 20

Oxygen Control Levels

Cascade from Cell 3 Dissolved Oxygen probe

Ratio from Discharge flow

AutoManual Control

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 22

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 23

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 24

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 25

The following control levels are available for the Recycle flow

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 27

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 28

The following control levels are available for the PD Blowers Timed Mode

Dissolved Oxygen Mode

Manual Mode

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

Motor Popup

The following information is available for each motor control from the respective motor popup

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

Aerator Control Motor Popup

Like all motors the following information is available for the Aerator motor control from the motor popup

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 32

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 33

Motor Popup Surface Aerator Control

The following information is available for motor control from the motor popup

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 35

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 36

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 37

Lower Explosive Level (LEL)

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 38

Each train has a digital input that tells whether thecombustible 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 (LEL) system

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 39

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 Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 40

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 41

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 Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 42

Like a DCS

middot 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

middot 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 amp CASCADE amp RATIO PID WITH AUTO amp RATIO Digin Motor Status DigOut Motor (or Digital Composite) Motor with ILock and Perm Numeric Set Timers Alarm Detail and Alarm Tags

middot A single generic trend display to trend ALL trendable (archived) points

Alarm Management

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

middot A Distributed Alarm Summary has been used to give better alarm management tools

bull Up to eight trend pens on the trend display

bull The operator picks which values to trend by clicking in the center of the trend

display

bull 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 44

The AnoxicOxic 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 Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 46

The following control levels are available for Oxygen1 Cascade from Dissolved Oxygen

2 Ratio from Discharge flow3 Auto-Manual Control

The following control levels are available for the Recycle flow1 Ratio from Discharge flow

2 Auto-Manual Control

The following control levels are available for the PD Blowers3 Timed Mode

2 Dissolved Oxygen Mode3 Manual Mode

Conclusions

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 47

Following the commissioning of the ethernet-based PLCs Oxygen consumption was significantly reduced

The advanced controls allow the operators to leave the process alone and continue to optimally treat the sewage

Conclusions

Following the commissioning of the ethernet-based PLCs AnoxicOxic 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 Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 48

Summary

The PD Blowers ran in Timed Mode andor 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

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 Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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 Authoritys 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 50

TUTORIAL

Part 2A

PLC Programming Basics

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 51

Separate parts of the process have been organized into a separate ldquoSECTIONrdquo

PLC Program Organization

Each ldquoSECTIONrdquo can be any of the IEC programming types

bull Ladder (LD)bull Structured Text (ST)

bull Instruction List (IL)

bull Function Blocks (FB)bull Sequential Function Charts (SFC)

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 52

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 53

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 54

IO Map

On-Line PLC Diagnostics

PLC Status

PLC Simulator

Ethernet (TCPIP) Address

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 55

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 56

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 57

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 58

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 59

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 60

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 61

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 62

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 63

Structured Text was used hereNOT Ladder

Programming for Motors

The PLC DOES NOT CAREStructured Text Functions EXACTLY

the same as LadderUse what yoursquore comfortable with

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 64

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 65

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 66

IEC Function Blocks Used Here

Programming for Analogs amp PID

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 67

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 68

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 69

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 70

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 71

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 72

Sequential Function Charts were used here

Higher-Level Control

bull SFCrsquos lend themselves well to (as the name would imply) sequential processes

bull Three Important components in SFCrsquosbull Transitionsbull Stepsbull Jumps

bull The status of the process can be viewed as a flow chart

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 73

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 74

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 75

PLC - HMI Communication

A ldquoPLC Heartbeatrdquo is traditionally used to monitor the PLC - HMI Communication sometimes called ardquoWatchdog Timerrdquo

Call it whatever you want but the PLC amp 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 ldquodiesrdquo then that switch doesnrsquot change state and an alarm alerts the operator

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 76

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 77

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 78

TUTORIAL

Part 2B

HMI Programming

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 79

Ethernet (TCPIP) IO Driver

The Ethernet (TCPIP) IO Driver allows the HMI to communicate with the PLC (In this case the driver is called MBENETEXE)

The PLC has an ethernet module in one of the slots that has a ldquoCAT5RJ-45rdquo 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 ldquoCAT5RJ-45rdquo receptacle for the ethernet cable

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 80

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 81

Operator Screens amp Popup Displays

The display is laid out in 3 sections

bull Upper - Security amp Alarm Windowbull Middle- Main Operator Screens bull Lower - Menu amp Popup Displays

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 82

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 83

Scripting

There are 6 types of ldquoScriptsrdquobull Application Scriptsbull Key Scriptsbull Condition Scriptsbull Data Change Scriptsbull Quick Function Scriptsbull ActiveX Event Scripts

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 84

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 85

Access Names

The ldquoAccess Namesrdquo Must be configured to allow the PLC - HMI communications

Note that the ldquoApplicationTopicrdquo is the same as the IO Driver

The ldquocomputer namerdquo is the name of the PC that the HMI is running on (brad_s_carlberg in this case)

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 86

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 87

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 88

Indirect Tags

ldquoIndirect Tagsrdquo were used here to minimize the number of popup displays

This is especially useful in HMIrsquos with many tags

ONLY 12 popup displays are reused throughout the HMI

This gives the HMI a ldquoDCS-Likerdquo Look amp Feel

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 89

Popup Display TypesThe tag point type determines which popup display to use

Analog InputHIC (or Analog Output)PID (or Analog Composite)

bull PID WITH AUTO amp CASCADE amp RATIObull PID WITH AUTO amp RATIO

Diginbull Motor Status

DigOutMotor (or Digital Composite)

bull Motor with ILock and PermNumericSet TimersAlarm DetailAlarm Tags

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 90

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 91

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 92

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 93

Bars Buttons amp Sliders

By choosing to use indirect tags we complicate the Bar Graphs Buttons amp Sliders in the popup displays

Different scales need to be used for different engineering unit ranges

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 94

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 95

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 96

Popup Displays

The next two pages shows how the individual popup displays use the indirect tags

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 97

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 98

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 99

Adding a ldquoTouch Targetrdquo to a Display

2 Tell which tags to use

3 Tell which popup display to call upWhat kind of point type is it

3 Steps1 Tell which scale to use (if itrsquos an analog point type)

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 100

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 101

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 102

TUTORIAL

Part 2C

Excel Spreadsheets

amp

Visual Basic

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 103

A ldquoCHEAP amp DIRTYrdquo HMI With Excel

The 4 key parameters are

To communicate with the PLCUse brad_s_carlbergmbenet|ANOXIC_OXICrsquoplcregisterrsquo

Excel uses ldquopeeksrdquo amp ldquopokesrdquo to read from amp write to a PLC or HMI

To communicate with the HMIbrad_s_carlbergview|Tagnamersquotagnamersquo

bull computer namebull applicationbull topicbull item

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 104

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 105

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 106

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 107

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 108

Excel Macros

bull ldquoRequestrdquo Macro to read values

bull ldquoPokerdquo Macro to write values

bull A Sample Excel Macro

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 109

Sub PokeMacro()MsgBox ApplicationNetworkTemplatesPathChannel = ApplicationDDEInitiate(app=brad_s_carlbergVIEW topic=Tagname) This opens a DDE channel to ViewApplicationDDEPoke Channel Temperature1 Worksheets(Sheet1)Range(A1) Puts value from R1C1 into Temperature1ApplicationDDEPoke Channel DDEReal Worksheets(Sheet1)Range(A2) Puts value from R1C1 into Temperature1ApplicationDDEPoke Channel DDEInteger Worksheets(Sheet1)Range(A3) Puts value from R1C1 into Temperature1ApplicationDDETerminate Channel This terminates the DDE channelEnd SubSub RequestMacro()Channel = ApplicationDDEInitiate(app=brad_s_carlbergVIEW topic=Tagname) This opens a DDE channel to ViewWorksheets(Sheet1)Range(C4) = ApplicationDDERequest(Channel $Hour)Worksheets(Sheet1)Range(C5) = ApplicationDDERequest(Channel $Minute)Worksheets(Sheet1)Range(C6) = ApplicationDDERequest(Channel $Second)Worksheets(Sheet1)Range(C9) = ApplicationDDERequest(Channel $day)Worksheets(Sheet1)Range(C10) = ApplicationDDERequest(Channel $date)Worksheets(Sheet1)Range(C11) = ApplicationDDERequest(Channel $datestring)Worksheets(Sheet1)Range(C12) = ApplicationDDERequest(Channel $datetime)Worksheets(Sheet1)Range(C13) = ApplicationDDERequest(Channel $date)Worksheets(Sheet1)Range(C14) = ApplicationDDERequest(Channel $month)Worksheets(Sheet1)Range(C15) = ApplicationDDERequest(Channel $year)Worksheets(Sheet1)Range(C16) = ApplicationDDERequest(Channel $time)Worksheets(Sheet1)Range(C17) = ApplicationDDERequest(Channel $timestring)Worksheets(Sheet1)Range(C18) = ApplicationDDERequest(Channel $applicationversion)Worksheets(Sheet1)Range(C19) = ApplicationDDERequest(Channel $startddeconversations)Worksheets(Sheet1)Range(C20) = ApplicationDDERequest(Channel $accesslevel)Worksheets(Sheet1)Range(C21) = ApplicationDDERequest(Channel $alarmlogging)Worksheets(Sheet1)Range(C22) = ApplicationDDERequest(Channel $applicationchanged)Worksheets(Sheet1)Range(C23) = ApplicationDDERequest(Channel $configureusers)Worksheets(Sheet1)Range(C24) = ApplicationDDERequest(Channel $changepassword)Worksheets(Sheet1)Range(C25) = ApplicationDDERequest(Channel $InactivityTimeout)Worksheets(Sheet1)Range(C26) = ApplicationDDERequest(Channel $InactivityWarning)Worksheets(Sheet1)Range(C27) = ApplicationDDERequest(Channel $LogicRunning)Worksheets(Sheet1)Range(C28) = ApplicationDDERequest(Channel $OperatorEntered)Worksheets(Sheet1)Range(C29) = ApplicationDDERequest(Channel $Operator)Worksheets(Sheet1)Range(C30) = ApplicationDDERequest(Channel $PasswordEntered)ApplicationDDETerminate Channel This terminates the DDE channelEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 110

Visual Basic

ldquoRoll Your Ownrdquo HMI - Much More powerful than Excel

Key Parameters computer nameapplication|topicitem

IO Emulator - MBPlusSimulateexe

Can ldquoRead Fromrdquo amp ldquoWrite Tordquo PLC andor HMI

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 111

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 112

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 113

Dim PauseTime Start Finish TotalTime As Integer Declare variables

Private Sub txtAIT_332A_SCALED_Change()On Error GoTo PokeAIT_332AErrortxtAIT_332A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtAIT_332A_SCALEDText = Int((3 Rnd) + 20) Generate random value between 20 and 23txtAIT_332A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtAIT_332A_SCALEDLinkItem = AIT_332A_SCALEDtxtAIT_332A_SCALEDLinkMode = 2txtAIT_332A_SCALEDLinkPoketxtAIT_332A_SCALEDLinkMode = 0 DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total time

PokeAIT_332AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtAIT_332A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 114

Private Sub txtAIT_346A_SCALED_Change()On Error GoTo PokeAIT_346AErrortxtAIT_346A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtAIT_346A_SCALEDText = Int((3 Rnd) + 15) Generate random value between 15 and 18txtAIT_346A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtAIT_346A_SCALEDLinkItem = AIT_346A_SCALEDtxtAIT_346A_SCALEDLinkMode = 2txtAIT_346A_SCALEDLinkPoketxtAIT_346A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeAIT_346AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtAIT_346A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 115

Private Sub txtFIT_321A_SCALED_Change()On Error GoTo PokeFIT_321AErrortxtFIT_321A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtFIT_321A_SCALEDText = Int((10 Rnd) + 120) Generate random value between 120 and 130txtFIT_321A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_321A_SCALEDLinkItem = FIT_321A_SCALEDtxtFIT_321A_SCALEDLinkMode = 2txtFIT_321A_SCALEDLinkPoketxtFIT_321A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total time

PokeFIT_321AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_321A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume Next

End Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 116

Private Sub txtFIT_341A_SCALED_Change()On Error GoTo PokeFIT_341AErrortxtFIT_341A_SCALEDLinkMode = 0 PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTime

txtFIT_341A_SCALEDText = Int((3 Rnd) + 18) Generate random value between 18 and 21

txtFIT_341A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_341A_SCALEDLinkItem = FIT_341A_SCALEDtxtFIT_341A_SCALEDLinkMode = 2txtFIT_341A_SCALEDLinkPoketxtFIT_341A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeFIT_341AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_341A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 117

Private Sub txtFIT_343A_SCALED_Change()On Error GoTo PokeFIT_343AErrortxtFIT_343A_SCALEDLinkMode = 0 PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTime

txtFIT_343A_SCALEDText = Int((1 Rnd) + 3) Generate random value between 3 and 4

txtFIT_343A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_343A_SCALEDLinkItem = FIT_343A_SCALEDtxtFIT_343A_SCALEDLinkMode = 2txtFIT_343A_SCALEDLinkPoketxtFIT_343A_SCALEDLinkMode = 0 DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeFIT_343AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_343A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 118

TUTORIAL

Part 4

Questions

amp

Answers

  • Slide 1
  • Slide 2
  • Slide 3
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Slide 8
  • Slide 9
  • Slide 10
  • Slide 11
  • Slide 12
  • Slide 13
  • Slide 14
  • Slide 15
  • Slide 16
  • Slide 17
  • Slide 18
  • Slide 19
  • Slide 20
  • Slide 21
  • Slide 22
  • Slide 23
  • Slide 24
  • Slide 25
  • Slide 26
  • Slide 27
  • Slide 28
  • Slide 29
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
  • Slide 34
  • Slide 35
  • Slide 36
  • Slide 37
  • Slide 38
  • Slide 39
  • Slide 40
  • Slide 41
  • Slide 42
  • Slide 43
  • Slide 44
  • Slide 45
  • Slide 46
  • Slide 47
  • Slide 48
  • Slide 49
  • Slide 50
  • Slide 51
  • Slide 52
  • Slide 53
  • Slide 54
  • Slide 55
  • Slide 56
  • Slide 57
  • Slide 58
  • Slide 59
  • Slide 60
  • Slide 61
  • Slide 62
  • Slide 63
  • Slide 64
  • Slide 65
  • Slide 66
  • Slide 67
  • Slide 68
  • Slide 69
  • Slide 70
  • Slide 71
  • Slide 72
  • Slide 73
  • Slide 74
  • Slide 75
  • Slide 76
  • Slide 77
  • Slide 78
  • Slide 79
  • Slide 80
  • Slide 81
  • Slide 82
  • Slide 83
  • Slide 84
  • Slide 85
  • Slide 86
  • Slide 87
  • Slide 88
  • Slide 89
  • Slide 90
  • Slide 91
  • Slide 92
  • Slide 93
  • Slide 94
  • Slide 95
  • Slide 96
  • Slide 97
  • Slide 98
  • Slide 99
  • Slide 100
  • Slide 101
  • Slide 102
  • Slide 103
  • Slide 104
  • Slide 105
  • Slide 106
  • Slide 107
  • Slide 108
  • Slide 109
  • Slide 110
  • Slide 111
  • Slide 112
  • Slide 113
  • Slide 114
  • Slide 115
  • Slide 116
  • Slide 117
  • Slide 118
Page 13: TUTORIAL Ethernet PLC's Improve Oxygen Consumption ISA Expo/2001Houston, Texas Water & Wastewater Industry DivisionTuesday, September 11, 2001 1 Brad.

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 15

Train Details

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 17

Selecting A Control Level For Oxygen Addition For 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 18

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

Control Levels The following control levels are available for Oxygen

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 20

Oxygen Control Levels

Cascade from Cell 3 Dissolved Oxygen probe

Ratio from Discharge flow

AutoManual Control

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 22

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 23

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 24

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 25

The following control levels are available for the Recycle flow

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 27

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 28

The following control levels are available for the PD Blowers Timed Mode

Dissolved Oxygen Mode

Manual Mode

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

Motor Popup

The following information is available for each motor control from the respective motor popup

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

Aerator Control Motor Popup

Like all motors the following information is available for the Aerator motor control from the motor popup

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 32

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 33

Motor Popup Surface Aerator Control

The following information is available for motor control from the motor popup

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 35

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 36

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 37

Lower Explosive Level (LEL)

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 38

Each train has a digital input that tells whether thecombustible 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 (LEL) system

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 39

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 Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 40

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 41

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 Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 42

Like a DCS

middot 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

middot 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 amp CASCADE amp RATIO PID WITH AUTO amp RATIO Digin Motor Status DigOut Motor (or Digital Composite) Motor with ILock and Perm Numeric Set Timers Alarm Detail and Alarm Tags

middot A single generic trend display to trend ALL trendable (archived) points

Alarm Management

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

middot A Distributed Alarm Summary has been used to give better alarm management tools

bull Up to eight trend pens on the trend display

bull The operator picks which values to trend by clicking in the center of the trend

display

bull 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 44

The AnoxicOxic 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 Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 46

The following control levels are available for Oxygen1 Cascade from Dissolved Oxygen

2 Ratio from Discharge flow3 Auto-Manual Control

The following control levels are available for the Recycle flow1 Ratio from Discharge flow

2 Auto-Manual Control

The following control levels are available for the PD Blowers3 Timed Mode

2 Dissolved Oxygen Mode3 Manual Mode

Conclusions

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 47

Following the commissioning of the ethernet-based PLCs Oxygen consumption was significantly reduced

The advanced controls allow the operators to leave the process alone and continue to optimally treat the sewage

Conclusions

Following the commissioning of the ethernet-based PLCs AnoxicOxic 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 Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 48

Summary

The PD Blowers ran in Timed Mode andor 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

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 Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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 Authoritys 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 50

TUTORIAL

Part 2A

PLC Programming Basics

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 51

Separate parts of the process have been organized into a separate ldquoSECTIONrdquo

PLC Program Organization

Each ldquoSECTIONrdquo can be any of the IEC programming types

bull Ladder (LD)bull Structured Text (ST)

bull Instruction List (IL)

bull Function Blocks (FB)bull Sequential Function Charts (SFC)

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 52

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 53

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 54

IO Map

On-Line PLC Diagnostics

PLC Status

PLC Simulator

Ethernet (TCPIP) Address

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 55

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 56

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 57

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 58

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 59

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 60

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 61

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 62

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 63

Structured Text was used hereNOT Ladder

Programming for Motors

The PLC DOES NOT CAREStructured Text Functions EXACTLY

the same as LadderUse what yoursquore comfortable with

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 64

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 65

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 66

IEC Function Blocks Used Here

Programming for Analogs amp PID

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 67

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 68

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 69

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 70

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 71

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 72

Sequential Function Charts were used here

Higher-Level Control

bull SFCrsquos lend themselves well to (as the name would imply) sequential processes

bull Three Important components in SFCrsquosbull Transitionsbull Stepsbull Jumps

bull The status of the process can be viewed as a flow chart

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 73

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 74

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 75

PLC - HMI Communication

A ldquoPLC Heartbeatrdquo is traditionally used to monitor the PLC - HMI Communication sometimes called ardquoWatchdog Timerrdquo

Call it whatever you want but the PLC amp 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 ldquodiesrdquo then that switch doesnrsquot change state and an alarm alerts the operator

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 76

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 77

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 78

TUTORIAL

Part 2B

HMI Programming

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 79

Ethernet (TCPIP) IO Driver

The Ethernet (TCPIP) IO Driver allows the HMI to communicate with the PLC (In this case the driver is called MBENETEXE)

The PLC has an ethernet module in one of the slots that has a ldquoCAT5RJ-45rdquo 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 ldquoCAT5RJ-45rdquo receptacle for the ethernet cable

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 80

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 81

Operator Screens amp Popup Displays

The display is laid out in 3 sections

bull Upper - Security amp Alarm Windowbull Middle- Main Operator Screens bull Lower - Menu amp Popup Displays

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 82

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 83

Scripting

There are 6 types of ldquoScriptsrdquobull Application Scriptsbull Key Scriptsbull Condition Scriptsbull Data Change Scriptsbull Quick Function Scriptsbull ActiveX Event Scripts

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 84

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 85

Access Names

The ldquoAccess Namesrdquo Must be configured to allow the PLC - HMI communications

Note that the ldquoApplicationTopicrdquo is the same as the IO Driver

The ldquocomputer namerdquo is the name of the PC that the HMI is running on (brad_s_carlberg in this case)

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 86

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 87

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 88

Indirect Tags

ldquoIndirect Tagsrdquo were used here to minimize the number of popup displays

This is especially useful in HMIrsquos with many tags

ONLY 12 popup displays are reused throughout the HMI

This gives the HMI a ldquoDCS-Likerdquo Look amp Feel

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 89

Popup Display TypesThe tag point type determines which popup display to use

Analog InputHIC (or Analog Output)PID (or Analog Composite)

bull PID WITH AUTO amp CASCADE amp RATIObull PID WITH AUTO amp RATIO

Diginbull Motor Status

DigOutMotor (or Digital Composite)

bull Motor with ILock and PermNumericSet TimersAlarm DetailAlarm Tags

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 90

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 91

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 92

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 93

Bars Buttons amp Sliders

By choosing to use indirect tags we complicate the Bar Graphs Buttons amp Sliders in the popup displays

Different scales need to be used for different engineering unit ranges

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 94

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 95

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 96

Popup Displays

The next two pages shows how the individual popup displays use the indirect tags

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 97

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 98

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 99

Adding a ldquoTouch Targetrdquo to a Display

2 Tell which tags to use

3 Tell which popup display to call upWhat kind of point type is it

3 Steps1 Tell which scale to use (if itrsquos an analog point type)

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 100

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 101

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 102

TUTORIAL

Part 2C

Excel Spreadsheets

amp

Visual Basic

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 103

A ldquoCHEAP amp DIRTYrdquo HMI With Excel

The 4 key parameters are

To communicate with the PLCUse brad_s_carlbergmbenet|ANOXIC_OXICrsquoplcregisterrsquo

Excel uses ldquopeeksrdquo amp ldquopokesrdquo to read from amp write to a PLC or HMI

To communicate with the HMIbrad_s_carlbergview|Tagnamersquotagnamersquo

bull computer namebull applicationbull topicbull item

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 104

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 105

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 106

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 107

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 108

Excel Macros

bull ldquoRequestrdquo Macro to read values

bull ldquoPokerdquo Macro to write values

bull A Sample Excel Macro

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 109

Sub PokeMacro()MsgBox ApplicationNetworkTemplatesPathChannel = ApplicationDDEInitiate(app=brad_s_carlbergVIEW topic=Tagname) This opens a DDE channel to ViewApplicationDDEPoke Channel Temperature1 Worksheets(Sheet1)Range(A1) Puts value from R1C1 into Temperature1ApplicationDDEPoke Channel DDEReal Worksheets(Sheet1)Range(A2) Puts value from R1C1 into Temperature1ApplicationDDEPoke Channel DDEInteger Worksheets(Sheet1)Range(A3) Puts value from R1C1 into Temperature1ApplicationDDETerminate Channel This terminates the DDE channelEnd SubSub RequestMacro()Channel = ApplicationDDEInitiate(app=brad_s_carlbergVIEW topic=Tagname) This opens a DDE channel to ViewWorksheets(Sheet1)Range(C4) = ApplicationDDERequest(Channel $Hour)Worksheets(Sheet1)Range(C5) = ApplicationDDERequest(Channel $Minute)Worksheets(Sheet1)Range(C6) = ApplicationDDERequest(Channel $Second)Worksheets(Sheet1)Range(C9) = ApplicationDDERequest(Channel $day)Worksheets(Sheet1)Range(C10) = ApplicationDDERequest(Channel $date)Worksheets(Sheet1)Range(C11) = ApplicationDDERequest(Channel $datestring)Worksheets(Sheet1)Range(C12) = ApplicationDDERequest(Channel $datetime)Worksheets(Sheet1)Range(C13) = ApplicationDDERequest(Channel $date)Worksheets(Sheet1)Range(C14) = ApplicationDDERequest(Channel $month)Worksheets(Sheet1)Range(C15) = ApplicationDDERequest(Channel $year)Worksheets(Sheet1)Range(C16) = ApplicationDDERequest(Channel $time)Worksheets(Sheet1)Range(C17) = ApplicationDDERequest(Channel $timestring)Worksheets(Sheet1)Range(C18) = ApplicationDDERequest(Channel $applicationversion)Worksheets(Sheet1)Range(C19) = ApplicationDDERequest(Channel $startddeconversations)Worksheets(Sheet1)Range(C20) = ApplicationDDERequest(Channel $accesslevel)Worksheets(Sheet1)Range(C21) = ApplicationDDERequest(Channel $alarmlogging)Worksheets(Sheet1)Range(C22) = ApplicationDDERequest(Channel $applicationchanged)Worksheets(Sheet1)Range(C23) = ApplicationDDERequest(Channel $configureusers)Worksheets(Sheet1)Range(C24) = ApplicationDDERequest(Channel $changepassword)Worksheets(Sheet1)Range(C25) = ApplicationDDERequest(Channel $InactivityTimeout)Worksheets(Sheet1)Range(C26) = ApplicationDDERequest(Channel $InactivityWarning)Worksheets(Sheet1)Range(C27) = ApplicationDDERequest(Channel $LogicRunning)Worksheets(Sheet1)Range(C28) = ApplicationDDERequest(Channel $OperatorEntered)Worksheets(Sheet1)Range(C29) = ApplicationDDERequest(Channel $Operator)Worksheets(Sheet1)Range(C30) = ApplicationDDERequest(Channel $PasswordEntered)ApplicationDDETerminate Channel This terminates the DDE channelEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 110

Visual Basic

ldquoRoll Your Ownrdquo HMI - Much More powerful than Excel

Key Parameters computer nameapplication|topicitem

IO Emulator - MBPlusSimulateexe

Can ldquoRead Fromrdquo amp ldquoWrite Tordquo PLC andor HMI

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 111

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 112

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 113

Dim PauseTime Start Finish TotalTime As Integer Declare variables

Private Sub txtAIT_332A_SCALED_Change()On Error GoTo PokeAIT_332AErrortxtAIT_332A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtAIT_332A_SCALEDText = Int((3 Rnd) + 20) Generate random value between 20 and 23txtAIT_332A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtAIT_332A_SCALEDLinkItem = AIT_332A_SCALEDtxtAIT_332A_SCALEDLinkMode = 2txtAIT_332A_SCALEDLinkPoketxtAIT_332A_SCALEDLinkMode = 0 DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total time

PokeAIT_332AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtAIT_332A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 114

Private Sub txtAIT_346A_SCALED_Change()On Error GoTo PokeAIT_346AErrortxtAIT_346A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtAIT_346A_SCALEDText = Int((3 Rnd) + 15) Generate random value between 15 and 18txtAIT_346A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtAIT_346A_SCALEDLinkItem = AIT_346A_SCALEDtxtAIT_346A_SCALEDLinkMode = 2txtAIT_346A_SCALEDLinkPoketxtAIT_346A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeAIT_346AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtAIT_346A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 115

Private Sub txtFIT_321A_SCALED_Change()On Error GoTo PokeFIT_321AErrortxtFIT_321A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtFIT_321A_SCALEDText = Int((10 Rnd) + 120) Generate random value between 120 and 130txtFIT_321A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_321A_SCALEDLinkItem = FIT_321A_SCALEDtxtFIT_321A_SCALEDLinkMode = 2txtFIT_321A_SCALEDLinkPoketxtFIT_321A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total time

PokeFIT_321AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_321A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume Next

End Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 116

Private Sub txtFIT_341A_SCALED_Change()On Error GoTo PokeFIT_341AErrortxtFIT_341A_SCALEDLinkMode = 0 PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTime

txtFIT_341A_SCALEDText = Int((3 Rnd) + 18) Generate random value between 18 and 21

txtFIT_341A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_341A_SCALEDLinkItem = FIT_341A_SCALEDtxtFIT_341A_SCALEDLinkMode = 2txtFIT_341A_SCALEDLinkPoketxtFIT_341A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeFIT_341AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_341A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 117

Private Sub txtFIT_343A_SCALED_Change()On Error GoTo PokeFIT_343AErrortxtFIT_343A_SCALEDLinkMode = 0 PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTime

txtFIT_343A_SCALEDText = Int((1 Rnd) + 3) Generate random value between 3 and 4

txtFIT_343A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_343A_SCALEDLinkItem = FIT_343A_SCALEDtxtFIT_343A_SCALEDLinkMode = 2txtFIT_343A_SCALEDLinkPoketxtFIT_343A_SCALEDLinkMode = 0 DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeFIT_343AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_343A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 118

TUTORIAL

Part 4

Questions

amp

Answers

  • Slide 1
  • Slide 2
  • Slide 3
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Slide 8
  • Slide 9
  • Slide 10
  • Slide 11
  • Slide 12
  • Slide 13
  • Slide 14
  • Slide 15
  • Slide 16
  • Slide 17
  • Slide 18
  • Slide 19
  • Slide 20
  • Slide 21
  • Slide 22
  • Slide 23
  • Slide 24
  • Slide 25
  • Slide 26
  • Slide 27
  • Slide 28
  • Slide 29
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
  • Slide 34
  • Slide 35
  • Slide 36
  • Slide 37
  • Slide 38
  • Slide 39
  • Slide 40
  • Slide 41
  • Slide 42
  • Slide 43
  • Slide 44
  • Slide 45
  • Slide 46
  • Slide 47
  • Slide 48
  • Slide 49
  • Slide 50
  • Slide 51
  • Slide 52
  • Slide 53
  • Slide 54
  • Slide 55
  • Slide 56
  • Slide 57
  • Slide 58
  • Slide 59
  • Slide 60
  • Slide 61
  • Slide 62
  • Slide 63
  • Slide 64
  • Slide 65
  • Slide 66
  • Slide 67
  • Slide 68
  • Slide 69
  • Slide 70
  • Slide 71
  • Slide 72
  • Slide 73
  • Slide 74
  • Slide 75
  • Slide 76
  • Slide 77
  • Slide 78
  • Slide 79
  • Slide 80
  • Slide 81
  • Slide 82
  • Slide 83
  • Slide 84
  • Slide 85
  • Slide 86
  • Slide 87
  • Slide 88
  • Slide 89
  • Slide 90
  • Slide 91
  • Slide 92
  • Slide 93
  • Slide 94
  • Slide 95
  • Slide 96
  • Slide 97
  • Slide 98
  • Slide 99
  • Slide 100
  • Slide 101
  • Slide 102
  • Slide 103
  • Slide 104
  • Slide 105
  • Slide 106
  • Slide 107
  • Slide 108
  • Slide 109
  • Slide 110
  • Slide 111
  • Slide 112
  • Slide 113
  • Slide 114
  • Slide 115
  • Slide 116
  • Slide 117
  • Slide 118
Page 14: TUTORIAL Ethernet PLC's Improve Oxygen Consumption ISA Expo/2001Houston, Texas Water & Wastewater Industry DivisionTuesday, September 11, 2001 1 Brad.

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 15

Train Details

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 17

Selecting A Control Level For Oxygen Addition For 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 18

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

Control Levels The following control levels are available for Oxygen

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 20

Oxygen Control Levels

Cascade from Cell 3 Dissolved Oxygen probe

Ratio from Discharge flow

AutoManual Control

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 22

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 23

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 24

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 25

The following control levels are available for the Recycle flow

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 27

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 28

The following control levels are available for the PD Blowers Timed Mode

Dissolved Oxygen Mode

Manual Mode

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

Motor Popup

The following information is available for each motor control from the respective motor popup

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

Aerator Control Motor Popup

Like all motors the following information is available for the Aerator motor control from the motor popup

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 32

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 33

Motor Popup Surface Aerator Control

The following information is available for motor control from the motor popup

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 35

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 36

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 37

Lower Explosive Level (LEL)

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 38

Each train has a digital input that tells whether thecombustible 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 (LEL) system

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 39

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 Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 40

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 41

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 Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 42

Like a DCS

middot 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

middot 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 amp CASCADE amp RATIO PID WITH AUTO amp RATIO Digin Motor Status DigOut Motor (or Digital Composite) Motor with ILock and Perm Numeric Set Timers Alarm Detail and Alarm Tags

middot A single generic trend display to trend ALL trendable (archived) points

Alarm Management

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

middot A Distributed Alarm Summary has been used to give better alarm management tools

bull Up to eight trend pens on the trend display

bull The operator picks which values to trend by clicking in the center of the trend

display

bull 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 44

The AnoxicOxic 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 Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 46

The following control levels are available for Oxygen1 Cascade from Dissolved Oxygen

2 Ratio from Discharge flow3 Auto-Manual Control

The following control levels are available for the Recycle flow1 Ratio from Discharge flow

2 Auto-Manual Control

The following control levels are available for the PD Blowers3 Timed Mode

2 Dissolved Oxygen Mode3 Manual Mode

Conclusions

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 47

Following the commissioning of the ethernet-based PLCs Oxygen consumption was significantly reduced

The advanced controls allow the operators to leave the process alone and continue to optimally treat the sewage

Conclusions

Following the commissioning of the ethernet-based PLCs AnoxicOxic 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 Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 48

Summary

The PD Blowers ran in Timed Mode andor 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

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 Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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 Authoritys 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 50

TUTORIAL

Part 2A

PLC Programming Basics

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 51

Separate parts of the process have been organized into a separate ldquoSECTIONrdquo

PLC Program Organization

Each ldquoSECTIONrdquo can be any of the IEC programming types

bull Ladder (LD)bull Structured Text (ST)

bull Instruction List (IL)

bull Function Blocks (FB)bull Sequential Function Charts (SFC)

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 52

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 53

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 54

IO Map

On-Line PLC Diagnostics

PLC Status

PLC Simulator

Ethernet (TCPIP) Address

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 55

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 56

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 57

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 58

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 59

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 60

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 61

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 62

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 63

Structured Text was used hereNOT Ladder

Programming for Motors

The PLC DOES NOT CAREStructured Text Functions EXACTLY

the same as LadderUse what yoursquore comfortable with

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 64

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 65

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 66

IEC Function Blocks Used Here

Programming for Analogs amp PID

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 67

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 68

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 69

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 70

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 71

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 72

Sequential Function Charts were used here

Higher-Level Control

bull SFCrsquos lend themselves well to (as the name would imply) sequential processes

bull Three Important components in SFCrsquosbull Transitionsbull Stepsbull Jumps

bull The status of the process can be viewed as a flow chart

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 73

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 74

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 75

PLC - HMI Communication

A ldquoPLC Heartbeatrdquo is traditionally used to monitor the PLC - HMI Communication sometimes called ardquoWatchdog Timerrdquo

Call it whatever you want but the PLC amp 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 ldquodiesrdquo then that switch doesnrsquot change state and an alarm alerts the operator

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 76

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 77

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 78

TUTORIAL

Part 2B

HMI Programming

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 79

Ethernet (TCPIP) IO Driver

The Ethernet (TCPIP) IO Driver allows the HMI to communicate with the PLC (In this case the driver is called MBENETEXE)

The PLC has an ethernet module in one of the slots that has a ldquoCAT5RJ-45rdquo 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 ldquoCAT5RJ-45rdquo receptacle for the ethernet cable

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 80

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 81

Operator Screens amp Popup Displays

The display is laid out in 3 sections

bull Upper - Security amp Alarm Windowbull Middle- Main Operator Screens bull Lower - Menu amp Popup Displays

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 82

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 83

Scripting

There are 6 types of ldquoScriptsrdquobull Application Scriptsbull Key Scriptsbull Condition Scriptsbull Data Change Scriptsbull Quick Function Scriptsbull ActiveX Event Scripts

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 84

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 85

Access Names

The ldquoAccess Namesrdquo Must be configured to allow the PLC - HMI communications

Note that the ldquoApplicationTopicrdquo is the same as the IO Driver

The ldquocomputer namerdquo is the name of the PC that the HMI is running on (brad_s_carlberg in this case)

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 86

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 87

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 88

Indirect Tags

ldquoIndirect Tagsrdquo were used here to minimize the number of popup displays

This is especially useful in HMIrsquos with many tags

ONLY 12 popup displays are reused throughout the HMI

This gives the HMI a ldquoDCS-Likerdquo Look amp Feel

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 89

Popup Display TypesThe tag point type determines which popup display to use

Analog InputHIC (or Analog Output)PID (or Analog Composite)

bull PID WITH AUTO amp CASCADE amp RATIObull PID WITH AUTO amp RATIO

Diginbull Motor Status

DigOutMotor (or Digital Composite)

bull Motor with ILock and PermNumericSet TimersAlarm DetailAlarm Tags

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 90

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 91

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 92

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 93

Bars Buttons amp Sliders

By choosing to use indirect tags we complicate the Bar Graphs Buttons amp Sliders in the popup displays

Different scales need to be used for different engineering unit ranges

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 94

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 95

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 96

Popup Displays

The next two pages shows how the individual popup displays use the indirect tags

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 97

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 98

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 99

Adding a ldquoTouch Targetrdquo to a Display

2 Tell which tags to use

3 Tell which popup display to call upWhat kind of point type is it

3 Steps1 Tell which scale to use (if itrsquos an analog point type)

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 100

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 101

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 102

TUTORIAL

Part 2C

Excel Spreadsheets

amp

Visual Basic

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 103

A ldquoCHEAP amp DIRTYrdquo HMI With Excel

The 4 key parameters are

To communicate with the PLCUse brad_s_carlbergmbenet|ANOXIC_OXICrsquoplcregisterrsquo

Excel uses ldquopeeksrdquo amp ldquopokesrdquo to read from amp write to a PLC or HMI

To communicate with the HMIbrad_s_carlbergview|Tagnamersquotagnamersquo

bull computer namebull applicationbull topicbull item

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 104

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 105

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 106

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 107

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 108

Excel Macros

bull ldquoRequestrdquo Macro to read values

bull ldquoPokerdquo Macro to write values

bull A Sample Excel Macro

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 109

Sub PokeMacro()MsgBox ApplicationNetworkTemplatesPathChannel = ApplicationDDEInitiate(app=brad_s_carlbergVIEW topic=Tagname) This opens a DDE channel to ViewApplicationDDEPoke Channel Temperature1 Worksheets(Sheet1)Range(A1) Puts value from R1C1 into Temperature1ApplicationDDEPoke Channel DDEReal Worksheets(Sheet1)Range(A2) Puts value from R1C1 into Temperature1ApplicationDDEPoke Channel DDEInteger Worksheets(Sheet1)Range(A3) Puts value from R1C1 into Temperature1ApplicationDDETerminate Channel This terminates the DDE channelEnd SubSub RequestMacro()Channel = ApplicationDDEInitiate(app=brad_s_carlbergVIEW topic=Tagname) This opens a DDE channel to ViewWorksheets(Sheet1)Range(C4) = ApplicationDDERequest(Channel $Hour)Worksheets(Sheet1)Range(C5) = ApplicationDDERequest(Channel $Minute)Worksheets(Sheet1)Range(C6) = ApplicationDDERequest(Channel $Second)Worksheets(Sheet1)Range(C9) = ApplicationDDERequest(Channel $day)Worksheets(Sheet1)Range(C10) = ApplicationDDERequest(Channel $date)Worksheets(Sheet1)Range(C11) = ApplicationDDERequest(Channel $datestring)Worksheets(Sheet1)Range(C12) = ApplicationDDERequest(Channel $datetime)Worksheets(Sheet1)Range(C13) = ApplicationDDERequest(Channel $date)Worksheets(Sheet1)Range(C14) = ApplicationDDERequest(Channel $month)Worksheets(Sheet1)Range(C15) = ApplicationDDERequest(Channel $year)Worksheets(Sheet1)Range(C16) = ApplicationDDERequest(Channel $time)Worksheets(Sheet1)Range(C17) = ApplicationDDERequest(Channel $timestring)Worksheets(Sheet1)Range(C18) = ApplicationDDERequest(Channel $applicationversion)Worksheets(Sheet1)Range(C19) = ApplicationDDERequest(Channel $startddeconversations)Worksheets(Sheet1)Range(C20) = ApplicationDDERequest(Channel $accesslevel)Worksheets(Sheet1)Range(C21) = ApplicationDDERequest(Channel $alarmlogging)Worksheets(Sheet1)Range(C22) = ApplicationDDERequest(Channel $applicationchanged)Worksheets(Sheet1)Range(C23) = ApplicationDDERequest(Channel $configureusers)Worksheets(Sheet1)Range(C24) = ApplicationDDERequest(Channel $changepassword)Worksheets(Sheet1)Range(C25) = ApplicationDDERequest(Channel $InactivityTimeout)Worksheets(Sheet1)Range(C26) = ApplicationDDERequest(Channel $InactivityWarning)Worksheets(Sheet1)Range(C27) = ApplicationDDERequest(Channel $LogicRunning)Worksheets(Sheet1)Range(C28) = ApplicationDDERequest(Channel $OperatorEntered)Worksheets(Sheet1)Range(C29) = ApplicationDDERequest(Channel $Operator)Worksheets(Sheet1)Range(C30) = ApplicationDDERequest(Channel $PasswordEntered)ApplicationDDETerminate Channel This terminates the DDE channelEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 110

Visual Basic

ldquoRoll Your Ownrdquo HMI - Much More powerful than Excel

Key Parameters computer nameapplication|topicitem

IO Emulator - MBPlusSimulateexe

Can ldquoRead Fromrdquo amp ldquoWrite Tordquo PLC andor HMI

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 111

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 112

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 113

Dim PauseTime Start Finish TotalTime As Integer Declare variables

Private Sub txtAIT_332A_SCALED_Change()On Error GoTo PokeAIT_332AErrortxtAIT_332A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtAIT_332A_SCALEDText = Int((3 Rnd) + 20) Generate random value between 20 and 23txtAIT_332A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtAIT_332A_SCALEDLinkItem = AIT_332A_SCALEDtxtAIT_332A_SCALEDLinkMode = 2txtAIT_332A_SCALEDLinkPoketxtAIT_332A_SCALEDLinkMode = 0 DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total time

PokeAIT_332AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtAIT_332A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 114

Private Sub txtAIT_346A_SCALED_Change()On Error GoTo PokeAIT_346AErrortxtAIT_346A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtAIT_346A_SCALEDText = Int((3 Rnd) + 15) Generate random value between 15 and 18txtAIT_346A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtAIT_346A_SCALEDLinkItem = AIT_346A_SCALEDtxtAIT_346A_SCALEDLinkMode = 2txtAIT_346A_SCALEDLinkPoketxtAIT_346A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeAIT_346AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtAIT_346A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 115

Private Sub txtFIT_321A_SCALED_Change()On Error GoTo PokeFIT_321AErrortxtFIT_321A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtFIT_321A_SCALEDText = Int((10 Rnd) + 120) Generate random value between 120 and 130txtFIT_321A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_321A_SCALEDLinkItem = FIT_321A_SCALEDtxtFIT_321A_SCALEDLinkMode = 2txtFIT_321A_SCALEDLinkPoketxtFIT_321A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total time

PokeFIT_321AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_321A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume Next

End Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 116

Private Sub txtFIT_341A_SCALED_Change()On Error GoTo PokeFIT_341AErrortxtFIT_341A_SCALEDLinkMode = 0 PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTime

txtFIT_341A_SCALEDText = Int((3 Rnd) + 18) Generate random value between 18 and 21

txtFIT_341A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_341A_SCALEDLinkItem = FIT_341A_SCALEDtxtFIT_341A_SCALEDLinkMode = 2txtFIT_341A_SCALEDLinkPoketxtFIT_341A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeFIT_341AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_341A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 117

Private Sub txtFIT_343A_SCALED_Change()On Error GoTo PokeFIT_343AErrortxtFIT_343A_SCALEDLinkMode = 0 PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTime

txtFIT_343A_SCALEDText = Int((1 Rnd) + 3) Generate random value between 3 and 4

txtFIT_343A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_343A_SCALEDLinkItem = FIT_343A_SCALEDtxtFIT_343A_SCALEDLinkMode = 2txtFIT_343A_SCALEDLinkPoketxtFIT_343A_SCALEDLinkMode = 0 DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeFIT_343AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_343A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 118

TUTORIAL

Part 4

Questions

amp

Answers

  • Slide 1
  • Slide 2
  • Slide 3
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Slide 8
  • Slide 9
  • Slide 10
  • Slide 11
  • Slide 12
  • Slide 13
  • Slide 14
  • Slide 15
  • Slide 16
  • Slide 17
  • Slide 18
  • Slide 19
  • Slide 20
  • Slide 21
  • Slide 22
  • Slide 23
  • Slide 24
  • Slide 25
  • Slide 26
  • Slide 27
  • Slide 28
  • Slide 29
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
  • Slide 34
  • Slide 35
  • Slide 36
  • Slide 37
  • Slide 38
  • Slide 39
  • Slide 40
  • Slide 41
  • Slide 42
  • Slide 43
  • Slide 44
  • Slide 45
  • Slide 46
  • Slide 47
  • Slide 48
  • Slide 49
  • Slide 50
  • Slide 51
  • Slide 52
  • Slide 53
  • Slide 54
  • Slide 55
  • Slide 56
  • Slide 57
  • Slide 58
  • Slide 59
  • Slide 60
  • Slide 61
  • Slide 62
  • Slide 63
  • Slide 64
  • Slide 65
  • Slide 66
  • Slide 67
  • Slide 68
  • Slide 69
  • Slide 70
  • Slide 71
  • Slide 72
  • Slide 73
  • Slide 74
  • Slide 75
  • Slide 76
  • Slide 77
  • Slide 78
  • Slide 79
  • Slide 80
  • Slide 81
  • Slide 82
  • Slide 83
  • Slide 84
  • Slide 85
  • Slide 86
  • Slide 87
  • Slide 88
  • Slide 89
  • Slide 90
  • Slide 91
  • Slide 92
  • Slide 93
  • Slide 94
  • Slide 95
  • Slide 96
  • Slide 97
  • Slide 98
  • Slide 99
  • Slide 100
  • Slide 101
  • Slide 102
  • Slide 103
  • Slide 104
  • Slide 105
  • Slide 106
  • Slide 107
  • Slide 108
  • Slide 109
  • Slide 110
  • Slide 111
  • Slide 112
  • Slide 113
  • Slide 114
  • Slide 115
  • Slide 116
  • Slide 117
  • Slide 118
Page 15: TUTORIAL Ethernet PLC's Improve Oxygen Consumption ISA Expo/2001Houston, Texas Water & Wastewater Industry DivisionTuesday, September 11, 2001 1 Brad.

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 15

Train Details

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 17

Selecting A Control Level For Oxygen Addition For 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 18

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

Control Levels The following control levels are available for Oxygen

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 20

Oxygen Control Levels

Cascade from Cell 3 Dissolved Oxygen probe

Ratio from Discharge flow

AutoManual Control

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 22

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 23

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 24

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 25

The following control levels are available for the Recycle flow

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 27

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 28

The following control levels are available for the PD Blowers Timed Mode

Dissolved Oxygen Mode

Manual Mode

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

Motor Popup

The following information is available for each motor control from the respective motor popup

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

Aerator Control Motor Popup

Like all motors the following information is available for the Aerator motor control from the motor popup

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 32

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 33

Motor Popup Surface Aerator Control

The following information is available for motor control from the motor popup

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 35

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 36

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 37

Lower Explosive Level (LEL)

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 38

Each train has a digital input that tells whether thecombustible 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 (LEL) system

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 39

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 Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 40

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 41

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 Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 42

Like a DCS

middot 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

middot 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 amp CASCADE amp RATIO PID WITH AUTO amp RATIO Digin Motor Status DigOut Motor (or Digital Composite) Motor with ILock and Perm Numeric Set Timers Alarm Detail and Alarm Tags

middot A single generic trend display to trend ALL trendable (archived) points

Alarm Management

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

middot A Distributed Alarm Summary has been used to give better alarm management tools

bull Up to eight trend pens on the trend display

bull The operator picks which values to trend by clicking in the center of the trend

display

bull 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 44

The AnoxicOxic 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 Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 46

The following control levels are available for Oxygen1 Cascade from Dissolved Oxygen

2 Ratio from Discharge flow3 Auto-Manual Control

The following control levels are available for the Recycle flow1 Ratio from Discharge flow

2 Auto-Manual Control

The following control levels are available for the PD Blowers3 Timed Mode

2 Dissolved Oxygen Mode3 Manual Mode

Conclusions

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 47

Following the commissioning of the ethernet-based PLCs Oxygen consumption was significantly reduced

The advanced controls allow the operators to leave the process alone and continue to optimally treat the sewage

Conclusions

Following the commissioning of the ethernet-based PLCs AnoxicOxic 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 Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 48

Summary

The PD Blowers ran in Timed Mode andor 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

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 Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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 Authoritys 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 50

TUTORIAL

Part 2A

PLC Programming Basics

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 51

Separate parts of the process have been organized into a separate ldquoSECTIONrdquo

PLC Program Organization

Each ldquoSECTIONrdquo can be any of the IEC programming types

bull Ladder (LD)bull Structured Text (ST)

bull Instruction List (IL)

bull Function Blocks (FB)bull Sequential Function Charts (SFC)

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 52

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 53

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 54

IO Map

On-Line PLC Diagnostics

PLC Status

PLC Simulator

Ethernet (TCPIP) Address

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 55

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 56

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 57

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 58

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 59

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 60

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 61

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 62

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 63

Structured Text was used hereNOT Ladder

Programming for Motors

The PLC DOES NOT CAREStructured Text Functions EXACTLY

the same as LadderUse what yoursquore comfortable with

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 64

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 65

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 66

IEC Function Blocks Used Here

Programming for Analogs amp PID

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 67

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 68

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 69

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 70

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 71

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 72

Sequential Function Charts were used here

Higher-Level Control

bull SFCrsquos lend themselves well to (as the name would imply) sequential processes

bull Three Important components in SFCrsquosbull Transitionsbull Stepsbull Jumps

bull The status of the process can be viewed as a flow chart

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 73

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 74

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 75

PLC - HMI Communication

A ldquoPLC Heartbeatrdquo is traditionally used to monitor the PLC - HMI Communication sometimes called ardquoWatchdog Timerrdquo

Call it whatever you want but the PLC amp 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 ldquodiesrdquo then that switch doesnrsquot change state and an alarm alerts the operator

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 76

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 77

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 78

TUTORIAL

Part 2B

HMI Programming

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 79

Ethernet (TCPIP) IO Driver

The Ethernet (TCPIP) IO Driver allows the HMI to communicate with the PLC (In this case the driver is called MBENETEXE)

The PLC has an ethernet module in one of the slots that has a ldquoCAT5RJ-45rdquo 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 ldquoCAT5RJ-45rdquo receptacle for the ethernet cable

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 80

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 81

Operator Screens amp Popup Displays

The display is laid out in 3 sections

bull Upper - Security amp Alarm Windowbull Middle- Main Operator Screens bull Lower - Menu amp Popup Displays

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 82

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 83

Scripting

There are 6 types of ldquoScriptsrdquobull Application Scriptsbull Key Scriptsbull Condition Scriptsbull Data Change Scriptsbull Quick Function Scriptsbull ActiveX Event Scripts

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 84

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 85

Access Names

The ldquoAccess Namesrdquo Must be configured to allow the PLC - HMI communications

Note that the ldquoApplicationTopicrdquo is the same as the IO Driver

The ldquocomputer namerdquo is the name of the PC that the HMI is running on (brad_s_carlberg in this case)

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 86

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 87

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 88

Indirect Tags

ldquoIndirect Tagsrdquo were used here to minimize the number of popup displays

This is especially useful in HMIrsquos with many tags

ONLY 12 popup displays are reused throughout the HMI

This gives the HMI a ldquoDCS-Likerdquo Look amp Feel

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 89

Popup Display TypesThe tag point type determines which popup display to use

Analog InputHIC (or Analog Output)PID (or Analog Composite)

bull PID WITH AUTO amp CASCADE amp RATIObull PID WITH AUTO amp RATIO

Diginbull Motor Status

DigOutMotor (or Digital Composite)

bull Motor with ILock and PermNumericSet TimersAlarm DetailAlarm Tags

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 90

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 91

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 92

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 93

Bars Buttons amp Sliders

By choosing to use indirect tags we complicate the Bar Graphs Buttons amp Sliders in the popup displays

Different scales need to be used for different engineering unit ranges

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 94

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 95

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 96

Popup Displays

The next two pages shows how the individual popup displays use the indirect tags

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 97

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 98

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 99

Adding a ldquoTouch Targetrdquo to a Display

2 Tell which tags to use

3 Tell which popup display to call upWhat kind of point type is it

3 Steps1 Tell which scale to use (if itrsquos an analog point type)

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 100

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 101

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 102

TUTORIAL

Part 2C

Excel Spreadsheets

amp

Visual Basic

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 103

A ldquoCHEAP amp DIRTYrdquo HMI With Excel

The 4 key parameters are

To communicate with the PLCUse brad_s_carlbergmbenet|ANOXIC_OXICrsquoplcregisterrsquo

Excel uses ldquopeeksrdquo amp ldquopokesrdquo to read from amp write to a PLC or HMI

To communicate with the HMIbrad_s_carlbergview|Tagnamersquotagnamersquo

bull computer namebull applicationbull topicbull item

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 104

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 105

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 106

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 107

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 108

Excel Macros

bull ldquoRequestrdquo Macro to read values

bull ldquoPokerdquo Macro to write values

bull A Sample Excel Macro

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 109

Sub PokeMacro()MsgBox ApplicationNetworkTemplatesPathChannel = ApplicationDDEInitiate(app=brad_s_carlbergVIEW topic=Tagname) This opens a DDE channel to ViewApplicationDDEPoke Channel Temperature1 Worksheets(Sheet1)Range(A1) Puts value from R1C1 into Temperature1ApplicationDDEPoke Channel DDEReal Worksheets(Sheet1)Range(A2) Puts value from R1C1 into Temperature1ApplicationDDEPoke Channel DDEInteger Worksheets(Sheet1)Range(A3) Puts value from R1C1 into Temperature1ApplicationDDETerminate Channel This terminates the DDE channelEnd SubSub RequestMacro()Channel = ApplicationDDEInitiate(app=brad_s_carlbergVIEW topic=Tagname) This opens a DDE channel to ViewWorksheets(Sheet1)Range(C4) = ApplicationDDERequest(Channel $Hour)Worksheets(Sheet1)Range(C5) = ApplicationDDERequest(Channel $Minute)Worksheets(Sheet1)Range(C6) = ApplicationDDERequest(Channel $Second)Worksheets(Sheet1)Range(C9) = ApplicationDDERequest(Channel $day)Worksheets(Sheet1)Range(C10) = ApplicationDDERequest(Channel $date)Worksheets(Sheet1)Range(C11) = ApplicationDDERequest(Channel $datestring)Worksheets(Sheet1)Range(C12) = ApplicationDDERequest(Channel $datetime)Worksheets(Sheet1)Range(C13) = ApplicationDDERequest(Channel $date)Worksheets(Sheet1)Range(C14) = ApplicationDDERequest(Channel $month)Worksheets(Sheet1)Range(C15) = ApplicationDDERequest(Channel $year)Worksheets(Sheet1)Range(C16) = ApplicationDDERequest(Channel $time)Worksheets(Sheet1)Range(C17) = ApplicationDDERequest(Channel $timestring)Worksheets(Sheet1)Range(C18) = ApplicationDDERequest(Channel $applicationversion)Worksheets(Sheet1)Range(C19) = ApplicationDDERequest(Channel $startddeconversations)Worksheets(Sheet1)Range(C20) = ApplicationDDERequest(Channel $accesslevel)Worksheets(Sheet1)Range(C21) = ApplicationDDERequest(Channel $alarmlogging)Worksheets(Sheet1)Range(C22) = ApplicationDDERequest(Channel $applicationchanged)Worksheets(Sheet1)Range(C23) = ApplicationDDERequest(Channel $configureusers)Worksheets(Sheet1)Range(C24) = ApplicationDDERequest(Channel $changepassword)Worksheets(Sheet1)Range(C25) = ApplicationDDERequest(Channel $InactivityTimeout)Worksheets(Sheet1)Range(C26) = ApplicationDDERequest(Channel $InactivityWarning)Worksheets(Sheet1)Range(C27) = ApplicationDDERequest(Channel $LogicRunning)Worksheets(Sheet1)Range(C28) = ApplicationDDERequest(Channel $OperatorEntered)Worksheets(Sheet1)Range(C29) = ApplicationDDERequest(Channel $Operator)Worksheets(Sheet1)Range(C30) = ApplicationDDERequest(Channel $PasswordEntered)ApplicationDDETerminate Channel This terminates the DDE channelEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 110

Visual Basic

ldquoRoll Your Ownrdquo HMI - Much More powerful than Excel

Key Parameters computer nameapplication|topicitem

IO Emulator - MBPlusSimulateexe

Can ldquoRead Fromrdquo amp ldquoWrite Tordquo PLC andor HMI

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 111

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 112

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 113

Dim PauseTime Start Finish TotalTime As Integer Declare variables

Private Sub txtAIT_332A_SCALED_Change()On Error GoTo PokeAIT_332AErrortxtAIT_332A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtAIT_332A_SCALEDText = Int((3 Rnd) + 20) Generate random value between 20 and 23txtAIT_332A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtAIT_332A_SCALEDLinkItem = AIT_332A_SCALEDtxtAIT_332A_SCALEDLinkMode = 2txtAIT_332A_SCALEDLinkPoketxtAIT_332A_SCALEDLinkMode = 0 DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total time

PokeAIT_332AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtAIT_332A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 114

Private Sub txtAIT_346A_SCALED_Change()On Error GoTo PokeAIT_346AErrortxtAIT_346A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtAIT_346A_SCALEDText = Int((3 Rnd) + 15) Generate random value between 15 and 18txtAIT_346A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtAIT_346A_SCALEDLinkItem = AIT_346A_SCALEDtxtAIT_346A_SCALEDLinkMode = 2txtAIT_346A_SCALEDLinkPoketxtAIT_346A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeAIT_346AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtAIT_346A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 115

Private Sub txtFIT_321A_SCALED_Change()On Error GoTo PokeFIT_321AErrortxtFIT_321A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtFIT_321A_SCALEDText = Int((10 Rnd) + 120) Generate random value between 120 and 130txtFIT_321A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_321A_SCALEDLinkItem = FIT_321A_SCALEDtxtFIT_321A_SCALEDLinkMode = 2txtFIT_321A_SCALEDLinkPoketxtFIT_321A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total time

PokeFIT_321AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_321A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume Next

End Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 116

Private Sub txtFIT_341A_SCALED_Change()On Error GoTo PokeFIT_341AErrortxtFIT_341A_SCALEDLinkMode = 0 PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTime

txtFIT_341A_SCALEDText = Int((3 Rnd) + 18) Generate random value between 18 and 21

txtFIT_341A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_341A_SCALEDLinkItem = FIT_341A_SCALEDtxtFIT_341A_SCALEDLinkMode = 2txtFIT_341A_SCALEDLinkPoketxtFIT_341A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeFIT_341AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_341A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 117

Private Sub txtFIT_343A_SCALED_Change()On Error GoTo PokeFIT_343AErrortxtFIT_343A_SCALEDLinkMode = 0 PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTime

txtFIT_343A_SCALEDText = Int((1 Rnd) + 3) Generate random value between 3 and 4

txtFIT_343A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_343A_SCALEDLinkItem = FIT_343A_SCALEDtxtFIT_343A_SCALEDLinkMode = 2txtFIT_343A_SCALEDLinkPoketxtFIT_343A_SCALEDLinkMode = 0 DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeFIT_343AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_343A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 118

TUTORIAL

Part 4

Questions

amp

Answers

  • Slide 1
  • Slide 2
  • Slide 3
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Slide 8
  • Slide 9
  • Slide 10
  • Slide 11
  • Slide 12
  • Slide 13
  • Slide 14
  • Slide 15
  • Slide 16
  • Slide 17
  • Slide 18
  • Slide 19
  • Slide 20
  • Slide 21
  • Slide 22
  • Slide 23
  • Slide 24
  • Slide 25
  • Slide 26
  • Slide 27
  • Slide 28
  • Slide 29
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
  • Slide 34
  • Slide 35
  • Slide 36
  • Slide 37
  • Slide 38
  • Slide 39
  • Slide 40
  • Slide 41
  • Slide 42
  • Slide 43
  • Slide 44
  • Slide 45
  • Slide 46
  • Slide 47
  • Slide 48
  • Slide 49
  • Slide 50
  • Slide 51
  • Slide 52
  • Slide 53
  • Slide 54
  • Slide 55
  • Slide 56
  • Slide 57
  • Slide 58
  • Slide 59
  • Slide 60
  • Slide 61
  • Slide 62
  • Slide 63
  • Slide 64
  • Slide 65
  • Slide 66
  • Slide 67
  • Slide 68
  • Slide 69
  • Slide 70
  • Slide 71
  • Slide 72
  • Slide 73
  • Slide 74
  • Slide 75
  • Slide 76
  • Slide 77
  • Slide 78
  • Slide 79
  • Slide 80
  • Slide 81
  • Slide 82
  • Slide 83
  • Slide 84
  • Slide 85
  • Slide 86
  • Slide 87
  • Slide 88
  • Slide 89
  • Slide 90
  • Slide 91
  • Slide 92
  • Slide 93
  • Slide 94
  • Slide 95
  • Slide 96
  • Slide 97
  • Slide 98
  • Slide 99
  • Slide 100
  • Slide 101
  • Slide 102
  • Slide 103
  • Slide 104
  • Slide 105
  • Slide 106
  • Slide 107
  • Slide 108
  • Slide 109
  • Slide 110
  • Slide 111
  • Slide 112
  • Slide 113
  • Slide 114
  • Slide 115
  • Slide 116
  • Slide 117
  • Slide 118
Page 16: TUTORIAL Ethernet PLC's Improve Oxygen Consumption ISA Expo/2001Houston, Texas Water & Wastewater Industry DivisionTuesday, September 11, 2001 1 Brad.

Train Details

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 17

Selecting A Control Level For Oxygen Addition For 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 18

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

Control Levels The following control levels are available for Oxygen

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 20

Oxygen Control Levels

Cascade from Cell 3 Dissolved Oxygen probe

Ratio from Discharge flow

AutoManual Control

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 22

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 23

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 24

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 25

The following control levels are available for the Recycle flow

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 27

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 28

The following control levels are available for the PD Blowers Timed Mode

Dissolved Oxygen Mode

Manual Mode

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

Motor Popup

The following information is available for each motor control from the respective motor popup

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

Aerator Control Motor Popup

Like all motors the following information is available for the Aerator motor control from the motor popup

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 32

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 33

Motor Popup Surface Aerator Control

The following information is available for motor control from the motor popup

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 35

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 36

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 37

Lower Explosive Level (LEL)

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 38

Each train has a digital input that tells whether thecombustible 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 (LEL) system

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 39

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 Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 40

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 41

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 Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 42

Like a DCS

middot 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

middot 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 amp CASCADE amp RATIO PID WITH AUTO amp RATIO Digin Motor Status DigOut Motor (or Digital Composite) Motor with ILock and Perm Numeric Set Timers Alarm Detail and Alarm Tags

middot A single generic trend display to trend ALL trendable (archived) points

Alarm Management

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

middot A Distributed Alarm Summary has been used to give better alarm management tools

bull Up to eight trend pens on the trend display

bull The operator picks which values to trend by clicking in the center of the trend

display

bull 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 44

The AnoxicOxic 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 Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 46

The following control levels are available for Oxygen1 Cascade from Dissolved Oxygen

2 Ratio from Discharge flow3 Auto-Manual Control

The following control levels are available for the Recycle flow1 Ratio from Discharge flow

2 Auto-Manual Control

The following control levels are available for the PD Blowers3 Timed Mode

2 Dissolved Oxygen Mode3 Manual Mode

Conclusions

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 47

Following the commissioning of the ethernet-based PLCs Oxygen consumption was significantly reduced

The advanced controls allow the operators to leave the process alone and continue to optimally treat the sewage

Conclusions

Following the commissioning of the ethernet-based PLCs AnoxicOxic 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 Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 48

Summary

The PD Blowers ran in Timed Mode andor 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

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 Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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 Authoritys 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 50

TUTORIAL

Part 2A

PLC Programming Basics

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 51

Separate parts of the process have been organized into a separate ldquoSECTIONrdquo

PLC Program Organization

Each ldquoSECTIONrdquo can be any of the IEC programming types

bull Ladder (LD)bull Structured Text (ST)

bull Instruction List (IL)

bull Function Blocks (FB)bull Sequential Function Charts (SFC)

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 52

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 53

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 54

IO Map

On-Line PLC Diagnostics

PLC Status

PLC Simulator

Ethernet (TCPIP) Address

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 55

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 56

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 57

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 58

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 59

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 60

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 61

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 62

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 63

Structured Text was used hereNOT Ladder

Programming for Motors

The PLC DOES NOT CAREStructured Text Functions EXACTLY

the same as LadderUse what yoursquore comfortable with

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 64

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 65

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 66

IEC Function Blocks Used Here

Programming for Analogs amp PID

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 67

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 68

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 69

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 70

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 71

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 72

Sequential Function Charts were used here

Higher-Level Control

bull SFCrsquos lend themselves well to (as the name would imply) sequential processes

bull Three Important components in SFCrsquosbull Transitionsbull Stepsbull Jumps

bull The status of the process can be viewed as a flow chart

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 73

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 74

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 75

PLC - HMI Communication

A ldquoPLC Heartbeatrdquo is traditionally used to monitor the PLC - HMI Communication sometimes called ardquoWatchdog Timerrdquo

Call it whatever you want but the PLC amp 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 ldquodiesrdquo then that switch doesnrsquot change state and an alarm alerts the operator

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 76

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 77

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 78

TUTORIAL

Part 2B

HMI Programming

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 79

Ethernet (TCPIP) IO Driver

The Ethernet (TCPIP) IO Driver allows the HMI to communicate with the PLC (In this case the driver is called MBENETEXE)

The PLC has an ethernet module in one of the slots that has a ldquoCAT5RJ-45rdquo 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 ldquoCAT5RJ-45rdquo receptacle for the ethernet cable

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 80

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 81

Operator Screens amp Popup Displays

The display is laid out in 3 sections

bull Upper - Security amp Alarm Windowbull Middle- Main Operator Screens bull Lower - Menu amp Popup Displays

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 82

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 83

Scripting

There are 6 types of ldquoScriptsrdquobull Application Scriptsbull Key Scriptsbull Condition Scriptsbull Data Change Scriptsbull Quick Function Scriptsbull ActiveX Event Scripts

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 84

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 85

Access Names

The ldquoAccess Namesrdquo Must be configured to allow the PLC - HMI communications

Note that the ldquoApplicationTopicrdquo is the same as the IO Driver

The ldquocomputer namerdquo is the name of the PC that the HMI is running on (brad_s_carlberg in this case)

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 86

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 87

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 88

Indirect Tags

ldquoIndirect Tagsrdquo were used here to minimize the number of popup displays

This is especially useful in HMIrsquos with many tags

ONLY 12 popup displays are reused throughout the HMI

This gives the HMI a ldquoDCS-Likerdquo Look amp Feel

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 89

Popup Display TypesThe tag point type determines which popup display to use

Analog InputHIC (or Analog Output)PID (or Analog Composite)

bull PID WITH AUTO amp CASCADE amp RATIObull PID WITH AUTO amp RATIO

Diginbull Motor Status

DigOutMotor (or Digital Composite)

bull Motor with ILock and PermNumericSet TimersAlarm DetailAlarm Tags

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 90

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 91

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 92

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 93

Bars Buttons amp Sliders

By choosing to use indirect tags we complicate the Bar Graphs Buttons amp Sliders in the popup displays

Different scales need to be used for different engineering unit ranges

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 94

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 95

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 96

Popup Displays

The next two pages shows how the individual popup displays use the indirect tags

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 97

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 98

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 99

Adding a ldquoTouch Targetrdquo to a Display

2 Tell which tags to use

3 Tell which popup display to call upWhat kind of point type is it

3 Steps1 Tell which scale to use (if itrsquos an analog point type)

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 100

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 101

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 102

TUTORIAL

Part 2C

Excel Spreadsheets

amp

Visual Basic

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 103

A ldquoCHEAP amp DIRTYrdquo HMI With Excel

The 4 key parameters are

To communicate with the PLCUse brad_s_carlbergmbenet|ANOXIC_OXICrsquoplcregisterrsquo

Excel uses ldquopeeksrdquo amp ldquopokesrdquo to read from amp write to a PLC or HMI

To communicate with the HMIbrad_s_carlbergview|Tagnamersquotagnamersquo

bull computer namebull applicationbull topicbull item

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 104

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 105

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 106

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 107

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 108

Excel Macros

bull ldquoRequestrdquo Macro to read values

bull ldquoPokerdquo Macro to write values

bull A Sample Excel Macro

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 109

Sub PokeMacro()MsgBox ApplicationNetworkTemplatesPathChannel = ApplicationDDEInitiate(app=brad_s_carlbergVIEW topic=Tagname) This opens a DDE channel to ViewApplicationDDEPoke Channel Temperature1 Worksheets(Sheet1)Range(A1) Puts value from R1C1 into Temperature1ApplicationDDEPoke Channel DDEReal Worksheets(Sheet1)Range(A2) Puts value from R1C1 into Temperature1ApplicationDDEPoke Channel DDEInteger Worksheets(Sheet1)Range(A3) Puts value from R1C1 into Temperature1ApplicationDDETerminate Channel This terminates the DDE channelEnd SubSub RequestMacro()Channel = ApplicationDDEInitiate(app=brad_s_carlbergVIEW topic=Tagname) This opens a DDE channel to ViewWorksheets(Sheet1)Range(C4) = ApplicationDDERequest(Channel $Hour)Worksheets(Sheet1)Range(C5) = ApplicationDDERequest(Channel $Minute)Worksheets(Sheet1)Range(C6) = ApplicationDDERequest(Channel $Second)Worksheets(Sheet1)Range(C9) = ApplicationDDERequest(Channel $day)Worksheets(Sheet1)Range(C10) = ApplicationDDERequest(Channel $date)Worksheets(Sheet1)Range(C11) = ApplicationDDERequest(Channel $datestring)Worksheets(Sheet1)Range(C12) = ApplicationDDERequest(Channel $datetime)Worksheets(Sheet1)Range(C13) = ApplicationDDERequest(Channel $date)Worksheets(Sheet1)Range(C14) = ApplicationDDERequest(Channel $month)Worksheets(Sheet1)Range(C15) = ApplicationDDERequest(Channel $year)Worksheets(Sheet1)Range(C16) = ApplicationDDERequest(Channel $time)Worksheets(Sheet1)Range(C17) = ApplicationDDERequest(Channel $timestring)Worksheets(Sheet1)Range(C18) = ApplicationDDERequest(Channel $applicationversion)Worksheets(Sheet1)Range(C19) = ApplicationDDERequest(Channel $startddeconversations)Worksheets(Sheet1)Range(C20) = ApplicationDDERequest(Channel $accesslevel)Worksheets(Sheet1)Range(C21) = ApplicationDDERequest(Channel $alarmlogging)Worksheets(Sheet1)Range(C22) = ApplicationDDERequest(Channel $applicationchanged)Worksheets(Sheet1)Range(C23) = ApplicationDDERequest(Channel $configureusers)Worksheets(Sheet1)Range(C24) = ApplicationDDERequest(Channel $changepassword)Worksheets(Sheet1)Range(C25) = ApplicationDDERequest(Channel $InactivityTimeout)Worksheets(Sheet1)Range(C26) = ApplicationDDERequest(Channel $InactivityWarning)Worksheets(Sheet1)Range(C27) = ApplicationDDERequest(Channel $LogicRunning)Worksheets(Sheet1)Range(C28) = ApplicationDDERequest(Channel $OperatorEntered)Worksheets(Sheet1)Range(C29) = ApplicationDDERequest(Channel $Operator)Worksheets(Sheet1)Range(C30) = ApplicationDDERequest(Channel $PasswordEntered)ApplicationDDETerminate Channel This terminates the DDE channelEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 110

Visual Basic

ldquoRoll Your Ownrdquo HMI - Much More powerful than Excel

Key Parameters computer nameapplication|topicitem

IO Emulator - MBPlusSimulateexe

Can ldquoRead Fromrdquo amp ldquoWrite Tordquo PLC andor HMI

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 111

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 112

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 113

Dim PauseTime Start Finish TotalTime As Integer Declare variables

Private Sub txtAIT_332A_SCALED_Change()On Error GoTo PokeAIT_332AErrortxtAIT_332A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtAIT_332A_SCALEDText = Int((3 Rnd) + 20) Generate random value between 20 and 23txtAIT_332A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtAIT_332A_SCALEDLinkItem = AIT_332A_SCALEDtxtAIT_332A_SCALEDLinkMode = 2txtAIT_332A_SCALEDLinkPoketxtAIT_332A_SCALEDLinkMode = 0 DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total time

PokeAIT_332AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtAIT_332A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 114

Private Sub txtAIT_346A_SCALED_Change()On Error GoTo PokeAIT_346AErrortxtAIT_346A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtAIT_346A_SCALEDText = Int((3 Rnd) + 15) Generate random value between 15 and 18txtAIT_346A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtAIT_346A_SCALEDLinkItem = AIT_346A_SCALEDtxtAIT_346A_SCALEDLinkMode = 2txtAIT_346A_SCALEDLinkPoketxtAIT_346A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeAIT_346AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtAIT_346A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 115

Private Sub txtFIT_321A_SCALED_Change()On Error GoTo PokeFIT_321AErrortxtFIT_321A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtFIT_321A_SCALEDText = Int((10 Rnd) + 120) Generate random value between 120 and 130txtFIT_321A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_321A_SCALEDLinkItem = FIT_321A_SCALEDtxtFIT_321A_SCALEDLinkMode = 2txtFIT_321A_SCALEDLinkPoketxtFIT_321A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total time

PokeFIT_321AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_321A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume Next

End Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 116

Private Sub txtFIT_341A_SCALED_Change()On Error GoTo PokeFIT_341AErrortxtFIT_341A_SCALEDLinkMode = 0 PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTime

txtFIT_341A_SCALEDText = Int((3 Rnd) + 18) Generate random value between 18 and 21

txtFIT_341A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_341A_SCALEDLinkItem = FIT_341A_SCALEDtxtFIT_341A_SCALEDLinkMode = 2txtFIT_341A_SCALEDLinkPoketxtFIT_341A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeFIT_341AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_341A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 117

Private Sub txtFIT_343A_SCALED_Change()On Error GoTo PokeFIT_343AErrortxtFIT_343A_SCALEDLinkMode = 0 PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTime

txtFIT_343A_SCALEDText = Int((1 Rnd) + 3) Generate random value between 3 and 4

txtFIT_343A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_343A_SCALEDLinkItem = FIT_343A_SCALEDtxtFIT_343A_SCALEDLinkMode = 2txtFIT_343A_SCALEDLinkPoketxtFIT_343A_SCALEDLinkMode = 0 DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeFIT_343AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_343A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 118

TUTORIAL

Part 4

Questions

amp

Answers

  • Slide 1
  • Slide 2
  • Slide 3
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Slide 8
  • Slide 9
  • Slide 10
  • Slide 11
  • Slide 12
  • Slide 13
  • Slide 14
  • Slide 15
  • Slide 16
  • Slide 17
  • Slide 18
  • Slide 19
  • Slide 20
  • Slide 21
  • Slide 22
  • Slide 23
  • Slide 24
  • Slide 25
  • Slide 26
  • Slide 27
  • Slide 28
  • Slide 29
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
  • Slide 34
  • Slide 35
  • Slide 36
  • Slide 37
  • Slide 38
  • Slide 39
  • Slide 40
  • Slide 41
  • Slide 42
  • Slide 43
  • Slide 44
  • Slide 45
  • Slide 46
  • Slide 47
  • Slide 48
  • Slide 49
  • Slide 50
  • Slide 51
  • Slide 52
  • Slide 53
  • Slide 54
  • Slide 55
  • Slide 56
  • Slide 57
  • Slide 58
  • Slide 59
  • Slide 60
  • Slide 61
  • Slide 62
  • Slide 63
  • Slide 64
  • Slide 65
  • Slide 66
  • Slide 67
  • Slide 68
  • Slide 69
  • Slide 70
  • Slide 71
  • Slide 72
  • Slide 73
  • Slide 74
  • Slide 75
  • Slide 76
  • Slide 77
  • Slide 78
  • Slide 79
  • Slide 80
  • Slide 81
  • Slide 82
  • Slide 83
  • Slide 84
  • Slide 85
  • Slide 86
  • Slide 87
  • Slide 88
  • Slide 89
  • Slide 90
  • Slide 91
  • Slide 92
  • Slide 93
  • Slide 94
  • Slide 95
  • Slide 96
  • Slide 97
  • Slide 98
  • Slide 99
  • Slide 100
  • Slide 101
  • Slide 102
  • Slide 103
  • Slide 104
  • Slide 105
  • Slide 106
  • Slide 107
  • Slide 108
  • Slide 109
  • Slide 110
  • Slide 111
  • Slide 112
  • Slide 113
  • Slide 114
  • Slide 115
  • Slide 116
  • Slide 117
  • Slide 118
Page 17: TUTORIAL Ethernet PLC's Improve Oxygen Consumption ISA Expo/2001Houston, Texas Water & Wastewater Industry DivisionTuesday, September 11, 2001 1 Brad.

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 17

Selecting A Control Level For Oxygen Addition For 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 18

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

Control Levels The following control levels are available for Oxygen

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 20

Oxygen Control Levels

Cascade from Cell 3 Dissolved Oxygen probe

Ratio from Discharge flow

AutoManual Control

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 22

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 23

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 24

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 25

The following control levels are available for the Recycle flow

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 27

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 28

The following control levels are available for the PD Blowers Timed Mode

Dissolved Oxygen Mode

Manual Mode

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

Motor Popup

The following information is available for each motor control from the respective motor popup

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

Aerator Control Motor Popup

Like all motors the following information is available for the Aerator motor control from the motor popup

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 32

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 33

Motor Popup Surface Aerator Control

The following information is available for motor control from the motor popup

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 35

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 36

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 37

Lower Explosive Level (LEL)

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 38

Each train has a digital input that tells whether thecombustible 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 (LEL) system

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 39

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 Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 40

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 41

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 Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 42

Like a DCS

middot 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

middot 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 amp CASCADE amp RATIO PID WITH AUTO amp RATIO Digin Motor Status DigOut Motor (or Digital Composite) Motor with ILock and Perm Numeric Set Timers Alarm Detail and Alarm Tags

middot A single generic trend display to trend ALL trendable (archived) points

Alarm Management

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

middot A Distributed Alarm Summary has been used to give better alarm management tools

bull Up to eight trend pens on the trend display

bull The operator picks which values to trend by clicking in the center of the trend

display

bull 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 44

The AnoxicOxic 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 Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 46

The following control levels are available for Oxygen1 Cascade from Dissolved Oxygen

2 Ratio from Discharge flow3 Auto-Manual Control

The following control levels are available for the Recycle flow1 Ratio from Discharge flow

2 Auto-Manual Control

The following control levels are available for the PD Blowers3 Timed Mode

2 Dissolved Oxygen Mode3 Manual Mode

Conclusions

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 47

Following the commissioning of the ethernet-based PLCs Oxygen consumption was significantly reduced

The advanced controls allow the operators to leave the process alone and continue to optimally treat the sewage

Conclusions

Following the commissioning of the ethernet-based PLCs AnoxicOxic 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 Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 48

Summary

The PD Blowers ran in Timed Mode andor 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

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 Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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 Authoritys 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 50

TUTORIAL

Part 2A

PLC Programming Basics

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 51

Separate parts of the process have been organized into a separate ldquoSECTIONrdquo

PLC Program Organization

Each ldquoSECTIONrdquo can be any of the IEC programming types

bull Ladder (LD)bull Structured Text (ST)

bull Instruction List (IL)

bull Function Blocks (FB)bull Sequential Function Charts (SFC)

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 52

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 53

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 54

IO Map

On-Line PLC Diagnostics

PLC Status

PLC Simulator

Ethernet (TCPIP) Address

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 55

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 56

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 57

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 58

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 59

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 60

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 61

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 62

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 63

Structured Text was used hereNOT Ladder

Programming for Motors

The PLC DOES NOT CAREStructured Text Functions EXACTLY

the same as LadderUse what yoursquore comfortable with

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 64

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 65

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 66

IEC Function Blocks Used Here

Programming for Analogs amp PID

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 67

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 68

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 69

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 70

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 71

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 72

Sequential Function Charts were used here

Higher-Level Control

bull SFCrsquos lend themselves well to (as the name would imply) sequential processes

bull Three Important components in SFCrsquosbull Transitionsbull Stepsbull Jumps

bull The status of the process can be viewed as a flow chart

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 73

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 74

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 75

PLC - HMI Communication

A ldquoPLC Heartbeatrdquo is traditionally used to monitor the PLC - HMI Communication sometimes called ardquoWatchdog Timerrdquo

Call it whatever you want but the PLC amp 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 ldquodiesrdquo then that switch doesnrsquot change state and an alarm alerts the operator

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 76

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 77

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 78

TUTORIAL

Part 2B

HMI Programming

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 79

Ethernet (TCPIP) IO Driver

The Ethernet (TCPIP) IO Driver allows the HMI to communicate with the PLC (In this case the driver is called MBENETEXE)

The PLC has an ethernet module in one of the slots that has a ldquoCAT5RJ-45rdquo 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 ldquoCAT5RJ-45rdquo receptacle for the ethernet cable

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 80

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 81

Operator Screens amp Popup Displays

The display is laid out in 3 sections

bull Upper - Security amp Alarm Windowbull Middle- Main Operator Screens bull Lower - Menu amp Popup Displays

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 82

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 83

Scripting

There are 6 types of ldquoScriptsrdquobull Application Scriptsbull Key Scriptsbull Condition Scriptsbull Data Change Scriptsbull Quick Function Scriptsbull ActiveX Event Scripts

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 84

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 85

Access Names

The ldquoAccess Namesrdquo Must be configured to allow the PLC - HMI communications

Note that the ldquoApplicationTopicrdquo is the same as the IO Driver

The ldquocomputer namerdquo is the name of the PC that the HMI is running on (brad_s_carlberg in this case)

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 86

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 87

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 88

Indirect Tags

ldquoIndirect Tagsrdquo were used here to minimize the number of popup displays

This is especially useful in HMIrsquos with many tags

ONLY 12 popup displays are reused throughout the HMI

This gives the HMI a ldquoDCS-Likerdquo Look amp Feel

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 89

Popup Display TypesThe tag point type determines which popup display to use

Analog InputHIC (or Analog Output)PID (or Analog Composite)

bull PID WITH AUTO amp CASCADE amp RATIObull PID WITH AUTO amp RATIO

Diginbull Motor Status

DigOutMotor (or Digital Composite)

bull Motor with ILock and PermNumericSet TimersAlarm DetailAlarm Tags

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 90

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 91

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 92

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 93

Bars Buttons amp Sliders

By choosing to use indirect tags we complicate the Bar Graphs Buttons amp Sliders in the popup displays

Different scales need to be used for different engineering unit ranges

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 94

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 95

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 96

Popup Displays

The next two pages shows how the individual popup displays use the indirect tags

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 97

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 98

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 99

Adding a ldquoTouch Targetrdquo to a Display

2 Tell which tags to use

3 Tell which popup display to call upWhat kind of point type is it

3 Steps1 Tell which scale to use (if itrsquos an analog point type)

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 100

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 101

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 102

TUTORIAL

Part 2C

Excel Spreadsheets

amp

Visual Basic

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 103

A ldquoCHEAP amp DIRTYrdquo HMI With Excel

The 4 key parameters are

To communicate with the PLCUse brad_s_carlbergmbenet|ANOXIC_OXICrsquoplcregisterrsquo

Excel uses ldquopeeksrdquo amp ldquopokesrdquo to read from amp write to a PLC or HMI

To communicate with the HMIbrad_s_carlbergview|Tagnamersquotagnamersquo

bull computer namebull applicationbull topicbull item

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 104

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 105

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 106

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 107

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 108

Excel Macros

bull ldquoRequestrdquo Macro to read values

bull ldquoPokerdquo Macro to write values

bull A Sample Excel Macro

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 109

Sub PokeMacro()MsgBox ApplicationNetworkTemplatesPathChannel = ApplicationDDEInitiate(app=brad_s_carlbergVIEW topic=Tagname) This opens a DDE channel to ViewApplicationDDEPoke Channel Temperature1 Worksheets(Sheet1)Range(A1) Puts value from R1C1 into Temperature1ApplicationDDEPoke Channel DDEReal Worksheets(Sheet1)Range(A2) Puts value from R1C1 into Temperature1ApplicationDDEPoke Channel DDEInteger Worksheets(Sheet1)Range(A3) Puts value from R1C1 into Temperature1ApplicationDDETerminate Channel This terminates the DDE channelEnd SubSub RequestMacro()Channel = ApplicationDDEInitiate(app=brad_s_carlbergVIEW topic=Tagname) This opens a DDE channel to ViewWorksheets(Sheet1)Range(C4) = ApplicationDDERequest(Channel $Hour)Worksheets(Sheet1)Range(C5) = ApplicationDDERequest(Channel $Minute)Worksheets(Sheet1)Range(C6) = ApplicationDDERequest(Channel $Second)Worksheets(Sheet1)Range(C9) = ApplicationDDERequest(Channel $day)Worksheets(Sheet1)Range(C10) = ApplicationDDERequest(Channel $date)Worksheets(Sheet1)Range(C11) = ApplicationDDERequest(Channel $datestring)Worksheets(Sheet1)Range(C12) = ApplicationDDERequest(Channel $datetime)Worksheets(Sheet1)Range(C13) = ApplicationDDERequest(Channel $date)Worksheets(Sheet1)Range(C14) = ApplicationDDERequest(Channel $month)Worksheets(Sheet1)Range(C15) = ApplicationDDERequest(Channel $year)Worksheets(Sheet1)Range(C16) = ApplicationDDERequest(Channel $time)Worksheets(Sheet1)Range(C17) = ApplicationDDERequest(Channel $timestring)Worksheets(Sheet1)Range(C18) = ApplicationDDERequest(Channel $applicationversion)Worksheets(Sheet1)Range(C19) = ApplicationDDERequest(Channel $startddeconversations)Worksheets(Sheet1)Range(C20) = ApplicationDDERequest(Channel $accesslevel)Worksheets(Sheet1)Range(C21) = ApplicationDDERequest(Channel $alarmlogging)Worksheets(Sheet1)Range(C22) = ApplicationDDERequest(Channel $applicationchanged)Worksheets(Sheet1)Range(C23) = ApplicationDDERequest(Channel $configureusers)Worksheets(Sheet1)Range(C24) = ApplicationDDERequest(Channel $changepassword)Worksheets(Sheet1)Range(C25) = ApplicationDDERequest(Channel $InactivityTimeout)Worksheets(Sheet1)Range(C26) = ApplicationDDERequest(Channel $InactivityWarning)Worksheets(Sheet1)Range(C27) = ApplicationDDERequest(Channel $LogicRunning)Worksheets(Sheet1)Range(C28) = ApplicationDDERequest(Channel $OperatorEntered)Worksheets(Sheet1)Range(C29) = ApplicationDDERequest(Channel $Operator)Worksheets(Sheet1)Range(C30) = ApplicationDDERequest(Channel $PasswordEntered)ApplicationDDETerminate Channel This terminates the DDE channelEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 110

Visual Basic

ldquoRoll Your Ownrdquo HMI - Much More powerful than Excel

Key Parameters computer nameapplication|topicitem

IO Emulator - MBPlusSimulateexe

Can ldquoRead Fromrdquo amp ldquoWrite Tordquo PLC andor HMI

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 111

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 112

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 113

Dim PauseTime Start Finish TotalTime As Integer Declare variables

Private Sub txtAIT_332A_SCALED_Change()On Error GoTo PokeAIT_332AErrortxtAIT_332A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtAIT_332A_SCALEDText = Int((3 Rnd) + 20) Generate random value between 20 and 23txtAIT_332A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtAIT_332A_SCALEDLinkItem = AIT_332A_SCALEDtxtAIT_332A_SCALEDLinkMode = 2txtAIT_332A_SCALEDLinkPoketxtAIT_332A_SCALEDLinkMode = 0 DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total time

PokeAIT_332AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtAIT_332A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 114

Private Sub txtAIT_346A_SCALED_Change()On Error GoTo PokeAIT_346AErrortxtAIT_346A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtAIT_346A_SCALEDText = Int((3 Rnd) + 15) Generate random value between 15 and 18txtAIT_346A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtAIT_346A_SCALEDLinkItem = AIT_346A_SCALEDtxtAIT_346A_SCALEDLinkMode = 2txtAIT_346A_SCALEDLinkPoketxtAIT_346A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeAIT_346AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtAIT_346A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 115

Private Sub txtFIT_321A_SCALED_Change()On Error GoTo PokeFIT_321AErrortxtFIT_321A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtFIT_321A_SCALEDText = Int((10 Rnd) + 120) Generate random value between 120 and 130txtFIT_321A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_321A_SCALEDLinkItem = FIT_321A_SCALEDtxtFIT_321A_SCALEDLinkMode = 2txtFIT_321A_SCALEDLinkPoketxtFIT_321A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total time

PokeFIT_321AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_321A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume Next

End Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 116

Private Sub txtFIT_341A_SCALED_Change()On Error GoTo PokeFIT_341AErrortxtFIT_341A_SCALEDLinkMode = 0 PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTime

txtFIT_341A_SCALEDText = Int((3 Rnd) + 18) Generate random value between 18 and 21

txtFIT_341A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_341A_SCALEDLinkItem = FIT_341A_SCALEDtxtFIT_341A_SCALEDLinkMode = 2txtFIT_341A_SCALEDLinkPoketxtFIT_341A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeFIT_341AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_341A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 117

Private Sub txtFIT_343A_SCALED_Change()On Error GoTo PokeFIT_343AErrortxtFIT_343A_SCALEDLinkMode = 0 PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTime

txtFIT_343A_SCALEDText = Int((1 Rnd) + 3) Generate random value between 3 and 4

txtFIT_343A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_343A_SCALEDLinkItem = FIT_343A_SCALEDtxtFIT_343A_SCALEDLinkMode = 2txtFIT_343A_SCALEDLinkPoketxtFIT_343A_SCALEDLinkMode = 0 DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeFIT_343AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_343A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 118

TUTORIAL

Part 4

Questions

amp

Answers

  • Slide 1
  • Slide 2
  • Slide 3
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Slide 8
  • Slide 9
  • Slide 10
  • Slide 11
  • Slide 12
  • Slide 13
  • Slide 14
  • Slide 15
  • Slide 16
  • Slide 17
  • Slide 18
  • Slide 19
  • Slide 20
  • Slide 21
  • Slide 22
  • Slide 23
  • Slide 24
  • Slide 25
  • Slide 26
  • Slide 27
  • Slide 28
  • Slide 29
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
  • Slide 34
  • Slide 35
  • Slide 36
  • Slide 37
  • Slide 38
  • Slide 39
  • Slide 40
  • Slide 41
  • Slide 42
  • Slide 43
  • Slide 44
  • Slide 45
  • Slide 46
  • Slide 47
  • Slide 48
  • Slide 49
  • Slide 50
  • Slide 51
  • Slide 52
  • Slide 53
  • Slide 54
  • Slide 55
  • Slide 56
  • Slide 57
  • Slide 58
  • Slide 59
  • Slide 60
  • Slide 61
  • Slide 62
  • Slide 63
  • Slide 64
  • Slide 65
  • Slide 66
  • Slide 67
  • Slide 68
  • Slide 69
  • Slide 70
  • Slide 71
  • Slide 72
  • Slide 73
  • Slide 74
  • Slide 75
  • Slide 76
  • Slide 77
  • Slide 78
  • Slide 79
  • Slide 80
  • Slide 81
  • Slide 82
  • Slide 83
  • Slide 84
  • Slide 85
  • Slide 86
  • Slide 87
  • Slide 88
  • Slide 89
  • Slide 90
  • Slide 91
  • Slide 92
  • Slide 93
  • Slide 94
  • Slide 95
  • Slide 96
  • Slide 97
  • Slide 98
  • Slide 99
  • Slide 100
  • Slide 101
  • Slide 102
  • Slide 103
  • Slide 104
  • Slide 105
  • Slide 106
  • Slide 107
  • Slide 108
  • Slide 109
  • Slide 110
  • Slide 111
  • Slide 112
  • Slide 113
  • Slide 114
  • Slide 115
  • Slide 116
  • Slide 117
  • Slide 118
Page 18: TUTORIAL Ethernet PLC's Improve Oxygen Consumption ISA Expo/2001Houston, Texas Water & Wastewater Industry DivisionTuesday, September 11, 2001 1 Brad.

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 18

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

Control Levels The following control levels are available for Oxygen

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 20

Oxygen Control Levels

Cascade from Cell 3 Dissolved Oxygen probe

Ratio from Discharge flow

AutoManual Control

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 22

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 23

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 24

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 25

The following control levels are available for the Recycle flow

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 27

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 28

The following control levels are available for the PD Blowers Timed Mode

Dissolved Oxygen Mode

Manual Mode

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

Motor Popup

The following information is available for each motor control from the respective motor popup

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

Aerator Control Motor Popup

Like all motors the following information is available for the Aerator motor control from the motor popup

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 32

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 33

Motor Popup Surface Aerator Control

The following information is available for motor control from the motor popup

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 35

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 36

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 37

Lower Explosive Level (LEL)

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 38

Each train has a digital input that tells whether thecombustible 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 (LEL) system

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 39

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 Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 40

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 41

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 Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 42

Like a DCS

middot 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

middot 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 amp CASCADE amp RATIO PID WITH AUTO amp RATIO Digin Motor Status DigOut Motor (or Digital Composite) Motor with ILock and Perm Numeric Set Timers Alarm Detail and Alarm Tags

middot A single generic trend display to trend ALL trendable (archived) points

Alarm Management

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

middot A Distributed Alarm Summary has been used to give better alarm management tools

bull Up to eight trend pens on the trend display

bull The operator picks which values to trend by clicking in the center of the trend

display

bull 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 44

The AnoxicOxic 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 Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 46

The following control levels are available for Oxygen1 Cascade from Dissolved Oxygen

2 Ratio from Discharge flow3 Auto-Manual Control

The following control levels are available for the Recycle flow1 Ratio from Discharge flow

2 Auto-Manual Control

The following control levels are available for the PD Blowers3 Timed Mode

2 Dissolved Oxygen Mode3 Manual Mode

Conclusions

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 47

Following the commissioning of the ethernet-based PLCs Oxygen consumption was significantly reduced

The advanced controls allow the operators to leave the process alone and continue to optimally treat the sewage

Conclusions

Following the commissioning of the ethernet-based PLCs AnoxicOxic 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 Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 48

Summary

The PD Blowers ran in Timed Mode andor 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

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 Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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 Authoritys 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 50

TUTORIAL

Part 2A

PLC Programming Basics

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 51

Separate parts of the process have been organized into a separate ldquoSECTIONrdquo

PLC Program Organization

Each ldquoSECTIONrdquo can be any of the IEC programming types

bull Ladder (LD)bull Structured Text (ST)

bull Instruction List (IL)

bull Function Blocks (FB)bull Sequential Function Charts (SFC)

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 52

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 53

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 54

IO Map

On-Line PLC Diagnostics

PLC Status

PLC Simulator

Ethernet (TCPIP) Address

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 55

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 56

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 57

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 58

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 59

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 60

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 61

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 62

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 63

Structured Text was used hereNOT Ladder

Programming for Motors

The PLC DOES NOT CAREStructured Text Functions EXACTLY

the same as LadderUse what yoursquore comfortable with

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 64

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 65

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 66

IEC Function Blocks Used Here

Programming for Analogs amp PID

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 67

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 68

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 69

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 70

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 71

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 72

Sequential Function Charts were used here

Higher-Level Control

bull SFCrsquos lend themselves well to (as the name would imply) sequential processes

bull Three Important components in SFCrsquosbull Transitionsbull Stepsbull Jumps

bull The status of the process can be viewed as a flow chart

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 73

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 74

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 75

PLC - HMI Communication

A ldquoPLC Heartbeatrdquo is traditionally used to monitor the PLC - HMI Communication sometimes called ardquoWatchdog Timerrdquo

Call it whatever you want but the PLC amp 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 ldquodiesrdquo then that switch doesnrsquot change state and an alarm alerts the operator

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 76

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 77

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 78

TUTORIAL

Part 2B

HMI Programming

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 79

Ethernet (TCPIP) IO Driver

The Ethernet (TCPIP) IO Driver allows the HMI to communicate with the PLC (In this case the driver is called MBENETEXE)

The PLC has an ethernet module in one of the slots that has a ldquoCAT5RJ-45rdquo 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 ldquoCAT5RJ-45rdquo receptacle for the ethernet cable

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 80

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 81

Operator Screens amp Popup Displays

The display is laid out in 3 sections

bull Upper - Security amp Alarm Windowbull Middle- Main Operator Screens bull Lower - Menu amp Popup Displays

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 82

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 83

Scripting

There are 6 types of ldquoScriptsrdquobull Application Scriptsbull Key Scriptsbull Condition Scriptsbull Data Change Scriptsbull Quick Function Scriptsbull ActiveX Event Scripts

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 84

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 85

Access Names

The ldquoAccess Namesrdquo Must be configured to allow the PLC - HMI communications

Note that the ldquoApplicationTopicrdquo is the same as the IO Driver

The ldquocomputer namerdquo is the name of the PC that the HMI is running on (brad_s_carlberg in this case)

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 86

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 87

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 88

Indirect Tags

ldquoIndirect Tagsrdquo were used here to minimize the number of popup displays

This is especially useful in HMIrsquos with many tags

ONLY 12 popup displays are reused throughout the HMI

This gives the HMI a ldquoDCS-Likerdquo Look amp Feel

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 89

Popup Display TypesThe tag point type determines which popup display to use

Analog InputHIC (or Analog Output)PID (or Analog Composite)

bull PID WITH AUTO amp CASCADE amp RATIObull PID WITH AUTO amp RATIO

Diginbull Motor Status

DigOutMotor (or Digital Composite)

bull Motor with ILock and PermNumericSet TimersAlarm DetailAlarm Tags

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 90

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 91

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 92

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 93

Bars Buttons amp Sliders

By choosing to use indirect tags we complicate the Bar Graphs Buttons amp Sliders in the popup displays

Different scales need to be used for different engineering unit ranges

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 94

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 95

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 96

Popup Displays

The next two pages shows how the individual popup displays use the indirect tags

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 97

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 98

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 99

Adding a ldquoTouch Targetrdquo to a Display

2 Tell which tags to use

3 Tell which popup display to call upWhat kind of point type is it

3 Steps1 Tell which scale to use (if itrsquos an analog point type)

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 100

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 101

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 102

TUTORIAL

Part 2C

Excel Spreadsheets

amp

Visual Basic

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 103

A ldquoCHEAP amp DIRTYrdquo HMI With Excel

The 4 key parameters are

To communicate with the PLCUse brad_s_carlbergmbenet|ANOXIC_OXICrsquoplcregisterrsquo

Excel uses ldquopeeksrdquo amp ldquopokesrdquo to read from amp write to a PLC or HMI

To communicate with the HMIbrad_s_carlbergview|Tagnamersquotagnamersquo

bull computer namebull applicationbull topicbull item

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 104

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 105

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 106

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 107

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 108

Excel Macros

bull ldquoRequestrdquo Macro to read values

bull ldquoPokerdquo Macro to write values

bull A Sample Excel Macro

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 109

Sub PokeMacro()MsgBox ApplicationNetworkTemplatesPathChannel = ApplicationDDEInitiate(app=brad_s_carlbergVIEW topic=Tagname) This opens a DDE channel to ViewApplicationDDEPoke Channel Temperature1 Worksheets(Sheet1)Range(A1) Puts value from R1C1 into Temperature1ApplicationDDEPoke Channel DDEReal Worksheets(Sheet1)Range(A2) Puts value from R1C1 into Temperature1ApplicationDDEPoke Channel DDEInteger Worksheets(Sheet1)Range(A3) Puts value from R1C1 into Temperature1ApplicationDDETerminate Channel This terminates the DDE channelEnd SubSub RequestMacro()Channel = ApplicationDDEInitiate(app=brad_s_carlbergVIEW topic=Tagname) This opens a DDE channel to ViewWorksheets(Sheet1)Range(C4) = ApplicationDDERequest(Channel $Hour)Worksheets(Sheet1)Range(C5) = ApplicationDDERequest(Channel $Minute)Worksheets(Sheet1)Range(C6) = ApplicationDDERequest(Channel $Second)Worksheets(Sheet1)Range(C9) = ApplicationDDERequest(Channel $day)Worksheets(Sheet1)Range(C10) = ApplicationDDERequest(Channel $date)Worksheets(Sheet1)Range(C11) = ApplicationDDERequest(Channel $datestring)Worksheets(Sheet1)Range(C12) = ApplicationDDERequest(Channel $datetime)Worksheets(Sheet1)Range(C13) = ApplicationDDERequest(Channel $date)Worksheets(Sheet1)Range(C14) = ApplicationDDERequest(Channel $month)Worksheets(Sheet1)Range(C15) = ApplicationDDERequest(Channel $year)Worksheets(Sheet1)Range(C16) = ApplicationDDERequest(Channel $time)Worksheets(Sheet1)Range(C17) = ApplicationDDERequest(Channel $timestring)Worksheets(Sheet1)Range(C18) = ApplicationDDERequest(Channel $applicationversion)Worksheets(Sheet1)Range(C19) = ApplicationDDERequest(Channel $startddeconversations)Worksheets(Sheet1)Range(C20) = ApplicationDDERequest(Channel $accesslevel)Worksheets(Sheet1)Range(C21) = ApplicationDDERequest(Channel $alarmlogging)Worksheets(Sheet1)Range(C22) = ApplicationDDERequest(Channel $applicationchanged)Worksheets(Sheet1)Range(C23) = ApplicationDDERequest(Channel $configureusers)Worksheets(Sheet1)Range(C24) = ApplicationDDERequest(Channel $changepassword)Worksheets(Sheet1)Range(C25) = ApplicationDDERequest(Channel $InactivityTimeout)Worksheets(Sheet1)Range(C26) = ApplicationDDERequest(Channel $InactivityWarning)Worksheets(Sheet1)Range(C27) = ApplicationDDERequest(Channel $LogicRunning)Worksheets(Sheet1)Range(C28) = ApplicationDDERequest(Channel $OperatorEntered)Worksheets(Sheet1)Range(C29) = ApplicationDDERequest(Channel $Operator)Worksheets(Sheet1)Range(C30) = ApplicationDDERequest(Channel $PasswordEntered)ApplicationDDETerminate Channel This terminates the DDE channelEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 110

Visual Basic

ldquoRoll Your Ownrdquo HMI - Much More powerful than Excel

Key Parameters computer nameapplication|topicitem

IO Emulator - MBPlusSimulateexe

Can ldquoRead Fromrdquo amp ldquoWrite Tordquo PLC andor HMI

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 111

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 112

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 113

Dim PauseTime Start Finish TotalTime As Integer Declare variables

Private Sub txtAIT_332A_SCALED_Change()On Error GoTo PokeAIT_332AErrortxtAIT_332A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtAIT_332A_SCALEDText = Int((3 Rnd) + 20) Generate random value between 20 and 23txtAIT_332A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtAIT_332A_SCALEDLinkItem = AIT_332A_SCALEDtxtAIT_332A_SCALEDLinkMode = 2txtAIT_332A_SCALEDLinkPoketxtAIT_332A_SCALEDLinkMode = 0 DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total time

PokeAIT_332AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtAIT_332A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 114

Private Sub txtAIT_346A_SCALED_Change()On Error GoTo PokeAIT_346AErrortxtAIT_346A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtAIT_346A_SCALEDText = Int((3 Rnd) + 15) Generate random value between 15 and 18txtAIT_346A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtAIT_346A_SCALEDLinkItem = AIT_346A_SCALEDtxtAIT_346A_SCALEDLinkMode = 2txtAIT_346A_SCALEDLinkPoketxtAIT_346A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeAIT_346AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtAIT_346A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 115

Private Sub txtFIT_321A_SCALED_Change()On Error GoTo PokeFIT_321AErrortxtFIT_321A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtFIT_321A_SCALEDText = Int((10 Rnd) + 120) Generate random value between 120 and 130txtFIT_321A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_321A_SCALEDLinkItem = FIT_321A_SCALEDtxtFIT_321A_SCALEDLinkMode = 2txtFIT_321A_SCALEDLinkPoketxtFIT_321A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total time

PokeFIT_321AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_321A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume Next

End Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 116

Private Sub txtFIT_341A_SCALED_Change()On Error GoTo PokeFIT_341AErrortxtFIT_341A_SCALEDLinkMode = 0 PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTime

txtFIT_341A_SCALEDText = Int((3 Rnd) + 18) Generate random value between 18 and 21

txtFIT_341A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_341A_SCALEDLinkItem = FIT_341A_SCALEDtxtFIT_341A_SCALEDLinkMode = 2txtFIT_341A_SCALEDLinkPoketxtFIT_341A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeFIT_341AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_341A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 117

Private Sub txtFIT_343A_SCALED_Change()On Error GoTo PokeFIT_343AErrortxtFIT_343A_SCALEDLinkMode = 0 PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTime

txtFIT_343A_SCALEDText = Int((1 Rnd) + 3) Generate random value between 3 and 4

txtFIT_343A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_343A_SCALEDLinkItem = FIT_343A_SCALEDtxtFIT_343A_SCALEDLinkMode = 2txtFIT_343A_SCALEDLinkPoketxtFIT_343A_SCALEDLinkMode = 0 DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeFIT_343AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_343A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 118

TUTORIAL

Part 4

Questions

amp

Answers

  • Slide 1
  • Slide 2
  • Slide 3
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Slide 8
  • Slide 9
  • Slide 10
  • Slide 11
  • Slide 12
  • Slide 13
  • Slide 14
  • Slide 15
  • Slide 16
  • Slide 17
  • Slide 18
  • Slide 19
  • Slide 20
  • Slide 21
  • Slide 22
  • Slide 23
  • Slide 24
  • Slide 25
  • Slide 26
  • Slide 27
  • Slide 28
  • Slide 29
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
  • Slide 34
  • Slide 35
  • Slide 36
  • Slide 37
  • Slide 38
  • Slide 39
  • Slide 40
  • Slide 41
  • Slide 42
  • Slide 43
  • Slide 44
  • Slide 45
  • Slide 46
  • Slide 47
  • Slide 48
  • Slide 49
  • Slide 50
  • Slide 51
  • Slide 52
  • Slide 53
  • Slide 54
  • Slide 55
  • Slide 56
  • Slide 57
  • Slide 58
  • Slide 59
  • Slide 60
  • Slide 61
  • Slide 62
  • Slide 63
  • Slide 64
  • Slide 65
  • Slide 66
  • Slide 67
  • Slide 68
  • Slide 69
  • Slide 70
  • Slide 71
  • Slide 72
  • Slide 73
  • Slide 74
  • Slide 75
  • Slide 76
  • Slide 77
  • Slide 78
  • Slide 79
  • Slide 80
  • Slide 81
  • Slide 82
  • Slide 83
  • Slide 84
  • Slide 85
  • Slide 86
  • Slide 87
  • Slide 88
  • Slide 89
  • Slide 90
  • Slide 91
  • Slide 92
  • Slide 93
  • Slide 94
  • Slide 95
  • Slide 96
  • Slide 97
  • Slide 98
  • Slide 99
  • Slide 100
  • Slide 101
  • Slide 102
  • Slide 103
  • Slide 104
  • Slide 105
  • Slide 106
  • Slide 107
  • Slide 108
  • Slide 109
  • Slide 110
  • Slide 111
  • Slide 112
  • Slide 113
  • Slide 114
  • Slide 115
  • Slide 116
  • Slide 117
  • Slide 118
Page 19: TUTORIAL Ethernet PLC's Improve Oxygen Consumption ISA Expo/2001Houston, Texas Water & Wastewater Industry DivisionTuesday, September 11, 2001 1 Brad.

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

Control Levels The following control levels are available for Oxygen

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 20

Oxygen Control Levels

Cascade from Cell 3 Dissolved Oxygen probe

Ratio from Discharge flow

AutoManual Control

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 22

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 23

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 24

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 25

The following control levels are available for the Recycle flow

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 27

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 28

The following control levels are available for the PD Blowers Timed Mode

Dissolved Oxygen Mode

Manual Mode

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

Motor Popup

The following information is available for each motor control from the respective motor popup

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

Aerator Control Motor Popup

Like all motors the following information is available for the Aerator motor control from the motor popup

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 32

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 33

Motor Popup Surface Aerator Control

The following information is available for motor control from the motor popup

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 35

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 36

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 37

Lower Explosive Level (LEL)

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 38

Each train has a digital input that tells whether thecombustible 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 (LEL) system

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 39

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 Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 40

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 41

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 Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 42

Like a DCS

middot 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

middot 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 amp CASCADE amp RATIO PID WITH AUTO amp RATIO Digin Motor Status DigOut Motor (or Digital Composite) Motor with ILock and Perm Numeric Set Timers Alarm Detail and Alarm Tags

middot A single generic trend display to trend ALL trendable (archived) points

Alarm Management

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

middot A Distributed Alarm Summary has been used to give better alarm management tools

bull Up to eight trend pens on the trend display

bull The operator picks which values to trend by clicking in the center of the trend

display

bull 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 44

The AnoxicOxic 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 Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 46

The following control levels are available for Oxygen1 Cascade from Dissolved Oxygen

2 Ratio from Discharge flow3 Auto-Manual Control

The following control levels are available for the Recycle flow1 Ratio from Discharge flow

2 Auto-Manual Control

The following control levels are available for the PD Blowers3 Timed Mode

2 Dissolved Oxygen Mode3 Manual Mode

Conclusions

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 47

Following the commissioning of the ethernet-based PLCs Oxygen consumption was significantly reduced

The advanced controls allow the operators to leave the process alone and continue to optimally treat the sewage

Conclusions

Following the commissioning of the ethernet-based PLCs AnoxicOxic 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 Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 48

Summary

The PD Blowers ran in Timed Mode andor 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

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 Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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 Authoritys 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 50

TUTORIAL

Part 2A

PLC Programming Basics

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 51

Separate parts of the process have been organized into a separate ldquoSECTIONrdquo

PLC Program Organization

Each ldquoSECTIONrdquo can be any of the IEC programming types

bull Ladder (LD)bull Structured Text (ST)

bull Instruction List (IL)

bull Function Blocks (FB)bull Sequential Function Charts (SFC)

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 52

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 53

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 54

IO Map

On-Line PLC Diagnostics

PLC Status

PLC Simulator

Ethernet (TCPIP) Address

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 55

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 56

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 57

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 58

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 59

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 60

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 61

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 62

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 63

Structured Text was used hereNOT Ladder

Programming for Motors

The PLC DOES NOT CAREStructured Text Functions EXACTLY

the same as LadderUse what yoursquore comfortable with

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 64

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 65

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 66

IEC Function Blocks Used Here

Programming for Analogs amp PID

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 67

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 68

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 69

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 70

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 71

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 72

Sequential Function Charts were used here

Higher-Level Control

bull SFCrsquos lend themselves well to (as the name would imply) sequential processes

bull Three Important components in SFCrsquosbull Transitionsbull Stepsbull Jumps

bull The status of the process can be viewed as a flow chart

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 73

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 74

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 75

PLC - HMI Communication

A ldquoPLC Heartbeatrdquo is traditionally used to monitor the PLC - HMI Communication sometimes called ardquoWatchdog Timerrdquo

Call it whatever you want but the PLC amp 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 ldquodiesrdquo then that switch doesnrsquot change state and an alarm alerts the operator

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 76

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 77

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 78

TUTORIAL

Part 2B

HMI Programming

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 79

Ethernet (TCPIP) IO Driver

The Ethernet (TCPIP) IO Driver allows the HMI to communicate with the PLC (In this case the driver is called MBENETEXE)

The PLC has an ethernet module in one of the slots that has a ldquoCAT5RJ-45rdquo 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 ldquoCAT5RJ-45rdquo receptacle for the ethernet cable

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 80

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 81

Operator Screens amp Popup Displays

The display is laid out in 3 sections

bull Upper - Security amp Alarm Windowbull Middle- Main Operator Screens bull Lower - Menu amp Popup Displays

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 82

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 83

Scripting

There are 6 types of ldquoScriptsrdquobull Application Scriptsbull Key Scriptsbull Condition Scriptsbull Data Change Scriptsbull Quick Function Scriptsbull ActiveX Event Scripts

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 84

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 85

Access Names

The ldquoAccess Namesrdquo Must be configured to allow the PLC - HMI communications

Note that the ldquoApplicationTopicrdquo is the same as the IO Driver

The ldquocomputer namerdquo is the name of the PC that the HMI is running on (brad_s_carlberg in this case)

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 86

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 87

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 88

Indirect Tags

ldquoIndirect Tagsrdquo were used here to minimize the number of popup displays

This is especially useful in HMIrsquos with many tags

ONLY 12 popup displays are reused throughout the HMI

This gives the HMI a ldquoDCS-Likerdquo Look amp Feel

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 89

Popup Display TypesThe tag point type determines which popup display to use

Analog InputHIC (or Analog Output)PID (or Analog Composite)

bull PID WITH AUTO amp CASCADE amp RATIObull PID WITH AUTO amp RATIO

Diginbull Motor Status

DigOutMotor (or Digital Composite)

bull Motor with ILock and PermNumericSet TimersAlarm DetailAlarm Tags

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 90

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 91

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 92

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 93

Bars Buttons amp Sliders

By choosing to use indirect tags we complicate the Bar Graphs Buttons amp Sliders in the popup displays

Different scales need to be used for different engineering unit ranges

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 94

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 95

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 96

Popup Displays

The next two pages shows how the individual popup displays use the indirect tags

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 97

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 98

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 99

Adding a ldquoTouch Targetrdquo to a Display

2 Tell which tags to use

3 Tell which popup display to call upWhat kind of point type is it

3 Steps1 Tell which scale to use (if itrsquos an analog point type)

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 100

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 101

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 102

TUTORIAL

Part 2C

Excel Spreadsheets

amp

Visual Basic

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 103

A ldquoCHEAP amp DIRTYrdquo HMI With Excel

The 4 key parameters are

To communicate with the PLCUse brad_s_carlbergmbenet|ANOXIC_OXICrsquoplcregisterrsquo

Excel uses ldquopeeksrdquo amp ldquopokesrdquo to read from amp write to a PLC or HMI

To communicate with the HMIbrad_s_carlbergview|Tagnamersquotagnamersquo

bull computer namebull applicationbull topicbull item

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 104

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 105

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 106

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 107

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 108

Excel Macros

bull ldquoRequestrdquo Macro to read values

bull ldquoPokerdquo Macro to write values

bull A Sample Excel Macro

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 109

Sub PokeMacro()MsgBox ApplicationNetworkTemplatesPathChannel = ApplicationDDEInitiate(app=brad_s_carlbergVIEW topic=Tagname) This opens a DDE channel to ViewApplicationDDEPoke Channel Temperature1 Worksheets(Sheet1)Range(A1) Puts value from R1C1 into Temperature1ApplicationDDEPoke Channel DDEReal Worksheets(Sheet1)Range(A2) Puts value from R1C1 into Temperature1ApplicationDDEPoke Channel DDEInteger Worksheets(Sheet1)Range(A3) Puts value from R1C1 into Temperature1ApplicationDDETerminate Channel This terminates the DDE channelEnd SubSub RequestMacro()Channel = ApplicationDDEInitiate(app=brad_s_carlbergVIEW topic=Tagname) This opens a DDE channel to ViewWorksheets(Sheet1)Range(C4) = ApplicationDDERequest(Channel $Hour)Worksheets(Sheet1)Range(C5) = ApplicationDDERequest(Channel $Minute)Worksheets(Sheet1)Range(C6) = ApplicationDDERequest(Channel $Second)Worksheets(Sheet1)Range(C9) = ApplicationDDERequest(Channel $day)Worksheets(Sheet1)Range(C10) = ApplicationDDERequest(Channel $date)Worksheets(Sheet1)Range(C11) = ApplicationDDERequest(Channel $datestring)Worksheets(Sheet1)Range(C12) = ApplicationDDERequest(Channel $datetime)Worksheets(Sheet1)Range(C13) = ApplicationDDERequest(Channel $date)Worksheets(Sheet1)Range(C14) = ApplicationDDERequest(Channel $month)Worksheets(Sheet1)Range(C15) = ApplicationDDERequest(Channel $year)Worksheets(Sheet1)Range(C16) = ApplicationDDERequest(Channel $time)Worksheets(Sheet1)Range(C17) = ApplicationDDERequest(Channel $timestring)Worksheets(Sheet1)Range(C18) = ApplicationDDERequest(Channel $applicationversion)Worksheets(Sheet1)Range(C19) = ApplicationDDERequest(Channel $startddeconversations)Worksheets(Sheet1)Range(C20) = ApplicationDDERequest(Channel $accesslevel)Worksheets(Sheet1)Range(C21) = ApplicationDDERequest(Channel $alarmlogging)Worksheets(Sheet1)Range(C22) = ApplicationDDERequest(Channel $applicationchanged)Worksheets(Sheet1)Range(C23) = ApplicationDDERequest(Channel $configureusers)Worksheets(Sheet1)Range(C24) = ApplicationDDERequest(Channel $changepassword)Worksheets(Sheet1)Range(C25) = ApplicationDDERequest(Channel $InactivityTimeout)Worksheets(Sheet1)Range(C26) = ApplicationDDERequest(Channel $InactivityWarning)Worksheets(Sheet1)Range(C27) = ApplicationDDERequest(Channel $LogicRunning)Worksheets(Sheet1)Range(C28) = ApplicationDDERequest(Channel $OperatorEntered)Worksheets(Sheet1)Range(C29) = ApplicationDDERequest(Channel $Operator)Worksheets(Sheet1)Range(C30) = ApplicationDDERequest(Channel $PasswordEntered)ApplicationDDETerminate Channel This terminates the DDE channelEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 110

Visual Basic

ldquoRoll Your Ownrdquo HMI - Much More powerful than Excel

Key Parameters computer nameapplication|topicitem

IO Emulator - MBPlusSimulateexe

Can ldquoRead Fromrdquo amp ldquoWrite Tordquo PLC andor HMI

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 111

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 112

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 113

Dim PauseTime Start Finish TotalTime As Integer Declare variables

Private Sub txtAIT_332A_SCALED_Change()On Error GoTo PokeAIT_332AErrortxtAIT_332A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtAIT_332A_SCALEDText = Int((3 Rnd) + 20) Generate random value between 20 and 23txtAIT_332A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtAIT_332A_SCALEDLinkItem = AIT_332A_SCALEDtxtAIT_332A_SCALEDLinkMode = 2txtAIT_332A_SCALEDLinkPoketxtAIT_332A_SCALEDLinkMode = 0 DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total time

PokeAIT_332AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtAIT_332A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 114

Private Sub txtAIT_346A_SCALED_Change()On Error GoTo PokeAIT_346AErrortxtAIT_346A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtAIT_346A_SCALEDText = Int((3 Rnd) + 15) Generate random value between 15 and 18txtAIT_346A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtAIT_346A_SCALEDLinkItem = AIT_346A_SCALEDtxtAIT_346A_SCALEDLinkMode = 2txtAIT_346A_SCALEDLinkPoketxtAIT_346A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeAIT_346AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtAIT_346A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 115

Private Sub txtFIT_321A_SCALED_Change()On Error GoTo PokeFIT_321AErrortxtFIT_321A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtFIT_321A_SCALEDText = Int((10 Rnd) + 120) Generate random value between 120 and 130txtFIT_321A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_321A_SCALEDLinkItem = FIT_321A_SCALEDtxtFIT_321A_SCALEDLinkMode = 2txtFIT_321A_SCALEDLinkPoketxtFIT_321A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total time

PokeFIT_321AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_321A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume Next

End Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 116

Private Sub txtFIT_341A_SCALED_Change()On Error GoTo PokeFIT_341AErrortxtFIT_341A_SCALEDLinkMode = 0 PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTime

txtFIT_341A_SCALEDText = Int((3 Rnd) + 18) Generate random value between 18 and 21

txtFIT_341A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_341A_SCALEDLinkItem = FIT_341A_SCALEDtxtFIT_341A_SCALEDLinkMode = 2txtFIT_341A_SCALEDLinkPoketxtFIT_341A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeFIT_341AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_341A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 117

Private Sub txtFIT_343A_SCALED_Change()On Error GoTo PokeFIT_343AErrortxtFIT_343A_SCALEDLinkMode = 0 PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTime

txtFIT_343A_SCALEDText = Int((1 Rnd) + 3) Generate random value between 3 and 4

txtFIT_343A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_343A_SCALEDLinkItem = FIT_343A_SCALEDtxtFIT_343A_SCALEDLinkMode = 2txtFIT_343A_SCALEDLinkPoketxtFIT_343A_SCALEDLinkMode = 0 DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeFIT_343AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_343A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 118

TUTORIAL

Part 4

Questions

amp

Answers

  • Slide 1
  • Slide 2
  • Slide 3
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Slide 8
  • Slide 9
  • Slide 10
  • Slide 11
  • Slide 12
  • Slide 13
  • Slide 14
  • Slide 15
  • Slide 16
  • Slide 17
  • Slide 18
  • Slide 19
  • Slide 20
  • Slide 21
  • Slide 22
  • Slide 23
  • Slide 24
  • Slide 25
  • Slide 26
  • Slide 27
  • Slide 28
  • Slide 29
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
  • Slide 34
  • Slide 35
  • Slide 36
  • Slide 37
  • Slide 38
  • Slide 39
  • Slide 40
  • Slide 41
  • Slide 42
  • Slide 43
  • Slide 44
  • Slide 45
  • Slide 46
  • Slide 47
  • Slide 48
  • Slide 49
  • Slide 50
  • Slide 51
  • Slide 52
  • Slide 53
  • Slide 54
  • Slide 55
  • Slide 56
  • Slide 57
  • Slide 58
  • Slide 59
  • Slide 60
  • Slide 61
  • Slide 62
  • Slide 63
  • Slide 64
  • Slide 65
  • Slide 66
  • Slide 67
  • Slide 68
  • Slide 69
  • Slide 70
  • Slide 71
  • Slide 72
  • Slide 73
  • Slide 74
  • Slide 75
  • Slide 76
  • Slide 77
  • Slide 78
  • Slide 79
  • Slide 80
  • Slide 81
  • Slide 82
  • Slide 83
  • Slide 84
  • Slide 85
  • Slide 86
  • Slide 87
  • Slide 88
  • Slide 89
  • Slide 90
  • Slide 91
  • Slide 92
  • Slide 93
  • Slide 94
  • Slide 95
  • Slide 96
  • Slide 97
  • Slide 98
  • Slide 99
  • Slide 100
  • Slide 101
  • Slide 102
  • Slide 103
  • Slide 104
  • Slide 105
  • Slide 106
  • Slide 107
  • Slide 108
  • Slide 109
  • Slide 110
  • Slide 111
  • Slide 112
  • Slide 113
  • Slide 114
  • Slide 115
  • Slide 116
  • Slide 117
  • Slide 118
Page 20: TUTORIAL Ethernet PLC's Improve Oxygen Consumption ISA Expo/2001Houston, Texas Water & Wastewater Industry DivisionTuesday, September 11, 2001 1 Brad.

Control Levels The following control levels are available for Oxygen

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 20

Oxygen Control Levels

Cascade from Cell 3 Dissolved Oxygen probe

Ratio from Discharge flow

AutoManual Control

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 22

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 23

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 24

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 25

The following control levels are available for the Recycle flow

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 27

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 28

The following control levels are available for the PD Blowers Timed Mode

Dissolved Oxygen Mode

Manual Mode

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

Motor Popup

The following information is available for each motor control from the respective motor popup

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

Aerator Control Motor Popup

Like all motors the following information is available for the Aerator motor control from the motor popup

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 32

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 33

Motor Popup Surface Aerator Control

The following information is available for motor control from the motor popup

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 35

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 36

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 37

Lower Explosive Level (LEL)

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 38

Each train has a digital input that tells whether thecombustible 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 (LEL) system

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 39

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 Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 40

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 41

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 Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 42

Like a DCS

middot 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

middot 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 amp CASCADE amp RATIO PID WITH AUTO amp RATIO Digin Motor Status DigOut Motor (or Digital Composite) Motor with ILock and Perm Numeric Set Timers Alarm Detail and Alarm Tags

middot A single generic trend display to trend ALL trendable (archived) points

Alarm Management

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

middot A Distributed Alarm Summary has been used to give better alarm management tools

bull Up to eight trend pens on the trend display

bull The operator picks which values to trend by clicking in the center of the trend

display

bull 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 44

The AnoxicOxic 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 Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 46

The following control levels are available for Oxygen1 Cascade from Dissolved Oxygen

2 Ratio from Discharge flow3 Auto-Manual Control

The following control levels are available for the Recycle flow1 Ratio from Discharge flow

2 Auto-Manual Control

The following control levels are available for the PD Blowers3 Timed Mode

2 Dissolved Oxygen Mode3 Manual Mode

Conclusions

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 47

Following the commissioning of the ethernet-based PLCs Oxygen consumption was significantly reduced

The advanced controls allow the operators to leave the process alone and continue to optimally treat the sewage

Conclusions

Following the commissioning of the ethernet-based PLCs AnoxicOxic 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 Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 48

Summary

The PD Blowers ran in Timed Mode andor 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

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 Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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 Authoritys 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 50

TUTORIAL

Part 2A

PLC Programming Basics

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 51

Separate parts of the process have been organized into a separate ldquoSECTIONrdquo

PLC Program Organization

Each ldquoSECTIONrdquo can be any of the IEC programming types

bull Ladder (LD)bull Structured Text (ST)

bull Instruction List (IL)

bull Function Blocks (FB)bull Sequential Function Charts (SFC)

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 52

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 53

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 54

IO Map

On-Line PLC Diagnostics

PLC Status

PLC Simulator

Ethernet (TCPIP) Address

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 55

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 56

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 57

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 58

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 59

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 60

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 61

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 62

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 63

Structured Text was used hereNOT Ladder

Programming for Motors

The PLC DOES NOT CAREStructured Text Functions EXACTLY

the same as LadderUse what yoursquore comfortable with

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 64

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 65

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 66

IEC Function Blocks Used Here

Programming for Analogs amp PID

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 67

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 68

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 69

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 70

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 71

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 72

Sequential Function Charts were used here

Higher-Level Control

bull SFCrsquos lend themselves well to (as the name would imply) sequential processes

bull Three Important components in SFCrsquosbull Transitionsbull Stepsbull Jumps

bull The status of the process can be viewed as a flow chart

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 73

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 74

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 75

PLC - HMI Communication

A ldquoPLC Heartbeatrdquo is traditionally used to monitor the PLC - HMI Communication sometimes called ardquoWatchdog Timerrdquo

Call it whatever you want but the PLC amp 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 ldquodiesrdquo then that switch doesnrsquot change state and an alarm alerts the operator

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 76

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 77

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 78

TUTORIAL

Part 2B

HMI Programming

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 79

Ethernet (TCPIP) IO Driver

The Ethernet (TCPIP) IO Driver allows the HMI to communicate with the PLC (In this case the driver is called MBENETEXE)

The PLC has an ethernet module in one of the slots that has a ldquoCAT5RJ-45rdquo 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 ldquoCAT5RJ-45rdquo receptacle for the ethernet cable

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 80

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 81

Operator Screens amp Popup Displays

The display is laid out in 3 sections

bull Upper - Security amp Alarm Windowbull Middle- Main Operator Screens bull Lower - Menu amp Popup Displays

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 82

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 83

Scripting

There are 6 types of ldquoScriptsrdquobull Application Scriptsbull Key Scriptsbull Condition Scriptsbull Data Change Scriptsbull Quick Function Scriptsbull ActiveX Event Scripts

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 84

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 85

Access Names

The ldquoAccess Namesrdquo Must be configured to allow the PLC - HMI communications

Note that the ldquoApplicationTopicrdquo is the same as the IO Driver

The ldquocomputer namerdquo is the name of the PC that the HMI is running on (brad_s_carlberg in this case)

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 86

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 87

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 88

Indirect Tags

ldquoIndirect Tagsrdquo were used here to minimize the number of popup displays

This is especially useful in HMIrsquos with many tags

ONLY 12 popup displays are reused throughout the HMI

This gives the HMI a ldquoDCS-Likerdquo Look amp Feel

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 89

Popup Display TypesThe tag point type determines which popup display to use

Analog InputHIC (or Analog Output)PID (or Analog Composite)

bull PID WITH AUTO amp CASCADE amp RATIObull PID WITH AUTO amp RATIO

Diginbull Motor Status

DigOutMotor (or Digital Composite)

bull Motor with ILock and PermNumericSet TimersAlarm DetailAlarm Tags

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 90

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 91

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 92

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 93

Bars Buttons amp Sliders

By choosing to use indirect tags we complicate the Bar Graphs Buttons amp Sliders in the popup displays

Different scales need to be used for different engineering unit ranges

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 94

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 95

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 96

Popup Displays

The next two pages shows how the individual popup displays use the indirect tags

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 97

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 98

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 99

Adding a ldquoTouch Targetrdquo to a Display

2 Tell which tags to use

3 Tell which popup display to call upWhat kind of point type is it

3 Steps1 Tell which scale to use (if itrsquos an analog point type)

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 100

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 101

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 102

TUTORIAL

Part 2C

Excel Spreadsheets

amp

Visual Basic

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 103

A ldquoCHEAP amp DIRTYrdquo HMI With Excel

The 4 key parameters are

To communicate with the PLCUse brad_s_carlbergmbenet|ANOXIC_OXICrsquoplcregisterrsquo

Excel uses ldquopeeksrdquo amp ldquopokesrdquo to read from amp write to a PLC or HMI

To communicate with the HMIbrad_s_carlbergview|Tagnamersquotagnamersquo

bull computer namebull applicationbull topicbull item

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 104

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 105

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 106

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 107

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 108

Excel Macros

bull ldquoRequestrdquo Macro to read values

bull ldquoPokerdquo Macro to write values

bull A Sample Excel Macro

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 109

Sub PokeMacro()MsgBox ApplicationNetworkTemplatesPathChannel = ApplicationDDEInitiate(app=brad_s_carlbergVIEW topic=Tagname) This opens a DDE channel to ViewApplicationDDEPoke Channel Temperature1 Worksheets(Sheet1)Range(A1) Puts value from R1C1 into Temperature1ApplicationDDEPoke Channel DDEReal Worksheets(Sheet1)Range(A2) Puts value from R1C1 into Temperature1ApplicationDDEPoke Channel DDEInteger Worksheets(Sheet1)Range(A3) Puts value from R1C1 into Temperature1ApplicationDDETerminate Channel This terminates the DDE channelEnd SubSub RequestMacro()Channel = ApplicationDDEInitiate(app=brad_s_carlbergVIEW topic=Tagname) This opens a DDE channel to ViewWorksheets(Sheet1)Range(C4) = ApplicationDDERequest(Channel $Hour)Worksheets(Sheet1)Range(C5) = ApplicationDDERequest(Channel $Minute)Worksheets(Sheet1)Range(C6) = ApplicationDDERequest(Channel $Second)Worksheets(Sheet1)Range(C9) = ApplicationDDERequest(Channel $day)Worksheets(Sheet1)Range(C10) = ApplicationDDERequest(Channel $date)Worksheets(Sheet1)Range(C11) = ApplicationDDERequest(Channel $datestring)Worksheets(Sheet1)Range(C12) = ApplicationDDERequest(Channel $datetime)Worksheets(Sheet1)Range(C13) = ApplicationDDERequest(Channel $date)Worksheets(Sheet1)Range(C14) = ApplicationDDERequest(Channel $month)Worksheets(Sheet1)Range(C15) = ApplicationDDERequest(Channel $year)Worksheets(Sheet1)Range(C16) = ApplicationDDERequest(Channel $time)Worksheets(Sheet1)Range(C17) = ApplicationDDERequest(Channel $timestring)Worksheets(Sheet1)Range(C18) = ApplicationDDERequest(Channel $applicationversion)Worksheets(Sheet1)Range(C19) = ApplicationDDERequest(Channel $startddeconversations)Worksheets(Sheet1)Range(C20) = ApplicationDDERequest(Channel $accesslevel)Worksheets(Sheet1)Range(C21) = ApplicationDDERequest(Channel $alarmlogging)Worksheets(Sheet1)Range(C22) = ApplicationDDERequest(Channel $applicationchanged)Worksheets(Sheet1)Range(C23) = ApplicationDDERequest(Channel $configureusers)Worksheets(Sheet1)Range(C24) = ApplicationDDERequest(Channel $changepassword)Worksheets(Sheet1)Range(C25) = ApplicationDDERequest(Channel $InactivityTimeout)Worksheets(Sheet1)Range(C26) = ApplicationDDERequest(Channel $InactivityWarning)Worksheets(Sheet1)Range(C27) = ApplicationDDERequest(Channel $LogicRunning)Worksheets(Sheet1)Range(C28) = ApplicationDDERequest(Channel $OperatorEntered)Worksheets(Sheet1)Range(C29) = ApplicationDDERequest(Channel $Operator)Worksheets(Sheet1)Range(C30) = ApplicationDDERequest(Channel $PasswordEntered)ApplicationDDETerminate Channel This terminates the DDE channelEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 110

Visual Basic

ldquoRoll Your Ownrdquo HMI - Much More powerful than Excel

Key Parameters computer nameapplication|topicitem

IO Emulator - MBPlusSimulateexe

Can ldquoRead Fromrdquo amp ldquoWrite Tordquo PLC andor HMI

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 111

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 112

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 113

Dim PauseTime Start Finish TotalTime As Integer Declare variables

Private Sub txtAIT_332A_SCALED_Change()On Error GoTo PokeAIT_332AErrortxtAIT_332A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtAIT_332A_SCALEDText = Int((3 Rnd) + 20) Generate random value between 20 and 23txtAIT_332A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtAIT_332A_SCALEDLinkItem = AIT_332A_SCALEDtxtAIT_332A_SCALEDLinkMode = 2txtAIT_332A_SCALEDLinkPoketxtAIT_332A_SCALEDLinkMode = 0 DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total time

PokeAIT_332AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtAIT_332A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 114

Private Sub txtAIT_346A_SCALED_Change()On Error GoTo PokeAIT_346AErrortxtAIT_346A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtAIT_346A_SCALEDText = Int((3 Rnd) + 15) Generate random value between 15 and 18txtAIT_346A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtAIT_346A_SCALEDLinkItem = AIT_346A_SCALEDtxtAIT_346A_SCALEDLinkMode = 2txtAIT_346A_SCALEDLinkPoketxtAIT_346A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeAIT_346AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtAIT_346A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 115

Private Sub txtFIT_321A_SCALED_Change()On Error GoTo PokeFIT_321AErrortxtFIT_321A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtFIT_321A_SCALEDText = Int((10 Rnd) + 120) Generate random value between 120 and 130txtFIT_321A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_321A_SCALEDLinkItem = FIT_321A_SCALEDtxtFIT_321A_SCALEDLinkMode = 2txtFIT_321A_SCALEDLinkPoketxtFIT_321A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total time

PokeFIT_321AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_321A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume Next

End Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 116

Private Sub txtFIT_341A_SCALED_Change()On Error GoTo PokeFIT_341AErrortxtFIT_341A_SCALEDLinkMode = 0 PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTime

txtFIT_341A_SCALEDText = Int((3 Rnd) + 18) Generate random value between 18 and 21

txtFIT_341A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_341A_SCALEDLinkItem = FIT_341A_SCALEDtxtFIT_341A_SCALEDLinkMode = 2txtFIT_341A_SCALEDLinkPoketxtFIT_341A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeFIT_341AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_341A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 117

Private Sub txtFIT_343A_SCALED_Change()On Error GoTo PokeFIT_343AErrortxtFIT_343A_SCALEDLinkMode = 0 PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTime

txtFIT_343A_SCALEDText = Int((1 Rnd) + 3) Generate random value between 3 and 4

txtFIT_343A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_343A_SCALEDLinkItem = FIT_343A_SCALEDtxtFIT_343A_SCALEDLinkMode = 2txtFIT_343A_SCALEDLinkPoketxtFIT_343A_SCALEDLinkMode = 0 DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeFIT_343AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_343A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 118

TUTORIAL

Part 4

Questions

amp

Answers

  • Slide 1
  • Slide 2
  • Slide 3
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Slide 8
  • Slide 9
  • Slide 10
  • Slide 11
  • Slide 12
  • Slide 13
  • Slide 14
  • Slide 15
  • Slide 16
  • Slide 17
  • Slide 18
  • Slide 19
  • Slide 20
  • Slide 21
  • Slide 22
  • Slide 23
  • Slide 24
  • Slide 25
  • Slide 26
  • Slide 27
  • Slide 28
  • Slide 29
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
  • Slide 34
  • Slide 35
  • Slide 36
  • Slide 37
  • Slide 38
  • Slide 39
  • Slide 40
  • Slide 41
  • Slide 42
  • Slide 43
  • Slide 44
  • Slide 45
  • Slide 46
  • Slide 47
  • Slide 48
  • Slide 49
  • Slide 50
  • Slide 51
  • Slide 52
  • Slide 53
  • Slide 54
  • Slide 55
  • Slide 56
  • Slide 57
  • Slide 58
  • Slide 59
  • Slide 60
  • Slide 61
  • Slide 62
  • Slide 63
  • Slide 64
  • Slide 65
  • Slide 66
  • Slide 67
  • Slide 68
  • Slide 69
  • Slide 70
  • Slide 71
  • Slide 72
  • Slide 73
  • Slide 74
  • Slide 75
  • Slide 76
  • Slide 77
  • Slide 78
  • Slide 79
  • Slide 80
  • Slide 81
  • Slide 82
  • Slide 83
  • Slide 84
  • Slide 85
  • Slide 86
  • Slide 87
  • Slide 88
  • Slide 89
  • Slide 90
  • Slide 91
  • Slide 92
  • Slide 93
  • Slide 94
  • Slide 95
  • Slide 96
  • Slide 97
  • Slide 98
  • Slide 99
  • Slide 100
  • Slide 101
  • Slide 102
  • Slide 103
  • Slide 104
  • Slide 105
  • Slide 106
  • Slide 107
  • Slide 108
  • Slide 109
  • Slide 110
  • Slide 111
  • Slide 112
  • Slide 113
  • Slide 114
  • Slide 115
  • Slide 116
  • Slide 117
  • Slide 118
Page 21: TUTORIAL Ethernet PLC's Improve Oxygen Consumption ISA Expo/2001Houston, Texas Water & Wastewater Industry DivisionTuesday, September 11, 2001 1 Brad.

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 22

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 23

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 24

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 25

The following control levels are available for the Recycle flow

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 27

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 28

The following control levels are available for the PD Blowers Timed Mode

Dissolved Oxygen Mode

Manual Mode

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

Motor Popup

The following information is available for each motor control from the respective motor popup

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

Aerator Control Motor Popup

Like all motors the following information is available for the Aerator motor control from the motor popup

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 32

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 33

Motor Popup Surface Aerator Control

The following information is available for motor control from the motor popup

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 35

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 36

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 37

Lower Explosive Level (LEL)

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 38

Each train has a digital input that tells whether thecombustible 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 (LEL) system

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 39

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 Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 40

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 41

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 Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 42

Like a DCS

middot 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

middot 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 amp CASCADE amp RATIO PID WITH AUTO amp RATIO Digin Motor Status DigOut Motor (or Digital Composite) Motor with ILock and Perm Numeric Set Timers Alarm Detail and Alarm Tags

middot A single generic trend display to trend ALL trendable (archived) points

Alarm Management

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

middot A Distributed Alarm Summary has been used to give better alarm management tools

bull Up to eight trend pens on the trend display

bull The operator picks which values to trend by clicking in the center of the trend

display

bull 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 44

The AnoxicOxic 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 Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 46

The following control levels are available for Oxygen1 Cascade from Dissolved Oxygen

2 Ratio from Discharge flow3 Auto-Manual Control

The following control levels are available for the Recycle flow1 Ratio from Discharge flow

2 Auto-Manual Control

The following control levels are available for the PD Blowers3 Timed Mode

2 Dissolved Oxygen Mode3 Manual Mode

Conclusions

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 47

Following the commissioning of the ethernet-based PLCs Oxygen consumption was significantly reduced

The advanced controls allow the operators to leave the process alone and continue to optimally treat the sewage

Conclusions

Following the commissioning of the ethernet-based PLCs AnoxicOxic 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 Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 48

Summary

The PD Blowers ran in Timed Mode andor 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

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 Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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 Authoritys 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 50

TUTORIAL

Part 2A

PLC Programming Basics

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 51

Separate parts of the process have been organized into a separate ldquoSECTIONrdquo

PLC Program Organization

Each ldquoSECTIONrdquo can be any of the IEC programming types

bull Ladder (LD)bull Structured Text (ST)

bull Instruction List (IL)

bull Function Blocks (FB)bull Sequential Function Charts (SFC)

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 52

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 53

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 54

IO Map

On-Line PLC Diagnostics

PLC Status

PLC Simulator

Ethernet (TCPIP) Address

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 55

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 56

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 57

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 58

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 59

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 60

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 61

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 62

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 63

Structured Text was used hereNOT Ladder

Programming for Motors

The PLC DOES NOT CAREStructured Text Functions EXACTLY

the same as LadderUse what yoursquore comfortable with

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 64

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 65

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 66

IEC Function Blocks Used Here

Programming for Analogs amp PID

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 67

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 68

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 69

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 70

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 71

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 72

Sequential Function Charts were used here

Higher-Level Control

bull SFCrsquos lend themselves well to (as the name would imply) sequential processes

bull Three Important components in SFCrsquosbull Transitionsbull Stepsbull Jumps

bull The status of the process can be viewed as a flow chart

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 73

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 74

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 75

PLC - HMI Communication

A ldquoPLC Heartbeatrdquo is traditionally used to monitor the PLC - HMI Communication sometimes called ardquoWatchdog Timerrdquo

Call it whatever you want but the PLC amp 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 ldquodiesrdquo then that switch doesnrsquot change state and an alarm alerts the operator

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 76

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 77

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 78

TUTORIAL

Part 2B

HMI Programming

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 79

Ethernet (TCPIP) IO Driver

The Ethernet (TCPIP) IO Driver allows the HMI to communicate with the PLC (In this case the driver is called MBENETEXE)

The PLC has an ethernet module in one of the slots that has a ldquoCAT5RJ-45rdquo 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 ldquoCAT5RJ-45rdquo receptacle for the ethernet cable

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 80

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 81

Operator Screens amp Popup Displays

The display is laid out in 3 sections

bull Upper - Security amp Alarm Windowbull Middle- Main Operator Screens bull Lower - Menu amp Popup Displays

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 82

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 83

Scripting

There are 6 types of ldquoScriptsrdquobull Application Scriptsbull Key Scriptsbull Condition Scriptsbull Data Change Scriptsbull Quick Function Scriptsbull ActiveX Event Scripts

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 84

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 85

Access Names

The ldquoAccess Namesrdquo Must be configured to allow the PLC - HMI communications

Note that the ldquoApplicationTopicrdquo is the same as the IO Driver

The ldquocomputer namerdquo is the name of the PC that the HMI is running on (brad_s_carlberg in this case)

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 86

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 87

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 88

Indirect Tags

ldquoIndirect Tagsrdquo were used here to minimize the number of popup displays

This is especially useful in HMIrsquos with many tags

ONLY 12 popup displays are reused throughout the HMI

This gives the HMI a ldquoDCS-Likerdquo Look amp Feel

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 89

Popup Display TypesThe tag point type determines which popup display to use

Analog InputHIC (or Analog Output)PID (or Analog Composite)

bull PID WITH AUTO amp CASCADE amp RATIObull PID WITH AUTO amp RATIO

Diginbull Motor Status

DigOutMotor (or Digital Composite)

bull Motor with ILock and PermNumericSet TimersAlarm DetailAlarm Tags

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 90

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 91

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 92

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 93

Bars Buttons amp Sliders

By choosing to use indirect tags we complicate the Bar Graphs Buttons amp Sliders in the popup displays

Different scales need to be used for different engineering unit ranges

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 94

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 95

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 96

Popup Displays

The next two pages shows how the individual popup displays use the indirect tags

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 97

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 98

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 99

Adding a ldquoTouch Targetrdquo to a Display

2 Tell which tags to use

3 Tell which popup display to call upWhat kind of point type is it

3 Steps1 Tell which scale to use (if itrsquos an analog point type)

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 100

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 101

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 102

TUTORIAL

Part 2C

Excel Spreadsheets

amp

Visual Basic

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 103

A ldquoCHEAP amp DIRTYrdquo HMI With Excel

The 4 key parameters are

To communicate with the PLCUse brad_s_carlbergmbenet|ANOXIC_OXICrsquoplcregisterrsquo

Excel uses ldquopeeksrdquo amp ldquopokesrdquo to read from amp write to a PLC or HMI

To communicate with the HMIbrad_s_carlbergview|Tagnamersquotagnamersquo

bull computer namebull applicationbull topicbull item

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 104

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 105

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 106

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 107

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 108

Excel Macros

bull ldquoRequestrdquo Macro to read values

bull ldquoPokerdquo Macro to write values

bull A Sample Excel Macro

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 109

Sub PokeMacro()MsgBox ApplicationNetworkTemplatesPathChannel = ApplicationDDEInitiate(app=brad_s_carlbergVIEW topic=Tagname) This opens a DDE channel to ViewApplicationDDEPoke Channel Temperature1 Worksheets(Sheet1)Range(A1) Puts value from R1C1 into Temperature1ApplicationDDEPoke Channel DDEReal Worksheets(Sheet1)Range(A2) Puts value from R1C1 into Temperature1ApplicationDDEPoke Channel DDEInteger Worksheets(Sheet1)Range(A3) Puts value from R1C1 into Temperature1ApplicationDDETerminate Channel This terminates the DDE channelEnd SubSub RequestMacro()Channel = ApplicationDDEInitiate(app=brad_s_carlbergVIEW topic=Tagname) This opens a DDE channel to ViewWorksheets(Sheet1)Range(C4) = ApplicationDDERequest(Channel $Hour)Worksheets(Sheet1)Range(C5) = ApplicationDDERequest(Channel $Minute)Worksheets(Sheet1)Range(C6) = ApplicationDDERequest(Channel $Second)Worksheets(Sheet1)Range(C9) = ApplicationDDERequest(Channel $day)Worksheets(Sheet1)Range(C10) = ApplicationDDERequest(Channel $date)Worksheets(Sheet1)Range(C11) = ApplicationDDERequest(Channel $datestring)Worksheets(Sheet1)Range(C12) = ApplicationDDERequest(Channel $datetime)Worksheets(Sheet1)Range(C13) = ApplicationDDERequest(Channel $date)Worksheets(Sheet1)Range(C14) = ApplicationDDERequest(Channel $month)Worksheets(Sheet1)Range(C15) = ApplicationDDERequest(Channel $year)Worksheets(Sheet1)Range(C16) = ApplicationDDERequest(Channel $time)Worksheets(Sheet1)Range(C17) = ApplicationDDERequest(Channel $timestring)Worksheets(Sheet1)Range(C18) = ApplicationDDERequest(Channel $applicationversion)Worksheets(Sheet1)Range(C19) = ApplicationDDERequest(Channel $startddeconversations)Worksheets(Sheet1)Range(C20) = ApplicationDDERequest(Channel $accesslevel)Worksheets(Sheet1)Range(C21) = ApplicationDDERequest(Channel $alarmlogging)Worksheets(Sheet1)Range(C22) = ApplicationDDERequest(Channel $applicationchanged)Worksheets(Sheet1)Range(C23) = ApplicationDDERequest(Channel $configureusers)Worksheets(Sheet1)Range(C24) = ApplicationDDERequest(Channel $changepassword)Worksheets(Sheet1)Range(C25) = ApplicationDDERequest(Channel $InactivityTimeout)Worksheets(Sheet1)Range(C26) = ApplicationDDERequest(Channel $InactivityWarning)Worksheets(Sheet1)Range(C27) = ApplicationDDERequest(Channel $LogicRunning)Worksheets(Sheet1)Range(C28) = ApplicationDDERequest(Channel $OperatorEntered)Worksheets(Sheet1)Range(C29) = ApplicationDDERequest(Channel $Operator)Worksheets(Sheet1)Range(C30) = ApplicationDDERequest(Channel $PasswordEntered)ApplicationDDETerminate Channel This terminates the DDE channelEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 110

Visual Basic

ldquoRoll Your Ownrdquo HMI - Much More powerful than Excel

Key Parameters computer nameapplication|topicitem

IO Emulator - MBPlusSimulateexe

Can ldquoRead Fromrdquo amp ldquoWrite Tordquo PLC andor HMI

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 111

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 112

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 113

Dim PauseTime Start Finish TotalTime As Integer Declare variables

Private Sub txtAIT_332A_SCALED_Change()On Error GoTo PokeAIT_332AErrortxtAIT_332A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtAIT_332A_SCALEDText = Int((3 Rnd) + 20) Generate random value between 20 and 23txtAIT_332A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtAIT_332A_SCALEDLinkItem = AIT_332A_SCALEDtxtAIT_332A_SCALEDLinkMode = 2txtAIT_332A_SCALEDLinkPoketxtAIT_332A_SCALEDLinkMode = 0 DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total time

PokeAIT_332AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtAIT_332A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 114

Private Sub txtAIT_346A_SCALED_Change()On Error GoTo PokeAIT_346AErrortxtAIT_346A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtAIT_346A_SCALEDText = Int((3 Rnd) + 15) Generate random value between 15 and 18txtAIT_346A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtAIT_346A_SCALEDLinkItem = AIT_346A_SCALEDtxtAIT_346A_SCALEDLinkMode = 2txtAIT_346A_SCALEDLinkPoketxtAIT_346A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeAIT_346AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtAIT_346A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 115

Private Sub txtFIT_321A_SCALED_Change()On Error GoTo PokeFIT_321AErrortxtFIT_321A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtFIT_321A_SCALEDText = Int((10 Rnd) + 120) Generate random value between 120 and 130txtFIT_321A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_321A_SCALEDLinkItem = FIT_321A_SCALEDtxtFIT_321A_SCALEDLinkMode = 2txtFIT_321A_SCALEDLinkPoketxtFIT_321A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total time

PokeFIT_321AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_321A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume Next

End Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 116

Private Sub txtFIT_341A_SCALED_Change()On Error GoTo PokeFIT_341AErrortxtFIT_341A_SCALEDLinkMode = 0 PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTime

txtFIT_341A_SCALEDText = Int((3 Rnd) + 18) Generate random value between 18 and 21

txtFIT_341A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_341A_SCALEDLinkItem = FIT_341A_SCALEDtxtFIT_341A_SCALEDLinkMode = 2txtFIT_341A_SCALEDLinkPoketxtFIT_341A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeFIT_341AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_341A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 117

Private Sub txtFIT_343A_SCALED_Change()On Error GoTo PokeFIT_343AErrortxtFIT_343A_SCALEDLinkMode = 0 PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTime

txtFIT_343A_SCALEDText = Int((1 Rnd) + 3) Generate random value between 3 and 4

txtFIT_343A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_343A_SCALEDLinkItem = FIT_343A_SCALEDtxtFIT_343A_SCALEDLinkMode = 2txtFIT_343A_SCALEDLinkPoketxtFIT_343A_SCALEDLinkMode = 0 DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeFIT_343AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_343A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 118

TUTORIAL

Part 4

Questions

amp

Answers

  • Slide 1
  • Slide 2
  • Slide 3
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Slide 8
  • Slide 9
  • Slide 10
  • Slide 11
  • Slide 12
  • Slide 13
  • Slide 14
  • Slide 15
  • Slide 16
  • Slide 17
  • Slide 18
  • Slide 19
  • Slide 20
  • Slide 21
  • Slide 22
  • Slide 23
  • Slide 24
  • Slide 25
  • Slide 26
  • Slide 27
  • Slide 28
  • Slide 29
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
  • Slide 34
  • Slide 35
  • Slide 36
  • Slide 37
  • Slide 38
  • Slide 39
  • Slide 40
  • Slide 41
  • Slide 42
  • Slide 43
  • Slide 44
  • Slide 45
  • Slide 46
  • Slide 47
  • Slide 48
  • Slide 49
  • Slide 50
  • Slide 51
  • Slide 52
  • Slide 53
  • Slide 54
  • Slide 55
  • Slide 56
  • Slide 57
  • Slide 58
  • Slide 59
  • Slide 60
  • Slide 61
  • Slide 62
  • Slide 63
  • Slide 64
  • Slide 65
  • Slide 66
  • Slide 67
  • Slide 68
  • Slide 69
  • Slide 70
  • Slide 71
  • Slide 72
  • Slide 73
  • Slide 74
  • Slide 75
  • Slide 76
  • Slide 77
  • Slide 78
  • Slide 79
  • Slide 80
  • Slide 81
  • Slide 82
  • Slide 83
  • Slide 84
  • Slide 85
  • Slide 86
  • Slide 87
  • Slide 88
  • Slide 89
  • Slide 90
  • Slide 91
  • Slide 92
  • Slide 93
  • Slide 94
  • Slide 95
  • Slide 96
  • Slide 97
  • Slide 98
  • Slide 99
  • Slide 100
  • Slide 101
  • Slide 102
  • Slide 103
  • Slide 104
  • Slide 105
  • Slide 106
  • Slide 107
  • Slide 108
  • Slide 109
  • Slide 110
  • Slide 111
  • Slide 112
  • Slide 113
  • Slide 114
  • Slide 115
  • Slide 116
  • Slide 117
  • Slide 118
Page 22: TUTORIAL Ethernet PLC's Improve Oxygen Consumption ISA Expo/2001Houston, Texas Water & Wastewater Industry DivisionTuesday, September 11, 2001 1 Brad.

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 22

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 23

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 24

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 25

The following control levels are available for the Recycle flow

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 27

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 28

The following control levels are available for the PD Blowers Timed Mode

Dissolved Oxygen Mode

Manual Mode

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

Motor Popup

The following information is available for each motor control from the respective motor popup

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

Aerator Control Motor Popup

Like all motors the following information is available for the Aerator motor control from the motor popup

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 32

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 33

Motor Popup Surface Aerator Control

The following information is available for motor control from the motor popup

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 35

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 36

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 37

Lower Explosive Level (LEL)

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 38

Each train has a digital input that tells whether thecombustible 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 (LEL) system

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 39

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 Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 40

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 41

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 Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 42

Like a DCS

middot 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

middot 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 amp CASCADE amp RATIO PID WITH AUTO amp RATIO Digin Motor Status DigOut Motor (or Digital Composite) Motor with ILock and Perm Numeric Set Timers Alarm Detail and Alarm Tags

middot A single generic trend display to trend ALL trendable (archived) points

Alarm Management

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

middot A Distributed Alarm Summary has been used to give better alarm management tools

bull Up to eight trend pens on the trend display

bull The operator picks which values to trend by clicking in the center of the trend

display

bull 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 44

The AnoxicOxic 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 Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 46

The following control levels are available for Oxygen1 Cascade from Dissolved Oxygen

2 Ratio from Discharge flow3 Auto-Manual Control

The following control levels are available for the Recycle flow1 Ratio from Discharge flow

2 Auto-Manual Control

The following control levels are available for the PD Blowers3 Timed Mode

2 Dissolved Oxygen Mode3 Manual Mode

Conclusions

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 47

Following the commissioning of the ethernet-based PLCs Oxygen consumption was significantly reduced

The advanced controls allow the operators to leave the process alone and continue to optimally treat the sewage

Conclusions

Following the commissioning of the ethernet-based PLCs AnoxicOxic 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 Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 48

Summary

The PD Blowers ran in Timed Mode andor 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

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 Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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 Authoritys 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 50

TUTORIAL

Part 2A

PLC Programming Basics

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 51

Separate parts of the process have been organized into a separate ldquoSECTIONrdquo

PLC Program Organization

Each ldquoSECTIONrdquo can be any of the IEC programming types

bull Ladder (LD)bull Structured Text (ST)

bull Instruction List (IL)

bull Function Blocks (FB)bull Sequential Function Charts (SFC)

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 52

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 53

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 54

IO Map

On-Line PLC Diagnostics

PLC Status

PLC Simulator

Ethernet (TCPIP) Address

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 55

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 56

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 57

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 58

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 59

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 60

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 61

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 62

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 63

Structured Text was used hereNOT Ladder

Programming for Motors

The PLC DOES NOT CAREStructured Text Functions EXACTLY

the same as LadderUse what yoursquore comfortable with

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 64

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 65

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 66

IEC Function Blocks Used Here

Programming for Analogs amp PID

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 67

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 68

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 69

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 70

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 71

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 72

Sequential Function Charts were used here

Higher-Level Control

bull SFCrsquos lend themselves well to (as the name would imply) sequential processes

bull Three Important components in SFCrsquosbull Transitionsbull Stepsbull Jumps

bull The status of the process can be viewed as a flow chart

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 73

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 74

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 75

PLC - HMI Communication

A ldquoPLC Heartbeatrdquo is traditionally used to monitor the PLC - HMI Communication sometimes called ardquoWatchdog Timerrdquo

Call it whatever you want but the PLC amp 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 ldquodiesrdquo then that switch doesnrsquot change state and an alarm alerts the operator

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 76

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 77

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 78

TUTORIAL

Part 2B

HMI Programming

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 79

Ethernet (TCPIP) IO Driver

The Ethernet (TCPIP) IO Driver allows the HMI to communicate with the PLC (In this case the driver is called MBENETEXE)

The PLC has an ethernet module in one of the slots that has a ldquoCAT5RJ-45rdquo 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 ldquoCAT5RJ-45rdquo receptacle for the ethernet cable

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 80

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 81

Operator Screens amp Popup Displays

The display is laid out in 3 sections

bull Upper - Security amp Alarm Windowbull Middle- Main Operator Screens bull Lower - Menu amp Popup Displays

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 82

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 83

Scripting

There are 6 types of ldquoScriptsrdquobull Application Scriptsbull Key Scriptsbull Condition Scriptsbull Data Change Scriptsbull Quick Function Scriptsbull ActiveX Event Scripts

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 84

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 85

Access Names

The ldquoAccess Namesrdquo Must be configured to allow the PLC - HMI communications

Note that the ldquoApplicationTopicrdquo is the same as the IO Driver

The ldquocomputer namerdquo is the name of the PC that the HMI is running on (brad_s_carlberg in this case)

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 86

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 87

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 88

Indirect Tags

ldquoIndirect Tagsrdquo were used here to minimize the number of popup displays

This is especially useful in HMIrsquos with many tags

ONLY 12 popup displays are reused throughout the HMI

This gives the HMI a ldquoDCS-Likerdquo Look amp Feel

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 89

Popup Display TypesThe tag point type determines which popup display to use

Analog InputHIC (or Analog Output)PID (or Analog Composite)

bull PID WITH AUTO amp CASCADE amp RATIObull PID WITH AUTO amp RATIO

Diginbull Motor Status

DigOutMotor (or Digital Composite)

bull Motor with ILock and PermNumericSet TimersAlarm DetailAlarm Tags

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 90

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 91

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 92

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 93

Bars Buttons amp Sliders

By choosing to use indirect tags we complicate the Bar Graphs Buttons amp Sliders in the popup displays

Different scales need to be used for different engineering unit ranges

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 94

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 95

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 96

Popup Displays

The next two pages shows how the individual popup displays use the indirect tags

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 97

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 98

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 99

Adding a ldquoTouch Targetrdquo to a Display

2 Tell which tags to use

3 Tell which popup display to call upWhat kind of point type is it

3 Steps1 Tell which scale to use (if itrsquos an analog point type)

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 100

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 101

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 102

TUTORIAL

Part 2C

Excel Spreadsheets

amp

Visual Basic

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 103

A ldquoCHEAP amp DIRTYrdquo HMI With Excel

The 4 key parameters are

To communicate with the PLCUse brad_s_carlbergmbenet|ANOXIC_OXICrsquoplcregisterrsquo

Excel uses ldquopeeksrdquo amp ldquopokesrdquo to read from amp write to a PLC or HMI

To communicate with the HMIbrad_s_carlbergview|Tagnamersquotagnamersquo

bull computer namebull applicationbull topicbull item

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 104

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 105

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 106

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 107

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 108

Excel Macros

bull ldquoRequestrdquo Macro to read values

bull ldquoPokerdquo Macro to write values

bull A Sample Excel Macro

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 109

Sub PokeMacro()MsgBox ApplicationNetworkTemplatesPathChannel = ApplicationDDEInitiate(app=brad_s_carlbergVIEW topic=Tagname) This opens a DDE channel to ViewApplicationDDEPoke Channel Temperature1 Worksheets(Sheet1)Range(A1) Puts value from R1C1 into Temperature1ApplicationDDEPoke Channel DDEReal Worksheets(Sheet1)Range(A2) Puts value from R1C1 into Temperature1ApplicationDDEPoke Channel DDEInteger Worksheets(Sheet1)Range(A3) Puts value from R1C1 into Temperature1ApplicationDDETerminate Channel This terminates the DDE channelEnd SubSub RequestMacro()Channel = ApplicationDDEInitiate(app=brad_s_carlbergVIEW topic=Tagname) This opens a DDE channel to ViewWorksheets(Sheet1)Range(C4) = ApplicationDDERequest(Channel $Hour)Worksheets(Sheet1)Range(C5) = ApplicationDDERequest(Channel $Minute)Worksheets(Sheet1)Range(C6) = ApplicationDDERequest(Channel $Second)Worksheets(Sheet1)Range(C9) = ApplicationDDERequest(Channel $day)Worksheets(Sheet1)Range(C10) = ApplicationDDERequest(Channel $date)Worksheets(Sheet1)Range(C11) = ApplicationDDERequest(Channel $datestring)Worksheets(Sheet1)Range(C12) = ApplicationDDERequest(Channel $datetime)Worksheets(Sheet1)Range(C13) = ApplicationDDERequest(Channel $date)Worksheets(Sheet1)Range(C14) = ApplicationDDERequest(Channel $month)Worksheets(Sheet1)Range(C15) = ApplicationDDERequest(Channel $year)Worksheets(Sheet1)Range(C16) = ApplicationDDERequest(Channel $time)Worksheets(Sheet1)Range(C17) = ApplicationDDERequest(Channel $timestring)Worksheets(Sheet1)Range(C18) = ApplicationDDERequest(Channel $applicationversion)Worksheets(Sheet1)Range(C19) = ApplicationDDERequest(Channel $startddeconversations)Worksheets(Sheet1)Range(C20) = ApplicationDDERequest(Channel $accesslevel)Worksheets(Sheet1)Range(C21) = ApplicationDDERequest(Channel $alarmlogging)Worksheets(Sheet1)Range(C22) = ApplicationDDERequest(Channel $applicationchanged)Worksheets(Sheet1)Range(C23) = ApplicationDDERequest(Channel $configureusers)Worksheets(Sheet1)Range(C24) = ApplicationDDERequest(Channel $changepassword)Worksheets(Sheet1)Range(C25) = ApplicationDDERequest(Channel $InactivityTimeout)Worksheets(Sheet1)Range(C26) = ApplicationDDERequest(Channel $InactivityWarning)Worksheets(Sheet1)Range(C27) = ApplicationDDERequest(Channel $LogicRunning)Worksheets(Sheet1)Range(C28) = ApplicationDDERequest(Channel $OperatorEntered)Worksheets(Sheet1)Range(C29) = ApplicationDDERequest(Channel $Operator)Worksheets(Sheet1)Range(C30) = ApplicationDDERequest(Channel $PasswordEntered)ApplicationDDETerminate Channel This terminates the DDE channelEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 110

Visual Basic

ldquoRoll Your Ownrdquo HMI - Much More powerful than Excel

Key Parameters computer nameapplication|topicitem

IO Emulator - MBPlusSimulateexe

Can ldquoRead Fromrdquo amp ldquoWrite Tordquo PLC andor HMI

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 111

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 112

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 113

Dim PauseTime Start Finish TotalTime As Integer Declare variables

Private Sub txtAIT_332A_SCALED_Change()On Error GoTo PokeAIT_332AErrortxtAIT_332A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtAIT_332A_SCALEDText = Int((3 Rnd) + 20) Generate random value between 20 and 23txtAIT_332A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtAIT_332A_SCALEDLinkItem = AIT_332A_SCALEDtxtAIT_332A_SCALEDLinkMode = 2txtAIT_332A_SCALEDLinkPoketxtAIT_332A_SCALEDLinkMode = 0 DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total time

PokeAIT_332AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtAIT_332A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 114

Private Sub txtAIT_346A_SCALED_Change()On Error GoTo PokeAIT_346AErrortxtAIT_346A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtAIT_346A_SCALEDText = Int((3 Rnd) + 15) Generate random value between 15 and 18txtAIT_346A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtAIT_346A_SCALEDLinkItem = AIT_346A_SCALEDtxtAIT_346A_SCALEDLinkMode = 2txtAIT_346A_SCALEDLinkPoketxtAIT_346A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeAIT_346AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtAIT_346A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 115

Private Sub txtFIT_321A_SCALED_Change()On Error GoTo PokeFIT_321AErrortxtFIT_321A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtFIT_321A_SCALEDText = Int((10 Rnd) + 120) Generate random value between 120 and 130txtFIT_321A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_321A_SCALEDLinkItem = FIT_321A_SCALEDtxtFIT_321A_SCALEDLinkMode = 2txtFIT_321A_SCALEDLinkPoketxtFIT_321A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total time

PokeFIT_321AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_321A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume Next

End Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 116

Private Sub txtFIT_341A_SCALED_Change()On Error GoTo PokeFIT_341AErrortxtFIT_341A_SCALEDLinkMode = 0 PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTime

txtFIT_341A_SCALEDText = Int((3 Rnd) + 18) Generate random value between 18 and 21

txtFIT_341A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_341A_SCALEDLinkItem = FIT_341A_SCALEDtxtFIT_341A_SCALEDLinkMode = 2txtFIT_341A_SCALEDLinkPoketxtFIT_341A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeFIT_341AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_341A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 117

Private Sub txtFIT_343A_SCALED_Change()On Error GoTo PokeFIT_343AErrortxtFIT_343A_SCALEDLinkMode = 0 PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTime

txtFIT_343A_SCALEDText = Int((1 Rnd) + 3) Generate random value between 3 and 4

txtFIT_343A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_343A_SCALEDLinkItem = FIT_343A_SCALEDtxtFIT_343A_SCALEDLinkMode = 2txtFIT_343A_SCALEDLinkPoketxtFIT_343A_SCALEDLinkMode = 0 DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeFIT_343AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_343A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 118

TUTORIAL

Part 4

Questions

amp

Answers

  • Slide 1
  • Slide 2
  • Slide 3
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Slide 8
  • Slide 9
  • Slide 10
  • Slide 11
  • Slide 12
  • Slide 13
  • Slide 14
  • Slide 15
  • Slide 16
  • Slide 17
  • Slide 18
  • Slide 19
  • Slide 20
  • Slide 21
  • Slide 22
  • Slide 23
  • Slide 24
  • Slide 25
  • Slide 26
  • Slide 27
  • Slide 28
  • Slide 29
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
  • Slide 34
  • Slide 35
  • Slide 36
  • Slide 37
  • Slide 38
  • Slide 39
  • Slide 40
  • Slide 41
  • Slide 42
  • Slide 43
  • Slide 44
  • Slide 45
  • Slide 46
  • Slide 47
  • Slide 48
  • Slide 49
  • Slide 50
  • Slide 51
  • Slide 52
  • Slide 53
  • Slide 54
  • Slide 55
  • Slide 56
  • Slide 57
  • Slide 58
  • Slide 59
  • Slide 60
  • Slide 61
  • Slide 62
  • Slide 63
  • Slide 64
  • Slide 65
  • Slide 66
  • Slide 67
  • Slide 68
  • Slide 69
  • Slide 70
  • Slide 71
  • Slide 72
  • Slide 73
  • Slide 74
  • Slide 75
  • Slide 76
  • Slide 77
  • Slide 78
  • Slide 79
  • Slide 80
  • Slide 81
  • Slide 82
  • Slide 83
  • Slide 84
  • Slide 85
  • Slide 86
  • Slide 87
  • Slide 88
  • Slide 89
  • Slide 90
  • Slide 91
  • Slide 92
  • Slide 93
  • Slide 94
  • Slide 95
  • Slide 96
  • Slide 97
  • Slide 98
  • Slide 99
  • Slide 100
  • Slide 101
  • Slide 102
  • Slide 103
  • Slide 104
  • Slide 105
  • Slide 106
  • Slide 107
  • Slide 108
  • Slide 109
  • Slide 110
  • Slide 111
  • Slide 112
  • Slide 113
  • Slide 114
  • Slide 115
  • Slide 116
  • Slide 117
  • Slide 118
Page 23: TUTORIAL Ethernet PLC's Improve Oxygen Consumption ISA Expo/2001Houston, Texas Water & Wastewater Industry DivisionTuesday, September 11, 2001 1 Brad.

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 23

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 24

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 25

The following control levels are available for the Recycle flow

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 27

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 28

The following control levels are available for the PD Blowers Timed Mode

Dissolved Oxygen Mode

Manual Mode

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

Motor Popup

The following information is available for each motor control from the respective motor popup

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

Aerator Control Motor Popup

Like all motors the following information is available for the Aerator motor control from the motor popup

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 32

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 33

Motor Popup Surface Aerator Control

The following information is available for motor control from the motor popup

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 35

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 36

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 37

Lower Explosive Level (LEL)

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 38

Each train has a digital input that tells whether thecombustible 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 (LEL) system

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 39

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 Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 40

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 41

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 Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 42

Like a DCS

middot 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

middot 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 amp CASCADE amp RATIO PID WITH AUTO amp RATIO Digin Motor Status DigOut Motor (or Digital Composite) Motor with ILock and Perm Numeric Set Timers Alarm Detail and Alarm Tags

middot A single generic trend display to trend ALL trendable (archived) points

Alarm Management

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

middot A Distributed Alarm Summary has been used to give better alarm management tools

bull Up to eight trend pens on the trend display

bull The operator picks which values to trend by clicking in the center of the trend

display

bull 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 44

The AnoxicOxic 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 Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 46

The following control levels are available for Oxygen1 Cascade from Dissolved Oxygen

2 Ratio from Discharge flow3 Auto-Manual Control

The following control levels are available for the Recycle flow1 Ratio from Discharge flow

2 Auto-Manual Control

The following control levels are available for the PD Blowers3 Timed Mode

2 Dissolved Oxygen Mode3 Manual Mode

Conclusions

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 47

Following the commissioning of the ethernet-based PLCs Oxygen consumption was significantly reduced

The advanced controls allow the operators to leave the process alone and continue to optimally treat the sewage

Conclusions

Following the commissioning of the ethernet-based PLCs AnoxicOxic 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 Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 48

Summary

The PD Blowers ran in Timed Mode andor 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

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 Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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 Authoritys 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 50

TUTORIAL

Part 2A

PLC Programming Basics

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 51

Separate parts of the process have been organized into a separate ldquoSECTIONrdquo

PLC Program Organization

Each ldquoSECTIONrdquo can be any of the IEC programming types

bull Ladder (LD)bull Structured Text (ST)

bull Instruction List (IL)

bull Function Blocks (FB)bull Sequential Function Charts (SFC)

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 52

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 53

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 54

IO Map

On-Line PLC Diagnostics

PLC Status

PLC Simulator

Ethernet (TCPIP) Address

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 55

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 56

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 57

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 58

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 59

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 60

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 61

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 62

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 63

Structured Text was used hereNOT Ladder

Programming for Motors

The PLC DOES NOT CAREStructured Text Functions EXACTLY

the same as LadderUse what yoursquore comfortable with

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 64

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 65

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 66

IEC Function Blocks Used Here

Programming for Analogs amp PID

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 67

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 68

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 69

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 70

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 71

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 72

Sequential Function Charts were used here

Higher-Level Control

bull SFCrsquos lend themselves well to (as the name would imply) sequential processes

bull Three Important components in SFCrsquosbull Transitionsbull Stepsbull Jumps

bull The status of the process can be viewed as a flow chart

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 73

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 74

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 75

PLC - HMI Communication

A ldquoPLC Heartbeatrdquo is traditionally used to monitor the PLC - HMI Communication sometimes called ardquoWatchdog Timerrdquo

Call it whatever you want but the PLC amp 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 ldquodiesrdquo then that switch doesnrsquot change state and an alarm alerts the operator

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 76

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 77

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 78

TUTORIAL

Part 2B

HMI Programming

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 79

Ethernet (TCPIP) IO Driver

The Ethernet (TCPIP) IO Driver allows the HMI to communicate with the PLC (In this case the driver is called MBENETEXE)

The PLC has an ethernet module in one of the slots that has a ldquoCAT5RJ-45rdquo 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 ldquoCAT5RJ-45rdquo receptacle for the ethernet cable

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 80

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 81

Operator Screens amp Popup Displays

The display is laid out in 3 sections

bull Upper - Security amp Alarm Windowbull Middle- Main Operator Screens bull Lower - Menu amp Popup Displays

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 82

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 83

Scripting

There are 6 types of ldquoScriptsrdquobull Application Scriptsbull Key Scriptsbull Condition Scriptsbull Data Change Scriptsbull Quick Function Scriptsbull ActiveX Event Scripts

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 84

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 85

Access Names

The ldquoAccess Namesrdquo Must be configured to allow the PLC - HMI communications

Note that the ldquoApplicationTopicrdquo is the same as the IO Driver

The ldquocomputer namerdquo is the name of the PC that the HMI is running on (brad_s_carlberg in this case)

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 86

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 87

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 88

Indirect Tags

ldquoIndirect Tagsrdquo were used here to minimize the number of popup displays

This is especially useful in HMIrsquos with many tags

ONLY 12 popup displays are reused throughout the HMI

This gives the HMI a ldquoDCS-Likerdquo Look amp Feel

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 89

Popup Display TypesThe tag point type determines which popup display to use

Analog InputHIC (or Analog Output)PID (or Analog Composite)

bull PID WITH AUTO amp CASCADE amp RATIObull PID WITH AUTO amp RATIO

Diginbull Motor Status

DigOutMotor (or Digital Composite)

bull Motor with ILock and PermNumericSet TimersAlarm DetailAlarm Tags

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 90

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 91

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 92

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 93

Bars Buttons amp Sliders

By choosing to use indirect tags we complicate the Bar Graphs Buttons amp Sliders in the popup displays

Different scales need to be used for different engineering unit ranges

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 94

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 95

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 96

Popup Displays

The next two pages shows how the individual popup displays use the indirect tags

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 97

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 98

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 99

Adding a ldquoTouch Targetrdquo to a Display

2 Tell which tags to use

3 Tell which popup display to call upWhat kind of point type is it

3 Steps1 Tell which scale to use (if itrsquos an analog point type)

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 100

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 101

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 102

TUTORIAL

Part 2C

Excel Spreadsheets

amp

Visual Basic

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 103

A ldquoCHEAP amp DIRTYrdquo HMI With Excel

The 4 key parameters are

To communicate with the PLCUse brad_s_carlbergmbenet|ANOXIC_OXICrsquoplcregisterrsquo

Excel uses ldquopeeksrdquo amp ldquopokesrdquo to read from amp write to a PLC or HMI

To communicate with the HMIbrad_s_carlbergview|Tagnamersquotagnamersquo

bull computer namebull applicationbull topicbull item

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 104

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 105

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 106

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 107

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 108

Excel Macros

bull ldquoRequestrdquo Macro to read values

bull ldquoPokerdquo Macro to write values

bull A Sample Excel Macro

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 109

Sub PokeMacro()MsgBox ApplicationNetworkTemplatesPathChannel = ApplicationDDEInitiate(app=brad_s_carlbergVIEW topic=Tagname) This opens a DDE channel to ViewApplicationDDEPoke Channel Temperature1 Worksheets(Sheet1)Range(A1) Puts value from R1C1 into Temperature1ApplicationDDEPoke Channel DDEReal Worksheets(Sheet1)Range(A2) Puts value from R1C1 into Temperature1ApplicationDDEPoke Channel DDEInteger Worksheets(Sheet1)Range(A3) Puts value from R1C1 into Temperature1ApplicationDDETerminate Channel This terminates the DDE channelEnd SubSub RequestMacro()Channel = ApplicationDDEInitiate(app=brad_s_carlbergVIEW topic=Tagname) This opens a DDE channel to ViewWorksheets(Sheet1)Range(C4) = ApplicationDDERequest(Channel $Hour)Worksheets(Sheet1)Range(C5) = ApplicationDDERequest(Channel $Minute)Worksheets(Sheet1)Range(C6) = ApplicationDDERequest(Channel $Second)Worksheets(Sheet1)Range(C9) = ApplicationDDERequest(Channel $day)Worksheets(Sheet1)Range(C10) = ApplicationDDERequest(Channel $date)Worksheets(Sheet1)Range(C11) = ApplicationDDERequest(Channel $datestring)Worksheets(Sheet1)Range(C12) = ApplicationDDERequest(Channel $datetime)Worksheets(Sheet1)Range(C13) = ApplicationDDERequest(Channel $date)Worksheets(Sheet1)Range(C14) = ApplicationDDERequest(Channel $month)Worksheets(Sheet1)Range(C15) = ApplicationDDERequest(Channel $year)Worksheets(Sheet1)Range(C16) = ApplicationDDERequest(Channel $time)Worksheets(Sheet1)Range(C17) = ApplicationDDERequest(Channel $timestring)Worksheets(Sheet1)Range(C18) = ApplicationDDERequest(Channel $applicationversion)Worksheets(Sheet1)Range(C19) = ApplicationDDERequest(Channel $startddeconversations)Worksheets(Sheet1)Range(C20) = ApplicationDDERequest(Channel $accesslevel)Worksheets(Sheet1)Range(C21) = ApplicationDDERequest(Channel $alarmlogging)Worksheets(Sheet1)Range(C22) = ApplicationDDERequest(Channel $applicationchanged)Worksheets(Sheet1)Range(C23) = ApplicationDDERequest(Channel $configureusers)Worksheets(Sheet1)Range(C24) = ApplicationDDERequest(Channel $changepassword)Worksheets(Sheet1)Range(C25) = ApplicationDDERequest(Channel $InactivityTimeout)Worksheets(Sheet1)Range(C26) = ApplicationDDERequest(Channel $InactivityWarning)Worksheets(Sheet1)Range(C27) = ApplicationDDERequest(Channel $LogicRunning)Worksheets(Sheet1)Range(C28) = ApplicationDDERequest(Channel $OperatorEntered)Worksheets(Sheet1)Range(C29) = ApplicationDDERequest(Channel $Operator)Worksheets(Sheet1)Range(C30) = ApplicationDDERequest(Channel $PasswordEntered)ApplicationDDETerminate Channel This terminates the DDE channelEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 110

Visual Basic

ldquoRoll Your Ownrdquo HMI - Much More powerful than Excel

Key Parameters computer nameapplication|topicitem

IO Emulator - MBPlusSimulateexe

Can ldquoRead Fromrdquo amp ldquoWrite Tordquo PLC andor HMI

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 111

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 112

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 113

Dim PauseTime Start Finish TotalTime As Integer Declare variables

Private Sub txtAIT_332A_SCALED_Change()On Error GoTo PokeAIT_332AErrortxtAIT_332A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtAIT_332A_SCALEDText = Int((3 Rnd) + 20) Generate random value between 20 and 23txtAIT_332A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtAIT_332A_SCALEDLinkItem = AIT_332A_SCALEDtxtAIT_332A_SCALEDLinkMode = 2txtAIT_332A_SCALEDLinkPoketxtAIT_332A_SCALEDLinkMode = 0 DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total time

PokeAIT_332AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtAIT_332A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 114

Private Sub txtAIT_346A_SCALED_Change()On Error GoTo PokeAIT_346AErrortxtAIT_346A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtAIT_346A_SCALEDText = Int((3 Rnd) + 15) Generate random value between 15 and 18txtAIT_346A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtAIT_346A_SCALEDLinkItem = AIT_346A_SCALEDtxtAIT_346A_SCALEDLinkMode = 2txtAIT_346A_SCALEDLinkPoketxtAIT_346A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeAIT_346AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtAIT_346A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 115

Private Sub txtFIT_321A_SCALED_Change()On Error GoTo PokeFIT_321AErrortxtFIT_321A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtFIT_321A_SCALEDText = Int((10 Rnd) + 120) Generate random value between 120 and 130txtFIT_321A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_321A_SCALEDLinkItem = FIT_321A_SCALEDtxtFIT_321A_SCALEDLinkMode = 2txtFIT_321A_SCALEDLinkPoketxtFIT_321A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total time

PokeFIT_321AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_321A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume Next

End Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 116

Private Sub txtFIT_341A_SCALED_Change()On Error GoTo PokeFIT_341AErrortxtFIT_341A_SCALEDLinkMode = 0 PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTime

txtFIT_341A_SCALEDText = Int((3 Rnd) + 18) Generate random value between 18 and 21

txtFIT_341A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_341A_SCALEDLinkItem = FIT_341A_SCALEDtxtFIT_341A_SCALEDLinkMode = 2txtFIT_341A_SCALEDLinkPoketxtFIT_341A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeFIT_341AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_341A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 117

Private Sub txtFIT_343A_SCALED_Change()On Error GoTo PokeFIT_343AErrortxtFIT_343A_SCALEDLinkMode = 0 PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTime

txtFIT_343A_SCALEDText = Int((1 Rnd) + 3) Generate random value between 3 and 4

txtFIT_343A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_343A_SCALEDLinkItem = FIT_343A_SCALEDtxtFIT_343A_SCALEDLinkMode = 2txtFIT_343A_SCALEDLinkPoketxtFIT_343A_SCALEDLinkMode = 0 DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeFIT_343AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_343A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 118

TUTORIAL

Part 4

Questions

amp

Answers

  • Slide 1
  • Slide 2
  • Slide 3
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Slide 8
  • Slide 9
  • Slide 10
  • Slide 11
  • Slide 12
  • Slide 13
  • Slide 14
  • Slide 15
  • Slide 16
  • Slide 17
  • Slide 18
  • Slide 19
  • Slide 20
  • Slide 21
  • Slide 22
  • Slide 23
  • Slide 24
  • Slide 25
  • Slide 26
  • Slide 27
  • Slide 28
  • Slide 29
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
  • Slide 34
  • Slide 35
  • Slide 36
  • Slide 37
  • Slide 38
  • Slide 39
  • Slide 40
  • Slide 41
  • Slide 42
  • Slide 43
  • Slide 44
  • Slide 45
  • Slide 46
  • Slide 47
  • Slide 48
  • Slide 49
  • Slide 50
  • Slide 51
  • Slide 52
  • Slide 53
  • Slide 54
  • Slide 55
  • Slide 56
  • Slide 57
  • Slide 58
  • Slide 59
  • Slide 60
  • Slide 61
  • Slide 62
  • Slide 63
  • Slide 64
  • Slide 65
  • Slide 66
  • Slide 67
  • Slide 68
  • Slide 69
  • Slide 70
  • Slide 71
  • Slide 72
  • Slide 73
  • Slide 74
  • Slide 75
  • Slide 76
  • Slide 77
  • Slide 78
  • Slide 79
  • Slide 80
  • Slide 81
  • Slide 82
  • Slide 83
  • Slide 84
  • Slide 85
  • Slide 86
  • Slide 87
  • Slide 88
  • Slide 89
  • Slide 90
  • Slide 91
  • Slide 92
  • Slide 93
  • Slide 94
  • Slide 95
  • Slide 96
  • Slide 97
  • Slide 98
  • Slide 99
  • Slide 100
  • Slide 101
  • Slide 102
  • Slide 103
  • Slide 104
  • Slide 105
  • Slide 106
  • Slide 107
  • Slide 108
  • Slide 109
  • Slide 110
  • Slide 111
  • Slide 112
  • Slide 113
  • Slide 114
  • Slide 115
  • Slide 116
  • Slide 117
  • Slide 118
Page 24: TUTORIAL Ethernet PLC's Improve Oxygen Consumption ISA Expo/2001Houston, Texas Water & Wastewater Industry DivisionTuesday, September 11, 2001 1 Brad.

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 24

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 25

The following control levels are available for the Recycle flow

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 27

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 28

The following control levels are available for the PD Blowers Timed Mode

Dissolved Oxygen Mode

Manual Mode

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

Motor Popup

The following information is available for each motor control from the respective motor popup

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

Aerator Control Motor Popup

Like all motors the following information is available for the Aerator motor control from the motor popup

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 32

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 33

Motor Popup Surface Aerator Control

The following information is available for motor control from the motor popup

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 35

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 36

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 37

Lower Explosive Level (LEL)

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 38

Each train has a digital input that tells whether thecombustible 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 (LEL) system

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 39

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 Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 40

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 41

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 Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 42

Like a DCS

middot 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

middot 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 amp CASCADE amp RATIO PID WITH AUTO amp RATIO Digin Motor Status DigOut Motor (or Digital Composite) Motor with ILock and Perm Numeric Set Timers Alarm Detail and Alarm Tags

middot A single generic trend display to trend ALL trendable (archived) points

Alarm Management

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

middot A Distributed Alarm Summary has been used to give better alarm management tools

bull Up to eight trend pens on the trend display

bull The operator picks which values to trend by clicking in the center of the trend

display

bull 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 44

The AnoxicOxic 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 Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 46

The following control levels are available for Oxygen1 Cascade from Dissolved Oxygen

2 Ratio from Discharge flow3 Auto-Manual Control

The following control levels are available for the Recycle flow1 Ratio from Discharge flow

2 Auto-Manual Control

The following control levels are available for the PD Blowers3 Timed Mode

2 Dissolved Oxygen Mode3 Manual Mode

Conclusions

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 47

Following the commissioning of the ethernet-based PLCs Oxygen consumption was significantly reduced

The advanced controls allow the operators to leave the process alone and continue to optimally treat the sewage

Conclusions

Following the commissioning of the ethernet-based PLCs AnoxicOxic 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 Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 48

Summary

The PD Blowers ran in Timed Mode andor 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

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 Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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 Authoritys 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 50

TUTORIAL

Part 2A

PLC Programming Basics

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 51

Separate parts of the process have been organized into a separate ldquoSECTIONrdquo

PLC Program Organization

Each ldquoSECTIONrdquo can be any of the IEC programming types

bull Ladder (LD)bull Structured Text (ST)

bull Instruction List (IL)

bull Function Blocks (FB)bull Sequential Function Charts (SFC)

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 52

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 53

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 54

IO Map

On-Line PLC Diagnostics

PLC Status

PLC Simulator

Ethernet (TCPIP) Address

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 55

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 56

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 57

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 58

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 59

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 60

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 61

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 62

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 63

Structured Text was used hereNOT Ladder

Programming for Motors

The PLC DOES NOT CAREStructured Text Functions EXACTLY

the same as LadderUse what yoursquore comfortable with

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 64

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 65

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 66

IEC Function Blocks Used Here

Programming for Analogs amp PID

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 67

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 68

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 69

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 70

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 71

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 72

Sequential Function Charts were used here

Higher-Level Control

bull SFCrsquos lend themselves well to (as the name would imply) sequential processes

bull Three Important components in SFCrsquosbull Transitionsbull Stepsbull Jumps

bull The status of the process can be viewed as a flow chart

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 73

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 74

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 75

PLC - HMI Communication

A ldquoPLC Heartbeatrdquo is traditionally used to monitor the PLC - HMI Communication sometimes called ardquoWatchdog Timerrdquo

Call it whatever you want but the PLC amp 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 ldquodiesrdquo then that switch doesnrsquot change state and an alarm alerts the operator

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 76

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 77

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 78

TUTORIAL

Part 2B

HMI Programming

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 79

Ethernet (TCPIP) IO Driver

The Ethernet (TCPIP) IO Driver allows the HMI to communicate with the PLC (In this case the driver is called MBENETEXE)

The PLC has an ethernet module in one of the slots that has a ldquoCAT5RJ-45rdquo 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 ldquoCAT5RJ-45rdquo receptacle for the ethernet cable

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 80

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 81

Operator Screens amp Popup Displays

The display is laid out in 3 sections

bull Upper - Security amp Alarm Windowbull Middle- Main Operator Screens bull Lower - Menu amp Popup Displays

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 82

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 83

Scripting

There are 6 types of ldquoScriptsrdquobull Application Scriptsbull Key Scriptsbull Condition Scriptsbull Data Change Scriptsbull Quick Function Scriptsbull ActiveX Event Scripts

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 84

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 85

Access Names

The ldquoAccess Namesrdquo Must be configured to allow the PLC - HMI communications

Note that the ldquoApplicationTopicrdquo is the same as the IO Driver

The ldquocomputer namerdquo is the name of the PC that the HMI is running on (brad_s_carlberg in this case)

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 86

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 87

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 88

Indirect Tags

ldquoIndirect Tagsrdquo were used here to minimize the number of popup displays

This is especially useful in HMIrsquos with many tags

ONLY 12 popup displays are reused throughout the HMI

This gives the HMI a ldquoDCS-Likerdquo Look amp Feel

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 89

Popup Display TypesThe tag point type determines which popup display to use

Analog InputHIC (or Analog Output)PID (or Analog Composite)

bull PID WITH AUTO amp CASCADE amp RATIObull PID WITH AUTO amp RATIO

Diginbull Motor Status

DigOutMotor (or Digital Composite)

bull Motor with ILock and PermNumericSet TimersAlarm DetailAlarm Tags

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 90

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 91

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 92

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 93

Bars Buttons amp Sliders

By choosing to use indirect tags we complicate the Bar Graphs Buttons amp Sliders in the popup displays

Different scales need to be used for different engineering unit ranges

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 94

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 95

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 96

Popup Displays

The next two pages shows how the individual popup displays use the indirect tags

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 97

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 98

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 99

Adding a ldquoTouch Targetrdquo to a Display

2 Tell which tags to use

3 Tell which popup display to call upWhat kind of point type is it

3 Steps1 Tell which scale to use (if itrsquos an analog point type)

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 100

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 101

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 102

TUTORIAL

Part 2C

Excel Spreadsheets

amp

Visual Basic

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 103

A ldquoCHEAP amp DIRTYrdquo HMI With Excel

The 4 key parameters are

To communicate with the PLCUse brad_s_carlbergmbenet|ANOXIC_OXICrsquoplcregisterrsquo

Excel uses ldquopeeksrdquo amp ldquopokesrdquo to read from amp write to a PLC or HMI

To communicate with the HMIbrad_s_carlbergview|Tagnamersquotagnamersquo

bull computer namebull applicationbull topicbull item

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 104

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 105

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 106

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 107

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 108

Excel Macros

bull ldquoRequestrdquo Macro to read values

bull ldquoPokerdquo Macro to write values

bull A Sample Excel Macro

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 109

Sub PokeMacro()MsgBox ApplicationNetworkTemplatesPathChannel = ApplicationDDEInitiate(app=brad_s_carlbergVIEW topic=Tagname) This opens a DDE channel to ViewApplicationDDEPoke Channel Temperature1 Worksheets(Sheet1)Range(A1) Puts value from R1C1 into Temperature1ApplicationDDEPoke Channel DDEReal Worksheets(Sheet1)Range(A2) Puts value from R1C1 into Temperature1ApplicationDDEPoke Channel DDEInteger Worksheets(Sheet1)Range(A3) Puts value from R1C1 into Temperature1ApplicationDDETerminate Channel This terminates the DDE channelEnd SubSub RequestMacro()Channel = ApplicationDDEInitiate(app=brad_s_carlbergVIEW topic=Tagname) This opens a DDE channel to ViewWorksheets(Sheet1)Range(C4) = ApplicationDDERequest(Channel $Hour)Worksheets(Sheet1)Range(C5) = ApplicationDDERequest(Channel $Minute)Worksheets(Sheet1)Range(C6) = ApplicationDDERequest(Channel $Second)Worksheets(Sheet1)Range(C9) = ApplicationDDERequest(Channel $day)Worksheets(Sheet1)Range(C10) = ApplicationDDERequest(Channel $date)Worksheets(Sheet1)Range(C11) = ApplicationDDERequest(Channel $datestring)Worksheets(Sheet1)Range(C12) = ApplicationDDERequest(Channel $datetime)Worksheets(Sheet1)Range(C13) = ApplicationDDERequest(Channel $date)Worksheets(Sheet1)Range(C14) = ApplicationDDERequest(Channel $month)Worksheets(Sheet1)Range(C15) = ApplicationDDERequest(Channel $year)Worksheets(Sheet1)Range(C16) = ApplicationDDERequest(Channel $time)Worksheets(Sheet1)Range(C17) = ApplicationDDERequest(Channel $timestring)Worksheets(Sheet1)Range(C18) = ApplicationDDERequest(Channel $applicationversion)Worksheets(Sheet1)Range(C19) = ApplicationDDERequest(Channel $startddeconversations)Worksheets(Sheet1)Range(C20) = ApplicationDDERequest(Channel $accesslevel)Worksheets(Sheet1)Range(C21) = ApplicationDDERequest(Channel $alarmlogging)Worksheets(Sheet1)Range(C22) = ApplicationDDERequest(Channel $applicationchanged)Worksheets(Sheet1)Range(C23) = ApplicationDDERequest(Channel $configureusers)Worksheets(Sheet1)Range(C24) = ApplicationDDERequest(Channel $changepassword)Worksheets(Sheet1)Range(C25) = ApplicationDDERequest(Channel $InactivityTimeout)Worksheets(Sheet1)Range(C26) = ApplicationDDERequest(Channel $InactivityWarning)Worksheets(Sheet1)Range(C27) = ApplicationDDERequest(Channel $LogicRunning)Worksheets(Sheet1)Range(C28) = ApplicationDDERequest(Channel $OperatorEntered)Worksheets(Sheet1)Range(C29) = ApplicationDDERequest(Channel $Operator)Worksheets(Sheet1)Range(C30) = ApplicationDDERequest(Channel $PasswordEntered)ApplicationDDETerminate Channel This terminates the DDE channelEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 110

Visual Basic

ldquoRoll Your Ownrdquo HMI - Much More powerful than Excel

Key Parameters computer nameapplication|topicitem

IO Emulator - MBPlusSimulateexe

Can ldquoRead Fromrdquo amp ldquoWrite Tordquo PLC andor HMI

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 111

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 112

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 113

Dim PauseTime Start Finish TotalTime As Integer Declare variables

Private Sub txtAIT_332A_SCALED_Change()On Error GoTo PokeAIT_332AErrortxtAIT_332A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtAIT_332A_SCALEDText = Int((3 Rnd) + 20) Generate random value between 20 and 23txtAIT_332A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtAIT_332A_SCALEDLinkItem = AIT_332A_SCALEDtxtAIT_332A_SCALEDLinkMode = 2txtAIT_332A_SCALEDLinkPoketxtAIT_332A_SCALEDLinkMode = 0 DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total time

PokeAIT_332AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtAIT_332A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 114

Private Sub txtAIT_346A_SCALED_Change()On Error GoTo PokeAIT_346AErrortxtAIT_346A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtAIT_346A_SCALEDText = Int((3 Rnd) + 15) Generate random value between 15 and 18txtAIT_346A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtAIT_346A_SCALEDLinkItem = AIT_346A_SCALEDtxtAIT_346A_SCALEDLinkMode = 2txtAIT_346A_SCALEDLinkPoketxtAIT_346A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeAIT_346AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtAIT_346A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 115

Private Sub txtFIT_321A_SCALED_Change()On Error GoTo PokeFIT_321AErrortxtFIT_321A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtFIT_321A_SCALEDText = Int((10 Rnd) + 120) Generate random value between 120 and 130txtFIT_321A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_321A_SCALEDLinkItem = FIT_321A_SCALEDtxtFIT_321A_SCALEDLinkMode = 2txtFIT_321A_SCALEDLinkPoketxtFIT_321A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total time

PokeFIT_321AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_321A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume Next

End Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 116

Private Sub txtFIT_341A_SCALED_Change()On Error GoTo PokeFIT_341AErrortxtFIT_341A_SCALEDLinkMode = 0 PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTime

txtFIT_341A_SCALEDText = Int((3 Rnd) + 18) Generate random value between 18 and 21

txtFIT_341A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_341A_SCALEDLinkItem = FIT_341A_SCALEDtxtFIT_341A_SCALEDLinkMode = 2txtFIT_341A_SCALEDLinkPoketxtFIT_341A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeFIT_341AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_341A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 117

Private Sub txtFIT_343A_SCALED_Change()On Error GoTo PokeFIT_343AErrortxtFIT_343A_SCALEDLinkMode = 0 PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTime

txtFIT_343A_SCALEDText = Int((1 Rnd) + 3) Generate random value between 3 and 4

txtFIT_343A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_343A_SCALEDLinkItem = FIT_343A_SCALEDtxtFIT_343A_SCALEDLinkMode = 2txtFIT_343A_SCALEDLinkPoketxtFIT_343A_SCALEDLinkMode = 0 DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeFIT_343AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_343A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 118

TUTORIAL

Part 4

Questions

amp

Answers

  • Slide 1
  • Slide 2
  • Slide 3
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Slide 8
  • Slide 9
  • Slide 10
  • Slide 11
  • Slide 12
  • Slide 13
  • Slide 14
  • Slide 15
  • Slide 16
  • Slide 17
  • Slide 18
  • Slide 19
  • Slide 20
  • Slide 21
  • Slide 22
  • Slide 23
  • Slide 24
  • Slide 25
  • Slide 26
  • Slide 27
  • Slide 28
  • Slide 29
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
  • Slide 34
  • Slide 35
  • Slide 36
  • Slide 37
  • Slide 38
  • Slide 39
  • Slide 40
  • Slide 41
  • Slide 42
  • Slide 43
  • Slide 44
  • Slide 45
  • Slide 46
  • Slide 47
  • Slide 48
  • Slide 49
  • Slide 50
  • Slide 51
  • Slide 52
  • Slide 53
  • Slide 54
  • Slide 55
  • Slide 56
  • Slide 57
  • Slide 58
  • Slide 59
  • Slide 60
  • Slide 61
  • Slide 62
  • Slide 63
  • Slide 64
  • Slide 65
  • Slide 66
  • Slide 67
  • Slide 68
  • Slide 69
  • Slide 70
  • Slide 71
  • Slide 72
  • Slide 73
  • Slide 74
  • Slide 75
  • Slide 76
  • Slide 77
  • Slide 78
  • Slide 79
  • Slide 80
  • Slide 81
  • Slide 82
  • Slide 83
  • Slide 84
  • Slide 85
  • Slide 86
  • Slide 87
  • Slide 88
  • Slide 89
  • Slide 90
  • Slide 91
  • Slide 92
  • Slide 93
  • Slide 94
  • Slide 95
  • Slide 96
  • Slide 97
  • Slide 98
  • Slide 99
  • Slide 100
  • Slide 101
  • Slide 102
  • Slide 103
  • Slide 104
  • Slide 105
  • Slide 106
  • Slide 107
  • Slide 108
  • Slide 109
  • Slide 110
  • Slide 111
  • Slide 112
  • Slide 113
  • Slide 114
  • Slide 115
  • Slide 116
  • Slide 117
  • Slide 118
Page 25: TUTORIAL Ethernet PLC's Improve Oxygen Consumption ISA Expo/2001Houston, Texas Water & Wastewater Industry DivisionTuesday, September 11, 2001 1 Brad.

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 25

The following control levels are available for the Recycle flow

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 27

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 28

The following control levels are available for the PD Blowers Timed Mode

Dissolved Oxygen Mode

Manual Mode

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

Motor Popup

The following information is available for each motor control from the respective motor popup

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

Aerator Control Motor Popup

Like all motors the following information is available for the Aerator motor control from the motor popup

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 32

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 33

Motor Popup Surface Aerator Control

The following information is available for motor control from the motor popup

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 35

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 36

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 37

Lower Explosive Level (LEL)

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 38

Each train has a digital input that tells whether thecombustible 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 (LEL) system

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 39

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 Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 40

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 41

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 Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 42

Like a DCS

middot 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

middot 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 amp CASCADE amp RATIO PID WITH AUTO amp RATIO Digin Motor Status DigOut Motor (or Digital Composite) Motor with ILock and Perm Numeric Set Timers Alarm Detail and Alarm Tags

middot A single generic trend display to trend ALL trendable (archived) points

Alarm Management

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

middot A Distributed Alarm Summary has been used to give better alarm management tools

bull Up to eight trend pens on the trend display

bull The operator picks which values to trend by clicking in the center of the trend

display

bull 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 44

The AnoxicOxic 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 Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 46

The following control levels are available for Oxygen1 Cascade from Dissolved Oxygen

2 Ratio from Discharge flow3 Auto-Manual Control

The following control levels are available for the Recycle flow1 Ratio from Discharge flow

2 Auto-Manual Control

The following control levels are available for the PD Blowers3 Timed Mode

2 Dissolved Oxygen Mode3 Manual Mode

Conclusions

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 47

Following the commissioning of the ethernet-based PLCs Oxygen consumption was significantly reduced

The advanced controls allow the operators to leave the process alone and continue to optimally treat the sewage

Conclusions

Following the commissioning of the ethernet-based PLCs AnoxicOxic 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 Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 48

Summary

The PD Blowers ran in Timed Mode andor 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

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 Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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 Authoritys 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 50

TUTORIAL

Part 2A

PLC Programming Basics

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 51

Separate parts of the process have been organized into a separate ldquoSECTIONrdquo

PLC Program Organization

Each ldquoSECTIONrdquo can be any of the IEC programming types

bull Ladder (LD)bull Structured Text (ST)

bull Instruction List (IL)

bull Function Blocks (FB)bull Sequential Function Charts (SFC)

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 52

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 53

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 54

IO Map

On-Line PLC Diagnostics

PLC Status

PLC Simulator

Ethernet (TCPIP) Address

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 55

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 56

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 57

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 58

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 59

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 60

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 61

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 62

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 63

Structured Text was used hereNOT Ladder

Programming for Motors

The PLC DOES NOT CAREStructured Text Functions EXACTLY

the same as LadderUse what yoursquore comfortable with

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 64

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 65

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 66

IEC Function Blocks Used Here

Programming for Analogs amp PID

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 67

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 68

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 69

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 70

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 71

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 72

Sequential Function Charts were used here

Higher-Level Control

bull SFCrsquos lend themselves well to (as the name would imply) sequential processes

bull Three Important components in SFCrsquosbull Transitionsbull Stepsbull Jumps

bull The status of the process can be viewed as a flow chart

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 73

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 74

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 75

PLC - HMI Communication

A ldquoPLC Heartbeatrdquo is traditionally used to monitor the PLC - HMI Communication sometimes called ardquoWatchdog Timerrdquo

Call it whatever you want but the PLC amp 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 ldquodiesrdquo then that switch doesnrsquot change state and an alarm alerts the operator

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 76

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 77

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 78

TUTORIAL

Part 2B

HMI Programming

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 79

Ethernet (TCPIP) IO Driver

The Ethernet (TCPIP) IO Driver allows the HMI to communicate with the PLC (In this case the driver is called MBENETEXE)

The PLC has an ethernet module in one of the slots that has a ldquoCAT5RJ-45rdquo 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 ldquoCAT5RJ-45rdquo receptacle for the ethernet cable

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 80

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 81

Operator Screens amp Popup Displays

The display is laid out in 3 sections

bull Upper - Security amp Alarm Windowbull Middle- Main Operator Screens bull Lower - Menu amp Popup Displays

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 82

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 83

Scripting

There are 6 types of ldquoScriptsrdquobull Application Scriptsbull Key Scriptsbull Condition Scriptsbull Data Change Scriptsbull Quick Function Scriptsbull ActiveX Event Scripts

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 84

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 85

Access Names

The ldquoAccess Namesrdquo Must be configured to allow the PLC - HMI communications

Note that the ldquoApplicationTopicrdquo is the same as the IO Driver

The ldquocomputer namerdquo is the name of the PC that the HMI is running on (brad_s_carlberg in this case)

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 86

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 87

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 88

Indirect Tags

ldquoIndirect Tagsrdquo were used here to minimize the number of popup displays

This is especially useful in HMIrsquos with many tags

ONLY 12 popup displays are reused throughout the HMI

This gives the HMI a ldquoDCS-Likerdquo Look amp Feel

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 89

Popup Display TypesThe tag point type determines which popup display to use

Analog InputHIC (or Analog Output)PID (or Analog Composite)

bull PID WITH AUTO amp CASCADE amp RATIObull PID WITH AUTO amp RATIO

Diginbull Motor Status

DigOutMotor (or Digital Composite)

bull Motor with ILock and PermNumericSet TimersAlarm DetailAlarm Tags

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 90

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 91

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 92

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 93

Bars Buttons amp Sliders

By choosing to use indirect tags we complicate the Bar Graphs Buttons amp Sliders in the popup displays

Different scales need to be used for different engineering unit ranges

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 94

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 95

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 96

Popup Displays

The next two pages shows how the individual popup displays use the indirect tags

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 97

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 98

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 99

Adding a ldquoTouch Targetrdquo to a Display

2 Tell which tags to use

3 Tell which popup display to call upWhat kind of point type is it

3 Steps1 Tell which scale to use (if itrsquos an analog point type)

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 100

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 101

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 102

TUTORIAL

Part 2C

Excel Spreadsheets

amp

Visual Basic

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 103

A ldquoCHEAP amp DIRTYrdquo HMI With Excel

The 4 key parameters are

To communicate with the PLCUse brad_s_carlbergmbenet|ANOXIC_OXICrsquoplcregisterrsquo

Excel uses ldquopeeksrdquo amp ldquopokesrdquo to read from amp write to a PLC or HMI

To communicate with the HMIbrad_s_carlbergview|Tagnamersquotagnamersquo

bull computer namebull applicationbull topicbull item

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 104

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 105

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 106

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 107

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 108

Excel Macros

bull ldquoRequestrdquo Macro to read values

bull ldquoPokerdquo Macro to write values

bull A Sample Excel Macro

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 109

Sub PokeMacro()MsgBox ApplicationNetworkTemplatesPathChannel = ApplicationDDEInitiate(app=brad_s_carlbergVIEW topic=Tagname) This opens a DDE channel to ViewApplicationDDEPoke Channel Temperature1 Worksheets(Sheet1)Range(A1) Puts value from R1C1 into Temperature1ApplicationDDEPoke Channel DDEReal Worksheets(Sheet1)Range(A2) Puts value from R1C1 into Temperature1ApplicationDDEPoke Channel DDEInteger Worksheets(Sheet1)Range(A3) Puts value from R1C1 into Temperature1ApplicationDDETerminate Channel This terminates the DDE channelEnd SubSub RequestMacro()Channel = ApplicationDDEInitiate(app=brad_s_carlbergVIEW topic=Tagname) This opens a DDE channel to ViewWorksheets(Sheet1)Range(C4) = ApplicationDDERequest(Channel $Hour)Worksheets(Sheet1)Range(C5) = ApplicationDDERequest(Channel $Minute)Worksheets(Sheet1)Range(C6) = ApplicationDDERequest(Channel $Second)Worksheets(Sheet1)Range(C9) = ApplicationDDERequest(Channel $day)Worksheets(Sheet1)Range(C10) = ApplicationDDERequest(Channel $date)Worksheets(Sheet1)Range(C11) = ApplicationDDERequest(Channel $datestring)Worksheets(Sheet1)Range(C12) = ApplicationDDERequest(Channel $datetime)Worksheets(Sheet1)Range(C13) = ApplicationDDERequest(Channel $date)Worksheets(Sheet1)Range(C14) = ApplicationDDERequest(Channel $month)Worksheets(Sheet1)Range(C15) = ApplicationDDERequest(Channel $year)Worksheets(Sheet1)Range(C16) = ApplicationDDERequest(Channel $time)Worksheets(Sheet1)Range(C17) = ApplicationDDERequest(Channel $timestring)Worksheets(Sheet1)Range(C18) = ApplicationDDERequest(Channel $applicationversion)Worksheets(Sheet1)Range(C19) = ApplicationDDERequest(Channel $startddeconversations)Worksheets(Sheet1)Range(C20) = ApplicationDDERequest(Channel $accesslevel)Worksheets(Sheet1)Range(C21) = ApplicationDDERequest(Channel $alarmlogging)Worksheets(Sheet1)Range(C22) = ApplicationDDERequest(Channel $applicationchanged)Worksheets(Sheet1)Range(C23) = ApplicationDDERequest(Channel $configureusers)Worksheets(Sheet1)Range(C24) = ApplicationDDERequest(Channel $changepassword)Worksheets(Sheet1)Range(C25) = ApplicationDDERequest(Channel $InactivityTimeout)Worksheets(Sheet1)Range(C26) = ApplicationDDERequest(Channel $InactivityWarning)Worksheets(Sheet1)Range(C27) = ApplicationDDERequest(Channel $LogicRunning)Worksheets(Sheet1)Range(C28) = ApplicationDDERequest(Channel $OperatorEntered)Worksheets(Sheet1)Range(C29) = ApplicationDDERequest(Channel $Operator)Worksheets(Sheet1)Range(C30) = ApplicationDDERequest(Channel $PasswordEntered)ApplicationDDETerminate Channel This terminates the DDE channelEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 110

Visual Basic

ldquoRoll Your Ownrdquo HMI - Much More powerful than Excel

Key Parameters computer nameapplication|topicitem

IO Emulator - MBPlusSimulateexe

Can ldquoRead Fromrdquo amp ldquoWrite Tordquo PLC andor HMI

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 111

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 112

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 113

Dim PauseTime Start Finish TotalTime As Integer Declare variables

Private Sub txtAIT_332A_SCALED_Change()On Error GoTo PokeAIT_332AErrortxtAIT_332A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtAIT_332A_SCALEDText = Int((3 Rnd) + 20) Generate random value between 20 and 23txtAIT_332A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtAIT_332A_SCALEDLinkItem = AIT_332A_SCALEDtxtAIT_332A_SCALEDLinkMode = 2txtAIT_332A_SCALEDLinkPoketxtAIT_332A_SCALEDLinkMode = 0 DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total time

PokeAIT_332AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtAIT_332A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 114

Private Sub txtAIT_346A_SCALED_Change()On Error GoTo PokeAIT_346AErrortxtAIT_346A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtAIT_346A_SCALEDText = Int((3 Rnd) + 15) Generate random value between 15 and 18txtAIT_346A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtAIT_346A_SCALEDLinkItem = AIT_346A_SCALEDtxtAIT_346A_SCALEDLinkMode = 2txtAIT_346A_SCALEDLinkPoketxtAIT_346A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeAIT_346AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtAIT_346A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 115

Private Sub txtFIT_321A_SCALED_Change()On Error GoTo PokeFIT_321AErrortxtFIT_321A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtFIT_321A_SCALEDText = Int((10 Rnd) + 120) Generate random value between 120 and 130txtFIT_321A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_321A_SCALEDLinkItem = FIT_321A_SCALEDtxtFIT_321A_SCALEDLinkMode = 2txtFIT_321A_SCALEDLinkPoketxtFIT_321A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total time

PokeFIT_321AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_321A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume Next

End Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 116

Private Sub txtFIT_341A_SCALED_Change()On Error GoTo PokeFIT_341AErrortxtFIT_341A_SCALEDLinkMode = 0 PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTime

txtFIT_341A_SCALEDText = Int((3 Rnd) + 18) Generate random value between 18 and 21

txtFIT_341A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_341A_SCALEDLinkItem = FIT_341A_SCALEDtxtFIT_341A_SCALEDLinkMode = 2txtFIT_341A_SCALEDLinkPoketxtFIT_341A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeFIT_341AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_341A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 117

Private Sub txtFIT_343A_SCALED_Change()On Error GoTo PokeFIT_343AErrortxtFIT_343A_SCALEDLinkMode = 0 PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTime

txtFIT_343A_SCALEDText = Int((1 Rnd) + 3) Generate random value between 3 and 4

txtFIT_343A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_343A_SCALEDLinkItem = FIT_343A_SCALEDtxtFIT_343A_SCALEDLinkMode = 2txtFIT_343A_SCALEDLinkPoketxtFIT_343A_SCALEDLinkMode = 0 DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeFIT_343AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_343A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 118

TUTORIAL

Part 4

Questions

amp

Answers

  • Slide 1
  • Slide 2
  • Slide 3
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Slide 8
  • Slide 9
  • Slide 10
  • Slide 11
  • Slide 12
  • Slide 13
  • Slide 14
  • Slide 15
  • Slide 16
  • Slide 17
  • Slide 18
  • Slide 19
  • Slide 20
  • Slide 21
  • Slide 22
  • Slide 23
  • Slide 24
  • Slide 25
  • Slide 26
  • Slide 27
  • Slide 28
  • Slide 29
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
  • Slide 34
  • Slide 35
  • Slide 36
  • Slide 37
  • Slide 38
  • Slide 39
  • Slide 40
  • Slide 41
  • Slide 42
  • Slide 43
  • Slide 44
  • Slide 45
  • Slide 46
  • Slide 47
  • Slide 48
  • Slide 49
  • Slide 50
  • Slide 51
  • Slide 52
  • Slide 53
  • Slide 54
  • Slide 55
  • Slide 56
  • Slide 57
  • Slide 58
  • Slide 59
  • Slide 60
  • Slide 61
  • Slide 62
  • Slide 63
  • Slide 64
  • Slide 65
  • Slide 66
  • Slide 67
  • Slide 68
  • Slide 69
  • Slide 70
  • Slide 71
  • Slide 72
  • Slide 73
  • Slide 74
  • Slide 75
  • Slide 76
  • Slide 77
  • Slide 78
  • Slide 79
  • Slide 80
  • Slide 81
  • Slide 82
  • Slide 83
  • Slide 84
  • Slide 85
  • Slide 86
  • Slide 87
  • Slide 88
  • Slide 89
  • Slide 90
  • Slide 91
  • Slide 92
  • Slide 93
  • Slide 94
  • Slide 95
  • Slide 96
  • Slide 97
  • Slide 98
  • Slide 99
  • Slide 100
  • Slide 101
  • Slide 102
  • Slide 103
  • Slide 104
  • Slide 105
  • Slide 106
  • Slide 107
  • Slide 108
  • Slide 109
  • Slide 110
  • Slide 111
  • Slide 112
  • Slide 113
  • Slide 114
  • Slide 115
  • Slide 116
  • Slide 117
  • Slide 118
Page 26: TUTORIAL Ethernet PLC's Improve Oxygen Consumption ISA Expo/2001Houston, Texas Water & Wastewater Industry DivisionTuesday, September 11, 2001 1 Brad.

The following control levels are available for the Recycle flow

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 27

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 28

The following control levels are available for the PD Blowers Timed Mode

Dissolved Oxygen Mode

Manual Mode

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

Motor Popup

The following information is available for each motor control from the respective motor popup

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

Aerator Control Motor Popup

Like all motors the following information is available for the Aerator motor control from the motor popup

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 32

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 33

Motor Popup Surface Aerator Control

The following information is available for motor control from the motor popup

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 35

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 36

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 37

Lower Explosive Level (LEL)

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 38

Each train has a digital input that tells whether thecombustible 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 (LEL) system

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 39

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 Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 40

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 41

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 Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 42

Like a DCS

middot 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

middot 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 amp CASCADE amp RATIO PID WITH AUTO amp RATIO Digin Motor Status DigOut Motor (or Digital Composite) Motor with ILock and Perm Numeric Set Timers Alarm Detail and Alarm Tags

middot A single generic trend display to trend ALL trendable (archived) points

Alarm Management

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

middot A Distributed Alarm Summary has been used to give better alarm management tools

bull Up to eight trend pens on the trend display

bull The operator picks which values to trend by clicking in the center of the trend

display

bull 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 44

The AnoxicOxic 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 Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 46

The following control levels are available for Oxygen1 Cascade from Dissolved Oxygen

2 Ratio from Discharge flow3 Auto-Manual Control

The following control levels are available for the Recycle flow1 Ratio from Discharge flow

2 Auto-Manual Control

The following control levels are available for the PD Blowers3 Timed Mode

2 Dissolved Oxygen Mode3 Manual Mode

Conclusions

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 47

Following the commissioning of the ethernet-based PLCs Oxygen consumption was significantly reduced

The advanced controls allow the operators to leave the process alone and continue to optimally treat the sewage

Conclusions

Following the commissioning of the ethernet-based PLCs AnoxicOxic 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 Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 48

Summary

The PD Blowers ran in Timed Mode andor 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

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 Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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 Authoritys 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 50

TUTORIAL

Part 2A

PLC Programming Basics

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 51

Separate parts of the process have been organized into a separate ldquoSECTIONrdquo

PLC Program Organization

Each ldquoSECTIONrdquo can be any of the IEC programming types

bull Ladder (LD)bull Structured Text (ST)

bull Instruction List (IL)

bull Function Blocks (FB)bull Sequential Function Charts (SFC)

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 52

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 53

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 54

IO Map

On-Line PLC Diagnostics

PLC Status

PLC Simulator

Ethernet (TCPIP) Address

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 55

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 56

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 57

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 58

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 59

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 60

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 61

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 62

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 63

Structured Text was used hereNOT Ladder

Programming for Motors

The PLC DOES NOT CAREStructured Text Functions EXACTLY

the same as LadderUse what yoursquore comfortable with

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 64

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 65

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 66

IEC Function Blocks Used Here

Programming for Analogs amp PID

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 67

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 68

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 69

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 70

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 71

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 72

Sequential Function Charts were used here

Higher-Level Control

bull SFCrsquos lend themselves well to (as the name would imply) sequential processes

bull Three Important components in SFCrsquosbull Transitionsbull Stepsbull Jumps

bull The status of the process can be viewed as a flow chart

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 73

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 74

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 75

PLC - HMI Communication

A ldquoPLC Heartbeatrdquo is traditionally used to monitor the PLC - HMI Communication sometimes called ardquoWatchdog Timerrdquo

Call it whatever you want but the PLC amp 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 ldquodiesrdquo then that switch doesnrsquot change state and an alarm alerts the operator

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 76

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 77

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 78

TUTORIAL

Part 2B

HMI Programming

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 79

Ethernet (TCPIP) IO Driver

The Ethernet (TCPIP) IO Driver allows the HMI to communicate with the PLC (In this case the driver is called MBENETEXE)

The PLC has an ethernet module in one of the slots that has a ldquoCAT5RJ-45rdquo 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 ldquoCAT5RJ-45rdquo receptacle for the ethernet cable

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 80

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 81

Operator Screens amp Popup Displays

The display is laid out in 3 sections

bull Upper - Security amp Alarm Windowbull Middle- Main Operator Screens bull Lower - Menu amp Popup Displays

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 82

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 83

Scripting

There are 6 types of ldquoScriptsrdquobull Application Scriptsbull Key Scriptsbull Condition Scriptsbull Data Change Scriptsbull Quick Function Scriptsbull ActiveX Event Scripts

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 84

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 85

Access Names

The ldquoAccess Namesrdquo Must be configured to allow the PLC - HMI communications

Note that the ldquoApplicationTopicrdquo is the same as the IO Driver

The ldquocomputer namerdquo is the name of the PC that the HMI is running on (brad_s_carlberg in this case)

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 86

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 87

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 88

Indirect Tags

ldquoIndirect Tagsrdquo were used here to minimize the number of popup displays

This is especially useful in HMIrsquos with many tags

ONLY 12 popup displays are reused throughout the HMI

This gives the HMI a ldquoDCS-Likerdquo Look amp Feel

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 89

Popup Display TypesThe tag point type determines which popup display to use

Analog InputHIC (or Analog Output)PID (or Analog Composite)

bull PID WITH AUTO amp CASCADE amp RATIObull PID WITH AUTO amp RATIO

Diginbull Motor Status

DigOutMotor (or Digital Composite)

bull Motor with ILock and PermNumericSet TimersAlarm DetailAlarm Tags

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 90

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 91

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 92

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 93

Bars Buttons amp Sliders

By choosing to use indirect tags we complicate the Bar Graphs Buttons amp Sliders in the popup displays

Different scales need to be used for different engineering unit ranges

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 94

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 95

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 96

Popup Displays

The next two pages shows how the individual popup displays use the indirect tags

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 97

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 98

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 99

Adding a ldquoTouch Targetrdquo to a Display

2 Tell which tags to use

3 Tell which popup display to call upWhat kind of point type is it

3 Steps1 Tell which scale to use (if itrsquos an analog point type)

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 100

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 101

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 102

TUTORIAL

Part 2C

Excel Spreadsheets

amp

Visual Basic

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 103

A ldquoCHEAP amp DIRTYrdquo HMI With Excel

The 4 key parameters are

To communicate with the PLCUse brad_s_carlbergmbenet|ANOXIC_OXICrsquoplcregisterrsquo

Excel uses ldquopeeksrdquo amp ldquopokesrdquo to read from amp write to a PLC or HMI

To communicate with the HMIbrad_s_carlbergview|Tagnamersquotagnamersquo

bull computer namebull applicationbull topicbull item

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 104

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 105

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 106

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 107

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 108

Excel Macros

bull ldquoRequestrdquo Macro to read values

bull ldquoPokerdquo Macro to write values

bull A Sample Excel Macro

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 109

Sub PokeMacro()MsgBox ApplicationNetworkTemplatesPathChannel = ApplicationDDEInitiate(app=brad_s_carlbergVIEW topic=Tagname) This opens a DDE channel to ViewApplicationDDEPoke Channel Temperature1 Worksheets(Sheet1)Range(A1) Puts value from R1C1 into Temperature1ApplicationDDEPoke Channel DDEReal Worksheets(Sheet1)Range(A2) Puts value from R1C1 into Temperature1ApplicationDDEPoke Channel DDEInteger Worksheets(Sheet1)Range(A3) Puts value from R1C1 into Temperature1ApplicationDDETerminate Channel This terminates the DDE channelEnd SubSub RequestMacro()Channel = ApplicationDDEInitiate(app=brad_s_carlbergVIEW topic=Tagname) This opens a DDE channel to ViewWorksheets(Sheet1)Range(C4) = ApplicationDDERequest(Channel $Hour)Worksheets(Sheet1)Range(C5) = ApplicationDDERequest(Channel $Minute)Worksheets(Sheet1)Range(C6) = ApplicationDDERequest(Channel $Second)Worksheets(Sheet1)Range(C9) = ApplicationDDERequest(Channel $day)Worksheets(Sheet1)Range(C10) = ApplicationDDERequest(Channel $date)Worksheets(Sheet1)Range(C11) = ApplicationDDERequest(Channel $datestring)Worksheets(Sheet1)Range(C12) = ApplicationDDERequest(Channel $datetime)Worksheets(Sheet1)Range(C13) = ApplicationDDERequest(Channel $date)Worksheets(Sheet1)Range(C14) = ApplicationDDERequest(Channel $month)Worksheets(Sheet1)Range(C15) = ApplicationDDERequest(Channel $year)Worksheets(Sheet1)Range(C16) = ApplicationDDERequest(Channel $time)Worksheets(Sheet1)Range(C17) = ApplicationDDERequest(Channel $timestring)Worksheets(Sheet1)Range(C18) = ApplicationDDERequest(Channel $applicationversion)Worksheets(Sheet1)Range(C19) = ApplicationDDERequest(Channel $startddeconversations)Worksheets(Sheet1)Range(C20) = ApplicationDDERequest(Channel $accesslevel)Worksheets(Sheet1)Range(C21) = ApplicationDDERequest(Channel $alarmlogging)Worksheets(Sheet1)Range(C22) = ApplicationDDERequest(Channel $applicationchanged)Worksheets(Sheet1)Range(C23) = ApplicationDDERequest(Channel $configureusers)Worksheets(Sheet1)Range(C24) = ApplicationDDERequest(Channel $changepassword)Worksheets(Sheet1)Range(C25) = ApplicationDDERequest(Channel $InactivityTimeout)Worksheets(Sheet1)Range(C26) = ApplicationDDERequest(Channel $InactivityWarning)Worksheets(Sheet1)Range(C27) = ApplicationDDERequest(Channel $LogicRunning)Worksheets(Sheet1)Range(C28) = ApplicationDDERequest(Channel $OperatorEntered)Worksheets(Sheet1)Range(C29) = ApplicationDDERequest(Channel $Operator)Worksheets(Sheet1)Range(C30) = ApplicationDDERequest(Channel $PasswordEntered)ApplicationDDETerminate Channel This terminates the DDE channelEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 110

Visual Basic

ldquoRoll Your Ownrdquo HMI - Much More powerful than Excel

Key Parameters computer nameapplication|topicitem

IO Emulator - MBPlusSimulateexe

Can ldquoRead Fromrdquo amp ldquoWrite Tordquo PLC andor HMI

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 111

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 112

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 113

Dim PauseTime Start Finish TotalTime As Integer Declare variables

Private Sub txtAIT_332A_SCALED_Change()On Error GoTo PokeAIT_332AErrortxtAIT_332A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtAIT_332A_SCALEDText = Int((3 Rnd) + 20) Generate random value between 20 and 23txtAIT_332A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtAIT_332A_SCALEDLinkItem = AIT_332A_SCALEDtxtAIT_332A_SCALEDLinkMode = 2txtAIT_332A_SCALEDLinkPoketxtAIT_332A_SCALEDLinkMode = 0 DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total time

PokeAIT_332AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtAIT_332A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 114

Private Sub txtAIT_346A_SCALED_Change()On Error GoTo PokeAIT_346AErrortxtAIT_346A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtAIT_346A_SCALEDText = Int((3 Rnd) + 15) Generate random value between 15 and 18txtAIT_346A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtAIT_346A_SCALEDLinkItem = AIT_346A_SCALEDtxtAIT_346A_SCALEDLinkMode = 2txtAIT_346A_SCALEDLinkPoketxtAIT_346A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeAIT_346AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtAIT_346A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 115

Private Sub txtFIT_321A_SCALED_Change()On Error GoTo PokeFIT_321AErrortxtFIT_321A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtFIT_321A_SCALEDText = Int((10 Rnd) + 120) Generate random value between 120 and 130txtFIT_321A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_321A_SCALEDLinkItem = FIT_321A_SCALEDtxtFIT_321A_SCALEDLinkMode = 2txtFIT_321A_SCALEDLinkPoketxtFIT_321A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total time

PokeFIT_321AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_321A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume Next

End Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 116

Private Sub txtFIT_341A_SCALED_Change()On Error GoTo PokeFIT_341AErrortxtFIT_341A_SCALEDLinkMode = 0 PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTime

txtFIT_341A_SCALEDText = Int((3 Rnd) + 18) Generate random value between 18 and 21

txtFIT_341A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_341A_SCALEDLinkItem = FIT_341A_SCALEDtxtFIT_341A_SCALEDLinkMode = 2txtFIT_341A_SCALEDLinkPoketxtFIT_341A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeFIT_341AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_341A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 117

Private Sub txtFIT_343A_SCALED_Change()On Error GoTo PokeFIT_343AErrortxtFIT_343A_SCALEDLinkMode = 0 PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTime

txtFIT_343A_SCALEDText = Int((1 Rnd) + 3) Generate random value between 3 and 4

txtFIT_343A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_343A_SCALEDLinkItem = FIT_343A_SCALEDtxtFIT_343A_SCALEDLinkMode = 2txtFIT_343A_SCALEDLinkPoketxtFIT_343A_SCALEDLinkMode = 0 DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeFIT_343AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_343A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 118

TUTORIAL

Part 4

Questions

amp

Answers

  • Slide 1
  • Slide 2
  • Slide 3
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Slide 8
  • Slide 9
  • Slide 10
  • Slide 11
  • Slide 12
  • Slide 13
  • Slide 14
  • Slide 15
  • Slide 16
  • Slide 17
  • Slide 18
  • Slide 19
  • Slide 20
  • Slide 21
  • Slide 22
  • Slide 23
  • Slide 24
  • Slide 25
  • Slide 26
  • Slide 27
  • Slide 28
  • Slide 29
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
  • Slide 34
  • Slide 35
  • Slide 36
  • Slide 37
  • Slide 38
  • Slide 39
  • Slide 40
  • Slide 41
  • Slide 42
  • Slide 43
  • Slide 44
  • Slide 45
  • Slide 46
  • Slide 47
  • Slide 48
  • Slide 49
  • Slide 50
  • Slide 51
  • Slide 52
  • Slide 53
  • Slide 54
  • Slide 55
  • Slide 56
  • Slide 57
  • Slide 58
  • Slide 59
  • Slide 60
  • Slide 61
  • Slide 62
  • Slide 63
  • Slide 64
  • Slide 65
  • Slide 66
  • Slide 67
  • Slide 68
  • Slide 69
  • Slide 70
  • Slide 71
  • Slide 72
  • Slide 73
  • Slide 74
  • Slide 75
  • Slide 76
  • Slide 77
  • Slide 78
  • Slide 79
  • Slide 80
  • Slide 81
  • Slide 82
  • Slide 83
  • Slide 84
  • Slide 85
  • Slide 86
  • Slide 87
  • Slide 88
  • Slide 89
  • Slide 90
  • Slide 91
  • Slide 92
  • Slide 93
  • Slide 94
  • Slide 95
  • Slide 96
  • Slide 97
  • Slide 98
  • Slide 99
  • Slide 100
  • Slide 101
  • Slide 102
  • Slide 103
  • Slide 104
  • Slide 105
  • Slide 106
  • Slide 107
  • Slide 108
  • Slide 109
  • Slide 110
  • Slide 111
  • Slide 112
  • Slide 113
  • Slide 114
  • Slide 115
  • Slide 116
  • Slide 117
  • Slide 118
Page 27: TUTORIAL Ethernet PLC's Improve Oxygen Consumption ISA Expo/2001Houston, Texas Water & Wastewater Industry DivisionTuesday, September 11, 2001 1 Brad.

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 27

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 28

The following control levels are available for the PD Blowers Timed Mode

Dissolved Oxygen Mode

Manual Mode

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

Motor Popup

The following information is available for each motor control from the respective motor popup

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

Aerator Control Motor Popup

Like all motors the following information is available for the Aerator motor control from the motor popup

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 32

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 33

Motor Popup Surface Aerator Control

The following information is available for motor control from the motor popup

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 35

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 36

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 37

Lower Explosive Level (LEL)

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 38

Each train has a digital input that tells whether thecombustible 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 (LEL) system

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 39

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 Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 40

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 41

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 Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 42

Like a DCS

middot 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

middot 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 amp CASCADE amp RATIO PID WITH AUTO amp RATIO Digin Motor Status DigOut Motor (or Digital Composite) Motor with ILock and Perm Numeric Set Timers Alarm Detail and Alarm Tags

middot A single generic trend display to trend ALL trendable (archived) points

Alarm Management

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

middot A Distributed Alarm Summary has been used to give better alarm management tools

bull Up to eight trend pens on the trend display

bull The operator picks which values to trend by clicking in the center of the trend

display

bull 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 44

The AnoxicOxic 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 Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 46

The following control levels are available for Oxygen1 Cascade from Dissolved Oxygen

2 Ratio from Discharge flow3 Auto-Manual Control

The following control levels are available for the Recycle flow1 Ratio from Discharge flow

2 Auto-Manual Control

The following control levels are available for the PD Blowers3 Timed Mode

2 Dissolved Oxygen Mode3 Manual Mode

Conclusions

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 47

Following the commissioning of the ethernet-based PLCs Oxygen consumption was significantly reduced

The advanced controls allow the operators to leave the process alone and continue to optimally treat the sewage

Conclusions

Following the commissioning of the ethernet-based PLCs AnoxicOxic 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 Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 48

Summary

The PD Blowers ran in Timed Mode andor 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

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 Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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 Authoritys 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 50

TUTORIAL

Part 2A

PLC Programming Basics

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 51

Separate parts of the process have been organized into a separate ldquoSECTIONrdquo

PLC Program Organization

Each ldquoSECTIONrdquo can be any of the IEC programming types

bull Ladder (LD)bull Structured Text (ST)

bull Instruction List (IL)

bull Function Blocks (FB)bull Sequential Function Charts (SFC)

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 52

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 53

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 54

IO Map

On-Line PLC Diagnostics

PLC Status

PLC Simulator

Ethernet (TCPIP) Address

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 55

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 56

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 57

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 58

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 59

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 60

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 61

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 62

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 63

Structured Text was used hereNOT Ladder

Programming for Motors

The PLC DOES NOT CAREStructured Text Functions EXACTLY

the same as LadderUse what yoursquore comfortable with

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 64

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 65

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 66

IEC Function Blocks Used Here

Programming for Analogs amp PID

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 67

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 68

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 69

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 70

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 71

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 72

Sequential Function Charts were used here

Higher-Level Control

bull SFCrsquos lend themselves well to (as the name would imply) sequential processes

bull Three Important components in SFCrsquosbull Transitionsbull Stepsbull Jumps

bull The status of the process can be viewed as a flow chart

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 73

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 74

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 75

PLC - HMI Communication

A ldquoPLC Heartbeatrdquo is traditionally used to monitor the PLC - HMI Communication sometimes called ardquoWatchdog Timerrdquo

Call it whatever you want but the PLC amp 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 ldquodiesrdquo then that switch doesnrsquot change state and an alarm alerts the operator

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 76

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 77

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 78

TUTORIAL

Part 2B

HMI Programming

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 79

Ethernet (TCPIP) IO Driver

The Ethernet (TCPIP) IO Driver allows the HMI to communicate with the PLC (In this case the driver is called MBENETEXE)

The PLC has an ethernet module in one of the slots that has a ldquoCAT5RJ-45rdquo 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 ldquoCAT5RJ-45rdquo receptacle for the ethernet cable

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 80

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 81

Operator Screens amp Popup Displays

The display is laid out in 3 sections

bull Upper - Security amp Alarm Windowbull Middle- Main Operator Screens bull Lower - Menu amp Popup Displays

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 82

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 83

Scripting

There are 6 types of ldquoScriptsrdquobull Application Scriptsbull Key Scriptsbull Condition Scriptsbull Data Change Scriptsbull Quick Function Scriptsbull ActiveX Event Scripts

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 84

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 85

Access Names

The ldquoAccess Namesrdquo Must be configured to allow the PLC - HMI communications

Note that the ldquoApplicationTopicrdquo is the same as the IO Driver

The ldquocomputer namerdquo is the name of the PC that the HMI is running on (brad_s_carlberg in this case)

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 86

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 87

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 88

Indirect Tags

ldquoIndirect Tagsrdquo were used here to minimize the number of popup displays

This is especially useful in HMIrsquos with many tags

ONLY 12 popup displays are reused throughout the HMI

This gives the HMI a ldquoDCS-Likerdquo Look amp Feel

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 89

Popup Display TypesThe tag point type determines which popup display to use

Analog InputHIC (or Analog Output)PID (or Analog Composite)

bull PID WITH AUTO amp CASCADE amp RATIObull PID WITH AUTO amp RATIO

Diginbull Motor Status

DigOutMotor (or Digital Composite)

bull Motor with ILock and PermNumericSet TimersAlarm DetailAlarm Tags

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 90

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 91

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 92

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 93

Bars Buttons amp Sliders

By choosing to use indirect tags we complicate the Bar Graphs Buttons amp Sliders in the popup displays

Different scales need to be used for different engineering unit ranges

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 94

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 95

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 96

Popup Displays

The next two pages shows how the individual popup displays use the indirect tags

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 97

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 98

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 99

Adding a ldquoTouch Targetrdquo to a Display

2 Tell which tags to use

3 Tell which popup display to call upWhat kind of point type is it

3 Steps1 Tell which scale to use (if itrsquos an analog point type)

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 100

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 101

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 102

TUTORIAL

Part 2C

Excel Spreadsheets

amp

Visual Basic

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 103

A ldquoCHEAP amp DIRTYrdquo HMI With Excel

The 4 key parameters are

To communicate with the PLCUse brad_s_carlbergmbenet|ANOXIC_OXICrsquoplcregisterrsquo

Excel uses ldquopeeksrdquo amp ldquopokesrdquo to read from amp write to a PLC or HMI

To communicate with the HMIbrad_s_carlbergview|Tagnamersquotagnamersquo

bull computer namebull applicationbull topicbull item

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 104

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 105

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 106

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 107

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 108

Excel Macros

bull ldquoRequestrdquo Macro to read values

bull ldquoPokerdquo Macro to write values

bull A Sample Excel Macro

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 109

Sub PokeMacro()MsgBox ApplicationNetworkTemplatesPathChannel = ApplicationDDEInitiate(app=brad_s_carlbergVIEW topic=Tagname) This opens a DDE channel to ViewApplicationDDEPoke Channel Temperature1 Worksheets(Sheet1)Range(A1) Puts value from R1C1 into Temperature1ApplicationDDEPoke Channel DDEReal Worksheets(Sheet1)Range(A2) Puts value from R1C1 into Temperature1ApplicationDDEPoke Channel DDEInteger Worksheets(Sheet1)Range(A3) Puts value from R1C1 into Temperature1ApplicationDDETerminate Channel This terminates the DDE channelEnd SubSub RequestMacro()Channel = ApplicationDDEInitiate(app=brad_s_carlbergVIEW topic=Tagname) This opens a DDE channel to ViewWorksheets(Sheet1)Range(C4) = ApplicationDDERequest(Channel $Hour)Worksheets(Sheet1)Range(C5) = ApplicationDDERequest(Channel $Minute)Worksheets(Sheet1)Range(C6) = ApplicationDDERequest(Channel $Second)Worksheets(Sheet1)Range(C9) = ApplicationDDERequest(Channel $day)Worksheets(Sheet1)Range(C10) = ApplicationDDERequest(Channel $date)Worksheets(Sheet1)Range(C11) = ApplicationDDERequest(Channel $datestring)Worksheets(Sheet1)Range(C12) = ApplicationDDERequest(Channel $datetime)Worksheets(Sheet1)Range(C13) = ApplicationDDERequest(Channel $date)Worksheets(Sheet1)Range(C14) = ApplicationDDERequest(Channel $month)Worksheets(Sheet1)Range(C15) = ApplicationDDERequest(Channel $year)Worksheets(Sheet1)Range(C16) = ApplicationDDERequest(Channel $time)Worksheets(Sheet1)Range(C17) = ApplicationDDERequest(Channel $timestring)Worksheets(Sheet1)Range(C18) = ApplicationDDERequest(Channel $applicationversion)Worksheets(Sheet1)Range(C19) = ApplicationDDERequest(Channel $startddeconversations)Worksheets(Sheet1)Range(C20) = ApplicationDDERequest(Channel $accesslevel)Worksheets(Sheet1)Range(C21) = ApplicationDDERequest(Channel $alarmlogging)Worksheets(Sheet1)Range(C22) = ApplicationDDERequest(Channel $applicationchanged)Worksheets(Sheet1)Range(C23) = ApplicationDDERequest(Channel $configureusers)Worksheets(Sheet1)Range(C24) = ApplicationDDERequest(Channel $changepassword)Worksheets(Sheet1)Range(C25) = ApplicationDDERequest(Channel $InactivityTimeout)Worksheets(Sheet1)Range(C26) = ApplicationDDERequest(Channel $InactivityWarning)Worksheets(Sheet1)Range(C27) = ApplicationDDERequest(Channel $LogicRunning)Worksheets(Sheet1)Range(C28) = ApplicationDDERequest(Channel $OperatorEntered)Worksheets(Sheet1)Range(C29) = ApplicationDDERequest(Channel $Operator)Worksheets(Sheet1)Range(C30) = ApplicationDDERequest(Channel $PasswordEntered)ApplicationDDETerminate Channel This terminates the DDE channelEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 110

Visual Basic

ldquoRoll Your Ownrdquo HMI - Much More powerful than Excel

Key Parameters computer nameapplication|topicitem

IO Emulator - MBPlusSimulateexe

Can ldquoRead Fromrdquo amp ldquoWrite Tordquo PLC andor HMI

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 111

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 112

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 113

Dim PauseTime Start Finish TotalTime As Integer Declare variables

Private Sub txtAIT_332A_SCALED_Change()On Error GoTo PokeAIT_332AErrortxtAIT_332A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtAIT_332A_SCALEDText = Int((3 Rnd) + 20) Generate random value between 20 and 23txtAIT_332A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtAIT_332A_SCALEDLinkItem = AIT_332A_SCALEDtxtAIT_332A_SCALEDLinkMode = 2txtAIT_332A_SCALEDLinkPoketxtAIT_332A_SCALEDLinkMode = 0 DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total time

PokeAIT_332AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtAIT_332A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 114

Private Sub txtAIT_346A_SCALED_Change()On Error GoTo PokeAIT_346AErrortxtAIT_346A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtAIT_346A_SCALEDText = Int((3 Rnd) + 15) Generate random value between 15 and 18txtAIT_346A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtAIT_346A_SCALEDLinkItem = AIT_346A_SCALEDtxtAIT_346A_SCALEDLinkMode = 2txtAIT_346A_SCALEDLinkPoketxtAIT_346A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeAIT_346AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtAIT_346A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 115

Private Sub txtFIT_321A_SCALED_Change()On Error GoTo PokeFIT_321AErrortxtFIT_321A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtFIT_321A_SCALEDText = Int((10 Rnd) + 120) Generate random value between 120 and 130txtFIT_321A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_321A_SCALEDLinkItem = FIT_321A_SCALEDtxtFIT_321A_SCALEDLinkMode = 2txtFIT_321A_SCALEDLinkPoketxtFIT_321A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total time

PokeFIT_321AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_321A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume Next

End Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 116

Private Sub txtFIT_341A_SCALED_Change()On Error GoTo PokeFIT_341AErrortxtFIT_341A_SCALEDLinkMode = 0 PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTime

txtFIT_341A_SCALEDText = Int((3 Rnd) + 18) Generate random value between 18 and 21

txtFIT_341A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_341A_SCALEDLinkItem = FIT_341A_SCALEDtxtFIT_341A_SCALEDLinkMode = 2txtFIT_341A_SCALEDLinkPoketxtFIT_341A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeFIT_341AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_341A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 117

Private Sub txtFIT_343A_SCALED_Change()On Error GoTo PokeFIT_343AErrortxtFIT_343A_SCALEDLinkMode = 0 PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTime

txtFIT_343A_SCALEDText = Int((1 Rnd) + 3) Generate random value between 3 and 4

txtFIT_343A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_343A_SCALEDLinkItem = FIT_343A_SCALEDtxtFIT_343A_SCALEDLinkMode = 2txtFIT_343A_SCALEDLinkPoketxtFIT_343A_SCALEDLinkMode = 0 DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeFIT_343AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_343A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 118

TUTORIAL

Part 4

Questions

amp

Answers

  • Slide 1
  • Slide 2
  • Slide 3
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Slide 8
  • Slide 9
  • Slide 10
  • Slide 11
  • Slide 12
  • Slide 13
  • Slide 14
  • Slide 15
  • Slide 16
  • Slide 17
  • Slide 18
  • Slide 19
  • Slide 20
  • Slide 21
  • Slide 22
  • Slide 23
  • Slide 24
  • Slide 25
  • Slide 26
  • Slide 27
  • Slide 28
  • Slide 29
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
  • Slide 34
  • Slide 35
  • Slide 36
  • Slide 37
  • Slide 38
  • Slide 39
  • Slide 40
  • Slide 41
  • Slide 42
  • Slide 43
  • Slide 44
  • Slide 45
  • Slide 46
  • Slide 47
  • Slide 48
  • Slide 49
  • Slide 50
  • Slide 51
  • Slide 52
  • Slide 53
  • Slide 54
  • Slide 55
  • Slide 56
  • Slide 57
  • Slide 58
  • Slide 59
  • Slide 60
  • Slide 61
  • Slide 62
  • Slide 63
  • Slide 64
  • Slide 65
  • Slide 66
  • Slide 67
  • Slide 68
  • Slide 69
  • Slide 70
  • Slide 71
  • Slide 72
  • Slide 73
  • Slide 74
  • Slide 75
  • Slide 76
  • Slide 77
  • Slide 78
  • Slide 79
  • Slide 80
  • Slide 81
  • Slide 82
  • Slide 83
  • Slide 84
  • Slide 85
  • Slide 86
  • Slide 87
  • Slide 88
  • Slide 89
  • Slide 90
  • Slide 91
  • Slide 92
  • Slide 93
  • Slide 94
  • Slide 95
  • Slide 96
  • Slide 97
  • Slide 98
  • Slide 99
  • Slide 100
  • Slide 101
  • Slide 102
  • Slide 103
  • Slide 104
  • Slide 105
  • Slide 106
  • Slide 107
  • Slide 108
  • Slide 109
  • Slide 110
  • Slide 111
  • Slide 112
  • Slide 113
  • Slide 114
  • Slide 115
  • Slide 116
  • Slide 117
  • Slide 118
Page 28: TUTORIAL Ethernet PLC's Improve Oxygen Consumption ISA Expo/2001Houston, Texas Water & Wastewater Industry DivisionTuesday, September 11, 2001 1 Brad.

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 28

The following control levels are available for the PD Blowers Timed Mode

Dissolved Oxygen Mode

Manual Mode

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

Motor Popup

The following information is available for each motor control from the respective motor popup

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

Aerator Control Motor Popup

Like all motors the following information is available for the Aerator motor control from the motor popup

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 32

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 33

Motor Popup Surface Aerator Control

The following information is available for motor control from the motor popup

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 35

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 36

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 37

Lower Explosive Level (LEL)

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 38

Each train has a digital input that tells whether thecombustible 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 (LEL) system

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 39

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 Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 40

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 41

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 Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 42

Like a DCS

middot 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

middot 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 amp CASCADE amp RATIO PID WITH AUTO amp RATIO Digin Motor Status DigOut Motor (or Digital Composite) Motor with ILock and Perm Numeric Set Timers Alarm Detail and Alarm Tags

middot A single generic trend display to trend ALL trendable (archived) points

Alarm Management

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

middot A Distributed Alarm Summary has been used to give better alarm management tools

bull Up to eight trend pens on the trend display

bull The operator picks which values to trend by clicking in the center of the trend

display

bull 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 44

The AnoxicOxic 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 Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 46

The following control levels are available for Oxygen1 Cascade from Dissolved Oxygen

2 Ratio from Discharge flow3 Auto-Manual Control

The following control levels are available for the Recycle flow1 Ratio from Discharge flow

2 Auto-Manual Control

The following control levels are available for the PD Blowers3 Timed Mode

2 Dissolved Oxygen Mode3 Manual Mode

Conclusions

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 47

Following the commissioning of the ethernet-based PLCs Oxygen consumption was significantly reduced

The advanced controls allow the operators to leave the process alone and continue to optimally treat the sewage

Conclusions

Following the commissioning of the ethernet-based PLCs AnoxicOxic 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 Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 48

Summary

The PD Blowers ran in Timed Mode andor 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

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 Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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 Authoritys 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 50

TUTORIAL

Part 2A

PLC Programming Basics

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 51

Separate parts of the process have been organized into a separate ldquoSECTIONrdquo

PLC Program Organization

Each ldquoSECTIONrdquo can be any of the IEC programming types

bull Ladder (LD)bull Structured Text (ST)

bull Instruction List (IL)

bull Function Blocks (FB)bull Sequential Function Charts (SFC)

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 52

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 53

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 54

IO Map

On-Line PLC Diagnostics

PLC Status

PLC Simulator

Ethernet (TCPIP) Address

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 55

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 56

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 57

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 58

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 59

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 60

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 61

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 62

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 63

Structured Text was used hereNOT Ladder

Programming for Motors

The PLC DOES NOT CAREStructured Text Functions EXACTLY

the same as LadderUse what yoursquore comfortable with

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 64

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 65

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 66

IEC Function Blocks Used Here

Programming for Analogs amp PID

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 67

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 68

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 69

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 70

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 71

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 72

Sequential Function Charts were used here

Higher-Level Control

bull SFCrsquos lend themselves well to (as the name would imply) sequential processes

bull Three Important components in SFCrsquosbull Transitionsbull Stepsbull Jumps

bull The status of the process can be viewed as a flow chart

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 73

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 74

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 75

PLC - HMI Communication

A ldquoPLC Heartbeatrdquo is traditionally used to monitor the PLC - HMI Communication sometimes called ardquoWatchdog Timerrdquo

Call it whatever you want but the PLC amp 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 ldquodiesrdquo then that switch doesnrsquot change state and an alarm alerts the operator

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 76

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 77

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 78

TUTORIAL

Part 2B

HMI Programming

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 79

Ethernet (TCPIP) IO Driver

The Ethernet (TCPIP) IO Driver allows the HMI to communicate with the PLC (In this case the driver is called MBENETEXE)

The PLC has an ethernet module in one of the slots that has a ldquoCAT5RJ-45rdquo 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 ldquoCAT5RJ-45rdquo receptacle for the ethernet cable

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 80

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 81

Operator Screens amp Popup Displays

The display is laid out in 3 sections

bull Upper - Security amp Alarm Windowbull Middle- Main Operator Screens bull Lower - Menu amp Popup Displays

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 82

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 83

Scripting

There are 6 types of ldquoScriptsrdquobull Application Scriptsbull Key Scriptsbull Condition Scriptsbull Data Change Scriptsbull Quick Function Scriptsbull ActiveX Event Scripts

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 84

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 85

Access Names

The ldquoAccess Namesrdquo Must be configured to allow the PLC - HMI communications

Note that the ldquoApplicationTopicrdquo is the same as the IO Driver

The ldquocomputer namerdquo is the name of the PC that the HMI is running on (brad_s_carlberg in this case)

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 86

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 87

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 88

Indirect Tags

ldquoIndirect Tagsrdquo were used here to minimize the number of popup displays

This is especially useful in HMIrsquos with many tags

ONLY 12 popup displays are reused throughout the HMI

This gives the HMI a ldquoDCS-Likerdquo Look amp Feel

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 89

Popup Display TypesThe tag point type determines which popup display to use

Analog InputHIC (or Analog Output)PID (or Analog Composite)

bull PID WITH AUTO amp CASCADE amp RATIObull PID WITH AUTO amp RATIO

Diginbull Motor Status

DigOutMotor (or Digital Composite)

bull Motor with ILock and PermNumericSet TimersAlarm DetailAlarm Tags

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 90

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 91

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 92

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 93

Bars Buttons amp Sliders

By choosing to use indirect tags we complicate the Bar Graphs Buttons amp Sliders in the popup displays

Different scales need to be used for different engineering unit ranges

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 94

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 95

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 96

Popup Displays

The next two pages shows how the individual popup displays use the indirect tags

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 97

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 98

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 99

Adding a ldquoTouch Targetrdquo to a Display

2 Tell which tags to use

3 Tell which popup display to call upWhat kind of point type is it

3 Steps1 Tell which scale to use (if itrsquos an analog point type)

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 100

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 101

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 102

TUTORIAL

Part 2C

Excel Spreadsheets

amp

Visual Basic

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 103

A ldquoCHEAP amp DIRTYrdquo HMI With Excel

The 4 key parameters are

To communicate with the PLCUse brad_s_carlbergmbenet|ANOXIC_OXICrsquoplcregisterrsquo

Excel uses ldquopeeksrdquo amp ldquopokesrdquo to read from amp write to a PLC or HMI

To communicate with the HMIbrad_s_carlbergview|Tagnamersquotagnamersquo

bull computer namebull applicationbull topicbull item

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 104

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 105

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 106

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 107

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 108

Excel Macros

bull ldquoRequestrdquo Macro to read values

bull ldquoPokerdquo Macro to write values

bull A Sample Excel Macro

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 109

Sub PokeMacro()MsgBox ApplicationNetworkTemplatesPathChannel = ApplicationDDEInitiate(app=brad_s_carlbergVIEW topic=Tagname) This opens a DDE channel to ViewApplicationDDEPoke Channel Temperature1 Worksheets(Sheet1)Range(A1) Puts value from R1C1 into Temperature1ApplicationDDEPoke Channel DDEReal Worksheets(Sheet1)Range(A2) Puts value from R1C1 into Temperature1ApplicationDDEPoke Channel DDEInteger Worksheets(Sheet1)Range(A3) Puts value from R1C1 into Temperature1ApplicationDDETerminate Channel This terminates the DDE channelEnd SubSub RequestMacro()Channel = ApplicationDDEInitiate(app=brad_s_carlbergVIEW topic=Tagname) This opens a DDE channel to ViewWorksheets(Sheet1)Range(C4) = ApplicationDDERequest(Channel $Hour)Worksheets(Sheet1)Range(C5) = ApplicationDDERequest(Channel $Minute)Worksheets(Sheet1)Range(C6) = ApplicationDDERequest(Channel $Second)Worksheets(Sheet1)Range(C9) = ApplicationDDERequest(Channel $day)Worksheets(Sheet1)Range(C10) = ApplicationDDERequest(Channel $date)Worksheets(Sheet1)Range(C11) = ApplicationDDERequest(Channel $datestring)Worksheets(Sheet1)Range(C12) = ApplicationDDERequest(Channel $datetime)Worksheets(Sheet1)Range(C13) = ApplicationDDERequest(Channel $date)Worksheets(Sheet1)Range(C14) = ApplicationDDERequest(Channel $month)Worksheets(Sheet1)Range(C15) = ApplicationDDERequest(Channel $year)Worksheets(Sheet1)Range(C16) = ApplicationDDERequest(Channel $time)Worksheets(Sheet1)Range(C17) = ApplicationDDERequest(Channel $timestring)Worksheets(Sheet1)Range(C18) = ApplicationDDERequest(Channel $applicationversion)Worksheets(Sheet1)Range(C19) = ApplicationDDERequest(Channel $startddeconversations)Worksheets(Sheet1)Range(C20) = ApplicationDDERequest(Channel $accesslevel)Worksheets(Sheet1)Range(C21) = ApplicationDDERequest(Channel $alarmlogging)Worksheets(Sheet1)Range(C22) = ApplicationDDERequest(Channel $applicationchanged)Worksheets(Sheet1)Range(C23) = ApplicationDDERequest(Channel $configureusers)Worksheets(Sheet1)Range(C24) = ApplicationDDERequest(Channel $changepassword)Worksheets(Sheet1)Range(C25) = ApplicationDDERequest(Channel $InactivityTimeout)Worksheets(Sheet1)Range(C26) = ApplicationDDERequest(Channel $InactivityWarning)Worksheets(Sheet1)Range(C27) = ApplicationDDERequest(Channel $LogicRunning)Worksheets(Sheet1)Range(C28) = ApplicationDDERequest(Channel $OperatorEntered)Worksheets(Sheet1)Range(C29) = ApplicationDDERequest(Channel $Operator)Worksheets(Sheet1)Range(C30) = ApplicationDDERequest(Channel $PasswordEntered)ApplicationDDETerminate Channel This terminates the DDE channelEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 110

Visual Basic

ldquoRoll Your Ownrdquo HMI - Much More powerful than Excel

Key Parameters computer nameapplication|topicitem

IO Emulator - MBPlusSimulateexe

Can ldquoRead Fromrdquo amp ldquoWrite Tordquo PLC andor HMI

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 111

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 112

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 113

Dim PauseTime Start Finish TotalTime As Integer Declare variables

Private Sub txtAIT_332A_SCALED_Change()On Error GoTo PokeAIT_332AErrortxtAIT_332A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtAIT_332A_SCALEDText = Int((3 Rnd) + 20) Generate random value between 20 and 23txtAIT_332A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtAIT_332A_SCALEDLinkItem = AIT_332A_SCALEDtxtAIT_332A_SCALEDLinkMode = 2txtAIT_332A_SCALEDLinkPoketxtAIT_332A_SCALEDLinkMode = 0 DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total time

PokeAIT_332AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtAIT_332A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 114

Private Sub txtAIT_346A_SCALED_Change()On Error GoTo PokeAIT_346AErrortxtAIT_346A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtAIT_346A_SCALEDText = Int((3 Rnd) + 15) Generate random value between 15 and 18txtAIT_346A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtAIT_346A_SCALEDLinkItem = AIT_346A_SCALEDtxtAIT_346A_SCALEDLinkMode = 2txtAIT_346A_SCALEDLinkPoketxtAIT_346A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeAIT_346AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtAIT_346A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 115

Private Sub txtFIT_321A_SCALED_Change()On Error GoTo PokeFIT_321AErrortxtFIT_321A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtFIT_321A_SCALEDText = Int((10 Rnd) + 120) Generate random value between 120 and 130txtFIT_321A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_321A_SCALEDLinkItem = FIT_321A_SCALEDtxtFIT_321A_SCALEDLinkMode = 2txtFIT_321A_SCALEDLinkPoketxtFIT_321A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total time

PokeFIT_321AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_321A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume Next

End Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 116

Private Sub txtFIT_341A_SCALED_Change()On Error GoTo PokeFIT_341AErrortxtFIT_341A_SCALEDLinkMode = 0 PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTime

txtFIT_341A_SCALEDText = Int((3 Rnd) + 18) Generate random value between 18 and 21

txtFIT_341A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_341A_SCALEDLinkItem = FIT_341A_SCALEDtxtFIT_341A_SCALEDLinkMode = 2txtFIT_341A_SCALEDLinkPoketxtFIT_341A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeFIT_341AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_341A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 117

Private Sub txtFIT_343A_SCALED_Change()On Error GoTo PokeFIT_343AErrortxtFIT_343A_SCALEDLinkMode = 0 PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTime

txtFIT_343A_SCALEDText = Int((1 Rnd) + 3) Generate random value between 3 and 4

txtFIT_343A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_343A_SCALEDLinkItem = FIT_343A_SCALEDtxtFIT_343A_SCALEDLinkMode = 2txtFIT_343A_SCALEDLinkPoketxtFIT_343A_SCALEDLinkMode = 0 DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeFIT_343AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_343A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 118

TUTORIAL

Part 4

Questions

amp

Answers

  • Slide 1
  • Slide 2
  • Slide 3
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Slide 8
  • Slide 9
  • Slide 10
  • Slide 11
  • Slide 12
  • Slide 13
  • Slide 14
  • Slide 15
  • Slide 16
  • Slide 17
  • Slide 18
  • Slide 19
  • Slide 20
  • Slide 21
  • Slide 22
  • Slide 23
  • Slide 24
  • Slide 25
  • Slide 26
  • Slide 27
  • Slide 28
  • Slide 29
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
  • Slide 34
  • Slide 35
  • Slide 36
  • Slide 37
  • Slide 38
  • Slide 39
  • Slide 40
  • Slide 41
  • Slide 42
  • Slide 43
  • Slide 44
  • Slide 45
  • Slide 46
  • Slide 47
  • Slide 48
  • Slide 49
  • Slide 50
  • Slide 51
  • Slide 52
  • Slide 53
  • Slide 54
  • Slide 55
  • Slide 56
  • Slide 57
  • Slide 58
  • Slide 59
  • Slide 60
  • Slide 61
  • Slide 62
  • Slide 63
  • Slide 64
  • Slide 65
  • Slide 66
  • Slide 67
  • Slide 68
  • Slide 69
  • Slide 70
  • Slide 71
  • Slide 72
  • Slide 73
  • Slide 74
  • Slide 75
  • Slide 76
  • Slide 77
  • Slide 78
  • Slide 79
  • Slide 80
  • Slide 81
  • Slide 82
  • Slide 83
  • Slide 84
  • Slide 85
  • Slide 86
  • Slide 87
  • Slide 88
  • Slide 89
  • Slide 90
  • Slide 91
  • Slide 92
  • Slide 93
  • Slide 94
  • Slide 95
  • Slide 96
  • Slide 97
  • Slide 98
  • Slide 99
  • Slide 100
  • Slide 101
  • Slide 102
  • Slide 103
  • Slide 104
  • Slide 105
  • Slide 106
  • Slide 107
  • Slide 108
  • Slide 109
  • Slide 110
  • Slide 111
  • Slide 112
  • Slide 113
  • Slide 114
  • Slide 115
  • Slide 116
  • Slide 117
  • Slide 118
Page 29: TUTORIAL Ethernet PLC's Improve Oxygen Consumption ISA Expo/2001Houston, Texas Water & Wastewater Industry DivisionTuesday, September 11, 2001 1 Brad.

The following control levels are available for the PD Blowers Timed Mode

Dissolved Oxygen Mode

Manual Mode

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

Motor Popup

The following information is available for each motor control from the respective motor popup

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

Aerator Control Motor Popup

Like all motors the following information is available for the Aerator motor control from the motor popup

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 32

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 33

Motor Popup Surface Aerator Control

The following information is available for motor control from the motor popup

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 35

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 36

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 37

Lower Explosive Level (LEL)

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 38

Each train has a digital input that tells whether thecombustible 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 (LEL) system

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 39

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 Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 40

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 41

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 Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 42

Like a DCS

middot 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

middot 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 amp CASCADE amp RATIO PID WITH AUTO amp RATIO Digin Motor Status DigOut Motor (or Digital Composite) Motor with ILock and Perm Numeric Set Timers Alarm Detail and Alarm Tags

middot A single generic trend display to trend ALL trendable (archived) points

Alarm Management

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

middot A Distributed Alarm Summary has been used to give better alarm management tools

bull Up to eight trend pens on the trend display

bull The operator picks which values to trend by clicking in the center of the trend

display

bull 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 44

The AnoxicOxic 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 Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 46

The following control levels are available for Oxygen1 Cascade from Dissolved Oxygen

2 Ratio from Discharge flow3 Auto-Manual Control

The following control levels are available for the Recycle flow1 Ratio from Discharge flow

2 Auto-Manual Control

The following control levels are available for the PD Blowers3 Timed Mode

2 Dissolved Oxygen Mode3 Manual Mode

Conclusions

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 47

Following the commissioning of the ethernet-based PLCs Oxygen consumption was significantly reduced

The advanced controls allow the operators to leave the process alone and continue to optimally treat the sewage

Conclusions

Following the commissioning of the ethernet-based PLCs AnoxicOxic 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 Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 48

Summary

The PD Blowers ran in Timed Mode andor 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

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 Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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 Authoritys 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 50

TUTORIAL

Part 2A

PLC Programming Basics

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 51

Separate parts of the process have been organized into a separate ldquoSECTIONrdquo

PLC Program Organization

Each ldquoSECTIONrdquo can be any of the IEC programming types

bull Ladder (LD)bull Structured Text (ST)

bull Instruction List (IL)

bull Function Blocks (FB)bull Sequential Function Charts (SFC)

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 52

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 53

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 54

IO Map

On-Line PLC Diagnostics

PLC Status

PLC Simulator

Ethernet (TCPIP) Address

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 55

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 56

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 57

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 58

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 59

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 60

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 61

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 62

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 63

Structured Text was used hereNOT Ladder

Programming for Motors

The PLC DOES NOT CAREStructured Text Functions EXACTLY

the same as LadderUse what yoursquore comfortable with

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 64

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 65

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 66

IEC Function Blocks Used Here

Programming for Analogs amp PID

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 67

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 68

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 69

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 70

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 71

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 72

Sequential Function Charts were used here

Higher-Level Control

bull SFCrsquos lend themselves well to (as the name would imply) sequential processes

bull Three Important components in SFCrsquosbull Transitionsbull Stepsbull Jumps

bull The status of the process can be viewed as a flow chart

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 73

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 74

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 75

PLC - HMI Communication

A ldquoPLC Heartbeatrdquo is traditionally used to monitor the PLC - HMI Communication sometimes called ardquoWatchdog Timerrdquo

Call it whatever you want but the PLC amp 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 ldquodiesrdquo then that switch doesnrsquot change state and an alarm alerts the operator

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 76

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 77

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 78

TUTORIAL

Part 2B

HMI Programming

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 79

Ethernet (TCPIP) IO Driver

The Ethernet (TCPIP) IO Driver allows the HMI to communicate with the PLC (In this case the driver is called MBENETEXE)

The PLC has an ethernet module in one of the slots that has a ldquoCAT5RJ-45rdquo 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 ldquoCAT5RJ-45rdquo receptacle for the ethernet cable

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 80

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 81

Operator Screens amp Popup Displays

The display is laid out in 3 sections

bull Upper - Security amp Alarm Windowbull Middle- Main Operator Screens bull Lower - Menu amp Popup Displays

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 82

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 83

Scripting

There are 6 types of ldquoScriptsrdquobull Application Scriptsbull Key Scriptsbull Condition Scriptsbull Data Change Scriptsbull Quick Function Scriptsbull ActiveX Event Scripts

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 84

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 85

Access Names

The ldquoAccess Namesrdquo Must be configured to allow the PLC - HMI communications

Note that the ldquoApplicationTopicrdquo is the same as the IO Driver

The ldquocomputer namerdquo is the name of the PC that the HMI is running on (brad_s_carlberg in this case)

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 86

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 87

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 88

Indirect Tags

ldquoIndirect Tagsrdquo were used here to minimize the number of popup displays

This is especially useful in HMIrsquos with many tags

ONLY 12 popup displays are reused throughout the HMI

This gives the HMI a ldquoDCS-Likerdquo Look amp Feel

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 89

Popup Display TypesThe tag point type determines which popup display to use

Analog InputHIC (or Analog Output)PID (or Analog Composite)

bull PID WITH AUTO amp CASCADE amp RATIObull PID WITH AUTO amp RATIO

Diginbull Motor Status

DigOutMotor (or Digital Composite)

bull Motor with ILock and PermNumericSet TimersAlarm DetailAlarm Tags

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 90

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 91

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 92

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 93

Bars Buttons amp Sliders

By choosing to use indirect tags we complicate the Bar Graphs Buttons amp Sliders in the popup displays

Different scales need to be used for different engineering unit ranges

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 94

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 95

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 96

Popup Displays

The next two pages shows how the individual popup displays use the indirect tags

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 97

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 98

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 99

Adding a ldquoTouch Targetrdquo to a Display

2 Tell which tags to use

3 Tell which popup display to call upWhat kind of point type is it

3 Steps1 Tell which scale to use (if itrsquos an analog point type)

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 100

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 101

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 102

TUTORIAL

Part 2C

Excel Spreadsheets

amp

Visual Basic

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 103

A ldquoCHEAP amp DIRTYrdquo HMI With Excel

The 4 key parameters are

To communicate with the PLCUse brad_s_carlbergmbenet|ANOXIC_OXICrsquoplcregisterrsquo

Excel uses ldquopeeksrdquo amp ldquopokesrdquo to read from amp write to a PLC or HMI

To communicate with the HMIbrad_s_carlbergview|Tagnamersquotagnamersquo

bull computer namebull applicationbull topicbull item

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 104

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 105

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 106

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 107

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 108

Excel Macros

bull ldquoRequestrdquo Macro to read values

bull ldquoPokerdquo Macro to write values

bull A Sample Excel Macro

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 109

Sub PokeMacro()MsgBox ApplicationNetworkTemplatesPathChannel = ApplicationDDEInitiate(app=brad_s_carlbergVIEW topic=Tagname) This opens a DDE channel to ViewApplicationDDEPoke Channel Temperature1 Worksheets(Sheet1)Range(A1) Puts value from R1C1 into Temperature1ApplicationDDEPoke Channel DDEReal Worksheets(Sheet1)Range(A2) Puts value from R1C1 into Temperature1ApplicationDDEPoke Channel DDEInteger Worksheets(Sheet1)Range(A3) Puts value from R1C1 into Temperature1ApplicationDDETerminate Channel This terminates the DDE channelEnd SubSub RequestMacro()Channel = ApplicationDDEInitiate(app=brad_s_carlbergVIEW topic=Tagname) This opens a DDE channel to ViewWorksheets(Sheet1)Range(C4) = ApplicationDDERequest(Channel $Hour)Worksheets(Sheet1)Range(C5) = ApplicationDDERequest(Channel $Minute)Worksheets(Sheet1)Range(C6) = ApplicationDDERequest(Channel $Second)Worksheets(Sheet1)Range(C9) = ApplicationDDERequest(Channel $day)Worksheets(Sheet1)Range(C10) = ApplicationDDERequest(Channel $date)Worksheets(Sheet1)Range(C11) = ApplicationDDERequest(Channel $datestring)Worksheets(Sheet1)Range(C12) = ApplicationDDERequest(Channel $datetime)Worksheets(Sheet1)Range(C13) = ApplicationDDERequest(Channel $date)Worksheets(Sheet1)Range(C14) = ApplicationDDERequest(Channel $month)Worksheets(Sheet1)Range(C15) = ApplicationDDERequest(Channel $year)Worksheets(Sheet1)Range(C16) = ApplicationDDERequest(Channel $time)Worksheets(Sheet1)Range(C17) = ApplicationDDERequest(Channel $timestring)Worksheets(Sheet1)Range(C18) = ApplicationDDERequest(Channel $applicationversion)Worksheets(Sheet1)Range(C19) = ApplicationDDERequest(Channel $startddeconversations)Worksheets(Sheet1)Range(C20) = ApplicationDDERequest(Channel $accesslevel)Worksheets(Sheet1)Range(C21) = ApplicationDDERequest(Channel $alarmlogging)Worksheets(Sheet1)Range(C22) = ApplicationDDERequest(Channel $applicationchanged)Worksheets(Sheet1)Range(C23) = ApplicationDDERequest(Channel $configureusers)Worksheets(Sheet1)Range(C24) = ApplicationDDERequest(Channel $changepassword)Worksheets(Sheet1)Range(C25) = ApplicationDDERequest(Channel $InactivityTimeout)Worksheets(Sheet1)Range(C26) = ApplicationDDERequest(Channel $InactivityWarning)Worksheets(Sheet1)Range(C27) = ApplicationDDERequest(Channel $LogicRunning)Worksheets(Sheet1)Range(C28) = ApplicationDDERequest(Channel $OperatorEntered)Worksheets(Sheet1)Range(C29) = ApplicationDDERequest(Channel $Operator)Worksheets(Sheet1)Range(C30) = ApplicationDDERequest(Channel $PasswordEntered)ApplicationDDETerminate Channel This terminates the DDE channelEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 110

Visual Basic

ldquoRoll Your Ownrdquo HMI - Much More powerful than Excel

Key Parameters computer nameapplication|topicitem

IO Emulator - MBPlusSimulateexe

Can ldquoRead Fromrdquo amp ldquoWrite Tordquo PLC andor HMI

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 111

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 112

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 113

Dim PauseTime Start Finish TotalTime As Integer Declare variables

Private Sub txtAIT_332A_SCALED_Change()On Error GoTo PokeAIT_332AErrortxtAIT_332A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtAIT_332A_SCALEDText = Int((3 Rnd) + 20) Generate random value between 20 and 23txtAIT_332A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtAIT_332A_SCALEDLinkItem = AIT_332A_SCALEDtxtAIT_332A_SCALEDLinkMode = 2txtAIT_332A_SCALEDLinkPoketxtAIT_332A_SCALEDLinkMode = 0 DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total time

PokeAIT_332AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtAIT_332A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 114

Private Sub txtAIT_346A_SCALED_Change()On Error GoTo PokeAIT_346AErrortxtAIT_346A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtAIT_346A_SCALEDText = Int((3 Rnd) + 15) Generate random value between 15 and 18txtAIT_346A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtAIT_346A_SCALEDLinkItem = AIT_346A_SCALEDtxtAIT_346A_SCALEDLinkMode = 2txtAIT_346A_SCALEDLinkPoketxtAIT_346A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeAIT_346AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtAIT_346A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 115

Private Sub txtFIT_321A_SCALED_Change()On Error GoTo PokeFIT_321AErrortxtFIT_321A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtFIT_321A_SCALEDText = Int((10 Rnd) + 120) Generate random value between 120 and 130txtFIT_321A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_321A_SCALEDLinkItem = FIT_321A_SCALEDtxtFIT_321A_SCALEDLinkMode = 2txtFIT_321A_SCALEDLinkPoketxtFIT_321A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total time

PokeFIT_321AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_321A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume Next

End Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 116

Private Sub txtFIT_341A_SCALED_Change()On Error GoTo PokeFIT_341AErrortxtFIT_341A_SCALEDLinkMode = 0 PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTime

txtFIT_341A_SCALEDText = Int((3 Rnd) + 18) Generate random value between 18 and 21

txtFIT_341A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_341A_SCALEDLinkItem = FIT_341A_SCALEDtxtFIT_341A_SCALEDLinkMode = 2txtFIT_341A_SCALEDLinkPoketxtFIT_341A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeFIT_341AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_341A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 117

Private Sub txtFIT_343A_SCALED_Change()On Error GoTo PokeFIT_343AErrortxtFIT_343A_SCALEDLinkMode = 0 PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTime

txtFIT_343A_SCALEDText = Int((1 Rnd) + 3) Generate random value between 3 and 4

txtFIT_343A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_343A_SCALEDLinkItem = FIT_343A_SCALEDtxtFIT_343A_SCALEDLinkMode = 2txtFIT_343A_SCALEDLinkPoketxtFIT_343A_SCALEDLinkMode = 0 DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeFIT_343AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_343A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 118

TUTORIAL

Part 4

Questions

amp

Answers

  • Slide 1
  • Slide 2
  • Slide 3
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Slide 8
  • Slide 9
  • Slide 10
  • Slide 11
  • Slide 12
  • Slide 13
  • Slide 14
  • Slide 15
  • Slide 16
  • Slide 17
  • Slide 18
  • Slide 19
  • Slide 20
  • Slide 21
  • Slide 22
  • Slide 23
  • Slide 24
  • Slide 25
  • Slide 26
  • Slide 27
  • Slide 28
  • Slide 29
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
  • Slide 34
  • Slide 35
  • Slide 36
  • Slide 37
  • Slide 38
  • Slide 39
  • Slide 40
  • Slide 41
  • Slide 42
  • Slide 43
  • Slide 44
  • Slide 45
  • Slide 46
  • Slide 47
  • Slide 48
  • Slide 49
  • Slide 50
  • Slide 51
  • Slide 52
  • Slide 53
  • Slide 54
  • Slide 55
  • Slide 56
  • Slide 57
  • Slide 58
  • Slide 59
  • Slide 60
  • Slide 61
  • Slide 62
  • Slide 63
  • Slide 64
  • Slide 65
  • Slide 66
  • Slide 67
  • Slide 68
  • Slide 69
  • Slide 70
  • Slide 71
  • Slide 72
  • Slide 73
  • Slide 74
  • Slide 75
  • Slide 76
  • Slide 77
  • Slide 78
  • Slide 79
  • Slide 80
  • Slide 81
  • Slide 82
  • Slide 83
  • Slide 84
  • Slide 85
  • Slide 86
  • Slide 87
  • Slide 88
  • Slide 89
  • Slide 90
  • Slide 91
  • Slide 92
  • Slide 93
  • Slide 94
  • Slide 95
  • Slide 96
  • Slide 97
  • Slide 98
  • Slide 99
  • Slide 100
  • Slide 101
  • Slide 102
  • Slide 103
  • Slide 104
  • Slide 105
  • Slide 106
  • Slide 107
  • Slide 108
  • Slide 109
  • Slide 110
  • Slide 111
  • Slide 112
  • Slide 113
  • Slide 114
  • Slide 115
  • Slide 116
  • Slide 117
  • Slide 118
Page 30: TUTORIAL Ethernet PLC's Improve Oxygen Consumption ISA Expo/2001Houston, Texas Water & Wastewater Industry DivisionTuesday, September 11, 2001 1 Brad.

Motor Popup

The following information is available for each motor control from the respective motor popup

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

Aerator Control Motor Popup

Like all motors the following information is available for the Aerator motor control from the motor popup

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 32

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 33

Motor Popup Surface Aerator Control

The following information is available for motor control from the motor popup

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 35

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 36

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 37

Lower Explosive Level (LEL)

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 38

Each train has a digital input that tells whether thecombustible 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 (LEL) system

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 39

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 Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 40

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 41

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 Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 42

Like a DCS

middot 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

middot 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 amp CASCADE amp RATIO PID WITH AUTO amp RATIO Digin Motor Status DigOut Motor (or Digital Composite) Motor with ILock and Perm Numeric Set Timers Alarm Detail and Alarm Tags

middot A single generic trend display to trend ALL trendable (archived) points

Alarm Management

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

middot A Distributed Alarm Summary has been used to give better alarm management tools

bull Up to eight trend pens on the trend display

bull The operator picks which values to trend by clicking in the center of the trend

display

bull 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 44

The AnoxicOxic 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 Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 46

The following control levels are available for Oxygen1 Cascade from Dissolved Oxygen

2 Ratio from Discharge flow3 Auto-Manual Control

The following control levels are available for the Recycle flow1 Ratio from Discharge flow

2 Auto-Manual Control

The following control levels are available for the PD Blowers3 Timed Mode

2 Dissolved Oxygen Mode3 Manual Mode

Conclusions

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 47

Following the commissioning of the ethernet-based PLCs Oxygen consumption was significantly reduced

The advanced controls allow the operators to leave the process alone and continue to optimally treat the sewage

Conclusions

Following the commissioning of the ethernet-based PLCs AnoxicOxic 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 Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 48

Summary

The PD Blowers ran in Timed Mode andor 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

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 Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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 Authoritys 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 50

TUTORIAL

Part 2A

PLC Programming Basics

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 51

Separate parts of the process have been organized into a separate ldquoSECTIONrdquo

PLC Program Organization

Each ldquoSECTIONrdquo can be any of the IEC programming types

bull Ladder (LD)bull Structured Text (ST)

bull Instruction List (IL)

bull Function Blocks (FB)bull Sequential Function Charts (SFC)

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 52

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 53

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 54

IO Map

On-Line PLC Diagnostics

PLC Status

PLC Simulator

Ethernet (TCPIP) Address

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 55

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 56

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 57

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 58

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 59

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 60

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 61

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 62

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 63

Structured Text was used hereNOT Ladder

Programming for Motors

The PLC DOES NOT CAREStructured Text Functions EXACTLY

the same as LadderUse what yoursquore comfortable with

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 64

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 65

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 66

IEC Function Blocks Used Here

Programming for Analogs amp PID

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 67

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 68

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 69

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 70

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 71

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 72

Sequential Function Charts were used here

Higher-Level Control

bull SFCrsquos lend themselves well to (as the name would imply) sequential processes

bull Three Important components in SFCrsquosbull Transitionsbull Stepsbull Jumps

bull The status of the process can be viewed as a flow chart

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 73

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 74

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 75

PLC - HMI Communication

A ldquoPLC Heartbeatrdquo is traditionally used to monitor the PLC - HMI Communication sometimes called ardquoWatchdog Timerrdquo

Call it whatever you want but the PLC amp 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 ldquodiesrdquo then that switch doesnrsquot change state and an alarm alerts the operator

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 76

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 77

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 78

TUTORIAL

Part 2B

HMI Programming

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 79

Ethernet (TCPIP) IO Driver

The Ethernet (TCPIP) IO Driver allows the HMI to communicate with the PLC (In this case the driver is called MBENETEXE)

The PLC has an ethernet module in one of the slots that has a ldquoCAT5RJ-45rdquo 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 ldquoCAT5RJ-45rdquo receptacle for the ethernet cable

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 80

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 81

Operator Screens amp Popup Displays

The display is laid out in 3 sections

bull Upper - Security amp Alarm Windowbull Middle- Main Operator Screens bull Lower - Menu amp Popup Displays

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 82

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 83

Scripting

There are 6 types of ldquoScriptsrdquobull Application Scriptsbull Key Scriptsbull Condition Scriptsbull Data Change Scriptsbull Quick Function Scriptsbull ActiveX Event Scripts

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 84

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 85

Access Names

The ldquoAccess Namesrdquo Must be configured to allow the PLC - HMI communications

Note that the ldquoApplicationTopicrdquo is the same as the IO Driver

The ldquocomputer namerdquo is the name of the PC that the HMI is running on (brad_s_carlberg in this case)

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 86

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 87

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 88

Indirect Tags

ldquoIndirect Tagsrdquo were used here to minimize the number of popup displays

This is especially useful in HMIrsquos with many tags

ONLY 12 popup displays are reused throughout the HMI

This gives the HMI a ldquoDCS-Likerdquo Look amp Feel

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 89

Popup Display TypesThe tag point type determines which popup display to use

Analog InputHIC (or Analog Output)PID (or Analog Composite)

bull PID WITH AUTO amp CASCADE amp RATIObull PID WITH AUTO amp RATIO

Diginbull Motor Status

DigOutMotor (or Digital Composite)

bull Motor with ILock and PermNumericSet TimersAlarm DetailAlarm Tags

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 90

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 91

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 92

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 93

Bars Buttons amp Sliders

By choosing to use indirect tags we complicate the Bar Graphs Buttons amp Sliders in the popup displays

Different scales need to be used for different engineering unit ranges

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 94

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 95

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 96

Popup Displays

The next two pages shows how the individual popup displays use the indirect tags

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 97

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 98

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 99

Adding a ldquoTouch Targetrdquo to a Display

2 Tell which tags to use

3 Tell which popup display to call upWhat kind of point type is it

3 Steps1 Tell which scale to use (if itrsquos an analog point type)

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 100

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 101

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 102

TUTORIAL

Part 2C

Excel Spreadsheets

amp

Visual Basic

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 103

A ldquoCHEAP amp DIRTYrdquo HMI With Excel

The 4 key parameters are

To communicate with the PLCUse brad_s_carlbergmbenet|ANOXIC_OXICrsquoplcregisterrsquo

Excel uses ldquopeeksrdquo amp ldquopokesrdquo to read from amp write to a PLC or HMI

To communicate with the HMIbrad_s_carlbergview|Tagnamersquotagnamersquo

bull computer namebull applicationbull topicbull item

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 104

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 105

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 106

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 107

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 108

Excel Macros

bull ldquoRequestrdquo Macro to read values

bull ldquoPokerdquo Macro to write values

bull A Sample Excel Macro

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 109

Sub PokeMacro()MsgBox ApplicationNetworkTemplatesPathChannel = ApplicationDDEInitiate(app=brad_s_carlbergVIEW topic=Tagname) This opens a DDE channel to ViewApplicationDDEPoke Channel Temperature1 Worksheets(Sheet1)Range(A1) Puts value from R1C1 into Temperature1ApplicationDDEPoke Channel DDEReal Worksheets(Sheet1)Range(A2) Puts value from R1C1 into Temperature1ApplicationDDEPoke Channel DDEInteger Worksheets(Sheet1)Range(A3) Puts value from R1C1 into Temperature1ApplicationDDETerminate Channel This terminates the DDE channelEnd SubSub RequestMacro()Channel = ApplicationDDEInitiate(app=brad_s_carlbergVIEW topic=Tagname) This opens a DDE channel to ViewWorksheets(Sheet1)Range(C4) = ApplicationDDERequest(Channel $Hour)Worksheets(Sheet1)Range(C5) = ApplicationDDERequest(Channel $Minute)Worksheets(Sheet1)Range(C6) = ApplicationDDERequest(Channel $Second)Worksheets(Sheet1)Range(C9) = ApplicationDDERequest(Channel $day)Worksheets(Sheet1)Range(C10) = ApplicationDDERequest(Channel $date)Worksheets(Sheet1)Range(C11) = ApplicationDDERequest(Channel $datestring)Worksheets(Sheet1)Range(C12) = ApplicationDDERequest(Channel $datetime)Worksheets(Sheet1)Range(C13) = ApplicationDDERequest(Channel $date)Worksheets(Sheet1)Range(C14) = ApplicationDDERequest(Channel $month)Worksheets(Sheet1)Range(C15) = ApplicationDDERequest(Channel $year)Worksheets(Sheet1)Range(C16) = ApplicationDDERequest(Channel $time)Worksheets(Sheet1)Range(C17) = ApplicationDDERequest(Channel $timestring)Worksheets(Sheet1)Range(C18) = ApplicationDDERequest(Channel $applicationversion)Worksheets(Sheet1)Range(C19) = ApplicationDDERequest(Channel $startddeconversations)Worksheets(Sheet1)Range(C20) = ApplicationDDERequest(Channel $accesslevel)Worksheets(Sheet1)Range(C21) = ApplicationDDERequest(Channel $alarmlogging)Worksheets(Sheet1)Range(C22) = ApplicationDDERequest(Channel $applicationchanged)Worksheets(Sheet1)Range(C23) = ApplicationDDERequest(Channel $configureusers)Worksheets(Sheet1)Range(C24) = ApplicationDDERequest(Channel $changepassword)Worksheets(Sheet1)Range(C25) = ApplicationDDERequest(Channel $InactivityTimeout)Worksheets(Sheet1)Range(C26) = ApplicationDDERequest(Channel $InactivityWarning)Worksheets(Sheet1)Range(C27) = ApplicationDDERequest(Channel $LogicRunning)Worksheets(Sheet1)Range(C28) = ApplicationDDERequest(Channel $OperatorEntered)Worksheets(Sheet1)Range(C29) = ApplicationDDERequest(Channel $Operator)Worksheets(Sheet1)Range(C30) = ApplicationDDERequest(Channel $PasswordEntered)ApplicationDDETerminate Channel This terminates the DDE channelEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 110

Visual Basic

ldquoRoll Your Ownrdquo HMI - Much More powerful than Excel

Key Parameters computer nameapplication|topicitem

IO Emulator - MBPlusSimulateexe

Can ldquoRead Fromrdquo amp ldquoWrite Tordquo PLC andor HMI

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 111

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 112

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 113

Dim PauseTime Start Finish TotalTime As Integer Declare variables

Private Sub txtAIT_332A_SCALED_Change()On Error GoTo PokeAIT_332AErrortxtAIT_332A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtAIT_332A_SCALEDText = Int((3 Rnd) + 20) Generate random value between 20 and 23txtAIT_332A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtAIT_332A_SCALEDLinkItem = AIT_332A_SCALEDtxtAIT_332A_SCALEDLinkMode = 2txtAIT_332A_SCALEDLinkPoketxtAIT_332A_SCALEDLinkMode = 0 DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total time

PokeAIT_332AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtAIT_332A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 114

Private Sub txtAIT_346A_SCALED_Change()On Error GoTo PokeAIT_346AErrortxtAIT_346A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtAIT_346A_SCALEDText = Int((3 Rnd) + 15) Generate random value between 15 and 18txtAIT_346A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtAIT_346A_SCALEDLinkItem = AIT_346A_SCALEDtxtAIT_346A_SCALEDLinkMode = 2txtAIT_346A_SCALEDLinkPoketxtAIT_346A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeAIT_346AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtAIT_346A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 115

Private Sub txtFIT_321A_SCALED_Change()On Error GoTo PokeFIT_321AErrortxtFIT_321A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtFIT_321A_SCALEDText = Int((10 Rnd) + 120) Generate random value between 120 and 130txtFIT_321A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_321A_SCALEDLinkItem = FIT_321A_SCALEDtxtFIT_321A_SCALEDLinkMode = 2txtFIT_321A_SCALEDLinkPoketxtFIT_321A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total time

PokeFIT_321AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_321A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume Next

End Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 116

Private Sub txtFIT_341A_SCALED_Change()On Error GoTo PokeFIT_341AErrortxtFIT_341A_SCALEDLinkMode = 0 PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTime

txtFIT_341A_SCALEDText = Int((3 Rnd) + 18) Generate random value between 18 and 21

txtFIT_341A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_341A_SCALEDLinkItem = FIT_341A_SCALEDtxtFIT_341A_SCALEDLinkMode = 2txtFIT_341A_SCALEDLinkPoketxtFIT_341A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeFIT_341AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_341A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 117

Private Sub txtFIT_343A_SCALED_Change()On Error GoTo PokeFIT_343AErrortxtFIT_343A_SCALEDLinkMode = 0 PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTime

txtFIT_343A_SCALEDText = Int((1 Rnd) + 3) Generate random value between 3 and 4

txtFIT_343A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_343A_SCALEDLinkItem = FIT_343A_SCALEDtxtFIT_343A_SCALEDLinkMode = 2txtFIT_343A_SCALEDLinkPoketxtFIT_343A_SCALEDLinkMode = 0 DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeFIT_343AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_343A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 118

TUTORIAL

Part 4

Questions

amp

Answers

  • Slide 1
  • Slide 2
  • Slide 3
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Slide 8
  • Slide 9
  • Slide 10
  • Slide 11
  • Slide 12
  • Slide 13
  • Slide 14
  • Slide 15
  • Slide 16
  • Slide 17
  • Slide 18
  • Slide 19
  • Slide 20
  • Slide 21
  • Slide 22
  • Slide 23
  • Slide 24
  • Slide 25
  • Slide 26
  • Slide 27
  • Slide 28
  • Slide 29
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
  • Slide 34
  • Slide 35
  • Slide 36
  • Slide 37
  • Slide 38
  • Slide 39
  • Slide 40
  • Slide 41
  • Slide 42
  • Slide 43
  • Slide 44
  • Slide 45
  • Slide 46
  • Slide 47
  • Slide 48
  • Slide 49
  • Slide 50
  • Slide 51
  • Slide 52
  • Slide 53
  • Slide 54
  • Slide 55
  • Slide 56
  • Slide 57
  • Slide 58
  • Slide 59
  • Slide 60
  • Slide 61
  • Slide 62
  • Slide 63
  • Slide 64
  • Slide 65
  • Slide 66
  • Slide 67
  • Slide 68
  • Slide 69
  • Slide 70
  • Slide 71
  • Slide 72
  • Slide 73
  • Slide 74
  • Slide 75
  • Slide 76
  • Slide 77
  • Slide 78
  • Slide 79
  • Slide 80
  • Slide 81
  • Slide 82
  • Slide 83
  • Slide 84
  • Slide 85
  • Slide 86
  • Slide 87
  • Slide 88
  • Slide 89
  • Slide 90
  • Slide 91
  • Slide 92
  • Slide 93
  • Slide 94
  • Slide 95
  • Slide 96
  • Slide 97
  • Slide 98
  • Slide 99
  • Slide 100
  • Slide 101
  • Slide 102
  • Slide 103
  • Slide 104
  • Slide 105
  • Slide 106
  • Slide 107
  • Slide 108
  • Slide 109
  • Slide 110
  • Slide 111
  • Slide 112
  • Slide 113
  • Slide 114
  • Slide 115
  • Slide 116
  • Slide 117
  • Slide 118
Page 31: TUTORIAL Ethernet PLC's Improve Oxygen Consumption ISA Expo/2001Houston, Texas Water & Wastewater Industry DivisionTuesday, September 11, 2001 1 Brad.

Aerator Control Motor Popup

Like all motors the following information is available for the Aerator motor control from the motor popup

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 32

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 33

Motor Popup Surface Aerator Control

The following information is available for motor control from the motor popup

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 35

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 36

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 37

Lower Explosive Level (LEL)

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 38

Each train has a digital input that tells whether thecombustible 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 (LEL) system

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 39

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 Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 40

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 41

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 Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 42

Like a DCS

middot 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

middot 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 amp CASCADE amp RATIO PID WITH AUTO amp RATIO Digin Motor Status DigOut Motor (or Digital Composite) Motor with ILock and Perm Numeric Set Timers Alarm Detail and Alarm Tags

middot A single generic trend display to trend ALL trendable (archived) points

Alarm Management

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

middot A Distributed Alarm Summary has been used to give better alarm management tools

bull Up to eight trend pens on the trend display

bull The operator picks which values to trend by clicking in the center of the trend

display

bull 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 44

The AnoxicOxic 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 Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 46

The following control levels are available for Oxygen1 Cascade from Dissolved Oxygen

2 Ratio from Discharge flow3 Auto-Manual Control

The following control levels are available for the Recycle flow1 Ratio from Discharge flow

2 Auto-Manual Control

The following control levels are available for the PD Blowers3 Timed Mode

2 Dissolved Oxygen Mode3 Manual Mode

Conclusions

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 47

Following the commissioning of the ethernet-based PLCs Oxygen consumption was significantly reduced

The advanced controls allow the operators to leave the process alone and continue to optimally treat the sewage

Conclusions

Following the commissioning of the ethernet-based PLCs AnoxicOxic 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 Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 48

Summary

The PD Blowers ran in Timed Mode andor 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

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 Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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 Authoritys 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 50

TUTORIAL

Part 2A

PLC Programming Basics

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 51

Separate parts of the process have been organized into a separate ldquoSECTIONrdquo

PLC Program Organization

Each ldquoSECTIONrdquo can be any of the IEC programming types

bull Ladder (LD)bull Structured Text (ST)

bull Instruction List (IL)

bull Function Blocks (FB)bull Sequential Function Charts (SFC)

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 52

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 53

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 54

IO Map

On-Line PLC Diagnostics

PLC Status

PLC Simulator

Ethernet (TCPIP) Address

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 55

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 56

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 57

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 58

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 59

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 60

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 61

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 62

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 63

Structured Text was used hereNOT Ladder

Programming for Motors

The PLC DOES NOT CAREStructured Text Functions EXACTLY

the same as LadderUse what yoursquore comfortable with

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 64

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 65

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 66

IEC Function Blocks Used Here

Programming for Analogs amp PID

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 67

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 68

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 69

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 70

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 71

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 72

Sequential Function Charts were used here

Higher-Level Control

bull SFCrsquos lend themselves well to (as the name would imply) sequential processes

bull Three Important components in SFCrsquosbull Transitionsbull Stepsbull Jumps

bull The status of the process can be viewed as a flow chart

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 73

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 74

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 75

PLC - HMI Communication

A ldquoPLC Heartbeatrdquo is traditionally used to monitor the PLC - HMI Communication sometimes called ardquoWatchdog Timerrdquo

Call it whatever you want but the PLC amp 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 ldquodiesrdquo then that switch doesnrsquot change state and an alarm alerts the operator

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 76

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 77

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 78

TUTORIAL

Part 2B

HMI Programming

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 79

Ethernet (TCPIP) IO Driver

The Ethernet (TCPIP) IO Driver allows the HMI to communicate with the PLC (In this case the driver is called MBENETEXE)

The PLC has an ethernet module in one of the slots that has a ldquoCAT5RJ-45rdquo 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 ldquoCAT5RJ-45rdquo receptacle for the ethernet cable

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 80

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 81

Operator Screens amp Popup Displays

The display is laid out in 3 sections

bull Upper - Security amp Alarm Windowbull Middle- Main Operator Screens bull Lower - Menu amp Popup Displays

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 82

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 83

Scripting

There are 6 types of ldquoScriptsrdquobull Application Scriptsbull Key Scriptsbull Condition Scriptsbull Data Change Scriptsbull Quick Function Scriptsbull ActiveX Event Scripts

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 84

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 85

Access Names

The ldquoAccess Namesrdquo Must be configured to allow the PLC - HMI communications

Note that the ldquoApplicationTopicrdquo is the same as the IO Driver

The ldquocomputer namerdquo is the name of the PC that the HMI is running on (brad_s_carlberg in this case)

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 86

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 87

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 88

Indirect Tags

ldquoIndirect Tagsrdquo were used here to minimize the number of popup displays

This is especially useful in HMIrsquos with many tags

ONLY 12 popup displays are reused throughout the HMI

This gives the HMI a ldquoDCS-Likerdquo Look amp Feel

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 89

Popup Display TypesThe tag point type determines which popup display to use

Analog InputHIC (or Analog Output)PID (or Analog Composite)

bull PID WITH AUTO amp CASCADE amp RATIObull PID WITH AUTO amp RATIO

Diginbull Motor Status

DigOutMotor (or Digital Composite)

bull Motor with ILock and PermNumericSet TimersAlarm DetailAlarm Tags

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 90

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 91

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 92

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 93

Bars Buttons amp Sliders

By choosing to use indirect tags we complicate the Bar Graphs Buttons amp Sliders in the popup displays

Different scales need to be used for different engineering unit ranges

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 94

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 95

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 96

Popup Displays

The next two pages shows how the individual popup displays use the indirect tags

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 97

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 98

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 99

Adding a ldquoTouch Targetrdquo to a Display

2 Tell which tags to use

3 Tell which popup display to call upWhat kind of point type is it

3 Steps1 Tell which scale to use (if itrsquos an analog point type)

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 100

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 101

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 102

TUTORIAL

Part 2C

Excel Spreadsheets

amp

Visual Basic

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 103

A ldquoCHEAP amp DIRTYrdquo HMI With Excel

The 4 key parameters are

To communicate with the PLCUse brad_s_carlbergmbenet|ANOXIC_OXICrsquoplcregisterrsquo

Excel uses ldquopeeksrdquo amp ldquopokesrdquo to read from amp write to a PLC or HMI

To communicate with the HMIbrad_s_carlbergview|Tagnamersquotagnamersquo

bull computer namebull applicationbull topicbull item

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 104

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 105

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 106

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 107

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 108

Excel Macros

bull ldquoRequestrdquo Macro to read values

bull ldquoPokerdquo Macro to write values

bull A Sample Excel Macro

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 109

Sub PokeMacro()MsgBox ApplicationNetworkTemplatesPathChannel = ApplicationDDEInitiate(app=brad_s_carlbergVIEW topic=Tagname) This opens a DDE channel to ViewApplicationDDEPoke Channel Temperature1 Worksheets(Sheet1)Range(A1) Puts value from R1C1 into Temperature1ApplicationDDEPoke Channel DDEReal Worksheets(Sheet1)Range(A2) Puts value from R1C1 into Temperature1ApplicationDDEPoke Channel DDEInteger Worksheets(Sheet1)Range(A3) Puts value from R1C1 into Temperature1ApplicationDDETerminate Channel This terminates the DDE channelEnd SubSub RequestMacro()Channel = ApplicationDDEInitiate(app=brad_s_carlbergVIEW topic=Tagname) This opens a DDE channel to ViewWorksheets(Sheet1)Range(C4) = ApplicationDDERequest(Channel $Hour)Worksheets(Sheet1)Range(C5) = ApplicationDDERequest(Channel $Minute)Worksheets(Sheet1)Range(C6) = ApplicationDDERequest(Channel $Second)Worksheets(Sheet1)Range(C9) = ApplicationDDERequest(Channel $day)Worksheets(Sheet1)Range(C10) = ApplicationDDERequest(Channel $date)Worksheets(Sheet1)Range(C11) = ApplicationDDERequest(Channel $datestring)Worksheets(Sheet1)Range(C12) = ApplicationDDERequest(Channel $datetime)Worksheets(Sheet1)Range(C13) = ApplicationDDERequest(Channel $date)Worksheets(Sheet1)Range(C14) = ApplicationDDERequest(Channel $month)Worksheets(Sheet1)Range(C15) = ApplicationDDERequest(Channel $year)Worksheets(Sheet1)Range(C16) = ApplicationDDERequest(Channel $time)Worksheets(Sheet1)Range(C17) = ApplicationDDERequest(Channel $timestring)Worksheets(Sheet1)Range(C18) = ApplicationDDERequest(Channel $applicationversion)Worksheets(Sheet1)Range(C19) = ApplicationDDERequest(Channel $startddeconversations)Worksheets(Sheet1)Range(C20) = ApplicationDDERequest(Channel $accesslevel)Worksheets(Sheet1)Range(C21) = ApplicationDDERequest(Channel $alarmlogging)Worksheets(Sheet1)Range(C22) = ApplicationDDERequest(Channel $applicationchanged)Worksheets(Sheet1)Range(C23) = ApplicationDDERequest(Channel $configureusers)Worksheets(Sheet1)Range(C24) = ApplicationDDERequest(Channel $changepassword)Worksheets(Sheet1)Range(C25) = ApplicationDDERequest(Channel $InactivityTimeout)Worksheets(Sheet1)Range(C26) = ApplicationDDERequest(Channel $InactivityWarning)Worksheets(Sheet1)Range(C27) = ApplicationDDERequest(Channel $LogicRunning)Worksheets(Sheet1)Range(C28) = ApplicationDDERequest(Channel $OperatorEntered)Worksheets(Sheet1)Range(C29) = ApplicationDDERequest(Channel $Operator)Worksheets(Sheet1)Range(C30) = ApplicationDDERequest(Channel $PasswordEntered)ApplicationDDETerminate Channel This terminates the DDE channelEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 110

Visual Basic

ldquoRoll Your Ownrdquo HMI - Much More powerful than Excel

Key Parameters computer nameapplication|topicitem

IO Emulator - MBPlusSimulateexe

Can ldquoRead Fromrdquo amp ldquoWrite Tordquo PLC andor HMI

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 111

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 112

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 113

Dim PauseTime Start Finish TotalTime As Integer Declare variables

Private Sub txtAIT_332A_SCALED_Change()On Error GoTo PokeAIT_332AErrortxtAIT_332A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtAIT_332A_SCALEDText = Int((3 Rnd) + 20) Generate random value between 20 and 23txtAIT_332A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtAIT_332A_SCALEDLinkItem = AIT_332A_SCALEDtxtAIT_332A_SCALEDLinkMode = 2txtAIT_332A_SCALEDLinkPoketxtAIT_332A_SCALEDLinkMode = 0 DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total time

PokeAIT_332AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtAIT_332A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 114

Private Sub txtAIT_346A_SCALED_Change()On Error GoTo PokeAIT_346AErrortxtAIT_346A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtAIT_346A_SCALEDText = Int((3 Rnd) + 15) Generate random value between 15 and 18txtAIT_346A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtAIT_346A_SCALEDLinkItem = AIT_346A_SCALEDtxtAIT_346A_SCALEDLinkMode = 2txtAIT_346A_SCALEDLinkPoketxtAIT_346A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeAIT_346AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtAIT_346A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 115

Private Sub txtFIT_321A_SCALED_Change()On Error GoTo PokeFIT_321AErrortxtFIT_321A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtFIT_321A_SCALEDText = Int((10 Rnd) + 120) Generate random value between 120 and 130txtFIT_321A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_321A_SCALEDLinkItem = FIT_321A_SCALEDtxtFIT_321A_SCALEDLinkMode = 2txtFIT_321A_SCALEDLinkPoketxtFIT_321A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total time

PokeFIT_321AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_321A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume Next

End Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 116

Private Sub txtFIT_341A_SCALED_Change()On Error GoTo PokeFIT_341AErrortxtFIT_341A_SCALEDLinkMode = 0 PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTime

txtFIT_341A_SCALEDText = Int((3 Rnd) + 18) Generate random value between 18 and 21

txtFIT_341A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_341A_SCALEDLinkItem = FIT_341A_SCALEDtxtFIT_341A_SCALEDLinkMode = 2txtFIT_341A_SCALEDLinkPoketxtFIT_341A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeFIT_341AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_341A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 117

Private Sub txtFIT_343A_SCALED_Change()On Error GoTo PokeFIT_343AErrortxtFIT_343A_SCALEDLinkMode = 0 PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTime

txtFIT_343A_SCALEDText = Int((1 Rnd) + 3) Generate random value between 3 and 4

txtFIT_343A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_343A_SCALEDLinkItem = FIT_343A_SCALEDtxtFIT_343A_SCALEDLinkMode = 2txtFIT_343A_SCALEDLinkPoketxtFIT_343A_SCALEDLinkMode = 0 DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeFIT_343AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_343A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 118

TUTORIAL

Part 4

Questions

amp

Answers

  • Slide 1
  • Slide 2
  • Slide 3
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Slide 8
  • Slide 9
  • Slide 10
  • Slide 11
  • Slide 12
  • Slide 13
  • Slide 14
  • Slide 15
  • Slide 16
  • Slide 17
  • Slide 18
  • Slide 19
  • Slide 20
  • Slide 21
  • Slide 22
  • Slide 23
  • Slide 24
  • Slide 25
  • Slide 26
  • Slide 27
  • Slide 28
  • Slide 29
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
  • Slide 34
  • Slide 35
  • Slide 36
  • Slide 37
  • Slide 38
  • Slide 39
  • Slide 40
  • Slide 41
  • Slide 42
  • Slide 43
  • Slide 44
  • Slide 45
  • Slide 46
  • Slide 47
  • Slide 48
  • Slide 49
  • Slide 50
  • Slide 51
  • Slide 52
  • Slide 53
  • Slide 54
  • Slide 55
  • Slide 56
  • Slide 57
  • Slide 58
  • Slide 59
  • Slide 60
  • Slide 61
  • Slide 62
  • Slide 63
  • Slide 64
  • Slide 65
  • Slide 66
  • Slide 67
  • Slide 68
  • Slide 69
  • Slide 70
  • Slide 71
  • Slide 72
  • Slide 73
  • Slide 74
  • Slide 75
  • Slide 76
  • Slide 77
  • Slide 78
  • Slide 79
  • Slide 80
  • Slide 81
  • Slide 82
  • Slide 83
  • Slide 84
  • Slide 85
  • Slide 86
  • Slide 87
  • Slide 88
  • Slide 89
  • Slide 90
  • Slide 91
  • Slide 92
  • Slide 93
  • Slide 94
  • Slide 95
  • Slide 96
  • Slide 97
  • Slide 98
  • Slide 99
  • Slide 100
  • Slide 101
  • Slide 102
  • Slide 103
  • Slide 104
  • Slide 105
  • Slide 106
  • Slide 107
  • Slide 108
  • Slide 109
  • Slide 110
  • Slide 111
  • Slide 112
  • Slide 113
  • Slide 114
  • Slide 115
  • Slide 116
  • Slide 117
  • Slide 118
Page 32: TUTORIAL Ethernet PLC's Improve Oxygen Consumption ISA Expo/2001Houston, Texas Water & Wastewater Industry DivisionTuesday, September 11, 2001 1 Brad.

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 32

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 33

Motor Popup Surface Aerator Control

The following information is available for motor control from the motor popup

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 35

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 36

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 37

Lower Explosive Level (LEL)

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 38

Each train has a digital input that tells whether thecombustible 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 (LEL) system

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 39

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 Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 40

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 41

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 Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 42

Like a DCS

middot 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

middot 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 amp CASCADE amp RATIO PID WITH AUTO amp RATIO Digin Motor Status DigOut Motor (or Digital Composite) Motor with ILock and Perm Numeric Set Timers Alarm Detail and Alarm Tags

middot A single generic trend display to trend ALL trendable (archived) points

Alarm Management

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

middot A Distributed Alarm Summary has been used to give better alarm management tools

bull Up to eight trend pens on the trend display

bull The operator picks which values to trend by clicking in the center of the trend

display

bull 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 44

The AnoxicOxic 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 Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 46

The following control levels are available for Oxygen1 Cascade from Dissolved Oxygen

2 Ratio from Discharge flow3 Auto-Manual Control

The following control levels are available for the Recycle flow1 Ratio from Discharge flow

2 Auto-Manual Control

The following control levels are available for the PD Blowers3 Timed Mode

2 Dissolved Oxygen Mode3 Manual Mode

Conclusions

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 47

Following the commissioning of the ethernet-based PLCs Oxygen consumption was significantly reduced

The advanced controls allow the operators to leave the process alone and continue to optimally treat the sewage

Conclusions

Following the commissioning of the ethernet-based PLCs AnoxicOxic 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 Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 48

Summary

The PD Blowers ran in Timed Mode andor 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

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 Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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 Authoritys 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 50

TUTORIAL

Part 2A

PLC Programming Basics

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 51

Separate parts of the process have been organized into a separate ldquoSECTIONrdquo

PLC Program Organization

Each ldquoSECTIONrdquo can be any of the IEC programming types

bull Ladder (LD)bull Structured Text (ST)

bull Instruction List (IL)

bull Function Blocks (FB)bull Sequential Function Charts (SFC)

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 52

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 53

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 54

IO Map

On-Line PLC Diagnostics

PLC Status

PLC Simulator

Ethernet (TCPIP) Address

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 55

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 56

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 57

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 58

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 59

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 60

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 61

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 62

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 63

Structured Text was used hereNOT Ladder

Programming for Motors

The PLC DOES NOT CAREStructured Text Functions EXACTLY

the same as LadderUse what yoursquore comfortable with

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 64

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 65

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 66

IEC Function Blocks Used Here

Programming for Analogs amp PID

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 67

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 68

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 69

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 70

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 71

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 72

Sequential Function Charts were used here

Higher-Level Control

bull SFCrsquos lend themselves well to (as the name would imply) sequential processes

bull Three Important components in SFCrsquosbull Transitionsbull Stepsbull Jumps

bull The status of the process can be viewed as a flow chart

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 73

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 74

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 75

PLC - HMI Communication

A ldquoPLC Heartbeatrdquo is traditionally used to monitor the PLC - HMI Communication sometimes called ardquoWatchdog Timerrdquo

Call it whatever you want but the PLC amp 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 ldquodiesrdquo then that switch doesnrsquot change state and an alarm alerts the operator

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 76

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 77

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 78

TUTORIAL

Part 2B

HMI Programming

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 79

Ethernet (TCPIP) IO Driver

The Ethernet (TCPIP) IO Driver allows the HMI to communicate with the PLC (In this case the driver is called MBENETEXE)

The PLC has an ethernet module in one of the slots that has a ldquoCAT5RJ-45rdquo 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 ldquoCAT5RJ-45rdquo receptacle for the ethernet cable

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 80

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 81

Operator Screens amp Popup Displays

The display is laid out in 3 sections

bull Upper - Security amp Alarm Windowbull Middle- Main Operator Screens bull Lower - Menu amp Popup Displays

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 82

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 83

Scripting

There are 6 types of ldquoScriptsrdquobull Application Scriptsbull Key Scriptsbull Condition Scriptsbull Data Change Scriptsbull Quick Function Scriptsbull ActiveX Event Scripts

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 84

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 85

Access Names

The ldquoAccess Namesrdquo Must be configured to allow the PLC - HMI communications

Note that the ldquoApplicationTopicrdquo is the same as the IO Driver

The ldquocomputer namerdquo is the name of the PC that the HMI is running on (brad_s_carlberg in this case)

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 86

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 87

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 88

Indirect Tags

ldquoIndirect Tagsrdquo were used here to minimize the number of popup displays

This is especially useful in HMIrsquos with many tags

ONLY 12 popup displays are reused throughout the HMI

This gives the HMI a ldquoDCS-Likerdquo Look amp Feel

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 89

Popup Display TypesThe tag point type determines which popup display to use

Analog InputHIC (or Analog Output)PID (or Analog Composite)

bull PID WITH AUTO amp CASCADE amp RATIObull PID WITH AUTO amp RATIO

Diginbull Motor Status

DigOutMotor (or Digital Composite)

bull Motor with ILock and PermNumericSet TimersAlarm DetailAlarm Tags

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 90

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 91

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 92

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 93

Bars Buttons amp Sliders

By choosing to use indirect tags we complicate the Bar Graphs Buttons amp Sliders in the popup displays

Different scales need to be used for different engineering unit ranges

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 94

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 95

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 96

Popup Displays

The next two pages shows how the individual popup displays use the indirect tags

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 97

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 98

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 99

Adding a ldquoTouch Targetrdquo to a Display

2 Tell which tags to use

3 Tell which popup display to call upWhat kind of point type is it

3 Steps1 Tell which scale to use (if itrsquos an analog point type)

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 100

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 101

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 102

TUTORIAL

Part 2C

Excel Spreadsheets

amp

Visual Basic

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 103

A ldquoCHEAP amp DIRTYrdquo HMI With Excel

The 4 key parameters are

To communicate with the PLCUse brad_s_carlbergmbenet|ANOXIC_OXICrsquoplcregisterrsquo

Excel uses ldquopeeksrdquo amp ldquopokesrdquo to read from amp write to a PLC or HMI

To communicate with the HMIbrad_s_carlbergview|Tagnamersquotagnamersquo

bull computer namebull applicationbull topicbull item

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 104

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 105

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 106

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 107

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 108

Excel Macros

bull ldquoRequestrdquo Macro to read values

bull ldquoPokerdquo Macro to write values

bull A Sample Excel Macro

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 109

Sub PokeMacro()MsgBox ApplicationNetworkTemplatesPathChannel = ApplicationDDEInitiate(app=brad_s_carlbergVIEW topic=Tagname) This opens a DDE channel to ViewApplicationDDEPoke Channel Temperature1 Worksheets(Sheet1)Range(A1) Puts value from R1C1 into Temperature1ApplicationDDEPoke Channel DDEReal Worksheets(Sheet1)Range(A2) Puts value from R1C1 into Temperature1ApplicationDDEPoke Channel DDEInteger Worksheets(Sheet1)Range(A3) Puts value from R1C1 into Temperature1ApplicationDDETerminate Channel This terminates the DDE channelEnd SubSub RequestMacro()Channel = ApplicationDDEInitiate(app=brad_s_carlbergVIEW topic=Tagname) This opens a DDE channel to ViewWorksheets(Sheet1)Range(C4) = ApplicationDDERequest(Channel $Hour)Worksheets(Sheet1)Range(C5) = ApplicationDDERequest(Channel $Minute)Worksheets(Sheet1)Range(C6) = ApplicationDDERequest(Channel $Second)Worksheets(Sheet1)Range(C9) = ApplicationDDERequest(Channel $day)Worksheets(Sheet1)Range(C10) = ApplicationDDERequest(Channel $date)Worksheets(Sheet1)Range(C11) = ApplicationDDERequest(Channel $datestring)Worksheets(Sheet1)Range(C12) = ApplicationDDERequest(Channel $datetime)Worksheets(Sheet1)Range(C13) = ApplicationDDERequest(Channel $date)Worksheets(Sheet1)Range(C14) = ApplicationDDERequest(Channel $month)Worksheets(Sheet1)Range(C15) = ApplicationDDERequest(Channel $year)Worksheets(Sheet1)Range(C16) = ApplicationDDERequest(Channel $time)Worksheets(Sheet1)Range(C17) = ApplicationDDERequest(Channel $timestring)Worksheets(Sheet1)Range(C18) = ApplicationDDERequest(Channel $applicationversion)Worksheets(Sheet1)Range(C19) = ApplicationDDERequest(Channel $startddeconversations)Worksheets(Sheet1)Range(C20) = ApplicationDDERequest(Channel $accesslevel)Worksheets(Sheet1)Range(C21) = ApplicationDDERequest(Channel $alarmlogging)Worksheets(Sheet1)Range(C22) = ApplicationDDERequest(Channel $applicationchanged)Worksheets(Sheet1)Range(C23) = ApplicationDDERequest(Channel $configureusers)Worksheets(Sheet1)Range(C24) = ApplicationDDERequest(Channel $changepassword)Worksheets(Sheet1)Range(C25) = ApplicationDDERequest(Channel $InactivityTimeout)Worksheets(Sheet1)Range(C26) = ApplicationDDERequest(Channel $InactivityWarning)Worksheets(Sheet1)Range(C27) = ApplicationDDERequest(Channel $LogicRunning)Worksheets(Sheet1)Range(C28) = ApplicationDDERequest(Channel $OperatorEntered)Worksheets(Sheet1)Range(C29) = ApplicationDDERequest(Channel $Operator)Worksheets(Sheet1)Range(C30) = ApplicationDDERequest(Channel $PasswordEntered)ApplicationDDETerminate Channel This terminates the DDE channelEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 110

Visual Basic

ldquoRoll Your Ownrdquo HMI - Much More powerful than Excel

Key Parameters computer nameapplication|topicitem

IO Emulator - MBPlusSimulateexe

Can ldquoRead Fromrdquo amp ldquoWrite Tordquo PLC andor HMI

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 111

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 112

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 113

Dim PauseTime Start Finish TotalTime As Integer Declare variables

Private Sub txtAIT_332A_SCALED_Change()On Error GoTo PokeAIT_332AErrortxtAIT_332A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtAIT_332A_SCALEDText = Int((3 Rnd) + 20) Generate random value between 20 and 23txtAIT_332A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtAIT_332A_SCALEDLinkItem = AIT_332A_SCALEDtxtAIT_332A_SCALEDLinkMode = 2txtAIT_332A_SCALEDLinkPoketxtAIT_332A_SCALEDLinkMode = 0 DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total time

PokeAIT_332AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtAIT_332A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 114

Private Sub txtAIT_346A_SCALED_Change()On Error GoTo PokeAIT_346AErrortxtAIT_346A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtAIT_346A_SCALEDText = Int((3 Rnd) + 15) Generate random value between 15 and 18txtAIT_346A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtAIT_346A_SCALEDLinkItem = AIT_346A_SCALEDtxtAIT_346A_SCALEDLinkMode = 2txtAIT_346A_SCALEDLinkPoketxtAIT_346A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeAIT_346AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtAIT_346A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 115

Private Sub txtFIT_321A_SCALED_Change()On Error GoTo PokeFIT_321AErrortxtFIT_321A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtFIT_321A_SCALEDText = Int((10 Rnd) + 120) Generate random value between 120 and 130txtFIT_321A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_321A_SCALEDLinkItem = FIT_321A_SCALEDtxtFIT_321A_SCALEDLinkMode = 2txtFIT_321A_SCALEDLinkPoketxtFIT_321A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total time

PokeFIT_321AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_321A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume Next

End Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 116

Private Sub txtFIT_341A_SCALED_Change()On Error GoTo PokeFIT_341AErrortxtFIT_341A_SCALEDLinkMode = 0 PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTime

txtFIT_341A_SCALEDText = Int((3 Rnd) + 18) Generate random value between 18 and 21

txtFIT_341A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_341A_SCALEDLinkItem = FIT_341A_SCALEDtxtFIT_341A_SCALEDLinkMode = 2txtFIT_341A_SCALEDLinkPoketxtFIT_341A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeFIT_341AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_341A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 117

Private Sub txtFIT_343A_SCALED_Change()On Error GoTo PokeFIT_343AErrortxtFIT_343A_SCALEDLinkMode = 0 PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTime

txtFIT_343A_SCALEDText = Int((1 Rnd) + 3) Generate random value between 3 and 4

txtFIT_343A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_343A_SCALEDLinkItem = FIT_343A_SCALEDtxtFIT_343A_SCALEDLinkMode = 2txtFIT_343A_SCALEDLinkPoketxtFIT_343A_SCALEDLinkMode = 0 DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeFIT_343AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_343A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 118

TUTORIAL

Part 4

Questions

amp

Answers

  • Slide 1
  • Slide 2
  • Slide 3
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Slide 8
  • Slide 9
  • Slide 10
  • Slide 11
  • Slide 12
  • Slide 13
  • Slide 14
  • Slide 15
  • Slide 16
  • Slide 17
  • Slide 18
  • Slide 19
  • Slide 20
  • Slide 21
  • Slide 22
  • Slide 23
  • Slide 24
  • Slide 25
  • Slide 26
  • Slide 27
  • Slide 28
  • Slide 29
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
  • Slide 34
  • Slide 35
  • Slide 36
  • Slide 37
  • Slide 38
  • Slide 39
  • Slide 40
  • Slide 41
  • Slide 42
  • Slide 43
  • Slide 44
  • Slide 45
  • Slide 46
  • Slide 47
  • Slide 48
  • Slide 49
  • Slide 50
  • Slide 51
  • Slide 52
  • Slide 53
  • Slide 54
  • Slide 55
  • Slide 56
  • Slide 57
  • Slide 58
  • Slide 59
  • Slide 60
  • Slide 61
  • Slide 62
  • Slide 63
  • Slide 64
  • Slide 65
  • Slide 66
  • Slide 67
  • Slide 68
  • Slide 69
  • Slide 70
  • Slide 71
  • Slide 72
  • Slide 73
  • Slide 74
  • Slide 75
  • Slide 76
  • Slide 77
  • Slide 78
  • Slide 79
  • Slide 80
  • Slide 81
  • Slide 82
  • Slide 83
  • Slide 84
  • Slide 85
  • Slide 86
  • Slide 87
  • Slide 88
  • Slide 89
  • Slide 90
  • Slide 91
  • Slide 92
  • Slide 93
  • Slide 94
  • Slide 95
  • Slide 96
  • Slide 97
  • Slide 98
  • Slide 99
  • Slide 100
  • Slide 101
  • Slide 102
  • Slide 103
  • Slide 104
  • Slide 105
  • Slide 106
  • Slide 107
  • Slide 108
  • Slide 109
  • Slide 110
  • Slide 111
  • Slide 112
  • Slide 113
  • Slide 114
  • Slide 115
  • Slide 116
  • Slide 117
  • Slide 118
Page 33: TUTORIAL Ethernet PLC's Improve Oxygen Consumption ISA Expo/2001Houston, Texas Water & Wastewater Industry DivisionTuesday, September 11, 2001 1 Brad.

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 33

Motor Popup Surface Aerator Control

The following information is available for motor control from the motor popup

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 35

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 36

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 37

Lower Explosive Level (LEL)

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 38

Each train has a digital input that tells whether thecombustible 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 (LEL) system

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 39

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 Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 40

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 41

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 Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 42

Like a DCS

middot 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

middot 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 amp CASCADE amp RATIO PID WITH AUTO amp RATIO Digin Motor Status DigOut Motor (or Digital Composite) Motor with ILock and Perm Numeric Set Timers Alarm Detail and Alarm Tags

middot A single generic trend display to trend ALL trendable (archived) points

Alarm Management

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

middot A Distributed Alarm Summary has been used to give better alarm management tools

bull Up to eight trend pens on the trend display

bull The operator picks which values to trend by clicking in the center of the trend

display

bull 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 44

The AnoxicOxic 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 Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 46

The following control levels are available for Oxygen1 Cascade from Dissolved Oxygen

2 Ratio from Discharge flow3 Auto-Manual Control

The following control levels are available for the Recycle flow1 Ratio from Discharge flow

2 Auto-Manual Control

The following control levels are available for the PD Blowers3 Timed Mode

2 Dissolved Oxygen Mode3 Manual Mode

Conclusions

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 47

Following the commissioning of the ethernet-based PLCs Oxygen consumption was significantly reduced

The advanced controls allow the operators to leave the process alone and continue to optimally treat the sewage

Conclusions

Following the commissioning of the ethernet-based PLCs AnoxicOxic 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 Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 48

Summary

The PD Blowers ran in Timed Mode andor 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

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 Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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 Authoritys 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 50

TUTORIAL

Part 2A

PLC Programming Basics

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 51

Separate parts of the process have been organized into a separate ldquoSECTIONrdquo

PLC Program Organization

Each ldquoSECTIONrdquo can be any of the IEC programming types

bull Ladder (LD)bull Structured Text (ST)

bull Instruction List (IL)

bull Function Blocks (FB)bull Sequential Function Charts (SFC)

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 52

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 53

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 54

IO Map

On-Line PLC Diagnostics

PLC Status

PLC Simulator

Ethernet (TCPIP) Address

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 55

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 56

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 57

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 58

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 59

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 60

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 61

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 62

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 63

Structured Text was used hereNOT Ladder

Programming for Motors

The PLC DOES NOT CAREStructured Text Functions EXACTLY

the same as LadderUse what yoursquore comfortable with

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 64

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 65

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 66

IEC Function Blocks Used Here

Programming for Analogs amp PID

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 67

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 68

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 69

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 70

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 71

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 72

Sequential Function Charts were used here

Higher-Level Control

bull SFCrsquos lend themselves well to (as the name would imply) sequential processes

bull Three Important components in SFCrsquosbull Transitionsbull Stepsbull Jumps

bull The status of the process can be viewed as a flow chart

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 73

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 74

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 75

PLC - HMI Communication

A ldquoPLC Heartbeatrdquo is traditionally used to monitor the PLC - HMI Communication sometimes called ardquoWatchdog Timerrdquo

Call it whatever you want but the PLC amp 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 ldquodiesrdquo then that switch doesnrsquot change state and an alarm alerts the operator

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 76

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 77

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 78

TUTORIAL

Part 2B

HMI Programming

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 79

Ethernet (TCPIP) IO Driver

The Ethernet (TCPIP) IO Driver allows the HMI to communicate with the PLC (In this case the driver is called MBENETEXE)

The PLC has an ethernet module in one of the slots that has a ldquoCAT5RJ-45rdquo 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 ldquoCAT5RJ-45rdquo receptacle for the ethernet cable

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 80

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 81

Operator Screens amp Popup Displays

The display is laid out in 3 sections

bull Upper - Security amp Alarm Windowbull Middle- Main Operator Screens bull Lower - Menu amp Popup Displays

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 82

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 83

Scripting

There are 6 types of ldquoScriptsrdquobull Application Scriptsbull Key Scriptsbull Condition Scriptsbull Data Change Scriptsbull Quick Function Scriptsbull ActiveX Event Scripts

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 84

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 85

Access Names

The ldquoAccess Namesrdquo Must be configured to allow the PLC - HMI communications

Note that the ldquoApplicationTopicrdquo is the same as the IO Driver

The ldquocomputer namerdquo is the name of the PC that the HMI is running on (brad_s_carlberg in this case)

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 86

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 87

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 88

Indirect Tags

ldquoIndirect Tagsrdquo were used here to minimize the number of popup displays

This is especially useful in HMIrsquos with many tags

ONLY 12 popup displays are reused throughout the HMI

This gives the HMI a ldquoDCS-Likerdquo Look amp Feel

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 89

Popup Display TypesThe tag point type determines which popup display to use

Analog InputHIC (or Analog Output)PID (or Analog Composite)

bull PID WITH AUTO amp CASCADE amp RATIObull PID WITH AUTO amp RATIO

Diginbull Motor Status

DigOutMotor (or Digital Composite)

bull Motor with ILock and PermNumericSet TimersAlarm DetailAlarm Tags

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 90

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 91

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 92

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 93

Bars Buttons amp Sliders

By choosing to use indirect tags we complicate the Bar Graphs Buttons amp Sliders in the popup displays

Different scales need to be used for different engineering unit ranges

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 94

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 95

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 96

Popup Displays

The next two pages shows how the individual popup displays use the indirect tags

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 97

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 98

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 99

Adding a ldquoTouch Targetrdquo to a Display

2 Tell which tags to use

3 Tell which popup display to call upWhat kind of point type is it

3 Steps1 Tell which scale to use (if itrsquos an analog point type)

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 100

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 101

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 102

TUTORIAL

Part 2C

Excel Spreadsheets

amp

Visual Basic

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 103

A ldquoCHEAP amp DIRTYrdquo HMI With Excel

The 4 key parameters are

To communicate with the PLCUse brad_s_carlbergmbenet|ANOXIC_OXICrsquoplcregisterrsquo

Excel uses ldquopeeksrdquo amp ldquopokesrdquo to read from amp write to a PLC or HMI

To communicate with the HMIbrad_s_carlbergview|Tagnamersquotagnamersquo

bull computer namebull applicationbull topicbull item

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 104

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 105

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 106

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 107

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 108

Excel Macros

bull ldquoRequestrdquo Macro to read values

bull ldquoPokerdquo Macro to write values

bull A Sample Excel Macro

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 109

Sub PokeMacro()MsgBox ApplicationNetworkTemplatesPathChannel = ApplicationDDEInitiate(app=brad_s_carlbergVIEW topic=Tagname) This opens a DDE channel to ViewApplicationDDEPoke Channel Temperature1 Worksheets(Sheet1)Range(A1) Puts value from R1C1 into Temperature1ApplicationDDEPoke Channel DDEReal Worksheets(Sheet1)Range(A2) Puts value from R1C1 into Temperature1ApplicationDDEPoke Channel DDEInteger Worksheets(Sheet1)Range(A3) Puts value from R1C1 into Temperature1ApplicationDDETerminate Channel This terminates the DDE channelEnd SubSub RequestMacro()Channel = ApplicationDDEInitiate(app=brad_s_carlbergVIEW topic=Tagname) This opens a DDE channel to ViewWorksheets(Sheet1)Range(C4) = ApplicationDDERequest(Channel $Hour)Worksheets(Sheet1)Range(C5) = ApplicationDDERequest(Channel $Minute)Worksheets(Sheet1)Range(C6) = ApplicationDDERequest(Channel $Second)Worksheets(Sheet1)Range(C9) = ApplicationDDERequest(Channel $day)Worksheets(Sheet1)Range(C10) = ApplicationDDERequest(Channel $date)Worksheets(Sheet1)Range(C11) = ApplicationDDERequest(Channel $datestring)Worksheets(Sheet1)Range(C12) = ApplicationDDERequest(Channel $datetime)Worksheets(Sheet1)Range(C13) = ApplicationDDERequest(Channel $date)Worksheets(Sheet1)Range(C14) = ApplicationDDERequest(Channel $month)Worksheets(Sheet1)Range(C15) = ApplicationDDERequest(Channel $year)Worksheets(Sheet1)Range(C16) = ApplicationDDERequest(Channel $time)Worksheets(Sheet1)Range(C17) = ApplicationDDERequest(Channel $timestring)Worksheets(Sheet1)Range(C18) = ApplicationDDERequest(Channel $applicationversion)Worksheets(Sheet1)Range(C19) = ApplicationDDERequest(Channel $startddeconversations)Worksheets(Sheet1)Range(C20) = ApplicationDDERequest(Channel $accesslevel)Worksheets(Sheet1)Range(C21) = ApplicationDDERequest(Channel $alarmlogging)Worksheets(Sheet1)Range(C22) = ApplicationDDERequest(Channel $applicationchanged)Worksheets(Sheet1)Range(C23) = ApplicationDDERequest(Channel $configureusers)Worksheets(Sheet1)Range(C24) = ApplicationDDERequest(Channel $changepassword)Worksheets(Sheet1)Range(C25) = ApplicationDDERequest(Channel $InactivityTimeout)Worksheets(Sheet1)Range(C26) = ApplicationDDERequest(Channel $InactivityWarning)Worksheets(Sheet1)Range(C27) = ApplicationDDERequest(Channel $LogicRunning)Worksheets(Sheet1)Range(C28) = ApplicationDDERequest(Channel $OperatorEntered)Worksheets(Sheet1)Range(C29) = ApplicationDDERequest(Channel $Operator)Worksheets(Sheet1)Range(C30) = ApplicationDDERequest(Channel $PasswordEntered)ApplicationDDETerminate Channel This terminates the DDE channelEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 110

Visual Basic

ldquoRoll Your Ownrdquo HMI - Much More powerful than Excel

Key Parameters computer nameapplication|topicitem

IO Emulator - MBPlusSimulateexe

Can ldquoRead Fromrdquo amp ldquoWrite Tordquo PLC andor HMI

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 111

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 112

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 113

Dim PauseTime Start Finish TotalTime As Integer Declare variables

Private Sub txtAIT_332A_SCALED_Change()On Error GoTo PokeAIT_332AErrortxtAIT_332A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtAIT_332A_SCALEDText = Int((3 Rnd) + 20) Generate random value between 20 and 23txtAIT_332A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtAIT_332A_SCALEDLinkItem = AIT_332A_SCALEDtxtAIT_332A_SCALEDLinkMode = 2txtAIT_332A_SCALEDLinkPoketxtAIT_332A_SCALEDLinkMode = 0 DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total time

PokeAIT_332AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtAIT_332A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 114

Private Sub txtAIT_346A_SCALED_Change()On Error GoTo PokeAIT_346AErrortxtAIT_346A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtAIT_346A_SCALEDText = Int((3 Rnd) + 15) Generate random value between 15 and 18txtAIT_346A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtAIT_346A_SCALEDLinkItem = AIT_346A_SCALEDtxtAIT_346A_SCALEDLinkMode = 2txtAIT_346A_SCALEDLinkPoketxtAIT_346A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeAIT_346AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtAIT_346A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 115

Private Sub txtFIT_321A_SCALED_Change()On Error GoTo PokeFIT_321AErrortxtFIT_321A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtFIT_321A_SCALEDText = Int((10 Rnd) + 120) Generate random value between 120 and 130txtFIT_321A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_321A_SCALEDLinkItem = FIT_321A_SCALEDtxtFIT_321A_SCALEDLinkMode = 2txtFIT_321A_SCALEDLinkPoketxtFIT_321A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total time

PokeFIT_321AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_321A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume Next

End Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 116

Private Sub txtFIT_341A_SCALED_Change()On Error GoTo PokeFIT_341AErrortxtFIT_341A_SCALEDLinkMode = 0 PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTime

txtFIT_341A_SCALEDText = Int((3 Rnd) + 18) Generate random value between 18 and 21

txtFIT_341A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_341A_SCALEDLinkItem = FIT_341A_SCALEDtxtFIT_341A_SCALEDLinkMode = 2txtFIT_341A_SCALEDLinkPoketxtFIT_341A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeFIT_341AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_341A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 117

Private Sub txtFIT_343A_SCALED_Change()On Error GoTo PokeFIT_343AErrortxtFIT_343A_SCALEDLinkMode = 0 PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTime

txtFIT_343A_SCALEDText = Int((1 Rnd) + 3) Generate random value between 3 and 4

txtFIT_343A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_343A_SCALEDLinkItem = FIT_343A_SCALEDtxtFIT_343A_SCALEDLinkMode = 2txtFIT_343A_SCALEDLinkPoketxtFIT_343A_SCALEDLinkMode = 0 DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeFIT_343AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_343A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 118

TUTORIAL

Part 4

Questions

amp

Answers

  • Slide 1
  • Slide 2
  • Slide 3
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Slide 8
  • Slide 9
  • Slide 10
  • Slide 11
  • Slide 12
  • Slide 13
  • Slide 14
  • Slide 15
  • Slide 16
  • Slide 17
  • Slide 18
  • Slide 19
  • Slide 20
  • Slide 21
  • Slide 22
  • Slide 23
  • Slide 24
  • Slide 25
  • Slide 26
  • Slide 27
  • Slide 28
  • Slide 29
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
  • Slide 34
  • Slide 35
  • Slide 36
  • Slide 37
  • Slide 38
  • Slide 39
  • Slide 40
  • Slide 41
  • Slide 42
  • Slide 43
  • Slide 44
  • Slide 45
  • Slide 46
  • Slide 47
  • Slide 48
  • Slide 49
  • Slide 50
  • Slide 51
  • Slide 52
  • Slide 53
  • Slide 54
  • Slide 55
  • Slide 56
  • Slide 57
  • Slide 58
  • Slide 59
  • Slide 60
  • Slide 61
  • Slide 62
  • Slide 63
  • Slide 64
  • Slide 65
  • Slide 66
  • Slide 67
  • Slide 68
  • Slide 69
  • Slide 70
  • Slide 71
  • Slide 72
  • Slide 73
  • Slide 74
  • Slide 75
  • Slide 76
  • Slide 77
  • Slide 78
  • Slide 79
  • Slide 80
  • Slide 81
  • Slide 82
  • Slide 83
  • Slide 84
  • Slide 85
  • Slide 86
  • Slide 87
  • Slide 88
  • Slide 89
  • Slide 90
  • Slide 91
  • Slide 92
  • Slide 93
  • Slide 94
  • Slide 95
  • Slide 96
  • Slide 97
  • Slide 98
  • Slide 99
  • Slide 100
  • Slide 101
  • Slide 102
  • Slide 103
  • Slide 104
  • Slide 105
  • Slide 106
  • Slide 107
  • Slide 108
  • Slide 109
  • Slide 110
  • Slide 111
  • Slide 112
  • Slide 113
  • Slide 114
  • Slide 115
  • Slide 116
  • Slide 117
  • Slide 118
Page 34: TUTORIAL Ethernet PLC's Improve Oxygen Consumption ISA Expo/2001Houston, Texas Water & Wastewater Industry DivisionTuesday, September 11, 2001 1 Brad.

Motor Popup Surface Aerator Control

The following information is available for motor control from the motor popup

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 35

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 36

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 37

Lower Explosive Level (LEL)

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 38

Each train has a digital input that tells whether thecombustible 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 (LEL) system

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 39

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 Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 40

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 41

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 Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 42

Like a DCS

middot 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

middot 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 amp CASCADE amp RATIO PID WITH AUTO amp RATIO Digin Motor Status DigOut Motor (or Digital Composite) Motor with ILock and Perm Numeric Set Timers Alarm Detail and Alarm Tags

middot A single generic trend display to trend ALL trendable (archived) points

Alarm Management

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

middot A Distributed Alarm Summary has been used to give better alarm management tools

bull Up to eight trend pens on the trend display

bull The operator picks which values to trend by clicking in the center of the trend

display

bull 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 44

The AnoxicOxic 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 Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 46

The following control levels are available for Oxygen1 Cascade from Dissolved Oxygen

2 Ratio from Discharge flow3 Auto-Manual Control

The following control levels are available for the Recycle flow1 Ratio from Discharge flow

2 Auto-Manual Control

The following control levels are available for the PD Blowers3 Timed Mode

2 Dissolved Oxygen Mode3 Manual Mode

Conclusions

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 47

Following the commissioning of the ethernet-based PLCs Oxygen consumption was significantly reduced

The advanced controls allow the operators to leave the process alone and continue to optimally treat the sewage

Conclusions

Following the commissioning of the ethernet-based PLCs AnoxicOxic 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 Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 48

Summary

The PD Blowers ran in Timed Mode andor 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

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 Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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 Authoritys 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 50

TUTORIAL

Part 2A

PLC Programming Basics

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 51

Separate parts of the process have been organized into a separate ldquoSECTIONrdquo

PLC Program Organization

Each ldquoSECTIONrdquo can be any of the IEC programming types

bull Ladder (LD)bull Structured Text (ST)

bull Instruction List (IL)

bull Function Blocks (FB)bull Sequential Function Charts (SFC)

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 52

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 53

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 54

IO Map

On-Line PLC Diagnostics

PLC Status

PLC Simulator

Ethernet (TCPIP) Address

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 55

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 56

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 57

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 58

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 59

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 60

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 61

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 62

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 63

Structured Text was used hereNOT Ladder

Programming for Motors

The PLC DOES NOT CAREStructured Text Functions EXACTLY

the same as LadderUse what yoursquore comfortable with

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 64

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 65

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 66

IEC Function Blocks Used Here

Programming for Analogs amp PID

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 67

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 68

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 69

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 70

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 71

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 72

Sequential Function Charts were used here

Higher-Level Control

bull SFCrsquos lend themselves well to (as the name would imply) sequential processes

bull Three Important components in SFCrsquosbull Transitionsbull Stepsbull Jumps

bull The status of the process can be viewed as a flow chart

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 73

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 74

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 75

PLC - HMI Communication

A ldquoPLC Heartbeatrdquo is traditionally used to monitor the PLC - HMI Communication sometimes called ardquoWatchdog Timerrdquo

Call it whatever you want but the PLC amp 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 ldquodiesrdquo then that switch doesnrsquot change state and an alarm alerts the operator

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 76

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 77

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 78

TUTORIAL

Part 2B

HMI Programming

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 79

Ethernet (TCPIP) IO Driver

The Ethernet (TCPIP) IO Driver allows the HMI to communicate with the PLC (In this case the driver is called MBENETEXE)

The PLC has an ethernet module in one of the slots that has a ldquoCAT5RJ-45rdquo 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 ldquoCAT5RJ-45rdquo receptacle for the ethernet cable

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 80

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 81

Operator Screens amp Popup Displays

The display is laid out in 3 sections

bull Upper - Security amp Alarm Windowbull Middle- Main Operator Screens bull Lower - Menu amp Popup Displays

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 82

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 83

Scripting

There are 6 types of ldquoScriptsrdquobull Application Scriptsbull Key Scriptsbull Condition Scriptsbull Data Change Scriptsbull Quick Function Scriptsbull ActiveX Event Scripts

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 84

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 85

Access Names

The ldquoAccess Namesrdquo Must be configured to allow the PLC - HMI communications

Note that the ldquoApplicationTopicrdquo is the same as the IO Driver

The ldquocomputer namerdquo is the name of the PC that the HMI is running on (brad_s_carlberg in this case)

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 86

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 87

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 88

Indirect Tags

ldquoIndirect Tagsrdquo were used here to minimize the number of popup displays

This is especially useful in HMIrsquos with many tags

ONLY 12 popup displays are reused throughout the HMI

This gives the HMI a ldquoDCS-Likerdquo Look amp Feel

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 89

Popup Display TypesThe tag point type determines which popup display to use

Analog InputHIC (or Analog Output)PID (or Analog Composite)

bull PID WITH AUTO amp CASCADE amp RATIObull PID WITH AUTO amp RATIO

Diginbull Motor Status

DigOutMotor (or Digital Composite)

bull Motor with ILock and PermNumericSet TimersAlarm DetailAlarm Tags

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 90

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 91

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 92

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 93

Bars Buttons amp Sliders

By choosing to use indirect tags we complicate the Bar Graphs Buttons amp Sliders in the popup displays

Different scales need to be used for different engineering unit ranges

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 94

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 95

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 96

Popup Displays

The next two pages shows how the individual popup displays use the indirect tags

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 97

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 98

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 99

Adding a ldquoTouch Targetrdquo to a Display

2 Tell which tags to use

3 Tell which popup display to call upWhat kind of point type is it

3 Steps1 Tell which scale to use (if itrsquos an analog point type)

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 100

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 101

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 102

TUTORIAL

Part 2C

Excel Spreadsheets

amp

Visual Basic

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 103

A ldquoCHEAP amp DIRTYrdquo HMI With Excel

The 4 key parameters are

To communicate with the PLCUse brad_s_carlbergmbenet|ANOXIC_OXICrsquoplcregisterrsquo

Excel uses ldquopeeksrdquo amp ldquopokesrdquo to read from amp write to a PLC or HMI

To communicate with the HMIbrad_s_carlbergview|Tagnamersquotagnamersquo

bull computer namebull applicationbull topicbull item

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 104

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 105

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 106

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 107

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 108

Excel Macros

bull ldquoRequestrdquo Macro to read values

bull ldquoPokerdquo Macro to write values

bull A Sample Excel Macro

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 109

Sub PokeMacro()MsgBox ApplicationNetworkTemplatesPathChannel = ApplicationDDEInitiate(app=brad_s_carlbergVIEW topic=Tagname) This opens a DDE channel to ViewApplicationDDEPoke Channel Temperature1 Worksheets(Sheet1)Range(A1) Puts value from R1C1 into Temperature1ApplicationDDEPoke Channel DDEReal Worksheets(Sheet1)Range(A2) Puts value from R1C1 into Temperature1ApplicationDDEPoke Channel DDEInteger Worksheets(Sheet1)Range(A3) Puts value from R1C1 into Temperature1ApplicationDDETerminate Channel This terminates the DDE channelEnd SubSub RequestMacro()Channel = ApplicationDDEInitiate(app=brad_s_carlbergVIEW topic=Tagname) This opens a DDE channel to ViewWorksheets(Sheet1)Range(C4) = ApplicationDDERequest(Channel $Hour)Worksheets(Sheet1)Range(C5) = ApplicationDDERequest(Channel $Minute)Worksheets(Sheet1)Range(C6) = ApplicationDDERequest(Channel $Second)Worksheets(Sheet1)Range(C9) = ApplicationDDERequest(Channel $day)Worksheets(Sheet1)Range(C10) = ApplicationDDERequest(Channel $date)Worksheets(Sheet1)Range(C11) = ApplicationDDERequest(Channel $datestring)Worksheets(Sheet1)Range(C12) = ApplicationDDERequest(Channel $datetime)Worksheets(Sheet1)Range(C13) = ApplicationDDERequest(Channel $date)Worksheets(Sheet1)Range(C14) = ApplicationDDERequest(Channel $month)Worksheets(Sheet1)Range(C15) = ApplicationDDERequest(Channel $year)Worksheets(Sheet1)Range(C16) = ApplicationDDERequest(Channel $time)Worksheets(Sheet1)Range(C17) = ApplicationDDERequest(Channel $timestring)Worksheets(Sheet1)Range(C18) = ApplicationDDERequest(Channel $applicationversion)Worksheets(Sheet1)Range(C19) = ApplicationDDERequest(Channel $startddeconversations)Worksheets(Sheet1)Range(C20) = ApplicationDDERequest(Channel $accesslevel)Worksheets(Sheet1)Range(C21) = ApplicationDDERequest(Channel $alarmlogging)Worksheets(Sheet1)Range(C22) = ApplicationDDERequest(Channel $applicationchanged)Worksheets(Sheet1)Range(C23) = ApplicationDDERequest(Channel $configureusers)Worksheets(Sheet1)Range(C24) = ApplicationDDERequest(Channel $changepassword)Worksheets(Sheet1)Range(C25) = ApplicationDDERequest(Channel $InactivityTimeout)Worksheets(Sheet1)Range(C26) = ApplicationDDERequest(Channel $InactivityWarning)Worksheets(Sheet1)Range(C27) = ApplicationDDERequest(Channel $LogicRunning)Worksheets(Sheet1)Range(C28) = ApplicationDDERequest(Channel $OperatorEntered)Worksheets(Sheet1)Range(C29) = ApplicationDDERequest(Channel $Operator)Worksheets(Sheet1)Range(C30) = ApplicationDDERequest(Channel $PasswordEntered)ApplicationDDETerminate Channel This terminates the DDE channelEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 110

Visual Basic

ldquoRoll Your Ownrdquo HMI - Much More powerful than Excel

Key Parameters computer nameapplication|topicitem

IO Emulator - MBPlusSimulateexe

Can ldquoRead Fromrdquo amp ldquoWrite Tordquo PLC andor HMI

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 111

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 112

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 113

Dim PauseTime Start Finish TotalTime As Integer Declare variables

Private Sub txtAIT_332A_SCALED_Change()On Error GoTo PokeAIT_332AErrortxtAIT_332A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtAIT_332A_SCALEDText = Int((3 Rnd) + 20) Generate random value between 20 and 23txtAIT_332A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtAIT_332A_SCALEDLinkItem = AIT_332A_SCALEDtxtAIT_332A_SCALEDLinkMode = 2txtAIT_332A_SCALEDLinkPoketxtAIT_332A_SCALEDLinkMode = 0 DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total time

PokeAIT_332AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtAIT_332A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 114

Private Sub txtAIT_346A_SCALED_Change()On Error GoTo PokeAIT_346AErrortxtAIT_346A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtAIT_346A_SCALEDText = Int((3 Rnd) + 15) Generate random value between 15 and 18txtAIT_346A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtAIT_346A_SCALEDLinkItem = AIT_346A_SCALEDtxtAIT_346A_SCALEDLinkMode = 2txtAIT_346A_SCALEDLinkPoketxtAIT_346A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeAIT_346AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtAIT_346A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 115

Private Sub txtFIT_321A_SCALED_Change()On Error GoTo PokeFIT_321AErrortxtFIT_321A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtFIT_321A_SCALEDText = Int((10 Rnd) + 120) Generate random value between 120 and 130txtFIT_321A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_321A_SCALEDLinkItem = FIT_321A_SCALEDtxtFIT_321A_SCALEDLinkMode = 2txtFIT_321A_SCALEDLinkPoketxtFIT_321A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total time

PokeFIT_321AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_321A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume Next

End Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 116

Private Sub txtFIT_341A_SCALED_Change()On Error GoTo PokeFIT_341AErrortxtFIT_341A_SCALEDLinkMode = 0 PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTime

txtFIT_341A_SCALEDText = Int((3 Rnd) + 18) Generate random value between 18 and 21

txtFIT_341A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_341A_SCALEDLinkItem = FIT_341A_SCALEDtxtFIT_341A_SCALEDLinkMode = 2txtFIT_341A_SCALEDLinkPoketxtFIT_341A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeFIT_341AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_341A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 117

Private Sub txtFIT_343A_SCALED_Change()On Error GoTo PokeFIT_343AErrortxtFIT_343A_SCALEDLinkMode = 0 PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTime

txtFIT_343A_SCALEDText = Int((1 Rnd) + 3) Generate random value between 3 and 4

txtFIT_343A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_343A_SCALEDLinkItem = FIT_343A_SCALEDtxtFIT_343A_SCALEDLinkMode = 2txtFIT_343A_SCALEDLinkPoketxtFIT_343A_SCALEDLinkMode = 0 DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeFIT_343AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_343A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 118

TUTORIAL

Part 4

Questions

amp

Answers

  • Slide 1
  • Slide 2
  • Slide 3
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Slide 8
  • Slide 9
  • Slide 10
  • Slide 11
  • Slide 12
  • Slide 13
  • Slide 14
  • Slide 15
  • Slide 16
  • Slide 17
  • Slide 18
  • Slide 19
  • Slide 20
  • Slide 21
  • Slide 22
  • Slide 23
  • Slide 24
  • Slide 25
  • Slide 26
  • Slide 27
  • Slide 28
  • Slide 29
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
  • Slide 34
  • Slide 35
  • Slide 36
  • Slide 37
  • Slide 38
  • Slide 39
  • Slide 40
  • Slide 41
  • Slide 42
  • Slide 43
  • Slide 44
  • Slide 45
  • Slide 46
  • Slide 47
  • Slide 48
  • Slide 49
  • Slide 50
  • Slide 51
  • Slide 52
  • Slide 53
  • Slide 54
  • Slide 55
  • Slide 56
  • Slide 57
  • Slide 58
  • Slide 59
  • Slide 60
  • Slide 61
  • Slide 62
  • Slide 63
  • Slide 64
  • Slide 65
  • Slide 66
  • Slide 67
  • Slide 68
  • Slide 69
  • Slide 70
  • Slide 71
  • Slide 72
  • Slide 73
  • Slide 74
  • Slide 75
  • Slide 76
  • Slide 77
  • Slide 78
  • Slide 79
  • Slide 80
  • Slide 81
  • Slide 82
  • Slide 83
  • Slide 84
  • Slide 85
  • Slide 86
  • Slide 87
  • Slide 88
  • Slide 89
  • Slide 90
  • Slide 91
  • Slide 92
  • Slide 93
  • Slide 94
  • Slide 95
  • Slide 96
  • Slide 97
  • Slide 98
  • Slide 99
  • Slide 100
  • Slide 101
  • Slide 102
  • Slide 103
  • Slide 104
  • Slide 105
  • Slide 106
  • Slide 107
  • Slide 108
  • Slide 109
  • Slide 110
  • Slide 111
  • Slide 112
  • Slide 113
  • Slide 114
  • Slide 115
  • Slide 116
  • Slide 117
  • Slide 118
Page 35: TUTORIAL Ethernet PLC's Improve Oxygen Consumption ISA Expo/2001Houston, Texas Water & Wastewater Industry DivisionTuesday, September 11, 2001 1 Brad.

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 35

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 36

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 37

Lower Explosive Level (LEL)

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 38

Each train has a digital input that tells whether thecombustible 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 (LEL) system

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 39

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 Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 40

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 41

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 Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 42

Like a DCS

middot 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

middot 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 amp CASCADE amp RATIO PID WITH AUTO amp RATIO Digin Motor Status DigOut Motor (or Digital Composite) Motor with ILock and Perm Numeric Set Timers Alarm Detail and Alarm Tags

middot A single generic trend display to trend ALL trendable (archived) points

Alarm Management

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

middot A Distributed Alarm Summary has been used to give better alarm management tools

bull Up to eight trend pens on the trend display

bull The operator picks which values to trend by clicking in the center of the trend

display

bull 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 44

The AnoxicOxic 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 Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 46

The following control levels are available for Oxygen1 Cascade from Dissolved Oxygen

2 Ratio from Discharge flow3 Auto-Manual Control

The following control levels are available for the Recycle flow1 Ratio from Discharge flow

2 Auto-Manual Control

The following control levels are available for the PD Blowers3 Timed Mode

2 Dissolved Oxygen Mode3 Manual Mode

Conclusions

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 47

Following the commissioning of the ethernet-based PLCs Oxygen consumption was significantly reduced

The advanced controls allow the operators to leave the process alone and continue to optimally treat the sewage

Conclusions

Following the commissioning of the ethernet-based PLCs AnoxicOxic 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 Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 48

Summary

The PD Blowers ran in Timed Mode andor 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

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 Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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 Authoritys 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 50

TUTORIAL

Part 2A

PLC Programming Basics

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 51

Separate parts of the process have been organized into a separate ldquoSECTIONrdquo

PLC Program Organization

Each ldquoSECTIONrdquo can be any of the IEC programming types

bull Ladder (LD)bull Structured Text (ST)

bull Instruction List (IL)

bull Function Blocks (FB)bull Sequential Function Charts (SFC)

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 52

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 53

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 54

IO Map

On-Line PLC Diagnostics

PLC Status

PLC Simulator

Ethernet (TCPIP) Address

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 55

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 56

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 57

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 58

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 59

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 60

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 61

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 62

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 63

Structured Text was used hereNOT Ladder

Programming for Motors

The PLC DOES NOT CAREStructured Text Functions EXACTLY

the same as LadderUse what yoursquore comfortable with

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 64

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 65

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 66

IEC Function Blocks Used Here

Programming for Analogs amp PID

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 67

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 68

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 69

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 70

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 71

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 72

Sequential Function Charts were used here

Higher-Level Control

bull SFCrsquos lend themselves well to (as the name would imply) sequential processes

bull Three Important components in SFCrsquosbull Transitionsbull Stepsbull Jumps

bull The status of the process can be viewed as a flow chart

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 73

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 74

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 75

PLC - HMI Communication

A ldquoPLC Heartbeatrdquo is traditionally used to monitor the PLC - HMI Communication sometimes called ardquoWatchdog Timerrdquo

Call it whatever you want but the PLC amp 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 ldquodiesrdquo then that switch doesnrsquot change state and an alarm alerts the operator

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 76

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 77

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 78

TUTORIAL

Part 2B

HMI Programming

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 79

Ethernet (TCPIP) IO Driver

The Ethernet (TCPIP) IO Driver allows the HMI to communicate with the PLC (In this case the driver is called MBENETEXE)

The PLC has an ethernet module in one of the slots that has a ldquoCAT5RJ-45rdquo 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 ldquoCAT5RJ-45rdquo receptacle for the ethernet cable

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 80

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 81

Operator Screens amp Popup Displays

The display is laid out in 3 sections

bull Upper - Security amp Alarm Windowbull Middle- Main Operator Screens bull Lower - Menu amp Popup Displays

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 82

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 83

Scripting

There are 6 types of ldquoScriptsrdquobull Application Scriptsbull Key Scriptsbull Condition Scriptsbull Data Change Scriptsbull Quick Function Scriptsbull ActiveX Event Scripts

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 84

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 85

Access Names

The ldquoAccess Namesrdquo Must be configured to allow the PLC - HMI communications

Note that the ldquoApplicationTopicrdquo is the same as the IO Driver

The ldquocomputer namerdquo is the name of the PC that the HMI is running on (brad_s_carlberg in this case)

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 86

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 87

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 88

Indirect Tags

ldquoIndirect Tagsrdquo were used here to minimize the number of popup displays

This is especially useful in HMIrsquos with many tags

ONLY 12 popup displays are reused throughout the HMI

This gives the HMI a ldquoDCS-Likerdquo Look amp Feel

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 89

Popup Display TypesThe tag point type determines which popup display to use

Analog InputHIC (or Analog Output)PID (or Analog Composite)

bull PID WITH AUTO amp CASCADE amp RATIObull PID WITH AUTO amp RATIO

Diginbull Motor Status

DigOutMotor (or Digital Composite)

bull Motor with ILock and PermNumericSet TimersAlarm DetailAlarm Tags

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 90

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 91

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 92

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 93

Bars Buttons amp Sliders

By choosing to use indirect tags we complicate the Bar Graphs Buttons amp Sliders in the popup displays

Different scales need to be used for different engineering unit ranges

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 94

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 95

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 96

Popup Displays

The next two pages shows how the individual popup displays use the indirect tags

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 97

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 98

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 99

Adding a ldquoTouch Targetrdquo to a Display

2 Tell which tags to use

3 Tell which popup display to call upWhat kind of point type is it

3 Steps1 Tell which scale to use (if itrsquos an analog point type)

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 100

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 101

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 102

TUTORIAL

Part 2C

Excel Spreadsheets

amp

Visual Basic

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 103

A ldquoCHEAP amp DIRTYrdquo HMI With Excel

The 4 key parameters are

To communicate with the PLCUse brad_s_carlbergmbenet|ANOXIC_OXICrsquoplcregisterrsquo

Excel uses ldquopeeksrdquo amp ldquopokesrdquo to read from amp write to a PLC or HMI

To communicate with the HMIbrad_s_carlbergview|Tagnamersquotagnamersquo

bull computer namebull applicationbull topicbull item

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 104

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 105

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 106

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 107

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 108

Excel Macros

bull ldquoRequestrdquo Macro to read values

bull ldquoPokerdquo Macro to write values

bull A Sample Excel Macro

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 109

Sub PokeMacro()MsgBox ApplicationNetworkTemplatesPathChannel = ApplicationDDEInitiate(app=brad_s_carlbergVIEW topic=Tagname) This opens a DDE channel to ViewApplicationDDEPoke Channel Temperature1 Worksheets(Sheet1)Range(A1) Puts value from R1C1 into Temperature1ApplicationDDEPoke Channel DDEReal Worksheets(Sheet1)Range(A2) Puts value from R1C1 into Temperature1ApplicationDDEPoke Channel DDEInteger Worksheets(Sheet1)Range(A3) Puts value from R1C1 into Temperature1ApplicationDDETerminate Channel This terminates the DDE channelEnd SubSub RequestMacro()Channel = ApplicationDDEInitiate(app=brad_s_carlbergVIEW topic=Tagname) This opens a DDE channel to ViewWorksheets(Sheet1)Range(C4) = ApplicationDDERequest(Channel $Hour)Worksheets(Sheet1)Range(C5) = ApplicationDDERequest(Channel $Minute)Worksheets(Sheet1)Range(C6) = ApplicationDDERequest(Channel $Second)Worksheets(Sheet1)Range(C9) = ApplicationDDERequest(Channel $day)Worksheets(Sheet1)Range(C10) = ApplicationDDERequest(Channel $date)Worksheets(Sheet1)Range(C11) = ApplicationDDERequest(Channel $datestring)Worksheets(Sheet1)Range(C12) = ApplicationDDERequest(Channel $datetime)Worksheets(Sheet1)Range(C13) = ApplicationDDERequest(Channel $date)Worksheets(Sheet1)Range(C14) = ApplicationDDERequest(Channel $month)Worksheets(Sheet1)Range(C15) = ApplicationDDERequest(Channel $year)Worksheets(Sheet1)Range(C16) = ApplicationDDERequest(Channel $time)Worksheets(Sheet1)Range(C17) = ApplicationDDERequest(Channel $timestring)Worksheets(Sheet1)Range(C18) = ApplicationDDERequest(Channel $applicationversion)Worksheets(Sheet1)Range(C19) = ApplicationDDERequest(Channel $startddeconversations)Worksheets(Sheet1)Range(C20) = ApplicationDDERequest(Channel $accesslevel)Worksheets(Sheet1)Range(C21) = ApplicationDDERequest(Channel $alarmlogging)Worksheets(Sheet1)Range(C22) = ApplicationDDERequest(Channel $applicationchanged)Worksheets(Sheet1)Range(C23) = ApplicationDDERequest(Channel $configureusers)Worksheets(Sheet1)Range(C24) = ApplicationDDERequest(Channel $changepassword)Worksheets(Sheet1)Range(C25) = ApplicationDDERequest(Channel $InactivityTimeout)Worksheets(Sheet1)Range(C26) = ApplicationDDERequest(Channel $InactivityWarning)Worksheets(Sheet1)Range(C27) = ApplicationDDERequest(Channel $LogicRunning)Worksheets(Sheet1)Range(C28) = ApplicationDDERequest(Channel $OperatorEntered)Worksheets(Sheet1)Range(C29) = ApplicationDDERequest(Channel $Operator)Worksheets(Sheet1)Range(C30) = ApplicationDDERequest(Channel $PasswordEntered)ApplicationDDETerminate Channel This terminates the DDE channelEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 110

Visual Basic

ldquoRoll Your Ownrdquo HMI - Much More powerful than Excel

Key Parameters computer nameapplication|topicitem

IO Emulator - MBPlusSimulateexe

Can ldquoRead Fromrdquo amp ldquoWrite Tordquo PLC andor HMI

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 111

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 112

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 113

Dim PauseTime Start Finish TotalTime As Integer Declare variables

Private Sub txtAIT_332A_SCALED_Change()On Error GoTo PokeAIT_332AErrortxtAIT_332A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtAIT_332A_SCALEDText = Int((3 Rnd) + 20) Generate random value between 20 and 23txtAIT_332A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtAIT_332A_SCALEDLinkItem = AIT_332A_SCALEDtxtAIT_332A_SCALEDLinkMode = 2txtAIT_332A_SCALEDLinkPoketxtAIT_332A_SCALEDLinkMode = 0 DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total time

PokeAIT_332AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtAIT_332A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 114

Private Sub txtAIT_346A_SCALED_Change()On Error GoTo PokeAIT_346AErrortxtAIT_346A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtAIT_346A_SCALEDText = Int((3 Rnd) + 15) Generate random value between 15 and 18txtAIT_346A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtAIT_346A_SCALEDLinkItem = AIT_346A_SCALEDtxtAIT_346A_SCALEDLinkMode = 2txtAIT_346A_SCALEDLinkPoketxtAIT_346A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeAIT_346AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtAIT_346A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 115

Private Sub txtFIT_321A_SCALED_Change()On Error GoTo PokeFIT_321AErrortxtFIT_321A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtFIT_321A_SCALEDText = Int((10 Rnd) + 120) Generate random value between 120 and 130txtFIT_321A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_321A_SCALEDLinkItem = FIT_321A_SCALEDtxtFIT_321A_SCALEDLinkMode = 2txtFIT_321A_SCALEDLinkPoketxtFIT_321A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total time

PokeFIT_321AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_321A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume Next

End Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 116

Private Sub txtFIT_341A_SCALED_Change()On Error GoTo PokeFIT_341AErrortxtFIT_341A_SCALEDLinkMode = 0 PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTime

txtFIT_341A_SCALEDText = Int((3 Rnd) + 18) Generate random value between 18 and 21

txtFIT_341A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_341A_SCALEDLinkItem = FIT_341A_SCALEDtxtFIT_341A_SCALEDLinkMode = 2txtFIT_341A_SCALEDLinkPoketxtFIT_341A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeFIT_341AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_341A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 117

Private Sub txtFIT_343A_SCALED_Change()On Error GoTo PokeFIT_343AErrortxtFIT_343A_SCALEDLinkMode = 0 PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTime

txtFIT_343A_SCALEDText = Int((1 Rnd) + 3) Generate random value between 3 and 4

txtFIT_343A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_343A_SCALEDLinkItem = FIT_343A_SCALEDtxtFIT_343A_SCALEDLinkMode = 2txtFIT_343A_SCALEDLinkPoketxtFIT_343A_SCALEDLinkMode = 0 DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeFIT_343AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_343A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 118

TUTORIAL

Part 4

Questions

amp

Answers

  • Slide 1
  • Slide 2
  • Slide 3
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Slide 8
  • Slide 9
  • Slide 10
  • Slide 11
  • Slide 12
  • Slide 13
  • Slide 14
  • Slide 15
  • Slide 16
  • Slide 17
  • Slide 18
  • Slide 19
  • Slide 20
  • Slide 21
  • Slide 22
  • Slide 23
  • Slide 24
  • Slide 25
  • Slide 26
  • Slide 27
  • Slide 28
  • Slide 29
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
  • Slide 34
  • Slide 35
  • Slide 36
  • Slide 37
  • Slide 38
  • Slide 39
  • Slide 40
  • Slide 41
  • Slide 42
  • Slide 43
  • Slide 44
  • Slide 45
  • Slide 46
  • Slide 47
  • Slide 48
  • Slide 49
  • Slide 50
  • Slide 51
  • Slide 52
  • Slide 53
  • Slide 54
  • Slide 55
  • Slide 56
  • Slide 57
  • Slide 58
  • Slide 59
  • Slide 60
  • Slide 61
  • Slide 62
  • Slide 63
  • Slide 64
  • Slide 65
  • Slide 66
  • Slide 67
  • Slide 68
  • Slide 69
  • Slide 70
  • Slide 71
  • Slide 72
  • Slide 73
  • Slide 74
  • Slide 75
  • Slide 76
  • Slide 77
  • Slide 78
  • Slide 79
  • Slide 80
  • Slide 81
  • Slide 82
  • Slide 83
  • Slide 84
  • Slide 85
  • Slide 86
  • Slide 87
  • Slide 88
  • Slide 89
  • Slide 90
  • Slide 91
  • Slide 92
  • Slide 93
  • Slide 94
  • Slide 95
  • Slide 96
  • Slide 97
  • Slide 98
  • Slide 99
  • Slide 100
  • Slide 101
  • Slide 102
  • Slide 103
  • Slide 104
  • Slide 105
  • Slide 106
  • Slide 107
  • Slide 108
  • Slide 109
  • Slide 110
  • Slide 111
  • Slide 112
  • Slide 113
  • Slide 114
  • Slide 115
  • Slide 116
  • Slide 117
  • Slide 118
Page 36: TUTORIAL Ethernet PLC's Improve Oxygen Consumption ISA Expo/2001Houston, Texas Water & Wastewater Industry DivisionTuesday, September 11, 2001 1 Brad.

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 36

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 37

Lower Explosive Level (LEL)

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 38

Each train has a digital input that tells whether thecombustible 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 (LEL) system

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 39

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 Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 40

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 41

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 Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 42

Like a DCS

middot 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

middot 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 amp CASCADE amp RATIO PID WITH AUTO amp RATIO Digin Motor Status DigOut Motor (or Digital Composite) Motor with ILock and Perm Numeric Set Timers Alarm Detail and Alarm Tags

middot A single generic trend display to trend ALL trendable (archived) points

Alarm Management

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

middot A Distributed Alarm Summary has been used to give better alarm management tools

bull Up to eight trend pens on the trend display

bull The operator picks which values to trend by clicking in the center of the trend

display

bull 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 44

The AnoxicOxic 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 Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 46

The following control levels are available for Oxygen1 Cascade from Dissolved Oxygen

2 Ratio from Discharge flow3 Auto-Manual Control

The following control levels are available for the Recycle flow1 Ratio from Discharge flow

2 Auto-Manual Control

The following control levels are available for the PD Blowers3 Timed Mode

2 Dissolved Oxygen Mode3 Manual Mode

Conclusions

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 47

Following the commissioning of the ethernet-based PLCs Oxygen consumption was significantly reduced

The advanced controls allow the operators to leave the process alone and continue to optimally treat the sewage

Conclusions

Following the commissioning of the ethernet-based PLCs AnoxicOxic 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 Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 48

Summary

The PD Blowers ran in Timed Mode andor 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

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 Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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 Authoritys 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 50

TUTORIAL

Part 2A

PLC Programming Basics

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 51

Separate parts of the process have been organized into a separate ldquoSECTIONrdquo

PLC Program Organization

Each ldquoSECTIONrdquo can be any of the IEC programming types

bull Ladder (LD)bull Structured Text (ST)

bull Instruction List (IL)

bull Function Blocks (FB)bull Sequential Function Charts (SFC)

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 52

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 53

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 54

IO Map

On-Line PLC Diagnostics

PLC Status

PLC Simulator

Ethernet (TCPIP) Address

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 55

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 56

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 57

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 58

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 59

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 60

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 61

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 62

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 63

Structured Text was used hereNOT Ladder

Programming for Motors

The PLC DOES NOT CAREStructured Text Functions EXACTLY

the same as LadderUse what yoursquore comfortable with

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 64

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 65

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 66

IEC Function Blocks Used Here

Programming for Analogs amp PID

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 67

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 68

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 69

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 70

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 71

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 72

Sequential Function Charts were used here

Higher-Level Control

bull SFCrsquos lend themselves well to (as the name would imply) sequential processes

bull Three Important components in SFCrsquosbull Transitionsbull Stepsbull Jumps

bull The status of the process can be viewed as a flow chart

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 73

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 74

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 75

PLC - HMI Communication

A ldquoPLC Heartbeatrdquo is traditionally used to monitor the PLC - HMI Communication sometimes called ardquoWatchdog Timerrdquo

Call it whatever you want but the PLC amp 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 ldquodiesrdquo then that switch doesnrsquot change state and an alarm alerts the operator

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 76

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 77

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 78

TUTORIAL

Part 2B

HMI Programming

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 79

Ethernet (TCPIP) IO Driver

The Ethernet (TCPIP) IO Driver allows the HMI to communicate with the PLC (In this case the driver is called MBENETEXE)

The PLC has an ethernet module in one of the slots that has a ldquoCAT5RJ-45rdquo 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 ldquoCAT5RJ-45rdquo receptacle for the ethernet cable

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 80

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 81

Operator Screens amp Popup Displays

The display is laid out in 3 sections

bull Upper - Security amp Alarm Windowbull Middle- Main Operator Screens bull Lower - Menu amp Popup Displays

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 82

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 83

Scripting

There are 6 types of ldquoScriptsrdquobull Application Scriptsbull Key Scriptsbull Condition Scriptsbull Data Change Scriptsbull Quick Function Scriptsbull ActiveX Event Scripts

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 84

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 85

Access Names

The ldquoAccess Namesrdquo Must be configured to allow the PLC - HMI communications

Note that the ldquoApplicationTopicrdquo is the same as the IO Driver

The ldquocomputer namerdquo is the name of the PC that the HMI is running on (brad_s_carlberg in this case)

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 86

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 87

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 88

Indirect Tags

ldquoIndirect Tagsrdquo were used here to minimize the number of popup displays

This is especially useful in HMIrsquos with many tags

ONLY 12 popup displays are reused throughout the HMI

This gives the HMI a ldquoDCS-Likerdquo Look amp Feel

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 89

Popup Display TypesThe tag point type determines which popup display to use

Analog InputHIC (or Analog Output)PID (or Analog Composite)

bull PID WITH AUTO amp CASCADE amp RATIObull PID WITH AUTO amp RATIO

Diginbull Motor Status

DigOutMotor (or Digital Composite)

bull Motor with ILock and PermNumericSet TimersAlarm DetailAlarm Tags

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 90

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 91

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 92

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 93

Bars Buttons amp Sliders

By choosing to use indirect tags we complicate the Bar Graphs Buttons amp Sliders in the popup displays

Different scales need to be used for different engineering unit ranges

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 94

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 95

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 96

Popup Displays

The next two pages shows how the individual popup displays use the indirect tags

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 97

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 98

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 99

Adding a ldquoTouch Targetrdquo to a Display

2 Tell which tags to use

3 Tell which popup display to call upWhat kind of point type is it

3 Steps1 Tell which scale to use (if itrsquos an analog point type)

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 100

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 101

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 102

TUTORIAL

Part 2C

Excel Spreadsheets

amp

Visual Basic

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 103

A ldquoCHEAP amp DIRTYrdquo HMI With Excel

The 4 key parameters are

To communicate with the PLCUse brad_s_carlbergmbenet|ANOXIC_OXICrsquoplcregisterrsquo

Excel uses ldquopeeksrdquo amp ldquopokesrdquo to read from amp write to a PLC or HMI

To communicate with the HMIbrad_s_carlbergview|Tagnamersquotagnamersquo

bull computer namebull applicationbull topicbull item

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 104

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 105

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 106

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 107

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 108

Excel Macros

bull ldquoRequestrdquo Macro to read values

bull ldquoPokerdquo Macro to write values

bull A Sample Excel Macro

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 109

Sub PokeMacro()MsgBox ApplicationNetworkTemplatesPathChannel = ApplicationDDEInitiate(app=brad_s_carlbergVIEW topic=Tagname) This opens a DDE channel to ViewApplicationDDEPoke Channel Temperature1 Worksheets(Sheet1)Range(A1) Puts value from R1C1 into Temperature1ApplicationDDEPoke Channel DDEReal Worksheets(Sheet1)Range(A2) Puts value from R1C1 into Temperature1ApplicationDDEPoke Channel DDEInteger Worksheets(Sheet1)Range(A3) Puts value from R1C1 into Temperature1ApplicationDDETerminate Channel This terminates the DDE channelEnd SubSub RequestMacro()Channel = ApplicationDDEInitiate(app=brad_s_carlbergVIEW topic=Tagname) This opens a DDE channel to ViewWorksheets(Sheet1)Range(C4) = ApplicationDDERequest(Channel $Hour)Worksheets(Sheet1)Range(C5) = ApplicationDDERequest(Channel $Minute)Worksheets(Sheet1)Range(C6) = ApplicationDDERequest(Channel $Second)Worksheets(Sheet1)Range(C9) = ApplicationDDERequest(Channel $day)Worksheets(Sheet1)Range(C10) = ApplicationDDERequest(Channel $date)Worksheets(Sheet1)Range(C11) = ApplicationDDERequest(Channel $datestring)Worksheets(Sheet1)Range(C12) = ApplicationDDERequest(Channel $datetime)Worksheets(Sheet1)Range(C13) = ApplicationDDERequest(Channel $date)Worksheets(Sheet1)Range(C14) = ApplicationDDERequest(Channel $month)Worksheets(Sheet1)Range(C15) = ApplicationDDERequest(Channel $year)Worksheets(Sheet1)Range(C16) = ApplicationDDERequest(Channel $time)Worksheets(Sheet1)Range(C17) = ApplicationDDERequest(Channel $timestring)Worksheets(Sheet1)Range(C18) = ApplicationDDERequest(Channel $applicationversion)Worksheets(Sheet1)Range(C19) = ApplicationDDERequest(Channel $startddeconversations)Worksheets(Sheet1)Range(C20) = ApplicationDDERequest(Channel $accesslevel)Worksheets(Sheet1)Range(C21) = ApplicationDDERequest(Channel $alarmlogging)Worksheets(Sheet1)Range(C22) = ApplicationDDERequest(Channel $applicationchanged)Worksheets(Sheet1)Range(C23) = ApplicationDDERequest(Channel $configureusers)Worksheets(Sheet1)Range(C24) = ApplicationDDERequest(Channel $changepassword)Worksheets(Sheet1)Range(C25) = ApplicationDDERequest(Channel $InactivityTimeout)Worksheets(Sheet1)Range(C26) = ApplicationDDERequest(Channel $InactivityWarning)Worksheets(Sheet1)Range(C27) = ApplicationDDERequest(Channel $LogicRunning)Worksheets(Sheet1)Range(C28) = ApplicationDDERequest(Channel $OperatorEntered)Worksheets(Sheet1)Range(C29) = ApplicationDDERequest(Channel $Operator)Worksheets(Sheet1)Range(C30) = ApplicationDDERequest(Channel $PasswordEntered)ApplicationDDETerminate Channel This terminates the DDE channelEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 110

Visual Basic

ldquoRoll Your Ownrdquo HMI - Much More powerful than Excel

Key Parameters computer nameapplication|topicitem

IO Emulator - MBPlusSimulateexe

Can ldquoRead Fromrdquo amp ldquoWrite Tordquo PLC andor HMI

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 111

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 112

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 113

Dim PauseTime Start Finish TotalTime As Integer Declare variables

Private Sub txtAIT_332A_SCALED_Change()On Error GoTo PokeAIT_332AErrortxtAIT_332A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtAIT_332A_SCALEDText = Int((3 Rnd) + 20) Generate random value between 20 and 23txtAIT_332A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtAIT_332A_SCALEDLinkItem = AIT_332A_SCALEDtxtAIT_332A_SCALEDLinkMode = 2txtAIT_332A_SCALEDLinkPoketxtAIT_332A_SCALEDLinkMode = 0 DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total time

PokeAIT_332AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtAIT_332A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 114

Private Sub txtAIT_346A_SCALED_Change()On Error GoTo PokeAIT_346AErrortxtAIT_346A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtAIT_346A_SCALEDText = Int((3 Rnd) + 15) Generate random value between 15 and 18txtAIT_346A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtAIT_346A_SCALEDLinkItem = AIT_346A_SCALEDtxtAIT_346A_SCALEDLinkMode = 2txtAIT_346A_SCALEDLinkPoketxtAIT_346A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeAIT_346AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtAIT_346A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 115

Private Sub txtFIT_321A_SCALED_Change()On Error GoTo PokeFIT_321AErrortxtFIT_321A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtFIT_321A_SCALEDText = Int((10 Rnd) + 120) Generate random value between 120 and 130txtFIT_321A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_321A_SCALEDLinkItem = FIT_321A_SCALEDtxtFIT_321A_SCALEDLinkMode = 2txtFIT_321A_SCALEDLinkPoketxtFIT_321A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total time

PokeFIT_321AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_321A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume Next

End Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 116

Private Sub txtFIT_341A_SCALED_Change()On Error GoTo PokeFIT_341AErrortxtFIT_341A_SCALEDLinkMode = 0 PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTime

txtFIT_341A_SCALEDText = Int((3 Rnd) + 18) Generate random value between 18 and 21

txtFIT_341A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_341A_SCALEDLinkItem = FIT_341A_SCALEDtxtFIT_341A_SCALEDLinkMode = 2txtFIT_341A_SCALEDLinkPoketxtFIT_341A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeFIT_341AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_341A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 117

Private Sub txtFIT_343A_SCALED_Change()On Error GoTo PokeFIT_343AErrortxtFIT_343A_SCALEDLinkMode = 0 PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTime

txtFIT_343A_SCALEDText = Int((1 Rnd) + 3) Generate random value between 3 and 4

txtFIT_343A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_343A_SCALEDLinkItem = FIT_343A_SCALEDtxtFIT_343A_SCALEDLinkMode = 2txtFIT_343A_SCALEDLinkPoketxtFIT_343A_SCALEDLinkMode = 0 DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeFIT_343AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_343A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 118

TUTORIAL

Part 4

Questions

amp

Answers

  • Slide 1
  • Slide 2
  • Slide 3
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Slide 8
  • Slide 9
  • Slide 10
  • Slide 11
  • Slide 12
  • Slide 13
  • Slide 14
  • Slide 15
  • Slide 16
  • Slide 17
  • Slide 18
  • Slide 19
  • Slide 20
  • Slide 21
  • Slide 22
  • Slide 23
  • Slide 24
  • Slide 25
  • Slide 26
  • Slide 27
  • Slide 28
  • Slide 29
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
  • Slide 34
  • Slide 35
  • Slide 36
  • Slide 37
  • Slide 38
  • Slide 39
  • Slide 40
  • Slide 41
  • Slide 42
  • Slide 43
  • Slide 44
  • Slide 45
  • Slide 46
  • Slide 47
  • Slide 48
  • Slide 49
  • Slide 50
  • Slide 51
  • Slide 52
  • Slide 53
  • Slide 54
  • Slide 55
  • Slide 56
  • Slide 57
  • Slide 58
  • Slide 59
  • Slide 60
  • Slide 61
  • Slide 62
  • Slide 63
  • Slide 64
  • Slide 65
  • Slide 66
  • Slide 67
  • Slide 68
  • Slide 69
  • Slide 70
  • Slide 71
  • Slide 72
  • Slide 73
  • Slide 74
  • Slide 75
  • Slide 76
  • Slide 77
  • Slide 78
  • Slide 79
  • Slide 80
  • Slide 81
  • Slide 82
  • Slide 83
  • Slide 84
  • Slide 85
  • Slide 86
  • Slide 87
  • Slide 88
  • Slide 89
  • Slide 90
  • Slide 91
  • Slide 92
  • Slide 93
  • Slide 94
  • Slide 95
  • Slide 96
  • Slide 97
  • Slide 98
  • Slide 99
  • Slide 100
  • Slide 101
  • Slide 102
  • Slide 103
  • Slide 104
  • Slide 105
  • Slide 106
  • Slide 107
  • Slide 108
  • Slide 109
  • Slide 110
  • Slide 111
  • Slide 112
  • Slide 113
  • Slide 114
  • Slide 115
  • Slide 116
  • Slide 117
  • Slide 118
Page 37: TUTORIAL Ethernet PLC's Improve Oxygen Consumption ISA Expo/2001Houston, Texas Water & Wastewater Industry DivisionTuesday, September 11, 2001 1 Brad.

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 37

Lower Explosive Level (LEL)

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 38

Each train has a digital input that tells whether thecombustible 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 (LEL) system

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 39

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 Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 40

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 41

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 Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 42

Like a DCS

middot 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

middot 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 amp CASCADE amp RATIO PID WITH AUTO amp RATIO Digin Motor Status DigOut Motor (or Digital Composite) Motor with ILock and Perm Numeric Set Timers Alarm Detail and Alarm Tags

middot A single generic trend display to trend ALL trendable (archived) points

Alarm Management

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

middot A Distributed Alarm Summary has been used to give better alarm management tools

bull Up to eight trend pens on the trend display

bull The operator picks which values to trend by clicking in the center of the trend

display

bull 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 44

The AnoxicOxic 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 Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 46

The following control levels are available for Oxygen1 Cascade from Dissolved Oxygen

2 Ratio from Discharge flow3 Auto-Manual Control

The following control levels are available for the Recycle flow1 Ratio from Discharge flow

2 Auto-Manual Control

The following control levels are available for the PD Blowers3 Timed Mode

2 Dissolved Oxygen Mode3 Manual Mode

Conclusions

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 47

Following the commissioning of the ethernet-based PLCs Oxygen consumption was significantly reduced

The advanced controls allow the operators to leave the process alone and continue to optimally treat the sewage

Conclusions

Following the commissioning of the ethernet-based PLCs AnoxicOxic 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 Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 48

Summary

The PD Blowers ran in Timed Mode andor 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

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 Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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 Authoritys 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 50

TUTORIAL

Part 2A

PLC Programming Basics

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 51

Separate parts of the process have been organized into a separate ldquoSECTIONrdquo

PLC Program Organization

Each ldquoSECTIONrdquo can be any of the IEC programming types

bull Ladder (LD)bull Structured Text (ST)

bull Instruction List (IL)

bull Function Blocks (FB)bull Sequential Function Charts (SFC)

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 52

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 53

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 54

IO Map

On-Line PLC Diagnostics

PLC Status

PLC Simulator

Ethernet (TCPIP) Address

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 55

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 56

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 57

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 58

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 59

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 60

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 61

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 62

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 63

Structured Text was used hereNOT Ladder

Programming for Motors

The PLC DOES NOT CAREStructured Text Functions EXACTLY

the same as LadderUse what yoursquore comfortable with

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 64

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 65

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 66

IEC Function Blocks Used Here

Programming for Analogs amp PID

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 67

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 68

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 69

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 70

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 71

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 72

Sequential Function Charts were used here

Higher-Level Control

bull SFCrsquos lend themselves well to (as the name would imply) sequential processes

bull Three Important components in SFCrsquosbull Transitionsbull Stepsbull Jumps

bull The status of the process can be viewed as a flow chart

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 73

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 74

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 75

PLC - HMI Communication

A ldquoPLC Heartbeatrdquo is traditionally used to monitor the PLC - HMI Communication sometimes called ardquoWatchdog Timerrdquo

Call it whatever you want but the PLC amp 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 ldquodiesrdquo then that switch doesnrsquot change state and an alarm alerts the operator

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 76

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 77

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 78

TUTORIAL

Part 2B

HMI Programming

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 79

Ethernet (TCPIP) IO Driver

The Ethernet (TCPIP) IO Driver allows the HMI to communicate with the PLC (In this case the driver is called MBENETEXE)

The PLC has an ethernet module in one of the slots that has a ldquoCAT5RJ-45rdquo 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 ldquoCAT5RJ-45rdquo receptacle for the ethernet cable

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 80

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 81

Operator Screens amp Popup Displays

The display is laid out in 3 sections

bull Upper - Security amp Alarm Windowbull Middle- Main Operator Screens bull Lower - Menu amp Popup Displays

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 82

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 83

Scripting

There are 6 types of ldquoScriptsrdquobull Application Scriptsbull Key Scriptsbull Condition Scriptsbull Data Change Scriptsbull Quick Function Scriptsbull ActiveX Event Scripts

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 84

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 85

Access Names

The ldquoAccess Namesrdquo Must be configured to allow the PLC - HMI communications

Note that the ldquoApplicationTopicrdquo is the same as the IO Driver

The ldquocomputer namerdquo is the name of the PC that the HMI is running on (brad_s_carlberg in this case)

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 86

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 87

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 88

Indirect Tags

ldquoIndirect Tagsrdquo were used here to minimize the number of popup displays

This is especially useful in HMIrsquos with many tags

ONLY 12 popup displays are reused throughout the HMI

This gives the HMI a ldquoDCS-Likerdquo Look amp Feel

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 89

Popup Display TypesThe tag point type determines which popup display to use

Analog InputHIC (or Analog Output)PID (or Analog Composite)

bull PID WITH AUTO amp CASCADE amp RATIObull PID WITH AUTO amp RATIO

Diginbull Motor Status

DigOutMotor (or Digital Composite)

bull Motor with ILock and PermNumericSet TimersAlarm DetailAlarm Tags

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 90

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 91

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 92

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 93

Bars Buttons amp Sliders

By choosing to use indirect tags we complicate the Bar Graphs Buttons amp Sliders in the popup displays

Different scales need to be used for different engineering unit ranges

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 94

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 95

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 96

Popup Displays

The next two pages shows how the individual popup displays use the indirect tags

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 97

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 98

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 99

Adding a ldquoTouch Targetrdquo to a Display

2 Tell which tags to use

3 Tell which popup display to call upWhat kind of point type is it

3 Steps1 Tell which scale to use (if itrsquos an analog point type)

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 100

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 101

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 102

TUTORIAL

Part 2C

Excel Spreadsheets

amp

Visual Basic

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 103

A ldquoCHEAP amp DIRTYrdquo HMI With Excel

The 4 key parameters are

To communicate with the PLCUse brad_s_carlbergmbenet|ANOXIC_OXICrsquoplcregisterrsquo

Excel uses ldquopeeksrdquo amp ldquopokesrdquo to read from amp write to a PLC or HMI

To communicate with the HMIbrad_s_carlbergview|Tagnamersquotagnamersquo

bull computer namebull applicationbull topicbull item

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 104

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 105

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 106

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 107

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 108

Excel Macros

bull ldquoRequestrdquo Macro to read values

bull ldquoPokerdquo Macro to write values

bull A Sample Excel Macro

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 109

Sub PokeMacro()MsgBox ApplicationNetworkTemplatesPathChannel = ApplicationDDEInitiate(app=brad_s_carlbergVIEW topic=Tagname) This opens a DDE channel to ViewApplicationDDEPoke Channel Temperature1 Worksheets(Sheet1)Range(A1) Puts value from R1C1 into Temperature1ApplicationDDEPoke Channel DDEReal Worksheets(Sheet1)Range(A2) Puts value from R1C1 into Temperature1ApplicationDDEPoke Channel DDEInteger Worksheets(Sheet1)Range(A3) Puts value from R1C1 into Temperature1ApplicationDDETerminate Channel This terminates the DDE channelEnd SubSub RequestMacro()Channel = ApplicationDDEInitiate(app=brad_s_carlbergVIEW topic=Tagname) This opens a DDE channel to ViewWorksheets(Sheet1)Range(C4) = ApplicationDDERequest(Channel $Hour)Worksheets(Sheet1)Range(C5) = ApplicationDDERequest(Channel $Minute)Worksheets(Sheet1)Range(C6) = ApplicationDDERequest(Channel $Second)Worksheets(Sheet1)Range(C9) = ApplicationDDERequest(Channel $day)Worksheets(Sheet1)Range(C10) = ApplicationDDERequest(Channel $date)Worksheets(Sheet1)Range(C11) = ApplicationDDERequest(Channel $datestring)Worksheets(Sheet1)Range(C12) = ApplicationDDERequest(Channel $datetime)Worksheets(Sheet1)Range(C13) = ApplicationDDERequest(Channel $date)Worksheets(Sheet1)Range(C14) = ApplicationDDERequest(Channel $month)Worksheets(Sheet1)Range(C15) = ApplicationDDERequest(Channel $year)Worksheets(Sheet1)Range(C16) = ApplicationDDERequest(Channel $time)Worksheets(Sheet1)Range(C17) = ApplicationDDERequest(Channel $timestring)Worksheets(Sheet1)Range(C18) = ApplicationDDERequest(Channel $applicationversion)Worksheets(Sheet1)Range(C19) = ApplicationDDERequest(Channel $startddeconversations)Worksheets(Sheet1)Range(C20) = ApplicationDDERequest(Channel $accesslevel)Worksheets(Sheet1)Range(C21) = ApplicationDDERequest(Channel $alarmlogging)Worksheets(Sheet1)Range(C22) = ApplicationDDERequest(Channel $applicationchanged)Worksheets(Sheet1)Range(C23) = ApplicationDDERequest(Channel $configureusers)Worksheets(Sheet1)Range(C24) = ApplicationDDERequest(Channel $changepassword)Worksheets(Sheet1)Range(C25) = ApplicationDDERequest(Channel $InactivityTimeout)Worksheets(Sheet1)Range(C26) = ApplicationDDERequest(Channel $InactivityWarning)Worksheets(Sheet1)Range(C27) = ApplicationDDERequest(Channel $LogicRunning)Worksheets(Sheet1)Range(C28) = ApplicationDDERequest(Channel $OperatorEntered)Worksheets(Sheet1)Range(C29) = ApplicationDDERequest(Channel $Operator)Worksheets(Sheet1)Range(C30) = ApplicationDDERequest(Channel $PasswordEntered)ApplicationDDETerminate Channel This terminates the DDE channelEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 110

Visual Basic

ldquoRoll Your Ownrdquo HMI - Much More powerful than Excel

Key Parameters computer nameapplication|topicitem

IO Emulator - MBPlusSimulateexe

Can ldquoRead Fromrdquo amp ldquoWrite Tordquo PLC andor HMI

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 111

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 112

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 113

Dim PauseTime Start Finish TotalTime As Integer Declare variables

Private Sub txtAIT_332A_SCALED_Change()On Error GoTo PokeAIT_332AErrortxtAIT_332A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtAIT_332A_SCALEDText = Int((3 Rnd) + 20) Generate random value between 20 and 23txtAIT_332A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtAIT_332A_SCALEDLinkItem = AIT_332A_SCALEDtxtAIT_332A_SCALEDLinkMode = 2txtAIT_332A_SCALEDLinkPoketxtAIT_332A_SCALEDLinkMode = 0 DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total time

PokeAIT_332AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtAIT_332A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 114

Private Sub txtAIT_346A_SCALED_Change()On Error GoTo PokeAIT_346AErrortxtAIT_346A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtAIT_346A_SCALEDText = Int((3 Rnd) + 15) Generate random value between 15 and 18txtAIT_346A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtAIT_346A_SCALEDLinkItem = AIT_346A_SCALEDtxtAIT_346A_SCALEDLinkMode = 2txtAIT_346A_SCALEDLinkPoketxtAIT_346A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeAIT_346AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtAIT_346A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 115

Private Sub txtFIT_321A_SCALED_Change()On Error GoTo PokeFIT_321AErrortxtFIT_321A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtFIT_321A_SCALEDText = Int((10 Rnd) + 120) Generate random value between 120 and 130txtFIT_321A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_321A_SCALEDLinkItem = FIT_321A_SCALEDtxtFIT_321A_SCALEDLinkMode = 2txtFIT_321A_SCALEDLinkPoketxtFIT_321A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total time

PokeFIT_321AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_321A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume Next

End Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 116

Private Sub txtFIT_341A_SCALED_Change()On Error GoTo PokeFIT_341AErrortxtFIT_341A_SCALEDLinkMode = 0 PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTime

txtFIT_341A_SCALEDText = Int((3 Rnd) + 18) Generate random value between 18 and 21

txtFIT_341A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_341A_SCALEDLinkItem = FIT_341A_SCALEDtxtFIT_341A_SCALEDLinkMode = 2txtFIT_341A_SCALEDLinkPoketxtFIT_341A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeFIT_341AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_341A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 117

Private Sub txtFIT_343A_SCALED_Change()On Error GoTo PokeFIT_343AErrortxtFIT_343A_SCALEDLinkMode = 0 PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTime

txtFIT_343A_SCALEDText = Int((1 Rnd) + 3) Generate random value between 3 and 4

txtFIT_343A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_343A_SCALEDLinkItem = FIT_343A_SCALEDtxtFIT_343A_SCALEDLinkMode = 2txtFIT_343A_SCALEDLinkPoketxtFIT_343A_SCALEDLinkMode = 0 DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeFIT_343AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_343A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 118

TUTORIAL

Part 4

Questions

amp

Answers

  • Slide 1
  • Slide 2
  • Slide 3
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Slide 8
  • Slide 9
  • Slide 10
  • Slide 11
  • Slide 12
  • Slide 13
  • Slide 14
  • Slide 15
  • Slide 16
  • Slide 17
  • Slide 18
  • Slide 19
  • Slide 20
  • Slide 21
  • Slide 22
  • Slide 23
  • Slide 24
  • Slide 25
  • Slide 26
  • Slide 27
  • Slide 28
  • Slide 29
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
  • Slide 34
  • Slide 35
  • Slide 36
  • Slide 37
  • Slide 38
  • Slide 39
  • Slide 40
  • Slide 41
  • Slide 42
  • Slide 43
  • Slide 44
  • Slide 45
  • Slide 46
  • Slide 47
  • Slide 48
  • Slide 49
  • Slide 50
  • Slide 51
  • Slide 52
  • Slide 53
  • Slide 54
  • Slide 55
  • Slide 56
  • Slide 57
  • Slide 58
  • Slide 59
  • Slide 60
  • Slide 61
  • Slide 62
  • Slide 63
  • Slide 64
  • Slide 65
  • Slide 66
  • Slide 67
  • Slide 68
  • Slide 69
  • Slide 70
  • Slide 71
  • Slide 72
  • Slide 73
  • Slide 74
  • Slide 75
  • Slide 76
  • Slide 77
  • Slide 78
  • Slide 79
  • Slide 80
  • Slide 81
  • Slide 82
  • Slide 83
  • Slide 84
  • Slide 85
  • Slide 86
  • Slide 87
  • Slide 88
  • Slide 89
  • Slide 90
  • Slide 91
  • Slide 92
  • Slide 93
  • Slide 94
  • Slide 95
  • Slide 96
  • Slide 97
  • Slide 98
  • Slide 99
  • Slide 100
  • Slide 101
  • Slide 102
  • Slide 103
  • Slide 104
  • Slide 105
  • Slide 106
  • Slide 107
  • Slide 108
  • Slide 109
  • Slide 110
  • Slide 111
  • Slide 112
  • Slide 113
  • Slide 114
  • Slide 115
  • Slide 116
  • Slide 117
  • Slide 118
Page 38: TUTORIAL Ethernet PLC's Improve Oxygen Consumption ISA Expo/2001Houston, Texas Water & Wastewater Industry DivisionTuesday, September 11, 2001 1 Brad.

Lower Explosive Level (LEL)

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 38

Each train has a digital input that tells whether thecombustible 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 (LEL) system

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 39

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 Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 40

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 41

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 Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 42

Like a DCS

middot 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

middot 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 amp CASCADE amp RATIO PID WITH AUTO amp RATIO Digin Motor Status DigOut Motor (or Digital Composite) Motor with ILock and Perm Numeric Set Timers Alarm Detail and Alarm Tags

middot A single generic trend display to trend ALL trendable (archived) points

Alarm Management

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

middot A Distributed Alarm Summary has been used to give better alarm management tools

bull Up to eight trend pens on the trend display

bull The operator picks which values to trend by clicking in the center of the trend

display

bull 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 44

The AnoxicOxic 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 Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 46

The following control levels are available for Oxygen1 Cascade from Dissolved Oxygen

2 Ratio from Discharge flow3 Auto-Manual Control

The following control levels are available for the Recycle flow1 Ratio from Discharge flow

2 Auto-Manual Control

The following control levels are available for the PD Blowers3 Timed Mode

2 Dissolved Oxygen Mode3 Manual Mode

Conclusions

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 47

Following the commissioning of the ethernet-based PLCs Oxygen consumption was significantly reduced

The advanced controls allow the operators to leave the process alone and continue to optimally treat the sewage

Conclusions

Following the commissioning of the ethernet-based PLCs AnoxicOxic 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 Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 48

Summary

The PD Blowers ran in Timed Mode andor 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

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 Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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 Authoritys 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 50

TUTORIAL

Part 2A

PLC Programming Basics

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 51

Separate parts of the process have been organized into a separate ldquoSECTIONrdquo

PLC Program Organization

Each ldquoSECTIONrdquo can be any of the IEC programming types

bull Ladder (LD)bull Structured Text (ST)

bull Instruction List (IL)

bull Function Blocks (FB)bull Sequential Function Charts (SFC)

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 52

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 53

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 54

IO Map

On-Line PLC Diagnostics

PLC Status

PLC Simulator

Ethernet (TCPIP) Address

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 55

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 56

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 57

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 58

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 59

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 60

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 61

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 62

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 63

Structured Text was used hereNOT Ladder

Programming for Motors

The PLC DOES NOT CAREStructured Text Functions EXACTLY

the same as LadderUse what yoursquore comfortable with

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 64

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 65

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 66

IEC Function Blocks Used Here

Programming for Analogs amp PID

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 67

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 68

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 69

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 70

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 71

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 72

Sequential Function Charts were used here

Higher-Level Control

bull SFCrsquos lend themselves well to (as the name would imply) sequential processes

bull Three Important components in SFCrsquosbull Transitionsbull Stepsbull Jumps

bull The status of the process can be viewed as a flow chart

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 73

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 74

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 75

PLC - HMI Communication

A ldquoPLC Heartbeatrdquo is traditionally used to monitor the PLC - HMI Communication sometimes called ardquoWatchdog Timerrdquo

Call it whatever you want but the PLC amp 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 ldquodiesrdquo then that switch doesnrsquot change state and an alarm alerts the operator

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 76

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 77

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 78

TUTORIAL

Part 2B

HMI Programming

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 79

Ethernet (TCPIP) IO Driver

The Ethernet (TCPIP) IO Driver allows the HMI to communicate with the PLC (In this case the driver is called MBENETEXE)

The PLC has an ethernet module in one of the slots that has a ldquoCAT5RJ-45rdquo 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 ldquoCAT5RJ-45rdquo receptacle for the ethernet cable

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 80

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 81

Operator Screens amp Popup Displays

The display is laid out in 3 sections

bull Upper - Security amp Alarm Windowbull Middle- Main Operator Screens bull Lower - Menu amp Popup Displays

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 82

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 83

Scripting

There are 6 types of ldquoScriptsrdquobull Application Scriptsbull Key Scriptsbull Condition Scriptsbull Data Change Scriptsbull Quick Function Scriptsbull ActiveX Event Scripts

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 84

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 85

Access Names

The ldquoAccess Namesrdquo Must be configured to allow the PLC - HMI communications

Note that the ldquoApplicationTopicrdquo is the same as the IO Driver

The ldquocomputer namerdquo is the name of the PC that the HMI is running on (brad_s_carlberg in this case)

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 86

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 87

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 88

Indirect Tags

ldquoIndirect Tagsrdquo were used here to minimize the number of popup displays

This is especially useful in HMIrsquos with many tags

ONLY 12 popup displays are reused throughout the HMI

This gives the HMI a ldquoDCS-Likerdquo Look amp Feel

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 89

Popup Display TypesThe tag point type determines which popup display to use

Analog InputHIC (or Analog Output)PID (or Analog Composite)

bull PID WITH AUTO amp CASCADE amp RATIObull PID WITH AUTO amp RATIO

Diginbull Motor Status

DigOutMotor (or Digital Composite)

bull Motor with ILock and PermNumericSet TimersAlarm DetailAlarm Tags

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 90

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 91

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 92

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 93

Bars Buttons amp Sliders

By choosing to use indirect tags we complicate the Bar Graphs Buttons amp Sliders in the popup displays

Different scales need to be used for different engineering unit ranges

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 94

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 95

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 96

Popup Displays

The next two pages shows how the individual popup displays use the indirect tags

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 97

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 98

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 99

Adding a ldquoTouch Targetrdquo to a Display

2 Tell which tags to use

3 Tell which popup display to call upWhat kind of point type is it

3 Steps1 Tell which scale to use (if itrsquos an analog point type)

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 100

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 101

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 102

TUTORIAL

Part 2C

Excel Spreadsheets

amp

Visual Basic

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 103

A ldquoCHEAP amp DIRTYrdquo HMI With Excel

The 4 key parameters are

To communicate with the PLCUse brad_s_carlbergmbenet|ANOXIC_OXICrsquoplcregisterrsquo

Excel uses ldquopeeksrdquo amp ldquopokesrdquo to read from amp write to a PLC or HMI

To communicate with the HMIbrad_s_carlbergview|Tagnamersquotagnamersquo

bull computer namebull applicationbull topicbull item

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 104

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 105

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 106

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 107

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 108

Excel Macros

bull ldquoRequestrdquo Macro to read values

bull ldquoPokerdquo Macro to write values

bull A Sample Excel Macro

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 109

Sub PokeMacro()MsgBox ApplicationNetworkTemplatesPathChannel = ApplicationDDEInitiate(app=brad_s_carlbergVIEW topic=Tagname) This opens a DDE channel to ViewApplicationDDEPoke Channel Temperature1 Worksheets(Sheet1)Range(A1) Puts value from R1C1 into Temperature1ApplicationDDEPoke Channel DDEReal Worksheets(Sheet1)Range(A2) Puts value from R1C1 into Temperature1ApplicationDDEPoke Channel DDEInteger Worksheets(Sheet1)Range(A3) Puts value from R1C1 into Temperature1ApplicationDDETerminate Channel This terminates the DDE channelEnd SubSub RequestMacro()Channel = ApplicationDDEInitiate(app=brad_s_carlbergVIEW topic=Tagname) This opens a DDE channel to ViewWorksheets(Sheet1)Range(C4) = ApplicationDDERequest(Channel $Hour)Worksheets(Sheet1)Range(C5) = ApplicationDDERequest(Channel $Minute)Worksheets(Sheet1)Range(C6) = ApplicationDDERequest(Channel $Second)Worksheets(Sheet1)Range(C9) = ApplicationDDERequest(Channel $day)Worksheets(Sheet1)Range(C10) = ApplicationDDERequest(Channel $date)Worksheets(Sheet1)Range(C11) = ApplicationDDERequest(Channel $datestring)Worksheets(Sheet1)Range(C12) = ApplicationDDERequest(Channel $datetime)Worksheets(Sheet1)Range(C13) = ApplicationDDERequest(Channel $date)Worksheets(Sheet1)Range(C14) = ApplicationDDERequest(Channel $month)Worksheets(Sheet1)Range(C15) = ApplicationDDERequest(Channel $year)Worksheets(Sheet1)Range(C16) = ApplicationDDERequest(Channel $time)Worksheets(Sheet1)Range(C17) = ApplicationDDERequest(Channel $timestring)Worksheets(Sheet1)Range(C18) = ApplicationDDERequest(Channel $applicationversion)Worksheets(Sheet1)Range(C19) = ApplicationDDERequest(Channel $startddeconversations)Worksheets(Sheet1)Range(C20) = ApplicationDDERequest(Channel $accesslevel)Worksheets(Sheet1)Range(C21) = ApplicationDDERequest(Channel $alarmlogging)Worksheets(Sheet1)Range(C22) = ApplicationDDERequest(Channel $applicationchanged)Worksheets(Sheet1)Range(C23) = ApplicationDDERequest(Channel $configureusers)Worksheets(Sheet1)Range(C24) = ApplicationDDERequest(Channel $changepassword)Worksheets(Sheet1)Range(C25) = ApplicationDDERequest(Channel $InactivityTimeout)Worksheets(Sheet1)Range(C26) = ApplicationDDERequest(Channel $InactivityWarning)Worksheets(Sheet1)Range(C27) = ApplicationDDERequest(Channel $LogicRunning)Worksheets(Sheet1)Range(C28) = ApplicationDDERequest(Channel $OperatorEntered)Worksheets(Sheet1)Range(C29) = ApplicationDDERequest(Channel $Operator)Worksheets(Sheet1)Range(C30) = ApplicationDDERequest(Channel $PasswordEntered)ApplicationDDETerminate Channel This terminates the DDE channelEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 110

Visual Basic

ldquoRoll Your Ownrdquo HMI - Much More powerful than Excel

Key Parameters computer nameapplication|topicitem

IO Emulator - MBPlusSimulateexe

Can ldquoRead Fromrdquo amp ldquoWrite Tordquo PLC andor HMI

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 111

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 112

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 113

Dim PauseTime Start Finish TotalTime As Integer Declare variables

Private Sub txtAIT_332A_SCALED_Change()On Error GoTo PokeAIT_332AErrortxtAIT_332A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtAIT_332A_SCALEDText = Int((3 Rnd) + 20) Generate random value between 20 and 23txtAIT_332A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtAIT_332A_SCALEDLinkItem = AIT_332A_SCALEDtxtAIT_332A_SCALEDLinkMode = 2txtAIT_332A_SCALEDLinkPoketxtAIT_332A_SCALEDLinkMode = 0 DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total time

PokeAIT_332AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtAIT_332A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 114

Private Sub txtAIT_346A_SCALED_Change()On Error GoTo PokeAIT_346AErrortxtAIT_346A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtAIT_346A_SCALEDText = Int((3 Rnd) + 15) Generate random value between 15 and 18txtAIT_346A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtAIT_346A_SCALEDLinkItem = AIT_346A_SCALEDtxtAIT_346A_SCALEDLinkMode = 2txtAIT_346A_SCALEDLinkPoketxtAIT_346A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeAIT_346AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtAIT_346A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 115

Private Sub txtFIT_321A_SCALED_Change()On Error GoTo PokeFIT_321AErrortxtFIT_321A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtFIT_321A_SCALEDText = Int((10 Rnd) + 120) Generate random value between 120 and 130txtFIT_321A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_321A_SCALEDLinkItem = FIT_321A_SCALEDtxtFIT_321A_SCALEDLinkMode = 2txtFIT_321A_SCALEDLinkPoketxtFIT_321A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total time

PokeFIT_321AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_321A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume Next

End Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 116

Private Sub txtFIT_341A_SCALED_Change()On Error GoTo PokeFIT_341AErrortxtFIT_341A_SCALEDLinkMode = 0 PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTime

txtFIT_341A_SCALEDText = Int((3 Rnd) + 18) Generate random value between 18 and 21

txtFIT_341A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_341A_SCALEDLinkItem = FIT_341A_SCALEDtxtFIT_341A_SCALEDLinkMode = 2txtFIT_341A_SCALEDLinkPoketxtFIT_341A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeFIT_341AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_341A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 117

Private Sub txtFIT_343A_SCALED_Change()On Error GoTo PokeFIT_343AErrortxtFIT_343A_SCALEDLinkMode = 0 PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTime

txtFIT_343A_SCALEDText = Int((1 Rnd) + 3) Generate random value between 3 and 4

txtFIT_343A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_343A_SCALEDLinkItem = FIT_343A_SCALEDtxtFIT_343A_SCALEDLinkMode = 2txtFIT_343A_SCALEDLinkPoketxtFIT_343A_SCALEDLinkMode = 0 DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeFIT_343AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_343A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 118

TUTORIAL

Part 4

Questions

amp

Answers

  • Slide 1
  • Slide 2
  • Slide 3
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Slide 8
  • Slide 9
  • Slide 10
  • Slide 11
  • Slide 12
  • Slide 13
  • Slide 14
  • Slide 15
  • Slide 16
  • Slide 17
  • Slide 18
  • Slide 19
  • Slide 20
  • Slide 21
  • Slide 22
  • Slide 23
  • Slide 24
  • Slide 25
  • Slide 26
  • Slide 27
  • Slide 28
  • Slide 29
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
  • Slide 34
  • Slide 35
  • Slide 36
  • Slide 37
  • Slide 38
  • Slide 39
  • Slide 40
  • Slide 41
  • Slide 42
  • Slide 43
  • Slide 44
  • Slide 45
  • Slide 46
  • Slide 47
  • Slide 48
  • Slide 49
  • Slide 50
  • Slide 51
  • Slide 52
  • Slide 53
  • Slide 54
  • Slide 55
  • Slide 56
  • Slide 57
  • Slide 58
  • Slide 59
  • Slide 60
  • Slide 61
  • Slide 62
  • Slide 63
  • Slide 64
  • Slide 65
  • Slide 66
  • Slide 67
  • Slide 68
  • Slide 69
  • Slide 70
  • Slide 71
  • Slide 72
  • Slide 73
  • Slide 74
  • Slide 75
  • Slide 76
  • Slide 77
  • Slide 78
  • Slide 79
  • Slide 80
  • Slide 81
  • Slide 82
  • Slide 83
  • Slide 84
  • Slide 85
  • Slide 86
  • Slide 87
  • Slide 88
  • Slide 89
  • Slide 90
  • Slide 91
  • Slide 92
  • Slide 93
  • Slide 94
  • Slide 95
  • Slide 96
  • Slide 97
  • Slide 98
  • Slide 99
  • Slide 100
  • Slide 101
  • Slide 102
  • Slide 103
  • Slide 104
  • Slide 105
  • Slide 106
  • Slide 107
  • Slide 108
  • Slide 109
  • Slide 110
  • Slide 111
  • Slide 112
  • Slide 113
  • Slide 114
  • Slide 115
  • Slide 116
  • Slide 117
  • Slide 118
Page 39: TUTORIAL Ethernet PLC's Improve Oxygen Consumption ISA Expo/2001Houston, Texas Water & Wastewater Industry DivisionTuesday, September 11, 2001 1 Brad.

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 39

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 Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 40

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 41

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 Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 42

Like a DCS

middot 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

middot 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 amp CASCADE amp RATIO PID WITH AUTO amp RATIO Digin Motor Status DigOut Motor (or Digital Composite) Motor with ILock and Perm Numeric Set Timers Alarm Detail and Alarm Tags

middot A single generic trend display to trend ALL trendable (archived) points

Alarm Management

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

middot A Distributed Alarm Summary has been used to give better alarm management tools

bull Up to eight trend pens on the trend display

bull The operator picks which values to trend by clicking in the center of the trend

display

bull 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 44

The AnoxicOxic 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 Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 46

The following control levels are available for Oxygen1 Cascade from Dissolved Oxygen

2 Ratio from Discharge flow3 Auto-Manual Control

The following control levels are available for the Recycle flow1 Ratio from Discharge flow

2 Auto-Manual Control

The following control levels are available for the PD Blowers3 Timed Mode

2 Dissolved Oxygen Mode3 Manual Mode

Conclusions

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 47

Following the commissioning of the ethernet-based PLCs Oxygen consumption was significantly reduced

The advanced controls allow the operators to leave the process alone and continue to optimally treat the sewage

Conclusions

Following the commissioning of the ethernet-based PLCs AnoxicOxic 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 Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 48

Summary

The PD Blowers ran in Timed Mode andor 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

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 Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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 Authoritys 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 50

TUTORIAL

Part 2A

PLC Programming Basics

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 51

Separate parts of the process have been organized into a separate ldquoSECTIONrdquo

PLC Program Organization

Each ldquoSECTIONrdquo can be any of the IEC programming types

bull Ladder (LD)bull Structured Text (ST)

bull Instruction List (IL)

bull Function Blocks (FB)bull Sequential Function Charts (SFC)

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 52

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 53

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 54

IO Map

On-Line PLC Diagnostics

PLC Status

PLC Simulator

Ethernet (TCPIP) Address

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 55

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 56

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 57

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 58

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 59

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 60

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 61

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 62

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 63

Structured Text was used hereNOT Ladder

Programming for Motors

The PLC DOES NOT CAREStructured Text Functions EXACTLY

the same as LadderUse what yoursquore comfortable with

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 64

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 65

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 66

IEC Function Blocks Used Here

Programming for Analogs amp PID

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 67

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 68

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 69

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 70

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 71

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 72

Sequential Function Charts were used here

Higher-Level Control

bull SFCrsquos lend themselves well to (as the name would imply) sequential processes

bull Three Important components in SFCrsquosbull Transitionsbull Stepsbull Jumps

bull The status of the process can be viewed as a flow chart

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 73

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 74

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 75

PLC - HMI Communication

A ldquoPLC Heartbeatrdquo is traditionally used to monitor the PLC - HMI Communication sometimes called ardquoWatchdog Timerrdquo

Call it whatever you want but the PLC amp 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 ldquodiesrdquo then that switch doesnrsquot change state and an alarm alerts the operator

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 76

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 77

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 78

TUTORIAL

Part 2B

HMI Programming

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 79

Ethernet (TCPIP) IO Driver

The Ethernet (TCPIP) IO Driver allows the HMI to communicate with the PLC (In this case the driver is called MBENETEXE)

The PLC has an ethernet module in one of the slots that has a ldquoCAT5RJ-45rdquo 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 ldquoCAT5RJ-45rdquo receptacle for the ethernet cable

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 80

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 81

Operator Screens amp Popup Displays

The display is laid out in 3 sections

bull Upper - Security amp Alarm Windowbull Middle- Main Operator Screens bull Lower - Menu amp Popup Displays

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 82

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 83

Scripting

There are 6 types of ldquoScriptsrdquobull Application Scriptsbull Key Scriptsbull Condition Scriptsbull Data Change Scriptsbull Quick Function Scriptsbull ActiveX Event Scripts

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 84

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 85

Access Names

The ldquoAccess Namesrdquo Must be configured to allow the PLC - HMI communications

Note that the ldquoApplicationTopicrdquo is the same as the IO Driver

The ldquocomputer namerdquo is the name of the PC that the HMI is running on (brad_s_carlberg in this case)

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 86

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 87

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 88

Indirect Tags

ldquoIndirect Tagsrdquo were used here to minimize the number of popup displays

This is especially useful in HMIrsquos with many tags

ONLY 12 popup displays are reused throughout the HMI

This gives the HMI a ldquoDCS-Likerdquo Look amp Feel

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 89

Popup Display TypesThe tag point type determines which popup display to use

Analog InputHIC (or Analog Output)PID (or Analog Composite)

bull PID WITH AUTO amp CASCADE amp RATIObull PID WITH AUTO amp RATIO

Diginbull Motor Status

DigOutMotor (or Digital Composite)

bull Motor with ILock and PermNumericSet TimersAlarm DetailAlarm Tags

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 90

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 91

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 92

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 93

Bars Buttons amp Sliders

By choosing to use indirect tags we complicate the Bar Graphs Buttons amp Sliders in the popup displays

Different scales need to be used for different engineering unit ranges

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 94

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 95

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 96

Popup Displays

The next two pages shows how the individual popup displays use the indirect tags

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 97

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 98

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 99

Adding a ldquoTouch Targetrdquo to a Display

2 Tell which tags to use

3 Tell which popup display to call upWhat kind of point type is it

3 Steps1 Tell which scale to use (if itrsquos an analog point type)

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 100

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 101

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 102

TUTORIAL

Part 2C

Excel Spreadsheets

amp

Visual Basic

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 103

A ldquoCHEAP amp DIRTYrdquo HMI With Excel

The 4 key parameters are

To communicate with the PLCUse brad_s_carlbergmbenet|ANOXIC_OXICrsquoplcregisterrsquo

Excel uses ldquopeeksrdquo amp ldquopokesrdquo to read from amp write to a PLC or HMI

To communicate with the HMIbrad_s_carlbergview|Tagnamersquotagnamersquo

bull computer namebull applicationbull topicbull item

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 104

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 105

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 106

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 107

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 108

Excel Macros

bull ldquoRequestrdquo Macro to read values

bull ldquoPokerdquo Macro to write values

bull A Sample Excel Macro

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 109

Sub PokeMacro()MsgBox ApplicationNetworkTemplatesPathChannel = ApplicationDDEInitiate(app=brad_s_carlbergVIEW topic=Tagname) This opens a DDE channel to ViewApplicationDDEPoke Channel Temperature1 Worksheets(Sheet1)Range(A1) Puts value from R1C1 into Temperature1ApplicationDDEPoke Channel DDEReal Worksheets(Sheet1)Range(A2) Puts value from R1C1 into Temperature1ApplicationDDEPoke Channel DDEInteger Worksheets(Sheet1)Range(A3) Puts value from R1C1 into Temperature1ApplicationDDETerminate Channel This terminates the DDE channelEnd SubSub RequestMacro()Channel = ApplicationDDEInitiate(app=brad_s_carlbergVIEW topic=Tagname) This opens a DDE channel to ViewWorksheets(Sheet1)Range(C4) = ApplicationDDERequest(Channel $Hour)Worksheets(Sheet1)Range(C5) = ApplicationDDERequest(Channel $Minute)Worksheets(Sheet1)Range(C6) = ApplicationDDERequest(Channel $Second)Worksheets(Sheet1)Range(C9) = ApplicationDDERequest(Channel $day)Worksheets(Sheet1)Range(C10) = ApplicationDDERequest(Channel $date)Worksheets(Sheet1)Range(C11) = ApplicationDDERequest(Channel $datestring)Worksheets(Sheet1)Range(C12) = ApplicationDDERequest(Channel $datetime)Worksheets(Sheet1)Range(C13) = ApplicationDDERequest(Channel $date)Worksheets(Sheet1)Range(C14) = ApplicationDDERequest(Channel $month)Worksheets(Sheet1)Range(C15) = ApplicationDDERequest(Channel $year)Worksheets(Sheet1)Range(C16) = ApplicationDDERequest(Channel $time)Worksheets(Sheet1)Range(C17) = ApplicationDDERequest(Channel $timestring)Worksheets(Sheet1)Range(C18) = ApplicationDDERequest(Channel $applicationversion)Worksheets(Sheet1)Range(C19) = ApplicationDDERequest(Channel $startddeconversations)Worksheets(Sheet1)Range(C20) = ApplicationDDERequest(Channel $accesslevel)Worksheets(Sheet1)Range(C21) = ApplicationDDERequest(Channel $alarmlogging)Worksheets(Sheet1)Range(C22) = ApplicationDDERequest(Channel $applicationchanged)Worksheets(Sheet1)Range(C23) = ApplicationDDERequest(Channel $configureusers)Worksheets(Sheet1)Range(C24) = ApplicationDDERequest(Channel $changepassword)Worksheets(Sheet1)Range(C25) = ApplicationDDERequest(Channel $InactivityTimeout)Worksheets(Sheet1)Range(C26) = ApplicationDDERequest(Channel $InactivityWarning)Worksheets(Sheet1)Range(C27) = ApplicationDDERequest(Channel $LogicRunning)Worksheets(Sheet1)Range(C28) = ApplicationDDERequest(Channel $OperatorEntered)Worksheets(Sheet1)Range(C29) = ApplicationDDERequest(Channel $Operator)Worksheets(Sheet1)Range(C30) = ApplicationDDERequest(Channel $PasswordEntered)ApplicationDDETerminate Channel This terminates the DDE channelEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 110

Visual Basic

ldquoRoll Your Ownrdquo HMI - Much More powerful than Excel

Key Parameters computer nameapplication|topicitem

IO Emulator - MBPlusSimulateexe

Can ldquoRead Fromrdquo amp ldquoWrite Tordquo PLC andor HMI

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 111

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 112

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 113

Dim PauseTime Start Finish TotalTime As Integer Declare variables

Private Sub txtAIT_332A_SCALED_Change()On Error GoTo PokeAIT_332AErrortxtAIT_332A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtAIT_332A_SCALEDText = Int((3 Rnd) + 20) Generate random value between 20 and 23txtAIT_332A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtAIT_332A_SCALEDLinkItem = AIT_332A_SCALEDtxtAIT_332A_SCALEDLinkMode = 2txtAIT_332A_SCALEDLinkPoketxtAIT_332A_SCALEDLinkMode = 0 DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total time

PokeAIT_332AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtAIT_332A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 114

Private Sub txtAIT_346A_SCALED_Change()On Error GoTo PokeAIT_346AErrortxtAIT_346A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtAIT_346A_SCALEDText = Int((3 Rnd) + 15) Generate random value between 15 and 18txtAIT_346A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtAIT_346A_SCALEDLinkItem = AIT_346A_SCALEDtxtAIT_346A_SCALEDLinkMode = 2txtAIT_346A_SCALEDLinkPoketxtAIT_346A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeAIT_346AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtAIT_346A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 115

Private Sub txtFIT_321A_SCALED_Change()On Error GoTo PokeFIT_321AErrortxtFIT_321A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtFIT_321A_SCALEDText = Int((10 Rnd) + 120) Generate random value between 120 and 130txtFIT_321A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_321A_SCALEDLinkItem = FIT_321A_SCALEDtxtFIT_321A_SCALEDLinkMode = 2txtFIT_321A_SCALEDLinkPoketxtFIT_321A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total time

PokeFIT_321AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_321A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume Next

End Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 116

Private Sub txtFIT_341A_SCALED_Change()On Error GoTo PokeFIT_341AErrortxtFIT_341A_SCALEDLinkMode = 0 PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTime

txtFIT_341A_SCALEDText = Int((3 Rnd) + 18) Generate random value between 18 and 21

txtFIT_341A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_341A_SCALEDLinkItem = FIT_341A_SCALEDtxtFIT_341A_SCALEDLinkMode = 2txtFIT_341A_SCALEDLinkPoketxtFIT_341A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeFIT_341AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_341A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 117

Private Sub txtFIT_343A_SCALED_Change()On Error GoTo PokeFIT_343AErrortxtFIT_343A_SCALEDLinkMode = 0 PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTime

txtFIT_343A_SCALEDText = Int((1 Rnd) + 3) Generate random value between 3 and 4

txtFIT_343A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_343A_SCALEDLinkItem = FIT_343A_SCALEDtxtFIT_343A_SCALEDLinkMode = 2txtFIT_343A_SCALEDLinkPoketxtFIT_343A_SCALEDLinkMode = 0 DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeFIT_343AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_343A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 118

TUTORIAL

Part 4

Questions

amp

Answers

  • Slide 1
  • Slide 2
  • Slide 3
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Slide 8
  • Slide 9
  • Slide 10
  • Slide 11
  • Slide 12
  • Slide 13
  • Slide 14
  • Slide 15
  • Slide 16
  • Slide 17
  • Slide 18
  • Slide 19
  • Slide 20
  • Slide 21
  • Slide 22
  • Slide 23
  • Slide 24
  • Slide 25
  • Slide 26
  • Slide 27
  • Slide 28
  • Slide 29
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
  • Slide 34
  • Slide 35
  • Slide 36
  • Slide 37
  • Slide 38
  • Slide 39
  • Slide 40
  • Slide 41
  • Slide 42
  • Slide 43
  • Slide 44
  • Slide 45
  • Slide 46
  • Slide 47
  • Slide 48
  • Slide 49
  • Slide 50
  • Slide 51
  • Slide 52
  • Slide 53
  • Slide 54
  • Slide 55
  • Slide 56
  • Slide 57
  • Slide 58
  • Slide 59
  • Slide 60
  • Slide 61
  • Slide 62
  • Slide 63
  • Slide 64
  • Slide 65
  • Slide 66
  • Slide 67
  • Slide 68
  • Slide 69
  • Slide 70
  • Slide 71
  • Slide 72
  • Slide 73
  • Slide 74
  • Slide 75
  • Slide 76
  • Slide 77
  • Slide 78
  • Slide 79
  • Slide 80
  • Slide 81
  • Slide 82
  • Slide 83
  • Slide 84
  • Slide 85
  • Slide 86
  • Slide 87
  • Slide 88
  • Slide 89
  • Slide 90
  • Slide 91
  • Slide 92
  • Slide 93
  • Slide 94
  • Slide 95
  • Slide 96
  • Slide 97
  • Slide 98
  • Slide 99
  • Slide 100
  • Slide 101
  • Slide 102
  • Slide 103
  • Slide 104
  • Slide 105
  • Slide 106
  • Slide 107
  • Slide 108
  • Slide 109
  • Slide 110
  • Slide 111
  • Slide 112
  • Slide 113
  • Slide 114
  • Slide 115
  • Slide 116
  • Slide 117
  • Slide 118
Page 40: TUTORIAL Ethernet PLC's Improve Oxygen Consumption ISA Expo/2001Houston, Texas Water & Wastewater Industry DivisionTuesday, September 11, 2001 1 Brad.

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 Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 40

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 41

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 Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 42

Like a DCS

middot 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

middot 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 amp CASCADE amp RATIO PID WITH AUTO amp RATIO Digin Motor Status DigOut Motor (or Digital Composite) Motor with ILock and Perm Numeric Set Timers Alarm Detail and Alarm Tags

middot A single generic trend display to trend ALL trendable (archived) points

Alarm Management

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

middot A Distributed Alarm Summary has been used to give better alarm management tools

bull Up to eight trend pens on the trend display

bull The operator picks which values to trend by clicking in the center of the trend

display

bull 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 44

The AnoxicOxic 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 Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 46

The following control levels are available for Oxygen1 Cascade from Dissolved Oxygen

2 Ratio from Discharge flow3 Auto-Manual Control

The following control levels are available for the Recycle flow1 Ratio from Discharge flow

2 Auto-Manual Control

The following control levels are available for the PD Blowers3 Timed Mode

2 Dissolved Oxygen Mode3 Manual Mode

Conclusions

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 47

Following the commissioning of the ethernet-based PLCs Oxygen consumption was significantly reduced

The advanced controls allow the operators to leave the process alone and continue to optimally treat the sewage

Conclusions

Following the commissioning of the ethernet-based PLCs AnoxicOxic 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 Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 48

Summary

The PD Blowers ran in Timed Mode andor 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

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 Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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 Authoritys 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 50

TUTORIAL

Part 2A

PLC Programming Basics

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 51

Separate parts of the process have been organized into a separate ldquoSECTIONrdquo

PLC Program Organization

Each ldquoSECTIONrdquo can be any of the IEC programming types

bull Ladder (LD)bull Structured Text (ST)

bull Instruction List (IL)

bull Function Blocks (FB)bull Sequential Function Charts (SFC)

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 52

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 53

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 54

IO Map

On-Line PLC Diagnostics

PLC Status

PLC Simulator

Ethernet (TCPIP) Address

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 55

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 56

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 57

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 58

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 59

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 60

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 61

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 62

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 63

Structured Text was used hereNOT Ladder

Programming for Motors

The PLC DOES NOT CAREStructured Text Functions EXACTLY

the same as LadderUse what yoursquore comfortable with

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 64

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 65

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 66

IEC Function Blocks Used Here

Programming for Analogs amp PID

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 67

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 68

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 69

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 70

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 71

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 72

Sequential Function Charts were used here

Higher-Level Control

bull SFCrsquos lend themselves well to (as the name would imply) sequential processes

bull Three Important components in SFCrsquosbull Transitionsbull Stepsbull Jumps

bull The status of the process can be viewed as a flow chart

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 73

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 74

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 75

PLC - HMI Communication

A ldquoPLC Heartbeatrdquo is traditionally used to monitor the PLC - HMI Communication sometimes called ardquoWatchdog Timerrdquo

Call it whatever you want but the PLC amp 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 ldquodiesrdquo then that switch doesnrsquot change state and an alarm alerts the operator

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 76

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 77

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 78

TUTORIAL

Part 2B

HMI Programming

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 79

Ethernet (TCPIP) IO Driver

The Ethernet (TCPIP) IO Driver allows the HMI to communicate with the PLC (In this case the driver is called MBENETEXE)

The PLC has an ethernet module in one of the slots that has a ldquoCAT5RJ-45rdquo 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 ldquoCAT5RJ-45rdquo receptacle for the ethernet cable

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 80

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 81

Operator Screens amp Popup Displays

The display is laid out in 3 sections

bull Upper - Security amp Alarm Windowbull Middle- Main Operator Screens bull Lower - Menu amp Popup Displays

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 82

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 83

Scripting

There are 6 types of ldquoScriptsrdquobull Application Scriptsbull Key Scriptsbull Condition Scriptsbull Data Change Scriptsbull Quick Function Scriptsbull ActiveX Event Scripts

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 84

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 85

Access Names

The ldquoAccess Namesrdquo Must be configured to allow the PLC - HMI communications

Note that the ldquoApplicationTopicrdquo is the same as the IO Driver

The ldquocomputer namerdquo is the name of the PC that the HMI is running on (brad_s_carlberg in this case)

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 86

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 87

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 88

Indirect Tags

ldquoIndirect Tagsrdquo were used here to minimize the number of popup displays

This is especially useful in HMIrsquos with many tags

ONLY 12 popup displays are reused throughout the HMI

This gives the HMI a ldquoDCS-Likerdquo Look amp Feel

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 89

Popup Display TypesThe tag point type determines which popup display to use

Analog InputHIC (or Analog Output)PID (or Analog Composite)

bull PID WITH AUTO amp CASCADE amp RATIObull PID WITH AUTO amp RATIO

Diginbull Motor Status

DigOutMotor (or Digital Composite)

bull Motor with ILock and PermNumericSet TimersAlarm DetailAlarm Tags

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 90

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 91

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 92

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 93

Bars Buttons amp Sliders

By choosing to use indirect tags we complicate the Bar Graphs Buttons amp Sliders in the popup displays

Different scales need to be used for different engineering unit ranges

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 94

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 95

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 96

Popup Displays

The next two pages shows how the individual popup displays use the indirect tags

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 97

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 98

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 99

Adding a ldquoTouch Targetrdquo to a Display

2 Tell which tags to use

3 Tell which popup display to call upWhat kind of point type is it

3 Steps1 Tell which scale to use (if itrsquos an analog point type)

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 100

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 101

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 102

TUTORIAL

Part 2C

Excel Spreadsheets

amp

Visual Basic

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 103

A ldquoCHEAP amp DIRTYrdquo HMI With Excel

The 4 key parameters are

To communicate with the PLCUse brad_s_carlbergmbenet|ANOXIC_OXICrsquoplcregisterrsquo

Excel uses ldquopeeksrdquo amp ldquopokesrdquo to read from amp write to a PLC or HMI

To communicate with the HMIbrad_s_carlbergview|Tagnamersquotagnamersquo

bull computer namebull applicationbull topicbull item

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 104

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 105

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 106

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 107

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 108

Excel Macros

bull ldquoRequestrdquo Macro to read values

bull ldquoPokerdquo Macro to write values

bull A Sample Excel Macro

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 109

Sub PokeMacro()MsgBox ApplicationNetworkTemplatesPathChannel = ApplicationDDEInitiate(app=brad_s_carlbergVIEW topic=Tagname) This opens a DDE channel to ViewApplicationDDEPoke Channel Temperature1 Worksheets(Sheet1)Range(A1) Puts value from R1C1 into Temperature1ApplicationDDEPoke Channel DDEReal Worksheets(Sheet1)Range(A2) Puts value from R1C1 into Temperature1ApplicationDDEPoke Channel DDEInteger Worksheets(Sheet1)Range(A3) Puts value from R1C1 into Temperature1ApplicationDDETerminate Channel This terminates the DDE channelEnd SubSub RequestMacro()Channel = ApplicationDDEInitiate(app=brad_s_carlbergVIEW topic=Tagname) This opens a DDE channel to ViewWorksheets(Sheet1)Range(C4) = ApplicationDDERequest(Channel $Hour)Worksheets(Sheet1)Range(C5) = ApplicationDDERequest(Channel $Minute)Worksheets(Sheet1)Range(C6) = ApplicationDDERequest(Channel $Second)Worksheets(Sheet1)Range(C9) = ApplicationDDERequest(Channel $day)Worksheets(Sheet1)Range(C10) = ApplicationDDERequest(Channel $date)Worksheets(Sheet1)Range(C11) = ApplicationDDERequest(Channel $datestring)Worksheets(Sheet1)Range(C12) = ApplicationDDERequest(Channel $datetime)Worksheets(Sheet1)Range(C13) = ApplicationDDERequest(Channel $date)Worksheets(Sheet1)Range(C14) = ApplicationDDERequest(Channel $month)Worksheets(Sheet1)Range(C15) = ApplicationDDERequest(Channel $year)Worksheets(Sheet1)Range(C16) = ApplicationDDERequest(Channel $time)Worksheets(Sheet1)Range(C17) = ApplicationDDERequest(Channel $timestring)Worksheets(Sheet1)Range(C18) = ApplicationDDERequest(Channel $applicationversion)Worksheets(Sheet1)Range(C19) = ApplicationDDERequest(Channel $startddeconversations)Worksheets(Sheet1)Range(C20) = ApplicationDDERequest(Channel $accesslevel)Worksheets(Sheet1)Range(C21) = ApplicationDDERequest(Channel $alarmlogging)Worksheets(Sheet1)Range(C22) = ApplicationDDERequest(Channel $applicationchanged)Worksheets(Sheet1)Range(C23) = ApplicationDDERequest(Channel $configureusers)Worksheets(Sheet1)Range(C24) = ApplicationDDERequest(Channel $changepassword)Worksheets(Sheet1)Range(C25) = ApplicationDDERequest(Channel $InactivityTimeout)Worksheets(Sheet1)Range(C26) = ApplicationDDERequest(Channel $InactivityWarning)Worksheets(Sheet1)Range(C27) = ApplicationDDERequest(Channel $LogicRunning)Worksheets(Sheet1)Range(C28) = ApplicationDDERequest(Channel $OperatorEntered)Worksheets(Sheet1)Range(C29) = ApplicationDDERequest(Channel $Operator)Worksheets(Sheet1)Range(C30) = ApplicationDDERequest(Channel $PasswordEntered)ApplicationDDETerminate Channel This terminates the DDE channelEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 110

Visual Basic

ldquoRoll Your Ownrdquo HMI - Much More powerful than Excel

Key Parameters computer nameapplication|topicitem

IO Emulator - MBPlusSimulateexe

Can ldquoRead Fromrdquo amp ldquoWrite Tordquo PLC andor HMI

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 111

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 112

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 113

Dim PauseTime Start Finish TotalTime As Integer Declare variables

Private Sub txtAIT_332A_SCALED_Change()On Error GoTo PokeAIT_332AErrortxtAIT_332A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtAIT_332A_SCALEDText = Int((3 Rnd) + 20) Generate random value between 20 and 23txtAIT_332A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtAIT_332A_SCALEDLinkItem = AIT_332A_SCALEDtxtAIT_332A_SCALEDLinkMode = 2txtAIT_332A_SCALEDLinkPoketxtAIT_332A_SCALEDLinkMode = 0 DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total time

PokeAIT_332AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtAIT_332A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 114

Private Sub txtAIT_346A_SCALED_Change()On Error GoTo PokeAIT_346AErrortxtAIT_346A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtAIT_346A_SCALEDText = Int((3 Rnd) + 15) Generate random value between 15 and 18txtAIT_346A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtAIT_346A_SCALEDLinkItem = AIT_346A_SCALEDtxtAIT_346A_SCALEDLinkMode = 2txtAIT_346A_SCALEDLinkPoketxtAIT_346A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeAIT_346AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtAIT_346A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 115

Private Sub txtFIT_321A_SCALED_Change()On Error GoTo PokeFIT_321AErrortxtFIT_321A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtFIT_321A_SCALEDText = Int((10 Rnd) + 120) Generate random value between 120 and 130txtFIT_321A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_321A_SCALEDLinkItem = FIT_321A_SCALEDtxtFIT_321A_SCALEDLinkMode = 2txtFIT_321A_SCALEDLinkPoketxtFIT_321A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total time

PokeFIT_321AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_321A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume Next

End Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 116

Private Sub txtFIT_341A_SCALED_Change()On Error GoTo PokeFIT_341AErrortxtFIT_341A_SCALEDLinkMode = 0 PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTime

txtFIT_341A_SCALEDText = Int((3 Rnd) + 18) Generate random value between 18 and 21

txtFIT_341A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_341A_SCALEDLinkItem = FIT_341A_SCALEDtxtFIT_341A_SCALEDLinkMode = 2txtFIT_341A_SCALEDLinkPoketxtFIT_341A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeFIT_341AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_341A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 117

Private Sub txtFIT_343A_SCALED_Change()On Error GoTo PokeFIT_343AErrortxtFIT_343A_SCALEDLinkMode = 0 PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTime

txtFIT_343A_SCALEDText = Int((1 Rnd) + 3) Generate random value between 3 and 4

txtFIT_343A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_343A_SCALEDLinkItem = FIT_343A_SCALEDtxtFIT_343A_SCALEDLinkMode = 2txtFIT_343A_SCALEDLinkPoketxtFIT_343A_SCALEDLinkMode = 0 DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeFIT_343AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_343A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 118

TUTORIAL

Part 4

Questions

amp

Answers

  • Slide 1
  • Slide 2
  • Slide 3
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Slide 8
  • Slide 9
  • Slide 10
  • Slide 11
  • Slide 12
  • Slide 13
  • Slide 14
  • Slide 15
  • Slide 16
  • Slide 17
  • Slide 18
  • Slide 19
  • Slide 20
  • Slide 21
  • Slide 22
  • Slide 23
  • Slide 24
  • Slide 25
  • Slide 26
  • Slide 27
  • Slide 28
  • Slide 29
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
  • Slide 34
  • Slide 35
  • Slide 36
  • Slide 37
  • Slide 38
  • Slide 39
  • Slide 40
  • Slide 41
  • Slide 42
  • Slide 43
  • Slide 44
  • Slide 45
  • Slide 46
  • Slide 47
  • Slide 48
  • Slide 49
  • Slide 50
  • Slide 51
  • Slide 52
  • Slide 53
  • Slide 54
  • Slide 55
  • Slide 56
  • Slide 57
  • Slide 58
  • Slide 59
  • Slide 60
  • Slide 61
  • Slide 62
  • Slide 63
  • Slide 64
  • Slide 65
  • Slide 66
  • Slide 67
  • Slide 68
  • Slide 69
  • Slide 70
  • Slide 71
  • Slide 72
  • Slide 73
  • Slide 74
  • Slide 75
  • Slide 76
  • Slide 77
  • Slide 78
  • Slide 79
  • Slide 80
  • Slide 81
  • Slide 82
  • Slide 83
  • Slide 84
  • Slide 85
  • Slide 86
  • Slide 87
  • Slide 88
  • Slide 89
  • Slide 90
  • Slide 91
  • Slide 92
  • Slide 93
  • Slide 94
  • Slide 95
  • Slide 96
  • Slide 97
  • Slide 98
  • Slide 99
  • Slide 100
  • Slide 101
  • Slide 102
  • Slide 103
  • Slide 104
  • Slide 105
  • Slide 106
  • Slide 107
  • Slide 108
  • Slide 109
  • Slide 110
  • Slide 111
  • Slide 112
  • Slide 113
  • Slide 114
  • Slide 115
  • Slide 116
  • Slide 117
  • Slide 118
Page 41: TUTORIAL Ethernet PLC's Improve Oxygen Consumption ISA Expo/2001Houston, Texas Water & Wastewater Industry DivisionTuesday, September 11, 2001 1 Brad.

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 41

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 Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 42

Like a DCS

middot 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

middot 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 amp CASCADE amp RATIO PID WITH AUTO amp RATIO Digin Motor Status DigOut Motor (or Digital Composite) Motor with ILock and Perm Numeric Set Timers Alarm Detail and Alarm Tags

middot A single generic trend display to trend ALL trendable (archived) points

Alarm Management

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

middot A Distributed Alarm Summary has been used to give better alarm management tools

bull Up to eight trend pens on the trend display

bull The operator picks which values to trend by clicking in the center of the trend

display

bull 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 44

The AnoxicOxic 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 Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 46

The following control levels are available for Oxygen1 Cascade from Dissolved Oxygen

2 Ratio from Discharge flow3 Auto-Manual Control

The following control levels are available for the Recycle flow1 Ratio from Discharge flow

2 Auto-Manual Control

The following control levels are available for the PD Blowers3 Timed Mode

2 Dissolved Oxygen Mode3 Manual Mode

Conclusions

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 47

Following the commissioning of the ethernet-based PLCs Oxygen consumption was significantly reduced

The advanced controls allow the operators to leave the process alone and continue to optimally treat the sewage

Conclusions

Following the commissioning of the ethernet-based PLCs AnoxicOxic 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 Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 48

Summary

The PD Blowers ran in Timed Mode andor 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

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 Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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 Authoritys 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 50

TUTORIAL

Part 2A

PLC Programming Basics

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 51

Separate parts of the process have been organized into a separate ldquoSECTIONrdquo

PLC Program Organization

Each ldquoSECTIONrdquo can be any of the IEC programming types

bull Ladder (LD)bull Structured Text (ST)

bull Instruction List (IL)

bull Function Blocks (FB)bull Sequential Function Charts (SFC)

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 52

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 53

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 54

IO Map

On-Line PLC Diagnostics

PLC Status

PLC Simulator

Ethernet (TCPIP) Address

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 55

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 56

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 57

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 58

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 59

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 60

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 61

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 62

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 63

Structured Text was used hereNOT Ladder

Programming for Motors

The PLC DOES NOT CAREStructured Text Functions EXACTLY

the same as LadderUse what yoursquore comfortable with

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 64

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 65

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 66

IEC Function Blocks Used Here

Programming for Analogs amp PID

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 67

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 68

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 69

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 70

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 71

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 72

Sequential Function Charts were used here

Higher-Level Control

bull SFCrsquos lend themselves well to (as the name would imply) sequential processes

bull Three Important components in SFCrsquosbull Transitionsbull Stepsbull Jumps

bull The status of the process can be viewed as a flow chart

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 73

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 74

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 75

PLC - HMI Communication

A ldquoPLC Heartbeatrdquo is traditionally used to monitor the PLC - HMI Communication sometimes called ardquoWatchdog Timerrdquo

Call it whatever you want but the PLC amp 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 ldquodiesrdquo then that switch doesnrsquot change state and an alarm alerts the operator

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 76

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 77

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 78

TUTORIAL

Part 2B

HMI Programming

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 79

Ethernet (TCPIP) IO Driver

The Ethernet (TCPIP) IO Driver allows the HMI to communicate with the PLC (In this case the driver is called MBENETEXE)

The PLC has an ethernet module in one of the slots that has a ldquoCAT5RJ-45rdquo 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 ldquoCAT5RJ-45rdquo receptacle for the ethernet cable

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 80

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 81

Operator Screens amp Popup Displays

The display is laid out in 3 sections

bull Upper - Security amp Alarm Windowbull Middle- Main Operator Screens bull Lower - Menu amp Popup Displays

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 82

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 83

Scripting

There are 6 types of ldquoScriptsrdquobull Application Scriptsbull Key Scriptsbull Condition Scriptsbull Data Change Scriptsbull Quick Function Scriptsbull ActiveX Event Scripts

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 84

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 85

Access Names

The ldquoAccess Namesrdquo Must be configured to allow the PLC - HMI communications

Note that the ldquoApplicationTopicrdquo is the same as the IO Driver

The ldquocomputer namerdquo is the name of the PC that the HMI is running on (brad_s_carlberg in this case)

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 86

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 87

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 88

Indirect Tags

ldquoIndirect Tagsrdquo were used here to minimize the number of popup displays

This is especially useful in HMIrsquos with many tags

ONLY 12 popup displays are reused throughout the HMI

This gives the HMI a ldquoDCS-Likerdquo Look amp Feel

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 89

Popup Display TypesThe tag point type determines which popup display to use

Analog InputHIC (or Analog Output)PID (or Analog Composite)

bull PID WITH AUTO amp CASCADE amp RATIObull PID WITH AUTO amp RATIO

Diginbull Motor Status

DigOutMotor (or Digital Composite)

bull Motor with ILock and PermNumericSet TimersAlarm DetailAlarm Tags

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 90

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 91

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 92

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 93

Bars Buttons amp Sliders

By choosing to use indirect tags we complicate the Bar Graphs Buttons amp Sliders in the popup displays

Different scales need to be used for different engineering unit ranges

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 94

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 95

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 96

Popup Displays

The next two pages shows how the individual popup displays use the indirect tags

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 97

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 98

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 99

Adding a ldquoTouch Targetrdquo to a Display

2 Tell which tags to use

3 Tell which popup display to call upWhat kind of point type is it

3 Steps1 Tell which scale to use (if itrsquos an analog point type)

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 100

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 101

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 102

TUTORIAL

Part 2C

Excel Spreadsheets

amp

Visual Basic

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 103

A ldquoCHEAP amp DIRTYrdquo HMI With Excel

The 4 key parameters are

To communicate with the PLCUse brad_s_carlbergmbenet|ANOXIC_OXICrsquoplcregisterrsquo

Excel uses ldquopeeksrdquo amp ldquopokesrdquo to read from amp write to a PLC or HMI

To communicate with the HMIbrad_s_carlbergview|Tagnamersquotagnamersquo

bull computer namebull applicationbull topicbull item

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 104

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 105

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 106

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 107

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 108

Excel Macros

bull ldquoRequestrdquo Macro to read values

bull ldquoPokerdquo Macro to write values

bull A Sample Excel Macro

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 109

Sub PokeMacro()MsgBox ApplicationNetworkTemplatesPathChannel = ApplicationDDEInitiate(app=brad_s_carlbergVIEW topic=Tagname) This opens a DDE channel to ViewApplicationDDEPoke Channel Temperature1 Worksheets(Sheet1)Range(A1) Puts value from R1C1 into Temperature1ApplicationDDEPoke Channel DDEReal Worksheets(Sheet1)Range(A2) Puts value from R1C1 into Temperature1ApplicationDDEPoke Channel DDEInteger Worksheets(Sheet1)Range(A3) Puts value from R1C1 into Temperature1ApplicationDDETerminate Channel This terminates the DDE channelEnd SubSub RequestMacro()Channel = ApplicationDDEInitiate(app=brad_s_carlbergVIEW topic=Tagname) This opens a DDE channel to ViewWorksheets(Sheet1)Range(C4) = ApplicationDDERequest(Channel $Hour)Worksheets(Sheet1)Range(C5) = ApplicationDDERequest(Channel $Minute)Worksheets(Sheet1)Range(C6) = ApplicationDDERequest(Channel $Second)Worksheets(Sheet1)Range(C9) = ApplicationDDERequest(Channel $day)Worksheets(Sheet1)Range(C10) = ApplicationDDERequest(Channel $date)Worksheets(Sheet1)Range(C11) = ApplicationDDERequest(Channel $datestring)Worksheets(Sheet1)Range(C12) = ApplicationDDERequest(Channel $datetime)Worksheets(Sheet1)Range(C13) = ApplicationDDERequest(Channel $date)Worksheets(Sheet1)Range(C14) = ApplicationDDERequest(Channel $month)Worksheets(Sheet1)Range(C15) = ApplicationDDERequest(Channel $year)Worksheets(Sheet1)Range(C16) = ApplicationDDERequest(Channel $time)Worksheets(Sheet1)Range(C17) = ApplicationDDERequest(Channel $timestring)Worksheets(Sheet1)Range(C18) = ApplicationDDERequest(Channel $applicationversion)Worksheets(Sheet1)Range(C19) = ApplicationDDERequest(Channel $startddeconversations)Worksheets(Sheet1)Range(C20) = ApplicationDDERequest(Channel $accesslevel)Worksheets(Sheet1)Range(C21) = ApplicationDDERequest(Channel $alarmlogging)Worksheets(Sheet1)Range(C22) = ApplicationDDERequest(Channel $applicationchanged)Worksheets(Sheet1)Range(C23) = ApplicationDDERequest(Channel $configureusers)Worksheets(Sheet1)Range(C24) = ApplicationDDERequest(Channel $changepassword)Worksheets(Sheet1)Range(C25) = ApplicationDDERequest(Channel $InactivityTimeout)Worksheets(Sheet1)Range(C26) = ApplicationDDERequest(Channel $InactivityWarning)Worksheets(Sheet1)Range(C27) = ApplicationDDERequest(Channel $LogicRunning)Worksheets(Sheet1)Range(C28) = ApplicationDDERequest(Channel $OperatorEntered)Worksheets(Sheet1)Range(C29) = ApplicationDDERequest(Channel $Operator)Worksheets(Sheet1)Range(C30) = ApplicationDDERequest(Channel $PasswordEntered)ApplicationDDETerminate Channel This terminates the DDE channelEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 110

Visual Basic

ldquoRoll Your Ownrdquo HMI - Much More powerful than Excel

Key Parameters computer nameapplication|topicitem

IO Emulator - MBPlusSimulateexe

Can ldquoRead Fromrdquo amp ldquoWrite Tordquo PLC andor HMI

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 111

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 112

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 113

Dim PauseTime Start Finish TotalTime As Integer Declare variables

Private Sub txtAIT_332A_SCALED_Change()On Error GoTo PokeAIT_332AErrortxtAIT_332A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtAIT_332A_SCALEDText = Int((3 Rnd) + 20) Generate random value between 20 and 23txtAIT_332A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtAIT_332A_SCALEDLinkItem = AIT_332A_SCALEDtxtAIT_332A_SCALEDLinkMode = 2txtAIT_332A_SCALEDLinkPoketxtAIT_332A_SCALEDLinkMode = 0 DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total time

PokeAIT_332AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtAIT_332A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 114

Private Sub txtAIT_346A_SCALED_Change()On Error GoTo PokeAIT_346AErrortxtAIT_346A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtAIT_346A_SCALEDText = Int((3 Rnd) + 15) Generate random value between 15 and 18txtAIT_346A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtAIT_346A_SCALEDLinkItem = AIT_346A_SCALEDtxtAIT_346A_SCALEDLinkMode = 2txtAIT_346A_SCALEDLinkPoketxtAIT_346A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeAIT_346AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtAIT_346A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 115

Private Sub txtFIT_321A_SCALED_Change()On Error GoTo PokeFIT_321AErrortxtFIT_321A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtFIT_321A_SCALEDText = Int((10 Rnd) + 120) Generate random value between 120 and 130txtFIT_321A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_321A_SCALEDLinkItem = FIT_321A_SCALEDtxtFIT_321A_SCALEDLinkMode = 2txtFIT_321A_SCALEDLinkPoketxtFIT_321A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total time

PokeFIT_321AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_321A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume Next

End Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 116

Private Sub txtFIT_341A_SCALED_Change()On Error GoTo PokeFIT_341AErrortxtFIT_341A_SCALEDLinkMode = 0 PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTime

txtFIT_341A_SCALEDText = Int((3 Rnd) + 18) Generate random value between 18 and 21

txtFIT_341A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_341A_SCALEDLinkItem = FIT_341A_SCALEDtxtFIT_341A_SCALEDLinkMode = 2txtFIT_341A_SCALEDLinkPoketxtFIT_341A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeFIT_341AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_341A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 117

Private Sub txtFIT_343A_SCALED_Change()On Error GoTo PokeFIT_343AErrortxtFIT_343A_SCALEDLinkMode = 0 PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTime

txtFIT_343A_SCALEDText = Int((1 Rnd) + 3) Generate random value between 3 and 4

txtFIT_343A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_343A_SCALEDLinkItem = FIT_343A_SCALEDtxtFIT_343A_SCALEDLinkMode = 2txtFIT_343A_SCALEDLinkPoketxtFIT_343A_SCALEDLinkMode = 0 DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeFIT_343AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_343A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 118

TUTORIAL

Part 4

Questions

amp

Answers

  • Slide 1
  • Slide 2
  • Slide 3
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Slide 8
  • Slide 9
  • Slide 10
  • Slide 11
  • Slide 12
  • Slide 13
  • Slide 14
  • Slide 15
  • Slide 16
  • Slide 17
  • Slide 18
  • Slide 19
  • Slide 20
  • Slide 21
  • Slide 22
  • Slide 23
  • Slide 24
  • Slide 25
  • Slide 26
  • Slide 27
  • Slide 28
  • Slide 29
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
  • Slide 34
  • Slide 35
  • Slide 36
  • Slide 37
  • Slide 38
  • Slide 39
  • Slide 40
  • Slide 41
  • Slide 42
  • Slide 43
  • Slide 44
  • Slide 45
  • Slide 46
  • Slide 47
  • Slide 48
  • Slide 49
  • Slide 50
  • Slide 51
  • Slide 52
  • Slide 53
  • Slide 54
  • Slide 55
  • Slide 56
  • Slide 57
  • Slide 58
  • Slide 59
  • Slide 60
  • Slide 61
  • Slide 62
  • Slide 63
  • Slide 64
  • Slide 65
  • Slide 66
  • Slide 67
  • Slide 68
  • Slide 69
  • Slide 70
  • Slide 71
  • Slide 72
  • Slide 73
  • Slide 74
  • Slide 75
  • Slide 76
  • Slide 77
  • Slide 78
  • Slide 79
  • Slide 80
  • Slide 81
  • Slide 82
  • Slide 83
  • Slide 84
  • Slide 85
  • Slide 86
  • Slide 87
  • Slide 88
  • Slide 89
  • Slide 90
  • Slide 91
  • Slide 92
  • Slide 93
  • Slide 94
  • Slide 95
  • Slide 96
  • Slide 97
  • Slide 98
  • Slide 99
  • Slide 100
  • Slide 101
  • Slide 102
  • Slide 103
  • Slide 104
  • Slide 105
  • Slide 106
  • Slide 107
  • Slide 108
  • Slide 109
  • Slide 110
  • Slide 111
  • Slide 112
  • Slide 113
  • Slide 114
  • Slide 115
  • Slide 116
  • Slide 117
  • Slide 118
Page 42: TUTORIAL Ethernet PLC's Improve Oxygen Consumption ISA Expo/2001Houston, Texas Water & Wastewater Industry DivisionTuesday, September 11, 2001 1 Brad.

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 Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 42

Like a DCS

middot 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

middot 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 amp CASCADE amp RATIO PID WITH AUTO amp RATIO Digin Motor Status DigOut Motor (or Digital Composite) Motor with ILock and Perm Numeric Set Timers Alarm Detail and Alarm Tags

middot A single generic trend display to trend ALL trendable (archived) points

Alarm Management

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

middot A Distributed Alarm Summary has been used to give better alarm management tools

bull Up to eight trend pens on the trend display

bull The operator picks which values to trend by clicking in the center of the trend

display

bull 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 44

The AnoxicOxic 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 Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 46

The following control levels are available for Oxygen1 Cascade from Dissolved Oxygen

2 Ratio from Discharge flow3 Auto-Manual Control

The following control levels are available for the Recycle flow1 Ratio from Discharge flow

2 Auto-Manual Control

The following control levels are available for the PD Blowers3 Timed Mode

2 Dissolved Oxygen Mode3 Manual Mode

Conclusions

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 47

Following the commissioning of the ethernet-based PLCs Oxygen consumption was significantly reduced

The advanced controls allow the operators to leave the process alone and continue to optimally treat the sewage

Conclusions

Following the commissioning of the ethernet-based PLCs AnoxicOxic 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 Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 48

Summary

The PD Blowers ran in Timed Mode andor 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

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 Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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 Authoritys 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 50

TUTORIAL

Part 2A

PLC Programming Basics

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 51

Separate parts of the process have been organized into a separate ldquoSECTIONrdquo

PLC Program Organization

Each ldquoSECTIONrdquo can be any of the IEC programming types

bull Ladder (LD)bull Structured Text (ST)

bull Instruction List (IL)

bull Function Blocks (FB)bull Sequential Function Charts (SFC)

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 52

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 53

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 54

IO Map

On-Line PLC Diagnostics

PLC Status

PLC Simulator

Ethernet (TCPIP) Address

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 55

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 56

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 57

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 58

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 59

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 60

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 61

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 62

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 63

Structured Text was used hereNOT Ladder

Programming for Motors

The PLC DOES NOT CAREStructured Text Functions EXACTLY

the same as LadderUse what yoursquore comfortable with

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 64

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 65

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 66

IEC Function Blocks Used Here

Programming for Analogs amp PID

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 67

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 68

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 69

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 70

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 71

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 72

Sequential Function Charts were used here

Higher-Level Control

bull SFCrsquos lend themselves well to (as the name would imply) sequential processes

bull Three Important components in SFCrsquosbull Transitionsbull Stepsbull Jumps

bull The status of the process can be viewed as a flow chart

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 73

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 74

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 75

PLC - HMI Communication

A ldquoPLC Heartbeatrdquo is traditionally used to monitor the PLC - HMI Communication sometimes called ardquoWatchdog Timerrdquo

Call it whatever you want but the PLC amp 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 ldquodiesrdquo then that switch doesnrsquot change state and an alarm alerts the operator

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 76

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 77

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 78

TUTORIAL

Part 2B

HMI Programming

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 79

Ethernet (TCPIP) IO Driver

The Ethernet (TCPIP) IO Driver allows the HMI to communicate with the PLC (In this case the driver is called MBENETEXE)

The PLC has an ethernet module in one of the slots that has a ldquoCAT5RJ-45rdquo 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 ldquoCAT5RJ-45rdquo receptacle for the ethernet cable

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 80

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 81

Operator Screens amp Popup Displays

The display is laid out in 3 sections

bull Upper - Security amp Alarm Windowbull Middle- Main Operator Screens bull Lower - Menu amp Popup Displays

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 82

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 83

Scripting

There are 6 types of ldquoScriptsrdquobull Application Scriptsbull Key Scriptsbull Condition Scriptsbull Data Change Scriptsbull Quick Function Scriptsbull ActiveX Event Scripts

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 84

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 85

Access Names

The ldquoAccess Namesrdquo Must be configured to allow the PLC - HMI communications

Note that the ldquoApplicationTopicrdquo is the same as the IO Driver

The ldquocomputer namerdquo is the name of the PC that the HMI is running on (brad_s_carlberg in this case)

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 86

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 87

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 88

Indirect Tags

ldquoIndirect Tagsrdquo were used here to minimize the number of popup displays

This is especially useful in HMIrsquos with many tags

ONLY 12 popup displays are reused throughout the HMI

This gives the HMI a ldquoDCS-Likerdquo Look amp Feel

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 89

Popup Display TypesThe tag point type determines which popup display to use

Analog InputHIC (or Analog Output)PID (or Analog Composite)

bull PID WITH AUTO amp CASCADE amp RATIObull PID WITH AUTO amp RATIO

Diginbull Motor Status

DigOutMotor (or Digital Composite)

bull Motor with ILock and PermNumericSet TimersAlarm DetailAlarm Tags

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 90

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 91

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 92

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 93

Bars Buttons amp Sliders

By choosing to use indirect tags we complicate the Bar Graphs Buttons amp Sliders in the popup displays

Different scales need to be used for different engineering unit ranges

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 94

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 95

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 96

Popup Displays

The next two pages shows how the individual popup displays use the indirect tags

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 97

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 98

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 99

Adding a ldquoTouch Targetrdquo to a Display

2 Tell which tags to use

3 Tell which popup display to call upWhat kind of point type is it

3 Steps1 Tell which scale to use (if itrsquos an analog point type)

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 100

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 101

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 102

TUTORIAL

Part 2C

Excel Spreadsheets

amp

Visual Basic

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 103

A ldquoCHEAP amp DIRTYrdquo HMI With Excel

The 4 key parameters are

To communicate with the PLCUse brad_s_carlbergmbenet|ANOXIC_OXICrsquoplcregisterrsquo

Excel uses ldquopeeksrdquo amp ldquopokesrdquo to read from amp write to a PLC or HMI

To communicate with the HMIbrad_s_carlbergview|Tagnamersquotagnamersquo

bull computer namebull applicationbull topicbull item

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 104

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 105

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 106

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 107

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 108

Excel Macros

bull ldquoRequestrdquo Macro to read values

bull ldquoPokerdquo Macro to write values

bull A Sample Excel Macro

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 109

Sub PokeMacro()MsgBox ApplicationNetworkTemplatesPathChannel = ApplicationDDEInitiate(app=brad_s_carlbergVIEW topic=Tagname) This opens a DDE channel to ViewApplicationDDEPoke Channel Temperature1 Worksheets(Sheet1)Range(A1) Puts value from R1C1 into Temperature1ApplicationDDEPoke Channel DDEReal Worksheets(Sheet1)Range(A2) Puts value from R1C1 into Temperature1ApplicationDDEPoke Channel DDEInteger Worksheets(Sheet1)Range(A3) Puts value from R1C1 into Temperature1ApplicationDDETerminate Channel This terminates the DDE channelEnd SubSub RequestMacro()Channel = ApplicationDDEInitiate(app=brad_s_carlbergVIEW topic=Tagname) This opens a DDE channel to ViewWorksheets(Sheet1)Range(C4) = ApplicationDDERequest(Channel $Hour)Worksheets(Sheet1)Range(C5) = ApplicationDDERequest(Channel $Minute)Worksheets(Sheet1)Range(C6) = ApplicationDDERequest(Channel $Second)Worksheets(Sheet1)Range(C9) = ApplicationDDERequest(Channel $day)Worksheets(Sheet1)Range(C10) = ApplicationDDERequest(Channel $date)Worksheets(Sheet1)Range(C11) = ApplicationDDERequest(Channel $datestring)Worksheets(Sheet1)Range(C12) = ApplicationDDERequest(Channel $datetime)Worksheets(Sheet1)Range(C13) = ApplicationDDERequest(Channel $date)Worksheets(Sheet1)Range(C14) = ApplicationDDERequest(Channel $month)Worksheets(Sheet1)Range(C15) = ApplicationDDERequest(Channel $year)Worksheets(Sheet1)Range(C16) = ApplicationDDERequest(Channel $time)Worksheets(Sheet1)Range(C17) = ApplicationDDERequest(Channel $timestring)Worksheets(Sheet1)Range(C18) = ApplicationDDERequest(Channel $applicationversion)Worksheets(Sheet1)Range(C19) = ApplicationDDERequest(Channel $startddeconversations)Worksheets(Sheet1)Range(C20) = ApplicationDDERequest(Channel $accesslevel)Worksheets(Sheet1)Range(C21) = ApplicationDDERequest(Channel $alarmlogging)Worksheets(Sheet1)Range(C22) = ApplicationDDERequest(Channel $applicationchanged)Worksheets(Sheet1)Range(C23) = ApplicationDDERequest(Channel $configureusers)Worksheets(Sheet1)Range(C24) = ApplicationDDERequest(Channel $changepassword)Worksheets(Sheet1)Range(C25) = ApplicationDDERequest(Channel $InactivityTimeout)Worksheets(Sheet1)Range(C26) = ApplicationDDERequest(Channel $InactivityWarning)Worksheets(Sheet1)Range(C27) = ApplicationDDERequest(Channel $LogicRunning)Worksheets(Sheet1)Range(C28) = ApplicationDDERequest(Channel $OperatorEntered)Worksheets(Sheet1)Range(C29) = ApplicationDDERequest(Channel $Operator)Worksheets(Sheet1)Range(C30) = ApplicationDDERequest(Channel $PasswordEntered)ApplicationDDETerminate Channel This terminates the DDE channelEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 110

Visual Basic

ldquoRoll Your Ownrdquo HMI - Much More powerful than Excel

Key Parameters computer nameapplication|topicitem

IO Emulator - MBPlusSimulateexe

Can ldquoRead Fromrdquo amp ldquoWrite Tordquo PLC andor HMI

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 111

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 112

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 113

Dim PauseTime Start Finish TotalTime As Integer Declare variables

Private Sub txtAIT_332A_SCALED_Change()On Error GoTo PokeAIT_332AErrortxtAIT_332A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtAIT_332A_SCALEDText = Int((3 Rnd) + 20) Generate random value between 20 and 23txtAIT_332A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtAIT_332A_SCALEDLinkItem = AIT_332A_SCALEDtxtAIT_332A_SCALEDLinkMode = 2txtAIT_332A_SCALEDLinkPoketxtAIT_332A_SCALEDLinkMode = 0 DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total time

PokeAIT_332AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtAIT_332A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 114

Private Sub txtAIT_346A_SCALED_Change()On Error GoTo PokeAIT_346AErrortxtAIT_346A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtAIT_346A_SCALEDText = Int((3 Rnd) + 15) Generate random value between 15 and 18txtAIT_346A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtAIT_346A_SCALEDLinkItem = AIT_346A_SCALEDtxtAIT_346A_SCALEDLinkMode = 2txtAIT_346A_SCALEDLinkPoketxtAIT_346A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeAIT_346AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtAIT_346A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 115

Private Sub txtFIT_321A_SCALED_Change()On Error GoTo PokeFIT_321AErrortxtFIT_321A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtFIT_321A_SCALEDText = Int((10 Rnd) + 120) Generate random value between 120 and 130txtFIT_321A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_321A_SCALEDLinkItem = FIT_321A_SCALEDtxtFIT_321A_SCALEDLinkMode = 2txtFIT_321A_SCALEDLinkPoketxtFIT_321A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total time

PokeFIT_321AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_321A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume Next

End Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 116

Private Sub txtFIT_341A_SCALED_Change()On Error GoTo PokeFIT_341AErrortxtFIT_341A_SCALEDLinkMode = 0 PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTime

txtFIT_341A_SCALEDText = Int((3 Rnd) + 18) Generate random value between 18 and 21

txtFIT_341A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_341A_SCALEDLinkItem = FIT_341A_SCALEDtxtFIT_341A_SCALEDLinkMode = 2txtFIT_341A_SCALEDLinkPoketxtFIT_341A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeFIT_341AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_341A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 117

Private Sub txtFIT_343A_SCALED_Change()On Error GoTo PokeFIT_343AErrortxtFIT_343A_SCALEDLinkMode = 0 PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTime

txtFIT_343A_SCALEDText = Int((1 Rnd) + 3) Generate random value between 3 and 4

txtFIT_343A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_343A_SCALEDLinkItem = FIT_343A_SCALEDtxtFIT_343A_SCALEDLinkMode = 2txtFIT_343A_SCALEDLinkPoketxtFIT_343A_SCALEDLinkMode = 0 DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeFIT_343AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_343A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 118

TUTORIAL

Part 4

Questions

amp

Answers

  • Slide 1
  • Slide 2
  • Slide 3
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Slide 8
  • Slide 9
  • Slide 10
  • Slide 11
  • Slide 12
  • Slide 13
  • Slide 14
  • Slide 15
  • Slide 16
  • Slide 17
  • Slide 18
  • Slide 19
  • Slide 20
  • Slide 21
  • Slide 22
  • Slide 23
  • Slide 24
  • Slide 25
  • Slide 26
  • Slide 27
  • Slide 28
  • Slide 29
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
  • Slide 34
  • Slide 35
  • Slide 36
  • Slide 37
  • Slide 38
  • Slide 39
  • Slide 40
  • Slide 41
  • Slide 42
  • Slide 43
  • Slide 44
  • Slide 45
  • Slide 46
  • Slide 47
  • Slide 48
  • Slide 49
  • Slide 50
  • Slide 51
  • Slide 52
  • Slide 53
  • Slide 54
  • Slide 55
  • Slide 56
  • Slide 57
  • Slide 58
  • Slide 59
  • Slide 60
  • Slide 61
  • Slide 62
  • Slide 63
  • Slide 64
  • Slide 65
  • Slide 66
  • Slide 67
  • Slide 68
  • Slide 69
  • Slide 70
  • Slide 71
  • Slide 72
  • Slide 73
  • Slide 74
  • Slide 75
  • Slide 76
  • Slide 77
  • Slide 78
  • Slide 79
  • Slide 80
  • Slide 81
  • Slide 82
  • Slide 83
  • Slide 84
  • Slide 85
  • Slide 86
  • Slide 87
  • Slide 88
  • Slide 89
  • Slide 90
  • Slide 91
  • Slide 92
  • Slide 93
  • Slide 94
  • Slide 95
  • Slide 96
  • Slide 97
  • Slide 98
  • Slide 99
  • Slide 100
  • Slide 101
  • Slide 102
  • Slide 103
  • Slide 104
  • Slide 105
  • Slide 106
  • Slide 107
  • Slide 108
  • Slide 109
  • Slide 110
  • Slide 111
  • Slide 112
  • Slide 113
  • Slide 114
  • Slide 115
  • Slide 116
  • Slide 117
  • Slide 118
Page 43: TUTORIAL Ethernet PLC's Improve Oxygen Consumption ISA Expo/2001Houston, Texas Water & Wastewater Industry DivisionTuesday, September 11, 2001 1 Brad.

middot A single generic trend display to trend ALL trendable (archived) points

Alarm Management

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

middot A Distributed Alarm Summary has been used to give better alarm management tools

bull Up to eight trend pens on the trend display

bull The operator picks which values to trend by clicking in the center of the trend

display

bull 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 44

The AnoxicOxic 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 Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 46

The following control levels are available for Oxygen1 Cascade from Dissolved Oxygen

2 Ratio from Discharge flow3 Auto-Manual Control

The following control levels are available for the Recycle flow1 Ratio from Discharge flow

2 Auto-Manual Control

The following control levels are available for the PD Blowers3 Timed Mode

2 Dissolved Oxygen Mode3 Manual Mode

Conclusions

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 47

Following the commissioning of the ethernet-based PLCs Oxygen consumption was significantly reduced

The advanced controls allow the operators to leave the process alone and continue to optimally treat the sewage

Conclusions

Following the commissioning of the ethernet-based PLCs AnoxicOxic 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 Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 48

Summary

The PD Blowers ran in Timed Mode andor 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

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 Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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 Authoritys 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 50

TUTORIAL

Part 2A

PLC Programming Basics

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 51

Separate parts of the process have been organized into a separate ldquoSECTIONrdquo

PLC Program Organization

Each ldquoSECTIONrdquo can be any of the IEC programming types

bull Ladder (LD)bull Structured Text (ST)

bull Instruction List (IL)

bull Function Blocks (FB)bull Sequential Function Charts (SFC)

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 52

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 53

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 54

IO Map

On-Line PLC Diagnostics

PLC Status

PLC Simulator

Ethernet (TCPIP) Address

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 55

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 56

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 57

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 58

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 59

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 60

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 61

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 62

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 63

Structured Text was used hereNOT Ladder

Programming for Motors

The PLC DOES NOT CAREStructured Text Functions EXACTLY

the same as LadderUse what yoursquore comfortable with

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 64

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 65

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 66

IEC Function Blocks Used Here

Programming for Analogs amp PID

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 67

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 68

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 69

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 70

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 71

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 72

Sequential Function Charts were used here

Higher-Level Control

bull SFCrsquos lend themselves well to (as the name would imply) sequential processes

bull Three Important components in SFCrsquosbull Transitionsbull Stepsbull Jumps

bull The status of the process can be viewed as a flow chart

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 73

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 74

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 75

PLC - HMI Communication

A ldquoPLC Heartbeatrdquo is traditionally used to monitor the PLC - HMI Communication sometimes called ardquoWatchdog Timerrdquo

Call it whatever you want but the PLC amp 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 ldquodiesrdquo then that switch doesnrsquot change state and an alarm alerts the operator

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 76

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 77

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 78

TUTORIAL

Part 2B

HMI Programming

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 79

Ethernet (TCPIP) IO Driver

The Ethernet (TCPIP) IO Driver allows the HMI to communicate with the PLC (In this case the driver is called MBENETEXE)

The PLC has an ethernet module in one of the slots that has a ldquoCAT5RJ-45rdquo 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 ldquoCAT5RJ-45rdquo receptacle for the ethernet cable

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 80

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 81

Operator Screens amp Popup Displays

The display is laid out in 3 sections

bull Upper - Security amp Alarm Windowbull Middle- Main Operator Screens bull Lower - Menu amp Popup Displays

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 82

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 83

Scripting

There are 6 types of ldquoScriptsrdquobull Application Scriptsbull Key Scriptsbull Condition Scriptsbull Data Change Scriptsbull Quick Function Scriptsbull ActiveX Event Scripts

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 84

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 85

Access Names

The ldquoAccess Namesrdquo Must be configured to allow the PLC - HMI communications

Note that the ldquoApplicationTopicrdquo is the same as the IO Driver

The ldquocomputer namerdquo is the name of the PC that the HMI is running on (brad_s_carlberg in this case)

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 86

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 87

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 88

Indirect Tags

ldquoIndirect Tagsrdquo were used here to minimize the number of popup displays

This is especially useful in HMIrsquos with many tags

ONLY 12 popup displays are reused throughout the HMI

This gives the HMI a ldquoDCS-Likerdquo Look amp Feel

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 89

Popup Display TypesThe tag point type determines which popup display to use

Analog InputHIC (or Analog Output)PID (or Analog Composite)

bull PID WITH AUTO amp CASCADE amp RATIObull PID WITH AUTO amp RATIO

Diginbull Motor Status

DigOutMotor (or Digital Composite)

bull Motor with ILock and PermNumericSet TimersAlarm DetailAlarm Tags

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 90

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 91

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 92

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 93

Bars Buttons amp Sliders

By choosing to use indirect tags we complicate the Bar Graphs Buttons amp Sliders in the popup displays

Different scales need to be used for different engineering unit ranges

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 94

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 95

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 96

Popup Displays

The next two pages shows how the individual popup displays use the indirect tags

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 97

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 98

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 99

Adding a ldquoTouch Targetrdquo to a Display

2 Tell which tags to use

3 Tell which popup display to call upWhat kind of point type is it

3 Steps1 Tell which scale to use (if itrsquos an analog point type)

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 100

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 101

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 102

TUTORIAL

Part 2C

Excel Spreadsheets

amp

Visual Basic

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 103

A ldquoCHEAP amp DIRTYrdquo HMI With Excel

The 4 key parameters are

To communicate with the PLCUse brad_s_carlbergmbenet|ANOXIC_OXICrsquoplcregisterrsquo

Excel uses ldquopeeksrdquo amp ldquopokesrdquo to read from amp write to a PLC or HMI

To communicate with the HMIbrad_s_carlbergview|Tagnamersquotagnamersquo

bull computer namebull applicationbull topicbull item

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 104

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 105

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 106

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 107

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 108

Excel Macros

bull ldquoRequestrdquo Macro to read values

bull ldquoPokerdquo Macro to write values

bull A Sample Excel Macro

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 109

Sub PokeMacro()MsgBox ApplicationNetworkTemplatesPathChannel = ApplicationDDEInitiate(app=brad_s_carlbergVIEW topic=Tagname) This opens a DDE channel to ViewApplicationDDEPoke Channel Temperature1 Worksheets(Sheet1)Range(A1) Puts value from R1C1 into Temperature1ApplicationDDEPoke Channel DDEReal Worksheets(Sheet1)Range(A2) Puts value from R1C1 into Temperature1ApplicationDDEPoke Channel DDEInteger Worksheets(Sheet1)Range(A3) Puts value from R1C1 into Temperature1ApplicationDDETerminate Channel This terminates the DDE channelEnd SubSub RequestMacro()Channel = ApplicationDDEInitiate(app=brad_s_carlbergVIEW topic=Tagname) This opens a DDE channel to ViewWorksheets(Sheet1)Range(C4) = ApplicationDDERequest(Channel $Hour)Worksheets(Sheet1)Range(C5) = ApplicationDDERequest(Channel $Minute)Worksheets(Sheet1)Range(C6) = ApplicationDDERequest(Channel $Second)Worksheets(Sheet1)Range(C9) = ApplicationDDERequest(Channel $day)Worksheets(Sheet1)Range(C10) = ApplicationDDERequest(Channel $date)Worksheets(Sheet1)Range(C11) = ApplicationDDERequest(Channel $datestring)Worksheets(Sheet1)Range(C12) = ApplicationDDERequest(Channel $datetime)Worksheets(Sheet1)Range(C13) = ApplicationDDERequest(Channel $date)Worksheets(Sheet1)Range(C14) = ApplicationDDERequest(Channel $month)Worksheets(Sheet1)Range(C15) = ApplicationDDERequest(Channel $year)Worksheets(Sheet1)Range(C16) = ApplicationDDERequest(Channel $time)Worksheets(Sheet1)Range(C17) = ApplicationDDERequest(Channel $timestring)Worksheets(Sheet1)Range(C18) = ApplicationDDERequest(Channel $applicationversion)Worksheets(Sheet1)Range(C19) = ApplicationDDERequest(Channel $startddeconversations)Worksheets(Sheet1)Range(C20) = ApplicationDDERequest(Channel $accesslevel)Worksheets(Sheet1)Range(C21) = ApplicationDDERequest(Channel $alarmlogging)Worksheets(Sheet1)Range(C22) = ApplicationDDERequest(Channel $applicationchanged)Worksheets(Sheet1)Range(C23) = ApplicationDDERequest(Channel $configureusers)Worksheets(Sheet1)Range(C24) = ApplicationDDERequest(Channel $changepassword)Worksheets(Sheet1)Range(C25) = ApplicationDDERequest(Channel $InactivityTimeout)Worksheets(Sheet1)Range(C26) = ApplicationDDERequest(Channel $InactivityWarning)Worksheets(Sheet1)Range(C27) = ApplicationDDERequest(Channel $LogicRunning)Worksheets(Sheet1)Range(C28) = ApplicationDDERequest(Channel $OperatorEntered)Worksheets(Sheet1)Range(C29) = ApplicationDDERequest(Channel $Operator)Worksheets(Sheet1)Range(C30) = ApplicationDDERequest(Channel $PasswordEntered)ApplicationDDETerminate Channel This terminates the DDE channelEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 110

Visual Basic

ldquoRoll Your Ownrdquo HMI - Much More powerful than Excel

Key Parameters computer nameapplication|topicitem

IO Emulator - MBPlusSimulateexe

Can ldquoRead Fromrdquo amp ldquoWrite Tordquo PLC andor HMI

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 111

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 112

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 113

Dim PauseTime Start Finish TotalTime As Integer Declare variables

Private Sub txtAIT_332A_SCALED_Change()On Error GoTo PokeAIT_332AErrortxtAIT_332A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtAIT_332A_SCALEDText = Int((3 Rnd) + 20) Generate random value between 20 and 23txtAIT_332A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtAIT_332A_SCALEDLinkItem = AIT_332A_SCALEDtxtAIT_332A_SCALEDLinkMode = 2txtAIT_332A_SCALEDLinkPoketxtAIT_332A_SCALEDLinkMode = 0 DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total time

PokeAIT_332AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtAIT_332A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 114

Private Sub txtAIT_346A_SCALED_Change()On Error GoTo PokeAIT_346AErrortxtAIT_346A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtAIT_346A_SCALEDText = Int((3 Rnd) + 15) Generate random value between 15 and 18txtAIT_346A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtAIT_346A_SCALEDLinkItem = AIT_346A_SCALEDtxtAIT_346A_SCALEDLinkMode = 2txtAIT_346A_SCALEDLinkPoketxtAIT_346A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeAIT_346AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtAIT_346A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 115

Private Sub txtFIT_321A_SCALED_Change()On Error GoTo PokeFIT_321AErrortxtFIT_321A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtFIT_321A_SCALEDText = Int((10 Rnd) + 120) Generate random value between 120 and 130txtFIT_321A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_321A_SCALEDLinkItem = FIT_321A_SCALEDtxtFIT_321A_SCALEDLinkMode = 2txtFIT_321A_SCALEDLinkPoketxtFIT_321A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total time

PokeFIT_321AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_321A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume Next

End Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 116

Private Sub txtFIT_341A_SCALED_Change()On Error GoTo PokeFIT_341AErrortxtFIT_341A_SCALEDLinkMode = 0 PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTime

txtFIT_341A_SCALEDText = Int((3 Rnd) + 18) Generate random value between 18 and 21

txtFIT_341A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_341A_SCALEDLinkItem = FIT_341A_SCALEDtxtFIT_341A_SCALEDLinkMode = 2txtFIT_341A_SCALEDLinkPoketxtFIT_341A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeFIT_341AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_341A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 117

Private Sub txtFIT_343A_SCALED_Change()On Error GoTo PokeFIT_343AErrortxtFIT_343A_SCALEDLinkMode = 0 PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTime

txtFIT_343A_SCALEDText = Int((1 Rnd) + 3) Generate random value between 3 and 4

txtFIT_343A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_343A_SCALEDLinkItem = FIT_343A_SCALEDtxtFIT_343A_SCALEDLinkMode = 2txtFIT_343A_SCALEDLinkPoketxtFIT_343A_SCALEDLinkMode = 0 DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeFIT_343AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_343A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 118

TUTORIAL

Part 4

Questions

amp

Answers

  • Slide 1
  • Slide 2
  • Slide 3
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Slide 8
  • Slide 9
  • Slide 10
  • Slide 11
  • Slide 12
  • Slide 13
  • Slide 14
  • Slide 15
  • Slide 16
  • Slide 17
  • Slide 18
  • Slide 19
  • Slide 20
  • Slide 21
  • Slide 22
  • Slide 23
  • Slide 24
  • Slide 25
  • Slide 26
  • Slide 27
  • Slide 28
  • Slide 29
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
  • Slide 34
  • Slide 35
  • Slide 36
  • Slide 37
  • Slide 38
  • Slide 39
  • Slide 40
  • Slide 41
  • Slide 42
  • Slide 43
  • Slide 44
  • Slide 45
  • Slide 46
  • Slide 47
  • Slide 48
  • Slide 49
  • Slide 50
  • Slide 51
  • Slide 52
  • Slide 53
  • Slide 54
  • Slide 55
  • Slide 56
  • Slide 57
  • Slide 58
  • Slide 59
  • Slide 60
  • Slide 61
  • Slide 62
  • Slide 63
  • Slide 64
  • Slide 65
  • Slide 66
  • Slide 67
  • Slide 68
  • Slide 69
  • Slide 70
  • Slide 71
  • Slide 72
  • Slide 73
  • Slide 74
  • Slide 75
  • Slide 76
  • Slide 77
  • Slide 78
  • Slide 79
  • Slide 80
  • Slide 81
  • Slide 82
  • Slide 83
  • Slide 84
  • Slide 85
  • Slide 86
  • Slide 87
  • Slide 88
  • Slide 89
  • Slide 90
  • Slide 91
  • Slide 92
  • Slide 93
  • Slide 94
  • Slide 95
  • Slide 96
  • Slide 97
  • Slide 98
  • Slide 99
  • Slide 100
  • Slide 101
  • Slide 102
  • Slide 103
  • Slide 104
  • Slide 105
  • Slide 106
  • Slide 107
  • Slide 108
  • Slide 109
  • Slide 110
  • Slide 111
  • Slide 112
  • Slide 113
  • Slide 114
  • Slide 115
  • Slide 116
  • Slide 117
  • Slide 118
Page 44: TUTORIAL Ethernet PLC's Improve Oxygen Consumption ISA Expo/2001Houston, Texas Water & Wastewater Industry DivisionTuesday, September 11, 2001 1 Brad.

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 44

The AnoxicOxic 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 Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 46

The following control levels are available for Oxygen1 Cascade from Dissolved Oxygen

2 Ratio from Discharge flow3 Auto-Manual Control

The following control levels are available for the Recycle flow1 Ratio from Discharge flow

2 Auto-Manual Control

The following control levels are available for the PD Blowers3 Timed Mode

2 Dissolved Oxygen Mode3 Manual Mode

Conclusions

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 47

Following the commissioning of the ethernet-based PLCs Oxygen consumption was significantly reduced

The advanced controls allow the operators to leave the process alone and continue to optimally treat the sewage

Conclusions

Following the commissioning of the ethernet-based PLCs AnoxicOxic 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 Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 48

Summary

The PD Blowers ran in Timed Mode andor 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

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 Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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 Authoritys 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 50

TUTORIAL

Part 2A

PLC Programming Basics

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 51

Separate parts of the process have been organized into a separate ldquoSECTIONrdquo

PLC Program Organization

Each ldquoSECTIONrdquo can be any of the IEC programming types

bull Ladder (LD)bull Structured Text (ST)

bull Instruction List (IL)

bull Function Blocks (FB)bull Sequential Function Charts (SFC)

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 52

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 53

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 54

IO Map

On-Line PLC Diagnostics

PLC Status

PLC Simulator

Ethernet (TCPIP) Address

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 55

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 56

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 57

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 58

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 59

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 60

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 61

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 62

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 63

Structured Text was used hereNOT Ladder

Programming for Motors

The PLC DOES NOT CAREStructured Text Functions EXACTLY

the same as LadderUse what yoursquore comfortable with

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 64

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 65

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 66

IEC Function Blocks Used Here

Programming for Analogs amp PID

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 67

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 68

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 69

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 70

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 71

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 72

Sequential Function Charts were used here

Higher-Level Control

bull SFCrsquos lend themselves well to (as the name would imply) sequential processes

bull Three Important components in SFCrsquosbull Transitionsbull Stepsbull Jumps

bull The status of the process can be viewed as a flow chart

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 73

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 74

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 75

PLC - HMI Communication

A ldquoPLC Heartbeatrdquo is traditionally used to monitor the PLC - HMI Communication sometimes called ardquoWatchdog Timerrdquo

Call it whatever you want but the PLC amp 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 ldquodiesrdquo then that switch doesnrsquot change state and an alarm alerts the operator

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 76

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 77

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 78

TUTORIAL

Part 2B

HMI Programming

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 79

Ethernet (TCPIP) IO Driver

The Ethernet (TCPIP) IO Driver allows the HMI to communicate with the PLC (In this case the driver is called MBENETEXE)

The PLC has an ethernet module in one of the slots that has a ldquoCAT5RJ-45rdquo 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 ldquoCAT5RJ-45rdquo receptacle for the ethernet cable

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 80

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 81

Operator Screens amp Popup Displays

The display is laid out in 3 sections

bull Upper - Security amp Alarm Windowbull Middle- Main Operator Screens bull Lower - Menu amp Popup Displays

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 82

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 83

Scripting

There are 6 types of ldquoScriptsrdquobull Application Scriptsbull Key Scriptsbull Condition Scriptsbull Data Change Scriptsbull Quick Function Scriptsbull ActiveX Event Scripts

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 84

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 85

Access Names

The ldquoAccess Namesrdquo Must be configured to allow the PLC - HMI communications

Note that the ldquoApplicationTopicrdquo is the same as the IO Driver

The ldquocomputer namerdquo is the name of the PC that the HMI is running on (brad_s_carlberg in this case)

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 86

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 87

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 88

Indirect Tags

ldquoIndirect Tagsrdquo were used here to minimize the number of popup displays

This is especially useful in HMIrsquos with many tags

ONLY 12 popup displays are reused throughout the HMI

This gives the HMI a ldquoDCS-Likerdquo Look amp Feel

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 89

Popup Display TypesThe tag point type determines which popup display to use

Analog InputHIC (or Analog Output)PID (or Analog Composite)

bull PID WITH AUTO amp CASCADE amp RATIObull PID WITH AUTO amp RATIO

Diginbull Motor Status

DigOutMotor (or Digital Composite)

bull Motor with ILock and PermNumericSet TimersAlarm DetailAlarm Tags

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 90

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 91

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 92

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 93

Bars Buttons amp Sliders

By choosing to use indirect tags we complicate the Bar Graphs Buttons amp Sliders in the popup displays

Different scales need to be used for different engineering unit ranges

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 94

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 95

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 96

Popup Displays

The next two pages shows how the individual popup displays use the indirect tags

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 97

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 98

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 99

Adding a ldquoTouch Targetrdquo to a Display

2 Tell which tags to use

3 Tell which popup display to call upWhat kind of point type is it

3 Steps1 Tell which scale to use (if itrsquos an analog point type)

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 100

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 101

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 102

TUTORIAL

Part 2C

Excel Spreadsheets

amp

Visual Basic

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 103

A ldquoCHEAP amp DIRTYrdquo HMI With Excel

The 4 key parameters are

To communicate with the PLCUse brad_s_carlbergmbenet|ANOXIC_OXICrsquoplcregisterrsquo

Excel uses ldquopeeksrdquo amp ldquopokesrdquo to read from amp write to a PLC or HMI

To communicate with the HMIbrad_s_carlbergview|Tagnamersquotagnamersquo

bull computer namebull applicationbull topicbull item

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 104

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 105

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 106

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 107

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 108

Excel Macros

bull ldquoRequestrdquo Macro to read values

bull ldquoPokerdquo Macro to write values

bull A Sample Excel Macro

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 109

Sub PokeMacro()MsgBox ApplicationNetworkTemplatesPathChannel = ApplicationDDEInitiate(app=brad_s_carlbergVIEW topic=Tagname) This opens a DDE channel to ViewApplicationDDEPoke Channel Temperature1 Worksheets(Sheet1)Range(A1) Puts value from R1C1 into Temperature1ApplicationDDEPoke Channel DDEReal Worksheets(Sheet1)Range(A2) Puts value from R1C1 into Temperature1ApplicationDDEPoke Channel DDEInteger Worksheets(Sheet1)Range(A3) Puts value from R1C1 into Temperature1ApplicationDDETerminate Channel This terminates the DDE channelEnd SubSub RequestMacro()Channel = ApplicationDDEInitiate(app=brad_s_carlbergVIEW topic=Tagname) This opens a DDE channel to ViewWorksheets(Sheet1)Range(C4) = ApplicationDDERequest(Channel $Hour)Worksheets(Sheet1)Range(C5) = ApplicationDDERequest(Channel $Minute)Worksheets(Sheet1)Range(C6) = ApplicationDDERequest(Channel $Second)Worksheets(Sheet1)Range(C9) = ApplicationDDERequest(Channel $day)Worksheets(Sheet1)Range(C10) = ApplicationDDERequest(Channel $date)Worksheets(Sheet1)Range(C11) = ApplicationDDERequest(Channel $datestring)Worksheets(Sheet1)Range(C12) = ApplicationDDERequest(Channel $datetime)Worksheets(Sheet1)Range(C13) = ApplicationDDERequest(Channel $date)Worksheets(Sheet1)Range(C14) = ApplicationDDERequest(Channel $month)Worksheets(Sheet1)Range(C15) = ApplicationDDERequest(Channel $year)Worksheets(Sheet1)Range(C16) = ApplicationDDERequest(Channel $time)Worksheets(Sheet1)Range(C17) = ApplicationDDERequest(Channel $timestring)Worksheets(Sheet1)Range(C18) = ApplicationDDERequest(Channel $applicationversion)Worksheets(Sheet1)Range(C19) = ApplicationDDERequest(Channel $startddeconversations)Worksheets(Sheet1)Range(C20) = ApplicationDDERequest(Channel $accesslevel)Worksheets(Sheet1)Range(C21) = ApplicationDDERequest(Channel $alarmlogging)Worksheets(Sheet1)Range(C22) = ApplicationDDERequest(Channel $applicationchanged)Worksheets(Sheet1)Range(C23) = ApplicationDDERequest(Channel $configureusers)Worksheets(Sheet1)Range(C24) = ApplicationDDERequest(Channel $changepassword)Worksheets(Sheet1)Range(C25) = ApplicationDDERequest(Channel $InactivityTimeout)Worksheets(Sheet1)Range(C26) = ApplicationDDERequest(Channel $InactivityWarning)Worksheets(Sheet1)Range(C27) = ApplicationDDERequest(Channel $LogicRunning)Worksheets(Sheet1)Range(C28) = ApplicationDDERequest(Channel $OperatorEntered)Worksheets(Sheet1)Range(C29) = ApplicationDDERequest(Channel $Operator)Worksheets(Sheet1)Range(C30) = ApplicationDDERequest(Channel $PasswordEntered)ApplicationDDETerminate Channel This terminates the DDE channelEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 110

Visual Basic

ldquoRoll Your Ownrdquo HMI - Much More powerful than Excel

Key Parameters computer nameapplication|topicitem

IO Emulator - MBPlusSimulateexe

Can ldquoRead Fromrdquo amp ldquoWrite Tordquo PLC andor HMI

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 111

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 112

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 113

Dim PauseTime Start Finish TotalTime As Integer Declare variables

Private Sub txtAIT_332A_SCALED_Change()On Error GoTo PokeAIT_332AErrortxtAIT_332A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtAIT_332A_SCALEDText = Int((3 Rnd) + 20) Generate random value between 20 and 23txtAIT_332A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtAIT_332A_SCALEDLinkItem = AIT_332A_SCALEDtxtAIT_332A_SCALEDLinkMode = 2txtAIT_332A_SCALEDLinkPoketxtAIT_332A_SCALEDLinkMode = 0 DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total time

PokeAIT_332AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtAIT_332A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 114

Private Sub txtAIT_346A_SCALED_Change()On Error GoTo PokeAIT_346AErrortxtAIT_346A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtAIT_346A_SCALEDText = Int((3 Rnd) + 15) Generate random value between 15 and 18txtAIT_346A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtAIT_346A_SCALEDLinkItem = AIT_346A_SCALEDtxtAIT_346A_SCALEDLinkMode = 2txtAIT_346A_SCALEDLinkPoketxtAIT_346A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeAIT_346AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtAIT_346A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 115

Private Sub txtFIT_321A_SCALED_Change()On Error GoTo PokeFIT_321AErrortxtFIT_321A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtFIT_321A_SCALEDText = Int((10 Rnd) + 120) Generate random value between 120 and 130txtFIT_321A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_321A_SCALEDLinkItem = FIT_321A_SCALEDtxtFIT_321A_SCALEDLinkMode = 2txtFIT_321A_SCALEDLinkPoketxtFIT_321A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total time

PokeFIT_321AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_321A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume Next

End Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 116

Private Sub txtFIT_341A_SCALED_Change()On Error GoTo PokeFIT_341AErrortxtFIT_341A_SCALEDLinkMode = 0 PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTime

txtFIT_341A_SCALEDText = Int((3 Rnd) + 18) Generate random value between 18 and 21

txtFIT_341A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_341A_SCALEDLinkItem = FIT_341A_SCALEDtxtFIT_341A_SCALEDLinkMode = 2txtFIT_341A_SCALEDLinkPoketxtFIT_341A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeFIT_341AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_341A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 117

Private Sub txtFIT_343A_SCALED_Change()On Error GoTo PokeFIT_343AErrortxtFIT_343A_SCALEDLinkMode = 0 PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTime

txtFIT_343A_SCALEDText = Int((1 Rnd) + 3) Generate random value between 3 and 4

txtFIT_343A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_343A_SCALEDLinkItem = FIT_343A_SCALEDtxtFIT_343A_SCALEDLinkMode = 2txtFIT_343A_SCALEDLinkPoketxtFIT_343A_SCALEDLinkMode = 0 DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeFIT_343AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_343A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 118

TUTORIAL

Part 4

Questions

amp

Answers

  • Slide 1
  • Slide 2
  • Slide 3
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Slide 8
  • Slide 9
  • Slide 10
  • Slide 11
  • Slide 12
  • Slide 13
  • Slide 14
  • Slide 15
  • Slide 16
  • Slide 17
  • Slide 18
  • Slide 19
  • Slide 20
  • Slide 21
  • Slide 22
  • Slide 23
  • Slide 24
  • Slide 25
  • Slide 26
  • Slide 27
  • Slide 28
  • Slide 29
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
  • Slide 34
  • Slide 35
  • Slide 36
  • Slide 37
  • Slide 38
  • Slide 39
  • Slide 40
  • Slide 41
  • Slide 42
  • Slide 43
  • Slide 44
  • Slide 45
  • Slide 46
  • Slide 47
  • Slide 48
  • Slide 49
  • Slide 50
  • Slide 51
  • Slide 52
  • Slide 53
  • Slide 54
  • Slide 55
  • Slide 56
  • Slide 57
  • Slide 58
  • Slide 59
  • Slide 60
  • Slide 61
  • Slide 62
  • Slide 63
  • Slide 64
  • Slide 65
  • Slide 66
  • Slide 67
  • Slide 68
  • Slide 69
  • Slide 70
  • Slide 71
  • Slide 72
  • Slide 73
  • Slide 74
  • Slide 75
  • Slide 76
  • Slide 77
  • Slide 78
  • Slide 79
  • Slide 80
  • Slide 81
  • Slide 82
  • Slide 83
  • Slide 84
  • Slide 85
  • Slide 86
  • Slide 87
  • Slide 88
  • Slide 89
  • Slide 90
  • Slide 91
  • Slide 92
  • Slide 93
  • Slide 94
  • Slide 95
  • Slide 96
  • Slide 97
  • Slide 98
  • Slide 99
  • Slide 100
  • Slide 101
  • Slide 102
  • Slide 103
  • Slide 104
  • Slide 105
  • Slide 106
  • Slide 107
  • Slide 108
  • Slide 109
  • Slide 110
  • Slide 111
  • Slide 112
  • Slide 113
  • Slide 114
  • Slide 115
  • Slide 116
  • Slide 117
  • Slide 118
Page 45: TUTORIAL Ethernet PLC's Improve Oxygen Consumption ISA Expo/2001Houston, Texas Water & Wastewater Industry DivisionTuesday, September 11, 2001 1 Brad.

The AnoxicOxic 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 Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 46

The following control levels are available for Oxygen1 Cascade from Dissolved Oxygen

2 Ratio from Discharge flow3 Auto-Manual Control

The following control levels are available for the Recycle flow1 Ratio from Discharge flow

2 Auto-Manual Control

The following control levels are available for the PD Blowers3 Timed Mode

2 Dissolved Oxygen Mode3 Manual Mode

Conclusions

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 47

Following the commissioning of the ethernet-based PLCs Oxygen consumption was significantly reduced

The advanced controls allow the operators to leave the process alone and continue to optimally treat the sewage

Conclusions

Following the commissioning of the ethernet-based PLCs AnoxicOxic 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 Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 48

Summary

The PD Blowers ran in Timed Mode andor 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

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 Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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 Authoritys 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 50

TUTORIAL

Part 2A

PLC Programming Basics

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 51

Separate parts of the process have been organized into a separate ldquoSECTIONrdquo

PLC Program Organization

Each ldquoSECTIONrdquo can be any of the IEC programming types

bull Ladder (LD)bull Structured Text (ST)

bull Instruction List (IL)

bull Function Blocks (FB)bull Sequential Function Charts (SFC)

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 52

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 53

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 54

IO Map

On-Line PLC Diagnostics

PLC Status

PLC Simulator

Ethernet (TCPIP) Address

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 55

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 56

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 57

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 58

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 59

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 60

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 61

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 62

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 63

Structured Text was used hereNOT Ladder

Programming for Motors

The PLC DOES NOT CAREStructured Text Functions EXACTLY

the same as LadderUse what yoursquore comfortable with

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 64

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 65

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 66

IEC Function Blocks Used Here

Programming for Analogs amp PID

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 67

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 68

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 69

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 70

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 71

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 72

Sequential Function Charts were used here

Higher-Level Control

bull SFCrsquos lend themselves well to (as the name would imply) sequential processes

bull Three Important components in SFCrsquosbull Transitionsbull Stepsbull Jumps

bull The status of the process can be viewed as a flow chart

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 73

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 74

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 75

PLC - HMI Communication

A ldquoPLC Heartbeatrdquo is traditionally used to monitor the PLC - HMI Communication sometimes called ardquoWatchdog Timerrdquo

Call it whatever you want but the PLC amp 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 ldquodiesrdquo then that switch doesnrsquot change state and an alarm alerts the operator

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 76

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 77

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 78

TUTORIAL

Part 2B

HMI Programming

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 79

Ethernet (TCPIP) IO Driver

The Ethernet (TCPIP) IO Driver allows the HMI to communicate with the PLC (In this case the driver is called MBENETEXE)

The PLC has an ethernet module in one of the slots that has a ldquoCAT5RJ-45rdquo 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 ldquoCAT5RJ-45rdquo receptacle for the ethernet cable

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 80

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 81

Operator Screens amp Popup Displays

The display is laid out in 3 sections

bull Upper - Security amp Alarm Windowbull Middle- Main Operator Screens bull Lower - Menu amp Popup Displays

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 82

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 83

Scripting

There are 6 types of ldquoScriptsrdquobull Application Scriptsbull Key Scriptsbull Condition Scriptsbull Data Change Scriptsbull Quick Function Scriptsbull ActiveX Event Scripts

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 84

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 85

Access Names

The ldquoAccess Namesrdquo Must be configured to allow the PLC - HMI communications

Note that the ldquoApplicationTopicrdquo is the same as the IO Driver

The ldquocomputer namerdquo is the name of the PC that the HMI is running on (brad_s_carlberg in this case)

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 86

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 87

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 88

Indirect Tags

ldquoIndirect Tagsrdquo were used here to minimize the number of popup displays

This is especially useful in HMIrsquos with many tags

ONLY 12 popup displays are reused throughout the HMI

This gives the HMI a ldquoDCS-Likerdquo Look amp Feel

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 89

Popup Display TypesThe tag point type determines which popup display to use

Analog InputHIC (or Analog Output)PID (or Analog Composite)

bull PID WITH AUTO amp CASCADE amp RATIObull PID WITH AUTO amp RATIO

Diginbull Motor Status

DigOutMotor (or Digital Composite)

bull Motor with ILock and PermNumericSet TimersAlarm DetailAlarm Tags

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 90

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 91

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 92

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 93

Bars Buttons amp Sliders

By choosing to use indirect tags we complicate the Bar Graphs Buttons amp Sliders in the popup displays

Different scales need to be used for different engineering unit ranges

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 94

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 95

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 96

Popup Displays

The next two pages shows how the individual popup displays use the indirect tags

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 97

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 98

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 99

Adding a ldquoTouch Targetrdquo to a Display

2 Tell which tags to use

3 Tell which popup display to call upWhat kind of point type is it

3 Steps1 Tell which scale to use (if itrsquos an analog point type)

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 100

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 101

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 102

TUTORIAL

Part 2C

Excel Spreadsheets

amp

Visual Basic

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 103

A ldquoCHEAP amp DIRTYrdquo HMI With Excel

The 4 key parameters are

To communicate with the PLCUse brad_s_carlbergmbenet|ANOXIC_OXICrsquoplcregisterrsquo

Excel uses ldquopeeksrdquo amp ldquopokesrdquo to read from amp write to a PLC or HMI

To communicate with the HMIbrad_s_carlbergview|Tagnamersquotagnamersquo

bull computer namebull applicationbull topicbull item

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 104

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 105

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 106

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 107

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 108

Excel Macros

bull ldquoRequestrdquo Macro to read values

bull ldquoPokerdquo Macro to write values

bull A Sample Excel Macro

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 109

Sub PokeMacro()MsgBox ApplicationNetworkTemplatesPathChannel = ApplicationDDEInitiate(app=brad_s_carlbergVIEW topic=Tagname) This opens a DDE channel to ViewApplicationDDEPoke Channel Temperature1 Worksheets(Sheet1)Range(A1) Puts value from R1C1 into Temperature1ApplicationDDEPoke Channel DDEReal Worksheets(Sheet1)Range(A2) Puts value from R1C1 into Temperature1ApplicationDDEPoke Channel DDEInteger Worksheets(Sheet1)Range(A3) Puts value from R1C1 into Temperature1ApplicationDDETerminate Channel This terminates the DDE channelEnd SubSub RequestMacro()Channel = ApplicationDDEInitiate(app=brad_s_carlbergVIEW topic=Tagname) This opens a DDE channel to ViewWorksheets(Sheet1)Range(C4) = ApplicationDDERequest(Channel $Hour)Worksheets(Sheet1)Range(C5) = ApplicationDDERequest(Channel $Minute)Worksheets(Sheet1)Range(C6) = ApplicationDDERequest(Channel $Second)Worksheets(Sheet1)Range(C9) = ApplicationDDERequest(Channel $day)Worksheets(Sheet1)Range(C10) = ApplicationDDERequest(Channel $date)Worksheets(Sheet1)Range(C11) = ApplicationDDERequest(Channel $datestring)Worksheets(Sheet1)Range(C12) = ApplicationDDERequest(Channel $datetime)Worksheets(Sheet1)Range(C13) = ApplicationDDERequest(Channel $date)Worksheets(Sheet1)Range(C14) = ApplicationDDERequest(Channel $month)Worksheets(Sheet1)Range(C15) = ApplicationDDERequest(Channel $year)Worksheets(Sheet1)Range(C16) = ApplicationDDERequest(Channel $time)Worksheets(Sheet1)Range(C17) = ApplicationDDERequest(Channel $timestring)Worksheets(Sheet1)Range(C18) = ApplicationDDERequest(Channel $applicationversion)Worksheets(Sheet1)Range(C19) = ApplicationDDERequest(Channel $startddeconversations)Worksheets(Sheet1)Range(C20) = ApplicationDDERequest(Channel $accesslevel)Worksheets(Sheet1)Range(C21) = ApplicationDDERequest(Channel $alarmlogging)Worksheets(Sheet1)Range(C22) = ApplicationDDERequest(Channel $applicationchanged)Worksheets(Sheet1)Range(C23) = ApplicationDDERequest(Channel $configureusers)Worksheets(Sheet1)Range(C24) = ApplicationDDERequest(Channel $changepassword)Worksheets(Sheet1)Range(C25) = ApplicationDDERequest(Channel $InactivityTimeout)Worksheets(Sheet1)Range(C26) = ApplicationDDERequest(Channel $InactivityWarning)Worksheets(Sheet1)Range(C27) = ApplicationDDERequest(Channel $LogicRunning)Worksheets(Sheet1)Range(C28) = ApplicationDDERequest(Channel $OperatorEntered)Worksheets(Sheet1)Range(C29) = ApplicationDDERequest(Channel $Operator)Worksheets(Sheet1)Range(C30) = ApplicationDDERequest(Channel $PasswordEntered)ApplicationDDETerminate Channel This terminates the DDE channelEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 110

Visual Basic

ldquoRoll Your Ownrdquo HMI - Much More powerful than Excel

Key Parameters computer nameapplication|topicitem

IO Emulator - MBPlusSimulateexe

Can ldquoRead Fromrdquo amp ldquoWrite Tordquo PLC andor HMI

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 111

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 112

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 113

Dim PauseTime Start Finish TotalTime As Integer Declare variables

Private Sub txtAIT_332A_SCALED_Change()On Error GoTo PokeAIT_332AErrortxtAIT_332A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtAIT_332A_SCALEDText = Int((3 Rnd) + 20) Generate random value between 20 and 23txtAIT_332A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtAIT_332A_SCALEDLinkItem = AIT_332A_SCALEDtxtAIT_332A_SCALEDLinkMode = 2txtAIT_332A_SCALEDLinkPoketxtAIT_332A_SCALEDLinkMode = 0 DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total time

PokeAIT_332AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtAIT_332A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 114

Private Sub txtAIT_346A_SCALED_Change()On Error GoTo PokeAIT_346AErrortxtAIT_346A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtAIT_346A_SCALEDText = Int((3 Rnd) + 15) Generate random value between 15 and 18txtAIT_346A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtAIT_346A_SCALEDLinkItem = AIT_346A_SCALEDtxtAIT_346A_SCALEDLinkMode = 2txtAIT_346A_SCALEDLinkPoketxtAIT_346A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeAIT_346AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtAIT_346A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 115

Private Sub txtFIT_321A_SCALED_Change()On Error GoTo PokeFIT_321AErrortxtFIT_321A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtFIT_321A_SCALEDText = Int((10 Rnd) + 120) Generate random value between 120 and 130txtFIT_321A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_321A_SCALEDLinkItem = FIT_321A_SCALEDtxtFIT_321A_SCALEDLinkMode = 2txtFIT_321A_SCALEDLinkPoketxtFIT_321A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total time

PokeFIT_321AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_321A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume Next

End Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 116

Private Sub txtFIT_341A_SCALED_Change()On Error GoTo PokeFIT_341AErrortxtFIT_341A_SCALEDLinkMode = 0 PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTime

txtFIT_341A_SCALEDText = Int((3 Rnd) + 18) Generate random value between 18 and 21

txtFIT_341A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_341A_SCALEDLinkItem = FIT_341A_SCALEDtxtFIT_341A_SCALEDLinkMode = 2txtFIT_341A_SCALEDLinkPoketxtFIT_341A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeFIT_341AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_341A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 117

Private Sub txtFIT_343A_SCALED_Change()On Error GoTo PokeFIT_343AErrortxtFIT_343A_SCALEDLinkMode = 0 PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTime

txtFIT_343A_SCALEDText = Int((1 Rnd) + 3) Generate random value between 3 and 4

txtFIT_343A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_343A_SCALEDLinkItem = FIT_343A_SCALEDtxtFIT_343A_SCALEDLinkMode = 2txtFIT_343A_SCALEDLinkPoketxtFIT_343A_SCALEDLinkMode = 0 DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeFIT_343AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_343A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 118

TUTORIAL

Part 4

Questions

amp

Answers

  • Slide 1
  • Slide 2
  • Slide 3
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Slide 8
  • Slide 9
  • Slide 10
  • Slide 11
  • Slide 12
  • Slide 13
  • Slide 14
  • Slide 15
  • Slide 16
  • Slide 17
  • Slide 18
  • Slide 19
  • Slide 20
  • Slide 21
  • Slide 22
  • Slide 23
  • Slide 24
  • Slide 25
  • Slide 26
  • Slide 27
  • Slide 28
  • Slide 29
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
  • Slide 34
  • Slide 35
  • Slide 36
  • Slide 37
  • Slide 38
  • Slide 39
  • Slide 40
  • Slide 41
  • Slide 42
  • Slide 43
  • Slide 44
  • Slide 45
  • Slide 46
  • Slide 47
  • Slide 48
  • Slide 49
  • Slide 50
  • Slide 51
  • Slide 52
  • Slide 53
  • Slide 54
  • Slide 55
  • Slide 56
  • Slide 57
  • Slide 58
  • Slide 59
  • Slide 60
  • Slide 61
  • Slide 62
  • Slide 63
  • Slide 64
  • Slide 65
  • Slide 66
  • Slide 67
  • Slide 68
  • Slide 69
  • Slide 70
  • Slide 71
  • Slide 72
  • Slide 73
  • Slide 74
  • Slide 75
  • Slide 76
  • Slide 77
  • Slide 78
  • Slide 79
  • Slide 80
  • Slide 81
  • Slide 82
  • Slide 83
  • Slide 84
  • Slide 85
  • Slide 86
  • Slide 87
  • Slide 88
  • Slide 89
  • Slide 90
  • Slide 91
  • Slide 92
  • Slide 93
  • Slide 94
  • Slide 95
  • Slide 96
  • Slide 97
  • Slide 98
  • Slide 99
  • Slide 100
  • Slide 101
  • Slide 102
  • Slide 103
  • Slide 104
  • Slide 105
  • Slide 106
  • Slide 107
  • Slide 108
  • Slide 109
  • Slide 110
  • Slide 111
  • Slide 112
  • Slide 113
  • Slide 114
  • Slide 115
  • Slide 116
  • Slide 117
  • Slide 118
Page 46: TUTORIAL Ethernet PLC's Improve Oxygen Consumption ISA Expo/2001Houston, Texas Water & Wastewater Industry DivisionTuesday, September 11, 2001 1 Brad.

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 46

The following control levels are available for Oxygen1 Cascade from Dissolved Oxygen

2 Ratio from Discharge flow3 Auto-Manual Control

The following control levels are available for the Recycle flow1 Ratio from Discharge flow

2 Auto-Manual Control

The following control levels are available for the PD Blowers3 Timed Mode

2 Dissolved Oxygen Mode3 Manual Mode

Conclusions

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 47

Following the commissioning of the ethernet-based PLCs Oxygen consumption was significantly reduced

The advanced controls allow the operators to leave the process alone and continue to optimally treat the sewage

Conclusions

Following the commissioning of the ethernet-based PLCs AnoxicOxic 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 Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 48

Summary

The PD Blowers ran in Timed Mode andor 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

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 Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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 Authoritys 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 50

TUTORIAL

Part 2A

PLC Programming Basics

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 51

Separate parts of the process have been organized into a separate ldquoSECTIONrdquo

PLC Program Organization

Each ldquoSECTIONrdquo can be any of the IEC programming types

bull Ladder (LD)bull Structured Text (ST)

bull Instruction List (IL)

bull Function Blocks (FB)bull Sequential Function Charts (SFC)

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 52

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 53

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 54

IO Map

On-Line PLC Diagnostics

PLC Status

PLC Simulator

Ethernet (TCPIP) Address

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 55

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 56

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 57

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 58

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 59

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 60

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 61

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 62

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 63

Structured Text was used hereNOT Ladder

Programming for Motors

The PLC DOES NOT CAREStructured Text Functions EXACTLY

the same as LadderUse what yoursquore comfortable with

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 64

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 65

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 66

IEC Function Blocks Used Here

Programming for Analogs amp PID

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 67

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 68

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 69

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 70

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 71

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 72

Sequential Function Charts were used here

Higher-Level Control

bull SFCrsquos lend themselves well to (as the name would imply) sequential processes

bull Three Important components in SFCrsquosbull Transitionsbull Stepsbull Jumps

bull The status of the process can be viewed as a flow chart

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 73

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 74

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 75

PLC - HMI Communication

A ldquoPLC Heartbeatrdquo is traditionally used to monitor the PLC - HMI Communication sometimes called ardquoWatchdog Timerrdquo

Call it whatever you want but the PLC amp 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 ldquodiesrdquo then that switch doesnrsquot change state and an alarm alerts the operator

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 76

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 77

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 78

TUTORIAL

Part 2B

HMI Programming

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 79

Ethernet (TCPIP) IO Driver

The Ethernet (TCPIP) IO Driver allows the HMI to communicate with the PLC (In this case the driver is called MBENETEXE)

The PLC has an ethernet module in one of the slots that has a ldquoCAT5RJ-45rdquo 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 ldquoCAT5RJ-45rdquo receptacle for the ethernet cable

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 80

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 81

Operator Screens amp Popup Displays

The display is laid out in 3 sections

bull Upper - Security amp Alarm Windowbull Middle- Main Operator Screens bull Lower - Menu amp Popup Displays

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 82

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 83

Scripting

There are 6 types of ldquoScriptsrdquobull Application Scriptsbull Key Scriptsbull Condition Scriptsbull Data Change Scriptsbull Quick Function Scriptsbull ActiveX Event Scripts

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 84

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 85

Access Names

The ldquoAccess Namesrdquo Must be configured to allow the PLC - HMI communications

Note that the ldquoApplicationTopicrdquo is the same as the IO Driver

The ldquocomputer namerdquo is the name of the PC that the HMI is running on (brad_s_carlberg in this case)

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 86

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 87

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 88

Indirect Tags

ldquoIndirect Tagsrdquo were used here to minimize the number of popup displays

This is especially useful in HMIrsquos with many tags

ONLY 12 popup displays are reused throughout the HMI

This gives the HMI a ldquoDCS-Likerdquo Look amp Feel

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 89

Popup Display TypesThe tag point type determines which popup display to use

Analog InputHIC (or Analog Output)PID (or Analog Composite)

bull PID WITH AUTO amp CASCADE amp RATIObull PID WITH AUTO amp RATIO

Diginbull Motor Status

DigOutMotor (or Digital Composite)

bull Motor with ILock and PermNumericSet TimersAlarm DetailAlarm Tags

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 90

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 91

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 92

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 93

Bars Buttons amp Sliders

By choosing to use indirect tags we complicate the Bar Graphs Buttons amp Sliders in the popup displays

Different scales need to be used for different engineering unit ranges

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 94

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 95

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 96

Popup Displays

The next two pages shows how the individual popup displays use the indirect tags

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 97

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 98

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 99

Adding a ldquoTouch Targetrdquo to a Display

2 Tell which tags to use

3 Tell which popup display to call upWhat kind of point type is it

3 Steps1 Tell which scale to use (if itrsquos an analog point type)

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 100

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 101

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 102

TUTORIAL

Part 2C

Excel Spreadsheets

amp

Visual Basic

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 103

A ldquoCHEAP amp DIRTYrdquo HMI With Excel

The 4 key parameters are

To communicate with the PLCUse brad_s_carlbergmbenet|ANOXIC_OXICrsquoplcregisterrsquo

Excel uses ldquopeeksrdquo amp ldquopokesrdquo to read from amp write to a PLC or HMI

To communicate with the HMIbrad_s_carlbergview|Tagnamersquotagnamersquo

bull computer namebull applicationbull topicbull item

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 104

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 105

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 106

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 107

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 108

Excel Macros

bull ldquoRequestrdquo Macro to read values

bull ldquoPokerdquo Macro to write values

bull A Sample Excel Macro

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 109

Sub PokeMacro()MsgBox ApplicationNetworkTemplatesPathChannel = ApplicationDDEInitiate(app=brad_s_carlbergVIEW topic=Tagname) This opens a DDE channel to ViewApplicationDDEPoke Channel Temperature1 Worksheets(Sheet1)Range(A1) Puts value from R1C1 into Temperature1ApplicationDDEPoke Channel DDEReal Worksheets(Sheet1)Range(A2) Puts value from R1C1 into Temperature1ApplicationDDEPoke Channel DDEInteger Worksheets(Sheet1)Range(A3) Puts value from R1C1 into Temperature1ApplicationDDETerminate Channel This terminates the DDE channelEnd SubSub RequestMacro()Channel = ApplicationDDEInitiate(app=brad_s_carlbergVIEW topic=Tagname) This opens a DDE channel to ViewWorksheets(Sheet1)Range(C4) = ApplicationDDERequest(Channel $Hour)Worksheets(Sheet1)Range(C5) = ApplicationDDERequest(Channel $Minute)Worksheets(Sheet1)Range(C6) = ApplicationDDERequest(Channel $Second)Worksheets(Sheet1)Range(C9) = ApplicationDDERequest(Channel $day)Worksheets(Sheet1)Range(C10) = ApplicationDDERequest(Channel $date)Worksheets(Sheet1)Range(C11) = ApplicationDDERequest(Channel $datestring)Worksheets(Sheet1)Range(C12) = ApplicationDDERequest(Channel $datetime)Worksheets(Sheet1)Range(C13) = ApplicationDDERequest(Channel $date)Worksheets(Sheet1)Range(C14) = ApplicationDDERequest(Channel $month)Worksheets(Sheet1)Range(C15) = ApplicationDDERequest(Channel $year)Worksheets(Sheet1)Range(C16) = ApplicationDDERequest(Channel $time)Worksheets(Sheet1)Range(C17) = ApplicationDDERequest(Channel $timestring)Worksheets(Sheet1)Range(C18) = ApplicationDDERequest(Channel $applicationversion)Worksheets(Sheet1)Range(C19) = ApplicationDDERequest(Channel $startddeconversations)Worksheets(Sheet1)Range(C20) = ApplicationDDERequest(Channel $accesslevel)Worksheets(Sheet1)Range(C21) = ApplicationDDERequest(Channel $alarmlogging)Worksheets(Sheet1)Range(C22) = ApplicationDDERequest(Channel $applicationchanged)Worksheets(Sheet1)Range(C23) = ApplicationDDERequest(Channel $configureusers)Worksheets(Sheet1)Range(C24) = ApplicationDDERequest(Channel $changepassword)Worksheets(Sheet1)Range(C25) = ApplicationDDERequest(Channel $InactivityTimeout)Worksheets(Sheet1)Range(C26) = ApplicationDDERequest(Channel $InactivityWarning)Worksheets(Sheet1)Range(C27) = ApplicationDDERequest(Channel $LogicRunning)Worksheets(Sheet1)Range(C28) = ApplicationDDERequest(Channel $OperatorEntered)Worksheets(Sheet1)Range(C29) = ApplicationDDERequest(Channel $Operator)Worksheets(Sheet1)Range(C30) = ApplicationDDERequest(Channel $PasswordEntered)ApplicationDDETerminate Channel This terminates the DDE channelEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 110

Visual Basic

ldquoRoll Your Ownrdquo HMI - Much More powerful than Excel

Key Parameters computer nameapplication|topicitem

IO Emulator - MBPlusSimulateexe

Can ldquoRead Fromrdquo amp ldquoWrite Tordquo PLC andor HMI

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 111

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 112

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 113

Dim PauseTime Start Finish TotalTime As Integer Declare variables

Private Sub txtAIT_332A_SCALED_Change()On Error GoTo PokeAIT_332AErrortxtAIT_332A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtAIT_332A_SCALEDText = Int((3 Rnd) + 20) Generate random value between 20 and 23txtAIT_332A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtAIT_332A_SCALEDLinkItem = AIT_332A_SCALEDtxtAIT_332A_SCALEDLinkMode = 2txtAIT_332A_SCALEDLinkPoketxtAIT_332A_SCALEDLinkMode = 0 DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total time

PokeAIT_332AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtAIT_332A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 114

Private Sub txtAIT_346A_SCALED_Change()On Error GoTo PokeAIT_346AErrortxtAIT_346A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtAIT_346A_SCALEDText = Int((3 Rnd) + 15) Generate random value between 15 and 18txtAIT_346A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtAIT_346A_SCALEDLinkItem = AIT_346A_SCALEDtxtAIT_346A_SCALEDLinkMode = 2txtAIT_346A_SCALEDLinkPoketxtAIT_346A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeAIT_346AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtAIT_346A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 115

Private Sub txtFIT_321A_SCALED_Change()On Error GoTo PokeFIT_321AErrortxtFIT_321A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtFIT_321A_SCALEDText = Int((10 Rnd) + 120) Generate random value between 120 and 130txtFIT_321A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_321A_SCALEDLinkItem = FIT_321A_SCALEDtxtFIT_321A_SCALEDLinkMode = 2txtFIT_321A_SCALEDLinkPoketxtFIT_321A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total time

PokeFIT_321AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_321A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume Next

End Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 116

Private Sub txtFIT_341A_SCALED_Change()On Error GoTo PokeFIT_341AErrortxtFIT_341A_SCALEDLinkMode = 0 PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTime

txtFIT_341A_SCALEDText = Int((3 Rnd) + 18) Generate random value between 18 and 21

txtFIT_341A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_341A_SCALEDLinkItem = FIT_341A_SCALEDtxtFIT_341A_SCALEDLinkMode = 2txtFIT_341A_SCALEDLinkPoketxtFIT_341A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeFIT_341AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_341A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 117

Private Sub txtFIT_343A_SCALED_Change()On Error GoTo PokeFIT_343AErrortxtFIT_343A_SCALEDLinkMode = 0 PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTime

txtFIT_343A_SCALEDText = Int((1 Rnd) + 3) Generate random value between 3 and 4

txtFIT_343A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_343A_SCALEDLinkItem = FIT_343A_SCALEDtxtFIT_343A_SCALEDLinkMode = 2txtFIT_343A_SCALEDLinkPoketxtFIT_343A_SCALEDLinkMode = 0 DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeFIT_343AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_343A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 118

TUTORIAL

Part 4

Questions

amp

Answers

  • Slide 1
  • Slide 2
  • Slide 3
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Slide 8
  • Slide 9
  • Slide 10
  • Slide 11
  • Slide 12
  • Slide 13
  • Slide 14
  • Slide 15
  • Slide 16
  • Slide 17
  • Slide 18
  • Slide 19
  • Slide 20
  • Slide 21
  • Slide 22
  • Slide 23
  • Slide 24
  • Slide 25
  • Slide 26
  • Slide 27
  • Slide 28
  • Slide 29
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
  • Slide 34
  • Slide 35
  • Slide 36
  • Slide 37
  • Slide 38
  • Slide 39
  • Slide 40
  • Slide 41
  • Slide 42
  • Slide 43
  • Slide 44
  • Slide 45
  • Slide 46
  • Slide 47
  • Slide 48
  • Slide 49
  • Slide 50
  • Slide 51
  • Slide 52
  • Slide 53
  • Slide 54
  • Slide 55
  • Slide 56
  • Slide 57
  • Slide 58
  • Slide 59
  • Slide 60
  • Slide 61
  • Slide 62
  • Slide 63
  • Slide 64
  • Slide 65
  • Slide 66
  • Slide 67
  • Slide 68
  • Slide 69
  • Slide 70
  • Slide 71
  • Slide 72
  • Slide 73
  • Slide 74
  • Slide 75
  • Slide 76
  • Slide 77
  • Slide 78
  • Slide 79
  • Slide 80
  • Slide 81
  • Slide 82
  • Slide 83
  • Slide 84
  • Slide 85
  • Slide 86
  • Slide 87
  • Slide 88
  • Slide 89
  • Slide 90
  • Slide 91
  • Slide 92
  • Slide 93
  • Slide 94
  • Slide 95
  • Slide 96
  • Slide 97
  • Slide 98
  • Slide 99
  • Slide 100
  • Slide 101
  • Slide 102
  • Slide 103
  • Slide 104
  • Slide 105
  • Slide 106
  • Slide 107
  • Slide 108
  • Slide 109
  • Slide 110
  • Slide 111
  • Slide 112
  • Slide 113
  • Slide 114
  • Slide 115
  • Slide 116
  • Slide 117
  • Slide 118
Page 47: TUTORIAL Ethernet PLC's Improve Oxygen Consumption ISA Expo/2001Houston, Texas Water & Wastewater Industry DivisionTuesday, September 11, 2001 1 Brad.

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 47

Following the commissioning of the ethernet-based PLCs Oxygen consumption was significantly reduced

The advanced controls allow the operators to leave the process alone and continue to optimally treat the sewage

Conclusions

Following the commissioning of the ethernet-based PLCs AnoxicOxic 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 Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 48

Summary

The PD Blowers ran in Timed Mode andor 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

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 Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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 Authoritys 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 50

TUTORIAL

Part 2A

PLC Programming Basics

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 51

Separate parts of the process have been organized into a separate ldquoSECTIONrdquo

PLC Program Organization

Each ldquoSECTIONrdquo can be any of the IEC programming types

bull Ladder (LD)bull Structured Text (ST)

bull Instruction List (IL)

bull Function Blocks (FB)bull Sequential Function Charts (SFC)

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 52

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 53

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 54

IO Map

On-Line PLC Diagnostics

PLC Status

PLC Simulator

Ethernet (TCPIP) Address

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 55

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 56

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 57

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 58

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 59

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 60

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 61

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 62

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 63

Structured Text was used hereNOT Ladder

Programming for Motors

The PLC DOES NOT CAREStructured Text Functions EXACTLY

the same as LadderUse what yoursquore comfortable with

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 64

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 65

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 66

IEC Function Blocks Used Here

Programming for Analogs amp PID

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 67

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 68

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 69

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 70

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 71

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 72

Sequential Function Charts were used here

Higher-Level Control

bull SFCrsquos lend themselves well to (as the name would imply) sequential processes

bull Three Important components in SFCrsquosbull Transitionsbull Stepsbull Jumps

bull The status of the process can be viewed as a flow chart

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 73

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 74

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 75

PLC - HMI Communication

A ldquoPLC Heartbeatrdquo is traditionally used to monitor the PLC - HMI Communication sometimes called ardquoWatchdog Timerrdquo

Call it whatever you want but the PLC amp 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 ldquodiesrdquo then that switch doesnrsquot change state and an alarm alerts the operator

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 76

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 77

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 78

TUTORIAL

Part 2B

HMI Programming

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 79

Ethernet (TCPIP) IO Driver

The Ethernet (TCPIP) IO Driver allows the HMI to communicate with the PLC (In this case the driver is called MBENETEXE)

The PLC has an ethernet module in one of the slots that has a ldquoCAT5RJ-45rdquo 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 ldquoCAT5RJ-45rdquo receptacle for the ethernet cable

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 80

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 81

Operator Screens amp Popup Displays

The display is laid out in 3 sections

bull Upper - Security amp Alarm Windowbull Middle- Main Operator Screens bull Lower - Menu amp Popup Displays

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 82

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 83

Scripting

There are 6 types of ldquoScriptsrdquobull Application Scriptsbull Key Scriptsbull Condition Scriptsbull Data Change Scriptsbull Quick Function Scriptsbull ActiveX Event Scripts

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 84

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 85

Access Names

The ldquoAccess Namesrdquo Must be configured to allow the PLC - HMI communications

Note that the ldquoApplicationTopicrdquo is the same as the IO Driver

The ldquocomputer namerdquo is the name of the PC that the HMI is running on (brad_s_carlberg in this case)

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 86

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 87

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 88

Indirect Tags

ldquoIndirect Tagsrdquo were used here to minimize the number of popup displays

This is especially useful in HMIrsquos with many tags

ONLY 12 popup displays are reused throughout the HMI

This gives the HMI a ldquoDCS-Likerdquo Look amp Feel

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 89

Popup Display TypesThe tag point type determines which popup display to use

Analog InputHIC (or Analog Output)PID (or Analog Composite)

bull PID WITH AUTO amp CASCADE amp RATIObull PID WITH AUTO amp RATIO

Diginbull Motor Status

DigOutMotor (or Digital Composite)

bull Motor with ILock and PermNumericSet TimersAlarm DetailAlarm Tags

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 90

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 91

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 92

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 93

Bars Buttons amp Sliders

By choosing to use indirect tags we complicate the Bar Graphs Buttons amp Sliders in the popup displays

Different scales need to be used for different engineering unit ranges

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 94

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 95

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 96

Popup Displays

The next two pages shows how the individual popup displays use the indirect tags

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 97

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 98

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 99

Adding a ldquoTouch Targetrdquo to a Display

2 Tell which tags to use

3 Tell which popup display to call upWhat kind of point type is it

3 Steps1 Tell which scale to use (if itrsquos an analog point type)

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 100

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 101

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 102

TUTORIAL

Part 2C

Excel Spreadsheets

amp

Visual Basic

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 103

A ldquoCHEAP amp DIRTYrdquo HMI With Excel

The 4 key parameters are

To communicate with the PLCUse brad_s_carlbergmbenet|ANOXIC_OXICrsquoplcregisterrsquo

Excel uses ldquopeeksrdquo amp ldquopokesrdquo to read from amp write to a PLC or HMI

To communicate with the HMIbrad_s_carlbergview|Tagnamersquotagnamersquo

bull computer namebull applicationbull topicbull item

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 104

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 105

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 106

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 107

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 108

Excel Macros

bull ldquoRequestrdquo Macro to read values

bull ldquoPokerdquo Macro to write values

bull A Sample Excel Macro

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 109

Sub PokeMacro()MsgBox ApplicationNetworkTemplatesPathChannel = ApplicationDDEInitiate(app=brad_s_carlbergVIEW topic=Tagname) This opens a DDE channel to ViewApplicationDDEPoke Channel Temperature1 Worksheets(Sheet1)Range(A1) Puts value from R1C1 into Temperature1ApplicationDDEPoke Channel DDEReal Worksheets(Sheet1)Range(A2) Puts value from R1C1 into Temperature1ApplicationDDEPoke Channel DDEInteger Worksheets(Sheet1)Range(A3) Puts value from R1C1 into Temperature1ApplicationDDETerminate Channel This terminates the DDE channelEnd SubSub RequestMacro()Channel = ApplicationDDEInitiate(app=brad_s_carlbergVIEW topic=Tagname) This opens a DDE channel to ViewWorksheets(Sheet1)Range(C4) = ApplicationDDERequest(Channel $Hour)Worksheets(Sheet1)Range(C5) = ApplicationDDERequest(Channel $Minute)Worksheets(Sheet1)Range(C6) = ApplicationDDERequest(Channel $Second)Worksheets(Sheet1)Range(C9) = ApplicationDDERequest(Channel $day)Worksheets(Sheet1)Range(C10) = ApplicationDDERequest(Channel $date)Worksheets(Sheet1)Range(C11) = ApplicationDDERequest(Channel $datestring)Worksheets(Sheet1)Range(C12) = ApplicationDDERequest(Channel $datetime)Worksheets(Sheet1)Range(C13) = ApplicationDDERequest(Channel $date)Worksheets(Sheet1)Range(C14) = ApplicationDDERequest(Channel $month)Worksheets(Sheet1)Range(C15) = ApplicationDDERequest(Channel $year)Worksheets(Sheet1)Range(C16) = ApplicationDDERequest(Channel $time)Worksheets(Sheet1)Range(C17) = ApplicationDDERequest(Channel $timestring)Worksheets(Sheet1)Range(C18) = ApplicationDDERequest(Channel $applicationversion)Worksheets(Sheet1)Range(C19) = ApplicationDDERequest(Channel $startddeconversations)Worksheets(Sheet1)Range(C20) = ApplicationDDERequest(Channel $accesslevel)Worksheets(Sheet1)Range(C21) = ApplicationDDERequest(Channel $alarmlogging)Worksheets(Sheet1)Range(C22) = ApplicationDDERequest(Channel $applicationchanged)Worksheets(Sheet1)Range(C23) = ApplicationDDERequest(Channel $configureusers)Worksheets(Sheet1)Range(C24) = ApplicationDDERequest(Channel $changepassword)Worksheets(Sheet1)Range(C25) = ApplicationDDERequest(Channel $InactivityTimeout)Worksheets(Sheet1)Range(C26) = ApplicationDDERequest(Channel $InactivityWarning)Worksheets(Sheet1)Range(C27) = ApplicationDDERequest(Channel $LogicRunning)Worksheets(Sheet1)Range(C28) = ApplicationDDERequest(Channel $OperatorEntered)Worksheets(Sheet1)Range(C29) = ApplicationDDERequest(Channel $Operator)Worksheets(Sheet1)Range(C30) = ApplicationDDERequest(Channel $PasswordEntered)ApplicationDDETerminate Channel This terminates the DDE channelEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 110

Visual Basic

ldquoRoll Your Ownrdquo HMI - Much More powerful than Excel

Key Parameters computer nameapplication|topicitem

IO Emulator - MBPlusSimulateexe

Can ldquoRead Fromrdquo amp ldquoWrite Tordquo PLC andor HMI

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 111

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 112

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 113

Dim PauseTime Start Finish TotalTime As Integer Declare variables

Private Sub txtAIT_332A_SCALED_Change()On Error GoTo PokeAIT_332AErrortxtAIT_332A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtAIT_332A_SCALEDText = Int((3 Rnd) + 20) Generate random value between 20 and 23txtAIT_332A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtAIT_332A_SCALEDLinkItem = AIT_332A_SCALEDtxtAIT_332A_SCALEDLinkMode = 2txtAIT_332A_SCALEDLinkPoketxtAIT_332A_SCALEDLinkMode = 0 DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total time

PokeAIT_332AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtAIT_332A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 114

Private Sub txtAIT_346A_SCALED_Change()On Error GoTo PokeAIT_346AErrortxtAIT_346A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtAIT_346A_SCALEDText = Int((3 Rnd) + 15) Generate random value between 15 and 18txtAIT_346A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtAIT_346A_SCALEDLinkItem = AIT_346A_SCALEDtxtAIT_346A_SCALEDLinkMode = 2txtAIT_346A_SCALEDLinkPoketxtAIT_346A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeAIT_346AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtAIT_346A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 115

Private Sub txtFIT_321A_SCALED_Change()On Error GoTo PokeFIT_321AErrortxtFIT_321A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtFIT_321A_SCALEDText = Int((10 Rnd) + 120) Generate random value between 120 and 130txtFIT_321A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_321A_SCALEDLinkItem = FIT_321A_SCALEDtxtFIT_321A_SCALEDLinkMode = 2txtFIT_321A_SCALEDLinkPoketxtFIT_321A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total time

PokeFIT_321AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_321A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume Next

End Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 116

Private Sub txtFIT_341A_SCALED_Change()On Error GoTo PokeFIT_341AErrortxtFIT_341A_SCALEDLinkMode = 0 PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTime

txtFIT_341A_SCALEDText = Int((3 Rnd) + 18) Generate random value between 18 and 21

txtFIT_341A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_341A_SCALEDLinkItem = FIT_341A_SCALEDtxtFIT_341A_SCALEDLinkMode = 2txtFIT_341A_SCALEDLinkPoketxtFIT_341A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeFIT_341AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_341A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 117

Private Sub txtFIT_343A_SCALED_Change()On Error GoTo PokeFIT_343AErrortxtFIT_343A_SCALEDLinkMode = 0 PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTime

txtFIT_343A_SCALEDText = Int((1 Rnd) + 3) Generate random value between 3 and 4

txtFIT_343A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_343A_SCALEDLinkItem = FIT_343A_SCALEDtxtFIT_343A_SCALEDLinkMode = 2txtFIT_343A_SCALEDLinkPoketxtFIT_343A_SCALEDLinkMode = 0 DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeFIT_343AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_343A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 118

TUTORIAL

Part 4

Questions

amp

Answers

  • Slide 1
  • Slide 2
  • Slide 3
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Slide 8
  • Slide 9
  • Slide 10
  • Slide 11
  • Slide 12
  • Slide 13
  • Slide 14
  • Slide 15
  • Slide 16
  • Slide 17
  • Slide 18
  • Slide 19
  • Slide 20
  • Slide 21
  • Slide 22
  • Slide 23
  • Slide 24
  • Slide 25
  • Slide 26
  • Slide 27
  • Slide 28
  • Slide 29
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
  • Slide 34
  • Slide 35
  • Slide 36
  • Slide 37
  • Slide 38
  • Slide 39
  • Slide 40
  • Slide 41
  • Slide 42
  • Slide 43
  • Slide 44
  • Slide 45
  • Slide 46
  • Slide 47
  • Slide 48
  • Slide 49
  • Slide 50
  • Slide 51
  • Slide 52
  • Slide 53
  • Slide 54
  • Slide 55
  • Slide 56
  • Slide 57
  • Slide 58
  • Slide 59
  • Slide 60
  • Slide 61
  • Slide 62
  • Slide 63
  • Slide 64
  • Slide 65
  • Slide 66
  • Slide 67
  • Slide 68
  • Slide 69
  • Slide 70
  • Slide 71
  • Slide 72
  • Slide 73
  • Slide 74
  • Slide 75
  • Slide 76
  • Slide 77
  • Slide 78
  • Slide 79
  • Slide 80
  • Slide 81
  • Slide 82
  • Slide 83
  • Slide 84
  • Slide 85
  • Slide 86
  • Slide 87
  • Slide 88
  • Slide 89
  • Slide 90
  • Slide 91
  • Slide 92
  • Slide 93
  • Slide 94
  • Slide 95
  • Slide 96
  • Slide 97
  • Slide 98
  • Slide 99
  • Slide 100
  • Slide 101
  • Slide 102
  • Slide 103
  • Slide 104
  • Slide 105
  • Slide 106
  • Slide 107
  • Slide 108
  • Slide 109
  • Slide 110
  • Slide 111
  • Slide 112
  • Slide 113
  • Slide 114
  • Slide 115
  • Slide 116
  • Slide 117
  • Slide 118
Page 48: TUTORIAL Ethernet PLC's Improve Oxygen Consumption ISA Expo/2001Houston, Texas Water & Wastewater Industry DivisionTuesday, September 11, 2001 1 Brad.

Following the commissioning of the ethernet-based PLCs AnoxicOxic 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 Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 48

Summary

The PD Blowers ran in Timed Mode andor 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

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 Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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 Authoritys 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 50

TUTORIAL

Part 2A

PLC Programming Basics

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 51

Separate parts of the process have been organized into a separate ldquoSECTIONrdquo

PLC Program Organization

Each ldquoSECTIONrdquo can be any of the IEC programming types

bull Ladder (LD)bull Structured Text (ST)

bull Instruction List (IL)

bull Function Blocks (FB)bull Sequential Function Charts (SFC)

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 52

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 53

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 54

IO Map

On-Line PLC Diagnostics

PLC Status

PLC Simulator

Ethernet (TCPIP) Address

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 55

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 56

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 57

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 58

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 59

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 60

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 61

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 62

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 63

Structured Text was used hereNOT Ladder

Programming for Motors

The PLC DOES NOT CAREStructured Text Functions EXACTLY

the same as LadderUse what yoursquore comfortable with

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 64

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 65

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 66

IEC Function Blocks Used Here

Programming for Analogs amp PID

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 67

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 68

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 69

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 70

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 71

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 72

Sequential Function Charts were used here

Higher-Level Control

bull SFCrsquos lend themselves well to (as the name would imply) sequential processes

bull Three Important components in SFCrsquosbull Transitionsbull Stepsbull Jumps

bull The status of the process can be viewed as a flow chart

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 73

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 74

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 75

PLC - HMI Communication

A ldquoPLC Heartbeatrdquo is traditionally used to monitor the PLC - HMI Communication sometimes called ardquoWatchdog Timerrdquo

Call it whatever you want but the PLC amp 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 ldquodiesrdquo then that switch doesnrsquot change state and an alarm alerts the operator

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 76

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 77

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 78

TUTORIAL

Part 2B

HMI Programming

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 79

Ethernet (TCPIP) IO Driver

The Ethernet (TCPIP) IO Driver allows the HMI to communicate with the PLC (In this case the driver is called MBENETEXE)

The PLC has an ethernet module in one of the slots that has a ldquoCAT5RJ-45rdquo 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 ldquoCAT5RJ-45rdquo receptacle for the ethernet cable

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 80

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 81

Operator Screens amp Popup Displays

The display is laid out in 3 sections

bull Upper - Security amp Alarm Windowbull Middle- Main Operator Screens bull Lower - Menu amp Popup Displays

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 82

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 83

Scripting

There are 6 types of ldquoScriptsrdquobull Application Scriptsbull Key Scriptsbull Condition Scriptsbull Data Change Scriptsbull Quick Function Scriptsbull ActiveX Event Scripts

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 84

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 85

Access Names

The ldquoAccess Namesrdquo Must be configured to allow the PLC - HMI communications

Note that the ldquoApplicationTopicrdquo is the same as the IO Driver

The ldquocomputer namerdquo is the name of the PC that the HMI is running on (brad_s_carlberg in this case)

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 86

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 87

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 88

Indirect Tags

ldquoIndirect Tagsrdquo were used here to minimize the number of popup displays

This is especially useful in HMIrsquos with many tags

ONLY 12 popup displays are reused throughout the HMI

This gives the HMI a ldquoDCS-Likerdquo Look amp Feel

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 89

Popup Display TypesThe tag point type determines which popup display to use

Analog InputHIC (or Analog Output)PID (or Analog Composite)

bull PID WITH AUTO amp CASCADE amp RATIObull PID WITH AUTO amp RATIO

Diginbull Motor Status

DigOutMotor (or Digital Composite)

bull Motor with ILock and PermNumericSet TimersAlarm DetailAlarm Tags

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 90

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 91

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 92

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 93

Bars Buttons amp Sliders

By choosing to use indirect tags we complicate the Bar Graphs Buttons amp Sliders in the popup displays

Different scales need to be used for different engineering unit ranges

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 94

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 95

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 96

Popup Displays

The next two pages shows how the individual popup displays use the indirect tags

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 97

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 98

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 99

Adding a ldquoTouch Targetrdquo to a Display

2 Tell which tags to use

3 Tell which popup display to call upWhat kind of point type is it

3 Steps1 Tell which scale to use (if itrsquos an analog point type)

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 100

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 101

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 102

TUTORIAL

Part 2C

Excel Spreadsheets

amp

Visual Basic

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 103

A ldquoCHEAP amp DIRTYrdquo HMI With Excel

The 4 key parameters are

To communicate with the PLCUse brad_s_carlbergmbenet|ANOXIC_OXICrsquoplcregisterrsquo

Excel uses ldquopeeksrdquo amp ldquopokesrdquo to read from amp write to a PLC or HMI

To communicate with the HMIbrad_s_carlbergview|Tagnamersquotagnamersquo

bull computer namebull applicationbull topicbull item

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 104

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 105

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 106

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 107

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 108

Excel Macros

bull ldquoRequestrdquo Macro to read values

bull ldquoPokerdquo Macro to write values

bull A Sample Excel Macro

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 109

Sub PokeMacro()MsgBox ApplicationNetworkTemplatesPathChannel = ApplicationDDEInitiate(app=brad_s_carlbergVIEW topic=Tagname) This opens a DDE channel to ViewApplicationDDEPoke Channel Temperature1 Worksheets(Sheet1)Range(A1) Puts value from R1C1 into Temperature1ApplicationDDEPoke Channel DDEReal Worksheets(Sheet1)Range(A2) Puts value from R1C1 into Temperature1ApplicationDDEPoke Channel DDEInteger Worksheets(Sheet1)Range(A3) Puts value from R1C1 into Temperature1ApplicationDDETerminate Channel This terminates the DDE channelEnd SubSub RequestMacro()Channel = ApplicationDDEInitiate(app=brad_s_carlbergVIEW topic=Tagname) This opens a DDE channel to ViewWorksheets(Sheet1)Range(C4) = ApplicationDDERequest(Channel $Hour)Worksheets(Sheet1)Range(C5) = ApplicationDDERequest(Channel $Minute)Worksheets(Sheet1)Range(C6) = ApplicationDDERequest(Channel $Second)Worksheets(Sheet1)Range(C9) = ApplicationDDERequest(Channel $day)Worksheets(Sheet1)Range(C10) = ApplicationDDERequest(Channel $date)Worksheets(Sheet1)Range(C11) = ApplicationDDERequest(Channel $datestring)Worksheets(Sheet1)Range(C12) = ApplicationDDERequest(Channel $datetime)Worksheets(Sheet1)Range(C13) = ApplicationDDERequest(Channel $date)Worksheets(Sheet1)Range(C14) = ApplicationDDERequest(Channel $month)Worksheets(Sheet1)Range(C15) = ApplicationDDERequest(Channel $year)Worksheets(Sheet1)Range(C16) = ApplicationDDERequest(Channel $time)Worksheets(Sheet1)Range(C17) = ApplicationDDERequest(Channel $timestring)Worksheets(Sheet1)Range(C18) = ApplicationDDERequest(Channel $applicationversion)Worksheets(Sheet1)Range(C19) = ApplicationDDERequest(Channel $startddeconversations)Worksheets(Sheet1)Range(C20) = ApplicationDDERequest(Channel $accesslevel)Worksheets(Sheet1)Range(C21) = ApplicationDDERequest(Channel $alarmlogging)Worksheets(Sheet1)Range(C22) = ApplicationDDERequest(Channel $applicationchanged)Worksheets(Sheet1)Range(C23) = ApplicationDDERequest(Channel $configureusers)Worksheets(Sheet1)Range(C24) = ApplicationDDERequest(Channel $changepassword)Worksheets(Sheet1)Range(C25) = ApplicationDDERequest(Channel $InactivityTimeout)Worksheets(Sheet1)Range(C26) = ApplicationDDERequest(Channel $InactivityWarning)Worksheets(Sheet1)Range(C27) = ApplicationDDERequest(Channel $LogicRunning)Worksheets(Sheet1)Range(C28) = ApplicationDDERequest(Channel $OperatorEntered)Worksheets(Sheet1)Range(C29) = ApplicationDDERequest(Channel $Operator)Worksheets(Sheet1)Range(C30) = ApplicationDDERequest(Channel $PasswordEntered)ApplicationDDETerminate Channel This terminates the DDE channelEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 110

Visual Basic

ldquoRoll Your Ownrdquo HMI - Much More powerful than Excel

Key Parameters computer nameapplication|topicitem

IO Emulator - MBPlusSimulateexe

Can ldquoRead Fromrdquo amp ldquoWrite Tordquo PLC andor HMI

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 111

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 112

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 113

Dim PauseTime Start Finish TotalTime As Integer Declare variables

Private Sub txtAIT_332A_SCALED_Change()On Error GoTo PokeAIT_332AErrortxtAIT_332A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtAIT_332A_SCALEDText = Int((3 Rnd) + 20) Generate random value between 20 and 23txtAIT_332A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtAIT_332A_SCALEDLinkItem = AIT_332A_SCALEDtxtAIT_332A_SCALEDLinkMode = 2txtAIT_332A_SCALEDLinkPoketxtAIT_332A_SCALEDLinkMode = 0 DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total time

PokeAIT_332AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtAIT_332A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 114

Private Sub txtAIT_346A_SCALED_Change()On Error GoTo PokeAIT_346AErrortxtAIT_346A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtAIT_346A_SCALEDText = Int((3 Rnd) + 15) Generate random value between 15 and 18txtAIT_346A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtAIT_346A_SCALEDLinkItem = AIT_346A_SCALEDtxtAIT_346A_SCALEDLinkMode = 2txtAIT_346A_SCALEDLinkPoketxtAIT_346A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeAIT_346AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtAIT_346A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 115

Private Sub txtFIT_321A_SCALED_Change()On Error GoTo PokeFIT_321AErrortxtFIT_321A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtFIT_321A_SCALEDText = Int((10 Rnd) + 120) Generate random value between 120 and 130txtFIT_321A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_321A_SCALEDLinkItem = FIT_321A_SCALEDtxtFIT_321A_SCALEDLinkMode = 2txtFIT_321A_SCALEDLinkPoketxtFIT_321A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total time

PokeFIT_321AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_321A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume Next

End Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 116

Private Sub txtFIT_341A_SCALED_Change()On Error GoTo PokeFIT_341AErrortxtFIT_341A_SCALEDLinkMode = 0 PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTime

txtFIT_341A_SCALEDText = Int((3 Rnd) + 18) Generate random value between 18 and 21

txtFIT_341A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_341A_SCALEDLinkItem = FIT_341A_SCALEDtxtFIT_341A_SCALEDLinkMode = 2txtFIT_341A_SCALEDLinkPoketxtFIT_341A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeFIT_341AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_341A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 117

Private Sub txtFIT_343A_SCALED_Change()On Error GoTo PokeFIT_343AErrortxtFIT_343A_SCALEDLinkMode = 0 PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTime

txtFIT_343A_SCALEDText = Int((1 Rnd) + 3) Generate random value between 3 and 4

txtFIT_343A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_343A_SCALEDLinkItem = FIT_343A_SCALEDtxtFIT_343A_SCALEDLinkMode = 2txtFIT_343A_SCALEDLinkPoketxtFIT_343A_SCALEDLinkMode = 0 DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeFIT_343AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_343A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 118

TUTORIAL

Part 4

Questions

amp

Answers

  • Slide 1
  • Slide 2
  • Slide 3
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Slide 8
  • Slide 9
  • Slide 10
  • Slide 11
  • Slide 12
  • Slide 13
  • Slide 14
  • Slide 15
  • Slide 16
  • Slide 17
  • Slide 18
  • Slide 19
  • Slide 20
  • Slide 21
  • Slide 22
  • Slide 23
  • Slide 24
  • Slide 25
  • Slide 26
  • Slide 27
  • Slide 28
  • Slide 29
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
  • Slide 34
  • Slide 35
  • Slide 36
  • Slide 37
  • Slide 38
  • Slide 39
  • Slide 40
  • Slide 41
  • Slide 42
  • Slide 43
  • Slide 44
  • Slide 45
  • Slide 46
  • Slide 47
  • Slide 48
  • Slide 49
  • Slide 50
  • Slide 51
  • Slide 52
  • Slide 53
  • Slide 54
  • Slide 55
  • Slide 56
  • Slide 57
  • Slide 58
  • Slide 59
  • Slide 60
  • Slide 61
  • Slide 62
  • Slide 63
  • Slide 64
  • Slide 65
  • Slide 66
  • Slide 67
  • Slide 68
  • Slide 69
  • Slide 70
  • Slide 71
  • Slide 72
  • Slide 73
  • Slide 74
  • Slide 75
  • Slide 76
  • Slide 77
  • Slide 78
  • Slide 79
  • Slide 80
  • Slide 81
  • Slide 82
  • Slide 83
  • Slide 84
  • Slide 85
  • Slide 86
  • Slide 87
  • Slide 88
  • Slide 89
  • Slide 90
  • Slide 91
  • Slide 92
  • Slide 93
  • Slide 94
  • Slide 95
  • Slide 96
  • Slide 97
  • Slide 98
  • Slide 99
  • Slide 100
  • Slide 101
  • Slide 102
  • Slide 103
  • Slide 104
  • Slide 105
  • Slide 106
  • Slide 107
  • Slide 108
  • Slide 109
  • Slide 110
  • Slide 111
  • Slide 112
  • Slide 113
  • Slide 114
  • Slide 115
  • Slide 116
  • Slide 117
  • Slide 118
Page 49: TUTORIAL Ethernet PLC's Improve Oxygen Consumption ISA Expo/2001Houston, Texas Water & Wastewater Industry DivisionTuesday, September 11, 2001 1 Brad.

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 Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday 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 Authoritys 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

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 50

TUTORIAL

Part 2A

PLC Programming Basics

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 51

Separate parts of the process have been organized into a separate ldquoSECTIONrdquo

PLC Program Organization

Each ldquoSECTIONrdquo can be any of the IEC programming types

bull Ladder (LD)bull Structured Text (ST)

bull Instruction List (IL)

bull Function Blocks (FB)bull Sequential Function Charts (SFC)

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 52

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 53

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 54

IO Map

On-Line PLC Diagnostics

PLC Status

PLC Simulator

Ethernet (TCPIP) Address

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 55

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 56

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 57

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 58

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 59

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 60

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 61

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 62

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 63

Structured Text was used hereNOT Ladder

Programming for Motors

The PLC DOES NOT CAREStructured Text Functions EXACTLY

the same as LadderUse what yoursquore comfortable with

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 64

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 65

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 66

IEC Function Blocks Used Here

Programming for Analogs amp PID

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 67

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 68

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 69

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 70

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 71

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 72

Sequential Function Charts were used here

Higher-Level Control

bull SFCrsquos lend themselves well to (as the name would imply) sequential processes

bull Three Important components in SFCrsquosbull Transitionsbull Stepsbull Jumps

bull The status of the process can be viewed as a flow chart

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 73

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 74

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 75

PLC - HMI Communication

A ldquoPLC Heartbeatrdquo is traditionally used to monitor the PLC - HMI Communication sometimes called ardquoWatchdog Timerrdquo

Call it whatever you want but the PLC amp 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 ldquodiesrdquo then that switch doesnrsquot change state and an alarm alerts the operator

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 76

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 77

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 78

TUTORIAL

Part 2B

HMI Programming

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 79

Ethernet (TCPIP) IO Driver

The Ethernet (TCPIP) IO Driver allows the HMI to communicate with the PLC (In this case the driver is called MBENETEXE)

The PLC has an ethernet module in one of the slots that has a ldquoCAT5RJ-45rdquo 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 ldquoCAT5RJ-45rdquo receptacle for the ethernet cable

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 80

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 81

Operator Screens amp Popup Displays

The display is laid out in 3 sections

bull Upper - Security amp Alarm Windowbull Middle- Main Operator Screens bull Lower - Menu amp Popup Displays

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 82

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 83

Scripting

There are 6 types of ldquoScriptsrdquobull Application Scriptsbull Key Scriptsbull Condition Scriptsbull Data Change Scriptsbull Quick Function Scriptsbull ActiveX Event Scripts

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 84

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 85

Access Names

The ldquoAccess Namesrdquo Must be configured to allow the PLC - HMI communications

Note that the ldquoApplicationTopicrdquo is the same as the IO Driver

The ldquocomputer namerdquo is the name of the PC that the HMI is running on (brad_s_carlberg in this case)

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 86

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 87

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 88

Indirect Tags

ldquoIndirect Tagsrdquo were used here to minimize the number of popup displays

This is especially useful in HMIrsquos with many tags

ONLY 12 popup displays are reused throughout the HMI

This gives the HMI a ldquoDCS-Likerdquo Look amp Feel

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 89

Popup Display TypesThe tag point type determines which popup display to use

Analog InputHIC (or Analog Output)PID (or Analog Composite)

bull PID WITH AUTO amp CASCADE amp RATIObull PID WITH AUTO amp RATIO

Diginbull Motor Status

DigOutMotor (or Digital Composite)

bull Motor with ILock and PermNumericSet TimersAlarm DetailAlarm Tags

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 90

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 91

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 92

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 93

Bars Buttons amp Sliders

By choosing to use indirect tags we complicate the Bar Graphs Buttons amp Sliders in the popup displays

Different scales need to be used for different engineering unit ranges

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 94

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 95

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 96

Popup Displays

The next two pages shows how the individual popup displays use the indirect tags

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 97

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 98

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 99

Adding a ldquoTouch Targetrdquo to a Display

2 Tell which tags to use

3 Tell which popup display to call upWhat kind of point type is it

3 Steps1 Tell which scale to use (if itrsquos an analog point type)

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 100

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 101

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 102

TUTORIAL

Part 2C

Excel Spreadsheets

amp

Visual Basic

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 103

A ldquoCHEAP amp DIRTYrdquo HMI With Excel

The 4 key parameters are

To communicate with the PLCUse brad_s_carlbergmbenet|ANOXIC_OXICrsquoplcregisterrsquo

Excel uses ldquopeeksrdquo amp ldquopokesrdquo to read from amp write to a PLC or HMI

To communicate with the HMIbrad_s_carlbergview|Tagnamersquotagnamersquo

bull computer namebull applicationbull topicbull item

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 104

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 105

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 106

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 107

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 108

Excel Macros

bull ldquoRequestrdquo Macro to read values

bull ldquoPokerdquo Macro to write values

bull A Sample Excel Macro

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 109

Sub PokeMacro()MsgBox ApplicationNetworkTemplatesPathChannel = ApplicationDDEInitiate(app=brad_s_carlbergVIEW topic=Tagname) This opens a DDE channel to ViewApplicationDDEPoke Channel Temperature1 Worksheets(Sheet1)Range(A1) Puts value from R1C1 into Temperature1ApplicationDDEPoke Channel DDEReal Worksheets(Sheet1)Range(A2) Puts value from R1C1 into Temperature1ApplicationDDEPoke Channel DDEInteger Worksheets(Sheet1)Range(A3) Puts value from R1C1 into Temperature1ApplicationDDETerminate Channel This terminates the DDE channelEnd SubSub RequestMacro()Channel = ApplicationDDEInitiate(app=brad_s_carlbergVIEW topic=Tagname) This opens a DDE channel to ViewWorksheets(Sheet1)Range(C4) = ApplicationDDERequest(Channel $Hour)Worksheets(Sheet1)Range(C5) = ApplicationDDERequest(Channel $Minute)Worksheets(Sheet1)Range(C6) = ApplicationDDERequest(Channel $Second)Worksheets(Sheet1)Range(C9) = ApplicationDDERequest(Channel $day)Worksheets(Sheet1)Range(C10) = ApplicationDDERequest(Channel $date)Worksheets(Sheet1)Range(C11) = ApplicationDDERequest(Channel $datestring)Worksheets(Sheet1)Range(C12) = ApplicationDDERequest(Channel $datetime)Worksheets(Sheet1)Range(C13) = ApplicationDDERequest(Channel $date)Worksheets(Sheet1)Range(C14) = ApplicationDDERequest(Channel $month)Worksheets(Sheet1)Range(C15) = ApplicationDDERequest(Channel $year)Worksheets(Sheet1)Range(C16) = ApplicationDDERequest(Channel $time)Worksheets(Sheet1)Range(C17) = ApplicationDDERequest(Channel $timestring)Worksheets(Sheet1)Range(C18) = ApplicationDDERequest(Channel $applicationversion)Worksheets(Sheet1)Range(C19) = ApplicationDDERequest(Channel $startddeconversations)Worksheets(Sheet1)Range(C20) = ApplicationDDERequest(Channel $accesslevel)Worksheets(Sheet1)Range(C21) = ApplicationDDERequest(Channel $alarmlogging)Worksheets(Sheet1)Range(C22) = ApplicationDDERequest(Channel $applicationchanged)Worksheets(Sheet1)Range(C23) = ApplicationDDERequest(Channel $configureusers)Worksheets(Sheet1)Range(C24) = ApplicationDDERequest(Channel $changepassword)Worksheets(Sheet1)Range(C25) = ApplicationDDERequest(Channel $InactivityTimeout)Worksheets(Sheet1)Range(C26) = ApplicationDDERequest(Channel $InactivityWarning)Worksheets(Sheet1)Range(C27) = ApplicationDDERequest(Channel $LogicRunning)Worksheets(Sheet1)Range(C28) = ApplicationDDERequest(Channel $OperatorEntered)Worksheets(Sheet1)Range(C29) = ApplicationDDERequest(Channel $Operator)Worksheets(Sheet1)Range(C30) = ApplicationDDERequest(Channel $PasswordEntered)ApplicationDDETerminate Channel This terminates the DDE channelEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 110

Visual Basic

ldquoRoll Your Ownrdquo HMI - Much More powerful than Excel

Key Parameters computer nameapplication|topicitem

IO Emulator - MBPlusSimulateexe

Can ldquoRead Fromrdquo amp ldquoWrite Tordquo PLC andor HMI

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 111

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 112

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 113

Dim PauseTime Start Finish TotalTime As Integer Declare variables

Private Sub txtAIT_332A_SCALED_Change()On Error GoTo PokeAIT_332AErrortxtAIT_332A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtAIT_332A_SCALEDText = Int((3 Rnd) + 20) Generate random value between 20 and 23txtAIT_332A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtAIT_332A_SCALEDLinkItem = AIT_332A_SCALEDtxtAIT_332A_SCALEDLinkMode = 2txtAIT_332A_SCALEDLinkPoketxtAIT_332A_SCALEDLinkMode = 0 DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total time

PokeAIT_332AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtAIT_332A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 114

Private Sub txtAIT_346A_SCALED_Change()On Error GoTo PokeAIT_346AErrortxtAIT_346A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtAIT_346A_SCALEDText = Int((3 Rnd) + 15) Generate random value between 15 and 18txtAIT_346A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtAIT_346A_SCALEDLinkItem = AIT_346A_SCALEDtxtAIT_346A_SCALEDLinkMode = 2txtAIT_346A_SCALEDLinkPoketxtAIT_346A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeAIT_346AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtAIT_346A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 115

Private Sub txtFIT_321A_SCALED_Change()On Error GoTo PokeFIT_321AErrortxtFIT_321A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtFIT_321A_SCALEDText = Int((10 Rnd) + 120) Generate random value between 120 and 130txtFIT_321A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_321A_SCALEDLinkItem = FIT_321A_SCALEDtxtFIT_321A_SCALEDLinkMode = 2txtFIT_321A_SCALEDLinkPoketxtFIT_321A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total time

PokeFIT_321AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_321A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume Next

End Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 116

Private Sub txtFIT_341A_SCALED_Change()On Error GoTo PokeFIT_341AErrortxtFIT_341A_SCALEDLinkMode = 0 PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTime

txtFIT_341A_SCALEDText = Int((3 Rnd) + 18) Generate random value between 18 and 21

txtFIT_341A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_341A_SCALEDLinkItem = FIT_341A_SCALEDtxtFIT_341A_SCALEDLinkMode = 2txtFIT_341A_SCALEDLinkPoketxtFIT_341A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeFIT_341AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_341A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 117

Private Sub txtFIT_343A_SCALED_Change()On Error GoTo PokeFIT_343AErrortxtFIT_343A_SCALEDLinkMode = 0 PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTime

txtFIT_343A_SCALEDText = Int((1 Rnd) + 3) Generate random value between 3 and 4

txtFIT_343A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_343A_SCALEDLinkItem = FIT_343A_SCALEDtxtFIT_343A_SCALEDLinkMode = 2txtFIT_343A_SCALEDLinkPoketxtFIT_343A_SCALEDLinkMode = 0 DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeFIT_343AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_343A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 118

TUTORIAL

Part 4

Questions

amp

Answers

  • Slide 1
  • Slide 2
  • Slide 3
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Slide 8
  • Slide 9
  • Slide 10
  • Slide 11
  • Slide 12
  • Slide 13
  • Slide 14
  • Slide 15
  • Slide 16
  • Slide 17
  • Slide 18
  • Slide 19
  • Slide 20
  • Slide 21
  • Slide 22
  • Slide 23
  • Slide 24
  • Slide 25
  • Slide 26
  • Slide 27
  • Slide 28
  • Slide 29
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
  • Slide 34
  • Slide 35
  • Slide 36
  • Slide 37
  • Slide 38
  • Slide 39
  • Slide 40
  • Slide 41
  • Slide 42
  • Slide 43
  • Slide 44
  • Slide 45
  • Slide 46
  • Slide 47
  • Slide 48
  • Slide 49
  • Slide 50
  • Slide 51
  • Slide 52
  • Slide 53
  • Slide 54
  • Slide 55
  • Slide 56
  • Slide 57
  • Slide 58
  • Slide 59
  • Slide 60
  • Slide 61
  • Slide 62
  • Slide 63
  • Slide 64
  • Slide 65
  • Slide 66
  • Slide 67
  • Slide 68
  • Slide 69
  • Slide 70
  • Slide 71
  • Slide 72
  • Slide 73
  • Slide 74
  • Slide 75
  • Slide 76
  • Slide 77
  • Slide 78
  • Slide 79
  • Slide 80
  • Slide 81
  • Slide 82
  • Slide 83
  • Slide 84
  • Slide 85
  • Slide 86
  • Slide 87
  • Slide 88
  • Slide 89
  • Slide 90
  • Slide 91
  • Slide 92
  • Slide 93
  • Slide 94
  • Slide 95
  • Slide 96
  • Slide 97
  • Slide 98
  • Slide 99
  • Slide 100
  • Slide 101
  • Slide 102
  • Slide 103
  • Slide 104
  • Slide 105
  • Slide 106
  • Slide 107
  • Slide 108
  • Slide 109
  • Slide 110
  • Slide 111
  • Slide 112
  • Slide 113
  • Slide 114
  • Slide 115
  • Slide 116
  • Slide 117
  • Slide 118
Page 50: TUTORIAL Ethernet PLC's Improve Oxygen Consumption ISA Expo/2001Houston, Texas Water & Wastewater Industry DivisionTuesday, September 11, 2001 1 Brad.

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 50

TUTORIAL

Part 2A

PLC Programming Basics

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 51

Separate parts of the process have been organized into a separate ldquoSECTIONrdquo

PLC Program Organization

Each ldquoSECTIONrdquo can be any of the IEC programming types

bull Ladder (LD)bull Structured Text (ST)

bull Instruction List (IL)

bull Function Blocks (FB)bull Sequential Function Charts (SFC)

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 52

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 53

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 54

IO Map

On-Line PLC Diagnostics

PLC Status

PLC Simulator

Ethernet (TCPIP) Address

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 55

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 56

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 57

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 58

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 59

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 60

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 61

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 62

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 63

Structured Text was used hereNOT Ladder

Programming for Motors

The PLC DOES NOT CAREStructured Text Functions EXACTLY

the same as LadderUse what yoursquore comfortable with

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 64

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 65

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 66

IEC Function Blocks Used Here

Programming for Analogs amp PID

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 67

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 68

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 69

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 70

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 71

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 72

Sequential Function Charts were used here

Higher-Level Control

bull SFCrsquos lend themselves well to (as the name would imply) sequential processes

bull Three Important components in SFCrsquosbull Transitionsbull Stepsbull Jumps

bull The status of the process can be viewed as a flow chart

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 73

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 74

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 75

PLC - HMI Communication

A ldquoPLC Heartbeatrdquo is traditionally used to monitor the PLC - HMI Communication sometimes called ardquoWatchdog Timerrdquo

Call it whatever you want but the PLC amp 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 ldquodiesrdquo then that switch doesnrsquot change state and an alarm alerts the operator

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 76

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 77

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 78

TUTORIAL

Part 2B

HMI Programming

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 79

Ethernet (TCPIP) IO Driver

The Ethernet (TCPIP) IO Driver allows the HMI to communicate with the PLC (In this case the driver is called MBENETEXE)

The PLC has an ethernet module in one of the slots that has a ldquoCAT5RJ-45rdquo 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 ldquoCAT5RJ-45rdquo receptacle for the ethernet cable

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 80

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 81

Operator Screens amp Popup Displays

The display is laid out in 3 sections

bull Upper - Security amp Alarm Windowbull Middle- Main Operator Screens bull Lower - Menu amp Popup Displays

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 82

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 83

Scripting

There are 6 types of ldquoScriptsrdquobull Application Scriptsbull Key Scriptsbull Condition Scriptsbull Data Change Scriptsbull Quick Function Scriptsbull ActiveX Event Scripts

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 84

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 85

Access Names

The ldquoAccess Namesrdquo Must be configured to allow the PLC - HMI communications

Note that the ldquoApplicationTopicrdquo is the same as the IO Driver

The ldquocomputer namerdquo is the name of the PC that the HMI is running on (brad_s_carlberg in this case)

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 86

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 87

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 88

Indirect Tags

ldquoIndirect Tagsrdquo were used here to minimize the number of popup displays

This is especially useful in HMIrsquos with many tags

ONLY 12 popup displays are reused throughout the HMI

This gives the HMI a ldquoDCS-Likerdquo Look amp Feel

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 89

Popup Display TypesThe tag point type determines which popup display to use

Analog InputHIC (or Analog Output)PID (or Analog Composite)

bull PID WITH AUTO amp CASCADE amp RATIObull PID WITH AUTO amp RATIO

Diginbull Motor Status

DigOutMotor (or Digital Composite)

bull Motor with ILock and PermNumericSet TimersAlarm DetailAlarm Tags

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 90

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 91

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 92

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 93

Bars Buttons amp Sliders

By choosing to use indirect tags we complicate the Bar Graphs Buttons amp Sliders in the popup displays

Different scales need to be used for different engineering unit ranges

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 94

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 95

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 96

Popup Displays

The next two pages shows how the individual popup displays use the indirect tags

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 97

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 98

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 99

Adding a ldquoTouch Targetrdquo to a Display

2 Tell which tags to use

3 Tell which popup display to call upWhat kind of point type is it

3 Steps1 Tell which scale to use (if itrsquos an analog point type)

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 100

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 101

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 102

TUTORIAL

Part 2C

Excel Spreadsheets

amp

Visual Basic

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 103

A ldquoCHEAP amp DIRTYrdquo HMI With Excel

The 4 key parameters are

To communicate with the PLCUse brad_s_carlbergmbenet|ANOXIC_OXICrsquoplcregisterrsquo

Excel uses ldquopeeksrdquo amp ldquopokesrdquo to read from amp write to a PLC or HMI

To communicate with the HMIbrad_s_carlbergview|Tagnamersquotagnamersquo

bull computer namebull applicationbull topicbull item

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 104

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 105

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 106

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 107

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 108

Excel Macros

bull ldquoRequestrdquo Macro to read values

bull ldquoPokerdquo Macro to write values

bull A Sample Excel Macro

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 109

Sub PokeMacro()MsgBox ApplicationNetworkTemplatesPathChannel = ApplicationDDEInitiate(app=brad_s_carlbergVIEW topic=Tagname) This opens a DDE channel to ViewApplicationDDEPoke Channel Temperature1 Worksheets(Sheet1)Range(A1) Puts value from R1C1 into Temperature1ApplicationDDEPoke Channel DDEReal Worksheets(Sheet1)Range(A2) Puts value from R1C1 into Temperature1ApplicationDDEPoke Channel DDEInteger Worksheets(Sheet1)Range(A3) Puts value from R1C1 into Temperature1ApplicationDDETerminate Channel This terminates the DDE channelEnd SubSub RequestMacro()Channel = ApplicationDDEInitiate(app=brad_s_carlbergVIEW topic=Tagname) This opens a DDE channel to ViewWorksheets(Sheet1)Range(C4) = ApplicationDDERequest(Channel $Hour)Worksheets(Sheet1)Range(C5) = ApplicationDDERequest(Channel $Minute)Worksheets(Sheet1)Range(C6) = ApplicationDDERequest(Channel $Second)Worksheets(Sheet1)Range(C9) = ApplicationDDERequest(Channel $day)Worksheets(Sheet1)Range(C10) = ApplicationDDERequest(Channel $date)Worksheets(Sheet1)Range(C11) = ApplicationDDERequest(Channel $datestring)Worksheets(Sheet1)Range(C12) = ApplicationDDERequest(Channel $datetime)Worksheets(Sheet1)Range(C13) = ApplicationDDERequest(Channel $date)Worksheets(Sheet1)Range(C14) = ApplicationDDERequest(Channel $month)Worksheets(Sheet1)Range(C15) = ApplicationDDERequest(Channel $year)Worksheets(Sheet1)Range(C16) = ApplicationDDERequest(Channel $time)Worksheets(Sheet1)Range(C17) = ApplicationDDERequest(Channel $timestring)Worksheets(Sheet1)Range(C18) = ApplicationDDERequest(Channel $applicationversion)Worksheets(Sheet1)Range(C19) = ApplicationDDERequest(Channel $startddeconversations)Worksheets(Sheet1)Range(C20) = ApplicationDDERequest(Channel $accesslevel)Worksheets(Sheet1)Range(C21) = ApplicationDDERequest(Channel $alarmlogging)Worksheets(Sheet1)Range(C22) = ApplicationDDERequest(Channel $applicationchanged)Worksheets(Sheet1)Range(C23) = ApplicationDDERequest(Channel $configureusers)Worksheets(Sheet1)Range(C24) = ApplicationDDERequest(Channel $changepassword)Worksheets(Sheet1)Range(C25) = ApplicationDDERequest(Channel $InactivityTimeout)Worksheets(Sheet1)Range(C26) = ApplicationDDERequest(Channel $InactivityWarning)Worksheets(Sheet1)Range(C27) = ApplicationDDERequest(Channel $LogicRunning)Worksheets(Sheet1)Range(C28) = ApplicationDDERequest(Channel $OperatorEntered)Worksheets(Sheet1)Range(C29) = ApplicationDDERequest(Channel $Operator)Worksheets(Sheet1)Range(C30) = ApplicationDDERequest(Channel $PasswordEntered)ApplicationDDETerminate Channel This terminates the DDE channelEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 110

Visual Basic

ldquoRoll Your Ownrdquo HMI - Much More powerful than Excel

Key Parameters computer nameapplication|topicitem

IO Emulator - MBPlusSimulateexe

Can ldquoRead Fromrdquo amp ldquoWrite Tordquo PLC andor HMI

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 111

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 112

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 113

Dim PauseTime Start Finish TotalTime As Integer Declare variables

Private Sub txtAIT_332A_SCALED_Change()On Error GoTo PokeAIT_332AErrortxtAIT_332A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtAIT_332A_SCALEDText = Int((3 Rnd) + 20) Generate random value between 20 and 23txtAIT_332A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtAIT_332A_SCALEDLinkItem = AIT_332A_SCALEDtxtAIT_332A_SCALEDLinkMode = 2txtAIT_332A_SCALEDLinkPoketxtAIT_332A_SCALEDLinkMode = 0 DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total time

PokeAIT_332AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtAIT_332A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 114

Private Sub txtAIT_346A_SCALED_Change()On Error GoTo PokeAIT_346AErrortxtAIT_346A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtAIT_346A_SCALEDText = Int((3 Rnd) + 15) Generate random value between 15 and 18txtAIT_346A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtAIT_346A_SCALEDLinkItem = AIT_346A_SCALEDtxtAIT_346A_SCALEDLinkMode = 2txtAIT_346A_SCALEDLinkPoketxtAIT_346A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeAIT_346AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtAIT_346A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 115

Private Sub txtFIT_321A_SCALED_Change()On Error GoTo PokeFIT_321AErrortxtFIT_321A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtFIT_321A_SCALEDText = Int((10 Rnd) + 120) Generate random value between 120 and 130txtFIT_321A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_321A_SCALEDLinkItem = FIT_321A_SCALEDtxtFIT_321A_SCALEDLinkMode = 2txtFIT_321A_SCALEDLinkPoketxtFIT_321A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total time

PokeFIT_321AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_321A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume Next

End Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 116

Private Sub txtFIT_341A_SCALED_Change()On Error GoTo PokeFIT_341AErrortxtFIT_341A_SCALEDLinkMode = 0 PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTime

txtFIT_341A_SCALEDText = Int((3 Rnd) + 18) Generate random value between 18 and 21

txtFIT_341A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_341A_SCALEDLinkItem = FIT_341A_SCALEDtxtFIT_341A_SCALEDLinkMode = 2txtFIT_341A_SCALEDLinkPoketxtFIT_341A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeFIT_341AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_341A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 117

Private Sub txtFIT_343A_SCALED_Change()On Error GoTo PokeFIT_343AErrortxtFIT_343A_SCALEDLinkMode = 0 PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTime

txtFIT_343A_SCALEDText = Int((1 Rnd) + 3) Generate random value between 3 and 4

txtFIT_343A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_343A_SCALEDLinkItem = FIT_343A_SCALEDtxtFIT_343A_SCALEDLinkMode = 2txtFIT_343A_SCALEDLinkPoketxtFIT_343A_SCALEDLinkMode = 0 DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeFIT_343AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_343A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 118

TUTORIAL

Part 4

Questions

amp

Answers

  • Slide 1
  • Slide 2
  • Slide 3
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Slide 8
  • Slide 9
  • Slide 10
  • Slide 11
  • Slide 12
  • Slide 13
  • Slide 14
  • Slide 15
  • Slide 16
  • Slide 17
  • Slide 18
  • Slide 19
  • Slide 20
  • Slide 21
  • Slide 22
  • Slide 23
  • Slide 24
  • Slide 25
  • Slide 26
  • Slide 27
  • Slide 28
  • Slide 29
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
  • Slide 34
  • Slide 35
  • Slide 36
  • Slide 37
  • Slide 38
  • Slide 39
  • Slide 40
  • Slide 41
  • Slide 42
  • Slide 43
  • Slide 44
  • Slide 45
  • Slide 46
  • Slide 47
  • Slide 48
  • Slide 49
  • Slide 50
  • Slide 51
  • Slide 52
  • Slide 53
  • Slide 54
  • Slide 55
  • Slide 56
  • Slide 57
  • Slide 58
  • Slide 59
  • Slide 60
  • Slide 61
  • Slide 62
  • Slide 63
  • Slide 64
  • Slide 65
  • Slide 66
  • Slide 67
  • Slide 68
  • Slide 69
  • Slide 70
  • Slide 71
  • Slide 72
  • Slide 73
  • Slide 74
  • Slide 75
  • Slide 76
  • Slide 77
  • Slide 78
  • Slide 79
  • Slide 80
  • Slide 81
  • Slide 82
  • Slide 83
  • Slide 84
  • Slide 85
  • Slide 86
  • Slide 87
  • Slide 88
  • Slide 89
  • Slide 90
  • Slide 91
  • Slide 92
  • Slide 93
  • Slide 94
  • Slide 95
  • Slide 96
  • Slide 97
  • Slide 98
  • Slide 99
  • Slide 100
  • Slide 101
  • Slide 102
  • Slide 103
  • Slide 104
  • Slide 105
  • Slide 106
  • Slide 107
  • Slide 108
  • Slide 109
  • Slide 110
  • Slide 111
  • Slide 112
  • Slide 113
  • Slide 114
  • Slide 115
  • Slide 116
  • Slide 117
  • Slide 118
Page 51: TUTORIAL Ethernet PLC's Improve Oxygen Consumption ISA Expo/2001Houston, Texas Water & Wastewater Industry DivisionTuesday, September 11, 2001 1 Brad.

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 51

Separate parts of the process have been organized into a separate ldquoSECTIONrdquo

PLC Program Organization

Each ldquoSECTIONrdquo can be any of the IEC programming types

bull Ladder (LD)bull Structured Text (ST)

bull Instruction List (IL)

bull Function Blocks (FB)bull Sequential Function Charts (SFC)

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 52

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 53

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 54

IO Map

On-Line PLC Diagnostics

PLC Status

PLC Simulator

Ethernet (TCPIP) Address

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 55

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 56

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 57

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 58

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 59

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 60

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 61

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 62

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 63

Structured Text was used hereNOT Ladder

Programming for Motors

The PLC DOES NOT CAREStructured Text Functions EXACTLY

the same as LadderUse what yoursquore comfortable with

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 64

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 65

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 66

IEC Function Blocks Used Here

Programming for Analogs amp PID

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 67

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 68

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 69

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 70

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 71

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 72

Sequential Function Charts were used here

Higher-Level Control

bull SFCrsquos lend themselves well to (as the name would imply) sequential processes

bull Three Important components in SFCrsquosbull Transitionsbull Stepsbull Jumps

bull The status of the process can be viewed as a flow chart

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 73

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 74

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 75

PLC - HMI Communication

A ldquoPLC Heartbeatrdquo is traditionally used to monitor the PLC - HMI Communication sometimes called ardquoWatchdog Timerrdquo

Call it whatever you want but the PLC amp 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 ldquodiesrdquo then that switch doesnrsquot change state and an alarm alerts the operator

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 76

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 77

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 78

TUTORIAL

Part 2B

HMI Programming

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 79

Ethernet (TCPIP) IO Driver

The Ethernet (TCPIP) IO Driver allows the HMI to communicate with the PLC (In this case the driver is called MBENETEXE)

The PLC has an ethernet module in one of the slots that has a ldquoCAT5RJ-45rdquo 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 ldquoCAT5RJ-45rdquo receptacle for the ethernet cable

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 80

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 81

Operator Screens amp Popup Displays

The display is laid out in 3 sections

bull Upper - Security amp Alarm Windowbull Middle- Main Operator Screens bull Lower - Menu amp Popup Displays

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 82

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 83

Scripting

There are 6 types of ldquoScriptsrdquobull Application Scriptsbull Key Scriptsbull Condition Scriptsbull Data Change Scriptsbull Quick Function Scriptsbull ActiveX Event Scripts

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 84

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 85

Access Names

The ldquoAccess Namesrdquo Must be configured to allow the PLC - HMI communications

Note that the ldquoApplicationTopicrdquo is the same as the IO Driver

The ldquocomputer namerdquo is the name of the PC that the HMI is running on (brad_s_carlberg in this case)

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 86

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 87

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 88

Indirect Tags

ldquoIndirect Tagsrdquo were used here to minimize the number of popup displays

This is especially useful in HMIrsquos with many tags

ONLY 12 popup displays are reused throughout the HMI

This gives the HMI a ldquoDCS-Likerdquo Look amp Feel

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 89

Popup Display TypesThe tag point type determines which popup display to use

Analog InputHIC (or Analog Output)PID (or Analog Composite)

bull PID WITH AUTO amp CASCADE amp RATIObull PID WITH AUTO amp RATIO

Diginbull Motor Status

DigOutMotor (or Digital Composite)

bull Motor with ILock and PermNumericSet TimersAlarm DetailAlarm Tags

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 90

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 91

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 92

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 93

Bars Buttons amp Sliders

By choosing to use indirect tags we complicate the Bar Graphs Buttons amp Sliders in the popup displays

Different scales need to be used for different engineering unit ranges

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 94

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 95

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 96

Popup Displays

The next two pages shows how the individual popup displays use the indirect tags

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 97

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 98

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 99

Adding a ldquoTouch Targetrdquo to a Display

2 Tell which tags to use

3 Tell which popup display to call upWhat kind of point type is it

3 Steps1 Tell which scale to use (if itrsquos an analog point type)

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 100

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 101

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 102

TUTORIAL

Part 2C

Excel Spreadsheets

amp

Visual Basic

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 103

A ldquoCHEAP amp DIRTYrdquo HMI With Excel

The 4 key parameters are

To communicate with the PLCUse brad_s_carlbergmbenet|ANOXIC_OXICrsquoplcregisterrsquo

Excel uses ldquopeeksrdquo amp ldquopokesrdquo to read from amp write to a PLC or HMI

To communicate with the HMIbrad_s_carlbergview|Tagnamersquotagnamersquo

bull computer namebull applicationbull topicbull item

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 104

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 105

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 106

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 107

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 108

Excel Macros

bull ldquoRequestrdquo Macro to read values

bull ldquoPokerdquo Macro to write values

bull A Sample Excel Macro

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 109

Sub PokeMacro()MsgBox ApplicationNetworkTemplatesPathChannel = ApplicationDDEInitiate(app=brad_s_carlbergVIEW topic=Tagname) This opens a DDE channel to ViewApplicationDDEPoke Channel Temperature1 Worksheets(Sheet1)Range(A1) Puts value from R1C1 into Temperature1ApplicationDDEPoke Channel DDEReal Worksheets(Sheet1)Range(A2) Puts value from R1C1 into Temperature1ApplicationDDEPoke Channel DDEInteger Worksheets(Sheet1)Range(A3) Puts value from R1C1 into Temperature1ApplicationDDETerminate Channel This terminates the DDE channelEnd SubSub RequestMacro()Channel = ApplicationDDEInitiate(app=brad_s_carlbergVIEW topic=Tagname) This opens a DDE channel to ViewWorksheets(Sheet1)Range(C4) = ApplicationDDERequest(Channel $Hour)Worksheets(Sheet1)Range(C5) = ApplicationDDERequest(Channel $Minute)Worksheets(Sheet1)Range(C6) = ApplicationDDERequest(Channel $Second)Worksheets(Sheet1)Range(C9) = ApplicationDDERequest(Channel $day)Worksheets(Sheet1)Range(C10) = ApplicationDDERequest(Channel $date)Worksheets(Sheet1)Range(C11) = ApplicationDDERequest(Channel $datestring)Worksheets(Sheet1)Range(C12) = ApplicationDDERequest(Channel $datetime)Worksheets(Sheet1)Range(C13) = ApplicationDDERequest(Channel $date)Worksheets(Sheet1)Range(C14) = ApplicationDDERequest(Channel $month)Worksheets(Sheet1)Range(C15) = ApplicationDDERequest(Channel $year)Worksheets(Sheet1)Range(C16) = ApplicationDDERequest(Channel $time)Worksheets(Sheet1)Range(C17) = ApplicationDDERequest(Channel $timestring)Worksheets(Sheet1)Range(C18) = ApplicationDDERequest(Channel $applicationversion)Worksheets(Sheet1)Range(C19) = ApplicationDDERequest(Channel $startddeconversations)Worksheets(Sheet1)Range(C20) = ApplicationDDERequest(Channel $accesslevel)Worksheets(Sheet1)Range(C21) = ApplicationDDERequest(Channel $alarmlogging)Worksheets(Sheet1)Range(C22) = ApplicationDDERequest(Channel $applicationchanged)Worksheets(Sheet1)Range(C23) = ApplicationDDERequest(Channel $configureusers)Worksheets(Sheet1)Range(C24) = ApplicationDDERequest(Channel $changepassword)Worksheets(Sheet1)Range(C25) = ApplicationDDERequest(Channel $InactivityTimeout)Worksheets(Sheet1)Range(C26) = ApplicationDDERequest(Channel $InactivityWarning)Worksheets(Sheet1)Range(C27) = ApplicationDDERequest(Channel $LogicRunning)Worksheets(Sheet1)Range(C28) = ApplicationDDERequest(Channel $OperatorEntered)Worksheets(Sheet1)Range(C29) = ApplicationDDERequest(Channel $Operator)Worksheets(Sheet1)Range(C30) = ApplicationDDERequest(Channel $PasswordEntered)ApplicationDDETerminate Channel This terminates the DDE channelEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 110

Visual Basic

ldquoRoll Your Ownrdquo HMI - Much More powerful than Excel

Key Parameters computer nameapplication|topicitem

IO Emulator - MBPlusSimulateexe

Can ldquoRead Fromrdquo amp ldquoWrite Tordquo PLC andor HMI

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 111

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 112

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 113

Dim PauseTime Start Finish TotalTime As Integer Declare variables

Private Sub txtAIT_332A_SCALED_Change()On Error GoTo PokeAIT_332AErrortxtAIT_332A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtAIT_332A_SCALEDText = Int((3 Rnd) + 20) Generate random value between 20 and 23txtAIT_332A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtAIT_332A_SCALEDLinkItem = AIT_332A_SCALEDtxtAIT_332A_SCALEDLinkMode = 2txtAIT_332A_SCALEDLinkPoketxtAIT_332A_SCALEDLinkMode = 0 DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total time

PokeAIT_332AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtAIT_332A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 114

Private Sub txtAIT_346A_SCALED_Change()On Error GoTo PokeAIT_346AErrortxtAIT_346A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtAIT_346A_SCALEDText = Int((3 Rnd) + 15) Generate random value between 15 and 18txtAIT_346A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtAIT_346A_SCALEDLinkItem = AIT_346A_SCALEDtxtAIT_346A_SCALEDLinkMode = 2txtAIT_346A_SCALEDLinkPoketxtAIT_346A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeAIT_346AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtAIT_346A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 115

Private Sub txtFIT_321A_SCALED_Change()On Error GoTo PokeFIT_321AErrortxtFIT_321A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtFIT_321A_SCALEDText = Int((10 Rnd) + 120) Generate random value between 120 and 130txtFIT_321A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_321A_SCALEDLinkItem = FIT_321A_SCALEDtxtFIT_321A_SCALEDLinkMode = 2txtFIT_321A_SCALEDLinkPoketxtFIT_321A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total time

PokeFIT_321AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_321A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume Next

End Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 116

Private Sub txtFIT_341A_SCALED_Change()On Error GoTo PokeFIT_341AErrortxtFIT_341A_SCALEDLinkMode = 0 PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTime

txtFIT_341A_SCALEDText = Int((3 Rnd) + 18) Generate random value between 18 and 21

txtFIT_341A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_341A_SCALEDLinkItem = FIT_341A_SCALEDtxtFIT_341A_SCALEDLinkMode = 2txtFIT_341A_SCALEDLinkPoketxtFIT_341A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeFIT_341AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_341A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 117

Private Sub txtFIT_343A_SCALED_Change()On Error GoTo PokeFIT_343AErrortxtFIT_343A_SCALEDLinkMode = 0 PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTime

txtFIT_343A_SCALEDText = Int((1 Rnd) + 3) Generate random value between 3 and 4

txtFIT_343A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_343A_SCALEDLinkItem = FIT_343A_SCALEDtxtFIT_343A_SCALEDLinkMode = 2txtFIT_343A_SCALEDLinkPoketxtFIT_343A_SCALEDLinkMode = 0 DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeFIT_343AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_343A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 118

TUTORIAL

Part 4

Questions

amp

Answers

  • Slide 1
  • Slide 2
  • Slide 3
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Slide 8
  • Slide 9
  • Slide 10
  • Slide 11
  • Slide 12
  • Slide 13
  • Slide 14
  • Slide 15
  • Slide 16
  • Slide 17
  • Slide 18
  • Slide 19
  • Slide 20
  • Slide 21
  • Slide 22
  • Slide 23
  • Slide 24
  • Slide 25
  • Slide 26
  • Slide 27
  • Slide 28
  • Slide 29
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
  • Slide 34
  • Slide 35
  • Slide 36
  • Slide 37
  • Slide 38
  • Slide 39
  • Slide 40
  • Slide 41
  • Slide 42
  • Slide 43
  • Slide 44
  • Slide 45
  • Slide 46
  • Slide 47
  • Slide 48
  • Slide 49
  • Slide 50
  • Slide 51
  • Slide 52
  • Slide 53
  • Slide 54
  • Slide 55
  • Slide 56
  • Slide 57
  • Slide 58
  • Slide 59
  • Slide 60
  • Slide 61
  • Slide 62
  • Slide 63
  • Slide 64
  • Slide 65
  • Slide 66
  • Slide 67
  • Slide 68
  • Slide 69
  • Slide 70
  • Slide 71
  • Slide 72
  • Slide 73
  • Slide 74
  • Slide 75
  • Slide 76
  • Slide 77
  • Slide 78
  • Slide 79
  • Slide 80
  • Slide 81
  • Slide 82
  • Slide 83
  • Slide 84
  • Slide 85
  • Slide 86
  • Slide 87
  • Slide 88
  • Slide 89
  • Slide 90
  • Slide 91
  • Slide 92
  • Slide 93
  • Slide 94
  • Slide 95
  • Slide 96
  • Slide 97
  • Slide 98
  • Slide 99
  • Slide 100
  • Slide 101
  • Slide 102
  • Slide 103
  • Slide 104
  • Slide 105
  • Slide 106
  • Slide 107
  • Slide 108
  • Slide 109
  • Slide 110
  • Slide 111
  • Slide 112
  • Slide 113
  • Slide 114
  • Slide 115
  • Slide 116
  • Slide 117
  • Slide 118
Page 52: TUTORIAL Ethernet PLC's Improve Oxygen Consumption ISA Expo/2001Houston, Texas Water & Wastewater Industry DivisionTuesday, September 11, 2001 1 Brad.

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 52

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 53

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 54

IO Map

On-Line PLC Diagnostics

PLC Status

PLC Simulator

Ethernet (TCPIP) Address

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 55

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 56

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 57

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 58

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 59

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 60

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 61

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 62

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 63

Structured Text was used hereNOT Ladder

Programming for Motors

The PLC DOES NOT CAREStructured Text Functions EXACTLY

the same as LadderUse what yoursquore comfortable with

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 64

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 65

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 66

IEC Function Blocks Used Here

Programming for Analogs amp PID

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 67

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 68

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 69

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 70

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 71

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 72

Sequential Function Charts were used here

Higher-Level Control

bull SFCrsquos lend themselves well to (as the name would imply) sequential processes

bull Three Important components in SFCrsquosbull Transitionsbull Stepsbull Jumps

bull The status of the process can be viewed as a flow chart

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 73

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 74

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 75

PLC - HMI Communication

A ldquoPLC Heartbeatrdquo is traditionally used to monitor the PLC - HMI Communication sometimes called ardquoWatchdog Timerrdquo

Call it whatever you want but the PLC amp 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 ldquodiesrdquo then that switch doesnrsquot change state and an alarm alerts the operator

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 76

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 77

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 78

TUTORIAL

Part 2B

HMI Programming

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 79

Ethernet (TCPIP) IO Driver

The Ethernet (TCPIP) IO Driver allows the HMI to communicate with the PLC (In this case the driver is called MBENETEXE)

The PLC has an ethernet module in one of the slots that has a ldquoCAT5RJ-45rdquo 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 ldquoCAT5RJ-45rdquo receptacle for the ethernet cable

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 80

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 81

Operator Screens amp Popup Displays

The display is laid out in 3 sections

bull Upper - Security amp Alarm Windowbull Middle- Main Operator Screens bull Lower - Menu amp Popup Displays

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 82

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 83

Scripting

There are 6 types of ldquoScriptsrdquobull Application Scriptsbull Key Scriptsbull Condition Scriptsbull Data Change Scriptsbull Quick Function Scriptsbull ActiveX Event Scripts

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 84

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 85

Access Names

The ldquoAccess Namesrdquo Must be configured to allow the PLC - HMI communications

Note that the ldquoApplicationTopicrdquo is the same as the IO Driver

The ldquocomputer namerdquo is the name of the PC that the HMI is running on (brad_s_carlberg in this case)

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 86

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 87

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 88

Indirect Tags

ldquoIndirect Tagsrdquo were used here to minimize the number of popup displays

This is especially useful in HMIrsquos with many tags

ONLY 12 popup displays are reused throughout the HMI

This gives the HMI a ldquoDCS-Likerdquo Look amp Feel

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 89

Popup Display TypesThe tag point type determines which popup display to use

Analog InputHIC (or Analog Output)PID (or Analog Composite)

bull PID WITH AUTO amp CASCADE amp RATIObull PID WITH AUTO amp RATIO

Diginbull Motor Status

DigOutMotor (or Digital Composite)

bull Motor with ILock and PermNumericSet TimersAlarm DetailAlarm Tags

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 90

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 91

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 92

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 93

Bars Buttons amp Sliders

By choosing to use indirect tags we complicate the Bar Graphs Buttons amp Sliders in the popup displays

Different scales need to be used for different engineering unit ranges

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 94

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 95

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 96

Popup Displays

The next two pages shows how the individual popup displays use the indirect tags

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 97

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 98

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 99

Adding a ldquoTouch Targetrdquo to a Display

2 Tell which tags to use

3 Tell which popup display to call upWhat kind of point type is it

3 Steps1 Tell which scale to use (if itrsquos an analog point type)

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 100

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 101

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 102

TUTORIAL

Part 2C

Excel Spreadsheets

amp

Visual Basic

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 103

A ldquoCHEAP amp DIRTYrdquo HMI With Excel

The 4 key parameters are

To communicate with the PLCUse brad_s_carlbergmbenet|ANOXIC_OXICrsquoplcregisterrsquo

Excel uses ldquopeeksrdquo amp ldquopokesrdquo to read from amp write to a PLC or HMI

To communicate with the HMIbrad_s_carlbergview|Tagnamersquotagnamersquo

bull computer namebull applicationbull topicbull item

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 104

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 105

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 106

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 107

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 108

Excel Macros

bull ldquoRequestrdquo Macro to read values

bull ldquoPokerdquo Macro to write values

bull A Sample Excel Macro

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 109

Sub PokeMacro()MsgBox ApplicationNetworkTemplatesPathChannel = ApplicationDDEInitiate(app=brad_s_carlbergVIEW topic=Tagname) This opens a DDE channel to ViewApplicationDDEPoke Channel Temperature1 Worksheets(Sheet1)Range(A1) Puts value from R1C1 into Temperature1ApplicationDDEPoke Channel DDEReal Worksheets(Sheet1)Range(A2) Puts value from R1C1 into Temperature1ApplicationDDEPoke Channel DDEInteger Worksheets(Sheet1)Range(A3) Puts value from R1C1 into Temperature1ApplicationDDETerminate Channel This terminates the DDE channelEnd SubSub RequestMacro()Channel = ApplicationDDEInitiate(app=brad_s_carlbergVIEW topic=Tagname) This opens a DDE channel to ViewWorksheets(Sheet1)Range(C4) = ApplicationDDERequest(Channel $Hour)Worksheets(Sheet1)Range(C5) = ApplicationDDERequest(Channel $Minute)Worksheets(Sheet1)Range(C6) = ApplicationDDERequest(Channel $Second)Worksheets(Sheet1)Range(C9) = ApplicationDDERequest(Channel $day)Worksheets(Sheet1)Range(C10) = ApplicationDDERequest(Channel $date)Worksheets(Sheet1)Range(C11) = ApplicationDDERequest(Channel $datestring)Worksheets(Sheet1)Range(C12) = ApplicationDDERequest(Channel $datetime)Worksheets(Sheet1)Range(C13) = ApplicationDDERequest(Channel $date)Worksheets(Sheet1)Range(C14) = ApplicationDDERequest(Channel $month)Worksheets(Sheet1)Range(C15) = ApplicationDDERequest(Channel $year)Worksheets(Sheet1)Range(C16) = ApplicationDDERequest(Channel $time)Worksheets(Sheet1)Range(C17) = ApplicationDDERequest(Channel $timestring)Worksheets(Sheet1)Range(C18) = ApplicationDDERequest(Channel $applicationversion)Worksheets(Sheet1)Range(C19) = ApplicationDDERequest(Channel $startddeconversations)Worksheets(Sheet1)Range(C20) = ApplicationDDERequest(Channel $accesslevel)Worksheets(Sheet1)Range(C21) = ApplicationDDERequest(Channel $alarmlogging)Worksheets(Sheet1)Range(C22) = ApplicationDDERequest(Channel $applicationchanged)Worksheets(Sheet1)Range(C23) = ApplicationDDERequest(Channel $configureusers)Worksheets(Sheet1)Range(C24) = ApplicationDDERequest(Channel $changepassword)Worksheets(Sheet1)Range(C25) = ApplicationDDERequest(Channel $InactivityTimeout)Worksheets(Sheet1)Range(C26) = ApplicationDDERequest(Channel $InactivityWarning)Worksheets(Sheet1)Range(C27) = ApplicationDDERequest(Channel $LogicRunning)Worksheets(Sheet1)Range(C28) = ApplicationDDERequest(Channel $OperatorEntered)Worksheets(Sheet1)Range(C29) = ApplicationDDERequest(Channel $Operator)Worksheets(Sheet1)Range(C30) = ApplicationDDERequest(Channel $PasswordEntered)ApplicationDDETerminate Channel This terminates the DDE channelEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 110

Visual Basic

ldquoRoll Your Ownrdquo HMI - Much More powerful than Excel

Key Parameters computer nameapplication|topicitem

IO Emulator - MBPlusSimulateexe

Can ldquoRead Fromrdquo amp ldquoWrite Tordquo PLC andor HMI

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 111

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 112

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 113

Dim PauseTime Start Finish TotalTime As Integer Declare variables

Private Sub txtAIT_332A_SCALED_Change()On Error GoTo PokeAIT_332AErrortxtAIT_332A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtAIT_332A_SCALEDText = Int((3 Rnd) + 20) Generate random value between 20 and 23txtAIT_332A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtAIT_332A_SCALEDLinkItem = AIT_332A_SCALEDtxtAIT_332A_SCALEDLinkMode = 2txtAIT_332A_SCALEDLinkPoketxtAIT_332A_SCALEDLinkMode = 0 DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total time

PokeAIT_332AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtAIT_332A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 114

Private Sub txtAIT_346A_SCALED_Change()On Error GoTo PokeAIT_346AErrortxtAIT_346A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtAIT_346A_SCALEDText = Int((3 Rnd) + 15) Generate random value between 15 and 18txtAIT_346A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtAIT_346A_SCALEDLinkItem = AIT_346A_SCALEDtxtAIT_346A_SCALEDLinkMode = 2txtAIT_346A_SCALEDLinkPoketxtAIT_346A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeAIT_346AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtAIT_346A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 115

Private Sub txtFIT_321A_SCALED_Change()On Error GoTo PokeFIT_321AErrortxtFIT_321A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtFIT_321A_SCALEDText = Int((10 Rnd) + 120) Generate random value between 120 and 130txtFIT_321A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_321A_SCALEDLinkItem = FIT_321A_SCALEDtxtFIT_321A_SCALEDLinkMode = 2txtFIT_321A_SCALEDLinkPoketxtFIT_321A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total time

PokeFIT_321AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_321A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume Next

End Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 116

Private Sub txtFIT_341A_SCALED_Change()On Error GoTo PokeFIT_341AErrortxtFIT_341A_SCALEDLinkMode = 0 PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTime

txtFIT_341A_SCALEDText = Int((3 Rnd) + 18) Generate random value between 18 and 21

txtFIT_341A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_341A_SCALEDLinkItem = FIT_341A_SCALEDtxtFIT_341A_SCALEDLinkMode = 2txtFIT_341A_SCALEDLinkPoketxtFIT_341A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeFIT_341AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_341A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 117

Private Sub txtFIT_343A_SCALED_Change()On Error GoTo PokeFIT_343AErrortxtFIT_343A_SCALEDLinkMode = 0 PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTime

txtFIT_343A_SCALEDText = Int((1 Rnd) + 3) Generate random value between 3 and 4

txtFIT_343A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_343A_SCALEDLinkItem = FIT_343A_SCALEDtxtFIT_343A_SCALEDLinkMode = 2txtFIT_343A_SCALEDLinkPoketxtFIT_343A_SCALEDLinkMode = 0 DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeFIT_343AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_343A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 118

TUTORIAL

Part 4

Questions

amp

Answers

  • Slide 1
  • Slide 2
  • Slide 3
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Slide 8
  • Slide 9
  • Slide 10
  • Slide 11
  • Slide 12
  • Slide 13
  • Slide 14
  • Slide 15
  • Slide 16
  • Slide 17
  • Slide 18
  • Slide 19
  • Slide 20
  • Slide 21
  • Slide 22
  • Slide 23
  • Slide 24
  • Slide 25
  • Slide 26
  • Slide 27
  • Slide 28
  • Slide 29
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
  • Slide 34
  • Slide 35
  • Slide 36
  • Slide 37
  • Slide 38
  • Slide 39
  • Slide 40
  • Slide 41
  • Slide 42
  • Slide 43
  • Slide 44
  • Slide 45
  • Slide 46
  • Slide 47
  • Slide 48
  • Slide 49
  • Slide 50
  • Slide 51
  • Slide 52
  • Slide 53
  • Slide 54
  • Slide 55
  • Slide 56
  • Slide 57
  • Slide 58
  • Slide 59
  • Slide 60
  • Slide 61
  • Slide 62
  • Slide 63
  • Slide 64
  • Slide 65
  • Slide 66
  • Slide 67
  • Slide 68
  • Slide 69
  • Slide 70
  • Slide 71
  • Slide 72
  • Slide 73
  • Slide 74
  • Slide 75
  • Slide 76
  • Slide 77
  • Slide 78
  • Slide 79
  • Slide 80
  • Slide 81
  • Slide 82
  • Slide 83
  • Slide 84
  • Slide 85
  • Slide 86
  • Slide 87
  • Slide 88
  • Slide 89
  • Slide 90
  • Slide 91
  • Slide 92
  • Slide 93
  • Slide 94
  • Slide 95
  • Slide 96
  • Slide 97
  • Slide 98
  • Slide 99
  • Slide 100
  • Slide 101
  • Slide 102
  • Slide 103
  • Slide 104
  • Slide 105
  • Slide 106
  • Slide 107
  • Slide 108
  • Slide 109
  • Slide 110
  • Slide 111
  • Slide 112
  • Slide 113
  • Slide 114
  • Slide 115
  • Slide 116
  • Slide 117
  • Slide 118
Page 53: TUTORIAL Ethernet PLC's Improve Oxygen Consumption ISA Expo/2001Houston, Texas Water & Wastewater Industry DivisionTuesday, September 11, 2001 1 Brad.

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 53

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 54

IO Map

On-Line PLC Diagnostics

PLC Status

PLC Simulator

Ethernet (TCPIP) Address

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 55

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 56

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 57

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 58

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 59

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 60

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 61

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 62

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 63

Structured Text was used hereNOT Ladder

Programming for Motors

The PLC DOES NOT CAREStructured Text Functions EXACTLY

the same as LadderUse what yoursquore comfortable with

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 64

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 65

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 66

IEC Function Blocks Used Here

Programming for Analogs amp PID

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 67

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 68

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 69

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 70

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 71

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 72

Sequential Function Charts were used here

Higher-Level Control

bull SFCrsquos lend themselves well to (as the name would imply) sequential processes

bull Three Important components in SFCrsquosbull Transitionsbull Stepsbull Jumps

bull The status of the process can be viewed as a flow chart

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 73

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 74

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 75

PLC - HMI Communication

A ldquoPLC Heartbeatrdquo is traditionally used to monitor the PLC - HMI Communication sometimes called ardquoWatchdog Timerrdquo

Call it whatever you want but the PLC amp 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 ldquodiesrdquo then that switch doesnrsquot change state and an alarm alerts the operator

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 76

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 77

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 78

TUTORIAL

Part 2B

HMI Programming

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 79

Ethernet (TCPIP) IO Driver

The Ethernet (TCPIP) IO Driver allows the HMI to communicate with the PLC (In this case the driver is called MBENETEXE)

The PLC has an ethernet module in one of the slots that has a ldquoCAT5RJ-45rdquo 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 ldquoCAT5RJ-45rdquo receptacle for the ethernet cable

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 80

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 81

Operator Screens amp Popup Displays

The display is laid out in 3 sections

bull Upper - Security amp Alarm Windowbull Middle- Main Operator Screens bull Lower - Menu amp Popup Displays

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 82

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 83

Scripting

There are 6 types of ldquoScriptsrdquobull Application Scriptsbull Key Scriptsbull Condition Scriptsbull Data Change Scriptsbull Quick Function Scriptsbull ActiveX Event Scripts

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 84

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 85

Access Names

The ldquoAccess Namesrdquo Must be configured to allow the PLC - HMI communications

Note that the ldquoApplicationTopicrdquo is the same as the IO Driver

The ldquocomputer namerdquo is the name of the PC that the HMI is running on (brad_s_carlberg in this case)

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 86

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 87

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 88

Indirect Tags

ldquoIndirect Tagsrdquo were used here to minimize the number of popup displays

This is especially useful in HMIrsquos with many tags

ONLY 12 popup displays are reused throughout the HMI

This gives the HMI a ldquoDCS-Likerdquo Look amp Feel

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 89

Popup Display TypesThe tag point type determines which popup display to use

Analog InputHIC (or Analog Output)PID (or Analog Composite)

bull PID WITH AUTO amp CASCADE amp RATIObull PID WITH AUTO amp RATIO

Diginbull Motor Status

DigOutMotor (or Digital Composite)

bull Motor with ILock and PermNumericSet TimersAlarm DetailAlarm Tags

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 90

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 91

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 92

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 93

Bars Buttons amp Sliders

By choosing to use indirect tags we complicate the Bar Graphs Buttons amp Sliders in the popup displays

Different scales need to be used for different engineering unit ranges

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 94

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 95

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 96

Popup Displays

The next two pages shows how the individual popup displays use the indirect tags

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 97

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 98

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 99

Adding a ldquoTouch Targetrdquo to a Display

2 Tell which tags to use

3 Tell which popup display to call upWhat kind of point type is it

3 Steps1 Tell which scale to use (if itrsquos an analog point type)

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 100

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 101

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 102

TUTORIAL

Part 2C

Excel Spreadsheets

amp

Visual Basic

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 103

A ldquoCHEAP amp DIRTYrdquo HMI With Excel

The 4 key parameters are

To communicate with the PLCUse brad_s_carlbergmbenet|ANOXIC_OXICrsquoplcregisterrsquo

Excel uses ldquopeeksrdquo amp ldquopokesrdquo to read from amp write to a PLC or HMI

To communicate with the HMIbrad_s_carlbergview|Tagnamersquotagnamersquo

bull computer namebull applicationbull topicbull item

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 104

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 105

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 106

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 107

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 108

Excel Macros

bull ldquoRequestrdquo Macro to read values

bull ldquoPokerdquo Macro to write values

bull A Sample Excel Macro

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 109

Sub PokeMacro()MsgBox ApplicationNetworkTemplatesPathChannel = ApplicationDDEInitiate(app=brad_s_carlbergVIEW topic=Tagname) This opens a DDE channel to ViewApplicationDDEPoke Channel Temperature1 Worksheets(Sheet1)Range(A1) Puts value from R1C1 into Temperature1ApplicationDDEPoke Channel DDEReal Worksheets(Sheet1)Range(A2) Puts value from R1C1 into Temperature1ApplicationDDEPoke Channel DDEInteger Worksheets(Sheet1)Range(A3) Puts value from R1C1 into Temperature1ApplicationDDETerminate Channel This terminates the DDE channelEnd SubSub RequestMacro()Channel = ApplicationDDEInitiate(app=brad_s_carlbergVIEW topic=Tagname) This opens a DDE channel to ViewWorksheets(Sheet1)Range(C4) = ApplicationDDERequest(Channel $Hour)Worksheets(Sheet1)Range(C5) = ApplicationDDERequest(Channel $Minute)Worksheets(Sheet1)Range(C6) = ApplicationDDERequest(Channel $Second)Worksheets(Sheet1)Range(C9) = ApplicationDDERequest(Channel $day)Worksheets(Sheet1)Range(C10) = ApplicationDDERequest(Channel $date)Worksheets(Sheet1)Range(C11) = ApplicationDDERequest(Channel $datestring)Worksheets(Sheet1)Range(C12) = ApplicationDDERequest(Channel $datetime)Worksheets(Sheet1)Range(C13) = ApplicationDDERequest(Channel $date)Worksheets(Sheet1)Range(C14) = ApplicationDDERequest(Channel $month)Worksheets(Sheet1)Range(C15) = ApplicationDDERequest(Channel $year)Worksheets(Sheet1)Range(C16) = ApplicationDDERequest(Channel $time)Worksheets(Sheet1)Range(C17) = ApplicationDDERequest(Channel $timestring)Worksheets(Sheet1)Range(C18) = ApplicationDDERequest(Channel $applicationversion)Worksheets(Sheet1)Range(C19) = ApplicationDDERequest(Channel $startddeconversations)Worksheets(Sheet1)Range(C20) = ApplicationDDERequest(Channel $accesslevel)Worksheets(Sheet1)Range(C21) = ApplicationDDERequest(Channel $alarmlogging)Worksheets(Sheet1)Range(C22) = ApplicationDDERequest(Channel $applicationchanged)Worksheets(Sheet1)Range(C23) = ApplicationDDERequest(Channel $configureusers)Worksheets(Sheet1)Range(C24) = ApplicationDDERequest(Channel $changepassword)Worksheets(Sheet1)Range(C25) = ApplicationDDERequest(Channel $InactivityTimeout)Worksheets(Sheet1)Range(C26) = ApplicationDDERequest(Channel $InactivityWarning)Worksheets(Sheet1)Range(C27) = ApplicationDDERequest(Channel $LogicRunning)Worksheets(Sheet1)Range(C28) = ApplicationDDERequest(Channel $OperatorEntered)Worksheets(Sheet1)Range(C29) = ApplicationDDERequest(Channel $Operator)Worksheets(Sheet1)Range(C30) = ApplicationDDERequest(Channel $PasswordEntered)ApplicationDDETerminate Channel This terminates the DDE channelEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 110

Visual Basic

ldquoRoll Your Ownrdquo HMI - Much More powerful than Excel

Key Parameters computer nameapplication|topicitem

IO Emulator - MBPlusSimulateexe

Can ldquoRead Fromrdquo amp ldquoWrite Tordquo PLC andor HMI

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 111

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 112

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 113

Dim PauseTime Start Finish TotalTime As Integer Declare variables

Private Sub txtAIT_332A_SCALED_Change()On Error GoTo PokeAIT_332AErrortxtAIT_332A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtAIT_332A_SCALEDText = Int((3 Rnd) + 20) Generate random value between 20 and 23txtAIT_332A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtAIT_332A_SCALEDLinkItem = AIT_332A_SCALEDtxtAIT_332A_SCALEDLinkMode = 2txtAIT_332A_SCALEDLinkPoketxtAIT_332A_SCALEDLinkMode = 0 DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total time

PokeAIT_332AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtAIT_332A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 114

Private Sub txtAIT_346A_SCALED_Change()On Error GoTo PokeAIT_346AErrortxtAIT_346A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtAIT_346A_SCALEDText = Int((3 Rnd) + 15) Generate random value between 15 and 18txtAIT_346A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtAIT_346A_SCALEDLinkItem = AIT_346A_SCALEDtxtAIT_346A_SCALEDLinkMode = 2txtAIT_346A_SCALEDLinkPoketxtAIT_346A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeAIT_346AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtAIT_346A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 115

Private Sub txtFIT_321A_SCALED_Change()On Error GoTo PokeFIT_321AErrortxtFIT_321A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtFIT_321A_SCALEDText = Int((10 Rnd) + 120) Generate random value between 120 and 130txtFIT_321A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_321A_SCALEDLinkItem = FIT_321A_SCALEDtxtFIT_321A_SCALEDLinkMode = 2txtFIT_321A_SCALEDLinkPoketxtFIT_321A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total time

PokeFIT_321AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_321A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume Next

End Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 116

Private Sub txtFIT_341A_SCALED_Change()On Error GoTo PokeFIT_341AErrortxtFIT_341A_SCALEDLinkMode = 0 PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTime

txtFIT_341A_SCALEDText = Int((3 Rnd) + 18) Generate random value between 18 and 21

txtFIT_341A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_341A_SCALEDLinkItem = FIT_341A_SCALEDtxtFIT_341A_SCALEDLinkMode = 2txtFIT_341A_SCALEDLinkPoketxtFIT_341A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeFIT_341AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_341A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 117

Private Sub txtFIT_343A_SCALED_Change()On Error GoTo PokeFIT_343AErrortxtFIT_343A_SCALEDLinkMode = 0 PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTime

txtFIT_343A_SCALEDText = Int((1 Rnd) + 3) Generate random value between 3 and 4

txtFIT_343A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_343A_SCALEDLinkItem = FIT_343A_SCALEDtxtFIT_343A_SCALEDLinkMode = 2txtFIT_343A_SCALEDLinkPoketxtFIT_343A_SCALEDLinkMode = 0 DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeFIT_343AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_343A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 118

TUTORIAL

Part 4

Questions

amp

Answers

  • Slide 1
  • Slide 2
  • Slide 3
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Slide 8
  • Slide 9
  • Slide 10
  • Slide 11
  • Slide 12
  • Slide 13
  • Slide 14
  • Slide 15
  • Slide 16
  • Slide 17
  • Slide 18
  • Slide 19
  • Slide 20
  • Slide 21
  • Slide 22
  • Slide 23
  • Slide 24
  • Slide 25
  • Slide 26
  • Slide 27
  • Slide 28
  • Slide 29
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
  • Slide 34
  • Slide 35
  • Slide 36
  • Slide 37
  • Slide 38
  • Slide 39
  • Slide 40
  • Slide 41
  • Slide 42
  • Slide 43
  • Slide 44
  • Slide 45
  • Slide 46
  • Slide 47
  • Slide 48
  • Slide 49
  • Slide 50
  • Slide 51
  • Slide 52
  • Slide 53
  • Slide 54
  • Slide 55
  • Slide 56
  • Slide 57
  • Slide 58
  • Slide 59
  • Slide 60
  • Slide 61
  • Slide 62
  • Slide 63
  • Slide 64
  • Slide 65
  • Slide 66
  • Slide 67
  • Slide 68
  • Slide 69
  • Slide 70
  • Slide 71
  • Slide 72
  • Slide 73
  • Slide 74
  • Slide 75
  • Slide 76
  • Slide 77
  • Slide 78
  • Slide 79
  • Slide 80
  • Slide 81
  • Slide 82
  • Slide 83
  • Slide 84
  • Slide 85
  • Slide 86
  • Slide 87
  • Slide 88
  • Slide 89
  • Slide 90
  • Slide 91
  • Slide 92
  • Slide 93
  • Slide 94
  • Slide 95
  • Slide 96
  • Slide 97
  • Slide 98
  • Slide 99
  • Slide 100
  • Slide 101
  • Slide 102
  • Slide 103
  • Slide 104
  • Slide 105
  • Slide 106
  • Slide 107
  • Slide 108
  • Slide 109
  • Slide 110
  • Slide 111
  • Slide 112
  • Slide 113
  • Slide 114
  • Slide 115
  • Slide 116
  • Slide 117
  • Slide 118
Page 54: TUTORIAL Ethernet PLC's Improve Oxygen Consumption ISA Expo/2001Houston, Texas Water & Wastewater Industry DivisionTuesday, September 11, 2001 1 Brad.

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 54

IO Map

On-Line PLC Diagnostics

PLC Status

PLC Simulator

Ethernet (TCPIP) Address

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 55

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 56

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 57

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 58

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 59

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 60

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 61

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 62

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 63

Structured Text was used hereNOT Ladder

Programming for Motors

The PLC DOES NOT CAREStructured Text Functions EXACTLY

the same as LadderUse what yoursquore comfortable with

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 64

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 65

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 66

IEC Function Blocks Used Here

Programming for Analogs amp PID

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 67

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 68

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 69

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 70

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 71

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 72

Sequential Function Charts were used here

Higher-Level Control

bull SFCrsquos lend themselves well to (as the name would imply) sequential processes

bull Three Important components in SFCrsquosbull Transitionsbull Stepsbull Jumps

bull The status of the process can be viewed as a flow chart

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 73

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 74

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 75

PLC - HMI Communication

A ldquoPLC Heartbeatrdquo is traditionally used to monitor the PLC - HMI Communication sometimes called ardquoWatchdog Timerrdquo

Call it whatever you want but the PLC amp 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 ldquodiesrdquo then that switch doesnrsquot change state and an alarm alerts the operator

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 76

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 77

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 78

TUTORIAL

Part 2B

HMI Programming

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 79

Ethernet (TCPIP) IO Driver

The Ethernet (TCPIP) IO Driver allows the HMI to communicate with the PLC (In this case the driver is called MBENETEXE)

The PLC has an ethernet module in one of the slots that has a ldquoCAT5RJ-45rdquo 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 ldquoCAT5RJ-45rdquo receptacle for the ethernet cable

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 80

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 81

Operator Screens amp Popup Displays

The display is laid out in 3 sections

bull Upper - Security amp Alarm Windowbull Middle- Main Operator Screens bull Lower - Menu amp Popup Displays

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 82

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 83

Scripting

There are 6 types of ldquoScriptsrdquobull Application Scriptsbull Key Scriptsbull Condition Scriptsbull Data Change Scriptsbull Quick Function Scriptsbull ActiveX Event Scripts

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 84

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 85

Access Names

The ldquoAccess Namesrdquo Must be configured to allow the PLC - HMI communications

Note that the ldquoApplicationTopicrdquo is the same as the IO Driver

The ldquocomputer namerdquo is the name of the PC that the HMI is running on (brad_s_carlberg in this case)

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 86

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 87

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 88

Indirect Tags

ldquoIndirect Tagsrdquo were used here to minimize the number of popup displays

This is especially useful in HMIrsquos with many tags

ONLY 12 popup displays are reused throughout the HMI

This gives the HMI a ldquoDCS-Likerdquo Look amp Feel

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 89

Popup Display TypesThe tag point type determines which popup display to use

Analog InputHIC (or Analog Output)PID (or Analog Composite)

bull PID WITH AUTO amp CASCADE amp RATIObull PID WITH AUTO amp RATIO

Diginbull Motor Status

DigOutMotor (or Digital Composite)

bull Motor with ILock and PermNumericSet TimersAlarm DetailAlarm Tags

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 90

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 91

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 92

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 93

Bars Buttons amp Sliders

By choosing to use indirect tags we complicate the Bar Graphs Buttons amp Sliders in the popup displays

Different scales need to be used for different engineering unit ranges

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 94

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 95

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 96

Popup Displays

The next two pages shows how the individual popup displays use the indirect tags

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 97

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 98

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 99

Adding a ldquoTouch Targetrdquo to a Display

2 Tell which tags to use

3 Tell which popup display to call upWhat kind of point type is it

3 Steps1 Tell which scale to use (if itrsquos an analog point type)

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 100

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 101

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 102

TUTORIAL

Part 2C

Excel Spreadsheets

amp

Visual Basic

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 103

A ldquoCHEAP amp DIRTYrdquo HMI With Excel

The 4 key parameters are

To communicate with the PLCUse brad_s_carlbergmbenet|ANOXIC_OXICrsquoplcregisterrsquo

Excel uses ldquopeeksrdquo amp ldquopokesrdquo to read from amp write to a PLC or HMI

To communicate with the HMIbrad_s_carlbergview|Tagnamersquotagnamersquo

bull computer namebull applicationbull topicbull item

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 104

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 105

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 106

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 107

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 108

Excel Macros

bull ldquoRequestrdquo Macro to read values

bull ldquoPokerdquo Macro to write values

bull A Sample Excel Macro

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 109

Sub PokeMacro()MsgBox ApplicationNetworkTemplatesPathChannel = ApplicationDDEInitiate(app=brad_s_carlbergVIEW topic=Tagname) This opens a DDE channel to ViewApplicationDDEPoke Channel Temperature1 Worksheets(Sheet1)Range(A1) Puts value from R1C1 into Temperature1ApplicationDDEPoke Channel DDEReal Worksheets(Sheet1)Range(A2) Puts value from R1C1 into Temperature1ApplicationDDEPoke Channel DDEInteger Worksheets(Sheet1)Range(A3) Puts value from R1C1 into Temperature1ApplicationDDETerminate Channel This terminates the DDE channelEnd SubSub RequestMacro()Channel = ApplicationDDEInitiate(app=brad_s_carlbergVIEW topic=Tagname) This opens a DDE channel to ViewWorksheets(Sheet1)Range(C4) = ApplicationDDERequest(Channel $Hour)Worksheets(Sheet1)Range(C5) = ApplicationDDERequest(Channel $Minute)Worksheets(Sheet1)Range(C6) = ApplicationDDERequest(Channel $Second)Worksheets(Sheet1)Range(C9) = ApplicationDDERequest(Channel $day)Worksheets(Sheet1)Range(C10) = ApplicationDDERequest(Channel $date)Worksheets(Sheet1)Range(C11) = ApplicationDDERequest(Channel $datestring)Worksheets(Sheet1)Range(C12) = ApplicationDDERequest(Channel $datetime)Worksheets(Sheet1)Range(C13) = ApplicationDDERequest(Channel $date)Worksheets(Sheet1)Range(C14) = ApplicationDDERequest(Channel $month)Worksheets(Sheet1)Range(C15) = ApplicationDDERequest(Channel $year)Worksheets(Sheet1)Range(C16) = ApplicationDDERequest(Channel $time)Worksheets(Sheet1)Range(C17) = ApplicationDDERequest(Channel $timestring)Worksheets(Sheet1)Range(C18) = ApplicationDDERequest(Channel $applicationversion)Worksheets(Sheet1)Range(C19) = ApplicationDDERequest(Channel $startddeconversations)Worksheets(Sheet1)Range(C20) = ApplicationDDERequest(Channel $accesslevel)Worksheets(Sheet1)Range(C21) = ApplicationDDERequest(Channel $alarmlogging)Worksheets(Sheet1)Range(C22) = ApplicationDDERequest(Channel $applicationchanged)Worksheets(Sheet1)Range(C23) = ApplicationDDERequest(Channel $configureusers)Worksheets(Sheet1)Range(C24) = ApplicationDDERequest(Channel $changepassword)Worksheets(Sheet1)Range(C25) = ApplicationDDERequest(Channel $InactivityTimeout)Worksheets(Sheet1)Range(C26) = ApplicationDDERequest(Channel $InactivityWarning)Worksheets(Sheet1)Range(C27) = ApplicationDDERequest(Channel $LogicRunning)Worksheets(Sheet1)Range(C28) = ApplicationDDERequest(Channel $OperatorEntered)Worksheets(Sheet1)Range(C29) = ApplicationDDERequest(Channel $Operator)Worksheets(Sheet1)Range(C30) = ApplicationDDERequest(Channel $PasswordEntered)ApplicationDDETerminate Channel This terminates the DDE channelEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 110

Visual Basic

ldquoRoll Your Ownrdquo HMI - Much More powerful than Excel

Key Parameters computer nameapplication|topicitem

IO Emulator - MBPlusSimulateexe

Can ldquoRead Fromrdquo amp ldquoWrite Tordquo PLC andor HMI

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 111

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 112

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 113

Dim PauseTime Start Finish TotalTime As Integer Declare variables

Private Sub txtAIT_332A_SCALED_Change()On Error GoTo PokeAIT_332AErrortxtAIT_332A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtAIT_332A_SCALEDText = Int((3 Rnd) + 20) Generate random value between 20 and 23txtAIT_332A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtAIT_332A_SCALEDLinkItem = AIT_332A_SCALEDtxtAIT_332A_SCALEDLinkMode = 2txtAIT_332A_SCALEDLinkPoketxtAIT_332A_SCALEDLinkMode = 0 DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total time

PokeAIT_332AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtAIT_332A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 114

Private Sub txtAIT_346A_SCALED_Change()On Error GoTo PokeAIT_346AErrortxtAIT_346A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtAIT_346A_SCALEDText = Int((3 Rnd) + 15) Generate random value between 15 and 18txtAIT_346A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtAIT_346A_SCALEDLinkItem = AIT_346A_SCALEDtxtAIT_346A_SCALEDLinkMode = 2txtAIT_346A_SCALEDLinkPoketxtAIT_346A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeAIT_346AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtAIT_346A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 115

Private Sub txtFIT_321A_SCALED_Change()On Error GoTo PokeFIT_321AErrortxtFIT_321A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtFIT_321A_SCALEDText = Int((10 Rnd) + 120) Generate random value between 120 and 130txtFIT_321A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_321A_SCALEDLinkItem = FIT_321A_SCALEDtxtFIT_321A_SCALEDLinkMode = 2txtFIT_321A_SCALEDLinkPoketxtFIT_321A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total time

PokeFIT_321AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_321A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume Next

End Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 116

Private Sub txtFIT_341A_SCALED_Change()On Error GoTo PokeFIT_341AErrortxtFIT_341A_SCALEDLinkMode = 0 PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTime

txtFIT_341A_SCALEDText = Int((3 Rnd) + 18) Generate random value between 18 and 21

txtFIT_341A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_341A_SCALEDLinkItem = FIT_341A_SCALEDtxtFIT_341A_SCALEDLinkMode = 2txtFIT_341A_SCALEDLinkPoketxtFIT_341A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeFIT_341AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_341A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 117

Private Sub txtFIT_343A_SCALED_Change()On Error GoTo PokeFIT_343AErrortxtFIT_343A_SCALEDLinkMode = 0 PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTime

txtFIT_343A_SCALEDText = Int((1 Rnd) + 3) Generate random value between 3 and 4

txtFIT_343A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_343A_SCALEDLinkItem = FIT_343A_SCALEDtxtFIT_343A_SCALEDLinkMode = 2txtFIT_343A_SCALEDLinkPoketxtFIT_343A_SCALEDLinkMode = 0 DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeFIT_343AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_343A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 118

TUTORIAL

Part 4

Questions

amp

Answers

  • Slide 1
  • Slide 2
  • Slide 3
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Slide 8
  • Slide 9
  • Slide 10
  • Slide 11
  • Slide 12
  • Slide 13
  • Slide 14
  • Slide 15
  • Slide 16
  • Slide 17
  • Slide 18
  • Slide 19
  • Slide 20
  • Slide 21
  • Slide 22
  • Slide 23
  • Slide 24
  • Slide 25
  • Slide 26
  • Slide 27
  • Slide 28
  • Slide 29
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
  • Slide 34
  • Slide 35
  • Slide 36
  • Slide 37
  • Slide 38
  • Slide 39
  • Slide 40
  • Slide 41
  • Slide 42
  • Slide 43
  • Slide 44
  • Slide 45
  • Slide 46
  • Slide 47
  • Slide 48
  • Slide 49
  • Slide 50
  • Slide 51
  • Slide 52
  • Slide 53
  • Slide 54
  • Slide 55
  • Slide 56
  • Slide 57
  • Slide 58
  • Slide 59
  • Slide 60
  • Slide 61
  • Slide 62
  • Slide 63
  • Slide 64
  • Slide 65
  • Slide 66
  • Slide 67
  • Slide 68
  • Slide 69
  • Slide 70
  • Slide 71
  • Slide 72
  • Slide 73
  • Slide 74
  • Slide 75
  • Slide 76
  • Slide 77
  • Slide 78
  • Slide 79
  • Slide 80
  • Slide 81
  • Slide 82
  • Slide 83
  • Slide 84
  • Slide 85
  • Slide 86
  • Slide 87
  • Slide 88
  • Slide 89
  • Slide 90
  • Slide 91
  • Slide 92
  • Slide 93
  • Slide 94
  • Slide 95
  • Slide 96
  • Slide 97
  • Slide 98
  • Slide 99
  • Slide 100
  • Slide 101
  • Slide 102
  • Slide 103
  • Slide 104
  • Slide 105
  • Slide 106
  • Slide 107
  • Slide 108
  • Slide 109
  • Slide 110
  • Slide 111
  • Slide 112
  • Slide 113
  • Slide 114
  • Slide 115
  • Slide 116
  • Slide 117
  • Slide 118
Page 55: TUTORIAL Ethernet PLC's Improve Oxygen Consumption ISA Expo/2001Houston, Texas Water & Wastewater Industry DivisionTuesday, September 11, 2001 1 Brad.

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 55

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 56

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 57

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 58

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 59

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 60

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 61

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 62

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 63

Structured Text was used hereNOT Ladder

Programming for Motors

The PLC DOES NOT CAREStructured Text Functions EXACTLY

the same as LadderUse what yoursquore comfortable with

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 64

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 65

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 66

IEC Function Blocks Used Here

Programming for Analogs amp PID

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 67

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 68

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 69

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 70

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 71

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 72

Sequential Function Charts were used here

Higher-Level Control

bull SFCrsquos lend themselves well to (as the name would imply) sequential processes

bull Three Important components in SFCrsquosbull Transitionsbull Stepsbull Jumps

bull The status of the process can be viewed as a flow chart

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 73

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 74

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 75

PLC - HMI Communication

A ldquoPLC Heartbeatrdquo is traditionally used to monitor the PLC - HMI Communication sometimes called ardquoWatchdog Timerrdquo

Call it whatever you want but the PLC amp 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 ldquodiesrdquo then that switch doesnrsquot change state and an alarm alerts the operator

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 76

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 77

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 78

TUTORIAL

Part 2B

HMI Programming

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 79

Ethernet (TCPIP) IO Driver

The Ethernet (TCPIP) IO Driver allows the HMI to communicate with the PLC (In this case the driver is called MBENETEXE)

The PLC has an ethernet module in one of the slots that has a ldquoCAT5RJ-45rdquo 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 ldquoCAT5RJ-45rdquo receptacle for the ethernet cable

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 80

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 81

Operator Screens amp Popup Displays

The display is laid out in 3 sections

bull Upper - Security amp Alarm Windowbull Middle- Main Operator Screens bull Lower - Menu amp Popup Displays

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 82

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 83

Scripting

There are 6 types of ldquoScriptsrdquobull Application Scriptsbull Key Scriptsbull Condition Scriptsbull Data Change Scriptsbull Quick Function Scriptsbull ActiveX Event Scripts

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 84

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 85

Access Names

The ldquoAccess Namesrdquo Must be configured to allow the PLC - HMI communications

Note that the ldquoApplicationTopicrdquo is the same as the IO Driver

The ldquocomputer namerdquo is the name of the PC that the HMI is running on (brad_s_carlberg in this case)

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 86

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 87

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 88

Indirect Tags

ldquoIndirect Tagsrdquo were used here to minimize the number of popup displays

This is especially useful in HMIrsquos with many tags

ONLY 12 popup displays are reused throughout the HMI

This gives the HMI a ldquoDCS-Likerdquo Look amp Feel

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 89

Popup Display TypesThe tag point type determines which popup display to use

Analog InputHIC (or Analog Output)PID (or Analog Composite)

bull PID WITH AUTO amp CASCADE amp RATIObull PID WITH AUTO amp RATIO

Diginbull Motor Status

DigOutMotor (or Digital Composite)

bull Motor with ILock and PermNumericSet TimersAlarm DetailAlarm Tags

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 90

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 91

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 92

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 93

Bars Buttons amp Sliders

By choosing to use indirect tags we complicate the Bar Graphs Buttons amp Sliders in the popup displays

Different scales need to be used for different engineering unit ranges

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 94

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 95

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 96

Popup Displays

The next two pages shows how the individual popup displays use the indirect tags

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 97

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 98

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 99

Adding a ldquoTouch Targetrdquo to a Display

2 Tell which tags to use

3 Tell which popup display to call upWhat kind of point type is it

3 Steps1 Tell which scale to use (if itrsquos an analog point type)

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 100

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 101

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 102

TUTORIAL

Part 2C

Excel Spreadsheets

amp

Visual Basic

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 103

A ldquoCHEAP amp DIRTYrdquo HMI With Excel

The 4 key parameters are

To communicate with the PLCUse brad_s_carlbergmbenet|ANOXIC_OXICrsquoplcregisterrsquo

Excel uses ldquopeeksrdquo amp ldquopokesrdquo to read from amp write to a PLC or HMI

To communicate with the HMIbrad_s_carlbergview|Tagnamersquotagnamersquo

bull computer namebull applicationbull topicbull item

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 104

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 105

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 106

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 107

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 108

Excel Macros

bull ldquoRequestrdquo Macro to read values

bull ldquoPokerdquo Macro to write values

bull A Sample Excel Macro

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 109

Sub PokeMacro()MsgBox ApplicationNetworkTemplatesPathChannel = ApplicationDDEInitiate(app=brad_s_carlbergVIEW topic=Tagname) This opens a DDE channel to ViewApplicationDDEPoke Channel Temperature1 Worksheets(Sheet1)Range(A1) Puts value from R1C1 into Temperature1ApplicationDDEPoke Channel DDEReal Worksheets(Sheet1)Range(A2) Puts value from R1C1 into Temperature1ApplicationDDEPoke Channel DDEInteger Worksheets(Sheet1)Range(A3) Puts value from R1C1 into Temperature1ApplicationDDETerminate Channel This terminates the DDE channelEnd SubSub RequestMacro()Channel = ApplicationDDEInitiate(app=brad_s_carlbergVIEW topic=Tagname) This opens a DDE channel to ViewWorksheets(Sheet1)Range(C4) = ApplicationDDERequest(Channel $Hour)Worksheets(Sheet1)Range(C5) = ApplicationDDERequest(Channel $Minute)Worksheets(Sheet1)Range(C6) = ApplicationDDERequest(Channel $Second)Worksheets(Sheet1)Range(C9) = ApplicationDDERequest(Channel $day)Worksheets(Sheet1)Range(C10) = ApplicationDDERequest(Channel $date)Worksheets(Sheet1)Range(C11) = ApplicationDDERequest(Channel $datestring)Worksheets(Sheet1)Range(C12) = ApplicationDDERequest(Channel $datetime)Worksheets(Sheet1)Range(C13) = ApplicationDDERequest(Channel $date)Worksheets(Sheet1)Range(C14) = ApplicationDDERequest(Channel $month)Worksheets(Sheet1)Range(C15) = ApplicationDDERequest(Channel $year)Worksheets(Sheet1)Range(C16) = ApplicationDDERequest(Channel $time)Worksheets(Sheet1)Range(C17) = ApplicationDDERequest(Channel $timestring)Worksheets(Sheet1)Range(C18) = ApplicationDDERequest(Channel $applicationversion)Worksheets(Sheet1)Range(C19) = ApplicationDDERequest(Channel $startddeconversations)Worksheets(Sheet1)Range(C20) = ApplicationDDERequest(Channel $accesslevel)Worksheets(Sheet1)Range(C21) = ApplicationDDERequest(Channel $alarmlogging)Worksheets(Sheet1)Range(C22) = ApplicationDDERequest(Channel $applicationchanged)Worksheets(Sheet1)Range(C23) = ApplicationDDERequest(Channel $configureusers)Worksheets(Sheet1)Range(C24) = ApplicationDDERequest(Channel $changepassword)Worksheets(Sheet1)Range(C25) = ApplicationDDERequest(Channel $InactivityTimeout)Worksheets(Sheet1)Range(C26) = ApplicationDDERequest(Channel $InactivityWarning)Worksheets(Sheet1)Range(C27) = ApplicationDDERequest(Channel $LogicRunning)Worksheets(Sheet1)Range(C28) = ApplicationDDERequest(Channel $OperatorEntered)Worksheets(Sheet1)Range(C29) = ApplicationDDERequest(Channel $Operator)Worksheets(Sheet1)Range(C30) = ApplicationDDERequest(Channel $PasswordEntered)ApplicationDDETerminate Channel This terminates the DDE channelEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 110

Visual Basic

ldquoRoll Your Ownrdquo HMI - Much More powerful than Excel

Key Parameters computer nameapplication|topicitem

IO Emulator - MBPlusSimulateexe

Can ldquoRead Fromrdquo amp ldquoWrite Tordquo PLC andor HMI

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 111

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 112

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 113

Dim PauseTime Start Finish TotalTime As Integer Declare variables

Private Sub txtAIT_332A_SCALED_Change()On Error GoTo PokeAIT_332AErrortxtAIT_332A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtAIT_332A_SCALEDText = Int((3 Rnd) + 20) Generate random value between 20 and 23txtAIT_332A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtAIT_332A_SCALEDLinkItem = AIT_332A_SCALEDtxtAIT_332A_SCALEDLinkMode = 2txtAIT_332A_SCALEDLinkPoketxtAIT_332A_SCALEDLinkMode = 0 DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total time

PokeAIT_332AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtAIT_332A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 114

Private Sub txtAIT_346A_SCALED_Change()On Error GoTo PokeAIT_346AErrortxtAIT_346A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtAIT_346A_SCALEDText = Int((3 Rnd) + 15) Generate random value between 15 and 18txtAIT_346A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtAIT_346A_SCALEDLinkItem = AIT_346A_SCALEDtxtAIT_346A_SCALEDLinkMode = 2txtAIT_346A_SCALEDLinkPoketxtAIT_346A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeAIT_346AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtAIT_346A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 115

Private Sub txtFIT_321A_SCALED_Change()On Error GoTo PokeFIT_321AErrortxtFIT_321A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtFIT_321A_SCALEDText = Int((10 Rnd) + 120) Generate random value between 120 and 130txtFIT_321A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_321A_SCALEDLinkItem = FIT_321A_SCALEDtxtFIT_321A_SCALEDLinkMode = 2txtFIT_321A_SCALEDLinkPoketxtFIT_321A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total time

PokeFIT_321AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_321A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume Next

End Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 116

Private Sub txtFIT_341A_SCALED_Change()On Error GoTo PokeFIT_341AErrortxtFIT_341A_SCALEDLinkMode = 0 PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTime

txtFIT_341A_SCALEDText = Int((3 Rnd) + 18) Generate random value between 18 and 21

txtFIT_341A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_341A_SCALEDLinkItem = FIT_341A_SCALEDtxtFIT_341A_SCALEDLinkMode = 2txtFIT_341A_SCALEDLinkPoketxtFIT_341A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeFIT_341AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_341A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 117

Private Sub txtFIT_343A_SCALED_Change()On Error GoTo PokeFIT_343AErrortxtFIT_343A_SCALEDLinkMode = 0 PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTime

txtFIT_343A_SCALEDText = Int((1 Rnd) + 3) Generate random value between 3 and 4

txtFIT_343A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_343A_SCALEDLinkItem = FIT_343A_SCALEDtxtFIT_343A_SCALEDLinkMode = 2txtFIT_343A_SCALEDLinkPoketxtFIT_343A_SCALEDLinkMode = 0 DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeFIT_343AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_343A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 118

TUTORIAL

Part 4

Questions

amp

Answers

  • Slide 1
  • Slide 2
  • Slide 3
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Slide 8
  • Slide 9
  • Slide 10
  • Slide 11
  • Slide 12
  • Slide 13
  • Slide 14
  • Slide 15
  • Slide 16
  • Slide 17
  • Slide 18
  • Slide 19
  • Slide 20
  • Slide 21
  • Slide 22
  • Slide 23
  • Slide 24
  • Slide 25
  • Slide 26
  • Slide 27
  • Slide 28
  • Slide 29
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
  • Slide 34
  • Slide 35
  • Slide 36
  • Slide 37
  • Slide 38
  • Slide 39
  • Slide 40
  • Slide 41
  • Slide 42
  • Slide 43
  • Slide 44
  • Slide 45
  • Slide 46
  • Slide 47
  • Slide 48
  • Slide 49
  • Slide 50
  • Slide 51
  • Slide 52
  • Slide 53
  • Slide 54
  • Slide 55
  • Slide 56
  • Slide 57
  • Slide 58
  • Slide 59
  • Slide 60
  • Slide 61
  • Slide 62
  • Slide 63
  • Slide 64
  • Slide 65
  • Slide 66
  • Slide 67
  • Slide 68
  • Slide 69
  • Slide 70
  • Slide 71
  • Slide 72
  • Slide 73
  • Slide 74
  • Slide 75
  • Slide 76
  • Slide 77
  • Slide 78
  • Slide 79
  • Slide 80
  • Slide 81
  • Slide 82
  • Slide 83
  • Slide 84
  • Slide 85
  • Slide 86
  • Slide 87
  • Slide 88
  • Slide 89
  • Slide 90
  • Slide 91
  • Slide 92
  • Slide 93
  • Slide 94
  • Slide 95
  • Slide 96
  • Slide 97
  • Slide 98
  • Slide 99
  • Slide 100
  • Slide 101
  • Slide 102
  • Slide 103
  • Slide 104
  • Slide 105
  • Slide 106
  • Slide 107
  • Slide 108
  • Slide 109
  • Slide 110
  • Slide 111
  • Slide 112
  • Slide 113
  • Slide 114
  • Slide 115
  • Slide 116
  • Slide 117
  • Slide 118
Page 56: TUTORIAL Ethernet PLC's Improve Oxygen Consumption ISA Expo/2001Houston, Texas Water & Wastewater Industry DivisionTuesday, September 11, 2001 1 Brad.

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 56

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 57

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 58

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 59

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 60

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 61

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 62

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 63

Structured Text was used hereNOT Ladder

Programming for Motors

The PLC DOES NOT CAREStructured Text Functions EXACTLY

the same as LadderUse what yoursquore comfortable with

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 64

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 65

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 66

IEC Function Blocks Used Here

Programming for Analogs amp PID

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 67

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 68

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 69

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 70

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 71

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 72

Sequential Function Charts were used here

Higher-Level Control

bull SFCrsquos lend themselves well to (as the name would imply) sequential processes

bull Three Important components in SFCrsquosbull Transitionsbull Stepsbull Jumps

bull The status of the process can be viewed as a flow chart

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 73

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 74

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 75

PLC - HMI Communication

A ldquoPLC Heartbeatrdquo is traditionally used to monitor the PLC - HMI Communication sometimes called ardquoWatchdog Timerrdquo

Call it whatever you want but the PLC amp 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 ldquodiesrdquo then that switch doesnrsquot change state and an alarm alerts the operator

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 76

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 77

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 78

TUTORIAL

Part 2B

HMI Programming

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 79

Ethernet (TCPIP) IO Driver

The Ethernet (TCPIP) IO Driver allows the HMI to communicate with the PLC (In this case the driver is called MBENETEXE)

The PLC has an ethernet module in one of the slots that has a ldquoCAT5RJ-45rdquo 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 ldquoCAT5RJ-45rdquo receptacle for the ethernet cable

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 80

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 81

Operator Screens amp Popup Displays

The display is laid out in 3 sections

bull Upper - Security amp Alarm Windowbull Middle- Main Operator Screens bull Lower - Menu amp Popup Displays

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 82

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 83

Scripting

There are 6 types of ldquoScriptsrdquobull Application Scriptsbull Key Scriptsbull Condition Scriptsbull Data Change Scriptsbull Quick Function Scriptsbull ActiveX Event Scripts

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 84

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 85

Access Names

The ldquoAccess Namesrdquo Must be configured to allow the PLC - HMI communications

Note that the ldquoApplicationTopicrdquo is the same as the IO Driver

The ldquocomputer namerdquo is the name of the PC that the HMI is running on (brad_s_carlberg in this case)

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 86

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 87

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 88

Indirect Tags

ldquoIndirect Tagsrdquo were used here to minimize the number of popup displays

This is especially useful in HMIrsquos with many tags

ONLY 12 popup displays are reused throughout the HMI

This gives the HMI a ldquoDCS-Likerdquo Look amp Feel

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 89

Popup Display TypesThe tag point type determines which popup display to use

Analog InputHIC (or Analog Output)PID (or Analog Composite)

bull PID WITH AUTO amp CASCADE amp RATIObull PID WITH AUTO amp RATIO

Diginbull Motor Status

DigOutMotor (or Digital Composite)

bull Motor with ILock and PermNumericSet TimersAlarm DetailAlarm Tags

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 90

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 91

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 92

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 93

Bars Buttons amp Sliders

By choosing to use indirect tags we complicate the Bar Graphs Buttons amp Sliders in the popup displays

Different scales need to be used for different engineering unit ranges

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 94

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 95

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 96

Popup Displays

The next two pages shows how the individual popup displays use the indirect tags

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 97

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 98

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 99

Adding a ldquoTouch Targetrdquo to a Display

2 Tell which tags to use

3 Tell which popup display to call upWhat kind of point type is it

3 Steps1 Tell which scale to use (if itrsquos an analog point type)

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 100

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 101

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 102

TUTORIAL

Part 2C

Excel Spreadsheets

amp

Visual Basic

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 103

A ldquoCHEAP amp DIRTYrdquo HMI With Excel

The 4 key parameters are

To communicate with the PLCUse brad_s_carlbergmbenet|ANOXIC_OXICrsquoplcregisterrsquo

Excel uses ldquopeeksrdquo amp ldquopokesrdquo to read from amp write to a PLC or HMI

To communicate with the HMIbrad_s_carlbergview|Tagnamersquotagnamersquo

bull computer namebull applicationbull topicbull item

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 104

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 105

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 106

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 107

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 108

Excel Macros

bull ldquoRequestrdquo Macro to read values

bull ldquoPokerdquo Macro to write values

bull A Sample Excel Macro

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 109

Sub PokeMacro()MsgBox ApplicationNetworkTemplatesPathChannel = ApplicationDDEInitiate(app=brad_s_carlbergVIEW topic=Tagname) This opens a DDE channel to ViewApplicationDDEPoke Channel Temperature1 Worksheets(Sheet1)Range(A1) Puts value from R1C1 into Temperature1ApplicationDDEPoke Channel DDEReal Worksheets(Sheet1)Range(A2) Puts value from R1C1 into Temperature1ApplicationDDEPoke Channel DDEInteger Worksheets(Sheet1)Range(A3) Puts value from R1C1 into Temperature1ApplicationDDETerminate Channel This terminates the DDE channelEnd SubSub RequestMacro()Channel = ApplicationDDEInitiate(app=brad_s_carlbergVIEW topic=Tagname) This opens a DDE channel to ViewWorksheets(Sheet1)Range(C4) = ApplicationDDERequest(Channel $Hour)Worksheets(Sheet1)Range(C5) = ApplicationDDERequest(Channel $Minute)Worksheets(Sheet1)Range(C6) = ApplicationDDERequest(Channel $Second)Worksheets(Sheet1)Range(C9) = ApplicationDDERequest(Channel $day)Worksheets(Sheet1)Range(C10) = ApplicationDDERequest(Channel $date)Worksheets(Sheet1)Range(C11) = ApplicationDDERequest(Channel $datestring)Worksheets(Sheet1)Range(C12) = ApplicationDDERequest(Channel $datetime)Worksheets(Sheet1)Range(C13) = ApplicationDDERequest(Channel $date)Worksheets(Sheet1)Range(C14) = ApplicationDDERequest(Channel $month)Worksheets(Sheet1)Range(C15) = ApplicationDDERequest(Channel $year)Worksheets(Sheet1)Range(C16) = ApplicationDDERequest(Channel $time)Worksheets(Sheet1)Range(C17) = ApplicationDDERequest(Channel $timestring)Worksheets(Sheet1)Range(C18) = ApplicationDDERequest(Channel $applicationversion)Worksheets(Sheet1)Range(C19) = ApplicationDDERequest(Channel $startddeconversations)Worksheets(Sheet1)Range(C20) = ApplicationDDERequest(Channel $accesslevel)Worksheets(Sheet1)Range(C21) = ApplicationDDERequest(Channel $alarmlogging)Worksheets(Sheet1)Range(C22) = ApplicationDDERequest(Channel $applicationchanged)Worksheets(Sheet1)Range(C23) = ApplicationDDERequest(Channel $configureusers)Worksheets(Sheet1)Range(C24) = ApplicationDDERequest(Channel $changepassword)Worksheets(Sheet1)Range(C25) = ApplicationDDERequest(Channel $InactivityTimeout)Worksheets(Sheet1)Range(C26) = ApplicationDDERequest(Channel $InactivityWarning)Worksheets(Sheet1)Range(C27) = ApplicationDDERequest(Channel $LogicRunning)Worksheets(Sheet1)Range(C28) = ApplicationDDERequest(Channel $OperatorEntered)Worksheets(Sheet1)Range(C29) = ApplicationDDERequest(Channel $Operator)Worksheets(Sheet1)Range(C30) = ApplicationDDERequest(Channel $PasswordEntered)ApplicationDDETerminate Channel This terminates the DDE channelEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 110

Visual Basic

ldquoRoll Your Ownrdquo HMI - Much More powerful than Excel

Key Parameters computer nameapplication|topicitem

IO Emulator - MBPlusSimulateexe

Can ldquoRead Fromrdquo amp ldquoWrite Tordquo PLC andor HMI

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 111

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 112

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 113

Dim PauseTime Start Finish TotalTime As Integer Declare variables

Private Sub txtAIT_332A_SCALED_Change()On Error GoTo PokeAIT_332AErrortxtAIT_332A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtAIT_332A_SCALEDText = Int((3 Rnd) + 20) Generate random value between 20 and 23txtAIT_332A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtAIT_332A_SCALEDLinkItem = AIT_332A_SCALEDtxtAIT_332A_SCALEDLinkMode = 2txtAIT_332A_SCALEDLinkPoketxtAIT_332A_SCALEDLinkMode = 0 DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total time

PokeAIT_332AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtAIT_332A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 114

Private Sub txtAIT_346A_SCALED_Change()On Error GoTo PokeAIT_346AErrortxtAIT_346A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtAIT_346A_SCALEDText = Int((3 Rnd) + 15) Generate random value between 15 and 18txtAIT_346A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtAIT_346A_SCALEDLinkItem = AIT_346A_SCALEDtxtAIT_346A_SCALEDLinkMode = 2txtAIT_346A_SCALEDLinkPoketxtAIT_346A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeAIT_346AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtAIT_346A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 115

Private Sub txtFIT_321A_SCALED_Change()On Error GoTo PokeFIT_321AErrortxtFIT_321A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtFIT_321A_SCALEDText = Int((10 Rnd) + 120) Generate random value between 120 and 130txtFIT_321A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_321A_SCALEDLinkItem = FIT_321A_SCALEDtxtFIT_321A_SCALEDLinkMode = 2txtFIT_321A_SCALEDLinkPoketxtFIT_321A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total time

PokeFIT_321AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_321A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume Next

End Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 116

Private Sub txtFIT_341A_SCALED_Change()On Error GoTo PokeFIT_341AErrortxtFIT_341A_SCALEDLinkMode = 0 PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTime

txtFIT_341A_SCALEDText = Int((3 Rnd) + 18) Generate random value between 18 and 21

txtFIT_341A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_341A_SCALEDLinkItem = FIT_341A_SCALEDtxtFIT_341A_SCALEDLinkMode = 2txtFIT_341A_SCALEDLinkPoketxtFIT_341A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeFIT_341AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_341A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 117

Private Sub txtFIT_343A_SCALED_Change()On Error GoTo PokeFIT_343AErrortxtFIT_343A_SCALEDLinkMode = 0 PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTime

txtFIT_343A_SCALEDText = Int((1 Rnd) + 3) Generate random value between 3 and 4

txtFIT_343A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_343A_SCALEDLinkItem = FIT_343A_SCALEDtxtFIT_343A_SCALEDLinkMode = 2txtFIT_343A_SCALEDLinkPoketxtFIT_343A_SCALEDLinkMode = 0 DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeFIT_343AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_343A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 118

TUTORIAL

Part 4

Questions

amp

Answers

  • Slide 1
  • Slide 2
  • Slide 3
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Slide 8
  • Slide 9
  • Slide 10
  • Slide 11
  • Slide 12
  • Slide 13
  • Slide 14
  • Slide 15
  • Slide 16
  • Slide 17
  • Slide 18
  • Slide 19
  • Slide 20
  • Slide 21
  • Slide 22
  • Slide 23
  • Slide 24
  • Slide 25
  • Slide 26
  • Slide 27
  • Slide 28
  • Slide 29
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
  • Slide 34
  • Slide 35
  • Slide 36
  • Slide 37
  • Slide 38
  • Slide 39
  • Slide 40
  • Slide 41
  • Slide 42
  • Slide 43
  • Slide 44
  • Slide 45
  • Slide 46
  • Slide 47
  • Slide 48
  • Slide 49
  • Slide 50
  • Slide 51
  • Slide 52
  • Slide 53
  • Slide 54
  • Slide 55
  • Slide 56
  • Slide 57
  • Slide 58
  • Slide 59
  • Slide 60
  • Slide 61
  • Slide 62
  • Slide 63
  • Slide 64
  • Slide 65
  • Slide 66
  • Slide 67
  • Slide 68
  • Slide 69
  • Slide 70
  • Slide 71
  • Slide 72
  • Slide 73
  • Slide 74
  • Slide 75
  • Slide 76
  • Slide 77
  • Slide 78
  • Slide 79
  • Slide 80
  • Slide 81
  • Slide 82
  • Slide 83
  • Slide 84
  • Slide 85
  • Slide 86
  • Slide 87
  • Slide 88
  • Slide 89
  • Slide 90
  • Slide 91
  • Slide 92
  • Slide 93
  • Slide 94
  • Slide 95
  • Slide 96
  • Slide 97
  • Slide 98
  • Slide 99
  • Slide 100
  • Slide 101
  • Slide 102
  • Slide 103
  • Slide 104
  • Slide 105
  • Slide 106
  • Slide 107
  • Slide 108
  • Slide 109
  • Slide 110
  • Slide 111
  • Slide 112
  • Slide 113
  • Slide 114
  • Slide 115
  • Slide 116
  • Slide 117
  • Slide 118
Page 57: TUTORIAL Ethernet PLC's Improve Oxygen Consumption ISA Expo/2001Houston, Texas Water & Wastewater Industry DivisionTuesday, September 11, 2001 1 Brad.

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 57

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 58

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 59

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 60

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 61

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 62

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 63

Structured Text was used hereNOT Ladder

Programming for Motors

The PLC DOES NOT CAREStructured Text Functions EXACTLY

the same as LadderUse what yoursquore comfortable with

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 64

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 65

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 66

IEC Function Blocks Used Here

Programming for Analogs amp PID

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 67

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 68

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 69

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 70

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 71

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 72

Sequential Function Charts were used here

Higher-Level Control

bull SFCrsquos lend themselves well to (as the name would imply) sequential processes

bull Three Important components in SFCrsquosbull Transitionsbull Stepsbull Jumps

bull The status of the process can be viewed as a flow chart

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 73

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 74

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 75

PLC - HMI Communication

A ldquoPLC Heartbeatrdquo is traditionally used to monitor the PLC - HMI Communication sometimes called ardquoWatchdog Timerrdquo

Call it whatever you want but the PLC amp 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 ldquodiesrdquo then that switch doesnrsquot change state and an alarm alerts the operator

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 76

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 77

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 78

TUTORIAL

Part 2B

HMI Programming

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 79

Ethernet (TCPIP) IO Driver

The Ethernet (TCPIP) IO Driver allows the HMI to communicate with the PLC (In this case the driver is called MBENETEXE)

The PLC has an ethernet module in one of the slots that has a ldquoCAT5RJ-45rdquo 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 ldquoCAT5RJ-45rdquo receptacle for the ethernet cable

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 80

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 81

Operator Screens amp Popup Displays

The display is laid out in 3 sections

bull Upper - Security amp Alarm Windowbull Middle- Main Operator Screens bull Lower - Menu amp Popup Displays

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 82

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 83

Scripting

There are 6 types of ldquoScriptsrdquobull Application Scriptsbull Key Scriptsbull Condition Scriptsbull Data Change Scriptsbull Quick Function Scriptsbull ActiveX Event Scripts

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 84

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 85

Access Names

The ldquoAccess Namesrdquo Must be configured to allow the PLC - HMI communications

Note that the ldquoApplicationTopicrdquo is the same as the IO Driver

The ldquocomputer namerdquo is the name of the PC that the HMI is running on (brad_s_carlberg in this case)

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 86

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 87

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 88

Indirect Tags

ldquoIndirect Tagsrdquo were used here to minimize the number of popup displays

This is especially useful in HMIrsquos with many tags

ONLY 12 popup displays are reused throughout the HMI

This gives the HMI a ldquoDCS-Likerdquo Look amp Feel

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 89

Popup Display TypesThe tag point type determines which popup display to use

Analog InputHIC (or Analog Output)PID (or Analog Composite)

bull PID WITH AUTO amp CASCADE amp RATIObull PID WITH AUTO amp RATIO

Diginbull Motor Status

DigOutMotor (or Digital Composite)

bull Motor with ILock and PermNumericSet TimersAlarm DetailAlarm Tags

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 90

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 91

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 92

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 93

Bars Buttons amp Sliders

By choosing to use indirect tags we complicate the Bar Graphs Buttons amp Sliders in the popup displays

Different scales need to be used for different engineering unit ranges

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 94

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 95

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 96

Popup Displays

The next two pages shows how the individual popup displays use the indirect tags

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 97

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 98

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 99

Adding a ldquoTouch Targetrdquo to a Display

2 Tell which tags to use

3 Tell which popup display to call upWhat kind of point type is it

3 Steps1 Tell which scale to use (if itrsquos an analog point type)

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 100

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 101

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 102

TUTORIAL

Part 2C

Excel Spreadsheets

amp

Visual Basic

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 103

A ldquoCHEAP amp DIRTYrdquo HMI With Excel

The 4 key parameters are

To communicate with the PLCUse brad_s_carlbergmbenet|ANOXIC_OXICrsquoplcregisterrsquo

Excel uses ldquopeeksrdquo amp ldquopokesrdquo to read from amp write to a PLC or HMI

To communicate with the HMIbrad_s_carlbergview|Tagnamersquotagnamersquo

bull computer namebull applicationbull topicbull item

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 104

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 105

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 106

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 107

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 108

Excel Macros

bull ldquoRequestrdquo Macro to read values

bull ldquoPokerdquo Macro to write values

bull A Sample Excel Macro

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 109

Sub PokeMacro()MsgBox ApplicationNetworkTemplatesPathChannel = ApplicationDDEInitiate(app=brad_s_carlbergVIEW topic=Tagname) This opens a DDE channel to ViewApplicationDDEPoke Channel Temperature1 Worksheets(Sheet1)Range(A1) Puts value from R1C1 into Temperature1ApplicationDDEPoke Channel DDEReal Worksheets(Sheet1)Range(A2) Puts value from R1C1 into Temperature1ApplicationDDEPoke Channel DDEInteger Worksheets(Sheet1)Range(A3) Puts value from R1C1 into Temperature1ApplicationDDETerminate Channel This terminates the DDE channelEnd SubSub RequestMacro()Channel = ApplicationDDEInitiate(app=brad_s_carlbergVIEW topic=Tagname) This opens a DDE channel to ViewWorksheets(Sheet1)Range(C4) = ApplicationDDERequest(Channel $Hour)Worksheets(Sheet1)Range(C5) = ApplicationDDERequest(Channel $Minute)Worksheets(Sheet1)Range(C6) = ApplicationDDERequest(Channel $Second)Worksheets(Sheet1)Range(C9) = ApplicationDDERequest(Channel $day)Worksheets(Sheet1)Range(C10) = ApplicationDDERequest(Channel $date)Worksheets(Sheet1)Range(C11) = ApplicationDDERequest(Channel $datestring)Worksheets(Sheet1)Range(C12) = ApplicationDDERequest(Channel $datetime)Worksheets(Sheet1)Range(C13) = ApplicationDDERequest(Channel $date)Worksheets(Sheet1)Range(C14) = ApplicationDDERequest(Channel $month)Worksheets(Sheet1)Range(C15) = ApplicationDDERequest(Channel $year)Worksheets(Sheet1)Range(C16) = ApplicationDDERequest(Channel $time)Worksheets(Sheet1)Range(C17) = ApplicationDDERequest(Channel $timestring)Worksheets(Sheet1)Range(C18) = ApplicationDDERequest(Channel $applicationversion)Worksheets(Sheet1)Range(C19) = ApplicationDDERequest(Channel $startddeconversations)Worksheets(Sheet1)Range(C20) = ApplicationDDERequest(Channel $accesslevel)Worksheets(Sheet1)Range(C21) = ApplicationDDERequest(Channel $alarmlogging)Worksheets(Sheet1)Range(C22) = ApplicationDDERequest(Channel $applicationchanged)Worksheets(Sheet1)Range(C23) = ApplicationDDERequest(Channel $configureusers)Worksheets(Sheet1)Range(C24) = ApplicationDDERequest(Channel $changepassword)Worksheets(Sheet1)Range(C25) = ApplicationDDERequest(Channel $InactivityTimeout)Worksheets(Sheet1)Range(C26) = ApplicationDDERequest(Channel $InactivityWarning)Worksheets(Sheet1)Range(C27) = ApplicationDDERequest(Channel $LogicRunning)Worksheets(Sheet1)Range(C28) = ApplicationDDERequest(Channel $OperatorEntered)Worksheets(Sheet1)Range(C29) = ApplicationDDERequest(Channel $Operator)Worksheets(Sheet1)Range(C30) = ApplicationDDERequest(Channel $PasswordEntered)ApplicationDDETerminate Channel This terminates the DDE channelEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 110

Visual Basic

ldquoRoll Your Ownrdquo HMI - Much More powerful than Excel

Key Parameters computer nameapplication|topicitem

IO Emulator - MBPlusSimulateexe

Can ldquoRead Fromrdquo amp ldquoWrite Tordquo PLC andor HMI

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 111

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 112

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 113

Dim PauseTime Start Finish TotalTime As Integer Declare variables

Private Sub txtAIT_332A_SCALED_Change()On Error GoTo PokeAIT_332AErrortxtAIT_332A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtAIT_332A_SCALEDText = Int((3 Rnd) + 20) Generate random value between 20 and 23txtAIT_332A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtAIT_332A_SCALEDLinkItem = AIT_332A_SCALEDtxtAIT_332A_SCALEDLinkMode = 2txtAIT_332A_SCALEDLinkPoketxtAIT_332A_SCALEDLinkMode = 0 DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total time

PokeAIT_332AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtAIT_332A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 114

Private Sub txtAIT_346A_SCALED_Change()On Error GoTo PokeAIT_346AErrortxtAIT_346A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtAIT_346A_SCALEDText = Int((3 Rnd) + 15) Generate random value between 15 and 18txtAIT_346A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtAIT_346A_SCALEDLinkItem = AIT_346A_SCALEDtxtAIT_346A_SCALEDLinkMode = 2txtAIT_346A_SCALEDLinkPoketxtAIT_346A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeAIT_346AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtAIT_346A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 115

Private Sub txtFIT_321A_SCALED_Change()On Error GoTo PokeFIT_321AErrortxtFIT_321A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtFIT_321A_SCALEDText = Int((10 Rnd) + 120) Generate random value between 120 and 130txtFIT_321A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_321A_SCALEDLinkItem = FIT_321A_SCALEDtxtFIT_321A_SCALEDLinkMode = 2txtFIT_321A_SCALEDLinkPoketxtFIT_321A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total time

PokeFIT_321AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_321A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume Next

End Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 116

Private Sub txtFIT_341A_SCALED_Change()On Error GoTo PokeFIT_341AErrortxtFIT_341A_SCALEDLinkMode = 0 PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTime

txtFIT_341A_SCALEDText = Int((3 Rnd) + 18) Generate random value between 18 and 21

txtFIT_341A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_341A_SCALEDLinkItem = FIT_341A_SCALEDtxtFIT_341A_SCALEDLinkMode = 2txtFIT_341A_SCALEDLinkPoketxtFIT_341A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeFIT_341AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_341A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 117

Private Sub txtFIT_343A_SCALED_Change()On Error GoTo PokeFIT_343AErrortxtFIT_343A_SCALEDLinkMode = 0 PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTime

txtFIT_343A_SCALEDText = Int((1 Rnd) + 3) Generate random value between 3 and 4

txtFIT_343A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_343A_SCALEDLinkItem = FIT_343A_SCALEDtxtFIT_343A_SCALEDLinkMode = 2txtFIT_343A_SCALEDLinkPoketxtFIT_343A_SCALEDLinkMode = 0 DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeFIT_343AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_343A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 118

TUTORIAL

Part 4

Questions

amp

Answers

  • Slide 1
  • Slide 2
  • Slide 3
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Slide 8
  • Slide 9
  • Slide 10
  • Slide 11
  • Slide 12
  • Slide 13
  • Slide 14
  • Slide 15
  • Slide 16
  • Slide 17
  • Slide 18
  • Slide 19
  • Slide 20
  • Slide 21
  • Slide 22
  • Slide 23
  • Slide 24
  • Slide 25
  • Slide 26
  • Slide 27
  • Slide 28
  • Slide 29
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
  • Slide 34
  • Slide 35
  • Slide 36
  • Slide 37
  • Slide 38
  • Slide 39
  • Slide 40
  • Slide 41
  • Slide 42
  • Slide 43
  • Slide 44
  • Slide 45
  • Slide 46
  • Slide 47
  • Slide 48
  • Slide 49
  • Slide 50
  • Slide 51
  • Slide 52
  • Slide 53
  • Slide 54
  • Slide 55
  • Slide 56
  • Slide 57
  • Slide 58
  • Slide 59
  • Slide 60
  • Slide 61
  • Slide 62
  • Slide 63
  • Slide 64
  • Slide 65
  • Slide 66
  • Slide 67
  • Slide 68
  • Slide 69
  • Slide 70
  • Slide 71
  • Slide 72
  • Slide 73
  • Slide 74
  • Slide 75
  • Slide 76
  • Slide 77
  • Slide 78
  • Slide 79
  • Slide 80
  • Slide 81
  • Slide 82
  • Slide 83
  • Slide 84
  • Slide 85
  • Slide 86
  • Slide 87
  • Slide 88
  • Slide 89
  • Slide 90
  • Slide 91
  • Slide 92
  • Slide 93
  • Slide 94
  • Slide 95
  • Slide 96
  • Slide 97
  • Slide 98
  • Slide 99
  • Slide 100
  • Slide 101
  • Slide 102
  • Slide 103
  • Slide 104
  • Slide 105
  • Slide 106
  • Slide 107
  • Slide 108
  • Slide 109
  • Slide 110
  • Slide 111
  • Slide 112
  • Slide 113
  • Slide 114
  • Slide 115
  • Slide 116
  • Slide 117
  • Slide 118
Page 58: TUTORIAL Ethernet PLC's Improve Oxygen Consumption ISA Expo/2001Houston, Texas Water & Wastewater Industry DivisionTuesday, September 11, 2001 1 Brad.

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 58

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 59

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 60

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 61

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 62

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 63

Structured Text was used hereNOT Ladder

Programming for Motors

The PLC DOES NOT CAREStructured Text Functions EXACTLY

the same as LadderUse what yoursquore comfortable with

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 64

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 65

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 66

IEC Function Blocks Used Here

Programming for Analogs amp PID

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 67

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 68

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 69

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 70

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 71

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 72

Sequential Function Charts were used here

Higher-Level Control

bull SFCrsquos lend themselves well to (as the name would imply) sequential processes

bull Three Important components in SFCrsquosbull Transitionsbull Stepsbull Jumps

bull The status of the process can be viewed as a flow chart

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 73

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 74

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 75

PLC - HMI Communication

A ldquoPLC Heartbeatrdquo is traditionally used to monitor the PLC - HMI Communication sometimes called ardquoWatchdog Timerrdquo

Call it whatever you want but the PLC amp 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 ldquodiesrdquo then that switch doesnrsquot change state and an alarm alerts the operator

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 76

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 77

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 78

TUTORIAL

Part 2B

HMI Programming

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 79

Ethernet (TCPIP) IO Driver

The Ethernet (TCPIP) IO Driver allows the HMI to communicate with the PLC (In this case the driver is called MBENETEXE)

The PLC has an ethernet module in one of the slots that has a ldquoCAT5RJ-45rdquo 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 ldquoCAT5RJ-45rdquo receptacle for the ethernet cable

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 80

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 81

Operator Screens amp Popup Displays

The display is laid out in 3 sections

bull Upper - Security amp Alarm Windowbull Middle- Main Operator Screens bull Lower - Menu amp Popup Displays

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 82

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 83

Scripting

There are 6 types of ldquoScriptsrdquobull Application Scriptsbull Key Scriptsbull Condition Scriptsbull Data Change Scriptsbull Quick Function Scriptsbull ActiveX Event Scripts

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 84

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 85

Access Names

The ldquoAccess Namesrdquo Must be configured to allow the PLC - HMI communications

Note that the ldquoApplicationTopicrdquo is the same as the IO Driver

The ldquocomputer namerdquo is the name of the PC that the HMI is running on (brad_s_carlberg in this case)

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 86

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 87

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 88

Indirect Tags

ldquoIndirect Tagsrdquo were used here to minimize the number of popup displays

This is especially useful in HMIrsquos with many tags

ONLY 12 popup displays are reused throughout the HMI

This gives the HMI a ldquoDCS-Likerdquo Look amp Feel

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 89

Popup Display TypesThe tag point type determines which popup display to use

Analog InputHIC (or Analog Output)PID (or Analog Composite)

bull PID WITH AUTO amp CASCADE amp RATIObull PID WITH AUTO amp RATIO

Diginbull Motor Status

DigOutMotor (or Digital Composite)

bull Motor with ILock and PermNumericSet TimersAlarm DetailAlarm Tags

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 90

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 91

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 92

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 93

Bars Buttons amp Sliders

By choosing to use indirect tags we complicate the Bar Graphs Buttons amp Sliders in the popup displays

Different scales need to be used for different engineering unit ranges

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 94

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 95

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 96

Popup Displays

The next two pages shows how the individual popup displays use the indirect tags

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 97

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 98

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 99

Adding a ldquoTouch Targetrdquo to a Display

2 Tell which tags to use

3 Tell which popup display to call upWhat kind of point type is it

3 Steps1 Tell which scale to use (if itrsquos an analog point type)

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 100

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 101

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 102

TUTORIAL

Part 2C

Excel Spreadsheets

amp

Visual Basic

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 103

A ldquoCHEAP amp DIRTYrdquo HMI With Excel

The 4 key parameters are

To communicate with the PLCUse brad_s_carlbergmbenet|ANOXIC_OXICrsquoplcregisterrsquo

Excel uses ldquopeeksrdquo amp ldquopokesrdquo to read from amp write to a PLC or HMI

To communicate with the HMIbrad_s_carlbergview|Tagnamersquotagnamersquo

bull computer namebull applicationbull topicbull item

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 104

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 105

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 106

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 107

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 108

Excel Macros

bull ldquoRequestrdquo Macro to read values

bull ldquoPokerdquo Macro to write values

bull A Sample Excel Macro

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 109

Sub PokeMacro()MsgBox ApplicationNetworkTemplatesPathChannel = ApplicationDDEInitiate(app=brad_s_carlbergVIEW topic=Tagname) This opens a DDE channel to ViewApplicationDDEPoke Channel Temperature1 Worksheets(Sheet1)Range(A1) Puts value from R1C1 into Temperature1ApplicationDDEPoke Channel DDEReal Worksheets(Sheet1)Range(A2) Puts value from R1C1 into Temperature1ApplicationDDEPoke Channel DDEInteger Worksheets(Sheet1)Range(A3) Puts value from R1C1 into Temperature1ApplicationDDETerminate Channel This terminates the DDE channelEnd SubSub RequestMacro()Channel = ApplicationDDEInitiate(app=brad_s_carlbergVIEW topic=Tagname) This opens a DDE channel to ViewWorksheets(Sheet1)Range(C4) = ApplicationDDERequest(Channel $Hour)Worksheets(Sheet1)Range(C5) = ApplicationDDERequest(Channel $Minute)Worksheets(Sheet1)Range(C6) = ApplicationDDERequest(Channel $Second)Worksheets(Sheet1)Range(C9) = ApplicationDDERequest(Channel $day)Worksheets(Sheet1)Range(C10) = ApplicationDDERequest(Channel $date)Worksheets(Sheet1)Range(C11) = ApplicationDDERequest(Channel $datestring)Worksheets(Sheet1)Range(C12) = ApplicationDDERequest(Channel $datetime)Worksheets(Sheet1)Range(C13) = ApplicationDDERequest(Channel $date)Worksheets(Sheet1)Range(C14) = ApplicationDDERequest(Channel $month)Worksheets(Sheet1)Range(C15) = ApplicationDDERequest(Channel $year)Worksheets(Sheet1)Range(C16) = ApplicationDDERequest(Channel $time)Worksheets(Sheet1)Range(C17) = ApplicationDDERequest(Channel $timestring)Worksheets(Sheet1)Range(C18) = ApplicationDDERequest(Channel $applicationversion)Worksheets(Sheet1)Range(C19) = ApplicationDDERequest(Channel $startddeconversations)Worksheets(Sheet1)Range(C20) = ApplicationDDERequest(Channel $accesslevel)Worksheets(Sheet1)Range(C21) = ApplicationDDERequest(Channel $alarmlogging)Worksheets(Sheet1)Range(C22) = ApplicationDDERequest(Channel $applicationchanged)Worksheets(Sheet1)Range(C23) = ApplicationDDERequest(Channel $configureusers)Worksheets(Sheet1)Range(C24) = ApplicationDDERequest(Channel $changepassword)Worksheets(Sheet1)Range(C25) = ApplicationDDERequest(Channel $InactivityTimeout)Worksheets(Sheet1)Range(C26) = ApplicationDDERequest(Channel $InactivityWarning)Worksheets(Sheet1)Range(C27) = ApplicationDDERequest(Channel $LogicRunning)Worksheets(Sheet1)Range(C28) = ApplicationDDERequest(Channel $OperatorEntered)Worksheets(Sheet1)Range(C29) = ApplicationDDERequest(Channel $Operator)Worksheets(Sheet1)Range(C30) = ApplicationDDERequest(Channel $PasswordEntered)ApplicationDDETerminate Channel This terminates the DDE channelEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 110

Visual Basic

ldquoRoll Your Ownrdquo HMI - Much More powerful than Excel

Key Parameters computer nameapplication|topicitem

IO Emulator - MBPlusSimulateexe

Can ldquoRead Fromrdquo amp ldquoWrite Tordquo PLC andor HMI

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 111

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 112

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 113

Dim PauseTime Start Finish TotalTime As Integer Declare variables

Private Sub txtAIT_332A_SCALED_Change()On Error GoTo PokeAIT_332AErrortxtAIT_332A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtAIT_332A_SCALEDText = Int((3 Rnd) + 20) Generate random value between 20 and 23txtAIT_332A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtAIT_332A_SCALEDLinkItem = AIT_332A_SCALEDtxtAIT_332A_SCALEDLinkMode = 2txtAIT_332A_SCALEDLinkPoketxtAIT_332A_SCALEDLinkMode = 0 DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total time

PokeAIT_332AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtAIT_332A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 114

Private Sub txtAIT_346A_SCALED_Change()On Error GoTo PokeAIT_346AErrortxtAIT_346A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtAIT_346A_SCALEDText = Int((3 Rnd) + 15) Generate random value between 15 and 18txtAIT_346A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtAIT_346A_SCALEDLinkItem = AIT_346A_SCALEDtxtAIT_346A_SCALEDLinkMode = 2txtAIT_346A_SCALEDLinkPoketxtAIT_346A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeAIT_346AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtAIT_346A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 115

Private Sub txtFIT_321A_SCALED_Change()On Error GoTo PokeFIT_321AErrortxtFIT_321A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtFIT_321A_SCALEDText = Int((10 Rnd) + 120) Generate random value between 120 and 130txtFIT_321A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_321A_SCALEDLinkItem = FIT_321A_SCALEDtxtFIT_321A_SCALEDLinkMode = 2txtFIT_321A_SCALEDLinkPoketxtFIT_321A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total time

PokeFIT_321AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_321A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume Next

End Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 116

Private Sub txtFIT_341A_SCALED_Change()On Error GoTo PokeFIT_341AErrortxtFIT_341A_SCALEDLinkMode = 0 PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTime

txtFIT_341A_SCALEDText = Int((3 Rnd) + 18) Generate random value between 18 and 21

txtFIT_341A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_341A_SCALEDLinkItem = FIT_341A_SCALEDtxtFIT_341A_SCALEDLinkMode = 2txtFIT_341A_SCALEDLinkPoketxtFIT_341A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeFIT_341AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_341A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 117

Private Sub txtFIT_343A_SCALED_Change()On Error GoTo PokeFIT_343AErrortxtFIT_343A_SCALEDLinkMode = 0 PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTime

txtFIT_343A_SCALEDText = Int((1 Rnd) + 3) Generate random value between 3 and 4

txtFIT_343A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_343A_SCALEDLinkItem = FIT_343A_SCALEDtxtFIT_343A_SCALEDLinkMode = 2txtFIT_343A_SCALEDLinkPoketxtFIT_343A_SCALEDLinkMode = 0 DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeFIT_343AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_343A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 118

TUTORIAL

Part 4

Questions

amp

Answers

  • Slide 1
  • Slide 2
  • Slide 3
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Slide 8
  • Slide 9
  • Slide 10
  • Slide 11
  • Slide 12
  • Slide 13
  • Slide 14
  • Slide 15
  • Slide 16
  • Slide 17
  • Slide 18
  • Slide 19
  • Slide 20
  • Slide 21
  • Slide 22
  • Slide 23
  • Slide 24
  • Slide 25
  • Slide 26
  • Slide 27
  • Slide 28
  • Slide 29
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
  • Slide 34
  • Slide 35
  • Slide 36
  • Slide 37
  • Slide 38
  • Slide 39
  • Slide 40
  • Slide 41
  • Slide 42
  • Slide 43
  • Slide 44
  • Slide 45
  • Slide 46
  • Slide 47
  • Slide 48
  • Slide 49
  • Slide 50
  • Slide 51
  • Slide 52
  • Slide 53
  • Slide 54
  • Slide 55
  • Slide 56
  • Slide 57
  • Slide 58
  • Slide 59
  • Slide 60
  • Slide 61
  • Slide 62
  • Slide 63
  • Slide 64
  • Slide 65
  • Slide 66
  • Slide 67
  • Slide 68
  • Slide 69
  • Slide 70
  • Slide 71
  • Slide 72
  • Slide 73
  • Slide 74
  • Slide 75
  • Slide 76
  • Slide 77
  • Slide 78
  • Slide 79
  • Slide 80
  • Slide 81
  • Slide 82
  • Slide 83
  • Slide 84
  • Slide 85
  • Slide 86
  • Slide 87
  • Slide 88
  • Slide 89
  • Slide 90
  • Slide 91
  • Slide 92
  • Slide 93
  • Slide 94
  • Slide 95
  • Slide 96
  • Slide 97
  • Slide 98
  • Slide 99
  • Slide 100
  • Slide 101
  • Slide 102
  • Slide 103
  • Slide 104
  • Slide 105
  • Slide 106
  • Slide 107
  • Slide 108
  • Slide 109
  • Slide 110
  • Slide 111
  • Slide 112
  • Slide 113
  • Slide 114
  • Slide 115
  • Slide 116
  • Slide 117
  • Slide 118
Page 59: TUTORIAL Ethernet PLC's Improve Oxygen Consumption ISA Expo/2001Houston, Texas Water & Wastewater Industry DivisionTuesday, September 11, 2001 1 Brad.

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 59

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 60

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 61

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 62

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 63

Structured Text was used hereNOT Ladder

Programming for Motors

The PLC DOES NOT CAREStructured Text Functions EXACTLY

the same as LadderUse what yoursquore comfortable with

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 64

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 65

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 66

IEC Function Blocks Used Here

Programming for Analogs amp PID

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 67

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 68

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 69

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 70

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 71

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 72

Sequential Function Charts were used here

Higher-Level Control

bull SFCrsquos lend themselves well to (as the name would imply) sequential processes

bull Three Important components in SFCrsquosbull Transitionsbull Stepsbull Jumps

bull The status of the process can be viewed as a flow chart

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 73

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 74

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 75

PLC - HMI Communication

A ldquoPLC Heartbeatrdquo is traditionally used to monitor the PLC - HMI Communication sometimes called ardquoWatchdog Timerrdquo

Call it whatever you want but the PLC amp 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 ldquodiesrdquo then that switch doesnrsquot change state and an alarm alerts the operator

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 76

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 77

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 78

TUTORIAL

Part 2B

HMI Programming

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 79

Ethernet (TCPIP) IO Driver

The Ethernet (TCPIP) IO Driver allows the HMI to communicate with the PLC (In this case the driver is called MBENETEXE)

The PLC has an ethernet module in one of the slots that has a ldquoCAT5RJ-45rdquo 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 ldquoCAT5RJ-45rdquo receptacle for the ethernet cable

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 80

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 81

Operator Screens amp Popup Displays

The display is laid out in 3 sections

bull Upper - Security amp Alarm Windowbull Middle- Main Operator Screens bull Lower - Menu amp Popup Displays

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 82

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 83

Scripting

There are 6 types of ldquoScriptsrdquobull Application Scriptsbull Key Scriptsbull Condition Scriptsbull Data Change Scriptsbull Quick Function Scriptsbull ActiveX Event Scripts

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 84

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 85

Access Names

The ldquoAccess Namesrdquo Must be configured to allow the PLC - HMI communications

Note that the ldquoApplicationTopicrdquo is the same as the IO Driver

The ldquocomputer namerdquo is the name of the PC that the HMI is running on (brad_s_carlberg in this case)

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 86

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 87

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 88

Indirect Tags

ldquoIndirect Tagsrdquo were used here to minimize the number of popup displays

This is especially useful in HMIrsquos with many tags

ONLY 12 popup displays are reused throughout the HMI

This gives the HMI a ldquoDCS-Likerdquo Look amp Feel

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 89

Popup Display TypesThe tag point type determines which popup display to use

Analog InputHIC (or Analog Output)PID (or Analog Composite)

bull PID WITH AUTO amp CASCADE amp RATIObull PID WITH AUTO amp RATIO

Diginbull Motor Status

DigOutMotor (or Digital Composite)

bull Motor with ILock and PermNumericSet TimersAlarm DetailAlarm Tags

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 90

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 91

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 92

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 93

Bars Buttons amp Sliders

By choosing to use indirect tags we complicate the Bar Graphs Buttons amp Sliders in the popup displays

Different scales need to be used for different engineering unit ranges

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 94

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 95

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 96

Popup Displays

The next two pages shows how the individual popup displays use the indirect tags

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 97

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 98

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 99

Adding a ldquoTouch Targetrdquo to a Display

2 Tell which tags to use

3 Tell which popup display to call upWhat kind of point type is it

3 Steps1 Tell which scale to use (if itrsquos an analog point type)

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 100

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 101

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 102

TUTORIAL

Part 2C

Excel Spreadsheets

amp

Visual Basic

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 103

A ldquoCHEAP amp DIRTYrdquo HMI With Excel

The 4 key parameters are

To communicate with the PLCUse brad_s_carlbergmbenet|ANOXIC_OXICrsquoplcregisterrsquo

Excel uses ldquopeeksrdquo amp ldquopokesrdquo to read from amp write to a PLC or HMI

To communicate with the HMIbrad_s_carlbergview|Tagnamersquotagnamersquo

bull computer namebull applicationbull topicbull item

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 104

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 105

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 106

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 107

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 108

Excel Macros

bull ldquoRequestrdquo Macro to read values

bull ldquoPokerdquo Macro to write values

bull A Sample Excel Macro

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 109

Sub PokeMacro()MsgBox ApplicationNetworkTemplatesPathChannel = ApplicationDDEInitiate(app=brad_s_carlbergVIEW topic=Tagname) This opens a DDE channel to ViewApplicationDDEPoke Channel Temperature1 Worksheets(Sheet1)Range(A1) Puts value from R1C1 into Temperature1ApplicationDDEPoke Channel DDEReal Worksheets(Sheet1)Range(A2) Puts value from R1C1 into Temperature1ApplicationDDEPoke Channel DDEInteger Worksheets(Sheet1)Range(A3) Puts value from R1C1 into Temperature1ApplicationDDETerminate Channel This terminates the DDE channelEnd SubSub RequestMacro()Channel = ApplicationDDEInitiate(app=brad_s_carlbergVIEW topic=Tagname) This opens a DDE channel to ViewWorksheets(Sheet1)Range(C4) = ApplicationDDERequest(Channel $Hour)Worksheets(Sheet1)Range(C5) = ApplicationDDERequest(Channel $Minute)Worksheets(Sheet1)Range(C6) = ApplicationDDERequest(Channel $Second)Worksheets(Sheet1)Range(C9) = ApplicationDDERequest(Channel $day)Worksheets(Sheet1)Range(C10) = ApplicationDDERequest(Channel $date)Worksheets(Sheet1)Range(C11) = ApplicationDDERequest(Channel $datestring)Worksheets(Sheet1)Range(C12) = ApplicationDDERequest(Channel $datetime)Worksheets(Sheet1)Range(C13) = ApplicationDDERequest(Channel $date)Worksheets(Sheet1)Range(C14) = ApplicationDDERequest(Channel $month)Worksheets(Sheet1)Range(C15) = ApplicationDDERequest(Channel $year)Worksheets(Sheet1)Range(C16) = ApplicationDDERequest(Channel $time)Worksheets(Sheet1)Range(C17) = ApplicationDDERequest(Channel $timestring)Worksheets(Sheet1)Range(C18) = ApplicationDDERequest(Channel $applicationversion)Worksheets(Sheet1)Range(C19) = ApplicationDDERequest(Channel $startddeconversations)Worksheets(Sheet1)Range(C20) = ApplicationDDERequest(Channel $accesslevel)Worksheets(Sheet1)Range(C21) = ApplicationDDERequest(Channel $alarmlogging)Worksheets(Sheet1)Range(C22) = ApplicationDDERequest(Channel $applicationchanged)Worksheets(Sheet1)Range(C23) = ApplicationDDERequest(Channel $configureusers)Worksheets(Sheet1)Range(C24) = ApplicationDDERequest(Channel $changepassword)Worksheets(Sheet1)Range(C25) = ApplicationDDERequest(Channel $InactivityTimeout)Worksheets(Sheet1)Range(C26) = ApplicationDDERequest(Channel $InactivityWarning)Worksheets(Sheet1)Range(C27) = ApplicationDDERequest(Channel $LogicRunning)Worksheets(Sheet1)Range(C28) = ApplicationDDERequest(Channel $OperatorEntered)Worksheets(Sheet1)Range(C29) = ApplicationDDERequest(Channel $Operator)Worksheets(Sheet1)Range(C30) = ApplicationDDERequest(Channel $PasswordEntered)ApplicationDDETerminate Channel This terminates the DDE channelEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 110

Visual Basic

ldquoRoll Your Ownrdquo HMI - Much More powerful than Excel

Key Parameters computer nameapplication|topicitem

IO Emulator - MBPlusSimulateexe

Can ldquoRead Fromrdquo amp ldquoWrite Tordquo PLC andor HMI

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 111

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 112

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 113

Dim PauseTime Start Finish TotalTime As Integer Declare variables

Private Sub txtAIT_332A_SCALED_Change()On Error GoTo PokeAIT_332AErrortxtAIT_332A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtAIT_332A_SCALEDText = Int((3 Rnd) + 20) Generate random value between 20 and 23txtAIT_332A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtAIT_332A_SCALEDLinkItem = AIT_332A_SCALEDtxtAIT_332A_SCALEDLinkMode = 2txtAIT_332A_SCALEDLinkPoketxtAIT_332A_SCALEDLinkMode = 0 DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total time

PokeAIT_332AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtAIT_332A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 114

Private Sub txtAIT_346A_SCALED_Change()On Error GoTo PokeAIT_346AErrortxtAIT_346A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtAIT_346A_SCALEDText = Int((3 Rnd) + 15) Generate random value between 15 and 18txtAIT_346A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtAIT_346A_SCALEDLinkItem = AIT_346A_SCALEDtxtAIT_346A_SCALEDLinkMode = 2txtAIT_346A_SCALEDLinkPoketxtAIT_346A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeAIT_346AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtAIT_346A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 115

Private Sub txtFIT_321A_SCALED_Change()On Error GoTo PokeFIT_321AErrortxtFIT_321A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtFIT_321A_SCALEDText = Int((10 Rnd) + 120) Generate random value between 120 and 130txtFIT_321A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_321A_SCALEDLinkItem = FIT_321A_SCALEDtxtFIT_321A_SCALEDLinkMode = 2txtFIT_321A_SCALEDLinkPoketxtFIT_321A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total time

PokeFIT_321AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_321A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume Next

End Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 116

Private Sub txtFIT_341A_SCALED_Change()On Error GoTo PokeFIT_341AErrortxtFIT_341A_SCALEDLinkMode = 0 PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTime

txtFIT_341A_SCALEDText = Int((3 Rnd) + 18) Generate random value between 18 and 21

txtFIT_341A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_341A_SCALEDLinkItem = FIT_341A_SCALEDtxtFIT_341A_SCALEDLinkMode = 2txtFIT_341A_SCALEDLinkPoketxtFIT_341A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeFIT_341AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_341A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 117

Private Sub txtFIT_343A_SCALED_Change()On Error GoTo PokeFIT_343AErrortxtFIT_343A_SCALEDLinkMode = 0 PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTime

txtFIT_343A_SCALEDText = Int((1 Rnd) + 3) Generate random value between 3 and 4

txtFIT_343A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_343A_SCALEDLinkItem = FIT_343A_SCALEDtxtFIT_343A_SCALEDLinkMode = 2txtFIT_343A_SCALEDLinkPoketxtFIT_343A_SCALEDLinkMode = 0 DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeFIT_343AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_343A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 118

TUTORIAL

Part 4

Questions

amp

Answers

  • Slide 1
  • Slide 2
  • Slide 3
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Slide 8
  • Slide 9
  • Slide 10
  • Slide 11
  • Slide 12
  • Slide 13
  • Slide 14
  • Slide 15
  • Slide 16
  • Slide 17
  • Slide 18
  • Slide 19
  • Slide 20
  • Slide 21
  • Slide 22
  • Slide 23
  • Slide 24
  • Slide 25
  • Slide 26
  • Slide 27
  • Slide 28
  • Slide 29
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
  • Slide 34
  • Slide 35
  • Slide 36
  • Slide 37
  • Slide 38
  • Slide 39
  • Slide 40
  • Slide 41
  • Slide 42
  • Slide 43
  • Slide 44
  • Slide 45
  • Slide 46
  • Slide 47
  • Slide 48
  • Slide 49
  • Slide 50
  • Slide 51
  • Slide 52
  • Slide 53
  • Slide 54
  • Slide 55
  • Slide 56
  • Slide 57
  • Slide 58
  • Slide 59
  • Slide 60
  • Slide 61
  • Slide 62
  • Slide 63
  • Slide 64
  • Slide 65
  • Slide 66
  • Slide 67
  • Slide 68
  • Slide 69
  • Slide 70
  • Slide 71
  • Slide 72
  • Slide 73
  • Slide 74
  • Slide 75
  • Slide 76
  • Slide 77
  • Slide 78
  • Slide 79
  • Slide 80
  • Slide 81
  • Slide 82
  • Slide 83
  • Slide 84
  • Slide 85
  • Slide 86
  • Slide 87
  • Slide 88
  • Slide 89
  • Slide 90
  • Slide 91
  • Slide 92
  • Slide 93
  • Slide 94
  • Slide 95
  • Slide 96
  • Slide 97
  • Slide 98
  • Slide 99
  • Slide 100
  • Slide 101
  • Slide 102
  • Slide 103
  • Slide 104
  • Slide 105
  • Slide 106
  • Slide 107
  • Slide 108
  • Slide 109
  • Slide 110
  • Slide 111
  • Slide 112
  • Slide 113
  • Slide 114
  • Slide 115
  • Slide 116
  • Slide 117
  • Slide 118
Page 60: TUTORIAL Ethernet PLC's Improve Oxygen Consumption ISA Expo/2001Houston, Texas Water & Wastewater Industry DivisionTuesday, September 11, 2001 1 Brad.

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 60

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 61

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 62

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 63

Structured Text was used hereNOT Ladder

Programming for Motors

The PLC DOES NOT CAREStructured Text Functions EXACTLY

the same as LadderUse what yoursquore comfortable with

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 64

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 65

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 66

IEC Function Blocks Used Here

Programming for Analogs amp PID

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 67

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 68

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 69

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 70

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 71

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 72

Sequential Function Charts were used here

Higher-Level Control

bull SFCrsquos lend themselves well to (as the name would imply) sequential processes

bull Three Important components in SFCrsquosbull Transitionsbull Stepsbull Jumps

bull The status of the process can be viewed as a flow chart

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 73

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 74

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 75

PLC - HMI Communication

A ldquoPLC Heartbeatrdquo is traditionally used to monitor the PLC - HMI Communication sometimes called ardquoWatchdog Timerrdquo

Call it whatever you want but the PLC amp 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 ldquodiesrdquo then that switch doesnrsquot change state and an alarm alerts the operator

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 76

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 77

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 78

TUTORIAL

Part 2B

HMI Programming

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 79

Ethernet (TCPIP) IO Driver

The Ethernet (TCPIP) IO Driver allows the HMI to communicate with the PLC (In this case the driver is called MBENETEXE)

The PLC has an ethernet module in one of the slots that has a ldquoCAT5RJ-45rdquo 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 ldquoCAT5RJ-45rdquo receptacle for the ethernet cable

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 80

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 81

Operator Screens amp Popup Displays

The display is laid out in 3 sections

bull Upper - Security amp Alarm Windowbull Middle- Main Operator Screens bull Lower - Menu amp Popup Displays

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 82

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 83

Scripting

There are 6 types of ldquoScriptsrdquobull Application Scriptsbull Key Scriptsbull Condition Scriptsbull Data Change Scriptsbull Quick Function Scriptsbull ActiveX Event Scripts

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 84

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 85

Access Names

The ldquoAccess Namesrdquo Must be configured to allow the PLC - HMI communications

Note that the ldquoApplicationTopicrdquo is the same as the IO Driver

The ldquocomputer namerdquo is the name of the PC that the HMI is running on (brad_s_carlberg in this case)

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 86

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 87

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 88

Indirect Tags

ldquoIndirect Tagsrdquo were used here to minimize the number of popup displays

This is especially useful in HMIrsquos with many tags

ONLY 12 popup displays are reused throughout the HMI

This gives the HMI a ldquoDCS-Likerdquo Look amp Feel

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 89

Popup Display TypesThe tag point type determines which popup display to use

Analog InputHIC (or Analog Output)PID (or Analog Composite)

bull PID WITH AUTO amp CASCADE amp RATIObull PID WITH AUTO amp RATIO

Diginbull Motor Status

DigOutMotor (or Digital Composite)

bull Motor with ILock and PermNumericSet TimersAlarm DetailAlarm Tags

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 90

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 91

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 92

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 93

Bars Buttons amp Sliders

By choosing to use indirect tags we complicate the Bar Graphs Buttons amp Sliders in the popup displays

Different scales need to be used for different engineering unit ranges

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 94

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 95

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 96

Popup Displays

The next two pages shows how the individual popup displays use the indirect tags

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 97

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 98

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 99

Adding a ldquoTouch Targetrdquo to a Display

2 Tell which tags to use

3 Tell which popup display to call upWhat kind of point type is it

3 Steps1 Tell which scale to use (if itrsquos an analog point type)

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 100

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 101

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 102

TUTORIAL

Part 2C

Excel Spreadsheets

amp

Visual Basic

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 103

A ldquoCHEAP amp DIRTYrdquo HMI With Excel

The 4 key parameters are

To communicate with the PLCUse brad_s_carlbergmbenet|ANOXIC_OXICrsquoplcregisterrsquo

Excel uses ldquopeeksrdquo amp ldquopokesrdquo to read from amp write to a PLC or HMI

To communicate with the HMIbrad_s_carlbergview|Tagnamersquotagnamersquo

bull computer namebull applicationbull topicbull item

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 104

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 105

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 106

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 107

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 108

Excel Macros

bull ldquoRequestrdquo Macro to read values

bull ldquoPokerdquo Macro to write values

bull A Sample Excel Macro

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 109

Sub PokeMacro()MsgBox ApplicationNetworkTemplatesPathChannel = ApplicationDDEInitiate(app=brad_s_carlbergVIEW topic=Tagname) This opens a DDE channel to ViewApplicationDDEPoke Channel Temperature1 Worksheets(Sheet1)Range(A1) Puts value from R1C1 into Temperature1ApplicationDDEPoke Channel DDEReal Worksheets(Sheet1)Range(A2) Puts value from R1C1 into Temperature1ApplicationDDEPoke Channel DDEInteger Worksheets(Sheet1)Range(A3) Puts value from R1C1 into Temperature1ApplicationDDETerminate Channel This terminates the DDE channelEnd SubSub RequestMacro()Channel = ApplicationDDEInitiate(app=brad_s_carlbergVIEW topic=Tagname) This opens a DDE channel to ViewWorksheets(Sheet1)Range(C4) = ApplicationDDERequest(Channel $Hour)Worksheets(Sheet1)Range(C5) = ApplicationDDERequest(Channel $Minute)Worksheets(Sheet1)Range(C6) = ApplicationDDERequest(Channel $Second)Worksheets(Sheet1)Range(C9) = ApplicationDDERequest(Channel $day)Worksheets(Sheet1)Range(C10) = ApplicationDDERequest(Channel $date)Worksheets(Sheet1)Range(C11) = ApplicationDDERequest(Channel $datestring)Worksheets(Sheet1)Range(C12) = ApplicationDDERequest(Channel $datetime)Worksheets(Sheet1)Range(C13) = ApplicationDDERequest(Channel $date)Worksheets(Sheet1)Range(C14) = ApplicationDDERequest(Channel $month)Worksheets(Sheet1)Range(C15) = ApplicationDDERequest(Channel $year)Worksheets(Sheet1)Range(C16) = ApplicationDDERequest(Channel $time)Worksheets(Sheet1)Range(C17) = ApplicationDDERequest(Channel $timestring)Worksheets(Sheet1)Range(C18) = ApplicationDDERequest(Channel $applicationversion)Worksheets(Sheet1)Range(C19) = ApplicationDDERequest(Channel $startddeconversations)Worksheets(Sheet1)Range(C20) = ApplicationDDERequest(Channel $accesslevel)Worksheets(Sheet1)Range(C21) = ApplicationDDERequest(Channel $alarmlogging)Worksheets(Sheet1)Range(C22) = ApplicationDDERequest(Channel $applicationchanged)Worksheets(Sheet1)Range(C23) = ApplicationDDERequest(Channel $configureusers)Worksheets(Sheet1)Range(C24) = ApplicationDDERequest(Channel $changepassword)Worksheets(Sheet1)Range(C25) = ApplicationDDERequest(Channel $InactivityTimeout)Worksheets(Sheet1)Range(C26) = ApplicationDDERequest(Channel $InactivityWarning)Worksheets(Sheet1)Range(C27) = ApplicationDDERequest(Channel $LogicRunning)Worksheets(Sheet1)Range(C28) = ApplicationDDERequest(Channel $OperatorEntered)Worksheets(Sheet1)Range(C29) = ApplicationDDERequest(Channel $Operator)Worksheets(Sheet1)Range(C30) = ApplicationDDERequest(Channel $PasswordEntered)ApplicationDDETerminate Channel This terminates the DDE channelEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 110

Visual Basic

ldquoRoll Your Ownrdquo HMI - Much More powerful than Excel

Key Parameters computer nameapplication|topicitem

IO Emulator - MBPlusSimulateexe

Can ldquoRead Fromrdquo amp ldquoWrite Tordquo PLC andor HMI

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 111

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 112

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 113

Dim PauseTime Start Finish TotalTime As Integer Declare variables

Private Sub txtAIT_332A_SCALED_Change()On Error GoTo PokeAIT_332AErrortxtAIT_332A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtAIT_332A_SCALEDText = Int((3 Rnd) + 20) Generate random value between 20 and 23txtAIT_332A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtAIT_332A_SCALEDLinkItem = AIT_332A_SCALEDtxtAIT_332A_SCALEDLinkMode = 2txtAIT_332A_SCALEDLinkPoketxtAIT_332A_SCALEDLinkMode = 0 DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total time

PokeAIT_332AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtAIT_332A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 114

Private Sub txtAIT_346A_SCALED_Change()On Error GoTo PokeAIT_346AErrortxtAIT_346A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtAIT_346A_SCALEDText = Int((3 Rnd) + 15) Generate random value between 15 and 18txtAIT_346A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtAIT_346A_SCALEDLinkItem = AIT_346A_SCALEDtxtAIT_346A_SCALEDLinkMode = 2txtAIT_346A_SCALEDLinkPoketxtAIT_346A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeAIT_346AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtAIT_346A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 115

Private Sub txtFIT_321A_SCALED_Change()On Error GoTo PokeFIT_321AErrortxtFIT_321A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtFIT_321A_SCALEDText = Int((10 Rnd) + 120) Generate random value between 120 and 130txtFIT_321A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_321A_SCALEDLinkItem = FIT_321A_SCALEDtxtFIT_321A_SCALEDLinkMode = 2txtFIT_321A_SCALEDLinkPoketxtFIT_321A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total time

PokeFIT_321AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_321A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume Next

End Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 116

Private Sub txtFIT_341A_SCALED_Change()On Error GoTo PokeFIT_341AErrortxtFIT_341A_SCALEDLinkMode = 0 PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTime

txtFIT_341A_SCALEDText = Int((3 Rnd) + 18) Generate random value between 18 and 21

txtFIT_341A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_341A_SCALEDLinkItem = FIT_341A_SCALEDtxtFIT_341A_SCALEDLinkMode = 2txtFIT_341A_SCALEDLinkPoketxtFIT_341A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeFIT_341AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_341A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 117

Private Sub txtFIT_343A_SCALED_Change()On Error GoTo PokeFIT_343AErrortxtFIT_343A_SCALEDLinkMode = 0 PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTime

txtFIT_343A_SCALEDText = Int((1 Rnd) + 3) Generate random value between 3 and 4

txtFIT_343A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_343A_SCALEDLinkItem = FIT_343A_SCALEDtxtFIT_343A_SCALEDLinkMode = 2txtFIT_343A_SCALEDLinkPoketxtFIT_343A_SCALEDLinkMode = 0 DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeFIT_343AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_343A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 118

TUTORIAL

Part 4

Questions

amp

Answers

  • Slide 1
  • Slide 2
  • Slide 3
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Slide 8
  • Slide 9
  • Slide 10
  • Slide 11
  • Slide 12
  • Slide 13
  • Slide 14
  • Slide 15
  • Slide 16
  • Slide 17
  • Slide 18
  • Slide 19
  • Slide 20
  • Slide 21
  • Slide 22
  • Slide 23
  • Slide 24
  • Slide 25
  • Slide 26
  • Slide 27
  • Slide 28
  • Slide 29
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
  • Slide 34
  • Slide 35
  • Slide 36
  • Slide 37
  • Slide 38
  • Slide 39
  • Slide 40
  • Slide 41
  • Slide 42
  • Slide 43
  • Slide 44
  • Slide 45
  • Slide 46
  • Slide 47
  • Slide 48
  • Slide 49
  • Slide 50
  • Slide 51
  • Slide 52
  • Slide 53
  • Slide 54
  • Slide 55
  • Slide 56
  • Slide 57
  • Slide 58
  • Slide 59
  • Slide 60
  • Slide 61
  • Slide 62
  • Slide 63
  • Slide 64
  • Slide 65
  • Slide 66
  • Slide 67
  • Slide 68
  • Slide 69
  • Slide 70
  • Slide 71
  • Slide 72
  • Slide 73
  • Slide 74
  • Slide 75
  • Slide 76
  • Slide 77
  • Slide 78
  • Slide 79
  • Slide 80
  • Slide 81
  • Slide 82
  • Slide 83
  • Slide 84
  • Slide 85
  • Slide 86
  • Slide 87
  • Slide 88
  • Slide 89
  • Slide 90
  • Slide 91
  • Slide 92
  • Slide 93
  • Slide 94
  • Slide 95
  • Slide 96
  • Slide 97
  • Slide 98
  • Slide 99
  • Slide 100
  • Slide 101
  • Slide 102
  • Slide 103
  • Slide 104
  • Slide 105
  • Slide 106
  • Slide 107
  • Slide 108
  • Slide 109
  • Slide 110
  • Slide 111
  • Slide 112
  • Slide 113
  • Slide 114
  • Slide 115
  • Slide 116
  • Slide 117
  • Slide 118
Page 61: TUTORIAL Ethernet PLC's Improve Oxygen Consumption ISA Expo/2001Houston, Texas Water & Wastewater Industry DivisionTuesday, September 11, 2001 1 Brad.

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 61

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 62

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 63

Structured Text was used hereNOT Ladder

Programming for Motors

The PLC DOES NOT CAREStructured Text Functions EXACTLY

the same as LadderUse what yoursquore comfortable with

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 64

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 65

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 66

IEC Function Blocks Used Here

Programming for Analogs amp PID

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 67

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 68

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 69

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 70

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 71

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 72

Sequential Function Charts were used here

Higher-Level Control

bull SFCrsquos lend themselves well to (as the name would imply) sequential processes

bull Three Important components in SFCrsquosbull Transitionsbull Stepsbull Jumps

bull The status of the process can be viewed as a flow chart

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 73

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 74

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 75

PLC - HMI Communication

A ldquoPLC Heartbeatrdquo is traditionally used to monitor the PLC - HMI Communication sometimes called ardquoWatchdog Timerrdquo

Call it whatever you want but the PLC amp 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 ldquodiesrdquo then that switch doesnrsquot change state and an alarm alerts the operator

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 76

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 77

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 78

TUTORIAL

Part 2B

HMI Programming

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 79

Ethernet (TCPIP) IO Driver

The Ethernet (TCPIP) IO Driver allows the HMI to communicate with the PLC (In this case the driver is called MBENETEXE)

The PLC has an ethernet module in one of the slots that has a ldquoCAT5RJ-45rdquo 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 ldquoCAT5RJ-45rdquo receptacle for the ethernet cable

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 80

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 81

Operator Screens amp Popup Displays

The display is laid out in 3 sections

bull Upper - Security amp Alarm Windowbull Middle- Main Operator Screens bull Lower - Menu amp Popup Displays

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 82

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 83

Scripting

There are 6 types of ldquoScriptsrdquobull Application Scriptsbull Key Scriptsbull Condition Scriptsbull Data Change Scriptsbull Quick Function Scriptsbull ActiveX Event Scripts

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 84

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 85

Access Names

The ldquoAccess Namesrdquo Must be configured to allow the PLC - HMI communications

Note that the ldquoApplicationTopicrdquo is the same as the IO Driver

The ldquocomputer namerdquo is the name of the PC that the HMI is running on (brad_s_carlberg in this case)

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 86

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 87

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 88

Indirect Tags

ldquoIndirect Tagsrdquo were used here to minimize the number of popup displays

This is especially useful in HMIrsquos with many tags

ONLY 12 popup displays are reused throughout the HMI

This gives the HMI a ldquoDCS-Likerdquo Look amp Feel

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 89

Popup Display TypesThe tag point type determines which popup display to use

Analog InputHIC (or Analog Output)PID (or Analog Composite)

bull PID WITH AUTO amp CASCADE amp RATIObull PID WITH AUTO amp RATIO

Diginbull Motor Status

DigOutMotor (or Digital Composite)

bull Motor with ILock and PermNumericSet TimersAlarm DetailAlarm Tags

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 90

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 91

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 92

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 93

Bars Buttons amp Sliders

By choosing to use indirect tags we complicate the Bar Graphs Buttons amp Sliders in the popup displays

Different scales need to be used for different engineering unit ranges

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 94

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 95

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 96

Popup Displays

The next two pages shows how the individual popup displays use the indirect tags

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 97

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 98

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 99

Adding a ldquoTouch Targetrdquo to a Display

2 Tell which tags to use

3 Tell which popup display to call upWhat kind of point type is it

3 Steps1 Tell which scale to use (if itrsquos an analog point type)

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 100

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 101

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 102

TUTORIAL

Part 2C

Excel Spreadsheets

amp

Visual Basic

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 103

A ldquoCHEAP amp DIRTYrdquo HMI With Excel

The 4 key parameters are

To communicate with the PLCUse brad_s_carlbergmbenet|ANOXIC_OXICrsquoplcregisterrsquo

Excel uses ldquopeeksrdquo amp ldquopokesrdquo to read from amp write to a PLC or HMI

To communicate with the HMIbrad_s_carlbergview|Tagnamersquotagnamersquo

bull computer namebull applicationbull topicbull item

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 104

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 105

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 106

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 107

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 108

Excel Macros

bull ldquoRequestrdquo Macro to read values

bull ldquoPokerdquo Macro to write values

bull A Sample Excel Macro

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 109

Sub PokeMacro()MsgBox ApplicationNetworkTemplatesPathChannel = ApplicationDDEInitiate(app=brad_s_carlbergVIEW topic=Tagname) This opens a DDE channel to ViewApplicationDDEPoke Channel Temperature1 Worksheets(Sheet1)Range(A1) Puts value from R1C1 into Temperature1ApplicationDDEPoke Channel DDEReal Worksheets(Sheet1)Range(A2) Puts value from R1C1 into Temperature1ApplicationDDEPoke Channel DDEInteger Worksheets(Sheet1)Range(A3) Puts value from R1C1 into Temperature1ApplicationDDETerminate Channel This terminates the DDE channelEnd SubSub RequestMacro()Channel = ApplicationDDEInitiate(app=brad_s_carlbergVIEW topic=Tagname) This opens a DDE channel to ViewWorksheets(Sheet1)Range(C4) = ApplicationDDERequest(Channel $Hour)Worksheets(Sheet1)Range(C5) = ApplicationDDERequest(Channel $Minute)Worksheets(Sheet1)Range(C6) = ApplicationDDERequest(Channel $Second)Worksheets(Sheet1)Range(C9) = ApplicationDDERequest(Channel $day)Worksheets(Sheet1)Range(C10) = ApplicationDDERequest(Channel $date)Worksheets(Sheet1)Range(C11) = ApplicationDDERequest(Channel $datestring)Worksheets(Sheet1)Range(C12) = ApplicationDDERequest(Channel $datetime)Worksheets(Sheet1)Range(C13) = ApplicationDDERequest(Channel $date)Worksheets(Sheet1)Range(C14) = ApplicationDDERequest(Channel $month)Worksheets(Sheet1)Range(C15) = ApplicationDDERequest(Channel $year)Worksheets(Sheet1)Range(C16) = ApplicationDDERequest(Channel $time)Worksheets(Sheet1)Range(C17) = ApplicationDDERequest(Channel $timestring)Worksheets(Sheet1)Range(C18) = ApplicationDDERequest(Channel $applicationversion)Worksheets(Sheet1)Range(C19) = ApplicationDDERequest(Channel $startddeconversations)Worksheets(Sheet1)Range(C20) = ApplicationDDERequest(Channel $accesslevel)Worksheets(Sheet1)Range(C21) = ApplicationDDERequest(Channel $alarmlogging)Worksheets(Sheet1)Range(C22) = ApplicationDDERequest(Channel $applicationchanged)Worksheets(Sheet1)Range(C23) = ApplicationDDERequest(Channel $configureusers)Worksheets(Sheet1)Range(C24) = ApplicationDDERequest(Channel $changepassword)Worksheets(Sheet1)Range(C25) = ApplicationDDERequest(Channel $InactivityTimeout)Worksheets(Sheet1)Range(C26) = ApplicationDDERequest(Channel $InactivityWarning)Worksheets(Sheet1)Range(C27) = ApplicationDDERequest(Channel $LogicRunning)Worksheets(Sheet1)Range(C28) = ApplicationDDERequest(Channel $OperatorEntered)Worksheets(Sheet1)Range(C29) = ApplicationDDERequest(Channel $Operator)Worksheets(Sheet1)Range(C30) = ApplicationDDERequest(Channel $PasswordEntered)ApplicationDDETerminate Channel This terminates the DDE channelEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 110

Visual Basic

ldquoRoll Your Ownrdquo HMI - Much More powerful than Excel

Key Parameters computer nameapplication|topicitem

IO Emulator - MBPlusSimulateexe

Can ldquoRead Fromrdquo amp ldquoWrite Tordquo PLC andor HMI

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 111

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 112

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 113

Dim PauseTime Start Finish TotalTime As Integer Declare variables

Private Sub txtAIT_332A_SCALED_Change()On Error GoTo PokeAIT_332AErrortxtAIT_332A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtAIT_332A_SCALEDText = Int((3 Rnd) + 20) Generate random value between 20 and 23txtAIT_332A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtAIT_332A_SCALEDLinkItem = AIT_332A_SCALEDtxtAIT_332A_SCALEDLinkMode = 2txtAIT_332A_SCALEDLinkPoketxtAIT_332A_SCALEDLinkMode = 0 DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total time

PokeAIT_332AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtAIT_332A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 114

Private Sub txtAIT_346A_SCALED_Change()On Error GoTo PokeAIT_346AErrortxtAIT_346A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtAIT_346A_SCALEDText = Int((3 Rnd) + 15) Generate random value between 15 and 18txtAIT_346A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtAIT_346A_SCALEDLinkItem = AIT_346A_SCALEDtxtAIT_346A_SCALEDLinkMode = 2txtAIT_346A_SCALEDLinkPoketxtAIT_346A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeAIT_346AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtAIT_346A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 115

Private Sub txtFIT_321A_SCALED_Change()On Error GoTo PokeFIT_321AErrortxtFIT_321A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtFIT_321A_SCALEDText = Int((10 Rnd) + 120) Generate random value between 120 and 130txtFIT_321A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_321A_SCALEDLinkItem = FIT_321A_SCALEDtxtFIT_321A_SCALEDLinkMode = 2txtFIT_321A_SCALEDLinkPoketxtFIT_321A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total time

PokeFIT_321AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_321A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume Next

End Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 116

Private Sub txtFIT_341A_SCALED_Change()On Error GoTo PokeFIT_341AErrortxtFIT_341A_SCALEDLinkMode = 0 PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTime

txtFIT_341A_SCALEDText = Int((3 Rnd) + 18) Generate random value between 18 and 21

txtFIT_341A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_341A_SCALEDLinkItem = FIT_341A_SCALEDtxtFIT_341A_SCALEDLinkMode = 2txtFIT_341A_SCALEDLinkPoketxtFIT_341A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeFIT_341AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_341A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 117

Private Sub txtFIT_343A_SCALED_Change()On Error GoTo PokeFIT_343AErrortxtFIT_343A_SCALEDLinkMode = 0 PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTime

txtFIT_343A_SCALEDText = Int((1 Rnd) + 3) Generate random value between 3 and 4

txtFIT_343A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_343A_SCALEDLinkItem = FIT_343A_SCALEDtxtFIT_343A_SCALEDLinkMode = 2txtFIT_343A_SCALEDLinkPoketxtFIT_343A_SCALEDLinkMode = 0 DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeFIT_343AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_343A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 118

TUTORIAL

Part 4

Questions

amp

Answers

  • Slide 1
  • Slide 2
  • Slide 3
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Slide 8
  • Slide 9
  • Slide 10
  • Slide 11
  • Slide 12
  • Slide 13
  • Slide 14
  • Slide 15
  • Slide 16
  • Slide 17
  • Slide 18
  • Slide 19
  • Slide 20
  • Slide 21
  • Slide 22
  • Slide 23
  • Slide 24
  • Slide 25
  • Slide 26
  • Slide 27
  • Slide 28
  • Slide 29
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
  • Slide 34
  • Slide 35
  • Slide 36
  • Slide 37
  • Slide 38
  • Slide 39
  • Slide 40
  • Slide 41
  • Slide 42
  • Slide 43
  • Slide 44
  • Slide 45
  • Slide 46
  • Slide 47
  • Slide 48
  • Slide 49
  • Slide 50
  • Slide 51
  • Slide 52
  • Slide 53
  • Slide 54
  • Slide 55
  • Slide 56
  • Slide 57
  • Slide 58
  • Slide 59
  • Slide 60
  • Slide 61
  • Slide 62
  • Slide 63
  • Slide 64
  • Slide 65
  • Slide 66
  • Slide 67
  • Slide 68
  • Slide 69
  • Slide 70
  • Slide 71
  • Slide 72
  • Slide 73
  • Slide 74
  • Slide 75
  • Slide 76
  • Slide 77
  • Slide 78
  • Slide 79
  • Slide 80
  • Slide 81
  • Slide 82
  • Slide 83
  • Slide 84
  • Slide 85
  • Slide 86
  • Slide 87
  • Slide 88
  • Slide 89
  • Slide 90
  • Slide 91
  • Slide 92
  • Slide 93
  • Slide 94
  • Slide 95
  • Slide 96
  • Slide 97
  • Slide 98
  • Slide 99
  • Slide 100
  • Slide 101
  • Slide 102
  • Slide 103
  • Slide 104
  • Slide 105
  • Slide 106
  • Slide 107
  • Slide 108
  • Slide 109
  • Slide 110
  • Slide 111
  • Slide 112
  • Slide 113
  • Slide 114
  • Slide 115
  • Slide 116
  • Slide 117
  • Slide 118
Page 62: TUTORIAL Ethernet PLC's Improve Oxygen Consumption ISA Expo/2001Houston, Texas Water & Wastewater Industry DivisionTuesday, September 11, 2001 1 Brad.

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 62

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 63

Structured Text was used hereNOT Ladder

Programming for Motors

The PLC DOES NOT CAREStructured Text Functions EXACTLY

the same as LadderUse what yoursquore comfortable with

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 64

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 65

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 66

IEC Function Blocks Used Here

Programming for Analogs amp PID

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 67

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 68

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 69

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 70

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 71

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 72

Sequential Function Charts were used here

Higher-Level Control

bull SFCrsquos lend themselves well to (as the name would imply) sequential processes

bull Three Important components in SFCrsquosbull Transitionsbull Stepsbull Jumps

bull The status of the process can be viewed as a flow chart

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 73

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 74

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 75

PLC - HMI Communication

A ldquoPLC Heartbeatrdquo is traditionally used to monitor the PLC - HMI Communication sometimes called ardquoWatchdog Timerrdquo

Call it whatever you want but the PLC amp 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 ldquodiesrdquo then that switch doesnrsquot change state and an alarm alerts the operator

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 76

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 77

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 78

TUTORIAL

Part 2B

HMI Programming

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 79

Ethernet (TCPIP) IO Driver

The Ethernet (TCPIP) IO Driver allows the HMI to communicate with the PLC (In this case the driver is called MBENETEXE)

The PLC has an ethernet module in one of the slots that has a ldquoCAT5RJ-45rdquo 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 ldquoCAT5RJ-45rdquo receptacle for the ethernet cable

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 80

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 81

Operator Screens amp Popup Displays

The display is laid out in 3 sections

bull Upper - Security amp Alarm Windowbull Middle- Main Operator Screens bull Lower - Menu amp Popup Displays

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 82

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 83

Scripting

There are 6 types of ldquoScriptsrdquobull Application Scriptsbull Key Scriptsbull Condition Scriptsbull Data Change Scriptsbull Quick Function Scriptsbull ActiveX Event Scripts

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 84

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 85

Access Names

The ldquoAccess Namesrdquo Must be configured to allow the PLC - HMI communications

Note that the ldquoApplicationTopicrdquo is the same as the IO Driver

The ldquocomputer namerdquo is the name of the PC that the HMI is running on (brad_s_carlberg in this case)

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 86

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 87

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 88

Indirect Tags

ldquoIndirect Tagsrdquo were used here to minimize the number of popup displays

This is especially useful in HMIrsquos with many tags

ONLY 12 popup displays are reused throughout the HMI

This gives the HMI a ldquoDCS-Likerdquo Look amp Feel

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 89

Popup Display TypesThe tag point type determines which popup display to use

Analog InputHIC (or Analog Output)PID (or Analog Composite)

bull PID WITH AUTO amp CASCADE amp RATIObull PID WITH AUTO amp RATIO

Diginbull Motor Status

DigOutMotor (or Digital Composite)

bull Motor with ILock and PermNumericSet TimersAlarm DetailAlarm Tags

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 90

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 91

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 92

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 93

Bars Buttons amp Sliders

By choosing to use indirect tags we complicate the Bar Graphs Buttons amp Sliders in the popup displays

Different scales need to be used for different engineering unit ranges

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 94

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 95

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 96

Popup Displays

The next two pages shows how the individual popup displays use the indirect tags

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 97

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 98

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 99

Adding a ldquoTouch Targetrdquo to a Display

2 Tell which tags to use

3 Tell which popup display to call upWhat kind of point type is it

3 Steps1 Tell which scale to use (if itrsquos an analog point type)

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 100

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 101

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 102

TUTORIAL

Part 2C

Excel Spreadsheets

amp

Visual Basic

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 103

A ldquoCHEAP amp DIRTYrdquo HMI With Excel

The 4 key parameters are

To communicate with the PLCUse brad_s_carlbergmbenet|ANOXIC_OXICrsquoplcregisterrsquo

Excel uses ldquopeeksrdquo amp ldquopokesrdquo to read from amp write to a PLC or HMI

To communicate with the HMIbrad_s_carlbergview|Tagnamersquotagnamersquo

bull computer namebull applicationbull topicbull item

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 104

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 105

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 106

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 107

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 108

Excel Macros

bull ldquoRequestrdquo Macro to read values

bull ldquoPokerdquo Macro to write values

bull A Sample Excel Macro

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 109

Sub PokeMacro()MsgBox ApplicationNetworkTemplatesPathChannel = ApplicationDDEInitiate(app=brad_s_carlbergVIEW topic=Tagname) This opens a DDE channel to ViewApplicationDDEPoke Channel Temperature1 Worksheets(Sheet1)Range(A1) Puts value from R1C1 into Temperature1ApplicationDDEPoke Channel DDEReal Worksheets(Sheet1)Range(A2) Puts value from R1C1 into Temperature1ApplicationDDEPoke Channel DDEInteger Worksheets(Sheet1)Range(A3) Puts value from R1C1 into Temperature1ApplicationDDETerminate Channel This terminates the DDE channelEnd SubSub RequestMacro()Channel = ApplicationDDEInitiate(app=brad_s_carlbergVIEW topic=Tagname) This opens a DDE channel to ViewWorksheets(Sheet1)Range(C4) = ApplicationDDERequest(Channel $Hour)Worksheets(Sheet1)Range(C5) = ApplicationDDERequest(Channel $Minute)Worksheets(Sheet1)Range(C6) = ApplicationDDERequest(Channel $Second)Worksheets(Sheet1)Range(C9) = ApplicationDDERequest(Channel $day)Worksheets(Sheet1)Range(C10) = ApplicationDDERequest(Channel $date)Worksheets(Sheet1)Range(C11) = ApplicationDDERequest(Channel $datestring)Worksheets(Sheet1)Range(C12) = ApplicationDDERequest(Channel $datetime)Worksheets(Sheet1)Range(C13) = ApplicationDDERequest(Channel $date)Worksheets(Sheet1)Range(C14) = ApplicationDDERequest(Channel $month)Worksheets(Sheet1)Range(C15) = ApplicationDDERequest(Channel $year)Worksheets(Sheet1)Range(C16) = ApplicationDDERequest(Channel $time)Worksheets(Sheet1)Range(C17) = ApplicationDDERequest(Channel $timestring)Worksheets(Sheet1)Range(C18) = ApplicationDDERequest(Channel $applicationversion)Worksheets(Sheet1)Range(C19) = ApplicationDDERequest(Channel $startddeconversations)Worksheets(Sheet1)Range(C20) = ApplicationDDERequest(Channel $accesslevel)Worksheets(Sheet1)Range(C21) = ApplicationDDERequest(Channel $alarmlogging)Worksheets(Sheet1)Range(C22) = ApplicationDDERequest(Channel $applicationchanged)Worksheets(Sheet1)Range(C23) = ApplicationDDERequest(Channel $configureusers)Worksheets(Sheet1)Range(C24) = ApplicationDDERequest(Channel $changepassword)Worksheets(Sheet1)Range(C25) = ApplicationDDERequest(Channel $InactivityTimeout)Worksheets(Sheet1)Range(C26) = ApplicationDDERequest(Channel $InactivityWarning)Worksheets(Sheet1)Range(C27) = ApplicationDDERequest(Channel $LogicRunning)Worksheets(Sheet1)Range(C28) = ApplicationDDERequest(Channel $OperatorEntered)Worksheets(Sheet1)Range(C29) = ApplicationDDERequest(Channel $Operator)Worksheets(Sheet1)Range(C30) = ApplicationDDERequest(Channel $PasswordEntered)ApplicationDDETerminate Channel This terminates the DDE channelEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 110

Visual Basic

ldquoRoll Your Ownrdquo HMI - Much More powerful than Excel

Key Parameters computer nameapplication|topicitem

IO Emulator - MBPlusSimulateexe

Can ldquoRead Fromrdquo amp ldquoWrite Tordquo PLC andor HMI

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 111

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 112

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 113

Dim PauseTime Start Finish TotalTime As Integer Declare variables

Private Sub txtAIT_332A_SCALED_Change()On Error GoTo PokeAIT_332AErrortxtAIT_332A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtAIT_332A_SCALEDText = Int((3 Rnd) + 20) Generate random value between 20 and 23txtAIT_332A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtAIT_332A_SCALEDLinkItem = AIT_332A_SCALEDtxtAIT_332A_SCALEDLinkMode = 2txtAIT_332A_SCALEDLinkPoketxtAIT_332A_SCALEDLinkMode = 0 DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total time

PokeAIT_332AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtAIT_332A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 114

Private Sub txtAIT_346A_SCALED_Change()On Error GoTo PokeAIT_346AErrortxtAIT_346A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtAIT_346A_SCALEDText = Int((3 Rnd) + 15) Generate random value between 15 and 18txtAIT_346A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtAIT_346A_SCALEDLinkItem = AIT_346A_SCALEDtxtAIT_346A_SCALEDLinkMode = 2txtAIT_346A_SCALEDLinkPoketxtAIT_346A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeAIT_346AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtAIT_346A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 115

Private Sub txtFIT_321A_SCALED_Change()On Error GoTo PokeFIT_321AErrortxtFIT_321A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtFIT_321A_SCALEDText = Int((10 Rnd) + 120) Generate random value between 120 and 130txtFIT_321A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_321A_SCALEDLinkItem = FIT_321A_SCALEDtxtFIT_321A_SCALEDLinkMode = 2txtFIT_321A_SCALEDLinkPoketxtFIT_321A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total time

PokeFIT_321AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_321A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume Next

End Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 116

Private Sub txtFIT_341A_SCALED_Change()On Error GoTo PokeFIT_341AErrortxtFIT_341A_SCALEDLinkMode = 0 PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTime

txtFIT_341A_SCALEDText = Int((3 Rnd) + 18) Generate random value between 18 and 21

txtFIT_341A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_341A_SCALEDLinkItem = FIT_341A_SCALEDtxtFIT_341A_SCALEDLinkMode = 2txtFIT_341A_SCALEDLinkPoketxtFIT_341A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeFIT_341AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_341A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 117

Private Sub txtFIT_343A_SCALED_Change()On Error GoTo PokeFIT_343AErrortxtFIT_343A_SCALEDLinkMode = 0 PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTime

txtFIT_343A_SCALEDText = Int((1 Rnd) + 3) Generate random value between 3 and 4

txtFIT_343A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_343A_SCALEDLinkItem = FIT_343A_SCALEDtxtFIT_343A_SCALEDLinkMode = 2txtFIT_343A_SCALEDLinkPoketxtFIT_343A_SCALEDLinkMode = 0 DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeFIT_343AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_343A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 118

TUTORIAL

Part 4

Questions

amp

Answers

  • Slide 1
  • Slide 2
  • Slide 3
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Slide 8
  • Slide 9
  • Slide 10
  • Slide 11
  • Slide 12
  • Slide 13
  • Slide 14
  • Slide 15
  • Slide 16
  • Slide 17
  • Slide 18
  • Slide 19
  • Slide 20
  • Slide 21
  • Slide 22
  • Slide 23
  • Slide 24
  • Slide 25
  • Slide 26
  • Slide 27
  • Slide 28
  • Slide 29
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
  • Slide 34
  • Slide 35
  • Slide 36
  • Slide 37
  • Slide 38
  • Slide 39
  • Slide 40
  • Slide 41
  • Slide 42
  • Slide 43
  • Slide 44
  • Slide 45
  • Slide 46
  • Slide 47
  • Slide 48
  • Slide 49
  • Slide 50
  • Slide 51
  • Slide 52
  • Slide 53
  • Slide 54
  • Slide 55
  • Slide 56
  • Slide 57
  • Slide 58
  • Slide 59
  • Slide 60
  • Slide 61
  • Slide 62
  • Slide 63
  • Slide 64
  • Slide 65
  • Slide 66
  • Slide 67
  • Slide 68
  • Slide 69
  • Slide 70
  • Slide 71
  • Slide 72
  • Slide 73
  • Slide 74
  • Slide 75
  • Slide 76
  • Slide 77
  • Slide 78
  • Slide 79
  • Slide 80
  • Slide 81
  • Slide 82
  • Slide 83
  • Slide 84
  • Slide 85
  • Slide 86
  • Slide 87
  • Slide 88
  • Slide 89
  • Slide 90
  • Slide 91
  • Slide 92
  • Slide 93
  • Slide 94
  • Slide 95
  • Slide 96
  • Slide 97
  • Slide 98
  • Slide 99
  • Slide 100
  • Slide 101
  • Slide 102
  • Slide 103
  • Slide 104
  • Slide 105
  • Slide 106
  • Slide 107
  • Slide 108
  • Slide 109
  • Slide 110
  • Slide 111
  • Slide 112
  • Slide 113
  • Slide 114
  • Slide 115
  • Slide 116
  • Slide 117
  • Slide 118
Page 63: TUTORIAL Ethernet PLC's Improve Oxygen Consumption ISA Expo/2001Houston, Texas Water & Wastewater Industry DivisionTuesday, September 11, 2001 1 Brad.

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 63

Structured Text was used hereNOT Ladder

Programming for Motors

The PLC DOES NOT CAREStructured Text Functions EXACTLY

the same as LadderUse what yoursquore comfortable with

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 64

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 65

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 66

IEC Function Blocks Used Here

Programming for Analogs amp PID

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 67

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 68

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 69

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 70

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 71

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 72

Sequential Function Charts were used here

Higher-Level Control

bull SFCrsquos lend themselves well to (as the name would imply) sequential processes

bull Three Important components in SFCrsquosbull Transitionsbull Stepsbull Jumps

bull The status of the process can be viewed as a flow chart

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 73

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 74

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 75

PLC - HMI Communication

A ldquoPLC Heartbeatrdquo is traditionally used to monitor the PLC - HMI Communication sometimes called ardquoWatchdog Timerrdquo

Call it whatever you want but the PLC amp 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 ldquodiesrdquo then that switch doesnrsquot change state and an alarm alerts the operator

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 76

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 77

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 78

TUTORIAL

Part 2B

HMI Programming

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 79

Ethernet (TCPIP) IO Driver

The Ethernet (TCPIP) IO Driver allows the HMI to communicate with the PLC (In this case the driver is called MBENETEXE)

The PLC has an ethernet module in one of the slots that has a ldquoCAT5RJ-45rdquo 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 ldquoCAT5RJ-45rdquo receptacle for the ethernet cable

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 80

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 81

Operator Screens amp Popup Displays

The display is laid out in 3 sections

bull Upper - Security amp Alarm Windowbull Middle- Main Operator Screens bull Lower - Menu amp Popup Displays

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 82

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 83

Scripting

There are 6 types of ldquoScriptsrdquobull Application Scriptsbull Key Scriptsbull Condition Scriptsbull Data Change Scriptsbull Quick Function Scriptsbull ActiveX Event Scripts

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 84

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 85

Access Names

The ldquoAccess Namesrdquo Must be configured to allow the PLC - HMI communications

Note that the ldquoApplicationTopicrdquo is the same as the IO Driver

The ldquocomputer namerdquo is the name of the PC that the HMI is running on (brad_s_carlberg in this case)

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 86

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 87

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 88

Indirect Tags

ldquoIndirect Tagsrdquo were used here to minimize the number of popup displays

This is especially useful in HMIrsquos with many tags

ONLY 12 popup displays are reused throughout the HMI

This gives the HMI a ldquoDCS-Likerdquo Look amp Feel

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 89

Popup Display TypesThe tag point type determines which popup display to use

Analog InputHIC (or Analog Output)PID (or Analog Composite)

bull PID WITH AUTO amp CASCADE amp RATIObull PID WITH AUTO amp RATIO

Diginbull Motor Status

DigOutMotor (or Digital Composite)

bull Motor with ILock and PermNumericSet TimersAlarm DetailAlarm Tags

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 90

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 91

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 92

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 93

Bars Buttons amp Sliders

By choosing to use indirect tags we complicate the Bar Graphs Buttons amp Sliders in the popup displays

Different scales need to be used for different engineering unit ranges

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 94

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 95

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 96

Popup Displays

The next two pages shows how the individual popup displays use the indirect tags

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 97

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 98

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 99

Adding a ldquoTouch Targetrdquo to a Display

2 Tell which tags to use

3 Tell which popup display to call upWhat kind of point type is it

3 Steps1 Tell which scale to use (if itrsquos an analog point type)

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 100

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 101

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 102

TUTORIAL

Part 2C

Excel Spreadsheets

amp

Visual Basic

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 103

A ldquoCHEAP amp DIRTYrdquo HMI With Excel

The 4 key parameters are

To communicate with the PLCUse brad_s_carlbergmbenet|ANOXIC_OXICrsquoplcregisterrsquo

Excel uses ldquopeeksrdquo amp ldquopokesrdquo to read from amp write to a PLC or HMI

To communicate with the HMIbrad_s_carlbergview|Tagnamersquotagnamersquo

bull computer namebull applicationbull topicbull item

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 104

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 105

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 106

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 107

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 108

Excel Macros

bull ldquoRequestrdquo Macro to read values

bull ldquoPokerdquo Macro to write values

bull A Sample Excel Macro

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 109

Sub PokeMacro()MsgBox ApplicationNetworkTemplatesPathChannel = ApplicationDDEInitiate(app=brad_s_carlbergVIEW topic=Tagname) This opens a DDE channel to ViewApplicationDDEPoke Channel Temperature1 Worksheets(Sheet1)Range(A1) Puts value from R1C1 into Temperature1ApplicationDDEPoke Channel DDEReal Worksheets(Sheet1)Range(A2) Puts value from R1C1 into Temperature1ApplicationDDEPoke Channel DDEInteger Worksheets(Sheet1)Range(A3) Puts value from R1C1 into Temperature1ApplicationDDETerminate Channel This terminates the DDE channelEnd SubSub RequestMacro()Channel = ApplicationDDEInitiate(app=brad_s_carlbergVIEW topic=Tagname) This opens a DDE channel to ViewWorksheets(Sheet1)Range(C4) = ApplicationDDERequest(Channel $Hour)Worksheets(Sheet1)Range(C5) = ApplicationDDERequest(Channel $Minute)Worksheets(Sheet1)Range(C6) = ApplicationDDERequest(Channel $Second)Worksheets(Sheet1)Range(C9) = ApplicationDDERequest(Channel $day)Worksheets(Sheet1)Range(C10) = ApplicationDDERequest(Channel $date)Worksheets(Sheet1)Range(C11) = ApplicationDDERequest(Channel $datestring)Worksheets(Sheet1)Range(C12) = ApplicationDDERequest(Channel $datetime)Worksheets(Sheet1)Range(C13) = ApplicationDDERequest(Channel $date)Worksheets(Sheet1)Range(C14) = ApplicationDDERequest(Channel $month)Worksheets(Sheet1)Range(C15) = ApplicationDDERequest(Channel $year)Worksheets(Sheet1)Range(C16) = ApplicationDDERequest(Channel $time)Worksheets(Sheet1)Range(C17) = ApplicationDDERequest(Channel $timestring)Worksheets(Sheet1)Range(C18) = ApplicationDDERequest(Channel $applicationversion)Worksheets(Sheet1)Range(C19) = ApplicationDDERequest(Channel $startddeconversations)Worksheets(Sheet1)Range(C20) = ApplicationDDERequest(Channel $accesslevel)Worksheets(Sheet1)Range(C21) = ApplicationDDERequest(Channel $alarmlogging)Worksheets(Sheet1)Range(C22) = ApplicationDDERequest(Channel $applicationchanged)Worksheets(Sheet1)Range(C23) = ApplicationDDERequest(Channel $configureusers)Worksheets(Sheet1)Range(C24) = ApplicationDDERequest(Channel $changepassword)Worksheets(Sheet1)Range(C25) = ApplicationDDERequest(Channel $InactivityTimeout)Worksheets(Sheet1)Range(C26) = ApplicationDDERequest(Channel $InactivityWarning)Worksheets(Sheet1)Range(C27) = ApplicationDDERequest(Channel $LogicRunning)Worksheets(Sheet1)Range(C28) = ApplicationDDERequest(Channel $OperatorEntered)Worksheets(Sheet1)Range(C29) = ApplicationDDERequest(Channel $Operator)Worksheets(Sheet1)Range(C30) = ApplicationDDERequest(Channel $PasswordEntered)ApplicationDDETerminate Channel This terminates the DDE channelEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 110

Visual Basic

ldquoRoll Your Ownrdquo HMI - Much More powerful than Excel

Key Parameters computer nameapplication|topicitem

IO Emulator - MBPlusSimulateexe

Can ldquoRead Fromrdquo amp ldquoWrite Tordquo PLC andor HMI

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 111

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 112

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 113

Dim PauseTime Start Finish TotalTime As Integer Declare variables

Private Sub txtAIT_332A_SCALED_Change()On Error GoTo PokeAIT_332AErrortxtAIT_332A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtAIT_332A_SCALEDText = Int((3 Rnd) + 20) Generate random value between 20 and 23txtAIT_332A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtAIT_332A_SCALEDLinkItem = AIT_332A_SCALEDtxtAIT_332A_SCALEDLinkMode = 2txtAIT_332A_SCALEDLinkPoketxtAIT_332A_SCALEDLinkMode = 0 DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total time

PokeAIT_332AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtAIT_332A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 114

Private Sub txtAIT_346A_SCALED_Change()On Error GoTo PokeAIT_346AErrortxtAIT_346A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtAIT_346A_SCALEDText = Int((3 Rnd) + 15) Generate random value between 15 and 18txtAIT_346A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtAIT_346A_SCALEDLinkItem = AIT_346A_SCALEDtxtAIT_346A_SCALEDLinkMode = 2txtAIT_346A_SCALEDLinkPoketxtAIT_346A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeAIT_346AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtAIT_346A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 115

Private Sub txtFIT_321A_SCALED_Change()On Error GoTo PokeFIT_321AErrortxtFIT_321A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtFIT_321A_SCALEDText = Int((10 Rnd) + 120) Generate random value between 120 and 130txtFIT_321A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_321A_SCALEDLinkItem = FIT_321A_SCALEDtxtFIT_321A_SCALEDLinkMode = 2txtFIT_321A_SCALEDLinkPoketxtFIT_321A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total time

PokeFIT_321AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_321A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume Next

End Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 116

Private Sub txtFIT_341A_SCALED_Change()On Error GoTo PokeFIT_341AErrortxtFIT_341A_SCALEDLinkMode = 0 PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTime

txtFIT_341A_SCALEDText = Int((3 Rnd) + 18) Generate random value between 18 and 21

txtFIT_341A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_341A_SCALEDLinkItem = FIT_341A_SCALEDtxtFIT_341A_SCALEDLinkMode = 2txtFIT_341A_SCALEDLinkPoketxtFIT_341A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeFIT_341AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_341A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 117

Private Sub txtFIT_343A_SCALED_Change()On Error GoTo PokeFIT_343AErrortxtFIT_343A_SCALEDLinkMode = 0 PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTime

txtFIT_343A_SCALEDText = Int((1 Rnd) + 3) Generate random value between 3 and 4

txtFIT_343A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_343A_SCALEDLinkItem = FIT_343A_SCALEDtxtFIT_343A_SCALEDLinkMode = 2txtFIT_343A_SCALEDLinkPoketxtFIT_343A_SCALEDLinkMode = 0 DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeFIT_343AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_343A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 118

TUTORIAL

Part 4

Questions

amp

Answers

  • Slide 1
  • Slide 2
  • Slide 3
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Slide 8
  • Slide 9
  • Slide 10
  • Slide 11
  • Slide 12
  • Slide 13
  • Slide 14
  • Slide 15
  • Slide 16
  • Slide 17
  • Slide 18
  • Slide 19
  • Slide 20
  • Slide 21
  • Slide 22
  • Slide 23
  • Slide 24
  • Slide 25
  • Slide 26
  • Slide 27
  • Slide 28
  • Slide 29
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
  • Slide 34
  • Slide 35
  • Slide 36
  • Slide 37
  • Slide 38
  • Slide 39
  • Slide 40
  • Slide 41
  • Slide 42
  • Slide 43
  • Slide 44
  • Slide 45
  • Slide 46
  • Slide 47
  • Slide 48
  • Slide 49
  • Slide 50
  • Slide 51
  • Slide 52
  • Slide 53
  • Slide 54
  • Slide 55
  • Slide 56
  • Slide 57
  • Slide 58
  • Slide 59
  • Slide 60
  • Slide 61
  • Slide 62
  • Slide 63
  • Slide 64
  • Slide 65
  • Slide 66
  • Slide 67
  • Slide 68
  • Slide 69
  • Slide 70
  • Slide 71
  • Slide 72
  • Slide 73
  • Slide 74
  • Slide 75
  • Slide 76
  • Slide 77
  • Slide 78
  • Slide 79
  • Slide 80
  • Slide 81
  • Slide 82
  • Slide 83
  • Slide 84
  • Slide 85
  • Slide 86
  • Slide 87
  • Slide 88
  • Slide 89
  • Slide 90
  • Slide 91
  • Slide 92
  • Slide 93
  • Slide 94
  • Slide 95
  • Slide 96
  • Slide 97
  • Slide 98
  • Slide 99
  • Slide 100
  • Slide 101
  • Slide 102
  • Slide 103
  • Slide 104
  • Slide 105
  • Slide 106
  • Slide 107
  • Slide 108
  • Slide 109
  • Slide 110
  • Slide 111
  • Slide 112
  • Slide 113
  • Slide 114
  • Slide 115
  • Slide 116
  • Slide 117
  • Slide 118
Page 64: TUTORIAL Ethernet PLC's Improve Oxygen Consumption ISA Expo/2001Houston, Texas Water & Wastewater Industry DivisionTuesday, September 11, 2001 1 Brad.

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 64

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 65

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 66

IEC Function Blocks Used Here

Programming for Analogs amp PID

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 67

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 68

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 69

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 70

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 71

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 72

Sequential Function Charts were used here

Higher-Level Control

bull SFCrsquos lend themselves well to (as the name would imply) sequential processes

bull Three Important components in SFCrsquosbull Transitionsbull Stepsbull Jumps

bull The status of the process can be viewed as a flow chart

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 73

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 74

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 75

PLC - HMI Communication

A ldquoPLC Heartbeatrdquo is traditionally used to monitor the PLC - HMI Communication sometimes called ardquoWatchdog Timerrdquo

Call it whatever you want but the PLC amp 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 ldquodiesrdquo then that switch doesnrsquot change state and an alarm alerts the operator

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 76

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 77

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 78

TUTORIAL

Part 2B

HMI Programming

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 79

Ethernet (TCPIP) IO Driver

The Ethernet (TCPIP) IO Driver allows the HMI to communicate with the PLC (In this case the driver is called MBENETEXE)

The PLC has an ethernet module in one of the slots that has a ldquoCAT5RJ-45rdquo 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 ldquoCAT5RJ-45rdquo receptacle for the ethernet cable

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 80

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 81

Operator Screens amp Popup Displays

The display is laid out in 3 sections

bull Upper - Security amp Alarm Windowbull Middle- Main Operator Screens bull Lower - Menu amp Popup Displays

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 82

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 83

Scripting

There are 6 types of ldquoScriptsrdquobull Application Scriptsbull Key Scriptsbull Condition Scriptsbull Data Change Scriptsbull Quick Function Scriptsbull ActiveX Event Scripts

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 84

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 85

Access Names

The ldquoAccess Namesrdquo Must be configured to allow the PLC - HMI communications

Note that the ldquoApplicationTopicrdquo is the same as the IO Driver

The ldquocomputer namerdquo is the name of the PC that the HMI is running on (brad_s_carlberg in this case)

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 86

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 87

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 88

Indirect Tags

ldquoIndirect Tagsrdquo were used here to minimize the number of popup displays

This is especially useful in HMIrsquos with many tags

ONLY 12 popup displays are reused throughout the HMI

This gives the HMI a ldquoDCS-Likerdquo Look amp Feel

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 89

Popup Display TypesThe tag point type determines which popup display to use

Analog InputHIC (or Analog Output)PID (or Analog Composite)

bull PID WITH AUTO amp CASCADE amp RATIObull PID WITH AUTO amp RATIO

Diginbull Motor Status

DigOutMotor (or Digital Composite)

bull Motor with ILock and PermNumericSet TimersAlarm DetailAlarm Tags

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 90

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 91

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 92

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 93

Bars Buttons amp Sliders

By choosing to use indirect tags we complicate the Bar Graphs Buttons amp Sliders in the popup displays

Different scales need to be used for different engineering unit ranges

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 94

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 95

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 96

Popup Displays

The next two pages shows how the individual popup displays use the indirect tags

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 97

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 98

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 99

Adding a ldquoTouch Targetrdquo to a Display

2 Tell which tags to use

3 Tell which popup display to call upWhat kind of point type is it

3 Steps1 Tell which scale to use (if itrsquos an analog point type)

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 100

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 101

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 102

TUTORIAL

Part 2C

Excel Spreadsheets

amp

Visual Basic

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 103

A ldquoCHEAP amp DIRTYrdquo HMI With Excel

The 4 key parameters are

To communicate with the PLCUse brad_s_carlbergmbenet|ANOXIC_OXICrsquoplcregisterrsquo

Excel uses ldquopeeksrdquo amp ldquopokesrdquo to read from amp write to a PLC or HMI

To communicate with the HMIbrad_s_carlbergview|Tagnamersquotagnamersquo

bull computer namebull applicationbull topicbull item

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 104

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 105

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 106

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 107

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 108

Excel Macros

bull ldquoRequestrdquo Macro to read values

bull ldquoPokerdquo Macro to write values

bull A Sample Excel Macro

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 109

Sub PokeMacro()MsgBox ApplicationNetworkTemplatesPathChannel = ApplicationDDEInitiate(app=brad_s_carlbergVIEW topic=Tagname) This opens a DDE channel to ViewApplicationDDEPoke Channel Temperature1 Worksheets(Sheet1)Range(A1) Puts value from R1C1 into Temperature1ApplicationDDEPoke Channel DDEReal Worksheets(Sheet1)Range(A2) Puts value from R1C1 into Temperature1ApplicationDDEPoke Channel DDEInteger Worksheets(Sheet1)Range(A3) Puts value from R1C1 into Temperature1ApplicationDDETerminate Channel This terminates the DDE channelEnd SubSub RequestMacro()Channel = ApplicationDDEInitiate(app=brad_s_carlbergVIEW topic=Tagname) This opens a DDE channel to ViewWorksheets(Sheet1)Range(C4) = ApplicationDDERequest(Channel $Hour)Worksheets(Sheet1)Range(C5) = ApplicationDDERequest(Channel $Minute)Worksheets(Sheet1)Range(C6) = ApplicationDDERequest(Channel $Second)Worksheets(Sheet1)Range(C9) = ApplicationDDERequest(Channel $day)Worksheets(Sheet1)Range(C10) = ApplicationDDERequest(Channel $date)Worksheets(Sheet1)Range(C11) = ApplicationDDERequest(Channel $datestring)Worksheets(Sheet1)Range(C12) = ApplicationDDERequest(Channel $datetime)Worksheets(Sheet1)Range(C13) = ApplicationDDERequest(Channel $date)Worksheets(Sheet1)Range(C14) = ApplicationDDERequest(Channel $month)Worksheets(Sheet1)Range(C15) = ApplicationDDERequest(Channel $year)Worksheets(Sheet1)Range(C16) = ApplicationDDERequest(Channel $time)Worksheets(Sheet1)Range(C17) = ApplicationDDERequest(Channel $timestring)Worksheets(Sheet1)Range(C18) = ApplicationDDERequest(Channel $applicationversion)Worksheets(Sheet1)Range(C19) = ApplicationDDERequest(Channel $startddeconversations)Worksheets(Sheet1)Range(C20) = ApplicationDDERequest(Channel $accesslevel)Worksheets(Sheet1)Range(C21) = ApplicationDDERequest(Channel $alarmlogging)Worksheets(Sheet1)Range(C22) = ApplicationDDERequest(Channel $applicationchanged)Worksheets(Sheet1)Range(C23) = ApplicationDDERequest(Channel $configureusers)Worksheets(Sheet1)Range(C24) = ApplicationDDERequest(Channel $changepassword)Worksheets(Sheet1)Range(C25) = ApplicationDDERequest(Channel $InactivityTimeout)Worksheets(Sheet1)Range(C26) = ApplicationDDERequest(Channel $InactivityWarning)Worksheets(Sheet1)Range(C27) = ApplicationDDERequest(Channel $LogicRunning)Worksheets(Sheet1)Range(C28) = ApplicationDDERequest(Channel $OperatorEntered)Worksheets(Sheet1)Range(C29) = ApplicationDDERequest(Channel $Operator)Worksheets(Sheet1)Range(C30) = ApplicationDDERequest(Channel $PasswordEntered)ApplicationDDETerminate Channel This terminates the DDE channelEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 110

Visual Basic

ldquoRoll Your Ownrdquo HMI - Much More powerful than Excel

Key Parameters computer nameapplication|topicitem

IO Emulator - MBPlusSimulateexe

Can ldquoRead Fromrdquo amp ldquoWrite Tordquo PLC andor HMI

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 111

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 112

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 113

Dim PauseTime Start Finish TotalTime As Integer Declare variables

Private Sub txtAIT_332A_SCALED_Change()On Error GoTo PokeAIT_332AErrortxtAIT_332A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtAIT_332A_SCALEDText = Int((3 Rnd) + 20) Generate random value between 20 and 23txtAIT_332A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtAIT_332A_SCALEDLinkItem = AIT_332A_SCALEDtxtAIT_332A_SCALEDLinkMode = 2txtAIT_332A_SCALEDLinkPoketxtAIT_332A_SCALEDLinkMode = 0 DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total time

PokeAIT_332AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtAIT_332A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 114

Private Sub txtAIT_346A_SCALED_Change()On Error GoTo PokeAIT_346AErrortxtAIT_346A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtAIT_346A_SCALEDText = Int((3 Rnd) + 15) Generate random value between 15 and 18txtAIT_346A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtAIT_346A_SCALEDLinkItem = AIT_346A_SCALEDtxtAIT_346A_SCALEDLinkMode = 2txtAIT_346A_SCALEDLinkPoketxtAIT_346A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeAIT_346AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtAIT_346A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 115

Private Sub txtFIT_321A_SCALED_Change()On Error GoTo PokeFIT_321AErrortxtFIT_321A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtFIT_321A_SCALEDText = Int((10 Rnd) + 120) Generate random value between 120 and 130txtFIT_321A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_321A_SCALEDLinkItem = FIT_321A_SCALEDtxtFIT_321A_SCALEDLinkMode = 2txtFIT_321A_SCALEDLinkPoketxtFIT_321A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total time

PokeFIT_321AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_321A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume Next

End Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 116

Private Sub txtFIT_341A_SCALED_Change()On Error GoTo PokeFIT_341AErrortxtFIT_341A_SCALEDLinkMode = 0 PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTime

txtFIT_341A_SCALEDText = Int((3 Rnd) + 18) Generate random value between 18 and 21

txtFIT_341A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_341A_SCALEDLinkItem = FIT_341A_SCALEDtxtFIT_341A_SCALEDLinkMode = 2txtFIT_341A_SCALEDLinkPoketxtFIT_341A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeFIT_341AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_341A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 117

Private Sub txtFIT_343A_SCALED_Change()On Error GoTo PokeFIT_343AErrortxtFIT_343A_SCALEDLinkMode = 0 PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTime

txtFIT_343A_SCALEDText = Int((1 Rnd) + 3) Generate random value between 3 and 4

txtFIT_343A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_343A_SCALEDLinkItem = FIT_343A_SCALEDtxtFIT_343A_SCALEDLinkMode = 2txtFIT_343A_SCALEDLinkPoketxtFIT_343A_SCALEDLinkMode = 0 DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeFIT_343AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_343A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 118

TUTORIAL

Part 4

Questions

amp

Answers

  • Slide 1
  • Slide 2
  • Slide 3
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Slide 8
  • Slide 9
  • Slide 10
  • Slide 11
  • Slide 12
  • Slide 13
  • Slide 14
  • Slide 15
  • Slide 16
  • Slide 17
  • Slide 18
  • Slide 19
  • Slide 20
  • Slide 21
  • Slide 22
  • Slide 23
  • Slide 24
  • Slide 25
  • Slide 26
  • Slide 27
  • Slide 28
  • Slide 29
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
  • Slide 34
  • Slide 35
  • Slide 36
  • Slide 37
  • Slide 38
  • Slide 39
  • Slide 40
  • Slide 41
  • Slide 42
  • Slide 43
  • Slide 44
  • Slide 45
  • Slide 46
  • Slide 47
  • Slide 48
  • Slide 49
  • Slide 50
  • Slide 51
  • Slide 52
  • Slide 53
  • Slide 54
  • Slide 55
  • Slide 56
  • Slide 57
  • Slide 58
  • Slide 59
  • Slide 60
  • Slide 61
  • Slide 62
  • Slide 63
  • Slide 64
  • Slide 65
  • Slide 66
  • Slide 67
  • Slide 68
  • Slide 69
  • Slide 70
  • Slide 71
  • Slide 72
  • Slide 73
  • Slide 74
  • Slide 75
  • Slide 76
  • Slide 77
  • Slide 78
  • Slide 79
  • Slide 80
  • Slide 81
  • Slide 82
  • Slide 83
  • Slide 84
  • Slide 85
  • Slide 86
  • Slide 87
  • Slide 88
  • Slide 89
  • Slide 90
  • Slide 91
  • Slide 92
  • Slide 93
  • Slide 94
  • Slide 95
  • Slide 96
  • Slide 97
  • Slide 98
  • Slide 99
  • Slide 100
  • Slide 101
  • Slide 102
  • Slide 103
  • Slide 104
  • Slide 105
  • Slide 106
  • Slide 107
  • Slide 108
  • Slide 109
  • Slide 110
  • Slide 111
  • Slide 112
  • Slide 113
  • Slide 114
  • Slide 115
  • Slide 116
  • Slide 117
  • Slide 118
Page 65: TUTORIAL Ethernet PLC's Improve Oxygen Consumption ISA Expo/2001Houston, Texas Water & Wastewater Industry DivisionTuesday, September 11, 2001 1 Brad.

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 65

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 66

IEC Function Blocks Used Here

Programming for Analogs amp PID

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 67

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 68

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 69

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 70

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 71

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 72

Sequential Function Charts were used here

Higher-Level Control

bull SFCrsquos lend themselves well to (as the name would imply) sequential processes

bull Three Important components in SFCrsquosbull Transitionsbull Stepsbull Jumps

bull The status of the process can be viewed as a flow chart

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 73

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 74

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 75

PLC - HMI Communication

A ldquoPLC Heartbeatrdquo is traditionally used to monitor the PLC - HMI Communication sometimes called ardquoWatchdog Timerrdquo

Call it whatever you want but the PLC amp 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 ldquodiesrdquo then that switch doesnrsquot change state and an alarm alerts the operator

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 76

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 77

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 78

TUTORIAL

Part 2B

HMI Programming

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 79

Ethernet (TCPIP) IO Driver

The Ethernet (TCPIP) IO Driver allows the HMI to communicate with the PLC (In this case the driver is called MBENETEXE)

The PLC has an ethernet module in one of the slots that has a ldquoCAT5RJ-45rdquo 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 ldquoCAT5RJ-45rdquo receptacle for the ethernet cable

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 80

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 81

Operator Screens amp Popup Displays

The display is laid out in 3 sections

bull Upper - Security amp Alarm Windowbull Middle- Main Operator Screens bull Lower - Menu amp Popup Displays

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 82

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 83

Scripting

There are 6 types of ldquoScriptsrdquobull Application Scriptsbull Key Scriptsbull Condition Scriptsbull Data Change Scriptsbull Quick Function Scriptsbull ActiveX Event Scripts

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 84

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 85

Access Names

The ldquoAccess Namesrdquo Must be configured to allow the PLC - HMI communications

Note that the ldquoApplicationTopicrdquo is the same as the IO Driver

The ldquocomputer namerdquo is the name of the PC that the HMI is running on (brad_s_carlberg in this case)

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 86

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 87

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 88

Indirect Tags

ldquoIndirect Tagsrdquo were used here to minimize the number of popup displays

This is especially useful in HMIrsquos with many tags

ONLY 12 popup displays are reused throughout the HMI

This gives the HMI a ldquoDCS-Likerdquo Look amp Feel

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 89

Popup Display TypesThe tag point type determines which popup display to use

Analog InputHIC (or Analog Output)PID (or Analog Composite)

bull PID WITH AUTO amp CASCADE amp RATIObull PID WITH AUTO amp RATIO

Diginbull Motor Status

DigOutMotor (or Digital Composite)

bull Motor with ILock and PermNumericSet TimersAlarm DetailAlarm Tags

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 90

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 91

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 92

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 93

Bars Buttons amp Sliders

By choosing to use indirect tags we complicate the Bar Graphs Buttons amp Sliders in the popup displays

Different scales need to be used for different engineering unit ranges

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 94

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 95

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 96

Popup Displays

The next two pages shows how the individual popup displays use the indirect tags

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 97

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 98

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 99

Adding a ldquoTouch Targetrdquo to a Display

2 Tell which tags to use

3 Tell which popup display to call upWhat kind of point type is it

3 Steps1 Tell which scale to use (if itrsquos an analog point type)

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 100

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 101

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 102

TUTORIAL

Part 2C

Excel Spreadsheets

amp

Visual Basic

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 103

A ldquoCHEAP amp DIRTYrdquo HMI With Excel

The 4 key parameters are

To communicate with the PLCUse brad_s_carlbergmbenet|ANOXIC_OXICrsquoplcregisterrsquo

Excel uses ldquopeeksrdquo amp ldquopokesrdquo to read from amp write to a PLC or HMI

To communicate with the HMIbrad_s_carlbergview|Tagnamersquotagnamersquo

bull computer namebull applicationbull topicbull item

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 104

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 105

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 106

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 107

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 108

Excel Macros

bull ldquoRequestrdquo Macro to read values

bull ldquoPokerdquo Macro to write values

bull A Sample Excel Macro

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 109

Sub PokeMacro()MsgBox ApplicationNetworkTemplatesPathChannel = ApplicationDDEInitiate(app=brad_s_carlbergVIEW topic=Tagname) This opens a DDE channel to ViewApplicationDDEPoke Channel Temperature1 Worksheets(Sheet1)Range(A1) Puts value from R1C1 into Temperature1ApplicationDDEPoke Channel DDEReal Worksheets(Sheet1)Range(A2) Puts value from R1C1 into Temperature1ApplicationDDEPoke Channel DDEInteger Worksheets(Sheet1)Range(A3) Puts value from R1C1 into Temperature1ApplicationDDETerminate Channel This terminates the DDE channelEnd SubSub RequestMacro()Channel = ApplicationDDEInitiate(app=brad_s_carlbergVIEW topic=Tagname) This opens a DDE channel to ViewWorksheets(Sheet1)Range(C4) = ApplicationDDERequest(Channel $Hour)Worksheets(Sheet1)Range(C5) = ApplicationDDERequest(Channel $Minute)Worksheets(Sheet1)Range(C6) = ApplicationDDERequest(Channel $Second)Worksheets(Sheet1)Range(C9) = ApplicationDDERequest(Channel $day)Worksheets(Sheet1)Range(C10) = ApplicationDDERequest(Channel $date)Worksheets(Sheet1)Range(C11) = ApplicationDDERequest(Channel $datestring)Worksheets(Sheet1)Range(C12) = ApplicationDDERequest(Channel $datetime)Worksheets(Sheet1)Range(C13) = ApplicationDDERequest(Channel $date)Worksheets(Sheet1)Range(C14) = ApplicationDDERequest(Channel $month)Worksheets(Sheet1)Range(C15) = ApplicationDDERequest(Channel $year)Worksheets(Sheet1)Range(C16) = ApplicationDDERequest(Channel $time)Worksheets(Sheet1)Range(C17) = ApplicationDDERequest(Channel $timestring)Worksheets(Sheet1)Range(C18) = ApplicationDDERequest(Channel $applicationversion)Worksheets(Sheet1)Range(C19) = ApplicationDDERequest(Channel $startddeconversations)Worksheets(Sheet1)Range(C20) = ApplicationDDERequest(Channel $accesslevel)Worksheets(Sheet1)Range(C21) = ApplicationDDERequest(Channel $alarmlogging)Worksheets(Sheet1)Range(C22) = ApplicationDDERequest(Channel $applicationchanged)Worksheets(Sheet1)Range(C23) = ApplicationDDERequest(Channel $configureusers)Worksheets(Sheet1)Range(C24) = ApplicationDDERequest(Channel $changepassword)Worksheets(Sheet1)Range(C25) = ApplicationDDERequest(Channel $InactivityTimeout)Worksheets(Sheet1)Range(C26) = ApplicationDDERequest(Channel $InactivityWarning)Worksheets(Sheet1)Range(C27) = ApplicationDDERequest(Channel $LogicRunning)Worksheets(Sheet1)Range(C28) = ApplicationDDERequest(Channel $OperatorEntered)Worksheets(Sheet1)Range(C29) = ApplicationDDERequest(Channel $Operator)Worksheets(Sheet1)Range(C30) = ApplicationDDERequest(Channel $PasswordEntered)ApplicationDDETerminate Channel This terminates the DDE channelEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 110

Visual Basic

ldquoRoll Your Ownrdquo HMI - Much More powerful than Excel

Key Parameters computer nameapplication|topicitem

IO Emulator - MBPlusSimulateexe

Can ldquoRead Fromrdquo amp ldquoWrite Tordquo PLC andor HMI

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 111

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 112

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 113

Dim PauseTime Start Finish TotalTime As Integer Declare variables

Private Sub txtAIT_332A_SCALED_Change()On Error GoTo PokeAIT_332AErrortxtAIT_332A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtAIT_332A_SCALEDText = Int((3 Rnd) + 20) Generate random value between 20 and 23txtAIT_332A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtAIT_332A_SCALEDLinkItem = AIT_332A_SCALEDtxtAIT_332A_SCALEDLinkMode = 2txtAIT_332A_SCALEDLinkPoketxtAIT_332A_SCALEDLinkMode = 0 DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total time

PokeAIT_332AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtAIT_332A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 114

Private Sub txtAIT_346A_SCALED_Change()On Error GoTo PokeAIT_346AErrortxtAIT_346A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtAIT_346A_SCALEDText = Int((3 Rnd) + 15) Generate random value between 15 and 18txtAIT_346A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtAIT_346A_SCALEDLinkItem = AIT_346A_SCALEDtxtAIT_346A_SCALEDLinkMode = 2txtAIT_346A_SCALEDLinkPoketxtAIT_346A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeAIT_346AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtAIT_346A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 115

Private Sub txtFIT_321A_SCALED_Change()On Error GoTo PokeFIT_321AErrortxtFIT_321A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtFIT_321A_SCALEDText = Int((10 Rnd) + 120) Generate random value between 120 and 130txtFIT_321A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_321A_SCALEDLinkItem = FIT_321A_SCALEDtxtFIT_321A_SCALEDLinkMode = 2txtFIT_321A_SCALEDLinkPoketxtFIT_321A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total time

PokeFIT_321AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_321A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume Next

End Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 116

Private Sub txtFIT_341A_SCALED_Change()On Error GoTo PokeFIT_341AErrortxtFIT_341A_SCALEDLinkMode = 0 PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTime

txtFIT_341A_SCALEDText = Int((3 Rnd) + 18) Generate random value between 18 and 21

txtFIT_341A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_341A_SCALEDLinkItem = FIT_341A_SCALEDtxtFIT_341A_SCALEDLinkMode = 2txtFIT_341A_SCALEDLinkPoketxtFIT_341A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeFIT_341AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_341A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 117

Private Sub txtFIT_343A_SCALED_Change()On Error GoTo PokeFIT_343AErrortxtFIT_343A_SCALEDLinkMode = 0 PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTime

txtFIT_343A_SCALEDText = Int((1 Rnd) + 3) Generate random value between 3 and 4

txtFIT_343A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_343A_SCALEDLinkItem = FIT_343A_SCALEDtxtFIT_343A_SCALEDLinkMode = 2txtFIT_343A_SCALEDLinkPoketxtFIT_343A_SCALEDLinkMode = 0 DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeFIT_343AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_343A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 118

TUTORIAL

Part 4

Questions

amp

Answers

  • Slide 1
  • Slide 2
  • Slide 3
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Slide 8
  • Slide 9
  • Slide 10
  • Slide 11
  • Slide 12
  • Slide 13
  • Slide 14
  • Slide 15
  • Slide 16
  • Slide 17
  • Slide 18
  • Slide 19
  • Slide 20
  • Slide 21
  • Slide 22
  • Slide 23
  • Slide 24
  • Slide 25
  • Slide 26
  • Slide 27
  • Slide 28
  • Slide 29
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
  • Slide 34
  • Slide 35
  • Slide 36
  • Slide 37
  • Slide 38
  • Slide 39
  • Slide 40
  • Slide 41
  • Slide 42
  • Slide 43
  • Slide 44
  • Slide 45
  • Slide 46
  • Slide 47
  • Slide 48
  • Slide 49
  • Slide 50
  • Slide 51
  • Slide 52
  • Slide 53
  • Slide 54
  • Slide 55
  • Slide 56
  • Slide 57
  • Slide 58
  • Slide 59
  • Slide 60
  • Slide 61
  • Slide 62
  • Slide 63
  • Slide 64
  • Slide 65
  • Slide 66
  • Slide 67
  • Slide 68
  • Slide 69
  • Slide 70
  • Slide 71
  • Slide 72
  • Slide 73
  • Slide 74
  • Slide 75
  • Slide 76
  • Slide 77
  • Slide 78
  • Slide 79
  • Slide 80
  • Slide 81
  • Slide 82
  • Slide 83
  • Slide 84
  • Slide 85
  • Slide 86
  • Slide 87
  • Slide 88
  • Slide 89
  • Slide 90
  • Slide 91
  • Slide 92
  • Slide 93
  • Slide 94
  • Slide 95
  • Slide 96
  • Slide 97
  • Slide 98
  • Slide 99
  • Slide 100
  • Slide 101
  • Slide 102
  • Slide 103
  • Slide 104
  • Slide 105
  • Slide 106
  • Slide 107
  • Slide 108
  • Slide 109
  • Slide 110
  • Slide 111
  • Slide 112
  • Slide 113
  • Slide 114
  • Slide 115
  • Slide 116
  • Slide 117
  • Slide 118
Page 66: TUTORIAL Ethernet PLC's Improve Oxygen Consumption ISA Expo/2001Houston, Texas Water & Wastewater Industry DivisionTuesday, September 11, 2001 1 Brad.

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 66

IEC Function Blocks Used Here

Programming for Analogs amp PID

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 67

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 68

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 69

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 70

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 71

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 72

Sequential Function Charts were used here

Higher-Level Control

bull SFCrsquos lend themselves well to (as the name would imply) sequential processes

bull Three Important components in SFCrsquosbull Transitionsbull Stepsbull Jumps

bull The status of the process can be viewed as a flow chart

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 73

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 74

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 75

PLC - HMI Communication

A ldquoPLC Heartbeatrdquo is traditionally used to monitor the PLC - HMI Communication sometimes called ardquoWatchdog Timerrdquo

Call it whatever you want but the PLC amp 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 ldquodiesrdquo then that switch doesnrsquot change state and an alarm alerts the operator

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 76

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 77

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 78

TUTORIAL

Part 2B

HMI Programming

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 79

Ethernet (TCPIP) IO Driver

The Ethernet (TCPIP) IO Driver allows the HMI to communicate with the PLC (In this case the driver is called MBENETEXE)

The PLC has an ethernet module in one of the slots that has a ldquoCAT5RJ-45rdquo 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 ldquoCAT5RJ-45rdquo receptacle for the ethernet cable

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 80

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 81

Operator Screens amp Popup Displays

The display is laid out in 3 sections

bull Upper - Security amp Alarm Windowbull Middle- Main Operator Screens bull Lower - Menu amp Popup Displays

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 82

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 83

Scripting

There are 6 types of ldquoScriptsrdquobull Application Scriptsbull Key Scriptsbull Condition Scriptsbull Data Change Scriptsbull Quick Function Scriptsbull ActiveX Event Scripts

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 84

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 85

Access Names

The ldquoAccess Namesrdquo Must be configured to allow the PLC - HMI communications

Note that the ldquoApplicationTopicrdquo is the same as the IO Driver

The ldquocomputer namerdquo is the name of the PC that the HMI is running on (brad_s_carlberg in this case)

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 86

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 87

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 88

Indirect Tags

ldquoIndirect Tagsrdquo were used here to minimize the number of popup displays

This is especially useful in HMIrsquos with many tags

ONLY 12 popup displays are reused throughout the HMI

This gives the HMI a ldquoDCS-Likerdquo Look amp Feel

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 89

Popup Display TypesThe tag point type determines which popup display to use

Analog InputHIC (or Analog Output)PID (or Analog Composite)

bull PID WITH AUTO amp CASCADE amp RATIObull PID WITH AUTO amp RATIO

Diginbull Motor Status

DigOutMotor (or Digital Composite)

bull Motor with ILock and PermNumericSet TimersAlarm DetailAlarm Tags

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 90

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 91

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 92

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 93

Bars Buttons amp Sliders

By choosing to use indirect tags we complicate the Bar Graphs Buttons amp Sliders in the popup displays

Different scales need to be used for different engineering unit ranges

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 94

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 95

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 96

Popup Displays

The next two pages shows how the individual popup displays use the indirect tags

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 97

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 98

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 99

Adding a ldquoTouch Targetrdquo to a Display

2 Tell which tags to use

3 Tell which popup display to call upWhat kind of point type is it

3 Steps1 Tell which scale to use (if itrsquos an analog point type)

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 100

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 101

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 102

TUTORIAL

Part 2C

Excel Spreadsheets

amp

Visual Basic

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 103

A ldquoCHEAP amp DIRTYrdquo HMI With Excel

The 4 key parameters are

To communicate with the PLCUse brad_s_carlbergmbenet|ANOXIC_OXICrsquoplcregisterrsquo

Excel uses ldquopeeksrdquo amp ldquopokesrdquo to read from amp write to a PLC or HMI

To communicate with the HMIbrad_s_carlbergview|Tagnamersquotagnamersquo

bull computer namebull applicationbull topicbull item

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 104

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 105

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 106

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 107

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 108

Excel Macros

bull ldquoRequestrdquo Macro to read values

bull ldquoPokerdquo Macro to write values

bull A Sample Excel Macro

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 109

Sub PokeMacro()MsgBox ApplicationNetworkTemplatesPathChannel = ApplicationDDEInitiate(app=brad_s_carlbergVIEW topic=Tagname) This opens a DDE channel to ViewApplicationDDEPoke Channel Temperature1 Worksheets(Sheet1)Range(A1) Puts value from R1C1 into Temperature1ApplicationDDEPoke Channel DDEReal Worksheets(Sheet1)Range(A2) Puts value from R1C1 into Temperature1ApplicationDDEPoke Channel DDEInteger Worksheets(Sheet1)Range(A3) Puts value from R1C1 into Temperature1ApplicationDDETerminate Channel This terminates the DDE channelEnd SubSub RequestMacro()Channel = ApplicationDDEInitiate(app=brad_s_carlbergVIEW topic=Tagname) This opens a DDE channel to ViewWorksheets(Sheet1)Range(C4) = ApplicationDDERequest(Channel $Hour)Worksheets(Sheet1)Range(C5) = ApplicationDDERequest(Channel $Minute)Worksheets(Sheet1)Range(C6) = ApplicationDDERequest(Channel $Second)Worksheets(Sheet1)Range(C9) = ApplicationDDERequest(Channel $day)Worksheets(Sheet1)Range(C10) = ApplicationDDERequest(Channel $date)Worksheets(Sheet1)Range(C11) = ApplicationDDERequest(Channel $datestring)Worksheets(Sheet1)Range(C12) = ApplicationDDERequest(Channel $datetime)Worksheets(Sheet1)Range(C13) = ApplicationDDERequest(Channel $date)Worksheets(Sheet1)Range(C14) = ApplicationDDERequest(Channel $month)Worksheets(Sheet1)Range(C15) = ApplicationDDERequest(Channel $year)Worksheets(Sheet1)Range(C16) = ApplicationDDERequest(Channel $time)Worksheets(Sheet1)Range(C17) = ApplicationDDERequest(Channel $timestring)Worksheets(Sheet1)Range(C18) = ApplicationDDERequest(Channel $applicationversion)Worksheets(Sheet1)Range(C19) = ApplicationDDERequest(Channel $startddeconversations)Worksheets(Sheet1)Range(C20) = ApplicationDDERequest(Channel $accesslevel)Worksheets(Sheet1)Range(C21) = ApplicationDDERequest(Channel $alarmlogging)Worksheets(Sheet1)Range(C22) = ApplicationDDERequest(Channel $applicationchanged)Worksheets(Sheet1)Range(C23) = ApplicationDDERequest(Channel $configureusers)Worksheets(Sheet1)Range(C24) = ApplicationDDERequest(Channel $changepassword)Worksheets(Sheet1)Range(C25) = ApplicationDDERequest(Channel $InactivityTimeout)Worksheets(Sheet1)Range(C26) = ApplicationDDERequest(Channel $InactivityWarning)Worksheets(Sheet1)Range(C27) = ApplicationDDERequest(Channel $LogicRunning)Worksheets(Sheet1)Range(C28) = ApplicationDDERequest(Channel $OperatorEntered)Worksheets(Sheet1)Range(C29) = ApplicationDDERequest(Channel $Operator)Worksheets(Sheet1)Range(C30) = ApplicationDDERequest(Channel $PasswordEntered)ApplicationDDETerminate Channel This terminates the DDE channelEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 110

Visual Basic

ldquoRoll Your Ownrdquo HMI - Much More powerful than Excel

Key Parameters computer nameapplication|topicitem

IO Emulator - MBPlusSimulateexe

Can ldquoRead Fromrdquo amp ldquoWrite Tordquo PLC andor HMI

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 111

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 112

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 113

Dim PauseTime Start Finish TotalTime As Integer Declare variables

Private Sub txtAIT_332A_SCALED_Change()On Error GoTo PokeAIT_332AErrortxtAIT_332A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtAIT_332A_SCALEDText = Int((3 Rnd) + 20) Generate random value between 20 and 23txtAIT_332A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtAIT_332A_SCALEDLinkItem = AIT_332A_SCALEDtxtAIT_332A_SCALEDLinkMode = 2txtAIT_332A_SCALEDLinkPoketxtAIT_332A_SCALEDLinkMode = 0 DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total time

PokeAIT_332AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtAIT_332A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 114

Private Sub txtAIT_346A_SCALED_Change()On Error GoTo PokeAIT_346AErrortxtAIT_346A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtAIT_346A_SCALEDText = Int((3 Rnd) + 15) Generate random value between 15 and 18txtAIT_346A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtAIT_346A_SCALEDLinkItem = AIT_346A_SCALEDtxtAIT_346A_SCALEDLinkMode = 2txtAIT_346A_SCALEDLinkPoketxtAIT_346A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeAIT_346AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtAIT_346A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 115

Private Sub txtFIT_321A_SCALED_Change()On Error GoTo PokeFIT_321AErrortxtFIT_321A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtFIT_321A_SCALEDText = Int((10 Rnd) + 120) Generate random value between 120 and 130txtFIT_321A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_321A_SCALEDLinkItem = FIT_321A_SCALEDtxtFIT_321A_SCALEDLinkMode = 2txtFIT_321A_SCALEDLinkPoketxtFIT_321A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total time

PokeFIT_321AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_321A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume Next

End Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 116

Private Sub txtFIT_341A_SCALED_Change()On Error GoTo PokeFIT_341AErrortxtFIT_341A_SCALEDLinkMode = 0 PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTime

txtFIT_341A_SCALEDText = Int((3 Rnd) + 18) Generate random value between 18 and 21

txtFIT_341A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_341A_SCALEDLinkItem = FIT_341A_SCALEDtxtFIT_341A_SCALEDLinkMode = 2txtFIT_341A_SCALEDLinkPoketxtFIT_341A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeFIT_341AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_341A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 117

Private Sub txtFIT_343A_SCALED_Change()On Error GoTo PokeFIT_343AErrortxtFIT_343A_SCALEDLinkMode = 0 PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTime

txtFIT_343A_SCALEDText = Int((1 Rnd) + 3) Generate random value between 3 and 4

txtFIT_343A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_343A_SCALEDLinkItem = FIT_343A_SCALEDtxtFIT_343A_SCALEDLinkMode = 2txtFIT_343A_SCALEDLinkPoketxtFIT_343A_SCALEDLinkMode = 0 DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeFIT_343AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_343A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 118

TUTORIAL

Part 4

Questions

amp

Answers

  • Slide 1
  • Slide 2
  • Slide 3
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Slide 8
  • Slide 9
  • Slide 10
  • Slide 11
  • Slide 12
  • Slide 13
  • Slide 14
  • Slide 15
  • Slide 16
  • Slide 17
  • Slide 18
  • Slide 19
  • Slide 20
  • Slide 21
  • Slide 22
  • Slide 23
  • Slide 24
  • Slide 25
  • Slide 26
  • Slide 27
  • Slide 28
  • Slide 29
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
  • Slide 34
  • Slide 35
  • Slide 36
  • Slide 37
  • Slide 38
  • Slide 39
  • Slide 40
  • Slide 41
  • Slide 42
  • Slide 43
  • Slide 44
  • Slide 45
  • Slide 46
  • Slide 47
  • Slide 48
  • Slide 49
  • Slide 50
  • Slide 51
  • Slide 52
  • Slide 53
  • Slide 54
  • Slide 55
  • Slide 56
  • Slide 57
  • Slide 58
  • Slide 59
  • Slide 60
  • Slide 61
  • Slide 62
  • Slide 63
  • Slide 64
  • Slide 65
  • Slide 66
  • Slide 67
  • Slide 68
  • Slide 69
  • Slide 70
  • Slide 71
  • Slide 72
  • Slide 73
  • Slide 74
  • Slide 75
  • Slide 76
  • Slide 77
  • Slide 78
  • Slide 79
  • Slide 80
  • Slide 81
  • Slide 82
  • Slide 83
  • Slide 84
  • Slide 85
  • Slide 86
  • Slide 87
  • Slide 88
  • Slide 89
  • Slide 90
  • Slide 91
  • Slide 92
  • Slide 93
  • Slide 94
  • Slide 95
  • Slide 96
  • Slide 97
  • Slide 98
  • Slide 99
  • Slide 100
  • Slide 101
  • Slide 102
  • Slide 103
  • Slide 104
  • Slide 105
  • Slide 106
  • Slide 107
  • Slide 108
  • Slide 109
  • Slide 110
  • Slide 111
  • Slide 112
  • Slide 113
  • Slide 114
  • Slide 115
  • Slide 116
  • Slide 117
  • Slide 118
Page 67: TUTORIAL Ethernet PLC's Improve Oxygen Consumption ISA Expo/2001Houston, Texas Water & Wastewater Industry DivisionTuesday, September 11, 2001 1 Brad.

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 67

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 68

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 69

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 70

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 71

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 72

Sequential Function Charts were used here

Higher-Level Control

bull SFCrsquos lend themselves well to (as the name would imply) sequential processes

bull Three Important components in SFCrsquosbull Transitionsbull Stepsbull Jumps

bull The status of the process can be viewed as a flow chart

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 73

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 74

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 75

PLC - HMI Communication

A ldquoPLC Heartbeatrdquo is traditionally used to monitor the PLC - HMI Communication sometimes called ardquoWatchdog Timerrdquo

Call it whatever you want but the PLC amp 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 ldquodiesrdquo then that switch doesnrsquot change state and an alarm alerts the operator

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 76

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 77

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 78

TUTORIAL

Part 2B

HMI Programming

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 79

Ethernet (TCPIP) IO Driver

The Ethernet (TCPIP) IO Driver allows the HMI to communicate with the PLC (In this case the driver is called MBENETEXE)

The PLC has an ethernet module in one of the slots that has a ldquoCAT5RJ-45rdquo 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 ldquoCAT5RJ-45rdquo receptacle for the ethernet cable

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 80

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 81

Operator Screens amp Popup Displays

The display is laid out in 3 sections

bull Upper - Security amp Alarm Windowbull Middle- Main Operator Screens bull Lower - Menu amp Popup Displays

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 82

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 83

Scripting

There are 6 types of ldquoScriptsrdquobull Application Scriptsbull Key Scriptsbull Condition Scriptsbull Data Change Scriptsbull Quick Function Scriptsbull ActiveX Event Scripts

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 84

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 85

Access Names

The ldquoAccess Namesrdquo Must be configured to allow the PLC - HMI communications

Note that the ldquoApplicationTopicrdquo is the same as the IO Driver

The ldquocomputer namerdquo is the name of the PC that the HMI is running on (brad_s_carlberg in this case)

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 86

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 87

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 88

Indirect Tags

ldquoIndirect Tagsrdquo were used here to minimize the number of popup displays

This is especially useful in HMIrsquos with many tags

ONLY 12 popup displays are reused throughout the HMI

This gives the HMI a ldquoDCS-Likerdquo Look amp Feel

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 89

Popup Display TypesThe tag point type determines which popup display to use

Analog InputHIC (or Analog Output)PID (or Analog Composite)

bull PID WITH AUTO amp CASCADE amp RATIObull PID WITH AUTO amp RATIO

Diginbull Motor Status

DigOutMotor (or Digital Composite)

bull Motor with ILock and PermNumericSet TimersAlarm DetailAlarm Tags

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 90

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 91

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 92

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 93

Bars Buttons amp Sliders

By choosing to use indirect tags we complicate the Bar Graphs Buttons amp Sliders in the popup displays

Different scales need to be used for different engineering unit ranges

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 94

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 95

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 96

Popup Displays

The next two pages shows how the individual popup displays use the indirect tags

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 97

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 98

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 99

Adding a ldquoTouch Targetrdquo to a Display

2 Tell which tags to use

3 Tell which popup display to call upWhat kind of point type is it

3 Steps1 Tell which scale to use (if itrsquos an analog point type)

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 100

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 101

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 102

TUTORIAL

Part 2C

Excel Spreadsheets

amp

Visual Basic

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 103

A ldquoCHEAP amp DIRTYrdquo HMI With Excel

The 4 key parameters are

To communicate with the PLCUse brad_s_carlbergmbenet|ANOXIC_OXICrsquoplcregisterrsquo

Excel uses ldquopeeksrdquo amp ldquopokesrdquo to read from amp write to a PLC or HMI

To communicate with the HMIbrad_s_carlbergview|Tagnamersquotagnamersquo

bull computer namebull applicationbull topicbull item

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 104

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 105

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 106

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 107

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 108

Excel Macros

bull ldquoRequestrdquo Macro to read values

bull ldquoPokerdquo Macro to write values

bull A Sample Excel Macro

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 109

Sub PokeMacro()MsgBox ApplicationNetworkTemplatesPathChannel = ApplicationDDEInitiate(app=brad_s_carlbergVIEW topic=Tagname) This opens a DDE channel to ViewApplicationDDEPoke Channel Temperature1 Worksheets(Sheet1)Range(A1) Puts value from R1C1 into Temperature1ApplicationDDEPoke Channel DDEReal Worksheets(Sheet1)Range(A2) Puts value from R1C1 into Temperature1ApplicationDDEPoke Channel DDEInteger Worksheets(Sheet1)Range(A3) Puts value from R1C1 into Temperature1ApplicationDDETerminate Channel This terminates the DDE channelEnd SubSub RequestMacro()Channel = ApplicationDDEInitiate(app=brad_s_carlbergVIEW topic=Tagname) This opens a DDE channel to ViewWorksheets(Sheet1)Range(C4) = ApplicationDDERequest(Channel $Hour)Worksheets(Sheet1)Range(C5) = ApplicationDDERequest(Channel $Minute)Worksheets(Sheet1)Range(C6) = ApplicationDDERequest(Channel $Second)Worksheets(Sheet1)Range(C9) = ApplicationDDERequest(Channel $day)Worksheets(Sheet1)Range(C10) = ApplicationDDERequest(Channel $date)Worksheets(Sheet1)Range(C11) = ApplicationDDERequest(Channel $datestring)Worksheets(Sheet1)Range(C12) = ApplicationDDERequest(Channel $datetime)Worksheets(Sheet1)Range(C13) = ApplicationDDERequest(Channel $date)Worksheets(Sheet1)Range(C14) = ApplicationDDERequest(Channel $month)Worksheets(Sheet1)Range(C15) = ApplicationDDERequest(Channel $year)Worksheets(Sheet1)Range(C16) = ApplicationDDERequest(Channel $time)Worksheets(Sheet1)Range(C17) = ApplicationDDERequest(Channel $timestring)Worksheets(Sheet1)Range(C18) = ApplicationDDERequest(Channel $applicationversion)Worksheets(Sheet1)Range(C19) = ApplicationDDERequest(Channel $startddeconversations)Worksheets(Sheet1)Range(C20) = ApplicationDDERequest(Channel $accesslevel)Worksheets(Sheet1)Range(C21) = ApplicationDDERequest(Channel $alarmlogging)Worksheets(Sheet1)Range(C22) = ApplicationDDERequest(Channel $applicationchanged)Worksheets(Sheet1)Range(C23) = ApplicationDDERequest(Channel $configureusers)Worksheets(Sheet1)Range(C24) = ApplicationDDERequest(Channel $changepassword)Worksheets(Sheet1)Range(C25) = ApplicationDDERequest(Channel $InactivityTimeout)Worksheets(Sheet1)Range(C26) = ApplicationDDERequest(Channel $InactivityWarning)Worksheets(Sheet1)Range(C27) = ApplicationDDERequest(Channel $LogicRunning)Worksheets(Sheet1)Range(C28) = ApplicationDDERequest(Channel $OperatorEntered)Worksheets(Sheet1)Range(C29) = ApplicationDDERequest(Channel $Operator)Worksheets(Sheet1)Range(C30) = ApplicationDDERequest(Channel $PasswordEntered)ApplicationDDETerminate Channel This terminates the DDE channelEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 110

Visual Basic

ldquoRoll Your Ownrdquo HMI - Much More powerful than Excel

Key Parameters computer nameapplication|topicitem

IO Emulator - MBPlusSimulateexe

Can ldquoRead Fromrdquo amp ldquoWrite Tordquo PLC andor HMI

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 111

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 112

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 113

Dim PauseTime Start Finish TotalTime As Integer Declare variables

Private Sub txtAIT_332A_SCALED_Change()On Error GoTo PokeAIT_332AErrortxtAIT_332A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtAIT_332A_SCALEDText = Int((3 Rnd) + 20) Generate random value between 20 and 23txtAIT_332A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtAIT_332A_SCALEDLinkItem = AIT_332A_SCALEDtxtAIT_332A_SCALEDLinkMode = 2txtAIT_332A_SCALEDLinkPoketxtAIT_332A_SCALEDLinkMode = 0 DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total time

PokeAIT_332AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtAIT_332A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 114

Private Sub txtAIT_346A_SCALED_Change()On Error GoTo PokeAIT_346AErrortxtAIT_346A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtAIT_346A_SCALEDText = Int((3 Rnd) + 15) Generate random value between 15 and 18txtAIT_346A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtAIT_346A_SCALEDLinkItem = AIT_346A_SCALEDtxtAIT_346A_SCALEDLinkMode = 2txtAIT_346A_SCALEDLinkPoketxtAIT_346A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeAIT_346AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtAIT_346A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 115

Private Sub txtFIT_321A_SCALED_Change()On Error GoTo PokeFIT_321AErrortxtFIT_321A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtFIT_321A_SCALEDText = Int((10 Rnd) + 120) Generate random value between 120 and 130txtFIT_321A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_321A_SCALEDLinkItem = FIT_321A_SCALEDtxtFIT_321A_SCALEDLinkMode = 2txtFIT_321A_SCALEDLinkPoketxtFIT_321A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total time

PokeFIT_321AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_321A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume Next

End Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 116

Private Sub txtFIT_341A_SCALED_Change()On Error GoTo PokeFIT_341AErrortxtFIT_341A_SCALEDLinkMode = 0 PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTime

txtFIT_341A_SCALEDText = Int((3 Rnd) + 18) Generate random value between 18 and 21

txtFIT_341A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_341A_SCALEDLinkItem = FIT_341A_SCALEDtxtFIT_341A_SCALEDLinkMode = 2txtFIT_341A_SCALEDLinkPoketxtFIT_341A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeFIT_341AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_341A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 117

Private Sub txtFIT_343A_SCALED_Change()On Error GoTo PokeFIT_343AErrortxtFIT_343A_SCALEDLinkMode = 0 PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTime

txtFIT_343A_SCALEDText = Int((1 Rnd) + 3) Generate random value between 3 and 4

txtFIT_343A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_343A_SCALEDLinkItem = FIT_343A_SCALEDtxtFIT_343A_SCALEDLinkMode = 2txtFIT_343A_SCALEDLinkPoketxtFIT_343A_SCALEDLinkMode = 0 DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeFIT_343AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_343A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 118

TUTORIAL

Part 4

Questions

amp

Answers

  • Slide 1
  • Slide 2
  • Slide 3
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Slide 8
  • Slide 9
  • Slide 10
  • Slide 11
  • Slide 12
  • Slide 13
  • Slide 14
  • Slide 15
  • Slide 16
  • Slide 17
  • Slide 18
  • Slide 19
  • Slide 20
  • Slide 21
  • Slide 22
  • Slide 23
  • Slide 24
  • Slide 25
  • Slide 26
  • Slide 27
  • Slide 28
  • Slide 29
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
  • Slide 34
  • Slide 35
  • Slide 36
  • Slide 37
  • Slide 38
  • Slide 39
  • Slide 40
  • Slide 41
  • Slide 42
  • Slide 43
  • Slide 44
  • Slide 45
  • Slide 46
  • Slide 47
  • Slide 48
  • Slide 49
  • Slide 50
  • Slide 51
  • Slide 52
  • Slide 53
  • Slide 54
  • Slide 55
  • Slide 56
  • Slide 57
  • Slide 58
  • Slide 59
  • Slide 60
  • Slide 61
  • Slide 62
  • Slide 63
  • Slide 64
  • Slide 65
  • Slide 66
  • Slide 67
  • Slide 68
  • Slide 69
  • Slide 70
  • Slide 71
  • Slide 72
  • Slide 73
  • Slide 74
  • Slide 75
  • Slide 76
  • Slide 77
  • Slide 78
  • Slide 79
  • Slide 80
  • Slide 81
  • Slide 82
  • Slide 83
  • Slide 84
  • Slide 85
  • Slide 86
  • Slide 87
  • Slide 88
  • Slide 89
  • Slide 90
  • Slide 91
  • Slide 92
  • Slide 93
  • Slide 94
  • Slide 95
  • Slide 96
  • Slide 97
  • Slide 98
  • Slide 99
  • Slide 100
  • Slide 101
  • Slide 102
  • Slide 103
  • Slide 104
  • Slide 105
  • Slide 106
  • Slide 107
  • Slide 108
  • Slide 109
  • Slide 110
  • Slide 111
  • Slide 112
  • Slide 113
  • Slide 114
  • Slide 115
  • Slide 116
  • Slide 117
  • Slide 118
Page 68: TUTORIAL Ethernet PLC's Improve Oxygen Consumption ISA Expo/2001Houston, Texas Water & Wastewater Industry DivisionTuesday, September 11, 2001 1 Brad.

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 68

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 69

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 70

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 71

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 72

Sequential Function Charts were used here

Higher-Level Control

bull SFCrsquos lend themselves well to (as the name would imply) sequential processes

bull Three Important components in SFCrsquosbull Transitionsbull Stepsbull Jumps

bull The status of the process can be viewed as a flow chart

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 73

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 74

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 75

PLC - HMI Communication

A ldquoPLC Heartbeatrdquo is traditionally used to monitor the PLC - HMI Communication sometimes called ardquoWatchdog Timerrdquo

Call it whatever you want but the PLC amp 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 ldquodiesrdquo then that switch doesnrsquot change state and an alarm alerts the operator

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 76

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 77

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 78

TUTORIAL

Part 2B

HMI Programming

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 79

Ethernet (TCPIP) IO Driver

The Ethernet (TCPIP) IO Driver allows the HMI to communicate with the PLC (In this case the driver is called MBENETEXE)

The PLC has an ethernet module in one of the slots that has a ldquoCAT5RJ-45rdquo 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 ldquoCAT5RJ-45rdquo receptacle for the ethernet cable

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 80

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 81

Operator Screens amp Popup Displays

The display is laid out in 3 sections

bull Upper - Security amp Alarm Windowbull Middle- Main Operator Screens bull Lower - Menu amp Popup Displays

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 82

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 83

Scripting

There are 6 types of ldquoScriptsrdquobull Application Scriptsbull Key Scriptsbull Condition Scriptsbull Data Change Scriptsbull Quick Function Scriptsbull ActiveX Event Scripts

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 84

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 85

Access Names

The ldquoAccess Namesrdquo Must be configured to allow the PLC - HMI communications

Note that the ldquoApplicationTopicrdquo is the same as the IO Driver

The ldquocomputer namerdquo is the name of the PC that the HMI is running on (brad_s_carlberg in this case)

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 86

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 87

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 88

Indirect Tags

ldquoIndirect Tagsrdquo were used here to minimize the number of popup displays

This is especially useful in HMIrsquos with many tags

ONLY 12 popup displays are reused throughout the HMI

This gives the HMI a ldquoDCS-Likerdquo Look amp Feel

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 89

Popup Display TypesThe tag point type determines which popup display to use

Analog InputHIC (or Analog Output)PID (or Analog Composite)

bull PID WITH AUTO amp CASCADE amp RATIObull PID WITH AUTO amp RATIO

Diginbull Motor Status

DigOutMotor (or Digital Composite)

bull Motor with ILock and PermNumericSet TimersAlarm DetailAlarm Tags

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 90

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 91

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 92

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 93

Bars Buttons amp Sliders

By choosing to use indirect tags we complicate the Bar Graphs Buttons amp Sliders in the popup displays

Different scales need to be used for different engineering unit ranges

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 94

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 95

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 96

Popup Displays

The next two pages shows how the individual popup displays use the indirect tags

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 97

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 98

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 99

Adding a ldquoTouch Targetrdquo to a Display

2 Tell which tags to use

3 Tell which popup display to call upWhat kind of point type is it

3 Steps1 Tell which scale to use (if itrsquos an analog point type)

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 100

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 101

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 102

TUTORIAL

Part 2C

Excel Spreadsheets

amp

Visual Basic

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 103

A ldquoCHEAP amp DIRTYrdquo HMI With Excel

The 4 key parameters are

To communicate with the PLCUse brad_s_carlbergmbenet|ANOXIC_OXICrsquoplcregisterrsquo

Excel uses ldquopeeksrdquo amp ldquopokesrdquo to read from amp write to a PLC or HMI

To communicate with the HMIbrad_s_carlbergview|Tagnamersquotagnamersquo

bull computer namebull applicationbull topicbull item

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 104

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 105

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 106

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 107

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 108

Excel Macros

bull ldquoRequestrdquo Macro to read values

bull ldquoPokerdquo Macro to write values

bull A Sample Excel Macro

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 109

Sub PokeMacro()MsgBox ApplicationNetworkTemplatesPathChannel = ApplicationDDEInitiate(app=brad_s_carlbergVIEW topic=Tagname) This opens a DDE channel to ViewApplicationDDEPoke Channel Temperature1 Worksheets(Sheet1)Range(A1) Puts value from R1C1 into Temperature1ApplicationDDEPoke Channel DDEReal Worksheets(Sheet1)Range(A2) Puts value from R1C1 into Temperature1ApplicationDDEPoke Channel DDEInteger Worksheets(Sheet1)Range(A3) Puts value from R1C1 into Temperature1ApplicationDDETerminate Channel This terminates the DDE channelEnd SubSub RequestMacro()Channel = ApplicationDDEInitiate(app=brad_s_carlbergVIEW topic=Tagname) This opens a DDE channel to ViewWorksheets(Sheet1)Range(C4) = ApplicationDDERequest(Channel $Hour)Worksheets(Sheet1)Range(C5) = ApplicationDDERequest(Channel $Minute)Worksheets(Sheet1)Range(C6) = ApplicationDDERequest(Channel $Second)Worksheets(Sheet1)Range(C9) = ApplicationDDERequest(Channel $day)Worksheets(Sheet1)Range(C10) = ApplicationDDERequest(Channel $date)Worksheets(Sheet1)Range(C11) = ApplicationDDERequest(Channel $datestring)Worksheets(Sheet1)Range(C12) = ApplicationDDERequest(Channel $datetime)Worksheets(Sheet1)Range(C13) = ApplicationDDERequest(Channel $date)Worksheets(Sheet1)Range(C14) = ApplicationDDERequest(Channel $month)Worksheets(Sheet1)Range(C15) = ApplicationDDERequest(Channel $year)Worksheets(Sheet1)Range(C16) = ApplicationDDERequest(Channel $time)Worksheets(Sheet1)Range(C17) = ApplicationDDERequest(Channel $timestring)Worksheets(Sheet1)Range(C18) = ApplicationDDERequest(Channel $applicationversion)Worksheets(Sheet1)Range(C19) = ApplicationDDERequest(Channel $startddeconversations)Worksheets(Sheet1)Range(C20) = ApplicationDDERequest(Channel $accesslevel)Worksheets(Sheet1)Range(C21) = ApplicationDDERequest(Channel $alarmlogging)Worksheets(Sheet1)Range(C22) = ApplicationDDERequest(Channel $applicationchanged)Worksheets(Sheet1)Range(C23) = ApplicationDDERequest(Channel $configureusers)Worksheets(Sheet1)Range(C24) = ApplicationDDERequest(Channel $changepassword)Worksheets(Sheet1)Range(C25) = ApplicationDDERequest(Channel $InactivityTimeout)Worksheets(Sheet1)Range(C26) = ApplicationDDERequest(Channel $InactivityWarning)Worksheets(Sheet1)Range(C27) = ApplicationDDERequest(Channel $LogicRunning)Worksheets(Sheet1)Range(C28) = ApplicationDDERequest(Channel $OperatorEntered)Worksheets(Sheet1)Range(C29) = ApplicationDDERequest(Channel $Operator)Worksheets(Sheet1)Range(C30) = ApplicationDDERequest(Channel $PasswordEntered)ApplicationDDETerminate Channel This terminates the DDE channelEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 110

Visual Basic

ldquoRoll Your Ownrdquo HMI - Much More powerful than Excel

Key Parameters computer nameapplication|topicitem

IO Emulator - MBPlusSimulateexe

Can ldquoRead Fromrdquo amp ldquoWrite Tordquo PLC andor HMI

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 111

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 112

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 113

Dim PauseTime Start Finish TotalTime As Integer Declare variables

Private Sub txtAIT_332A_SCALED_Change()On Error GoTo PokeAIT_332AErrortxtAIT_332A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtAIT_332A_SCALEDText = Int((3 Rnd) + 20) Generate random value between 20 and 23txtAIT_332A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtAIT_332A_SCALEDLinkItem = AIT_332A_SCALEDtxtAIT_332A_SCALEDLinkMode = 2txtAIT_332A_SCALEDLinkPoketxtAIT_332A_SCALEDLinkMode = 0 DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total time

PokeAIT_332AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtAIT_332A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 114

Private Sub txtAIT_346A_SCALED_Change()On Error GoTo PokeAIT_346AErrortxtAIT_346A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtAIT_346A_SCALEDText = Int((3 Rnd) + 15) Generate random value between 15 and 18txtAIT_346A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtAIT_346A_SCALEDLinkItem = AIT_346A_SCALEDtxtAIT_346A_SCALEDLinkMode = 2txtAIT_346A_SCALEDLinkPoketxtAIT_346A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeAIT_346AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtAIT_346A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 115

Private Sub txtFIT_321A_SCALED_Change()On Error GoTo PokeFIT_321AErrortxtFIT_321A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtFIT_321A_SCALEDText = Int((10 Rnd) + 120) Generate random value between 120 and 130txtFIT_321A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_321A_SCALEDLinkItem = FIT_321A_SCALEDtxtFIT_321A_SCALEDLinkMode = 2txtFIT_321A_SCALEDLinkPoketxtFIT_321A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total time

PokeFIT_321AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_321A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume Next

End Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 116

Private Sub txtFIT_341A_SCALED_Change()On Error GoTo PokeFIT_341AErrortxtFIT_341A_SCALEDLinkMode = 0 PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTime

txtFIT_341A_SCALEDText = Int((3 Rnd) + 18) Generate random value between 18 and 21

txtFIT_341A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_341A_SCALEDLinkItem = FIT_341A_SCALEDtxtFIT_341A_SCALEDLinkMode = 2txtFIT_341A_SCALEDLinkPoketxtFIT_341A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeFIT_341AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_341A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 117

Private Sub txtFIT_343A_SCALED_Change()On Error GoTo PokeFIT_343AErrortxtFIT_343A_SCALEDLinkMode = 0 PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTime

txtFIT_343A_SCALEDText = Int((1 Rnd) + 3) Generate random value between 3 and 4

txtFIT_343A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_343A_SCALEDLinkItem = FIT_343A_SCALEDtxtFIT_343A_SCALEDLinkMode = 2txtFIT_343A_SCALEDLinkPoketxtFIT_343A_SCALEDLinkMode = 0 DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeFIT_343AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_343A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 118

TUTORIAL

Part 4

Questions

amp

Answers

  • Slide 1
  • Slide 2
  • Slide 3
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Slide 8
  • Slide 9
  • Slide 10
  • Slide 11
  • Slide 12
  • Slide 13
  • Slide 14
  • Slide 15
  • Slide 16
  • Slide 17
  • Slide 18
  • Slide 19
  • Slide 20
  • Slide 21
  • Slide 22
  • Slide 23
  • Slide 24
  • Slide 25
  • Slide 26
  • Slide 27
  • Slide 28
  • Slide 29
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
  • Slide 34
  • Slide 35
  • Slide 36
  • Slide 37
  • Slide 38
  • Slide 39
  • Slide 40
  • Slide 41
  • Slide 42
  • Slide 43
  • Slide 44
  • Slide 45
  • Slide 46
  • Slide 47
  • Slide 48
  • Slide 49
  • Slide 50
  • Slide 51
  • Slide 52
  • Slide 53
  • Slide 54
  • Slide 55
  • Slide 56
  • Slide 57
  • Slide 58
  • Slide 59
  • Slide 60
  • Slide 61
  • Slide 62
  • Slide 63
  • Slide 64
  • Slide 65
  • Slide 66
  • Slide 67
  • Slide 68
  • Slide 69
  • Slide 70
  • Slide 71
  • Slide 72
  • Slide 73
  • Slide 74
  • Slide 75
  • Slide 76
  • Slide 77
  • Slide 78
  • Slide 79
  • Slide 80
  • Slide 81
  • Slide 82
  • Slide 83
  • Slide 84
  • Slide 85
  • Slide 86
  • Slide 87
  • Slide 88
  • Slide 89
  • Slide 90
  • Slide 91
  • Slide 92
  • Slide 93
  • Slide 94
  • Slide 95
  • Slide 96
  • Slide 97
  • Slide 98
  • Slide 99
  • Slide 100
  • Slide 101
  • Slide 102
  • Slide 103
  • Slide 104
  • Slide 105
  • Slide 106
  • Slide 107
  • Slide 108
  • Slide 109
  • Slide 110
  • Slide 111
  • Slide 112
  • Slide 113
  • Slide 114
  • Slide 115
  • Slide 116
  • Slide 117
  • Slide 118
Page 69: TUTORIAL Ethernet PLC's Improve Oxygen Consumption ISA Expo/2001Houston, Texas Water & Wastewater Industry DivisionTuesday, September 11, 2001 1 Brad.

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 69

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 70

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 71

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 72

Sequential Function Charts were used here

Higher-Level Control

bull SFCrsquos lend themselves well to (as the name would imply) sequential processes

bull Three Important components in SFCrsquosbull Transitionsbull Stepsbull Jumps

bull The status of the process can be viewed as a flow chart

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 73

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 74

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 75

PLC - HMI Communication

A ldquoPLC Heartbeatrdquo is traditionally used to monitor the PLC - HMI Communication sometimes called ardquoWatchdog Timerrdquo

Call it whatever you want but the PLC amp 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 ldquodiesrdquo then that switch doesnrsquot change state and an alarm alerts the operator

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 76

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 77

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 78

TUTORIAL

Part 2B

HMI Programming

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 79

Ethernet (TCPIP) IO Driver

The Ethernet (TCPIP) IO Driver allows the HMI to communicate with the PLC (In this case the driver is called MBENETEXE)

The PLC has an ethernet module in one of the slots that has a ldquoCAT5RJ-45rdquo 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 ldquoCAT5RJ-45rdquo receptacle for the ethernet cable

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 80

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 81

Operator Screens amp Popup Displays

The display is laid out in 3 sections

bull Upper - Security amp Alarm Windowbull Middle- Main Operator Screens bull Lower - Menu amp Popup Displays

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 82

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 83

Scripting

There are 6 types of ldquoScriptsrdquobull Application Scriptsbull Key Scriptsbull Condition Scriptsbull Data Change Scriptsbull Quick Function Scriptsbull ActiveX Event Scripts

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 84

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 85

Access Names

The ldquoAccess Namesrdquo Must be configured to allow the PLC - HMI communications

Note that the ldquoApplicationTopicrdquo is the same as the IO Driver

The ldquocomputer namerdquo is the name of the PC that the HMI is running on (brad_s_carlberg in this case)

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 86

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 87

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 88

Indirect Tags

ldquoIndirect Tagsrdquo were used here to minimize the number of popup displays

This is especially useful in HMIrsquos with many tags

ONLY 12 popup displays are reused throughout the HMI

This gives the HMI a ldquoDCS-Likerdquo Look amp Feel

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 89

Popup Display TypesThe tag point type determines which popup display to use

Analog InputHIC (or Analog Output)PID (or Analog Composite)

bull PID WITH AUTO amp CASCADE amp RATIObull PID WITH AUTO amp RATIO

Diginbull Motor Status

DigOutMotor (or Digital Composite)

bull Motor with ILock and PermNumericSet TimersAlarm DetailAlarm Tags

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 90

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 91

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 92

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 93

Bars Buttons amp Sliders

By choosing to use indirect tags we complicate the Bar Graphs Buttons amp Sliders in the popup displays

Different scales need to be used for different engineering unit ranges

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 94

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 95

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 96

Popup Displays

The next two pages shows how the individual popup displays use the indirect tags

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 97

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 98

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 99

Adding a ldquoTouch Targetrdquo to a Display

2 Tell which tags to use

3 Tell which popup display to call upWhat kind of point type is it

3 Steps1 Tell which scale to use (if itrsquos an analog point type)

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 100

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 101

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 102

TUTORIAL

Part 2C

Excel Spreadsheets

amp

Visual Basic

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 103

A ldquoCHEAP amp DIRTYrdquo HMI With Excel

The 4 key parameters are

To communicate with the PLCUse brad_s_carlbergmbenet|ANOXIC_OXICrsquoplcregisterrsquo

Excel uses ldquopeeksrdquo amp ldquopokesrdquo to read from amp write to a PLC or HMI

To communicate with the HMIbrad_s_carlbergview|Tagnamersquotagnamersquo

bull computer namebull applicationbull topicbull item

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 104

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 105

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 106

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 107

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 108

Excel Macros

bull ldquoRequestrdquo Macro to read values

bull ldquoPokerdquo Macro to write values

bull A Sample Excel Macro

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 109

Sub PokeMacro()MsgBox ApplicationNetworkTemplatesPathChannel = ApplicationDDEInitiate(app=brad_s_carlbergVIEW topic=Tagname) This opens a DDE channel to ViewApplicationDDEPoke Channel Temperature1 Worksheets(Sheet1)Range(A1) Puts value from R1C1 into Temperature1ApplicationDDEPoke Channel DDEReal Worksheets(Sheet1)Range(A2) Puts value from R1C1 into Temperature1ApplicationDDEPoke Channel DDEInteger Worksheets(Sheet1)Range(A3) Puts value from R1C1 into Temperature1ApplicationDDETerminate Channel This terminates the DDE channelEnd SubSub RequestMacro()Channel = ApplicationDDEInitiate(app=brad_s_carlbergVIEW topic=Tagname) This opens a DDE channel to ViewWorksheets(Sheet1)Range(C4) = ApplicationDDERequest(Channel $Hour)Worksheets(Sheet1)Range(C5) = ApplicationDDERequest(Channel $Minute)Worksheets(Sheet1)Range(C6) = ApplicationDDERequest(Channel $Second)Worksheets(Sheet1)Range(C9) = ApplicationDDERequest(Channel $day)Worksheets(Sheet1)Range(C10) = ApplicationDDERequest(Channel $date)Worksheets(Sheet1)Range(C11) = ApplicationDDERequest(Channel $datestring)Worksheets(Sheet1)Range(C12) = ApplicationDDERequest(Channel $datetime)Worksheets(Sheet1)Range(C13) = ApplicationDDERequest(Channel $date)Worksheets(Sheet1)Range(C14) = ApplicationDDERequest(Channel $month)Worksheets(Sheet1)Range(C15) = ApplicationDDERequest(Channel $year)Worksheets(Sheet1)Range(C16) = ApplicationDDERequest(Channel $time)Worksheets(Sheet1)Range(C17) = ApplicationDDERequest(Channel $timestring)Worksheets(Sheet1)Range(C18) = ApplicationDDERequest(Channel $applicationversion)Worksheets(Sheet1)Range(C19) = ApplicationDDERequest(Channel $startddeconversations)Worksheets(Sheet1)Range(C20) = ApplicationDDERequest(Channel $accesslevel)Worksheets(Sheet1)Range(C21) = ApplicationDDERequest(Channel $alarmlogging)Worksheets(Sheet1)Range(C22) = ApplicationDDERequest(Channel $applicationchanged)Worksheets(Sheet1)Range(C23) = ApplicationDDERequest(Channel $configureusers)Worksheets(Sheet1)Range(C24) = ApplicationDDERequest(Channel $changepassword)Worksheets(Sheet1)Range(C25) = ApplicationDDERequest(Channel $InactivityTimeout)Worksheets(Sheet1)Range(C26) = ApplicationDDERequest(Channel $InactivityWarning)Worksheets(Sheet1)Range(C27) = ApplicationDDERequest(Channel $LogicRunning)Worksheets(Sheet1)Range(C28) = ApplicationDDERequest(Channel $OperatorEntered)Worksheets(Sheet1)Range(C29) = ApplicationDDERequest(Channel $Operator)Worksheets(Sheet1)Range(C30) = ApplicationDDERequest(Channel $PasswordEntered)ApplicationDDETerminate Channel This terminates the DDE channelEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 110

Visual Basic

ldquoRoll Your Ownrdquo HMI - Much More powerful than Excel

Key Parameters computer nameapplication|topicitem

IO Emulator - MBPlusSimulateexe

Can ldquoRead Fromrdquo amp ldquoWrite Tordquo PLC andor HMI

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 111

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 112

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 113

Dim PauseTime Start Finish TotalTime As Integer Declare variables

Private Sub txtAIT_332A_SCALED_Change()On Error GoTo PokeAIT_332AErrortxtAIT_332A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtAIT_332A_SCALEDText = Int((3 Rnd) + 20) Generate random value between 20 and 23txtAIT_332A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtAIT_332A_SCALEDLinkItem = AIT_332A_SCALEDtxtAIT_332A_SCALEDLinkMode = 2txtAIT_332A_SCALEDLinkPoketxtAIT_332A_SCALEDLinkMode = 0 DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total time

PokeAIT_332AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtAIT_332A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 114

Private Sub txtAIT_346A_SCALED_Change()On Error GoTo PokeAIT_346AErrortxtAIT_346A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtAIT_346A_SCALEDText = Int((3 Rnd) + 15) Generate random value between 15 and 18txtAIT_346A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtAIT_346A_SCALEDLinkItem = AIT_346A_SCALEDtxtAIT_346A_SCALEDLinkMode = 2txtAIT_346A_SCALEDLinkPoketxtAIT_346A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeAIT_346AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtAIT_346A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 115

Private Sub txtFIT_321A_SCALED_Change()On Error GoTo PokeFIT_321AErrortxtFIT_321A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtFIT_321A_SCALEDText = Int((10 Rnd) + 120) Generate random value between 120 and 130txtFIT_321A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_321A_SCALEDLinkItem = FIT_321A_SCALEDtxtFIT_321A_SCALEDLinkMode = 2txtFIT_321A_SCALEDLinkPoketxtFIT_321A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total time

PokeFIT_321AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_321A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume Next

End Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 116

Private Sub txtFIT_341A_SCALED_Change()On Error GoTo PokeFIT_341AErrortxtFIT_341A_SCALEDLinkMode = 0 PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTime

txtFIT_341A_SCALEDText = Int((3 Rnd) + 18) Generate random value between 18 and 21

txtFIT_341A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_341A_SCALEDLinkItem = FIT_341A_SCALEDtxtFIT_341A_SCALEDLinkMode = 2txtFIT_341A_SCALEDLinkPoketxtFIT_341A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeFIT_341AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_341A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 117

Private Sub txtFIT_343A_SCALED_Change()On Error GoTo PokeFIT_343AErrortxtFIT_343A_SCALEDLinkMode = 0 PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTime

txtFIT_343A_SCALEDText = Int((1 Rnd) + 3) Generate random value between 3 and 4

txtFIT_343A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_343A_SCALEDLinkItem = FIT_343A_SCALEDtxtFIT_343A_SCALEDLinkMode = 2txtFIT_343A_SCALEDLinkPoketxtFIT_343A_SCALEDLinkMode = 0 DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeFIT_343AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_343A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 118

TUTORIAL

Part 4

Questions

amp

Answers

  • Slide 1
  • Slide 2
  • Slide 3
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Slide 8
  • Slide 9
  • Slide 10
  • Slide 11
  • Slide 12
  • Slide 13
  • Slide 14
  • Slide 15
  • Slide 16
  • Slide 17
  • Slide 18
  • Slide 19
  • Slide 20
  • Slide 21
  • Slide 22
  • Slide 23
  • Slide 24
  • Slide 25
  • Slide 26
  • Slide 27
  • Slide 28
  • Slide 29
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
  • Slide 34
  • Slide 35
  • Slide 36
  • Slide 37
  • Slide 38
  • Slide 39
  • Slide 40
  • Slide 41
  • Slide 42
  • Slide 43
  • Slide 44
  • Slide 45
  • Slide 46
  • Slide 47
  • Slide 48
  • Slide 49
  • Slide 50
  • Slide 51
  • Slide 52
  • Slide 53
  • Slide 54
  • Slide 55
  • Slide 56
  • Slide 57
  • Slide 58
  • Slide 59
  • Slide 60
  • Slide 61
  • Slide 62
  • Slide 63
  • Slide 64
  • Slide 65
  • Slide 66
  • Slide 67
  • Slide 68
  • Slide 69
  • Slide 70
  • Slide 71
  • Slide 72
  • Slide 73
  • Slide 74
  • Slide 75
  • Slide 76
  • Slide 77
  • Slide 78
  • Slide 79
  • Slide 80
  • Slide 81
  • Slide 82
  • Slide 83
  • Slide 84
  • Slide 85
  • Slide 86
  • Slide 87
  • Slide 88
  • Slide 89
  • Slide 90
  • Slide 91
  • Slide 92
  • Slide 93
  • Slide 94
  • Slide 95
  • Slide 96
  • Slide 97
  • Slide 98
  • Slide 99
  • Slide 100
  • Slide 101
  • Slide 102
  • Slide 103
  • Slide 104
  • Slide 105
  • Slide 106
  • Slide 107
  • Slide 108
  • Slide 109
  • Slide 110
  • Slide 111
  • Slide 112
  • Slide 113
  • Slide 114
  • Slide 115
  • Slide 116
  • Slide 117
  • Slide 118
Page 70: TUTORIAL Ethernet PLC's Improve Oxygen Consumption ISA Expo/2001Houston, Texas Water & Wastewater Industry DivisionTuesday, September 11, 2001 1 Brad.

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 70

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 71

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 72

Sequential Function Charts were used here

Higher-Level Control

bull SFCrsquos lend themselves well to (as the name would imply) sequential processes

bull Three Important components in SFCrsquosbull Transitionsbull Stepsbull Jumps

bull The status of the process can be viewed as a flow chart

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 73

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 74

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 75

PLC - HMI Communication

A ldquoPLC Heartbeatrdquo is traditionally used to monitor the PLC - HMI Communication sometimes called ardquoWatchdog Timerrdquo

Call it whatever you want but the PLC amp 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 ldquodiesrdquo then that switch doesnrsquot change state and an alarm alerts the operator

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 76

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 77

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 78

TUTORIAL

Part 2B

HMI Programming

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 79

Ethernet (TCPIP) IO Driver

The Ethernet (TCPIP) IO Driver allows the HMI to communicate with the PLC (In this case the driver is called MBENETEXE)

The PLC has an ethernet module in one of the slots that has a ldquoCAT5RJ-45rdquo 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 ldquoCAT5RJ-45rdquo receptacle for the ethernet cable

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 80

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 81

Operator Screens amp Popup Displays

The display is laid out in 3 sections

bull Upper - Security amp Alarm Windowbull Middle- Main Operator Screens bull Lower - Menu amp Popup Displays

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 82

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 83

Scripting

There are 6 types of ldquoScriptsrdquobull Application Scriptsbull Key Scriptsbull Condition Scriptsbull Data Change Scriptsbull Quick Function Scriptsbull ActiveX Event Scripts

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 84

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 85

Access Names

The ldquoAccess Namesrdquo Must be configured to allow the PLC - HMI communications

Note that the ldquoApplicationTopicrdquo is the same as the IO Driver

The ldquocomputer namerdquo is the name of the PC that the HMI is running on (brad_s_carlberg in this case)

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 86

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 87

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 88

Indirect Tags

ldquoIndirect Tagsrdquo were used here to minimize the number of popup displays

This is especially useful in HMIrsquos with many tags

ONLY 12 popup displays are reused throughout the HMI

This gives the HMI a ldquoDCS-Likerdquo Look amp Feel

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 89

Popup Display TypesThe tag point type determines which popup display to use

Analog InputHIC (or Analog Output)PID (or Analog Composite)

bull PID WITH AUTO amp CASCADE amp RATIObull PID WITH AUTO amp RATIO

Diginbull Motor Status

DigOutMotor (or Digital Composite)

bull Motor with ILock and PermNumericSet TimersAlarm DetailAlarm Tags

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 90

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 91

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 92

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 93

Bars Buttons amp Sliders

By choosing to use indirect tags we complicate the Bar Graphs Buttons amp Sliders in the popup displays

Different scales need to be used for different engineering unit ranges

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 94

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 95

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 96

Popup Displays

The next two pages shows how the individual popup displays use the indirect tags

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 97

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 98

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 99

Adding a ldquoTouch Targetrdquo to a Display

2 Tell which tags to use

3 Tell which popup display to call upWhat kind of point type is it

3 Steps1 Tell which scale to use (if itrsquos an analog point type)

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 100

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 101

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 102

TUTORIAL

Part 2C

Excel Spreadsheets

amp

Visual Basic

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 103

A ldquoCHEAP amp DIRTYrdquo HMI With Excel

The 4 key parameters are

To communicate with the PLCUse brad_s_carlbergmbenet|ANOXIC_OXICrsquoplcregisterrsquo

Excel uses ldquopeeksrdquo amp ldquopokesrdquo to read from amp write to a PLC or HMI

To communicate with the HMIbrad_s_carlbergview|Tagnamersquotagnamersquo

bull computer namebull applicationbull topicbull item

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 104

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 105

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 106

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 107

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 108

Excel Macros

bull ldquoRequestrdquo Macro to read values

bull ldquoPokerdquo Macro to write values

bull A Sample Excel Macro

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 109

Sub PokeMacro()MsgBox ApplicationNetworkTemplatesPathChannel = ApplicationDDEInitiate(app=brad_s_carlbergVIEW topic=Tagname) This opens a DDE channel to ViewApplicationDDEPoke Channel Temperature1 Worksheets(Sheet1)Range(A1) Puts value from R1C1 into Temperature1ApplicationDDEPoke Channel DDEReal Worksheets(Sheet1)Range(A2) Puts value from R1C1 into Temperature1ApplicationDDEPoke Channel DDEInteger Worksheets(Sheet1)Range(A3) Puts value from R1C1 into Temperature1ApplicationDDETerminate Channel This terminates the DDE channelEnd SubSub RequestMacro()Channel = ApplicationDDEInitiate(app=brad_s_carlbergVIEW topic=Tagname) This opens a DDE channel to ViewWorksheets(Sheet1)Range(C4) = ApplicationDDERequest(Channel $Hour)Worksheets(Sheet1)Range(C5) = ApplicationDDERequest(Channel $Minute)Worksheets(Sheet1)Range(C6) = ApplicationDDERequest(Channel $Second)Worksheets(Sheet1)Range(C9) = ApplicationDDERequest(Channel $day)Worksheets(Sheet1)Range(C10) = ApplicationDDERequest(Channel $date)Worksheets(Sheet1)Range(C11) = ApplicationDDERequest(Channel $datestring)Worksheets(Sheet1)Range(C12) = ApplicationDDERequest(Channel $datetime)Worksheets(Sheet1)Range(C13) = ApplicationDDERequest(Channel $date)Worksheets(Sheet1)Range(C14) = ApplicationDDERequest(Channel $month)Worksheets(Sheet1)Range(C15) = ApplicationDDERequest(Channel $year)Worksheets(Sheet1)Range(C16) = ApplicationDDERequest(Channel $time)Worksheets(Sheet1)Range(C17) = ApplicationDDERequest(Channel $timestring)Worksheets(Sheet1)Range(C18) = ApplicationDDERequest(Channel $applicationversion)Worksheets(Sheet1)Range(C19) = ApplicationDDERequest(Channel $startddeconversations)Worksheets(Sheet1)Range(C20) = ApplicationDDERequest(Channel $accesslevel)Worksheets(Sheet1)Range(C21) = ApplicationDDERequest(Channel $alarmlogging)Worksheets(Sheet1)Range(C22) = ApplicationDDERequest(Channel $applicationchanged)Worksheets(Sheet1)Range(C23) = ApplicationDDERequest(Channel $configureusers)Worksheets(Sheet1)Range(C24) = ApplicationDDERequest(Channel $changepassword)Worksheets(Sheet1)Range(C25) = ApplicationDDERequest(Channel $InactivityTimeout)Worksheets(Sheet1)Range(C26) = ApplicationDDERequest(Channel $InactivityWarning)Worksheets(Sheet1)Range(C27) = ApplicationDDERequest(Channel $LogicRunning)Worksheets(Sheet1)Range(C28) = ApplicationDDERequest(Channel $OperatorEntered)Worksheets(Sheet1)Range(C29) = ApplicationDDERequest(Channel $Operator)Worksheets(Sheet1)Range(C30) = ApplicationDDERequest(Channel $PasswordEntered)ApplicationDDETerminate Channel This terminates the DDE channelEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 110

Visual Basic

ldquoRoll Your Ownrdquo HMI - Much More powerful than Excel

Key Parameters computer nameapplication|topicitem

IO Emulator - MBPlusSimulateexe

Can ldquoRead Fromrdquo amp ldquoWrite Tordquo PLC andor HMI

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 111

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 112

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 113

Dim PauseTime Start Finish TotalTime As Integer Declare variables

Private Sub txtAIT_332A_SCALED_Change()On Error GoTo PokeAIT_332AErrortxtAIT_332A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtAIT_332A_SCALEDText = Int((3 Rnd) + 20) Generate random value between 20 and 23txtAIT_332A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtAIT_332A_SCALEDLinkItem = AIT_332A_SCALEDtxtAIT_332A_SCALEDLinkMode = 2txtAIT_332A_SCALEDLinkPoketxtAIT_332A_SCALEDLinkMode = 0 DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total time

PokeAIT_332AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtAIT_332A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 114

Private Sub txtAIT_346A_SCALED_Change()On Error GoTo PokeAIT_346AErrortxtAIT_346A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtAIT_346A_SCALEDText = Int((3 Rnd) + 15) Generate random value between 15 and 18txtAIT_346A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtAIT_346A_SCALEDLinkItem = AIT_346A_SCALEDtxtAIT_346A_SCALEDLinkMode = 2txtAIT_346A_SCALEDLinkPoketxtAIT_346A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeAIT_346AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtAIT_346A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 115

Private Sub txtFIT_321A_SCALED_Change()On Error GoTo PokeFIT_321AErrortxtFIT_321A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtFIT_321A_SCALEDText = Int((10 Rnd) + 120) Generate random value between 120 and 130txtFIT_321A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_321A_SCALEDLinkItem = FIT_321A_SCALEDtxtFIT_321A_SCALEDLinkMode = 2txtFIT_321A_SCALEDLinkPoketxtFIT_321A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total time

PokeFIT_321AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_321A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume Next

End Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 116

Private Sub txtFIT_341A_SCALED_Change()On Error GoTo PokeFIT_341AErrortxtFIT_341A_SCALEDLinkMode = 0 PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTime

txtFIT_341A_SCALEDText = Int((3 Rnd) + 18) Generate random value between 18 and 21

txtFIT_341A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_341A_SCALEDLinkItem = FIT_341A_SCALEDtxtFIT_341A_SCALEDLinkMode = 2txtFIT_341A_SCALEDLinkPoketxtFIT_341A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeFIT_341AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_341A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 117

Private Sub txtFIT_343A_SCALED_Change()On Error GoTo PokeFIT_343AErrortxtFIT_343A_SCALEDLinkMode = 0 PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTime

txtFIT_343A_SCALEDText = Int((1 Rnd) + 3) Generate random value between 3 and 4

txtFIT_343A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_343A_SCALEDLinkItem = FIT_343A_SCALEDtxtFIT_343A_SCALEDLinkMode = 2txtFIT_343A_SCALEDLinkPoketxtFIT_343A_SCALEDLinkMode = 0 DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeFIT_343AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_343A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 118

TUTORIAL

Part 4

Questions

amp

Answers

  • Slide 1
  • Slide 2
  • Slide 3
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Slide 8
  • Slide 9
  • Slide 10
  • Slide 11
  • Slide 12
  • Slide 13
  • Slide 14
  • Slide 15
  • Slide 16
  • Slide 17
  • Slide 18
  • Slide 19
  • Slide 20
  • Slide 21
  • Slide 22
  • Slide 23
  • Slide 24
  • Slide 25
  • Slide 26
  • Slide 27
  • Slide 28
  • Slide 29
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
  • Slide 34
  • Slide 35
  • Slide 36
  • Slide 37
  • Slide 38
  • Slide 39
  • Slide 40
  • Slide 41
  • Slide 42
  • Slide 43
  • Slide 44
  • Slide 45
  • Slide 46
  • Slide 47
  • Slide 48
  • Slide 49
  • Slide 50
  • Slide 51
  • Slide 52
  • Slide 53
  • Slide 54
  • Slide 55
  • Slide 56
  • Slide 57
  • Slide 58
  • Slide 59
  • Slide 60
  • Slide 61
  • Slide 62
  • Slide 63
  • Slide 64
  • Slide 65
  • Slide 66
  • Slide 67
  • Slide 68
  • Slide 69
  • Slide 70
  • Slide 71
  • Slide 72
  • Slide 73
  • Slide 74
  • Slide 75
  • Slide 76
  • Slide 77
  • Slide 78
  • Slide 79
  • Slide 80
  • Slide 81
  • Slide 82
  • Slide 83
  • Slide 84
  • Slide 85
  • Slide 86
  • Slide 87
  • Slide 88
  • Slide 89
  • Slide 90
  • Slide 91
  • Slide 92
  • Slide 93
  • Slide 94
  • Slide 95
  • Slide 96
  • Slide 97
  • Slide 98
  • Slide 99
  • Slide 100
  • Slide 101
  • Slide 102
  • Slide 103
  • Slide 104
  • Slide 105
  • Slide 106
  • Slide 107
  • Slide 108
  • Slide 109
  • Slide 110
  • Slide 111
  • Slide 112
  • Slide 113
  • Slide 114
  • Slide 115
  • Slide 116
  • Slide 117
  • Slide 118
Page 71: TUTORIAL Ethernet PLC's Improve Oxygen Consumption ISA Expo/2001Houston, Texas Water & Wastewater Industry DivisionTuesday, September 11, 2001 1 Brad.

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 71

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 72

Sequential Function Charts were used here

Higher-Level Control

bull SFCrsquos lend themselves well to (as the name would imply) sequential processes

bull Three Important components in SFCrsquosbull Transitionsbull Stepsbull Jumps

bull The status of the process can be viewed as a flow chart

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 73

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 74

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 75

PLC - HMI Communication

A ldquoPLC Heartbeatrdquo is traditionally used to monitor the PLC - HMI Communication sometimes called ardquoWatchdog Timerrdquo

Call it whatever you want but the PLC amp 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 ldquodiesrdquo then that switch doesnrsquot change state and an alarm alerts the operator

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 76

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 77

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 78

TUTORIAL

Part 2B

HMI Programming

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 79

Ethernet (TCPIP) IO Driver

The Ethernet (TCPIP) IO Driver allows the HMI to communicate with the PLC (In this case the driver is called MBENETEXE)

The PLC has an ethernet module in one of the slots that has a ldquoCAT5RJ-45rdquo 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 ldquoCAT5RJ-45rdquo receptacle for the ethernet cable

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 80

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 81

Operator Screens amp Popup Displays

The display is laid out in 3 sections

bull Upper - Security amp Alarm Windowbull Middle- Main Operator Screens bull Lower - Menu amp Popup Displays

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 82

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 83

Scripting

There are 6 types of ldquoScriptsrdquobull Application Scriptsbull Key Scriptsbull Condition Scriptsbull Data Change Scriptsbull Quick Function Scriptsbull ActiveX Event Scripts

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 84

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 85

Access Names

The ldquoAccess Namesrdquo Must be configured to allow the PLC - HMI communications

Note that the ldquoApplicationTopicrdquo is the same as the IO Driver

The ldquocomputer namerdquo is the name of the PC that the HMI is running on (brad_s_carlberg in this case)

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 86

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 87

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 88

Indirect Tags

ldquoIndirect Tagsrdquo were used here to minimize the number of popup displays

This is especially useful in HMIrsquos with many tags

ONLY 12 popup displays are reused throughout the HMI

This gives the HMI a ldquoDCS-Likerdquo Look amp Feel

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 89

Popup Display TypesThe tag point type determines which popup display to use

Analog InputHIC (or Analog Output)PID (or Analog Composite)

bull PID WITH AUTO amp CASCADE amp RATIObull PID WITH AUTO amp RATIO

Diginbull Motor Status

DigOutMotor (or Digital Composite)

bull Motor with ILock and PermNumericSet TimersAlarm DetailAlarm Tags

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 90

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 91

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 92

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 93

Bars Buttons amp Sliders

By choosing to use indirect tags we complicate the Bar Graphs Buttons amp Sliders in the popup displays

Different scales need to be used for different engineering unit ranges

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 94

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 95

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 96

Popup Displays

The next two pages shows how the individual popup displays use the indirect tags

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 97

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 98

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 99

Adding a ldquoTouch Targetrdquo to a Display

2 Tell which tags to use

3 Tell which popup display to call upWhat kind of point type is it

3 Steps1 Tell which scale to use (if itrsquos an analog point type)

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 100

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 101

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 102

TUTORIAL

Part 2C

Excel Spreadsheets

amp

Visual Basic

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 103

A ldquoCHEAP amp DIRTYrdquo HMI With Excel

The 4 key parameters are

To communicate with the PLCUse brad_s_carlbergmbenet|ANOXIC_OXICrsquoplcregisterrsquo

Excel uses ldquopeeksrdquo amp ldquopokesrdquo to read from amp write to a PLC or HMI

To communicate with the HMIbrad_s_carlbergview|Tagnamersquotagnamersquo

bull computer namebull applicationbull topicbull item

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 104

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 105

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 106

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 107

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 108

Excel Macros

bull ldquoRequestrdquo Macro to read values

bull ldquoPokerdquo Macro to write values

bull A Sample Excel Macro

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 109

Sub PokeMacro()MsgBox ApplicationNetworkTemplatesPathChannel = ApplicationDDEInitiate(app=brad_s_carlbergVIEW topic=Tagname) This opens a DDE channel to ViewApplicationDDEPoke Channel Temperature1 Worksheets(Sheet1)Range(A1) Puts value from R1C1 into Temperature1ApplicationDDEPoke Channel DDEReal Worksheets(Sheet1)Range(A2) Puts value from R1C1 into Temperature1ApplicationDDEPoke Channel DDEInteger Worksheets(Sheet1)Range(A3) Puts value from R1C1 into Temperature1ApplicationDDETerminate Channel This terminates the DDE channelEnd SubSub RequestMacro()Channel = ApplicationDDEInitiate(app=brad_s_carlbergVIEW topic=Tagname) This opens a DDE channel to ViewWorksheets(Sheet1)Range(C4) = ApplicationDDERequest(Channel $Hour)Worksheets(Sheet1)Range(C5) = ApplicationDDERequest(Channel $Minute)Worksheets(Sheet1)Range(C6) = ApplicationDDERequest(Channel $Second)Worksheets(Sheet1)Range(C9) = ApplicationDDERequest(Channel $day)Worksheets(Sheet1)Range(C10) = ApplicationDDERequest(Channel $date)Worksheets(Sheet1)Range(C11) = ApplicationDDERequest(Channel $datestring)Worksheets(Sheet1)Range(C12) = ApplicationDDERequest(Channel $datetime)Worksheets(Sheet1)Range(C13) = ApplicationDDERequest(Channel $date)Worksheets(Sheet1)Range(C14) = ApplicationDDERequest(Channel $month)Worksheets(Sheet1)Range(C15) = ApplicationDDERequest(Channel $year)Worksheets(Sheet1)Range(C16) = ApplicationDDERequest(Channel $time)Worksheets(Sheet1)Range(C17) = ApplicationDDERequest(Channel $timestring)Worksheets(Sheet1)Range(C18) = ApplicationDDERequest(Channel $applicationversion)Worksheets(Sheet1)Range(C19) = ApplicationDDERequest(Channel $startddeconversations)Worksheets(Sheet1)Range(C20) = ApplicationDDERequest(Channel $accesslevel)Worksheets(Sheet1)Range(C21) = ApplicationDDERequest(Channel $alarmlogging)Worksheets(Sheet1)Range(C22) = ApplicationDDERequest(Channel $applicationchanged)Worksheets(Sheet1)Range(C23) = ApplicationDDERequest(Channel $configureusers)Worksheets(Sheet1)Range(C24) = ApplicationDDERequest(Channel $changepassword)Worksheets(Sheet1)Range(C25) = ApplicationDDERequest(Channel $InactivityTimeout)Worksheets(Sheet1)Range(C26) = ApplicationDDERequest(Channel $InactivityWarning)Worksheets(Sheet1)Range(C27) = ApplicationDDERequest(Channel $LogicRunning)Worksheets(Sheet1)Range(C28) = ApplicationDDERequest(Channel $OperatorEntered)Worksheets(Sheet1)Range(C29) = ApplicationDDERequest(Channel $Operator)Worksheets(Sheet1)Range(C30) = ApplicationDDERequest(Channel $PasswordEntered)ApplicationDDETerminate Channel This terminates the DDE channelEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 110

Visual Basic

ldquoRoll Your Ownrdquo HMI - Much More powerful than Excel

Key Parameters computer nameapplication|topicitem

IO Emulator - MBPlusSimulateexe

Can ldquoRead Fromrdquo amp ldquoWrite Tordquo PLC andor HMI

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 111

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 112

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 113

Dim PauseTime Start Finish TotalTime As Integer Declare variables

Private Sub txtAIT_332A_SCALED_Change()On Error GoTo PokeAIT_332AErrortxtAIT_332A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtAIT_332A_SCALEDText = Int((3 Rnd) + 20) Generate random value between 20 and 23txtAIT_332A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtAIT_332A_SCALEDLinkItem = AIT_332A_SCALEDtxtAIT_332A_SCALEDLinkMode = 2txtAIT_332A_SCALEDLinkPoketxtAIT_332A_SCALEDLinkMode = 0 DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total time

PokeAIT_332AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtAIT_332A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 114

Private Sub txtAIT_346A_SCALED_Change()On Error GoTo PokeAIT_346AErrortxtAIT_346A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtAIT_346A_SCALEDText = Int((3 Rnd) + 15) Generate random value between 15 and 18txtAIT_346A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtAIT_346A_SCALEDLinkItem = AIT_346A_SCALEDtxtAIT_346A_SCALEDLinkMode = 2txtAIT_346A_SCALEDLinkPoketxtAIT_346A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeAIT_346AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtAIT_346A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 115

Private Sub txtFIT_321A_SCALED_Change()On Error GoTo PokeFIT_321AErrortxtFIT_321A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtFIT_321A_SCALEDText = Int((10 Rnd) + 120) Generate random value between 120 and 130txtFIT_321A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_321A_SCALEDLinkItem = FIT_321A_SCALEDtxtFIT_321A_SCALEDLinkMode = 2txtFIT_321A_SCALEDLinkPoketxtFIT_321A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total time

PokeFIT_321AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_321A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume Next

End Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 116

Private Sub txtFIT_341A_SCALED_Change()On Error GoTo PokeFIT_341AErrortxtFIT_341A_SCALEDLinkMode = 0 PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTime

txtFIT_341A_SCALEDText = Int((3 Rnd) + 18) Generate random value between 18 and 21

txtFIT_341A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_341A_SCALEDLinkItem = FIT_341A_SCALEDtxtFIT_341A_SCALEDLinkMode = 2txtFIT_341A_SCALEDLinkPoketxtFIT_341A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeFIT_341AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_341A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 117

Private Sub txtFIT_343A_SCALED_Change()On Error GoTo PokeFIT_343AErrortxtFIT_343A_SCALEDLinkMode = 0 PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTime

txtFIT_343A_SCALEDText = Int((1 Rnd) + 3) Generate random value between 3 and 4

txtFIT_343A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_343A_SCALEDLinkItem = FIT_343A_SCALEDtxtFIT_343A_SCALEDLinkMode = 2txtFIT_343A_SCALEDLinkPoketxtFIT_343A_SCALEDLinkMode = 0 DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeFIT_343AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_343A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 118

TUTORIAL

Part 4

Questions

amp

Answers

  • Slide 1
  • Slide 2
  • Slide 3
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Slide 8
  • Slide 9
  • Slide 10
  • Slide 11
  • Slide 12
  • Slide 13
  • Slide 14
  • Slide 15
  • Slide 16
  • Slide 17
  • Slide 18
  • Slide 19
  • Slide 20
  • Slide 21
  • Slide 22
  • Slide 23
  • Slide 24
  • Slide 25
  • Slide 26
  • Slide 27
  • Slide 28
  • Slide 29
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
  • Slide 34
  • Slide 35
  • Slide 36
  • Slide 37
  • Slide 38
  • Slide 39
  • Slide 40
  • Slide 41
  • Slide 42
  • Slide 43
  • Slide 44
  • Slide 45
  • Slide 46
  • Slide 47
  • Slide 48
  • Slide 49
  • Slide 50
  • Slide 51
  • Slide 52
  • Slide 53
  • Slide 54
  • Slide 55
  • Slide 56
  • Slide 57
  • Slide 58
  • Slide 59
  • Slide 60
  • Slide 61
  • Slide 62
  • Slide 63
  • Slide 64
  • Slide 65
  • Slide 66
  • Slide 67
  • Slide 68
  • Slide 69
  • Slide 70
  • Slide 71
  • Slide 72
  • Slide 73
  • Slide 74
  • Slide 75
  • Slide 76
  • Slide 77
  • Slide 78
  • Slide 79
  • Slide 80
  • Slide 81
  • Slide 82
  • Slide 83
  • Slide 84
  • Slide 85
  • Slide 86
  • Slide 87
  • Slide 88
  • Slide 89
  • Slide 90
  • Slide 91
  • Slide 92
  • Slide 93
  • Slide 94
  • Slide 95
  • Slide 96
  • Slide 97
  • Slide 98
  • Slide 99
  • Slide 100
  • Slide 101
  • Slide 102
  • Slide 103
  • Slide 104
  • Slide 105
  • Slide 106
  • Slide 107
  • Slide 108
  • Slide 109
  • Slide 110
  • Slide 111
  • Slide 112
  • Slide 113
  • Slide 114
  • Slide 115
  • Slide 116
  • Slide 117
  • Slide 118
Page 72: TUTORIAL Ethernet PLC's Improve Oxygen Consumption ISA Expo/2001Houston, Texas Water & Wastewater Industry DivisionTuesday, September 11, 2001 1 Brad.

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 72

Sequential Function Charts were used here

Higher-Level Control

bull SFCrsquos lend themselves well to (as the name would imply) sequential processes

bull Three Important components in SFCrsquosbull Transitionsbull Stepsbull Jumps

bull The status of the process can be viewed as a flow chart

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 73

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 74

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 75

PLC - HMI Communication

A ldquoPLC Heartbeatrdquo is traditionally used to monitor the PLC - HMI Communication sometimes called ardquoWatchdog Timerrdquo

Call it whatever you want but the PLC amp 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 ldquodiesrdquo then that switch doesnrsquot change state and an alarm alerts the operator

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 76

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 77

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 78

TUTORIAL

Part 2B

HMI Programming

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 79

Ethernet (TCPIP) IO Driver

The Ethernet (TCPIP) IO Driver allows the HMI to communicate with the PLC (In this case the driver is called MBENETEXE)

The PLC has an ethernet module in one of the slots that has a ldquoCAT5RJ-45rdquo 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 ldquoCAT5RJ-45rdquo receptacle for the ethernet cable

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 80

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 81

Operator Screens amp Popup Displays

The display is laid out in 3 sections

bull Upper - Security amp Alarm Windowbull Middle- Main Operator Screens bull Lower - Menu amp Popup Displays

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 82

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 83

Scripting

There are 6 types of ldquoScriptsrdquobull Application Scriptsbull Key Scriptsbull Condition Scriptsbull Data Change Scriptsbull Quick Function Scriptsbull ActiveX Event Scripts

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 84

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 85

Access Names

The ldquoAccess Namesrdquo Must be configured to allow the PLC - HMI communications

Note that the ldquoApplicationTopicrdquo is the same as the IO Driver

The ldquocomputer namerdquo is the name of the PC that the HMI is running on (brad_s_carlberg in this case)

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 86

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 87

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 88

Indirect Tags

ldquoIndirect Tagsrdquo were used here to minimize the number of popup displays

This is especially useful in HMIrsquos with many tags

ONLY 12 popup displays are reused throughout the HMI

This gives the HMI a ldquoDCS-Likerdquo Look amp Feel

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 89

Popup Display TypesThe tag point type determines which popup display to use

Analog InputHIC (or Analog Output)PID (or Analog Composite)

bull PID WITH AUTO amp CASCADE amp RATIObull PID WITH AUTO amp RATIO

Diginbull Motor Status

DigOutMotor (or Digital Composite)

bull Motor with ILock and PermNumericSet TimersAlarm DetailAlarm Tags

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 90

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 91

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 92

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 93

Bars Buttons amp Sliders

By choosing to use indirect tags we complicate the Bar Graphs Buttons amp Sliders in the popup displays

Different scales need to be used for different engineering unit ranges

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 94

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 95

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 96

Popup Displays

The next two pages shows how the individual popup displays use the indirect tags

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 97

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 98

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 99

Adding a ldquoTouch Targetrdquo to a Display

2 Tell which tags to use

3 Tell which popup display to call upWhat kind of point type is it

3 Steps1 Tell which scale to use (if itrsquos an analog point type)

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 100

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 101

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 102

TUTORIAL

Part 2C

Excel Spreadsheets

amp

Visual Basic

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 103

A ldquoCHEAP amp DIRTYrdquo HMI With Excel

The 4 key parameters are

To communicate with the PLCUse brad_s_carlbergmbenet|ANOXIC_OXICrsquoplcregisterrsquo

Excel uses ldquopeeksrdquo amp ldquopokesrdquo to read from amp write to a PLC or HMI

To communicate with the HMIbrad_s_carlbergview|Tagnamersquotagnamersquo

bull computer namebull applicationbull topicbull item

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 104

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 105

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 106

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 107

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 108

Excel Macros

bull ldquoRequestrdquo Macro to read values

bull ldquoPokerdquo Macro to write values

bull A Sample Excel Macro

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 109

Sub PokeMacro()MsgBox ApplicationNetworkTemplatesPathChannel = ApplicationDDEInitiate(app=brad_s_carlbergVIEW topic=Tagname) This opens a DDE channel to ViewApplicationDDEPoke Channel Temperature1 Worksheets(Sheet1)Range(A1) Puts value from R1C1 into Temperature1ApplicationDDEPoke Channel DDEReal Worksheets(Sheet1)Range(A2) Puts value from R1C1 into Temperature1ApplicationDDEPoke Channel DDEInteger Worksheets(Sheet1)Range(A3) Puts value from R1C1 into Temperature1ApplicationDDETerminate Channel This terminates the DDE channelEnd SubSub RequestMacro()Channel = ApplicationDDEInitiate(app=brad_s_carlbergVIEW topic=Tagname) This opens a DDE channel to ViewWorksheets(Sheet1)Range(C4) = ApplicationDDERequest(Channel $Hour)Worksheets(Sheet1)Range(C5) = ApplicationDDERequest(Channel $Minute)Worksheets(Sheet1)Range(C6) = ApplicationDDERequest(Channel $Second)Worksheets(Sheet1)Range(C9) = ApplicationDDERequest(Channel $day)Worksheets(Sheet1)Range(C10) = ApplicationDDERequest(Channel $date)Worksheets(Sheet1)Range(C11) = ApplicationDDERequest(Channel $datestring)Worksheets(Sheet1)Range(C12) = ApplicationDDERequest(Channel $datetime)Worksheets(Sheet1)Range(C13) = ApplicationDDERequest(Channel $date)Worksheets(Sheet1)Range(C14) = ApplicationDDERequest(Channel $month)Worksheets(Sheet1)Range(C15) = ApplicationDDERequest(Channel $year)Worksheets(Sheet1)Range(C16) = ApplicationDDERequest(Channel $time)Worksheets(Sheet1)Range(C17) = ApplicationDDERequest(Channel $timestring)Worksheets(Sheet1)Range(C18) = ApplicationDDERequest(Channel $applicationversion)Worksheets(Sheet1)Range(C19) = ApplicationDDERequest(Channel $startddeconversations)Worksheets(Sheet1)Range(C20) = ApplicationDDERequest(Channel $accesslevel)Worksheets(Sheet1)Range(C21) = ApplicationDDERequest(Channel $alarmlogging)Worksheets(Sheet1)Range(C22) = ApplicationDDERequest(Channel $applicationchanged)Worksheets(Sheet1)Range(C23) = ApplicationDDERequest(Channel $configureusers)Worksheets(Sheet1)Range(C24) = ApplicationDDERequest(Channel $changepassword)Worksheets(Sheet1)Range(C25) = ApplicationDDERequest(Channel $InactivityTimeout)Worksheets(Sheet1)Range(C26) = ApplicationDDERequest(Channel $InactivityWarning)Worksheets(Sheet1)Range(C27) = ApplicationDDERequest(Channel $LogicRunning)Worksheets(Sheet1)Range(C28) = ApplicationDDERequest(Channel $OperatorEntered)Worksheets(Sheet1)Range(C29) = ApplicationDDERequest(Channel $Operator)Worksheets(Sheet1)Range(C30) = ApplicationDDERequest(Channel $PasswordEntered)ApplicationDDETerminate Channel This terminates the DDE channelEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 110

Visual Basic

ldquoRoll Your Ownrdquo HMI - Much More powerful than Excel

Key Parameters computer nameapplication|topicitem

IO Emulator - MBPlusSimulateexe

Can ldquoRead Fromrdquo amp ldquoWrite Tordquo PLC andor HMI

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 111

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 112

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 113

Dim PauseTime Start Finish TotalTime As Integer Declare variables

Private Sub txtAIT_332A_SCALED_Change()On Error GoTo PokeAIT_332AErrortxtAIT_332A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtAIT_332A_SCALEDText = Int((3 Rnd) + 20) Generate random value between 20 and 23txtAIT_332A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtAIT_332A_SCALEDLinkItem = AIT_332A_SCALEDtxtAIT_332A_SCALEDLinkMode = 2txtAIT_332A_SCALEDLinkPoketxtAIT_332A_SCALEDLinkMode = 0 DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total time

PokeAIT_332AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtAIT_332A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 114

Private Sub txtAIT_346A_SCALED_Change()On Error GoTo PokeAIT_346AErrortxtAIT_346A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtAIT_346A_SCALEDText = Int((3 Rnd) + 15) Generate random value between 15 and 18txtAIT_346A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtAIT_346A_SCALEDLinkItem = AIT_346A_SCALEDtxtAIT_346A_SCALEDLinkMode = 2txtAIT_346A_SCALEDLinkPoketxtAIT_346A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeAIT_346AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtAIT_346A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 115

Private Sub txtFIT_321A_SCALED_Change()On Error GoTo PokeFIT_321AErrortxtFIT_321A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtFIT_321A_SCALEDText = Int((10 Rnd) + 120) Generate random value between 120 and 130txtFIT_321A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_321A_SCALEDLinkItem = FIT_321A_SCALEDtxtFIT_321A_SCALEDLinkMode = 2txtFIT_321A_SCALEDLinkPoketxtFIT_321A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total time

PokeFIT_321AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_321A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume Next

End Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 116

Private Sub txtFIT_341A_SCALED_Change()On Error GoTo PokeFIT_341AErrortxtFIT_341A_SCALEDLinkMode = 0 PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTime

txtFIT_341A_SCALEDText = Int((3 Rnd) + 18) Generate random value between 18 and 21

txtFIT_341A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_341A_SCALEDLinkItem = FIT_341A_SCALEDtxtFIT_341A_SCALEDLinkMode = 2txtFIT_341A_SCALEDLinkPoketxtFIT_341A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeFIT_341AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_341A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 117

Private Sub txtFIT_343A_SCALED_Change()On Error GoTo PokeFIT_343AErrortxtFIT_343A_SCALEDLinkMode = 0 PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTime

txtFIT_343A_SCALEDText = Int((1 Rnd) + 3) Generate random value between 3 and 4

txtFIT_343A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_343A_SCALEDLinkItem = FIT_343A_SCALEDtxtFIT_343A_SCALEDLinkMode = 2txtFIT_343A_SCALEDLinkPoketxtFIT_343A_SCALEDLinkMode = 0 DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeFIT_343AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_343A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 118

TUTORIAL

Part 4

Questions

amp

Answers

  • Slide 1
  • Slide 2
  • Slide 3
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Slide 8
  • Slide 9
  • Slide 10
  • Slide 11
  • Slide 12
  • Slide 13
  • Slide 14
  • Slide 15
  • Slide 16
  • Slide 17
  • Slide 18
  • Slide 19
  • Slide 20
  • Slide 21
  • Slide 22
  • Slide 23
  • Slide 24
  • Slide 25
  • Slide 26
  • Slide 27
  • Slide 28
  • Slide 29
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
  • Slide 34
  • Slide 35
  • Slide 36
  • Slide 37
  • Slide 38
  • Slide 39
  • Slide 40
  • Slide 41
  • Slide 42
  • Slide 43
  • Slide 44
  • Slide 45
  • Slide 46
  • Slide 47
  • Slide 48
  • Slide 49
  • Slide 50
  • Slide 51
  • Slide 52
  • Slide 53
  • Slide 54
  • Slide 55
  • Slide 56
  • Slide 57
  • Slide 58
  • Slide 59
  • Slide 60
  • Slide 61
  • Slide 62
  • Slide 63
  • Slide 64
  • Slide 65
  • Slide 66
  • Slide 67
  • Slide 68
  • Slide 69
  • Slide 70
  • Slide 71
  • Slide 72
  • Slide 73
  • Slide 74
  • Slide 75
  • Slide 76
  • Slide 77
  • Slide 78
  • Slide 79
  • Slide 80
  • Slide 81
  • Slide 82
  • Slide 83
  • Slide 84
  • Slide 85
  • Slide 86
  • Slide 87
  • Slide 88
  • Slide 89
  • Slide 90
  • Slide 91
  • Slide 92
  • Slide 93
  • Slide 94
  • Slide 95
  • Slide 96
  • Slide 97
  • Slide 98
  • Slide 99
  • Slide 100
  • Slide 101
  • Slide 102
  • Slide 103
  • Slide 104
  • Slide 105
  • Slide 106
  • Slide 107
  • Slide 108
  • Slide 109
  • Slide 110
  • Slide 111
  • Slide 112
  • Slide 113
  • Slide 114
  • Slide 115
  • Slide 116
  • Slide 117
  • Slide 118
Page 73: TUTORIAL Ethernet PLC's Improve Oxygen Consumption ISA Expo/2001Houston, Texas Water & Wastewater Industry DivisionTuesday, September 11, 2001 1 Brad.

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 73

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 74

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 75

PLC - HMI Communication

A ldquoPLC Heartbeatrdquo is traditionally used to monitor the PLC - HMI Communication sometimes called ardquoWatchdog Timerrdquo

Call it whatever you want but the PLC amp 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 ldquodiesrdquo then that switch doesnrsquot change state and an alarm alerts the operator

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 76

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 77

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 78

TUTORIAL

Part 2B

HMI Programming

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 79

Ethernet (TCPIP) IO Driver

The Ethernet (TCPIP) IO Driver allows the HMI to communicate with the PLC (In this case the driver is called MBENETEXE)

The PLC has an ethernet module in one of the slots that has a ldquoCAT5RJ-45rdquo 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 ldquoCAT5RJ-45rdquo receptacle for the ethernet cable

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 80

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 81

Operator Screens amp Popup Displays

The display is laid out in 3 sections

bull Upper - Security amp Alarm Windowbull Middle- Main Operator Screens bull Lower - Menu amp Popup Displays

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 82

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 83

Scripting

There are 6 types of ldquoScriptsrdquobull Application Scriptsbull Key Scriptsbull Condition Scriptsbull Data Change Scriptsbull Quick Function Scriptsbull ActiveX Event Scripts

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 84

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 85

Access Names

The ldquoAccess Namesrdquo Must be configured to allow the PLC - HMI communications

Note that the ldquoApplicationTopicrdquo is the same as the IO Driver

The ldquocomputer namerdquo is the name of the PC that the HMI is running on (brad_s_carlberg in this case)

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 86

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 87

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 88

Indirect Tags

ldquoIndirect Tagsrdquo were used here to minimize the number of popup displays

This is especially useful in HMIrsquos with many tags

ONLY 12 popup displays are reused throughout the HMI

This gives the HMI a ldquoDCS-Likerdquo Look amp Feel

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 89

Popup Display TypesThe tag point type determines which popup display to use

Analog InputHIC (or Analog Output)PID (or Analog Composite)

bull PID WITH AUTO amp CASCADE amp RATIObull PID WITH AUTO amp RATIO

Diginbull Motor Status

DigOutMotor (or Digital Composite)

bull Motor with ILock and PermNumericSet TimersAlarm DetailAlarm Tags

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 90

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 91

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 92

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 93

Bars Buttons amp Sliders

By choosing to use indirect tags we complicate the Bar Graphs Buttons amp Sliders in the popup displays

Different scales need to be used for different engineering unit ranges

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 94

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 95

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 96

Popup Displays

The next two pages shows how the individual popup displays use the indirect tags

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 97

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 98

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 99

Adding a ldquoTouch Targetrdquo to a Display

2 Tell which tags to use

3 Tell which popup display to call upWhat kind of point type is it

3 Steps1 Tell which scale to use (if itrsquos an analog point type)

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 100

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 101

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 102

TUTORIAL

Part 2C

Excel Spreadsheets

amp

Visual Basic

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 103

A ldquoCHEAP amp DIRTYrdquo HMI With Excel

The 4 key parameters are

To communicate with the PLCUse brad_s_carlbergmbenet|ANOXIC_OXICrsquoplcregisterrsquo

Excel uses ldquopeeksrdquo amp ldquopokesrdquo to read from amp write to a PLC or HMI

To communicate with the HMIbrad_s_carlbergview|Tagnamersquotagnamersquo

bull computer namebull applicationbull topicbull item

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 104

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 105

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 106

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 107

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 108

Excel Macros

bull ldquoRequestrdquo Macro to read values

bull ldquoPokerdquo Macro to write values

bull A Sample Excel Macro

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 109

Sub PokeMacro()MsgBox ApplicationNetworkTemplatesPathChannel = ApplicationDDEInitiate(app=brad_s_carlbergVIEW topic=Tagname) This opens a DDE channel to ViewApplicationDDEPoke Channel Temperature1 Worksheets(Sheet1)Range(A1) Puts value from R1C1 into Temperature1ApplicationDDEPoke Channel DDEReal Worksheets(Sheet1)Range(A2) Puts value from R1C1 into Temperature1ApplicationDDEPoke Channel DDEInteger Worksheets(Sheet1)Range(A3) Puts value from R1C1 into Temperature1ApplicationDDETerminate Channel This terminates the DDE channelEnd SubSub RequestMacro()Channel = ApplicationDDEInitiate(app=brad_s_carlbergVIEW topic=Tagname) This opens a DDE channel to ViewWorksheets(Sheet1)Range(C4) = ApplicationDDERequest(Channel $Hour)Worksheets(Sheet1)Range(C5) = ApplicationDDERequest(Channel $Minute)Worksheets(Sheet1)Range(C6) = ApplicationDDERequest(Channel $Second)Worksheets(Sheet1)Range(C9) = ApplicationDDERequest(Channel $day)Worksheets(Sheet1)Range(C10) = ApplicationDDERequest(Channel $date)Worksheets(Sheet1)Range(C11) = ApplicationDDERequest(Channel $datestring)Worksheets(Sheet1)Range(C12) = ApplicationDDERequest(Channel $datetime)Worksheets(Sheet1)Range(C13) = ApplicationDDERequest(Channel $date)Worksheets(Sheet1)Range(C14) = ApplicationDDERequest(Channel $month)Worksheets(Sheet1)Range(C15) = ApplicationDDERequest(Channel $year)Worksheets(Sheet1)Range(C16) = ApplicationDDERequest(Channel $time)Worksheets(Sheet1)Range(C17) = ApplicationDDERequest(Channel $timestring)Worksheets(Sheet1)Range(C18) = ApplicationDDERequest(Channel $applicationversion)Worksheets(Sheet1)Range(C19) = ApplicationDDERequest(Channel $startddeconversations)Worksheets(Sheet1)Range(C20) = ApplicationDDERequest(Channel $accesslevel)Worksheets(Sheet1)Range(C21) = ApplicationDDERequest(Channel $alarmlogging)Worksheets(Sheet1)Range(C22) = ApplicationDDERequest(Channel $applicationchanged)Worksheets(Sheet1)Range(C23) = ApplicationDDERequest(Channel $configureusers)Worksheets(Sheet1)Range(C24) = ApplicationDDERequest(Channel $changepassword)Worksheets(Sheet1)Range(C25) = ApplicationDDERequest(Channel $InactivityTimeout)Worksheets(Sheet1)Range(C26) = ApplicationDDERequest(Channel $InactivityWarning)Worksheets(Sheet1)Range(C27) = ApplicationDDERequest(Channel $LogicRunning)Worksheets(Sheet1)Range(C28) = ApplicationDDERequest(Channel $OperatorEntered)Worksheets(Sheet1)Range(C29) = ApplicationDDERequest(Channel $Operator)Worksheets(Sheet1)Range(C30) = ApplicationDDERequest(Channel $PasswordEntered)ApplicationDDETerminate Channel This terminates the DDE channelEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 110

Visual Basic

ldquoRoll Your Ownrdquo HMI - Much More powerful than Excel

Key Parameters computer nameapplication|topicitem

IO Emulator - MBPlusSimulateexe

Can ldquoRead Fromrdquo amp ldquoWrite Tordquo PLC andor HMI

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 111

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 112

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 113

Dim PauseTime Start Finish TotalTime As Integer Declare variables

Private Sub txtAIT_332A_SCALED_Change()On Error GoTo PokeAIT_332AErrortxtAIT_332A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtAIT_332A_SCALEDText = Int((3 Rnd) + 20) Generate random value between 20 and 23txtAIT_332A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtAIT_332A_SCALEDLinkItem = AIT_332A_SCALEDtxtAIT_332A_SCALEDLinkMode = 2txtAIT_332A_SCALEDLinkPoketxtAIT_332A_SCALEDLinkMode = 0 DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total time

PokeAIT_332AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtAIT_332A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 114

Private Sub txtAIT_346A_SCALED_Change()On Error GoTo PokeAIT_346AErrortxtAIT_346A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtAIT_346A_SCALEDText = Int((3 Rnd) + 15) Generate random value between 15 and 18txtAIT_346A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtAIT_346A_SCALEDLinkItem = AIT_346A_SCALEDtxtAIT_346A_SCALEDLinkMode = 2txtAIT_346A_SCALEDLinkPoketxtAIT_346A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeAIT_346AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtAIT_346A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 115

Private Sub txtFIT_321A_SCALED_Change()On Error GoTo PokeFIT_321AErrortxtFIT_321A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtFIT_321A_SCALEDText = Int((10 Rnd) + 120) Generate random value between 120 and 130txtFIT_321A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_321A_SCALEDLinkItem = FIT_321A_SCALEDtxtFIT_321A_SCALEDLinkMode = 2txtFIT_321A_SCALEDLinkPoketxtFIT_321A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total time

PokeFIT_321AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_321A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume Next

End Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 116

Private Sub txtFIT_341A_SCALED_Change()On Error GoTo PokeFIT_341AErrortxtFIT_341A_SCALEDLinkMode = 0 PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTime

txtFIT_341A_SCALEDText = Int((3 Rnd) + 18) Generate random value between 18 and 21

txtFIT_341A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_341A_SCALEDLinkItem = FIT_341A_SCALEDtxtFIT_341A_SCALEDLinkMode = 2txtFIT_341A_SCALEDLinkPoketxtFIT_341A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeFIT_341AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_341A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 117

Private Sub txtFIT_343A_SCALED_Change()On Error GoTo PokeFIT_343AErrortxtFIT_343A_SCALEDLinkMode = 0 PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTime

txtFIT_343A_SCALEDText = Int((1 Rnd) + 3) Generate random value between 3 and 4

txtFIT_343A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_343A_SCALEDLinkItem = FIT_343A_SCALEDtxtFIT_343A_SCALEDLinkMode = 2txtFIT_343A_SCALEDLinkPoketxtFIT_343A_SCALEDLinkMode = 0 DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeFIT_343AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_343A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 118

TUTORIAL

Part 4

Questions

amp

Answers

  • Slide 1
  • Slide 2
  • Slide 3
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Slide 8
  • Slide 9
  • Slide 10
  • Slide 11
  • Slide 12
  • Slide 13
  • Slide 14
  • Slide 15
  • Slide 16
  • Slide 17
  • Slide 18
  • Slide 19
  • Slide 20
  • Slide 21
  • Slide 22
  • Slide 23
  • Slide 24
  • Slide 25
  • Slide 26
  • Slide 27
  • Slide 28
  • Slide 29
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
  • Slide 34
  • Slide 35
  • Slide 36
  • Slide 37
  • Slide 38
  • Slide 39
  • Slide 40
  • Slide 41
  • Slide 42
  • Slide 43
  • Slide 44
  • Slide 45
  • Slide 46
  • Slide 47
  • Slide 48
  • Slide 49
  • Slide 50
  • Slide 51
  • Slide 52
  • Slide 53
  • Slide 54
  • Slide 55
  • Slide 56
  • Slide 57
  • Slide 58
  • Slide 59
  • Slide 60
  • Slide 61
  • Slide 62
  • Slide 63
  • Slide 64
  • Slide 65
  • Slide 66
  • Slide 67
  • Slide 68
  • Slide 69
  • Slide 70
  • Slide 71
  • Slide 72
  • Slide 73
  • Slide 74
  • Slide 75
  • Slide 76
  • Slide 77
  • Slide 78
  • Slide 79
  • Slide 80
  • Slide 81
  • Slide 82
  • Slide 83
  • Slide 84
  • Slide 85
  • Slide 86
  • Slide 87
  • Slide 88
  • Slide 89
  • Slide 90
  • Slide 91
  • Slide 92
  • Slide 93
  • Slide 94
  • Slide 95
  • Slide 96
  • Slide 97
  • Slide 98
  • Slide 99
  • Slide 100
  • Slide 101
  • Slide 102
  • Slide 103
  • Slide 104
  • Slide 105
  • Slide 106
  • Slide 107
  • Slide 108
  • Slide 109
  • Slide 110
  • Slide 111
  • Slide 112
  • Slide 113
  • Slide 114
  • Slide 115
  • Slide 116
  • Slide 117
  • Slide 118
Page 74: TUTORIAL Ethernet PLC's Improve Oxygen Consumption ISA Expo/2001Houston, Texas Water & Wastewater Industry DivisionTuesday, September 11, 2001 1 Brad.

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 74

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 75

PLC - HMI Communication

A ldquoPLC Heartbeatrdquo is traditionally used to monitor the PLC - HMI Communication sometimes called ardquoWatchdog Timerrdquo

Call it whatever you want but the PLC amp 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 ldquodiesrdquo then that switch doesnrsquot change state and an alarm alerts the operator

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 76

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 77

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 78

TUTORIAL

Part 2B

HMI Programming

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 79

Ethernet (TCPIP) IO Driver

The Ethernet (TCPIP) IO Driver allows the HMI to communicate with the PLC (In this case the driver is called MBENETEXE)

The PLC has an ethernet module in one of the slots that has a ldquoCAT5RJ-45rdquo 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 ldquoCAT5RJ-45rdquo receptacle for the ethernet cable

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 80

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 81

Operator Screens amp Popup Displays

The display is laid out in 3 sections

bull Upper - Security amp Alarm Windowbull Middle- Main Operator Screens bull Lower - Menu amp Popup Displays

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 82

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 83

Scripting

There are 6 types of ldquoScriptsrdquobull Application Scriptsbull Key Scriptsbull Condition Scriptsbull Data Change Scriptsbull Quick Function Scriptsbull ActiveX Event Scripts

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 84

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 85

Access Names

The ldquoAccess Namesrdquo Must be configured to allow the PLC - HMI communications

Note that the ldquoApplicationTopicrdquo is the same as the IO Driver

The ldquocomputer namerdquo is the name of the PC that the HMI is running on (brad_s_carlberg in this case)

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 86

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 87

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 88

Indirect Tags

ldquoIndirect Tagsrdquo were used here to minimize the number of popup displays

This is especially useful in HMIrsquos with many tags

ONLY 12 popup displays are reused throughout the HMI

This gives the HMI a ldquoDCS-Likerdquo Look amp Feel

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 89

Popup Display TypesThe tag point type determines which popup display to use

Analog InputHIC (or Analog Output)PID (or Analog Composite)

bull PID WITH AUTO amp CASCADE amp RATIObull PID WITH AUTO amp RATIO

Diginbull Motor Status

DigOutMotor (or Digital Composite)

bull Motor with ILock and PermNumericSet TimersAlarm DetailAlarm Tags

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 90

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 91

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 92

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 93

Bars Buttons amp Sliders

By choosing to use indirect tags we complicate the Bar Graphs Buttons amp Sliders in the popup displays

Different scales need to be used for different engineering unit ranges

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 94

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 95

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 96

Popup Displays

The next two pages shows how the individual popup displays use the indirect tags

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 97

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 98

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 99

Adding a ldquoTouch Targetrdquo to a Display

2 Tell which tags to use

3 Tell which popup display to call upWhat kind of point type is it

3 Steps1 Tell which scale to use (if itrsquos an analog point type)

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 100

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 101

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 102

TUTORIAL

Part 2C

Excel Spreadsheets

amp

Visual Basic

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 103

A ldquoCHEAP amp DIRTYrdquo HMI With Excel

The 4 key parameters are

To communicate with the PLCUse brad_s_carlbergmbenet|ANOXIC_OXICrsquoplcregisterrsquo

Excel uses ldquopeeksrdquo amp ldquopokesrdquo to read from amp write to a PLC or HMI

To communicate with the HMIbrad_s_carlbergview|Tagnamersquotagnamersquo

bull computer namebull applicationbull topicbull item

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 104

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 105

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 106

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 107

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 108

Excel Macros

bull ldquoRequestrdquo Macro to read values

bull ldquoPokerdquo Macro to write values

bull A Sample Excel Macro

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 109

Sub PokeMacro()MsgBox ApplicationNetworkTemplatesPathChannel = ApplicationDDEInitiate(app=brad_s_carlbergVIEW topic=Tagname) This opens a DDE channel to ViewApplicationDDEPoke Channel Temperature1 Worksheets(Sheet1)Range(A1) Puts value from R1C1 into Temperature1ApplicationDDEPoke Channel DDEReal Worksheets(Sheet1)Range(A2) Puts value from R1C1 into Temperature1ApplicationDDEPoke Channel DDEInteger Worksheets(Sheet1)Range(A3) Puts value from R1C1 into Temperature1ApplicationDDETerminate Channel This terminates the DDE channelEnd SubSub RequestMacro()Channel = ApplicationDDEInitiate(app=brad_s_carlbergVIEW topic=Tagname) This opens a DDE channel to ViewWorksheets(Sheet1)Range(C4) = ApplicationDDERequest(Channel $Hour)Worksheets(Sheet1)Range(C5) = ApplicationDDERequest(Channel $Minute)Worksheets(Sheet1)Range(C6) = ApplicationDDERequest(Channel $Second)Worksheets(Sheet1)Range(C9) = ApplicationDDERequest(Channel $day)Worksheets(Sheet1)Range(C10) = ApplicationDDERequest(Channel $date)Worksheets(Sheet1)Range(C11) = ApplicationDDERequest(Channel $datestring)Worksheets(Sheet1)Range(C12) = ApplicationDDERequest(Channel $datetime)Worksheets(Sheet1)Range(C13) = ApplicationDDERequest(Channel $date)Worksheets(Sheet1)Range(C14) = ApplicationDDERequest(Channel $month)Worksheets(Sheet1)Range(C15) = ApplicationDDERequest(Channel $year)Worksheets(Sheet1)Range(C16) = ApplicationDDERequest(Channel $time)Worksheets(Sheet1)Range(C17) = ApplicationDDERequest(Channel $timestring)Worksheets(Sheet1)Range(C18) = ApplicationDDERequest(Channel $applicationversion)Worksheets(Sheet1)Range(C19) = ApplicationDDERequest(Channel $startddeconversations)Worksheets(Sheet1)Range(C20) = ApplicationDDERequest(Channel $accesslevel)Worksheets(Sheet1)Range(C21) = ApplicationDDERequest(Channel $alarmlogging)Worksheets(Sheet1)Range(C22) = ApplicationDDERequest(Channel $applicationchanged)Worksheets(Sheet1)Range(C23) = ApplicationDDERequest(Channel $configureusers)Worksheets(Sheet1)Range(C24) = ApplicationDDERequest(Channel $changepassword)Worksheets(Sheet1)Range(C25) = ApplicationDDERequest(Channel $InactivityTimeout)Worksheets(Sheet1)Range(C26) = ApplicationDDERequest(Channel $InactivityWarning)Worksheets(Sheet1)Range(C27) = ApplicationDDERequest(Channel $LogicRunning)Worksheets(Sheet1)Range(C28) = ApplicationDDERequest(Channel $OperatorEntered)Worksheets(Sheet1)Range(C29) = ApplicationDDERequest(Channel $Operator)Worksheets(Sheet1)Range(C30) = ApplicationDDERequest(Channel $PasswordEntered)ApplicationDDETerminate Channel This terminates the DDE channelEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 110

Visual Basic

ldquoRoll Your Ownrdquo HMI - Much More powerful than Excel

Key Parameters computer nameapplication|topicitem

IO Emulator - MBPlusSimulateexe

Can ldquoRead Fromrdquo amp ldquoWrite Tordquo PLC andor HMI

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 111

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 112

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 113

Dim PauseTime Start Finish TotalTime As Integer Declare variables

Private Sub txtAIT_332A_SCALED_Change()On Error GoTo PokeAIT_332AErrortxtAIT_332A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtAIT_332A_SCALEDText = Int((3 Rnd) + 20) Generate random value between 20 and 23txtAIT_332A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtAIT_332A_SCALEDLinkItem = AIT_332A_SCALEDtxtAIT_332A_SCALEDLinkMode = 2txtAIT_332A_SCALEDLinkPoketxtAIT_332A_SCALEDLinkMode = 0 DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total time

PokeAIT_332AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtAIT_332A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 114

Private Sub txtAIT_346A_SCALED_Change()On Error GoTo PokeAIT_346AErrortxtAIT_346A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtAIT_346A_SCALEDText = Int((3 Rnd) + 15) Generate random value between 15 and 18txtAIT_346A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtAIT_346A_SCALEDLinkItem = AIT_346A_SCALEDtxtAIT_346A_SCALEDLinkMode = 2txtAIT_346A_SCALEDLinkPoketxtAIT_346A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeAIT_346AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtAIT_346A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 115

Private Sub txtFIT_321A_SCALED_Change()On Error GoTo PokeFIT_321AErrortxtFIT_321A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtFIT_321A_SCALEDText = Int((10 Rnd) + 120) Generate random value between 120 and 130txtFIT_321A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_321A_SCALEDLinkItem = FIT_321A_SCALEDtxtFIT_321A_SCALEDLinkMode = 2txtFIT_321A_SCALEDLinkPoketxtFIT_321A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total time

PokeFIT_321AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_321A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume Next

End Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 116

Private Sub txtFIT_341A_SCALED_Change()On Error GoTo PokeFIT_341AErrortxtFIT_341A_SCALEDLinkMode = 0 PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTime

txtFIT_341A_SCALEDText = Int((3 Rnd) + 18) Generate random value between 18 and 21

txtFIT_341A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_341A_SCALEDLinkItem = FIT_341A_SCALEDtxtFIT_341A_SCALEDLinkMode = 2txtFIT_341A_SCALEDLinkPoketxtFIT_341A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeFIT_341AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_341A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 117

Private Sub txtFIT_343A_SCALED_Change()On Error GoTo PokeFIT_343AErrortxtFIT_343A_SCALEDLinkMode = 0 PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTime

txtFIT_343A_SCALEDText = Int((1 Rnd) + 3) Generate random value between 3 and 4

txtFIT_343A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_343A_SCALEDLinkItem = FIT_343A_SCALEDtxtFIT_343A_SCALEDLinkMode = 2txtFIT_343A_SCALEDLinkPoketxtFIT_343A_SCALEDLinkMode = 0 DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeFIT_343AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_343A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 118

TUTORIAL

Part 4

Questions

amp

Answers

  • Slide 1
  • Slide 2
  • Slide 3
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Slide 8
  • Slide 9
  • Slide 10
  • Slide 11
  • Slide 12
  • Slide 13
  • Slide 14
  • Slide 15
  • Slide 16
  • Slide 17
  • Slide 18
  • Slide 19
  • Slide 20
  • Slide 21
  • Slide 22
  • Slide 23
  • Slide 24
  • Slide 25
  • Slide 26
  • Slide 27
  • Slide 28
  • Slide 29
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
  • Slide 34
  • Slide 35
  • Slide 36
  • Slide 37
  • Slide 38
  • Slide 39
  • Slide 40
  • Slide 41
  • Slide 42
  • Slide 43
  • Slide 44
  • Slide 45
  • Slide 46
  • Slide 47
  • Slide 48
  • Slide 49
  • Slide 50
  • Slide 51
  • Slide 52
  • Slide 53
  • Slide 54
  • Slide 55
  • Slide 56
  • Slide 57
  • Slide 58
  • Slide 59
  • Slide 60
  • Slide 61
  • Slide 62
  • Slide 63
  • Slide 64
  • Slide 65
  • Slide 66
  • Slide 67
  • Slide 68
  • Slide 69
  • Slide 70
  • Slide 71
  • Slide 72
  • Slide 73
  • Slide 74
  • Slide 75
  • Slide 76
  • Slide 77
  • Slide 78
  • Slide 79
  • Slide 80
  • Slide 81
  • Slide 82
  • Slide 83
  • Slide 84
  • Slide 85
  • Slide 86
  • Slide 87
  • Slide 88
  • Slide 89
  • Slide 90
  • Slide 91
  • Slide 92
  • Slide 93
  • Slide 94
  • Slide 95
  • Slide 96
  • Slide 97
  • Slide 98
  • Slide 99
  • Slide 100
  • Slide 101
  • Slide 102
  • Slide 103
  • Slide 104
  • Slide 105
  • Slide 106
  • Slide 107
  • Slide 108
  • Slide 109
  • Slide 110
  • Slide 111
  • Slide 112
  • Slide 113
  • Slide 114
  • Slide 115
  • Slide 116
  • Slide 117
  • Slide 118
Page 75: TUTORIAL Ethernet PLC's Improve Oxygen Consumption ISA Expo/2001Houston, Texas Water & Wastewater Industry DivisionTuesday, September 11, 2001 1 Brad.

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 75

PLC - HMI Communication

A ldquoPLC Heartbeatrdquo is traditionally used to monitor the PLC - HMI Communication sometimes called ardquoWatchdog Timerrdquo

Call it whatever you want but the PLC amp 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 ldquodiesrdquo then that switch doesnrsquot change state and an alarm alerts the operator

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 76

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 77

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 78

TUTORIAL

Part 2B

HMI Programming

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 79

Ethernet (TCPIP) IO Driver

The Ethernet (TCPIP) IO Driver allows the HMI to communicate with the PLC (In this case the driver is called MBENETEXE)

The PLC has an ethernet module in one of the slots that has a ldquoCAT5RJ-45rdquo 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 ldquoCAT5RJ-45rdquo receptacle for the ethernet cable

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 80

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 81

Operator Screens amp Popup Displays

The display is laid out in 3 sections

bull Upper - Security amp Alarm Windowbull Middle- Main Operator Screens bull Lower - Menu amp Popup Displays

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 82

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 83

Scripting

There are 6 types of ldquoScriptsrdquobull Application Scriptsbull Key Scriptsbull Condition Scriptsbull Data Change Scriptsbull Quick Function Scriptsbull ActiveX Event Scripts

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 84

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 85

Access Names

The ldquoAccess Namesrdquo Must be configured to allow the PLC - HMI communications

Note that the ldquoApplicationTopicrdquo is the same as the IO Driver

The ldquocomputer namerdquo is the name of the PC that the HMI is running on (brad_s_carlberg in this case)

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 86

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 87

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 88

Indirect Tags

ldquoIndirect Tagsrdquo were used here to minimize the number of popup displays

This is especially useful in HMIrsquos with many tags

ONLY 12 popup displays are reused throughout the HMI

This gives the HMI a ldquoDCS-Likerdquo Look amp Feel

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 89

Popup Display TypesThe tag point type determines which popup display to use

Analog InputHIC (or Analog Output)PID (or Analog Composite)

bull PID WITH AUTO amp CASCADE amp RATIObull PID WITH AUTO amp RATIO

Diginbull Motor Status

DigOutMotor (or Digital Composite)

bull Motor with ILock and PermNumericSet TimersAlarm DetailAlarm Tags

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 90

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 91

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 92

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 93

Bars Buttons amp Sliders

By choosing to use indirect tags we complicate the Bar Graphs Buttons amp Sliders in the popup displays

Different scales need to be used for different engineering unit ranges

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 94

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 95

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 96

Popup Displays

The next two pages shows how the individual popup displays use the indirect tags

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 97

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 98

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 99

Adding a ldquoTouch Targetrdquo to a Display

2 Tell which tags to use

3 Tell which popup display to call upWhat kind of point type is it

3 Steps1 Tell which scale to use (if itrsquos an analog point type)

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 100

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 101

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 102

TUTORIAL

Part 2C

Excel Spreadsheets

amp

Visual Basic

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 103

A ldquoCHEAP amp DIRTYrdquo HMI With Excel

The 4 key parameters are

To communicate with the PLCUse brad_s_carlbergmbenet|ANOXIC_OXICrsquoplcregisterrsquo

Excel uses ldquopeeksrdquo amp ldquopokesrdquo to read from amp write to a PLC or HMI

To communicate with the HMIbrad_s_carlbergview|Tagnamersquotagnamersquo

bull computer namebull applicationbull topicbull item

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 104

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 105

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 106

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 107

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 108

Excel Macros

bull ldquoRequestrdquo Macro to read values

bull ldquoPokerdquo Macro to write values

bull A Sample Excel Macro

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 109

Sub PokeMacro()MsgBox ApplicationNetworkTemplatesPathChannel = ApplicationDDEInitiate(app=brad_s_carlbergVIEW topic=Tagname) This opens a DDE channel to ViewApplicationDDEPoke Channel Temperature1 Worksheets(Sheet1)Range(A1) Puts value from R1C1 into Temperature1ApplicationDDEPoke Channel DDEReal Worksheets(Sheet1)Range(A2) Puts value from R1C1 into Temperature1ApplicationDDEPoke Channel DDEInteger Worksheets(Sheet1)Range(A3) Puts value from R1C1 into Temperature1ApplicationDDETerminate Channel This terminates the DDE channelEnd SubSub RequestMacro()Channel = ApplicationDDEInitiate(app=brad_s_carlbergVIEW topic=Tagname) This opens a DDE channel to ViewWorksheets(Sheet1)Range(C4) = ApplicationDDERequest(Channel $Hour)Worksheets(Sheet1)Range(C5) = ApplicationDDERequest(Channel $Minute)Worksheets(Sheet1)Range(C6) = ApplicationDDERequest(Channel $Second)Worksheets(Sheet1)Range(C9) = ApplicationDDERequest(Channel $day)Worksheets(Sheet1)Range(C10) = ApplicationDDERequest(Channel $date)Worksheets(Sheet1)Range(C11) = ApplicationDDERequest(Channel $datestring)Worksheets(Sheet1)Range(C12) = ApplicationDDERequest(Channel $datetime)Worksheets(Sheet1)Range(C13) = ApplicationDDERequest(Channel $date)Worksheets(Sheet1)Range(C14) = ApplicationDDERequest(Channel $month)Worksheets(Sheet1)Range(C15) = ApplicationDDERequest(Channel $year)Worksheets(Sheet1)Range(C16) = ApplicationDDERequest(Channel $time)Worksheets(Sheet1)Range(C17) = ApplicationDDERequest(Channel $timestring)Worksheets(Sheet1)Range(C18) = ApplicationDDERequest(Channel $applicationversion)Worksheets(Sheet1)Range(C19) = ApplicationDDERequest(Channel $startddeconversations)Worksheets(Sheet1)Range(C20) = ApplicationDDERequest(Channel $accesslevel)Worksheets(Sheet1)Range(C21) = ApplicationDDERequest(Channel $alarmlogging)Worksheets(Sheet1)Range(C22) = ApplicationDDERequest(Channel $applicationchanged)Worksheets(Sheet1)Range(C23) = ApplicationDDERequest(Channel $configureusers)Worksheets(Sheet1)Range(C24) = ApplicationDDERequest(Channel $changepassword)Worksheets(Sheet1)Range(C25) = ApplicationDDERequest(Channel $InactivityTimeout)Worksheets(Sheet1)Range(C26) = ApplicationDDERequest(Channel $InactivityWarning)Worksheets(Sheet1)Range(C27) = ApplicationDDERequest(Channel $LogicRunning)Worksheets(Sheet1)Range(C28) = ApplicationDDERequest(Channel $OperatorEntered)Worksheets(Sheet1)Range(C29) = ApplicationDDERequest(Channel $Operator)Worksheets(Sheet1)Range(C30) = ApplicationDDERequest(Channel $PasswordEntered)ApplicationDDETerminate Channel This terminates the DDE channelEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 110

Visual Basic

ldquoRoll Your Ownrdquo HMI - Much More powerful than Excel

Key Parameters computer nameapplication|topicitem

IO Emulator - MBPlusSimulateexe

Can ldquoRead Fromrdquo amp ldquoWrite Tordquo PLC andor HMI

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 111

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 112

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 113

Dim PauseTime Start Finish TotalTime As Integer Declare variables

Private Sub txtAIT_332A_SCALED_Change()On Error GoTo PokeAIT_332AErrortxtAIT_332A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtAIT_332A_SCALEDText = Int((3 Rnd) + 20) Generate random value between 20 and 23txtAIT_332A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtAIT_332A_SCALEDLinkItem = AIT_332A_SCALEDtxtAIT_332A_SCALEDLinkMode = 2txtAIT_332A_SCALEDLinkPoketxtAIT_332A_SCALEDLinkMode = 0 DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total time

PokeAIT_332AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtAIT_332A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 114

Private Sub txtAIT_346A_SCALED_Change()On Error GoTo PokeAIT_346AErrortxtAIT_346A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtAIT_346A_SCALEDText = Int((3 Rnd) + 15) Generate random value between 15 and 18txtAIT_346A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtAIT_346A_SCALEDLinkItem = AIT_346A_SCALEDtxtAIT_346A_SCALEDLinkMode = 2txtAIT_346A_SCALEDLinkPoketxtAIT_346A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeAIT_346AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtAIT_346A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 115

Private Sub txtFIT_321A_SCALED_Change()On Error GoTo PokeFIT_321AErrortxtFIT_321A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtFIT_321A_SCALEDText = Int((10 Rnd) + 120) Generate random value between 120 and 130txtFIT_321A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_321A_SCALEDLinkItem = FIT_321A_SCALEDtxtFIT_321A_SCALEDLinkMode = 2txtFIT_321A_SCALEDLinkPoketxtFIT_321A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total time

PokeFIT_321AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_321A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume Next

End Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 116

Private Sub txtFIT_341A_SCALED_Change()On Error GoTo PokeFIT_341AErrortxtFIT_341A_SCALEDLinkMode = 0 PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTime

txtFIT_341A_SCALEDText = Int((3 Rnd) + 18) Generate random value between 18 and 21

txtFIT_341A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_341A_SCALEDLinkItem = FIT_341A_SCALEDtxtFIT_341A_SCALEDLinkMode = 2txtFIT_341A_SCALEDLinkPoketxtFIT_341A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeFIT_341AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_341A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 117

Private Sub txtFIT_343A_SCALED_Change()On Error GoTo PokeFIT_343AErrortxtFIT_343A_SCALEDLinkMode = 0 PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTime

txtFIT_343A_SCALEDText = Int((1 Rnd) + 3) Generate random value between 3 and 4

txtFIT_343A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_343A_SCALEDLinkItem = FIT_343A_SCALEDtxtFIT_343A_SCALEDLinkMode = 2txtFIT_343A_SCALEDLinkPoketxtFIT_343A_SCALEDLinkMode = 0 DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeFIT_343AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_343A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 118

TUTORIAL

Part 4

Questions

amp

Answers

  • Slide 1
  • Slide 2
  • Slide 3
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Slide 8
  • Slide 9
  • Slide 10
  • Slide 11
  • Slide 12
  • Slide 13
  • Slide 14
  • Slide 15
  • Slide 16
  • Slide 17
  • Slide 18
  • Slide 19
  • Slide 20
  • Slide 21
  • Slide 22
  • Slide 23
  • Slide 24
  • Slide 25
  • Slide 26
  • Slide 27
  • Slide 28
  • Slide 29
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
  • Slide 34
  • Slide 35
  • Slide 36
  • Slide 37
  • Slide 38
  • Slide 39
  • Slide 40
  • Slide 41
  • Slide 42
  • Slide 43
  • Slide 44
  • Slide 45
  • Slide 46
  • Slide 47
  • Slide 48
  • Slide 49
  • Slide 50
  • Slide 51
  • Slide 52
  • Slide 53
  • Slide 54
  • Slide 55
  • Slide 56
  • Slide 57
  • Slide 58
  • Slide 59
  • Slide 60
  • Slide 61
  • Slide 62
  • Slide 63
  • Slide 64
  • Slide 65
  • Slide 66
  • Slide 67
  • Slide 68
  • Slide 69
  • Slide 70
  • Slide 71
  • Slide 72
  • Slide 73
  • Slide 74
  • Slide 75
  • Slide 76
  • Slide 77
  • Slide 78
  • Slide 79
  • Slide 80
  • Slide 81
  • Slide 82
  • Slide 83
  • Slide 84
  • Slide 85
  • Slide 86
  • Slide 87
  • Slide 88
  • Slide 89
  • Slide 90
  • Slide 91
  • Slide 92
  • Slide 93
  • Slide 94
  • Slide 95
  • Slide 96
  • Slide 97
  • Slide 98
  • Slide 99
  • Slide 100
  • Slide 101
  • Slide 102
  • Slide 103
  • Slide 104
  • Slide 105
  • Slide 106
  • Slide 107
  • Slide 108
  • Slide 109
  • Slide 110
  • Slide 111
  • Slide 112
  • Slide 113
  • Slide 114
  • Slide 115
  • Slide 116
  • Slide 117
  • Slide 118
Page 76: TUTORIAL Ethernet PLC's Improve Oxygen Consumption ISA Expo/2001Houston, Texas Water & Wastewater Industry DivisionTuesday, September 11, 2001 1 Brad.

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 76

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 77

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 78

TUTORIAL

Part 2B

HMI Programming

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 79

Ethernet (TCPIP) IO Driver

The Ethernet (TCPIP) IO Driver allows the HMI to communicate with the PLC (In this case the driver is called MBENETEXE)

The PLC has an ethernet module in one of the slots that has a ldquoCAT5RJ-45rdquo 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 ldquoCAT5RJ-45rdquo receptacle for the ethernet cable

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 80

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 81

Operator Screens amp Popup Displays

The display is laid out in 3 sections

bull Upper - Security amp Alarm Windowbull Middle- Main Operator Screens bull Lower - Menu amp Popup Displays

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 82

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 83

Scripting

There are 6 types of ldquoScriptsrdquobull Application Scriptsbull Key Scriptsbull Condition Scriptsbull Data Change Scriptsbull Quick Function Scriptsbull ActiveX Event Scripts

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 84

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 85

Access Names

The ldquoAccess Namesrdquo Must be configured to allow the PLC - HMI communications

Note that the ldquoApplicationTopicrdquo is the same as the IO Driver

The ldquocomputer namerdquo is the name of the PC that the HMI is running on (brad_s_carlberg in this case)

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 86

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 87

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 88

Indirect Tags

ldquoIndirect Tagsrdquo were used here to minimize the number of popup displays

This is especially useful in HMIrsquos with many tags

ONLY 12 popup displays are reused throughout the HMI

This gives the HMI a ldquoDCS-Likerdquo Look amp Feel

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 89

Popup Display TypesThe tag point type determines which popup display to use

Analog InputHIC (or Analog Output)PID (or Analog Composite)

bull PID WITH AUTO amp CASCADE amp RATIObull PID WITH AUTO amp RATIO

Diginbull Motor Status

DigOutMotor (or Digital Composite)

bull Motor with ILock and PermNumericSet TimersAlarm DetailAlarm Tags

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 90

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 91

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 92

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 93

Bars Buttons amp Sliders

By choosing to use indirect tags we complicate the Bar Graphs Buttons amp Sliders in the popup displays

Different scales need to be used for different engineering unit ranges

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 94

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 95

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 96

Popup Displays

The next two pages shows how the individual popup displays use the indirect tags

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 97

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 98

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 99

Adding a ldquoTouch Targetrdquo to a Display

2 Tell which tags to use

3 Tell which popup display to call upWhat kind of point type is it

3 Steps1 Tell which scale to use (if itrsquos an analog point type)

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 100

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 101

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 102

TUTORIAL

Part 2C

Excel Spreadsheets

amp

Visual Basic

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 103

A ldquoCHEAP amp DIRTYrdquo HMI With Excel

The 4 key parameters are

To communicate with the PLCUse brad_s_carlbergmbenet|ANOXIC_OXICrsquoplcregisterrsquo

Excel uses ldquopeeksrdquo amp ldquopokesrdquo to read from amp write to a PLC or HMI

To communicate with the HMIbrad_s_carlbergview|Tagnamersquotagnamersquo

bull computer namebull applicationbull topicbull item

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 104

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 105

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 106

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 107

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 108

Excel Macros

bull ldquoRequestrdquo Macro to read values

bull ldquoPokerdquo Macro to write values

bull A Sample Excel Macro

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 109

Sub PokeMacro()MsgBox ApplicationNetworkTemplatesPathChannel = ApplicationDDEInitiate(app=brad_s_carlbergVIEW topic=Tagname) This opens a DDE channel to ViewApplicationDDEPoke Channel Temperature1 Worksheets(Sheet1)Range(A1) Puts value from R1C1 into Temperature1ApplicationDDEPoke Channel DDEReal Worksheets(Sheet1)Range(A2) Puts value from R1C1 into Temperature1ApplicationDDEPoke Channel DDEInteger Worksheets(Sheet1)Range(A3) Puts value from R1C1 into Temperature1ApplicationDDETerminate Channel This terminates the DDE channelEnd SubSub RequestMacro()Channel = ApplicationDDEInitiate(app=brad_s_carlbergVIEW topic=Tagname) This opens a DDE channel to ViewWorksheets(Sheet1)Range(C4) = ApplicationDDERequest(Channel $Hour)Worksheets(Sheet1)Range(C5) = ApplicationDDERequest(Channel $Minute)Worksheets(Sheet1)Range(C6) = ApplicationDDERequest(Channel $Second)Worksheets(Sheet1)Range(C9) = ApplicationDDERequest(Channel $day)Worksheets(Sheet1)Range(C10) = ApplicationDDERequest(Channel $date)Worksheets(Sheet1)Range(C11) = ApplicationDDERequest(Channel $datestring)Worksheets(Sheet1)Range(C12) = ApplicationDDERequest(Channel $datetime)Worksheets(Sheet1)Range(C13) = ApplicationDDERequest(Channel $date)Worksheets(Sheet1)Range(C14) = ApplicationDDERequest(Channel $month)Worksheets(Sheet1)Range(C15) = ApplicationDDERequest(Channel $year)Worksheets(Sheet1)Range(C16) = ApplicationDDERequest(Channel $time)Worksheets(Sheet1)Range(C17) = ApplicationDDERequest(Channel $timestring)Worksheets(Sheet1)Range(C18) = ApplicationDDERequest(Channel $applicationversion)Worksheets(Sheet1)Range(C19) = ApplicationDDERequest(Channel $startddeconversations)Worksheets(Sheet1)Range(C20) = ApplicationDDERequest(Channel $accesslevel)Worksheets(Sheet1)Range(C21) = ApplicationDDERequest(Channel $alarmlogging)Worksheets(Sheet1)Range(C22) = ApplicationDDERequest(Channel $applicationchanged)Worksheets(Sheet1)Range(C23) = ApplicationDDERequest(Channel $configureusers)Worksheets(Sheet1)Range(C24) = ApplicationDDERequest(Channel $changepassword)Worksheets(Sheet1)Range(C25) = ApplicationDDERequest(Channel $InactivityTimeout)Worksheets(Sheet1)Range(C26) = ApplicationDDERequest(Channel $InactivityWarning)Worksheets(Sheet1)Range(C27) = ApplicationDDERequest(Channel $LogicRunning)Worksheets(Sheet1)Range(C28) = ApplicationDDERequest(Channel $OperatorEntered)Worksheets(Sheet1)Range(C29) = ApplicationDDERequest(Channel $Operator)Worksheets(Sheet1)Range(C30) = ApplicationDDERequest(Channel $PasswordEntered)ApplicationDDETerminate Channel This terminates the DDE channelEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 110

Visual Basic

ldquoRoll Your Ownrdquo HMI - Much More powerful than Excel

Key Parameters computer nameapplication|topicitem

IO Emulator - MBPlusSimulateexe

Can ldquoRead Fromrdquo amp ldquoWrite Tordquo PLC andor HMI

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 111

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 112

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 113

Dim PauseTime Start Finish TotalTime As Integer Declare variables

Private Sub txtAIT_332A_SCALED_Change()On Error GoTo PokeAIT_332AErrortxtAIT_332A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtAIT_332A_SCALEDText = Int((3 Rnd) + 20) Generate random value between 20 and 23txtAIT_332A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtAIT_332A_SCALEDLinkItem = AIT_332A_SCALEDtxtAIT_332A_SCALEDLinkMode = 2txtAIT_332A_SCALEDLinkPoketxtAIT_332A_SCALEDLinkMode = 0 DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total time

PokeAIT_332AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtAIT_332A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 114

Private Sub txtAIT_346A_SCALED_Change()On Error GoTo PokeAIT_346AErrortxtAIT_346A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtAIT_346A_SCALEDText = Int((3 Rnd) + 15) Generate random value between 15 and 18txtAIT_346A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtAIT_346A_SCALEDLinkItem = AIT_346A_SCALEDtxtAIT_346A_SCALEDLinkMode = 2txtAIT_346A_SCALEDLinkPoketxtAIT_346A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeAIT_346AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtAIT_346A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 115

Private Sub txtFIT_321A_SCALED_Change()On Error GoTo PokeFIT_321AErrortxtFIT_321A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtFIT_321A_SCALEDText = Int((10 Rnd) + 120) Generate random value between 120 and 130txtFIT_321A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_321A_SCALEDLinkItem = FIT_321A_SCALEDtxtFIT_321A_SCALEDLinkMode = 2txtFIT_321A_SCALEDLinkPoketxtFIT_321A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total time

PokeFIT_321AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_321A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume Next

End Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 116

Private Sub txtFIT_341A_SCALED_Change()On Error GoTo PokeFIT_341AErrortxtFIT_341A_SCALEDLinkMode = 0 PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTime

txtFIT_341A_SCALEDText = Int((3 Rnd) + 18) Generate random value between 18 and 21

txtFIT_341A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_341A_SCALEDLinkItem = FIT_341A_SCALEDtxtFIT_341A_SCALEDLinkMode = 2txtFIT_341A_SCALEDLinkPoketxtFIT_341A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeFIT_341AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_341A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 117

Private Sub txtFIT_343A_SCALED_Change()On Error GoTo PokeFIT_343AErrortxtFIT_343A_SCALEDLinkMode = 0 PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTime

txtFIT_343A_SCALEDText = Int((1 Rnd) + 3) Generate random value between 3 and 4

txtFIT_343A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_343A_SCALEDLinkItem = FIT_343A_SCALEDtxtFIT_343A_SCALEDLinkMode = 2txtFIT_343A_SCALEDLinkPoketxtFIT_343A_SCALEDLinkMode = 0 DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeFIT_343AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_343A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 118

TUTORIAL

Part 4

Questions

amp

Answers

  • Slide 1
  • Slide 2
  • Slide 3
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Slide 8
  • Slide 9
  • Slide 10
  • Slide 11
  • Slide 12
  • Slide 13
  • Slide 14
  • Slide 15
  • Slide 16
  • Slide 17
  • Slide 18
  • Slide 19
  • Slide 20
  • Slide 21
  • Slide 22
  • Slide 23
  • Slide 24
  • Slide 25
  • Slide 26
  • Slide 27
  • Slide 28
  • Slide 29
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
  • Slide 34
  • Slide 35
  • Slide 36
  • Slide 37
  • Slide 38
  • Slide 39
  • Slide 40
  • Slide 41
  • Slide 42
  • Slide 43
  • Slide 44
  • Slide 45
  • Slide 46
  • Slide 47
  • Slide 48
  • Slide 49
  • Slide 50
  • Slide 51
  • Slide 52
  • Slide 53
  • Slide 54
  • Slide 55
  • Slide 56
  • Slide 57
  • Slide 58
  • Slide 59
  • Slide 60
  • Slide 61
  • Slide 62
  • Slide 63
  • Slide 64
  • Slide 65
  • Slide 66
  • Slide 67
  • Slide 68
  • Slide 69
  • Slide 70
  • Slide 71
  • Slide 72
  • Slide 73
  • Slide 74
  • Slide 75
  • Slide 76
  • Slide 77
  • Slide 78
  • Slide 79
  • Slide 80
  • Slide 81
  • Slide 82
  • Slide 83
  • Slide 84
  • Slide 85
  • Slide 86
  • Slide 87
  • Slide 88
  • Slide 89
  • Slide 90
  • Slide 91
  • Slide 92
  • Slide 93
  • Slide 94
  • Slide 95
  • Slide 96
  • Slide 97
  • Slide 98
  • Slide 99
  • Slide 100
  • Slide 101
  • Slide 102
  • Slide 103
  • Slide 104
  • Slide 105
  • Slide 106
  • Slide 107
  • Slide 108
  • Slide 109
  • Slide 110
  • Slide 111
  • Slide 112
  • Slide 113
  • Slide 114
  • Slide 115
  • Slide 116
  • Slide 117
  • Slide 118
Page 77: TUTORIAL Ethernet PLC's Improve Oxygen Consumption ISA Expo/2001Houston, Texas Water & Wastewater Industry DivisionTuesday, September 11, 2001 1 Brad.

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 77

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 78

TUTORIAL

Part 2B

HMI Programming

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 79

Ethernet (TCPIP) IO Driver

The Ethernet (TCPIP) IO Driver allows the HMI to communicate with the PLC (In this case the driver is called MBENETEXE)

The PLC has an ethernet module in one of the slots that has a ldquoCAT5RJ-45rdquo 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 ldquoCAT5RJ-45rdquo receptacle for the ethernet cable

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 80

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 81

Operator Screens amp Popup Displays

The display is laid out in 3 sections

bull Upper - Security amp Alarm Windowbull Middle- Main Operator Screens bull Lower - Menu amp Popup Displays

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 82

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 83

Scripting

There are 6 types of ldquoScriptsrdquobull Application Scriptsbull Key Scriptsbull Condition Scriptsbull Data Change Scriptsbull Quick Function Scriptsbull ActiveX Event Scripts

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 84

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 85

Access Names

The ldquoAccess Namesrdquo Must be configured to allow the PLC - HMI communications

Note that the ldquoApplicationTopicrdquo is the same as the IO Driver

The ldquocomputer namerdquo is the name of the PC that the HMI is running on (brad_s_carlberg in this case)

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 86

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 87

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 88

Indirect Tags

ldquoIndirect Tagsrdquo were used here to minimize the number of popup displays

This is especially useful in HMIrsquos with many tags

ONLY 12 popup displays are reused throughout the HMI

This gives the HMI a ldquoDCS-Likerdquo Look amp Feel

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 89

Popup Display TypesThe tag point type determines which popup display to use

Analog InputHIC (or Analog Output)PID (or Analog Composite)

bull PID WITH AUTO amp CASCADE amp RATIObull PID WITH AUTO amp RATIO

Diginbull Motor Status

DigOutMotor (or Digital Composite)

bull Motor with ILock and PermNumericSet TimersAlarm DetailAlarm Tags

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 90

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 91

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 92

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 93

Bars Buttons amp Sliders

By choosing to use indirect tags we complicate the Bar Graphs Buttons amp Sliders in the popup displays

Different scales need to be used for different engineering unit ranges

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 94

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 95

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 96

Popup Displays

The next two pages shows how the individual popup displays use the indirect tags

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 97

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 98

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 99

Adding a ldquoTouch Targetrdquo to a Display

2 Tell which tags to use

3 Tell which popup display to call upWhat kind of point type is it

3 Steps1 Tell which scale to use (if itrsquos an analog point type)

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 100

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 101

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 102

TUTORIAL

Part 2C

Excel Spreadsheets

amp

Visual Basic

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 103

A ldquoCHEAP amp DIRTYrdquo HMI With Excel

The 4 key parameters are

To communicate with the PLCUse brad_s_carlbergmbenet|ANOXIC_OXICrsquoplcregisterrsquo

Excel uses ldquopeeksrdquo amp ldquopokesrdquo to read from amp write to a PLC or HMI

To communicate with the HMIbrad_s_carlbergview|Tagnamersquotagnamersquo

bull computer namebull applicationbull topicbull item

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 104

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 105

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 106

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 107

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 108

Excel Macros

bull ldquoRequestrdquo Macro to read values

bull ldquoPokerdquo Macro to write values

bull A Sample Excel Macro

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 109

Sub PokeMacro()MsgBox ApplicationNetworkTemplatesPathChannel = ApplicationDDEInitiate(app=brad_s_carlbergVIEW topic=Tagname) This opens a DDE channel to ViewApplicationDDEPoke Channel Temperature1 Worksheets(Sheet1)Range(A1) Puts value from R1C1 into Temperature1ApplicationDDEPoke Channel DDEReal Worksheets(Sheet1)Range(A2) Puts value from R1C1 into Temperature1ApplicationDDEPoke Channel DDEInteger Worksheets(Sheet1)Range(A3) Puts value from R1C1 into Temperature1ApplicationDDETerminate Channel This terminates the DDE channelEnd SubSub RequestMacro()Channel = ApplicationDDEInitiate(app=brad_s_carlbergVIEW topic=Tagname) This opens a DDE channel to ViewWorksheets(Sheet1)Range(C4) = ApplicationDDERequest(Channel $Hour)Worksheets(Sheet1)Range(C5) = ApplicationDDERequest(Channel $Minute)Worksheets(Sheet1)Range(C6) = ApplicationDDERequest(Channel $Second)Worksheets(Sheet1)Range(C9) = ApplicationDDERequest(Channel $day)Worksheets(Sheet1)Range(C10) = ApplicationDDERequest(Channel $date)Worksheets(Sheet1)Range(C11) = ApplicationDDERequest(Channel $datestring)Worksheets(Sheet1)Range(C12) = ApplicationDDERequest(Channel $datetime)Worksheets(Sheet1)Range(C13) = ApplicationDDERequest(Channel $date)Worksheets(Sheet1)Range(C14) = ApplicationDDERequest(Channel $month)Worksheets(Sheet1)Range(C15) = ApplicationDDERequest(Channel $year)Worksheets(Sheet1)Range(C16) = ApplicationDDERequest(Channel $time)Worksheets(Sheet1)Range(C17) = ApplicationDDERequest(Channel $timestring)Worksheets(Sheet1)Range(C18) = ApplicationDDERequest(Channel $applicationversion)Worksheets(Sheet1)Range(C19) = ApplicationDDERequest(Channel $startddeconversations)Worksheets(Sheet1)Range(C20) = ApplicationDDERequest(Channel $accesslevel)Worksheets(Sheet1)Range(C21) = ApplicationDDERequest(Channel $alarmlogging)Worksheets(Sheet1)Range(C22) = ApplicationDDERequest(Channel $applicationchanged)Worksheets(Sheet1)Range(C23) = ApplicationDDERequest(Channel $configureusers)Worksheets(Sheet1)Range(C24) = ApplicationDDERequest(Channel $changepassword)Worksheets(Sheet1)Range(C25) = ApplicationDDERequest(Channel $InactivityTimeout)Worksheets(Sheet1)Range(C26) = ApplicationDDERequest(Channel $InactivityWarning)Worksheets(Sheet1)Range(C27) = ApplicationDDERequest(Channel $LogicRunning)Worksheets(Sheet1)Range(C28) = ApplicationDDERequest(Channel $OperatorEntered)Worksheets(Sheet1)Range(C29) = ApplicationDDERequest(Channel $Operator)Worksheets(Sheet1)Range(C30) = ApplicationDDERequest(Channel $PasswordEntered)ApplicationDDETerminate Channel This terminates the DDE channelEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 110

Visual Basic

ldquoRoll Your Ownrdquo HMI - Much More powerful than Excel

Key Parameters computer nameapplication|topicitem

IO Emulator - MBPlusSimulateexe

Can ldquoRead Fromrdquo amp ldquoWrite Tordquo PLC andor HMI

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 111

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 112

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 113

Dim PauseTime Start Finish TotalTime As Integer Declare variables

Private Sub txtAIT_332A_SCALED_Change()On Error GoTo PokeAIT_332AErrortxtAIT_332A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtAIT_332A_SCALEDText = Int((3 Rnd) + 20) Generate random value between 20 and 23txtAIT_332A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtAIT_332A_SCALEDLinkItem = AIT_332A_SCALEDtxtAIT_332A_SCALEDLinkMode = 2txtAIT_332A_SCALEDLinkPoketxtAIT_332A_SCALEDLinkMode = 0 DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total time

PokeAIT_332AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtAIT_332A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 114

Private Sub txtAIT_346A_SCALED_Change()On Error GoTo PokeAIT_346AErrortxtAIT_346A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtAIT_346A_SCALEDText = Int((3 Rnd) + 15) Generate random value between 15 and 18txtAIT_346A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtAIT_346A_SCALEDLinkItem = AIT_346A_SCALEDtxtAIT_346A_SCALEDLinkMode = 2txtAIT_346A_SCALEDLinkPoketxtAIT_346A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeAIT_346AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtAIT_346A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 115

Private Sub txtFIT_321A_SCALED_Change()On Error GoTo PokeFIT_321AErrortxtFIT_321A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtFIT_321A_SCALEDText = Int((10 Rnd) + 120) Generate random value between 120 and 130txtFIT_321A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_321A_SCALEDLinkItem = FIT_321A_SCALEDtxtFIT_321A_SCALEDLinkMode = 2txtFIT_321A_SCALEDLinkPoketxtFIT_321A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total time

PokeFIT_321AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_321A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume Next

End Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 116

Private Sub txtFIT_341A_SCALED_Change()On Error GoTo PokeFIT_341AErrortxtFIT_341A_SCALEDLinkMode = 0 PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTime

txtFIT_341A_SCALEDText = Int((3 Rnd) + 18) Generate random value between 18 and 21

txtFIT_341A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_341A_SCALEDLinkItem = FIT_341A_SCALEDtxtFIT_341A_SCALEDLinkMode = 2txtFIT_341A_SCALEDLinkPoketxtFIT_341A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeFIT_341AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_341A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 117

Private Sub txtFIT_343A_SCALED_Change()On Error GoTo PokeFIT_343AErrortxtFIT_343A_SCALEDLinkMode = 0 PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTime

txtFIT_343A_SCALEDText = Int((1 Rnd) + 3) Generate random value between 3 and 4

txtFIT_343A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_343A_SCALEDLinkItem = FIT_343A_SCALEDtxtFIT_343A_SCALEDLinkMode = 2txtFIT_343A_SCALEDLinkPoketxtFIT_343A_SCALEDLinkMode = 0 DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeFIT_343AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_343A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 118

TUTORIAL

Part 4

Questions

amp

Answers

  • Slide 1
  • Slide 2
  • Slide 3
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Slide 8
  • Slide 9
  • Slide 10
  • Slide 11
  • Slide 12
  • Slide 13
  • Slide 14
  • Slide 15
  • Slide 16
  • Slide 17
  • Slide 18
  • Slide 19
  • Slide 20
  • Slide 21
  • Slide 22
  • Slide 23
  • Slide 24
  • Slide 25
  • Slide 26
  • Slide 27
  • Slide 28
  • Slide 29
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
  • Slide 34
  • Slide 35
  • Slide 36
  • Slide 37
  • Slide 38
  • Slide 39
  • Slide 40
  • Slide 41
  • Slide 42
  • Slide 43
  • Slide 44
  • Slide 45
  • Slide 46
  • Slide 47
  • Slide 48
  • Slide 49
  • Slide 50
  • Slide 51
  • Slide 52
  • Slide 53
  • Slide 54
  • Slide 55
  • Slide 56
  • Slide 57
  • Slide 58
  • Slide 59
  • Slide 60
  • Slide 61
  • Slide 62
  • Slide 63
  • Slide 64
  • Slide 65
  • Slide 66
  • Slide 67
  • Slide 68
  • Slide 69
  • Slide 70
  • Slide 71
  • Slide 72
  • Slide 73
  • Slide 74
  • Slide 75
  • Slide 76
  • Slide 77
  • Slide 78
  • Slide 79
  • Slide 80
  • Slide 81
  • Slide 82
  • Slide 83
  • Slide 84
  • Slide 85
  • Slide 86
  • Slide 87
  • Slide 88
  • Slide 89
  • Slide 90
  • Slide 91
  • Slide 92
  • Slide 93
  • Slide 94
  • Slide 95
  • Slide 96
  • Slide 97
  • Slide 98
  • Slide 99
  • Slide 100
  • Slide 101
  • Slide 102
  • Slide 103
  • Slide 104
  • Slide 105
  • Slide 106
  • Slide 107
  • Slide 108
  • Slide 109
  • Slide 110
  • Slide 111
  • Slide 112
  • Slide 113
  • Slide 114
  • Slide 115
  • Slide 116
  • Slide 117
  • Slide 118
Page 78: TUTORIAL Ethernet PLC's Improve Oxygen Consumption ISA Expo/2001Houston, Texas Water & Wastewater Industry DivisionTuesday, September 11, 2001 1 Brad.

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 78

TUTORIAL

Part 2B

HMI Programming

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 79

Ethernet (TCPIP) IO Driver

The Ethernet (TCPIP) IO Driver allows the HMI to communicate with the PLC (In this case the driver is called MBENETEXE)

The PLC has an ethernet module in one of the slots that has a ldquoCAT5RJ-45rdquo 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 ldquoCAT5RJ-45rdquo receptacle for the ethernet cable

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 80

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 81

Operator Screens amp Popup Displays

The display is laid out in 3 sections

bull Upper - Security amp Alarm Windowbull Middle- Main Operator Screens bull Lower - Menu amp Popup Displays

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 82

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 83

Scripting

There are 6 types of ldquoScriptsrdquobull Application Scriptsbull Key Scriptsbull Condition Scriptsbull Data Change Scriptsbull Quick Function Scriptsbull ActiveX Event Scripts

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 84

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 85

Access Names

The ldquoAccess Namesrdquo Must be configured to allow the PLC - HMI communications

Note that the ldquoApplicationTopicrdquo is the same as the IO Driver

The ldquocomputer namerdquo is the name of the PC that the HMI is running on (brad_s_carlberg in this case)

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 86

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 87

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 88

Indirect Tags

ldquoIndirect Tagsrdquo were used here to minimize the number of popup displays

This is especially useful in HMIrsquos with many tags

ONLY 12 popup displays are reused throughout the HMI

This gives the HMI a ldquoDCS-Likerdquo Look amp Feel

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 89

Popup Display TypesThe tag point type determines which popup display to use

Analog InputHIC (or Analog Output)PID (or Analog Composite)

bull PID WITH AUTO amp CASCADE amp RATIObull PID WITH AUTO amp RATIO

Diginbull Motor Status

DigOutMotor (or Digital Composite)

bull Motor with ILock and PermNumericSet TimersAlarm DetailAlarm Tags

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 90

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 91

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 92

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 93

Bars Buttons amp Sliders

By choosing to use indirect tags we complicate the Bar Graphs Buttons amp Sliders in the popup displays

Different scales need to be used for different engineering unit ranges

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 94

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 95

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 96

Popup Displays

The next two pages shows how the individual popup displays use the indirect tags

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 97

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 98

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 99

Adding a ldquoTouch Targetrdquo to a Display

2 Tell which tags to use

3 Tell which popup display to call upWhat kind of point type is it

3 Steps1 Tell which scale to use (if itrsquos an analog point type)

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 100

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 101

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 102

TUTORIAL

Part 2C

Excel Spreadsheets

amp

Visual Basic

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 103

A ldquoCHEAP amp DIRTYrdquo HMI With Excel

The 4 key parameters are

To communicate with the PLCUse brad_s_carlbergmbenet|ANOXIC_OXICrsquoplcregisterrsquo

Excel uses ldquopeeksrdquo amp ldquopokesrdquo to read from amp write to a PLC or HMI

To communicate with the HMIbrad_s_carlbergview|Tagnamersquotagnamersquo

bull computer namebull applicationbull topicbull item

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 104

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 105

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 106

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 107

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 108

Excel Macros

bull ldquoRequestrdquo Macro to read values

bull ldquoPokerdquo Macro to write values

bull A Sample Excel Macro

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 109

Sub PokeMacro()MsgBox ApplicationNetworkTemplatesPathChannel = ApplicationDDEInitiate(app=brad_s_carlbergVIEW topic=Tagname) This opens a DDE channel to ViewApplicationDDEPoke Channel Temperature1 Worksheets(Sheet1)Range(A1) Puts value from R1C1 into Temperature1ApplicationDDEPoke Channel DDEReal Worksheets(Sheet1)Range(A2) Puts value from R1C1 into Temperature1ApplicationDDEPoke Channel DDEInteger Worksheets(Sheet1)Range(A3) Puts value from R1C1 into Temperature1ApplicationDDETerminate Channel This terminates the DDE channelEnd SubSub RequestMacro()Channel = ApplicationDDEInitiate(app=brad_s_carlbergVIEW topic=Tagname) This opens a DDE channel to ViewWorksheets(Sheet1)Range(C4) = ApplicationDDERequest(Channel $Hour)Worksheets(Sheet1)Range(C5) = ApplicationDDERequest(Channel $Minute)Worksheets(Sheet1)Range(C6) = ApplicationDDERequest(Channel $Second)Worksheets(Sheet1)Range(C9) = ApplicationDDERequest(Channel $day)Worksheets(Sheet1)Range(C10) = ApplicationDDERequest(Channel $date)Worksheets(Sheet1)Range(C11) = ApplicationDDERequest(Channel $datestring)Worksheets(Sheet1)Range(C12) = ApplicationDDERequest(Channel $datetime)Worksheets(Sheet1)Range(C13) = ApplicationDDERequest(Channel $date)Worksheets(Sheet1)Range(C14) = ApplicationDDERequest(Channel $month)Worksheets(Sheet1)Range(C15) = ApplicationDDERequest(Channel $year)Worksheets(Sheet1)Range(C16) = ApplicationDDERequest(Channel $time)Worksheets(Sheet1)Range(C17) = ApplicationDDERequest(Channel $timestring)Worksheets(Sheet1)Range(C18) = ApplicationDDERequest(Channel $applicationversion)Worksheets(Sheet1)Range(C19) = ApplicationDDERequest(Channel $startddeconversations)Worksheets(Sheet1)Range(C20) = ApplicationDDERequest(Channel $accesslevel)Worksheets(Sheet1)Range(C21) = ApplicationDDERequest(Channel $alarmlogging)Worksheets(Sheet1)Range(C22) = ApplicationDDERequest(Channel $applicationchanged)Worksheets(Sheet1)Range(C23) = ApplicationDDERequest(Channel $configureusers)Worksheets(Sheet1)Range(C24) = ApplicationDDERequest(Channel $changepassword)Worksheets(Sheet1)Range(C25) = ApplicationDDERequest(Channel $InactivityTimeout)Worksheets(Sheet1)Range(C26) = ApplicationDDERequest(Channel $InactivityWarning)Worksheets(Sheet1)Range(C27) = ApplicationDDERequest(Channel $LogicRunning)Worksheets(Sheet1)Range(C28) = ApplicationDDERequest(Channel $OperatorEntered)Worksheets(Sheet1)Range(C29) = ApplicationDDERequest(Channel $Operator)Worksheets(Sheet1)Range(C30) = ApplicationDDERequest(Channel $PasswordEntered)ApplicationDDETerminate Channel This terminates the DDE channelEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 110

Visual Basic

ldquoRoll Your Ownrdquo HMI - Much More powerful than Excel

Key Parameters computer nameapplication|topicitem

IO Emulator - MBPlusSimulateexe

Can ldquoRead Fromrdquo amp ldquoWrite Tordquo PLC andor HMI

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 111

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 112

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 113

Dim PauseTime Start Finish TotalTime As Integer Declare variables

Private Sub txtAIT_332A_SCALED_Change()On Error GoTo PokeAIT_332AErrortxtAIT_332A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtAIT_332A_SCALEDText = Int((3 Rnd) + 20) Generate random value between 20 and 23txtAIT_332A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtAIT_332A_SCALEDLinkItem = AIT_332A_SCALEDtxtAIT_332A_SCALEDLinkMode = 2txtAIT_332A_SCALEDLinkPoketxtAIT_332A_SCALEDLinkMode = 0 DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total time

PokeAIT_332AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtAIT_332A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 114

Private Sub txtAIT_346A_SCALED_Change()On Error GoTo PokeAIT_346AErrortxtAIT_346A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtAIT_346A_SCALEDText = Int((3 Rnd) + 15) Generate random value between 15 and 18txtAIT_346A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtAIT_346A_SCALEDLinkItem = AIT_346A_SCALEDtxtAIT_346A_SCALEDLinkMode = 2txtAIT_346A_SCALEDLinkPoketxtAIT_346A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeAIT_346AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtAIT_346A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 115

Private Sub txtFIT_321A_SCALED_Change()On Error GoTo PokeFIT_321AErrortxtFIT_321A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtFIT_321A_SCALEDText = Int((10 Rnd) + 120) Generate random value between 120 and 130txtFIT_321A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_321A_SCALEDLinkItem = FIT_321A_SCALEDtxtFIT_321A_SCALEDLinkMode = 2txtFIT_321A_SCALEDLinkPoketxtFIT_321A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total time

PokeFIT_321AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_321A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume Next

End Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 116

Private Sub txtFIT_341A_SCALED_Change()On Error GoTo PokeFIT_341AErrortxtFIT_341A_SCALEDLinkMode = 0 PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTime

txtFIT_341A_SCALEDText = Int((3 Rnd) + 18) Generate random value between 18 and 21

txtFIT_341A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_341A_SCALEDLinkItem = FIT_341A_SCALEDtxtFIT_341A_SCALEDLinkMode = 2txtFIT_341A_SCALEDLinkPoketxtFIT_341A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeFIT_341AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_341A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 117

Private Sub txtFIT_343A_SCALED_Change()On Error GoTo PokeFIT_343AErrortxtFIT_343A_SCALEDLinkMode = 0 PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTime

txtFIT_343A_SCALEDText = Int((1 Rnd) + 3) Generate random value between 3 and 4

txtFIT_343A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_343A_SCALEDLinkItem = FIT_343A_SCALEDtxtFIT_343A_SCALEDLinkMode = 2txtFIT_343A_SCALEDLinkPoketxtFIT_343A_SCALEDLinkMode = 0 DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeFIT_343AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_343A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 118

TUTORIAL

Part 4

Questions

amp

Answers

  • Slide 1
  • Slide 2
  • Slide 3
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Slide 8
  • Slide 9
  • Slide 10
  • Slide 11
  • Slide 12
  • Slide 13
  • Slide 14
  • Slide 15
  • Slide 16
  • Slide 17
  • Slide 18
  • Slide 19
  • Slide 20
  • Slide 21
  • Slide 22
  • Slide 23
  • Slide 24
  • Slide 25
  • Slide 26
  • Slide 27
  • Slide 28
  • Slide 29
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
  • Slide 34
  • Slide 35
  • Slide 36
  • Slide 37
  • Slide 38
  • Slide 39
  • Slide 40
  • Slide 41
  • Slide 42
  • Slide 43
  • Slide 44
  • Slide 45
  • Slide 46
  • Slide 47
  • Slide 48
  • Slide 49
  • Slide 50
  • Slide 51
  • Slide 52
  • Slide 53
  • Slide 54
  • Slide 55
  • Slide 56
  • Slide 57
  • Slide 58
  • Slide 59
  • Slide 60
  • Slide 61
  • Slide 62
  • Slide 63
  • Slide 64
  • Slide 65
  • Slide 66
  • Slide 67
  • Slide 68
  • Slide 69
  • Slide 70
  • Slide 71
  • Slide 72
  • Slide 73
  • Slide 74
  • Slide 75
  • Slide 76
  • Slide 77
  • Slide 78
  • Slide 79
  • Slide 80
  • Slide 81
  • Slide 82
  • Slide 83
  • Slide 84
  • Slide 85
  • Slide 86
  • Slide 87
  • Slide 88
  • Slide 89
  • Slide 90
  • Slide 91
  • Slide 92
  • Slide 93
  • Slide 94
  • Slide 95
  • Slide 96
  • Slide 97
  • Slide 98
  • Slide 99
  • Slide 100
  • Slide 101
  • Slide 102
  • Slide 103
  • Slide 104
  • Slide 105
  • Slide 106
  • Slide 107
  • Slide 108
  • Slide 109
  • Slide 110
  • Slide 111
  • Slide 112
  • Slide 113
  • Slide 114
  • Slide 115
  • Slide 116
  • Slide 117
  • Slide 118
Page 79: TUTORIAL Ethernet PLC's Improve Oxygen Consumption ISA Expo/2001Houston, Texas Water & Wastewater Industry DivisionTuesday, September 11, 2001 1 Brad.

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 79

Ethernet (TCPIP) IO Driver

The Ethernet (TCPIP) IO Driver allows the HMI to communicate with the PLC (In this case the driver is called MBENETEXE)

The PLC has an ethernet module in one of the slots that has a ldquoCAT5RJ-45rdquo 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 ldquoCAT5RJ-45rdquo receptacle for the ethernet cable

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 80

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 81

Operator Screens amp Popup Displays

The display is laid out in 3 sections

bull Upper - Security amp Alarm Windowbull Middle- Main Operator Screens bull Lower - Menu amp Popup Displays

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 82

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 83

Scripting

There are 6 types of ldquoScriptsrdquobull Application Scriptsbull Key Scriptsbull Condition Scriptsbull Data Change Scriptsbull Quick Function Scriptsbull ActiveX Event Scripts

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 84

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 85

Access Names

The ldquoAccess Namesrdquo Must be configured to allow the PLC - HMI communications

Note that the ldquoApplicationTopicrdquo is the same as the IO Driver

The ldquocomputer namerdquo is the name of the PC that the HMI is running on (brad_s_carlberg in this case)

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 86

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 87

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 88

Indirect Tags

ldquoIndirect Tagsrdquo were used here to minimize the number of popup displays

This is especially useful in HMIrsquos with many tags

ONLY 12 popup displays are reused throughout the HMI

This gives the HMI a ldquoDCS-Likerdquo Look amp Feel

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 89

Popup Display TypesThe tag point type determines which popup display to use

Analog InputHIC (or Analog Output)PID (or Analog Composite)

bull PID WITH AUTO amp CASCADE amp RATIObull PID WITH AUTO amp RATIO

Diginbull Motor Status

DigOutMotor (or Digital Composite)

bull Motor with ILock and PermNumericSet TimersAlarm DetailAlarm Tags

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 90

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 91

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 92

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 93

Bars Buttons amp Sliders

By choosing to use indirect tags we complicate the Bar Graphs Buttons amp Sliders in the popup displays

Different scales need to be used for different engineering unit ranges

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 94

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 95

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 96

Popup Displays

The next two pages shows how the individual popup displays use the indirect tags

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 97

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 98

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 99

Adding a ldquoTouch Targetrdquo to a Display

2 Tell which tags to use

3 Tell which popup display to call upWhat kind of point type is it

3 Steps1 Tell which scale to use (if itrsquos an analog point type)

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 100

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 101

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 102

TUTORIAL

Part 2C

Excel Spreadsheets

amp

Visual Basic

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 103

A ldquoCHEAP amp DIRTYrdquo HMI With Excel

The 4 key parameters are

To communicate with the PLCUse brad_s_carlbergmbenet|ANOXIC_OXICrsquoplcregisterrsquo

Excel uses ldquopeeksrdquo amp ldquopokesrdquo to read from amp write to a PLC or HMI

To communicate with the HMIbrad_s_carlbergview|Tagnamersquotagnamersquo

bull computer namebull applicationbull topicbull item

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 104

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 105

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 106

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 107

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 108

Excel Macros

bull ldquoRequestrdquo Macro to read values

bull ldquoPokerdquo Macro to write values

bull A Sample Excel Macro

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 109

Sub PokeMacro()MsgBox ApplicationNetworkTemplatesPathChannel = ApplicationDDEInitiate(app=brad_s_carlbergVIEW topic=Tagname) This opens a DDE channel to ViewApplicationDDEPoke Channel Temperature1 Worksheets(Sheet1)Range(A1) Puts value from R1C1 into Temperature1ApplicationDDEPoke Channel DDEReal Worksheets(Sheet1)Range(A2) Puts value from R1C1 into Temperature1ApplicationDDEPoke Channel DDEInteger Worksheets(Sheet1)Range(A3) Puts value from R1C1 into Temperature1ApplicationDDETerminate Channel This terminates the DDE channelEnd SubSub RequestMacro()Channel = ApplicationDDEInitiate(app=brad_s_carlbergVIEW topic=Tagname) This opens a DDE channel to ViewWorksheets(Sheet1)Range(C4) = ApplicationDDERequest(Channel $Hour)Worksheets(Sheet1)Range(C5) = ApplicationDDERequest(Channel $Minute)Worksheets(Sheet1)Range(C6) = ApplicationDDERequest(Channel $Second)Worksheets(Sheet1)Range(C9) = ApplicationDDERequest(Channel $day)Worksheets(Sheet1)Range(C10) = ApplicationDDERequest(Channel $date)Worksheets(Sheet1)Range(C11) = ApplicationDDERequest(Channel $datestring)Worksheets(Sheet1)Range(C12) = ApplicationDDERequest(Channel $datetime)Worksheets(Sheet1)Range(C13) = ApplicationDDERequest(Channel $date)Worksheets(Sheet1)Range(C14) = ApplicationDDERequest(Channel $month)Worksheets(Sheet1)Range(C15) = ApplicationDDERequest(Channel $year)Worksheets(Sheet1)Range(C16) = ApplicationDDERequest(Channel $time)Worksheets(Sheet1)Range(C17) = ApplicationDDERequest(Channel $timestring)Worksheets(Sheet1)Range(C18) = ApplicationDDERequest(Channel $applicationversion)Worksheets(Sheet1)Range(C19) = ApplicationDDERequest(Channel $startddeconversations)Worksheets(Sheet1)Range(C20) = ApplicationDDERequest(Channel $accesslevel)Worksheets(Sheet1)Range(C21) = ApplicationDDERequest(Channel $alarmlogging)Worksheets(Sheet1)Range(C22) = ApplicationDDERequest(Channel $applicationchanged)Worksheets(Sheet1)Range(C23) = ApplicationDDERequest(Channel $configureusers)Worksheets(Sheet1)Range(C24) = ApplicationDDERequest(Channel $changepassword)Worksheets(Sheet1)Range(C25) = ApplicationDDERequest(Channel $InactivityTimeout)Worksheets(Sheet1)Range(C26) = ApplicationDDERequest(Channel $InactivityWarning)Worksheets(Sheet1)Range(C27) = ApplicationDDERequest(Channel $LogicRunning)Worksheets(Sheet1)Range(C28) = ApplicationDDERequest(Channel $OperatorEntered)Worksheets(Sheet1)Range(C29) = ApplicationDDERequest(Channel $Operator)Worksheets(Sheet1)Range(C30) = ApplicationDDERequest(Channel $PasswordEntered)ApplicationDDETerminate Channel This terminates the DDE channelEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 110

Visual Basic

ldquoRoll Your Ownrdquo HMI - Much More powerful than Excel

Key Parameters computer nameapplication|topicitem

IO Emulator - MBPlusSimulateexe

Can ldquoRead Fromrdquo amp ldquoWrite Tordquo PLC andor HMI

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 111

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 112

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 113

Dim PauseTime Start Finish TotalTime As Integer Declare variables

Private Sub txtAIT_332A_SCALED_Change()On Error GoTo PokeAIT_332AErrortxtAIT_332A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtAIT_332A_SCALEDText = Int((3 Rnd) + 20) Generate random value between 20 and 23txtAIT_332A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtAIT_332A_SCALEDLinkItem = AIT_332A_SCALEDtxtAIT_332A_SCALEDLinkMode = 2txtAIT_332A_SCALEDLinkPoketxtAIT_332A_SCALEDLinkMode = 0 DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total time

PokeAIT_332AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtAIT_332A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 114

Private Sub txtAIT_346A_SCALED_Change()On Error GoTo PokeAIT_346AErrortxtAIT_346A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtAIT_346A_SCALEDText = Int((3 Rnd) + 15) Generate random value between 15 and 18txtAIT_346A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtAIT_346A_SCALEDLinkItem = AIT_346A_SCALEDtxtAIT_346A_SCALEDLinkMode = 2txtAIT_346A_SCALEDLinkPoketxtAIT_346A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeAIT_346AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtAIT_346A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 115

Private Sub txtFIT_321A_SCALED_Change()On Error GoTo PokeFIT_321AErrortxtFIT_321A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtFIT_321A_SCALEDText = Int((10 Rnd) + 120) Generate random value between 120 and 130txtFIT_321A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_321A_SCALEDLinkItem = FIT_321A_SCALEDtxtFIT_321A_SCALEDLinkMode = 2txtFIT_321A_SCALEDLinkPoketxtFIT_321A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total time

PokeFIT_321AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_321A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume Next

End Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 116

Private Sub txtFIT_341A_SCALED_Change()On Error GoTo PokeFIT_341AErrortxtFIT_341A_SCALEDLinkMode = 0 PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTime

txtFIT_341A_SCALEDText = Int((3 Rnd) + 18) Generate random value between 18 and 21

txtFIT_341A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_341A_SCALEDLinkItem = FIT_341A_SCALEDtxtFIT_341A_SCALEDLinkMode = 2txtFIT_341A_SCALEDLinkPoketxtFIT_341A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeFIT_341AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_341A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 117

Private Sub txtFIT_343A_SCALED_Change()On Error GoTo PokeFIT_343AErrortxtFIT_343A_SCALEDLinkMode = 0 PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTime

txtFIT_343A_SCALEDText = Int((1 Rnd) + 3) Generate random value between 3 and 4

txtFIT_343A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_343A_SCALEDLinkItem = FIT_343A_SCALEDtxtFIT_343A_SCALEDLinkMode = 2txtFIT_343A_SCALEDLinkPoketxtFIT_343A_SCALEDLinkMode = 0 DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeFIT_343AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_343A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 118

TUTORIAL

Part 4

Questions

amp

Answers

  • Slide 1
  • Slide 2
  • Slide 3
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Slide 8
  • Slide 9
  • Slide 10
  • Slide 11
  • Slide 12
  • Slide 13
  • Slide 14
  • Slide 15
  • Slide 16
  • Slide 17
  • Slide 18
  • Slide 19
  • Slide 20
  • Slide 21
  • Slide 22
  • Slide 23
  • Slide 24
  • Slide 25
  • Slide 26
  • Slide 27
  • Slide 28
  • Slide 29
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
  • Slide 34
  • Slide 35
  • Slide 36
  • Slide 37
  • Slide 38
  • Slide 39
  • Slide 40
  • Slide 41
  • Slide 42
  • Slide 43
  • Slide 44
  • Slide 45
  • Slide 46
  • Slide 47
  • Slide 48
  • Slide 49
  • Slide 50
  • Slide 51
  • Slide 52
  • Slide 53
  • Slide 54
  • Slide 55
  • Slide 56
  • Slide 57
  • Slide 58
  • Slide 59
  • Slide 60
  • Slide 61
  • Slide 62
  • Slide 63
  • Slide 64
  • Slide 65
  • Slide 66
  • Slide 67
  • Slide 68
  • Slide 69
  • Slide 70
  • Slide 71
  • Slide 72
  • Slide 73
  • Slide 74
  • Slide 75
  • Slide 76
  • Slide 77
  • Slide 78
  • Slide 79
  • Slide 80
  • Slide 81
  • Slide 82
  • Slide 83
  • Slide 84
  • Slide 85
  • Slide 86
  • Slide 87
  • Slide 88
  • Slide 89
  • Slide 90
  • Slide 91
  • Slide 92
  • Slide 93
  • Slide 94
  • Slide 95
  • Slide 96
  • Slide 97
  • Slide 98
  • Slide 99
  • Slide 100
  • Slide 101
  • Slide 102
  • Slide 103
  • Slide 104
  • Slide 105
  • Slide 106
  • Slide 107
  • Slide 108
  • Slide 109
  • Slide 110
  • Slide 111
  • Slide 112
  • Slide 113
  • Slide 114
  • Slide 115
  • Slide 116
  • Slide 117
  • Slide 118
Page 80: TUTORIAL Ethernet PLC's Improve Oxygen Consumption ISA Expo/2001Houston, Texas Water & Wastewater Industry DivisionTuesday, September 11, 2001 1 Brad.

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 80

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 81

Operator Screens amp Popup Displays

The display is laid out in 3 sections

bull Upper - Security amp Alarm Windowbull Middle- Main Operator Screens bull Lower - Menu amp Popup Displays

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 82

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 83

Scripting

There are 6 types of ldquoScriptsrdquobull Application Scriptsbull Key Scriptsbull Condition Scriptsbull Data Change Scriptsbull Quick Function Scriptsbull ActiveX Event Scripts

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 84

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 85

Access Names

The ldquoAccess Namesrdquo Must be configured to allow the PLC - HMI communications

Note that the ldquoApplicationTopicrdquo is the same as the IO Driver

The ldquocomputer namerdquo is the name of the PC that the HMI is running on (brad_s_carlberg in this case)

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 86

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 87

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 88

Indirect Tags

ldquoIndirect Tagsrdquo were used here to minimize the number of popup displays

This is especially useful in HMIrsquos with many tags

ONLY 12 popup displays are reused throughout the HMI

This gives the HMI a ldquoDCS-Likerdquo Look amp Feel

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 89

Popup Display TypesThe tag point type determines which popup display to use

Analog InputHIC (or Analog Output)PID (or Analog Composite)

bull PID WITH AUTO amp CASCADE amp RATIObull PID WITH AUTO amp RATIO

Diginbull Motor Status

DigOutMotor (or Digital Composite)

bull Motor with ILock and PermNumericSet TimersAlarm DetailAlarm Tags

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 90

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 91

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 92

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 93

Bars Buttons amp Sliders

By choosing to use indirect tags we complicate the Bar Graphs Buttons amp Sliders in the popup displays

Different scales need to be used for different engineering unit ranges

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 94

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 95

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 96

Popup Displays

The next two pages shows how the individual popup displays use the indirect tags

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 97

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 98

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 99

Adding a ldquoTouch Targetrdquo to a Display

2 Tell which tags to use

3 Tell which popup display to call upWhat kind of point type is it

3 Steps1 Tell which scale to use (if itrsquos an analog point type)

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 100

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 101

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 102

TUTORIAL

Part 2C

Excel Spreadsheets

amp

Visual Basic

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 103

A ldquoCHEAP amp DIRTYrdquo HMI With Excel

The 4 key parameters are

To communicate with the PLCUse brad_s_carlbergmbenet|ANOXIC_OXICrsquoplcregisterrsquo

Excel uses ldquopeeksrdquo amp ldquopokesrdquo to read from amp write to a PLC or HMI

To communicate with the HMIbrad_s_carlbergview|Tagnamersquotagnamersquo

bull computer namebull applicationbull topicbull item

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 104

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 105

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 106

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 107

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 108

Excel Macros

bull ldquoRequestrdquo Macro to read values

bull ldquoPokerdquo Macro to write values

bull A Sample Excel Macro

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 109

Sub PokeMacro()MsgBox ApplicationNetworkTemplatesPathChannel = ApplicationDDEInitiate(app=brad_s_carlbergVIEW topic=Tagname) This opens a DDE channel to ViewApplicationDDEPoke Channel Temperature1 Worksheets(Sheet1)Range(A1) Puts value from R1C1 into Temperature1ApplicationDDEPoke Channel DDEReal Worksheets(Sheet1)Range(A2) Puts value from R1C1 into Temperature1ApplicationDDEPoke Channel DDEInteger Worksheets(Sheet1)Range(A3) Puts value from R1C1 into Temperature1ApplicationDDETerminate Channel This terminates the DDE channelEnd SubSub RequestMacro()Channel = ApplicationDDEInitiate(app=brad_s_carlbergVIEW topic=Tagname) This opens a DDE channel to ViewWorksheets(Sheet1)Range(C4) = ApplicationDDERequest(Channel $Hour)Worksheets(Sheet1)Range(C5) = ApplicationDDERequest(Channel $Minute)Worksheets(Sheet1)Range(C6) = ApplicationDDERequest(Channel $Second)Worksheets(Sheet1)Range(C9) = ApplicationDDERequest(Channel $day)Worksheets(Sheet1)Range(C10) = ApplicationDDERequest(Channel $date)Worksheets(Sheet1)Range(C11) = ApplicationDDERequest(Channel $datestring)Worksheets(Sheet1)Range(C12) = ApplicationDDERequest(Channel $datetime)Worksheets(Sheet1)Range(C13) = ApplicationDDERequest(Channel $date)Worksheets(Sheet1)Range(C14) = ApplicationDDERequest(Channel $month)Worksheets(Sheet1)Range(C15) = ApplicationDDERequest(Channel $year)Worksheets(Sheet1)Range(C16) = ApplicationDDERequest(Channel $time)Worksheets(Sheet1)Range(C17) = ApplicationDDERequest(Channel $timestring)Worksheets(Sheet1)Range(C18) = ApplicationDDERequest(Channel $applicationversion)Worksheets(Sheet1)Range(C19) = ApplicationDDERequest(Channel $startddeconversations)Worksheets(Sheet1)Range(C20) = ApplicationDDERequest(Channel $accesslevel)Worksheets(Sheet1)Range(C21) = ApplicationDDERequest(Channel $alarmlogging)Worksheets(Sheet1)Range(C22) = ApplicationDDERequest(Channel $applicationchanged)Worksheets(Sheet1)Range(C23) = ApplicationDDERequest(Channel $configureusers)Worksheets(Sheet1)Range(C24) = ApplicationDDERequest(Channel $changepassword)Worksheets(Sheet1)Range(C25) = ApplicationDDERequest(Channel $InactivityTimeout)Worksheets(Sheet1)Range(C26) = ApplicationDDERequest(Channel $InactivityWarning)Worksheets(Sheet1)Range(C27) = ApplicationDDERequest(Channel $LogicRunning)Worksheets(Sheet1)Range(C28) = ApplicationDDERequest(Channel $OperatorEntered)Worksheets(Sheet1)Range(C29) = ApplicationDDERequest(Channel $Operator)Worksheets(Sheet1)Range(C30) = ApplicationDDERequest(Channel $PasswordEntered)ApplicationDDETerminate Channel This terminates the DDE channelEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 110

Visual Basic

ldquoRoll Your Ownrdquo HMI - Much More powerful than Excel

Key Parameters computer nameapplication|topicitem

IO Emulator - MBPlusSimulateexe

Can ldquoRead Fromrdquo amp ldquoWrite Tordquo PLC andor HMI

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 111

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 112

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 113

Dim PauseTime Start Finish TotalTime As Integer Declare variables

Private Sub txtAIT_332A_SCALED_Change()On Error GoTo PokeAIT_332AErrortxtAIT_332A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtAIT_332A_SCALEDText = Int((3 Rnd) + 20) Generate random value between 20 and 23txtAIT_332A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtAIT_332A_SCALEDLinkItem = AIT_332A_SCALEDtxtAIT_332A_SCALEDLinkMode = 2txtAIT_332A_SCALEDLinkPoketxtAIT_332A_SCALEDLinkMode = 0 DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total time

PokeAIT_332AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtAIT_332A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 114

Private Sub txtAIT_346A_SCALED_Change()On Error GoTo PokeAIT_346AErrortxtAIT_346A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtAIT_346A_SCALEDText = Int((3 Rnd) + 15) Generate random value between 15 and 18txtAIT_346A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtAIT_346A_SCALEDLinkItem = AIT_346A_SCALEDtxtAIT_346A_SCALEDLinkMode = 2txtAIT_346A_SCALEDLinkPoketxtAIT_346A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeAIT_346AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtAIT_346A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 115

Private Sub txtFIT_321A_SCALED_Change()On Error GoTo PokeFIT_321AErrortxtFIT_321A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtFIT_321A_SCALEDText = Int((10 Rnd) + 120) Generate random value between 120 and 130txtFIT_321A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_321A_SCALEDLinkItem = FIT_321A_SCALEDtxtFIT_321A_SCALEDLinkMode = 2txtFIT_321A_SCALEDLinkPoketxtFIT_321A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total time

PokeFIT_321AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_321A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume Next

End Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 116

Private Sub txtFIT_341A_SCALED_Change()On Error GoTo PokeFIT_341AErrortxtFIT_341A_SCALEDLinkMode = 0 PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTime

txtFIT_341A_SCALEDText = Int((3 Rnd) + 18) Generate random value between 18 and 21

txtFIT_341A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_341A_SCALEDLinkItem = FIT_341A_SCALEDtxtFIT_341A_SCALEDLinkMode = 2txtFIT_341A_SCALEDLinkPoketxtFIT_341A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeFIT_341AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_341A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 117

Private Sub txtFIT_343A_SCALED_Change()On Error GoTo PokeFIT_343AErrortxtFIT_343A_SCALEDLinkMode = 0 PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTime

txtFIT_343A_SCALEDText = Int((1 Rnd) + 3) Generate random value between 3 and 4

txtFIT_343A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_343A_SCALEDLinkItem = FIT_343A_SCALEDtxtFIT_343A_SCALEDLinkMode = 2txtFIT_343A_SCALEDLinkPoketxtFIT_343A_SCALEDLinkMode = 0 DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeFIT_343AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_343A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 118

TUTORIAL

Part 4

Questions

amp

Answers

  • Slide 1
  • Slide 2
  • Slide 3
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Slide 8
  • Slide 9
  • Slide 10
  • Slide 11
  • Slide 12
  • Slide 13
  • Slide 14
  • Slide 15
  • Slide 16
  • Slide 17
  • Slide 18
  • Slide 19
  • Slide 20
  • Slide 21
  • Slide 22
  • Slide 23
  • Slide 24
  • Slide 25
  • Slide 26
  • Slide 27
  • Slide 28
  • Slide 29
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
  • Slide 34
  • Slide 35
  • Slide 36
  • Slide 37
  • Slide 38
  • Slide 39
  • Slide 40
  • Slide 41
  • Slide 42
  • Slide 43
  • Slide 44
  • Slide 45
  • Slide 46
  • Slide 47
  • Slide 48
  • Slide 49
  • Slide 50
  • Slide 51
  • Slide 52
  • Slide 53
  • Slide 54
  • Slide 55
  • Slide 56
  • Slide 57
  • Slide 58
  • Slide 59
  • Slide 60
  • Slide 61
  • Slide 62
  • Slide 63
  • Slide 64
  • Slide 65
  • Slide 66
  • Slide 67
  • Slide 68
  • Slide 69
  • Slide 70
  • Slide 71
  • Slide 72
  • Slide 73
  • Slide 74
  • Slide 75
  • Slide 76
  • Slide 77
  • Slide 78
  • Slide 79
  • Slide 80
  • Slide 81
  • Slide 82
  • Slide 83
  • Slide 84
  • Slide 85
  • Slide 86
  • Slide 87
  • Slide 88
  • Slide 89
  • Slide 90
  • Slide 91
  • Slide 92
  • Slide 93
  • Slide 94
  • Slide 95
  • Slide 96
  • Slide 97
  • Slide 98
  • Slide 99
  • Slide 100
  • Slide 101
  • Slide 102
  • Slide 103
  • Slide 104
  • Slide 105
  • Slide 106
  • Slide 107
  • Slide 108
  • Slide 109
  • Slide 110
  • Slide 111
  • Slide 112
  • Slide 113
  • Slide 114
  • Slide 115
  • Slide 116
  • Slide 117
  • Slide 118
Page 81: TUTORIAL Ethernet PLC's Improve Oxygen Consumption ISA Expo/2001Houston, Texas Water & Wastewater Industry DivisionTuesday, September 11, 2001 1 Brad.

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 81

Operator Screens amp Popup Displays

The display is laid out in 3 sections

bull Upper - Security amp Alarm Windowbull Middle- Main Operator Screens bull Lower - Menu amp Popup Displays

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 82

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 83

Scripting

There are 6 types of ldquoScriptsrdquobull Application Scriptsbull Key Scriptsbull Condition Scriptsbull Data Change Scriptsbull Quick Function Scriptsbull ActiveX Event Scripts

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 84

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 85

Access Names

The ldquoAccess Namesrdquo Must be configured to allow the PLC - HMI communications

Note that the ldquoApplicationTopicrdquo is the same as the IO Driver

The ldquocomputer namerdquo is the name of the PC that the HMI is running on (brad_s_carlberg in this case)

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 86

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 87

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 88

Indirect Tags

ldquoIndirect Tagsrdquo were used here to minimize the number of popup displays

This is especially useful in HMIrsquos with many tags

ONLY 12 popup displays are reused throughout the HMI

This gives the HMI a ldquoDCS-Likerdquo Look amp Feel

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 89

Popup Display TypesThe tag point type determines which popup display to use

Analog InputHIC (or Analog Output)PID (or Analog Composite)

bull PID WITH AUTO amp CASCADE amp RATIObull PID WITH AUTO amp RATIO

Diginbull Motor Status

DigOutMotor (or Digital Composite)

bull Motor with ILock and PermNumericSet TimersAlarm DetailAlarm Tags

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 90

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 91

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 92

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 93

Bars Buttons amp Sliders

By choosing to use indirect tags we complicate the Bar Graphs Buttons amp Sliders in the popup displays

Different scales need to be used for different engineering unit ranges

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 94

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 95

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 96

Popup Displays

The next two pages shows how the individual popup displays use the indirect tags

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 97

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 98

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 99

Adding a ldquoTouch Targetrdquo to a Display

2 Tell which tags to use

3 Tell which popup display to call upWhat kind of point type is it

3 Steps1 Tell which scale to use (if itrsquos an analog point type)

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 100

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 101

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 102

TUTORIAL

Part 2C

Excel Spreadsheets

amp

Visual Basic

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 103

A ldquoCHEAP amp DIRTYrdquo HMI With Excel

The 4 key parameters are

To communicate with the PLCUse brad_s_carlbergmbenet|ANOXIC_OXICrsquoplcregisterrsquo

Excel uses ldquopeeksrdquo amp ldquopokesrdquo to read from amp write to a PLC or HMI

To communicate with the HMIbrad_s_carlbergview|Tagnamersquotagnamersquo

bull computer namebull applicationbull topicbull item

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 104

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 105

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 106

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 107

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 108

Excel Macros

bull ldquoRequestrdquo Macro to read values

bull ldquoPokerdquo Macro to write values

bull A Sample Excel Macro

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 109

Sub PokeMacro()MsgBox ApplicationNetworkTemplatesPathChannel = ApplicationDDEInitiate(app=brad_s_carlbergVIEW topic=Tagname) This opens a DDE channel to ViewApplicationDDEPoke Channel Temperature1 Worksheets(Sheet1)Range(A1) Puts value from R1C1 into Temperature1ApplicationDDEPoke Channel DDEReal Worksheets(Sheet1)Range(A2) Puts value from R1C1 into Temperature1ApplicationDDEPoke Channel DDEInteger Worksheets(Sheet1)Range(A3) Puts value from R1C1 into Temperature1ApplicationDDETerminate Channel This terminates the DDE channelEnd SubSub RequestMacro()Channel = ApplicationDDEInitiate(app=brad_s_carlbergVIEW topic=Tagname) This opens a DDE channel to ViewWorksheets(Sheet1)Range(C4) = ApplicationDDERequest(Channel $Hour)Worksheets(Sheet1)Range(C5) = ApplicationDDERequest(Channel $Minute)Worksheets(Sheet1)Range(C6) = ApplicationDDERequest(Channel $Second)Worksheets(Sheet1)Range(C9) = ApplicationDDERequest(Channel $day)Worksheets(Sheet1)Range(C10) = ApplicationDDERequest(Channel $date)Worksheets(Sheet1)Range(C11) = ApplicationDDERequest(Channel $datestring)Worksheets(Sheet1)Range(C12) = ApplicationDDERequest(Channel $datetime)Worksheets(Sheet1)Range(C13) = ApplicationDDERequest(Channel $date)Worksheets(Sheet1)Range(C14) = ApplicationDDERequest(Channel $month)Worksheets(Sheet1)Range(C15) = ApplicationDDERequest(Channel $year)Worksheets(Sheet1)Range(C16) = ApplicationDDERequest(Channel $time)Worksheets(Sheet1)Range(C17) = ApplicationDDERequest(Channel $timestring)Worksheets(Sheet1)Range(C18) = ApplicationDDERequest(Channel $applicationversion)Worksheets(Sheet1)Range(C19) = ApplicationDDERequest(Channel $startddeconversations)Worksheets(Sheet1)Range(C20) = ApplicationDDERequest(Channel $accesslevel)Worksheets(Sheet1)Range(C21) = ApplicationDDERequest(Channel $alarmlogging)Worksheets(Sheet1)Range(C22) = ApplicationDDERequest(Channel $applicationchanged)Worksheets(Sheet1)Range(C23) = ApplicationDDERequest(Channel $configureusers)Worksheets(Sheet1)Range(C24) = ApplicationDDERequest(Channel $changepassword)Worksheets(Sheet1)Range(C25) = ApplicationDDERequest(Channel $InactivityTimeout)Worksheets(Sheet1)Range(C26) = ApplicationDDERequest(Channel $InactivityWarning)Worksheets(Sheet1)Range(C27) = ApplicationDDERequest(Channel $LogicRunning)Worksheets(Sheet1)Range(C28) = ApplicationDDERequest(Channel $OperatorEntered)Worksheets(Sheet1)Range(C29) = ApplicationDDERequest(Channel $Operator)Worksheets(Sheet1)Range(C30) = ApplicationDDERequest(Channel $PasswordEntered)ApplicationDDETerminate Channel This terminates the DDE channelEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 110

Visual Basic

ldquoRoll Your Ownrdquo HMI - Much More powerful than Excel

Key Parameters computer nameapplication|topicitem

IO Emulator - MBPlusSimulateexe

Can ldquoRead Fromrdquo amp ldquoWrite Tordquo PLC andor HMI

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 111

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 112

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 113

Dim PauseTime Start Finish TotalTime As Integer Declare variables

Private Sub txtAIT_332A_SCALED_Change()On Error GoTo PokeAIT_332AErrortxtAIT_332A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtAIT_332A_SCALEDText = Int((3 Rnd) + 20) Generate random value between 20 and 23txtAIT_332A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtAIT_332A_SCALEDLinkItem = AIT_332A_SCALEDtxtAIT_332A_SCALEDLinkMode = 2txtAIT_332A_SCALEDLinkPoketxtAIT_332A_SCALEDLinkMode = 0 DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total time

PokeAIT_332AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtAIT_332A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 114

Private Sub txtAIT_346A_SCALED_Change()On Error GoTo PokeAIT_346AErrortxtAIT_346A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtAIT_346A_SCALEDText = Int((3 Rnd) + 15) Generate random value between 15 and 18txtAIT_346A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtAIT_346A_SCALEDLinkItem = AIT_346A_SCALEDtxtAIT_346A_SCALEDLinkMode = 2txtAIT_346A_SCALEDLinkPoketxtAIT_346A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeAIT_346AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtAIT_346A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 115

Private Sub txtFIT_321A_SCALED_Change()On Error GoTo PokeFIT_321AErrortxtFIT_321A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtFIT_321A_SCALEDText = Int((10 Rnd) + 120) Generate random value between 120 and 130txtFIT_321A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_321A_SCALEDLinkItem = FIT_321A_SCALEDtxtFIT_321A_SCALEDLinkMode = 2txtFIT_321A_SCALEDLinkPoketxtFIT_321A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total time

PokeFIT_321AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_321A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume Next

End Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 116

Private Sub txtFIT_341A_SCALED_Change()On Error GoTo PokeFIT_341AErrortxtFIT_341A_SCALEDLinkMode = 0 PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTime

txtFIT_341A_SCALEDText = Int((3 Rnd) + 18) Generate random value between 18 and 21

txtFIT_341A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_341A_SCALEDLinkItem = FIT_341A_SCALEDtxtFIT_341A_SCALEDLinkMode = 2txtFIT_341A_SCALEDLinkPoketxtFIT_341A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeFIT_341AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_341A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 117

Private Sub txtFIT_343A_SCALED_Change()On Error GoTo PokeFIT_343AErrortxtFIT_343A_SCALEDLinkMode = 0 PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTime

txtFIT_343A_SCALEDText = Int((1 Rnd) + 3) Generate random value between 3 and 4

txtFIT_343A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_343A_SCALEDLinkItem = FIT_343A_SCALEDtxtFIT_343A_SCALEDLinkMode = 2txtFIT_343A_SCALEDLinkPoketxtFIT_343A_SCALEDLinkMode = 0 DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeFIT_343AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_343A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 118

TUTORIAL

Part 4

Questions

amp

Answers

  • Slide 1
  • Slide 2
  • Slide 3
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Slide 8
  • Slide 9
  • Slide 10
  • Slide 11
  • Slide 12
  • Slide 13
  • Slide 14
  • Slide 15
  • Slide 16
  • Slide 17
  • Slide 18
  • Slide 19
  • Slide 20
  • Slide 21
  • Slide 22
  • Slide 23
  • Slide 24
  • Slide 25
  • Slide 26
  • Slide 27
  • Slide 28
  • Slide 29
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
  • Slide 34
  • Slide 35
  • Slide 36
  • Slide 37
  • Slide 38
  • Slide 39
  • Slide 40
  • Slide 41
  • Slide 42
  • Slide 43
  • Slide 44
  • Slide 45
  • Slide 46
  • Slide 47
  • Slide 48
  • Slide 49
  • Slide 50
  • Slide 51
  • Slide 52
  • Slide 53
  • Slide 54
  • Slide 55
  • Slide 56
  • Slide 57
  • Slide 58
  • Slide 59
  • Slide 60
  • Slide 61
  • Slide 62
  • Slide 63
  • Slide 64
  • Slide 65
  • Slide 66
  • Slide 67
  • Slide 68
  • Slide 69
  • Slide 70
  • Slide 71
  • Slide 72
  • Slide 73
  • Slide 74
  • Slide 75
  • Slide 76
  • Slide 77
  • Slide 78
  • Slide 79
  • Slide 80
  • Slide 81
  • Slide 82
  • Slide 83
  • Slide 84
  • Slide 85
  • Slide 86
  • Slide 87
  • Slide 88
  • Slide 89
  • Slide 90
  • Slide 91
  • Slide 92
  • Slide 93
  • Slide 94
  • Slide 95
  • Slide 96
  • Slide 97
  • Slide 98
  • Slide 99
  • Slide 100
  • Slide 101
  • Slide 102
  • Slide 103
  • Slide 104
  • Slide 105
  • Slide 106
  • Slide 107
  • Slide 108
  • Slide 109
  • Slide 110
  • Slide 111
  • Slide 112
  • Slide 113
  • Slide 114
  • Slide 115
  • Slide 116
  • Slide 117
  • Slide 118
Page 82: TUTORIAL Ethernet PLC's Improve Oxygen Consumption ISA Expo/2001Houston, Texas Water & Wastewater Industry DivisionTuesday, September 11, 2001 1 Brad.

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 82

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 83

Scripting

There are 6 types of ldquoScriptsrdquobull Application Scriptsbull Key Scriptsbull Condition Scriptsbull Data Change Scriptsbull Quick Function Scriptsbull ActiveX Event Scripts

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 84

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 85

Access Names

The ldquoAccess Namesrdquo Must be configured to allow the PLC - HMI communications

Note that the ldquoApplicationTopicrdquo is the same as the IO Driver

The ldquocomputer namerdquo is the name of the PC that the HMI is running on (brad_s_carlberg in this case)

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 86

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 87

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 88

Indirect Tags

ldquoIndirect Tagsrdquo were used here to minimize the number of popup displays

This is especially useful in HMIrsquos with many tags

ONLY 12 popup displays are reused throughout the HMI

This gives the HMI a ldquoDCS-Likerdquo Look amp Feel

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 89

Popup Display TypesThe tag point type determines which popup display to use

Analog InputHIC (or Analog Output)PID (or Analog Composite)

bull PID WITH AUTO amp CASCADE amp RATIObull PID WITH AUTO amp RATIO

Diginbull Motor Status

DigOutMotor (or Digital Composite)

bull Motor with ILock and PermNumericSet TimersAlarm DetailAlarm Tags

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 90

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 91

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 92

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 93

Bars Buttons amp Sliders

By choosing to use indirect tags we complicate the Bar Graphs Buttons amp Sliders in the popup displays

Different scales need to be used for different engineering unit ranges

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 94

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 95

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 96

Popup Displays

The next two pages shows how the individual popup displays use the indirect tags

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 97

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 98

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 99

Adding a ldquoTouch Targetrdquo to a Display

2 Tell which tags to use

3 Tell which popup display to call upWhat kind of point type is it

3 Steps1 Tell which scale to use (if itrsquos an analog point type)

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 100

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 101

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 102

TUTORIAL

Part 2C

Excel Spreadsheets

amp

Visual Basic

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 103

A ldquoCHEAP amp DIRTYrdquo HMI With Excel

The 4 key parameters are

To communicate with the PLCUse brad_s_carlbergmbenet|ANOXIC_OXICrsquoplcregisterrsquo

Excel uses ldquopeeksrdquo amp ldquopokesrdquo to read from amp write to a PLC or HMI

To communicate with the HMIbrad_s_carlbergview|Tagnamersquotagnamersquo

bull computer namebull applicationbull topicbull item

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 104

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 105

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 106

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 107

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 108

Excel Macros

bull ldquoRequestrdquo Macro to read values

bull ldquoPokerdquo Macro to write values

bull A Sample Excel Macro

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 109

Sub PokeMacro()MsgBox ApplicationNetworkTemplatesPathChannel = ApplicationDDEInitiate(app=brad_s_carlbergVIEW topic=Tagname) This opens a DDE channel to ViewApplicationDDEPoke Channel Temperature1 Worksheets(Sheet1)Range(A1) Puts value from R1C1 into Temperature1ApplicationDDEPoke Channel DDEReal Worksheets(Sheet1)Range(A2) Puts value from R1C1 into Temperature1ApplicationDDEPoke Channel DDEInteger Worksheets(Sheet1)Range(A3) Puts value from R1C1 into Temperature1ApplicationDDETerminate Channel This terminates the DDE channelEnd SubSub RequestMacro()Channel = ApplicationDDEInitiate(app=brad_s_carlbergVIEW topic=Tagname) This opens a DDE channel to ViewWorksheets(Sheet1)Range(C4) = ApplicationDDERequest(Channel $Hour)Worksheets(Sheet1)Range(C5) = ApplicationDDERequest(Channel $Minute)Worksheets(Sheet1)Range(C6) = ApplicationDDERequest(Channel $Second)Worksheets(Sheet1)Range(C9) = ApplicationDDERequest(Channel $day)Worksheets(Sheet1)Range(C10) = ApplicationDDERequest(Channel $date)Worksheets(Sheet1)Range(C11) = ApplicationDDERequest(Channel $datestring)Worksheets(Sheet1)Range(C12) = ApplicationDDERequest(Channel $datetime)Worksheets(Sheet1)Range(C13) = ApplicationDDERequest(Channel $date)Worksheets(Sheet1)Range(C14) = ApplicationDDERequest(Channel $month)Worksheets(Sheet1)Range(C15) = ApplicationDDERequest(Channel $year)Worksheets(Sheet1)Range(C16) = ApplicationDDERequest(Channel $time)Worksheets(Sheet1)Range(C17) = ApplicationDDERequest(Channel $timestring)Worksheets(Sheet1)Range(C18) = ApplicationDDERequest(Channel $applicationversion)Worksheets(Sheet1)Range(C19) = ApplicationDDERequest(Channel $startddeconversations)Worksheets(Sheet1)Range(C20) = ApplicationDDERequest(Channel $accesslevel)Worksheets(Sheet1)Range(C21) = ApplicationDDERequest(Channel $alarmlogging)Worksheets(Sheet1)Range(C22) = ApplicationDDERequest(Channel $applicationchanged)Worksheets(Sheet1)Range(C23) = ApplicationDDERequest(Channel $configureusers)Worksheets(Sheet1)Range(C24) = ApplicationDDERequest(Channel $changepassword)Worksheets(Sheet1)Range(C25) = ApplicationDDERequest(Channel $InactivityTimeout)Worksheets(Sheet1)Range(C26) = ApplicationDDERequest(Channel $InactivityWarning)Worksheets(Sheet1)Range(C27) = ApplicationDDERequest(Channel $LogicRunning)Worksheets(Sheet1)Range(C28) = ApplicationDDERequest(Channel $OperatorEntered)Worksheets(Sheet1)Range(C29) = ApplicationDDERequest(Channel $Operator)Worksheets(Sheet1)Range(C30) = ApplicationDDERequest(Channel $PasswordEntered)ApplicationDDETerminate Channel This terminates the DDE channelEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 110

Visual Basic

ldquoRoll Your Ownrdquo HMI - Much More powerful than Excel

Key Parameters computer nameapplication|topicitem

IO Emulator - MBPlusSimulateexe

Can ldquoRead Fromrdquo amp ldquoWrite Tordquo PLC andor HMI

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 111

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 112

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 113

Dim PauseTime Start Finish TotalTime As Integer Declare variables

Private Sub txtAIT_332A_SCALED_Change()On Error GoTo PokeAIT_332AErrortxtAIT_332A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtAIT_332A_SCALEDText = Int((3 Rnd) + 20) Generate random value between 20 and 23txtAIT_332A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtAIT_332A_SCALEDLinkItem = AIT_332A_SCALEDtxtAIT_332A_SCALEDLinkMode = 2txtAIT_332A_SCALEDLinkPoketxtAIT_332A_SCALEDLinkMode = 0 DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total time

PokeAIT_332AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtAIT_332A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 114

Private Sub txtAIT_346A_SCALED_Change()On Error GoTo PokeAIT_346AErrortxtAIT_346A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtAIT_346A_SCALEDText = Int((3 Rnd) + 15) Generate random value between 15 and 18txtAIT_346A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtAIT_346A_SCALEDLinkItem = AIT_346A_SCALEDtxtAIT_346A_SCALEDLinkMode = 2txtAIT_346A_SCALEDLinkPoketxtAIT_346A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeAIT_346AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtAIT_346A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 115

Private Sub txtFIT_321A_SCALED_Change()On Error GoTo PokeFIT_321AErrortxtFIT_321A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtFIT_321A_SCALEDText = Int((10 Rnd) + 120) Generate random value between 120 and 130txtFIT_321A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_321A_SCALEDLinkItem = FIT_321A_SCALEDtxtFIT_321A_SCALEDLinkMode = 2txtFIT_321A_SCALEDLinkPoketxtFIT_321A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total time

PokeFIT_321AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_321A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume Next

End Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 116

Private Sub txtFIT_341A_SCALED_Change()On Error GoTo PokeFIT_341AErrortxtFIT_341A_SCALEDLinkMode = 0 PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTime

txtFIT_341A_SCALEDText = Int((3 Rnd) + 18) Generate random value between 18 and 21

txtFIT_341A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_341A_SCALEDLinkItem = FIT_341A_SCALEDtxtFIT_341A_SCALEDLinkMode = 2txtFIT_341A_SCALEDLinkPoketxtFIT_341A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeFIT_341AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_341A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 117

Private Sub txtFIT_343A_SCALED_Change()On Error GoTo PokeFIT_343AErrortxtFIT_343A_SCALEDLinkMode = 0 PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTime

txtFIT_343A_SCALEDText = Int((1 Rnd) + 3) Generate random value between 3 and 4

txtFIT_343A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_343A_SCALEDLinkItem = FIT_343A_SCALEDtxtFIT_343A_SCALEDLinkMode = 2txtFIT_343A_SCALEDLinkPoketxtFIT_343A_SCALEDLinkMode = 0 DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeFIT_343AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_343A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 118

TUTORIAL

Part 4

Questions

amp

Answers

  • Slide 1
  • Slide 2
  • Slide 3
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Slide 8
  • Slide 9
  • Slide 10
  • Slide 11
  • Slide 12
  • Slide 13
  • Slide 14
  • Slide 15
  • Slide 16
  • Slide 17
  • Slide 18
  • Slide 19
  • Slide 20
  • Slide 21
  • Slide 22
  • Slide 23
  • Slide 24
  • Slide 25
  • Slide 26
  • Slide 27
  • Slide 28
  • Slide 29
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
  • Slide 34
  • Slide 35
  • Slide 36
  • Slide 37
  • Slide 38
  • Slide 39
  • Slide 40
  • Slide 41
  • Slide 42
  • Slide 43
  • Slide 44
  • Slide 45
  • Slide 46
  • Slide 47
  • Slide 48
  • Slide 49
  • Slide 50
  • Slide 51
  • Slide 52
  • Slide 53
  • Slide 54
  • Slide 55
  • Slide 56
  • Slide 57
  • Slide 58
  • Slide 59
  • Slide 60
  • Slide 61
  • Slide 62
  • Slide 63
  • Slide 64
  • Slide 65
  • Slide 66
  • Slide 67
  • Slide 68
  • Slide 69
  • Slide 70
  • Slide 71
  • Slide 72
  • Slide 73
  • Slide 74
  • Slide 75
  • Slide 76
  • Slide 77
  • Slide 78
  • Slide 79
  • Slide 80
  • Slide 81
  • Slide 82
  • Slide 83
  • Slide 84
  • Slide 85
  • Slide 86
  • Slide 87
  • Slide 88
  • Slide 89
  • Slide 90
  • Slide 91
  • Slide 92
  • Slide 93
  • Slide 94
  • Slide 95
  • Slide 96
  • Slide 97
  • Slide 98
  • Slide 99
  • Slide 100
  • Slide 101
  • Slide 102
  • Slide 103
  • Slide 104
  • Slide 105
  • Slide 106
  • Slide 107
  • Slide 108
  • Slide 109
  • Slide 110
  • Slide 111
  • Slide 112
  • Slide 113
  • Slide 114
  • Slide 115
  • Slide 116
  • Slide 117
  • Slide 118
Page 83: TUTORIAL Ethernet PLC's Improve Oxygen Consumption ISA Expo/2001Houston, Texas Water & Wastewater Industry DivisionTuesday, September 11, 2001 1 Brad.

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 83

Scripting

There are 6 types of ldquoScriptsrdquobull Application Scriptsbull Key Scriptsbull Condition Scriptsbull Data Change Scriptsbull Quick Function Scriptsbull ActiveX Event Scripts

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 84

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 85

Access Names

The ldquoAccess Namesrdquo Must be configured to allow the PLC - HMI communications

Note that the ldquoApplicationTopicrdquo is the same as the IO Driver

The ldquocomputer namerdquo is the name of the PC that the HMI is running on (brad_s_carlberg in this case)

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 86

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 87

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 88

Indirect Tags

ldquoIndirect Tagsrdquo were used here to minimize the number of popup displays

This is especially useful in HMIrsquos with many tags

ONLY 12 popup displays are reused throughout the HMI

This gives the HMI a ldquoDCS-Likerdquo Look amp Feel

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 89

Popup Display TypesThe tag point type determines which popup display to use

Analog InputHIC (or Analog Output)PID (or Analog Composite)

bull PID WITH AUTO amp CASCADE amp RATIObull PID WITH AUTO amp RATIO

Diginbull Motor Status

DigOutMotor (or Digital Composite)

bull Motor with ILock and PermNumericSet TimersAlarm DetailAlarm Tags

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 90

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 91

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 92

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 93

Bars Buttons amp Sliders

By choosing to use indirect tags we complicate the Bar Graphs Buttons amp Sliders in the popup displays

Different scales need to be used for different engineering unit ranges

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 94

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 95

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 96

Popup Displays

The next two pages shows how the individual popup displays use the indirect tags

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 97

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 98

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 99

Adding a ldquoTouch Targetrdquo to a Display

2 Tell which tags to use

3 Tell which popup display to call upWhat kind of point type is it

3 Steps1 Tell which scale to use (if itrsquos an analog point type)

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 100

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 101

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 102

TUTORIAL

Part 2C

Excel Spreadsheets

amp

Visual Basic

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 103

A ldquoCHEAP amp DIRTYrdquo HMI With Excel

The 4 key parameters are

To communicate with the PLCUse brad_s_carlbergmbenet|ANOXIC_OXICrsquoplcregisterrsquo

Excel uses ldquopeeksrdquo amp ldquopokesrdquo to read from amp write to a PLC or HMI

To communicate with the HMIbrad_s_carlbergview|Tagnamersquotagnamersquo

bull computer namebull applicationbull topicbull item

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 104

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 105

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 106

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 107

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 108

Excel Macros

bull ldquoRequestrdquo Macro to read values

bull ldquoPokerdquo Macro to write values

bull A Sample Excel Macro

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 109

Sub PokeMacro()MsgBox ApplicationNetworkTemplatesPathChannel = ApplicationDDEInitiate(app=brad_s_carlbergVIEW topic=Tagname) This opens a DDE channel to ViewApplicationDDEPoke Channel Temperature1 Worksheets(Sheet1)Range(A1) Puts value from R1C1 into Temperature1ApplicationDDEPoke Channel DDEReal Worksheets(Sheet1)Range(A2) Puts value from R1C1 into Temperature1ApplicationDDEPoke Channel DDEInteger Worksheets(Sheet1)Range(A3) Puts value from R1C1 into Temperature1ApplicationDDETerminate Channel This terminates the DDE channelEnd SubSub RequestMacro()Channel = ApplicationDDEInitiate(app=brad_s_carlbergVIEW topic=Tagname) This opens a DDE channel to ViewWorksheets(Sheet1)Range(C4) = ApplicationDDERequest(Channel $Hour)Worksheets(Sheet1)Range(C5) = ApplicationDDERequest(Channel $Minute)Worksheets(Sheet1)Range(C6) = ApplicationDDERequest(Channel $Second)Worksheets(Sheet1)Range(C9) = ApplicationDDERequest(Channel $day)Worksheets(Sheet1)Range(C10) = ApplicationDDERequest(Channel $date)Worksheets(Sheet1)Range(C11) = ApplicationDDERequest(Channel $datestring)Worksheets(Sheet1)Range(C12) = ApplicationDDERequest(Channel $datetime)Worksheets(Sheet1)Range(C13) = ApplicationDDERequest(Channel $date)Worksheets(Sheet1)Range(C14) = ApplicationDDERequest(Channel $month)Worksheets(Sheet1)Range(C15) = ApplicationDDERequest(Channel $year)Worksheets(Sheet1)Range(C16) = ApplicationDDERequest(Channel $time)Worksheets(Sheet1)Range(C17) = ApplicationDDERequest(Channel $timestring)Worksheets(Sheet1)Range(C18) = ApplicationDDERequest(Channel $applicationversion)Worksheets(Sheet1)Range(C19) = ApplicationDDERequest(Channel $startddeconversations)Worksheets(Sheet1)Range(C20) = ApplicationDDERequest(Channel $accesslevel)Worksheets(Sheet1)Range(C21) = ApplicationDDERequest(Channel $alarmlogging)Worksheets(Sheet1)Range(C22) = ApplicationDDERequest(Channel $applicationchanged)Worksheets(Sheet1)Range(C23) = ApplicationDDERequest(Channel $configureusers)Worksheets(Sheet1)Range(C24) = ApplicationDDERequest(Channel $changepassword)Worksheets(Sheet1)Range(C25) = ApplicationDDERequest(Channel $InactivityTimeout)Worksheets(Sheet1)Range(C26) = ApplicationDDERequest(Channel $InactivityWarning)Worksheets(Sheet1)Range(C27) = ApplicationDDERequest(Channel $LogicRunning)Worksheets(Sheet1)Range(C28) = ApplicationDDERequest(Channel $OperatorEntered)Worksheets(Sheet1)Range(C29) = ApplicationDDERequest(Channel $Operator)Worksheets(Sheet1)Range(C30) = ApplicationDDERequest(Channel $PasswordEntered)ApplicationDDETerminate Channel This terminates the DDE channelEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 110

Visual Basic

ldquoRoll Your Ownrdquo HMI - Much More powerful than Excel

Key Parameters computer nameapplication|topicitem

IO Emulator - MBPlusSimulateexe

Can ldquoRead Fromrdquo amp ldquoWrite Tordquo PLC andor HMI

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 111

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 112

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 113

Dim PauseTime Start Finish TotalTime As Integer Declare variables

Private Sub txtAIT_332A_SCALED_Change()On Error GoTo PokeAIT_332AErrortxtAIT_332A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtAIT_332A_SCALEDText = Int((3 Rnd) + 20) Generate random value between 20 and 23txtAIT_332A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtAIT_332A_SCALEDLinkItem = AIT_332A_SCALEDtxtAIT_332A_SCALEDLinkMode = 2txtAIT_332A_SCALEDLinkPoketxtAIT_332A_SCALEDLinkMode = 0 DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total time

PokeAIT_332AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtAIT_332A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 114

Private Sub txtAIT_346A_SCALED_Change()On Error GoTo PokeAIT_346AErrortxtAIT_346A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtAIT_346A_SCALEDText = Int((3 Rnd) + 15) Generate random value between 15 and 18txtAIT_346A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtAIT_346A_SCALEDLinkItem = AIT_346A_SCALEDtxtAIT_346A_SCALEDLinkMode = 2txtAIT_346A_SCALEDLinkPoketxtAIT_346A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeAIT_346AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtAIT_346A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 115

Private Sub txtFIT_321A_SCALED_Change()On Error GoTo PokeFIT_321AErrortxtFIT_321A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtFIT_321A_SCALEDText = Int((10 Rnd) + 120) Generate random value between 120 and 130txtFIT_321A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_321A_SCALEDLinkItem = FIT_321A_SCALEDtxtFIT_321A_SCALEDLinkMode = 2txtFIT_321A_SCALEDLinkPoketxtFIT_321A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total time

PokeFIT_321AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_321A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume Next

End Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 116

Private Sub txtFIT_341A_SCALED_Change()On Error GoTo PokeFIT_341AErrortxtFIT_341A_SCALEDLinkMode = 0 PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTime

txtFIT_341A_SCALEDText = Int((3 Rnd) + 18) Generate random value between 18 and 21

txtFIT_341A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_341A_SCALEDLinkItem = FIT_341A_SCALEDtxtFIT_341A_SCALEDLinkMode = 2txtFIT_341A_SCALEDLinkPoketxtFIT_341A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeFIT_341AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_341A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 117

Private Sub txtFIT_343A_SCALED_Change()On Error GoTo PokeFIT_343AErrortxtFIT_343A_SCALEDLinkMode = 0 PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTime

txtFIT_343A_SCALEDText = Int((1 Rnd) + 3) Generate random value between 3 and 4

txtFIT_343A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_343A_SCALEDLinkItem = FIT_343A_SCALEDtxtFIT_343A_SCALEDLinkMode = 2txtFIT_343A_SCALEDLinkPoketxtFIT_343A_SCALEDLinkMode = 0 DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeFIT_343AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_343A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 118

TUTORIAL

Part 4

Questions

amp

Answers

  • Slide 1
  • Slide 2
  • Slide 3
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Slide 8
  • Slide 9
  • Slide 10
  • Slide 11
  • Slide 12
  • Slide 13
  • Slide 14
  • Slide 15
  • Slide 16
  • Slide 17
  • Slide 18
  • Slide 19
  • Slide 20
  • Slide 21
  • Slide 22
  • Slide 23
  • Slide 24
  • Slide 25
  • Slide 26
  • Slide 27
  • Slide 28
  • Slide 29
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
  • Slide 34
  • Slide 35
  • Slide 36
  • Slide 37
  • Slide 38
  • Slide 39
  • Slide 40
  • Slide 41
  • Slide 42
  • Slide 43
  • Slide 44
  • Slide 45
  • Slide 46
  • Slide 47
  • Slide 48
  • Slide 49
  • Slide 50
  • Slide 51
  • Slide 52
  • Slide 53
  • Slide 54
  • Slide 55
  • Slide 56
  • Slide 57
  • Slide 58
  • Slide 59
  • Slide 60
  • Slide 61
  • Slide 62
  • Slide 63
  • Slide 64
  • Slide 65
  • Slide 66
  • Slide 67
  • Slide 68
  • Slide 69
  • Slide 70
  • Slide 71
  • Slide 72
  • Slide 73
  • Slide 74
  • Slide 75
  • Slide 76
  • Slide 77
  • Slide 78
  • Slide 79
  • Slide 80
  • Slide 81
  • Slide 82
  • Slide 83
  • Slide 84
  • Slide 85
  • Slide 86
  • Slide 87
  • Slide 88
  • Slide 89
  • Slide 90
  • Slide 91
  • Slide 92
  • Slide 93
  • Slide 94
  • Slide 95
  • Slide 96
  • Slide 97
  • Slide 98
  • Slide 99
  • Slide 100
  • Slide 101
  • Slide 102
  • Slide 103
  • Slide 104
  • Slide 105
  • Slide 106
  • Slide 107
  • Slide 108
  • Slide 109
  • Slide 110
  • Slide 111
  • Slide 112
  • Slide 113
  • Slide 114
  • Slide 115
  • Slide 116
  • Slide 117
  • Slide 118
Page 84: TUTORIAL Ethernet PLC's Improve Oxygen Consumption ISA Expo/2001Houston, Texas Water & Wastewater Industry DivisionTuesday, September 11, 2001 1 Brad.

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 84

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 85

Access Names

The ldquoAccess Namesrdquo Must be configured to allow the PLC - HMI communications

Note that the ldquoApplicationTopicrdquo is the same as the IO Driver

The ldquocomputer namerdquo is the name of the PC that the HMI is running on (brad_s_carlberg in this case)

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 86

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 87

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 88

Indirect Tags

ldquoIndirect Tagsrdquo were used here to minimize the number of popup displays

This is especially useful in HMIrsquos with many tags

ONLY 12 popup displays are reused throughout the HMI

This gives the HMI a ldquoDCS-Likerdquo Look amp Feel

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 89

Popup Display TypesThe tag point type determines which popup display to use

Analog InputHIC (or Analog Output)PID (or Analog Composite)

bull PID WITH AUTO amp CASCADE amp RATIObull PID WITH AUTO amp RATIO

Diginbull Motor Status

DigOutMotor (or Digital Composite)

bull Motor with ILock and PermNumericSet TimersAlarm DetailAlarm Tags

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 90

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 91

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 92

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 93

Bars Buttons amp Sliders

By choosing to use indirect tags we complicate the Bar Graphs Buttons amp Sliders in the popup displays

Different scales need to be used for different engineering unit ranges

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 94

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 95

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 96

Popup Displays

The next two pages shows how the individual popup displays use the indirect tags

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 97

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 98

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 99

Adding a ldquoTouch Targetrdquo to a Display

2 Tell which tags to use

3 Tell which popup display to call upWhat kind of point type is it

3 Steps1 Tell which scale to use (if itrsquos an analog point type)

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 100

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 101

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 102

TUTORIAL

Part 2C

Excel Spreadsheets

amp

Visual Basic

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 103

A ldquoCHEAP amp DIRTYrdquo HMI With Excel

The 4 key parameters are

To communicate with the PLCUse brad_s_carlbergmbenet|ANOXIC_OXICrsquoplcregisterrsquo

Excel uses ldquopeeksrdquo amp ldquopokesrdquo to read from amp write to a PLC or HMI

To communicate with the HMIbrad_s_carlbergview|Tagnamersquotagnamersquo

bull computer namebull applicationbull topicbull item

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 104

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 105

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 106

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 107

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 108

Excel Macros

bull ldquoRequestrdquo Macro to read values

bull ldquoPokerdquo Macro to write values

bull A Sample Excel Macro

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 109

Sub PokeMacro()MsgBox ApplicationNetworkTemplatesPathChannel = ApplicationDDEInitiate(app=brad_s_carlbergVIEW topic=Tagname) This opens a DDE channel to ViewApplicationDDEPoke Channel Temperature1 Worksheets(Sheet1)Range(A1) Puts value from R1C1 into Temperature1ApplicationDDEPoke Channel DDEReal Worksheets(Sheet1)Range(A2) Puts value from R1C1 into Temperature1ApplicationDDEPoke Channel DDEInteger Worksheets(Sheet1)Range(A3) Puts value from R1C1 into Temperature1ApplicationDDETerminate Channel This terminates the DDE channelEnd SubSub RequestMacro()Channel = ApplicationDDEInitiate(app=brad_s_carlbergVIEW topic=Tagname) This opens a DDE channel to ViewWorksheets(Sheet1)Range(C4) = ApplicationDDERequest(Channel $Hour)Worksheets(Sheet1)Range(C5) = ApplicationDDERequest(Channel $Minute)Worksheets(Sheet1)Range(C6) = ApplicationDDERequest(Channel $Second)Worksheets(Sheet1)Range(C9) = ApplicationDDERequest(Channel $day)Worksheets(Sheet1)Range(C10) = ApplicationDDERequest(Channel $date)Worksheets(Sheet1)Range(C11) = ApplicationDDERequest(Channel $datestring)Worksheets(Sheet1)Range(C12) = ApplicationDDERequest(Channel $datetime)Worksheets(Sheet1)Range(C13) = ApplicationDDERequest(Channel $date)Worksheets(Sheet1)Range(C14) = ApplicationDDERequest(Channel $month)Worksheets(Sheet1)Range(C15) = ApplicationDDERequest(Channel $year)Worksheets(Sheet1)Range(C16) = ApplicationDDERequest(Channel $time)Worksheets(Sheet1)Range(C17) = ApplicationDDERequest(Channel $timestring)Worksheets(Sheet1)Range(C18) = ApplicationDDERequest(Channel $applicationversion)Worksheets(Sheet1)Range(C19) = ApplicationDDERequest(Channel $startddeconversations)Worksheets(Sheet1)Range(C20) = ApplicationDDERequest(Channel $accesslevel)Worksheets(Sheet1)Range(C21) = ApplicationDDERequest(Channel $alarmlogging)Worksheets(Sheet1)Range(C22) = ApplicationDDERequest(Channel $applicationchanged)Worksheets(Sheet1)Range(C23) = ApplicationDDERequest(Channel $configureusers)Worksheets(Sheet1)Range(C24) = ApplicationDDERequest(Channel $changepassword)Worksheets(Sheet1)Range(C25) = ApplicationDDERequest(Channel $InactivityTimeout)Worksheets(Sheet1)Range(C26) = ApplicationDDERequest(Channel $InactivityWarning)Worksheets(Sheet1)Range(C27) = ApplicationDDERequest(Channel $LogicRunning)Worksheets(Sheet1)Range(C28) = ApplicationDDERequest(Channel $OperatorEntered)Worksheets(Sheet1)Range(C29) = ApplicationDDERequest(Channel $Operator)Worksheets(Sheet1)Range(C30) = ApplicationDDERequest(Channel $PasswordEntered)ApplicationDDETerminate Channel This terminates the DDE channelEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 110

Visual Basic

ldquoRoll Your Ownrdquo HMI - Much More powerful than Excel

Key Parameters computer nameapplication|topicitem

IO Emulator - MBPlusSimulateexe

Can ldquoRead Fromrdquo amp ldquoWrite Tordquo PLC andor HMI

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 111

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 112

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 113

Dim PauseTime Start Finish TotalTime As Integer Declare variables

Private Sub txtAIT_332A_SCALED_Change()On Error GoTo PokeAIT_332AErrortxtAIT_332A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtAIT_332A_SCALEDText = Int((3 Rnd) + 20) Generate random value between 20 and 23txtAIT_332A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtAIT_332A_SCALEDLinkItem = AIT_332A_SCALEDtxtAIT_332A_SCALEDLinkMode = 2txtAIT_332A_SCALEDLinkPoketxtAIT_332A_SCALEDLinkMode = 0 DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total time

PokeAIT_332AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtAIT_332A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 114

Private Sub txtAIT_346A_SCALED_Change()On Error GoTo PokeAIT_346AErrortxtAIT_346A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtAIT_346A_SCALEDText = Int((3 Rnd) + 15) Generate random value between 15 and 18txtAIT_346A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtAIT_346A_SCALEDLinkItem = AIT_346A_SCALEDtxtAIT_346A_SCALEDLinkMode = 2txtAIT_346A_SCALEDLinkPoketxtAIT_346A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeAIT_346AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtAIT_346A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 115

Private Sub txtFIT_321A_SCALED_Change()On Error GoTo PokeFIT_321AErrortxtFIT_321A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtFIT_321A_SCALEDText = Int((10 Rnd) + 120) Generate random value between 120 and 130txtFIT_321A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_321A_SCALEDLinkItem = FIT_321A_SCALEDtxtFIT_321A_SCALEDLinkMode = 2txtFIT_321A_SCALEDLinkPoketxtFIT_321A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total time

PokeFIT_321AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_321A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume Next

End Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 116

Private Sub txtFIT_341A_SCALED_Change()On Error GoTo PokeFIT_341AErrortxtFIT_341A_SCALEDLinkMode = 0 PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTime

txtFIT_341A_SCALEDText = Int((3 Rnd) + 18) Generate random value between 18 and 21

txtFIT_341A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_341A_SCALEDLinkItem = FIT_341A_SCALEDtxtFIT_341A_SCALEDLinkMode = 2txtFIT_341A_SCALEDLinkPoketxtFIT_341A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeFIT_341AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_341A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 117

Private Sub txtFIT_343A_SCALED_Change()On Error GoTo PokeFIT_343AErrortxtFIT_343A_SCALEDLinkMode = 0 PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTime

txtFIT_343A_SCALEDText = Int((1 Rnd) + 3) Generate random value between 3 and 4

txtFIT_343A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_343A_SCALEDLinkItem = FIT_343A_SCALEDtxtFIT_343A_SCALEDLinkMode = 2txtFIT_343A_SCALEDLinkPoketxtFIT_343A_SCALEDLinkMode = 0 DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeFIT_343AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_343A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 118

TUTORIAL

Part 4

Questions

amp

Answers

  • Slide 1
  • Slide 2
  • Slide 3
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Slide 8
  • Slide 9
  • Slide 10
  • Slide 11
  • Slide 12
  • Slide 13
  • Slide 14
  • Slide 15
  • Slide 16
  • Slide 17
  • Slide 18
  • Slide 19
  • Slide 20
  • Slide 21
  • Slide 22
  • Slide 23
  • Slide 24
  • Slide 25
  • Slide 26
  • Slide 27
  • Slide 28
  • Slide 29
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
  • Slide 34
  • Slide 35
  • Slide 36
  • Slide 37
  • Slide 38
  • Slide 39
  • Slide 40
  • Slide 41
  • Slide 42
  • Slide 43
  • Slide 44
  • Slide 45
  • Slide 46
  • Slide 47
  • Slide 48
  • Slide 49
  • Slide 50
  • Slide 51
  • Slide 52
  • Slide 53
  • Slide 54
  • Slide 55
  • Slide 56
  • Slide 57
  • Slide 58
  • Slide 59
  • Slide 60
  • Slide 61
  • Slide 62
  • Slide 63
  • Slide 64
  • Slide 65
  • Slide 66
  • Slide 67
  • Slide 68
  • Slide 69
  • Slide 70
  • Slide 71
  • Slide 72
  • Slide 73
  • Slide 74
  • Slide 75
  • Slide 76
  • Slide 77
  • Slide 78
  • Slide 79
  • Slide 80
  • Slide 81
  • Slide 82
  • Slide 83
  • Slide 84
  • Slide 85
  • Slide 86
  • Slide 87
  • Slide 88
  • Slide 89
  • Slide 90
  • Slide 91
  • Slide 92
  • Slide 93
  • Slide 94
  • Slide 95
  • Slide 96
  • Slide 97
  • Slide 98
  • Slide 99
  • Slide 100
  • Slide 101
  • Slide 102
  • Slide 103
  • Slide 104
  • Slide 105
  • Slide 106
  • Slide 107
  • Slide 108
  • Slide 109
  • Slide 110
  • Slide 111
  • Slide 112
  • Slide 113
  • Slide 114
  • Slide 115
  • Slide 116
  • Slide 117
  • Slide 118
Page 85: TUTORIAL Ethernet PLC's Improve Oxygen Consumption ISA Expo/2001Houston, Texas Water & Wastewater Industry DivisionTuesday, September 11, 2001 1 Brad.

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 85

Access Names

The ldquoAccess Namesrdquo Must be configured to allow the PLC - HMI communications

Note that the ldquoApplicationTopicrdquo is the same as the IO Driver

The ldquocomputer namerdquo is the name of the PC that the HMI is running on (brad_s_carlberg in this case)

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 86

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 87

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 88

Indirect Tags

ldquoIndirect Tagsrdquo were used here to minimize the number of popup displays

This is especially useful in HMIrsquos with many tags

ONLY 12 popup displays are reused throughout the HMI

This gives the HMI a ldquoDCS-Likerdquo Look amp Feel

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 89

Popup Display TypesThe tag point type determines which popup display to use

Analog InputHIC (or Analog Output)PID (or Analog Composite)

bull PID WITH AUTO amp CASCADE amp RATIObull PID WITH AUTO amp RATIO

Diginbull Motor Status

DigOutMotor (or Digital Composite)

bull Motor with ILock and PermNumericSet TimersAlarm DetailAlarm Tags

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 90

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 91

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 92

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 93

Bars Buttons amp Sliders

By choosing to use indirect tags we complicate the Bar Graphs Buttons amp Sliders in the popup displays

Different scales need to be used for different engineering unit ranges

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 94

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 95

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 96

Popup Displays

The next two pages shows how the individual popup displays use the indirect tags

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 97

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 98

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 99

Adding a ldquoTouch Targetrdquo to a Display

2 Tell which tags to use

3 Tell which popup display to call upWhat kind of point type is it

3 Steps1 Tell which scale to use (if itrsquos an analog point type)

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 100

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 101

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 102

TUTORIAL

Part 2C

Excel Spreadsheets

amp

Visual Basic

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 103

A ldquoCHEAP amp DIRTYrdquo HMI With Excel

The 4 key parameters are

To communicate with the PLCUse brad_s_carlbergmbenet|ANOXIC_OXICrsquoplcregisterrsquo

Excel uses ldquopeeksrdquo amp ldquopokesrdquo to read from amp write to a PLC or HMI

To communicate with the HMIbrad_s_carlbergview|Tagnamersquotagnamersquo

bull computer namebull applicationbull topicbull item

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 104

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 105

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 106

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 107

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 108

Excel Macros

bull ldquoRequestrdquo Macro to read values

bull ldquoPokerdquo Macro to write values

bull A Sample Excel Macro

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 109

Sub PokeMacro()MsgBox ApplicationNetworkTemplatesPathChannel = ApplicationDDEInitiate(app=brad_s_carlbergVIEW topic=Tagname) This opens a DDE channel to ViewApplicationDDEPoke Channel Temperature1 Worksheets(Sheet1)Range(A1) Puts value from R1C1 into Temperature1ApplicationDDEPoke Channel DDEReal Worksheets(Sheet1)Range(A2) Puts value from R1C1 into Temperature1ApplicationDDEPoke Channel DDEInteger Worksheets(Sheet1)Range(A3) Puts value from R1C1 into Temperature1ApplicationDDETerminate Channel This terminates the DDE channelEnd SubSub RequestMacro()Channel = ApplicationDDEInitiate(app=brad_s_carlbergVIEW topic=Tagname) This opens a DDE channel to ViewWorksheets(Sheet1)Range(C4) = ApplicationDDERequest(Channel $Hour)Worksheets(Sheet1)Range(C5) = ApplicationDDERequest(Channel $Minute)Worksheets(Sheet1)Range(C6) = ApplicationDDERequest(Channel $Second)Worksheets(Sheet1)Range(C9) = ApplicationDDERequest(Channel $day)Worksheets(Sheet1)Range(C10) = ApplicationDDERequest(Channel $date)Worksheets(Sheet1)Range(C11) = ApplicationDDERequest(Channel $datestring)Worksheets(Sheet1)Range(C12) = ApplicationDDERequest(Channel $datetime)Worksheets(Sheet1)Range(C13) = ApplicationDDERequest(Channel $date)Worksheets(Sheet1)Range(C14) = ApplicationDDERequest(Channel $month)Worksheets(Sheet1)Range(C15) = ApplicationDDERequest(Channel $year)Worksheets(Sheet1)Range(C16) = ApplicationDDERequest(Channel $time)Worksheets(Sheet1)Range(C17) = ApplicationDDERequest(Channel $timestring)Worksheets(Sheet1)Range(C18) = ApplicationDDERequest(Channel $applicationversion)Worksheets(Sheet1)Range(C19) = ApplicationDDERequest(Channel $startddeconversations)Worksheets(Sheet1)Range(C20) = ApplicationDDERequest(Channel $accesslevel)Worksheets(Sheet1)Range(C21) = ApplicationDDERequest(Channel $alarmlogging)Worksheets(Sheet1)Range(C22) = ApplicationDDERequest(Channel $applicationchanged)Worksheets(Sheet1)Range(C23) = ApplicationDDERequest(Channel $configureusers)Worksheets(Sheet1)Range(C24) = ApplicationDDERequest(Channel $changepassword)Worksheets(Sheet1)Range(C25) = ApplicationDDERequest(Channel $InactivityTimeout)Worksheets(Sheet1)Range(C26) = ApplicationDDERequest(Channel $InactivityWarning)Worksheets(Sheet1)Range(C27) = ApplicationDDERequest(Channel $LogicRunning)Worksheets(Sheet1)Range(C28) = ApplicationDDERequest(Channel $OperatorEntered)Worksheets(Sheet1)Range(C29) = ApplicationDDERequest(Channel $Operator)Worksheets(Sheet1)Range(C30) = ApplicationDDERequest(Channel $PasswordEntered)ApplicationDDETerminate Channel This terminates the DDE channelEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 110

Visual Basic

ldquoRoll Your Ownrdquo HMI - Much More powerful than Excel

Key Parameters computer nameapplication|topicitem

IO Emulator - MBPlusSimulateexe

Can ldquoRead Fromrdquo amp ldquoWrite Tordquo PLC andor HMI

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 111

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 112

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 113

Dim PauseTime Start Finish TotalTime As Integer Declare variables

Private Sub txtAIT_332A_SCALED_Change()On Error GoTo PokeAIT_332AErrortxtAIT_332A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtAIT_332A_SCALEDText = Int((3 Rnd) + 20) Generate random value between 20 and 23txtAIT_332A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtAIT_332A_SCALEDLinkItem = AIT_332A_SCALEDtxtAIT_332A_SCALEDLinkMode = 2txtAIT_332A_SCALEDLinkPoketxtAIT_332A_SCALEDLinkMode = 0 DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total time

PokeAIT_332AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtAIT_332A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 114

Private Sub txtAIT_346A_SCALED_Change()On Error GoTo PokeAIT_346AErrortxtAIT_346A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtAIT_346A_SCALEDText = Int((3 Rnd) + 15) Generate random value between 15 and 18txtAIT_346A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtAIT_346A_SCALEDLinkItem = AIT_346A_SCALEDtxtAIT_346A_SCALEDLinkMode = 2txtAIT_346A_SCALEDLinkPoketxtAIT_346A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeAIT_346AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtAIT_346A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 115

Private Sub txtFIT_321A_SCALED_Change()On Error GoTo PokeFIT_321AErrortxtFIT_321A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtFIT_321A_SCALEDText = Int((10 Rnd) + 120) Generate random value between 120 and 130txtFIT_321A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_321A_SCALEDLinkItem = FIT_321A_SCALEDtxtFIT_321A_SCALEDLinkMode = 2txtFIT_321A_SCALEDLinkPoketxtFIT_321A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total time

PokeFIT_321AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_321A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume Next

End Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 116

Private Sub txtFIT_341A_SCALED_Change()On Error GoTo PokeFIT_341AErrortxtFIT_341A_SCALEDLinkMode = 0 PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTime

txtFIT_341A_SCALEDText = Int((3 Rnd) + 18) Generate random value between 18 and 21

txtFIT_341A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_341A_SCALEDLinkItem = FIT_341A_SCALEDtxtFIT_341A_SCALEDLinkMode = 2txtFIT_341A_SCALEDLinkPoketxtFIT_341A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeFIT_341AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_341A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 117

Private Sub txtFIT_343A_SCALED_Change()On Error GoTo PokeFIT_343AErrortxtFIT_343A_SCALEDLinkMode = 0 PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTime

txtFIT_343A_SCALEDText = Int((1 Rnd) + 3) Generate random value between 3 and 4

txtFIT_343A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_343A_SCALEDLinkItem = FIT_343A_SCALEDtxtFIT_343A_SCALEDLinkMode = 2txtFIT_343A_SCALEDLinkPoketxtFIT_343A_SCALEDLinkMode = 0 DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeFIT_343AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_343A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 118

TUTORIAL

Part 4

Questions

amp

Answers

  • Slide 1
  • Slide 2
  • Slide 3
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Slide 8
  • Slide 9
  • Slide 10
  • Slide 11
  • Slide 12
  • Slide 13
  • Slide 14
  • Slide 15
  • Slide 16
  • Slide 17
  • Slide 18
  • Slide 19
  • Slide 20
  • Slide 21
  • Slide 22
  • Slide 23
  • Slide 24
  • Slide 25
  • Slide 26
  • Slide 27
  • Slide 28
  • Slide 29
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
  • Slide 34
  • Slide 35
  • Slide 36
  • Slide 37
  • Slide 38
  • Slide 39
  • Slide 40
  • Slide 41
  • Slide 42
  • Slide 43
  • Slide 44
  • Slide 45
  • Slide 46
  • Slide 47
  • Slide 48
  • Slide 49
  • Slide 50
  • Slide 51
  • Slide 52
  • Slide 53
  • Slide 54
  • Slide 55
  • Slide 56
  • Slide 57
  • Slide 58
  • Slide 59
  • Slide 60
  • Slide 61
  • Slide 62
  • Slide 63
  • Slide 64
  • Slide 65
  • Slide 66
  • Slide 67
  • Slide 68
  • Slide 69
  • Slide 70
  • Slide 71
  • Slide 72
  • Slide 73
  • Slide 74
  • Slide 75
  • Slide 76
  • Slide 77
  • Slide 78
  • Slide 79
  • Slide 80
  • Slide 81
  • Slide 82
  • Slide 83
  • Slide 84
  • Slide 85
  • Slide 86
  • Slide 87
  • Slide 88
  • Slide 89
  • Slide 90
  • Slide 91
  • Slide 92
  • Slide 93
  • Slide 94
  • Slide 95
  • Slide 96
  • Slide 97
  • Slide 98
  • Slide 99
  • Slide 100
  • Slide 101
  • Slide 102
  • Slide 103
  • Slide 104
  • Slide 105
  • Slide 106
  • Slide 107
  • Slide 108
  • Slide 109
  • Slide 110
  • Slide 111
  • Slide 112
  • Slide 113
  • Slide 114
  • Slide 115
  • Slide 116
  • Slide 117
  • Slide 118
Page 86: TUTORIAL Ethernet PLC's Improve Oxygen Consumption ISA Expo/2001Houston, Texas Water & Wastewater Industry DivisionTuesday, September 11, 2001 1 Brad.

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 86

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 87

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 88

Indirect Tags

ldquoIndirect Tagsrdquo were used here to minimize the number of popup displays

This is especially useful in HMIrsquos with many tags

ONLY 12 popup displays are reused throughout the HMI

This gives the HMI a ldquoDCS-Likerdquo Look amp Feel

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 89

Popup Display TypesThe tag point type determines which popup display to use

Analog InputHIC (or Analog Output)PID (or Analog Composite)

bull PID WITH AUTO amp CASCADE amp RATIObull PID WITH AUTO amp RATIO

Diginbull Motor Status

DigOutMotor (or Digital Composite)

bull Motor with ILock and PermNumericSet TimersAlarm DetailAlarm Tags

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 90

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 91

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 92

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 93

Bars Buttons amp Sliders

By choosing to use indirect tags we complicate the Bar Graphs Buttons amp Sliders in the popup displays

Different scales need to be used for different engineering unit ranges

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 94

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 95

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 96

Popup Displays

The next two pages shows how the individual popup displays use the indirect tags

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 97

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 98

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 99

Adding a ldquoTouch Targetrdquo to a Display

2 Tell which tags to use

3 Tell which popup display to call upWhat kind of point type is it

3 Steps1 Tell which scale to use (if itrsquos an analog point type)

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 100

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 101

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 102

TUTORIAL

Part 2C

Excel Spreadsheets

amp

Visual Basic

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 103

A ldquoCHEAP amp DIRTYrdquo HMI With Excel

The 4 key parameters are

To communicate with the PLCUse brad_s_carlbergmbenet|ANOXIC_OXICrsquoplcregisterrsquo

Excel uses ldquopeeksrdquo amp ldquopokesrdquo to read from amp write to a PLC or HMI

To communicate with the HMIbrad_s_carlbergview|Tagnamersquotagnamersquo

bull computer namebull applicationbull topicbull item

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 104

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 105

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 106

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 107

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 108

Excel Macros

bull ldquoRequestrdquo Macro to read values

bull ldquoPokerdquo Macro to write values

bull A Sample Excel Macro

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 109

Sub PokeMacro()MsgBox ApplicationNetworkTemplatesPathChannel = ApplicationDDEInitiate(app=brad_s_carlbergVIEW topic=Tagname) This opens a DDE channel to ViewApplicationDDEPoke Channel Temperature1 Worksheets(Sheet1)Range(A1) Puts value from R1C1 into Temperature1ApplicationDDEPoke Channel DDEReal Worksheets(Sheet1)Range(A2) Puts value from R1C1 into Temperature1ApplicationDDEPoke Channel DDEInteger Worksheets(Sheet1)Range(A3) Puts value from R1C1 into Temperature1ApplicationDDETerminate Channel This terminates the DDE channelEnd SubSub RequestMacro()Channel = ApplicationDDEInitiate(app=brad_s_carlbergVIEW topic=Tagname) This opens a DDE channel to ViewWorksheets(Sheet1)Range(C4) = ApplicationDDERequest(Channel $Hour)Worksheets(Sheet1)Range(C5) = ApplicationDDERequest(Channel $Minute)Worksheets(Sheet1)Range(C6) = ApplicationDDERequest(Channel $Second)Worksheets(Sheet1)Range(C9) = ApplicationDDERequest(Channel $day)Worksheets(Sheet1)Range(C10) = ApplicationDDERequest(Channel $date)Worksheets(Sheet1)Range(C11) = ApplicationDDERequest(Channel $datestring)Worksheets(Sheet1)Range(C12) = ApplicationDDERequest(Channel $datetime)Worksheets(Sheet1)Range(C13) = ApplicationDDERequest(Channel $date)Worksheets(Sheet1)Range(C14) = ApplicationDDERequest(Channel $month)Worksheets(Sheet1)Range(C15) = ApplicationDDERequest(Channel $year)Worksheets(Sheet1)Range(C16) = ApplicationDDERequest(Channel $time)Worksheets(Sheet1)Range(C17) = ApplicationDDERequest(Channel $timestring)Worksheets(Sheet1)Range(C18) = ApplicationDDERequest(Channel $applicationversion)Worksheets(Sheet1)Range(C19) = ApplicationDDERequest(Channel $startddeconversations)Worksheets(Sheet1)Range(C20) = ApplicationDDERequest(Channel $accesslevel)Worksheets(Sheet1)Range(C21) = ApplicationDDERequest(Channel $alarmlogging)Worksheets(Sheet1)Range(C22) = ApplicationDDERequest(Channel $applicationchanged)Worksheets(Sheet1)Range(C23) = ApplicationDDERequest(Channel $configureusers)Worksheets(Sheet1)Range(C24) = ApplicationDDERequest(Channel $changepassword)Worksheets(Sheet1)Range(C25) = ApplicationDDERequest(Channel $InactivityTimeout)Worksheets(Sheet1)Range(C26) = ApplicationDDERequest(Channel $InactivityWarning)Worksheets(Sheet1)Range(C27) = ApplicationDDERequest(Channel $LogicRunning)Worksheets(Sheet1)Range(C28) = ApplicationDDERequest(Channel $OperatorEntered)Worksheets(Sheet1)Range(C29) = ApplicationDDERequest(Channel $Operator)Worksheets(Sheet1)Range(C30) = ApplicationDDERequest(Channel $PasswordEntered)ApplicationDDETerminate Channel This terminates the DDE channelEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 110

Visual Basic

ldquoRoll Your Ownrdquo HMI - Much More powerful than Excel

Key Parameters computer nameapplication|topicitem

IO Emulator - MBPlusSimulateexe

Can ldquoRead Fromrdquo amp ldquoWrite Tordquo PLC andor HMI

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 111

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 112

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 113

Dim PauseTime Start Finish TotalTime As Integer Declare variables

Private Sub txtAIT_332A_SCALED_Change()On Error GoTo PokeAIT_332AErrortxtAIT_332A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtAIT_332A_SCALEDText = Int((3 Rnd) + 20) Generate random value between 20 and 23txtAIT_332A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtAIT_332A_SCALEDLinkItem = AIT_332A_SCALEDtxtAIT_332A_SCALEDLinkMode = 2txtAIT_332A_SCALEDLinkPoketxtAIT_332A_SCALEDLinkMode = 0 DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total time

PokeAIT_332AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtAIT_332A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 114

Private Sub txtAIT_346A_SCALED_Change()On Error GoTo PokeAIT_346AErrortxtAIT_346A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtAIT_346A_SCALEDText = Int((3 Rnd) + 15) Generate random value between 15 and 18txtAIT_346A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtAIT_346A_SCALEDLinkItem = AIT_346A_SCALEDtxtAIT_346A_SCALEDLinkMode = 2txtAIT_346A_SCALEDLinkPoketxtAIT_346A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeAIT_346AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtAIT_346A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 115

Private Sub txtFIT_321A_SCALED_Change()On Error GoTo PokeFIT_321AErrortxtFIT_321A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtFIT_321A_SCALEDText = Int((10 Rnd) + 120) Generate random value between 120 and 130txtFIT_321A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_321A_SCALEDLinkItem = FIT_321A_SCALEDtxtFIT_321A_SCALEDLinkMode = 2txtFIT_321A_SCALEDLinkPoketxtFIT_321A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total time

PokeFIT_321AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_321A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume Next

End Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 116

Private Sub txtFIT_341A_SCALED_Change()On Error GoTo PokeFIT_341AErrortxtFIT_341A_SCALEDLinkMode = 0 PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTime

txtFIT_341A_SCALEDText = Int((3 Rnd) + 18) Generate random value between 18 and 21

txtFIT_341A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_341A_SCALEDLinkItem = FIT_341A_SCALEDtxtFIT_341A_SCALEDLinkMode = 2txtFIT_341A_SCALEDLinkPoketxtFIT_341A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeFIT_341AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_341A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 117

Private Sub txtFIT_343A_SCALED_Change()On Error GoTo PokeFIT_343AErrortxtFIT_343A_SCALEDLinkMode = 0 PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTime

txtFIT_343A_SCALEDText = Int((1 Rnd) + 3) Generate random value between 3 and 4

txtFIT_343A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_343A_SCALEDLinkItem = FIT_343A_SCALEDtxtFIT_343A_SCALEDLinkMode = 2txtFIT_343A_SCALEDLinkPoketxtFIT_343A_SCALEDLinkMode = 0 DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeFIT_343AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_343A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 118

TUTORIAL

Part 4

Questions

amp

Answers

  • Slide 1
  • Slide 2
  • Slide 3
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Slide 8
  • Slide 9
  • Slide 10
  • Slide 11
  • Slide 12
  • Slide 13
  • Slide 14
  • Slide 15
  • Slide 16
  • Slide 17
  • Slide 18
  • Slide 19
  • Slide 20
  • Slide 21
  • Slide 22
  • Slide 23
  • Slide 24
  • Slide 25
  • Slide 26
  • Slide 27
  • Slide 28
  • Slide 29
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
  • Slide 34
  • Slide 35
  • Slide 36
  • Slide 37
  • Slide 38
  • Slide 39
  • Slide 40
  • Slide 41
  • Slide 42
  • Slide 43
  • Slide 44
  • Slide 45
  • Slide 46
  • Slide 47
  • Slide 48
  • Slide 49
  • Slide 50
  • Slide 51
  • Slide 52
  • Slide 53
  • Slide 54
  • Slide 55
  • Slide 56
  • Slide 57
  • Slide 58
  • Slide 59
  • Slide 60
  • Slide 61
  • Slide 62
  • Slide 63
  • Slide 64
  • Slide 65
  • Slide 66
  • Slide 67
  • Slide 68
  • Slide 69
  • Slide 70
  • Slide 71
  • Slide 72
  • Slide 73
  • Slide 74
  • Slide 75
  • Slide 76
  • Slide 77
  • Slide 78
  • Slide 79
  • Slide 80
  • Slide 81
  • Slide 82
  • Slide 83
  • Slide 84
  • Slide 85
  • Slide 86
  • Slide 87
  • Slide 88
  • Slide 89
  • Slide 90
  • Slide 91
  • Slide 92
  • Slide 93
  • Slide 94
  • Slide 95
  • Slide 96
  • Slide 97
  • Slide 98
  • Slide 99
  • Slide 100
  • Slide 101
  • Slide 102
  • Slide 103
  • Slide 104
  • Slide 105
  • Slide 106
  • Slide 107
  • Slide 108
  • Slide 109
  • Slide 110
  • Slide 111
  • Slide 112
  • Slide 113
  • Slide 114
  • Slide 115
  • Slide 116
  • Slide 117
  • Slide 118
Page 87: TUTORIAL Ethernet PLC's Improve Oxygen Consumption ISA Expo/2001Houston, Texas Water & Wastewater Industry DivisionTuesday, September 11, 2001 1 Brad.

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 87

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 88

Indirect Tags

ldquoIndirect Tagsrdquo were used here to minimize the number of popup displays

This is especially useful in HMIrsquos with many tags

ONLY 12 popup displays are reused throughout the HMI

This gives the HMI a ldquoDCS-Likerdquo Look amp Feel

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 89

Popup Display TypesThe tag point type determines which popup display to use

Analog InputHIC (or Analog Output)PID (or Analog Composite)

bull PID WITH AUTO amp CASCADE amp RATIObull PID WITH AUTO amp RATIO

Diginbull Motor Status

DigOutMotor (or Digital Composite)

bull Motor with ILock and PermNumericSet TimersAlarm DetailAlarm Tags

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 90

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 91

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 92

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 93

Bars Buttons amp Sliders

By choosing to use indirect tags we complicate the Bar Graphs Buttons amp Sliders in the popup displays

Different scales need to be used for different engineering unit ranges

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 94

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 95

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 96

Popup Displays

The next two pages shows how the individual popup displays use the indirect tags

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 97

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 98

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 99

Adding a ldquoTouch Targetrdquo to a Display

2 Tell which tags to use

3 Tell which popup display to call upWhat kind of point type is it

3 Steps1 Tell which scale to use (if itrsquos an analog point type)

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 100

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 101

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 102

TUTORIAL

Part 2C

Excel Spreadsheets

amp

Visual Basic

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 103

A ldquoCHEAP amp DIRTYrdquo HMI With Excel

The 4 key parameters are

To communicate with the PLCUse brad_s_carlbergmbenet|ANOXIC_OXICrsquoplcregisterrsquo

Excel uses ldquopeeksrdquo amp ldquopokesrdquo to read from amp write to a PLC or HMI

To communicate with the HMIbrad_s_carlbergview|Tagnamersquotagnamersquo

bull computer namebull applicationbull topicbull item

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 104

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 105

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 106

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 107

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 108

Excel Macros

bull ldquoRequestrdquo Macro to read values

bull ldquoPokerdquo Macro to write values

bull A Sample Excel Macro

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 109

Sub PokeMacro()MsgBox ApplicationNetworkTemplatesPathChannel = ApplicationDDEInitiate(app=brad_s_carlbergVIEW topic=Tagname) This opens a DDE channel to ViewApplicationDDEPoke Channel Temperature1 Worksheets(Sheet1)Range(A1) Puts value from R1C1 into Temperature1ApplicationDDEPoke Channel DDEReal Worksheets(Sheet1)Range(A2) Puts value from R1C1 into Temperature1ApplicationDDEPoke Channel DDEInteger Worksheets(Sheet1)Range(A3) Puts value from R1C1 into Temperature1ApplicationDDETerminate Channel This terminates the DDE channelEnd SubSub RequestMacro()Channel = ApplicationDDEInitiate(app=brad_s_carlbergVIEW topic=Tagname) This opens a DDE channel to ViewWorksheets(Sheet1)Range(C4) = ApplicationDDERequest(Channel $Hour)Worksheets(Sheet1)Range(C5) = ApplicationDDERequest(Channel $Minute)Worksheets(Sheet1)Range(C6) = ApplicationDDERequest(Channel $Second)Worksheets(Sheet1)Range(C9) = ApplicationDDERequest(Channel $day)Worksheets(Sheet1)Range(C10) = ApplicationDDERequest(Channel $date)Worksheets(Sheet1)Range(C11) = ApplicationDDERequest(Channel $datestring)Worksheets(Sheet1)Range(C12) = ApplicationDDERequest(Channel $datetime)Worksheets(Sheet1)Range(C13) = ApplicationDDERequest(Channel $date)Worksheets(Sheet1)Range(C14) = ApplicationDDERequest(Channel $month)Worksheets(Sheet1)Range(C15) = ApplicationDDERequest(Channel $year)Worksheets(Sheet1)Range(C16) = ApplicationDDERequest(Channel $time)Worksheets(Sheet1)Range(C17) = ApplicationDDERequest(Channel $timestring)Worksheets(Sheet1)Range(C18) = ApplicationDDERequest(Channel $applicationversion)Worksheets(Sheet1)Range(C19) = ApplicationDDERequest(Channel $startddeconversations)Worksheets(Sheet1)Range(C20) = ApplicationDDERequest(Channel $accesslevel)Worksheets(Sheet1)Range(C21) = ApplicationDDERequest(Channel $alarmlogging)Worksheets(Sheet1)Range(C22) = ApplicationDDERequest(Channel $applicationchanged)Worksheets(Sheet1)Range(C23) = ApplicationDDERequest(Channel $configureusers)Worksheets(Sheet1)Range(C24) = ApplicationDDERequest(Channel $changepassword)Worksheets(Sheet1)Range(C25) = ApplicationDDERequest(Channel $InactivityTimeout)Worksheets(Sheet1)Range(C26) = ApplicationDDERequest(Channel $InactivityWarning)Worksheets(Sheet1)Range(C27) = ApplicationDDERequest(Channel $LogicRunning)Worksheets(Sheet1)Range(C28) = ApplicationDDERequest(Channel $OperatorEntered)Worksheets(Sheet1)Range(C29) = ApplicationDDERequest(Channel $Operator)Worksheets(Sheet1)Range(C30) = ApplicationDDERequest(Channel $PasswordEntered)ApplicationDDETerminate Channel This terminates the DDE channelEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 110

Visual Basic

ldquoRoll Your Ownrdquo HMI - Much More powerful than Excel

Key Parameters computer nameapplication|topicitem

IO Emulator - MBPlusSimulateexe

Can ldquoRead Fromrdquo amp ldquoWrite Tordquo PLC andor HMI

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 111

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 112

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 113

Dim PauseTime Start Finish TotalTime As Integer Declare variables

Private Sub txtAIT_332A_SCALED_Change()On Error GoTo PokeAIT_332AErrortxtAIT_332A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtAIT_332A_SCALEDText = Int((3 Rnd) + 20) Generate random value between 20 and 23txtAIT_332A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtAIT_332A_SCALEDLinkItem = AIT_332A_SCALEDtxtAIT_332A_SCALEDLinkMode = 2txtAIT_332A_SCALEDLinkPoketxtAIT_332A_SCALEDLinkMode = 0 DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total time

PokeAIT_332AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtAIT_332A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 114

Private Sub txtAIT_346A_SCALED_Change()On Error GoTo PokeAIT_346AErrortxtAIT_346A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtAIT_346A_SCALEDText = Int((3 Rnd) + 15) Generate random value between 15 and 18txtAIT_346A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtAIT_346A_SCALEDLinkItem = AIT_346A_SCALEDtxtAIT_346A_SCALEDLinkMode = 2txtAIT_346A_SCALEDLinkPoketxtAIT_346A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeAIT_346AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtAIT_346A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 115

Private Sub txtFIT_321A_SCALED_Change()On Error GoTo PokeFIT_321AErrortxtFIT_321A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtFIT_321A_SCALEDText = Int((10 Rnd) + 120) Generate random value between 120 and 130txtFIT_321A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_321A_SCALEDLinkItem = FIT_321A_SCALEDtxtFIT_321A_SCALEDLinkMode = 2txtFIT_321A_SCALEDLinkPoketxtFIT_321A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total time

PokeFIT_321AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_321A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume Next

End Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 116

Private Sub txtFIT_341A_SCALED_Change()On Error GoTo PokeFIT_341AErrortxtFIT_341A_SCALEDLinkMode = 0 PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTime

txtFIT_341A_SCALEDText = Int((3 Rnd) + 18) Generate random value between 18 and 21

txtFIT_341A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_341A_SCALEDLinkItem = FIT_341A_SCALEDtxtFIT_341A_SCALEDLinkMode = 2txtFIT_341A_SCALEDLinkPoketxtFIT_341A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeFIT_341AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_341A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 117

Private Sub txtFIT_343A_SCALED_Change()On Error GoTo PokeFIT_343AErrortxtFIT_343A_SCALEDLinkMode = 0 PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTime

txtFIT_343A_SCALEDText = Int((1 Rnd) + 3) Generate random value between 3 and 4

txtFIT_343A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_343A_SCALEDLinkItem = FIT_343A_SCALEDtxtFIT_343A_SCALEDLinkMode = 2txtFIT_343A_SCALEDLinkPoketxtFIT_343A_SCALEDLinkMode = 0 DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeFIT_343AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_343A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 118

TUTORIAL

Part 4

Questions

amp

Answers

  • Slide 1
  • Slide 2
  • Slide 3
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Slide 8
  • Slide 9
  • Slide 10
  • Slide 11
  • Slide 12
  • Slide 13
  • Slide 14
  • Slide 15
  • Slide 16
  • Slide 17
  • Slide 18
  • Slide 19
  • Slide 20
  • Slide 21
  • Slide 22
  • Slide 23
  • Slide 24
  • Slide 25
  • Slide 26
  • Slide 27
  • Slide 28
  • Slide 29
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
  • Slide 34
  • Slide 35
  • Slide 36
  • Slide 37
  • Slide 38
  • Slide 39
  • Slide 40
  • Slide 41
  • Slide 42
  • Slide 43
  • Slide 44
  • Slide 45
  • Slide 46
  • Slide 47
  • Slide 48
  • Slide 49
  • Slide 50
  • Slide 51
  • Slide 52
  • Slide 53
  • Slide 54
  • Slide 55
  • Slide 56
  • Slide 57
  • Slide 58
  • Slide 59
  • Slide 60
  • Slide 61
  • Slide 62
  • Slide 63
  • Slide 64
  • Slide 65
  • Slide 66
  • Slide 67
  • Slide 68
  • Slide 69
  • Slide 70
  • Slide 71
  • Slide 72
  • Slide 73
  • Slide 74
  • Slide 75
  • Slide 76
  • Slide 77
  • Slide 78
  • Slide 79
  • Slide 80
  • Slide 81
  • Slide 82
  • Slide 83
  • Slide 84
  • Slide 85
  • Slide 86
  • Slide 87
  • Slide 88
  • Slide 89
  • Slide 90
  • Slide 91
  • Slide 92
  • Slide 93
  • Slide 94
  • Slide 95
  • Slide 96
  • Slide 97
  • Slide 98
  • Slide 99
  • Slide 100
  • Slide 101
  • Slide 102
  • Slide 103
  • Slide 104
  • Slide 105
  • Slide 106
  • Slide 107
  • Slide 108
  • Slide 109
  • Slide 110
  • Slide 111
  • Slide 112
  • Slide 113
  • Slide 114
  • Slide 115
  • Slide 116
  • Slide 117
  • Slide 118
Page 88: TUTORIAL Ethernet PLC's Improve Oxygen Consumption ISA Expo/2001Houston, Texas Water & Wastewater Industry DivisionTuesday, September 11, 2001 1 Brad.

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 88

Indirect Tags

ldquoIndirect Tagsrdquo were used here to minimize the number of popup displays

This is especially useful in HMIrsquos with many tags

ONLY 12 popup displays are reused throughout the HMI

This gives the HMI a ldquoDCS-Likerdquo Look amp Feel

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 89

Popup Display TypesThe tag point type determines which popup display to use

Analog InputHIC (or Analog Output)PID (or Analog Composite)

bull PID WITH AUTO amp CASCADE amp RATIObull PID WITH AUTO amp RATIO

Diginbull Motor Status

DigOutMotor (or Digital Composite)

bull Motor with ILock and PermNumericSet TimersAlarm DetailAlarm Tags

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 90

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 91

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 92

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 93

Bars Buttons amp Sliders

By choosing to use indirect tags we complicate the Bar Graphs Buttons amp Sliders in the popup displays

Different scales need to be used for different engineering unit ranges

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 94

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 95

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 96

Popup Displays

The next two pages shows how the individual popup displays use the indirect tags

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 97

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 98

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 99

Adding a ldquoTouch Targetrdquo to a Display

2 Tell which tags to use

3 Tell which popup display to call upWhat kind of point type is it

3 Steps1 Tell which scale to use (if itrsquos an analog point type)

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 100

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 101

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 102

TUTORIAL

Part 2C

Excel Spreadsheets

amp

Visual Basic

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 103

A ldquoCHEAP amp DIRTYrdquo HMI With Excel

The 4 key parameters are

To communicate with the PLCUse brad_s_carlbergmbenet|ANOXIC_OXICrsquoplcregisterrsquo

Excel uses ldquopeeksrdquo amp ldquopokesrdquo to read from amp write to a PLC or HMI

To communicate with the HMIbrad_s_carlbergview|Tagnamersquotagnamersquo

bull computer namebull applicationbull topicbull item

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 104

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 105

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 106

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 107

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 108

Excel Macros

bull ldquoRequestrdquo Macro to read values

bull ldquoPokerdquo Macro to write values

bull A Sample Excel Macro

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 109

Sub PokeMacro()MsgBox ApplicationNetworkTemplatesPathChannel = ApplicationDDEInitiate(app=brad_s_carlbergVIEW topic=Tagname) This opens a DDE channel to ViewApplicationDDEPoke Channel Temperature1 Worksheets(Sheet1)Range(A1) Puts value from R1C1 into Temperature1ApplicationDDEPoke Channel DDEReal Worksheets(Sheet1)Range(A2) Puts value from R1C1 into Temperature1ApplicationDDEPoke Channel DDEInteger Worksheets(Sheet1)Range(A3) Puts value from R1C1 into Temperature1ApplicationDDETerminate Channel This terminates the DDE channelEnd SubSub RequestMacro()Channel = ApplicationDDEInitiate(app=brad_s_carlbergVIEW topic=Tagname) This opens a DDE channel to ViewWorksheets(Sheet1)Range(C4) = ApplicationDDERequest(Channel $Hour)Worksheets(Sheet1)Range(C5) = ApplicationDDERequest(Channel $Minute)Worksheets(Sheet1)Range(C6) = ApplicationDDERequest(Channel $Second)Worksheets(Sheet1)Range(C9) = ApplicationDDERequest(Channel $day)Worksheets(Sheet1)Range(C10) = ApplicationDDERequest(Channel $date)Worksheets(Sheet1)Range(C11) = ApplicationDDERequest(Channel $datestring)Worksheets(Sheet1)Range(C12) = ApplicationDDERequest(Channel $datetime)Worksheets(Sheet1)Range(C13) = ApplicationDDERequest(Channel $date)Worksheets(Sheet1)Range(C14) = ApplicationDDERequest(Channel $month)Worksheets(Sheet1)Range(C15) = ApplicationDDERequest(Channel $year)Worksheets(Sheet1)Range(C16) = ApplicationDDERequest(Channel $time)Worksheets(Sheet1)Range(C17) = ApplicationDDERequest(Channel $timestring)Worksheets(Sheet1)Range(C18) = ApplicationDDERequest(Channel $applicationversion)Worksheets(Sheet1)Range(C19) = ApplicationDDERequest(Channel $startddeconversations)Worksheets(Sheet1)Range(C20) = ApplicationDDERequest(Channel $accesslevel)Worksheets(Sheet1)Range(C21) = ApplicationDDERequest(Channel $alarmlogging)Worksheets(Sheet1)Range(C22) = ApplicationDDERequest(Channel $applicationchanged)Worksheets(Sheet1)Range(C23) = ApplicationDDERequest(Channel $configureusers)Worksheets(Sheet1)Range(C24) = ApplicationDDERequest(Channel $changepassword)Worksheets(Sheet1)Range(C25) = ApplicationDDERequest(Channel $InactivityTimeout)Worksheets(Sheet1)Range(C26) = ApplicationDDERequest(Channel $InactivityWarning)Worksheets(Sheet1)Range(C27) = ApplicationDDERequest(Channel $LogicRunning)Worksheets(Sheet1)Range(C28) = ApplicationDDERequest(Channel $OperatorEntered)Worksheets(Sheet1)Range(C29) = ApplicationDDERequest(Channel $Operator)Worksheets(Sheet1)Range(C30) = ApplicationDDERequest(Channel $PasswordEntered)ApplicationDDETerminate Channel This terminates the DDE channelEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 110

Visual Basic

ldquoRoll Your Ownrdquo HMI - Much More powerful than Excel

Key Parameters computer nameapplication|topicitem

IO Emulator - MBPlusSimulateexe

Can ldquoRead Fromrdquo amp ldquoWrite Tordquo PLC andor HMI

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 111

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 112

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 113

Dim PauseTime Start Finish TotalTime As Integer Declare variables

Private Sub txtAIT_332A_SCALED_Change()On Error GoTo PokeAIT_332AErrortxtAIT_332A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtAIT_332A_SCALEDText = Int((3 Rnd) + 20) Generate random value between 20 and 23txtAIT_332A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtAIT_332A_SCALEDLinkItem = AIT_332A_SCALEDtxtAIT_332A_SCALEDLinkMode = 2txtAIT_332A_SCALEDLinkPoketxtAIT_332A_SCALEDLinkMode = 0 DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total time

PokeAIT_332AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtAIT_332A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 114

Private Sub txtAIT_346A_SCALED_Change()On Error GoTo PokeAIT_346AErrortxtAIT_346A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtAIT_346A_SCALEDText = Int((3 Rnd) + 15) Generate random value between 15 and 18txtAIT_346A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtAIT_346A_SCALEDLinkItem = AIT_346A_SCALEDtxtAIT_346A_SCALEDLinkMode = 2txtAIT_346A_SCALEDLinkPoketxtAIT_346A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeAIT_346AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtAIT_346A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 115

Private Sub txtFIT_321A_SCALED_Change()On Error GoTo PokeFIT_321AErrortxtFIT_321A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtFIT_321A_SCALEDText = Int((10 Rnd) + 120) Generate random value between 120 and 130txtFIT_321A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_321A_SCALEDLinkItem = FIT_321A_SCALEDtxtFIT_321A_SCALEDLinkMode = 2txtFIT_321A_SCALEDLinkPoketxtFIT_321A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total time

PokeFIT_321AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_321A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume Next

End Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 116

Private Sub txtFIT_341A_SCALED_Change()On Error GoTo PokeFIT_341AErrortxtFIT_341A_SCALEDLinkMode = 0 PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTime

txtFIT_341A_SCALEDText = Int((3 Rnd) + 18) Generate random value between 18 and 21

txtFIT_341A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_341A_SCALEDLinkItem = FIT_341A_SCALEDtxtFIT_341A_SCALEDLinkMode = 2txtFIT_341A_SCALEDLinkPoketxtFIT_341A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeFIT_341AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_341A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 117

Private Sub txtFIT_343A_SCALED_Change()On Error GoTo PokeFIT_343AErrortxtFIT_343A_SCALEDLinkMode = 0 PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTime

txtFIT_343A_SCALEDText = Int((1 Rnd) + 3) Generate random value between 3 and 4

txtFIT_343A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_343A_SCALEDLinkItem = FIT_343A_SCALEDtxtFIT_343A_SCALEDLinkMode = 2txtFIT_343A_SCALEDLinkPoketxtFIT_343A_SCALEDLinkMode = 0 DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeFIT_343AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_343A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 118

TUTORIAL

Part 4

Questions

amp

Answers

  • Slide 1
  • Slide 2
  • Slide 3
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Slide 8
  • Slide 9
  • Slide 10
  • Slide 11
  • Slide 12
  • Slide 13
  • Slide 14
  • Slide 15
  • Slide 16
  • Slide 17
  • Slide 18
  • Slide 19
  • Slide 20
  • Slide 21
  • Slide 22
  • Slide 23
  • Slide 24
  • Slide 25
  • Slide 26
  • Slide 27
  • Slide 28
  • Slide 29
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
  • Slide 34
  • Slide 35
  • Slide 36
  • Slide 37
  • Slide 38
  • Slide 39
  • Slide 40
  • Slide 41
  • Slide 42
  • Slide 43
  • Slide 44
  • Slide 45
  • Slide 46
  • Slide 47
  • Slide 48
  • Slide 49
  • Slide 50
  • Slide 51
  • Slide 52
  • Slide 53
  • Slide 54
  • Slide 55
  • Slide 56
  • Slide 57
  • Slide 58
  • Slide 59
  • Slide 60
  • Slide 61
  • Slide 62
  • Slide 63
  • Slide 64
  • Slide 65
  • Slide 66
  • Slide 67
  • Slide 68
  • Slide 69
  • Slide 70
  • Slide 71
  • Slide 72
  • Slide 73
  • Slide 74
  • Slide 75
  • Slide 76
  • Slide 77
  • Slide 78
  • Slide 79
  • Slide 80
  • Slide 81
  • Slide 82
  • Slide 83
  • Slide 84
  • Slide 85
  • Slide 86
  • Slide 87
  • Slide 88
  • Slide 89
  • Slide 90
  • Slide 91
  • Slide 92
  • Slide 93
  • Slide 94
  • Slide 95
  • Slide 96
  • Slide 97
  • Slide 98
  • Slide 99
  • Slide 100
  • Slide 101
  • Slide 102
  • Slide 103
  • Slide 104
  • Slide 105
  • Slide 106
  • Slide 107
  • Slide 108
  • Slide 109
  • Slide 110
  • Slide 111
  • Slide 112
  • Slide 113
  • Slide 114
  • Slide 115
  • Slide 116
  • Slide 117
  • Slide 118
Page 89: TUTORIAL Ethernet PLC's Improve Oxygen Consumption ISA Expo/2001Houston, Texas Water & Wastewater Industry DivisionTuesday, September 11, 2001 1 Brad.

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 89

Popup Display TypesThe tag point type determines which popup display to use

Analog InputHIC (or Analog Output)PID (or Analog Composite)

bull PID WITH AUTO amp CASCADE amp RATIObull PID WITH AUTO amp RATIO

Diginbull Motor Status

DigOutMotor (or Digital Composite)

bull Motor with ILock and PermNumericSet TimersAlarm DetailAlarm Tags

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 90

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 91

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 92

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 93

Bars Buttons amp Sliders

By choosing to use indirect tags we complicate the Bar Graphs Buttons amp Sliders in the popup displays

Different scales need to be used for different engineering unit ranges

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 94

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 95

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 96

Popup Displays

The next two pages shows how the individual popup displays use the indirect tags

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 97

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 98

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 99

Adding a ldquoTouch Targetrdquo to a Display

2 Tell which tags to use

3 Tell which popup display to call upWhat kind of point type is it

3 Steps1 Tell which scale to use (if itrsquos an analog point type)

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 100

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 101

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 102

TUTORIAL

Part 2C

Excel Spreadsheets

amp

Visual Basic

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 103

A ldquoCHEAP amp DIRTYrdquo HMI With Excel

The 4 key parameters are

To communicate with the PLCUse brad_s_carlbergmbenet|ANOXIC_OXICrsquoplcregisterrsquo

Excel uses ldquopeeksrdquo amp ldquopokesrdquo to read from amp write to a PLC or HMI

To communicate with the HMIbrad_s_carlbergview|Tagnamersquotagnamersquo

bull computer namebull applicationbull topicbull item

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 104

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 105

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 106

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 107

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 108

Excel Macros

bull ldquoRequestrdquo Macro to read values

bull ldquoPokerdquo Macro to write values

bull A Sample Excel Macro

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 109

Sub PokeMacro()MsgBox ApplicationNetworkTemplatesPathChannel = ApplicationDDEInitiate(app=brad_s_carlbergVIEW topic=Tagname) This opens a DDE channel to ViewApplicationDDEPoke Channel Temperature1 Worksheets(Sheet1)Range(A1) Puts value from R1C1 into Temperature1ApplicationDDEPoke Channel DDEReal Worksheets(Sheet1)Range(A2) Puts value from R1C1 into Temperature1ApplicationDDEPoke Channel DDEInteger Worksheets(Sheet1)Range(A3) Puts value from R1C1 into Temperature1ApplicationDDETerminate Channel This terminates the DDE channelEnd SubSub RequestMacro()Channel = ApplicationDDEInitiate(app=brad_s_carlbergVIEW topic=Tagname) This opens a DDE channel to ViewWorksheets(Sheet1)Range(C4) = ApplicationDDERequest(Channel $Hour)Worksheets(Sheet1)Range(C5) = ApplicationDDERequest(Channel $Minute)Worksheets(Sheet1)Range(C6) = ApplicationDDERequest(Channel $Second)Worksheets(Sheet1)Range(C9) = ApplicationDDERequest(Channel $day)Worksheets(Sheet1)Range(C10) = ApplicationDDERequest(Channel $date)Worksheets(Sheet1)Range(C11) = ApplicationDDERequest(Channel $datestring)Worksheets(Sheet1)Range(C12) = ApplicationDDERequest(Channel $datetime)Worksheets(Sheet1)Range(C13) = ApplicationDDERequest(Channel $date)Worksheets(Sheet1)Range(C14) = ApplicationDDERequest(Channel $month)Worksheets(Sheet1)Range(C15) = ApplicationDDERequest(Channel $year)Worksheets(Sheet1)Range(C16) = ApplicationDDERequest(Channel $time)Worksheets(Sheet1)Range(C17) = ApplicationDDERequest(Channel $timestring)Worksheets(Sheet1)Range(C18) = ApplicationDDERequest(Channel $applicationversion)Worksheets(Sheet1)Range(C19) = ApplicationDDERequest(Channel $startddeconversations)Worksheets(Sheet1)Range(C20) = ApplicationDDERequest(Channel $accesslevel)Worksheets(Sheet1)Range(C21) = ApplicationDDERequest(Channel $alarmlogging)Worksheets(Sheet1)Range(C22) = ApplicationDDERequest(Channel $applicationchanged)Worksheets(Sheet1)Range(C23) = ApplicationDDERequest(Channel $configureusers)Worksheets(Sheet1)Range(C24) = ApplicationDDERequest(Channel $changepassword)Worksheets(Sheet1)Range(C25) = ApplicationDDERequest(Channel $InactivityTimeout)Worksheets(Sheet1)Range(C26) = ApplicationDDERequest(Channel $InactivityWarning)Worksheets(Sheet1)Range(C27) = ApplicationDDERequest(Channel $LogicRunning)Worksheets(Sheet1)Range(C28) = ApplicationDDERequest(Channel $OperatorEntered)Worksheets(Sheet1)Range(C29) = ApplicationDDERequest(Channel $Operator)Worksheets(Sheet1)Range(C30) = ApplicationDDERequest(Channel $PasswordEntered)ApplicationDDETerminate Channel This terminates the DDE channelEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 110

Visual Basic

ldquoRoll Your Ownrdquo HMI - Much More powerful than Excel

Key Parameters computer nameapplication|topicitem

IO Emulator - MBPlusSimulateexe

Can ldquoRead Fromrdquo amp ldquoWrite Tordquo PLC andor HMI

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 111

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 112

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 113

Dim PauseTime Start Finish TotalTime As Integer Declare variables

Private Sub txtAIT_332A_SCALED_Change()On Error GoTo PokeAIT_332AErrortxtAIT_332A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtAIT_332A_SCALEDText = Int((3 Rnd) + 20) Generate random value between 20 and 23txtAIT_332A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtAIT_332A_SCALEDLinkItem = AIT_332A_SCALEDtxtAIT_332A_SCALEDLinkMode = 2txtAIT_332A_SCALEDLinkPoketxtAIT_332A_SCALEDLinkMode = 0 DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total time

PokeAIT_332AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtAIT_332A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 114

Private Sub txtAIT_346A_SCALED_Change()On Error GoTo PokeAIT_346AErrortxtAIT_346A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtAIT_346A_SCALEDText = Int((3 Rnd) + 15) Generate random value between 15 and 18txtAIT_346A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtAIT_346A_SCALEDLinkItem = AIT_346A_SCALEDtxtAIT_346A_SCALEDLinkMode = 2txtAIT_346A_SCALEDLinkPoketxtAIT_346A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeAIT_346AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtAIT_346A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 115

Private Sub txtFIT_321A_SCALED_Change()On Error GoTo PokeFIT_321AErrortxtFIT_321A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtFIT_321A_SCALEDText = Int((10 Rnd) + 120) Generate random value between 120 and 130txtFIT_321A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_321A_SCALEDLinkItem = FIT_321A_SCALEDtxtFIT_321A_SCALEDLinkMode = 2txtFIT_321A_SCALEDLinkPoketxtFIT_321A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total time

PokeFIT_321AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_321A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume Next

End Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 116

Private Sub txtFIT_341A_SCALED_Change()On Error GoTo PokeFIT_341AErrortxtFIT_341A_SCALEDLinkMode = 0 PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTime

txtFIT_341A_SCALEDText = Int((3 Rnd) + 18) Generate random value between 18 and 21

txtFIT_341A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_341A_SCALEDLinkItem = FIT_341A_SCALEDtxtFIT_341A_SCALEDLinkMode = 2txtFIT_341A_SCALEDLinkPoketxtFIT_341A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeFIT_341AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_341A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 117

Private Sub txtFIT_343A_SCALED_Change()On Error GoTo PokeFIT_343AErrortxtFIT_343A_SCALEDLinkMode = 0 PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTime

txtFIT_343A_SCALEDText = Int((1 Rnd) + 3) Generate random value between 3 and 4

txtFIT_343A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_343A_SCALEDLinkItem = FIT_343A_SCALEDtxtFIT_343A_SCALEDLinkMode = 2txtFIT_343A_SCALEDLinkPoketxtFIT_343A_SCALEDLinkMode = 0 DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeFIT_343AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_343A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 118

TUTORIAL

Part 4

Questions

amp

Answers

  • Slide 1
  • Slide 2
  • Slide 3
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Slide 8
  • Slide 9
  • Slide 10
  • Slide 11
  • Slide 12
  • Slide 13
  • Slide 14
  • Slide 15
  • Slide 16
  • Slide 17
  • Slide 18
  • Slide 19
  • Slide 20
  • Slide 21
  • Slide 22
  • Slide 23
  • Slide 24
  • Slide 25
  • Slide 26
  • Slide 27
  • Slide 28
  • Slide 29
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
  • Slide 34
  • Slide 35
  • Slide 36
  • Slide 37
  • Slide 38
  • Slide 39
  • Slide 40
  • Slide 41
  • Slide 42
  • Slide 43
  • Slide 44
  • Slide 45
  • Slide 46
  • Slide 47
  • Slide 48
  • Slide 49
  • Slide 50
  • Slide 51
  • Slide 52
  • Slide 53
  • Slide 54
  • Slide 55
  • Slide 56
  • Slide 57
  • Slide 58
  • Slide 59
  • Slide 60
  • Slide 61
  • Slide 62
  • Slide 63
  • Slide 64
  • Slide 65
  • Slide 66
  • Slide 67
  • Slide 68
  • Slide 69
  • Slide 70
  • Slide 71
  • Slide 72
  • Slide 73
  • Slide 74
  • Slide 75
  • Slide 76
  • Slide 77
  • Slide 78
  • Slide 79
  • Slide 80
  • Slide 81
  • Slide 82
  • Slide 83
  • Slide 84
  • Slide 85
  • Slide 86
  • Slide 87
  • Slide 88
  • Slide 89
  • Slide 90
  • Slide 91
  • Slide 92
  • Slide 93
  • Slide 94
  • Slide 95
  • Slide 96
  • Slide 97
  • Slide 98
  • Slide 99
  • Slide 100
  • Slide 101
  • Slide 102
  • Slide 103
  • Slide 104
  • Slide 105
  • Slide 106
  • Slide 107
  • Slide 108
  • Slide 109
  • Slide 110
  • Slide 111
  • Slide 112
  • Slide 113
  • Slide 114
  • Slide 115
  • Slide 116
  • Slide 117
  • Slide 118
Page 90: TUTORIAL Ethernet PLC's Improve Oxygen Consumption ISA Expo/2001Houston, Texas Water & Wastewater Industry DivisionTuesday, September 11, 2001 1 Brad.

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 90

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 91

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 92

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 93

Bars Buttons amp Sliders

By choosing to use indirect tags we complicate the Bar Graphs Buttons amp Sliders in the popup displays

Different scales need to be used for different engineering unit ranges

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 94

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 95

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 96

Popup Displays

The next two pages shows how the individual popup displays use the indirect tags

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 97

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 98

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 99

Adding a ldquoTouch Targetrdquo to a Display

2 Tell which tags to use

3 Tell which popup display to call upWhat kind of point type is it

3 Steps1 Tell which scale to use (if itrsquos an analog point type)

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 100

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 101

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 102

TUTORIAL

Part 2C

Excel Spreadsheets

amp

Visual Basic

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 103

A ldquoCHEAP amp DIRTYrdquo HMI With Excel

The 4 key parameters are

To communicate with the PLCUse brad_s_carlbergmbenet|ANOXIC_OXICrsquoplcregisterrsquo

Excel uses ldquopeeksrdquo amp ldquopokesrdquo to read from amp write to a PLC or HMI

To communicate with the HMIbrad_s_carlbergview|Tagnamersquotagnamersquo

bull computer namebull applicationbull topicbull item

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 104

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 105

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 106

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 107

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 108

Excel Macros

bull ldquoRequestrdquo Macro to read values

bull ldquoPokerdquo Macro to write values

bull A Sample Excel Macro

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 109

Sub PokeMacro()MsgBox ApplicationNetworkTemplatesPathChannel = ApplicationDDEInitiate(app=brad_s_carlbergVIEW topic=Tagname) This opens a DDE channel to ViewApplicationDDEPoke Channel Temperature1 Worksheets(Sheet1)Range(A1) Puts value from R1C1 into Temperature1ApplicationDDEPoke Channel DDEReal Worksheets(Sheet1)Range(A2) Puts value from R1C1 into Temperature1ApplicationDDEPoke Channel DDEInteger Worksheets(Sheet1)Range(A3) Puts value from R1C1 into Temperature1ApplicationDDETerminate Channel This terminates the DDE channelEnd SubSub RequestMacro()Channel = ApplicationDDEInitiate(app=brad_s_carlbergVIEW topic=Tagname) This opens a DDE channel to ViewWorksheets(Sheet1)Range(C4) = ApplicationDDERequest(Channel $Hour)Worksheets(Sheet1)Range(C5) = ApplicationDDERequest(Channel $Minute)Worksheets(Sheet1)Range(C6) = ApplicationDDERequest(Channel $Second)Worksheets(Sheet1)Range(C9) = ApplicationDDERequest(Channel $day)Worksheets(Sheet1)Range(C10) = ApplicationDDERequest(Channel $date)Worksheets(Sheet1)Range(C11) = ApplicationDDERequest(Channel $datestring)Worksheets(Sheet1)Range(C12) = ApplicationDDERequest(Channel $datetime)Worksheets(Sheet1)Range(C13) = ApplicationDDERequest(Channel $date)Worksheets(Sheet1)Range(C14) = ApplicationDDERequest(Channel $month)Worksheets(Sheet1)Range(C15) = ApplicationDDERequest(Channel $year)Worksheets(Sheet1)Range(C16) = ApplicationDDERequest(Channel $time)Worksheets(Sheet1)Range(C17) = ApplicationDDERequest(Channel $timestring)Worksheets(Sheet1)Range(C18) = ApplicationDDERequest(Channel $applicationversion)Worksheets(Sheet1)Range(C19) = ApplicationDDERequest(Channel $startddeconversations)Worksheets(Sheet1)Range(C20) = ApplicationDDERequest(Channel $accesslevel)Worksheets(Sheet1)Range(C21) = ApplicationDDERequest(Channel $alarmlogging)Worksheets(Sheet1)Range(C22) = ApplicationDDERequest(Channel $applicationchanged)Worksheets(Sheet1)Range(C23) = ApplicationDDERequest(Channel $configureusers)Worksheets(Sheet1)Range(C24) = ApplicationDDERequest(Channel $changepassword)Worksheets(Sheet1)Range(C25) = ApplicationDDERequest(Channel $InactivityTimeout)Worksheets(Sheet1)Range(C26) = ApplicationDDERequest(Channel $InactivityWarning)Worksheets(Sheet1)Range(C27) = ApplicationDDERequest(Channel $LogicRunning)Worksheets(Sheet1)Range(C28) = ApplicationDDERequest(Channel $OperatorEntered)Worksheets(Sheet1)Range(C29) = ApplicationDDERequest(Channel $Operator)Worksheets(Sheet1)Range(C30) = ApplicationDDERequest(Channel $PasswordEntered)ApplicationDDETerminate Channel This terminates the DDE channelEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 110

Visual Basic

ldquoRoll Your Ownrdquo HMI - Much More powerful than Excel

Key Parameters computer nameapplication|topicitem

IO Emulator - MBPlusSimulateexe

Can ldquoRead Fromrdquo amp ldquoWrite Tordquo PLC andor HMI

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 111

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 112

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 113

Dim PauseTime Start Finish TotalTime As Integer Declare variables

Private Sub txtAIT_332A_SCALED_Change()On Error GoTo PokeAIT_332AErrortxtAIT_332A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtAIT_332A_SCALEDText = Int((3 Rnd) + 20) Generate random value between 20 and 23txtAIT_332A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtAIT_332A_SCALEDLinkItem = AIT_332A_SCALEDtxtAIT_332A_SCALEDLinkMode = 2txtAIT_332A_SCALEDLinkPoketxtAIT_332A_SCALEDLinkMode = 0 DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total time

PokeAIT_332AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtAIT_332A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 114

Private Sub txtAIT_346A_SCALED_Change()On Error GoTo PokeAIT_346AErrortxtAIT_346A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtAIT_346A_SCALEDText = Int((3 Rnd) + 15) Generate random value between 15 and 18txtAIT_346A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtAIT_346A_SCALEDLinkItem = AIT_346A_SCALEDtxtAIT_346A_SCALEDLinkMode = 2txtAIT_346A_SCALEDLinkPoketxtAIT_346A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeAIT_346AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtAIT_346A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 115

Private Sub txtFIT_321A_SCALED_Change()On Error GoTo PokeFIT_321AErrortxtFIT_321A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtFIT_321A_SCALEDText = Int((10 Rnd) + 120) Generate random value between 120 and 130txtFIT_321A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_321A_SCALEDLinkItem = FIT_321A_SCALEDtxtFIT_321A_SCALEDLinkMode = 2txtFIT_321A_SCALEDLinkPoketxtFIT_321A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total time

PokeFIT_321AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_321A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume Next

End Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 116

Private Sub txtFIT_341A_SCALED_Change()On Error GoTo PokeFIT_341AErrortxtFIT_341A_SCALEDLinkMode = 0 PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTime

txtFIT_341A_SCALEDText = Int((3 Rnd) + 18) Generate random value between 18 and 21

txtFIT_341A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_341A_SCALEDLinkItem = FIT_341A_SCALEDtxtFIT_341A_SCALEDLinkMode = 2txtFIT_341A_SCALEDLinkPoketxtFIT_341A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeFIT_341AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_341A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 117

Private Sub txtFIT_343A_SCALED_Change()On Error GoTo PokeFIT_343AErrortxtFIT_343A_SCALEDLinkMode = 0 PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTime

txtFIT_343A_SCALEDText = Int((1 Rnd) + 3) Generate random value between 3 and 4

txtFIT_343A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_343A_SCALEDLinkItem = FIT_343A_SCALEDtxtFIT_343A_SCALEDLinkMode = 2txtFIT_343A_SCALEDLinkPoketxtFIT_343A_SCALEDLinkMode = 0 DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeFIT_343AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_343A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 118

TUTORIAL

Part 4

Questions

amp

Answers

  • Slide 1
  • Slide 2
  • Slide 3
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Slide 8
  • Slide 9
  • Slide 10
  • Slide 11
  • Slide 12
  • Slide 13
  • Slide 14
  • Slide 15
  • Slide 16
  • Slide 17
  • Slide 18
  • Slide 19
  • Slide 20
  • Slide 21
  • Slide 22
  • Slide 23
  • Slide 24
  • Slide 25
  • Slide 26
  • Slide 27
  • Slide 28
  • Slide 29
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
  • Slide 34
  • Slide 35
  • Slide 36
  • Slide 37
  • Slide 38
  • Slide 39
  • Slide 40
  • Slide 41
  • Slide 42
  • Slide 43
  • Slide 44
  • Slide 45
  • Slide 46
  • Slide 47
  • Slide 48
  • Slide 49
  • Slide 50
  • Slide 51
  • Slide 52
  • Slide 53
  • Slide 54
  • Slide 55
  • Slide 56
  • Slide 57
  • Slide 58
  • Slide 59
  • Slide 60
  • Slide 61
  • Slide 62
  • Slide 63
  • Slide 64
  • Slide 65
  • Slide 66
  • Slide 67
  • Slide 68
  • Slide 69
  • Slide 70
  • Slide 71
  • Slide 72
  • Slide 73
  • Slide 74
  • Slide 75
  • Slide 76
  • Slide 77
  • Slide 78
  • Slide 79
  • Slide 80
  • Slide 81
  • Slide 82
  • Slide 83
  • Slide 84
  • Slide 85
  • Slide 86
  • Slide 87
  • Slide 88
  • Slide 89
  • Slide 90
  • Slide 91
  • Slide 92
  • Slide 93
  • Slide 94
  • Slide 95
  • Slide 96
  • Slide 97
  • Slide 98
  • Slide 99
  • Slide 100
  • Slide 101
  • Slide 102
  • Slide 103
  • Slide 104
  • Slide 105
  • Slide 106
  • Slide 107
  • Slide 108
  • Slide 109
  • Slide 110
  • Slide 111
  • Slide 112
  • Slide 113
  • Slide 114
  • Slide 115
  • Slide 116
  • Slide 117
  • Slide 118
Page 91: TUTORIAL Ethernet PLC's Improve Oxygen Consumption ISA Expo/2001Houston, Texas Water & Wastewater Industry DivisionTuesday, September 11, 2001 1 Brad.

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 91

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 92

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 93

Bars Buttons amp Sliders

By choosing to use indirect tags we complicate the Bar Graphs Buttons amp Sliders in the popup displays

Different scales need to be used for different engineering unit ranges

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 94

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 95

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 96

Popup Displays

The next two pages shows how the individual popup displays use the indirect tags

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 97

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 98

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 99

Adding a ldquoTouch Targetrdquo to a Display

2 Tell which tags to use

3 Tell which popup display to call upWhat kind of point type is it

3 Steps1 Tell which scale to use (if itrsquos an analog point type)

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 100

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 101

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 102

TUTORIAL

Part 2C

Excel Spreadsheets

amp

Visual Basic

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 103

A ldquoCHEAP amp DIRTYrdquo HMI With Excel

The 4 key parameters are

To communicate with the PLCUse brad_s_carlbergmbenet|ANOXIC_OXICrsquoplcregisterrsquo

Excel uses ldquopeeksrdquo amp ldquopokesrdquo to read from amp write to a PLC or HMI

To communicate with the HMIbrad_s_carlbergview|Tagnamersquotagnamersquo

bull computer namebull applicationbull topicbull item

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 104

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 105

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 106

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 107

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 108

Excel Macros

bull ldquoRequestrdquo Macro to read values

bull ldquoPokerdquo Macro to write values

bull A Sample Excel Macro

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 109

Sub PokeMacro()MsgBox ApplicationNetworkTemplatesPathChannel = ApplicationDDEInitiate(app=brad_s_carlbergVIEW topic=Tagname) This opens a DDE channel to ViewApplicationDDEPoke Channel Temperature1 Worksheets(Sheet1)Range(A1) Puts value from R1C1 into Temperature1ApplicationDDEPoke Channel DDEReal Worksheets(Sheet1)Range(A2) Puts value from R1C1 into Temperature1ApplicationDDEPoke Channel DDEInteger Worksheets(Sheet1)Range(A3) Puts value from R1C1 into Temperature1ApplicationDDETerminate Channel This terminates the DDE channelEnd SubSub RequestMacro()Channel = ApplicationDDEInitiate(app=brad_s_carlbergVIEW topic=Tagname) This opens a DDE channel to ViewWorksheets(Sheet1)Range(C4) = ApplicationDDERequest(Channel $Hour)Worksheets(Sheet1)Range(C5) = ApplicationDDERequest(Channel $Minute)Worksheets(Sheet1)Range(C6) = ApplicationDDERequest(Channel $Second)Worksheets(Sheet1)Range(C9) = ApplicationDDERequest(Channel $day)Worksheets(Sheet1)Range(C10) = ApplicationDDERequest(Channel $date)Worksheets(Sheet1)Range(C11) = ApplicationDDERequest(Channel $datestring)Worksheets(Sheet1)Range(C12) = ApplicationDDERequest(Channel $datetime)Worksheets(Sheet1)Range(C13) = ApplicationDDERequest(Channel $date)Worksheets(Sheet1)Range(C14) = ApplicationDDERequest(Channel $month)Worksheets(Sheet1)Range(C15) = ApplicationDDERequest(Channel $year)Worksheets(Sheet1)Range(C16) = ApplicationDDERequest(Channel $time)Worksheets(Sheet1)Range(C17) = ApplicationDDERequest(Channel $timestring)Worksheets(Sheet1)Range(C18) = ApplicationDDERequest(Channel $applicationversion)Worksheets(Sheet1)Range(C19) = ApplicationDDERequest(Channel $startddeconversations)Worksheets(Sheet1)Range(C20) = ApplicationDDERequest(Channel $accesslevel)Worksheets(Sheet1)Range(C21) = ApplicationDDERequest(Channel $alarmlogging)Worksheets(Sheet1)Range(C22) = ApplicationDDERequest(Channel $applicationchanged)Worksheets(Sheet1)Range(C23) = ApplicationDDERequest(Channel $configureusers)Worksheets(Sheet1)Range(C24) = ApplicationDDERequest(Channel $changepassword)Worksheets(Sheet1)Range(C25) = ApplicationDDERequest(Channel $InactivityTimeout)Worksheets(Sheet1)Range(C26) = ApplicationDDERequest(Channel $InactivityWarning)Worksheets(Sheet1)Range(C27) = ApplicationDDERequest(Channel $LogicRunning)Worksheets(Sheet1)Range(C28) = ApplicationDDERequest(Channel $OperatorEntered)Worksheets(Sheet1)Range(C29) = ApplicationDDERequest(Channel $Operator)Worksheets(Sheet1)Range(C30) = ApplicationDDERequest(Channel $PasswordEntered)ApplicationDDETerminate Channel This terminates the DDE channelEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 110

Visual Basic

ldquoRoll Your Ownrdquo HMI - Much More powerful than Excel

Key Parameters computer nameapplication|topicitem

IO Emulator - MBPlusSimulateexe

Can ldquoRead Fromrdquo amp ldquoWrite Tordquo PLC andor HMI

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 111

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 112

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 113

Dim PauseTime Start Finish TotalTime As Integer Declare variables

Private Sub txtAIT_332A_SCALED_Change()On Error GoTo PokeAIT_332AErrortxtAIT_332A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtAIT_332A_SCALEDText = Int((3 Rnd) + 20) Generate random value between 20 and 23txtAIT_332A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtAIT_332A_SCALEDLinkItem = AIT_332A_SCALEDtxtAIT_332A_SCALEDLinkMode = 2txtAIT_332A_SCALEDLinkPoketxtAIT_332A_SCALEDLinkMode = 0 DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total time

PokeAIT_332AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtAIT_332A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 114

Private Sub txtAIT_346A_SCALED_Change()On Error GoTo PokeAIT_346AErrortxtAIT_346A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtAIT_346A_SCALEDText = Int((3 Rnd) + 15) Generate random value between 15 and 18txtAIT_346A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtAIT_346A_SCALEDLinkItem = AIT_346A_SCALEDtxtAIT_346A_SCALEDLinkMode = 2txtAIT_346A_SCALEDLinkPoketxtAIT_346A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeAIT_346AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtAIT_346A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 115

Private Sub txtFIT_321A_SCALED_Change()On Error GoTo PokeFIT_321AErrortxtFIT_321A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtFIT_321A_SCALEDText = Int((10 Rnd) + 120) Generate random value between 120 and 130txtFIT_321A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_321A_SCALEDLinkItem = FIT_321A_SCALEDtxtFIT_321A_SCALEDLinkMode = 2txtFIT_321A_SCALEDLinkPoketxtFIT_321A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total time

PokeFIT_321AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_321A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume Next

End Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 116

Private Sub txtFIT_341A_SCALED_Change()On Error GoTo PokeFIT_341AErrortxtFIT_341A_SCALEDLinkMode = 0 PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTime

txtFIT_341A_SCALEDText = Int((3 Rnd) + 18) Generate random value between 18 and 21

txtFIT_341A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_341A_SCALEDLinkItem = FIT_341A_SCALEDtxtFIT_341A_SCALEDLinkMode = 2txtFIT_341A_SCALEDLinkPoketxtFIT_341A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeFIT_341AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_341A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 117

Private Sub txtFIT_343A_SCALED_Change()On Error GoTo PokeFIT_343AErrortxtFIT_343A_SCALEDLinkMode = 0 PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTime

txtFIT_343A_SCALEDText = Int((1 Rnd) + 3) Generate random value between 3 and 4

txtFIT_343A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_343A_SCALEDLinkItem = FIT_343A_SCALEDtxtFIT_343A_SCALEDLinkMode = 2txtFIT_343A_SCALEDLinkPoketxtFIT_343A_SCALEDLinkMode = 0 DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeFIT_343AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_343A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 118

TUTORIAL

Part 4

Questions

amp

Answers

  • Slide 1
  • Slide 2
  • Slide 3
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Slide 8
  • Slide 9
  • Slide 10
  • Slide 11
  • Slide 12
  • Slide 13
  • Slide 14
  • Slide 15
  • Slide 16
  • Slide 17
  • Slide 18
  • Slide 19
  • Slide 20
  • Slide 21
  • Slide 22
  • Slide 23
  • Slide 24
  • Slide 25
  • Slide 26
  • Slide 27
  • Slide 28
  • Slide 29
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
  • Slide 34
  • Slide 35
  • Slide 36
  • Slide 37
  • Slide 38
  • Slide 39
  • Slide 40
  • Slide 41
  • Slide 42
  • Slide 43
  • Slide 44
  • Slide 45
  • Slide 46
  • Slide 47
  • Slide 48
  • Slide 49
  • Slide 50
  • Slide 51
  • Slide 52
  • Slide 53
  • Slide 54
  • Slide 55
  • Slide 56
  • Slide 57
  • Slide 58
  • Slide 59
  • Slide 60
  • Slide 61
  • Slide 62
  • Slide 63
  • Slide 64
  • Slide 65
  • Slide 66
  • Slide 67
  • Slide 68
  • Slide 69
  • Slide 70
  • Slide 71
  • Slide 72
  • Slide 73
  • Slide 74
  • Slide 75
  • Slide 76
  • Slide 77
  • Slide 78
  • Slide 79
  • Slide 80
  • Slide 81
  • Slide 82
  • Slide 83
  • Slide 84
  • Slide 85
  • Slide 86
  • Slide 87
  • Slide 88
  • Slide 89
  • Slide 90
  • Slide 91
  • Slide 92
  • Slide 93
  • Slide 94
  • Slide 95
  • Slide 96
  • Slide 97
  • Slide 98
  • Slide 99
  • Slide 100
  • Slide 101
  • Slide 102
  • Slide 103
  • Slide 104
  • Slide 105
  • Slide 106
  • Slide 107
  • Slide 108
  • Slide 109
  • Slide 110
  • Slide 111
  • Slide 112
  • Slide 113
  • Slide 114
  • Slide 115
  • Slide 116
  • Slide 117
  • Slide 118
Page 92: TUTORIAL Ethernet PLC's Improve Oxygen Consumption ISA Expo/2001Houston, Texas Water & Wastewater Industry DivisionTuesday, September 11, 2001 1 Brad.

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 92

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 93

Bars Buttons amp Sliders

By choosing to use indirect tags we complicate the Bar Graphs Buttons amp Sliders in the popup displays

Different scales need to be used for different engineering unit ranges

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 94

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 95

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 96

Popup Displays

The next two pages shows how the individual popup displays use the indirect tags

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 97

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 98

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 99

Adding a ldquoTouch Targetrdquo to a Display

2 Tell which tags to use

3 Tell which popup display to call upWhat kind of point type is it

3 Steps1 Tell which scale to use (if itrsquos an analog point type)

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 100

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 101

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 102

TUTORIAL

Part 2C

Excel Spreadsheets

amp

Visual Basic

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 103

A ldquoCHEAP amp DIRTYrdquo HMI With Excel

The 4 key parameters are

To communicate with the PLCUse brad_s_carlbergmbenet|ANOXIC_OXICrsquoplcregisterrsquo

Excel uses ldquopeeksrdquo amp ldquopokesrdquo to read from amp write to a PLC or HMI

To communicate with the HMIbrad_s_carlbergview|Tagnamersquotagnamersquo

bull computer namebull applicationbull topicbull item

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 104

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 105

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 106

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 107

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 108

Excel Macros

bull ldquoRequestrdquo Macro to read values

bull ldquoPokerdquo Macro to write values

bull A Sample Excel Macro

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 109

Sub PokeMacro()MsgBox ApplicationNetworkTemplatesPathChannel = ApplicationDDEInitiate(app=brad_s_carlbergVIEW topic=Tagname) This opens a DDE channel to ViewApplicationDDEPoke Channel Temperature1 Worksheets(Sheet1)Range(A1) Puts value from R1C1 into Temperature1ApplicationDDEPoke Channel DDEReal Worksheets(Sheet1)Range(A2) Puts value from R1C1 into Temperature1ApplicationDDEPoke Channel DDEInteger Worksheets(Sheet1)Range(A3) Puts value from R1C1 into Temperature1ApplicationDDETerminate Channel This terminates the DDE channelEnd SubSub RequestMacro()Channel = ApplicationDDEInitiate(app=brad_s_carlbergVIEW topic=Tagname) This opens a DDE channel to ViewWorksheets(Sheet1)Range(C4) = ApplicationDDERequest(Channel $Hour)Worksheets(Sheet1)Range(C5) = ApplicationDDERequest(Channel $Minute)Worksheets(Sheet1)Range(C6) = ApplicationDDERequest(Channel $Second)Worksheets(Sheet1)Range(C9) = ApplicationDDERequest(Channel $day)Worksheets(Sheet1)Range(C10) = ApplicationDDERequest(Channel $date)Worksheets(Sheet1)Range(C11) = ApplicationDDERequest(Channel $datestring)Worksheets(Sheet1)Range(C12) = ApplicationDDERequest(Channel $datetime)Worksheets(Sheet1)Range(C13) = ApplicationDDERequest(Channel $date)Worksheets(Sheet1)Range(C14) = ApplicationDDERequest(Channel $month)Worksheets(Sheet1)Range(C15) = ApplicationDDERequest(Channel $year)Worksheets(Sheet1)Range(C16) = ApplicationDDERequest(Channel $time)Worksheets(Sheet1)Range(C17) = ApplicationDDERequest(Channel $timestring)Worksheets(Sheet1)Range(C18) = ApplicationDDERequest(Channel $applicationversion)Worksheets(Sheet1)Range(C19) = ApplicationDDERequest(Channel $startddeconversations)Worksheets(Sheet1)Range(C20) = ApplicationDDERequest(Channel $accesslevel)Worksheets(Sheet1)Range(C21) = ApplicationDDERequest(Channel $alarmlogging)Worksheets(Sheet1)Range(C22) = ApplicationDDERequest(Channel $applicationchanged)Worksheets(Sheet1)Range(C23) = ApplicationDDERequest(Channel $configureusers)Worksheets(Sheet1)Range(C24) = ApplicationDDERequest(Channel $changepassword)Worksheets(Sheet1)Range(C25) = ApplicationDDERequest(Channel $InactivityTimeout)Worksheets(Sheet1)Range(C26) = ApplicationDDERequest(Channel $InactivityWarning)Worksheets(Sheet1)Range(C27) = ApplicationDDERequest(Channel $LogicRunning)Worksheets(Sheet1)Range(C28) = ApplicationDDERequest(Channel $OperatorEntered)Worksheets(Sheet1)Range(C29) = ApplicationDDERequest(Channel $Operator)Worksheets(Sheet1)Range(C30) = ApplicationDDERequest(Channel $PasswordEntered)ApplicationDDETerminate Channel This terminates the DDE channelEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 110

Visual Basic

ldquoRoll Your Ownrdquo HMI - Much More powerful than Excel

Key Parameters computer nameapplication|topicitem

IO Emulator - MBPlusSimulateexe

Can ldquoRead Fromrdquo amp ldquoWrite Tordquo PLC andor HMI

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 111

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 112

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 113

Dim PauseTime Start Finish TotalTime As Integer Declare variables

Private Sub txtAIT_332A_SCALED_Change()On Error GoTo PokeAIT_332AErrortxtAIT_332A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtAIT_332A_SCALEDText = Int((3 Rnd) + 20) Generate random value between 20 and 23txtAIT_332A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtAIT_332A_SCALEDLinkItem = AIT_332A_SCALEDtxtAIT_332A_SCALEDLinkMode = 2txtAIT_332A_SCALEDLinkPoketxtAIT_332A_SCALEDLinkMode = 0 DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total time

PokeAIT_332AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtAIT_332A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 114

Private Sub txtAIT_346A_SCALED_Change()On Error GoTo PokeAIT_346AErrortxtAIT_346A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtAIT_346A_SCALEDText = Int((3 Rnd) + 15) Generate random value between 15 and 18txtAIT_346A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtAIT_346A_SCALEDLinkItem = AIT_346A_SCALEDtxtAIT_346A_SCALEDLinkMode = 2txtAIT_346A_SCALEDLinkPoketxtAIT_346A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeAIT_346AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtAIT_346A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 115

Private Sub txtFIT_321A_SCALED_Change()On Error GoTo PokeFIT_321AErrortxtFIT_321A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtFIT_321A_SCALEDText = Int((10 Rnd) + 120) Generate random value between 120 and 130txtFIT_321A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_321A_SCALEDLinkItem = FIT_321A_SCALEDtxtFIT_321A_SCALEDLinkMode = 2txtFIT_321A_SCALEDLinkPoketxtFIT_321A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total time

PokeFIT_321AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_321A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume Next

End Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 116

Private Sub txtFIT_341A_SCALED_Change()On Error GoTo PokeFIT_341AErrortxtFIT_341A_SCALEDLinkMode = 0 PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTime

txtFIT_341A_SCALEDText = Int((3 Rnd) + 18) Generate random value between 18 and 21

txtFIT_341A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_341A_SCALEDLinkItem = FIT_341A_SCALEDtxtFIT_341A_SCALEDLinkMode = 2txtFIT_341A_SCALEDLinkPoketxtFIT_341A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeFIT_341AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_341A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 117

Private Sub txtFIT_343A_SCALED_Change()On Error GoTo PokeFIT_343AErrortxtFIT_343A_SCALEDLinkMode = 0 PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTime

txtFIT_343A_SCALEDText = Int((1 Rnd) + 3) Generate random value between 3 and 4

txtFIT_343A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_343A_SCALEDLinkItem = FIT_343A_SCALEDtxtFIT_343A_SCALEDLinkMode = 2txtFIT_343A_SCALEDLinkPoketxtFIT_343A_SCALEDLinkMode = 0 DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeFIT_343AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_343A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 118

TUTORIAL

Part 4

Questions

amp

Answers

  • Slide 1
  • Slide 2
  • Slide 3
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Slide 8
  • Slide 9
  • Slide 10
  • Slide 11
  • Slide 12
  • Slide 13
  • Slide 14
  • Slide 15
  • Slide 16
  • Slide 17
  • Slide 18
  • Slide 19
  • Slide 20
  • Slide 21
  • Slide 22
  • Slide 23
  • Slide 24
  • Slide 25
  • Slide 26
  • Slide 27
  • Slide 28
  • Slide 29
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
  • Slide 34
  • Slide 35
  • Slide 36
  • Slide 37
  • Slide 38
  • Slide 39
  • Slide 40
  • Slide 41
  • Slide 42
  • Slide 43
  • Slide 44
  • Slide 45
  • Slide 46
  • Slide 47
  • Slide 48
  • Slide 49
  • Slide 50
  • Slide 51
  • Slide 52
  • Slide 53
  • Slide 54
  • Slide 55
  • Slide 56
  • Slide 57
  • Slide 58
  • Slide 59
  • Slide 60
  • Slide 61
  • Slide 62
  • Slide 63
  • Slide 64
  • Slide 65
  • Slide 66
  • Slide 67
  • Slide 68
  • Slide 69
  • Slide 70
  • Slide 71
  • Slide 72
  • Slide 73
  • Slide 74
  • Slide 75
  • Slide 76
  • Slide 77
  • Slide 78
  • Slide 79
  • Slide 80
  • Slide 81
  • Slide 82
  • Slide 83
  • Slide 84
  • Slide 85
  • Slide 86
  • Slide 87
  • Slide 88
  • Slide 89
  • Slide 90
  • Slide 91
  • Slide 92
  • Slide 93
  • Slide 94
  • Slide 95
  • Slide 96
  • Slide 97
  • Slide 98
  • Slide 99
  • Slide 100
  • Slide 101
  • Slide 102
  • Slide 103
  • Slide 104
  • Slide 105
  • Slide 106
  • Slide 107
  • Slide 108
  • Slide 109
  • Slide 110
  • Slide 111
  • Slide 112
  • Slide 113
  • Slide 114
  • Slide 115
  • Slide 116
  • Slide 117
  • Slide 118
Page 93: TUTORIAL Ethernet PLC's Improve Oxygen Consumption ISA Expo/2001Houston, Texas Water & Wastewater Industry DivisionTuesday, September 11, 2001 1 Brad.

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 93

Bars Buttons amp Sliders

By choosing to use indirect tags we complicate the Bar Graphs Buttons amp Sliders in the popup displays

Different scales need to be used for different engineering unit ranges

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 94

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 95

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 96

Popup Displays

The next two pages shows how the individual popup displays use the indirect tags

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 97

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 98

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 99

Adding a ldquoTouch Targetrdquo to a Display

2 Tell which tags to use

3 Tell which popup display to call upWhat kind of point type is it

3 Steps1 Tell which scale to use (if itrsquos an analog point type)

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 100

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 101

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 102

TUTORIAL

Part 2C

Excel Spreadsheets

amp

Visual Basic

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 103

A ldquoCHEAP amp DIRTYrdquo HMI With Excel

The 4 key parameters are

To communicate with the PLCUse brad_s_carlbergmbenet|ANOXIC_OXICrsquoplcregisterrsquo

Excel uses ldquopeeksrdquo amp ldquopokesrdquo to read from amp write to a PLC or HMI

To communicate with the HMIbrad_s_carlbergview|Tagnamersquotagnamersquo

bull computer namebull applicationbull topicbull item

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 104

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 105

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 106

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 107

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 108

Excel Macros

bull ldquoRequestrdquo Macro to read values

bull ldquoPokerdquo Macro to write values

bull A Sample Excel Macro

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 109

Sub PokeMacro()MsgBox ApplicationNetworkTemplatesPathChannel = ApplicationDDEInitiate(app=brad_s_carlbergVIEW topic=Tagname) This opens a DDE channel to ViewApplicationDDEPoke Channel Temperature1 Worksheets(Sheet1)Range(A1) Puts value from R1C1 into Temperature1ApplicationDDEPoke Channel DDEReal Worksheets(Sheet1)Range(A2) Puts value from R1C1 into Temperature1ApplicationDDEPoke Channel DDEInteger Worksheets(Sheet1)Range(A3) Puts value from R1C1 into Temperature1ApplicationDDETerminate Channel This terminates the DDE channelEnd SubSub RequestMacro()Channel = ApplicationDDEInitiate(app=brad_s_carlbergVIEW topic=Tagname) This opens a DDE channel to ViewWorksheets(Sheet1)Range(C4) = ApplicationDDERequest(Channel $Hour)Worksheets(Sheet1)Range(C5) = ApplicationDDERequest(Channel $Minute)Worksheets(Sheet1)Range(C6) = ApplicationDDERequest(Channel $Second)Worksheets(Sheet1)Range(C9) = ApplicationDDERequest(Channel $day)Worksheets(Sheet1)Range(C10) = ApplicationDDERequest(Channel $date)Worksheets(Sheet1)Range(C11) = ApplicationDDERequest(Channel $datestring)Worksheets(Sheet1)Range(C12) = ApplicationDDERequest(Channel $datetime)Worksheets(Sheet1)Range(C13) = ApplicationDDERequest(Channel $date)Worksheets(Sheet1)Range(C14) = ApplicationDDERequest(Channel $month)Worksheets(Sheet1)Range(C15) = ApplicationDDERequest(Channel $year)Worksheets(Sheet1)Range(C16) = ApplicationDDERequest(Channel $time)Worksheets(Sheet1)Range(C17) = ApplicationDDERequest(Channel $timestring)Worksheets(Sheet1)Range(C18) = ApplicationDDERequest(Channel $applicationversion)Worksheets(Sheet1)Range(C19) = ApplicationDDERequest(Channel $startddeconversations)Worksheets(Sheet1)Range(C20) = ApplicationDDERequest(Channel $accesslevel)Worksheets(Sheet1)Range(C21) = ApplicationDDERequest(Channel $alarmlogging)Worksheets(Sheet1)Range(C22) = ApplicationDDERequest(Channel $applicationchanged)Worksheets(Sheet1)Range(C23) = ApplicationDDERequest(Channel $configureusers)Worksheets(Sheet1)Range(C24) = ApplicationDDERequest(Channel $changepassword)Worksheets(Sheet1)Range(C25) = ApplicationDDERequest(Channel $InactivityTimeout)Worksheets(Sheet1)Range(C26) = ApplicationDDERequest(Channel $InactivityWarning)Worksheets(Sheet1)Range(C27) = ApplicationDDERequest(Channel $LogicRunning)Worksheets(Sheet1)Range(C28) = ApplicationDDERequest(Channel $OperatorEntered)Worksheets(Sheet1)Range(C29) = ApplicationDDERequest(Channel $Operator)Worksheets(Sheet1)Range(C30) = ApplicationDDERequest(Channel $PasswordEntered)ApplicationDDETerminate Channel This terminates the DDE channelEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 110

Visual Basic

ldquoRoll Your Ownrdquo HMI - Much More powerful than Excel

Key Parameters computer nameapplication|topicitem

IO Emulator - MBPlusSimulateexe

Can ldquoRead Fromrdquo amp ldquoWrite Tordquo PLC andor HMI

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 111

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 112

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 113

Dim PauseTime Start Finish TotalTime As Integer Declare variables

Private Sub txtAIT_332A_SCALED_Change()On Error GoTo PokeAIT_332AErrortxtAIT_332A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtAIT_332A_SCALEDText = Int((3 Rnd) + 20) Generate random value between 20 and 23txtAIT_332A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtAIT_332A_SCALEDLinkItem = AIT_332A_SCALEDtxtAIT_332A_SCALEDLinkMode = 2txtAIT_332A_SCALEDLinkPoketxtAIT_332A_SCALEDLinkMode = 0 DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total time

PokeAIT_332AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtAIT_332A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 114

Private Sub txtAIT_346A_SCALED_Change()On Error GoTo PokeAIT_346AErrortxtAIT_346A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtAIT_346A_SCALEDText = Int((3 Rnd) + 15) Generate random value between 15 and 18txtAIT_346A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtAIT_346A_SCALEDLinkItem = AIT_346A_SCALEDtxtAIT_346A_SCALEDLinkMode = 2txtAIT_346A_SCALEDLinkPoketxtAIT_346A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeAIT_346AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtAIT_346A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 115

Private Sub txtFIT_321A_SCALED_Change()On Error GoTo PokeFIT_321AErrortxtFIT_321A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtFIT_321A_SCALEDText = Int((10 Rnd) + 120) Generate random value between 120 and 130txtFIT_321A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_321A_SCALEDLinkItem = FIT_321A_SCALEDtxtFIT_321A_SCALEDLinkMode = 2txtFIT_321A_SCALEDLinkPoketxtFIT_321A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total time

PokeFIT_321AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_321A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume Next

End Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 116

Private Sub txtFIT_341A_SCALED_Change()On Error GoTo PokeFIT_341AErrortxtFIT_341A_SCALEDLinkMode = 0 PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTime

txtFIT_341A_SCALEDText = Int((3 Rnd) + 18) Generate random value between 18 and 21

txtFIT_341A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_341A_SCALEDLinkItem = FIT_341A_SCALEDtxtFIT_341A_SCALEDLinkMode = 2txtFIT_341A_SCALEDLinkPoketxtFIT_341A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeFIT_341AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_341A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 117

Private Sub txtFIT_343A_SCALED_Change()On Error GoTo PokeFIT_343AErrortxtFIT_343A_SCALEDLinkMode = 0 PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTime

txtFIT_343A_SCALEDText = Int((1 Rnd) + 3) Generate random value between 3 and 4

txtFIT_343A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_343A_SCALEDLinkItem = FIT_343A_SCALEDtxtFIT_343A_SCALEDLinkMode = 2txtFIT_343A_SCALEDLinkPoketxtFIT_343A_SCALEDLinkMode = 0 DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeFIT_343AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_343A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 118

TUTORIAL

Part 4

Questions

amp

Answers

  • Slide 1
  • Slide 2
  • Slide 3
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Slide 8
  • Slide 9
  • Slide 10
  • Slide 11
  • Slide 12
  • Slide 13
  • Slide 14
  • Slide 15
  • Slide 16
  • Slide 17
  • Slide 18
  • Slide 19
  • Slide 20
  • Slide 21
  • Slide 22
  • Slide 23
  • Slide 24
  • Slide 25
  • Slide 26
  • Slide 27
  • Slide 28
  • Slide 29
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
  • Slide 34
  • Slide 35
  • Slide 36
  • Slide 37
  • Slide 38
  • Slide 39
  • Slide 40
  • Slide 41
  • Slide 42
  • Slide 43
  • Slide 44
  • Slide 45
  • Slide 46
  • Slide 47
  • Slide 48
  • Slide 49
  • Slide 50
  • Slide 51
  • Slide 52
  • Slide 53
  • Slide 54
  • Slide 55
  • Slide 56
  • Slide 57
  • Slide 58
  • Slide 59
  • Slide 60
  • Slide 61
  • Slide 62
  • Slide 63
  • Slide 64
  • Slide 65
  • Slide 66
  • Slide 67
  • Slide 68
  • Slide 69
  • Slide 70
  • Slide 71
  • Slide 72
  • Slide 73
  • Slide 74
  • Slide 75
  • Slide 76
  • Slide 77
  • Slide 78
  • Slide 79
  • Slide 80
  • Slide 81
  • Slide 82
  • Slide 83
  • Slide 84
  • Slide 85
  • Slide 86
  • Slide 87
  • Slide 88
  • Slide 89
  • Slide 90
  • Slide 91
  • Slide 92
  • Slide 93
  • Slide 94
  • Slide 95
  • Slide 96
  • Slide 97
  • Slide 98
  • Slide 99
  • Slide 100
  • Slide 101
  • Slide 102
  • Slide 103
  • Slide 104
  • Slide 105
  • Slide 106
  • Slide 107
  • Slide 108
  • Slide 109
  • Slide 110
  • Slide 111
  • Slide 112
  • Slide 113
  • Slide 114
  • Slide 115
  • Slide 116
  • Slide 117
  • Slide 118
Page 94: TUTORIAL Ethernet PLC's Improve Oxygen Consumption ISA Expo/2001Houston, Texas Water & Wastewater Industry DivisionTuesday, September 11, 2001 1 Brad.

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 94

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 95

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 96

Popup Displays

The next two pages shows how the individual popup displays use the indirect tags

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 97

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 98

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 99

Adding a ldquoTouch Targetrdquo to a Display

2 Tell which tags to use

3 Tell which popup display to call upWhat kind of point type is it

3 Steps1 Tell which scale to use (if itrsquos an analog point type)

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 100

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 101

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 102

TUTORIAL

Part 2C

Excel Spreadsheets

amp

Visual Basic

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 103

A ldquoCHEAP amp DIRTYrdquo HMI With Excel

The 4 key parameters are

To communicate with the PLCUse brad_s_carlbergmbenet|ANOXIC_OXICrsquoplcregisterrsquo

Excel uses ldquopeeksrdquo amp ldquopokesrdquo to read from amp write to a PLC or HMI

To communicate with the HMIbrad_s_carlbergview|Tagnamersquotagnamersquo

bull computer namebull applicationbull topicbull item

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 104

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 105

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 106

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 107

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 108

Excel Macros

bull ldquoRequestrdquo Macro to read values

bull ldquoPokerdquo Macro to write values

bull A Sample Excel Macro

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 109

Sub PokeMacro()MsgBox ApplicationNetworkTemplatesPathChannel = ApplicationDDEInitiate(app=brad_s_carlbergVIEW topic=Tagname) This opens a DDE channel to ViewApplicationDDEPoke Channel Temperature1 Worksheets(Sheet1)Range(A1) Puts value from R1C1 into Temperature1ApplicationDDEPoke Channel DDEReal Worksheets(Sheet1)Range(A2) Puts value from R1C1 into Temperature1ApplicationDDEPoke Channel DDEInteger Worksheets(Sheet1)Range(A3) Puts value from R1C1 into Temperature1ApplicationDDETerminate Channel This terminates the DDE channelEnd SubSub RequestMacro()Channel = ApplicationDDEInitiate(app=brad_s_carlbergVIEW topic=Tagname) This opens a DDE channel to ViewWorksheets(Sheet1)Range(C4) = ApplicationDDERequest(Channel $Hour)Worksheets(Sheet1)Range(C5) = ApplicationDDERequest(Channel $Minute)Worksheets(Sheet1)Range(C6) = ApplicationDDERequest(Channel $Second)Worksheets(Sheet1)Range(C9) = ApplicationDDERequest(Channel $day)Worksheets(Sheet1)Range(C10) = ApplicationDDERequest(Channel $date)Worksheets(Sheet1)Range(C11) = ApplicationDDERequest(Channel $datestring)Worksheets(Sheet1)Range(C12) = ApplicationDDERequest(Channel $datetime)Worksheets(Sheet1)Range(C13) = ApplicationDDERequest(Channel $date)Worksheets(Sheet1)Range(C14) = ApplicationDDERequest(Channel $month)Worksheets(Sheet1)Range(C15) = ApplicationDDERequest(Channel $year)Worksheets(Sheet1)Range(C16) = ApplicationDDERequest(Channel $time)Worksheets(Sheet1)Range(C17) = ApplicationDDERequest(Channel $timestring)Worksheets(Sheet1)Range(C18) = ApplicationDDERequest(Channel $applicationversion)Worksheets(Sheet1)Range(C19) = ApplicationDDERequest(Channel $startddeconversations)Worksheets(Sheet1)Range(C20) = ApplicationDDERequest(Channel $accesslevel)Worksheets(Sheet1)Range(C21) = ApplicationDDERequest(Channel $alarmlogging)Worksheets(Sheet1)Range(C22) = ApplicationDDERequest(Channel $applicationchanged)Worksheets(Sheet1)Range(C23) = ApplicationDDERequest(Channel $configureusers)Worksheets(Sheet1)Range(C24) = ApplicationDDERequest(Channel $changepassword)Worksheets(Sheet1)Range(C25) = ApplicationDDERequest(Channel $InactivityTimeout)Worksheets(Sheet1)Range(C26) = ApplicationDDERequest(Channel $InactivityWarning)Worksheets(Sheet1)Range(C27) = ApplicationDDERequest(Channel $LogicRunning)Worksheets(Sheet1)Range(C28) = ApplicationDDERequest(Channel $OperatorEntered)Worksheets(Sheet1)Range(C29) = ApplicationDDERequest(Channel $Operator)Worksheets(Sheet1)Range(C30) = ApplicationDDERequest(Channel $PasswordEntered)ApplicationDDETerminate Channel This terminates the DDE channelEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 110

Visual Basic

ldquoRoll Your Ownrdquo HMI - Much More powerful than Excel

Key Parameters computer nameapplication|topicitem

IO Emulator - MBPlusSimulateexe

Can ldquoRead Fromrdquo amp ldquoWrite Tordquo PLC andor HMI

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 111

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 112

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 113

Dim PauseTime Start Finish TotalTime As Integer Declare variables

Private Sub txtAIT_332A_SCALED_Change()On Error GoTo PokeAIT_332AErrortxtAIT_332A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtAIT_332A_SCALEDText = Int((3 Rnd) + 20) Generate random value between 20 and 23txtAIT_332A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtAIT_332A_SCALEDLinkItem = AIT_332A_SCALEDtxtAIT_332A_SCALEDLinkMode = 2txtAIT_332A_SCALEDLinkPoketxtAIT_332A_SCALEDLinkMode = 0 DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total time

PokeAIT_332AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtAIT_332A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 114

Private Sub txtAIT_346A_SCALED_Change()On Error GoTo PokeAIT_346AErrortxtAIT_346A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtAIT_346A_SCALEDText = Int((3 Rnd) + 15) Generate random value between 15 and 18txtAIT_346A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtAIT_346A_SCALEDLinkItem = AIT_346A_SCALEDtxtAIT_346A_SCALEDLinkMode = 2txtAIT_346A_SCALEDLinkPoketxtAIT_346A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeAIT_346AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtAIT_346A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 115

Private Sub txtFIT_321A_SCALED_Change()On Error GoTo PokeFIT_321AErrortxtFIT_321A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtFIT_321A_SCALEDText = Int((10 Rnd) + 120) Generate random value between 120 and 130txtFIT_321A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_321A_SCALEDLinkItem = FIT_321A_SCALEDtxtFIT_321A_SCALEDLinkMode = 2txtFIT_321A_SCALEDLinkPoketxtFIT_321A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total time

PokeFIT_321AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_321A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume Next

End Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 116

Private Sub txtFIT_341A_SCALED_Change()On Error GoTo PokeFIT_341AErrortxtFIT_341A_SCALEDLinkMode = 0 PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTime

txtFIT_341A_SCALEDText = Int((3 Rnd) + 18) Generate random value between 18 and 21

txtFIT_341A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_341A_SCALEDLinkItem = FIT_341A_SCALEDtxtFIT_341A_SCALEDLinkMode = 2txtFIT_341A_SCALEDLinkPoketxtFIT_341A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeFIT_341AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_341A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 117

Private Sub txtFIT_343A_SCALED_Change()On Error GoTo PokeFIT_343AErrortxtFIT_343A_SCALEDLinkMode = 0 PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTime

txtFIT_343A_SCALEDText = Int((1 Rnd) + 3) Generate random value between 3 and 4

txtFIT_343A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_343A_SCALEDLinkItem = FIT_343A_SCALEDtxtFIT_343A_SCALEDLinkMode = 2txtFIT_343A_SCALEDLinkPoketxtFIT_343A_SCALEDLinkMode = 0 DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeFIT_343AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_343A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 118

TUTORIAL

Part 4

Questions

amp

Answers

  • Slide 1
  • Slide 2
  • Slide 3
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Slide 8
  • Slide 9
  • Slide 10
  • Slide 11
  • Slide 12
  • Slide 13
  • Slide 14
  • Slide 15
  • Slide 16
  • Slide 17
  • Slide 18
  • Slide 19
  • Slide 20
  • Slide 21
  • Slide 22
  • Slide 23
  • Slide 24
  • Slide 25
  • Slide 26
  • Slide 27
  • Slide 28
  • Slide 29
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
  • Slide 34
  • Slide 35
  • Slide 36
  • Slide 37
  • Slide 38
  • Slide 39
  • Slide 40
  • Slide 41
  • Slide 42
  • Slide 43
  • Slide 44
  • Slide 45
  • Slide 46
  • Slide 47
  • Slide 48
  • Slide 49
  • Slide 50
  • Slide 51
  • Slide 52
  • Slide 53
  • Slide 54
  • Slide 55
  • Slide 56
  • Slide 57
  • Slide 58
  • Slide 59
  • Slide 60
  • Slide 61
  • Slide 62
  • Slide 63
  • Slide 64
  • Slide 65
  • Slide 66
  • Slide 67
  • Slide 68
  • Slide 69
  • Slide 70
  • Slide 71
  • Slide 72
  • Slide 73
  • Slide 74
  • Slide 75
  • Slide 76
  • Slide 77
  • Slide 78
  • Slide 79
  • Slide 80
  • Slide 81
  • Slide 82
  • Slide 83
  • Slide 84
  • Slide 85
  • Slide 86
  • Slide 87
  • Slide 88
  • Slide 89
  • Slide 90
  • Slide 91
  • Slide 92
  • Slide 93
  • Slide 94
  • Slide 95
  • Slide 96
  • Slide 97
  • Slide 98
  • Slide 99
  • Slide 100
  • Slide 101
  • Slide 102
  • Slide 103
  • Slide 104
  • Slide 105
  • Slide 106
  • Slide 107
  • Slide 108
  • Slide 109
  • Slide 110
  • Slide 111
  • Slide 112
  • Slide 113
  • Slide 114
  • Slide 115
  • Slide 116
  • Slide 117
  • Slide 118
Page 95: TUTORIAL Ethernet PLC's Improve Oxygen Consumption ISA Expo/2001Houston, Texas Water & Wastewater Industry DivisionTuesday, September 11, 2001 1 Brad.

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 95

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 96

Popup Displays

The next two pages shows how the individual popup displays use the indirect tags

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 97

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 98

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 99

Adding a ldquoTouch Targetrdquo to a Display

2 Tell which tags to use

3 Tell which popup display to call upWhat kind of point type is it

3 Steps1 Tell which scale to use (if itrsquos an analog point type)

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 100

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 101

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 102

TUTORIAL

Part 2C

Excel Spreadsheets

amp

Visual Basic

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 103

A ldquoCHEAP amp DIRTYrdquo HMI With Excel

The 4 key parameters are

To communicate with the PLCUse brad_s_carlbergmbenet|ANOXIC_OXICrsquoplcregisterrsquo

Excel uses ldquopeeksrdquo amp ldquopokesrdquo to read from amp write to a PLC or HMI

To communicate with the HMIbrad_s_carlbergview|Tagnamersquotagnamersquo

bull computer namebull applicationbull topicbull item

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 104

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 105

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 106

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 107

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 108

Excel Macros

bull ldquoRequestrdquo Macro to read values

bull ldquoPokerdquo Macro to write values

bull A Sample Excel Macro

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 109

Sub PokeMacro()MsgBox ApplicationNetworkTemplatesPathChannel = ApplicationDDEInitiate(app=brad_s_carlbergVIEW topic=Tagname) This opens a DDE channel to ViewApplicationDDEPoke Channel Temperature1 Worksheets(Sheet1)Range(A1) Puts value from R1C1 into Temperature1ApplicationDDEPoke Channel DDEReal Worksheets(Sheet1)Range(A2) Puts value from R1C1 into Temperature1ApplicationDDEPoke Channel DDEInteger Worksheets(Sheet1)Range(A3) Puts value from R1C1 into Temperature1ApplicationDDETerminate Channel This terminates the DDE channelEnd SubSub RequestMacro()Channel = ApplicationDDEInitiate(app=brad_s_carlbergVIEW topic=Tagname) This opens a DDE channel to ViewWorksheets(Sheet1)Range(C4) = ApplicationDDERequest(Channel $Hour)Worksheets(Sheet1)Range(C5) = ApplicationDDERequest(Channel $Minute)Worksheets(Sheet1)Range(C6) = ApplicationDDERequest(Channel $Second)Worksheets(Sheet1)Range(C9) = ApplicationDDERequest(Channel $day)Worksheets(Sheet1)Range(C10) = ApplicationDDERequest(Channel $date)Worksheets(Sheet1)Range(C11) = ApplicationDDERequest(Channel $datestring)Worksheets(Sheet1)Range(C12) = ApplicationDDERequest(Channel $datetime)Worksheets(Sheet1)Range(C13) = ApplicationDDERequest(Channel $date)Worksheets(Sheet1)Range(C14) = ApplicationDDERequest(Channel $month)Worksheets(Sheet1)Range(C15) = ApplicationDDERequest(Channel $year)Worksheets(Sheet1)Range(C16) = ApplicationDDERequest(Channel $time)Worksheets(Sheet1)Range(C17) = ApplicationDDERequest(Channel $timestring)Worksheets(Sheet1)Range(C18) = ApplicationDDERequest(Channel $applicationversion)Worksheets(Sheet1)Range(C19) = ApplicationDDERequest(Channel $startddeconversations)Worksheets(Sheet1)Range(C20) = ApplicationDDERequest(Channel $accesslevel)Worksheets(Sheet1)Range(C21) = ApplicationDDERequest(Channel $alarmlogging)Worksheets(Sheet1)Range(C22) = ApplicationDDERequest(Channel $applicationchanged)Worksheets(Sheet1)Range(C23) = ApplicationDDERequest(Channel $configureusers)Worksheets(Sheet1)Range(C24) = ApplicationDDERequest(Channel $changepassword)Worksheets(Sheet1)Range(C25) = ApplicationDDERequest(Channel $InactivityTimeout)Worksheets(Sheet1)Range(C26) = ApplicationDDERequest(Channel $InactivityWarning)Worksheets(Sheet1)Range(C27) = ApplicationDDERequest(Channel $LogicRunning)Worksheets(Sheet1)Range(C28) = ApplicationDDERequest(Channel $OperatorEntered)Worksheets(Sheet1)Range(C29) = ApplicationDDERequest(Channel $Operator)Worksheets(Sheet1)Range(C30) = ApplicationDDERequest(Channel $PasswordEntered)ApplicationDDETerminate Channel This terminates the DDE channelEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 110

Visual Basic

ldquoRoll Your Ownrdquo HMI - Much More powerful than Excel

Key Parameters computer nameapplication|topicitem

IO Emulator - MBPlusSimulateexe

Can ldquoRead Fromrdquo amp ldquoWrite Tordquo PLC andor HMI

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 111

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 112

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 113

Dim PauseTime Start Finish TotalTime As Integer Declare variables

Private Sub txtAIT_332A_SCALED_Change()On Error GoTo PokeAIT_332AErrortxtAIT_332A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtAIT_332A_SCALEDText = Int((3 Rnd) + 20) Generate random value between 20 and 23txtAIT_332A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtAIT_332A_SCALEDLinkItem = AIT_332A_SCALEDtxtAIT_332A_SCALEDLinkMode = 2txtAIT_332A_SCALEDLinkPoketxtAIT_332A_SCALEDLinkMode = 0 DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total time

PokeAIT_332AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtAIT_332A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 114

Private Sub txtAIT_346A_SCALED_Change()On Error GoTo PokeAIT_346AErrortxtAIT_346A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtAIT_346A_SCALEDText = Int((3 Rnd) + 15) Generate random value between 15 and 18txtAIT_346A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtAIT_346A_SCALEDLinkItem = AIT_346A_SCALEDtxtAIT_346A_SCALEDLinkMode = 2txtAIT_346A_SCALEDLinkPoketxtAIT_346A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeAIT_346AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtAIT_346A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 115

Private Sub txtFIT_321A_SCALED_Change()On Error GoTo PokeFIT_321AErrortxtFIT_321A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtFIT_321A_SCALEDText = Int((10 Rnd) + 120) Generate random value between 120 and 130txtFIT_321A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_321A_SCALEDLinkItem = FIT_321A_SCALEDtxtFIT_321A_SCALEDLinkMode = 2txtFIT_321A_SCALEDLinkPoketxtFIT_321A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total time

PokeFIT_321AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_321A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume Next

End Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 116

Private Sub txtFIT_341A_SCALED_Change()On Error GoTo PokeFIT_341AErrortxtFIT_341A_SCALEDLinkMode = 0 PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTime

txtFIT_341A_SCALEDText = Int((3 Rnd) + 18) Generate random value between 18 and 21

txtFIT_341A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_341A_SCALEDLinkItem = FIT_341A_SCALEDtxtFIT_341A_SCALEDLinkMode = 2txtFIT_341A_SCALEDLinkPoketxtFIT_341A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeFIT_341AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_341A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 117

Private Sub txtFIT_343A_SCALED_Change()On Error GoTo PokeFIT_343AErrortxtFIT_343A_SCALEDLinkMode = 0 PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTime

txtFIT_343A_SCALEDText = Int((1 Rnd) + 3) Generate random value between 3 and 4

txtFIT_343A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_343A_SCALEDLinkItem = FIT_343A_SCALEDtxtFIT_343A_SCALEDLinkMode = 2txtFIT_343A_SCALEDLinkPoketxtFIT_343A_SCALEDLinkMode = 0 DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeFIT_343AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_343A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 118

TUTORIAL

Part 4

Questions

amp

Answers

  • Slide 1
  • Slide 2
  • Slide 3
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Slide 8
  • Slide 9
  • Slide 10
  • Slide 11
  • Slide 12
  • Slide 13
  • Slide 14
  • Slide 15
  • Slide 16
  • Slide 17
  • Slide 18
  • Slide 19
  • Slide 20
  • Slide 21
  • Slide 22
  • Slide 23
  • Slide 24
  • Slide 25
  • Slide 26
  • Slide 27
  • Slide 28
  • Slide 29
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
  • Slide 34
  • Slide 35
  • Slide 36
  • Slide 37
  • Slide 38
  • Slide 39
  • Slide 40
  • Slide 41
  • Slide 42
  • Slide 43
  • Slide 44
  • Slide 45
  • Slide 46
  • Slide 47
  • Slide 48
  • Slide 49
  • Slide 50
  • Slide 51
  • Slide 52
  • Slide 53
  • Slide 54
  • Slide 55
  • Slide 56
  • Slide 57
  • Slide 58
  • Slide 59
  • Slide 60
  • Slide 61
  • Slide 62
  • Slide 63
  • Slide 64
  • Slide 65
  • Slide 66
  • Slide 67
  • Slide 68
  • Slide 69
  • Slide 70
  • Slide 71
  • Slide 72
  • Slide 73
  • Slide 74
  • Slide 75
  • Slide 76
  • Slide 77
  • Slide 78
  • Slide 79
  • Slide 80
  • Slide 81
  • Slide 82
  • Slide 83
  • Slide 84
  • Slide 85
  • Slide 86
  • Slide 87
  • Slide 88
  • Slide 89
  • Slide 90
  • Slide 91
  • Slide 92
  • Slide 93
  • Slide 94
  • Slide 95
  • Slide 96
  • Slide 97
  • Slide 98
  • Slide 99
  • Slide 100
  • Slide 101
  • Slide 102
  • Slide 103
  • Slide 104
  • Slide 105
  • Slide 106
  • Slide 107
  • Slide 108
  • Slide 109
  • Slide 110
  • Slide 111
  • Slide 112
  • Slide 113
  • Slide 114
  • Slide 115
  • Slide 116
  • Slide 117
  • Slide 118
Page 96: TUTORIAL Ethernet PLC's Improve Oxygen Consumption ISA Expo/2001Houston, Texas Water & Wastewater Industry DivisionTuesday, September 11, 2001 1 Brad.

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 96

Popup Displays

The next two pages shows how the individual popup displays use the indirect tags

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 97

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 98

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 99

Adding a ldquoTouch Targetrdquo to a Display

2 Tell which tags to use

3 Tell which popup display to call upWhat kind of point type is it

3 Steps1 Tell which scale to use (if itrsquos an analog point type)

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 100

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 101

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 102

TUTORIAL

Part 2C

Excel Spreadsheets

amp

Visual Basic

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 103

A ldquoCHEAP amp DIRTYrdquo HMI With Excel

The 4 key parameters are

To communicate with the PLCUse brad_s_carlbergmbenet|ANOXIC_OXICrsquoplcregisterrsquo

Excel uses ldquopeeksrdquo amp ldquopokesrdquo to read from amp write to a PLC or HMI

To communicate with the HMIbrad_s_carlbergview|Tagnamersquotagnamersquo

bull computer namebull applicationbull topicbull item

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 104

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 105

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 106

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 107

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 108

Excel Macros

bull ldquoRequestrdquo Macro to read values

bull ldquoPokerdquo Macro to write values

bull A Sample Excel Macro

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 109

Sub PokeMacro()MsgBox ApplicationNetworkTemplatesPathChannel = ApplicationDDEInitiate(app=brad_s_carlbergVIEW topic=Tagname) This opens a DDE channel to ViewApplicationDDEPoke Channel Temperature1 Worksheets(Sheet1)Range(A1) Puts value from R1C1 into Temperature1ApplicationDDEPoke Channel DDEReal Worksheets(Sheet1)Range(A2) Puts value from R1C1 into Temperature1ApplicationDDEPoke Channel DDEInteger Worksheets(Sheet1)Range(A3) Puts value from R1C1 into Temperature1ApplicationDDETerminate Channel This terminates the DDE channelEnd SubSub RequestMacro()Channel = ApplicationDDEInitiate(app=brad_s_carlbergVIEW topic=Tagname) This opens a DDE channel to ViewWorksheets(Sheet1)Range(C4) = ApplicationDDERequest(Channel $Hour)Worksheets(Sheet1)Range(C5) = ApplicationDDERequest(Channel $Minute)Worksheets(Sheet1)Range(C6) = ApplicationDDERequest(Channel $Second)Worksheets(Sheet1)Range(C9) = ApplicationDDERequest(Channel $day)Worksheets(Sheet1)Range(C10) = ApplicationDDERequest(Channel $date)Worksheets(Sheet1)Range(C11) = ApplicationDDERequest(Channel $datestring)Worksheets(Sheet1)Range(C12) = ApplicationDDERequest(Channel $datetime)Worksheets(Sheet1)Range(C13) = ApplicationDDERequest(Channel $date)Worksheets(Sheet1)Range(C14) = ApplicationDDERequest(Channel $month)Worksheets(Sheet1)Range(C15) = ApplicationDDERequest(Channel $year)Worksheets(Sheet1)Range(C16) = ApplicationDDERequest(Channel $time)Worksheets(Sheet1)Range(C17) = ApplicationDDERequest(Channel $timestring)Worksheets(Sheet1)Range(C18) = ApplicationDDERequest(Channel $applicationversion)Worksheets(Sheet1)Range(C19) = ApplicationDDERequest(Channel $startddeconversations)Worksheets(Sheet1)Range(C20) = ApplicationDDERequest(Channel $accesslevel)Worksheets(Sheet1)Range(C21) = ApplicationDDERequest(Channel $alarmlogging)Worksheets(Sheet1)Range(C22) = ApplicationDDERequest(Channel $applicationchanged)Worksheets(Sheet1)Range(C23) = ApplicationDDERequest(Channel $configureusers)Worksheets(Sheet1)Range(C24) = ApplicationDDERequest(Channel $changepassword)Worksheets(Sheet1)Range(C25) = ApplicationDDERequest(Channel $InactivityTimeout)Worksheets(Sheet1)Range(C26) = ApplicationDDERequest(Channel $InactivityWarning)Worksheets(Sheet1)Range(C27) = ApplicationDDERequest(Channel $LogicRunning)Worksheets(Sheet1)Range(C28) = ApplicationDDERequest(Channel $OperatorEntered)Worksheets(Sheet1)Range(C29) = ApplicationDDERequest(Channel $Operator)Worksheets(Sheet1)Range(C30) = ApplicationDDERequest(Channel $PasswordEntered)ApplicationDDETerminate Channel This terminates the DDE channelEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 110

Visual Basic

ldquoRoll Your Ownrdquo HMI - Much More powerful than Excel

Key Parameters computer nameapplication|topicitem

IO Emulator - MBPlusSimulateexe

Can ldquoRead Fromrdquo amp ldquoWrite Tordquo PLC andor HMI

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 111

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 112

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 113

Dim PauseTime Start Finish TotalTime As Integer Declare variables

Private Sub txtAIT_332A_SCALED_Change()On Error GoTo PokeAIT_332AErrortxtAIT_332A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtAIT_332A_SCALEDText = Int((3 Rnd) + 20) Generate random value between 20 and 23txtAIT_332A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtAIT_332A_SCALEDLinkItem = AIT_332A_SCALEDtxtAIT_332A_SCALEDLinkMode = 2txtAIT_332A_SCALEDLinkPoketxtAIT_332A_SCALEDLinkMode = 0 DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total time

PokeAIT_332AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtAIT_332A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 114

Private Sub txtAIT_346A_SCALED_Change()On Error GoTo PokeAIT_346AErrortxtAIT_346A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtAIT_346A_SCALEDText = Int((3 Rnd) + 15) Generate random value between 15 and 18txtAIT_346A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtAIT_346A_SCALEDLinkItem = AIT_346A_SCALEDtxtAIT_346A_SCALEDLinkMode = 2txtAIT_346A_SCALEDLinkPoketxtAIT_346A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeAIT_346AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtAIT_346A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 115

Private Sub txtFIT_321A_SCALED_Change()On Error GoTo PokeFIT_321AErrortxtFIT_321A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtFIT_321A_SCALEDText = Int((10 Rnd) + 120) Generate random value between 120 and 130txtFIT_321A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_321A_SCALEDLinkItem = FIT_321A_SCALEDtxtFIT_321A_SCALEDLinkMode = 2txtFIT_321A_SCALEDLinkPoketxtFIT_321A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total time

PokeFIT_321AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_321A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume Next

End Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 116

Private Sub txtFIT_341A_SCALED_Change()On Error GoTo PokeFIT_341AErrortxtFIT_341A_SCALEDLinkMode = 0 PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTime

txtFIT_341A_SCALEDText = Int((3 Rnd) + 18) Generate random value between 18 and 21

txtFIT_341A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_341A_SCALEDLinkItem = FIT_341A_SCALEDtxtFIT_341A_SCALEDLinkMode = 2txtFIT_341A_SCALEDLinkPoketxtFIT_341A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeFIT_341AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_341A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 117

Private Sub txtFIT_343A_SCALED_Change()On Error GoTo PokeFIT_343AErrortxtFIT_343A_SCALEDLinkMode = 0 PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTime

txtFIT_343A_SCALEDText = Int((1 Rnd) + 3) Generate random value between 3 and 4

txtFIT_343A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_343A_SCALEDLinkItem = FIT_343A_SCALEDtxtFIT_343A_SCALEDLinkMode = 2txtFIT_343A_SCALEDLinkPoketxtFIT_343A_SCALEDLinkMode = 0 DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeFIT_343AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_343A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 118

TUTORIAL

Part 4

Questions

amp

Answers

  • Slide 1
  • Slide 2
  • Slide 3
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Slide 8
  • Slide 9
  • Slide 10
  • Slide 11
  • Slide 12
  • Slide 13
  • Slide 14
  • Slide 15
  • Slide 16
  • Slide 17
  • Slide 18
  • Slide 19
  • Slide 20
  • Slide 21
  • Slide 22
  • Slide 23
  • Slide 24
  • Slide 25
  • Slide 26
  • Slide 27
  • Slide 28
  • Slide 29
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
  • Slide 34
  • Slide 35
  • Slide 36
  • Slide 37
  • Slide 38
  • Slide 39
  • Slide 40
  • Slide 41
  • Slide 42
  • Slide 43
  • Slide 44
  • Slide 45
  • Slide 46
  • Slide 47
  • Slide 48
  • Slide 49
  • Slide 50
  • Slide 51
  • Slide 52
  • Slide 53
  • Slide 54
  • Slide 55
  • Slide 56
  • Slide 57
  • Slide 58
  • Slide 59
  • Slide 60
  • Slide 61
  • Slide 62
  • Slide 63
  • Slide 64
  • Slide 65
  • Slide 66
  • Slide 67
  • Slide 68
  • Slide 69
  • Slide 70
  • Slide 71
  • Slide 72
  • Slide 73
  • Slide 74
  • Slide 75
  • Slide 76
  • Slide 77
  • Slide 78
  • Slide 79
  • Slide 80
  • Slide 81
  • Slide 82
  • Slide 83
  • Slide 84
  • Slide 85
  • Slide 86
  • Slide 87
  • Slide 88
  • Slide 89
  • Slide 90
  • Slide 91
  • Slide 92
  • Slide 93
  • Slide 94
  • Slide 95
  • Slide 96
  • Slide 97
  • Slide 98
  • Slide 99
  • Slide 100
  • Slide 101
  • Slide 102
  • Slide 103
  • Slide 104
  • Slide 105
  • Slide 106
  • Slide 107
  • Slide 108
  • Slide 109
  • Slide 110
  • Slide 111
  • Slide 112
  • Slide 113
  • Slide 114
  • Slide 115
  • Slide 116
  • Slide 117
  • Slide 118
Page 97: TUTORIAL Ethernet PLC's Improve Oxygen Consumption ISA Expo/2001Houston, Texas Water & Wastewater Industry DivisionTuesday, September 11, 2001 1 Brad.

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 97

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 98

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 99

Adding a ldquoTouch Targetrdquo to a Display

2 Tell which tags to use

3 Tell which popup display to call upWhat kind of point type is it

3 Steps1 Tell which scale to use (if itrsquos an analog point type)

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 100

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 101

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 102

TUTORIAL

Part 2C

Excel Spreadsheets

amp

Visual Basic

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 103

A ldquoCHEAP amp DIRTYrdquo HMI With Excel

The 4 key parameters are

To communicate with the PLCUse brad_s_carlbergmbenet|ANOXIC_OXICrsquoplcregisterrsquo

Excel uses ldquopeeksrdquo amp ldquopokesrdquo to read from amp write to a PLC or HMI

To communicate with the HMIbrad_s_carlbergview|Tagnamersquotagnamersquo

bull computer namebull applicationbull topicbull item

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 104

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 105

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 106

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 107

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 108

Excel Macros

bull ldquoRequestrdquo Macro to read values

bull ldquoPokerdquo Macro to write values

bull A Sample Excel Macro

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 109

Sub PokeMacro()MsgBox ApplicationNetworkTemplatesPathChannel = ApplicationDDEInitiate(app=brad_s_carlbergVIEW topic=Tagname) This opens a DDE channel to ViewApplicationDDEPoke Channel Temperature1 Worksheets(Sheet1)Range(A1) Puts value from R1C1 into Temperature1ApplicationDDEPoke Channel DDEReal Worksheets(Sheet1)Range(A2) Puts value from R1C1 into Temperature1ApplicationDDEPoke Channel DDEInteger Worksheets(Sheet1)Range(A3) Puts value from R1C1 into Temperature1ApplicationDDETerminate Channel This terminates the DDE channelEnd SubSub RequestMacro()Channel = ApplicationDDEInitiate(app=brad_s_carlbergVIEW topic=Tagname) This opens a DDE channel to ViewWorksheets(Sheet1)Range(C4) = ApplicationDDERequest(Channel $Hour)Worksheets(Sheet1)Range(C5) = ApplicationDDERequest(Channel $Minute)Worksheets(Sheet1)Range(C6) = ApplicationDDERequest(Channel $Second)Worksheets(Sheet1)Range(C9) = ApplicationDDERequest(Channel $day)Worksheets(Sheet1)Range(C10) = ApplicationDDERequest(Channel $date)Worksheets(Sheet1)Range(C11) = ApplicationDDERequest(Channel $datestring)Worksheets(Sheet1)Range(C12) = ApplicationDDERequest(Channel $datetime)Worksheets(Sheet1)Range(C13) = ApplicationDDERequest(Channel $date)Worksheets(Sheet1)Range(C14) = ApplicationDDERequest(Channel $month)Worksheets(Sheet1)Range(C15) = ApplicationDDERequest(Channel $year)Worksheets(Sheet1)Range(C16) = ApplicationDDERequest(Channel $time)Worksheets(Sheet1)Range(C17) = ApplicationDDERequest(Channel $timestring)Worksheets(Sheet1)Range(C18) = ApplicationDDERequest(Channel $applicationversion)Worksheets(Sheet1)Range(C19) = ApplicationDDERequest(Channel $startddeconversations)Worksheets(Sheet1)Range(C20) = ApplicationDDERequest(Channel $accesslevel)Worksheets(Sheet1)Range(C21) = ApplicationDDERequest(Channel $alarmlogging)Worksheets(Sheet1)Range(C22) = ApplicationDDERequest(Channel $applicationchanged)Worksheets(Sheet1)Range(C23) = ApplicationDDERequest(Channel $configureusers)Worksheets(Sheet1)Range(C24) = ApplicationDDERequest(Channel $changepassword)Worksheets(Sheet1)Range(C25) = ApplicationDDERequest(Channel $InactivityTimeout)Worksheets(Sheet1)Range(C26) = ApplicationDDERequest(Channel $InactivityWarning)Worksheets(Sheet1)Range(C27) = ApplicationDDERequest(Channel $LogicRunning)Worksheets(Sheet1)Range(C28) = ApplicationDDERequest(Channel $OperatorEntered)Worksheets(Sheet1)Range(C29) = ApplicationDDERequest(Channel $Operator)Worksheets(Sheet1)Range(C30) = ApplicationDDERequest(Channel $PasswordEntered)ApplicationDDETerminate Channel This terminates the DDE channelEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 110

Visual Basic

ldquoRoll Your Ownrdquo HMI - Much More powerful than Excel

Key Parameters computer nameapplication|topicitem

IO Emulator - MBPlusSimulateexe

Can ldquoRead Fromrdquo amp ldquoWrite Tordquo PLC andor HMI

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 111

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 112

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 113

Dim PauseTime Start Finish TotalTime As Integer Declare variables

Private Sub txtAIT_332A_SCALED_Change()On Error GoTo PokeAIT_332AErrortxtAIT_332A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtAIT_332A_SCALEDText = Int((3 Rnd) + 20) Generate random value between 20 and 23txtAIT_332A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtAIT_332A_SCALEDLinkItem = AIT_332A_SCALEDtxtAIT_332A_SCALEDLinkMode = 2txtAIT_332A_SCALEDLinkPoketxtAIT_332A_SCALEDLinkMode = 0 DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total time

PokeAIT_332AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtAIT_332A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 114

Private Sub txtAIT_346A_SCALED_Change()On Error GoTo PokeAIT_346AErrortxtAIT_346A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtAIT_346A_SCALEDText = Int((3 Rnd) + 15) Generate random value between 15 and 18txtAIT_346A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtAIT_346A_SCALEDLinkItem = AIT_346A_SCALEDtxtAIT_346A_SCALEDLinkMode = 2txtAIT_346A_SCALEDLinkPoketxtAIT_346A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeAIT_346AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtAIT_346A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 115

Private Sub txtFIT_321A_SCALED_Change()On Error GoTo PokeFIT_321AErrortxtFIT_321A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtFIT_321A_SCALEDText = Int((10 Rnd) + 120) Generate random value between 120 and 130txtFIT_321A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_321A_SCALEDLinkItem = FIT_321A_SCALEDtxtFIT_321A_SCALEDLinkMode = 2txtFIT_321A_SCALEDLinkPoketxtFIT_321A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total time

PokeFIT_321AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_321A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume Next

End Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 116

Private Sub txtFIT_341A_SCALED_Change()On Error GoTo PokeFIT_341AErrortxtFIT_341A_SCALEDLinkMode = 0 PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTime

txtFIT_341A_SCALEDText = Int((3 Rnd) + 18) Generate random value between 18 and 21

txtFIT_341A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_341A_SCALEDLinkItem = FIT_341A_SCALEDtxtFIT_341A_SCALEDLinkMode = 2txtFIT_341A_SCALEDLinkPoketxtFIT_341A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeFIT_341AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_341A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 117

Private Sub txtFIT_343A_SCALED_Change()On Error GoTo PokeFIT_343AErrortxtFIT_343A_SCALEDLinkMode = 0 PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTime

txtFIT_343A_SCALEDText = Int((1 Rnd) + 3) Generate random value between 3 and 4

txtFIT_343A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_343A_SCALEDLinkItem = FIT_343A_SCALEDtxtFIT_343A_SCALEDLinkMode = 2txtFIT_343A_SCALEDLinkPoketxtFIT_343A_SCALEDLinkMode = 0 DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeFIT_343AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_343A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 118

TUTORIAL

Part 4

Questions

amp

Answers

  • Slide 1
  • Slide 2
  • Slide 3
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Slide 8
  • Slide 9
  • Slide 10
  • Slide 11
  • Slide 12
  • Slide 13
  • Slide 14
  • Slide 15
  • Slide 16
  • Slide 17
  • Slide 18
  • Slide 19
  • Slide 20
  • Slide 21
  • Slide 22
  • Slide 23
  • Slide 24
  • Slide 25
  • Slide 26
  • Slide 27
  • Slide 28
  • Slide 29
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
  • Slide 34
  • Slide 35
  • Slide 36
  • Slide 37
  • Slide 38
  • Slide 39
  • Slide 40
  • Slide 41
  • Slide 42
  • Slide 43
  • Slide 44
  • Slide 45
  • Slide 46
  • Slide 47
  • Slide 48
  • Slide 49
  • Slide 50
  • Slide 51
  • Slide 52
  • Slide 53
  • Slide 54
  • Slide 55
  • Slide 56
  • Slide 57
  • Slide 58
  • Slide 59
  • Slide 60
  • Slide 61
  • Slide 62
  • Slide 63
  • Slide 64
  • Slide 65
  • Slide 66
  • Slide 67
  • Slide 68
  • Slide 69
  • Slide 70
  • Slide 71
  • Slide 72
  • Slide 73
  • Slide 74
  • Slide 75
  • Slide 76
  • Slide 77
  • Slide 78
  • Slide 79
  • Slide 80
  • Slide 81
  • Slide 82
  • Slide 83
  • Slide 84
  • Slide 85
  • Slide 86
  • Slide 87
  • Slide 88
  • Slide 89
  • Slide 90
  • Slide 91
  • Slide 92
  • Slide 93
  • Slide 94
  • Slide 95
  • Slide 96
  • Slide 97
  • Slide 98
  • Slide 99
  • Slide 100
  • Slide 101
  • Slide 102
  • Slide 103
  • Slide 104
  • Slide 105
  • Slide 106
  • Slide 107
  • Slide 108
  • Slide 109
  • Slide 110
  • Slide 111
  • Slide 112
  • Slide 113
  • Slide 114
  • Slide 115
  • Slide 116
  • Slide 117
  • Slide 118
Page 98: TUTORIAL Ethernet PLC's Improve Oxygen Consumption ISA Expo/2001Houston, Texas Water & Wastewater Industry DivisionTuesday, September 11, 2001 1 Brad.

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 98

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 99

Adding a ldquoTouch Targetrdquo to a Display

2 Tell which tags to use

3 Tell which popup display to call upWhat kind of point type is it

3 Steps1 Tell which scale to use (if itrsquos an analog point type)

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 100

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 101

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 102

TUTORIAL

Part 2C

Excel Spreadsheets

amp

Visual Basic

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 103

A ldquoCHEAP amp DIRTYrdquo HMI With Excel

The 4 key parameters are

To communicate with the PLCUse brad_s_carlbergmbenet|ANOXIC_OXICrsquoplcregisterrsquo

Excel uses ldquopeeksrdquo amp ldquopokesrdquo to read from amp write to a PLC or HMI

To communicate with the HMIbrad_s_carlbergview|Tagnamersquotagnamersquo

bull computer namebull applicationbull topicbull item

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 104

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 105

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 106

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 107

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 108

Excel Macros

bull ldquoRequestrdquo Macro to read values

bull ldquoPokerdquo Macro to write values

bull A Sample Excel Macro

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 109

Sub PokeMacro()MsgBox ApplicationNetworkTemplatesPathChannel = ApplicationDDEInitiate(app=brad_s_carlbergVIEW topic=Tagname) This opens a DDE channel to ViewApplicationDDEPoke Channel Temperature1 Worksheets(Sheet1)Range(A1) Puts value from R1C1 into Temperature1ApplicationDDEPoke Channel DDEReal Worksheets(Sheet1)Range(A2) Puts value from R1C1 into Temperature1ApplicationDDEPoke Channel DDEInteger Worksheets(Sheet1)Range(A3) Puts value from R1C1 into Temperature1ApplicationDDETerminate Channel This terminates the DDE channelEnd SubSub RequestMacro()Channel = ApplicationDDEInitiate(app=brad_s_carlbergVIEW topic=Tagname) This opens a DDE channel to ViewWorksheets(Sheet1)Range(C4) = ApplicationDDERequest(Channel $Hour)Worksheets(Sheet1)Range(C5) = ApplicationDDERequest(Channel $Minute)Worksheets(Sheet1)Range(C6) = ApplicationDDERequest(Channel $Second)Worksheets(Sheet1)Range(C9) = ApplicationDDERequest(Channel $day)Worksheets(Sheet1)Range(C10) = ApplicationDDERequest(Channel $date)Worksheets(Sheet1)Range(C11) = ApplicationDDERequest(Channel $datestring)Worksheets(Sheet1)Range(C12) = ApplicationDDERequest(Channel $datetime)Worksheets(Sheet1)Range(C13) = ApplicationDDERequest(Channel $date)Worksheets(Sheet1)Range(C14) = ApplicationDDERequest(Channel $month)Worksheets(Sheet1)Range(C15) = ApplicationDDERequest(Channel $year)Worksheets(Sheet1)Range(C16) = ApplicationDDERequest(Channel $time)Worksheets(Sheet1)Range(C17) = ApplicationDDERequest(Channel $timestring)Worksheets(Sheet1)Range(C18) = ApplicationDDERequest(Channel $applicationversion)Worksheets(Sheet1)Range(C19) = ApplicationDDERequest(Channel $startddeconversations)Worksheets(Sheet1)Range(C20) = ApplicationDDERequest(Channel $accesslevel)Worksheets(Sheet1)Range(C21) = ApplicationDDERequest(Channel $alarmlogging)Worksheets(Sheet1)Range(C22) = ApplicationDDERequest(Channel $applicationchanged)Worksheets(Sheet1)Range(C23) = ApplicationDDERequest(Channel $configureusers)Worksheets(Sheet1)Range(C24) = ApplicationDDERequest(Channel $changepassword)Worksheets(Sheet1)Range(C25) = ApplicationDDERequest(Channel $InactivityTimeout)Worksheets(Sheet1)Range(C26) = ApplicationDDERequest(Channel $InactivityWarning)Worksheets(Sheet1)Range(C27) = ApplicationDDERequest(Channel $LogicRunning)Worksheets(Sheet1)Range(C28) = ApplicationDDERequest(Channel $OperatorEntered)Worksheets(Sheet1)Range(C29) = ApplicationDDERequest(Channel $Operator)Worksheets(Sheet1)Range(C30) = ApplicationDDERequest(Channel $PasswordEntered)ApplicationDDETerminate Channel This terminates the DDE channelEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 110

Visual Basic

ldquoRoll Your Ownrdquo HMI - Much More powerful than Excel

Key Parameters computer nameapplication|topicitem

IO Emulator - MBPlusSimulateexe

Can ldquoRead Fromrdquo amp ldquoWrite Tordquo PLC andor HMI

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 111

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 112

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 113

Dim PauseTime Start Finish TotalTime As Integer Declare variables

Private Sub txtAIT_332A_SCALED_Change()On Error GoTo PokeAIT_332AErrortxtAIT_332A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtAIT_332A_SCALEDText = Int((3 Rnd) + 20) Generate random value between 20 and 23txtAIT_332A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtAIT_332A_SCALEDLinkItem = AIT_332A_SCALEDtxtAIT_332A_SCALEDLinkMode = 2txtAIT_332A_SCALEDLinkPoketxtAIT_332A_SCALEDLinkMode = 0 DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total time

PokeAIT_332AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtAIT_332A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 114

Private Sub txtAIT_346A_SCALED_Change()On Error GoTo PokeAIT_346AErrortxtAIT_346A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtAIT_346A_SCALEDText = Int((3 Rnd) + 15) Generate random value between 15 and 18txtAIT_346A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtAIT_346A_SCALEDLinkItem = AIT_346A_SCALEDtxtAIT_346A_SCALEDLinkMode = 2txtAIT_346A_SCALEDLinkPoketxtAIT_346A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeAIT_346AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtAIT_346A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 115

Private Sub txtFIT_321A_SCALED_Change()On Error GoTo PokeFIT_321AErrortxtFIT_321A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtFIT_321A_SCALEDText = Int((10 Rnd) + 120) Generate random value between 120 and 130txtFIT_321A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_321A_SCALEDLinkItem = FIT_321A_SCALEDtxtFIT_321A_SCALEDLinkMode = 2txtFIT_321A_SCALEDLinkPoketxtFIT_321A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total time

PokeFIT_321AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_321A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume Next

End Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 116

Private Sub txtFIT_341A_SCALED_Change()On Error GoTo PokeFIT_341AErrortxtFIT_341A_SCALEDLinkMode = 0 PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTime

txtFIT_341A_SCALEDText = Int((3 Rnd) + 18) Generate random value between 18 and 21

txtFIT_341A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_341A_SCALEDLinkItem = FIT_341A_SCALEDtxtFIT_341A_SCALEDLinkMode = 2txtFIT_341A_SCALEDLinkPoketxtFIT_341A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeFIT_341AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_341A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 117

Private Sub txtFIT_343A_SCALED_Change()On Error GoTo PokeFIT_343AErrortxtFIT_343A_SCALEDLinkMode = 0 PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTime

txtFIT_343A_SCALEDText = Int((1 Rnd) + 3) Generate random value between 3 and 4

txtFIT_343A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_343A_SCALEDLinkItem = FIT_343A_SCALEDtxtFIT_343A_SCALEDLinkMode = 2txtFIT_343A_SCALEDLinkPoketxtFIT_343A_SCALEDLinkMode = 0 DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeFIT_343AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_343A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 118

TUTORIAL

Part 4

Questions

amp

Answers

  • Slide 1
  • Slide 2
  • Slide 3
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Slide 8
  • Slide 9
  • Slide 10
  • Slide 11
  • Slide 12
  • Slide 13
  • Slide 14
  • Slide 15
  • Slide 16
  • Slide 17
  • Slide 18
  • Slide 19
  • Slide 20
  • Slide 21
  • Slide 22
  • Slide 23
  • Slide 24
  • Slide 25
  • Slide 26
  • Slide 27
  • Slide 28
  • Slide 29
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
  • Slide 34
  • Slide 35
  • Slide 36
  • Slide 37
  • Slide 38
  • Slide 39
  • Slide 40
  • Slide 41
  • Slide 42
  • Slide 43
  • Slide 44
  • Slide 45
  • Slide 46
  • Slide 47
  • Slide 48
  • Slide 49
  • Slide 50
  • Slide 51
  • Slide 52
  • Slide 53
  • Slide 54
  • Slide 55
  • Slide 56
  • Slide 57
  • Slide 58
  • Slide 59
  • Slide 60
  • Slide 61
  • Slide 62
  • Slide 63
  • Slide 64
  • Slide 65
  • Slide 66
  • Slide 67
  • Slide 68
  • Slide 69
  • Slide 70
  • Slide 71
  • Slide 72
  • Slide 73
  • Slide 74
  • Slide 75
  • Slide 76
  • Slide 77
  • Slide 78
  • Slide 79
  • Slide 80
  • Slide 81
  • Slide 82
  • Slide 83
  • Slide 84
  • Slide 85
  • Slide 86
  • Slide 87
  • Slide 88
  • Slide 89
  • Slide 90
  • Slide 91
  • Slide 92
  • Slide 93
  • Slide 94
  • Slide 95
  • Slide 96
  • Slide 97
  • Slide 98
  • Slide 99
  • Slide 100
  • Slide 101
  • Slide 102
  • Slide 103
  • Slide 104
  • Slide 105
  • Slide 106
  • Slide 107
  • Slide 108
  • Slide 109
  • Slide 110
  • Slide 111
  • Slide 112
  • Slide 113
  • Slide 114
  • Slide 115
  • Slide 116
  • Slide 117
  • Slide 118
Page 99: TUTORIAL Ethernet PLC's Improve Oxygen Consumption ISA Expo/2001Houston, Texas Water & Wastewater Industry DivisionTuesday, September 11, 2001 1 Brad.

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 99

Adding a ldquoTouch Targetrdquo to a Display

2 Tell which tags to use

3 Tell which popup display to call upWhat kind of point type is it

3 Steps1 Tell which scale to use (if itrsquos an analog point type)

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 100

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 101

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 102

TUTORIAL

Part 2C

Excel Spreadsheets

amp

Visual Basic

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 103

A ldquoCHEAP amp DIRTYrdquo HMI With Excel

The 4 key parameters are

To communicate with the PLCUse brad_s_carlbergmbenet|ANOXIC_OXICrsquoplcregisterrsquo

Excel uses ldquopeeksrdquo amp ldquopokesrdquo to read from amp write to a PLC or HMI

To communicate with the HMIbrad_s_carlbergview|Tagnamersquotagnamersquo

bull computer namebull applicationbull topicbull item

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 104

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 105

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 106

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 107

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 108

Excel Macros

bull ldquoRequestrdquo Macro to read values

bull ldquoPokerdquo Macro to write values

bull A Sample Excel Macro

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 109

Sub PokeMacro()MsgBox ApplicationNetworkTemplatesPathChannel = ApplicationDDEInitiate(app=brad_s_carlbergVIEW topic=Tagname) This opens a DDE channel to ViewApplicationDDEPoke Channel Temperature1 Worksheets(Sheet1)Range(A1) Puts value from R1C1 into Temperature1ApplicationDDEPoke Channel DDEReal Worksheets(Sheet1)Range(A2) Puts value from R1C1 into Temperature1ApplicationDDEPoke Channel DDEInteger Worksheets(Sheet1)Range(A3) Puts value from R1C1 into Temperature1ApplicationDDETerminate Channel This terminates the DDE channelEnd SubSub RequestMacro()Channel = ApplicationDDEInitiate(app=brad_s_carlbergVIEW topic=Tagname) This opens a DDE channel to ViewWorksheets(Sheet1)Range(C4) = ApplicationDDERequest(Channel $Hour)Worksheets(Sheet1)Range(C5) = ApplicationDDERequest(Channel $Minute)Worksheets(Sheet1)Range(C6) = ApplicationDDERequest(Channel $Second)Worksheets(Sheet1)Range(C9) = ApplicationDDERequest(Channel $day)Worksheets(Sheet1)Range(C10) = ApplicationDDERequest(Channel $date)Worksheets(Sheet1)Range(C11) = ApplicationDDERequest(Channel $datestring)Worksheets(Sheet1)Range(C12) = ApplicationDDERequest(Channel $datetime)Worksheets(Sheet1)Range(C13) = ApplicationDDERequest(Channel $date)Worksheets(Sheet1)Range(C14) = ApplicationDDERequest(Channel $month)Worksheets(Sheet1)Range(C15) = ApplicationDDERequest(Channel $year)Worksheets(Sheet1)Range(C16) = ApplicationDDERequest(Channel $time)Worksheets(Sheet1)Range(C17) = ApplicationDDERequest(Channel $timestring)Worksheets(Sheet1)Range(C18) = ApplicationDDERequest(Channel $applicationversion)Worksheets(Sheet1)Range(C19) = ApplicationDDERequest(Channel $startddeconversations)Worksheets(Sheet1)Range(C20) = ApplicationDDERequest(Channel $accesslevel)Worksheets(Sheet1)Range(C21) = ApplicationDDERequest(Channel $alarmlogging)Worksheets(Sheet1)Range(C22) = ApplicationDDERequest(Channel $applicationchanged)Worksheets(Sheet1)Range(C23) = ApplicationDDERequest(Channel $configureusers)Worksheets(Sheet1)Range(C24) = ApplicationDDERequest(Channel $changepassword)Worksheets(Sheet1)Range(C25) = ApplicationDDERequest(Channel $InactivityTimeout)Worksheets(Sheet1)Range(C26) = ApplicationDDERequest(Channel $InactivityWarning)Worksheets(Sheet1)Range(C27) = ApplicationDDERequest(Channel $LogicRunning)Worksheets(Sheet1)Range(C28) = ApplicationDDERequest(Channel $OperatorEntered)Worksheets(Sheet1)Range(C29) = ApplicationDDERequest(Channel $Operator)Worksheets(Sheet1)Range(C30) = ApplicationDDERequest(Channel $PasswordEntered)ApplicationDDETerminate Channel This terminates the DDE channelEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 110

Visual Basic

ldquoRoll Your Ownrdquo HMI - Much More powerful than Excel

Key Parameters computer nameapplication|topicitem

IO Emulator - MBPlusSimulateexe

Can ldquoRead Fromrdquo amp ldquoWrite Tordquo PLC andor HMI

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 111

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 112

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 113

Dim PauseTime Start Finish TotalTime As Integer Declare variables

Private Sub txtAIT_332A_SCALED_Change()On Error GoTo PokeAIT_332AErrortxtAIT_332A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtAIT_332A_SCALEDText = Int((3 Rnd) + 20) Generate random value between 20 and 23txtAIT_332A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtAIT_332A_SCALEDLinkItem = AIT_332A_SCALEDtxtAIT_332A_SCALEDLinkMode = 2txtAIT_332A_SCALEDLinkPoketxtAIT_332A_SCALEDLinkMode = 0 DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total time

PokeAIT_332AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtAIT_332A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 114

Private Sub txtAIT_346A_SCALED_Change()On Error GoTo PokeAIT_346AErrortxtAIT_346A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtAIT_346A_SCALEDText = Int((3 Rnd) + 15) Generate random value between 15 and 18txtAIT_346A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtAIT_346A_SCALEDLinkItem = AIT_346A_SCALEDtxtAIT_346A_SCALEDLinkMode = 2txtAIT_346A_SCALEDLinkPoketxtAIT_346A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeAIT_346AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtAIT_346A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 115

Private Sub txtFIT_321A_SCALED_Change()On Error GoTo PokeFIT_321AErrortxtFIT_321A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtFIT_321A_SCALEDText = Int((10 Rnd) + 120) Generate random value between 120 and 130txtFIT_321A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_321A_SCALEDLinkItem = FIT_321A_SCALEDtxtFIT_321A_SCALEDLinkMode = 2txtFIT_321A_SCALEDLinkPoketxtFIT_321A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total time

PokeFIT_321AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_321A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume Next

End Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 116

Private Sub txtFIT_341A_SCALED_Change()On Error GoTo PokeFIT_341AErrortxtFIT_341A_SCALEDLinkMode = 0 PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTime

txtFIT_341A_SCALEDText = Int((3 Rnd) + 18) Generate random value between 18 and 21

txtFIT_341A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_341A_SCALEDLinkItem = FIT_341A_SCALEDtxtFIT_341A_SCALEDLinkMode = 2txtFIT_341A_SCALEDLinkPoketxtFIT_341A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeFIT_341AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_341A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 117

Private Sub txtFIT_343A_SCALED_Change()On Error GoTo PokeFIT_343AErrortxtFIT_343A_SCALEDLinkMode = 0 PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTime

txtFIT_343A_SCALEDText = Int((1 Rnd) + 3) Generate random value between 3 and 4

txtFIT_343A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_343A_SCALEDLinkItem = FIT_343A_SCALEDtxtFIT_343A_SCALEDLinkMode = 2txtFIT_343A_SCALEDLinkPoketxtFIT_343A_SCALEDLinkMode = 0 DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeFIT_343AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_343A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 118

TUTORIAL

Part 4

Questions

amp

Answers

  • Slide 1
  • Slide 2
  • Slide 3
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Slide 8
  • Slide 9
  • Slide 10
  • Slide 11
  • Slide 12
  • Slide 13
  • Slide 14
  • Slide 15
  • Slide 16
  • Slide 17
  • Slide 18
  • Slide 19
  • Slide 20
  • Slide 21
  • Slide 22
  • Slide 23
  • Slide 24
  • Slide 25
  • Slide 26
  • Slide 27
  • Slide 28
  • Slide 29
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
  • Slide 34
  • Slide 35
  • Slide 36
  • Slide 37
  • Slide 38
  • Slide 39
  • Slide 40
  • Slide 41
  • Slide 42
  • Slide 43
  • Slide 44
  • Slide 45
  • Slide 46
  • Slide 47
  • Slide 48
  • Slide 49
  • Slide 50
  • Slide 51
  • Slide 52
  • Slide 53
  • Slide 54
  • Slide 55
  • Slide 56
  • Slide 57
  • Slide 58
  • Slide 59
  • Slide 60
  • Slide 61
  • Slide 62
  • Slide 63
  • Slide 64
  • Slide 65
  • Slide 66
  • Slide 67
  • Slide 68
  • Slide 69
  • Slide 70
  • Slide 71
  • Slide 72
  • Slide 73
  • Slide 74
  • Slide 75
  • Slide 76
  • Slide 77
  • Slide 78
  • Slide 79
  • Slide 80
  • Slide 81
  • Slide 82
  • Slide 83
  • Slide 84
  • Slide 85
  • Slide 86
  • Slide 87
  • Slide 88
  • Slide 89
  • Slide 90
  • Slide 91
  • Slide 92
  • Slide 93
  • Slide 94
  • Slide 95
  • Slide 96
  • Slide 97
  • Slide 98
  • Slide 99
  • Slide 100
  • Slide 101
  • Slide 102
  • Slide 103
  • Slide 104
  • Slide 105
  • Slide 106
  • Slide 107
  • Slide 108
  • Slide 109
  • Slide 110
  • Slide 111
  • Slide 112
  • Slide 113
  • Slide 114
  • Slide 115
  • Slide 116
  • Slide 117
  • Slide 118
Page 100: TUTORIAL Ethernet PLC's Improve Oxygen Consumption ISA Expo/2001Houston, Texas Water & Wastewater Industry DivisionTuesday, September 11, 2001 1 Brad.

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 100

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 101

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 102

TUTORIAL

Part 2C

Excel Spreadsheets

amp

Visual Basic

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 103

A ldquoCHEAP amp DIRTYrdquo HMI With Excel

The 4 key parameters are

To communicate with the PLCUse brad_s_carlbergmbenet|ANOXIC_OXICrsquoplcregisterrsquo

Excel uses ldquopeeksrdquo amp ldquopokesrdquo to read from amp write to a PLC or HMI

To communicate with the HMIbrad_s_carlbergview|Tagnamersquotagnamersquo

bull computer namebull applicationbull topicbull item

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 104

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 105

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 106

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 107

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 108

Excel Macros

bull ldquoRequestrdquo Macro to read values

bull ldquoPokerdquo Macro to write values

bull A Sample Excel Macro

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 109

Sub PokeMacro()MsgBox ApplicationNetworkTemplatesPathChannel = ApplicationDDEInitiate(app=brad_s_carlbergVIEW topic=Tagname) This opens a DDE channel to ViewApplicationDDEPoke Channel Temperature1 Worksheets(Sheet1)Range(A1) Puts value from R1C1 into Temperature1ApplicationDDEPoke Channel DDEReal Worksheets(Sheet1)Range(A2) Puts value from R1C1 into Temperature1ApplicationDDEPoke Channel DDEInteger Worksheets(Sheet1)Range(A3) Puts value from R1C1 into Temperature1ApplicationDDETerminate Channel This terminates the DDE channelEnd SubSub RequestMacro()Channel = ApplicationDDEInitiate(app=brad_s_carlbergVIEW topic=Tagname) This opens a DDE channel to ViewWorksheets(Sheet1)Range(C4) = ApplicationDDERequest(Channel $Hour)Worksheets(Sheet1)Range(C5) = ApplicationDDERequest(Channel $Minute)Worksheets(Sheet1)Range(C6) = ApplicationDDERequest(Channel $Second)Worksheets(Sheet1)Range(C9) = ApplicationDDERequest(Channel $day)Worksheets(Sheet1)Range(C10) = ApplicationDDERequest(Channel $date)Worksheets(Sheet1)Range(C11) = ApplicationDDERequest(Channel $datestring)Worksheets(Sheet1)Range(C12) = ApplicationDDERequest(Channel $datetime)Worksheets(Sheet1)Range(C13) = ApplicationDDERequest(Channel $date)Worksheets(Sheet1)Range(C14) = ApplicationDDERequest(Channel $month)Worksheets(Sheet1)Range(C15) = ApplicationDDERequest(Channel $year)Worksheets(Sheet1)Range(C16) = ApplicationDDERequest(Channel $time)Worksheets(Sheet1)Range(C17) = ApplicationDDERequest(Channel $timestring)Worksheets(Sheet1)Range(C18) = ApplicationDDERequest(Channel $applicationversion)Worksheets(Sheet1)Range(C19) = ApplicationDDERequest(Channel $startddeconversations)Worksheets(Sheet1)Range(C20) = ApplicationDDERequest(Channel $accesslevel)Worksheets(Sheet1)Range(C21) = ApplicationDDERequest(Channel $alarmlogging)Worksheets(Sheet1)Range(C22) = ApplicationDDERequest(Channel $applicationchanged)Worksheets(Sheet1)Range(C23) = ApplicationDDERequest(Channel $configureusers)Worksheets(Sheet1)Range(C24) = ApplicationDDERequest(Channel $changepassword)Worksheets(Sheet1)Range(C25) = ApplicationDDERequest(Channel $InactivityTimeout)Worksheets(Sheet1)Range(C26) = ApplicationDDERequest(Channel $InactivityWarning)Worksheets(Sheet1)Range(C27) = ApplicationDDERequest(Channel $LogicRunning)Worksheets(Sheet1)Range(C28) = ApplicationDDERequest(Channel $OperatorEntered)Worksheets(Sheet1)Range(C29) = ApplicationDDERequest(Channel $Operator)Worksheets(Sheet1)Range(C30) = ApplicationDDERequest(Channel $PasswordEntered)ApplicationDDETerminate Channel This terminates the DDE channelEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 110

Visual Basic

ldquoRoll Your Ownrdquo HMI - Much More powerful than Excel

Key Parameters computer nameapplication|topicitem

IO Emulator - MBPlusSimulateexe

Can ldquoRead Fromrdquo amp ldquoWrite Tordquo PLC andor HMI

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 111

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 112

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 113

Dim PauseTime Start Finish TotalTime As Integer Declare variables

Private Sub txtAIT_332A_SCALED_Change()On Error GoTo PokeAIT_332AErrortxtAIT_332A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtAIT_332A_SCALEDText = Int((3 Rnd) + 20) Generate random value between 20 and 23txtAIT_332A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtAIT_332A_SCALEDLinkItem = AIT_332A_SCALEDtxtAIT_332A_SCALEDLinkMode = 2txtAIT_332A_SCALEDLinkPoketxtAIT_332A_SCALEDLinkMode = 0 DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total time

PokeAIT_332AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtAIT_332A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 114

Private Sub txtAIT_346A_SCALED_Change()On Error GoTo PokeAIT_346AErrortxtAIT_346A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtAIT_346A_SCALEDText = Int((3 Rnd) + 15) Generate random value between 15 and 18txtAIT_346A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtAIT_346A_SCALEDLinkItem = AIT_346A_SCALEDtxtAIT_346A_SCALEDLinkMode = 2txtAIT_346A_SCALEDLinkPoketxtAIT_346A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeAIT_346AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtAIT_346A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 115

Private Sub txtFIT_321A_SCALED_Change()On Error GoTo PokeFIT_321AErrortxtFIT_321A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtFIT_321A_SCALEDText = Int((10 Rnd) + 120) Generate random value between 120 and 130txtFIT_321A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_321A_SCALEDLinkItem = FIT_321A_SCALEDtxtFIT_321A_SCALEDLinkMode = 2txtFIT_321A_SCALEDLinkPoketxtFIT_321A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total time

PokeFIT_321AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_321A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume Next

End Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 116

Private Sub txtFIT_341A_SCALED_Change()On Error GoTo PokeFIT_341AErrortxtFIT_341A_SCALEDLinkMode = 0 PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTime

txtFIT_341A_SCALEDText = Int((3 Rnd) + 18) Generate random value between 18 and 21

txtFIT_341A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_341A_SCALEDLinkItem = FIT_341A_SCALEDtxtFIT_341A_SCALEDLinkMode = 2txtFIT_341A_SCALEDLinkPoketxtFIT_341A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeFIT_341AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_341A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 117

Private Sub txtFIT_343A_SCALED_Change()On Error GoTo PokeFIT_343AErrortxtFIT_343A_SCALEDLinkMode = 0 PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTime

txtFIT_343A_SCALEDText = Int((1 Rnd) + 3) Generate random value between 3 and 4

txtFIT_343A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_343A_SCALEDLinkItem = FIT_343A_SCALEDtxtFIT_343A_SCALEDLinkMode = 2txtFIT_343A_SCALEDLinkPoketxtFIT_343A_SCALEDLinkMode = 0 DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeFIT_343AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_343A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 118

TUTORIAL

Part 4

Questions

amp

Answers

  • Slide 1
  • Slide 2
  • Slide 3
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Slide 8
  • Slide 9
  • Slide 10
  • Slide 11
  • Slide 12
  • Slide 13
  • Slide 14
  • Slide 15
  • Slide 16
  • Slide 17
  • Slide 18
  • Slide 19
  • Slide 20
  • Slide 21
  • Slide 22
  • Slide 23
  • Slide 24
  • Slide 25
  • Slide 26
  • Slide 27
  • Slide 28
  • Slide 29
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
  • Slide 34
  • Slide 35
  • Slide 36
  • Slide 37
  • Slide 38
  • Slide 39
  • Slide 40
  • Slide 41
  • Slide 42
  • Slide 43
  • Slide 44
  • Slide 45
  • Slide 46
  • Slide 47
  • Slide 48
  • Slide 49
  • Slide 50
  • Slide 51
  • Slide 52
  • Slide 53
  • Slide 54
  • Slide 55
  • Slide 56
  • Slide 57
  • Slide 58
  • Slide 59
  • Slide 60
  • Slide 61
  • Slide 62
  • Slide 63
  • Slide 64
  • Slide 65
  • Slide 66
  • Slide 67
  • Slide 68
  • Slide 69
  • Slide 70
  • Slide 71
  • Slide 72
  • Slide 73
  • Slide 74
  • Slide 75
  • Slide 76
  • Slide 77
  • Slide 78
  • Slide 79
  • Slide 80
  • Slide 81
  • Slide 82
  • Slide 83
  • Slide 84
  • Slide 85
  • Slide 86
  • Slide 87
  • Slide 88
  • Slide 89
  • Slide 90
  • Slide 91
  • Slide 92
  • Slide 93
  • Slide 94
  • Slide 95
  • Slide 96
  • Slide 97
  • Slide 98
  • Slide 99
  • Slide 100
  • Slide 101
  • Slide 102
  • Slide 103
  • Slide 104
  • Slide 105
  • Slide 106
  • Slide 107
  • Slide 108
  • Slide 109
  • Slide 110
  • Slide 111
  • Slide 112
  • Slide 113
  • Slide 114
  • Slide 115
  • Slide 116
  • Slide 117
  • Slide 118
Page 101: TUTORIAL Ethernet PLC's Improve Oxygen Consumption ISA Expo/2001Houston, Texas Water & Wastewater Industry DivisionTuesday, September 11, 2001 1 Brad.

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 101

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 102

TUTORIAL

Part 2C

Excel Spreadsheets

amp

Visual Basic

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 103

A ldquoCHEAP amp DIRTYrdquo HMI With Excel

The 4 key parameters are

To communicate with the PLCUse brad_s_carlbergmbenet|ANOXIC_OXICrsquoplcregisterrsquo

Excel uses ldquopeeksrdquo amp ldquopokesrdquo to read from amp write to a PLC or HMI

To communicate with the HMIbrad_s_carlbergview|Tagnamersquotagnamersquo

bull computer namebull applicationbull topicbull item

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 104

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 105

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 106

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 107

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 108

Excel Macros

bull ldquoRequestrdquo Macro to read values

bull ldquoPokerdquo Macro to write values

bull A Sample Excel Macro

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 109

Sub PokeMacro()MsgBox ApplicationNetworkTemplatesPathChannel = ApplicationDDEInitiate(app=brad_s_carlbergVIEW topic=Tagname) This opens a DDE channel to ViewApplicationDDEPoke Channel Temperature1 Worksheets(Sheet1)Range(A1) Puts value from R1C1 into Temperature1ApplicationDDEPoke Channel DDEReal Worksheets(Sheet1)Range(A2) Puts value from R1C1 into Temperature1ApplicationDDEPoke Channel DDEInteger Worksheets(Sheet1)Range(A3) Puts value from R1C1 into Temperature1ApplicationDDETerminate Channel This terminates the DDE channelEnd SubSub RequestMacro()Channel = ApplicationDDEInitiate(app=brad_s_carlbergVIEW topic=Tagname) This opens a DDE channel to ViewWorksheets(Sheet1)Range(C4) = ApplicationDDERequest(Channel $Hour)Worksheets(Sheet1)Range(C5) = ApplicationDDERequest(Channel $Minute)Worksheets(Sheet1)Range(C6) = ApplicationDDERequest(Channel $Second)Worksheets(Sheet1)Range(C9) = ApplicationDDERequest(Channel $day)Worksheets(Sheet1)Range(C10) = ApplicationDDERequest(Channel $date)Worksheets(Sheet1)Range(C11) = ApplicationDDERequest(Channel $datestring)Worksheets(Sheet1)Range(C12) = ApplicationDDERequest(Channel $datetime)Worksheets(Sheet1)Range(C13) = ApplicationDDERequest(Channel $date)Worksheets(Sheet1)Range(C14) = ApplicationDDERequest(Channel $month)Worksheets(Sheet1)Range(C15) = ApplicationDDERequest(Channel $year)Worksheets(Sheet1)Range(C16) = ApplicationDDERequest(Channel $time)Worksheets(Sheet1)Range(C17) = ApplicationDDERequest(Channel $timestring)Worksheets(Sheet1)Range(C18) = ApplicationDDERequest(Channel $applicationversion)Worksheets(Sheet1)Range(C19) = ApplicationDDERequest(Channel $startddeconversations)Worksheets(Sheet1)Range(C20) = ApplicationDDERequest(Channel $accesslevel)Worksheets(Sheet1)Range(C21) = ApplicationDDERequest(Channel $alarmlogging)Worksheets(Sheet1)Range(C22) = ApplicationDDERequest(Channel $applicationchanged)Worksheets(Sheet1)Range(C23) = ApplicationDDERequest(Channel $configureusers)Worksheets(Sheet1)Range(C24) = ApplicationDDERequest(Channel $changepassword)Worksheets(Sheet1)Range(C25) = ApplicationDDERequest(Channel $InactivityTimeout)Worksheets(Sheet1)Range(C26) = ApplicationDDERequest(Channel $InactivityWarning)Worksheets(Sheet1)Range(C27) = ApplicationDDERequest(Channel $LogicRunning)Worksheets(Sheet1)Range(C28) = ApplicationDDERequest(Channel $OperatorEntered)Worksheets(Sheet1)Range(C29) = ApplicationDDERequest(Channel $Operator)Worksheets(Sheet1)Range(C30) = ApplicationDDERequest(Channel $PasswordEntered)ApplicationDDETerminate Channel This terminates the DDE channelEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 110

Visual Basic

ldquoRoll Your Ownrdquo HMI - Much More powerful than Excel

Key Parameters computer nameapplication|topicitem

IO Emulator - MBPlusSimulateexe

Can ldquoRead Fromrdquo amp ldquoWrite Tordquo PLC andor HMI

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 111

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 112

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 113

Dim PauseTime Start Finish TotalTime As Integer Declare variables

Private Sub txtAIT_332A_SCALED_Change()On Error GoTo PokeAIT_332AErrortxtAIT_332A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtAIT_332A_SCALEDText = Int((3 Rnd) + 20) Generate random value between 20 and 23txtAIT_332A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtAIT_332A_SCALEDLinkItem = AIT_332A_SCALEDtxtAIT_332A_SCALEDLinkMode = 2txtAIT_332A_SCALEDLinkPoketxtAIT_332A_SCALEDLinkMode = 0 DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total time

PokeAIT_332AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtAIT_332A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 114

Private Sub txtAIT_346A_SCALED_Change()On Error GoTo PokeAIT_346AErrortxtAIT_346A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtAIT_346A_SCALEDText = Int((3 Rnd) + 15) Generate random value between 15 and 18txtAIT_346A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtAIT_346A_SCALEDLinkItem = AIT_346A_SCALEDtxtAIT_346A_SCALEDLinkMode = 2txtAIT_346A_SCALEDLinkPoketxtAIT_346A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeAIT_346AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtAIT_346A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 115

Private Sub txtFIT_321A_SCALED_Change()On Error GoTo PokeFIT_321AErrortxtFIT_321A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtFIT_321A_SCALEDText = Int((10 Rnd) + 120) Generate random value between 120 and 130txtFIT_321A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_321A_SCALEDLinkItem = FIT_321A_SCALEDtxtFIT_321A_SCALEDLinkMode = 2txtFIT_321A_SCALEDLinkPoketxtFIT_321A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total time

PokeFIT_321AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_321A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume Next

End Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 116

Private Sub txtFIT_341A_SCALED_Change()On Error GoTo PokeFIT_341AErrortxtFIT_341A_SCALEDLinkMode = 0 PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTime

txtFIT_341A_SCALEDText = Int((3 Rnd) + 18) Generate random value between 18 and 21

txtFIT_341A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_341A_SCALEDLinkItem = FIT_341A_SCALEDtxtFIT_341A_SCALEDLinkMode = 2txtFIT_341A_SCALEDLinkPoketxtFIT_341A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeFIT_341AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_341A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 117

Private Sub txtFIT_343A_SCALED_Change()On Error GoTo PokeFIT_343AErrortxtFIT_343A_SCALEDLinkMode = 0 PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTime

txtFIT_343A_SCALEDText = Int((1 Rnd) + 3) Generate random value between 3 and 4

txtFIT_343A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_343A_SCALEDLinkItem = FIT_343A_SCALEDtxtFIT_343A_SCALEDLinkMode = 2txtFIT_343A_SCALEDLinkPoketxtFIT_343A_SCALEDLinkMode = 0 DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeFIT_343AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_343A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 118

TUTORIAL

Part 4

Questions

amp

Answers

  • Slide 1
  • Slide 2
  • Slide 3
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Slide 8
  • Slide 9
  • Slide 10
  • Slide 11
  • Slide 12
  • Slide 13
  • Slide 14
  • Slide 15
  • Slide 16
  • Slide 17
  • Slide 18
  • Slide 19
  • Slide 20
  • Slide 21
  • Slide 22
  • Slide 23
  • Slide 24
  • Slide 25
  • Slide 26
  • Slide 27
  • Slide 28
  • Slide 29
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
  • Slide 34
  • Slide 35
  • Slide 36
  • Slide 37
  • Slide 38
  • Slide 39
  • Slide 40
  • Slide 41
  • Slide 42
  • Slide 43
  • Slide 44
  • Slide 45
  • Slide 46
  • Slide 47
  • Slide 48
  • Slide 49
  • Slide 50
  • Slide 51
  • Slide 52
  • Slide 53
  • Slide 54
  • Slide 55
  • Slide 56
  • Slide 57
  • Slide 58
  • Slide 59
  • Slide 60
  • Slide 61
  • Slide 62
  • Slide 63
  • Slide 64
  • Slide 65
  • Slide 66
  • Slide 67
  • Slide 68
  • Slide 69
  • Slide 70
  • Slide 71
  • Slide 72
  • Slide 73
  • Slide 74
  • Slide 75
  • Slide 76
  • Slide 77
  • Slide 78
  • Slide 79
  • Slide 80
  • Slide 81
  • Slide 82
  • Slide 83
  • Slide 84
  • Slide 85
  • Slide 86
  • Slide 87
  • Slide 88
  • Slide 89
  • Slide 90
  • Slide 91
  • Slide 92
  • Slide 93
  • Slide 94
  • Slide 95
  • Slide 96
  • Slide 97
  • Slide 98
  • Slide 99
  • Slide 100
  • Slide 101
  • Slide 102
  • Slide 103
  • Slide 104
  • Slide 105
  • Slide 106
  • Slide 107
  • Slide 108
  • Slide 109
  • Slide 110
  • Slide 111
  • Slide 112
  • Slide 113
  • Slide 114
  • Slide 115
  • Slide 116
  • Slide 117
  • Slide 118
Page 102: TUTORIAL Ethernet PLC's Improve Oxygen Consumption ISA Expo/2001Houston, Texas Water & Wastewater Industry DivisionTuesday, September 11, 2001 1 Brad.

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 102

TUTORIAL

Part 2C

Excel Spreadsheets

amp

Visual Basic

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 103

A ldquoCHEAP amp DIRTYrdquo HMI With Excel

The 4 key parameters are

To communicate with the PLCUse brad_s_carlbergmbenet|ANOXIC_OXICrsquoplcregisterrsquo

Excel uses ldquopeeksrdquo amp ldquopokesrdquo to read from amp write to a PLC or HMI

To communicate with the HMIbrad_s_carlbergview|Tagnamersquotagnamersquo

bull computer namebull applicationbull topicbull item

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 104

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 105

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 106

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 107

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 108

Excel Macros

bull ldquoRequestrdquo Macro to read values

bull ldquoPokerdquo Macro to write values

bull A Sample Excel Macro

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 109

Sub PokeMacro()MsgBox ApplicationNetworkTemplatesPathChannel = ApplicationDDEInitiate(app=brad_s_carlbergVIEW topic=Tagname) This opens a DDE channel to ViewApplicationDDEPoke Channel Temperature1 Worksheets(Sheet1)Range(A1) Puts value from R1C1 into Temperature1ApplicationDDEPoke Channel DDEReal Worksheets(Sheet1)Range(A2) Puts value from R1C1 into Temperature1ApplicationDDEPoke Channel DDEInteger Worksheets(Sheet1)Range(A3) Puts value from R1C1 into Temperature1ApplicationDDETerminate Channel This terminates the DDE channelEnd SubSub RequestMacro()Channel = ApplicationDDEInitiate(app=brad_s_carlbergVIEW topic=Tagname) This opens a DDE channel to ViewWorksheets(Sheet1)Range(C4) = ApplicationDDERequest(Channel $Hour)Worksheets(Sheet1)Range(C5) = ApplicationDDERequest(Channel $Minute)Worksheets(Sheet1)Range(C6) = ApplicationDDERequest(Channel $Second)Worksheets(Sheet1)Range(C9) = ApplicationDDERequest(Channel $day)Worksheets(Sheet1)Range(C10) = ApplicationDDERequest(Channel $date)Worksheets(Sheet1)Range(C11) = ApplicationDDERequest(Channel $datestring)Worksheets(Sheet1)Range(C12) = ApplicationDDERequest(Channel $datetime)Worksheets(Sheet1)Range(C13) = ApplicationDDERequest(Channel $date)Worksheets(Sheet1)Range(C14) = ApplicationDDERequest(Channel $month)Worksheets(Sheet1)Range(C15) = ApplicationDDERequest(Channel $year)Worksheets(Sheet1)Range(C16) = ApplicationDDERequest(Channel $time)Worksheets(Sheet1)Range(C17) = ApplicationDDERequest(Channel $timestring)Worksheets(Sheet1)Range(C18) = ApplicationDDERequest(Channel $applicationversion)Worksheets(Sheet1)Range(C19) = ApplicationDDERequest(Channel $startddeconversations)Worksheets(Sheet1)Range(C20) = ApplicationDDERequest(Channel $accesslevel)Worksheets(Sheet1)Range(C21) = ApplicationDDERequest(Channel $alarmlogging)Worksheets(Sheet1)Range(C22) = ApplicationDDERequest(Channel $applicationchanged)Worksheets(Sheet1)Range(C23) = ApplicationDDERequest(Channel $configureusers)Worksheets(Sheet1)Range(C24) = ApplicationDDERequest(Channel $changepassword)Worksheets(Sheet1)Range(C25) = ApplicationDDERequest(Channel $InactivityTimeout)Worksheets(Sheet1)Range(C26) = ApplicationDDERequest(Channel $InactivityWarning)Worksheets(Sheet1)Range(C27) = ApplicationDDERequest(Channel $LogicRunning)Worksheets(Sheet1)Range(C28) = ApplicationDDERequest(Channel $OperatorEntered)Worksheets(Sheet1)Range(C29) = ApplicationDDERequest(Channel $Operator)Worksheets(Sheet1)Range(C30) = ApplicationDDERequest(Channel $PasswordEntered)ApplicationDDETerminate Channel This terminates the DDE channelEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 110

Visual Basic

ldquoRoll Your Ownrdquo HMI - Much More powerful than Excel

Key Parameters computer nameapplication|topicitem

IO Emulator - MBPlusSimulateexe

Can ldquoRead Fromrdquo amp ldquoWrite Tordquo PLC andor HMI

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 111

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 112

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 113

Dim PauseTime Start Finish TotalTime As Integer Declare variables

Private Sub txtAIT_332A_SCALED_Change()On Error GoTo PokeAIT_332AErrortxtAIT_332A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtAIT_332A_SCALEDText = Int((3 Rnd) + 20) Generate random value between 20 and 23txtAIT_332A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtAIT_332A_SCALEDLinkItem = AIT_332A_SCALEDtxtAIT_332A_SCALEDLinkMode = 2txtAIT_332A_SCALEDLinkPoketxtAIT_332A_SCALEDLinkMode = 0 DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total time

PokeAIT_332AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtAIT_332A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 114

Private Sub txtAIT_346A_SCALED_Change()On Error GoTo PokeAIT_346AErrortxtAIT_346A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtAIT_346A_SCALEDText = Int((3 Rnd) + 15) Generate random value between 15 and 18txtAIT_346A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtAIT_346A_SCALEDLinkItem = AIT_346A_SCALEDtxtAIT_346A_SCALEDLinkMode = 2txtAIT_346A_SCALEDLinkPoketxtAIT_346A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeAIT_346AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtAIT_346A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 115

Private Sub txtFIT_321A_SCALED_Change()On Error GoTo PokeFIT_321AErrortxtFIT_321A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtFIT_321A_SCALEDText = Int((10 Rnd) + 120) Generate random value between 120 and 130txtFIT_321A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_321A_SCALEDLinkItem = FIT_321A_SCALEDtxtFIT_321A_SCALEDLinkMode = 2txtFIT_321A_SCALEDLinkPoketxtFIT_321A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total time

PokeFIT_321AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_321A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume Next

End Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 116

Private Sub txtFIT_341A_SCALED_Change()On Error GoTo PokeFIT_341AErrortxtFIT_341A_SCALEDLinkMode = 0 PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTime

txtFIT_341A_SCALEDText = Int((3 Rnd) + 18) Generate random value between 18 and 21

txtFIT_341A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_341A_SCALEDLinkItem = FIT_341A_SCALEDtxtFIT_341A_SCALEDLinkMode = 2txtFIT_341A_SCALEDLinkPoketxtFIT_341A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeFIT_341AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_341A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 117

Private Sub txtFIT_343A_SCALED_Change()On Error GoTo PokeFIT_343AErrortxtFIT_343A_SCALEDLinkMode = 0 PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTime

txtFIT_343A_SCALEDText = Int((1 Rnd) + 3) Generate random value between 3 and 4

txtFIT_343A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_343A_SCALEDLinkItem = FIT_343A_SCALEDtxtFIT_343A_SCALEDLinkMode = 2txtFIT_343A_SCALEDLinkPoketxtFIT_343A_SCALEDLinkMode = 0 DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeFIT_343AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_343A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 118

TUTORIAL

Part 4

Questions

amp

Answers

  • Slide 1
  • Slide 2
  • Slide 3
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Slide 8
  • Slide 9
  • Slide 10
  • Slide 11
  • Slide 12
  • Slide 13
  • Slide 14
  • Slide 15
  • Slide 16
  • Slide 17
  • Slide 18
  • Slide 19
  • Slide 20
  • Slide 21
  • Slide 22
  • Slide 23
  • Slide 24
  • Slide 25
  • Slide 26
  • Slide 27
  • Slide 28
  • Slide 29
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
  • Slide 34
  • Slide 35
  • Slide 36
  • Slide 37
  • Slide 38
  • Slide 39
  • Slide 40
  • Slide 41
  • Slide 42
  • Slide 43
  • Slide 44
  • Slide 45
  • Slide 46
  • Slide 47
  • Slide 48
  • Slide 49
  • Slide 50
  • Slide 51
  • Slide 52
  • Slide 53
  • Slide 54
  • Slide 55
  • Slide 56
  • Slide 57
  • Slide 58
  • Slide 59
  • Slide 60
  • Slide 61
  • Slide 62
  • Slide 63
  • Slide 64
  • Slide 65
  • Slide 66
  • Slide 67
  • Slide 68
  • Slide 69
  • Slide 70
  • Slide 71
  • Slide 72
  • Slide 73
  • Slide 74
  • Slide 75
  • Slide 76
  • Slide 77
  • Slide 78
  • Slide 79
  • Slide 80
  • Slide 81
  • Slide 82
  • Slide 83
  • Slide 84
  • Slide 85
  • Slide 86
  • Slide 87
  • Slide 88
  • Slide 89
  • Slide 90
  • Slide 91
  • Slide 92
  • Slide 93
  • Slide 94
  • Slide 95
  • Slide 96
  • Slide 97
  • Slide 98
  • Slide 99
  • Slide 100
  • Slide 101
  • Slide 102
  • Slide 103
  • Slide 104
  • Slide 105
  • Slide 106
  • Slide 107
  • Slide 108
  • Slide 109
  • Slide 110
  • Slide 111
  • Slide 112
  • Slide 113
  • Slide 114
  • Slide 115
  • Slide 116
  • Slide 117
  • Slide 118
Page 103: TUTORIAL Ethernet PLC's Improve Oxygen Consumption ISA Expo/2001Houston, Texas Water & Wastewater Industry DivisionTuesday, September 11, 2001 1 Brad.

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 103

A ldquoCHEAP amp DIRTYrdquo HMI With Excel

The 4 key parameters are

To communicate with the PLCUse brad_s_carlbergmbenet|ANOXIC_OXICrsquoplcregisterrsquo

Excel uses ldquopeeksrdquo amp ldquopokesrdquo to read from amp write to a PLC or HMI

To communicate with the HMIbrad_s_carlbergview|Tagnamersquotagnamersquo

bull computer namebull applicationbull topicbull item

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 104

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 105

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 106

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 107

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 108

Excel Macros

bull ldquoRequestrdquo Macro to read values

bull ldquoPokerdquo Macro to write values

bull A Sample Excel Macro

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 109

Sub PokeMacro()MsgBox ApplicationNetworkTemplatesPathChannel = ApplicationDDEInitiate(app=brad_s_carlbergVIEW topic=Tagname) This opens a DDE channel to ViewApplicationDDEPoke Channel Temperature1 Worksheets(Sheet1)Range(A1) Puts value from R1C1 into Temperature1ApplicationDDEPoke Channel DDEReal Worksheets(Sheet1)Range(A2) Puts value from R1C1 into Temperature1ApplicationDDEPoke Channel DDEInteger Worksheets(Sheet1)Range(A3) Puts value from R1C1 into Temperature1ApplicationDDETerminate Channel This terminates the DDE channelEnd SubSub RequestMacro()Channel = ApplicationDDEInitiate(app=brad_s_carlbergVIEW topic=Tagname) This opens a DDE channel to ViewWorksheets(Sheet1)Range(C4) = ApplicationDDERequest(Channel $Hour)Worksheets(Sheet1)Range(C5) = ApplicationDDERequest(Channel $Minute)Worksheets(Sheet1)Range(C6) = ApplicationDDERequest(Channel $Second)Worksheets(Sheet1)Range(C9) = ApplicationDDERequest(Channel $day)Worksheets(Sheet1)Range(C10) = ApplicationDDERequest(Channel $date)Worksheets(Sheet1)Range(C11) = ApplicationDDERequest(Channel $datestring)Worksheets(Sheet1)Range(C12) = ApplicationDDERequest(Channel $datetime)Worksheets(Sheet1)Range(C13) = ApplicationDDERequest(Channel $date)Worksheets(Sheet1)Range(C14) = ApplicationDDERequest(Channel $month)Worksheets(Sheet1)Range(C15) = ApplicationDDERequest(Channel $year)Worksheets(Sheet1)Range(C16) = ApplicationDDERequest(Channel $time)Worksheets(Sheet1)Range(C17) = ApplicationDDERequest(Channel $timestring)Worksheets(Sheet1)Range(C18) = ApplicationDDERequest(Channel $applicationversion)Worksheets(Sheet1)Range(C19) = ApplicationDDERequest(Channel $startddeconversations)Worksheets(Sheet1)Range(C20) = ApplicationDDERequest(Channel $accesslevel)Worksheets(Sheet1)Range(C21) = ApplicationDDERequest(Channel $alarmlogging)Worksheets(Sheet1)Range(C22) = ApplicationDDERequest(Channel $applicationchanged)Worksheets(Sheet1)Range(C23) = ApplicationDDERequest(Channel $configureusers)Worksheets(Sheet1)Range(C24) = ApplicationDDERequest(Channel $changepassword)Worksheets(Sheet1)Range(C25) = ApplicationDDERequest(Channel $InactivityTimeout)Worksheets(Sheet1)Range(C26) = ApplicationDDERequest(Channel $InactivityWarning)Worksheets(Sheet1)Range(C27) = ApplicationDDERequest(Channel $LogicRunning)Worksheets(Sheet1)Range(C28) = ApplicationDDERequest(Channel $OperatorEntered)Worksheets(Sheet1)Range(C29) = ApplicationDDERequest(Channel $Operator)Worksheets(Sheet1)Range(C30) = ApplicationDDERequest(Channel $PasswordEntered)ApplicationDDETerminate Channel This terminates the DDE channelEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 110

Visual Basic

ldquoRoll Your Ownrdquo HMI - Much More powerful than Excel

Key Parameters computer nameapplication|topicitem

IO Emulator - MBPlusSimulateexe

Can ldquoRead Fromrdquo amp ldquoWrite Tordquo PLC andor HMI

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 111

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 112

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 113

Dim PauseTime Start Finish TotalTime As Integer Declare variables

Private Sub txtAIT_332A_SCALED_Change()On Error GoTo PokeAIT_332AErrortxtAIT_332A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtAIT_332A_SCALEDText = Int((3 Rnd) + 20) Generate random value between 20 and 23txtAIT_332A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtAIT_332A_SCALEDLinkItem = AIT_332A_SCALEDtxtAIT_332A_SCALEDLinkMode = 2txtAIT_332A_SCALEDLinkPoketxtAIT_332A_SCALEDLinkMode = 0 DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total time

PokeAIT_332AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtAIT_332A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 114

Private Sub txtAIT_346A_SCALED_Change()On Error GoTo PokeAIT_346AErrortxtAIT_346A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtAIT_346A_SCALEDText = Int((3 Rnd) + 15) Generate random value between 15 and 18txtAIT_346A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtAIT_346A_SCALEDLinkItem = AIT_346A_SCALEDtxtAIT_346A_SCALEDLinkMode = 2txtAIT_346A_SCALEDLinkPoketxtAIT_346A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeAIT_346AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtAIT_346A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 115

Private Sub txtFIT_321A_SCALED_Change()On Error GoTo PokeFIT_321AErrortxtFIT_321A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtFIT_321A_SCALEDText = Int((10 Rnd) + 120) Generate random value between 120 and 130txtFIT_321A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_321A_SCALEDLinkItem = FIT_321A_SCALEDtxtFIT_321A_SCALEDLinkMode = 2txtFIT_321A_SCALEDLinkPoketxtFIT_321A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total time

PokeFIT_321AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_321A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume Next

End Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 116

Private Sub txtFIT_341A_SCALED_Change()On Error GoTo PokeFIT_341AErrortxtFIT_341A_SCALEDLinkMode = 0 PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTime

txtFIT_341A_SCALEDText = Int((3 Rnd) + 18) Generate random value between 18 and 21

txtFIT_341A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_341A_SCALEDLinkItem = FIT_341A_SCALEDtxtFIT_341A_SCALEDLinkMode = 2txtFIT_341A_SCALEDLinkPoketxtFIT_341A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeFIT_341AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_341A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 117

Private Sub txtFIT_343A_SCALED_Change()On Error GoTo PokeFIT_343AErrortxtFIT_343A_SCALEDLinkMode = 0 PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTime

txtFIT_343A_SCALEDText = Int((1 Rnd) + 3) Generate random value between 3 and 4

txtFIT_343A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_343A_SCALEDLinkItem = FIT_343A_SCALEDtxtFIT_343A_SCALEDLinkMode = 2txtFIT_343A_SCALEDLinkPoketxtFIT_343A_SCALEDLinkMode = 0 DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeFIT_343AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_343A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 118

TUTORIAL

Part 4

Questions

amp

Answers

  • Slide 1
  • Slide 2
  • Slide 3
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Slide 8
  • Slide 9
  • Slide 10
  • Slide 11
  • Slide 12
  • Slide 13
  • Slide 14
  • Slide 15
  • Slide 16
  • Slide 17
  • Slide 18
  • Slide 19
  • Slide 20
  • Slide 21
  • Slide 22
  • Slide 23
  • Slide 24
  • Slide 25
  • Slide 26
  • Slide 27
  • Slide 28
  • Slide 29
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
  • Slide 34
  • Slide 35
  • Slide 36
  • Slide 37
  • Slide 38
  • Slide 39
  • Slide 40
  • Slide 41
  • Slide 42
  • Slide 43
  • Slide 44
  • Slide 45
  • Slide 46
  • Slide 47
  • Slide 48
  • Slide 49
  • Slide 50
  • Slide 51
  • Slide 52
  • Slide 53
  • Slide 54
  • Slide 55
  • Slide 56
  • Slide 57
  • Slide 58
  • Slide 59
  • Slide 60
  • Slide 61
  • Slide 62
  • Slide 63
  • Slide 64
  • Slide 65
  • Slide 66
  • Slide 67
  • Slide 68
  • Slide 69
  • Slide 70
  • Slide 71
  • Slide 72
  • Slide 73
  • Slide 74
  • Slide 75
  • Slide 76
  • Slide 77
  • Slide 78
  • Slide 79
  • Slide 80
  • Slide 81
  • Slide 82
  • Slide 83
  • Slide 84
  • Slide 85
  • Slide 86
  • Slide 87
  • Slide 88
  • Slide 89
  • Slide 90
  • Slide 91
  • Slide 92
  • Slide 93
  • Slide 94
  • Slide 95
  • Slide 96
  • Slide 97
  • Slide 98
  • Slide 99
  • Slide 100
  • Slide 101
  • Slide 102
  • Slide 103
  • Slide 104
  • Slide 105
  • Slide 106
  • Slide 107
  • Slide 108
  • Slide 109
  • Slide 110
  • Slide 111
  • Slide 112
  • Slide 113
  • Slide 114
  • Slide 115
  • Slide 116
  • Slide 117
  • Slide 118
Page 104: TUTORIAL Ethernet PLC's Improve Oxygen Consumption ISA Expo/2001Houston, Texas Water & Wastewater Industry DivisionTuesday, September 11, 2001 1 Brad.

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 104

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 105

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 106

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 107

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 108

Excel Macros

bull ldquoRequestrdquo Macro to read values

bull ldquoPokerdquo Macro to write values

bull A Sample Excel Macro

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 109

Sub PokeMacro()MsgBox ApplicationNetworkTemplatesPathChannel = ApplicationDDEInitiate(app=brad_s_carlbergVIEW topic=Tagname) This opens a DDE channel to ViewApplicationDDEPoke Channel Temperature1 Worksheets(Sheet1)Range(A1) Puts value from R1C1 into Temperature1ApplicationDDEPoke Channel DDEReal Worksheets(Sheet1)Range(A2) Puts value from R1C1 into Temperature1ApplicationDDEPoke Channel DDEInteger Worksheets(Sheet1)Range(A3) Puts value from R1C1 into Temperature1ApplicationDDETerminate Channel This terminates the DDE channelEnd SubSub RequestMacro()Channel = ApplicationDDEInitiate(app=brad_s_carlbergVIEW topic=Tagname) This opens a DDE channel to ViewWorksheets(Sheet1)Range(C4) = ApplicationDDERequest(Channel $Hour)Worksheets(Sheet1)Range(C5) = ApplicationDDERequest(Channel $Minute)Worksheets(Sheet1)Range(C6) = ApplicationDDERequest(Channel $Second)Worksheets(Sheet1)Range(C9) = ApplicationDDERequest(Channel $day)Worksheets(Sheet1)Range(C10) = ApplicationDDERequest(Channel $date)Worksheets(Sheet1)Range(C11) = ApplicationDDERequest(Channel $datestring)Worksheets(Sheet1)Range(C12) = ApplicationDDERequest(Channel $datetime)Worksheets(Sheet1)Range(C13) = ApplicationDDERequest(Channel $date)Worksheets(Sheet1)Range(C14) = ApplicationDDERequest(Channel $month)Worksheets(Sheet1)Range(C15) = ApplicationDDERequest(Channel $year)Worksheets(Sheet1)Range(C16) = ApplicationDDERequest(Channel $time)Worksheets(Sheet1)Range(C17) = ApplicationDDERequest(Channel $timestring)Worksheets(Sheet1)Range(C18) = ApplicationDDERequest(Channel $applicationversion)Worksheets(Sheet1)Range(C19) = ApplicationDDERequest(Channel $startddeconversations)Worksheets(Sheet1)Range(C20) = ApplicationDDERequest(Channel $accesslevel)Worksheets(Sheet1)Range(C21) = ApplicationDDERequest(Channel $alarmlogging)Worksheets(Sheet1)Range(C22) = ApplicationDDERequest(Channel $applicationchanged)Worksheets(Sheet1)Range(C23) = ApplicationDDERequest(Channel $configureusers)Worksheets(Sheet1)Range(C24) = ApplicationDDERequest(Channel $changepassword)Worksheets(Sheet1)Range(C25) = ApplicationDDERequest(Channel $InactivityTimeout)Worksheets(Sheet1)Range(C26) = ApplicationDDERequest(Channel $InactivityWarning)Worksheets(Sheet1)Range(C27) = ApplicationDDERequest(Channel $LogicRunning)Worksheets(Sheet1)Range(C28) = ApplicationDDERequest(Channel $OperatorEntered)Worksheets(Sheet1)Range(C29) = ApplicationDDERequest(Channel $Operator)Worksheets(Sheet1)Range(C30) = ApplicationDDERequest(Channel $PasswordEntered)ApplicationDDETerminate Channel This terminates the DDE channelEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 110

Visual Basic

ldquoRoll Your Ownrdquo HMI - Much More powerful than Excel

Key Parameters computer nameapplication|topicitem

IO Emulator - MBPlusSimulateexe

Can ldquoRead Fromrdquo amp ldquoWrite Tordquo PLC andor HMI

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 111

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 112

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 113

Dim PauseTime Start Finish TotalTime As Integer Declare variables

Private Sub txtAIT_332A_SCALED_Change()On Error GoTo PokeAIT_332AErrortxtAIT_332A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtAIT_332A_SCALEDText = Int((3 Rnd) + 20) Generate random value between 20 and 23txtAIT_332A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtAIT_332A_SCALEDLinkItem = AIT_332A_SCALEDtxtAIT_332A_SCALEDLinkMode = 2txtAIT_332A_SCALEDLinkPoketxtAIT_332A_SCALEDLinkMode = 0 DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total time

PokeAIT_332AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtAIT_332A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 114

Private Sub txtAIT_346A_SCALED_Change()On Error GoTo PokeAIT_346AErrortxtAIT_346A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtAIT_346A_SCALEDText = Int((3 Rnd) + 15) Generate random value between 15 and 18txtAIT_346A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtAIT_346A_SCALEDLinkItem = AIT_346A_SCALEDtxtAIT_346A_SCALEDLinkMode = 2txtAIT_346A_SCALEDLinkPoketxtAIT_346A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeAIT_346AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtAIT_346A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 115

Private Sub txtFIT_321A_SCALED_Change()On Error GoTo PokeFIT_321AErrortxtFIT_321A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtFIT_321A_SCALEDText = Int((10 Rnd) + 120) Generate random value between 120 and 130txtFIT_321A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_321A_SCALEDLinkItem = FIT_321A_SCALEDtxtFIT_321A_SCALEDLinkMode = 2txtFIT_321A_SCALEDLinkPoketxtFIT_321A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total time

PokeFIT_321AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_321A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume Next

End Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 116

Private Sub txtFIT_341A_SCALED_Change()On Error GoTo PokeFIT_341AErrortxtFIT_341A_SCALEDLinkMode = 0 PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTime

txtFIT_341A_SCALEDText = Int((3 Rnd) + 18) Generate random value between 18 and 21

txtFIT_341A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_341A_SCALEDLinkItem = FIT_341A_SCALEDtxtFIT_341A_SCALEDLinkMode = 2txtFIT_341A_SCALEDLinkPoketxtFIT_341A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeFIT_341AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_341A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 117

Private Sub txtFIT_343A_SCALED_Change()On Error GoTo PokeFIT_343AErrortxtFIT_343A_SCALEDLinkMode = 0 PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTime

txtFIT_343A_SCALEDText = Int((1 Rnd) + 3) Generate random value between 3 and 4

txtFIT_343A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_343A_SCALEDLinkItem = FIT_343A_SCALEDtxtFIT_343A_SCALEDLinkMode = 2txtFIT_343A_SCALEDLinkPoketxtFIT_343A_SCALEDLinkMode = 0 DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeFIT_343AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_343A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 118

TUTORIAL

Part 4

Questions

amp

Answers

  • Slide 1
  • Slide 2
  • Slide 3
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Slide 8
  • Slide 9
  • Slide 10
  • Slide 11
  • Slide 12
  • Slide 13
  • Slide 14
  • Slide 15
  • Slide 16
  • Slide 17
  • Slide 18
  • Slide 19
  • Slide 20
  • Slide 21
  • Slide 22
  • Slide 23
  • Slide 24
  • Slide 25
  • Slide 26
  • Slide 27
  • Slide 28
  • Slide 29
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
  • Slide 34
  • Slide 35
  • Slide 36
  • Slide 37
  • Slide 38
  • Slide 39
  • Slide 40
  • Slide 41
  • Slide 42
  • Slide 43
  • Slide 44
  • Slide 45
  • Slide 46
  • Slide 47
  • Slide 48
  • Slide 49
  • Slide 50
  • Slide 51
  • Slide 52
  • Slide 53
  • Slide 54
  • Slide 55
  • Slide 56
  • Slide 57
  • Slide 58
  • Slide 59
  • Slide 60
  • Slide 61
  • Slide 62
  • Slide 63
  • Slide 64
  • Slide 65
  • Slide 66
  • Slide 67
  • Slide 68
  • Slide 69
  • Slide 70
  • Slide 71
  • Slide 72
  • Slide 73
  • Slide 74
  • Slide 75
  • Slide 76
  • Slide 77
  • Slide 78
  • Slide 79
  • Slide 80
  • Slide 81
  • Slide 82
  • Slide 83
  • Slide 84
  • Slide 85
  • Slide 86
  • Slide 87
  • Slide 88
  • Slide 89
  • Slide 90
  • Slide 91
  • Slide 92
  • Slide 93
  • Slide 94
  • Slide 95
  • Slide 96
  • Slide 97
  • Slide 98
  • Slide 99
  • Slide 100
  • Slide 101
  • Slide 102
  • Slide 103
  • Slide 104
  • Slide 105
  • Slide 106
  • Slide 107
  • Slide 108
  • Slide 109
  • Slide 110
  • Slide 111
  • Slide 112
  • Slide 113
  • Slide 114
  • Slide 115
  • Slide 116
  • Slide 117
  • Slide 118
Page 105: TUTORIAL Ethernet PLC's Improve Oxygen Consumption ISA Expo/2001Houston, Texas Water & Wastewater Industry DivisionTuesday, September 11, 2001 1 Brad.

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 105

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 106

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 107

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 108

Excel Macros

bull ldquoRequestrdquo Macro to read values

bull ldquoPokerdquo Macro to write values

bull A Sample Excel Macro

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 109

Sub PokeMacro()MsgBox ApplicationNetworkTemplatesPathChannel = ApplicationDDEInitiate(app=brad_s_carlbergVIEW topic=Tagname) This opens a DDE channel to ViewApplicationDDEPoke Channel Temperature1 Worksheets(Sheet1)Range(A1) Puts value from R1C1 into Temperature1ApplicationDDEPoke Channel DDEReal Worksheets(Sheet1)Range(A2) Puts value from R1C1 into Temperature1ApplicationDDEPoke Channel DDEInteger Worksheets(Sheet1)Range(A3) Puts value from R1C1 into Temperature1ApplicationDDETerminate Channel This terminates the DDE channelEnd SubSub RequestMacro()Channel = ApplicationDDEInitiate(app=brad_s_carlbergVIEW topic=Tagname) This opens a DDE channel to ViewWorksheets(Sheet1)Range(C4) = ApplicationDDERequest(Channel $Hour)Worksheets(Sheet1)Range(C5) = ApplicationDDERequest(Channel $Minute)Worksheets(Sheet1)Range(C6) = ApplicationDDERequest(Channel $Second)Worksheets(Sheet1)Range(C9) = ApplicationDDERequest(Channel $day)Worksheets(Sheet1)Range(C10) = ApplicationDDERequest(Channel $date)Worksheets(Sheet1)Range(C11) = ApplicationDDERequest(Channel $datestring)Worksheets(Sheet1)Range(C12) = ApplicationDDERequest(Channel $datetime)Worksheets(Sheet1)Range(C13) = ApplicationDDERequest(Channel $date)Worksheets(Sheet1)Range(C14) = ApplicationDDERequest(Channel $month)Worksheets(Sheet1)Range(C15) = ApplicationDDERequest(Channel $year)Worksheets(Sheet1)Range(C16) = ApplicationDDERequest(Channel $time)Worksheets(Sheet1)Range(C17) = ApplicationDDERequest(Channel $timestring)Worksheets(Sheet1)Range(C18) = ApplicationDDERequest(Channel $applicationversion)Worksheets(Sheet1)Range(C19) = ApplicationDDERequest(Channel $startddeconversations)Worksheets(Sheet1)Range(C20) = ApplicationDDERequest(Channel $accesslevel)Worksheets(Sheet1)Range(C21) = ApplicationDDERequest(Channel $alarmlogging)Worksheets(Sheet1)Range(C22) = ApplicationDDERequest(Channel $applicationchanged)Worksheets(Sheet1)Range(C23) = ApplicationDDERequest(Channel $configureusers)Worksheets(Sheet1)Range(C24) = ApplicationDDERequest(Channel $changepassword)Worksheets(Sheet1)Range(C25) = ApplicationDDERequest(Channel $InactivityTimeout)Worksheets(Sheet1)Range(C26) = ApplicationDDERequest(Channel $InactivityWarning)Worksheets(Sheet1)Range(C27) = ApplicationDDERequest(Channel $LogicRunning)Worksheets(Sheet1)Range(C28) = ApplicationDDERequest(Channel $OperatorEntered)Worksheets(Sheet1)Range(C29) = ApplicationDDERequest(Channel $Operator)Worksheets(Sheet1)Range(C30) = ApplicationDDERequest(Channel $PasswordEntered)ApplicationDDETerminate Channel This terminates the DDE channelEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 110

Visual Basic

ldquoRoll Your Ownrdquo HMI - Much More powerful than Excel

Key Parameters computer nameapplication|topicitem

IO Emulator - MBPlusSimulateexe

Can ldquoRead Fromrdquo amp ldquoWrite Tordquo PLC andor HMI

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 111

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 112

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 113

Dim PauseTime Start Finish TotalTime As Integer Declare variables

Private Sub txtAIT_332A_SCALED_Change()On Error GoTo PokeAIT_332AErrortxtAIT_332A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtAIT_332A_SCALEDText = Int((3 Rnd) + 20) Generate random value between 20 and 23txtAIT_332A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtAIT_332A_SCALEDLinkItem = AIT_332A_SCALEDtxtAIT_332A_SCALEDLinkMode = 2txtAIT_332A_SCALEDLinkPoketxtAIT_332A_SCALEDLinkMode = 0 DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total time

PokeAIT_332AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtAIT_332A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 114

Private Sub txtAIT_346A_SCALED_Change()On Error GoTo PokeAIT_346AErrortxtAIT_346A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtAIT_346A_SCALEDText = Int((3 Rnd) + 15) Generate random value between 15 and 18txtAIT_346A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtAIT_346A_SCALEDLinkItem = AIT_346A_SCALEDtxtAIT_346A_SCALEDLinkMode = 2txtAIT_346A_SCALEDLinkPoketxtAIT_346A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeAIT_346AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtAIT_346A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 115

Private Sub txtFIT_321A_SCALED_Change()On Error GoTo PokeFIT_321AErrortxtFIT_321A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtFIT_321A_SCALEDText = Int((10 Rnd) + 120) Generate random value between 120 and 130txtFIT_321A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_321A_SCALEDLinkItem = FIT_321A_SCALEDtxtFIT_321A_SCALEDLinkMode = 2txtFIT_321A_SCALEDLinkPoketxtFIT_321A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total time

PokeFIT_321AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_321A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume Next

End Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 116

Private Sub txtFIT_341A_SCALED_Change()On Error GoTo PokeFIT_341AErrortxtFIT_341A_SCALEDLinkMode = 0 PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTime

txtFIT_341A_SCALEDText = Int((3 Rnd) + 18) Generate random value between 18 and 21

txtFIT_341A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_341A_SCALEDLinkItem = FIT_341A_SCALEDtxtFIT_341A_SCALEDLinkMode = 2txtFIT_341A_SCALEDLinkPoketxtFIT_341A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeFIT_341AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_341A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 117

Private Sub txtFIT_343A_SCALED_Change()On Error GoTo PokeFIT_343AErrortxtFIT_343A_SCALEDLinkMode = 0 PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTime

txtFIT_343A_SCALEDText = Int((1 Rnd) + 3) Generate random value between 3 and 4

txtFIT_343A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_343A_SCALEDLinkItem = FIT_343A_SCALEDtxtFIT_343A_SCALEDLinkMode = 2txtFIT_343A_SCALEDLinkPoketxtFIT_343A_SCALEDLinkMode = 0 DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeFIT_343AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_343A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 118

TUTORIAL

Part 4

Questions

amp

Answers

  • Slide 1
  • Slide 2
  • Slide 3
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Slide 8
  • Slide 9
  • Slide 10
  • Slide 11
  • Slide 12
  • Slide 13
  • Slide 14
  • Slide 15
  • Slide 16
  • Slide 17
  • Slide 18
  • Slide 19
  • Slide 20
  • Slide 21
  • Slide 22
  • Slide 23
  • Slide 24
  • Slide 25
  • Slide 26
  • Slide 27
  • Slide 28
  • Slide 29
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
  • Slide 34
  • Slide 35
  • Slide 36
  • Slide 37
  • Slide 38
  • Slide 39
  • Slide 40
  • Slide 41
  • Slide 42
  • Slide 43
  • Slide 44
  • Slide 45
  • Slide 46
  • Slide 47
  • Slide 48
  • Slide 49
  • Slide 50
  • Slide 51
  • Slide 52
  • Slide 53
  • Slide 54
  • Slide 55
  • Slide 56
  • Slide 57
  • Slide 58
  • Slide 59
  • Slide 60
  • Slide 61
  • Slide 62
  • Slide 63
  • Slide 64
  • Slide 65
  • Slide 66
  • Slide 67
  • Slide 68
  • Slide 69
  • Slide 70
  • Slide 71
  • Slide 72
  • Slide 73
  • Slide 74
  • Slide 75
  • Slide 76
  • Slide 77
  • Slide 78
  • Slide 79
  • Slide 80
  • Slide 81
  • Slide 82
  • Slide 83
  • Slide 84
  • Slide 85
  • Slide 86
  • Slide 87
  • Slide 88
  • Slide 89
  • Slide 90
  • Slide 91
  • Slide 92
  • Slide 93
  • Slide 94
  • Slide 95
  • Slide 96
  • Slide 97
  • Slide 98
  • Slide 99
  • Slide 100
  • Slide 101
  • Slide 102
  • Slide 103
  • Slide 104
  • Slide 105
  • Slide 106
  • Slide 107
  • Slide 108
  • Slide 109
  • Slide 110
  • Slide 111
  • Slide 112
  • Slide 113
  • Slide 114
  • Slide 115
  • Slide 116
  • Slide 117
  • Slide 118
Page 106: TUTORIAL Ethernet PLC's Improve Oxygen Consumption ISA Expo/2001Houston, Texas Water & Wastewater Industry DivisionTuesday, September 11, 2001 1 Brad.

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 106

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 107

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 108

Excel Macros

bull ldquoRequestrdquo Macro to read values

bull ldquoPokerdquo Macro to write values

bull A Sample Excel Macro

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 109

Sub PokeMacro()MsgBox ApplicationNetworkTemplatesPathChannel = ApplicationDDEInitiate(app=brad_s_carlbergVIEW topic=Tagname) This opens a DDE channel to ViewApplicationDDEPoke Channel Temperature1 Worksheets(Sheet1)Range(A1) Puts value from R1C1 into Temperature1ApplicationDDEPoke Channel DDEReal Worksheets(Sheet1)Range(A2) Puts value from R1C1 into Temperature1ApplicationDDEPoke Channel DDEInteger Worksheets(Sheet1)Range(A3) Puts value from R1C1 into Temperature1ApplicationDDETerminate Channel This terminates the DDE channelEnd SubSub RequestMacro()Channel = ApplicationDDEInitiate(app=brad_s_carlbergVIEW topic=Tagname) This opens a DDE channel to ViewWorksheets(Sheet1)Range(C4) = ApplicationDDERequest(Channel $Hour)Worksheets(Sheet1)Range(C5) = ApplicationDDERequest(Channel $Minute)Worksheets(Sheet1)Range(C6) = ApplicationDDERequest(Channel $Second)Worksheets(Sheet1)Range(C9) = ApplicationDDERequest(Channel $day)Worksheets(Sheet1)Range(C10) = ApplicationDDERequest(Channel $date)Worksheets(Sheet1)Range(C11) = ApplicationDDERequest(Channel $datestring)Worksheets(Sheet1)Range(C12) = ApplicationDDERequest(Channel $datetime)Worksheets(Sheet1)Range(C13) = ApplicationDDERequest(Channel $date)Worksheets(Sheet1)Range(C14) = ApplicationDDERequest(Channel $month)Worksheets(Sheet1)Range(C15) = ApplicationDDERequest(Channel $year)Worksheets(Sheet1)Range(C16) = ApplicationDDERequest(Channel $time)Worksheets(Sheet1)Range(C17) = ApplicationDDERequest(Channel $timestring)Worksheets(Sheet1)Range(C18) = ApplicationDDERequest(Channel $applicationversion)Worksheets(Sheet1)Range(C19) = ApplicationDDERequest(Channel $startddeconversations)Worksheets(Sheet1)Range(C20) = ApplicationDDERequest(Channel $accesslevel)Worksheets(Sheet1)Range(C21) = ApplicationDDERequest(Channel $alarmlogging)Worksheets(Sheet1)Range(C22) = ApplicationDDERequest(Channel $applicationchanged)Worksheets(Sheet1)Range(C23) = ApplicationDDERequest(Channel $configureusers)Worksheets(Sheet1)Range(C24) = ApplicationDDERequest(Channel $changepassword)Worksheets(Sheet1)Range(C25) = ApplicationDDERequest(Channel $InactivityTimeout)Worksheets(Sheet1)Range(C26) = ApplicationDDERequest(Channel $InactivityWarning)Worksheets(Sheet1)Range(C27) = ApplicationDDERequest(Channel $LogicRunning)Worksheets(Sheet1)Range(C28) = ApplicationDDERequest(Channel $OperatorEntered)Worksheets(Sheet1)Range(C29) = ApplicationDDERequest(Channel $Operator)Worksheets(Sheet1)Range(C30) = ApplicationDDERequest(Channel $PasswordEntered)ApplicationDDETerminate Channel This terminates the DDE channelEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 110

Visual Basic

ldquoRoll Your Ownrdquo HMI - Much More powerful than Excel

Key Parameters computer nameapplication|topicitem

IO Emulator - MBPlusSimulateexe

Can ldquoRead Fromrdquo amp ldquoWrite Tordquo PLC andor HMI

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 111

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 112

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 113

Dim PauseTime Start Finish TotalTime As Integer Declare variables

Private Sub txtAIT_332A_SCALED_Change()On Error GoTo PokeAIT_332AErrortxtAIT_332A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtAIT_332A_SCALEDText = Int((3 Rnd) + 20) Generate random value between 20 and 23txtAIT_332A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtAIT_332A_SCALEDLinkItem = AIT_332A_SCALEDtxtAIT_332A_SCALEDLinkMode = 2txtAIT_332A_SCALEDLinkPoketxtAIT_332A_SCALEDLinkMode = 0 DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total time

PokeAIT_332AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtAIT_332A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 114

Private Sub txtAIT_346A_SCALED_Change()On Error GoTo PokeAIT_346AErrortxtAIT_346A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtAIT_346A_SCALEDText = Int((3 Rnd) + 15) Generate random value between 15 and 18txtAIT_346A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtAIT_346A_SCALEDLinkItem = AIT_346A_SCALEDtxtAIT_346A_SCALEDLinkMode = 2txtAIT_346A_SCALEDLinkPoketxtAIT_346A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeAIT_346AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtAIT_346A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 115

Private Sub txtFIT_321A_SCALED_Change()On Error GoTo PokeFIT_321AErrortxtFIT_321A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtFIT_321A_SCALEDText = Int((10 Rnd) + 120) Generate random value between 120 and 130txtFIT_321A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_321A_SCALEDLinkItem = FIT_321A_SCALEDtxtFIT_321A_SCALEDLinkMode = 2txtFIT_321A_SCALEDLinkPoketxtFIT_321A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total time

PokeFIT_321AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_321A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume Next

End Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 116

Private Sub txtFIT_341A_SCALED_Change()On Error GoTo PokeFIT_341AErrortxtFIT_341A_SCALEDLinkMode = 0 PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTime

txtFIT_341A_SCALEDText = Int((3 Rnd) + 18) Generate random value between 18 and 21

txtFIT_341A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_341A_SCALEDLinkItem = FIT_341A_SCALEDtxtFIT_341A_SCALEDLinkMode = 2txtFIT_341A_SCALEDLinkPoketxtFIT_341A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeFIT_341AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_341A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 117

Private Sub txtFIT_343A_SCALED_Change()On Error GoTo PokeFIT_343AErrortxtFIT_343A_SCALEDLinkMode = 0 PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTime

txtFIT_343A_SCALEDText = Int((1 Rnd) + 3) Generate random value between 3 and 4

txtFIT_343A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_343A_SCALEDLinkItem = FIT_343A_SCALEDtxtFIT_343A_SCALEDLinkMode = 2txtFIT_343A_SCALEDLinkPoketxtFIT_343A_SCALEDLinkMode = 0 DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeFIT_343AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_343A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 118

TUTORIAL

Part 4

Questions

amp

Answers

  • Slide 1
  • Slide 2
  • Slide 3
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Slide 8
  • Slide 9
  • Slide 10
  • Slide 11
  • Slide 12
  • Slide 13
  • Slide 14
  • Slide 15
  • Slide 16
  • Slide 17
  • Slide 18
  • Slide 19
  • Slide 20
  • Slide 21
  • Slide 22
  • Slide 23
  • Slide 24
  • Slide 25
  • Slide 26
  • Slide 27
  • Slide 28
  • Slide 29
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
  • Slide 34
  • Slide 35
  • Slide 36
  • Slide 37
  • Slide 38
  • Slide 39
  • Slide 40
  • Slide 41
  • Slide 42
  • Slide 43
  • Slide 44
  • Slide 45
  • Slide 46
  • Slide 47
  • Slide 48
  • Slide 49
  • Slide 50
  • Slide 51
  • Slide 52
  • Slide 53
  • Slide 54
  • Slide 55
  • Slide 56
  • Slide 57
  • Slide 58
  • Slide 59
  • Slide 60
  • Slide 61
  • Slide 62
  • Slide 63
  • Slide 64
  • Slide 65
  • Slide 66
  • Slide 67
  • Slide 68
  • Slide 69
  • Slide 70
  • Slide 71
  • Slide 72
  • Slide 73
  • Slide 74
  • Slide 75
  • Slide 76
  • Slide 77
  • Slide 78
  • Slide 79
  • Slide 80
  • Slide 81
  • Slide 82
  • Slide 83
  • Slide 84
  • Slide 85
  • Slide 86
  • Slide 87
  • Slide 88
  • Slide 89
  • Slide 90
  • Slide 91
  • Slide 92
  • Slide 93
  • Slide 94
  • Slide 95
  • Slide 96
  • Slide 97
  • Slide 98
  • Slide 99
  • Slide 100
  • Slide 101
  • Slide 102
  • Slide 103
  • Slide 104
  • Slide 105
  • Slide 106
  • Slide 107
  • Slide 108
  • Slide 109
  • Slide 110
  • Slide 111
  • Slide 112
  • Slide 113
  • Slide 114
  • Slide 115
  • Slide 116
  • Slide 117
  • Slide 118
Page 107: TUTORIAL Ethernet PLC's Improve Oxygen Consumption ISA Expo/2001Houston, Texas Water & Wastewater Industry DivisionTuesday, September 11, 2001 1 Brad.

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 107

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 108

Excel Macros

bull ldquoRequestrdquo Macro to read values

bull ldquoPokerdquo Macro to write values

bull A Sample Excel Macro

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 109

Sub PokeMacro()MsgBox ApplicationNetworkTemplatesPathChannel = ApplicationDDEInitiate(app=brad_s_carlbergVIEW topic=Tagname) This opens a DDE channel to ViewApplicationDDEPoke Channel Temperature1 Worksheets(Sheet1)Range(A1) Puts value from R1C1 into Temperature1ApplicationDDEPoke Channel DDEReal Worksheets(Sheet1)Range(A2) Puts value from R1C1 into Temperature1ApplicationDDEPoke Channel DDEInteger Worksheets(Sheet1)Range(A3) Puts value from R1C1 into Temperature1ApplicationDDETerminate Channel This terminates the DDE channelEnd SubSub RequestMacro()Channel = ApplicationDDEInitiate(app=brad_s_carlbergVIEW topic=Tagname) This opens a DDE channel to ViewWorksheets(Sheet1)Range(C4) = ApplicationDDERequest(Channel $Hour)Worksheets(Sheet1)Range(C5) = ApplicationDDERequest(Channel $Minute)Worksheets(Sheet1)Range(C6) = ApplicationDDERequest(Channel $Second)Worksheets(Sheet1)Range(C9) = ApplicationDDERequest(Channel $day)Worksheets(Sheet1)Range(C10) = ApplicationDDERequest(Channel $date)Worksheets(Sheet1)Range(C11) = ApplicationDDERequest(Channel $datestring)Worksheets(Sheet1)Range(C12) = ApplicationDDERequest(Channel $datetime)Worksheets(Sheet1)Range(C13) = ApplicationDDERequest(Channel $date)Worksheets(Sheet1)Range(C14) = ApplicationDDERequest(Channel $month)Worksheets(Sheet1)Range(C15) = ApplicationDDERequest(Channel $year)Worksheets(Sheet1)Range(C16) = ApplicationDDERequest(Channel $time)Worksheets(Sheet1)Range(C17) = ApplicationDDERequest(Channel $timestring)Worksheets(Sheet1)Range(C18) = ApplicationDDERequest(Channel $applicationversion)Worksheets(Sheet1)Range(C19) = ApplicationDDERequest(Channel $startddeconversations)Worksheets(Sheet1)Range(C20) = ApplicationDDERequest(Channel $accesslevel)Worksheets(Sheet1)Range(C21) = ApplicationDDERequest(Channel $alarmlogging)Worksheets(Sheet1)Range(C22) = ApplicationDDERequest(Channel $applicationchanged)Worksheets(Sheet1)Range(C23) = ApplicationDDERequest(Channel $configureusers)Worksheets(Sheet1)Range(C24) = ApplicationDDERequest(Channel $changepassword)Worksheets(Sheet1)Range(C25) = ApplicationDDERequest(Channel $InactivityTimeout)Worksheets(Sheet1)Range(C26) = ApplicationDDERequest(Channel $InactivityWarning)Worksheets(Sheet1)Range(C27) = ApplicationDDERequest(Channel $LogicRunning)Worksheets(Sheet1)Range(C28) = ApplicationDDERequest(Channel $OperatorEntered)Worksheets(Sheet1)Range(C29) = ApplicationDDERequest(Channel $Operator)Worksheets(Sheet1)Range(C30) = ApplicationDDERequest(Channel $PasswordEntered)ApplicationDDETerminate Channel This terminates the DDE channelEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 110

Visual Basic

ldquoRoll Your Ownrdquo HMI - Much More powerful than Excel

Key Parameters computer nameapplication|topicitem

IO Emulator - MBPlusSimulateexe

Can ldquoRead Fromrdquo amp ldquoWrite Tordquo PLC andor HMI

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 111

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 112

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 113

Dim PauseTime Start Finish TotalTime As Integer Declare variables

Private Sub txtAIT_332A_SCALED_Change()On Error GoTo PokeAIT_332AErrortxtAIT_332A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtAIT_332A_SCALEDText = Int((3 Rnd) + 20) Generate random value between 20 and 23txtAIT_332A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtAIT_332A_SCALEDLinkItem = AIT_332A_SCALEDtxtAIT_332A_SCALEDLinkMode = 2txtAIT_332A_SCALEDLinkPoketxtAIT_332A_SCALEDLinkMode = 0 DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total time

PokeAIT_332AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtAIT_332A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 114

Private Sub txtAIT_346A_SCALED_Change()On Error GoTo PokeAIT_346AErrortxtAIT_346A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtAIT_346A_SCALEDText = Int((3 Rnd) + 15) Generate random value between 15 and 18txtAIT_346A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtAIT_346A_SCALEDLinkItem = AIT_346A_SCALEDtxtAIT_346A_SCALEDLinkMode = 2txtAIT_346A_SCALEDLinkPoketxtAIT_346A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeAIT_346AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtAIT_346A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 115

Private Sub txtFIT_321A_SCALED_Change()On Error GoTo PokeFIT_321AErrortxtFIT_321A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtFIT_321A_SCALEDText = Int((10 Rnd) + 120) Generate random value between 120 and 130txtFIT_321A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_321A_SCALEDLinkItem = FIT_321A_SCALEDtxtFIT_321A_SCALEDLinkMode = 2txtFIT_321A_SCALEDLinkPoketxtFIT_321A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total time

PokeFIT_321AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_321A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume Next

End Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 116

Private Sub txtFIT_341A_SCALED_Change()On Error GoTo PokeFIT_341AErrortxtFIT_341A_SCALEDLinkMode = 0 PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTime

txtFIT_341A_SCALEDText = Int((3 Rnd) + 18) Generate random value between 18 and 21

txtFIT_341A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_341A_SCALEDLinkItem = FIT_341A_SCALEDtxtFIT_341A_SCALEDLinkMode = 2txtFIT_341A_SCALEDLinkPoketxtFIT_341A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeFIT_341AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_341A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 117

Private Sub txtFIT_343A_SCALED_Change()On Error GoTo PokeFIT_343AErrortxtFIT_343A_SCALEDLinkMode = 0 PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTime

txtFIT_343A_SCALEDText = Int((1 Rnd) + 3) Generate random value between 3 and 4

txtFIT_343A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_343A_SCALEDLinkItem = FIT_343A_SCALEDtxtFIT_343A_SCALEDLinkMode = 2txtFIT_343A_SCALEDLinkPoketxtFIT_343A_SCALEDLinkMode = 0 DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeFIT_343AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_343A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 118

TUTORIAL

Part 4

Questions

amp

Answers

  • Slide 1
  • Slide 2
  • Slide 3
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Slide 8
  • Slide 9
  • Slide 10
  • Slide 11
  • Slide 12
  • Slide 13
  • Slide 14
  • Slide 15
  • Slide 16
  • Slide 17
  • Slide 18
  • Slide 19
  • Slide 20
  • Slide 21
  • Slide 22
  • Slide 23
  • Slide 24
  • Slide 25
  • Slide 26
  • Slide 27
  • Slide 28
  • Slide 29
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
  • Slide 34
  • Slide 35
  • Slide 36
  • Slide 37
  • Slide 38
  • Slide 39
  • Slide 40
  • Slide 41
  • Slide 42
  • Slide 43
  • Slide 44
  • Slide 45
  • Slide 46
  • Slide 47
  • Slide 48
  • Slide 49
  • Slide 50
  • Slide 51
  • Slide 52
  • Slide 53
  • Slide 54
  • Slide 55
  • Slide 56
  • Slide 57
  • Slide 58
  • Slide 59
  • Slide 60
  • Slide 61
  • Slide 62
  • Slide 63
  • Slide 64
  • Slide 65
  • Slide 66
  • Slide 67
  • Slide 68
  • Slide 69
  • Slide 70
  • Slide 71
  • Slide 72
  • Slide 73
  • Slide 74
  • Slide 75
  • Slide 76
  • Slide 77
  • Slide 78
  • Slide 79
  • Slide 80
  • Slide 81
  • Slide 82
  • Slide 83
  • Slide 84
  • Slide 85
  • Slide 86
  • Slide 87
  • Slide 88
  • Slide 89
  • Slide 90
  • Slide 91
  • Slide 92
  • Slide 93
  • Slide 94
  • Slide 95
  • Slide 96
  • Slide 97
  • Slide 98
  • Slide 99
  • Slide 100
  • Slide 101
  • Slide 102
  • Slide 103
  • Slide 104
  • Slide 105
  • Slide 106
  • Slide 107
  • Slide 108
  • Slide 109
  • Slide 110
  • Slide 111
  • Slide 112
  • Slide 113
  • Slide 114
  • Slide 115
  • Slide 116
  • Slide 117
  • Slide 118
Page 108: TUTORIAL Ethernet PLC's Improve Oxygen Consumption ISA Expo/2001Houston, Texas Water & Wastewater Industry DivisionTuesday, September 11, 2001 1 Brad.

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 108

Excel Macros

bull ldquoRequestrdquo Macro to read values

bull ldquoPokerdquo Macro to write values

bull A Sample Excel Macro

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 109

Sub PokeMacro()MsgBox ApplicationNetworkTemplatesPathChannel = ApplicationDDEInitiate(app=brad_s_carlbergVIEW topic=Tagname) This opens a DDE channel to ViewApplicationDDEPoke Channel Temperature1 Worksheets(Sheet1)Range(A1) Puts value from R1C1 into Temperature1ApplicationDDEPoke Channel DDEReal Worksheets(Sheet1)Range(A2) Puts value from R1C1 into Temperature1ApplicationDDEPoke Channel DDEInteger Worksheets(Sheet1)Range(A3) Puts value from R1C1 into Temperature1ApplicationDDETerminate Channel This terminates the DDE channelEnd SubSub RequestMacro()Channel = ApplicationDDEInitiate(app=brad_s_carlbergVIEW topic=Tagname) This opens a DDE channel to ViewWorksheets(Sheet1)Range(C4) = ApplicationDDERequest(Channel $Hour)Worksheets(Sheet1)Range(C5) = ApplicationDDERequest(Channel $Minute)Worksheets(Sheet1)Range(C6) = ApplicationDDERequest(Channel $Second)Worksheets(Sheet1)Range(C9) = ApplicationDDERequest(Channel $day)Worksheets(Sheet1)Range(C10) = ApplicationDDERequest(Channel $date)Worksheets(Sheet1)Range(C11) = ApplicationDDERequest(Channel $datestring)Worksheets(Sheet1)Range(C12) = ApplicationDDERequest(Channel $datetime)Worksheets(Sheet1)Range(C13) = ApplicationDDERequest(Channel $date)Worksheets(Sheet1)Range(C14) = ApplicationDDERequest(Channel $month)Worksheets(Sheet1)Range(C15) = ApplicationDDERequest(Channel $year)Worksheets(Sheet1)Range(C16) = ApplicationDDERequest(Channel $time)Worksheets(Sheet1)Range(C17) = ApplicationDDERequest(Channel $timestring)Worksheets(Sheet1)Range(C18) = ApplicationDDERequest(Channel $applicationversion)Worksheets(Sheet1)Range(C19) = ApplicationDDERequest(Channel $startddeconversations)Worksheets(Sheet1)Range(C20) = ApplicationDDERequest(Channel $accesslevel)Worksheets(Sheet1)Range(C21) = ApplicationDDERequest(Channel $alarmlogging)Worksheets(Sheet1)Range(C22) = ApplicationDDERequest(Channel $applicationchanged)Worksheets(Sheet1)Range(C23) = ApplicationDDERequest(Channel $configureusers)Worksheets(Sheet1)Range(C24) = ApplicationDDERequest(Channel $changepassword)Worksheets(Sheet1)Range(C25) = ApplicationDDERequest(Channel $InactivityTimeout)Worksheets(Sheet1)Range(C26) = ApplicationDDERequest(Channel $InactivityWarning)Worksheets(Sheet1)Range(C27) = ApplicationDDERequest(Channel $LogicRunning)Worksheets(Sheet1)Range(C28) = ApplicationDDERequest(Channel $OperatorEntered)Worksheets(Sheet1)Range(C29) = ApplicationDDERequest(Channel $Operator)Worksheets(Sheet1)Range(C30) = ApplicationDDERequest(Channel $PasswordEntered)ApplicationDDETerminate Channel This terminates the DDE channelEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 110

Visual Basic

ldquoRoll Your Ownrdquo HMI - Much More powerful than Excel

Key Parameters computer nameapplication|topicitem

IO Emulator - MBPlusSimulateexe

Can ldquoRead Fromrdquo amp ldquoWrite Tordquo PLC andor HMI

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 111

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 112

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 113

Dim PauseTime Start Finish TotalTime As Integer Declare variables

Private Sub txtAIT_332A_SCALED_Change()On Error GoTo PokeAIT_332AErrortxtAIT_332A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtAIT_332A_SCALEDText = Int((3 Rnd) + 20) Generate random value between 20 and 23txtAIT_332A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtAIT_332A_SCALEDLinkItem = AIT_332A_SCALEDtxtAIT_332A_SCALEDLinkMode = 2txtAIT_332A_SCALEDLinkPoketxtAIT_332A_SCALEDLinkMode = 0 DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total time

PokeAIT_332AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtAIT_332A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 114

Private Sub txtAIT_346A_SCALED_Change()On Error GoTo PokeAIT_346AErrortxtAIT_346A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtAIT_346A_SCALEDText = Int((3 Rnd) + 15) Generate random value between 15 and 18txtAIT_346A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtAIT_346A_SCALEDLinkItem = AIT_346A_SCALEDtxtAIT_346A_SCALEDLinkMode = 2txtAIT_346A_SCALEDLinkPoketxtAIT_346A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeAIT_346AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtAIT_346A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 115

Private Sub txtFIT_321A_SCALED_Change()On Error GoTo PokeFIT_321AErrortxtFIT_321A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtFIT_321A_SCALEDText = Int((10 Rnd) + 120) Generate random value between 120 and 130txtFIT_321A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_321A_SCALEDLinkItem = FIT_321A_SCALEDtxtFIT_321A_SCALEDLinkMode = 2txtFIT_321A_SCALEDLinkPoketxtFIT_321A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total time

PokeFIT_321AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_321A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume Next

End Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 116

Private Sub txtFIT_341A_SCALED_Change()On Error GoTo PokeFIT_341AErrortxtFIT_341A_SCALEDLinkMode = 0 PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTime

txtFIT_341A_SCALEDText = Int((3 Rnd) + 18) Generate random value between 18 and 21

txtFIT_341A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_341A_SCALEDLinkItem = FIT_341A_SCALEDtxtFIT_341A_SCALEDLinkMode = 2txtFIT_341A_SCALEDLinkPoketxtFIT_341A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeFIT_341AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_341A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 117

Private Sub txtFIT_343A_SCALED_Change()On Error GoTo PokeFIT_343AErrortxtFIT_343A_SCALEDLinkMode = 0 PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTime

txtFIT_343A_SCALEDText = Int((1 Rnd) + 3) Generate random value between 3 and 4

txtFIT_343A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_343A_SCALEDLinkItem = FIT_343A_SCALEDtxtFIT_343A_SCALEDLinkMode = 2txtFIT_343A_SCALEDLinkPoketxtFIT_343A_SCALEDLinkMode = 0 DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeFIT_343AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_343A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 118

TUTORIAL

Part 4

Questions

amp

Answers

  • Slide 1
  • Slide 2
  • Slide 3
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Slide 8
  • Slide 9
  • Slide 10
  • Slide 11
  • Slide 12
  • Slide 13
  • Slide 14
  • Slide 15
  • Slide 16
  • Slide 17
  • Slide 18
  • Slide 19
  • Slide 20
  • Slide 21
  • Slide 22
  • Slide 23
  • Slide 24
  • Slide 25
  • Slide 26
  • Slide 27
  • Slide 28
  • Slide 29
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
  • Slide 34
  • Slide 35
  • Slide 36
  • Slide 37
  • Slide 38
  • Slide 39
  • Slide 40
  • Slide 41
  • Slide 42
  • Slide 43
  • Slide 44
  • Slide 45
  • Slide 46
  • Slide 47
  • Slide 48
  • Slide 49
  • Slide 50
  • Slide 51
  • Slide 52
  • Slide 53
  • Slide 54
  • Slide 55
  • Slide 56
  • Slide 57
  • Slide 58
  • Slide 59
  • Slide 60
  • Slide 61
  • Slide 62
  • Slide 63
  • Slide 64
  • Slide 65
  • Slide 66
  • Slide 67
  • Slide 68
  • Slide 69
  • Slide 70
  • Slide 71
  • Slide 72
  • Slide 73
  • Slide 74
  • Slide 75
  • Slide 76
  • Slide 77
  • Slide 78
  • Slide 79
  • Slide 80
  • Slide 81
  • Slide 82
  • Slide 83
  • Slide 84
  • Slide 85
  • Slide 86
  • Slide 87
  • Slide 88
  • Slide 89
  • Slide 90
  • Slide 91
  • Slide 92
  • Slide 93
  • Slide 94
  • Slide 95
  • Slide 96
  • Slide 97
  • Slide 98
  • Slide 99
  • Slide 100
  • Slide 101
  • Slide 102
  • Slide 103
  • Slide 104
  • Slide 105
  • Slide 106
  • Slide 107
  • Slide 108
  • Slide 109
  • Slide 110
  • Slide 111
  • Slide 112
  • Slide 113
  • Slide 114
  • Slide 115
  • Slide 116
  • Slide 117
  • Slide 118
Page 109: TUTORIAL Ethernet PLC's Improve Oxygen Consumption ISA Expo/2001Houston, Texas Water & Wastewater Industry DivisionTuesday, September 11, 2001 1 Brad.

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 109

Sub PokeMacro()MsgBox ApplicationNetworkTemplatesPathChannel = ApplicationDDEInitiate(app=brad_s_carlbergVIEW topic=Tagname) This opens a DDE channel to ViewApplicationDDEPoke Channel Temperature1 Worksheets(Sheet1)Range(A1) Puts value from R1C1 into Temperature1ApplicationDDEPoke Channel DDEReal Worksheets(Sheet1)Range(A2) Puts value from R1C1 into Temperature1ApplicationDDEPoke Channel DDEInteger Worksheets(Sheet1)Range(A3) Puts value from R1C1 into Temperature1ApplicationDDETerminate Channel This terminates the DDE channelEnd SubSub RequestMacro()Channel = ApplicationDDEInitiate(app=brad_s_carlbergVIEW topic=Tagname) This opens a DDE channel to ViewWorksheets(Sheet1)Range(C4) = ApplicationDDERequest(Channel $Hour)Worksheets(Sheet1)Range(C5) = ApplicationDDERequest(Channel $Minute)Worksheets(Sheet1)Range(C6) = ApplicationDDERequest(Channel $Second)Worksheets(Sheet1)Range(C9) = ApplicationDDERequest(Channel $day)Worksheets(Sheet1)Range(C10) = ApplicationDDERequest(Channel $date)Worksheets(Sheet1)Range(C11) = ApplicationDDERequest(Channel $datestring)Worksheets(Sheet1)Range(C12) = ApplicationDDERequest(Channel $datetime)Worksheets(Sheet1)Range(C13) = ApplicationDDERequest(Channel $date)Worksheets(Sheet1)Range(C14) = ApplicationDDERequest(Channel $month)Worksheets(Sheet1)Range(C15) = ApplicationDDERequest(Channel $year)Worksheets(Sheet1)Range(C16) = ApplicationDDERequest(Channel $time)Worksheets(Sheet1)Range(C17) = ApplicationDDERequest(Channel $timestring)Worksheets(Sheet1)Range(C18) = ApplicationDDERequest(Channel $applicationversion)Worksheets(Sheet1)Range(C19) = ApplicationDDERequest(Channel $startddeconversations)Worksheets(Sheet1)Range(C20) = ApplicationDDERequest(Channel $accesslevel)Worksheets(Sheet1)Range(C21) = ApplicationDDERequest(Channel $alarmlogging)Worksheets(Sheet1)Range(C22) = ApplicationDDERequest(Channel $applicationchanged)Worksheets(Sheet1)Range(C23) = ApplicationDDERequest(Channel $configureusers)Worksheets(Sheet1)Range(C24) = ApplicationDDERequest(Channel $changepassword)Worksheets(Sheet1)Range(C25) = ApplicationDDERequest(Channel $InactivityTimeout)Worksheets(Sheet1)Range(C26) = ApplicationDDERequest(Channel $InactivityWarning)Worksheets(Sheet1)Range(C27) = ApplicationDDERequest(Channel $LogicRunning)Worksheets(Sheet1)Range(C28) = ApplicationDDERequest(Channel $OperatorEntered)Worksheets(Sheet1)Range(C29) = ApplicationDDERequest(Channel $Operator)Worksheets(Sheet1)Range(C30) = ApplicationDDERequest(Channel $PasswordEntered)ApplicationDDETerminate Channel This terminates the DDE channelEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 110

Visual Basic

ldquoRoll Your Ownrdquo HMI - Much More powerful than Excel

Key Parameters computer nameapplication|topicitem

IO Emulator - MBPlusSimulateexe

Can ldquoRead Fromrdquo amp ldquoWrite Tordquo PLC andor HMI

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 111

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 112

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 113

Dim PauseTime Start Finish TotalTime As Integer Declare variables

Private Sub txtAIT_332A_SCALED_Change()On Error GoTo PokeAIT_332AErrortxtAIT_332A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtAIT_332A_SCALEDText = Int((3 Rnd) + 20) Generate random value between 20 and 23txtAIT_332A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtAIT_332A_SCALEDLinkItem = AIT_332A_SCALEDtxtAIT_332A_SCALEDLinkMode = 2txtAIT_332A_SCALEDLinkPoketxtAIT_332A_SCALEDLinkMode = 0 DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total time

PokeAIT_332AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtAIT_332A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 114

Private Sub txtAIT_346A_SCALED_Change()On Error GoTo PokeAIT_346AErrortxtAIT_346A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtAIT_346A_SCALEDText = Int((3 Rnd) + 15) Generate random value between 15 and 18txtAIT_346A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtAIT_346A_SCALEDLinkItem = AIT_346A_SCALEDtxtAIT_346A_SCALEDLinkMode = 2txtAIT_346A_SCALEDLinkPoketxtAIT_346A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeAIT_346AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtAIT_346A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 115

Private Sub txtFIT_321A_SCALED_Change()On Error GoTo PokeFIT_321AErrortxtFIT_321A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtFIT_321A_SCALEDText = Int((10 Rnd) + 120) Generate random value between 120 and 130txtFIT_321A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_321A_SCALEDLinkItem = FIT_321A_SCALEDtxtFIT_321A_SCALEDLinkMode = 2txtFIT_321A_SCALEDLinkPoketxtFIT_321A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total time

PokeFIT_321AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_321A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume Next

End Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 116

Private Sub txtFIT_341A_SCALED_Change()On Error GoTo PokeFIT_341AErrortxtFIT_341A_SCALEDLinkMode = 0 PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTime

txtFIT_341A_SCALEDText = Int((3 Rnd) + 18) Generate random value between 18 and 21

txtFIT_341A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_341A_SCALEDLinkItem = FIT_341A_SCALEDtxtFIT_341A_SCALEDLinkMode = 2txtFIT_341A_SCALEDLinkPoketxtFIT_341A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeFIT_341AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_341A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 117

Private Sub txtFIT_343A_SCALED_Change()On Error GoTo PokeFIT_343AErrortxtFIT_343A_SCALEDLinkMode = 0 PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTime

txtFIT_343A_SCALEDText = Int((1 Rnd) + 3) Generate random value between 3 and 4

txtFIT_343A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_343A_SCALEDLinkItem = FIT_343A_SCALEDtxtFIT_343A_SCALEDLinkMode = 2txtFIT_343A_SCALEDLinkPoketxtFIT_343A_SCALEDLinkMode = 0 DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeFIT_343AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_343A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 118

TUTORIAL

Part 4

Questions

amp

Answers

  • Slide 1
  • Slide 2
  • Slide 3
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Slide 8
  • Slide 9
  • Slide 10
  • Slide 11
  • Slide 12
  • Slide 13
  • Slide 14
  • Slide 15
  • Slide 16
  • Slide 17
  • Slide 18
  • Slide 19
  • Slide 20
  • Slide 21
  • Slide 22
  • Slide 23
  • Slide 24
  • Slide 25
  • Slide 26
  • Slide 27
  • Slide 28
  • Slide 29
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
  • Slide 34
  • Slide 35
  • Slide 36
  • Slide 37
  • Slide 38
  • Slide 39
  • Slide 40
  • Slide 41
  • Slide 42
  • Slide 43
  • Slide 44
  • Slide 45
  • Slide 46
  • Slide 47
  • Slide 48
  • Slide 49
  • Slide 50
  • Slide 51
  • Slide 52
  • Slide 53
  • Slide 54
  • Slide 55
  • Slide 56
  • Slide 57
  • Slide 58
  • Slide 59
  • Slide 60
  • Slide 61
  • Slide 62
  • Slide 63
  • Slide 64
  • Slide 65
  • Slide 66
  • Slide 67
  • Slide 68
  • Slide 69
  • Slide 70
  • Slide 71
  • Slide 72
  • Slide 73
  • Slide 74
  • Slide 75
  • Slide 76
  • Slide 77
  • Slide 78
  • Slide 79
  • Slide 80
  • Slide 81
  • Slide 82
  • Slide 83
  • Slide 84
  • Slide 85
  • Slide 86
  • Slide 87
  • Slide 88
  • Slide 89
  • Slide 90
  • Slide 91
  • Slide 92
  • Slide 93
  • Slide 94
  • Slide 95
  • Slide 96
  • Slide 97
  • Slide 98
  • Slide 99
  • Slide 100
  • Slide 101
  • Slide 102
  • Slide 103
  • Slide 104
  • Slide 105
  • Slide 106
  • Slide 107
  • Slide 108
  • Slide 109
  • Slide 110
  • Slide 111
  • Slide 112
  • Slide 113
  • Slide 114
  • Slide 115
  • Slide 116
  • Slide 117
  • Slide 118
Page 110: TUTORIAL Ethernet PLC's Improve Oxygen Consumption ISA Expo/2001Houston, Texas Water & Wastewater Industry DivisionTuesday, September 11, 2001 1 Brad.

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 110

Visual Basic

ldquoRoll Your Ownrdquo HMI - Much More powerful than Excel

Key Parameters computer nameapplication|topicitem

IO Emulator - MBPlusSimulateexe

Can ldquoRead Fromrdquo amp ldquoWrite Tordquo PLC andor HMI

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 111

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 112

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 113

Dim PauseTime Start Finish TotalTime As Integer Declare variables

Private Sub txtAIT_332A_SCALED_Change()On Error GoTo PokeAIT_332AErrortxtAIT_332A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtAIT_332A_SCALEDText = Int((3 Rnd) + 20) Generate random value between 20 and 23txtAIT_332A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtAIT_332A_SCALEDLinkItem = AIT_332A_SCALEDtxtAIT_332A_SCALEDLinkMode = 2txtAIT_332A_SCALEDLinkPoketxtAIT_332A_SCALEDLinkMode = 0 DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total time

PokeAIT_332AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtAIT_332A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 114

Private Sub txtAIT_346A_SCALED_Change()On Error GoTo PokeAIT_346AErrortxtAIT_346A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtAIT_346A_SCALEDText = Int((3 Rnd) + 15) Generate random value between 15 and 18txtAIT_346A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtAIT_346A_SCALEDLinkItem = AIT_346A_SCALEDtxtAIT_346A_SCALEDLinkMode = 2txtAIT_346A_SCALEDLinkPoketxtAIT_346A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeAIT_346AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtAIT_346A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 115

Private Sub txtFIT_321A_SCALED_Change()On Error GoTo PokeFIT_321AErrortxtFIT_321A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtFIT_321A_SCALEDText = Int((10 Rnd) + 120) Generate random value between 120 and 130txtFIT_321A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_321A_SCALEDLinkItem = FIT_321A_SCALEDtxtFIT_321A_SCALEDLinkMode = 2txtFIT_321A_SCALEDLinkPoketxtFIT_321A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total time

PokeFIT_321AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_321A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume Next

End Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 116

Private Sub txtFIT_341A_SCALED_Change()On Error GoTo PokeFIT_341AErrortxtFIT_341A_SCALEDLinkMode = 0 PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTime

txtFIT_341A_SCALEDText = Int((3 Rnd) + 18) Generate random value between 18 and 21

txtFIT_341A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_341A_SCALEDLinkItem = FIT_341A_SCALEDtxtFIT_341A_SCALEDLinkMode = 2txtFIT_341A_SCALEDLinkPoketxtFIT_341A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeFIT_341AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_341A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 117

Private Sub txtFIT_343A_SCALED_Change()On Error GoTo PokeFIT_343AErrortxtFIT_343A_SCALEDLinkMode = 0 PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTime

txtFIT_343A_SCALEDText = Int((1 Rnd) + 3) Generate random value between 3 and 4

txtFIT_343A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_343A_SCALEDLinkItem = FIT_343A_SCALEDtxtFIT_343A_SCALEDLinkMode = 2txtFIT_343A_SCALEDLinkPoketxtFIT_343A_SCALEDLinkMode = 0 DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeFIT_343AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_343A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 118

TUTORIAL

Part 4

Questions

amp

Answers

  • Slide 1
  • Slide 2
  • Slide 3
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Slide 8
  • Slide 9
  • Slide 10
  • Slide 11
  • Slide 12
  • Slide 13
  • Slide 14
  • Slide 15
  • Slide 16
  • Slide 17
  • Slide 18
  • Slide 19
  • Slide 20
  • Slide 21
  • Slide 22
  • Slide 23
  • Slide 24
  • Slide 25
  • Slide 26
  • Slide 27
  • Slide 28
  • Slide 29
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
  • Slide 34
  • Slide 35
  • Slide 36
  • Slide 37
  • Slide 38
  • Slide 39
  • Slide 40
  • Slide 41
  • Slide 42
  • Slide 43
  • Slide 44
  • Slide 45
  • Slide 46
  • Slide 47
  • Slide 48
  • Slide 49
  • Slide 50
  • Slide 51
  • Slide 52
  • Slide 53
  • Slide 54
  • Slide 55
  • Slide 56
  • Slide 57
  • Slide 58
  • Slide 59
  • Slide 60
  • Slide 61
  • Slide 62
  • Slide 63
  • Slide 64
  • Slide 65
  • Slide 66
  • Slide 67
  • Slide 68
  • Slide 69
  • Slide 70
  • Slide 71
  • Slide 72
  • Slide 73
  • Slide 74
  • Slide 75
  • Slide 76
  • Slide 77
  • Slide 78
  • Slide 79
  • Slide 80
  • Slide 81
  • Slide 82
  • Slide 83
  • Slide 84
  • Slide 85
  • Slide 86
  • Slide 87
  • Slide 88
  • Slide 89
  • Slide 90
  • Slide 91
  • Slide 92
  • Slide 93
  • Slide 94
  • Slide 95
  • Slide 96
  • Slide 97
  • Slide 98
  • Slide 99
  • Slide 100
  • Slide 101
  • Slide 102
  • Slide 103
  • Slide 104
  • Slide 105
  • Slide 106
  • Slide 107
  • Slide 108
  • Slide 109
  • Slide 110
  • Slide 111
  • Slide 112
  • Slide 113
  • Slide 114
  • Slide 115
  • Slide 116
  • Slide 117
  • Slide 118
Page 111: TUTORIAL Ethernet PLC's Improve Oxygen Consumption ISA Expo/2001Houston, Texas Water & Wastewater Industry DivisionTuesday, September 11, 2001 1 Brad.

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 111

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 112

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 113

Dim PauseTime Start Finish TotalTime As Integer Declare variables

Private Sub txtAIT_332A_SCALED_Change()On Error GoTo PokeAIT_332AErrortxtAIT_332A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtAIT_332A_SCALEDText = Int((3 Rnd) + 20) Generate random value between 20 and 23txtAIT_332A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtAIT_332A_SCALEDLinkItem = AIT_332A_SCALEDtxtAIT_332A_SCALEDLinkMode = 2txtAIT_332A_SCALEDLinkPoketxtAIT_332A_SCALEDLinkMode = 0 DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total time

PokeAIT_332AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtAIT_332A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 114

Private Sub txtAIT_346A_SCALED_Change()On Error GoTo PokeAIT_346AErrortxtAIT_346A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtAIT_346A_SCALEDText = Int((3 Rnd) + 15) Generate random value between 15 and 18txtAIT_346A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtAIT_346A_SCALEDLinkItem = AIT_346A_SCALEDtxtAIT_346A_SCALEDLinkMode = 2txtAIT_346A_SCALEDLinkPoketxtAIT_346A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeAIT_346AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtAIT_346A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 115

Private Sub txtFIT_321A_SCALED_Change()On Error GoTo PokeFIT_321AErrortxtFIT_321A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtFIT_321A_SCALEDText = Int((10 Rnd) + 120) Generate random value between 120 and 130txtFIT_321A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_321A_SCALEDLinkItem = FIT_321A_SCALEDtxtFIT_321A_SCALEDLinkMode = 2txtFIT_321A_SCALEDLinkPoketxtFIT_321A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total time

PokeFIT_321AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_321A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume Next

End Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 116

Private Sub txtFIT_341A_SCALED_Change()On Error GoTo PokeFIT_341AErrortxtFIT_341A_SCALEDLinkMode = 0 PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTime

txtFIT_341A_SCALEDText = Int((3 Rnd) + 18) Generate random value between 18 and 21

txtFIT_341A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_341A_SCALEDLinkItem = FIT_341A_SCALEDtxtFIT_341A_SCALEDLinkMode = 2txtFIT_341A_SCALEDLinkPoketxtFIT_341A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeFIT_341AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_341A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 117

Private Sub txtFIT_343A_SCALED_Change()On Error GoTo PokeFIT_343AErrortxtFIT_343A_SCALEDLinkMode = 0 PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTime

txtFIT_343A_SCALEDText = Int((1 Rnd) + 3) Generate random value between 3 and 4

txtFIT_343A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_343A_SCALEDLinkItem = FIT_343A_SCALEDtxtFIT_343A_SCALEDLinkMode = 2txtFIT_343A_SCALEDLinkPoketxtFIT_343A_SCALEDLinkMode = 0 DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeFIT_343AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_343A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 118

TUTORIAL

Part 4

Questions

amp

Answers

  • Slide 1
  • Slide 2
  • Slide 3
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Slide 8
  • Slide 9
  • Slide 10
  • Slide 11
  • Slide 12
  • Slide 13
  • Slide 14
  • Slide 15
  • Slide 16
  • Slide 17
  • Slide 18
  • Slide 19
  • Slide 20
  • Slide 21
  • Slide 22
  • Slide 23
  • Slide 24
  • Slide 25
  • Slide 26
  • Slide 27
  • Slide 28
  • Slide 29
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
  • Slide 34
  • Slide 35
  • Slide 36
  • Slide 37
  • Slide 38
  • Slide 39
  • Slide 40
  • Slide 41
  • Slide 42
  • Slide 43
  • Slide 44
  • Slide 45
  • Slide 46
  • Slide 47
  • Slide 48
  • Slide 49
  • Slide 50
  • Slide 51
  • Slide 52
  • Slide 53
  • Slide 54
  • Slide 55
  • Slide 56
  • Slide 57
  • Slide 58
  • Slide 59
  • Slide 60
  • Slide 61
  • Slide 62
  • Slide 63
  • Slide 64
  • Slide 65
  • Slide 66
  • Slide 67
  • Slide 68
  • Slide 69
  • Slide 70
  • Slide 71
  • Slide 72
  • Slide 73
  • Slide 74
  • Slide 75
  • Slide 76
  • Slide 77
  • Slide 78
  • Slide 79
  • Slide 80
  • Slide 81
  • Slide 82
  • Slide 83
  • Slide 84
  • Slide 85
  • Slide 86
  • Slide 87
  • Slide 88
  • Slide 89
  • Slide 90
  • Slide 91
  • Slide 92
  • Slide 93
  • Slide 94
  • Slide 95
  • Slide 96
  • Slide 97
  • Slide 98
  • Slide 99
  • Slide 100
  • Slide 101
  • Slide 102
  • Slide 103
  • Slide 104
  • Slide 105
  • Slide 106
  • Slide 107
  • Slide 108
  • Slide 109
  • Slide 110
  • Slide 111
  • Slide 112
  • Slide 113
  • Slide 114
  • Slide 115
  • Slide 116
  • Slide 117
  • Slide 118
Page 112: TUTORIAL Ethernet PLC's Improve Oxygen Consumption ISA Expo/2001Houston, Texas Water & Wastewater Industry DivisionTuesday, September 11, 2001 1 Brad.

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 112

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 113

Dim PauseTime Start Finish TotalTime As Integer Declare variables

Private Sub txtAIT_332A_SCALED_Change()On Error GoTo PokeAIT_332AErrortxtAIT_332A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtAIT_332A_SCALEDText = Int((3 Rnd) + 20) Generate random value between 20 and 23txtAIT_332A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtAIT_332A_SCALEDLinkItem = AIT_332A_SCALEDtxtAIT_332A_SCALEDLinkMode = 2txtAIT_332A_SCALEDLinkPoketxtAIT_332A_SCALEDLinkMode = 0 DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total time

PokeAIT_332AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtAIT_332A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 114

Private Sub txtAIT_346A_SCALED_Change()On Error GoTo PokeAIT_346AErrortxtAIT_346A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtAIT_346A_SCALEDText = Int((3 Rnd) + 15) Generate random value between 15 and 18txtAIT_346A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtAIT_346A_SCALEDLinkItem = AIT_346A_SCALEDtxtAIT_346A_SCALEDLinkMode = 2txtAIT_346A_SCALEDLinkPoketxtAIT_346A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeAIT_346AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtAIT_346A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 115

Private Sub txtFIT_321A_SCALED_Change()On Error GoTo PokeFIT_321AErrortxtFIT_321A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtFIT_321A_SCALEDText = Int((10 Rnd) + 120) Generate random value between 120 and 130txtFIT_321A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_321A_SCALEDLinkItem = FIT_321A_SCALEDtxtFIT_321A_SCALEDLinkMode = 2txtFIT_321A_SCALEDLinkPoketxtFIT_321A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total time

PokeFIT_321AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_321A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume Next

End Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 116

Private Sub txtFIT_341A_SCALED_Change()On Error GoTo PokeFIT_341AErrortxtFIT_341A_SCALEDLinkMode = 0 PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTime

txtFIT_341A_SCALEDText = Int((3 Rnd) + 18) Generate random value between 18 and 21

txtFIT_341A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_341A_SCALEDLinkItem = FIT_341A_SCALEDtxtFIT_341A_SCALEDLinkMode = 2txtFIT_341A_SCALEDLinkPoketxtFIT_341A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeFIT_341AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_341A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 117

Private Sub txtFIT_343A_SCALED_Change()On Error GoTo PokeFIT_343AErrortxtFIT_343A_SCALEDLinkMode = 0 PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTime

txtFIT_343A_SCALEDText = Int((1 Rnd) + 3) Generate random value between 3 and 4

txtFIT_343A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_343A_SCALEDLinkItem = FIT_343A_SCALEDtxtFIT_343A_SCALEDLinkMode = 2txtFIT_343A_SCALEDLinkPoketxtFIT_343A_SCALEDLinkMode = 0 DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeFIT_343AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_343A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 118

TUTORIAL

Part 4

Questions

amp

Answers

  • Slide 1
  • Slide 2
  • Slide 3
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Slide 8
  • Slide 9
  • Slide 10
  • Slide 11
  • Slide 12
  • Slide 13
  • Slide 14
  • Slide 15
  • Slide 16
  • Slide 17
  • Slide 18
  • Slide 19
  • Slide 20
  • Slide 21
  • Slide 22
  • Slide 23
  • Slide 24
  • Slide 25
  • Slide 26
  • Slide 27
  • Slide 28
  • Slide 29
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
  • Slide 34
  • Slide 35
  • Slide 36
  • Slide 37
  • Slide 38
  • Slide 39
  • Slide 40
  • Slide 41
  • Slide 42
  • Slide 43
  • Slide 44
  • Slide 45
  • Slide 46
  • Slide 47
  • Slide 48
  • Slide 49
  • Slide 50
  • Slide 51
  • Slide 52
  • Slide 53
  • Slide 54
  • Slide 55
  • Slide 56
  • Slide 57
  • Slide 58
  • Slide 59
  • Slide 60
  • Slide 61
  • Slide 62
  • Slide 63
  • Slide 64
  • Slide 65
  • Slide 66
  • Slide 67
  • Slide 68
  • Slide 69
  • Slide 70
  • Slide 71
  • Slide 72
  • Slide 73
  • Slide 74
  • Slide 75
  • Slide 76
  • Slide 77
  • Slide 78
  • Slide 79
  • Slide 80
  • Slide 81
  • Slide 82
  • Slide 83
  • Slide 84
  • Slide 85
  • Slide 86
  • Slide 87
  • Slide 88
  • Slide 89
  • Slide 90
  • Slide 91
  • Slide 92
  • Slide 93
  • Slide 94
  • Slide 95
  • Slide 96
  • Slide 97
  • Slide 98
  • Slide 99
  • Slide 100
  • Slide 101
  • Slide 102
  • Slide 103
  • Slide 104
  • Slide 105
  • Slide 106
  • Slide 107
  • Slide 108
  • Slide 109
  • Slide 110
  • Slide 111
  • Slide 112
  • Slide 113
  • Slide 114
  • Slide 115
  • Slide 116
  • Slide 117
  • Slide 118
Page 113: TUTORIAL Ethernet PLC's Improve Oxygen Consumption ISA Expo/2001Houston, Texas Water & Wastewater Industry DivisionTuesday, September 11, 2001 1 Brad.

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 113

Dim PauseTime Start Finish TotalTime As Integer Declare variables

Private Sub txtAIT_332A_SCALED_Change()On Error GoTo PokeAIT_332AErrortxtAIT_332A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtAIT_332A_SCALEDText = Int((3 Rnd) + 20) Generate random value between 20 and 23txtAIT_332A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtAIT_332A_SCALEDLinkItem = AIT_332A_SCALEDtxtAIT_332A_SCALEDLinkMode = 2txtAIT_332A_SCALEDLinkPoketxtAIT_332A_SCALEDLinkMode = 0 DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total time

PokeAIT_332AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtAIT_332A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 114

Private Sub txtAIT_346A_SCALED_Change()On Error GoTo PokeAIT_346AErrortxtAIT_346A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtAIT_346A_SCALEDText = Int((3 Rnd) + 15) Generate random value between 15 and 18txtAIT_346A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtAIT_346A_SCALEDLinkItem = AIT_346A_SCALEDtxtAIT_346A_SCALEDLinkMode = 2txtAIT_346A_SCALEDLinkPoketxtAIT_346A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeAIT_346AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtAIT_346A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 115

Private Sub txtFIT_321A_SCALED_Change()On Error GoTo PokeFIT_321AErrortxtFIT_321A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtFIT_321A_SCALEDText = Int((10 Rnd) + 120) Generate random value between 120 and 130txtFIT_321A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_321A_SCALEDLinkItem = FIT_321A_SCALEDtxtFIT_321A_SCALEDLinkMode = 2txtFIT_321A_SCALEDLinkPoketxtFIT_321A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total time

PokeFIT_321AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_321A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume Next

End Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 116

Private Sub txtFIT_341A_SCALED_Change()On Error GoTo PokeFIT_341AErrortxtFIT_341A_SCALEDLinkMode = 0 PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTime

txtFIT_341A_SCALEDText = Int((3 Rnd) + 18) Generate random value between 18 and 21

txtFIT_341A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_341A_SCALEDLinkItem = FIT_341A_SCALEDtxtFIT_341A_SCALEDLinkMode = 2txtFIT_341A_SCALEDLinkPoketxtFIT_341A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeFIT_341AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_341A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 117

Private Sub txtFIT_343A_SCALED_Change()On Error GoTo PokeFIT_343AErrortxtFIT_343A_SCALEDLinkMode = 0 PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTime

txtFIT_343A_SCALEDText = Int((1 Rnd) + 3) Generate random value between 3 and 4

txtFIT_343A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_343A_SCALEDLinkItem = FIT_343A_SCALEDtxtFIT_343A_SCALEDLinkMode = 2txtFIT_343A_SCALEDLinkPoketxtFIT_343A_SCALEDLinkMode = 0 DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeFIT_343AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_343A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 118

TUTORIAL

Part 4

Questions

amp

Answers

  • Slide 1
  • Slide 2
  • Slide 3
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Slide 8
  • Slide 9
  • Slide 10
  • Slide 11
  • Slide 12
  • Slide 13
  • Slide 14
  • Slide 15
  • Slide 16
  • Slide 17
  • Slide 18
  • Slide 19
  • Slide 20
  • Slide 21
  • Slide 22
  • Slide 23
  • Slide 24
  • Slide 25
  • Slide 26
  • Slide 27
  • Slide 28
  • Slide 29
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
  • Slide 34
  • Slide 35
  • Slide 36
  • Slide 37
  • Slide 38
  • Slide 39
  • Slide 40
  • Slide 41
  • Slide 42
  • Slide 43
  • Slide 44
  • Slide 45
  • Slide 46
  • Slide 47
  • Slide 48
  • Slide 49
  • Slide 50
  • Slide 51
  • Slide 52
  • Slide 53
  • Slide 54
  • Slide 55
  • Slide 56
  • Slide 57
  • Slide 58
  • Slide 59
  • Slide 60
  • Slide 61
  • Slide 62
  • Slide 63
  • Slide 64
  • Slide 65
  • Slide 66
  • Slide 67
  • Slide 68
  • Slide 69
  • Slide 70
  • Slide 71
  • Slide 72
  • Slide 73
  • Slide 74
  • Slide 75
  • Slide 76
  • Slide 77
  • Slide 78
  • Slide 79
  • Slide 80
  • Slide 81
  • Slide 82
  • Slide 83
  • Slide 84
  • Slide 85
  • Slide 86
  • Slide 87
  • Slide 88
  • Slide 89
  • Slide 90
  • Slide 91
  • Slide 92
  • Slide 93
  • Slide 94
  • Slide 95
  • Slide 96
  • Slide 97
  • Slide 98
  • Slide 99
  • Slide 100
  • Slide 101
  • Slide 102
  • Slide 103
  • Slide 104
  • Slide 105
  • Slide 106
  • Slide 107
  • Slide 108
  • Slide 109
  • Slide 110
  • Slide 111
  • Slide 112
  • Slide 113
  • Slide 114
  • Slide 115
  • Slide 116
  • Slide 117
  • Slide 118
Page 114: TUTORIAL Ethernet PLC's Improve Oxygen Consumption ISA Expo/2001Houston, Texas Water & Wastewater Industry DivisionTuesday, September 11, 2001 1 Brad.

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 114

Private Sub txtAIT_346A_SCALED_Change()On Error GoTo PokeAIT_346AErrortxtAIT_346A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtAIT_346A_SCALEDText = Int((3 Rnd) + 15) Generate random value between 15 and 18txtAIT_346A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtAIT_346A_SCALEDLinkItem = AIT_346A_SCALEDtxtAIT_346A_SCALEDLinkMode = 2txtAIT_346A_SCALEDLinkPoketxtAIT_346A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeAIT_346AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtAIT_346A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 115

Private Sub txtFIT_321A_SCALED_Change()On Error GoTo PokeFIT_321AErrortxtFIT_321A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtFIT_321A_SCALEDText = Int((10 Rnd) + 120) Generate random value between 120 and 130txtFIT_321A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_321A_SCALEDLinkItem = FIT_321A_SCALEDtxtFIT_321A_SCALEDLinkMode = 2txtFIT_321A_SCALEDLinkPoketxtFIT_321A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total time

PokeFIT_321AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_321A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume Next

End Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 116

Private Sub txtFIT_341A_SCALED_Change()On Error GoTo PokeFIT_341AErrortxtFIT_341A_SCALEDLinkMode = 0 PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTime

txtFIT_341A_SCALEDText = Int((3 Rnd) + 18) Generate random value between 18 and 21

txtFIT_341A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_341A_SCALEDLinkItem = FIT_341A_SCALEDtxtFIT_341A_SCALEDLinkMode = 2txtFIT_341A_SCALEDLinkPoketxtFIT_341A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeFIT_341AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_341A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 117

Private Sub txtFIT_343A_SCALED_Change()On Error GoTo PokeFIT_343AErrortxtFIT_343A_SCALEDLinkMode = 0 PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTime

txtFIT_343A_SCALEDText = Int((1 Rnd) + 3) Generate random value between 3 and 4

txtFIT_343A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_343A_SCALEDLinkItem = FIT_343A_SCALEDtxtFIT_343A_SCALEDLinkMode = 2txtFIT_343A_SCALEDLinkPoketxtFIT_343A_SCALEDLinkMode = 0 DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeFIT_343AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_343A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 118

TUTORIAL

Part 4

Questions

amp

Answers

  • Slide 1
  • Slide 2
  • Slide 3
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Slide 8
  • Slide 9
  • Slide 10
  • Slide 11
  • Slide 12
  • Slide 13
  • Slide 14
  • Slide 15
  • Slide 16
  • Slide 17
  • Slide 18
  • Slide 19
  • Slide 20
  • Slide 21
  • Slide 22
  • Slide 23
  • Slide 24
  • Slide 25
  • Slide 26
  • Slide 27
  • Slide 28
  • Slide 29
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
  • Slide 34
  • Slide 35
  • Slide 36
  • Slide 37
  • Slide 38
  • Slide 39
  • Slide 40
  • Slide 41
  • Slide 42
  • Slide 43
  • Slide 44
  • Slide 45
  • Slide 46
  • Slide 47
  • Slide 48
  • Slide 49
  • Slide 50
  • Slide 51
  • Slide 52
  • Slide 53
  • Slide 54
  • Slide 55
  • Slide 56
  • Slide 57
  • Slide 58
  • Slide 59
  • Slide 60
  • Slide 61
  • Slide 62
  • Slide 63
  • Slide 64
  • Slide 65
  • Slide 66
  • Slide 67
  • Slide 68
  • Slide 69
  • Slide 70
  • Slide 71
  • Slide 72
  • Slide 73
  • Slide 74
  • Slide 75
  • Slide 76
  • Slide 77
  • Slide 78
  • Slide 79
  • Slide 80
  • Slide 81
  • Slide 82
  • Slide 83
  • Slide 84
  • Slide 85
  • Slide 86
  • Slide 87
  • Slide 88
  • Slide 89
  • Slide 90
  • Slide 91
  • Slide 92
  • Slide 93
  • Slide 94
  • Slide 95
  • Slide 96
  • Slide 97
  • Slide 98
  • Slide 99
  • Slide 100
  • Slide 101
  • Slide 102
  • Slide 103
  • Slide 104
  • Slide 105
  • Slide 106
  • Slide 107
  • Slide 108
  • Slide 109
  • Slide 110
  • Slide 111
  • Slide 112
  • Slide 113
  • Slide 114
  • Slide 115
  • Slide 116
  • Slide 117
  • Slide 118
Page 115: TUTORIAL Ethernet PLC's Improve Oxygen Consumption ISA Expo/2001Houston, Texas Water & Wastewater Industry DivisionTuesday, September 11, 2001 1 Brad.

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 115

Private Sub txtFIT_321A_SCALED_Change()On Error GoTo PokeFIT_321AErrortxtFIT_321A_SCALEDLinkMode = 0PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTimetxtFIT_321A_SCALEDText = Int((10 Rnd) + 120) Generate random value between 120 and 130txtFIT_321A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_321A_SCALEDLinkItem = FIT_321A_SCALEDtxtFIT_321A_SCALEDLinkMode = 2txtFIT_321A_SCALEDLinkPoketxtFIT_321A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total time

PokeFIT_321AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_321A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume Next

End Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 116

Private Sub txtFIT_341A_SCALED_Change()On Error GoTo PokeFIT_341AErrortxtFIT_341A_SCALEDLinkMode = 0 PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTime

txtFIT_341A_SCALEDText = Int((3 Rnd) + 18) Generate random value between 18 and 21

txtFIT_341A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_341A_SCALEDLinkItem = FIT_341A_SCALEDtxtFIT_341A_SCALEDLinkMode = 2txtFIT_341A_SCALEDLinkPoketxtFIT_341A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeFIT_341AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_341A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 117

Private Sub txtFIT_343A_SCALED_Change()On Error GoTo PokeFIT_343AErrortxtFIT_343A_SCALEDLinkMode = 0 PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTime

txtFIT_343A_SCALEDText = Int((1 Rnd) + 3) Generate random value between 3 and 4

txtFIT_343A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_343A_SCALEDLinkItem = FIT_343A_SCALEDtxtFIT_343A_SCALEDLinkMode = 2txtFIT_343A_SCALEDLinkPoketxtFIT_343A_SCALEDLinkMode = 0 DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeFIT_343AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_343A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 118

TUTORIAL

Part 4

Questions

amp

Answers

  • Slide 1
  • Slide 2
  • Slide 3
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Slide 8
  • Slide 9
  • Slide 10
  • Slide 11
  • Slide 12
  • Slide 13
  • Slide 14
  • Slide 15
  • Slide 16
  • Slide 17
  • Slide 18
  • Slide 19
  • Slide 20
  • Slide 21
  • Slide 22
  • Slide 23
  • Slide 24
  • Slide 25
  • Slide 26
  • Slide 27
  • Slide 28
  • Slide 29
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
  • Slide 34
  • Slide 35
  • Slide 36
  • Slide 37
  • Slide 38
  • Slide 39
  • Slide 40
  • Slide 41
  • Slide 42
  • Slide 43
  • Slide 44
  • Slide 45
  • Slide 46
  • Slide 47
  • Slide 48
  • Slide 49
  • Slide 50
  • Slide 51
  • Slide 52
  • Slide 53
  • Slide 54
  • Slide 55
  • Slide 56
  • Slide 57
  • Slide 58
  • Slide 59
  • Slide 60
  • Slide 61
  • Slide 62
  • Slide 63
  • Slide 64
  • Slide 65
  • Slide 66
  • Slide 67
  • Slide 68
  • Slide 69
  • Slide 70
  • Slide 71
  • Slide 72
  • Slide 73
  • Slide 74
  • Slide 75
  • Slide 76
  • Slide 77
  • Slide 78
  • Slide 79
  • Slide 80
  • Slide 81
  • Slide 82
  • Slide 83
  • Slide 84
  • Slide 85
  • Slide 86
  • Slide 87
  • Slide 88
  • Slide 89
  • Slide 90
  • Slide 91
  • Slide 92
  • Slide 93
  • Slide 94
  • Slide 95
  • Slide 96
  • Slide 97
  • Slide 98
  • Slide 99
  • Slide 100
  • Slide 101
  • Slide 102
  • Slide 103
  • Slide 104
  • Slide 105
  • Slide 106
  • Slide 107
  • Slide 108
  • Slide 109
  • Slide 110
  • Slide 111
  • Slide 112
  • Slide 113
  • Slide 114
  • Slide 115
  • Slide 116
  • Slide 117
  • Slide 118
Page 116: TUTORIAL Ethernet PLC's Improve Oxygen Consumption ISA Expo/2001Houston, Texas Water & Wastewater Industry DivisionTuesday, September 11, 2001 1 Brad.

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 116

Private Sub txtFIT_341A_SCALED_Change()On Error GoTo PokeFIT_341AErrortxtFIT_341A_SCALEDLinkMode = 0 PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTime

txtFIT_341A_SCALEDText = Int((3 Rnd) + 18) Generate random value between 18 and 21

txtFIT_341A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_341A_SCALEDLinkItem = FIT_341A_SCALEDtxtFIT_341A_SCALEDLinkMode = 2txtFIT_341A_SCALEDLinkPoketxtFIT_341A_SCALEDLinkMode = 0DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeFIT_341AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_341A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 117

Private Sub txtFIT_343A_SCALED_Change()On Error GoTo PokeFIT_343AErrortxtFIT_343A_SCALEDLinkMode = 0 PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTime

txtFIT_343A_SCALEDText = Int((1 Rnd) + 3) Generate random value between 3 and 4

txtFIT_343A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_343A_SCALEDLinkItem = FIT_343A_SCALEDtxtFIT_343A_SCALEDLinkMode = 2txtFIT_343A_SCALEDLinkPoketxtFIT_343A_SCALEDLinkMode = 0 DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeFIT_343AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_343A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 118

TUTORIAL

Part 4

Questions

amp

Answers

  • Slide 1
  • Slide 2
  • Slide 3
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Slide 8
  • Slide 9
  • Slide 10
  • Slide 11
  • Slide 12
  • Slide 13
  • Slide 14
  • Slide 15
  • Slide 16
  • Slide 17
  • Slide 18
  • Slide 19
  • Slide 20
  • Slide 21
  • Slide 22
  • Slide 23
  • Slide 24
  • Slide 25
  • Slide 26
  • Slide 27
  • Slide 28
  • Slide 29
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
  • Slide 34
  • Slide 35
  • Slide 36
  • Slide 37
  • Slide 38
  • Slide 39
  • Slide 40
  • Slide 41
  • Slide 42
  • Slide 43
  • Slide 44
  • Slide 45
  • Slide 46
  • Slide 47
  • Slide 48
  • Slide 49
  • Slide 50
  • Slide 51
  • Slide 52
  • Slide 53
  • Slide 54
  • Slide 55
  • Slide 56
  • Slide 57
  • Slide 58
  • Slide 59
  • Slide 60
  • Slide 61
  • Slide 62
  • Slide 63
  • Slide 64
  • Slide 65
  • Slide 66
  • Slide 67
  • Slide 68
  • Slide 69
  • Slide 70
  • Slide 71
  • Slide 72
  • Slide 73
  • Slide 74
  • Slide 75
  • Slide 76
  • Slide 77
  • Slide 78
  • Slide 79
  • Slide 80
  • Slide 81
  • Slide 82
  • Slide 83
  • Slide 84
  • Slide 85
  • Slide 86
  • Slide 87
  • Slide 88
  • Slide 89
  • Slide 90
  • Slide 91
  • Slide 92
  • Slide 93
  • Slide 94
  • Slide 95
  • Slide 96
  • Slide 97
  • Slide 98
  • Slide 99
  • Slide 100
  • Slide 101
  • Slide 102
  • Slide 103
  • Slide 104
  • Slide 105
  • Slide 106
  • Slide 107
  • Slide 108
  • Slide 109
  • Slide 110
  • Slide 111
  • Slide 112
  • Slide 113
  • Slide 114
  • Slide 115
  • Slide 116
  • Slide 117
  • Slide 118
Page 117: TUTORIAL Ethernet PLC's Improve Oxygen Consumption ISA Expo/2001Houston, Texas Water & Wastewater Industry DivisionTuesday, September 11, 2001 1 Brad.

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 117

Private Sub txtFIT_343A_SCALED_Change()On Error GoTo PokeFIT_343AErrortxtFIT_343A_SCALEDLinkMode = 0 PauseTime = 1000 Set duration Start = Timer Set start time Do While Timer lt Start + PauseTime

txtFIT_343A_SCALEDText = Int((1 Rnd) + 3) Generate random value between 3 and 4

txtFIT_343A_SCALEDLinkTopic = brad_s_carlbergView|TagnametxtFIT_343A_SCALEDLinkItem = FIT_343A_SCALEDtxtFIT_343A_SCALEDLinkMode = 2txtFIT_343A_SCALEDLinkPoketxtFIT_343A_SCALEDLinkMode = 0 DoEvents Yield to other processes Loop Finish = Timer Set end time TotalTime = Finish - Start Calculate total timePokeFIT_343AErrorSelect Case ErrCase 282MsgBox Foreign Application amp txtFIT_343A_SCALEDLinkTopic amp did not respond to a DDE initiateCase 286MsgBox Timeout waiting for a responseCase 292MsgBox DDE conversation closed or changedCase 293MsgBox DDE method attempted without DDE channel openCase 297MsgBox Cant set LinkMode invalid link topicCase ElseEnd SelectResume NextEnd Sub

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 118

TUTORIAL

Part 4

Questions

amp

Answers

  • Slide 1
  • Slide 2
  • Slide 3
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Slide 8
  • Slide 9
  • Slide 10
  • Slide 11
  • Slide 12
  • Slide 13
  • Slide 14
  • Slide 15
  • Slide 16
  • Slide 17
  • Slide 18
  • Slide 19
  • Slide 20
  • Slide 21
  • Slide 22
  • Slide 23
  • Slide 24
  • Slide 25
  • Slide 26
  • Slide 27
  • Slide 28
  • Slide 29
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
  • Slide 34
  • Slide 35
  • Slide 36
  • Slide 37
  • Slide 38
  • Slide 39
  • Slide 40
  • Slide 41
  • Slide 42
  • Slide 43
  • Slide 44
  • Slide 45
  • Slide 46
  • Slide 47
  • Slide 48
  • Slide 49
  • Slide 50
  • Slide 51
  • Slide 52
  • Slide 53
  • Slide 54
  • Slide 55
  • Slide 56
  • Slide 57
  • Slide 58
  • Slide 59
  • Slide 60
  • Slide 61
  • Slide 62
  • Slide 63
  • Slide 64
  • Slide 65
  • Slide 66
  • Slide 67
  • Slide 68
  • Slide 69
  • Slide 70
  • Slide 71
  • Slide 72
  • Slide 73
  • Slide 74
  • Slide 75
  • Slide 76
  • Slide 77
  • Slide 78
  • Slide 79
  • Slide 80
  • Slide 81
  • Slide 82
  • Slide 83
  • Slide 84
  • Slide 85
  • Slide 86
  • Slide 87
  • Slide 88
  • Slide 89
  • Slide 90
  • Slide 91
  • Slide 92
  • Slide 93
  • Slide 94
  • Slide 95
  • Slide 96
  • Slide 97
  • Slide 98
  • Slide 99
  • Slide 100
  • Slide 101
  • Slide 102
  • Slide 103
  • Slide 104
  • Slide 105
  • Slide 106
  • Slide 107
  • Slide 108
  • Slide 109
  • Slide 110
  • Slide 111
  • Slide 112
  • Slide 113
  • Slide 114
  • Slide 115
  • Slide 116
  • Slide 117
  • Slide 118
Page 118: TUTORIAL Ethernet PLC's Improve Oxygen Consumption ISA Expo/2001Houston, Texas Water & Wastewater Industry DivisionTuesday, September 11, 2001 1 Brad.

ISA Expo2001 Houston Texas

Water amp Wastewater Industry Division Tuesday September 11 2001 118

TUTORIAL

Part 4

Questions

amp

Answers

  • Slide 1
  • Slide 2
  • Slide 3
  • Slide 4
  • Slide 5
  • Slide 6
  • Slide 7
  • Slide 8
  • Slide 9
  • Slide 10
  • Slide 11
  • Slide 12
  • Slide 13
  • Slide 14
  • Slide 15
  • Slide 16
  • Slide 17
  • Slide 18
  • Slide 19
  • Slide 20
  • Slide 21
  • Slide 22
  • Slide 23
  • Slide 24
  • Slide 25
  • Slide 26
  • Slide 27
  • Slide 28
  • Slide 29
  • Slide 30
  • Slide 31
  • Slide 32
  • Slide 33
  • Slide 34
  • Slide 35
  • Slide 36
  • Slide 37
  • Slide 38
  • Slide 39
  • Slide 40
  • Slide 41
  • Slide 42
  • Slide 43
  • Slide 44
  • Slide 45
  • Slide 46
  • Slide 47
  • Slide 48
  • Slide 49
  • Slide 50
  • Slide 51
  • Slide 52
  • Slide 53
  • Slide 54
  • Slide 55
  • Slide 56
  • Slide 57
  • Slide 58
  • Slide 59
  • Slide 60
  • Slide 61
  • Slide 62
  • Slide 63
  • Slide 64
  • Slide 65
  • Slide 66
  • Slide 67
  • Slide 68
  • Slide 69
  • Slide 70
  • Slide 71
  • Slide 72
  • Slide 73
  • Slide 74
  • Slide 75
  • Slide 76
  • Slide 77
  • Slide 78
  • Slide 79
  • Slide 80
  • Slide 81
  • Slide 82
  • Slide 83
  • Slide 84
  • Slide 85
  • Slide 86
  • Slide 87
  • Slide 88
  • Slide 89
  • Slide 90
  • Slide 91
  • Slide 92
  • Slide 93
  • Slide 94
  • Slide 95
  • Slide 96
  • Slide 97
  • Slide 98
  • Slide 99
  • Slide 100
  • Slide 101
  • Slide 102
  • Slide 103
  • Slide 104
  • Slide 105
  • Slide 106
  • Slide 107
  • Slide 108
  • Slide 109
  • Slide 110
  • Slide 111
  • Slide 112
  • Slide 113
  • Slide 114
  • Slide 115
  • Slide 116
  • Slide 117
  • Slide 118