SlideShare une entreprise Scribd logo
1  sur  22
Télécharger pour lire hors ligne
^ŝĞŵĞŶƐ W> WƌŽŐƌĂŵŵŝŶŐ ĞdžĂŵƉůĞƐ ďLJ /Eϵϱ͘ĐŽŵ
More... See http://bin95.com/Siemens-Training/siemens-plc-
programming-examples.htm ƒ‰‡ ͳ
‹‡‡• ‘—–‡” ”‘‰”ƒ•
/Ey
ϭͿ ŽƵŶƚĞƌ ƐĞůĞĐƚŝŽŶ ŵĞƚŚŽĚ ŝŶ ůĂĚĚĞƌ ŶĞƚǁŽƌŬƐ Ϯ Ͳ ϰ
ϮͿ hƉ ŽƵŶƚĞƌ ϰ Ͳ ϴ
ϯͿ ŽǁŶ ŽƵŶƚĞƌ ϵ Ͳ ϭϯ
ϰͿ hƉ ŽǁŶ ŽƵŶƚĞƌ ϭϰ Ͳ ϭϱ
ϱͿ hƉ ŽƵŶƚĞƌ Žŝů ϭϲ Ͳ ϭϵ
ϲͿ ŽǁŶ ŽƵŶƚĞƌ Žŝů ϮϬ Ͳ Ϯϭ
ϲͿ ^ƚƌƵĐƚƵƌĞĚ dĞdžƚ Ϯϭ Ͳ ϮϮ
^ŝĞŵĞŶƐ W WƌŽŐƌĂŵŵŝŶŐ ĞdžĂŵƉůĞƐ ďLJ /Eϵϱ͘ĐŽŵ
More... See http://bin95.com/Siemens-Training/siemens-plc-
programming-examples.htm ƒ‰‡ ʹ
Following is the Counter logic, step by step explained with significance of each
counter input.
Ϳ ,Žǁ ƚŽ /ŶƐĞƌƚ ŽƵŶƚĞƌ͕ ĞdžƉůĂŝŶĞĚ ŝŶ ƉŽŝŶƚ ϭ͕Ϯ͘
ϭͿ ,Žǁ ƚŽ ĚƌĂŐ ĐŽƵŶƚĞƌ ŝŶ ƉƌŽŐƌĂŵ͍
First open Simatic Manager software as shown below diag#1
Daig#1
Then double click on FC2 (Function Block) and then following file appears shown in diag#2
Daig#2
^ŝĞŵĞŶƐ W WƌŽŐƌĂŵŵŝŶŐ ĞdžĂŵƉůĞƐ ďLJ /Eϵϱ͘ĐŽŵ
More... See http://bin95.com/Siemens-Training/siemens-plc-
programming-examples.htm ƒ‰‡ ͵
then double click on the line of network1 as shown below
After this goto left side of FC2 where it shows various features or instruction folder such as Bit
Logic, Comparator etc. Exactly click on folder counter and it will show number of counter types
as shown below and then double click on S_CU (UP Counter), this counter will appear with ???
over it, on network 1and similarly for S_CD (Down Counter) and S_CUD (UP Down Counter)
as shown in network 1,2  3 each in below diag#3.
Daig#3
^ŝĞŵĞŶƐ W WƌŽŐƌĂŵŵŝŶŐ ĞdžĂŵƉůĞƐ ďLJ /Eϵϱ͘ĐŽŵ
More... See http://bin95.com/Siemens-Training/siemens-plc-
programming-examples.htm ƒ‰‡ Ͷ
ϮͿ ,Žǁ ƚŽ ĂƐƐŝŐŶ ŶƵŵďĞƌ ƚŽ ŽƵŶƚĞƌƐ͍
Then click on ???type C1 for up counter (S_CU), C2 for down counter (S_CD) and C3 for up
down counter (S_CUD) every network and then these counters are assigned with names or tag
C1, C2  C3 as shown below diag#4.
Daig#4
UP Counter Operation:
The counter C1 shown above diag#4 performs function of UP counter. Let us learn with
example on number of lamps turned ON count.
It can be understood from following diagram. The input CU is connected to real world input I1.0
which reads 1when a lamp turns on. Now consider here when 55 lamps are to be turned on and
after all 55 lamps are turned on counter is reset and starts counting again. Let us focus on
following diag#5 to get understanding of UP counter operation.
^ŝĞŵĞŶƐ W WƌŽŐƌĂŵŵŝŶŐ ĞdžĂŵƉůĞƐ ďLJ /Eϵϱ͘ĐŽŵ
More... See http://bin95.com/Siemens-Training/siemens-plc-
programming-examples.htm ƒ‰‡ ͷ
Daig#5
Now here real world input I1.0 is connected to CU and it turns on when it lamp switches are
turned on one by one for every lamp respectively. As real world input I1.0 senses any switch
^ŝĞŵĞŶƐ W WƌŽŐƌĂŵŵŝŶŐ ĞdžĂŵƉůĞƐ ďLJ /Eϵϱ͘ĐŽŵ
More... See http://bin95.com/Siemens-Training/siemens-plc-
programming-examples.htm ƒ‰‡ ͸
that is turned on CU input increments counter (here count is 2) as shown in below figure diag#6
after two lamps are on. The count BCD value is converted into decimal in more simpler way to
understand and stored in internal memory MW16.
This count in internal memory is compared with the set point 55 counts and when count becomes
55 the counter is reset by internal memory bit M80.0 (C1_Reset).
Daig#6
As shown in below diag#7 the count is 54 as 54th lamp has turned ON.
^ŝĞŵĞŶƐ W WƌŽŐƌĂŵŵŝŶŐ ĞdžĂŵƉůĞƐ ďLJ /Eϵϱ͘ĐŽŵ
More... See http://bin95.com/Siemens-Training/siemens-plc-
programming-examples.htm ƒ‰‡ ͹
Daig#7
As 55th lamp turns ON the counter is reset to zero as shown below diag#8 by internal memory
M80.0 (C1_Reset) and again counter is ready to count for next cycle.
^ŝĞŵĞŶƐ W WƌŽŐƌĂŵŵŝŶŐ ĞdžĂŵƉůĞƐ ďLJ /Eϵϱ͘ĐŽŵ
More... See http://bin95.com/Siemens-Training/siemens-plc-
programming-examples.htm ƒ‰‡ ͺ
Daig#8
In this way Up Counter operation works!!
^ŝĞŵĞŶƐ W WƌŽŐƌĂŵŵŝŶŐ ĞdžĂŵƉůĞƐ ďLJ /Eϵϱ͘ĐŽŵ
More... See http://bin95.com/Siemens-Training/siemens-plc-
programming-examples.htm ƒ‰‡ ͻ
Down Counter
Now the drop drag procedure is same as explained for Up counter and you can follow diag#1 to
diag#4 explained above where Down counter is shown too named C2.
The function of down is opposite to Up counter, here the counter is decremented by one if the
signal state at input CD changes, the counter is reset if there is a 1 at input R. Let us understand
using example of Bottle Sense as shown in diag#9 below
Daig#9
^ŝĞŵĞŶƐ W WƌŽŐƌĂŵŵŝŶŐ ĞdžĂŵƉůĞƐ ďLJ /Eϵϱ͘ĐŽŵ
More... See http://bin95.com/Siemens-Training/siemens-plc-
programming-examples.htm ƒ‰‡ ͳͲ
In the above diagram let us say 50 bottle are to be counted by real world input I2.0. When real
world input I2.0 sense a passing of bottle by sensor, CD input reads 1 and decrements count by
1 until 50 bottles are sensed. The CD read 1 from internal memory M46.0 called rising edge
which reads 1 from real world input I2.0.
The counter has to be preset to 50 and when real world input I2.2 is turned ON counter is loaded
with value 50. It comes from local memory C2_PV loaded with 50 as shown in above diag#9
network3.
Now for example real world input I2.0 senses two bottles the count is 48 as shown in diag#10.
Daig#10
^ŝĞŵĞŶƐ W WƌŽŐƌĂŵŵŝŶŐ ĞdžĂŵƉůĞƐ ďLJ /Eϵϱ͘ĐŽŵ
More... See http://bin95.com/Siemens-Training/siemens-plc-
programming-examples.htm ƒ‰‡ ͳͳ
Likewise CD decrements until count becomes zero. Now 49 bottles are counted and count is 1 as
shown in diag#11 below.
Daig#11
^ŝĞŵĞŶƐ W WƌŽŐƌĂŵŵŝŶŐ ĞdžĂŵƉůĞƐ ďLJ /Eϵϱ͘ĐŽŵ
More... See http://bin95.com/Siemens-Training/siemens-plc-
programming-examples.htm ƒ‰‡ ͳʹ
When last bottle 50 is counted the counter resets to zero by internal memory M80.1 (C2_Reset)
as shown below diag#12
Daig#12
Now again real world input I2.2 needs to ON/OFF (i.e. push button action) so that counter is
preset to 50 again and next 50 bottles are count down as shown in diag#13, but in actual project
or programming logic you should write such a logic that counter is preset when count becomes
^ŝĞŵĞŶƐ W WƌŽŐƌĂŵŵŝŶŐ ĞdžĂŵƉůĞƐ ďLJ /Eϵϱ͘ĐŽŵ
More... See http://bin95.com/Siemens-Training/siemens-plc-
programming-examples.htm ƒ‰‡ ͳ͵
zero, you can use internal memory or whatever is better. Here using is just to understand
basics!!
Daig#13
Here ends operation of Down counter!!
^ŝĞŵĞŶƐ W WƌŽŐƌĂŵŵŝŶŐ ĞdžĂŵƉůĞƐ ďLJ /Eϵϱ͘ĐŽŵ
More... See http://bin95.com/Siemens-Training/siemens-plc-
programming-examples.htm ƒ‰‡ ͳͶ
UP Down Counter
Now the drop drag procedure is same as explained for Up counter and you can follow diag#1 to
diag#4 explained above where Up Down counter is shown too named C3.
The counter is incremented by one if the signal state at input CU reads 1. The counter is
decremented by one if the signal state at input CD reads 1 and the value of the counter is greater
than 0. If there is value 1 read at both count inputs, both instructions are executed and the count
value remains unchanged, the counter is reset if there is a 1 at input R. Following diag#14 and
diag#15 shows logic of Up Down counter.
Daig#14
^ŝĞŵĞŶƐ W WƌŽŐƌĂŵŵŝŶŐ ĞdžĂŵƉůĞƐ ďLJ /Eϵϱ͘ĐŽŵ
More... See http://bin95.com/Siemens-Training/siemens-plc-
programming-examples.htm ƒ‰‡ ͳͷ
Daig#15
The logic counts Faulty part selected in up direction same in the way as explained in UP Counter
and Faulty part rejected counts in down direction as explained with down counter example.
Here when Up count is reached internal memory M80.2 (C3_Reset) resets count to zero by
reading 1 value from internal memory M30.0 (Reset_Up) and in case of down operation M80.2
(C3_Reset) reset count to zero by reading 1 value from internal memory M30.1(Reset_Down)!!
^ŝĞŵĞŶƐ W WƌŽŐƌĂŵŵŝŶŐ ĞdžĂŵƉůĞƐ ďLJ /Eϵϱ͘ĐŽŵ
More... See http://bin95.com/Siemens-Training/siemens-plc-
programming-examples.htm ƒ‰‡ ͳ͸
UP Counter Coil
This Up counter in coil form as shown below diag#16, it is dragged and dropped similarly as
shown for above counters, can refer diag#3 above.
Daig#16
Here as shown in above diag#15 coil SC has two parameters
1) Counter number, here it is C5 and
2) Counter preset value, here it is 10, when real world input I5.0 goes high counter C5 is loaded
by 10.
Coil CU acts as up counter which increment when real world input I5.1 goes high i.e. senses
Tablet packet i.e. any preceding real world input or memory bit before coil exist and senses high
state.
^ŝĞŵĞŶƐ W WƌŽŐƌĂŵŵŝŶŐ ĞdžĂŵƉůĞƐ ďLJ /Eϵϱ͘ĐŽŵ
More... See http://bin95.com/Siemens-Training/siemens-plc-
programming-examples.htm ƒ‰‡ ͳ͹
The counter is reset here when C5 reaches desired count 10. C5 value is moved into local
memory (C5_Count) as C5 is not accepted by comparator block as it needs internal or local
memory or direct value. The actual count is in C5.
Here suppose 10 tablet packets are to be counted in each batch then counter has to be reset to
zero after count 10 is reached, which means one batch is completed, which fills one box of 10
tablet packets.
Now suppose 5 tablet packets are sensed the C5 has value 5 as shown in below diag#17.
Daig#17
Now it counts till 10 and automatically resets to zero after 10 tablets are sensed.
Now C5 has count 9 as shown in diag#18
^ŝĞŵĞŶƐ W WƌŽŐƌĂŵŵŝŶŐ ĞdžĂŵƉůĞƐ ďLJ /Eϵϱ͘ĐŽŵ
More... See http://bin95.com/Siemens-Training/siemens-plc-
programming-examples.htm ƒ‰‡ ͳͺ
Daig#18
^ŝĞŵĞŶƐ W WƌŽŐƌĂŵŵŝŶŐ ĞdžĂŵƉůĞƐ ďLJ /Eϵϱ͘ĐŽŵ
More... See http://bin95.com/Siemens-Training/siemens-plc-
programming-examples.htm ƒ‰‡ ͳͻ
Now as 10th tablet pack is sensed counter C5 is automatically reset to zero as shown in diag#19
Daig#19
Again the counter is preset with value by turning real world input I5.0 ON, here after count 10,
C5 was reloaded by 10 as I5.0 real world input was kept high throughout logic.
Note: In real practice it may happen that preset value has to be loaded manually from HMI after
every batch and not kept high throughout logic always or depending upon requirement of process
theory/ philosophy. In this way UP counter works in coil form!!
^ŝĞŵĞŶƐ W WƌŽŐƌĂŵŵŝŶŐ ĞdžĂŵƉůĞƐ ďLJ /Eϵϱ͘ĐŽŵ
More... See http://bin95.com/Siemens-Training/siemens-plc-
programming-examples.htm ƒ‰‡ ʹͲ
Down Counter Coil
This counter also looks like up counter in coil form as shown below diag#20 except coil CD in
place of coil CU, it is dragged and dropped similarly as shown for above counters, can refer
diag#16 above.
Daig#20
The operation of Down counter coil is in reverse way of Up counter coil and logical arrangement
is same as Up counter coil as shown in diag#20. Here the counter counts in downward direction
from its preset value to zero.
^ŝĞŵĞŶƐ W WƌŽŐƌĂŵŵŝŶŐ ĞdžĂŵƉůĞƐ ďLJ /Eϵϱ͘ĐŽŵ
More... See http://bin95.com/Siemens-Training/siemens-plc-
programming-examples.htm ƒ‰‡ ʹͳ
Here real world input I6.0 loads counter preset value and real world input I6.1 senses noof
wagons in unloading station.
In above logic wagons used for loading coal on conveyor/truck carrying coal to thermal power
station are counted. At coal station wagons are counted one by one, here for e.g. the desired
count is 20 shown in above. When last wagon i.e #20 is counted counter is automatically
resetted, similarly as explained in Up counter operation. In this way Down counter coil works.
Counter Operation in Structured Text
To understand counter operation in another programming language, provided below is a
Structured Text example (IEC 61131-3). With structured text PAC programming, the life cycle
cost of industrial automation control greatly increases compared to using just ladder logic. As the
people maintaining and making minor modifications to control automation for the next 20-30
years are typically not computer programmers and IT people. They are electricians and industrial
engineers.
Note below:
“=” is a compare operator
“:=” is an assignment operator
“[:=]” is a non-retentive assignment operator
“;” semicolon indicates end of current statement
“//” are followed by comment, like rung comment
“Part_Present” and “Operator_Reset_PB” are Boolean (one or zero) Tags (memory storage
areas)
“PLCCount_7” is an INT (integer, whole number 1 to 32767) Tag (memory storage area)
Note: Tags are assigned data types in PAC software, so do not need to use “VAR” construct
within Structured Text.
As you can see from above one typo or misunderstanding of similar looking operators, can cause damage to man or
machine. An issue far less likely to occur using a graphical programming language like ladder logic. Probably the most
common error people make with structured text programming language is putting a “=” where they should have used a
“;=”. Possibly followed by using a semicolon where they should have used a colon.
^ŝĞŵĞŶƐ W WƌŽŐƌĂŵŵŝŶŐ ĞdžĂŵƉůĞƐ ďLJ /Eϵϱ͘ĐŽŵ
More... See http://bin95.com/Siemens-Training/siemens-plc-
programming-examples.htm ƒ‰‡ ʹʹ
.
Below is PAC Structured Text example to make photo eye (‘Part_Present’) count to 38
// increment counter if photo eye sees part
IF Part_Present True THEN
PLCCount_7 [:=] PLCCount_7 +1 ;
// The brackets ‘[]’around ‘ := ’ cause ‘PLCCount_7’ to reset to zero on PAC power up.
// if counter reaches 38, set ‘counter done bit’
If PLCCount_7 = 38 THEN
PLCCount_7.DN True ;
// if counter reaches 998, set ‘counter current value’ to zero(0). In other world reset counter as
fail safe so counter never causes math overflow error.
If PLCCount_7 = 998 THEN
PLCCount_7 := 0 ;
// Or if operator presses reset button, reset counter to zero.
If Operator_Reset_PB True THEN
PLCCount_7 := 0 ;
*********************THE END*********************

