Home > Common Problem > body text

What is the plc instruction list and explanation?

爱喝马黛茶的安东尼
Release: 2019-07-13 09:37:30
Original
15513 people have browsed it

What is the plc instruction list and explanation?

plc instruction list and explanation (based on Mitsubishi FX series PLC)

PLC/PAC

What is the plc instruction list and explanation?

Basic logic instructions of Mitsubishi FX series PLC

Fetching instructions and output instructions (LD/LDI/LDP /LDF/OUT)

(1) LD (fetch command) A command that connects a normally open contact to the left bus. This command is used for every logic line starting with a normally open contact.

(2) LDI (negative instruction) A normally closed contact is connected to the left busbar instruction. This instruction is used for every logic line starting with a normally closed contact.

(3) LDP (rising edge command) The rising edge detection command of the normally open contact connected to the left bus bar only turns on one scan when the rising edge of the specified bit element (from OFF→ON) cycle.

(4) LDF (Fetch falling edge instruction) The falling edge detection instruction of the normally closed contact connected to the left bus.

(5) OUT (output command) The command to drive the coil is also called the output command.

Instructions for using instructions and output instructions:

1) LD and LDI instructions can be used to input contacts connected to the left bus, or with ANB and ORB The instructions cooperate to implement block logic operations;

2) The LDP and LDF instructions only maintain the on for one scan cycle when the corresponding components are valid.

3) The target components of the LD, LDI, LDP, and LDF instructions are X, Y, M, T, C, S;

4) The OUT instruction can be used several times continuously (equivalent to Coils in parallel), for timers and counters, the constant K or data register should be set after the OUT instruction.

5) The target components of the OUT instruction are Y, M, T, C and S, but cannot be used for X. Contact series connection instruction (AND/ANI/ANDP/ANDF)

(1) AND (AND instruction) A normally open contact series connection instruction to complete the logical "AND" operation.

(2) ANI (AND AND NEGATIVE instruction) A normally closed contact is connected in series to complete the logical NAND operation.

(3)ANDP rising edge detection series connection instruction.

(4)ANDF falling edge detection series connection instruction.

Instructions for using the contact series connection instructions:

1) AND, ANI, ANDP, ANDF all refer to the instructions for the series connection of a single contact, the number of series connections There is no limit and can be used repeatedly.

2) The target elements of AND, ANI, ANDP and ANDF are X, Y, M, T, C and S.

3) After the OUT M101 instruction, driving Y4 through the contact of T1 is called continuous output.

Contact parallel connection instruction (OR/ORI/ORP/ORF)

(1) OR (or instruction) is used for parallel connection of a single normally open contact to achieve Logical "OR" operation.

(2) ORI (or not instruction) is used for parallel connection of a single normally closed contact to implement logical "OR" operation.

(3)ORP rising edge detection parallel connection instruction.

(4) ORF falling edge detection parallel connection instruction.

Instructions for using parallel contact instructions:

1) OR, ORI, ORP, and ORF instructions all refer to the parallel connection of a single contact, and the left end of the parallel contact Received at LD, LDI, LDP or LPF, the right end is connected to the right end of the corresponding contact of the previous instruction. There is no limit to the number of times the contact parallel connection instructions can be used continuously;

2) The target components of the OR, ORI, ORP, and ORF instructions are X, Y, M, T, C, and S. Block Operation Instructions (ORB/ANB)

(1) ORB (Block or Instruction) Used for parallel connection between circuits where two or more contacts are connected in series.

Instructions for using the ORB instruction:

1) When several series circuit blocks are connected in parallel, the LD or LDI instruction should be used at the beginning of each series circuit block;

2) There are multiple circuit blocks connected in parallel. If you use the ORB instruction for each circuit block, there is no limit to the number of parallel circuit blocks;

3) The ORB instruction can also be used continuously, but This method of program writing is not recommended. The LD or LDI instructions must not be used more than 8 times, that is, the ORB can only be used less than 8 times in a row.

(2) ANB (Block and Instruction) Used for series connection between circuits with two or more contacts connected in parallel.

Instructions for using the ANB instruction:

