Comprehensive Guide to Mitsubishi PLC Instructions (Practical Version + Examples)

The instruction system of Mitsubishi PLC is very rich, mainly divided intoFX Series (Small) and Q/L Series (Medium to Large). Most of their instructions are similar, but the Q/L series has more advanced instructions.

The instruction system of Mitsubishi PLC is very rich, mainly divided intoFX Series (Small) and Q/L Series (Medium to Large). Most of their instructions are similar, but the Q/L series has more advanced instructions.

1. Basic Sequential Instructions

This is the most basic and commonly used instruction.

Instruction Symbol Name Function Description Example Description
<span>LD</span> Load Normally open contact connected to the left bus <span>LD X0</span>
<span>LDI</span> Load Inverted Normally closed contact connected to the left bus <span>LDI X0</span>
<span>OUT</span> Output Coil drive instruction <span>OUT Y0</span>
<span>AND</span> AND Normally open contacts connected in series <span>LD X0 AND X1</span>
<span>ANI</span> AND NOT Normally closed contacts connected in series <span>LD X0 ANI X1</span>
<span>OR</span> OR Normally open contacts connected in parallel <span>LD X0 OR Y0</span>
<span>ORI</span> OR NOT Normally closed contacts connected in parallel <span>LD X0 ORI Y0</span>

Classic Example 1: Self-Locking (Start-Stop) CircuitThis is the most basic motor control circuit.

  • Function: Press the start button X0, the motor Y0 runs; release X0, the motor keeps running; press the stop button X1, the motor stops.

  • Relay Ladder Diagram:

|—|[X0]—-|[X1]—–(Y0)—|

| |

|—|[Y0]———————|

Instruction Table

LD X0 // Read start button

ANI X1 // Series stop button (normally closed)

OR Y0 // Parallel self-locking contact

OUT Y0 // Drive motor output

2. Basic Function Instructions

Instruction Symbol Name Function Description
<span>SET</span> Set Contact is turned on and held (equivalent to latching)
<span>RST</span> Reset Clear action, current value/register reset to zero
<span>PLS</span> Rising Edge Pulse Generate a pulse for one scan cycle on the rising edge of the input signal
<span>PLF</span> Falling Edge Pulse Generate a pulse for one scan cycle on the falling edge of the input signal
<span>NOP</span> No Operation No operation performed, used for program fine-tuning or reserving space

Classic Example 2: SET/RST Implementing Start-Stop Using Set and Reset to Achieve the Same Functionality as Example 1.Relay Ladder Diagram:

|—|[X0]—–(SET Y0)—| // Start, set Y0

|—|[X1]—–(RST Y0)—| // Stop, reset Y0

  • Description: This method has clearer logic, one condition is responsible for starting, and another condition is responsible for stopping.

Classic Example 3: Single Button Start-Stop ControlUse one button to control the start and stop of the device. The first press starts, the second press stops.

  • Relay Ladder Diagram (using PLS instruction):

  • |—|[X0]—–[PLS M0]—| // Convert the press of X0 into a pulse for one scan cycle M0

    |—|[M0]—-|[Y0]—–(SET Y0)—| // If Y0 is OFF, M0 will SET it to ON

    |—|[M0]—-|[Y0]—–(RST Y0)—| // If Y0 is ON, M0 will RST it to OFF

Description: Using pulse instructions and the state of Y0 as judgment conditions to achieve alternating actions.

3. Timer and Counter Instructions

Device/Instruction Name Function Description
<span>T0 K50</span> Timer T0 is a 100ms general-purpose timer,<span>K50</span> indicates a timing of 5 seconds (50 * 100ms = 5000ms)
<span>C0 K5</span> Counter C0 is a 16-bit incrementing counter,<span>K5</span> indicates that the contact acts after counting 5 times

Classic Example 4: Delayed StartPress the start button X0, and the motor Y0 will automatically run after 5 seconds.

|—|[X0]———————-(T0 K50)–|

|—|[T0]———————–(Y0)—|

  • Description: After X0 is turned on, timer T0 starts timing for 5 seconds, when the time is up, T0 contact is turned on, driving Y0.

Classic Example 5: Blinking Circuit (Oscillation Circuit)

Make the indicator light Y0 blink at a frequency of 1 second on, 1 second off.

Relay Ladder Diagram:

|—|[M8002]—–(T0 K10)—| // Initialize pulse to start the first timer

|—|[T0]———(T1 K10)—|

|—|[T1]———(T0 K10)—| // T1 disconnects T0, forming a loop