Contenu connexe

Tendances

Simatic getting-started-pcs7
Simatic getting-started-pcs7Simatic getting-started-pcs7
Simatic getting-started-pcs7
ionut grozav
 
Delta v advanced control overview_en
Delta v advanced control overview_enDelta v advanced control overview_en
Delta v advanced control overview_en
Luis Atencio
 
Plc presentation
Plc presentationPlc presentation
Plc presentation
Akshay Modi
 
Basic Control System unit5
Basic Control System unit5Basic Control System unit5
Basic Control System unit5
Asraf Malik
 
DeltaV Safety Instrumented System Overview
DeltaV Safety Instrumented System OverviewDeltaV Safety Instrumented System Overview
DeltaV Safety Instrumented System Overview
Sumeet Goel
 

Tendances (20)

Vt training plc_1
Vt training plc_1Vt training plc_1
Vt training plc_1
 
Lecture 10.cont,11 (plc)
Lecture 10.cont,11 (plc)Lecture 10.cont,11 (plc)
Lecture 10.cont,11 (plc)
 
Allen bradley
Allen bradleyAllen bradley
Allen bradley
 
PLC data types and addressing
PLC data types and addressingPLC data types and addressing
PLC data types and addressing
 
PLC Internal Relays
PLC Internal RelaysPLC Internal Relays
PLC Internal Relays
 