1) When parallel circuit blocks are connected in series, use the LD or LDI instruction at the beginning of the parallel circuit block;

2) When multiple parallel circuit blocks are connected in series with the previous circuit in sequence, there is no limit to the number of times the ANB instruction can be used. ANB can also be used continuously, but like ORB, the number of uses is limited to 8 times or less.

Set and reset instructions (SET/RST)

(1) SET (set instruction) Its function is to set the target component being operated and Keep.

(2) RST (reset instruction) resets the operated target component and keeps it in a clear state. Using the SET and RST instructions, when X0 is normally open and connected, Y0 becomes the ON state and remains in this state. Even if X0 is disconnected, the ON state of Y0 remains unchanged; only when the normally open of X1 is closed, Y0 It turns to OFF state and remains. Even if X1 is normally open and disconnected, Y0 is still in OFF state.

Related recommendations: "FAQ"

Instructions for using SET and RST instructions:

1) The target components of the SET instruction are Y, M, and S, and the target components of the RST instruction are Y, M, S, T, C, D, V, and Z. The RST instruction is often used to clear the contents of D, Z, and V, and is also used to reset the accumulated timer and counter.

2) For the same target component, SET and RST can be used multiple times in any order, but the last executor is valid. Differential instruction (PLS/PLF)

(1) PLS (rising edge differential instruction) generates a pulse output of one scan cycle on the rising edge of the input signal.

(2) PLF (falling edge differential instruction) generates a pulse output of one scan cycle on the falling edge of the input signal.

Use differential instructions to detect the edge of the signal, and control the state of Y0 through set and reset commands.

Instructions for using PLS and PLF instructions:

1) The target components of PLS ​​and PLF instructions are Y and M;

2) Using PLS When, the target element is ON only in one scan cycle after the drive input is ON, and M0 is ON only in one scan cycle when the normally open contact of X0 is from off to on; when using the PLF instruction, only the decline of the input signal is used Edge driven, others are the same as PLS.

Master control command (MC/MCR)

(1) MC (master control command) is used for the connection of public series contacts. After MC is executed, the left busbar moves behind the MC contact.

(2) MCR (Master Control Reset Command) It is the reset command of the MC command, that is, the MCR command is used to restore the original left bus position.

It often happens during programming that multiple coils are controlled by one or a group of contacts at the same time. If the same contacts are connected in series to the control circuit of each coil, a lot of storage units will be occupied. , this problem can be solved by using the main control instruction.

MC and MCR instructions use MC N0 M100 to move the left bus to the right, so that Y0 and Y1 are both under the control of X0, where N0 represents the nesting level, and the number of times N0 is used in a non-nested structure Unlimited; use MCR N0 to restore to the original left bus state. If X0 is disconnected, the instructions between MC and MCR will be skipped and executed downward.

Instructions for using MC and MCR instructions:

1) The target components of MC and MCR instructions are Y and M, but special auxiliary relays cannot be used. MC occupies 3 program steps, MCR occupies 2 program steps;

2) The main control contact is perpendicular to the general contact in the ladder diagram. The main control contact is a normally open contact connected to the left busbar and is the master switch that controls a group of circuits. The contact connected to the main control contact must use the LD or LDI instruction.

3) When the input contact of the MC instruction is disconnected, the accumulated timers, counters, and components driven by the reset/set instructions within MC and MCR remain in their previous states. Non-accumulating timers and counters, components driven by the OUT instruction will be reset. When X0 is disconnected in 22, Y0 and Y1 will become OFF.

4) If MC instructions are used within an MC instruction area, it is called nesting. The maximum number of nesting levels is 8, and the number increases in the order of N0→N1→N2→N3→N4→N5→N6→N7. The return of each level uses the corresponding MCR instruction, starting from the nesting level with the larger number. Stack instruction (MPS/MRD/MPP)

Stack instruction is a new basic instruction in the FX series, which is used for multiple output circuits and brings convenience to programming. There are 11 storage units in the FX series PLC, which are specially used to store the intermediate results of program operations and are called stack memories.

(1) MPS (push instruction) Send the operation result to the first segment of the stack memory, and at the same time move the previously sent data to the next segment of the stack.

