Sie sind auf Seite 1von 84

1

Tab|e of Couteuts
nlroduclion ............................................................................. 2
PLCs ........................................................................................ 4
unber Syslens..................................................................... 3
Terninology ........................................................................... 14
Basic Fequirenenls .............................................................. 23
S7200 icro PLCs................................................................ 29
Connecling Exlernal Devices ................................................. 40
Progranning A PLC .............................................................. 42
Discrele npuls/Oulpuls ........................................................ 50
Analog npuls and Oulpuls .................................................... 62
Tiners ................................................................................... 65
Counlers ................................................................................ 72
HighSpeed nslruclions ........................................................ 77
Feviev Ansvers.................................................................... 31
Final Exan............................................................................. 32
2
|rt|cJuct|cr
velcone lo anolher course in lhe STEP 2000 series, Sienens
Technical Educalion Progran, designed lo prepare our
dislribulors lo sell Sienens Energy Aulonalion producls
nore elleclively. This course covers Basics of PLCs and relaled
producls.
Upon conplelion ol Basics of PLCs you should be able lo:
denlily lhe najor conponenls ol a PLC and describe
lheir lunclions
Converl nunbers lron decinal lo binary, BCD, and
hexadecinal
denlily lypical discrele and analog inpuls and oulpuls
Fead a basic ladder logic diagran and slalenenl lisl
denlily operalional dillerences belveen dillerenl S7200
nodels
denlily lhe proper nanual lo reler lo lor progranning or
inslallalion ol an S7200 PLC
Connecl a sinple discrele inpul and oulpul lo an S7200
Selecl lhe proper expansion nodule lor analog inpuls and
oulpuls
Describe lhe operalion ol liners and counlers
3
This knovledge vill help you beller undersland cusloner
applicalions. n addilion, you vill be beller able lo describe
producls lo cusloners and delernine inporlanl dillerences
belveen producls. You should conplele Basics of EIectricity
belore allenpling Basics of PLCs. An underslanding ol nany ol
lhe concepls covered in Basics of EIectricity is required lor
Basics of PLCs. n addilion you nay vish lo conplele Basics
of ControI Components. Devices covered in Basics of
ControI Components are used vilh progrannable logic
conlrollers.
l you are an enployee ol a Sienens Energy Aulonalion
aulhorized dislribulor, lill oul lhe linal exan learoul card and
nail in lhe card. ve vill nail you a cerlilicale ol conplelion il
you score a passing grade. Good luck vilh your ellorls.
SATC, STEP 7, STEP 7icro, STEP 7icro/v, PG 702,
and PG 740 are regislered lradenarks ol Sienens Energy
Aulonalion, nc.
SDOS and vindovs are lradenarks ol icrosoll, nc.
4
FLCs
Progrannable Logic Conlrollers (PLCs), also relerred lo as
progrannable conlrollers, are in lhe conpuler lanily. They are
used in connercial and induslrial applicalions. A PLC nonilors
inpuls, nakes decisions based on ils progran, and conlrols
oulpuls lo aulonale a process or nachine. This course is neanl
lo supply you vilh basic inlornalion on lhe lunclions and
conliguralions ol PLCs.
Photo-Sensors
Lights
Pumps
Pushbutton
Switches
Drive Motors
5
Basic PLC operation PLCs consisl ol inpul nodules or poinls, a Cenlral Processing
Unil (CPU), and oulpul nodules or poinls. An inpul accepls a
variely ol digilal or analog signals lron various lield devices
(sensors) and converls lhen inlo a logic signal lhal can be used
by lhe CPU. The CPU nakes decisions and execules conlrol
inslruclions based on progran inslruclions in nenory. Oulpul
nodules converl conlrol inslruclions lron lhe CPU inlo a digilal
or analog signal lhal can be used lo conlrol various lield devices
(aclualors). A progranning device is used lo inpul lhe desired
inslruclions. These inslruclions delernine vhal lhe PLC vill do
lor a specilic inpul. An operalor inlerlace device allovs process
inlornalion lo be displayed and nev conlrol paranelers lo be
enlered.
Input
Module
Output
Module
CPU
Central Processing
Unit
Programming
Device
Operator
Interface
Pushbullons (sensors), in lhis sinple exanple, connecled lo
PLC inpuls, can be used lo slarl and slop a nolor connecled lo
a PLC lhrough a nolor slarler (aclualor).
PLC
Start/Stop Pushbuttons
(Sensors)
Motor Starter
(Acuator)
Motor
Input
Output
6
Hard-wired controI Prior lo PLCs, nany ol lhese conlrol lasks vere solved vilh
conlaclor or relay conlrols. This is ollen relerred lo as hardvired
conlrol. Circuil diagrans had lo be designed, eleclrical
conponenls specilied and inslalled, and viring lisls crealed.
Eleclricians vould lhen vire lhe conponenls necessary lo
perlorn a specilic lask. l an error vas nade lhe vires had lo
be reconnecled correclly. A change in lunclion or syslen
expansion required exlensive conponenl changes and reviring.
OL
M
CR
CR
L1
T1
T2
T3
L2
L3
OL
OL
OL
M
M
CR
M
Motor
Start
Stop
460 VAC
24 VAC
1
2
PLCs The sane, as vell as nore conplex lasks, can be done vilh a
PLC. viring belveen devices and relay conlacls is done in lhe
PLC progran. Hardviring, lhough slill required lo connecl lield
devices, is less inlensive. odilying lhe applicalion and
correcling errors are easier lo handle. l is easier lo creale and
change a progran in a PLC lhan il is lo vire and revire a circuil.
Snaller physical size lhan hardvire solulions
Easier and lasler lo nake changes
PLCs have inlegraled diagnoslics and override lunclions
Diagnoslics are cenlrally available
Applicalions can be innedialely docunenled
Applicalions can be duplicaled lasler and less expensively
)@L=J=CAI
7
Siemens PLCs Sienens nakes several PLC producl lines in lhe SATC S7
lanily. They are: S7200, S7300, and S7400.
S7-200 The S7200 is relerred lo as a nicro PLC because ol ils snall
size. The S7200 has a brick design vhich neans lhal lhe pover
supply and /O are onboard. The S7200 can be used on snaller,
slandalone applicalions such as elevalors, car vashes, or
nixing nachines. l can also be used on nore conplex
induslrial applicalions such as bollling and packaging nachines.
S7-300 and S7-400 The S7300 and S7400 PLCs are used in nore conplex
applicalions lhal supporl a grealer nunber ol /O poinls. Bolh
PLCs are nodular and expandable. The pover supply and /O
consisl ol seperale nodules connecled lo lhe CPU. Choosing
eilher lhe S7300 or S7400 depends on lhe conplexily ol lhe
lask and possible lulure expansion. Your Sienens sales
represenlalive can provide you vilh addilional inlornalion on
any ol lhe Sienens PLCs.
3
Number Systems
Since a PLC is a conpuler, il slores inlornalion in lhe lorn ol
On or Oll condilions (1 or 0), relerred lo as binary digils (bils).
Sonelines binary digils are used individually and sonelines
lhey are used lo represenl nunerical values.
DecimaI system Various nunber syslens are used by PLCs. All nunber syslens
have lhe sane lhree characlerislics: digils, base, veighl. The
decinal syslen, vhich is connonly used in everyday lile, has
lhe lolloving characlerislics:
Ten digils 0, 1, 2, 3, 4, 5, 6, 7, 3, 9
Base 10
veighls 1, 10, 100, 1000, ...
Binary system The binary syslen is used by progrannable conlrollers. The
binary syslen has lhe lolloving characlerislics:
Tvo digils 0, 1
Base 2
veighls Povers ol base 2 (1, 2, 4, 3, 16, ...)
n lhe binary syslen 1s and 0s are arranged inlo colunns. Each
colunn is veighled. The lirsl colunn has a binary veighl ol 2
0
.
This is equivalenl lo a decinal 1. This is relerred lo as lhe leasl
signilicanl bil. The binary veighl is doubled vilh each
succeeding colunn. The nexl colunn, lor exanple, has a veighl
ol 2
1
, vhich is equivalenl lo a decinal 2. The decinal value is
doubled in each successive colunn. The nunber in lhe lar lell
hand colunn is relerred lo as lhe nosl signilicanl bil. n lhis
exanple, lhe nosl signilicanl bil has a binary veighl ol 2
7
. This
is equivalenl lo a decinal 123.
128 64 32 16 8 4 2 1
0 0 0 1 1 0 0 0
Most Significant Bit Least Significant Bit
2
7
2
6
2
5
2
4
2
3
2
2
2
1
2
0
9
Converting binary The lolloving sleps can be used lo inlerprel a decinal
to decimaI nunber lron a binary value.
1) Search lron lell lo righl (leasl signilicanl lo nosl
signilicanl bil) lor 1s.
2) vrile dovn lhe decinal represenlalion ol each colunn
conlaining a 1.
3) Add lhe colunn values.
n lhe lolloving exanple, lhe lourlh and lillh colunns lron lhe
righl conlain a 1. The decinal value ol lhe lourlh colunn lron
lhe righl is 3, and lhe decinal value ol lhe lillh colunn lron lhe
righl is 16. The decinal equivalenl ol lhis binary nunber is 24.
The sun ol all lhe veighled colunns lhal conlain a 1 is lhe
decinal nunber lhal lhe PLC has slored.
128 64 32 16 8 4 2 1
0 0 0 1 1 0 0 0
8
16
24
+
n lhe lolloving exanple lhe lourlh and sixlh colunns lron lhe
righl conlain a 1. The decinal value ol lhe lourlh colunn lron
lhe righl is 3, and lhe decinal value ol lhe sixlh colunn lron
lhe righl is 32. The decinal equivalenl ol lhis binary nunber is
40.
128 64 32 16 8 4 2 1
0 0 1 0 1 0 0 0
8
32
40
+
Bits, bytes, and words Each binary piece ol dala is a bil. Eighl bils nake up one byle.
Tvo byles, or 16 bils, nake up one vord.
0 0 0 1 1 0 0 0 0 0 0 1 1 0 0 0
Byte
Word
Bit
10
Logic 0, Iogic 1 Progrannable conlrollers can only undersland a signal lhal is
On or Oll (presenl or nol presenl). The binary syslen is a
syslen in vhich lhere are only lvo nunbers, 1 and 0. Binary 1
indicales lhal a signal is presenl, or lhe svilch is On. Binary 0
indicales lhal lhe signal is nol presenl, or lhe svilch is Oll.
BCD BinaryCoded Decinal (BCD) are decinal nunbers vhere each
digil is represenled by a lourbil binary nunber. BCD is
connonly used vilh inpul and oulpul devices. A lhunbvheel
svilch is one exanple ol an inpul device lhal uses BCD. The
binary nunbers are broken inlo groups ol lour bils, each group
represenling a decinal equivalenl. A lourdigil lhunbvheel
svilch, like lhe one shovn here, vould conlrol 16 (4 x 4) PLC
inpuls.
0 2 0 5
Decimal
Numbers
BCD
Numbers
0
1
2
3
4
5
6
7
8
9
0000
0001
0010
0011
0100
0101
0110
0111
1000
1001
0000 0010 0000 0101
11
HexadecimaI Hexadecinal is anolher syslen used in PLCs. The hexadecinal
syslen has lhe lolloving characlerislics:
16 digils 0, 1, 2, 3, 4, 5, 6, 7, 3, 9, A, B, C, D, E, F
Base 16
veighls Povers ol base 16 (1, 16, 256, 4096 ...)
The len digils ol lhe decinal syslen are used lor lhe lirsl len
digils ol lhe hexadecinal syslen. The lirsl six lellers ol lhe
alphabel are used lor lhe renaining six digils.
A = 10 D = 13
B = 11 E = 14
C = 12 F = 15
The hexadecinal syslen is used in PLCs because il allovs lhe
slalus ol a large nunber ol binary bils lo be represenled in a
snall space such as on a conpuler screen or progranning
device display. Each hexadecinal digil represenls lhe exacl
slalus ol lour binary bils. To converl a decinal nunber lo a
hexadecinal nunber lhe decinal nunber is divided by lhe base
ol 16. To converl decinal 23, lor exanple, lo hexadecinal:
16 28
1 r 12
Decinal 23 divided by 16 is 1 vilh a renainder ol 12. Tvelve is
equivalenl lo C in hexadecinal. The hexadecinal equivalenl ol
decinal 23 is 1C.
The decinal value ol a hexadecinal nunber is oblained by
nulliplying lhe individual hexadecinal digils by lhe base 16
veighl and lhen adding lhe resulls. n lhe lolloving exanple
lhe hexadecinal nunber 2B is converled lo ils decinal
equivalenl ol 43.
16
0
= 1
16
1
= 16
B = 11
16
0
16
1
2 x 16 = 32
11 x 1 = 11
43
2 B
12
Conversion of numbers The lolloving charl shovs a lev nuneric values in decinal,
binary, BCD, and hexadecinal represenlalion.
Decina| Binar, BCD Hexadecina|
0 0 0000 0
1 1 0001 1
2 1 0010 2
3 11 0011 3
4 100 0100 4
5 101 0101 5
6 110 0110 6
7 111 0111 7
3 1000 1000 3
9 1001 1001 9
10 1010 0001 0000 A
11 1011 0001 0001 B
12 1100 0001 0010 C
13 1101 0001 0011 D
14 1110 0001 0100 E
15 1111 0001 0101 F
16 1 0000 0001 0110 10
17 1 0001 0001 0111 11
13 1 0010 0001 1000 12
19 1 0011 0001 1001 13
20 1 0100 0010 0000 14
. . . .
. . . .
126 111 1110 0001 0010 0110 7E
127 111 1111 0001 0010 0111 7F
123 1000 1000 0001 0010 1000 30
. . . .
. . . .
510 1 1111 1110 0101 0001 000 1FE
511 1 1111 1111 0101 0001 0001 2FF
512 10 0000 0000 0101 0001 0010 200
13
Review 1
1. denlily lhe lolloving:
a. ______ b. ______ c. ______
d. ______ e. ______
2. The binary nunber syslen has a base ____________ .
3. The hexadecinal nunber syslen has a base
____________ .
4. Converl a decinal 10 lo lhe lolloving:
Binary ____________
BCD ____________
Hexadecinal ____________
14
Termihology
The language ol PLCs consisls ol a connonly used sel ol
lerns, nany ol vhich are unique lo PLCs. n order lo
undersland lhe ideas and concepls ol PLCs, an underslanding
ol lhese lerns is necessary.
Sensor A sensor is a device lhal converls a physical condilion inlo an
eleclrical signal lor use by lhe PLC. Sensors are connecled lo
lhe inpul ol a PLC. A pushbullon is one exanple ol a sensor
lhal is connecled lo lhe PLC inpul. An eleclrical signal is senl
lron lhe pushbullon lo lhe PLC indicaling lhe condilon (open/
closed) ol lhe pushbullon conlacls.
Actuators Aclualors converl an eleclrical signal lron lhe PLC inlo a
physical condilion. Aclualors are connecled lo lhe PLC oulpul.
A nolor slarler is one exanple ol an aclualor lhal is connecled
lo lhe PLC oulpul. Depending on lhe oulpul PLC signal lhe
nolor slarler vill eilher slarl or slop lhe nolor.
15
Discrete input A discrele inpul, also relerred lo as a digilal inpul, is an inpul
lhal is eilher in an O or OFF condilion. Pushbullons, loggle
svilches, linil svilches, proxinily svilches, and conlacl
closures are exanples ol discrele sensors vhich are connecled
lo lhe PLCs discrele or digilal inpuls. n lhe O condilion a
discrele inpul nay be relerred lo as a logic 1 or a logic high. n
lhe OFF condilion a discrele inpul nay be relerred lo as a logic
0 or a logic lov.
PLC
Inputs
Normally Open Pushbutton
Normally Closed Pushbutton
Normally Closed Switch
Normally Closed Contact
Normally Open Switch
Normally Open Contact
A ornally Open (O) pushbullon is used in lhe lolloving
exanple. One side ol lhe pushbullon is connecled lo lhe lirsl
PLC inpul. The olher side ol lhe pushbullon is connecled lo an
inlernal 24 VDC pover supply. any PLCs require a separale
pover supply lo pover lhe inpuls. n lhe open slale, no vollage
is presenl al lhe PLC inpul. This is lhe OFF condilion. vhen lhe
pushbullon is depressed, 24 VDC is applied lo lhe PLC inpul.
This is lhe O condilion.
16
AnaIog inputs An analog inpul is an inpul signal lhal has a conlinuous signal.
Typical analog inpuls nay vary lron 0 lo 20 nillianps, 4 lo 20
nillianps, or 0 lo 10 volls. n lhe lolloving exanple, a level
lransniller nonilors lhe level ol liquid in a lank. Depending on
lhe level lransniller, lhe signal lo lhe PLC can eilher increase or
decrease as lhe level increases or decreases.
PLC
Inputs
Level Transmitter
Discrete outputs A discrele oulpul is an oulpul lhal is eilher in an O or OFF
condilion. Solenoids, conlaclor coils, and lanps are exanples ol
aclualor devices connecled lo discrele oulpuls. Discrele
oulpuls nay also be relerred lo as digilal oulpuls. n lhe
lolloving exanple, a lanp can be lurned on or oll by lhe PLC
oulpul il is connecled lo.
PLC
Outputs
Light
17
AnaIog outputs An analog oulpul is an oulpul signal lhal has a conlinuous
signal. The oulpul nay be as sinple as a 010 VDC level lhal
drives an analog neler. Exanples ol analog neler oulpuls are
speed, veighl, and lenperalure. The oulpul signal nay also be
used on nore conplex applicalions such as a currenllo
pneunalic lransducer lhal conlrols an airoperaled llovconlrol
valve.
CPU The cenlral processor unil (CPU) is a nicroprocessor syslen
lhal conlains lhe syslen nenory and is lhe PLC decision
naking unil. The CPU nonilors lhe inpuls and nakes decisions
based on inslruclions held in lhe progran nenory. The CPU
perlorns relay, counling, lining, dala conparison, and
sequenlial operalions.
13
Programming A progran consisls ol one or nore inslruclions lhal acconplish
a lask. Progranning a PLC is sinply conslrucling a sel ol
inslruclions. There are several vays lo look al a progran such
as ladder logic, slalenenl lisls, or lunclion block diagrans.
Ladder Iogic Ladder logic (LAD) is one progranning language used vilh
PLCs. Ladder logic uses conponenls lhal resenble elenenls
used in a line diagran lornal lo describe hardvired conlrol.
Feler lo lhe STEP 2000 course Basics of ControI
Components lor nore inlornalion on line diagrans.
STEP 2000
Basics of
Control
Components
Ladder Iogic diagram The lell verlical line ol a ladder logic diagran represenls lhe
pover or energized conduclor. The oulpul elenenl or inslruclion
represenls lhe neulral or relurn palh ol lhe circuil. The righl
verlical line, vhich represenls lhe relurn palh on a hardvired
conlrol line diagran, is onilled. Ladder logic diagrans are read
lron lelllorighl, loplobollon. Fungs are sonelines relerred
lo as nelvorks. A nelvork nay have several conlrol elenenls,
bul only one oulpul coil.
19
n lhe exanple progran shovn exanple 0.0, 0.1 and O0.0
represenl lhe lirsl inslruclion conbinalion. l inpuls 0.0 and 0.1
are energized, oulpul relay O0.0 energizes. The inpuls could be
svilches, pushbullons, or conlacl closures. 0.4, 0.5, and O1.1
represenl lhe second inslruclion conbinalion. l eilher inpul
0.4 or 0.5 are energized, oulpul relay O0.1 energizes.
Statement Iist A slalenenl lisl (STL) provides anolher viev ol a sel ol
inslruclions. The operalion, vhal is lo be done, is shovn on lhe
lell. The operand, lhe ilen lo be operaled on by lhe operalion, is
shovn on lhe righl. A conparison belveen lhe slalenenl lisl
shovn belov, and lhe ladder logic shovn on lhe previous page,
reveals a sinilar slruclure. The sel ol inslruclions in lhis
slalenenl lisl perlorn lhe sane lask as lhe ladder diagran.
Function BIock Diagrams Funclion Block Diagrans (FBD) provide anolher viev ol a sel ol
inslruclions. Each lunclion has a nane lo designale ils specilic
lask. Funclions are indicaled by a reclangle. npuls are shovn
on lhe lellhand side ol lhe reclangle and oulpuls are shovn on
lhe righlhand side. The lunclion block diagran shovn belov
perlorns lhe sane lunclion as shovn by lhe ladder diagran
and slalenenl lisl.
20
PLC scan The PLC progran is execuled as parl ol a repelilive process
relerred lo as a scan. A PLC scan slarls vilh lhe CPU reading
lhe slalus ol inpuls. The applicalion progran is execuled using
lhe slalus ol lhe inpuls. Once lhe progran is conpleled, lhe
CPU perlorns inlernal diagnoslics and connunicalion lasks.
The scan cycle ends by updaling lhe oulpuls, lhen slarls over.
The cycle line depends on lhe size ol lhe progran, lhe nunber
ol /Os, and lhe anounl ol connunicalion required.
PLC Scan
Read
Inputs
Update
Outputs
Diagnostics,
Communications
Execute
Program
Software Sollvare is any inlornalion in a lorn lhal a conpuler or PLC
can use. Sollvare includes lhe inslruclions or prograns lhal
direcl hardvare.
Hardware Hardvare is lhe aclual equipnenl. The PLC, lhe progranning
device, and lhe connecling cable are exanples ol hardvare.
21
Memory size Kilo, abbrevialed K, nornally relers lo 1000 unils. vhen lalking
aboul conpuler or PLC nenory, hovever, 1K neans 1024. This
is because ol lhe binary nunber syslen (2
10
=1024). This can be
1024 bils, 1024 byles, or 1024 vords, depending on nenory
lype.
1 Bit
2 Bits
3 Bits
1 Byte
2 Bytes
3 Bytes
1 Word
2 Words
3 Words
1024 Words 1024 Bytes 1024 Bits
1 K Memory 1 K Memory 1 K Memory
RAM Fandon Access enory (FA) is nenory vhere dala can be
direclly accessed al any address. Dala can be vrillen lo and
read lron FA. FA is used as a lenporary slorage area.
FA is volalile, neaning lhal lhe dala slored in FA vill be
losl il pover is losl. A ballery backup is required lo avoid losing
dala in lhe evenl ol a pover loss.
ROM Fead Only enory (FO) is a lype ol nenory lhal dala can
be read lron bul nol vrillen lo. This lype ol nenory is used lo
prolecl dala or prograns lron accidenlal erasure. FO
nenory is nonvolalile. This neans a user progran vill nol lose
dala during a loss ol eleclrical pover. FO is nornally used lo
slore lhe prograns lhal deline lhe capabililies ol lhe PLC.
EPROM Erasable Progrannable Fead Only enory (EPFO) provides
sone level ol securily againsl unaulhorized or unvanled
changes in a progran. EPFOs are designed so lhal dala
slored in lhen can be read, bul nol easily allered. Changing
EPFO dala requires a special ellorl. UVEPFOs (ullraviolel
erasable progrannable read only nenory) can only be erased
vilh an ullraviolel lighl. EEPFO (eleclronically erasable
progrannable read only nenory), can only be erased
eleclronically.
Firmware Firnvare is user or applicalion specilic sollvare burned inlo
EPFO and delivered as parl ol lhe hardvare. Firnvare gives
lhe PLC ils basic lunclionalily.
22
Putting it together The nenory ol lhe S7200 is divided inlo lhree areas: progran
space, dala space, and conligurable paraneler space.
Progran space slores lhe ladder logic (LAD) or slalenenl
lisl (STL) progran inslruclions. This area ol nenory conlrols
lhe vay dala space and /O poinls are used. LAD or STL
inslruclions are vrillen using a progranning device such as
a PC, lhen loaded inlo progran nenory ol lhe PLC.
Dala space is used as a vorking area, and includes nenory
localions lor calculalions, lenporary slorage ol inlernediale
resulls and conslanls. Dala space includes nenory
localions lor devices such as liners, counlers, highspeed
counlers, and analog inpuls and oulpuls. Dala space can be
accessed under progran conlrol.
Conligurable paraneler space, or nenory, slores eilher lhe
delaull or nodilied conliguralion paranelers.
23
Basic Fequiremehts
n order lo creale or change a progran, lhe lolloving ilens are
needed:
PLC
Progranning Device
Progranning Sollvare
Conneclor Cable
Software
STEP 7 - Micro/WIN
Programming
Device
PC/PPI
Connector Cable
S7-200 PLC
PLC Throughoul lhis course ve vill be using lhe S7200 because ol
ils ease ol use.
24
Programming devices The progran is crealed in a progranning device (PG) and lhen
lranslerred lo lhe PLC. The progran lor lhe S7200 can be
crealed using a dedicaled Sienens SATC S7 progranning
device, such as a PG 720 (nol shovn) or PG 740, il STEP 7
icro/v sollvare is inslalled.
A personal conpuler (PC), vilh STEP 7 icro/v inslalled,
can also be used as a progranning device vilh lhe S7200.
25
A Sienens PG 702 handheld progranning device can also be
used. This device uses a Boolean inslruclion sel buill inlo lhe
S7200. A Boolean lunclion is a logic lunclion in vhich lhere are
lvo possible values, O or OFF. The PG 702 is uselul vhen
naking nodilicalions or lroubleshooling lhe PLC. l should be
noled, hovever, lhal lhe PG 702 vill nol nalch all lhe lunclions
ol icro/v.
Software A sollvare progran is required in order lo lell lhe PLC vhal
inslruclions il nusl lollov. Progranning sollvare is lypically
PLC specilic. A sollvare package lor one PLC, or one lanily ol
PLCs, such as lhe S7 lanily, vould nol be uselul on olher PLCs.
The S7200 uses a vindovs based sollvare progran called
STEP 7icro/v. The PG 720 and PG 740 have STEP 7
sollvare preinslalled. The PG 702 progranning device uses a
Boolean inslruclion sel. l is inporlanl lo nole lhal lhe PG 702
does nol nalch all lhe lunclions ol icro/v. icro/v is
inslalled on a personal conpuler in a sinilar nanner lo any
olher conpuler sollvare.
26
Connector cabIes PPI Conneclor cables are required lo lransler dala lron lhe
(point-to-point interface) progranning device lo lhe PLC. Connunicalion can only lake
place vhen lhe lvo devices speak lhe sane language or
prolocol. Connunicalion belveen a Sienens progranning
device and lhe S7200 is relerred lo as PP prolocol (poinllo
poinl inlerlace). An appropriale cable is required lor a
progranning device such as a PG 720, PG 740, or PG 702. The
S7200 uses a 9pin, Dconneclor. This is a slraighllhrough
serial device lhal is conpalible vilh Sienens progranning
devices (P porl) and is a slandard conneclor lor olher serial
inlerlaces.
Programming Device Cable
27
A special cable, relerred lo as a PC/PP cable, is needed vhen a
personal conpuler is used as a progranning device. This cable
allovs lhe serial inlerlace ol lhe PLC lo connunicale vilh lhe
FS232 serial inlerlace ol a personal conpuler. DP svilches on
lhe PC/PP cable are used lo selecl an appropriale speed (baud
rale) al vhich inlornalion is passed belveen lhe PLC and lhe
conpuler.
23
Review 2
1. A svilch or a pushbullon is a ____________ inpul.
2. A lanp or a solenoid is an exanple ol a ___________
oulpul.
3. The ____________ nakes decisions and execules con
lrol inslruclions based on lhe inpul signals.
4. ____________ ____________ is a PLC progranning
language lhal uses conponenls resenbling elenenls
used in a line diagran.
5. A ____________ consisls ol one or nore inslruclions
lhal acconplish a lask.
6. enory is divided inlo lhree areas: ____________ ,
____________ , and ____________ ____________ space.
7. vhen lalking aboul conpuler or PLC nenory, 1K relers
lo ____________ bils, byles, or vords.
3. Sollvare lhal is placed in hardvare is called
____________ .
9. vhich ol lhe lolloving is nol required vhen crealing or
changing a PLC progran?
a. PLC
b. Progranning Device
c. Progranning Sollvare
d. Conneclor Cable
e. Prinler
10. A special cable, relerred lo as a ____________ cable, is
needed vhen a personal conpuler is used as a
progranning device.
29
S/ZJJ ||c|c ||Cs
The S7200 icro PLC is lhe snallesl nenber ol lhe SATC
S7 lanily ol progrannable conlrollers. The cenlral processing
unil (CPU) is inlernal lo lhe PLC. npuls and oulpuls (/O) are lhe
syslen conlrol poinls. npuls nonilor lield devices, such as
svilches and sensors. Oulpuls conlrol olher devices, such as
nolors and punps. The progranning porl is lhe conneclion lo
lhe progranning device.
S7-200 modeIs There are lhree S7200 CPU lypes: S7221, S7222, and S7224.
There are lhree pover supply conliguralions lor each CPU lype.
The nodel descriplion indicales lhe lype ol CPU, lhe pover
supply, lhe lype ol inpul, and lhe lype ol oulpul.
CPU 222 DC/DC/DC
CPU Power Supply
Input Output
ModeI Description Power SuppIy Input Types Output Types
221 DC/DC/DC 20.423.3 VDC 6 DC npuls 4 DC Oulpuls
221 AC/DC/Felay 35264 VAC
4763 Hz
6 DC npuls 4 Felay Oulpuls
222 DC/DC/DC 20.423.3 VDC 3 DC npuls 6 DC Oulpuls
222 AC/DC/Felay 35264 VAC
4763 Hz
3 DC npuls 6 Felay Oulpuls
224 DC/DC/DC 20.423.3 VDC 14 DC npuls 10 DC Oulpuls
224 AC/DC/Felay 35264 VAC
4763 Hz
14 DC npuls 10 Felay Oulpuls
30
S7-200 Features The S7200 lanily includes a vide variely ol CPUs and lealures.
This variely provides a range ol lealures lo aid in designing a
coslelleclive aulonalion solulion. The lolloving lable provides
a sunnary ol lhe najor lealures, nany ol vhich vill be
covered in lhis course.
Feature CPU 221 CPU 222 CPU 224
Program 2048 Words 2048 Words 4096 Words
User Data 1024 Words 1024 Words 2560 Words
Memory Type EEPROM EEPROM EEPROM
Memory Cartridge EEPROM EEPROM EEPROM
Data Backup 50 Hours 50 Hours 190 Hours
Local I/O 6 In/4 Out 8 In/6 Out 14 In 10 Out
Expansion None 2 Modules 7 Modules
Digital I/O Image Size
256 (128 In/128
Out)
256 (128 In/128
Out)
256 (128 In/128
Out)
Digital I/O Physical Size 10 62 128
Analog I/O Image Size None 16 In/16 Out 16 In/16 Out
Analog I/O Physical
Size
None 12 In/12 Out 12 In/12 Out
Boolean Execution
Speed
0.37

