Sunday, December 15, 2013

PLC connections

When a process is controlled by a PLC it uses inputs from sensors to make decisions and update outputs to drive actuators, as shown in Figure 4. The process is a real process that will change over time. Actuators will drive the system to new states (or modes of operation). This means that the controller is limited by the sensors available, if an input is not available, the controller will have no way to detect a condition. 


http://makox.com/plc-scada/wp-content/uploads/2011/12/clip_image002.gif

 The control loop is a continuous cycle of the PLC reading inputs, solving the ladder logic, and then changing the outputs. Like any computer this does not happen instantly. Figure 5 shows the basic operation cycle of a PLC. When power is turned on initially the PLC does a quick sanity check to ensure that the hardware is working properly. If there is a problem the PLC will halt and indicate there is an error. For example, if the PLC power is dropping and about to go off this will result in one type of fault. If the PLC passes the sanity check it will then scan (read) all the inputs. After the inputs values are stored in memory the ladder logic will be scanned (solved) using the stored values – not the current values. This is done to prevent logic problems when inputs change during the ladder logic scan. When the ladder logic scan is complete the outputs will be scanned (the output values will be changed). After this the system goes back to do a sanity check, and the loop continues indefinitely. Unlike normal computers, the entire program will be run every scan. Typical times for each of the stages are in the order of milliseconds. 

http://makox.com/plc-scada/wp-content/uploads/2011/12/clip_image004.gif 


Ladder Logic

Ladder Logic
Ladder logic is the main programming method used for PLCs. As mentioned before, ladder logic has been developed to mimic relay logic. The decision to use the relay logic diagrams was a strategic one. By selecting ladder logic as the main programming method, the amount of retraining needed for engineers and trades people was greatly reduced.
Modern control systems still include relays, but these are rarely used for logic. A relay is a simple device that uses a magnetic field to control a switch, as pictured in Figure 10. When a voltage is applied to the input coil, the resulting current creates a magnetic field. The magnetic field pulls a metal switch (or reed) towards it and the contacts touch, closing the switch. The contact that closes when the coil is energized is called normally open. The normally closed contacts touch when the input coil is not energized. Relays are normally drawn in schematic form using a circle to represent the input coil. The output contacts are shown with two parallel lines. Normally open contacts are shown as two lines, and will be open (non-conducting) when the input is not energized. Normally closed contacts are shown with two lines with a diagonal line through them. When the input coil is not energized the normally closed contacts will be closed (conducting).

http://makox.com/plc-scada/wp-content/uploads/2012/05/clip_image0021.gif

                                        Figure 12 A PLC Illustrated With Relays

 Many relays also have multiple outputs (throws) and this allows an output relay to also be an input simultaneously. The circuit shown in Figure 13 is an example of this; it is called a seal in circuit. In this circuit the current can flow through either branch of the circuit, through the contacts labelled A or B. The input B will only be on when the output B is on. If B is off, and A is energized, then B will turn on. If B turns on then the input B will turn on, and keep output B on even if input A goes off. After B is turned on the output B will not turn off.

http://makox.com/plc-scada/wp-content/uploads/2012/05/clip_image008.gif 

Ladder Logic Inputs
 
PLC inputs are easily represented in ladder logic. In Figure 14 there are three types of inputs shown. The first two are normally open and normally closed inputs, discussed previously. The IIT (Immediate Input) function allows inputs to be read after the input scan, while the ladder logic is being scanned. This allows ladder logic to examine input values more often than once every cycle. (Note: This instruction is not available on the ControlLogix processors, but is still available on older models.)

http://makox.com/plc-scada/wp-content/uploads/2012/05/clip_image010.gif
                                                 Figure 14 Ladder Logic Inputs

Ladder Logic Outputs
 
In ladder logic there are multiple types of outputs, but these are not consistently available on all PLCs. Some of the outputs will be externally connected to devices outside the PLC, but it is also possible to use internal memory locations in the PLC. Six types of outputs are shown in Figure 15. The first is a normal output, when energized the output will turn on, and energize an output. The circle with a diagonal line through is a normally on output. When energized, the output will turn off. This type of output is not available on all PLC types. When initially energized the OSR (One Shot Relay) instruction will turn on for one scan, but then be off for all scans after, until it is turned off. The L (latch) and U (unlatch) instructions can be used to lock outputs on. When an L output is energized the output will turn on indefinitely, even when the output coil is deenergized. The output can only be turned off using a U output. The last instruction is the IOT (Immediate Output) that will allow outputs to be updated without having to wait for the ladder logic scan to be completed.

http://makox.com/plc-scada/wp-content/uploads/2012/05/clip_image012.gif
http://makox.com/plc-scada/wp-content/uploads/2012/05/clip_image014.gif
                                               Figure 15 Ladder Logic Outputs

No comments:

Post a Comment