(2) MRD (stack read instruction) reads the first segment of data in the stack memory (the last data pushed onto the stack) and the data continues to be stored in the first segment of the stack memory. The data in the stack does not Movement occurs.

(3) MPP (pop command) Read the first piece of data from the stack memory (the last data pushed onto the stack) and the data disappears from the stack, and at the same time, move other data in the stack up in sequence.

Instructions for using stack instructions:

1) The stack instruction has no target component;

2) MPS and MPP must be used in pairs;

3) Since there are only 11 stack storage units, the stack can have up to 11 levels.

Logical inversion, no operation and end instructions (INV/NOP/END)

(1) INV (inverse instruction) After executing this instruction, the original operation result Negate. The use of reverse instructions is shown in Figure 10. If X0 is disconnected, Y0 is ON, otherwise Y0 is OFF. When using it, please note that INV cannot be connected to the bus like the LD, LDI, LDP, and LDF instructions in the instruction list, nor can it be used alone like the OR, ORI, ORP, and ORF instructions in the instruction list.

(2) NOP (no operation instruction) No operation is performed, but it occupies one program step. Nothing is done when NOP is executed. Sometimes the NOP instruction can be used to short-circuit certain contacts or the NOP instruction can be used to overwrite unnecessary instructions. When the PLC performs the clear user memory operation, all the contents of the user memory become no-operation instructions.

(3) END (end command) indicates the end of the program. If the END instruction is not written at the end of the program, the PLC will execute from the first step to the last step of the user program memory no matter how long the actual user program is; if there is an END instruction, when the END is scanned, the execution of the program will end. This way Shorten the scan cycle. When debugging a program, you can insert several END instructions into the program to divide the program into several segments. After confirming that the previous program segments are correct, delete the END instructions in sequence until the debugging is completed.

Step instructions of FX series PLC

1. Stepping instructions (STL/RET)

Step instructions are instructions specially designed for sequence control. In the field of industrial control, many control processes can be implemented by sequential control. Using step instructions to achieve sequential control is both convenient to implement and easy to read and modify.

There are two stepping instructions in FX2N: STL (stepping contact instruction) and RET (stepping return instruction).

STL and RET instructions can only have step function when cooperated with state device S. For example, STL S200 represents a normally open contact, which is called an STL contact. Its symbol in the ladder diagram is -|| ||-, and it does not have a normally closed contact. We use each state device S to record a work step. For example, STL S200 is valid (ON), then enter the step represented by S200 (similar to the main switch of this step), start to perform the work to be done in this stage, and judge to enter the next step. Whether the conditions of one step are met. Once the signal is ON at the end of this step, turn off S200 and enter the next step, such as step S201. The RET instruction is used to reset the STL instruction. After executing RET, it will return to the bus and exit the step state.

2. State transition diagram

A sequential control process can be divided into several stages, also called steps or states. Each state has different actions. When the transition conditions between two adjacent states are met, the transition will be realized, that is, the transition from the previous state to the next state will be executed. We often use state transition diagrams (function chart diagrams) to describe this sequential control process. Use state device S to record each state, and X is the transition condition. For example, when X1 is ON, the system changes from S20 state to S21 state.

Each step in the state transition diagram contains three contents: the content driven by this step, the transition condition and the conversion target of the instruction.

Step drives Y0. When X1 is effectively ON, the system changes from S20 state to S21 state. X1 is the conversion condition, and the conversion target is step S21.

3. Instructions for using step instructions

1) The STL contact is a normally open contact connected to the left busbar. If an STL contact is connected, the corresponding state is the active step;

2) The contact connected to the STL contact applies the LD or LDI instruction, and returns to the left bus only after RET is executed; 3) The STL contact can be driven directly or through other contacts to drive Y, M, S, T, etc. The coil of the component;

4) Since the PLC only executes the circuit block corresponding to the active step, dual coil output is allowed when using STL instructions (the sequence program can drive the same coil multiple times in different steps);

5) MC and MCR instructions cannot be used in STL contact driven circuit blocks, but CJ instructions can be used; 6) STL instructions cannot be used in interrupt programs and subroutines.

The above is the detailed content of What is the plc instruction list and explanation?. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!