CONTROL ENGINEERING VOLUME: 9 | NUMBER: 2 | 2011 | JUNE
© 2011 ADVANCES IN ELECTRICAL AND ELECTRONIC ENGINEERING 96
DATA COMMUNICATION BETWEEN PROGRAMMABLE LOGIC
CONTROLLERS IN THE INDUSTRIAL DISTRIBUTION
APPLICATIONS
Anna BYSTRICANOVA1, And ej RYBOVIC1
1Depa men o Mecha onics and Elec onics, Facul y o Elec ical Enginee ing, Uni e si y o Zilina, Uni e zi na 1,
010 26 Zilina, Slo akia
anna.bys icano [email protected], and ej. y[email p o ec ed]
Abs ac . The impac o au oma ion is isible in all a eas
o indus y as well as in e e yday li e. Au oma ion makes
he p ocess con ol mo e e icien , inc eases p oduc i i y
o wo k, manu ac u ing quali y, dec eases manu ac u ing
cos s. Au oma ion is s ill in de elopmen so ha i could
succeed in illing all equi emen s o oday’s echnical
ad ance. Fo his eason we daily mee new ques ions
abou implemen a ion o au oma ion sys ems, hei
handling and expanding. One o hese is he ques ion o
communica ion in indus ial applica ions. In case o
ha ing mo e PLCs in one indus ial ne wo k, i is
necessa y o sol e hei in e -communica ion. We should
deal wi h his ques ion in dependence on some ac s, o
example: used con ol sys em, used indus ial ne wo k,
ansmission eliabili y equi emen s and so on. In his
a icle we would like o p esen a solu ion o in e -
communica ion be ween PLCs in one indus ial ne wo k
by S7 communica ion. S7 communica ion ia Indus ial
E he ne allows p og am-con olled communica ion
using communica ion SFBs/FBs ia con igu ed S7
connec ions.
Keywo ds
Au oma iza ion, E he ne , CPU, CP, MPI, PLC,
P o ibus, RM-OSI.
1. In oduc ion
I he communica ion in he small applica ions is no
c i ical han is su icien o con ol hese by one
p og ammable logical con olle (PLC). The ole o he
communica ion is exchanging o connec ion wi h a
common compu e in o de o c ea e and ansmi he
p og am o PLC and o ansmi da a o supe io le els
o ope a o ’s con ol o echnology. A he di ec con ol
i is possible o ely on he esponse speci ied by
manu ac u es be ween inpu change and adequa e
eac ion (A-A´, Fig. 1). This esponse anges abou 10 ms
depending on memo y size, p ocesso speed o on he
longes ime o p og amming epe i ion cycle (scan ime).
While building dis ibu ion con ol sys em o con olling
la ge indus ial applica ion i is e y impo an o sol e
he ques ion o communica ion. Some imes he e a ises
he ques ion abou con olling ou pu on he emo e PLC,
which is a ailable only ia indus ial communica ion
ne wo k (B-B´, Fig. 1).
In his case he esponse will be bigge and depend
on a lo o ac o s. Indus ial ne wo ks co e mainly
p oduc ion con ol, so i is e y impo an o ensu e high
eliabili y, de e minis ic mode o communica ion and
high powe . On he o he hand indus ial ne wo ks enable
connec ion (C-C´, Fig. 1) wi h cen alized ope a o laye
(PC wi h unc ion SCADA/MES) o whole company
in o ma ion sys em and op company ERP sys em.
Common co po a ion (p op ie a y) indus ial ne wo ks
use only h ee laye s om s anda d e e ence
communica ion model (RM-OSI) – physical, link and
applica ion laye . See compa ison in he Tab. 1. Mode n
ne wo ks based on indus ial E he ne and TCP/IP
echnologies use i e laye s, whe e ne wo k laye and
anspo laye a e alloca ed o physical and link laye s o
suppo TCP/IP echnology [1].
CONTROL ENGINEERING VOLUME: 9 | NUMBER: 2 | 2011 | JUNE
© 2011 ADVANCES IN ELECTRICAL AND ELECTRONIC ENGINEERING 97
Fig. 1: Business in o ma ion model.
2. Basic Ques ions
Managing connec ions be ween emo e PLC pe o ms he
da a link laye wi h use o ansmission in eal ime. To al
segmen a ion o cu en indus ial ne wo king p o ocols
is exp essed in Tab. 1 [1].
Tab.1: Compa ison o communica ion models o indus ial
ne wo ks wi h a e e ence model RM-OSI.
Classic
Ne wo k RM-OSI Indus ial
E he ne
TCP/IP
Applica ion 7 Applica ion Applica ion
6 P esen a ion
5 Session
4 T anspo TCP/UDP
3 Ne wo k IP
CAN, MAC,
LLC 2 Da a Link MAC, LLC
CAN,
P o ibus.... 1 Physical IEEE 802.3, 4
Communica ion Ga eway is used o link ne wo k
con olle s and E he ne .
When es ablishing a communica ion model a
le el o p og ammable logic con olle s, we ace o
undamen al issues o ne wo k selec ion wi h gi en
in e ace and p o ocol wi h ega d o he used ha dwa e.
Which ne wo k o choose?
Se ices o indus y compu e ne wo ks ha e
p ima ily been designed o suppo p ocess con ol in eal
ime and o gene al au oma ion applica ions. Se ices o
indus ial ne wo ks ha e been speci ically designed,
pa icula ly wi h ega d o needs o indi idual
manu ac u e s o au oma ion echnologies and sys ems.
The e o e hei s anda diza ion was delayed and only
a e a ce ain pe iod o ime i is possible o moni o
p o iling o ypical applica ion se ice o indus ial
ne wo ks [1].
Wha ype o p o ocol / se ice o selec ?
In o de o he PLC o be able o know how o
communica e in common ne wo k, hey use he same
communica ion p o ocol. I is ac ually a summa y o
pa ame e s and ules go e ning communica ion.
Selec ion o he communica ion p o ocol depends on
selec ion o ne wo k.
2.1 Basic Ne wo k Cha ac e is ics
The a chi ec u e o he Sima ic Siemens-Ne was
designed wi h in en ion o c ea ing an in eg a ed
en i onmen o open communica ion o a ious
au oma ion sys ems (To al In eg a ed Au oma ion) a all
le els o indus ial sys ems. A chi ec u e o hese
ne wo ks in eg a es a ious ne wo k echnologies so hey
ensu e p o iding equi ed communica ion se ices.
Wi hin he a chi ec u e a e de ined he ollowing
hie a chy le els wi h designa ed mode o
communica ion:
IT communica ion – allows in eg a ion o
au oma ion equipmen wi h En e p ise
In o ma ion Sys em.
Da a communica ion – allows o communica e in
eal ime on p ocedu al le el and con ol le el, in
which communica ion o PLCs, p og amming and
con olling o pe o mance componen s a e
dominan .
P ocedu al communica ion – allows I/O
ope a ions in eal ime and communica ion wi h
senso s and senso manu ac u ing p ocess [1].
As p e iously men ioned, in his case we a e
in e es ed in da a communica ion wi hin indus ial
ne wo ks Sima ic-Ne , whe e we cha ac e ize basic ypes
o indus ial ne wo ks.
1) MPI – Mul i Poin In e ace
MPI bus is designed o p og amming and da a se ices
on de ices. I is no designed o collec da a om
decen alized pe iphe als. In a ne wo k he e mus be a
leas one Mas e , which manages da a low on he
ne wo k. Ne wo k speed is op ional, 9 kbi /s o 12 Mbi /s.
In p inciple, ansmission dis ance is no limi ed, bu he
ne wo k is p ima ily in ended o local oad leng h in ens
o hund eds me e s.
T ansmission echnology is add essed h ough he
RS485 communica ion s anda d ansmission and by
CONTROL ENGINEERING VOLUME: 9 | NUMBER: 2 | 2011 | JUNE
© 2011 ADVANCES IN ELECTRICAL AND ELECTRONIC ENGINEERING 98
ibe op ic supplemen ed wi h con e e s, bu his
solu ion is no commonly used.
2) Disad an ages o Using:
limi ed amoun o da a ans e ed,
longe esponse ime,
sho ange ne wo k.
PLCs om o he manu ac u e s such as Siemens
do no usually ha e MPI in e ace [2], [3].
3) P o ibus–P oces Field Bus
Is an indus ial ieldbus used o all a eas o au oma ion.
A he le el o physical laye P o ibus is speci ied o sui
he di e se needs and o suppo majo i y o indus ial
applica ions, such as linking emo e con olle
pe iphe als o p ocedu al con olle (DP) o p ocedu al
au oma ion (PA) [1].
4) Types and Ve sions o P o ibus
P o ibus DP (Decen alized Pe iphe y). This is he
simples and highly p edominan a ian o P o ibus. I is
sui able o as ans e o decen alized pe iphe als and
emo e I/O uni s. Communica ion medium is ei he a
wis ed pai (s anda d RS-485) o op ical ibe a speed o
up o 12 Mbi /s.
P o ibus PA (P oces Au oma ion) uses enla ged
s anda d P o ibus DP and is designed o con ol slow
p ocesses, especially in po en ially explosi e
a mosphe es as i co esponds o in insical spa k sa e y.
P o ibus FMS P o ibus FMS p o ides
communica ion s anda d o communica ion in
he e ogeneous en i onmen wi h a la ge se o se ices
o wo king wi h da a, p og ams and ala ms.
Communica ion medium is a wis ed pai (s anda d RS-
485) o op ical ibe . Speed is lowe han he P o ibus DP
[1].
5) Disad an ages o Using
Compa ing o E he ne , P o ibus is less powe ul and
lexible ne wo k.
Fig. 2: Sys em a chi ec u e ne wo k Sima ic – Ne .
6) Indus ial E he ne
Indus ial E he ne is based on s anda d IEEE 802.3. This
p o ocol de ines he physical laye and da a link laye
model. As a consequence, he s anda d IEEE 802.3
speci ies cha ac e is ics o communica ion in e ace and a
me hod o managing he access o ansmission medium
[1].
Sys ems wi h indus ial E he ne can ha e
di e en s uc u es, i.e. ne wo k opology, logical
s uc u e o communica ion links bu also me hods o
ansmi ing da a. Topology: bus, ee, s a , ing [3].
Fig. 3: Bus opology E he ne ne wo k.
In he p ocess o de elopmen and use o E he ne
in indus ial p ac ice we e c ea ed many solu ions.
In e na ional Elec o echnical Commission (IEC) has
ecognized ollowing E he ne p o ocols:
P o ine IO – cyclic communica ion add essing
h ough MAC (De ice Name),
ISO – acyclic communica ion add essing h ough
MAC,
ISO-on-TCP – acyclic communica ion add essing
h ough IP,
TCP/IP – eliable acyclic con i med by
communica ion add essing h ough IP,
UDP/IP – acyclic da ag am by unce i ied
communica ion add essing h ough IP [1].
3. Communica ion among Se e al
PLC
Managing connec ions be ween emo e PLC pe o ms he
da a link laye wi h use.
3.1 C ea ing P ojec o Communica ion
be ween PLC
Fo p ac ical e i ica ion o communica ion among
a ious PLC, we used he communica ion model
consis ing o he ollowing pa s.
Ha dwa e:
Sima ic S7-300 (CPU 315-2 PN/DP),
Sima ic S7-300 (CPU 315-2 PN/DP),
CONTROL ENGINEERING VOLUME: 9 | NUMBER: 2 | 2011 | JUNE
© 2011 ADVANCES IN ELECTRICAL AND ELECTRONIC ENGINEERING 99
So wa e:
S ep 7 S7/M7/C7 (Ve sion V5.4 + SP5 + HF1).
Ne wo k:
E he ne .
P o ocol:
S7 communica ion (wi h sys emic blocks BSEND,
BRCV).
The E he ne CP o SIMATIC S7 suppo s his
ype o communica ion depending on he CP ype. S7
communica ion o ms a simple and e icien in e ace
be ween SIMATIC S7 s a ions and PGs/PCs using
communica ion unc ion blocks.
In Sima ic Manage , we ha e c ea ed a new
p ojec , in o which wo SIMATIC 300 s a ions we e
inse ed. The p ojec is ma ked 1 and 2.
Fig. 4: The p ojec c ea ed in SIMATIC Manage en i onmen .
In o he pa Ha dwa e P og amming En i onmen
S ep 7 we inse a speci ic ype o p ocesso (CPU) o
each PLC. Fo each p ocesso an IP add ess is be se .
In S ep 7 we open en i onmen o he Ne , whe e
we c ea e a connec ion be ween he communica ion
pa ne s in he ollowing way:
Menu- Inse - New Connec ion.
We choose he communica ion pa ne wi hin one
p ojec . Type o connec ion is: S7 connec ion.
The ollowing pic u e illus a es he cha ac e is ics
o c ea ed connec ion be ween wo CPU.
Fig. 5: P ope ies o S7 connec ion.
3.2 PLC P og am
A e se ing communica ion be ween p ocesso s (CPUs)
o he bo h PLCs, we could access o c ea ion o he use
p og am. I is possible o choose om he ollowing
p og amming languages in p og amming en i onmen o
S ep 7:
STL (S a emen Lis P og amming Language): a
ex -based p og amming language wi h a s uc u e
simila o machine code. Each s a emen
ep esen s a p og am p ocessing ope a ion o he
CPU,
LAD (Ladde Logic): a p og amming language
ha ep esen s a p og am by a g aphical diag am
based on he ci cui diag ams o elay-based logic
ha dwa e,
FBD (Func ion Block Diag am) a g aphical
language ha allows he use o p og am elemen s
in "blocks".
These p og am languages a e equi alen . We
could change hem while p og amming. Use p og am
s uc u e is decla ed by o ganiza ion block (OB 1), which
ope a es cyclically. Ope a ion sys em S7 CPU
pe iodically ini ializes he block OB1. OB1 consis s o
sepa a ely p og ammable unc ion blocks (FBs). FB
con ains memo y, which makes i possible o sa e
in e nal a iables o his block by decla a ion able. Fo
he mos equen ly used ou ines we use unc ion – FC
blocks. Da a blocks (DBs) a e used o sa ing use da a,
which could bu need no o couple wi h pa icula
unc ion block FB. P og am S ep 7 uses Sys em
Func ion Blocks SFBs and Sys em Func ions SFCs.
These a e di ec ly in eg a ed in he S7 p ocesso (CPU)
and enable en y o some special sys em unc ions. I is
necessa y o call p og ammed blocks FB, FC, DB by
app op ia e o ganiza ion block (OB) [5].
In o each PLC p og amme we pu sha ed Da a
Blocks, which a e no associa ed wi h a conc e e FB
block. We ma k hem as DB200 and DB 201.
DB 200: DB con ains da a sen om one PLC o
ano he .
DB2001: DB con ains da a ecei ed om he
o he PLC.
Size and da a ype in Da a Blocks a e isible om
he pic u es.
Fig. 6: Da a Block DB200 sending da a.
CONTROL ENGINEERING VOLUME: 9 | NUMBER: 2 | 2011 | JUNE
© 2011 ADVANCES IN ELECTRICAL AND ELECTRONIC ENGINEERING 100
Fig. 7: Da a Block DB201 ecei ing da a.
We c ea e Func ion Block FB1 in o which we pu
blocks SFB 12 and SFB 13.
F om he p og am lib a y we choose sys em
unc ions SFB 12 BSEND and SFB 13 BRCV. Func ion
block FB1 con aining unc ions o da a ans e is
pe iodically ope a ed a he main block OB1 oge he
wi h i s da a block DB1.
1) Desc ip ion o he Sys em Block SFB12/FB 12
SFB/FB 12 "BRCV" sends da a o a emo e node
(pa ne ), SFB/FB, which is a ype o "BRCV". The da a
a ea o be ansmi ed is segmen ed. Each segmen is sen
indi idually. Las segmen , when adop ed con i med
pa ne . In his way da a ansmission may be ansmi ed
be ween communica ion pa ne s mo e han o he
communica ion SFB/FB blocks con igu ed o
connec ion o he S7 65534 By es h ough an in eg a ed
in e ace.
S7-300: Sending da a is ac i a e wi h help leading
edge inpu REQ. The pa ame e s R_ID, ID, SD_1 and
LEN a e ans e ed on each posi i e edge a REQ. A e
a job has been comple ed, you can assign new alues o
he R_ID, ID, SD_1 and LEN pa ame e s. To ca y ou
he ans e o he segmen da a block ha mus be called
pe iodically in he use p og am. The s a ing add ess and
he maximum leng h o da a sen is speci ied in SD_1. In
he inpu pa ame e LEN de ines he size o sending da a
ield in by es [4].
2) Desc ip ion o Sys em Block SFB13/FB 13
SFB/FB 13 "BRCV" ecei e da a om a emo e pa ne
SFB/FB, which is a ype o "BSEND. A e each ecei ed
da a segmen sen a con i ma ion pa ne SFB/FB and
LEN pa ame e upda ing [4].
4. Communica ion among Se e al
PLC
A e p og amming sys em blocks and ollowing illing
CPUs o bo h PLC, we can make check communica ion
p ocedu e be ween wo PLCs. Block BSEND sends da a
o he o he PLC, whe e he block BRCV ecei es i .
Se ings sys em o he blocks is clea om he pic u es
below.
Fig. 8: Block SFB 12 BSEND.
Fig. 9: Block SFB 13 BRCV.
Mu ual communica ion was e i ied by VAT
ables. Da a sen om DB 200 ia BSEND unc ion om
PLC 1 we e ecei ed by he o he PLC ia unc ion
BRCV in o DB 201. Da a could be sen and ecei ed
sepa a ely by pa icula elemen a y ypes (bi , by e, wo d,
in , eal,..) o by whole da a a eas (a ay, ...).
CONTROL ENGINEERING VOLUME: 9 | NUMBER: 2 | 2011 | JUNE
© 2011 ADVANCES IN ELECTRICAL AND ELECTRONIC ENGINEERING 101
Fig. 10: VAT able in PLC 1.
Fig. 11: VAT able in PLC 2.
5. Achie ed Expe imen al Resul s o
he P ojec
A he end we ca ied ou he expe imen when we we e
in one minu e acking he numbe o cycles o da a
ans e ed be ween PLC a :
change impulse leng h o pa ame e REQ in block
BSEND,
change o capaci y o ans e ed da a.
We ollowed one bi om he ans e ed da a
block. I s s a e was changing (0,1) e e y ealized cycle o
ansmission o da a du ing one minu e. We used coun e
C1, which coun ed s a es o a iable in 1 and coun e C2,
which coun ed s a es o a iable in 0.
We ound ou ha in size 10 B o ans e ed da a
and ime 100 ms in a iable REQ o BSEND in bo h
PLCs 578 cycles da a communica ion du ing 1 minu es
we e execu ed a scan imes CPU 1 (Fig. 12) and CPU 2
(Fig. 13).
Fig. 12: Scan ime CPU 1.
Fig. 13: Scan ime CPU 2.
Fig. 14: Cycle coun e s o ans e ed da a wi h size 10 B and 100 ms
impulse.
We ca ied ou he same expe imen a 1 s impulse
in pa ame e REQ o BSEND block. In his case 60
cycles be ween wo PLCs du ing 1 minu e we e ealised.
CONTROL ENGINEERING VOLUME: 9 | NUMBER: 2 | 2011 | JUNE
© 2011 ADVANCES IN ELECTRICAL AND ELECTRONIC ENGINEERING 102
I means ha a 10 imes dec eased equency o da a
communica ion be ween sys em blocks o bo h PLCs, he
numbe o ealised cycles o da a ans e dec eased
almos by 10 imes. The e was no a shining changing
scan ime bo h CPUs. No signi ican change in scan ime
was egis e ed.
Fig. 15: Coun e cycles o ans e ed da a wi h size 10 B a 1 s impulse.
This ime we inc ease he capaci y o
communica ed da a on maximum, i.e. 32 kB. A he
impulse leng h o 100 ms he ans e was execu ed 338
imes du ing 1 minu e. Scan ime was he same o bo h
CPUs.
Fig. 16: Coun e cycles o ans e ed da a wi h size 32 kB and 100 ms
impulse.
We ied o dec ease equency o ans e . To he
pa ame e REQ o BSEND blocks o bo h PLCs we
connec ed 1s impulse, which inicialized sending da a
om one PLC o he o he . In his case ans e was
execu ed 26 imes only.
Fig. 17: Coun e cycles o ans e ed da a wi h size 32 kB and 1 ms
impulse.
The esul o hese expe imen s is ha scan ime o
bo h p ocesso s was conside ably changed nei he wi h
condensed ans e equency no wi h bigge capaci y o
communica ion da a. I means ha he examined da a
communica ion was execu ed eliably and did no load
he p ocesso s o bo h logical au oma s.
6. Conclusion
By he p ac ical example one o m o da a
communica ion among mo e PLCs was demons a ed.
We chose he model whe e bo h p ocesso s we e he
SIMATIC ype. We chose he Indus ial E he ne
ne wo k wi h se ice S7 communica ion. Fo da a
ans e we used sys em blocks SFB 12 BSEND and SFB
13 BRCV, which a e able o ans e maximum da a
capaci y 32 kB o S7 – 300 and 64 kB o S7-400.
As i has been men ioned and expe imen ally
e i ied, he da a communica ion speed among se e al
PLCs mainly depends on used ha dwa e (CPU ype),
indus ial ne wo k used o da a ans e and pa ame e
se ings o sys em blocks including he size o ans e ed
da a.
Acknowledgemen s
This a icle was w i en wi h he suppo o a gua an eed
p ojec APVV VMSP-P-0085-09.
Re e ences
[1] FRANEKOVÁ, M.; KÁLLAY, F.; PENIAK, P.; VESTENICKÝ,
P. Komunikačná bezpečnosť p iemyselných sie í. Žilina 2007.
ISBN 9078-80-8070-715-6.
[2] BÉLAI, I. Indus ial communica ion : Lec u e [online]. 2007, 18.
1. 2007. A ailable a WWW:
<h p://www.ka .el .s uba.sk/p edme y/pkom/PKS/P ednasky/pks_
p ednasky.h ml>.
[3] KOSEK, R.; VOJANEC, J. No inky a komunikace SIMATIC
[online]. 27. 1. 2010. A ailable a WWW:
<h p://www.siemens.cz/siemje s o age/ iles/57032_01$komunika
ce.p ehled.pd >.
[4] SIEMENS AG. Help on Sima ic Manage V5.4+SP5+HF1.
Siemens AG, 1995-2009.
[5] ONDROVIČOVÁ, M. Con ol sys em SIMATIC S7-300 [online].
20. 1. 2010. A ailable a WWW:
<h p://www.ki p.ch .s uba.sk/~ond o ic/sima ic.h m>.
Abou Au ho s
Anna BYSTRICANOVA was bo n in 1983 in T encin.
She ecei ed he mas e `s deg ee in he ield o s udy
„Au oma iza ion“ a he Uni e si y o Zilina - Facul y o
Mechanical Enginee ing - Depa men o Machining and
Au oma iza ion. Nowadays she wo ks as PLC
p og amme . She is an ex e nal Ph.D. s uden a he
Uni e si y o Zilina - Facul y o Elec ical Enginee ing -
Depa men o Mecha onics and Elec onics in he s udy
p og amme „Au oma iza ion“.
And ej RYBOVIC was bo n in 1984 in H us ic
(Slo akia). He ecei ed he mas e `s deg ee in he ield
o s udy „Powe Elec onics Sys ems“ a he Uni e si y
o Zilina - Facul y o Elec ical Enginee ing - Depa men
o Mecha onics and Elec onics. Nowadays he is a Ph.D.
s uden a he Uni e si y o Zilina - Facul y o Elec ical
Enginee ing - Depa men o Mecha onics and
Elec onics in he s udy p og amme "Powe Elec onics
Sys ems". He is abou design o mecha onics models
wi h ha dwa e Loop Back (HIL).