Simatic getting-started-pcs7
Simatic getting-started-pcs7Simatic getting-started-pcs7
Simatic getting-started-pcs7
 
Utilisation de relais et contacteurs v5
Utilisation de relais et contacteurs v5Utilisation de relais et contacteurs v5
Utilisation de relais et contacteurs v5
 
Plc basics
Plc   basicsPlc   basics
Plc basics
 
Building The Virtual Plant For DeltaV
Building The Virtual Plant For DeltaVBuilding The Virtual Plant For DeltaV
Building The Virtual Plant For DeltaV
 
TIA Portal STEP 7 Basic
TIA Portal STEP 7 BasicTIA Portal STEP 7 Basic
TIA Portal STEP 7 Basic
 
Classic control in industry
Classic control in industry Classic control in industry
Classic control in industry
 
PLC: Controladores Lógicos Programables
PLC: Controladores Lógicos ProgramablesPLC: Controladores Lógicos Programables
PLC: Controladores Lógicos Programables
 
Distributed Control System
Distributed Control SystemDistributed Control System
Distributed Control System
 
Grafcet cours
Grafcet coursGrafcet cours
Grafcet cours
 
Delta v advanced control overview_en
Delta v advanced control overview_enDelta v advanced control overview_en
Delta v advanced control overview_en
 
