【正文】
put 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.) Figure 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 . 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) The last instruction is the 沈陽建筑大學(xué)畢業(yè)設(shè)計(jì) 19 IOT (Immediate OutpuT)that will allow outputs to be updated without having to wait for the ladder logic scan to be pleted. INPUTS AND OUTPUTS Inputs to, and outputs from, a PLC are necessary to monitor and control a process. Both inputs and outputs can be categorized into two basic types: logical or continuous. Consider the example of a light bulb. If it can only be turned on or off, it is logical control. If the light can be dimmed to different levels, it is continuous. Continuous values seem more intuitive, but logical values are preferred because they allow more certainty, and simplify control. As a result most controls applications (and PLCs) use logical inputs and outputs for most applications. Hence, we will discuss logical I/O and leave continuous I/O for later. Outputs to actuators allow a PLC to cause something to happen in a process. A short list of popular actuators is given below in order of relative popularity. Solenoid Valves logical outputs that can switch a hydraulic or pneumatic flow. Lights logical outputs that can often be powered directly from PLC output Starters motors often draw a large amount of current when started, so they require motor starters, which are basically large relays. Servo Motors a continuous output from the PLC can mand a variable speed or position. Outputs from PLCs are often relays, but they can also be solid state electronics such as transistors for DC outputs or Triacs for AC outputs. Continuous outputs require special output cards with digital to analog converters. Inputs e from sensors that translate physical phenomena into electrical signals. Typical examples of sensors are listed below in relative order of Switches use inductance, capacitance or light to detect an object logically. Switches mechanical mechanisms will open or close electrical contacts for a logical signal. Potentiometer measures angular positions continuously, using resistance. LVDT (linear variable differential transformer) measures linear displacement continuously using magic coupling. Inputs for a PLC e in a few basic varieties, the simplest are AC and DC inputs. Sourcing and sinking inputs are also popular. This output method dictates that a device does not supply any power. Instead, the device only switches current on or off, like a simple switch. Sinking When active the output allows current to flow to a mon ground. This is best selected when different voltages are supplied. Sourcing When active, current flows from a supply, through the output device and to ground. This method is best used when all devices use a single supply voltage. This is also referred to as NPN (sinking) and PNP (sourcing). PNP is more popular. This will be covered in detail in the chapter on sensors. Inputs In smaller PLCs the inputs are normally built in and are specified when purchasing the PLC. For larger PLCs the inputs are purchased as modules, or cards, with 8 or 16 inputs of the same type on each card. For discussion purposes we will discuss all inputs as if they have been purchased as cards. The list below shows typical ranges for input voltages, and is roughly in order of popularity. PLC input cards rarely supply power, this means that an external power supply is needed to supply power for the inputs and sensors. The example in Figure shows how to connect an AC input card. 沈陽建筑大學(xué)畢業(yè)設(shè)計(jì) 20 Figure An AC Input Card and Ladder Logic In the example there are two inputs, one is a normally open push button, and the second is a temperature switch, or thermal relay. (NOTE: These symbols are standard and will be discussed later in this chapter.) Both of the switches are powered by the positive/ hot output of the 24Vac power supply this is like the positive terminal on a DC supply. Power is supplied to the left side of both of the switches. When the switches are open there is no voltage passed to the input card. If either of the switches are closed power will be supplied to the input card. In this case inputs 1 and 3 are used notice that the inputs start at 0. The input card pares these voltages to the mon. If the input voltage is within a given tol