Download presentation
1
Logic Functions OR Operation
A coil is not energized until either normally open switch A or B is closed. Boolean Logic Diagram
2
Logic Functions NOR Operation
There has to be an output when neither A nor B has input. When there is input to A or B the output ceases. The ladder program shows Input 1 in series with Input 2, with both being represented by normally closed contacts.
3
Logic Functions NAND Operation
There is no output when both A and B have an input. For the ladder program line to obtain an output we require no inputs to Input 1 and to Input 2.
4
Logic Functions EXCLUSIVE-OR (XOR) Operation
No output when the status of the inputs is same No output when there is no input to both Input 1 and 2 and when there is an input to both Input 1 and Input 2
5
Testing a Program Through Simulation
Once a program has been written it needs to be tested and debugged. One way this can be done is to simulate the field inputs with an input simulator. The program is first downloaded from the programming device to the CPU. The selector switch is placed in the RUN position. The simulator switches are operated and the resulting indication is observed on the output status indicator lamps.
6
Testing a Program Through Simulation
Status Functions After a program has been loaded and is running in the PLC, the actual status of ladder elements can be monitored. The standard method of showing a ladder element is by indicating the circuit condition it produces when the device is in the de-energized or non operative state. In the above illustration, input 1 (I0.0) is programmed as a normally open (NO) contact. In this condition, power will not flow through the contacts to the output (Q0.0). When viewing the ladder diagram in the status mode, control elements that are active are highlighted. In the following, example the toggle switch connected to input 1 has been closed. Power flows through the control element associated with input (I0.0), output (Q0.0) is active, and the lamp is on.
7
Testing a Program Through Simulation
Forcing Used to temporarily override the input or output status of the application in order to test and debug the program Forcing is another useful tool in the commissioning or maintenance of a PLC system. It can be used to temporarily override the input or output status of the application in order to test and debug the program. The force function can also be used to override discrete output points or to skip portions of a program by enabling a jump instruction with a forced memory bit. In the example shown, the toggle switch is open. Under normal circumstances, the toggle switch would have to be closed to enable input (I0.0) and turn on the output light. However, input can be forced on even though the input toggle switch is open. With input forced high, the lamp will be on. When a function is forced the control bit identifier is highlighted. The element is also highlighted because it is on.
8
Testing a Program Through Simulation
Forcing Appearance of ladder elements in the off, forced, and on conditions.
9
Case Study -1 Discrete Inputs/Outputs Wiring
The same simple lamp circuit previously discussed, is useful to review to understand discrete I/O control. In this example, the lamp is off when the switch is open and on when the switch is closed. To accomplish this task, a switch is wired to an input terminal of the PLC and an indicator light is wired to an output terminal.
10
Case Study – 1 contd… Discrete Inputs/Outputs
The above drawing illustrates the operation of a simple program that allows a toggle switch to control a lamp. Once programmed, the CPU repetitively scans the status of I/O points and the stored program. As long as the toggle switch is open, the lamp remains off. However, when the toggle switch closes, the internal status of I0.0 changes to a 1. This causes the I0.0 normally open contact in the program to close, activating the Q0.0 coil and changing the associated output status bit to 1. On the next scan of the PLCs I/O, the lamp turns on.
11
Case Study - 2 Motor starter to control a three-phase AC motor:
Hard-wired Approach While the lamp application is useful to explain basic PLC operation, a more practical application is a start-stop control of an AC motor. Before examining the PLC application, first consider a hard-wired approach. The line diagram illustrates how a normally open and a normally closed pushbutton might be connected to control a three-phase AC motor. In this example, a motor starter coil (M) is wired in series with a normally open momentary Start pushbutton, a normally closed momentary Stop pushbutton, and normally closed overload relay (OL) contacts.
12
Case Study – 2 contd… Motor Starter – Hard-wired Approach
Momentarily depressing the Start pushbutton completes the path of current flow and energizes the motor starter (M). This closes the associated M and Ma (auxiliary contact located in the motor starter) contacts. When the Start button is released, current continues to flow through the Stop button and the Ma contact, and the M coil remains energized. The motor will run until the normally closed Stop button is pressed unless the overload relay (OL) contacts open. When the Stop button is pressed, the path of current flow is interrupted opening the associated M and Ma contacts, and the motor stops.
13
Case Study – 2 contd… Motor Starter – PLC Approach
14
Case Study – 2 contd… Motor Starter – PLC Approach
In the above example, a normally open Start pushbutton is wired to the first input (I0.0), a normally closed Stop pushbutton is wired to the second input (I0.1), and normally closed overload relay contacts (part of the motor starter) are connected to the third input (I0.2). These inputs are used to control normally open contacts in a line of ladder logic programmed into the PLC. Initially, I0.1 status bit is a logic 1 because the normally closed (NC) Stop pushbutton is closed. I0.2 status bit is a logic 1 because the normally closed (NC) overload relay (OL) contacts are closed. I0.0 status bit is a logic 0, however, because the normally open Start pushbutton has not been pressed. Normally open output Q0.0 is also programmed on Network as a sealing contact. With this simple network, energizing output coil Q0.0 is required to turn on the motor.
15
Case Study – 2 contd… Motor Starter – PLC Approach
When Start pushbutton is pressed, the CPU receives a logic 1 from input I0.0. This causes the I0.0 contact to close. All three inputs are now a logic 1. The CPU sends a logic 1 to output Q0.0. The motor starter is energized and the motor starts.
16
Case Study – 2 contd… Motor Starter – PLC Approach
The output status bit for Q0.0 is now a 1. On the next scan, when normally open contact Q0.0 is encountered, the contact will close and output Q0.0 will stay on even if the Start pushbutton is released.
17
Case Study – 2 contd… Motor Starter – PLC Approach
When the Stop pushbutton is pressed, input I0.1 turns off, the I0.1 contact opens, output coil Q0.0 de-energizes, and the motor turns off.
18
Case Study – 2 contd… Expanding the Application - Run & Stop Indicators Lamps The application can easily be expanded to include indicator lights for run and stop conditions. In this example, a RUN indicator light is connected to output Q0.1 and a STOP indicator light is connected to output Q0.2.
19
Case Study – 2 contd… Expanding the Application - Run & Stop Indicators Lamps The ladder logic for this application includes a normally open output contact Q0.0 connected on Network 2 to output Q0.1 and a normally closed Q0.0 contact connected on Network 3 to output Q0.2. When Q0.0 is off, the normally open Q0.0 contact on Network 2 is open and the RUN indicator off. At the same time, the normally closed Q0,0 contact is closed and the STOP indicator is on. When Q0.0 is off, the normally open Q0.0 contact on Network 2 is open and the RUN indicator off. At the same time, the normally closed Q0,0 contact is closed and the STOP indicator is on.
20
Case Study – 2 contd… Expanding the Application - Run & Stop Indicators Lamps When the Start button is pressed, the PLC starts the motor. Output Q0.0 is now on. The normally open Q0.0 contact on Network 2 is now closed and the RUN indicator on. At the same time, the normally closed Q0.0 contact on Network 3 is open and the STOP indicator light connected to output Q0.2 is off. Start button is pressed, output Q0.0 is on. The normally open Q0.0 contact on Network 2 is closed and the RUN indicator on. The normally closed Q0.0 contact on Network 3 is open and the STOP indicator light connected to output Q0.2 is off.
21
Case Study – 2 contd… Adding a Limit Switch
The application can be further expanded by adding a limit switch with normally open contacts to input I0.3. A limit switch could be used to stop the motor or prevent the motor from being started. This limit switch might be associated with an access door to the motor, or its associated equipment. A limit switch could be used to stop the motor or prevent the motor from being started.
22
Case Study – 2 contd… Adding a Limit Switch
If the access door is open, the normally open contacts of LS1 connected to input I0.3 are open and the motor will not start.
23
Case Study – 2 contd… Adding a Limit Switch
When the access door closes, LS1 closes. Input I0.3 is now on, and the motor will start when the Start pushbutton is pressed.
24
Case Study – 2 contd… Further Expansion
The PLC program can be further expanded to accommodate many commercial and industrial applications. Additional Start/Stop pushbuttons and indicator lights can be added for remote operation, or control of a second motor starter and motor. Over-travel limit switches can be added along with proximity switches for sensing object position. In addition, expansion modules can be added to further increase the I/O capability. The applications are only limited by the number of I/Os and amount of memory available on the PLC.
25
Analog Inputs and Outputs
Many PLCs also work with analog I/O devices. Analog devices use signals that continuously vary within a specified range such as 0 to 10 VDC or 4 to 20 mA. Analog signals are used to represent changing values such as speed, temperature, weight, and level. In order to process an input of this type, a PLC must convert the analog signal into a digital representation. This means that an expansion module capable of converting the analog signal must be used. Analog modules convert standard voltage and current analog values into a 8-bit or 12-bit digital representation. The digital values are transferred to the PLC for use in register or word locations. In addition, analog modules are available for use with thermocouple and RTD type sensors which sense the temperature at a specific point in a machine or process.
26
Analog Inputs Application Example
In the above 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 VDC output. The VDC load cell output is connected to the input of a 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.
27
Analog Inputs Expanding the Application – A Conveyor System
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. The previous example can be expanded to include a conveyor system with a gate to direct packages of varying weight.
28
Analog Outputs The transducer takes the voltage signal
Depending on the requirement, amplifies, reduces, or changes it into another signal which controls the device. The VDC signal controls the Lbs. scale analog meter Analog outputs are used in applications requiring control capability of field devices which respond to continuously varying voltage or current levels. For example, analog outputs may be used as a variable reference for control valves, chart recorders, electric motor drives, analog meters, and pressure transducers. Like analog inputs, analog outputs are generally connected to a controlling device through a transducer. The transducer takes the voltage signal and, depending on the requirement, amplifies, reduces, or changes it into another signal which controls the device. In the following example, a VDC signal controls a Lbs. scale analog meter
29
Timers Timers are devices that count increments of time
Timers are devices that count increments of time. Traffic lights are one example where timers are used. In this example timers are used to control the length of time between signal changes. Timers are represented by boxes in ladder logic. When a timer receives an enable, the timer starts to time. The timer compares its current time with the preset time. The output of the timer is a logic 0 as long as the current time is less than the preset time. When the current time is greater than the preset time, the timer output is a logic 1. S7-200 uses three types of timers: On-Delay (TON), Retentive On-Delay (TONR), and Off-Delay (TOF). S7-200 timers are provided with resolutions of 1 millisecond, 10 milliseconds, and 100 milliseconds. The maximum value of these timers is seconds, seconds, and seconds, respectively. By adding program elements, logic can be programmed for much greater time intervals. Timers are devices that count increments of time The output of the timer is a logic 0 as long as the current time is less than the preset time. When the current time is greater than the preset time, the timer output is a logic 1
30
Timers Hard-Wired Timing Circuit (On-delay)
When S1 closes, TR1 begins timing. When 5 seconds (preset) have elapsed, TR1 will close its associated normally open TR1 contacts, illuminating pilot light PL1. When S1 opens, de-energizing TR1, the TR1 contacts open, immediately extinguishing PL1. Timers used with PLCs can be compared to timing circuits used in hard-wired control line diagrams. In the following example, a normally open (NO) switch (S1) is used with a timer (TR1). For this example, the timer has been set for 5 seconds. When S1 closes, TR1 begins timing. When 5 seconds have elapsed, TR1 will close its associated normally open TR1 contacts, illuminating pilot light PL1. When S1 opens, de-energizing TR1, the TR1 contacts open, immediately extinguishing PL1. This type of timer is referred to as an on-delay timer. The term “on-delay” indicates that once a timer receives an enable signal, a preset amount of time must pass before the timer’s output coil (TR1) turns on.
31
Timers On-Delay Timer (TON)
The previous example illustrated how a hardware on-delay timer works. The corresponding software function in an S7-200 PLC is the On-Delay Timer (TON) shown below. When the On-Delay Timer (TON) receives an enable (logic 1) at its input (IN), a predetermined amount of time (preset time - PT) passes before the timer bit (T-bit) turns on. The T-bit is a logic function internal to the timer and is not shown on the symbol. The timer resets to the accumulated time to zero when the enabling input goes to a logic 0. When the On-Delay Timer (TON) receives an enable (logic 1) at its input (IN), a predetermined amount of time (preset time - PT) passes before the timer bit (T-bit) turns on. The timer resets to the accumulated time to zero when the enabling input goes to a logic 0.
32
Timers Example A switch is connected to input I0.3, and a light is connected to output Q0.1. In the following simple timer example, a switch is connected to input I0.3, and a light is connected to output Q0.1. When the switch closes, the I0.3 contact closes, and timer T37 begins timing. T37 has a time base of 100 ms (0.1 seconds). The preset time (PT) value has been set to 150. This is equivalent to 15 seconds (0.1 x 150 ). 15 seconds after the input switch closes, the timer output becomes a logic 1, the T37 contact closes, output Q0.1 becomes a logic 1, and the light turns on. If the switch were opened before 15 seconds has passed, then re-closed, the timer would again begin timing at 0. Because this type of timer does not retain its accumulated time when its input (IN) goes to logic 0, it is said to be non-retentive. If the switch were opened before 15 seconds has passed, then re-closed, the timer would again begin timing at 0. Because this type of timer does not retain its accumulated time when its input (IN) goes to logic 0, it is said to be non-retentive.
33
Timers T37 is now a normally closed contact.
What is the function of this circuit now? A small sample of the flexibility of PLCs is shown in the following program logic. By reprogramming the T37 contact as a normally closed contact, the function of the circuit is changed to cause the indicator light to turn off only when the timer times out. This function change was accomplished without changing or rewiring I/O devices. Function: Causes the indicator light to turn off only when the timer times out
34
Timers Retentive On-Delay Timer (TONR)
Just like the On-Delay timer (TON), the Retentive On-Delay Timer (TONR) times as long as the enabling input is on, but does not reset when the input goes off. The Retentive On-Delay Timer (TONR) functions in a similar manner to the On-Delay Timer (TON). Just like the On-Delay timer (TON), the Retentive On-Delay Timer (TONR) times as long as the enabling input is on, but does not reset when the input goes off. The timer must be reset with a RESET (R) instruction.
35
Timers Example If, for example, after 10 seconds input I0.3 turns off, the timer stops. When input I0.3 turns on again, the timer begins timing at 10 seconds. The light connected to Q0.1 turns on 5 seconds after input I0.3 has been closed for the second time. The same example used with the On-Delay Timer (TON) is shown below with the Retentive On-Delay timer (TONR). When the switch connected to input I0.3 closes, I0.3 contact closes, and timer T5 begins timing. If, for example, after 10 seconds input I0.3 turns off, the timer stops. When input I0.3 turns on again, the timer begins timing at 10 seconds. The light connected to O0.1 turns on 5 seconds after input I0.3 has been closed for the second time.
36
Timers Off-Delay Timer
Used to delay turning an output off for a fixed period of time after the input turns off When the enabling bit turns on, the timer bit turns on immediately, and the time value is set to 0. When the input turns off, the timer times until the preset time has elapsed. At that time, the timer bit turns off. The Off-Delay Timer (TOF) is used to delay turning an output off for a fixed period of time after the input turns off. When the enabling bit turns on, the timer bit turns on immediately, and the time value is set to 0. When the input turns off, the timer times until the preset time has elapsed. At that time, the timer bit turns off.
37
Timers Timer Example A tank is filled with two chemicals, the solution is mixed, and the tank is drained.
38
Timers Steps When the Start button is pressed, input I0.0 turns on, and the program starts pump 1, controlled by output Q0.0. Pump 1 runs for 5 seconds, adding the first chemical to the tank, then shuts off. The program then starts pump 2, controlled by output Q0.1. Pump 2 runs for 3 seconds adding the second chemical to the tank. After 3 seconds pump 2 shuts off. The program then starts the mixer motor, connected to output Q0.2 and mixes the two chemicals for 60 seconds. Next, the program opens the drain valve, controlled by output Q0.3, and starts pump 3 controlled by output Q0.4. Pump 3 shuts off after 8 seconds and the process stops.
39
Counters Counters compare an accumulated value to a preset value to control circuit functions. Used to initiate an operation when a count is reached or to prevent an operation from occurring until a count has been reached. Counters used in PLCs serve the same function as mechanical counters. Counters compare an accumulated value to a preset value to control circuit functions. Counters can be used to initial an operation when a count is reached or to prevent an operation from occurring until a count has been reached. A bottling machine, for example, may use a counter to count bottles into groups of six for packaging.
40
Counters Counters are represented by boxes in ladder logic. Counters increment or decrement one count each time the input transitions from off (logic 0) to on (logic 1). Counters are reset when a RESET instruction is executed. There are 256 counters available in the S7-200, numbered C0 through C255. The same number cannot be assigned to more than one counter. For example, if an up counter is assigned number 45, a down counter cannot also be assigned number 45. The maximum count value of a counter is ±32,767.
41
Counters Count Up Counter (CTU)
Counts up from the current value each time the count up (CU) input goes from off to on. When the current value is greater than or equal to the preset value (PV), the counter bit is a logic 1. The course resets when the reset (R) input turns on. The counter stops counting when it reaches its maximum value of 32,767.
42
Counters Count Down Counter (CTD)
Counts down from the current value each time the count down (CD) input goes from off to on. When the current value is equal to zero, the counter bit is a logic 1. The counter stops counting at zero. The counter resets and loads the current value with the preset value (PV) when the load input (LD) turns on.
Similar presentations
© 2024 SlidePlayer.com Inc.
All rights reserved.