PROCESS CONTROL.pdf
PROCESS CONTROL.pdfPROCESS CONTROL.pdf
PROCESS CONTROL.pdf
 
Plc presentation
Plc presentationPlc presentation
Plc presentation
 
Basic Control System unit5
Basic Control System unit5Basic Control System unit5
Basic Control System unit5
 
DeltaV Safety Instrumented System Overview
DeltaV Safety Instrumented System OverviewDeltaV Safety Instrumented System Overview
DeltaV Safety Instrumented System Overview
 
Yokogawa Centum-VP-Engneering-Course.pptx
Yokogawa Centum-VP-Engneering-Course.pptxYokogawa Centum-VP-Engneering-Course.pptx
Yokogawa Centum-VP-Engneering-Course.pptx
 

En vedette

PLC and SCADA training.
PLC and SCADA training.PLC and SCADA training.
PLC and SCADA training.
Ishank Ranjan
 

En vedette (17)

Plc Siemens Training Notes
Plc Siemens Training NotesPlc Siemens Training Notes
Plc Siemens Training Notes
 
Basics of Automation, PLC and SCADA
Basics of Automation, PLC and SCADABasics of Automation, PLC and SCADA
Basics of Automation, PLC and SCADA
 
Top Ten Programming Mistakes by People New to Siemens
Top Ten Programming Mistakes by People New to SiemensTop Ten Programming Mistakes by People New to Siemens
Top Ten Programming Mistakes by People New to Siemens
 
Simens plc training. simatic working-with-step-7
Simens  plc  training. simatic working-with-step-7Simens  plc  training. simatic working-with-step-7
Simens plc training. simatic working-with-step-7
 
Top Ten Siemens S7 Tips and Tricks
Top Ten Siemens S7 Tips and TricksTop Ten Siemens S7 Tips and Tricks
Top Ten Siemens S7 Tips and Tricks
 
InLife Project presentation
InLife Project presentationInLife Project presentation
InLife Project presentation
 
310 1-26 مطبوع التعويض عن فقدان الشغل
310 1-26 مطبوع التعويض عن فقدان الشغل310 1-26 مطبوع التعويض عن فقدان الشغل
310 1-26 مطبوع التعويض عن فقدان الشغل
 
Scan0030
Scan0030Scan0030
Scan0030
 
PREDICTION THE NUMBER OF PATIENTS AT DENGUE HEMORRHAGIC FEVER CASES USING ADA...
PREDICTION THE NUMBER OF PATIENTS AT DENGUE HEMORRHAGIC FEVER CASES USING ADA...PREDICTION THE NUMBER OF PATIENTS AT DENGUE HEMORRHAGIC FEVER CASES USING ADA...
PREDICTION THE NUMBER OF PATIENTS AT DENGUE HEMORRHAGIC FEVER CASES USING ADA...
 
How reducing customer effort raising & resolving a complaint can drive custom...
How reducing customer effort raising & resolving a complaint can drive custom...How reducing customer effort raising & resolving a complaint can drive custom...
How reducing customer effort raising & resolving a complaint can drive custom...
 
Social Media Marketing for Librarians
Social Media Marketing for LibrariansSocial Media Marketing for Librarians
Social Media Marketing for Librarians
 
Artificial Intelligence and Law - 
A Primer
Artificial Intelligence and Law - 
A Primer Artificial Intelligence and Law - 
A Primer
Artificial Intelligence and Law - 
A Primer
 
Códigos semióticos
Códigos semióticosCódigos semióticos
Códigos semióticos
 
NJ Future Redevelopment Forum 2017 Maraziti
NJ Future Redevelopment Forum 2017 MarazitiNJ Future Redevelopment Forum 2017 Maraziti
NJ Future Redevelopment Forum 2017 Maraziti
 
PLC and SCADA training.
PLC and SCADA training.PLC and SCADA training.
PLC and SCADA training.
 
NJ Future Redevelopment Forum 2017 Cammarata
NJ Future Redevelopment Forum 2017 CammarataNJ Future Redevelopment Forum 2017 Cammarata
NJ Future Redevelopment Forum 2017 Cammarata
 
NJ Future Redevelopment Forum 2017 Reigniting Stalled Projects
NJ Future Redevelopment Forum 2017 Reigniting Stalled ProjectsNJ Future Redevelopment Forum 2017 Reigniting Stalled Projects
NJ Future Redevelopment Forum 2017 Reigniting Stalled Projects
 

Similaire à Siemens PLC Programming Example #2

micro proj4.V2odt
micro proj4.V2odtmicro proj4.V2odt
micro proj4.V2odt
Bruno Diaz
 
Calculator 4
Calculator 4Calculator 4
Calculator 4
livecode
 

Similaire à Siemens PLC Programming Example #2 (20)

A tutorial on programming the Mits Altair computer by Mihai Pruna
A tutorial on programming the Mits Altair computer by Mihai PrunaA tutorial on programming the Mits Altair computer by Mihai Pruna
A tutorial on programming the Mits Altair computer by Mihai Pruna
 
Operating Systems: The Little-Man Computer
Operating Systems: The Little-Man ComputerOperating Systems: The Little-Man Computer
Operating Systems: The Little-Man Computer
 
The Little-Man Computer (in detail)
The Little-Man Computer (in detail)The Little-Man Computer (in detail)
The Little-Man Computer (in detail)
 
