Professional Documents
Culture Documents
Automation Industrielle
Industrielle Automation
Application
Presentation
Session
Transport
Network
Link
Physical
2004 June, HK
Forma de examinare:
Examen semestrial
2004 June, HK
NF
Nota Final
NE
Nota la Examen
NL
Nota la Laborator
PC
PrezenalaCurs
2004 June, HK
2004 June, HK
"Application"
protocols
"Transport"
protocols
Application
Presentation
Session
Transport
Network
Link
Physical
2004 June, HK
node 1
node 2
Application
Presentation
Session
Transport
Network
Link
Physical
Physical Medium
2004 June, HK
Repeater
500m
department A
workstations
Ethernet
To connect a workstation of
department A to the printer of
department B, the cable becomes too
long and the messages are corrupted.
server
repeater
printer
500m
department B
server
Physically, there is only one bus carrying
both departments traffic, only one node
may transmit at a time.
Ethernet
500m
EPFL - Industrial Automation
2004 June, HK
bridge
Node 2
Application
Presentation
Session
Transport
Network
Link
Physical
e.g. ATM
2004 June, HK
Bridge example
In this example, most traffic is directed from the workstations to the department
server, there is little cross-department traffic
department A
workstations
Ethernet
department A
server
Ethernet 1
repeater
printer
Bridge
printer
department B
department B
server
Ethernet
server
Ethernet 2
server
2004 June, HK
LAN
port
port
port
port
port
Spanning-tree-Algorithmen
avoid loops and ensures
redundancy
port
LAN
port
port
LAN
2004 June, HK
port
LAN
port
port
LAN
10
Switch
nodes
queues
crossbarswitch
(or bus)
full-duplex
2004 June, HK
11
Router
Node 2
Application
Presentation
Session
Transport
Network
Link
Physical
The router routes the frames on the base of their network address.
The subnets may have different link layer protocols
Frames in transit are handled in the network layer .
2004 June, HK
12
gateway
different subnetworks,
same address space
same transport protocol,
segmentation/reassembly
routers are initially opaque
end-to-end
transport protocol
Router
Bridge
same speed
same medium
access
same frames
Repeater
segment
subnet (LAN, bus, extended link)
devices (nodes, stations) have different physical addresses
devices (nodes, stations) have different link addresses
2004 June, HK
13
Apl
Apl
Pre
Pre
Pre
Pre
Ses
Ses
Ses
Ses
Trp
Trp
Trp
TCP
Net
IP
LLC
bridge
( "switch")
Trp
(store-and-forward)
Net
MAC
MAC
MIS
Layer 1
MDS
MDS
10 Mbit/s coax
Layer 3
Net
repeater
or hub
LLC
Layer 2
MDS
Apl
router
LLC
LLC
LLC
MAC
MAC
MAC
MAC
MIS
MIS
MIS
MIS
MIS
MDS
MDS
MDS
MDS
MDS
10 Mbit/s fibre
RPC
MDS
Fibre
ATM 155 Mbit/s
2004 June, HK
14
application
presentation
session
network
link
physical
transport
link phy
LLC
repeater, hub
destination
source
LLC
bridge
final
origin
router
NC
TRP
SES
PRE
Network Control
preamble
APL
CRC
ED
application
(gateway)
2004 June, HK
15
Encapsulation
INFO
User information
TrpCrt
Transport header
NetAdr
Network address
Link control
(Acknowledge, Token,etc.)
LinkCrt
LinkAdr
Link-address
size
Error detection
CRC
Flag
Frame
Flag
Signal
Each layer introduces its own header and overhead
EPFL - Industrial Automation
2004 June, HK
16
ISO 8802
logical link control
MAC_header
13
MA. frame control
MA. destination
address
(6 octets)
ISO 8473
connectionless network control
LNK_hdr
NET_header
>48
L_destination SAP
ISO 8073
class 4 transport control
TRP_header
5
L_source SAP
Header Length
L_PDU
Version/Protocol ID (01)
LSAP = DSAP
FE = network layer
18 = Mini-MAP Object
Dictionary Client
19 = Network Management
00 = own link layer
Lifetime
SP MS ER
DT/ER Type
Checksum
DATA
LI
TPDU
FIXED
PART
(CDT)
Destination
Reference
N(S)
ET
IDP
(initial
domain
part)
AFI = 49
Destination Address
(18 octets)
MA. source
address
(6 octets)
ADDRESS
PART
Source Address
(18 octets)
Segmentation
(0 or 6 octets)
Options
(priority = 3 octets)
IDI, Area ID
(7 octets)
PSI
Physical Address
(6 octets)
LSAP = FE
DSP
(domain
specific
part)
NSAP = 00
2004 June, HK
17
N+1- Layer
ServiceData Unit
(SDU)
N - Layer
Protocol
Data Unit
(PDU)
(n)-layer entity
(n)-layer entity
Protocol
Data Unit
(PDU)
ServiceData Unit
(SDU)
N-1 Layer
(n+1)-layer entity
(n+1)-layer entity
(n-1)-layer entity
(n-1)-layer entity
2004 June, HK
18
user of
service N
user of
service N
functions in layer N
2004 June, HK
19
ASAP
z.B. TCP/IP
Transport
TSAP
Transport-SAP
NSAP
Network-SAP
(not Network address)
LSAP
ISO 8473
Network
ISO-stack
Link
Physical
PhSAP
2004 June, HK
Application
(z.B. File transfer, Email,....)
20
Physical Address
Service User
Service Provider
(Network Transmission)
Service User
request
indication
confirm
(local)
confirm
(network)
confirm
(user)
response
time
2004 June, HK
21
OSI implementation
OSI should be considered as a model, not as an implementation guide
The idea of independent layers is a useful as a way of thinking, not the best implementation.
Even if many claim to have "OSI"-conformant implementation, it cannot be proven.
IEC published about 300 standards which form the "OSI" stack, e.g.:
ISO/IEC 8473-2:1996 Information technology -- Protocol for providing
the connectionless-mode network service -ISO/IEC 8073:1997 Information technology -- Open Systems
Interconnection -- Protocol for providing the connection-mode transport service
ISO/IEC 8327-1:1996 Information technology -- Open Systems
Interconnection -- Connection-oriented Session protocol: Protocol specification
ISO/IEC 8649:1996 Information technology -- Open Systems
Interconnection -- Service definition for the Association Control Service Element
ISO 8571-2:1988 Information processing systems -- Open Systems
Interconnection -- File Transfer, Access and Management
2004 June, HK
22
2004 June, HK
23
TCP / IP structure
FTP SMTP
Files
TCP
HTTP
routing
ATM
Applications
Transport
UDP
IP
Ethernet
SNMP
modem
ICMP
Network
radio
The TCP/IP stack is lighter than the OSI stack, but has about the same complexity
2004 June, HK
24
Conclusions
The OSI model is the reference for all industrial communication
Even when some layers are skipped, the concepts are generally implemented
Real-Time extensions to OSI are under consideration
TCP/IP however installs itself as a competitor to the OSI suite, although some efforts are
made to integrate it into the OSI model
TCP/IP/UDP is becoming the backbone for all non-time critical industrial communication
TCP/IP/UDP is quickly displacing proprietary protocols.
Next generation TCP/IP (V6) is very much like the OSI standards.
Many embedded controllers come with an integrated Ethernet controller, an the
corresponding real-time operating system kernel offers TCP/IP services
Like OSI, TCP protocols have delays counted in tens or hundred milliseconds,
often unpredictable especially in case of disturbances.
For further reading: Motorola Digital Data Communication Guide
2004 June, HK
25
2004 June, HK
Industrial Automation
Automation Industrielle
Industrielle Automation
3.3.2
2004 June, HK
9. Repeaters
2004 June, HK
To probe further
2004 June, HK
Application
protocols
Application
Presentation
Session
Transport
Network
Link
Physical
Transport
protocols
2004 June, HK
medium-independent signalling
medium-dependent signalling
Physical
Layer
electrical / optical
specifications
2004 June, HK
mechanical
specifications
Topology
Mechanical
Medium
Channels
Control
Modulation
Coding/Decoding
Synchronisation
Flow Control
Handshake
Interface
2004 June, HK
Topology:
Data
Terminal
Equipment
DTE
DCE
Terminal
Telephone
lines
DCE
Data Communication
Equipment (Modem)
Cabling rules
Modem
Data
Terminal
Equipment
Computer
modem eliminator
extension
DTE
2
computer
extension
terminal
cable
cable
2 3
Mechanical
1
25
Electrical:
transmitter
receiver
+12V
+3V
-12V
-3V
2004 June, HK
"0" Space On
"1" Mark Off
9. Repeaters
2004 June, HK
Sender/
Receiver
Sender/
Receiver
Sender/
Receiver
Half-duplex
Sender/
Receiver
Examples:
RS232
Examples:
RS485
Bus (Half-Duplex, except when using Carrier Frequency over multiple bands)
Terminator
Examples:
Ethernet, Profibus
Examples:
SERCOS, Interbus-S
consists of point-to-point links
2004 June, HK
10
Bus topologies
party-line
Terminator
Terminator
hub
point-to-point
free topology
radio
repeater
2004 June, HK
11
Repeater
500m
department A
workstations
Ethernet
server
To connect a workstation of
department A to the printer of
department B, the cable becomes
too long and the messages are
corrupted.
repeater
500m
printer
department B
server
Ethernet
500m
EPFL - Industrial Automation
2004 June, HK
12
higher-level hub
repeaters
point-to-point
link
partyline
partyline
2004 June, HK
13
wiring length = d n,
increases linearly with number of devices
Up to 32 devices
(more with repeaters)
I/O
hub
I/O
I/O
I/O
wiring length = d n n / 2 2
increases with square of number of devices
PLC
Up to 16 devices
per hub
does it fit into the
wiring tray ?
I/O
I/O
2004 June, HK
I/O
14
I/O
I/O
I/O
Rings
classical ring
2004 June, HK
15
9. Repeaters
2004 June, HK
16
coaxial cables
twisted wire
700m
single mode
2058
516
207
5.5
very good
multimode
196
49
20
6.5
very good
0.5
6.5
very good
50 Ohm
20
1.2
good
75 Ohm TV 1/2"
12
2.5
1.0
2.2
good
93-100 Ohm
15
0.8
2.5
good
twinax
0.9
0.2
3.5
very good
individually
shielded (STP)
0.35
0.15
.5
very good
0.3
0.1
0.2
0.1
0.05
0.2
good (crosstalk)
regular (foreign)
good (crosstalk)
bad (foreign)
0.05
0.01
very bad
Radio
bad
Infrared
0.02
good
ultrasound
0.01
bad
Telephone cable
others
Electromagnetic
Compatibility
200m
plastic
2000m
Costs
(Fr/m)
2004 June, HK
17
9. Repeaters
2004 June, HK
18
Zw = 50 ... 100
Cost
efficient
core
Coaxial
cablewiring:
twisted pair (without
dielectric
screen
inflexible, costly,
low losses
10 MHz..100 MHz
shield
Zw = 85..120
Shield
very cheap,
sensible to perturbations
Telephone
numerous branches, not terminated,
except possibly at one place
2004 June, HK
flexible, cheap,
medium attenuation
~1 MHz..12 MHz
19
very cheap,
very high losses and disturbances,
very low speed (~10 ..100 kbit/s)
2004 June, HK
20
All parameters
Characteristic impedance
Attenuation
Linear resistance
Linear capacitance
Cross talk
Common-mode
Shield protection
are frequency-dependent
2004 June, HK
21
Consider in cables
L'
R'
C'
Zw =
G'
L'
L'
R'
C'
L'
R'
G'
C'
G'
R'
C'
G'
C'
2004 June, HK
22
direct coupling
driver on line without galvanic coupling
collision possible when several transmitters active
Inductive
transformer-coupling
galvanic separation
good electromagnetic compatibility (filter)
retro-action free
good efficiency
signal may not contain DC-components
bandwidth limited
Capacitive
capacitor as coupler
weak galvanic separation
signal may not contain DC components
cheap
not efficient
2004 June, HK
23
Unipolar, unbalanced
Bipolar, unbalanced
+ Us
Coax
Ru
+ Us
Zw
Zw
Rd
- Us
Open Collector
Ut
(unbalanced)
Ut = 5 V (e.g.)
Rt
Rt
Terminator and
Pull-up resistor
wired-OR behaviour
(Low wins over High
Out
In
device
2004 June, HK
Out
In
device
24
Out
In
device
+Ub
Zw
100
Shield
Rt
UA
Differential amplifier
(OpAmp)
UB
(Data Ground)
2004 June, HK
25
TxS RxS
TxS RxS
TxS RxS
100
Terminator
stub
A
tap
120
120
Data-GND
B
multiple transmitter
allowed
Short-circuit limitation
needed
2004 June, HK
26
distance
10000
5000
2000
1200
1000
500
limited by
frequency-dependent
losses 20 dB/decade
200
100
50
20
12
10KBd
100KBd
2004 June, HK
1 MBd
27
10 MBd
Baudrate
Sender/Receiver
Sender/Receiver
Isolation transformer
isolation resistors
shield
Twisted Wire Pair
2004 June, HK
28
Double-Transformer
(long stub: 0.3 .. 6m)
Sender/Receiver
Isolation transformer
short
stub
long
stub
Isolation transformer
isolation resistors
isolation resistors
shield
shield
2004 June, HK
29
voltage
source
terminator
Free topology is used to connect scattered devices which are usually line-powered.
Main application: building wiring
2004 June, HK
30
HF-trap
220V
2004 June, HK
31
short stub
thread-through
double-connector
junction box
2 connectors
live insertion
installation ?
1 connector
live insertion
(costly) junction box
stub
1 connector
live insertion
2 connectors
no live insertion
2004 June, HK
32
2004 June, HK
33
Electrical: Connectors
Field busses require at the same time low cost and robust connectors.
The cheapest connectors come from the automobile industry (Faston clips)
and from telephony (RJ11, RJ 45)
The most popular connector is the sub-D 9 (the IBM PC's serial port),
which exists in diverse rugged versions.
Also popular are Weidmann and Phoenix connectors.
2004 June, HK
34
2004 June, HK
35
9. Repeaters
2004 June, HK
36
Fiber: Principle
3 components:
transmitter
fibre
GaAs
LED
receiver
PIN
fotodiode
Is
different refraction
coefficients
2004 June, HK
37
Fiber: Types
Multimodefibre
Monomode fibre
N(r)
50 m
Refraction profile
Cross-section
50 - 300 m
50 - 100 m
2-10 m
total reflection
gradual reflection
waveguide
3 dB/km
0,6 dB/km
1 GHzkm
2,3 dB/km
0,4 dB/km
100 GHzkm
Core
Clad
Longitudinal section
(red) 650nm
800nm
(infra-red) 1300nm
10 dB/km
5dB/km
20MHzkm
2004 June, HK
38
telecom - costly
Fibre: Use
Type
POF
HCS/PCF
GOF
Material
distance
Usage
Connector
Cost
aging
bending
bandwidth
plastic
70m
local networking
simple
cheap
poor
very good
poor
glass / plastic
400m
remote networking
glass
1km
telephone
high-precision
medium
good
poor
very good
2004 June, HK
39
precision
medium
very good
good
good
Passive coupler
n% coupling losses
1
2
3
4
5
6
Fused zone
1
2
3
4
5
6
opto-electrical
transceiver
fibre pair
2004 June, HK
40
example of
solution
Powered
unpowered
Double ring
2004 June, HK
41
Fiber: advantages
1 ) high bandwidth and data rate (400 MHz x km)
2 ) small, frequency-insensitive attenuation (ca. 3 dB/km)
3 ) cover long distances without a repeater
4 ) immune against electromagnetic disturbances (great for electrical substations)
5 ) galvanic separation and potential-free operation (great for large current environment)
6 ) tamper free
7 ) may be used in explosive environments (chemical, mining)
8 ) low cable weight (100 kg/km) and diameter, flexible, small cable duct costs
9 ) low cost cable
10) standardized
2004 June, HK
42
5) Galvanic isolation can be achieved with coaxial cables and twisted pairs through opto-couplers
6) Tapping is not a problem in industrial plants
7) Optical busses using (cheap) passive components are limited to a few branches (16)
8) In explosive environments, the power requirement of the optical components hurts.
9) Installation of optical fibres is costly due to splicing
10) Topology is restricted by the star coupler (hub) or the ring structure
2004 June, HK
43
Radio Transmission
Radio had the reputation to be slow, highly disturbed and range limited.
Mobile radio (GSM, DECT) is able to carry only limited rate of data (9.6 kbit/s) at high costs,
distance being limited only by ground station coverage.
IEEE 802.11 standards developed for computer peripherals e.g. Apples AirPort
allow short-range (200m) transmission at 11 Mbit/s in the 2.4 GHz band with 100mW.
Bluetooth allow low-cost, low power (1 mW) links in the same 2.4 GHz band, at 1 Mbit/s
Modulation uses amplitude, phase and multiple frequencies (see next Section)
Higher-layer protocols (WAP, ) are tailored to packet radio communication.
bluetooth module
2004 June, HK
44
2004 June, HK
45
Terminator
Terminator
decentralized wiring
Star topology
star coupler B
centralized wiring
2004 June, HK
46
9. Repeaters
2004 June, HK
47
Modulation
Base band
Carrier band
Backward
channel
Broadband
2004 June, HK
5-108
MHz
48
Forwardchannel
162-400
MHz
Frequency
9. Repeaters
2004 June, HK
49
Data
1 1 0 1 0 0 0 1
Clock
+NRZ Data
+Framing
= Line Signal
Start-sync
(Violation)
2004 June, HK
Data in Manchester II
50
Stop-sync
(Violation)
Frames: Synchronization
character-synchronous
(e.g. bisync)
Data
A B C SYN D E F G
SYN
Signal
SYN SYN
Byte-stuffing
flag
SYN
flag
bit-synchronous
(e.g. HDLC)
Data
11 100 0 11 111
110
011 1 1 1
flag
Signal
0 1 1 1 1 1 10 1 1 1 0 0 0 1 1 1 1 1 0 1 1 0
0 1 1 1 1 1 0 0 0 1 1 1 1 11 0
Bit-stuffing
delimiter
(e.g. IEC 61158)
Signal
"1" "1" "0" "0" "1" "1"
2004 June, HK
51
Manchester symbols
9. Repeaters
2004 June, HK
52
Manchester
Differential Manchester
Ethernet, FIP
IEC 61158,
MVB, MIL 1553
LON
High-density
diskettes
Miller (MFM)
Xerxes
FlexRay
2004 June, HK
53
The drivers must be carefully balanced (positive and negative excursion |+U| = |-U|)
effect of unbalance
(magnetic discharge)
2004 June, HK
54
Dynamic: 10 dB
line
unipolar signal
histeresis
idle level
Uh+
Uh-
time
active
RxS
Dynamic: 18 dB
idle
bipolar signal
Uh+
Uh-
Dynamic: 32 dB
Daten
1 0 1 0 1 0 1 0 1 N+ N- 1 0 N- N+ 0 1 1 1
Preamble
Delimiter
Dynamic: 38 dB
2004 June, HK
55
N+
N-
N-
N+
N+
N-
+U
Preamble (variable) 0V
-U
Start delimiter (8 bit times)
1
defines end of frame
start
2004 June, HK
payload
56
end delimiter
Encodings: Multi-frequency
power
"SB1"
"0" "1"
unused
"SB2" "SB3"
"0" "1" "0" "1"
"SB4"
"0" "1"
"SB5"
"0" "1"
"SB6"
"SB7"
"0" "1" "0" "1"
"SB8"
"0" "1"
22,5 kHz 31,5 kHz 40,5 kHz 49,5 kHz 58,5 kHz 67,5 kHz 76,5 kHz 85,5 kHz
27 kHz 36
45 kHz
54
63
72
81 kHz
90 kHz
kHz
kHz
kHz
kHz
frequency
EMC considerations
2004 June, HK
57
" 0 " " 1 "" 0 " " 0 " " 1 " " 1 " " 0 "
3-step
2-step
3-step
EPFL - Industrial Automation
2004 June, HK
58
Encoding: qualities
2) Spectral efficiency
4) Decoding ease
5) Integrity
6) Polarity
2004 June, HK
59
9. Repeaters
2004 June, HK
60
Repeater
node
node
node
repeater
2004 June, HK
encoder
decoder
(RS 485)
node
node
decoder
encoder
segment 1
node
61
segment 2
(transformer-coupled)
2004 June, HK
62
opto-electrical
transceiver
to other device
or star coupler
to other device
or star coupler
fibre pair
device
device
2004 June, HK
device
device
63
2004 June, HK
Industrial Automation
Automation Industrielle
Industrielle Automation
3.
2004 June, HK
2004 June, HK
2004 June, HK
Application
bridge control
Presentation
Session
Logical Link
Control
(LLC)
Medium Access
Control
(MAC)
Transport
Network
Link
Physical
Frame
store-and-forward
address discovery
connection establishment
flow Control
error handling
medium allocation
(master redundancy)
addressing
frame format
integrity control
Physical
Signaling
Physical
Medium
2004 June, HK
Node 1
Node 2
Application
Presentation
Session
Transport
Network
Link
Physical
Physical Medium
2004 June, HK
Application
repeater
Node 2
Presentation
Session
Transport
Network
Link
Physical
1
physical medium (0)
The two segments on each side of a repeater form a single subnet, identified by
same speed (medium, modulation may differ)
same frame format (except fringe effects)
same medium access
same address space (transparent on both side of the repeater)
Repeaters introduce a delay in the order of a few bit time.
EPFL - Industrial Automation
2004 June, HK
bridge
Node 2
Application
Presentation
Session
Transport
Network
Link
Physical
2004 June, HK
2004 June, HK
Function
Objects
Flag
01111110
Address
Control
8 bit
8 bit
Data
CRC
(n 8)
16 bit
Integrity Check
Medium Access
Error recovery
Flow control
2004 June, HK
10
Flag
01111110
HDLC Topology
Secondary
(Terminal)
Secondary
(Terminal)
full-duplex
or
half-duplex
medium
Secondary
(Terminal)
Secondary
(Terminal)
Secondary
(Terminal)
Secondary
(Terminal)
Primary
(Mainframe)
Secondary
(Terminal)
Secondary
(Terminal)
2004 June, HK
11
Command/Data
Requester/
Primary
Responder/
Secondary
Acknowledgement
Sender/Receiver
Sender/Receiver
Command/Acknowledgement
Requester/
Primary
Responder/
Secondary
Data
Sender/Receiver
Sender/Receiver
Half-Duplex
Requester/
Primary
Responder/
Secondary
Sender/Receiver
Sender/Receiver
The Primary switches the Secondary to send mode, the Secondary sends until it returns control
2004 June, HK
12
2004 June, HK
13
Frame Sublayer
Network
Network
Logical Link
Control
(LLC)
Logical Link
Control
(LLC)
Medium Access
Control
(MAC)
Medium Access
Control
(MAC)
Frame
Frame
Physical
Signaling
Physical
Signaling
Physical
Medium
Physical
Medium
sublayer
The frame layer is concerned with the correct frame format and contents,
with (practically) no consideration of the medium or speed.
EPFL - Industrial Automation
2004 June, HK
14
Error Handling
Industry imposes high standards regarding data integrity
Transmission quality is not very high , but consequences are severe.
Errors not detected at the link layer are very difficult to catch at higher layers
Error detection
Frame data are protected by redundant information, such as parity bits,checksum,
CRC (Cyclic Redundancy Check)
Error recovery
Except when medium is very poor (Power Line Carrier, radio), error correcting
codes are not used.
Erroneous frames are ignored, the potential sender of the error is not informed
(the address of the sender is unknown if the frame is damaged)
The sender is informed of the lack of response when it does not receive the
expected acknowledgement within a time-out.
Definition of the time-out has a strong impact on real-time behaviour
EPFL - Industrial Automation
2004 June, HK
15
2004 June, HK
16
Error Detection
Error detection require redundancy in the transmitted information.
Signal redundancy: Signal quality supervision (squelch, jamming,..)
Coding redundancy: Timing-violations in decoder
Data redundancy: error detecting code
k data bits
r check bits
Hamming-Distance
Residual Error Rate
2004 June, HK
17
Hamming Distance
The Hamming Distance between two words is the number of bits in which they differ:
Example
Word 1: 01100110
Word 2: 00101001
-> Hamming-Distance = 5
The Hamming Distance of a code is the minimum number of bits which need to be tilted
in a valid codeword to produce another valid (but erroneous) codeword
Number of detectable bit errors:
ZD = HD 1
ZC = (HD1)/2
Example: HD = 4: ZD = 3, ZC = 1
00000
00001
code word
00111
2004 June, HK
2nd error
18
01111
code word
m=4
1st error
00011
3rd error
4th error
par
D7
D6
D5
D4
D3
D2
D1
D0
Odd parity: sum Modulo-2 of all "1" in the codeword (including the parity bit) is odd
The parity bit is the last transmitted bit (->LSB first, a matter of convention)
illegal
111
110
101
100
legal
011
010
001
000
2004 June, HK
19
Principle
2004 June, HK
20
Example:
Hamming Distance
E
r
R
er
= 1 - (1 - E )
r
no error
n E (1 - E )
r
r
n -1
-5
n = 9 bit
R = 72 1 0
er
-5
n = 513 bit
R = 2.6 1 0
er
2004 June, HK
21
-1 0
-5
quite efficient.
quite useless ...
10 -12
Integrity class I3
10 -14
10 -16
10 -5
10 -4
2004 June, HK
10 -3
22
10 -2
10 -1
10 0
Synchronization Errors
HDLC-frame
flag
flag
01111110
any data
disturbance
FCS
01111110
flag
flag
"FCS"
01111110
1 Chance in 65536,
that the random data
form a correct CRC
FCS
01111110
false
flag
01111110
discarded
The synchronization should have a higher Hamming distance than the data itself.
EPFL - Industrial Automation
2004 June, HK
23
2004 June, HK
24
2004 June, HK
25
2004 June, HK
26
Network
Network
Logical Link
Control
(LLC)
Logical Link
Control
(LLC)
Logical Link
Control
(LLC)
Medium Access
Control
(MAC)
Medium Access
Control
(MAC)
Medium Access
Control
(MAC)
Frame
Frame
Frame
Physical
Signaling
Physical
Signaling
Physical
Signaling
Physical
Medium
Physical
Medium
Physical
Medium
2004 June, HK
27
2004 June, HK
28
Fairness
Determinism
Timelyness
Robustness
2004 June, HK
29
2004 June, HK
30
slave
slave
slave
bus
master
devices
(slaves)
bus
command reply
read
command ack
write with ack
command
write no ack
command
reply
read & write
time
2004 June, HK
31
2004 June, HK
32
Devices are connected by point-to-point links (no bus!), there is one sender per segment.
The operation is similar to a large shift register.
The master sends a long frame with the output data to the first device in the ring.
Each device reads the data intended for it, inserts its data instead and
passes the frame to the next device.
The last device gives the frame back to the master.
data
time
output
application memory
devices
input
master
output
shift register
input
data
output
input
time
2004 June, HK
33
the position of the bit in the frame corresponds to the position of the device in the ring,
there are no device addresses - easy to use, but prone to misconfiguration.
each device introduces a delay at least equal to a few bits
+ deterministic access, good usage of capacity, addresses are given by device sequence
on the ring, only point-to-point links
- long delays (some s per device)
2004 June, HK
34
2004 June, HK
35
Principle
(pure Aloha)
(Carrier Sense)
(Collision Detection)
(Binary Backoff)
Advantage:
Drawback:
2004 June, HK
36
preamble
= 8 Bytes
(2 x 7.5 s/km+ 2
repeaters)
Tpd
minimum
frame size
= 64 Bytes
collision
Station A must
detect that its
frame collided
while it is still
transmitting its
frame
time
Station B started
transmission just
before receiving
As frame.
it nevertheless
transmits its
header completely
2004 June, HK
37
The frame must be long enough to allow all stations to detect a collision while the frame is
being transmitted.
500 m
500 m
Collisions can only be detected reliably when the frame size is longer than the
propagation delay -> padding to a minimum size (512 bits = 64 Bytes)
2004 June, HK
38
previous frame
utilisation 100%
time
frame size
0.8
4096
1024
0.6
512
48
0.4
0.2
0
1
10
32
64
128
256
number of transmitters
Ethernet is not efficient for small frame size and large number of simultaneous transmitters
Ethernet is considered to enter overload when reaching 10%-18% load
EPFL - Industrial Automation
2004 June, HK
39
0.9
0.8
0.7
0.6
0.5
0.4
0.3
0.2
0.1
0
10
11
12
13
14
15
16
2004 June, HK
40
2004 June, HK
41
The CAN fieldbus uses media with a dominant and a recessive state
When several transmitters are simultaneously active, the dominant state wins
over the recessive state if there is at least one transmitter sending the dominant state
(dominant is Low in open collector, "Bright" in an optical fiber, or a collision on a medium that
allows collisions).
device 1
Out
Jam
device 2
In
Out
XOR
Jam
device 3
In
XOR
Out
Jam
XOR
device 4
In
Out
Jam
XOR
In
Terminator and
pull-up resistor
Ut
Ut
Rt
Rt
Bus line
A device is capable to know if the signal it puts on the line is disturbed (XOR).
EPFL - Industrial Automation
2004 June, HK
42
Station 10 (wins)
Station 06
(1)
(1)
(0)
Station 09
(1)
Bus signal
2004 June, HK
43
Drawback: the slot time (one bit time) must be long enough so that every station can
detect if it has been disturbed - I.e. twice as long as the propagation time
from one end of the bus to the other ( signal speed = 5 ns / m).
2004 June, HK
44
2004 June, HK
45
Each station knows the next station in the ring (and the overnext)
Each station delegates the right to send to the next station in the ring,
(in the form of a token frame or as an appendix to a data frame).
Variants
Token with Priority (back to the station with the highest priority)
Problems:
2004 June, HK
46
station address
12
25
31
AS
AS
AS
current bus
master
active stations
(potential masters)
passive stations
(slaves)
Active Stations (AS) can become master if they own the token,
for a limited duration (one frame only).
After that time, the master passes the token to a station with a higher address
or, if it has the highest address, to the station with the lowest address.
A station must send at least one frame (data or token) when it gets its turn.
EPFL - Industrial Automation
2004 June, HK
47
AS AS
Active
Station
PS
Previous
Station
TS
10 11
NS
This
Station
12 13 14 15
..
30 32
AS
Next
Overnext
Station Station
When the current master has no more data to send, or when its turn expires, it
sends a token frame to the Next Station (NS) in the ring.
NS acknowledges reception of the token.
If the master does not receive an acknowledgement for two consecutive trials,
the master removes the station from the LAS and declares the overnext
active station (OS) as NS.
2004 June, HK
48
2004 June, HK
49
2004 June, HK
50
deterministic
stochastic
pessimistic
optimistic
carrier sense
central master
collision detection
p-persistent collision
2004 June, HK
token passing
51
2004 June, HK
52
Network
Logical Link
Control
(LLC)
Logical Link
Control
(LLC)
Medium Access
Control
(MAC)
Medium Access
Control
(MAC)
Frame
Frame
Physical
Signaling
Physical
Signaling
Physical
Medium
Physical
Medium
53
Connectionless mode
(Datagram letter)
Each packet (Datagram) contains all
information needed to forward it to its final
destination over the network, including the
path back to the sender.
The network assumes no responsibility for
the ordering of packets and does not try to
recover damaged datagrams.
The burden of flow control and error recovery
is shifted to the application.
Semantic of CL-transmission
Connection-Oriented mode
(Virtual Circuit telephone)
A connection is first established between sender
and receiver.
Information packets are identified by their
connection identifier and by their sequence
number within that connection.
The network cares for opening and closing
connections and ensures that packets are received
in same order as they are sent, recovering lost
packets and controlling the flow.
Applications see the network as a reliable pipe.
Connection is closed after use (and reused)
Semantic of CO-transmission
Open_Channel(Node, Task, Channel_Nr);
Send_Message (Channel_Nr, Msg1);
Send_Message (Channel_Nr, Msg2);
Close(Channel_Nr);
2004 June, HK
54
service
provider
service
user
REQUEST
INDICATION
RESPONSE
CONFIRM
2004 June, HK
55
Flow Control
( = synchronization at the link layer)
"Adapt the speed of the sender to that of the receiver"
Methods
Use Acknowledgements: do not send until an acknowledgement is received
(acknowledgements have two purposes: error recovery and flow control !)
Upper Window
Edge
8
10
11
12
time
sent and
acknowledged
EPFL - Industrial Automation
2004 June, HK
56
can be sent
may not
be sent
LLC
Bus
Consumer
LLC
Connection
tm_message.req
Connect Request
connect
timer
nm_connect.ind
nm_connect.cnf
Connect Confirm
Transfer
DATA (0)
ack
timer
ACK (1)
DATA (1)
alive
time-out
ACK (2)
DATA ( last)
nm_message_ind
ACK (last)
Disconnection
nm_message.cnf
late
acks
time
2004 June, HK
57
Error Recovery
General rule: Erroneous information frames are repeated
(error correcting codes belong to physical layer)
1) In cyclic transmission, information is not explicitly repeated in case of loss,
the receiver will receive a fresh information in the next cycle.
A freshness control supervises the age of the data in case communication ceases.
2) In event-driven transmission, no information may be lost, a repetition is explicit:
a) The sender of information frames expects acknowledgement of the
receiver, indicating which information it received.
b) The sender repeats the missing information a number of times, until it
receives an acknowledgement or until a time-out expires.
c) To distinguish repetitions from new information, each packet receives
a sequence number (in the minimum odd/even).
d) The receiver acknowledges repetitions even if it already received the
information correctly.
2004 June, HK
58
2004 June, HK
59
Example: HDLC
2004 June, HK
60
flag
adr
control
FCS
any data
01111110
16
Information Transfer
Command/Response
(I-Format PDU)
Supervisory
Commands/Responses
(S-Format PDUs)
Unnumbered
Commands/Response
(U-Format PDUs)
N(S)
P/F
N(R)
N(R) = Sequence number of
receiver
P/F
N(R)
S = Supervisory
P/F
2004 June, HK
61
2004 June, HK
62
Send Sequence
set normal response
mode, poll
please confirm
information packets
SNRM, P
I0,0
I2,0P
I1,0
I3,0
Primary
(Commander)
time
UA,F
Secondary
(Responder)
RR3,F
accept
connection,
final
receiver
ready, expects 3
Receive Sequence
set normal response
mode, poll
SNRM; P
receiver
ready, expects 0
receiver
ready, expects 3
RR0;P
RR3;P
Primary
(Commander)
Secondary
(Responder)
time
UA;F
I0,0
accept
connection, final
I1,0
several
information packets
I2,0;F
I3,0
last frame
2004 June, HK
63
Clocks
2004 June, HK
64
int
req
int
req
PORTS
slave
clock
master
clock
application
processor 1
pulse
application
processor 2
int
req
PORTS
pulse
bus
controller
application
processor 3
PORTS
pulse
bus
controller
bus
controller
BUS
time variable
bus master
2004 June, HK
65
other master
with clock
slave
clock
master
1
MVB 1
other MVB
synchronizer
master clock
device
slave clocks
The clock does not need to be generated by the Master, but the master must poll the clock
The clock can synchronize sampling within a few s across several bus segments.
2004 June, HK
66
IEEE 1588 defines the Precision Time Protocol, a clock synchronization that assumes that
two consecutive frames have the same delay, but the moment of sending suffers jitter.
The clock device (possibly coupled to a radio signal) sends the first frame with an coarse
time stamp, but registers in hardware the exact moment when the frame was sent.
It then sends a second frame with the exact time at which the first frame was sent.
Bridges and switches are responsible to compensate for their internal delays and send a
corrected time frame.
2004 June, HK
67
2004 June, HK
68
Industrial Automation
Automation Industrielle
Industrielle Automation
2006, April HK
To probe further
Industrial Automation
2/48
Application
Presentation
Session
Transport
Network
Link
Physical
Industrial Automation
Application
protocols
Management of connections
(e.g. ISO 8326)
End-to-end flow control and error recovery
(e.g. TP4, TCP)
Transport
protocols
3/48
Presentation Layer
Industrial Automation
4/48
Industrial Automation
5/48
MA. destination
address
(6 octets)
ISO 8802
logical link control
ISO 8473
connectionless network control
LNK_hdr
NET_header
>48
L_destination SAP
ISO 8073
class 4 transport control
TRP_header
Protocol Identifier
(81)
Header Length
L_PDU
Version/Protocol ID (01)
Lifetime
SP MS ER
DT/ER Type
(18 octets)
(18 octets)
(6 octets)
(CDT)
Destination
Reference
FIXED
PART
ET
N(S)
address length
IDI, Area ID
(7 octets)
Segmentation
(0 or 6 octets)
Options
LSAP = FE
6/48
IDP
(initial
domain
part)
PSI
Physical Address
(6 octets)
(priority = 3 octets)
Industrial Automation
TPDU
AFI = 49
Source Address
Address
Part
LI
Checksum
Destination Address
MA. source
address
DATA
L_source SAP
LSAP = DSAP
FE = network layer
18 = Mini-MAP Object
Dictionary Client
19 = Network Management
00 = own link layer
DSP
(domain
specific
part)
NSAP = 00
154,5 Vrms
struct {
unsigned count;
int
item2:8;
int
item1:4;
int
dummy:4;
}
application memory
application
processor
D15
D00
transmission
specification
language and
encoding rules
SEQUENCE {
item1 INTEGER16,
item2 INTEGER4,
count UNSIGNED8;
}
bus controller
(16-bit oriented)
time
Industrial Automation
7/48
first
0 1 0 0 0 0 0 0
LSB
MSB
0 0 0 0 0 0 1 0
MSB
LSB
time
There is no relation between the bit and the byte ordering scheme
octet in
octet out
Who says which bit is really transmitted first ?
(FDDI: multi-bit symbol transmission, multi-bit
transmission with interleaving)
8/48
Memory contents
MSB
address
LSB
0 0 0 0 0 0 1 0
x0001
x0002
0 0 0 0 0 0 0 1
x0003
x0004
0 0 0 0 0 0 0 1
x0005
x0006
0 0 0 0 0 0 0 0
BE
Intel
Motorola
DEC
7 6 5 4 3 2 1 0
x0000
LE
IBM, TCP/IP,
Unix, RISC
INTEGER8
=2
=2
INTEGER16
=1
= 256
INTEGER32
=1
0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0
= 16777216
0 0 0 0 0 0 0 0
Processor
B7 B6 B5 B4 B3 B2 B1 B0
(bit name)
TCP/IP
0 1 2 3 4 5 6 7
(bit offset)
Profibus
1 2 3 4 5 6 7 8
(bit position)
Industrial Automation
9/48
INTEGER32
time
Industrial Automation
10/48
Description
Host order to
Host order to
Network order
Network order
network
network
to host
to host
order,
order,
order,
order,
All data "seen" by the sockets layer and passed on to the network must be in network order
struct sockaddr_in s;
/* WRONG */
s.sin_port = 23;
/* RIGHT */
s.sin_port = htons(23);
11/48
preamble
N
N
F
F
I/G L/U
0
M
lsb
N
M
N
M
0
P
0
P
0
P
Destination Address
lsb
Source Address
remaining 44 bits of address
msb
msb
lsb
first octet
msb
Industrial Automation
lsb
E
12/48
intuitive
0
snu
gni
nodeID or groupID
stationID
functionID
protocolID
command
parameter
i
i+1
Industrial Automation
typedef struct {
char location[ LOCATION_LEN ];
unsigned long object_id;
alarm_type_t alarm_type;
priority_level_t priority_level;
unsigned long index_to_SNVT;
unsigned value[ 4 ];
unsigned long year;
unsigned short month;
unsigned short day;
unsigned short hour;
unsigned short minute;
unsigned short second;
unsigned long millisecond;
unsigned alarm_limit[ 4 ];
} SNVT_alarm;
is "short" a byte ?
is unsigned 16 bits or 32 bits ?
No!
Such a machine-dependent syntax is only valid if all applications use the same syntax on
the same machine with the same compiler, it is not suited to describe the bus traffic.
Industrial Automation
14/48
The IEC/ISO define a standard notation in IEC 8824 (ASN.1), allowing to define
simple types (primitive) and constructed types.
Data structures can take forms not usually found in programming languages.
Each data structure is identified during transmission by a tag.
In principle, ASN.1 only defines data structures to be transmitted, but not how
they are encoded for transmission.
One possible coding of the primitive and constructed data types is defined in
ISO/IEC 8825 as "Basic Encoding Rules (BER) defined in ISO 8825.
More efficient encodings (PER,) also exist.
ASN.1 can be used for defining memory contents, file contents or communication
data, and in general any exchanged information.
ASN.1 was originally designed to transfer information between data bases.
ASN.1 has the same role as XML, but it is far more efficient.
see: http://asn1.elibel.tm.fr/en/index.htm
Industrial Automation
15/48
John P Smith
Director
51
17 September 1971
Mary T Smith
2
ASN.1
PersonRecord ::=
name
title
number
dateOfHire
nameOfSpouse
children
[APPLICATION 0] SEQUENCE {
Name
[0] VisibleString,
EmployeeNumber,
[1] Date,
[2] Name,
[3] SEQUENCE OF
Childinformation
DEFAULT {} }
Industrial Automation
16/48
A transfer syntax describes how the structures and elements are effectively
encoded for storing and transmission, so that the receiver can fully decode the
transmitted information. At transmission time, only the transfer syntax is visible, it cannot
be interpreted without knowing the abstract syntax.
E.g. A transfer syntax defines that an array of 33 Unicode characters is transmitted.
The receiver knows from the abstract syntax that this is a persons name.
The basic encoding rules for ASN.1 are defined in the standard ISO 8825-1.
Industrial Automation
17/48
ASN.1 does not say how data are stored nor transmitted, but it assumes that the
transmission format consists for each item of: a tag, a length and a value (TLV)
tag
length
value
length
tag
length
value
tag
length
value
(recursive)
the tag specifies the data type of the value that follows, implicitly or explicitly.
Industrial Automation
18/48
UNIVERSAL
APPLICATION
CONTEXT_SPECIFIC
PRIVATE
Basic Types
BOOLEAN
INTEGER
BITSTRING
OCTETSTRING
NULL
OBJECT_ID
OBJECT_DESC
EXTERNAL
REAL
ENUMERATED
ANY
Constructed Types
SEQUENCE
SET
SET OF
unused
unused
pointers are not used objects of undefined length (closing character) are treated specially
Industrial Automation
19/48
20/48
person
PersonRecord
chief
VisibleString
Industrial Automation
title
number
INTEGER
21/48
dateOfHire
UniversalTime
3.3.4 Data Presentation
Tagging
person
tags
A1
[1]
Industrial Automation
number
[4]
dateOfHire
title
[3]
22/48
[5]
3.3.4 Data Presentation
INTEGER16,
INTEGER32,
FLOAT
1234
quantity in units
1234
quantity in millimetres
1.2 E 03
Industrial Automation
23/48
Unix systems use XDR (Sun's external data representation) that is 32-bit oriented, not efficient
for small data items, also a mixture of abstract and transfer syntax.
Industrial Automation
24/48
Industrial Automation
25/48
BER (ISO 8825-1), a companion to ASN1, defines encoding rules for ASN.1 data types
BER tags all data, either implicitly or explicitly
Type-Tag and size are transmitted before every value or structured data
Example:
02
12
34
26/48
Class
00 = UNIVERSAL
01 = APPLICATION
10 = CONTEXT_SPECIFIC
11 = PRIVATE
Primitive {0} or
Constructed {1}
P: after the size comes a value C: after the size comes a tag
Example:
Tag
(for universal class only):
00 = null (size = 0, no value)
01 = Boolean type
02 = Integer type
03 = Bitstring type
04 = Octetstring type
05 = Null type
06 = Object Identifier type
07 = Object Descriptor type
16 = Sequence and Sequence_Of types
17 = Set and Set_Of types
18-22 = Character strings (numeric, printable, )
23-24 = Time types
25 = Graphic string
26 = VisibleString (ISO646)
> 28 = reserve and escape: use a second octet.
Industrial Automation
27/48
01 01 FF = true
02 01 05
02 02 01 04
(hex representation)
02 03 01 00 08 (hex representation)
bitstring
2 octets
Industrial Automation
6 unused bits
value = 11
28/48
AP C
CallerRef :== [APPLICATION 7] SEQUENCE {
priority
[2] INTEGER,
command
[0] INTEGER,
reference
[1] INTEGER,
caller
INTEGER}
(useful information)
Industrial Automation
29/48
7
16
CS P
1
high_prio
CS P
0
1
command
CS P
1
2
reference (MSB)
reference (LSB)
CS P
3
4
UN P
2
2
caller (MSB)
caller (LSB)
high_prio
command
reference
caller
Examples
constructed means: the octet following the size is not a value, but a type-tag !
Tag-Type:
80 10000000
61 01100001
AB 10101101
01 00000001
30/48
[APPLICATION 1]
[6]
3.3.4 Data Presentation
Examples
green: tag / type
red: size
black: value
A0 0E 02 01 0A A1 09 A0 03 80 01 00 A1 02 80 00
A1 67 02 01 0A A1 62 A0 5D 1A 0B 54 65 6D 70 65
72 61 74 75 72 65 1A 0C 54 65 6D 70 65 72 61 74
75 72 65 31 1A 07 61 72 72 61 79 5F 35 1A 04 62
6F 6F 6C 1A 0F 66 65 65 64 65 72 31 5F 33 5F 70
68 61 73 65 1A 05 66 6C 6F 61 74 1A 0F 68 65 72
62 73 5F 74 65 73 74 5F 74 79 70 65 1A 08 75 6E
73 69 67 6E 65 64 81 01 00
-A0 18 02 01 0B A6 13 A0 11 80 0F 66 65 65 64 65
72 31 5F 33 5F 70 68 61 73 65
A1 34 02 01 0B A6 2F 80 01 00 A1 16 81 14 66 65
65 64 65 72 31 5F 33 5F 70 68 61 73 65 24 41 64
64 72 A2 12 A2 10 A1 0E 30 05 A1 03 85 01 10 30
05 A1 03 85 01 10
-A0 1E 02 01 0C A4 19 A1 17
Industrial Automation
31/48
null
values are transmitted with a variable length. This costs a lot of encoding and decoding that
is not justified for simple types. Example for INTEGER:
Value
Length field
1
127
128
255
32767
32768
65535
01
01
02
02
02
03
03
-1
-127
-128
-129
-255
-32767
-32768
-32769
01
01
01
02
02
02
02
03
Value Octets
00
00
7F
00 80
00 FF
01
7F
80
FF
FF
00
FF
FF
FF
80
80
FF 7F
FF
81
80
7F
01
01
00
FF
Industrial Automation
32/48
Industrial Automation
33/48
Each data type is specified, e.g. Integer32 differs from Integer32_LE (Little Endian)
The ROSIN notation uses the ASN.1 meta-syntax, but it does not imply a TLV scheme.
- the length can be deduced from the type or position,
- typing information is inserted explicitly when:
a choice exists among several alternative types (e.g. depends on success/failure)
types have a (large) variable size (e.g. text strings, files)
sequences have optional fields and out-of-sequence fields (occurs too often).
Industrial Automation
34/48
--------
octet.
16-bit word, MSB first
6- bit value
2 bits for par4, e.g. check variable.
parameter5 has a structured type
an array of up to 32 8-bit characters.
trailed if shorter with 0 characters.
snu
ENUM1 {
USER
(0),
-- 0 = user
SYSTEM (1)
-- 1 = system
},
gni
ENUM1 {
-- could also be expressed as BOOLEAN1
INDIV (0),
-- individual function addressing
GROUP (1),
-- group addressing.
},
node_id
UNSIGNED6,
-- 6-bit unsigned integer
sta_or_func
ONE_OF [snu] { -- meaning depends on snu
function [USER] UNSIGNED8,
-- if snu = user, function identifier
station [SYSTEM] UNSIGNED8
-- if snu = system, station identifier
},
next_station_id
UNSIGNED8,
-- next station or FFH if unknown
tv
BOOLEAN1,
-- TRUE if 1
res1
BOOLEAN1 (=0), -- 0 (place holder)
topo_counter
UNSIGNED6,
-- 6-bit unsigned integer
tnm_code
ENUM8 {
-- has only two defined values
FIRSTCASE (1EH)
-- one of two defined values
SECONDCASE (84H)
-- the other defined value
},
action_code
Action_Code,
-- this type is used several times
parameter1
parameter2
2
3
parameter3
par4
parameter5
5
6
parameter6
CHARACTER8
39 snu gni
sta_or_func
40
next_station_id
41
42
node_id
tv
d1
top_counter
43
tnm_code
44
action_code
Industrial Automation
35/48
(SUN)
BER
XDR
Boolean
24
16
Integer8
24
Unsigned8
(UIT)
A-PER
(Profibus) (FIP)
U-PER
FER
BuER
ROSIN
16
16
16
12
16
16
24
16
11
11
16
16
Integer16
32
24
24
20
24
24
16
Unsigned 16
32
24
24
19
24
24
16
Integer32
48
40
24..48
36
40
40
32
Unsigned32
48
40
24..48
35
40
40
32
String [32]
272
272
272
272
272
272
256
encoding/decoding highly packed data may cost more than is won by shorter transmission
Industrial Automation
36/48
Industrial Automation
-----------
37/48
Engineering Units
Scaling (determined the possible range of a variable) is necessary for analog displays.
It requires the definition of the possible range of values that the variable may take.
Industrial Automation
38/48
SI Units
All physical variables should be restricted to SI Units (NIST 330-1991, IEEE 268A-1974)
or referred directly to them
For instance:
Industrial Automation
unit
m
kg
s
A
rad
N
Nm
s-1
rad/s
-2
rad s
39/48
variable
power
energy
pressure
volume
flow
mass flow
tension
reactive power
impedance
temperature
unit
W
J
Pa
m3
m3 /s
kg/s
V
var
Industrial Automation
40/48
Fractionals
A device can indicate the format of a fractional analog variable by
specifying (as a REAL32) the span and the offset to be applied to the base unit:
offset value
span value
physical variable
UNSIGNED16
0
65535
INTEGER16
-32768
+32767
e.g. offset = 0,0 m/s, span = 100,0 m/s, base unit = UNSIGNED16
means: 0 = 0,0 m/s, 65536 == 100,0 m/s
e.g. offset = - 32,768 V, span = 65,536 V, base unit = INTEGER16
means: 0 = -32,768 m/s, 65536 == 32,767 V
Industrial Automation
41/48
Scaled Variables
caution
--> 0 .. 65535
--> -32768 .. 32768
--> 0 .. 65535
--> 0 .. 65535
(UNSIGNED16)
(INTEGER16)
(UNSIGNED16)
(UNSIGNED16)
== 0 .. 65535
== -32768 .. 32768
(UNSIGNED16)
(INTEGER16)
== 0
== 32768
42/48
DoubleCommand
Persistent
Regulating Command
RegulatingStep
Command
Double-Point
Information
00
01
10
11
not permitted
OFF
ON
not permitted
not permitted
Lower
Higher
not permitted
not permitted
Next Step Lower
Next Step Higher
not permitted
indeterminate
determined OFF
determined OFF
not permitted
Time-Stamped Variable:
value
time
status
Industrial Automation
43/48
Structured Text:
RTF - Microsoft Word Native Format
HTTP - Hypermedia data presentation
Some standards for video:
QuickTime -- an Apple Computer specification for video and audio.
Motion Picture Experts Group (MPEG) -- video compression and coding.
Some graphic image formats:
Graphics Interchange Format (GIF) -- compression and coding of graphic images.
Joint Photographic Experts Group (JPEG) -- compression and coding for graphic images.
Tagged Image File Format (TIFF) -- coding format for graphic images.
Industrial Automation
44/48
Industrial Automation
45/48
Gateway
When devices share no common transport layer protocol, gateways act as protocol
converters and application layer protocols must ensure end-to-end control.
Protocol Conversion is costly in development and real time, since protocols are in
general insufficiently specified, custom-designed, and modified without notice.
application
Real-Time
Protocols
PV
application
presentation
presentation
session
session
transport
transport
network
network
PV
link
link
link
link
physical
physical
physical
physical
bus type 1
Industrial Automation
bus type 2
46/48
Industrial Automation
Automation Industrielle
Industrielle Automation
Office
network
Industrial Automation
Automation Industrielle
Industrielle Automation
TCP - IP
Ethernet
Plant Network
Ethernet, ControlNet
Fieldbus
intelligent field devices
FF, PROFIBUS, MVB, LON
Sensor Busses
simple switches etc.
CAN, DeviceNet, SDS, ASI-bus, Interbus-S
3.1
2006 March, HK
Industrial Automation
SCADA level
Operator
23
2
4
33
12
2
Engineering
Plant bus
Programmable
Logic Controller
Plant Level
Field bus
Field level
Sensor/
Actor
Bus
direct I/O
Sensor /
Industrial Automation
Industrial Automation
Expectations
- reduce cabling
- increased modularity of plant (each object comes with its computer)
- easy fault location and maintenance
- simplify commissioning (mise en service, IBS = Inbetriebssetzung)
- simplify extension and retrofit
- large number of off-the-shelf standard products to build Lego-control systems
- possibility to sell ones own developments (if based on a standard)
Industrial Automation
tray
marshalling
capacity
bar
dumb devices
PLC
(Rangierung,
PLC
COM
field bus
Industrial Automation
Office
network
TCP IP
Ethernet
Plant Network
Ethernet, ControlNet
Fieldbus
intelligent field devices
FF, PROFIBUS PA, LON
Sensor Busses
simple switches etc.
CAN, DeviceNet, SDS, ASI-bus, Interbus-S
1 km .. 5 km
Power Generation
Out of primary energy sources:
waterfalls - coal - gas - oil - nuclear - solar - ...
50 m .. 3 km
Industrial Plants
Manufacturing and transformation plants:
cement works - steel works - food silos - printing - paper
pulp processing - glass plants - harbors - ...
500m .. 2 km
Building Automation
energy - air conditioning - fire - intrusion - repair - ...
1 m .. 1 km
Manufacturing
flexible manufacturing cells - robots
1 m .. 800 m
Vehicles
locomotives - trains - streetcars - trolley buses - vans buses - cars - airplanes - spacecraft - ...
Industrial Automation
Pumps, gates, valves, motors, water level sensors, flow meters, temperature sensors,
gas meters (CH4), generators, are spread over an area of several km2
Some parts of the plant have explosive atmosphere.
Wiring is traditionally 4..20 mA, resulting in long threads of cable (several 100 km).
Industrial Automation
10
Japan
R emote
Maintenanc e
Sy s tem
SCADA
Malaysia
Ethernet
Bus Monitor
H1 Speed Fieldbus
JB
Segment 1
Segment 3
Sub Station
JB
AO
AI
AI
P ID
AI
P ID
AI
AI
AO
AI
AI
AI
AI
PLC
AO
P ID AO
AO
M.C.C.
DI
FB Protoc ol
C onv erter
JB
Segment 2
Segment 4
D igital Input/Output
AI
AI
AI
JB
AI
AI
P ID AI P ID
AO
AO
AI AI
AI
AI
11
2 kbit in 10 ms
Planning of a field bus requires to estimate the data density per unit of length (or surface)
and the requirements in response time and throughput over each link.
Industrial Automation
12
Distributed peripherals
Industrial Automation
13
low cost, low data rate (78 kbit/s), may use power lines (10 kbit/s)
Industrial Automation
14
power line
radio
cockpit
Train Bus
diagnosis
Vehicle Bus
brakes
power electronics
data rate
delay
medium
number of stations
integrity
cost
Industrial Automation
motors
track signals
1.5 Mbit/second
1 ms (16 ms for skip/slip control)
twisted wire pair, optical fibers (EM disturbances)
up to 255 programmable stations, 4096 simple I/O
very high (signaling tasks)
engineering costs dominate
15
Application: automobile
- 8 nodes
- 4 electromechanical wheel brakes
- 2 redundant Vehicle Control Unit
- Pedal simulator
- Fault-tolerant 2-voltage on-board power supply
- Diagnostic System
Industrial Automation
16
Industrial Automation
17
control
center
SCADA
control
center
IEC 870-6
Modicom
IEC 870-5
DNP 3.0
RTU
COM
ICCP
RTU
Conitel
control
center
RP 570
RTU
HV
High
Voltage
RTU
RTU
substation
substation
RTU
RTU
houses
MV
Medium
Voltage
LV
Low
Voltage
RTU
RTU
low speed, long distance communication, may use power lines or telephone modems.
Problem: diversity of protocols, data format, semantics...
Industrial Automation
18
19
Industrial Automation
Automation Industrielle
Industrielle Automation
3.2
Fieldbus - Operation
Industrial Automation
source
Industrial Automation
value
quality
time
description
master
AP
slaves
input
peer-to-peer: distributed
PLC
alternate
master
PLC
AP
AP
input
slaves
PLC
AP
output
masters
PLC
AP
output
Broadcasts
A variable is read on the average in 1..3 different places
Broadcasting messages identified by their source (or contents) increases efficiency.
=
variable
instances
application
processor
application
processor
application
processor
application
processor
plant
image
plant
image
plant
image
plant
image
=
distributed
data base
bus
The replicated traffic memories can be considered as "caches" of the plant state
(similar to caches in a multiprocessor system), representing part of the plant image.
Each station snoops the bus and reads the variables it is interested in.
Industrial Automation
Data format
source
value
quality
time
In principle, the bus could transmit the process variable in clear text (even using XML..)
However, this is quite expansive and only considered when the communication network
offers some 100 Mbit/s and a powerful processor is available to parse the message
More compact ways such as ASN.1 have been used in the past with 10 Mbit/s Ethernet
(see: Presentation Layer)
Field busses are still slow (1Mbit/s ..12 Mbits/s) and therefore more compact
encodings are used.
Industrial Automation
Datasets
Field busses devices had a low data rate and transmit over and over the same variables.
It is economical to group variables of a device in the same frame as a dataset.
A dataset is treated as a whole for communication and access.
A variable is identified within a dataset by its offset and its size
Variables may be of different types, types can be mixed.
Dataset
binary variables
analog variables
dataset
identifier
wheel
speed
0
air
pressure
16
bit offset
Industrial Automation
line
voltage
32
time
stamp
48
64 66
70
size
To allow later extension, room is left in the datasets for additional variables.
Since the type of these future data is unknown, unused fields are filled with '1".
To signal that a variable is invalid, the producer overwrites the variable with "0".
Since both an "all 1" and an "all 0" word can be a meaningful combination, each
variable can be supervised by a check variable, of type ANTIVALENT2:
Dataset
correct variable
error
undefined
variable value
check
0 1 0 1 1 1 0 0
0 1
0 0 0 0 0 0 0 0
0 0
1 1 1 1 1 1 1 1
1 1
00 = network error
01 = ok
10 = substituted
11 = data undefined
chk_offset
var_offset
A variable and its check variable are treated indivisibly when reading or writing
The check variable may be located anywhere in the same data set.
Industrial Automation
decoupled (asynchronous):
application
processor
application
processor
events
(interrupts)
traffic
memory
queues
bus
controller
bus
controller
Traffic Memory
Associative
memory
Bus
Controller
bus
Industrial Automation
10
Freshness supervision
It is necessary to check that the data in the traffic memory is still up-to-date,
independently of a time-stamp (simple devices do not have time-stamping)
The application should always read the value of the counter before using
the port data and compare it with its tolerance level.
The freshness supervision is evaluated by each reader independently, some
readers may be more tolerant than others.
Bus error interrupts in case of severe disturbances are not directed to the
application, but to the device management.
Industrial Automation
11
Note: Usually, only one variable is allowed to raise an interrupt when received: the one
carrying the current time (sent by the common clock)
Industrial Automation
12
t1
t2
processing
input
input
input
t3
t4
bus
t1 val1
Industrial Automation
13
Transmission principle
The previous operation modes made no assumption, how data are transmitted.
The actual network can transmit data
cyclically (time-driven) or
on demand (event-driven),
or a combination of both.
Industrial Automation
14
individual
period
time
hysteresis
limit update
frequency !,
limit hysteresis
15
nevertheless transmit:
- every xx as Im alive sign
- when data is internally updated
- upon quality change (failure)
3.2 Field bus operation
Industrial Automation
16
devices
(slaves)
Poll
List
plant
The master polls the addresses in a fixed sequence, according to its poll list.
Individual period
1
Individual period
6
2 3
N polls
6
2 3
6
time [ms]
2 x Tpd
address
10 s/km
(i)
data
(i)
read transfer
address
(i+1)
time [s]
44 s .. 296 s
Industrial Automation
17
Industrial Automation
18
Source-Addressed Broadcast
Process Data are transmitted by source-addressed broadcast.
Phase1: The bus master broadcasts the identifier of a variable to be transmitted:
bus
master
device
device
sink
source
subscribed devices
sink
devices
(slaves)
sink
bus
variable identifier
Phase 2: The device that sources that variable responds with a slave frame
containing the value, all devices subscribed as sink receive that frame.
bus.
master
subscribed
device
subscribed
device
sink
source
subscribed devices
sink
sink
devices
(slaves)
bus
variable value
Industrial Automation
19
read transfer:
arb
source
address
turn-around
time
next transfer
data
arb
address
time
Read Transfer
write transfer:
master (source)
arb
address
next transfer
data
arb
address
time
destination
master (source)
arb
address
data
turn-around
time
ack
next transfer
arb
address
time
Their link layer or transport layer provides acknowledgements by another write-only transfer
20
Round-tip Delay
master
T_m
t_repeat
t_repeat
The
round-trip
delay limits
the extension
of a read-only
bus
propagation delay
(t_pd = 6 s/km)
T_m
t_source
t_mm
t_ms
(t_repeat < 3 s)
access delay
T_s
t_repeat
t_sm
T_m
distance
Industrial Automation
21
4a
16
4 ms period
1 4b
64
4a
time
1 ms period
(basic period)
1 ms
1 ms
group with
period 1 ms
22
cyclic
poll
cyclic
algorithms
cyclic
algorithms
cyclic
algorithms
cyclic
algorithms
application
1
application
2
application
3
application
4
bus
master
Periodic
List
source
port
Traffic
Memory
Ports
Ports
Ports
sink
port
bus
controller
bus
controller
Ports
sink
port
bus
controller
bus
controller
bus
controller
bus
port address
port data
The bus traffic and the application cycles are asynchronous to each other.
The bus master scans the identifiers at its own pace.
Bus and applications are decoupled by a shared memory, the traffic memory,
which acts as distributed database actualized by the network.
Industrial Automation
23
It is currently used for power plant control, rail vehicles, aircrafts, etc...
This method gives the network a deterministic behavior, at expenses of a reduced
bandwidth and geographical extension.
The poll scan list located in the central master (which may be duplicated for
availability purposes) determines the behavior of the bus.
It is configured for a specific project by a single tool, which takes into account
the transmission wishes of the applications.
This guarantees that no application can occupy more than its share of the bus
bandwidth and gives control to the project leader.
Industrial Automation
24
device
applications
bus
bus instance
Worst-case delay for transmitting all time critical variables is the sum of:
Source application cycle time
8 ms
Individual period of the variable
16 ms
Sink application cycle time
8 ms
= 32 ms
Industrial Automation
25
65 frames of 64 bits
37 of 16 bits
18 of 32
Industrial Automation
32 ms
26
64 ms
128 256
1024
Industrial Automation
27
Event-driven Operation
Events cause a transmission only when an state change takes place.
Bus load is very low on the average, but peaks under exceptional situations
since transmissions are correlated by the process (christmas-tree effect).
Multi-master bus: uses write-only transfers
intelligent
stations
eventreporting
station
eventreporting
station
eventreporting
station
sensors/
actors
plant
Industrial Automation
28
interrupt
Bus
Controller
bus
Industrial Automation
29
Transport
software
Bus
Transport
software
Called
Application
request
interrupt
indication
confirm
time
30
Deterministic
Non-deterministic
Central master,
Token-passing (round-robin),
Binary bisection,
Collision with winner.
Collision
(Ethernet)
Industrial Automation
31
input and
output queues
bus
acknowledgements
data packets
The average delivery time depends on the length of the queues, on the bus
traffic and on the processing time at the destination.
Often, the computers limit far more the event delay than the bus does.
Real-time Control = Measurement + Transmission + Processing + Acting
Industrial Automation
32
Can treat a large number of events - if not all at the same time
Supports a large number of stations
System idle under steady - state conditions
Better use of resources
Uses write-only transfers, suited for LANs with long propagation delays
Suited for standard (interrupt-driven) operating systems (Unix, Windows)
Drawbacks:
Industrial Automation
33
Industrial Automation
34
Process Data
represent the state of the plant
Message Data
represent state changes of the plant
basic period
event
time
sporadic
phase
periodic
phase
Industrial Automation
sporadic
phase
35
periodic
phase
Industrial Automation
36
time-benign
messages
Management
Interface
7
Application
implicit
Presentation
Session
connection-oriented
Transport (connection-oriented)
Network (connectionless)
2"
medium access
2'
media
Physical
implicit
Logical Link
Control
connectionless
connectionless
common
Industrial Automation
37
Periodic Tasks
R1
R2
R3
Event-driven Tasks
R4
E1
Traffic
Memory
(Broadcast)
station
E3
Message Services
Variables Services
Process Data
E2
Queues
Supervisory
Data
Message Data
(destination-oriented)
bus controller
bus
Industrial Automation
38
Fieldbus
Process Bus
strictly deterministic
non - deterministic
cyclic polling
event-driven
Industrial Automation
39
event-driven operation
(periodic, round-robin)
object-oriented bus
message-oriented bus
Industrial Automation
40
Fieldbus: Networking
Industrial Automation
41
Industrial Automation
42
Production
Plant-bus (Ethernet)
Operator bus (Ethernet)
Console,
Section Supervision
LS LS LS PM
LS LS LS PM
LS LS LS PM
LS LS LS PM
Printing Towers
Section Control
D
SSB
SSC
SSD
SSE
RPB
RPC
RPD
RPE
multiplicity of field busses with different tasks, often associated with units.
main task of controllers: gateway, routing, filtering, processing data.
most of the processing power of the controllers is used to route data
Industrial Automation
43
(Ethernet)
bridge
standby
LS
LS
LS
PM
PM
standby
GW
GW
Pressmasterbus (Ethernet)
V-Sercos
IBG
V-Sercos
IBG
Section bus C
V-Sercos
IBG
V-Sercos
IBG
H-Sercos
H -steuerungen
IBG
IBG
IBG
Interbus
Interbus
Interbus
KT94
KT94
KT94
KT94
KT94
KT94
KT94
KT94
KT94
KT94
KT94
KT94
KT94
KT94
Service-Arcnet
Tower-ARCnet
Section bus B
Section bus C
Line bus
Turmsteuerung
AC160
Turmsteuerung
AC160
Turmsteuerung
AC160
Falz- und
Wendeturm- AC160
steuerung
Section bus D
Rollenwechslerkoppler I KT94
Oxydry-Arcnet
MR93
Sektions- SektionsAC160
steuerung steuerung
Rollenwechslerkoppler A
Interbus-S
KT94
ODC
Oxydry
Auro
ARCnet
Industrial Automation
44
copying,
filtering &
marshalling
delay
gateway
gateway
Feeder Bus
copying,
filtering &
marshalling
delay
Feeder Bus
stop
speed
speed
stop
Industrial Automation
32 ms
16 ms
25 ms
10 ms (synchronized)
32 ms
45
= 100 ms
2006 March, HK
Industrial Automation
Automation Industrielle
Industrielle Automation
2005 April, HK
Industrial Automation
Partnerbus
P-net
* Profibus-FMS
Profibus-PA
Profibus-DP
PDV
* SERCOS
SDS
Sigma-i
Sinec H1
Sinec L1
Spabus
Suconet
VAN
WorldFIP
ZB10
...
User*
Application
Sponsor
CANs
25%
Profibus (3 kinds)
26%
Process control
Siemens, ABB
Building systems
Echelon, ABB
LON
6%
Ethernet
50%
Plant bus
Interbus-S
7%
Manufacturing
7%
Chemical Industry
ASI
9%
Building Systems
Modbus
22%
obsolete point-to-point
ControlNet
14%
plant bus
all
Phoenix Contact
Fisher-Rosemount, ABB
Siemens
many
Rockwell
Sum > 100%, since firms support more than one bus
European market in 2002: 199 Mio , 16.6 % increase (Profibus: 1/3 market share)
Industrial Automation
10,000
1000
frame size
(bytes)
100
Sensor Bus
Simple devices
Low cost
Bus powered (?)
Short messages (bits)
Fixed configuration
Not intrinsically safe
Twisted pair
Max distance 500m
Honeywell
PV 6000
SP 6000
AUTO
1
10
10
100
1000
10,000
source: ABB
fluid
sensor
flow
transducer
i(t) = f(v)
RL1
reader
reader
R1
i(t) = 0, 4..20 mA
RL2
RL4
R2
voltage
source
10V..24V
RL3
R3
RL4
conductor resistance
3.3.2 HART
2005 April, HK
HART - Principle
HART (Highway Addressable Remote Transducer) was developed by Fisher-Rosemount to
retrofit 4-to-20mA current loop transducers with digital data communication.
HART modulates the 4-20mA
current with a low-level
frequency-shift-keyed (FSK)
sine-wave signal, without
affecting the average analogue
signal.
HART uses low frequencies
(1200Hz and 2200 Hz) to deal
with poor cabling, its rate is
1200 Bd - but sufficient.
HART uses Bell 202 modem
technology, ADSL technology
was not available in 1989, at
the time HART was designed
Transmission of device characteristics is normally not real-time critical
Industrial Automation
HART - Protocol
Hart communicates point-to-point, under the control of a master, e.g. a hand-held device
Master
Slave
Indication
Request
time-out
Response
Confirmation
start
address
5..20
(xFF)
1..5
Industrial Automation
command bytecount
1
10
[status]
data
data
[2]
0..25
(slave response) (recommended)
checksum
1
HART - Commands
11
HART - Importance
more info:
http://www.hartcomm.org/
http://www.thehartbook.com/default.asp
Industrial Automation
12
3.3.3 ASI
2005 April, HK
D0 = sensor 1
one connection
D1 = sensor 2
D2 = actuator 1
AS-Interface
Slave IC
1 module
enclosure
D3 = actuator 2
P0
Watchdog
energy
up to 4 sensors
or/and
4 actuators
vampire-connector
Industrial Automation
14
master-slave principle
up to 31 slaves on one line
cycle time < 5 ms
controller
master
To Slave 1
To Slave 2
Slave 1
Slave 2
Industrial Automation
To Slave 31
Slave 31
To Slave 1
Slave 1
15
master calls
slave response
star
line
controller
controller
Master
controller
controller
Master
Master
Master
Slave
Slave
Slave
Slave
tree
branch lines
Slave
Slave
Slave
Slave
Slave
Slave
Slave
Slave
Slave
Slave
Slave
Slave
Slave
Slave
Slave
Slave
Industrial Automation
16
3.3.4 Interbus-S
2005 April, HK
Master
BA
remote "bus"
(ring)
BA
400 m between
devices
BC IO IO IO
5-wire
bus coupler
Industrial Automation
18
+ standard in CENELEC
+ easy to engineer
sensitive to misplacement
+ conformance test
Industrial Automation
19
3.3.5 CAN
Automotive bus
2005 April, HK
Supporters
Standard
Medium
Medium redundancy
Connector
Distance
Repeaters
Encoding
User bits in frame
Mastership
Mastership redundancy
Link layer control
Upper layers
Application Protocols
Chips
Industrial Automation
21
3.3.6 Profibus
2005 April, HK
Profibus - Family
Industrial Automation
24
Profibus - Stack
FMS
FMS
device
profiles
DP
PA
DP-profiles
PA-profiles
DP basic functions
Upper layers
Fieldbus
Messaging
Specification
Link
Phy
IEC interface
RS 485
Industrial Automation
Fibre optics
25
IEC 61158-2
Industrial Automation
bus
TWP @ 31.25 kbits/s (intrinsic safety), 10 devices (PA)
RS 485 @ 19.2 kbit/s.. 500 kbit/s (FMS)
RS 485 or fibres @ 1.5 Mbit/s (12 Mbit/s) (DP)
PA: Manchester II, preamble, delimiters
DP, FMS: UART 11 bit/character
CRC8, HD = 4
none under normal conditions
not supported by the controller
DP: central master, cyclic polling (see: 3.1.2)
FMS, PA: token passing
dedicated chips for 12 Mbit/s
can use UART interface on most processors directly
depends on number of slaves (cyclic, not periodic)
8 bit device address
up to 512 bits in Process Data, 2048 bits in messages
SDN
SDA
SRD
CSRD
Profibus - Analysis
Industrial Automation
3.3.7 LonWorks
2005 April, HK
Communication chip
Medium redundancy:
Signalling:
bus
STP 150 Ohm @ 1.25 Mbit/s 300m, transformer-coupling
UTP 100 Ohm, @ 78 kbit/s, 1300m, transformer-coupling
reduced to 100m with free topology
power line carrier @ 9.6 kbit/s, limited by -55dB
radio @ 4.9 kbit/s
Neuron chip (Motorola, Hitachi)
none
Differential Manchester for STP, UTP
Medium access:
Response Time
Address space
Frame size (useful data)
Integrity
Higher-level protocols
Application
Support
p-persistent CSMA/CD
3 ms (single call/reply), 400 exchanges/s @ 1.25 Mbit/s
32385 stations
up to 1824 bits
CRC16, HD = 2 against steps, =1 against sync slips)
full 7-layer stack
programmed in Neuron-C
LONMark group (www.echelon.com)
Topography:
Medium:
Industrial Automation
29
network management
Session Layer
request-response
Transport Layer
acknowledged and unacknowledged, unicast and multicast
Authentication
server
Transaction Control Sublayer
common ordering and duplicate detection
Network Layer
connectionless, domain-wide broadcast,
no segmentation, loop-free topology, learning routers
Link Layer
connectionless frame transfer,
framing, data encoding, CRC error detection
MAC sublayer
predictive p-persistent CSMA: collision avoidance;
optional priority and collision detection
Physical Layer
multiple-media, medium-specific protocols (e.g. spread-spectrum)
Industrial Automation
30
no conformance testing
31
3.3.8 Ethernet
Industrial Automation
33
SCADA
switch
Ethernet
PLC
PLC
PLC
Fieldbus
simple
devices
Ethernet as Fieldbus
(trendy)
SCADA
switch
Ethernet
costly field devices
Soft-PLC as concentrators
Event-driven operation
Soft-PLC
Soft-PLC
Soft-PLC
Soft-PLC
34
35
local I/O
CPU
fieldbus
Ethernet
Industrial Automation
36
www.can.bosch.com
www.flexray-group.com
www.tttech.com
Industrial Automation
37
Car network
extreme low cost, low data rate (100 kbit/s) for general use (power slides)
extreme reliability, excellent real-time behavior for brake-by-wire or drive-by-wire
Industrial Automation
38
Mbit/s
50.0
20.0
FlexRay (10 Mbit/s)
10.0
D28, MOST
Token-Ring
optical bus
byteflight
(10 Mbit/s)
5.0
TTP
TDMA, fault-tolerant
2 x 2 wire, 2 Mbit/s
2.0
1.0
CAN-A
2-wire
1 Mbit/s
0.5
MVB
CAN-B
fault-tolerant
0.2
0.1
J1850
0.05
0.02
LIN
Master-Slave
1-wire, not clocked
1
Industrial Automation
5
39
10
20 / node
3.3 Standard Field Busses
Wireless fieldbus
Disadvantages:
Base stations are still costly,
work in disturbed environments and metallic structures costs
mobile = batteries
distance = 30m in factories
lifetime > 5 years ?
privacy
Industrial Automation
40
Wireless Technologies
costs
high
GPRS
medium
WLAN
low
bluetooth
0.1
10
100 Mbit/s
source: aktuelle Technik, 4/05
Industrial Automation
41
www.fieldbus.org
www.iec.ch
www.interbusclub.com
www.nfpa.org
www.odva.org
www.phoenixcon.com
www.pilz.com
www.profibus.com
www.roboticsonline.com
www.rockwellautomation.com
www.safetybus.com
www.tuv.org
Industrial Automation
42
Non- time critical busses are in danger of being displaced by LANs (Ethernet)
and cheap peripheral busses (Firewire, USB)
In reality, these "cheap" solutions are being adapted to the industrial environment
and become a proprietary solution (e.g. Siemens "Industrial Ethernet")
The cost objective of field busses (less than 50$ per connection) is out of reach for
LANs.
The cabling objective of field busses (more than 32 devices over 400 m) is out of reach
for the cheap peripheral busses such as Firewire and USB.
Fieldbusses tend to live very long (10-20 years), contrarily to office products.
There is no real incentive from the control system manufacturers to reduce the
fieldbus diversity, since the fieldbus binds customers.
The project of a single, interoperable field bus defined by users (Fieldbus Foundation)
failed, both in the standardisation and on the market.
Industrial Automation
43
Deterministic behavior
Device and network configuration tools
Bus monitor (baseline and application level) tools
Integration in development environment
Industrial Automation
44
Industrial Automation
Automation Industrielle
Industrielle Automation
4 Access to devices
4.3 OLE for Process Control (OPC)
4.3.1 Common elements
2006 May, HK
Executive Summary
OPC is a set of standard commands collected in a software library (DLL) that can be called by
client applications, written in Visual Basic, C# or other Microsoft programming languages, that allow
to access automation devices (PLCs) in a uniform way, independently from their built or
manufacturer.
To that effect, the particularities of the automation devices are hidden by an OPC server running
either on the same machine as the client program or on another machine, by using DCOM. The
OPC Servers are supplied by the manufacturer of the PLC or by 3rd parties and can manage
several PLCs of the same type. Several servers can run in parallel.
The OPC library allows in particular to read and write process variables, read alarms and events
and acknowledge alarms, and retrieve historical data from data bases according to several criteria.
Automation platforms such as ABB's 800XA platform act as OPC clients to collect data from PLCs
or databases through third-party OPC servers. Several automation platforms act themselves as an
OPC server to publish their data, events and historical data.
OPC is the preferred connectivity for 78% of MES, 75% of HMI / SCADA, 68% of DCS / PLC and
53% or ERP /Enterprise system level applications (according to Arc Advisory Group, 2004)"
2/32
OPC Common
Overview: usage and specifications
OPC as an integration tool
Clients and Servers: configuration
Automation and Custom Interface
OPC Data Access
Overview: Browsing the server
Objects, Types and properties
Communication model
Simple Programming Example
Standard and components
3/32
What is OPC ?
OPC (formerly: "OLE1 for Process Control", now: "Open Process Control") is
an industry standard set up by the OPC Foundation
specifying the software interface (objects, methods) to a server that
collects data produced by field devices and programmable logic controllers.
interfaces
covered by the
OPC standard
application
(OPC client)
OPC server
X
OPC server
(simulator)
Ethernet
(not covered)
node
servers
OPC server
Y
Field bus
(not covered)
PLCs Brand X
PLCs Brand Y
Sensors/Actors
1) OLE (Object Linking and Embedding) is a Microsoft technology for connecting software components.
It has since been extended by the COM / DCOM technology. It corresponds to Java Beans.
Industrial Automation
4/32
Before OPC
visualization
history
data base
MasterBus
MMS driver
ABB PLCs
Industrial Automation
XWAY
driver
Profinet
driver
Tlmcanique PLCs
5/32
Siemens PLCs
4.3.1 OPC Common
Historian
(Information
Manager)
application software is
written independently from
the type of controller
ABB AC800M
Industrial Automation
AC800M
OPC server
Schneider
OPC server
Siemens
OPC server
MMS
XWAY
ProfiNet
Tlmcanique TSX
6/32
Siemens S7
4.3.1 OPC Common
Importance
Industrial Automation
7/32
OPC
DX
OPC
Batch
OPC
HDA
batch
system
history
data base
OPC
Data Access
OPC
Alarms & Events
OPC
UA
Industrial Automation
8/32
Process variables can be sent upon a change, on demand or when a given time elapsed.
The OPC DA (Data Access) specification addresses collecting Process Variables.
The main clients of OPC DA are visualization and (soft-) control.
Industrial Automation
9/32
Events are changes in the process that need to be logged, such as "production start"
Alarms are abnormal states in the process that require attention, such as "low oil pressure"
OPC AE (Alarms and Events) specifies how alarms and events are subscribed, under
which conditions they are filtered and sent with their associated messages.
The main clients of OPC AE are the Alarms and Event loggers.
determine the exact time of change
(time stamping)
categorize by priorities
log for further use
acknowledge alarms
(events are not acknowledged)
link to clear text explanation
Industrial Automation
10/32
Industrial Automation
11/32
consists of an
ordered set of
allows to access:
Unit
Procedure
equipment capabilities,
current operating conditions,
historical and
recipe contents
consists of an
ordered set of
Operation
consists of an
ordered set of
Phase
Industrial Automation
12/32
In a move to get more independence from Microsoft and use web technology,
a new specification called " Unified Architecture" (formerly. OPC XML) that uses web
services for all kinds of transactions: query, read, write, subscribe,...
The classical OPC DA, AE and HDA are implemented with XML / SOAP /WSDL
this allows encryption and authentication of process data.
This does not only standardize the interfaces, but also the transmitted data.
Industrial Automation
13/32
14/32
OPC as a hub
Industrial Automation
15/32
application
(OPC client)
OPC server
ODBC
DB
Industrial Automation
16/32
ABB's Integration Platform (AIP) is at the same time an OPC server and an OPC client.
Components (aspects) within AIP expose their properties as OPC objects.
Internal (within AIP) and external communication takes place over OPC.
AIP
aspects
aspects
aspects
aspects
Asset
Optimizer
Enterprise
Historian
OPC server
process
data base
OPC
connections
OPC client
AC800M
OPC server
Industrial Automation
Schneider
OPC server
17/32
Siemens
OPC server
4.3.1 OPC Common
Industrial Automation
18/32
Explorer:
Several tools are available on the market to browse OPC servers, especially:
Industrial Automation
19/32
20/32
OPC server
devices
client application
(OPC client)
OPC server
devices devices
OPC server
devices
The OPC specification defines the interface between client and server in the form
of objects and methods.
Industrial Automation
21/32
fieldbus connection
client application
(OPC client)
clients and
servers run as
parallel
processes
(local)
OPC server
FB Manager
fieldbus
proprietary
protocol
I/O devices
Industrial Automation
can also be
a point-topoint link
22/32
fieldbus
fieldbus
FB agent
FB agent
PLC
PLC
client application
(OPC client)
stub
DCOM
TCP/IP
DCOM
Limitation:
does not work over firewalls.
Solution:
OPC XML (see later)
Industrial Automation
TCP/IP
TCP/IP
DCOM
DCOM
OPC
server
OPC server
FB Manager
fieldbus
23/32
app3 TCP/IP
OPC server
for BrandZ
TCP/IP
node 1
application 2
(OPC client)
application 1
(OPC client)
OPC server
for BrandY
OPC server
for BrandX
Fieldbus
Y
Fieldbus X
panel
OPC server
for simulation
drivers
24/32
Matrikon
client
separate
processes
IEC 61131
Programming
Environment
config
files
(Control Builder)
user panels
AC800
OPCserver
OPCServer
config
MMS
MMS Panel
TCP/IP
by FTP or internal
Ethernet
TCP/IP
MMS
PLC variables
25/32
OPC Technology
OPC Common
Overview: usage and specifications
OPC as an integration tool
Clients and Servers: configuration
OPC Technology, client and custom interface
OPC Data Access
Overview: Browsing the server
Objects, Types and properties
Communication model
Simple Programming Example
Standard and components
26/32
client
2) different processes
same computer
client
3) different computers
client
library
(DLL)
stub
proxy
local
procedure
call
local
procedure
call
stub
remote
procedure
call
memory
TCP/IP
27/32
proxy
network
library
library
remote
procedure
call
TCP/IP
OPC technologies
ActiveX
Object Linking and
Embedding (OLE)
Transport
(TCP-IP, UDP, Queued)
Ethernet
OPC bases on Microsoft's COM/DCOM technology (i.e. it only works on Windows platforms).
Effort to port it to other platforms (Linux) and web transport protocols (XML) are in progress.
Advantages are the direct integration into all applications, such as Excel.
Industrial Automation
28/32
graphical interface
business logic
Industrial Automation
29/32
OPC/COM Interfaces
OPC Group & Item Management
Industrial Automation
30/32
"Custom" client
(C++,.)
OPC Automation
wrapper
custom interface
custom interface
server
server
Industrial Automation
server
31/32
Industrial Automation
Automation Industrielle
Industrielle Automation
4 Access to devices
4.3 OLE for Process Control (OPC)
4.3.2 Data Access Specification
2005 May, HK
2/48
4.3.2 OPC DA
To probe further.
OPC Foundation:
Specifications http://www.opcfoundation.org
SoftwareToolbox
Examples in Visual Basic
http://www.softwaretoolbox.com/Tech_Support/TechExpertiseCenter/OPC/opc.html
Matrikon
Free client and server:
http://www.matrikon.com
WinTech
Toolkit for an OPC server
http://www.win-tech.com/html/opcstk.htm
NewAge Automation
Toolkit for an OPC server
http://www.newageautomation.com
Industrial Automation
3/48
4.3.2 OPC DA
OPC DA Client
e.g. visualization
OPC DA Client
e.g. performance
indicator
OPC DA
specified
interface
OPC DA Server
An OPC DA Server
is configured using
the information
coming from the
development tools
for the controllers
Variables defined
in the controllers
are mirrored to the
OPC DA server
e.g. Ethernet
tags
controllers
controller
controller
field bus
plant
measurement
points
Industrial Automation
field devices
4/48
4.3.2 OPC DA
controller development
OPC application
Reactor_1.Program2
ReadItem
("OPC:Reactor1:
Program2.MotorSpeed")
Value: 112
OPC
server
load
symbol
table
MW%1003
MotorSpeed
MW%1004
Temperature
symbols
code
Network
Reactor_1
Marker: MW%1003
Industrial Automation
Oven controller
5/48
4.3.2 OPC DA
Process Line 1
Tag Name
Controller 1
Controller 2
Controller_3.Prog_1
Controller_3.Prog_2
TAG
Level_1
TAG
Level_2
TAG
Ramp4
Cell 1
Machine 2
Industrial Automation
6/48
4.3.2 OPC DA
showBranches
showLeafes *
GetItemID : retrieves the fully qualified item ID (see later)
Optional:
GetAccessPath: retrieves the access path for items that can be accessed over different ways.
The Access Path is an optional information that the client may provide regarding how to get to the
data, where several possibilities exist. Its use is highly server specific. Do not confound with
hierarchical path.
(*the English error is unfortunate)
Industrial Automation
7/48
4.3.2 OPC DA
Example:
an item reached as:
needs to be accessed internally as:
Root.SimulatedItems.UserDefined.Ramp.Ramp1
UserDefined!Ramp.Ramp1
Industrial Automation
8/48
4.3.2 OPC DA
clients
Client1
GroupX
Client2
GroupZ
server
Area 1
TAG
Temperature
TAG
Heat_On
TAG
Level
Area 2
TAG
Empty_Valve
Area 51
TAG
Fill_Valve
Oven_1
Tank_1
Industrial Automation
9/48
4.3.2 OPC DA
client 2
group2
1, 76584
2, 87689
3, 23443
3, 53664
4, 43222
client1
The fully qualified item
is not sufficient to identify
an item, a client may
subscribe the same item
in different groups
3, 54
2, 1201
group1
1, 1
2, 2
3, 3
client2
x
2, 2
3, 1202
1,1
2, 2
Industrial Automation
10/48
4.3.2 OPC DA
11/48
4.3.2 OPC DA
numerical or text
time-stamp:
the time at which this data was transmitted from the PLC to the server
this time is UTC (Greenwich Winter time), not local time.
quality:
Industrial Automation
12/48
4.3.2 OPC DA
Boolean,
Character,
Byte,
(1 byte)
Word, (2 bytes)
Double Word, (4 bytes)
Short Integer (2 bytes)
Integer (4 bytes)
Long Integer:
Long Unsigned Integer
Single Float (4 bytes)
Double Float (8 bytes)
Currency,
Date,
String,
Array of "the above"
Industrial Automation
13/48
4.3.2 OPC DA
14/48
4.3.2 OPC DA
client
myGroup.SynchWrite()
server
Call
client
myGroup.AsyncWrite()
Reply
server
Call
Reply
myGroup_AsyncWriteComplete()
Industrial Automation
15/48
4.3.2 OPC DA
asynchronous
server
client
Call
myGroup.AsyncRead()
Reply
server
Call
Reply
myGroup_AsyncReadComplete()
client
myGroup.IsSubscribed
on change
("subscription-based")
server
Subscribe
Notify
myGroup_DataChange()
Notify
myGroup_DataChange()
Industrial Automation
16/48
4.3.2 OPC DA
server
Subscribe
Notify
myGroup_DataChange()
Notify
myGroup_DataChange()
myGroup.Refresh()
Notify
myGroup_DataChange()
17/48
4.3.2 OPC DA
client application
(OPC client)
OPC server
cache
server samples items
(at the RequestedUpdateRate)
and puts them into cache
FB manager
fieldbus
proprietary
protocol
fieldbus connection
Industrial Automation
fieldbus
fieldbus
device
device
FB agent
FB agent
18/48
4.3.2 OPC DA
range
deadband
min
time
Industrial Automation
19/48
4.3.2 OPC DA
OPC DA Client
OPC DA Server
Industrial Automation
20/48
4.3.2 OPC DA
21/48
4.3.2 OPC DA
OPCServer
OPCGroups (collection)
OPCGroup
OPCGroup
OPCItems (collection)
OPCItem
OPCItem
OPCItem
OPCBrowser
Industrial Automation
22/48
4.3.2 OPC DA
Industrial Automation
23/48
4.3.2 OPC DA
myDummyServer.GetOPCServers
myServer.Connect
next
group
myGroup1.AddItems
myGroup1.IsActive
myGroup1.IsSubscribed
Industrial Automation
FQItems1[1] = "Device1.Temp1"
ClientHandle1[1] = 101
ReDim ServerHandle1(nrItems)
ReDim ServerErrors1(nrItems)
ReDim Value1(nrItems)
24/48
4.3.2 OPC DA
Option Base 1
Dim WithEvents MyServer
Dim WithEvents MyGroups
Dim WithEvents MyGroup
' items
Dim nrItems
As
Dim MyItems
Dim MyItem
Dim ItemsID(2)
Dim ClientHandles(2)
Dim ServerHandles()
Dim ServerErrors()
As OPCServer
As OPCGroups
As OPCGroup
Integer
As OPCItems
As OPCItem
As String
As Long
As Long
As Long
'OPC
'OPC
'OPC
'OPC
25/48
4.3.2 OPC DA
The GetOPCServers function applied to a dummy Server object allow to list the existing
servers on this node or on another node (over DCOM - security must be set correctly).
The information about which OPC servers exist is taken from the registry, where it has been p
by each server at its installation time
Private Sub ShowServers(netNodeName As String)
Dim dummyServer As OPCServer
Dim Servers As Variant
Dim cntServers As Integer
Industrial Automation
26/48
4.3.2 OPC DA
Before connecting, it is safe to check the name of the server from the server's list.
Also, it is preferable to include the connection in a separate routine since it can fail:
Function ServerGetCare(Name As String, ServerNode As String) As OPCServer
On Error GoTo ServerGetCareErr
Dim MyOPCServer As New OPCServer
MyOPCServer.Connect ServerName, ServerNode ' connect risky
Set ServerGetCare = MyOPCServer
Exit Function
ServerGetCare_Err:
Err.Clear
MsgBox "Could not connect"
Set MyServer = Nothing
Exit Function
Industrial Automation
27/48
4.3.2 OPC DA
MyBrowser.ShowBranches
For Each vName In MyBrowser
MsgBox "Branch: " & vName
Next vName
MyBrowser.ShowLeafs
For Each vName In MyBrowser
MsgBox "Leaf: " & vName
Next vName
Industrial Automation
28/48
4.3.2 OPC DA
MyBrowser.MoveDown (strBranch)
MyBrowser.MoveUp
Server root
server
Site A
TAG
site properties
Tank
Machine Room
TAG
Level
TAG
Temperature
TAG
Valve_On
Wash Room
Grinder
Climate
Store
There may be leaves at every branch, since a branch may have properties
Industrial Automation
29/48
4.3.2 OPC DA
To get the "fully qualified itemID", one positions the browser at the place where the
leaf is attached to the branch and calls GetItemID
myOPCBrowser.MoveDown("TankArea")
myOPCBrowser.MoveDown("Tank1")
FQI = myOPCBrowser.GetItemId ("Level")
Industrial Automation
30/48
4.3.2 OPC DA
FQItemIDs(1) = "Area2.Tank1.Level"
ClientHandles(1) = 5
FQItemIDs(2) = "Area2.Tank1.Temperature"
ClientHandles(2) = 6
nrItems = 2
'
'
'
'
MyItems.AddItems _
nrItems, _
FQItemIDs, _
ClientHandles, _
ServerHandles, _
ServerErrors
'
'
'
'
'
'
MyGroup1.ClientHandle = 1
MyGroup1.IsActive = True
MyGroup1.IsSubscribed = True
31/48
4.3.2 OPC DA
returned by server
when registering
dynamic changes
(refreshed on change)
Value
Quality TimeStamp
"Channel1.Device1.Temp1"
100
34543
123.4
OK
12:09.234
"Channel1.Device1.Speed1"
102
22532
999.8
OK
12:02.214
"Channel1.PLC2.Door"
203
534676
OK
12:03.002
"Channel1.PLC2.Valve3"
204
787234
OK
12:02.345
"Channel1.PLC2.CloseDoor"
205
58432
BAD
12:02.345
..
..
..
..
..
..
32/48
4.3.2 OPC DA
thisGroup As OPCGroup
cntItems As Integer
source As Integer
serverHandles(2) As Long
values() As Variant
errors() As Long
serverHandles(1) =
serverHandles(2) =
client
myGroup.SynchRead()
server
Call
Reply
ServerHandle(11) ' copy from global variables
ServerHandle(14)
source = OPCcache
thisGroup.SyncRead
source,
nrItems,
serverHandles,
values,
errors
Industrial Automation
33/48
4.3.2 OPC DA
server
client
AsyncRead()
Call
Reply
AsyncReadComplete()
Private Sub Mygroup_AsyncReadComplete (
ByVal TransactionID As Long,
ByVal NumItems As Long,
ClientHandles() As Long,
ItemValues() As Variant,
Qualities() As Long,
Asynchronous read separates Call and Reply.
TimeStamps() As Date,
Errors() As Long)
Industrial Automation
34/48
4.3.2 OPC DA
client
Call
Reply
AsyncReadComplete()
AsyncCancel ()
AsyncCancelComplete ()
Although the AsynchReadComplete carries the ClientHandle of each item,
it does not tell which AsynchRead caused the AsynchReadComplete event to fire.
Call and Reply are linked by the TransactionID: this ID is returned in AsynchReadComplete
It can also be used to cancel the operation
Industrial Automation
35/48
4.3.2 OPC DA
To UBound(ClientHandles)
' index 1..n
= ItemValues(cntItems)
' display
= DateAdd("h", 9, TimeStamps(cntItems))
= Qualities(cntItems)
End Sub
36/48
4.3.2 OPC DA
Industrial Automation
37/48
4.3.2 OPC DA
Industrial Automation
38/48
4.3.2 OPC DA
This event signals to the client that the server shut down.
The client must declare its server WithEvents and provide the corresponding event
Subroutine
This should stop all actions, otherwise exceptions will occur.
Industrial Automation
39/48
4.3.2 OPC DA
Industrial Automation
40/48
4.3.2 OPC DA
41/48
4.3.2 OPC DA
There exist three versions of DA, 1.0, 2.0 and 3.0, that behave differently, however, older
servers do not have a property indicating which version they support.
Industrial Automation
42/48
4.3.2 OPC DA
Industrial Automation
IOPCDataCallback
IOPCServerShutdown
OPC
client
OPC
server
IOPCItemMgt
IOPCGroupStateMgt
[IOPCPublicGroupSteatMgt]
IOPCSyncIO
IOPCAsyncIO2
IConnectionPointContainer
IEnumOPCItemAttributes
IOPCSyncIO
IDataObject
43/48
OPC
group
4.3.2 OPC DA
DA 1.0
DA 2.0
DA 3.0
OPCGroup
IUnknown
Required
Required
Required
IOPCItemMgt
Required
Required
Required
IOPCGroupStateMgt
Required
Required
Required
IOPCGroupStateMgt2
N/A
N/A
Required
IOPCPublicGroupStateMgt
Optional
Optional
N/A
IOPCSyncIO
Required
Required
Required
IOPCSyncIO2
N/A
N/A
Required
IOPCAsyncIO2
IOPCAsyncIO3
N/A Required
N/A
Required
N/A
Required
IOPCItemDeadbandMgt
N/A
N/A
Required
IOPCItemSamplingMgt
N/A
N/A
Optional
IConnectionPointContainer
N/A
Required
Required
IOPCAsyncIO
IDataObject
Required
Required
Optional
Optional
N/A
N/A
Industrial Automation
44/48
4.3.2 OPC DA
Required Interfaces
1.0
2.0
3.0
OPCServer
IOPCServer
Required
Required
Required
IOPCCommon
IConnectionPointContainer
N/A Required
N/A
Required
Required
Required
IOPCItemProperties
IOPCBrowse
N/A Required
N/A
N/A
N/A
Required
IOPCServerPublicGroups
Optional
Optional
N/A
IOPCBrowseServerAddressSpace
Optional
Optional
N/A
IOPCItemIO
N/A
N/A
Required
Industrial Automation
45/48
4.3.2 OPC DA
Industrial Automation
Automation Industrielle
Industrielle Automation
4 Access to devices
4.3 OLE for Process Control (OPC)
4.3.3 Alarms & Events
2005 May, HK
AE: Overview
OPC Common
Overview: usage and specifications
OPC as an integration tool
Clients and Servers: configuration
OPC Technology, client and custom interface
OPC Data Access
Overview: browsing the server
Objects, types and properties
Communication model
Simple Programming Example
Standard and components
2/32
To probe further.
OPC Foundation:
Specifications http://www.opcfoundation.org
SoftwareToolbox
Examples in Visual Basic
http://www.softwaretoolbox.com/Tech_Support/TechExpertiseCenter/OPC/opc.html
Matrikon
Free client and server:
http://www.matrikon.com
WinTech
Toolkit for an OPC server
http://www.win-tech.com/html/opcstk.htm
NewAge Automation
Toolkit for an OPC server
http://www.newageautomation.com
Industrial Automation
3/32
AE: Configuration
OPC AE Client
e.g. event logger
OPC A&E
specified
interface
OPC AE Client
e.g. alarm printer
OPC AE Server
An OPC AE Server
is configured using
the information
coming from the
development tools
for the controllers
Events defined in
the controllers are
mirrored to the
OPC AE server
event notification
e.g. Ethernet
events
controllers
controller
controller
field bus
plant
measurement
points
Industrial Automation
field devices
4/32
AE: Purpose
The controllers (PLC) generate events in response to changes in the plant variables.
together with their precise time of occurrence, type, severity and associated message for
the human operator.
An OPC Event server registers these events and makes them available to several clients
A particular class of events are the alarms, which are detailed events that may require
acknowledgement.
The OPC Alarms & Events Interface gives access to the OPC Event server, allowing to:
- browse the OPC A&E Server for predefined events.
- enable or disable alarms and events
- subscribe to alarms and events of interest
- receive the event and alarm notifications with the associated attributes
- acknowledge alarms
Industrial Automation
5/32
AE: Definitions
An event is a general change of state that is relevant to the OPC server.
An event signal a change:
1) in the field device ("production started")
2) in the OPC server ("alarm acknowledged")
3) in the application ("operator action")
An alarm is a state of the process that requires attention and is relevant to the OPC server.
An alarm is represented by an alarm condition, (or short: condition), a state machine
indicating if the alarm has been enabled, triggered or acknowledged.
An event or an alarm does not transmit analogue process values,
but they transmit information about their origin, the time of their occurrence and a message
intended for a human operator.
Alarms and events may not get lost
(contrarily to OPC DA, which does not guarantee completeness)
Industrial Automation
6/32
OPC AE Client
OPC AE
Client
OPC AE
Server
12:34 23.114
12:34 32.334
Industrial Automation
7/32
Ack
checkbox
Industrial Automation
8/32
leaves
Areas
A23
Sources
(objects)
Events
A24
S1
E1
S2
S3
E2
E1
E2
E2
E3
simple
tracking
condition
related
condition
related
condition
related
C2
C2
C2
properties
Conditions (alarms only)
SC1
SC1
SC3
SC1
An event is identified by a source (owner object in the controller) and an event name
this combination must be unique in the AE Server.
Industrial Automation
9/32
root
Area 1
Source 1
Area 2
Source 2
Area 5
Source 3
Area 51
Area 52
Alarms and Event are organized by area, which themselves may contain other areas.
Contrarily to branches in OPC DA, area and sources have properties that allow to
disable or enable events or alarms by area or by source, corresponding to parts of the
plants, rooms or specific equipment of the plant.
Industrial Automation
10/32
Like all other OPC Servers, an OPC A&E presents an interface that allows the client to
browse the server to explore its structure, with the methods:
BrowseOPCArea
ChangeBrowsePosition (up, down, root)
GetQualifiedAreaName
GetQualifiedSourceName
There is no "GetQualifiedItemID, since the condition name is known from the source.
Industrial Automation
11/32
AE: Events
OPC Common
Overview: usage and specifications
OPC as an integration tool
Clients and Servers: configuration
OPC Technology, client and custom interface
OPC Data Access
Overview: browsing the server
Objects, types and properties
Communication model
Simple Programming Example
Standard and components
12/32
1.
2.
3.
Industrial Automation
13/32
HiLevelCond
event
HiLevelCond
event
LoLevelCond LoLevelCond
event
Tank1
Industrial Automation
Tank2
event
HiLevelCond
event
LOLevelCond
event
Tank3
14/32
Industrial Automation
15/32
AE Client
Tank1LevelHigh_SimpleEvent
(source, timestamp, message,
severity, category)
OPC AE
Server
queue
event notification
message
timestamp
Controller
Event
FB
Tank1
Plant
Level Switch
Industrial Automation
16/32
Industrial Automation
17/32
all events
condition
-related
events
Property
Source
Time
Message
EventCategory
Severity
OPCEventAttribute
Meaning
source object (area + source)
time of occurrence
associated message for the operator
user-defined
priority (1..1000)
ConditionName
SubCondition
ChangeActiveState
ChangeAckState
ChangeEnableState
ChangeQuality
ChangeSeverity
ChangeSubCondition
ChangeMessage
ChangeAttribute
ConditionAction
ConditionAcknowleddged
Quality
AckRequired
ActiveTime
Cookie
ActorID
Industrial Automation
18/32
19/32
Active:
Acknowledged:
Alarm signal
(e.g. FIC101.PV > 100 AND FIC101.PV < 150)
Condition
Acknowledgement signal
(a positive transition of a boolean variable)
Condition state
Industrial Automation
20/32
Condition
timestamp
controller
AckButton
(field ack)
Alarm Signal
Industrial Automation
21/32
acknowledgement
condition state
Inactive
Acked
Active
Active
Unacked Acked
Inactive
Acked
Active
Inactive
Unacked Unacked
Inactive
Unacked
Inactive
Acked
alarm_signal
Enabled
Inactive
Acked
condition state
transitions
(here: always
enabled)
Ack
alarm_signal
alarm_signal
Enabled
Inactive
Unacked
Enabled
Active
Unacked
Ack
Enabled
Active
Acked
alarm_signal
An event is generated each time the alarm signal changes state, or is acknowledged
Industrial Automation
22/32
Name
Active
ActiveSubCondition
Quality
Enabled
Acked
LastAckTime
SubCondLastActive
CondLastActive
LastInactive
AcknowledgerID
Comment
Industrial Automation
23/32
Name
Definition
Severity
Description
An alarm condition has at least one subcondition, that defines the severity.
Industrial Automation
24/32
Tank1AlarmCond
active, acked,..
Industrial Automation
25/32
Alarm
AE Client
AE Client
OPC AE
Server
OPC AE
Server
alarm notification (source, timestamp, message,
condition, subcondition, severity, type)
message
timestamp
Event
FB
message
controller
Industrial Automation
Condition
controller
26/32
Automation Interface
OPC Historical Data Specification
Overview
Industrial Automation
27/32
OPCEventSubscription
OPCEventSubscription
OPCEventAreaBrowsers
OPCEventAreaBrowser
OPCEvents (col.)
OPCEvent
OPCEvent
OPCEventCondition
OPCSubConditions (col.)
OPCSubCondition
OPCSubCondition
Industrial Automation
28/32
Event Server
Industrial Automation
29/32
Classes
Types
Constants
Industrial Automation
30/32
Industrial Automation
Automation Industrielle
Industrielle Automation
4 Access to devices
4.3.4 OLE for Process Control (OPC)
Historical Data Access
HDA: Overview
OPC Common
Overview: usage and specifications
OPC as an integration tool
Clients and Servers: configuration
OPC Technology, client and custom interface
OPC Data Access
Overview: browsing the server
Objects, types and properties
Communication model
Simple Programming Example
Standard and components
OPC Alarms and Events Specification
Overview: definitions and objects
Events
Alarm Conditions
Automation Interface
OPC Historical Data Specification
Overview
Industrial Automation
2/32
To probe further.
OPC Foundation:
Specifications http://www.opcfoundation.org
SoftwareToolbox
Examples in Visual Basic
http://www.softwaretoolbox.com/Tech_Support/TechExpertiseCenter/OPC/opc.html
Matrikon
Free client and server:
http://www.matrikon.com
WinTech
Toolkit for an OPC server
http://www.win-tech.com/html/opcstk.htm
NewAge Automation
Toolkit for an OPC server
http://www.newageautomation.com
Industrial Automation
3/32
Historians: An introduction
The role of HDA will become clearer
after a first glance at historians
4/32
Historians Example
GE Fanuc/Intellution iHistorian (iFix...)
Questions to the historian:
What was the value of FIC101 last week ?
What was the flow average during October ?
Which were the daily averages in October ?
What was the total flow in each month ?
How much fuel did we use for the batch ?
Features:
Unlimited Point Collection
Sub-Second Data Collection Rates
Enhanced Data Compression
True Thin Client Administration
Fault Tolerant Architecture
Industrial Automation
Historians: Market
11%
21%
1%
6%
13%
13%
12%
Chemical
Food and Beverage
Petroleum
Pulp and Paper
Pharmaceuticals
Power
Textiles
Waste and Water
Other
21%
Industrial Automation
7/32
Historians: Players
ABB
InfoPlus.21
OSISoft PI 3.4
Largest installed base (perceived as de facto standard)
Easy-to-use
Perceived low cost (PI 3.4: 1 Mio data points / 80'000 /s)
Industrial Automation
8/32
Historian implementation
application
OPC HDA
ODBC/SQL and OPC HDA are
complementary
log organisation
"SQL"
history
database
collector
corrections
operator actions
"OPC"
field data
Industrial Automation
9/32
HDA Clients
independent
processes
OPC HDA
Server
hidden
calculations
history
database
raw and
ordered data
collector
proprietary
data acquisition
OPC DA Server
Field device
Industrial Automation
Field device
10/32
HDA: Purpose
An OPC HDA server gives access to a historical data base (logs) in which data from the
process have been collected and time-stamped, possibly through an OPC DA interface.
The OPC HDA interface clients, such as trend analysis, product tracking or data mining,
that require ordered access these data logs.
The OPC HDA interface allows to:
Industrial Automation
11/32
Gpcpt2ofpbonne
Cpt2bac
Gpcpt2bac
Gpcptbe2
Gpcpt1bac
Gpcpt1ofpbonne
Gpcptae2
Cpt1bac
Gpdefr2
Gpvoydef
Gpr3tempscycleprd
Gpstn1e1
Gpalarme1
Gpalarme2
4824
50
70
45
151
4826
45
49
64
2
318
16
0
0
2
1346
1
16
0
317
0
0
0
1
1992
435
1
1
0
4823
12.3.02 13:43
12.3.02 13:43
12.3.02 13:43
12.3.02 13:43
12.3.02 13:43
12.3.02 13:43
12.3.02 13:43
12.3.02 13:43
12.3.02 13:44
12.3.02 13:44
12.3.02 13:44
12.3.02 13:44
12.3.02 13:44
12.3.02 13:44
12.3.02 13:44
Gptpscycle
Gpetatmodemarche
Gpdefgene1
Gpetatmodemarche
Gptpscycle
Gpdefr2
Gpvoydef
Gpdefgene1
Gpetatmodemarche
Gpr2tempscycleprd
Gptpscycle
Gpalarme3
Gpalarme4
Gpalarme3
Gpcpt2ofpbonne
Industrial Automation
12/32
HDA: How to reduce raw data (even before HDA comes into play)
Tag values are sent to the OPC DA server when they change (on events).
The collector records these data in a log that is organized cyclically.
Since a log has a limited storage capacity, data are reduced by several means:
1) if a variable is received more often than the log's minimal storage interval (e.g. 1s),
the log keeps the latest of all values of the interval
2) if (and only if) a received variable changed by more than the "exception deviation"
(e.g. 5%, analog values only), it is entered into the log.
3) if a variable changed by less than the exception deviation, it may nevertheless be
forced into the log after the log's maximum storage interval (e.g. 4 s) elapsed.
Two situations can occur:
- the time scale of the log is smaller than that of the trend display in this case, values have to be
interpolated to be displayed correctly
min time
max time
max time
max time
max
exception
deviation
min
time
= process value (event)
Industrial Automation
13/32
= log entry
4.3.4 OPC HDA
Parameters:
log: how were data sampled
time scale (with possible offset, zoom, pan)
amplitude scale (low range, high range, scale units)
style: smoothed, stepped, filled (several ways to display the same data)
extrapolate: how to display values not received (e.g. because they did not yet change)
Industrial Automation
14/32
log 1
log 2.2
log 2
raw log
Collector
(OPC DA Client)
other servers
OPC DA Server
Field device
XML / CSV
Field device
Industrial Automation
15/32
3 27 28 29 30
september octobre
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
october
23
24
d-6
d-5
d-4
10
d-3
11
12
13
16/32
d-2
14
15
16
yesterday
17
18
19
today
20
21
22
Actual data
HDA role
An HDA server allows to browse the logs and filter the logs to be read.
It can filter them according to their attributes, such as
name of the datapoints, type of the datapoint, engineering units,....
When reading the log, the HDA server can process the log by applying aggregations
The "min time", "deviation", "max time" rules used to collect raw data is also used
as an aggregation to build new logs.
Therefore, hierarchical logs can be built out of a raw log by an OPC HDA service.
Industrial Automation
17/32
HDA: Server
The client can query the HDA server for its capabilities, and in particular:
- which LocaleID (national languages) the server supports (as in DA and AE servers)
- which attributes the server supports (the attributes of its items is a subset thereof)
- which aggregates the server support (and the client can request)
- if the server supports correction / deletion of data (synchronous and/or asynchronous)
- if the server supports insertion of annotations (synchronous and/or asynchronous)
Many capabilities of the HDA server are optional.
Industrial Automation
18/32
root
Leaves
Object
Log 1
Object
Log 2
Area 5
Log 3
Area 51
Area 52
Industrial Automation
19/32
MyOPCHDABrowser.MoveDown (MyOPCHDABrowser.OPCHDABranches(1))
Items = MyOPCHDABrowser.OPCHDAItems
.... list these items
Industrial Automation
20/32
Description
1
2
3
4
DATA_TYPE
DESCRIPTION
ENG_UNITS
STEPPED
5
6
7
ARCHIVING
DERIVE_EQUATION
NODE_NAME
PROCESS_NAME
SOURCE_NAME
10
SOURCE_TYPE
11
NORMAL_MAXIMUM
12
NORMAL_MINIMUM
13
ITEMID
data type for the item. See the definition of a VARIANT for valid values (VT_R4, etc.)
text that describes the item.
label to use in displays to define the units for the item (e.g., kg/s).
whether data from the history repository should be displayed as interpolated (sloped lines
between points) or stepped (vertically-connected horizontal lines between points) data.
whether historian is recording data for this item (0 means no).
equation to be used by a derived item to calculate its value. This is a free-form string.
machine which is the source for the item. This is intended to be the broadest category for
defining sources. For an OPC Data Access Server source, this is the node name or IP
address of the server. For non-OPC sources, the meaning of this field is server-specific.
process which is the source for the item. This is intended to the second-broadest category
for defining sources. For an OPC DA server, this would be the registered server name.
For non-OPC sources, the meaning of this field is server-specific.
name of the item on the source. For an OPC DA server, this is the ItemID.
For non-OPC sources, the meaning of this field is server-specific.
sort of source produces the data for the item. For an OPC DA server, this would be "OPC".
For non-OPC sources, the meaning of this field is server-specific.
upper limit for the normal value range for the item, is used for trend display default scaling
and exception deviation limit calculations, should be the normal high value for the item.
lower limit for the normal value range for the item, is used for trend display default scaling
and exception deviation limit calculations, should be the normal low value for the item.
item identifier. This is used to allow filtering in the CreateBrowse method.
Industrial Automation
21/32
Data Type
Description
14
VT_FILETIME
15
VT_FILETIME
16
Exception Deviation
VT_R8
17
VT_I2
18
VT_R8
19
VT_R8
Industrial Automation
22/32
....
Industrial Automation
23/32
Industrial Automation
24/32
HDA: Aggregates
Symbol
0 NoAggregate
1 Interpolative
2 Total
3 Average
4 TimeAverage
5 Count
6 StDev
7 MinimumActualTime
8 Minimum
9 MaximumActualTime
10 Maximum
11 Start
12 End
13 Delta
14 RegSlope
15 RegConst
16 RegDev
17 Variance
18 Range
19 DurationGood
20 DurationBad
21 PercentGood
22 PercentBad
23 WorstQuality
24 Annotations
Description
Do not retrieve an aggregate (use only start time - stop time and filtering).
Get interpolated values.
Get the totalized value (time integral) of the data over the resample interval.
Get the average data over the resample interval.
Get the time weighted average data over the resample interval.
Get the number of raw values over the resample interval.
Get the standard deviation over the resample interval.
Get the minimum value in the resample interval and the timestamp of the minimum value.
Get the minimum value in the resample interval.
Get the maximum value in the resample interval and the timestamp of the maximum value.
Get the maximum value in the resample interval.
Get the value at the beginning of the resample interval (time stamp).
Get the value at the end of the resample interval (time stamp of end of the interval).
Get the difference between the first and last value in the resample interval.
Get the slope of the regression line over the resample interval.
Get the intercept of the regression line over the resample interval, (time start of interval).
Get the standard deviation of the regression line over the resample interval.
Get the variance over the sample interval .
Get the difference between the minimum and maximum value over the sample interval.
Get the duration (in seconds) of time in the interval during which the data is good.
Get the duration (in seconds) of time in the interval during which the data is bad.
Get the percent of data (1 = 100 %) in the interval which has good quality.
Get the percent of data (1 = 100 %) in the interval which has bad quality.
Get the worst quality of data in the interval.
Get the number of annotations in the interval.
Industrial Automation
25/32
HDA interpolation
interpolation is an aggregate used when the time scale of the derived log is smaller than
that of the parent log.
= parent log
= filtered log
time
Industrial Automation
26/32
Industrial Automation
27/32
28/32
OPCHDAItems (col)
OPCHDAItem
OPCHDAItem
An object that maintains the items definition. Note the Custom Interface
does not provide a separate Item Object.
OPCHDABrowsers
OPCHDAHistory
OPCHDAValue
OPCHDAValue
OPCHDAEntry
OPCHDAEntry
Industrial Automation
29/32
Industrial Automation
30/32
Industrial Automation
31/32