|—|[T0]———————–(Y0)—| // Use T0’s output to control Y0

Description: T0 and T1 control each other, forming a loop. T0 times for 1 second, its coil is de-energized, contact acts (Y0 lights), while starting T1; T1 times for 1 second, resets T0, the loop restarts.

4. Common Application Instructions (Function Instructions)

FX series function instructions are represented by mnemonics such as MOV, ADD, etc., with a D prefix indicating processing of 32-bit data.

Instruction Name Function Description
<span>MOV</span> Transfer Transfer source data to target element
<span>ADD</span> Addition Binary addition of two source data, result sent to target element
<span>SUB</span> Subtraction Binary subtraction of two source data
<span>CMP</span> Comparison Compare two numbers, drive specified contact (=, >, <)
<span>INC</span> / <span>DEC</span> Increment / Decrement Add 1 or subtract 1 from the value of the target element
<span>ZRST</span> Batch Reset Batch reset of elements within a specified range

|-

Classic Example 6: Data Transfer and ComparisonTransfer the value 100 to data register D0, when the value of D0 is greater than 50, light the alarm lamp Y0.

  • Relay Ladder Diagram:

|—|[M8002]—–[MOV K100 D0]—| // On power-up initialization, transfer 100 to D0

|—|[X0]———[CMP K50 D0 M0]—| // When X0 is turned on, perform comparison

|—|[M1]———————–(Y0)—| // M1 is the output point for “greater than”, driving Y0

Description: CMP K50 D0 M0 instruction will occupy three consecutive bit elements (M0, M1, M2), representing: M0 ON when D0 = K50 M1 ON when D0 > K50 (this is the one we are using) M2 ON when D0 < K50

Classic Example 7: Simple Loop Counting

Count using one button (X0), after pressing 5 times, the indicator light (Y0) lights up, press once more to reset the count, and the light goes out.

Relay Ladder Diagram:

|—|[X0]—–[PLS M0]—| // Convert button signal to pulse

|—|[M0]—–[INC D0]—| // Each press increments D0 by 1

|—|[M0]—–[CMP K5 D0 M10]—| // Compare if D0 equals 5

|—|[M11]——————(Y0)—| // When equal to 5, M11 ON, Y0 lights up

|—|[M0]—-|[M11]—–[MOV K0 D0]–| // When Y0 lights up, press again to transfer 0 to D0 to reset

|—|[M0]—-|[M11]—–[ZRST M10 M12]–| // Simultaneously clear the comparison result state

Description: Combined pulse, increment, comparison, and transfer instructions to achieve a complete counting control logic.

5. Step Control Instructions (SFC Programming)

For sequential flow control, using step instructions is very convenient.

Instruction Name Function Description
<span>STL</span> Step Contact Represents each step of sequential control
<span>RET</span> Step Return Indicates the end of the sequential control process

Classic Example 8: Simple Robotic Arm Control

Process: Descend → Grip → Ascend → Move Right → Descend → Release → Ascend → Move Left (Return to Origin).

SFC Diagram (Concept):

S0 (Initial State)

|

|—| [X0(Start)] |—>

|

S20 (Descend) —| [X1(Lower Limit)] |—> S21 (Grip) —| [T0(Delay)] |—> S22 (Ascend) …

Description: Each step (S20, S21…) is driven by the `STL` instruction, when the transfer condition of that step is met (e.g., limit switch X1 is turned on), the program will automatically close the current step and move to the next step. This makes complex sequential logic clear and understandable.

Summary and Recommendations

  1. Start from the Basics: Be sure to masterBasic Sequential Instructions andTimers/Counters, these are the foundation of all programs.

  2. Understand Soft Elements: Be clear about the functions and characteristics of soft elements such as X, Y, M, S, T, C, D.

  3. Use Simulation Software: Mitsubishi’s GX Works2 software comes with simulation capabilities (requires installation of the corresponding series). After writing the program, simulating it first can greatly improve debugging efficiency.

  4. Refer to Manuals: This comprehensive guide is just the tip of the iceberg. When needing to use complex functions (such as communication, positioning, PID, etc.), be sure to refer to theMitsubishi FX Series Programming Manual, which contains the most authoritative and complete instruction descriptions and application cases.

I hope this instruction guide, combined with examples, can help you better understand and use Mitsubishi PLCs.

For more practical materials, you can message or leave a comment for Teacher Zou, and remember to follow Industrial Control – Teacher Zou.

Leave a Comment