Back to blog

Designing Mitsubishi FX PLC Sequences with STL and RET

Learn how Mitsubishi FX PLC STL and RET instructions structure conveyor and pneumatic sequences, with practical state design, transition logic, timeouts, diagnostics, and safe restart boundaries.

Long machine sequences become difficult to maintain when every transition is expressed as interlocked coils, seals, resets, and permissives in one ladder routine. Mitsubishi FX PLCs provide step ladder programming with state relays, the STL instruction, and RET boundaries. Used carefully, this structure makes the active machine state visible and limits each section of logic to the work required for that state.

This guide uses a conveyor and pneumatic pusher as a teaching example. The objective is not to supply production-ready safety logic. It is to show how to translate a written sequence into explicit states, transitions, outputs, and recovery behavior. Always confirm instruction support and device ranges in the manual for the exact CPU and programming software.

Start with the sequence, not the instructions

Define the process before opening the ladder editor. In this example, a start command enables automatic operation. An entry sensor detects a part, the conveyor moves it to an end sensor, the conveyor stops, and a cylinder pushes the part into a bin. A cylinder sensor confirms motion before the sequence returns to its waiting state.

Separate that description into stable states. A practical first pass is Idle, Conveying, Pushing, Retracting, and Fault. Every state needs a clear entry condition, permitted outputs, completion condition, timeout, and response to stop or fault. This discipline prevents an output from remaining energized simply because a transition condition was missed.

How Mitsubishi STL and RET organize states

In Mitsubishi step ladder, state relays identify sequence stages. An STL instruction begins the logic associated with an active state. RET marks the end of the step ladder block and returns program execution to ordinary ladder processing. The exact behavior, usable state-device ranges, initial-state rules, and transition syntax depend on the PLC family. The Mitsubishi FX programming manual should be treated as the governing reference.

An active state executes its associated logic while inactive state sections are bypassed according to the platform rules. That creates a useful diagnostic model: the technician can see which state is active, which transition is waiting, and which input prevents progress. It also reduces the need for many cross-coupled latches.

Conventional Mitsubishi FX ladder logic for a conveyor and pneumatic pusher sequence

A conventional interlocked sequence can work, but transitions become harder to trace as more states are added.

Build the state model

Idle and cycle start

The Idle state confirms that automatic mode is selected, no fault is active, the cylinder is in its known home position, and the stop circuit permits operation. A start push button should request a cycle; it should not bypass safety functions. When the part-present condition is valid, the transition activates the Conveying state.

Conveying

The conveyor output is permitted only in the Conveying state and only while all relevant permissives remain true. The end sensor completes the state. Add a travel timer so a missing part, failed sensor, slipping belt, or jam cannot leave the motor running indefinitely. The timeout should move the sequence to a defined fault state and record a useful alarm.

Mitsubishi FX state relay initialization for the first STL sequence step

Initialize the first state only when the machine is in a known condition.

Pushing and retracting

When the end sensor is stable, the conveyor stops before the pusher is enabled. The Pushing state energizes the valve output and waits for the extended confirmation. A separate Retracting state removes or reverses the valve command as required by the pneumatic circuit, then waits for the home sensor. Treat extension and retraction as distinct states when each motion needs its own timeout and fault message.

Mitsubishi STL transition from conveyor motion to the pneumatic pusher state

A transition should describe verified process completion, not merely elapsed time.

Return to ready

After the home sensor is confirmed, the program returns to the waiting state for the next part. Do not use a short timer as the only proof that a cylinder retracted. Timers are valuable fault detectors, but physical feedback is stronger evidence of machine position.

Final Mitsubishi FX STL state with completion logic before the RET instruction

Place RET according to the programming manual and verify every path into and out of the step block.

Design stop, fault, and restart behavior

Sequence structure does not provide machine safety. Emergency stops, guard functions, and hazardous-energy isolation require the appropriate safety architecture outside ordinary sequence logic. A standard PLC state can coordinate controlled stopping and diagnostics, but it must not be treated as a safety-rated protective function unless the entire system is designed and validated for that purpose.

Define what happens after power loss, CPU restart, mode change, or an interrupted motion. Automatically resuming the previous state can be dangerous when the machine’s physical position is unknown. A safer engineering pattern is to enter a recovery state, verify inputs, require an operator decision where necessary, and move actuators through a documented recovery sequence.

Latched faults should identify the state, expected input, actual input, and timeout. For example, “Pusher extension not confirmed in Pushing state” is more useful than “Sequence fault.” Expose current state and transition conditions on the HMI so maintenance can diagnose the process without forcing inputs.

Commissioning checklist

Test one state at a time with hazardous motion controlled. Confirm input polarity, output mapping, actuator direction, sensor position, and timer units. Then single-step through every normal transition. Repeat the test with each sensor withheld to prove the timeout and alarm. Test stop commands during every state, followed by the approved restart procedure.

Use a state diagram, I/O list, and transition matrix as controlled documentation. Online edits should be followed by a complete transition review because a small change can create an unreachable state or an unintended path. Back up the verified PLC program and record the CPU type and software version.

When STL is the right choice

STL/RET is useful when a machine has a mostly linear sequence with clear states and transitions. Conventional ladder may remain simpler for a few independent actions. A function-block or structured state-machine approach may be better when the controller platform, team standards, or modular equipment architecture favors reusable code.

The deciding factor is maintainability. Engineers should be able to identify the active state, understand why it is active, predict the next transition, and recover without defeating protection. For related controller hardware, see the PLC collection; additional implementation guidance is available in the Knowledge archive.

Leave a comment

Please note, comments need to be approved before they are published.