Take the basic logic instructions of Mitsubishi FX series as an example to talk about the basic logic instructions of PLC

/ 2019-01-22 / Tech

PLC is a microprocessor-based, integrated computer technology, automatic control technology and communication technology, with a user-oriented "natural" process Language "programming, adapt to the industrial environment, simple and easy to understand, easy to operate, high reliability, a new generation of general industrial control devices. PLC is a general-purpose automatic control device based on microprocessor based on relay sequence control.

Programmable Logic Controller is essentially a computer dedicated to industrial control. Its hardware structure is basically the same as that of a microcomputer. The basic composition is as shown below. The basic composition is described in detail as follows:

Power supply

The power supply is used to convert AC power into DC power required inside the PLC. At present, most PLCs use switching power supply. >Power supply.

Central Processing Unit (CPU)

The central processing unit is the control center of the PLC and the core component of the PLC. Its performance determines the performance of the PLC.

The central processing unit consists of controllers, arithmetic units and registers, these circuits are concentrated on one chip, connected to the input/output interface circuit of the memory through the address bus and the control bus. The function of the central processor is to process and run the user program, and perform the logical sum. Mathematical operations that control the entire system to coordinate.


Memory is a semiconductor circuit with memory function, which is used to store system programs, user programs, logic variables and other information. It is a program that controls the PLC to realize various functions, which is written by the PLC manufacturer and solidified into a read-only memory (ROM), which cannot be accessed by the user.

Input unit

Input unit is the input interface of PLC connected to the controlled device, it is the bridge of signal entering PLC, its role is to receive the main The signal from the component and the detection component. The input type is DC input, AC input, AC/DC input.

Output unit

The output unit is also the connection component between the PLC and the controlled device.Its function is to transmit the output signal of the PLC to the controlled device, that is, convert the weak electric signal sent by the central processor into a level signal to drive the actuator of the controlled device. The types of outputs are relay output, transistor output, and gate output.

PLC In addition to the above, there are a variety of external devices depending on the model, which are used to help with programming, monitoring, and network communication. Commonly used external devices are programmers, printers, cassette tape recorders, computers, and the like.


(1) High reliability. Since PLCs mostly use a single-chip microcomputer, the integration is high, and the corresponding protection circuit and self-diagnosis function improve the reliability of the system.

(2) Easy programming. PLC programming uses relay control ladder diagrams and command statements.The number is much less than that of the microcomputer. In addition to the medium and high-end PLCs, there are only about 16 small PLCs. Due to the simplicity of the ladder image, it is easy to master, easy to use, and even requires no computer expertise to program.

(3) Flexible configuration. Since the PLC adopts a modular structure, the user can flexibly change the function and scale of the control system by simply combining, so that it can be applied to any control system.

(4) The input/output function modules are complete. One of the biggest advantages of PLC is that it can be used with different on-site signals (such as DC or AC, switching, digital or analog, voltage or current). Devices such as buttons, switches, sense current transmitters, motor starters or control valves are directly connected and connected to the CPU board via a bus.

(5) Easy to install.Compared with computer systems, PLC installation does not require a dedicated machine room or strict shielding measures. When you use it, you only need to connect the detection device to the I/O interface terminal of the actuator and PLC correctly, and it can work normally.

(6) Runs fast. Since the control of the PLC is controlled by the program, regardless of its reliability or operating speed, the relay logic control cannot be compared.

In recent years, the use of microprocessors, especially with the use of microcontrollers, has greatly enhanced the capabilities of PLCs and The difference between PLC and microcomputer control systems is getting smaller and smaller, especially for high-end PLCs.

Take the Mitsubishi FX series basic logic instructions as an example,

We talk about PLC common basic logic instructions:

01 master reset command MC and MCRMC (master command)

Connection for common contacts. After MC is executed, the left bus moves to the back of the MC contact.

MCR (Master reset command)

MCR is the reset command of the MC command, which uses the MCR command to restore the position of the original left bus.

The advantage of using the MCMCR instruction is that it saves a lot of storage units, because when we program, multiple coils are simultaneously controlled by one or a set of contacts, if we are in each coil If the same contacts are connected in the middle, it will occupy a lot of storage units, because the storage unit of the PLC is limited.Using MC and MCR instructions can solve this problem very well.


Using MC NO M0 to realize the left bus shift to the right, so that Y0 and Y1 are under the control of X0, among them N0 indicates the nesting level. With MCR, N0 returns to the original left bus state. If m0 is disconnected, MC will be skipped and the instruction between MCRs will be executed downward.


1, MC, the target component of the MCR program instruction is Y He M , but special auxiliary relays cannot be used.The MC occupies 3 program steps, and the MCR occupies 2 program steps;

2. The product of the MC and the MCR when the input contact of the MC instruction is disconnected Counting timer, the counter, the component driven by the complex position bit remains unchanged.

02 Set and reset command SET, RST

SET set instruction is to set and hold the target component being operated.

RST reset command resets the target object being operated and keeps it clear status.


As shown above: When X000 is normally on, Y000 becomes It is in the ON state and remains in this state. Even if X000 turns off the ON state of Y000, it remains unchanged. Only when X1 is normally open and closed, Y0 becomes OFF and remains, even if X1 is normally open and disconnected, Y0 It is still in the OFF state.

03 punch output command PLS, PLF

PLS rising edge Pulse command:

Generate a pulse output pulse period on the rising edge of the input signal;

PLF falling edge pulse command:

Generate a pulse output for the scan cycle on the falling edge of the input signal.


1, PLS, PLF instruction target components are Y and M;

2. When using PLS, the target component is ON only during one scan cycle after the drive input is ON;

3. When using PLF, it only uses the falling edge of the input signal to drive, the other is the same as PLS.


When the normally open contact X0 is broken, it will produce a rise Along the pulse, M0 turns on and sets Y0. X1 generates a falling edge pulse from the moment of breaking to pass, and M1 turns on and resets Y0.

Relevant articles recommend

Hot Products

> 3000 Pieces USD 0.18/Piece
> 1000 Pieces USD 0.22/Piece
> 100 Pieces USD 0.30/Piece
> 10 Pieces USD 0.37/Piece
> 100 Pieces USD 0.15/Piece
> 2000 Pieces USD 9.00/Piece
> 1000 Pieces USD 11.00/Piece
> 500 Pieces USD 13.00/Piece
> 100 Pieces USD 15.00/Piece
> 2500 Pieces USD 0.08/Piece
> 1000 Pieces USD 0.10/Piece
> 100 Pieces USD 0.12/Piece
> 10 Pieces USD 0.15/Piece
Top suppliers

Response Time


Response Rate


Product:Original Semiconductor, NXP,TI,ST,HIT,TOS,NS,ON,FSC,EL,HAR,ITS,NEC,JRC,SHARP,INFINEON,Sunlord,CJ,LRC,Arduino parts,etc.

Response Time


Response Rate



Response Time


Response Rate



Response Time


Response Rate


Product:IC,Module, bluetooth chips, RF chips, USB-UART chips

Response Time


Response Rate



Response Time


Response Rate


Subscribe News

Enter your email address:

Contact Us


One to One Customer Service