Sei sulla pagina 1di 70

To access a bit in a memory area, you specify the address, which

includes the memory area identifier, the byte address, and the bit
number.

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

The S7-200 samples the physical input points


at the beginning of each scan cycle and writes
these values to the process-image input
register.
You can access the process-image input
register in bits, bytes, words, or double
words:

At the end of the scan cycle, the S7-200


copies the values stored in the processimage output register to the physical output
points.
You can access the process-image output
register in bits, bytes, words, or double
words:

You can use V memory to store intermediate


results of operations being performed by the
control logic in your program.
You can also use V memory to store other
data pertaining to your process or task. You
can access the V memory area in bits, bytes,
words, or double words:

You can use the bit memory area (M memory)


as control relays to store the intermediate
status of an operation or other control
information.
You can access the bit memory area in bits,
bytes, words, or double words

The S7-200 provides timers that count increments of time in


resolutions (time-base increments) of 1 ms, 10 ms, or 100 ms. Two
variables are associated with a timer:
Current value: this 16-bit signed integer stores the amount of time
counted by the timer.
Timer 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 timer instruction.

The S7-200 provides three types of counters that count each low-to-high
transition event on the counter input(s): one type counts up only, one type
counts down only, and one type counts both up and down. Two variables are
associated 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 counter
instruction.

The high-speed counters count high-speed


events independent of the CPU scan. Highspeed counters have a signed, 32-bit integer
counting value (or current value).
The current value of the high-speed counter
is a read-only value and can be addressed
only as a double word (32 bits).

The accumulators are read/write devices that can be used like memory. For
example, you can use accumulators to pass parameters to and from
subroutines and to store intermediate values used in a calculation. The S7200 provides four 32-bit accumulators (AC0, AC1, AC2, and AC3).

The SM bits provide a means for communicating information between the


CPU and your program.
You can use these bits to select and control some of the special functions of
the S7-200 CPU, such as: a bit that turns on for the first scan cycle, a bit that
toggles at a fixed rate, or a bit that shows the status of math or operational
instructions.

The S7-200 converts an analog value (such as temperature or voltage) into a


word-length (16-bit) digital value. You access these values by the area
identifier (AI), size of the data (W), and the starting byte address.
Since analog inputs are words and always start on even-number bytes (such
as 0, 2, or 4), you access them with even-number byte addresses (such as
AIW0, AIW2, or AIW4). Analog input values are read-only values.

The S7-200 converts a word-length (16-bit) digital value into a current or