Serial Switching in Interval Meters
Serial Switching in Interval MetersSerial Switching in Interval Meters
Serial Switching in Interval Meters
 
03b loops
03b   loops03b   loops
03b loops
 
Project Report On 0-9 decade counter
Project Report On 0-9 decade counterProject Report On 0-9 decade counter
Project Report On 0-9 decade counter
 
a simple bcd counter project
a simple bcd counter projecta simple bcd counter project
a simple bcd counter project
 
Casio fx-991EX classWiz user manual and commands.
Casio fx-991EX classWiz user manual and commands.Casio fx-991EX classWiz user manual and commands.
Casio fx-991EX classWiz user manual and commands.
 
exp 15.docx
exp 15.docxexp 15.docx
exp 15.docx
 
Lab 9 D-Flip Flops: Shift Register and Sequence Counter
Lab 9 D-Flip Flops: Shift Register and Sequence CounterLab 9 D-Flip Flops: Shift Register and Sequence Counter
Lab 9 D-Flip Flops: Shift Register and Sequence Counter
 
Fx 570 991-es_plus_en
Fx 570 991-es_plus_enFx 570 991-es_plus_en
Fx 570 991-es_plus_en
 
How do you use PID in PLC.docx
How do you use PID in PLC.docxHow do you use PID in PLC.docx
How do you use PID in PLC.docx
 
TermProject
TermProjectTermProject
TermProject
 
ES-CH5.ppt
ES-CH5.pptES-CH5.ppt
ES-CH5.ppt
 
micro proj4.V2odt
micro proj4.V2odtmicro proj4.V2odt
micro proj4.V2odt
 
Ladder logic on Soft-Master Honeywell PLC ML50
Ladder logic on Soft-Master Honeywell PLC ML50Ladder logic on Soft-Master Honeywell PLC ML50
Ladder logic on Soft-Master Honeywell PLC ML50
 
Calculator 4
Calculator 4Calculator 4
Calculator 4
 
Ijecet 06 08_001
Ijecet 06 08_001Ijecet 06 08_001
Ijecet 06 08_001
 
Ijecet 06 08_001
Ijecet 06 08_001Ijecet 06 08_001
Ijecet 06 08_001
 
Lec1_EENG112-Introduction.pdf
Lec1_EENG112-Introduction.pdfLec1_EENG112-Introduction.pdf
Lec1_EENG112-Introduction.pdf
 

Plus de Business Industrial Network

Plus de Business Industrial Network (20)

Rotary Gear Type Pump Whitepaper
Rotary Gear Type Pump WhitepaperRotary Gear Type Pump Whitepaper
Rotary Gear Type Pump Whitepaper
 
Process Hazards Analysis
Process Hazards AnalysisProcess Hazards Analysis
Process Hazards Analysis
 
Machinery Failure Analysis and Troubleshooting
Machinery Failure Analysis and TroubleshootingMachinery Failure Analysis and Troubleshooting
Machinery Failure Analysis and Troubleshooting
 
Total Quality Management TQM
Total Quality Management TQMTotal Quality Management TQM
Total Quality Management TQM
 
Process Risk Management
Process Risk ManagementProcess Risk Management
Process Risk Management
 
Equipment Reliability Example
Equipment Reliability ExampleEquipment Reliability Example
Equipment Reliability Example
 
How to learn SCADA
How to learn SCADAHow to learn SCADA
How to learn SCADA
 
PLC Programming Example - PLC Clock - Answ
PLC Programming Example - PLC Clock - AnswPLC Programming Example - PLC Clock - Answ
PLC Programming Example - PLC Clock - Answ
 
What is a PLC ?
What is a PLC ?What is a PLC ?
What is a PLC ?
 
Online Infrared Training Center Presentation
Online Infrared Training Center PresentationOnline Infrared Training Center Presentation
Online Infrared Training Center Presentation
 
PLC Networking Basics - Instructor's notes
PLC Networking Basics - Instructor's notesPLC Networking Basics - Instructor's notes
PLC Networking Basics - Instructor's notes
 
Plc networking basics - controllogix
Plc networking basics - controllogixPlc networking basics - controllogix
Plc networking basics - controllogix
 
Best plc-programming
Best plc-programmingBest plc-programming
Best plc-programming
 
PC vs PLC
PC vs PLCPC vs PLC
PC vs PLC
 
Thank You Veterans for your service
Thank You Veterans for your serviceThank You Veterans for your service
Thank You Veterans for your service
 
USA Manufacturing Jobs Analysis
USA Manufacturing Jobs AnalysisUSA Manufacturing Jobs Analysis
USA Manufacturing Jobs Analysis
 
Best Practices in PLC Programming
Best Practices in PLC ProgrammingBest Practices in PLC Programming
Best Practices in PLC Programming
 
Support Workforce Wednesdays
Support Workforce WednesdaysSupport Workforce Wednesdays
Support Workforce Wednesdays
 
Lean TPM Autonomous Maintenance 2
Lean TPM Autonomous Maintenance 2Lean TPM Autonomous Maintenance 2
Lean TPM Autonomous Maintenance 2
 
7 warnings: Before Hiring a Web Developer
7 warnings: Before Hiring a Web Developer7 warnings: Before Hiring a Web Developer
7 warnings: Before Hiring a Web Developer
 

Dernier

VIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 Booking
dharasingh5698
 
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Christo Ananth
 
Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar ≼🔝 Delhi door step de...
Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar  ≼🔝 Delhi door step de...Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar  ≼🔝 Delhi door step de...
Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar ≼🔝 Delhi door step de...
9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
dharasingh5698
 

Dernier (20)

Thermal Engineering Unit - I & II . ppt
Thermal Engineering  Unit - I & II . pptThermal Engineering  Unit - I & II . ppt
Thermal Engineering Unit - I & II . ppt
 
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdfONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
 
University management System project report..pdf
University management System project report..pdfUniversity management System project report..pdf
University management System project report..pdf
 
Java Programming :Event Handling(Types of Events)
Java Programming :Event Handling(Types of Events)Java Programming :Event Handling(Types of Events)
Java Programming :Event Handling(Types of Events)
 
UNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its PerformanceUNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its Performance
 
Water Industry Process Automation & Control Monthly - April 2024
Water Industry Process Automation & Control Monthly - April 2024Water Industry Process Automation & Control Monthly - April 2024
Water Industry Process Automation & Control Monthly - April 2024
 
