The CPU handles various tasks in a time-sharing manner. The CPU can only do one thing at a time, so the execution of the program is to complete the actions on the corresponding program segments in sequence, so it belongs to the serial working mode. The working principle of PLC is introduced below.
The equivalent working circuit of PLC control system is composed of input part, internal control circuit and output part. The input part is used to collect input signals, and the output part is the executive part of the system. These two parts are related toFinder relayThe control circuit is the same. The internal control circuit realizes the control logic through programming, and the function of the relay circuit is replaced by software programming.
1. Input part
The input part is composed of external input circuit, PLC input terminal block and input Fende relay. Each input terminal has a clear and unique corresponding relationship with the input finder relay with the same number. When the external input device is in the on state, the corresponding input relay coil is energized.
Note: this input finder relay is the "soft relay" inside the PLC, that is, a bit in the basic memory unit, such as the input electrical coil is powered on, and the corresponding bit of the basic memory unit is "1"; If the input fand relay coil is powered off, the corresponding bit of the memory basic unit is "0".
The input finder relay coil can only be driven by on-site input equipment (such as control buttons, contacts of travel switches, base emitter voltage of transistors, contacts of various inspection and protection devices, etc.) and cannot be controlled by programming. Therefore, only the coil of the input relay can be used in the ladder program.
2. Internal control circuit
This is a program written by the user, which uses "soft relay" to replace the hard Fende relay to form the control logic. Its function is to check, judge, calculate and sum the states of input and output signals according to the logical relationship specified by the user program, and then get the corresponding output.
The general user program is written in ladder diagram language, which looks like finder relay control circuit diagram. In the relay control circuit, the contacts of the relay can act instantaneously or delay, while the contacts in the PLC ladder diagram act instantaneously. If time delay is required, it can be completed through the timer provided by PLC. The PLC also provides counters, bit storage and Fende relays with some special functions. The logic control functions provided by these devices of PLC can be selected according to needs during programming, and can only be used in the internal control circuit of PLC.
Precautions in programming:
1) Control should follow the principle from left to right and from top to bottom. There must be no contact on the right side of the coil.
2) The ladder program of PLC should conform to the programming rules of "top heavy, bottom light" and "left heavy, right light", so that the program structure is simplified and the running speed is fast. When several series circuits are related, the series circuit with the most contacts should be placed at the top of the ladder diagram. When several parallel circuits are connected in series, the parallel circuit with the most contacts should be placed on the leftmost side of the ladder diagram.
3. Output part
The output part is the external actual normally open contact, output terminal and many output relays in the external drive circuit of the output finder relay which is internal to the PLC and isolated from the internal control circuit. Each output relay is equipped with any number of normally open and normally closed contacts for programming the internal control circuit, and also provides an actual normally open contact for the external output circuit to connect with the output terminal.
The power supply for driving the external load circuit must be provided by the external power supply. The type and specification of the power supply can be equipped according to the load requirements, as long as it works within the voltage range allowed by PLC.