Upload
s-m-jawad-fakhir
View
220
Download
1
Embed Size (px)
Citation preview
8/10/2019 L-14 PLC_3
1/70
8/10/2019 L-14 PLC_3
2/70
8/10/2019 L-14 PLC_3
3/70
8/10/2019 L-14 PLC_3
4/70
To access a bit in a memory area, you specify the address, whichincludes the memory area identifier, the byte address, and the bitnumber.
8/10/2019 L-14 PLC_3
5/70
8/10/2019 L-14 PLC_3
6/70
Process-Image Input Register: I Process-Image Output Register: Q Variable Memory Area: V Bit Memory Area: M Timer Memory Area: T Counter Memory Area: C High-Speed Counters: HC Accumulators: AC Special Memory: SM Local Memory Area: L Analog Inputs: AI Analog Outputs: AQ Sequence Control Relay (SCR) Memory Area: S
8/10/2019 L-14 PLC_3
7/70
The S7-200 samples the physical input pointsat the beginning of each scan cycle and writesthese values to the process-image inputregister.
You can access the process-image inputregister in bits, bytes, words, or doublewords:
8/10/2019 L-14 PLC_3
8/70
At the end of the scan cycle, the S7-200copies the values stored in the process-image output register to the physical outputpoints.
You can access the process-image outputregister in bits, bytes, words, or doublewords:
8/10/2019 L-14 PLC_3
9/70
8/10/2019 L-14 PLC_3
10/70
You can use the bit memory area (M memory)as control relays to store the intermediatestatus of an operation or other controlinformation.
You can access the bit memory area in bits,bytes, words, or double words
8/10/2019 L-14 PLC_3
11/70
The S7-200 provides timers that count increments of time inresolutions (time-base increments) of 1 ms, 10 ms, or 100 ms. Twovariables are associated with a timer:
Current value: this 16-bit signed integer stores the amount of timecounted by the timer.
Timer bit: this bit is set or cleared as a result of comparing thecurrent and the preset value. The preset value is entered as part ofthe timer instruction.
8/10/2019 L-14 PLC_3
12/70
The S7-200 provides three types of counters that count each low-to-hightransition event on the counter input(s): one type counts up only, one typecounts down only, and one type counts both up and down. Two variables areassociated with a counter:
Current value: this 16-bit signed integer stores the accumulated count.
Counter bit: this bit is set or cleared as a result of comparing the current and
the preset value. The preset value is entered as part of the counterinstruction.
8/10/2019 L-14 PLC_3
13/70
The high-speed counters count high-speedevents independent of the CPU scan. High-speed counters have a signed, 32-bit integercounting value (or current value).
The current value of the high-speed counteris a read-only value and can be addressedonly as a double word (32 bits).
8/10/2019 L-14 PLC_3
14/70
The accumulators are read/write devices that can be used like memory. Forexample, you can use accumulators to pass parameters to and fromsubroutines and to store intermediate values used in a calculation. The S7-200 provides four 32-bit accumulators (AC0, AC1, AC2, and AC3).
8/10/2019 L-14 PLC_3
15/70
The SM bits provide a means for communicating information between theCPU and your program.
You can use these bits to select and control some of the special functions ofthe S7-200 CPU, such as: a bit that turns on for the first scan cycle, a bit thattoggles at a fixed rate, or a bit that shows the status of math or operationalinstructions.
8/10/2019 L-14 PLC_3
16/70
The S7-200 converts an analog value (such as temperature or voltage) into aword-length (16-bit) digital value. You access these values by the areaidentifier (AI), size of the data (W), and the starting byte address.
Since analog inputs are words and always start on even-number bytes (suchas 0, 2, or 4), you access them with even-number byte addresses (such asAIW0, AIW2, or AIW4). Analog input values are read-only values.
8/10/2019 L-14 PLC_3
17/70
The S7-200 converts a word-length (16-bit) digital value into a current orvoltage, proportional to the digital value (such as for a current or voltage).
You write these values by the area identifier (AQ), size of the data (W), andthe starting byte address.
Since analog outputs are words and always start on even-number bytes (suchas 0, 2, or 4), you write them with even-number byte addresses (such as
AQW0, AQW2, or AQW4).
Analog output values are write-only values.
8/10/2019 L-14 PLC_3
18/70
SCRs or S bits are used to organize machine operations or steps intoequivalent program segments.
SCRs allow logical segmentation of the control program.
You can access the S bits as bits, bytes, words, or double words.
8/10/2019 L-14 PLC_3
19/70
S7-200 Instruction Set
8/10/2019 L-14 PLC_3
20/70
8/10/2019 L-14 PLC_3
21/70
8/10/2019 L-14 PLC_3
22/70
Standard contact: The Normally Open contact instructions (LD, A, and O)and Normally Closed contact instructions (LDN, AN, ON) obtain thereferenced value from the memory or from the process-image register.
The standard contact instructions obtain the referenced value from thememory (or process-image register if the data type is I or Q).
Immediate Contacts: An immediate contact does not rely on the S7-200
scan cycle to update; it updates immediately. The Normally Open Immediate contact is closed (on) when the physical
input point (bit) is 1, and the Normally Closed Immediate contact isclosed (on) when the physical input point (bit) is 0.
NOT Instruction: The Not instruction (NOT) changes the state of powerflow input (that is, it changes the value on the top of the stack from 0 to1 or from1 to 0).
Positive and Negative Transition Instructions: The Positive Transitioncontact instruction (EU) allows power to flow for one scan for each off-to-on transition.
8/10/2019 L-14 PLC_3
23/70
8/10/2019 L-14 PLC_3
24/70
Output: The Output instruction (=) writes the new value for the outputbit to the process-image register.
When the Output instruction is executed, the S7-200 turns the output bit inthe process-image register on or off.
Output Immediate: The Output Immediate instruction (=I) writesthe new value to both the physical output and the corresponding process-image register location when the instruction is executed.
Set and Reset: The Set (S) and Reset (R) instructions set (turn on) orreset (turn off) the specified number of points (N), starting at the specifiedaddress (Bit). You can set or reset from 1 to 255 points.
Set Immediate and Reset Immediate: The SetImmediate and Reset Immediate instructions immediately set (turn on) orimmediately reset (turn off) the number of points (N), starting at specifiedaddress (Bit). You can set or reset from 1 to 128 points immediately
8/10/2019 L-14 PLC_3
25/70
8/10/2019 L-14 PLC_3
26/70
8/10/2019 L-14 PLC_3
27/70
8/10/2019 L-14 PLC_3
28/70
8/10/2019 L-14 PLC_3
29/70
The Set Dominant Bistable is a latch where the set dominates. If the set (S1) and reset (R)signals are both true, the output (OUT) is true.
The Reset Dominant Bistable is a latch where the reset dominates. If the set (S) and reset(R1) signals are both true, the output (OUT) is false.
8/10/2019 L-14 PLC_3
30/70
8/10/2019 L-14 PLC_3
31/70
An on-delay timer will wait for a set time after a line of ladder logichas been true before turning on, but it will turn off immediately.
An off-delay timer will turn on immediately when a line of ladderlogic is true, but it will delay before turning off.
Consider the example of an old car. If you turn the key in theignition and the car does not start immediately, that is an on-delay.
If you turn the key to stop the engine but the engine doesnt stopfor a few seconds, that is an off delay. An on-delay timer can beused to allow an oven to reach temperature before startingproduction.
An off delay timer can keep cooling fans on for a set time after the
oven has been turned off. A retentive timer will sum all of the on or off time for a timer, even if
the timer never finished.
A nonretentive timer will start timing the delay from zero each time
8/10/2019 L-14 PLC_3
32/70
The SIMATIC timers are available in three resolutions: 1 ms, 10 ms, and 100 ms.
8/10/2019 L-14 PLC_3
33/70
8/10/2019 L-14 PLC_3
34/70
8/10/2019 L-14 PLC_3
35/70
8/10/2019 L-14 PLC_3
36/70
Comparing Numerical Values The compareinstructions are used to compare two values
8/10/2019 L-14 PLC_3
37/70
8/10/2019 L-14 PLC_3
38/70
The Count Down instruction(CTD) counts down from thecurrent value of that countereach time the count down (CD)input makes the transition fromoff to on.
When the current value Cxx is
equal to 0, the counter bit Cxxturns on.
The counter resets the counterbit Cxx and loads the currentvalue with the preset value PVwhen the load input LD turns on.
The counter stops upon reachingzero, and the counter bit Cxxturns on.
8/10/2019 L-14 PLC_3
39/70
8/10/2019 L-14 PLC_3
40/70
8/10/2019 L-14 PLC_3
41/70
8/10/2019 L-14 PLC_3
42/70
8/10/2019 L-14 PLC_3
43/70
8/10/2019 L-14 PLC_3
44/70
8/10/2019 L-14 PLC_3
45/70
8/10/2019 L-14 PLC_3
46/70
8/10/2019 L-14 PLC_3
47/70
Detecting the standing bottles on the conveyor and pushing fallingbottles in tray
X0 Proximity Sensor to sense bottom of the Bottle i.e. X0 = ONwhen the detected input signal from the bottle-bottom issheltered.
X1 Proximity Sensor to sense upper part of the Bottle i.e. X1 = ON
when the detected input signal from the bottle-neck is sheltered.
8/10/2019 L-14 PLC_3
48/70
Problem: Develop Ladder Logic for a cardoor/seat belt safety system.
When the car door is open, and the seatbeltis not done up, the ignition power must not
be applied. If all is safe then the key will startthe engine.
8/10/2019 L-14 PLC_3
49/70
8/10/2019 L-14 PLC_3
50/70
Problem: Design a motor controller that has aforward and a reverse button. The motorforward and reverse outputs will only be onwhen one of the buttons is pushed.
When both buttons are pushed the motor willnot work.
8/10/2019 L-14 PLC_3
51/70
8/10/2019 L-14 PLC_3
52/70
Develop the ladder logic that will turn on alight, after switch A has been closed 10times. Push button B will reset the counters
8/10/2019 L-14 PLC_3
53/70
Develop the ladder logic that will turn on an output(light), 15 seconds after switch (A) has been turnedon.
8/10/2019 L-14 PLC_3
54/70
Develop the ladder logic that will turn on a output (light),after a switch (A) has been closed 10 times. Push button (B)will reset the counters.
8/10/2019 L-14 PLC_3
55/70
Write a ladder logic program that will count the number ofparts in a buffer. As parts arrive they activate input A. Asparts leave they will activate input B. If the number of parts isless than 8 then a conveyor motor, output C, will be turnedon.
8/10/2019 L-14 PLC_3
56/70
Write a simple program that will use onetimer to flash a light. The light should be onfor 1.0 seconds and off for 0.5 seconds.
8/10/2019 L-14 PLC_3
57/70
Write a program that only uses one timer. When an input A isturned on a light will be on for 10 seconds.
After that it will be off for two seconds, and then again on for5 seconds.
After that the light will not turn on again until the input A is
turned off.
8/10/2019 L-14 PLC_3
58/70
8/10/2019 L-14 PLC_3
59/70
Here the water sprinkler system (Q0.0) starts towork when either temperature sensor(I0.0) orhumidity sensor (I0.1) send a signal to it.
In this scenario grass will be water first (water thegrass Q0.1) fro 4 second (it is assumed very smallfor simplicity) and then flowers will be water (waterthe flowers Q0.2) for 10 second and at last treeswill be watered (water the trees Q0.3) for 18seconds. Since it is required to avoid pressure drop
in the water line ,each section is separated andhere the order to water this garden is given: Firstgrass, second flowers and third trees.
8/10/2019 L-14 PLC_3
60/70
In the following example, ascale is connected to a loadcell. A load cell is a device thatgenerates an electrical outputproportional to the forceapplied. In this example, theload cell is converting a value
of weight from 0 to 500pounds into a 0 - 10 VDCoutput. The 0 - 10 VDC loadcell output is connected to theinput of an S7-200 PLC analogexpansion module. The analogvalue applied to the PLC can
be used in various ways. Forinstance, the actual weight canbe compared to a desiredweight for a package or groupof packages.
8/10/2019 L-14 PLC_3
61/70
This example can be expanded to include a conveyor system
with a gate to direct packages of varying weight. As packagesmove along the conveyor they are weighed. A package thatweighs at or greater than a specified value is routed along oneconveyor path. A package that weighs less than a specified valueis routed along another conveyor path, where it will later beinspected for missing contents. All of this functionality can becontrolled by an S7-200 PLC.
8/10/2019 L-14 PLC_3
62/70
An automatic stamp system shown in Figure 2 works as follows: Whenstart switch is turned on, system gets ready to run.
When the operator puts a box at the beginning of the conveyor (on LS1)the motor runs and conveyor moves.
Upon reaching the mid point of the conveyor (on LS2) the conveyor motor stops. Then the stamp comes down and puts the stamp on the
box.
When this process is finished, the stamp goes up and conveyor movesagain to the other end of the conveyor. After box reaches to end of the conveyor (on LS3), the motor stops. The system waits for the box to get and the another box to be placed at
the beginning of the conveyor. If start switch is turned off, the system can not run even if there is a box
on conveyor. The light on the start box indicates that the system is
active whereas UP and Down lights indicate that the stamp is UP andDOWN position respectively. Develop a LAD to control the stamp system.
8/10/2019 L-14 PLC_3
63/70
8/10/2019 L-14 PLC_3
64/70
The system to be controlled by PLC consists of two belts. If the Start button ispressed, Conveyor Belt-1 will begin to run. After 5 seconds Conveyor Belt-2 will be
active. After the whole system runs for 15 seconds, Conveyor Belt-1 will stop. Then
Conveyor Belt-2 continues to move for 5 seconds and then it will stop, too. Also the
system can be reset by the emergency-stop button at any time.Construct a LAD forS7-200 PLC to control the system
8/10/2019 L-14 PLC_3
65/70
The parking lot whichhas a capacity of 100cars is to be controlledby a PLC system. Thesensor S1 and S2 areused to count the carat the entrance and
exit. If the number ofthe cars reaches to100, red light is lit andthe gate arm is closed.The arm stays closeduntil one or moreparking space is
available in the lot. Thegate arm is controlledbyactivating/deactivatingthe gate solenoid (GS).
8/10/2019 L-14 PLC_3
66/70
8/10/2019 L-14 PLC_3
67/70
8/10/2019 L-14 PLC_3
68/70
8/10/2019 L-14 PLC_3
69/70
8/10/2019 L-14 PLC_3
70/70