【正文】
llers (PLC) and their varied applications. From their introduction more than 30 years ago, PLC has bee the er stone of hundreds of thousands of control systems in a wide range of industries.At heart, the PLC is an industrialized puter programmed with highly specialized languages, and it continues to benefit from technological advances in the puter and information technology worlds. The most prominent of which is miniaturization and munications. Programmable logic controllers I/O channel specifications include total number of points, number of inputs and outputs, ability to expand, and maximum number of channels. Expandable units may be stacked or linked together to increase total control capacity. PLC system specifications to consider include scan time, number of instructions, data memory, and program memory. Instructions are standard operations (such as math functions) available to PLC software. Program memory is the capacity for control software. Available inputs for programmable logic controllers include DC, AC, analog, thermocouple, RTD, frequency or pulse, transistor, and interrupt inputs. Programming options for PLC include front panel, hand held, and puter. Programmable logic controllers use a variety of software programming languages for control. The IEC 611313 programming environment provides support for five languages specified by the global standard: Sequential Function Chart, Function Block Diagram, Ladder Diagram, Structured Text, and Instruction List. This allows for multivendor patibility and multilanguage programming. FBD uses a broad function library to build plex procedures in a graphical format. Standard math and logic functions may be coordinated with customizable munication and interface functions. ST is a text language used for plex mathematical procedures and calculations less well suited to graphical languages. Relay Ladder Logic (RLL), or ladder diagrams, is the primary programming language for programmable logic controllers (PLC). Ladder logic programming is a graphical representation of the program designed to look like relay logic. C is a high level programming language suited to handle the most plex putation, sequential, and data logging tasks. It is typically developed and debugged on a PC. PLC power options, mounting options and environmental operating conditions are all also important to consider.2. INTRODUCTIONFor simple programming the relay model of the PLC is sufficient. As more plex functions are used the more plex VonNeuman model of the PLC must be used. A VonNeuman puter processes one instruction at a time. Most puters operate this way, although they appear to be doing many things at once. Consider the puter ponents shown in Figure 1.Figure 1 Simplified Personal Computer ArchitectureInput is obtained from the keyboard and mouse, output is sent to the screen, and the disk and memory are used for both input and output for storage. (Note: the directions of these arrows are very important to engineers, always pay attention to indicate where information is flowing.) This figure can be redrawn as in Figure 2 to clarify the role of inputs and outputs.Figure 2 An InputOutput Oriented ArchitectureIn this figure the data enters the left side through the inputs. (Note: most engineering diagrams have inputs on the left and outputs on the right.) It travels through buffering circuits before it enters the CPU. The CPU outputs data through other circuits. Memory and disks are used for storage of data that is not destined for output. If we look at a personal puter as a controller, it is controlling the user by outputting stimuli on the screen, and inputting responses from the mouse and the keyboard.A PLC is also a puter controlling a process. When fully integrated into an application the analogies bee。Power on this will be on whenever the PLC has power.Program running this will often indicate if a program is running, or if no program is running.Fault this will indicate when the PLC has experienced a major hardware or software problem.These lights are normally used for debugging. Limited buttons will also be provided for PLC hardware. The most mon will be a run/program switch that will be switched to program when maintenance is being conducted, and back to run when in production. This switch normally requires a key to keep unauthorized personnel from altering the PLC program or stopping execution. A PLC will almost never have an onoff switch or reset button on the front. This needs to be designed into the remainder of the system.The status of the PLC can be detected by ladder logic also. It is mon for programs to check to see if they are being executed for the first time, as shown in Figure 6. The ’first scan’ input will be true on the very first time the ladder logic is scanned, but false on every other scan. In this case the address for ’first scans’ in a PLC5 is ’S2:1/14’. With the logic in the example the first scan will seal on ’light’, until ’clear’ is turned on. So the light will turn on after the PLC has been turned on, but it will turn off and stay off after ’clear’ is turned on. The ’first scan’ bit is also referred to at the ’first pass’ bit.Figure 6 A programs that checks for the first scan of the PLC7. MEMORY TYPESThere are a few basic types of puter memory that are in use today.RAM (Random Access Memory) this memory is fast, but it will lose its contents when power is lost, this is known as volatile memory. Every PLC uses this memory for the central CPU when running the PLC.ROM (Read Only Memory) this memory is permanent and cannot be erased. It is often used for storing the operating system for the PLC.EPROM (Erasable Programmable Read Only Memory) this is memory that can be programmed to behave like ROM, but it can be erased with ultraviolet light and reprogrammed.EEPROM (Electronically Erasable Programmable Read Only Memory) – This