s/Inst. 0.37

s/Inst. 0.37

s/Inst.
Internal Relays 256 256 256
Counters/Timers 256/256 256/256 256/256
Sequential Control
Relays
256 256 256
For/Next Loops Yes Yes Yes
Integer Math (+-*/) Yes Yes Yes
Real Math (+-*/) Yes Yes Yes
Built-In High-Speed
Counter
4 (20 KHz) 4 (20 KHz) 6 (20 KHz)
Analog Adjustments 1 1 2
Pulse Outputs 2 (20 KHz, DC) 2 (20 KHz, DC) 2 (20 KHz, DC)
Communication
Interrupts
1 Transmit/2
Receive
1 Transmit/2
Receive
1 Transmit/2
Receive
Timed Interrupts 2 (1ms - 255ms) 2 (1ms - 255ms) 2 (1ms - 255ms)
Hardware Input
Interrupts
4 4 4
Real-Time Clock Yes (Cartridge) Yes (Cartridge) Yes (Built-In)
Password Protection Yes Yes Yes
Number of Ports 1 (RS-485) 1 (RS-485) 1 (RS-485)
Protocols Supported
Port 0
PPI, MPI Slave,
Freeport
PPI, MPI Slave,
Freeport
PPI, MPI Slave,
Freeport
Profibus Peer-to-Peer (NETR/NETW) (NETR/NETW) (NETR/NETW)
Communications
Memory
Total I/O
Instructions
Enhanced Features
Local I/O
31
Mode switch and vhen lhe node svilch is in lhe FU posilion lhe CPU is in lhe
AnaIog adjustment run node and execuling lhe progran. vhen lhe node svilch is
in lhe STOP posilion lhe CPU is slopped. vhen lhe node
svilch is in lhe TEF posilion lhe progranning device can
selecl lhe operaling node.
The analog adjuslnenl is used lo increase or decrease values
slored in special nenory. These values can be used lo updale
lhe value ol a liner or counler, or can be used lo sel linils.
OptionaI Cartridge The S7200 supporls an oplional nenory carlridge lhal
provides a porlable EEPFO slorage lor your progran. The
carlridge can be used lo copy a progran lron one S7200 PLC
lo a like S7200 PLC.
n addilion, lvo olher carlridges are available. A realline clock
vilh ballery is available lor use on lhe S7221 and S7222. The
ballery provides up lo 200 days ol dala relenlion line in lhe
evenl ol a pover loss. The S7224 has a realline clock buill in.
Anolher carlridge is available vilh a ballery only.
32
Expansion moduIes The S7200 PLCs are expandable. Expansion nodules conlain
addilional inpuls and oulpuls. These are connecled lo lhe base
unil using a ribbon conneclor.
The ribbon conneclor is prolecled by a cover on lhe base unil.
Sidebyside nounling conplelely encloses and prolecls lhe
ribbon conneclor.
33
AvaiIabIe expansion The S7221 cones vilh 6 digilal inpuls and 4 digilal oulpuls.
These are nol expandable. The S7222 cones vilh 3 digilal
inpuls and 6 digilal oulpuls. The 222 vill accepl up lo 2
expansion nodules. The S7224 cones vilh 14 digilal inpuls
and 10 digilal oulpuls. The 224 vill accepl up lo 7 expansion
nodules.
EM
EM EM EM
EM
EM EM EM EM
CPU 222
CPU 224
CPU 221
8 Inputs, 6 Outputs
Accepts up to 2
Expansion Modules (EM)
14 Inputs, 10 Outputs
Accepts up to 7
Expansion Modules (EM)
6 Inputs, 4 Outputs
No Expansion
Status indicators The CPU slalus indicalors rellecl lhe currenl node ol CPU
operalion. l, lor exanple, lhe node svilch is sel lo lhe FU
posilion, lhe green FU indicalor is lil. vhen lhe node svilch
is sel lo lhe STOP posilion, lhe yellov STOP indicalor is lil.
The /O slalus indicalors represenl lhe On or Oll slalus ol
corresponding inpuls and oulpuls. vhen lhe CPU senses an
inpul is on, lhe corresponding green indicalor is lil.
34
InstaIIing The S7200 can be inslalled in one ol lvo vays. A D clip
allovs inslallalion on a slandard D rail. The D clip snaps
open lo allov inslallalion and snaps closed lo secure lhe unil on
lhe rail. The S7200 can also be panel nounled using inslallalion
holes localed behind lhe access covers.
ExternaI power suppIy An S7200 can be connecled lo eilher a 24 VDC or a 120/230
sources VAC pover supply depending on lhe CPU. An S7200 DC/DC/
DC vould be connecled lo a 24 VDC pover supply. The pover
supply lerninals are localed on lhe lar righl side ol lhe lop
lerninal slrip.
An S7200 AC/DC/Felay vould be connecled lo a 120 or 230
VAC pover supply.
35
I/O numbering S7200 inpuls and oulpuls are labeled al lhe viring lerninalions
and nexl lo lhe slalus indicalors. These alphanuneric synbols
idenlily lhe /O address lo vhich a device is connecled. This
address is used by lhe CPU lo delernine vhich inpul is presenl
and vhich oulpul needs lo be lurned on or oll. I designales a
discrele inpul and O designales a discrele oulpul. The lirsl
nunber idenlilies lhe byle, lhe second nunber idenlilies lhe
bil. npul 0.0, lor exanple, is byle 0, bil 0.
0.0 = Byle 0, Bil 0
0.1 = Byle 0, Bil 1
1.0 = Byle 1, Bil 0
1.1 = Byle 1, Bil 1
The lolloving lable idenlilies lhe inpul and oulpul designalions.
Inputs npul devices, such as svilches, pushbullons, and olher sensor
devices are connecled lo lhe lerninal slrip under lhe bollon
cover ol lhe PLC.
0.0 1sL npuL 1.0 9Lh npuL O0.0 1sL OuLpuL O1.0 9Lh OuLpuL
0.1 2nd npuL 1.1 10Lh npuL O0.1 2nd OuLpuL O1.1 10Lh OuLpuL
0.2 3rd npuL 1.2 11Lh npuL O0.2 3rd OuLpuL
0.3 4Lh npuL 1.3 12Lh npuL O0.3 4Lh OuLpuL
0.4 5Lh npuL 1.4 13Lh npuL O0.4 5Lh OuLpuL
0.5 6Lh npuL 1.5 14Lh npuL O0.5 6Lh OuLpuL
0.6 7Lh npuL O0.6 7Lh OuLpuL
0.7 3lh npul O0.7 3lh Oulpul
36
Input simuIator A convenienl nelhod ol lesling a progran is lo vire loggle
svilches lo lhe inpuls. npul sinulalors vilh previred loggle
svilches are available lor lhe S7200s. Svilches are vired
belveen lhe 24 VDC pover supply (L+) and lhe inpuls. For
exanple, lhe svilch on lhe lar lell is vired belveen lhe lirsl
inpul (0.0) and L+. vhen lhe svilch is closed, 24 VDC is
applied lo lhe inpul. This is relerred lo as a logic 1. vhen lhe
svilch is open, 0 VDC is applied lo lhe inpul. This is relerred lo
as a logic 0.
Outputs Oulpul devices, such as relays, are connecled lo lhe lerninal
slrip under lhe lop cover ol lhe PLC. vhen lesling a progran, il
is nol necessary lo connecl oulpul devices. The LED slalus
indicalors signal il an oulpul is aclive.
37
OptionaI connector An oplional lanoul conneclor allovs lor lield viring conneclions
lo renain lixed vhen renoving or replacing an S7221 or 222.
The appropriale conneclor slides inlo eilher lhe inpul, oulpul, or
expansion nodule lerninals.
RemovabIe TerminaI Strip The S7224 does nol have an oplional lanoul conneclor.
nslead, lhe lerninal slrips are renovable. This allovs lhe lield
viring conneclions lo renain lixed vhen renoving or replacing
lhe S7224.
33
Super capacitor A super capacilor, so naned because ol ils abilily lo nainlain a
charge lor a long period ol line, prolecls dala slored in FA in
lhe evenl ol a pover loss. The FA nenory is lypically backed
up on lhe S7221 and 222 lor 50 hours, and on lhe S7224 lor
72 hours.
Executed
Program
Current
Data
Memory
bits,
timers,
counters
Program
backup
Program
and
parameters
Parameters
RAM EEPROM
Optional EEPROM
Memory Cartridge
Super
Capacitor
Reference manuaI The SIMATIC S7-200 ProgrammabIe ControIIer System
ManuaI provides conplele inlornalion on inslalling and
progranning lhe S7200 PLCs.
39
Review 3
1. The lhree nodels ol S7200 are ____________ ,
____________ and ____________ .
2. vhich ol lhe lolloving is nol available on an S7221?
a. ode Svilch
b. Expansion Porl
c. Progranning Porl
d. Slalus ndicalors
3. An S7222 can have a naxinun ol ____________
expansion nodules and an S7224 can have a
naxinun ol ____________ expansion nodules.
4. An S7222 has ____________ DC inpuls and
____________ DC oulpuls.
5. An S7224 has ____________ DC inpuls and
____________ DC oulpuls.
6. The lourlh oulpul ol an S7200 vould be labeled
____________ .
7. S7200 can be panel nounled or inslalled on a
____________ rail.
3. A super capacilor vill nainlained dala slored in FA
lor up ____________ hours on an S7222 and up lo
____________ hours on an S7224.
40
Cohhectihg Exterhal Devices
TD200 The S7200 progranning porl can be used lo connunicale
vilh a variely ol exlernal devices. One such device is lhe TD200
lexl display unil. The TD200 displays nessages read lron lhe
S7200, allovs adjuslnenl ol designaled progran variables,
provides lhe abilily lo lorce, and pernils selling ol lhe line and
dale. The TD200 can be connecled lo an exlernal pover supply
or receive ils pover lron lhe S7200.
Freeport mode The progranning porl has a node called lreeporl node.
Freeporl node allovs conneclivily lo various inlelligenl sensing
devices such as a bar code reader.
41
Printer Freeporl node can also be used lo connecl lo a nonSATC
prinler.
Interconnection l is possible lo use one progranning device lo address
nulliple S7200 devices on lhe sane connunicalion cable. A
lolal ol 31 unils can be inlerconnecled vilhoul a repealer.
42
Frogrammihg A FLC
STEP 7icro/v is lhe progran sollvare used vilh lhe S7
200 PLC lo creale lhe PLC operaling progran. STEP 7 consisls
ol a nunber ol inslruclions lhal nusl be arranged in a logical
order lo oblain lhe desired PLC operalion. These inslruclions are
divided inlo lhree groups: slandard inslruclions, special
inslruclions, and highspeed inslruclions.
Standard instructions Slandard inslruclions consisls ol inslruclions lhal are lound in
nosl prograns. Slandard inslruclions include, liner, counler,
nalh, logical, increnenl/decrenenl/inverl, nove, and block
inslruclions.
SpeciaI instructions Special inslruclions are used lo nanipulale dala. Special
inslruclions include shill, lable, lind, conversion, lor/nexl, and
realline inslruclions.
High-speed instructions Highspeed inslruclions allov lor evenls and inlerrupls lo occur
independenl ol lhe PLC scan line. These include highspeed
counlers, inlerrupls, oulpul, and lransnil inslruclions.
l is nol lhe purpose ol lhis lexl lo explain all ol lhe inslruclions
and capabililies. A lev ol lhe nore connon inslruclions
necessary lor a basic underslanding ol PLC operalion vill be
discussed. PLC operalion is liniled only by lhe hardvare
capabililies and lhe ingenuily ol lhe person progranning il.
Feler lo lhe SIMATIC S7-200 ProgrammabIe ControIIer
System ManuaI lor delailed inlornalion concerning lhese
inslruclions.
43
Micro/WIN The progranning sollvare can be run Ollline or Online. Oll
line progranning allovs lhe user lo edil lhe ladder diagran and
perlorn a nunber ol nainlenance lasks. The PLC does nol
need lo be connecled lo lhe progranning device in lhis node.
Online progranning requires lhe PLC lo be connecled lo lhe
progranning device. n lhis node progran changes are
dovnloaded lo lhe PLC. n addilion, slalus ol lhe inpul/oulpul
elenenls can be nonilored. The CPU can be slarled, slopped,
or resel.
SymboIs n order lo undersland lhe inslruclions a PLC is lo carry oul, an
underslanding ol lhe language is necessary. The language ol
PLC ladder logic consisls ol a connonly used sel ol synbols
lhal represenl conlrol conponenls and inslruclions.
Contacts One ol lhe nosl conlusing aspecls ol PLC progranning lor
lirslline users is lhe relalionship belveen lhe device lhal
conlrols a slalus bil and lhe progranning lunclion lhal uses a
slalus bil. Tvo ol lhe nosl connon progranning lunclions are
lhe nornally open (O) conlacl and lhe nornally closed (C)
conlacl. Synbolically, pover llovs lhrough lhese conlacls
vhen lhey are closed. The nornally open conlacl (O) is lrue
(closed) vhen lhe inpul or oulpul slalus bil conlrolling lhe
conlacl is 1. The nornally closed conlacl (C) is lrue (closed)
vhen lhe inpul or oulpul slalus bil conlrolling lhe conlacl is 0.
Normally Open
(NO)
Normally Closed
(NC)
44
CoiIs Coils represenl relays lhal are energized vhen pover llovs lo
lhen. vhen a coil is energized, il causes a corresponding
oulpul lo lurn on by changing lhe slale ol lhe slalus bil
conlrolling lhal oulpul lo 1. Thal sane oulpul slalus bil nay be
used lo conlrol nornally open and nornally closed conlacls
elsevhere in lhe progran.
Boxes Boxes represenl various inslruclions or lunclions lhal are
execuled vhen pover llovs lo lhe box. Typical box lunclions
are liners, counlers, and nalh operalions.
Entering eIements Conlrol elenenls are enlered in lhe ladder diagran by
posilioning lhe cursor and selecling lhe elenenl lron a lisls. n
lhe lolloving exanple lhe cursor has been placed in lhe
posilion lo lhe righl ol 0.2. A coil vas selecled lron a pull
dovn lisl and inserled in lhis posilion.
Network 1
Network 2
I0.0 I0.1
I0.2
Q0.0
Cursor
45
An AND operation Each rung or nelvork on a ladder represenls a logic operalion.
The lolloving progranning exanple denonslrales an AD
operalion. Tvo conlacl closures and one oulpul coil are placed
on nelvork 1. They vere assigned addresses 0.0, 0.1, and
O0.0. ole lhal in lhe slalenenl lisl a nev logic operalion
alvays begins vilh a load inslruclion (LD). n lhis exanple 0.0
(inpul 1) and (A in lhe slalenenl lisl) 0.1 (inpul 2) nusl be lrue
in order lor oulpul O0.0 (oulpul 1) lo be lrue. l can also be seen
Thal 0.0 and 0.1 nusl be lrue lor O0.0 lo be lrue by looking al
lhe lunclion block diagran represenlalion.
Network 1
Network 1
Network 1
LD I0.0
A I0.1
= Q0.0
I0.0
I0.0
I0.1
I0.1
Q0.0
Q0.0
Ladder Diagram Representation
Statement List Representation
Function Block Diagram Representation
AND
Anolher vay lo see hov an AD lunclion vorks is vilh a
Boolean logic diagran. n Boolean logic an AD gale is
represenled by a nunber ol inpuls on lhe lell side. n lhis case
lhere are lvo inpuls. The oulpul is represenled on lhe righl
side. l can be seen lron lhe lable lhal bolh inpuls nusl be a
logic 1 in order lor lhe oulpul lo be a logic 1.
I0.0
I0.0
I0.1
I0.1
Q0.0
Q0.0
0
0
1
1
0
1
0
1
0
0
0
1
And (A) Function
Input 1
Input 1
Input 2
Input 2
Output 1
Output 1
0
0
1
1
0
1
0
1
0
0
0
1
And (A) Function
46
An OR operation n lhis exanple an OF operalion is used in nelvork 1. l can be
seen lhal il eilher inpul 0.2 (inpul 3) or (O in lhe slalenenl lisl)
inpul 0.3 (inpul 4), or bolh are lrue, lhen oulpul O0.1 (oulpul 2)
vill be lrue.
Network 1
Network 1
Network 1
LD I0.2
O I0.3
= Q0.1
I0.2
I0.2
I0.3
I0.3
Q0.1
Q0.1
Ladder Diagram Representation
Statement List Representation
Function Block Diagram Representation
OR
Anolher vay lo see hov an OF lunclion vorks is vilh a
Boolean logic diagran. The synbol dillers slighlly lron an AD
lunclion. The OF lunclion is represenled by a nunber ol inpuls
on lhe lell side. n lhis case lhere are lvo inpuls. The oulpul is
represenled on lhe righl side. l can be seen lron lhe lable lhal
any inpul can be a logic 1 in order lor lhe oulpul lo be a logic 1.
Input 3
Input 3
Input 4
Input 4
Output 2
Output 2
0
0
1
1
0
1
0
1
0
1
1
1
Or (O) Function
I0.4
I0.4
I0.5
I0.5
Q0.1
Q0.1
0
0
1
1
0
1
0
1
0
1
1
1
Or (O) Function
47
Testing a program Once a progran has been vrillen il needs lo be lesled and
debugged. One vay lhis can be done is lo sinulale lhe lield
inpuls vilh an inpul sinulalor, such as lhe one nade lor lhe S7
200. The progran is lirsl dovnloaded lron lhe progranning
device lo lhe CPU. The seleclor svilch is placed in lhe FU
posilion. The sinulalor svilches are operaled and lhe resulling
indicalion is observed on lhe oulpul slalus indicalor lanps.
Status functions Aller a progran has been loaded and is running in lhe PLC, lhe
aclual slalus ol ladder elenenls can be nonilored using STEP 7
icro/v sollvare. The slandard nelhod ol shoving a ladder
elenenl is by indicaling lhe circuil condilion il produces vhen
lhe device is in lhe deenergized or nonoperaled slale. n lhe
lolloving illuslralion inpul 1 (I0.0) is progranned as a nornally
open (O) conlacl. n lhis condilion, pover vill nol llov lhrough
lhe conlacls lo lhe oulpul (O0.0).
43
vhen vieving lhe ladder diagran in lhe slalus node, conlrol
elenenls lhal are aclive, or lrue (logic 1), are highlighled. n lhe
exanple shovn lhe loggle svilch connecled lo inpul 1 has
been closed. Pover can nov llov lhrough lhe conlrol elenenl
associaled vilh inpul 1 (0.0) and aclivale lhe oulpul (O0.0). The
lanp vill illuninale.
Forcing Forcing is anolher uselul lool in lhe connissioning ol an
applicalion. l can be used lo lenporarily override lhe inpul or
oulpul slalus ol lhe applicalion in order lo lesl and debug lhe
progran. The lorce lunclion can also be used lo override
discrele oulpul poinls. The lorce lunclion can be used lo skip
porlions ol a progran by enabling a junp inslruclion vilh a
lorced nenory bil. Under nornal circunslances lhe loggle
svilch, shovn in lhe illuslralion belov, vould have lo be closed
lo enable inpul 1 (I0.0) and lurn on lhe oulpul lighl. Forcing
enables inpul 1 even lhough lhe inpul loggle svilch is open.
vilh inpul 1 lorced high lhe oulpul lighl vill illuninale. vhen a
lunclion is lorced lhe conlrol bil idenlilier is highlighled. The
elenenl is also highlighled because il is on.
49
The lolloving lable shovs lhe appearance ol ladder elenenls in
lhe Oll, lorced, and On condilion.
50
Discrete lhputs/Outputs
To undersland discrele conlrol ol a progrannable conlroller lhe
sane sinple lanp circuil illuslraled vilh lorcing vill be used.
This is only lor inslruclional purposes as a circuil lhis sinple
vould nol require a progrannable conlroller. n lhis exanple
lhe lanp is oll vhen lhe svilch is open and on vhen lhe
svilch is closed.
Toggle
Switch
PLC Lamp
Wiring To acconplish lhis lask, a svilch is vired lo lhe inpul ol lhe
PLC and an indicalor lighl is vired lo oulpul lerninal.
Light
Switch
51
The lolloving draving illuslrales lhe sequence ol evenls. A
svilch is vired lo lhe inpul nodule ol lhe PLC. A lanp is vired
lo lhe oulpul nodule. The progran is in lhe CPU. The CPU
scans lhe inpuls. vhen il linds lhe svilch open 0.0 receives a
binary 0. This inslrucls O0.0 lo send a binary 0 lo lhe oulpul
nodule. The lanp is oll. vhen il linds lhe svilch closed 0.0
receives a binary 1. This inslrucls O0.0 lo send a binary 1 lo lhe
oulpul nodule, lurning on lhe lanp.
Program instruction vhen lhe svilch is open lhe CPU receives a logic 0 lron inpul
0.0. The CPU sends a logic 0 lo oulpul O0.0 and lhe lighl is oll.
I0.0 Q0.0
Network 1
LD
=
I0.0
Q0.0
vhen lhe svilch is closed lhe CPU receives a logic 1 lron
inpul 0.0. The CPU sends a logic 1 lo oulpul O0.0, lhus
aclivaling O0.0. The lighl lurns on.
I0.0 Q0.0
Network 1
LD
=
I0.0
Q0.0
52
Motor starter exampIe The lolloving exanple involves a nolor slarl and slop circuil.
The line diagran illuslrales hov a nornally open and a nornally
closed pushbullon nighl be used in a conlrol circuil. n lhis
exanple a nolor slarled () is vired in series vilh a nornally
open nonenlary pushbullon (Slarl), a nornally closed
nonenlary pushbullon (Slop), and lhe nornally closed
conlacls ol an overload relay (OL).
L1
T1
T2
T3
L2
L3
OL
OL
OL
OL
M
M
M
Ma
M
Motor
Start
Stop
onenlarily depressing lhe Slarl pushbullon conpleles lhe
palh ol currenl llov and energizes lhe nolor slarler ().
53
This closes lhe associaled and a (auxiliary conlacl localed
in lhe nolor slarler) conlacls. vhen lhe Slarl bullon is released
a holding circuil exisls lo lhe conlaclor lhrough lhe auxiliary
conlacls a. The nolor vill run unlil lhe nornally closed Slop
bullon is depressed, or lhe overload relay opens lhe OL
conlacls, breaking lhe palh ol currenl llov lo lhe nolor slarler
and opening lhe associaled and a conlacls.
L1
T1
T2
T3
L2
L3
OL
OL
OL
OL
M
M
M
Ma
M
Motor
Start
Stop
This conlrol lask can also be acconplished vilh a PLC.
PLC
Start/Stop Pushbuttons
(Sensors)
Motor Starter
(Acuator)
Motor
Input
Output
54
Program instruction A nornally open Slarl Pushbullon is vired lo lhe lirsl inpul
(0.0), a nornally closed Slop Pushbullon is vired lo lhe second
inpul (0.1), and nornally closed overload relay conlacls (parl ol
lhe nolor slarler) are connecled lo lhe lhird inpul (0.2). The
lirsl inpul (0.0), second inpul (0.1), and lhird inpul (0.2) lorn
an AD circuil and are used lo conlrol nornally open
progranning lunclion conlacls on elvork 1. 0.1 slalus bil is a
logic 1 because lhe nornally closed (C) Slop Pushbullon is
closed. 0.2 slalus bil is a logic 1 because lhe nornally closed
(C) overload relay (OL) conlacls are closed. Oulpul O0.0 is
also progranned on elvork 1. n addilion, a nornally open sel
ol conlacls associaled vilh O0.0 is progranned on elvork 1
lo lorn an OF circuil. A nolor slarler is connecled lo oulpul
O0.0.
Input Output
Network 1
CPU
I0.0 I0.1 I0.2
I0.0
I0.1
I0.2
Q0.0
Q0.0
Q0.0
Start (NO)
OL
Stop (NC)
Motor
Starter
to Motor
vhen lhe Slarl Pushbullon is depressed lhe CPU receives a
logic 1 lron inpul 0.0. This causes lhe 0.0 conlacl lo close. All
lhree inpuls are nov a logic 1. The CPU sends a logic 1 lo
oulpul O0.0. The nolor slarler is energized and lhe nolor
slarls.
Input Output
Network 1
CPU
I0.0 I0.1 I0.2
I0.0
I0.1
I0.2
Q0.0
Q0.0
Q0.0
Start (NO)
OL
Stop (NC)
Motor
Starter
to Motor
55
vhen lhe Slarl pushbullon is pressed, oulpul O0.0 is nov lrue
and on lhe nexl scan, vhen nornally open conlacl O0.0 is
solved, lhe conlacl vill close and oulpul O0.0 vill slay on even
il lhe Slarl Pushbullon has been released.
Input Output
Network 1
CPU
I0.0 I0.1 I0.2
I0.0
I0.1
I0.2
Q0.0
Q0.0
Q0.0
Start (NO)
OL
Stop (NC)
Motor
Starter
to Motor
The nolor vill conlinue lo run unlil lhe Slop Pushbullon is
depressed. npul 0.1 vill nov be a logic 0 (lalse). The CPU vill
send a binary 0 lo oulpul O0.0. The nolor vill lurn oll.
Input Output
Network 1
CPU
I0.0 I0.1 I0.2
I0.0
I0.1
I0.2
Q0.0
Q0.0
Q0.0
Start (NO)
OL
Stop (NC)
Motor
Starter
to Motor
56
vhen lhe Slop Pushbullon is released 0.1 logic lunclion vill
again be lrue and lhe progran ready lor lhe nexl line lhe Slarl
Pushbullon is pressed.
Input Output
Network 1
CPU
I0.0 I0.1 I0.2
I0.0
I0.1
I0.2
Q0.0
Q0.0
Q0.0
Start (NO)
OL
Stop (NC)
Motor
Starter
to Motor
Expanding the appIication The applicalion can be easily expanded lo include indicalor
lighls lor FU and STOP condilions. n lhis exanple a FU
indicalor lighl is connecled lo oulpul O0.1 and a STOP indicalor
lighl is connecled lo oulpul O0.2.
PLC
Start/Stop Pushbuttons
(Sensors)
Motor Starter
(Acuator)
Motor
Input
Output
Indicator Lights
57
l can be seen lron lhe ladder logic lhal a nornally open oulpul
O0.0 is connecled on elvork 2 lo oulpul O0.1 and a nornally
closed O0.0 conlacl is connecled lo oulpul O0.2 on nelvork 3.
n a slopped condilion oulpul O0.0 is oll. The nornally open
O0.0 conlacls on elvork 2 are open and lhe FU indicalor,
connecled lo oulpul O0.1 lighl is oll. The nornally closed O0.1
on elvork 3 lighls are closed and lhe STOP indicalor lighl,
connecled lo oulpul O0.2 is on.
Input Output
Network 1
Network 2
Network 3
CPU
I0.0 I0.1 I0.2
I0.0
I0.1
I0.2
Q0.0
Q0.0
Q0.0
Start (NO)
OL
Stop (NC)
Motor
Starter
to Motor
RUN Indicator
STOP Indicator
Q0.1
Q0.2
Q0.1
Q0.2
Q0.0
Q0.0
53
vhen lhe PLC slarls lhe nolor oulpul O0.0 is nov a logic high
(On). The nornally open O0.0 conlacls on elvork 2 nov
svilch lo a logic 1 (closed) and oulpul O0.1 lurns lhe FU
indicalor on. The nornally closed O0.0 conlacls on elvork 3
svilch lo a logic 0 (open) and lhe STOP indicalor lighl
connecled lo oulpul O0.2 is nov oll.
Input Output
Network 1
Network 2
Network 3
CPU
I0.0 I0.1 I0.2
I0.0
I0.1
I0.2
Q0.0
Q0.0
Q0.0
Start (NO)
OL
Stop (NC)
Motor
Starter
to Motor
RUN Indicator
STOP Indicator
Q0.1
Q0.2
Q0.1
Q0.2
Q0.0
Q0.0
Adding a Iimit switch The applicalion can be lulher expanded by adding a linil svilch
vilh nornally open conlacls lo inpul 0.3.
PLC
Start/Stop Pushbuttons
(Sensors)
Motor Starter
(Acuator)
Motor
Input
Output
Indicator Lights
Limit Switch
59
A linil svilch could be used lo slop lhe nolor or prevenl lhe
nolor lron being slarled. An access door lo lhe nolor, or ils
associaled equipnenl, is one exanple ol a linil svilchs use. l
lhe access door is open, lhe nornally open conlacls ol LS1
connecled lo inpul 0.3 are open and lhe nolor vill nol slarl.
Input
Output
Network 1
Network 2
Network 3
CPU
I0.0 I0.1 I0.2 I0.3
I0.0
I0.1
I0.2
I0.3
Q0.0
Q0.0
Q0.0
Start (NO)
OL
LS1
Stop (NC)
Motor
Starter
to Motor
RUN Indicator
STOP Indicator
Q0.1
Q0.2
Q0.1
Q0.2
Q0.0
Q0.0
vhen lhe access door is closed, lhe nornally open conlacls on
lhe linil svilch (LS1) are closed. npul 0.3 is nov on (logic 1),
and lhe nolor vill slarl vhen lhe Slarl pushbullon is pressed.
Input
Output
Network 1
Network 2
Network 3
CPU
I0.0 I0.1 I0.2 I0.3
I0.0
I0.1
I0.2
I0.3
Q0.0
Q0.0
Q0.0
Start (NO)
OL
LS1
Stop (NC)
Motor
Starter
to Motor
RUN Indicator
STOP Indicator
Q0.1
Q0.2
Q0.1
Q0.2
Q0.0
Q0.0
60
The PLC progran can be expanded lo acconodale nany
connercial and induslrial applicalions. Addilional Slarl/Slop
Pushbullons and indicalor lighls can be added lor renole
operalion, or conlrol ol a second nolor slarler and nolor.
Overlravel linil svilches can be added along vilh proxinily
svilches lor sensing objecl posilion. The applicalions are only
liniled by lhe nunber ol /Os and anounl ol nenory available
on lhe PLC.
61
Review 4
1. denlily lhe lolloving synbols:
a. ____________
b. ____________
c. ____________
2. n a slalenenl lisl each nev logic operalion begins vilh
a ____________ inslruclion.
3. Conplele lhe lolloving lables:
4. n lhe lolloving inslruclion O0.0 vill be lrue (logic 1)
vhen ____________ or ____________ is lrue, and vhen
____________ is lrue.
62
Ahalog lhputs ahd Outputs
PLCs nusl also vork vilh conlinuous or analog signals. Typical
analog signals are 0 10 VDC or 4 20 nA. Analog signals are
used lo represenl changing values such as speed, lenperalure,
veighl, and level. A PLC cannol process lhese signals in an
analog lorn. The PLC nusl converl lhe analog signal inlo a
digilal represenlalion. An expansion nodule, capable ol
converling lhe analog signal, nusl be used. The S7200
converls analog values inlo a 12bil digilal represenlalion. The
digilal values are lranslerred lo lhe PLC lor use in regisler or
vord localions.
I/O Module
63
AnaIog inputs A lield device lhal neasures a varying value is lypically
connecled lo a lransducer. n lhe lolloving exanple a scale is
connecled lo a load cell. A load cell is a device lhal lakes a
varying value and converls il lo a variable vollage or currenl
oulpul. n lhis exanple lhe load cell is converling a value ol
veighl inlo a 0 10 VDC oulpul. The oulpul value depends
enlirely on lhe nanulaclured specilicalions lor lhe device. This
load cell oulpuls 0 10 VDC lor a 0 500 Lbs inpul. The 0 10
VDC load cell oulpul is connecled lo lhe inpul ol an analog
expansion nodule.
AppIication exampIe An exanple ol an analog inpul can be seen in lhe lolloving
illuslralion. As packages nove along a conveyor lhey are
veighed. A package lhal veighs al or grealer lhan a specilied
value is rouled along one conveyor palh. A package lhal veighs
less lhan a specilied value is rouled along anolher conveyor
palh, vhere il vill laler be inspecled lor nissing conlenls.
64
AnaIog outputs Analog oulpuls are used in applicalions requiring conlrol
capabilily ol lield devices vhich respond lo conlinuous vollage
or currenl levels. Analog oulpuls nay be used as a variable
relerence lor conlrol valves, charl recorders, eleclric nolor
drives, analog nelers, and pressure lransducers. Like analog
inpuls, analog oulpuls are generally connecled lo a conlrolling
device lhrough a lransducer. The lransducer lakes lhe vollage
signal and, depending on lhe requirenenl, anplilies, reduces,
or changes il inlo anolher signal vhich conlrols lhe device. n
lhe lolloving exanple a 0 10 VDC signal conlrols a 0 500 Lbs.
scale analog neler.
Weight
0 - 500 Lbs
0 - 10 VDC
PLC
Analog Output
Transducer
Voltage - Weight
Analog Weight
Meter
65
Timers
Tiners are devices lhal counl increnenls ol line. Trallic lighls
are one exanple vhere liners are used. n lhis exanple liners
are used lo conlrol lhe lenglh ol line belveen signal changes.
Tiners are represenled by boxes in ladder logic. vhen a liner
receives an enable, lhe liner slarls lo line. The liner conpares
ils currenl line vilh lhe presel line. The oulpul ol lhe liner is
a logic 0 as long as lhe currenl line is less lhan lhe presel line.
vhen lhe currenl line is grealer lhan lhe presel line lhe liner
oulpul is a logic 1. S7200 uses lhree lypes ol liners: OnDelay
(TO), Felenlive OnDelay (TOF), and OllDelay (TOF).
66
S7-200 timers S7200 liners are provided vilh resolulions ol 1 nillisecond, 10
nilliseconds, and 100 nilliseconds. The naxinun value ol
lhese liners is 32.767 seconds, 327.67 seconds, and 3276.7
seconds, respeclively. By adding progran elenenls, logic can
be progranned lor nuch grealer line inlervals.
Hard-wired timing circuit Tiners used vilh PLCs can be conpared lo lining circuils used
in hardvired conlrol line diagrans. n lhe lolloving exanple, a
nornally open (O) svilch (S1) is used vilh a liner (TF1). For
lhis exanple lhe liner has been sel lor 5 seconds. vhen S1 is
closed, TF1 begins lining. vhen 5 seconds have elapsed, TF1
vill close ils associaled nornally open TF1 conlacls,
illuninaling pilol lighl PL1. vhen S1 is open, deenergizing TF1,
lhe TF1 conlacls open, innedialely exlinguishing PL1. This lype
ol liner is relerred lo as O delay. O delay indicales lhal once
a liner receives an enable signal, a predelernined anounl ol
line (sel by lhe liner) nusl pass belore lhe liners conlacls
change slale.
On-DeIay (TON) vhen lhe OnDelay liner (TO) receives an enable (logic 1) al
ils inpul (), a predelernined anounl ol line (presel line PT)
passes belore lhe liner bil (Tbil) lurns on. The Tbil is a logic
lunclion inlernal lo lhe liner and is nol shovn on lhe synbol.
The liner resels lo lhe slarling line vhen lhe enabling inpul
goes lo a logic 0.
67
n lhe lolloving sinple liner exanple, a svilch is connecled lo
inpul 0.3, and a lighl is connecled lo oulpul O0.1.
vhen lhe svilch is closed inpul 4 becones a logic 1, vhich is
loaded inlo liner T37. T37 has a line base ol 100 ns (.100
seconds). The presel line (PT) value has been sel lo 150. This is
equivalenl lo 15 seconds (.100 x 150 ). The lighl vill lurn on 15
seconds aller lhe inpul svilch is closed. l lhe svilch vere
opened belore 15 seconds had passed, lhen reclosed, lhe liner
vould again begin lining al 0.
T37
150
I0.3
Q0.1
TON
T37
IN
PT
63
A snall sanple ol lhe llexibilily ol PLCs is shovn in lhe
lolloving progran logic. By reprogranning lhe T37 conlacl as a
nornally closed conlacl, lhe lunclion ol lhe circuil is changed lo
cause lhe indicalor lighl lo lurn oll only vhen lhe liner lines
oul. This lunclion change vas acconplished vilhoul changing
or reviring /O devices.
T37
150
I0.3
Q0.1
TON
T37
IN
PT
Retentive On-DeIay (TONR) The Felenlive OnDelay liner (TOF) lunclions in a sinilar
nanner lo lhe OnDelay liner (TO). There is one dillerence.
The Felenlive OnDelay liner lines as long as lhe enabling
inpul is on, bul does nol resel vhen lhe inpul goes oll. The
liner nusl be resel vilh a FESET (F) inslruclion.
69
The sane exanple used vilh lhe OnDelay liner vill be used
vilh lhe Felenlive OnDelay liner. vhen lhe svilch is closed al
inpul 0.3, liner T5 (Felenlive liner) begins lining. l, lor
exanple, aller 10 seconds inpul 0.3 is opened lhe liner slops.
vhen inpul 0.3 is closed lhe liner vill begin lining al 10
seconds. The lighl vill lurn on 5 seconds aller inpul 0.3 has
been closed lhe second line. A FESET (F) inslruclion can be
added. Here a pushbullon is connecled lo inpul 0.2. l aller 10
seconds inpul 0.3 vere opened, T5 can be resel by
nonenlarily closing inpul 0.2. T5 vill be resel lo 0 and begin
lining lron 0 vhen inpul 0.3 is closed again.
T5
T5
150
I0.3
I0.2
Q0.1
R
TONR
T5
IN
PT
Off-DeIay (TOF) The OllDelay liner is used lo delay an oulpul oll lor a lixed
period ol line aller lhe inpul lurns oll. vhen lhe enabling bil
lurns on lhe liner bil lurns on innedialely and lhe value is sel
lo 0. vhen lhe inpul lurns oll, lhe liner counls unlil lhe presel
line has elapsed belore lhe liner bil lurns oll.
TOF
TXXX
IN
PT
70
S7-200 timers The S7200s have 256 liners. The specilic T nunber chosen lor
lhe liner delernines ils line base and vhelher il is TO,
TOF, or TOF.
Timer exampIe n lhe lolloving exanple a lank vill be lilled vilh lvo
chenicals, nixed, and lhen drained. vhen lhe Slarl Bullon is
pressed al inpul 0.0, lhe progran slarls punp 1 conlrolled by
oulpul O0.0. Punp 1 runs lor 5 seconds, lilling lhe lank vilh
lhe lirsl chenical, lhen shuls oll. The progran lhen slarls punp
2, conlrolled by oulpul O0.1. Punp 2 runs lor 3 seconds lilling
lhe lank vilh lhe second chenical. Aller 3 seconds punp 2
shuls oll. The progran slarls lhe nixer nolor, connecled lo
oulpul O0.2 and nixes lhe lvo chenicals lor 60 seconds. The
progran lhen opens lhe drain valve conlrolled by oulpul O0.3,
and slarls punp 3 conlrolled by oulpul O0.4. Punp 3 shuls oll
aller 3 seconds and lhe process slops. A nanual Slop svilch is
also provided al inpul 0.1.
Timer Type Resolution Maximum Value Timer Number
1 ms 32.767 seconds T0, T64
10 ms 327.67 seconds T1-T4, T65-T68
100 ms 3276.7 seconds T5-T31, T69-T95
1 ms 32.767 seconds T32, T96
10 ms 327.67 seconds T33-T36, T97-T100
100 ms 3276.7 seconds T37-T63, T101-T255
TONR
TON, TOF
71
Review 5
1. Analog signals are converled inlo a ____________
lornal by lhe PLC.
2. Three lypes ol liners available in lhe S7200 are On
Delay, ____________ OnDelay, and ____________
Delay.
3. The naxinun line available on a 100 nillisecond line
base liner is ____________ seconds.
4. A counl ol 25 on a 10 nillisecond line base liner
represenls a line ol __________ nilliseconds.
5. There are ____________ liners in lhe S7200.
72
Couhters
Counlers used in PLCs serve lhe sane lunclion as nechanical
counlers. Counlers conpare an accunulaled value lo a presel
value lo conlrol circuil lunclions. Conlrol applicalions lhal
connonly use counlers include lhe lolloving:
Counl lo a presel value and cause an evenl lo occur
Cause an evenl lo occur unlil lhe counl reaches a presel
value
A bollling nachine, lor exanple, nay use a counler lo counl
bollles inlo groups ol six lor packaging.
73
Counlers are represenled by boxes in ladder logic. Counlers
increnenl/decrenenl one counl each line lhe inpul lransilions
lron oll (logic 0) lo on (logic 1). The counlers are resel vhen a
FESET inslruclion is execuled. S7200 uses lhree lypes ol
counlers: up counler (CTU), dovn counler (CTD), and up/dovn
counler (CTUD).
Count Up/Down Count Up Count Down
PV PV
R LD
PV
CU CD
CD
CU
R
CTU CTD CTUD
XXX XXX XXX
S7-200 counters There are 256 counlers in lhe S7200, nunbered 0 lhrough 255.
The sane nunber cannol be assigned lo nore lhan one
counler. For exanple, il an up counler is assigned nunber 45, a
dovn counler cannol also be assigned nunber 45. The
naxinun counl value ol a counler is -32,767.
Up counter The up counler counls up lron a currenl value lo a presel value
(PV). npul CU is lhe counl inpul. Each line CU lransilions lron
a logic 0 lo a logic 1 lhe counler increnenls by a counl ol 1.
npul F is lhe resel. A presel counl value is slored in PV inpul. l
lhe currenl counl is equal lo or grealer lhan lhe presel value
slored in PV, lhe oulpul bil (O) lurns on (nol shovn).
PV
R
CU
CTU
XXX
74
Down counter The dovn counler counls dovn lron lhe presel value (PV) each
line CD lransilions lron a logic 0 lo a logic 1. vhen lhe currenl
value is equal lo zero lhe counler oulpul bil (O) lurns on (nol
shovn). The counler resels and loads lhe currenl value vilh lhe
presel value (PV) vhen lhe load inpul (LD) is enabled.
PV
LD
CD
CTD
XXX
Up/Down counter The up/dovn counler counls up or dovn lron lhe presel value
each line eilher CD or CU lransilions lron a logic 0 lo a logic 1.
vhen lhe currenl value is equal lo lhe presel value, lhe oulpul
OU lurns on. vhen lhe currenl value (CV) is equal lo zero, lhe
oulpul OD lurns on. The counler loads lhe currenl value (CV)
vilh lhe presel value (PV) vhen lhe load inpul (LD) is enabled.
Sinilarly, lhe counler resels and loads lhe currenl value (CV)
vilh zero vhen lhe resel (F) is enabled. The counler slops
counling vhen il reaches presel or zero.
PV
LD
CD
CU
R
CTUD
XXX
75
Counter exampIe A counler nighl be used lo keep lrack ol lhe nunber ol
vehicles in a parking lol. As vehicles enler lhe lol lhrough an
enlrance gale, lhe counler counls up. As vehicles exil lhe lol
lhrough an exil gale, lhe counler counls dovn. vhen lhe lol is
lull a sign al lhe enlrance gale lurns on indicaling lhe lol is lull.
76
Up/dovn counler C43 is used in lhis exanple. A svilch,
connecled lo lhe enlrance gale, has been vired lo inpul 0.0. A
svilch, connecled lo lhe exil gale, has been vired lo inpul 0.1.
A resel svilch, localed al lhe colleclion boolh, has been vired
lo inpul 0.2. The parking lol has 150 parking spaces. This value
has been slored in lhe presel value (PV). The counler oulpul has
been direcled lo oulpul O0.1. Oulpul 2 is connecled lo a
Parking Lol Full sign. As cars enler lhe lol lhe enlrance gale
opens. npul 0.0 lransilions lron a logic 0 lo a logic 1,
increnenling lhe counl by one. As cars leave lhe lol lhe exil
gale opens. npul 0.1 lransilions lron a logic 0 lo a logic 1,
decrenenling lhe counl by 1. vhen lhe counl has reached 150
oulpul O0.1 lransilions lron a logic 0 lo a logic 1. The Parking
Lol Full sign illuninales. vhen a car exils, decrenenling lhe
counl lo 149, lhe sign lurns oll.
77
High-Speed lhstructiohs
As discussed earlier, PLCs have a scan line. The scan line
depends on lhe size ol lhe progran, lhe nunber ol /Os, and
lhe anounl ol connunicalion required. Evenls nay occur in an
applicalion lhal require a response lron lhe PLC belore lhe
scan cycle is conplele. For lhese applicalions highspeed
inslruclions can be used.
PLC Scan
Read
Inputs
Update
Outputs
Diagnostics,
Communications
Execute
Program
High speed counters Highspeed counlers are represenled by boxes in ladder logic.
The S7221 and S7222 supporls lour highspeed counlers
(HSC0, HSC3, HSC4, HSC5). The CPU 224 supporls six high
speed counlers (HSC0, HSC1, HSC2, HSC3, HSC4, HSC5).
73
Definition boxes and The highspeed counler delinilion boxes are used lo assign
high-speed counters a node lo lhe counler. Highspeed counlers can be delined by
lhe delinilion box lo operale in any ol lhe12 available nodes. l
should be noled lhal nol all counlers can operale in all ol lhe
available nodes. Feler lo lhe S7Progrannab|e Con!ro||er
S,s!en anua| lor delinilions available lor each counler. Each
counler has dedicaled inpuls lor clocks, direclion conlrol, resel,
and slarl vhere lhese lunclions are supporled. The naxinun
clock inpul lrequency is 20 KHz. For lhe lvophase counlers,
bolh clocks nay be run al 20 KHz. n quadralure node, 1x or 4x
counling rales can be selecled. Al 1x rale lhe naxinun
counling lrequency is 20 KHz. Al 4x rale lhe naxinun counling
lrequency is 30 KHz.
Positioning Posilioning is one exanple ol an applicalion lhal can use high
speed counlers. n lhe lolloving illuslralion a nolor is
connecled lhrough a slarler lo a PLC oulpul. The nolor shall is
connecled lo an encoder and a posilioning aclualor. The
encoder enils a series ol pulses as lhe nolor lurns. n lhis
exanple lhe progran vill nove an objecl lron posilion 1 lo
posilion 6. Assune lhe encoder generales 600 pulses per
revolulion, and il lakes 1000 nolor revolulions lo nove lhe
objecl lron one posilion lo anolher. To nove lhe objecl lron
posilion 1 lo posilion 6 (5 posilions) vould lake 5000 nolor
revolulions. The counler vould counl up 30,000 counls (5000
revolulions x 600 pulses per revolulion) and slop lhe nolor.
79
Interrupts nlerrupls are anolher exanple ol an inslruclion lhal nusl be
execuled belore lhe PLC has conpleled lhe scan cycle.
nlerrupls in lhe S7200 are priorilized in lhe lolloving order:
1. Connunicalions
2. /O nlerrupls
3. TineBased nlerrupls
PTO Pulse lrain oulpul (PTO) is used lo provide a series ol pulses lo
an oulpul device, such as a slepper nolor driver. The PTO
provides a square vave oulpul lor a specilied nunber ol pulses
and a specilied cycle line. The nunber ol pulses can be lron 1
lo 4,294,967,295 pulses. The cycle line can eilher be lron 250
lo 65,535 nicroseconds or 2 lo 65,535 nilliseconds. PTOs have
a 50 duly cycle. This neans lhe pulse is oll lor lhe sane
anounl ol line il is on. The nunber ol pulses and lhe cycle
line can be changed vilh an inlerrupl. n lhe lolloving exanple
each pulse is on lor 500 ns, and oll lor 500 ns. Aller lour
pulses an inlerrupl occurs vhich changes lhe cycle line lo
1000 ns.
Q0.0
4 Pulses
500 milliseconds Each
4 Pulses
1000 milliseconds Each
Interrupt
Occurs
PWM The Pulse vidlh odulalion (Pv) lunclion provides a lixed
cycle line vilh a variable duly cycle line. The cycle line and
pulse vidlh can be specilied lron 250 lo 65,535 nicroseconds
or 2 lo 65,535 nilliseconds. The pulse vidlh line has a range ol
0 lo 65,535 nicroseconds or 0 lo 65,535 nilliseconds. vhen
lhe pulse vidlh is equal lo lhe cycle line, lhe duly cycle is
100 and lhe oulpul is lurned on conlinuously. n lhe lolloving
exanple lhe oulpul has a 10 duly cycle (on 10 oll 90).
Aller an inlerrupl lhe cycle svilches lo a 50 duly cycle (on
50, oll 50).
Q0.0
On On Off Off
10%
Duty Cycle
50%
Duty Cycle
30
The Pv lunclion can be used lo provide a progrannable or
adjuslable conlrol ol nachine lining. This allovs nachine
operalion lo be varied lo conpensale lor producl varialions or
nechanical vear.
Transmit Transnil allovs connunicalion vilh exlernal devices, such as
nodens, prinlers, conpulers, via lhe serial inlerlace. See lhe
seclion lilled Connecling Exlernal Devices lor exanples.
Web site For nore inlornalion and sales supporl on lhe S7200 visil our
veb sile al hllp://vvv.sienens.con/s7200.
Review 6
1. The S7200 supporls ____________ counlers.
2. Three lypes ol counlers used in S7200 are
____________ , ____________ , and ____________ .
3. Counlers can counl lo a naxinun ol ____________ .
4. Evenls lhal require an aclion lron lhe PLC belore lhe
scan cycle is conplele are conlrolled by ____________
____________ inslruclions.
5. Depending on lhe counler, lhere are up lo ____________
nodes available on highspeed counlers.
31
Feview Ahswers
Review 1 1) a: inpul nodule, b: CPU, c: oulpul nodule, d: progranning
device, e: operalor inlerlace, 2) 2, 3) 16, 4) 1010, 0001 000, A.
Review 2 1) discrele, 2) discrele, 3) CPU, 4) Ladder logic, 5) progran,
6) progran, dala, conliguarable paraneler, 7) 1024, 3) lirnvare,
9) e, 10) PC/PP.
Review 3 1) 221, 222, 224, 2) b, 3) 2, 7, 4) 3, 6, 5) 14, 10, 6) O0.3, 7) D,
3) 50, 72.
Review 4 1) a: box, b: conlacl, c: coil, 2) load, 3) AD Funclion a: 0, b: 0,
c: 0, d: 1, Or Funclion e: 0, l: 1, g: 1, h: 1, 4) 0.0 or O0.0, and
0.1.
Review 5 1) digilal, 2) relenlive, oll, 3) 3276.7 seconds, 4) 250, 5) 256.
Review 6 1) 256, 2) CTU, CTD, CTUD, 3) -32,767, 4) highspeed, 5) 12.
32
Fihal Exam
The linal exan is inlended lo be a learning lool. The book nay
be used during lhe exan. A learoul ansver sheel is provided.
Aller conpleling lhe lesl, nail lhe ansver sheel in lor grading.
A grade ol 70 or beller is passing. Upon successlul
conplelion ol lhe lesl a cerlilicale vill be issued.
1. The conponenl ol a PLC lhal nakes decisions and
execules conlrol inslruclions based on lhe inpul signals is
lhe ____________ .
a. CPU b. npul nodule
c. Progranning device d. Operalor inlerlace
2. One byle is nade up ol ____________ .
a. 2 bils b. 3 bils
c. 16 bils d. 32 bils
3. The binary equivalenl ol a decinal 5 is ____________ .
a. 11 b. 100
c. 101 d. 111
4. An inpul lhal is eilher On or Oll is a/an ____________ inpul.
a. analog b. discrele
c. highspeed d. nornally open
5. A progranning language lhal uses synbols resenbling
elenenls used in hardvired conlrol line diagrans is
relerred lo as a ____________ .
a. ladder logic diagran b. slalenenl lisl
c. nelvork d. PLC scan
33
6. A lype ol nenory lhal can be read lron bul nol vrillen lo
is ____________ .
a. FA b. FO
c. lirnvare d. K nenory
7. vhich lype ol inlerlace cable is needed vhen a personal
conpuler is used as a progranning device lor an S7200
PLC?
a. PC/PP b. parallel
c. serial d. P
3. The CPU 224 AC/DC/FELAY has ____________ .
a. 3 DC inpuls and 10 relay oulpuls
b. 3 AC inpuls and 6 relay oulpuls
c. 14 DC inpuls and 14 relay oulpuls
d. 14 DC inpuls and 10 relay oulpuls
9. ____________ expansion nodules can be used on lhe
S7224.
a. none b. 7
c. 10 d. 30
10. The S7222 has lhe abilily lo slore ____________ vords in
user dala.
a. 4096 b. 2,043
c. 1,024 d. 3,192
11. A nev logic operalion begins vilh a ____________
inslruclion.
a. A b. OP
c. LD d. =
12. The address designalion lor oulpul lour ol an S7200 is
____________ .
a. 0.4 b. 0.3
c. O0.3 d. O0.4
13. The naxinun clock inpul lrequency lor highspeed
counlers is ____________ .
a. 0.37 s b. 10 KHz
c. 20 KHz d. 1 ns
34
14. The naxinun value ol an S7200 liner vilh a resolulion
ol 1 nillisecond is ____________ seconds.
a. 3.2767 b. 32.767
c. 327.67 d. 3276.7
15. An S7200 liner vilh a line base ol 100 ns can counl lo a
naxinun value ol ____________ seconds.
a. 3.2767 b. 32.767
c. 327.67 d. 3276.7
16. The line base ol TO 32 ol is ____________ ns.
a. .1 b. 10
c. 1 d. 100
17. The naxinun counl ol an S7200 up counler is
____________ .
a. 32,767 b. 65,534
c. 93,301 d. 1,000,000
13. A/An ____________ is used lo assign a node lo a high
speed counler.
a. loggle svilch b. inlerrupl
c. PLC scan d. delinilion box
19. ____________ inslruclions allovs connunicalion vilh
exlernal devices, such as nodens, prinlers, and
conpulers.
a. Transnil b. nlerrupl
c. Highspeed counlers d. Highspeed oulpuls
20. ____________ is used lo lenporarily override lhe inpul or
oulpul slalus in order lo lesl and debug lhe progran.
a. Transnil b. Forcing
c. nlerrupl d. PLC scan

Das könnte Ihnen auch gefallen