voltage, 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), and
the starting byte address.
Since analog outputs are words and always start on even-number bytes (such
as 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.

SCRs or S bits are used to organize machine operations or steps into


equivalent program segments.
SCRs allow logical segmentation of the control program.
You can access the S bits as bits, bytes, words, or double words.

S7-200 Instruction Set

Standard contact: The Normally Open contact instructions (LD, A, and O)


and Normally Closed contact instructions (LDN, AN, ON) obtain the
referenced value from the memory or from the process-image register.
The standard contact instructions obtain the referenced value from the
memory (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 is
closed (on) when the physical input point (bit) is 0.
NOT Instruction: The Not instruction (NOT) changes the state of power
flow input (that is, it changes the value on the top of the stack from 0 to
1 or from1 to 0).
Positive and Negative Transition Instructions: The Positive Transition
contact instruction (EU) allows power to flow for one scan for each offto-on transition.

Output:

The Output instruction (=) writes the new value for the output
bit to the process-image register.
When the Output instruction is executed, the S7-200 turns the output bit in
the process-image register on or off.

Output Immediate:

Set and Reset:

Set Immediate and Reset Immediate: The Set

The Output Immediate instruction (=I) writes


the new value to both the physical output and the corresponding processimage register location when the instruction is executed.
The Set (S) and Reset (R) instructions set (turn on) or
reset (turn off) the specified number of points (N), starting at the specified
address (Bit). You can set or reset from 1 to 255 points.
Immediate and Reset Immediate instructions immediately set (turn on) or
immediately reset (turn off) the number of points (N), starting at specified
address (Bit). You can set or reset from 1 to 128 points immediately

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.

An on-delay timer will wait for a set time after a line of ladder logic
has been true before turning on, but it will turn off immediately.
An off-delay timer will turn on immediately when a line of ladder
logic is true, but it will delay before turning off.
Consider the example of an old car. If you turn the key in the
ignition 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 stop
for a few seconds, that is an off delay. An on-delay timer can be
used to allow an oven to reach temperature before starting
production.
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

The SIMATIC timers are available in three resolutions: 1 ms, 10 ms, and 100 ms.

Comparing Numerical Values The compare


instructions are used to compare two values

The Count Down instruction


(CTD) counts down from the
current value of that counter
each time the count down (CD)
input makes the transition from
off to on.
When the current value Cxx is
equal to 0, the counter bit Cxx
turns on.
The counter resets the counter
bit Cxx and loads the current
value with the preset value PV
when the load input LD turns on.
The counter stops upon reaching
zero, and the counter bit Cxx
turns on.

Detecting the standing bottles on the conveyor and pushing falling


bottles in tray
X0 Proximity Sensor to sense bottom of the Bottle i.e. X0 = ON
when the
detected input signal from the bottle-bottom is
sheltered.
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.

Problem: Develop Ladder Logic for a car


door/seat belt safety system.
When the car door is open, and the seatbelt
is not done up, the ignition power must not
be applied. If all is safe then the key will start
the engine.

Problem: Design a motor controller that has a


forward and a reverse button. The motor
forward and reverse outputs will only be on
when one of the buttons is pushed.
When both buttons are pushed the motor will
not work.

Develop the ladder logic that will turn on a


light, after switch A has been closed 10
times. Push button B will reset the counters

Develop the ladder logic that will turn on an output


(light), 15 seconds after switch (A) has been turned
on.

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.

Write a ladder logic program that will count the number of


parts in a buffer. As parts arrive they activate input A. As
parts leave they will activate input B. If the number of parts is
less than 8 then a conveyor motor, output C, will be turned
on.

Write a simple program that will use one


timer to flash a light. The light should be on
for 1.0 seconds and off for 0.5 seconds.

Write a program that only uses one timer. When an input A is


turned on a light will be on for 10 seconds.
After that it will be off for two seconds, and then again on for
5 seconds.
After that the light will not turn on again until the input A is
turned off.

Here the water sprinkler system (Q0.0) starts to


work when either temperature sensor(I0.0) or
humidity sensor (I0.1) send a signal to it.
In this scenario grass will be water first (water the
grass Q0.1) fro 4 second (it is assumed very small
for simplicity) and then flowers will be water (water
the flowers Q0.2) for 10 second and at last trees
will be watered (water the trees Q0.3) for 18
seconds. Since it is required to avoid pressure drop
in the water line ,each section is separated and
here the order to water this garden is given: First
grass, second flowers and third trees.

In the following example, a


scale is connected to a load
cell. A load cell is a device that
generates an electrical output
proportional to the force
applied. In this example, the
load cell is converting a value
of weight from 0 to 500
pounds into a 0 - 10 VDC
output. The 0 - 10 VDC load
cell output is connected to the
input of an S7-200 PLC analog
expansion module. The analog
value applied to the PLC can
be used in various ways. For
instance, the actual weight can
be compared to a desired
weight for a package or group
of packages.

This example can be expanded to include a conveyor system


with a gate to direct packages of varying weight. As packages
move along the conveyor they are weighed. A package that
weighs at or greater than a specified value is routed along one
conveyor path. A package that weighs less than a specified value
is routed along another conveyor path, where it will later be
inspected for missing contents. All of this functionality can be
controlled by an S7-200 PLC.

An automatic stamp system shown in Figure 2 works as follows: When


start 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 moves
again 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 and
DOWN position respectively. Develop a LAD to control the stamp system.

The system to be controlled by PLC consists of two belts. If the Start button is
pressed, 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 for
S7-200 PLC to control the system

The parking lot which


has a capacity of 100
cars is to be controlled
by a PLC system. The
sensor S1 and S2 are
used to count the car
at the entrance and
exit. If the number of
the cars reaches to
100, red light is lit and
the gate arm is closed.
The arm stays closed
until one or more
parking
space
is
available in the lot. The
gate arm is controlled
by
activating/deactivating
the gate solenoid (GS).

Potrebbero piacerti anche