Learn MELSEC-FX-EXTENSIONS with Real Code Examples
Updated Nov 27, 2025
Code Sample Descriptions
1
Start/Stop Motor Control
IF StartButton THEN
MotorOutput := TRUE;
ELSIF StopButton THEN
MotorOutput := FALSE;
END_IF;
Control a motor using a start and stop input with MELSEC FX extensions.
2
Timer-Based Conveyor
TON Timer1, PT := T#5s, IN := StartSignal;
IF Timer1.Q THEN
ConveyorOutput := FALSE;
ELSE
ConveyorOutput := TRUE;
END_IF;
Activate a conveyor for a fixed time using a timer instruction.
3
Sum Array Elements
Sum := 0;
FOR i := 0 TO ArraySize-1 DO
Sum := Sum + DataArray[i];
END_FOR;
Calculate the sum of elements in an array using MELSEC FX structured text.