Call for Papers - International Journal of Intelligent Systems and Applicatio...
Call for Papers - International Journal of Intelligent Systems and Applicatio...Call for Papers - International Journal of Intelligent Systems and Applicatio...
Call for Papers - International Journal of Intelligent Systems and Applicatio...
 
VIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 Booking
 
Call Girls Wakad Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Wakad Call Me 7737669865 Budget Friendly No Advance BookingCall Girls Wakad Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Wakad Call Me 7737669865 Budget Friendly No Advance Booking
 
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
 
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
 
Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar ≼🔝 Delhi door step de...
Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar  ≼🔝 Delhi door step de...Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar  ≼🔝 Delhi door step de...
Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar ≼🔝 Delhi door step de...
 
Booking open Available Pune Call Girls Pargaon 6297143586 Call Hot Indian Gi...
Booking open Available Pune Call Girls Pargaon  6297143586 Call Hot Indian Gi...Booking open Available Pune Call Girls Pargaon  6297143586 Call Hot Indian Gi...
Booking open Available Pune Call Girls Pargaon 6297143586 Call Hot Indian Gi...
 
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
 
Intze Overhead Water Tank Design by Working Stress - IS Method.pdf
Intze Overhead Water Tank  Design by Working Stress - IS Method.pdfIntze Overhead Water Tank  Design by Working Stress - IS Method.pdf
Intze Overhead Water Tank Design by Working Stress - IS Method.pdf
 
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
 
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete RecordCCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
 
BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptx
BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptxBSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptx
BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptx
 
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
 
Vivazz, Mieres Social Housing Design Spain
Vivazz, Mieres Social Housing Design SpainVivazz, Mieres Social Housing Design Spain
Vivazz, Mieres Social Housing Design Spain
 

