SSE Training Module 2
SSE Training Module 2
SSE Training Module 2
MODULE 02
1
Training Program for Module 02
• Revision on RTU ( Module 01 )
• Introduction to Network Mapping
• Configure and Test advanced features in Network Mapping.
• Introduction to I/O Mapping
• Configure and Test advanced features in I/O Mapping.
• Introduction to SSE RTU Data Logging
• Configure and Test advanced features in Data logging
• Understand and configure the Communication Orchestrator
• Understand the SSE RTU Control program language or sequential statement list.
• Compile a local program and test.
• Compile a advanced distributed program and test.
• Compile a program with set points from OPC
• Link the SSE-OPC with a SCADA software.
• Route data from the OPC to different types Data Bases .
• Implement remote Time Stamping on Data Bases
• System Planning and Design
2
Communication
Typical Types
➢RS 232
➢RS 485
➢Radio
➢Dial Up Modem
➢Satellite Phone
➢Fiber Optic
➢Cell Phone
•Dial Up
•SMS ( Short Message Service)
•GPRS ( General Packed Radio System)
•HSCSD ( High Speed Circuit Switch Data )
3
Communication
Serial Interfacing Basics
Major points of serial interfacing
o Three kinds of signals:
➢ Sync uses clock signals so the line receiver knows when to sample the incoming
data
Clock signals are usually implemented as separate wires in a serial interface, but
line coding schemes can be used to encode data and clocks on the same wires
4
Communication
Serial Interfacing Basics
With few exceptions, serial interfaces are unidirectional
o Inputs must connect to outputs; outputs must connect to inputs
DTE and DCE were created to enhance standards so that manufacturers would
implement them in directly compatible ways
o DTE-Data Terminal Equipment
o Connecting DCE to DCE or DTE to DTE requires crossover (or null) cable
5
Communication
Electrical Standards Basics
Electrical interface standards specify the following:
oSignal types and their exact names
➢ Data lines
➢ Control lines
➢ Timing lines
oElectrical specifics
detection
➢ Standards specify balanced or unbalanced signalling
oPinouts
oOther requirements
6
Communication
RS-232
The most common electrical interface for low-speed data
o ITU designation V.24, EIA standard 232
➢ Short-range
o Poor noise immunity, cable capacitance limits distance, unbalanced interface limits
distance
➢ EIA-232 does not specify maximum distance
o Practical for speeds up to 115.2 kbps over very short cables (2m)
➢ The zone between 3V and -3V is defined as undefined in the EIA-232 standard-that
7
Communication
EIA-232 EIA-561
DTE
DTE
DB-9 Male Socket 1 2 3 4 5 6 7 8
1 2 3 4 5
DCD
Rx
Tx
DTR
DTE DSR DCE
CTS 6 7 8 9
RTS
RI
GND 8 7 6 5 4 3 2 1
8
Communication
RS-232
TX RX
RX TX
Gnd Gnd
TX RX
RX TX
Gnd Gnd
9
Communication
ADVANTAGES DISADVANTAGES
10
Communication
RS-485
RS232 RS232 RS 485 RS232
TO
TO
RS485
RS485 RS232
Converter
Converter
RS232 RS232
TO
RS485
Converter
RS232 RS232
TO
RS485
Converter
11
Communication
RS-485
ADVANTAGES DISADVANTAGES
12
Communication
Optic Fiber
RS232 RS232
TO
Optic Fiber
Converter
RS232 RS232
TO
Optic Fiber
Converter
13
Communication
Optic Fiber
ADVANTAGES DISADVANTAGES
14
Communication
Analog Radio Network
15
Communication
Analog Radio Network
The analog radio will be connected to the FSK Modem port on the RTU
ADVANTAGES DISADVANTAGES
16
Communication
Digital Radio Network
Digital
Radio RS232
RS232
Digital
Radio
RS232
Digital
Radio
RS232
Digital
Radio
17
Communication
Digital Radio Network
ADVANTAGES DISADVANTAGES
18
Communication
Dial Up Land Line Modem Network
RS232
Modem
Modem
RS232
RS232
Modem
Telephone
Network
RS232
Modem
19
Communication
Dial Up Land Line Modem Network
ADVANTAGES
•Distance
DISADVANTAGES
•Speed ( 56K )
•Point to Point communication
•Connection Time
•Expensive
Steps of communication •Cable Theft
•Lightning
•Dial number – ATD 0126634331 •Network ( Telkom)
•Incoming call at RTU – RTU pick line up
•Modems Negotiate baud rate ( +/- 30 sec)
•Switch off FSK and connect
•Go into transport mode
•When finish disconnect ( +/- 15 Sec)
20
Communication
Cell Phone Modem Network
RS232
Cell
Phone Cell
Phone RS232
RS232
Cell Phone Cell
Network Phone
•Vodacom
•Cell C
•MTN
RS232
Cell
Phone
21
Communication
Cell Phone Modem Network
ADVANTAGES DISADVANTAGES
22
Communication
Cell Phone Modem Network
Dial Up
Exactly the same as the normal dial up modem. ( Max speed 9600 baud)
SMS ( Short Message Service)
Send Protocol message to OPC via service center
Send Read Text message to private persons to indicate alarms.
HSCSD ( High Speed Circuit Switch Data )
With this mode you have a maximum of 4 Channels to upload data and 4 Channels to
Download data .
Therefore it is faster than dial up and SMS ( 14K2 baud rate )
GPRS (General Packed Radio System)
Computer is permanently connected to the service provider via a ISDN Line.
You have 4 Download Link and 2 Upload links. ( 500-800 ms @ 14000b /link)
You don’t pay for the time of calls , but for the amount of data transferred.
23
Inside Computer
GPRS Site
SCADA (Highsite)
Adroit OPUS GPRS
OPC-Server
RF
Radio Site
Database
GPRS NETWORK
NOC
SPOORNET
APN
GPRS
SPOORNET NETWORK
Mobile
Workstation
24
RTU Hardware Bus Port
Note- Do not remove
RTU12 (Top)
Ribbon Cable when
Power is On
25
RTU Hardware
RTU12 (Top)
Processor
SRAM
(Data/Descriptor Memory)
26
RTU Hardware
RTU12 (Top)
Analog Circuitry
27
RTU Hardware
RTU12 (Bottom)
FLASH
(Program/OS Memory)
28
RTU Hardware RTU12 - Comms
Ports ASC0 and ASC1
ASC0 and ASC1 Fitted
• All serial ports on the RTU are DTE ports,
NO exceptions!
• ASC0 and -1 are EIA-561 compatible (NOT
compliant)
RTU12
ASC0 & ASC1
1 2 3 4 5 6 7 8
1: ASCx_CTRL_IN_1
2: ASCx_CTRL_IN_1
3: ASCx_CTRL_OUT_1
4: Ground/Common (GND)
5: ASCx_Rx
6: ASCx_Tx
7: Bootload (ASC0 ONLY, ASC1 Not Used)
8: ASCx_CTRL_OUT_2
29
Communication
EIA-232 EIA-561
DTE
DTE
DB-9 Male Socket 1 2 3 4 5 6 7 8
1 2 3 4 5
DCD
Rx
Tx
DTR
DTE DSR DCE
CTS 6 7 8 9
RTS
RI
8 7 6 5 4 3 2 1
GND
1: Data Carrier Detect (DCD)
2: Receive (Rx)
3: Transmit (Tx)
4: Data Terminal Ready (DTR)
5: Ground/Common (GND)
6: Data Set Ready (DSR)
7: Request To Send (RTS)
8: Clear To Send (CTS)
9: Ring Indicator (RI) 1: Ring Indicator (RI)/Data Set Ready (DSR) Blue
2: Data Carrier Detect (DCD) Orange
3: Data Terminal Ready (DTR) Black
4: Ground/Common (GND) Red
5: Receive (Rx) Green
6: Transmit (Tx) Yellow
7: Clear To Send (CTS) Brown
8: Request To Send (RTS) White
30
RTU Hardware
RTU12 - Comms Ports ASC0 and ASC1
DCD
EIA-561
Rx
Tx DTE
DTR
DTE DSR DCE 1 2 3 4 5 6 7 8
CTS
RTS
RI
GND
RTU12
ASC0 & ASC1
1 2 3 4 5 6 7 8
8 7 6 5 4 3 2 1
1: ASCx_CTRL_IN_1
2: ASCx_CTRL_IN_1 1: Ring Indicator (RI)/Data Set Ready (DSR) Blue
3: ASCx_CTRL_OUT_1 2: Data Carrier Detect (DCD) Orange
4: Ground/Common (GND) 3: Data Terminal Ready (DTR) Black
5: ASCx_Rx 4: Ground/Common (GND) Red
6: ASCx_Tx 5: Receive (Rx) Green
7: Bootload (ASC0 ONLY, ASC1 Not Used) 6: Transmit (Tx) Yellow
7: Clear To Send (CTS) Brown
8: ASCx_CTRL_OUT_2
8: Request To Send (RTS) White
31
RTU Hardware
RTU12 - Comms Ports ASC0 and ASC1
32
RTU Hardware
RTU12 - Comms Ports ASC0 and ASC1
JP20: ASCx_CTRL_IN_1
JP21: ASCx_CTRL_OUT_1
JP22: ASCx_CTRL_IN_2
JP23: ASCx_CTRL_OUT_2
33
RTU Hardware
RTU12 - Comms Ports ASC2 and ASC3
• When RS232 Module fitted, ASC2/-3 have
proprietary pin-outs on the DB-9
34
RTU12 RS232 Module
• This module may NOT be removed
from, or inserted into the RTU while
power is applied to the RTU!!!
• This module expands the serial ports
on the RTU12 to two additional
independent serial ports (ASC2 and -
3)
• Shared pins in the DB9 on the RTU12
base board is used for the relevant
Tx, Rx and GND signals ONLY
• NO FLOW CONTROL SIGNALS ARE
AVAILABLE!!!
35
RTU Hardware
RTU12 - Comms Connections
6 7 8 9 6 7 8 9 6 7 8 9
1 2 3 4 5 6 7 8 1 2 3 4 5 6 7 8 1 2 3 4 5 6 7 8
36
RTU Hardware
RTU12 - Comms Ports FSK
• When FSK Module fitted, pin-outs are the
same as for the RTU3, -10 and -11
RTU12
FSK
DB-9 Male Socket
1 2 3 4 5
6 7 8 9
1: V+ Supply
2: V+ Supply
3: Squelch
4: Press-To-Talk/Transmit (PTT)
5: Tx to Radio
6: Ground/Common (GND)
7: Ground/Common (GND)
8: Band Pass Test
9: Rx from Radio
37
RTU12 FSK Module
38
RTU12 FSK Module
Radio Gain
Pots set audio Gain and
attenuate
Top - Transmit
Bottom – Receive
CD/DCD
2&3 (Default) Data
Carrier Detect
1&2 Carrier Detect
39
RTU Hardware
RTU12 - IO Connections General
For clarity sake all IO wiring interface connections discussed here are with reference to the 10-Way screw terminal
connectors, although the 14-Way connectors are shown.
40
RTU Hardware
RTU12 - Comms Connections
Ethernet (EIA-T-568)
• For the RTU12 Ethernet (X-Port) connections (via cable), ensure that a twisted cable is used for direct PC
connection and a straight cable is used when connected to a hub/switch
• Connection to a wireless hub/switch is via a straight cable
41
RTU Hardware
RTU12 - Comms Connections
Ethernet (EIA-T-568)
T-568A Straight T-568B Straight
42
RTU Hardware
RTU12 - Comms Connections
Ethernet (EIA-T-568)
T-568 Crossover
43
RTU Hardware
RTU12 - IO Connections Layout
44
RTU Hardware
RTU12 - IO Connections - DOT
DOT – Digital/Binary Outputs
45
RTU Hardware
RTU12 - IO Connections
DOT Connections (indicative only)
46
RTU Hardware
RTU12 - IO Connections - DIN
DIN – Digital/Binary Inputs
47
RTU Hardware
RTU12 - IO Connections
DIN – Active Low/High
Opto-Isolator type determine if the RTU can be only active low or both
48
RTU Hardware
RTU12 - IO Connections
DIN – Active Low/High
Opto-Isolator type determine if the RTU can be
only active low or both
49
RTU Hardware
RTU12 - IO Connections
DIN Connections (Indicative Only)
Active Low
RTU12
V-MINUS
DIN8
DIN7
DIN6
JMP- LINKS
3 DIN5
2 1 Supply PSU
V-PLUS
DIN4
IK
DIN3
DIN2
DIN1
50
RTU Hardware
RTU12 - IO Connections
DIN Connections (Indicative Only)
Active High
51
RTU Hardware
RTU12 - IO Connections
Layout
AIN - Analogue Inputs
• All AINs are 4-20mA inputs
• NO VOLTAGE INPUTS!
Scaling
4mA = 0m = 0%
20mA = 10m =100%
V =I *R
Vmin = 0.004 * 120 = 0.48v
Vmax = 0.020 * 120 = 2.40v
4mA = 786
20mA = 3932
52
RTU Hardware
RTU12 - IO Connections
AIN Connections (Indicative Only)
GND
120 R V2 = 2.4V
A/D AIN8 Loop Powered Instrument
Converter R2
4- 20 mA
120 R AIN7
12 Bit
AIN6
GND
+
AIN3 Galvanic External
4- 20 mA
Voltage Input Isolator - Supply
AIN2
V1 = I * R1
R1= V1 / I AIN1
R1
R1 = 13.8 V / 20mA 690 R V1 = 13.8V
DC Voltage Input (13.8 v)
R1 = 690 Ohm
53
RTU Hardware
RTU12 - Decimal Values
0 4 2 3 1 4 0 0 4231.4
7 0 5 0 0 0 7 0 70500.07
0 0 0 0 0 0 0 4 0.004
54
RTU Hardwar
RTU12 – Binary Values
Representation
A binary number can be represented by any sequence of bits (binary digits), which in turn may be
represented by any mechanism capable of being in two mutually exclusive states.
12 bits
Byte
2048 1024 512 256 128 64 32 16 8 4 2 1
0 0 0 0 0 0 0 0 0 0 0 1 1
0 0 0 0 0 0 0 0 0 0 1 0 2
0 0 0 0 0 0 0 0 0 0 1 1 3
0 0 0 0 0 0 0 0 0 1 0 0 4
0 0 0 0 0 0 0 0 1 0 0 0 8
0 0 0 0 0 0 0 1 0 1 0 0 20
0 0 0 0 0 1 0 1 0 0 0 0 80
0 0 0 0 0 1 1 0 0 1 0 0 100
0 0 0 0 1 1 1 1 1 1 1 1 255
1 0 1 0 1 0 1 0 1 0 1 0 2730
1 1 1 1 1 1 1 1 1 1 1 1 4095
55
SSE OPC Software
56
OPC
• OLE (Object Link & Embedding) for Process Control
The reason for OPC and not dedicated drivers at the SCADA is :
• The SCADA developers don’t write drivers for all the different
devices
• Different types of SCADA software can link to one OPC Server
• The OPC server can run on a different computer on the network
• From the OPC you can access different types of databases without
going through the SCADA.
57
Protocols
A protocol is the “ language “ use between RTU’s to exchange data . The package is normally called a word and contain
a certain amount of data.
– SSE
– Modbus
– Profibus
– IP
– Dnp-3
58
OPC
Network Network
Protocol
Protocol
Protocol Protocol
59
ADROIT SCADA
OPC-Client
OPC-Server
Config Data-
Toolbox Data Centre Base
Handler
60
OPC Configuration
• 1. Add a channel ( New )
– Com1
– Address 254
• 2. Add a device
– Address 254
• 5. Configure Outstation 254
– 8 x Digital inputs
– 8 x Analog inputs
– 8 x Analog Outputs
– 8 x Digital Outputs
– 8 x Counters
• 3. Data scope
– Set Address 254
– Connect simulator box
– Connect DIN and AIN and switch on
– Select station address and request un-configured I/O
– Data Blocks in RTU.
61
• 4. Add a device
– Address 05
• 5. Configure Outstation 05
– 8 x Digital inputs
– 8 x Analog inputs
– 8 x Analog Outputs
– 8 x Digital Outputs
– 8 x Counters
• 6. Configure Outstation Network Mapping
– Destination address
– Polling
– Event Types
– Digipeating
• 7. Download Descriptors
– Auto Polling from OPC
– Auto Polling from RTU
– Event base tags
62
• 8. I/O Mapping Receiving
– Add I/O Mapping on Address 254
• Digital 1 – 4 ( Add 05 ) set Dot 5-8 ( Add 254)
Remove I/O Mapping
63
Data Logging
• 1. Setup the following tags for Data Logging
The tags must be logged every minute
Please note that if – Log Min after hour is set to anything > 59 it will be disabled ( only
from 1-59 minutes )
– Digital Input 1,3,5,7
– Analog Input 2,4,6,8
Can be use together because it work in a “ OR “ function.
– Setup the logging under the Device ( Hardware and Logging )
Setup the time period that the OPC should poll logged data
64
Enable Device for Logging
65
Setup OPC to retrieve logged data
66
Database Setup
• Databases
– Event : Event data or changed data stored
– Poll : The status of the I/O when the station report
back is stored
– Log Data : Logged data is polled and stored
– To OPC : The logged data is passed on to the SCADA
67
SMS Messaging
RS232
Cell
Phone Cell
Phone RS232
SSE
Protocol
Cell Phone
Network
•Vodacom SMS
Message
•Cell C
•MTN
68
SMS Message Setup
• Components for a SMS message
– Device Description
– Data Point Description
– Condition of the data point
• Device
– The device description is filled in under “ Header “
• Data Point
– Enable data point for SMS
– SMS Point : Pump 01
– SMS Hi :Trip
– SMS Lo :Normal
69
1. Channel
2. Device
3. Data Point
4. Network Map
70
From Your Cell To Outstation
• To Poll data from your Cell Phone: space
#Poll Station(0I1 8)
Station Address I/O start I/O end
If “0” ignore
Type Info
I=All Conf Inputs
D=Digitals
A=Analogs
71
From Your Cell To Outstation
• To Send Controls from your Cell Phone:
space
#Set P1(0R1 1)
Station Address Relay No. 1=On
If “0” ignore 0=Off
Type Info
R=Relays
72
RTU P Code Programming
73
P-Code / RTU Program
Instructions/Commands
Overall…
• P-Code is executed once every second, not faster [and not slower]
• P-Code execution is sequential and cannot react on a hardware peripheral interrupt event
• P-Code is hereditary from the RTU3 technology, thus new data type implementations are
IMPOSSIBLE!
• With the above in mind, certain changes were implemented to utilise certain critical data types
such as the upper 16-bits of CINs (CIUs)
• Floating point data CANNOT be supported, EVER!
• 32-Bit integer data types CANNOT be supported further than it is now, EVER!
• 8-Bit integer data types will not be supported, EVER!
• Any signed integer data types CANNOT be supported, EVER!
• String data types will not be supported, EVER!
• Maximum lines of code: 2500
• One of the most important things: NEVER USE JUMPS BACK INTO THE P-Code!!!
• P-Code is not an endless loop or a thread running in the RTU…
• thus, a whole program must be executed in each executing cycle
74
P-Code / RTU Program
Resultant Logic Operator
75
P-Code / RTU Program
Instructions/Commands
Operator Mnemonic Operator Mnemonic
76
P-Code / RTU Program
Instructions/Commands: Accumulators
• There are only TWO accumulators present in the P-Code engine
• This means any arithmetic operation must be completed after the second load (L) instruction
• eg multiply AREG1 with AREG4 and write answer to AREG200
L AREG 1
L AREG 4
* AREG 200 ; two values are loaded, one in each accumulator, now arithmetic operation
must be executed
▪ The FIRST loaded accumulator becomes the reference accumulator for all arithmetic operators
▪ eg subtract AREG5 from AREG7 and write answer to AREG10
L AREG 7
L AREG 5
- AREG 10
• The SECOND loaded accumulator becomes the reference accumulator for all magnitude operators
• eg if AREG1 greater than AREG4, set DOT9
L AREG 1 ; value loaded into accumulator1
L AREG 4 ; value loaded into accumulator2
> DOT 9 ; accumulator1 is now compared with reference to accumulator2
77
P-Code / RTU Program
Instructions/Commands: Commonly Used
78
P-Code / RTU Program
Instructions/Commands: Never Used
79
P-Code / RTU Program
Instructions/Commands
Obsolete
80
P-Code / RTU Program
Parameters
81
RTU Programming
Previously the SCADA did the control of most the interlocks or sequences in the field. If
the SCADA failed or a communication failure is present to the device , then the control
commands could not be executed. Therefore it is good practice to do controls locally or
as close to the device as possible.
– The RTU is able to accommodate an intelligent control program .
– The Control program could be downloaded via the selected communication medium
from the OPC to the device.
– Changes to the program can be made at the OPC and then downloaded to the device.
Program Name
82
RTU Programming
83
Import a program from a .csv file
• OR
A OR B = Q
0 OR 0 = 0
A 0 OR 1 = 1
1 OR 0 = 1
B
1 OR 1 = 1
85
Programming Exercise 01
86
Programming Exercise 02
• The purpose of the program is:
– If Digital Input 01 = On and Digital input 02 =On
– then Relay 01 = On
• Add rows ( steps ) 1 to 5 RLO=Result Logic Operator
• RLO = RLO (1) AND Din 01 (1) =1
• RLO = RLO (1) AND Din 02 (1) =1
1. A Din 01 • RLO = DOT ( 1 ) =1
2. A Din 02
3. = Dot 01
4. End RLO=Result Logic Operator
• RLO = RLO (1) AND Din 01 (0) =0
• RLO = RLO (1) AND Din 02 (0) =0
• RLO = DOT ( 1 ) =0
87
Programming Exercise 03
• The purpose of the program is:
– If Digital Input 01 = On and Digital input 02 =off
– then Relay 01 = On
• Add rows ( steps )
1
1. Din 01 0 0
1. A Din 01
1 1
0
2. AN Din 02
2. Din 02 3. = Dot 01
1 4. End
3. Dot 01 0 0
88
Programming Exercise 04
• The purpose of the program is:
– If Digital Input 01 = On or Digital input 02 =0n or Digital input 03 =0n
– then Relay 01 = On
• Add rows ( steps )
1
• Din 01 0 0
1
2. Din 02 0 0 1. O Din 01
1
2. O Din 02
3. Din 03 3. O Din 03
0 0
4 = Dot 01
1 5 END
4. Dot 01 0 0
89
Programming Exercise 04
1 1
1. Din 01 0 0 0
1
2. Din 02
0 0 1. AN Din 01
2. A Din 02
3. Din 03 1 1
3. AN Din 03
0
4 = Dot 01
1 5 END
4. Dot 01 0 0
90
Programming Exercise 05
• Write a program to do the following:
• Digital input 01=1 switch relay 01 on . Digital input 02 =1 switch relay 01 off
1
• Din 01 0 0
1. A Din 01
1
2. Din 02 2. AN Din 02
0 0
3. S Dot 01
1 4. A Din 02
3. Dot 01 0 0 5. AN Din 01
4 R Dot 01
5 END
91
Programming Exercise 06
• Write a program to do the following:
• Digital input 01=1 switch relay 01 on . Digital input 02 =1 switch relay 01 off
1
1. Din 01 0 0 1. A Din 01
1
2. AN Din 02
2. Din 02 3. S Dot 01
0 0
4. R Dot 02
1 5. A Din 02
3. Dot 01 0 0 6. AN Din 01
1
4 R Dot 01
1
4. Dot 02 5 S Dot 02
0
6 END
92
Programming Exercise 07
• Write a program from the following RLO Graph
1
1. Din 01 0 0
1 1. O Din 01
2. Din 02 0 0 2. O Din 02
1 3. A Din 03
3. Din 03 0 0 4. = Dot 01
1 1 5. END
4. Dot 01 0
0 0
93
Analogs in programming
Other commands
• >=
• <=
• +
• -
• Etc
94
Programming Exercise 08
• Write the following program : If AIN 01 > OR = TO 2000 ( Raw value ) Switch Relay 01 On
Raw
Value
2000
1. Ain 01
1
2. Dot 01 0 0
1. L Ain 01
2. L Cst 2000
3. >= Dot 01
4. END
95
Programming Exercise 09
• Write the following program : If AIN 01 > OR = TO 2000 ( Raw value ) Switch Relay 01 On
Raw
Value
1. L Ain 01
2000
2. L Cst 2000
1. Ain 01 3. >= Dot 01
4. A Dot 01
1 5. R Dot 02
2. Dot 01 0 0 6. AN Dot 01
7. R Dot 02
0 1 8. END
3. Dot 02 1
96
Programming Exercise 10
• Write the following program : If AIN 01 > OR = TO 2000 ( Raw value ) Switch Relay 01 On
• Write the following program : If AIN 01 > OR = TO 3000 ( Raw value ) Switch Relay 02 On
Raw
Value 1. L Ain 01
2000 2. L Cst 2000
3. >= Dot 01
1. Ain 01 4. L Ain 01
1 5. L Cst 3000
0 0 6. >= Dot 02
2. Dot 01 7. END
0 1 1
3. Dot 02 0
97
Programming Exercise 11
• Write the following program :
Raw
Value
2000
1. L Ain 01
1. Ain 01
2. L Cst 2000
3. >= Dreg 01
4. A Dreg 01
1
5. A Din 01
2. Din 01 0
6. = Dot 01
1 7. END
0
2. Dot 01
98
Programming Exercise 12
• Write the following program :
3000
AIN 02
1000
AREG 01
If the tower is lower than “1000” raw then start the pump and the pump
run until the tower is full “3000”. If the reservoir low set point ( Areg 01)
is reached or the pump trip is on then the pump start ( Dot 01 ) must stop.
99
The Program 12
• ( Low Level on Tower)
L AIN 02
L CST 1000
< DREG 01
• ( High Level on Tower)
L AIN 02
L CST 3000
> DREG 02
• ( Low Level on Reservoir)
L AREG 100
L CST 1000
< DREG 03
• ( Pump Start Sequence)
A DREG 01 ( Tower Low Level)
AN DREG 03 ( Reservoir not low Level)
AN DIN 01 ( Pump not running)
AN DIN 02 ( Pump not Tripped)
S DOT 01 (Start Pump)
• ( Pump Stop Sequence)
O DREG 02 ( Tower High Level)
O DREG 03 ( Reservoir low Level)
O DIN 02 ( Pump Trip )
R DOT 01 ( Stop Pump )
END
PROGRAM 08 A . With the previous program : Use the Analog Registers to determine the set points on the Tower
100
Programming Exercise 13
• Use the previous program and do the following:
3000 Areg-02
AIN 02
1000 Areg -01
DIN 03=Open
DIN 04=Close
DOT 02=Valve
If the tower is lower than “1000” raw then start the pump and the pump
run until the tower is full “3000”. If the reservoir low set point ( Areg 01)
is reached or the pump trip is on then the pump start ( Dot 01 ) must stop.
The pump must start against a close valve . If the pump stop then first close
the valve and then stop the pump. ( Replace the Constant Values now with
Analog Registers and set values from OPC )
101
The Program 13
• ( Valve Sequence)
A DIN 04 ( Valve Close)
AN DIN 03 ( Valve not Open)
S DOT 01 (Start Pump)
A DIN 01 ( Pump running)
A DOT 01 (Start Pump)
S DOT 02 (Open Valve)
A DREG 02
O DREG 03
O DIN 02
S DREG 04
A DREG 04
A DIN 03
R DOT 02
A DREG 04
A DN 04
R DOT 01
R DREG 04
END
102
Programming Exercise 14
3000 DREG 21
ADD=05
1000 DREG 20
ADD=250 LEVEL=AIN 03
DIN 01=RUN
DIN 02=TRIP
DOT 01=START
STOP
If the level is lower than 1000 then the pump at station 250 must start.
If the level is higher than 3000 then the pump must stop. If there is a communication failure
at the pump station then the pump must stop.
Tips:
• Declare DIN 09 in outstation 05
• Do I/O Mapping Tx 250 dot 1 1 din 9 9
• Network map I/O Event Reporting
103
The Program 14
• ( Low Level)
L AIN 03
L CST 1000
< DREG 20
• ( High Level)
L AIN 03
L CST 3000
> DREG 21
A DREG 20 ( Tower )
S DIN 09 (Start Pump)
• ( Pump Stop Sequence)
O DOT 08 ( Tower High Level)
O DREG 21 ( Reservoir low Level)
R DIN 09 ( Stop Pump )
END
104
Programming Exercise 15
3000 AREG 21
ADD=05
1000 AREG 20
ADD=250 LEVEL=AIN 01
P1 P2
If the level is lower than Areg-20 then the pumps at station 250 must start.
If the level is higher than Areg-21 then the pumps must stop. The pumps must rotate with starts
( in other words build a flip/flop to alternate the pumps ). Use the previous program and add the
additional items.
105
The Program 15
L AIN 01 ( Load the Res Level )
L CST 1000 ( Load the Low Set point )
< DREG 01
L AIN 01 ( Load the Res Level )
L CST 3000 ( Load the Low Set point )
> DREG 02
106