Siemens PLC Programming Example #2

  • 1. ^ŝĞŵĞŶƐ W> WƌŽŐƌĂŵŵŝŶŐ ĞdžĂŵƉůĞƐ ďLJ /Eϵϱ͘ĐŽŵ More... See http://bin95.com/Siemens-Training/siemens-plc- programming-examples.htm ƒ‰‡ ͳ ‹‡‡• ‘—–‡” ”‘‰”ƒ• /Ey ϭͿ ŽƵŶƚĞƌ ƐĞůĞĐƚŝŽŶ ŵĞƚŚŽĚ ŝŶ ůĂĚĚĞƌ ŶĞƚǁŽƌŬƐ Ϯ Ͳ ϰ ϮͿ hƉ ŽƵŶƚĞƌ ϰ Ͳ ϴ ϯͿ ŽǁŶ ŽƵŶƚĞƌ ϵ Ͳ ϭϯ ϰͿ hƉ ŽǁŶ ŽƵŶƚĞƌ ϭϰ Ͳ ϭϱ ϱͿ hƉ ŽƵŶƚĞƌ Žŝů ϭϲ Ͳ ϭϵ ϲͿ ŽǁŶ ŽƵŶƚĞƌ Žŝů ϮϬ Ͳ Ϯϭ ϲͿ ^ƚƌƵĐƚƵƌĞĚ dĞdžƚ Ϯϭ Ͳ ϮϮ
  • 2. ^ŝĞŵĞŶƐ W WƌŽŐƌĂŵŵŝŶŐ ĞdžĂŵƉůĞƐ ďLJ /Eϵϱ͘ĐŽŵ More... See http://bin95.com/Siemens-Training/siemens-plc- programming-examples.htm ƒ‰‡ ʹ Following is the Counter logic, step by step explained with significance of each counter input. Ϳ ,Žǁ ƚŽ /ŶƐĞƌƚ ŽƵŶƚĞƌ͕ ĞdžƉůĂŝŶĞĚ ŝŶ ƉŽŝŶƚ ϭ͕Ϯ͘ ϭͿ ,Žǁ ƚŽ ĚƌĂŐ ĐŽƵŶƚĞƌ ŝŶ ƉƌŽŐƌĂŵ͍ First open Simatic Manager software as shown below diag#1 Daig#1 Then double click on FC2 (Function Block) and then following file appears shown in diag#2 Daig#2
  • 3. ^ŝĞŵĞŶƐ W WƌŽŐƌĂŵŵŝŶŐ ĞdžĂŵƉůĞƐ ďLJ /Eϵϱ͘ĐŽŵ More... See http://bin95.com/Siemens-Training/siemens-plc- programming-examples.htm ƒ‰‡ ͵ then double click on the line of network1 as shown below After this goto left side of FC2 where it shows various features or instruction folder such as Bit Logic, Comparator etc. Exactly click on folder counter and it will show number of counter types as shown below and then double click on S_CU (UP Counter), this counter will appear with ??? over it, on network 1and similarly for S_CD (Down Counter) and S_CUD (UP Down Counter) as shown in network 1,2 3 each in below diag#3. Daig#3
  • 4. ^ŝĞŵĞŶƐ W WƌŽŐƌĂŵŵŝŶŐ ĞdžĂŵƉůĞƐ ďLJ /Eϵϱ͘ĐŽŵ More... See http://bin95.com/Siemens-Training/siemens-plc- programming-examples.htm ƒ‰‡ Ͷ ϮͿ ,Žǁ ƚŽ ĂƐƐŝŐŶ ŶƵŵďĞƌ ƚŽ ŽƵŶƚĞƌƐ͍ Then click on ???type C1 for up counter (S_CU), C2 for down counter (S_CD) and C3 for up down counter (S_CUD) every network and then these counters are assigned with names or tag C1, C2 C3 as shown below diag#4. Daig#4 UP Counter Operation: The counter C1 shown above diag#4 performs function of UP counter. Let us learn with example on number of lamps turned ON count. It can be understood from following diagram. The input CU is connected to real world input I1.0 which reads 1when a lamp turns on. Now consider here when 55 lamps are to be turned on and after all 55 lamps are turned on counter is reset and starts counting again. Let us focus on following diag#5 to get understanding of UP counter operation.
  • 5. ^ŝĞŵĞŶƐ W WƌŽŐƌĂŵŵŝŶŐ ĞdžĂŵƉůĞƐ ďLJ /Eϵϱ͘ĐŽŵ More... See http://bin95.com/Siemens-Training/siemens-plc- programming-examples.htm ƒ‰‡ ͷ Daig#5 Now here real world input I1.0 is connected to CU and it turns on when it lamp switches are turned on one by one for every lamp respectively. As real world input I1.0 senses any switch
  • 6. ^ŝĞŵĞŶƐ W WƌŽŐƌĂŵŵŝŶŐ ĞdžĂŵƉůĞƐ ďLJ /Eϵϱ͘ĐŽŵ More... See http://bin95.com/Siemens-Training/siemens-plc- programming-examples.htm ƒ‰‡ ͸ that is turned on CU input increments counter (here count is 2) as shown in below figure diag#6 after two lamps are on. The count BCD value is converted into decimal in more simpler way to understand and stored in internal memory MW16. This count in internal memory is compared with the set point 55 counts and when count becomes 55 the counter is reset by internal memory bit M80.0 (C1_Reset). Daig#6 As shown in below diag#7 the count is 54 as 54th lamp has turned ON.
  • 7. ^ŝĞŵĞŶƐ W WƌŽŐƌĂŵŵŝŶŐ ĞdžĂŵƉůĞƐ ďLJ /Eϵϱ͘ĐŽŵ More... See http://bin95.com/Siemens-Training/siemens-plc- programming-examples.htm ƒ‰‡ ͹ Daig#7 As 55th lamp turns ON the counter is reset to zero as shown below diag#8 by internal memory M80.0 (C1_Reset) and again counter is ready to count for next cycle.
  • 8. ^ŝĞŵĞŶƐ W WƌŽŐƌĂŵŵŝŶŐ ĞdžĂŵƉůĞƐ ďLJ /Eϵϱ͘ĐŽŵ More... See http://bin95.com/Siemens-Training/siemens-plc- programming-examples.htm ƒ‰‡ ͺ Daig#8 In this way Up Counter operation works!!
  • 9. ^ŝĞŵĞŶƐ W WƌŽŐƌĂŵŵŝŶŐ ĞdžĂŵƉůĞƐ ďLJ /Eϵϱ͘ĐŽŵ More... See http://bin95.com/Siemens-Training/siemens-plc- programming-examples.htm ƒ‰‡ ͻ Down Counter Now the drop drag procedure is same as explained for Up counter and you can follow diag#1 to diag#4 explained above where Down counter is shown too named C2. The function of down is opposite to Up counter, here the counter is decremented by one if the signal state at input CD changes, the counter is reset if there is a 1 at input R. Let us understand using example of Bottle Sense as shown in diag#9 below Daig#9
  • 10. ^ŝĞŵĞŶƐ W WƌŽŐƌĂŵŵŝŶŐ ĞdžĂŵƉůĞƐ ďLJ /Eϵϱ͘ĐŽŵ More... See http://bin95.com/Siemens-Training/siemens-plc- programming-examples.htm ƒ‰‡ ͳͲ In the above diagram let us say 50 bottle are to be counted by real world input I2.0. When real world input I2.0 sense a passing of bottle by sensor, CD input reads 1 and decrements count by 1 until 50 bottles are sensed. The CD read 1 from internal memory M46.0 called rising edge which reads 1 from real world input I2.0. The counter has to be preset to 50 and when real world input I2.2 is turned ON counter is loaded with value 50. It comes from local memory C2_PV loaded with 50 as shown in above diag#9 network3. Now for example real world input I2.0 senses two bottles the count is 48 as shown in diag#10. Daig#10
  • 11. ^ŝĞŵĞŶƐ W WƌŽŐƌĂŵŵŝŶŐ ĞdžĂŵƉůĞƐ ďLJ /Eϵϱ͘ĐŽŵ More... See http://bin95.com/Siemens-Training/siemens-plc- programming-examples.htm ƒ‰‡ ͳͳ Likewise CD decrements until count becomes zero. Now 49 bottles are counted and count is 1 as shown in diag#11 below. Daig#11
  • 12. ^ŝĞŵĞŶƐ W WƌŽŐƌĂŵŵŝŶŐ ĞdžĂŵƉůĞƐ ďLJ /Eϵϱ͘ĐŽŵ More... See http://bin95.com/Siemens-Training/siemens-plc- programming-examples.htm ƒ‰‡ ͳʹ When last bottle 50 is counted the counter resets to zero by internal memory M80.1 (C2_Reset) as shown below diag#12 Daig#12 Now again real world input I2.2 needs to ON/OFF (i.e. push button action) so that counter is preset to 50 again and next 50 bottles are count down as shown in diag#13, but in actual project or programming logic you should write such a logic that counter is preset when count becomes
  • 13. ^ŝĞŵĞŶƐ W WƌŽŐƌĂŵŵŝŶŐ ĞdžĂŵƉůĞƐ ďLJ /Eϵϱ͘ĐŽŵ More... See http://bin95.com/Siemens-Training/siemens-plc- programming-examples.htm ƒ‰‡ ͳ͵ zero, you can use internal memory or whatever is better. Here using is just to understand basics!! Daig#13 Here ends operation of Down counter!!
  • 14. ^ŝĞŵĞŶƐ W WƌŽŐƌĂŵŵŝŶŐ ĞdžĂŵƉůĞƐ ďLJ /Eϵϱ͘ĐŽŵ More... See http://bin95.com/Siemens-Training/siemens-plc- programming-examples.htm ƒ‰‡ ͳͶ UP Down Counter Now the drop drag procedure is same as explained for Up counter and you can follow diag#1 to diag#4 explained above where Up Down counter is shown too named C3. The counter is incremented by one if the signal state at input CU reads 1. The counter is decremented by one if the signal state at input CD reads 1 and the value of the counter is greater than 0. If there is value 1 read at both count inputs, both instructions are executed and the count value remains unchanged, the counter is reset if there is a 1 at input R. Following diag#14 and diag#15 shows logic of Up Down counter. Daig#14
  • 15. ^ŝĞŵĞŶƐ W WƌŽŐƌĂŵŵŝŶŐ ĞdžĂŵƉůĞƐ ďLJ /Eϵϱ͘ĐŽŵ More... See http://bin95.com/Siemens-Training/siemens-plc- programming-examples.htm ƒ‰‡ ͳͷ Daig#15 The logic counts Faulty part selected in up direction same in the way as explained in UP Counter and Faulty part rejected counts in down direction as explained with down counter example. Here when Up count is reached internal memory M80.2 (C3_Reset) resets count to zero by reading 1 value from internal memory M30.0 (Reset_Up) and in case of down operation M80.2 (C3_Reset) reset count to zero by reading 1 value from internal memory M30.1(Reset_Down)!!
  • 16. ^ŝĞŵĞŶƐ W WƌŽŐƌĂŵŵŝŶŐ ĞdžĂŵƉůĞƐ ďLJ /Eϵϱ͘ĐŽŵ More... See http://bin95.com/Siemens-Training/siemens-plc- programming-examples.htm ƒ‰‡ ͳ͸ UP Counter Coil This Up counter in coil form as shown below diag#16, it is dragged and dropped similarly as shown for above counters, can refer diag#3 above. Daig#16 Here as shown in above diag#15 coil SC has two parameters 1) Counter number, here it is C5 and 2) Counter preset value, here it is 10, when real world input I5.0 goes high counter C5 is loaded by 10. Coil CU acts as up counter which increment when real world input I5.1 goes high i.e. senses Tablet packet i.e. any preceding real world input or memory bit before coil exist and senses high state.
  • 17. ^ŝĞŵĞŶƐ W WƌŽŐƌĂŵŵŝŶŐ ĞdžĂŵƉůĞƐ ďLJ /Eϵϱ͘ĐŽŵ More... See http://bin95.com/Siemens-Training/siemens-plc- programming-examples.htm ƒ‰‡ ͳ͹ The counter is reset here when C5 reaches desired count 10. C5 value is moved into local memory (C5_Count) as C5 is not accepted by comparator block as it needs internal or local memory or direct value. The actual count is in C5. Here suppose 10 tablet packets are to be counted in each batch then counter has to be reset to zero after count 10 is reached, which means one batch is completed, which fills one box of 10 tablet packets. Now suppose 5 tablet packets are sensed the C5 has value 5 as shown in below diag#17. Daig#17 Now it counts till 10 and automatically resets to zero after 10 tablets are sensed. Now C5 has count 9 as shown in diag#18
  • 18. ^ŝĞŵĞŶƐ W WƌŽŐƌĂŵŵŝŶŐ ĞdžĂŵƉůĞƐ ďLJ /Eϵϱ͘ĐŽŵ More... See http://bin95.com/Siemens-Training/siemens-plc- programming-examples.htm ƒ‰‡ ͳͺ Daig#18
  • 19. ^ŝĞŵĞŶƐ W WƌŽŐƌĂŵŵŝŶŐ ĞdžĂŵƉůĞƐ ďLJ /Eϵϱ͘ĐŽŵ More... See http://bin95.com/Siemens-Training/siemens-plc- programming-examples.htm ƒ‰‡ ͳͻ Now as 10th tablet pack is sensed counter C5 is automatically reset to zero as shown in diag#19 Daig#19 Again the counter is preset with value by turning real world input I5.0 ON, here after count 10, C5 was reloaded by 10 as I5.0 real world input was kept high throughout logic. Note: In real practice it may happen that preset value has to be loaded manually from HMI after every batch and not kept high throughout logic always or depending upon requirement of process theory/ philosophy. In this way UP counter works in coil form!!
  • 20. ^ŝĞŵĞŶƐ W WƌŽŐƌĂŵŵŝŶŐ ĞdžĂŵƉůĞƐ ďLJ /Eϵϱ͘ĐŽŵ More... See http://bin95.com/Siemens-Training/siemens-plc- programming-examples.htm ƒ‰‡ ʹͲ Down Counter Coil This counter also looks like up counter in coil form as shown below diag#20 except coil CD in place of coil CU, it is dragged and dropped similarly as shown for above counters, can refer diag#16 above. Daig#20 The operation of Down counter coil is in reverse way of Up counter coil and logical arrangement is same as Up counter coil as shown in diag#20. Here the counter counts in downward direction from its preset value to zero.
  • 21. ^ŝĞŵĞŶƐ W WƌŽŐƌĂŵŵŝŶŐ ĞdžĂŵƉůĞƐ ďLJ /Eϵϱ͘ĐŽŵ More... See http://bin95.com/Siemens-Training/siemens-plc- programming-examples.htm ƒ‰‡ ʹͳ Here real world input I6.0 loads counter preset value and real world input I6.1 senses noof wagons in unloading station. In above logic wagons used for loading coal on conveyor/truck carrying coal to thermal power station are counted. At coal station wagons are counted one by one, here for e.g. the desired count is 20 shown in above. When last wagon i.e #20 is counted counter is automatically resetted, similarly as explained in Up counter operation. In this way Down counter coil works. Counter Operation in Structured Text To understand counter operation in another programming language, provided below is a Structured Text example (IEC 61131-3). With structured text PAC programming, the life cycle cost of industrial automation control greatly increases compared to using just ladder logic. As the people maintaining and making minor modifications to control automation for the next 20-30 years are typically not computer programmers and IT people. They are electricians and industrial engineers. Note below: “=” is a compare operator “:=” is an assignment operator “[:=]” is a non-retentive assignment operator “;” semicolon indicates end of current statement “//” are followed by comment, like rung comment “Part_Present” and “Operator_Reset_PB” are Boolean (one or zero) Tags (memory storage areas) “PLCCount_7” is an INT (integer, whole number 1 to 32767) Tag (memory storage area) Note: Tags are assigned data types in PAC software, so do not need to use “VAR” construct within Structured Text. As you can see from above one typo or misunderstanding of similar looking operators, can cause damage to man or machine. An issue far less likely to occur using a graphical programming language like ladder logic. Probably the most common error people make with structured text programming language is putting a “=” where they should have used a “;=”. Possibly followed by using a semicolon where they should have used a colon.
  • 22. ^ŝĞŵĞŶƐ W WƌŽŐƌĂŵŵŝŶŐ ĞdžĂŵƉůĞƐ ďLJ /Eϵϱ͘ĐŽŵ More... See http://bin95.com/Siemens-Training/siemens-plc- programming-examples.htm ƒ‰‡ ʹʹ . Below is PAC Structured Text example to make photo eye (‘Part_Present’) count to 38 // increment counter if photo eye sees part IF Part_Present True THEN PLCCount_7 [:=] PLCCount_7 +1 ; // The brackets ‘[]’around ‘ := ’ cause ‘PLCCount_7’ to reset to zero on PAC power up. // if counter reaches 38, set ‘counter done bit’ If PLCCount_7 = 38 THEN PLCCount_7.DN True ; // if counter reaches 998, set ‘counter current value’ to zero(0). In other world reset counter as fail safe so counter never causes math overflow error. If PLCCount_7 = 998 THEN PLCCount_7 := 0 ; // Or if operator presses reset button, reset counter to zero. If Operator_Reset_PB True THEN PLCCount_7 := 0 ; *********************THE END*********************