Program Examples - Mitsubishi FX2N-10GM Hardware / Programming Manual

Melsec-f
Hide thumbs Also See for FX2N-10GM:
Table of Contents

Advertisement

FX Series Positioning Controllers
Processing of subtasks
Unconditional
jump
Inside a subtask, all the sequence and application instructions (described in Section 5) and the
following cod instructions are valid.
cod 04 (TIM)
cod 73 (MOVC)
cod 74 (CNTC)
cod 75 (RADC)
cod 76 (CANC)
cod 92 (SET)
m code outputs are not available. The m100 (WAIT) and the m102 (END) only are valid instruc-
tions.
The subtask processing speed is approximately 1 to 3 msec per line. It is recommended to
restrict the number of lines to approximately 100 when the subtask is processed repeatedly so
that the operation time does not become too long.

Program examples

Two examples of subtask programs are shown below. Note that processes which would take a
long time if performed in a positioning program and controls other than positioning control are
best handled by the subtask.
Fetching the digital switch data
O100, N0;
N00 P255;
N01 FNC 74 ([D]SEGL)
D9004 Y00 K4 K0
N02 FNC 04 (JMP) P255;
N03 m102 (END);
Error detection output
O100, N0;
N00 P255;
N01 LDI M9050;
N02 ANI M9082;
N03 FNC 90 (OUT) Y00;
N04 FNC 04 (JMP) P255;
N05 m102 (END);
The program above turns OFF the normal output Y00 when detecting an error in either the X or Y axes.
The subtask is processed one line at a time in the same way as
O100
a positioning program. When the START signal is entered, the
P0;
LD X00;
subtask is processed from the first line, and finishes at "m102
AND X01;
(END)" then waits for the next START signal.
SET Y0;
FNC 04 (JMP)
For cyclic operation, use a jump instruction such as FNC04
P0;
(JMP) as shown in the example on the left. However, jumping
m102;
from the subtask to a positioning program (main program) is
impossible.
Dwell
Travel compensation
Center point compensation
Radius compensation
Compensation cancel
Present position change
The example on the left displays the lower 4 digits of the X-axis
current position.
In a similar manner anything not directly connected to positioning
operations can be programmed in the subtask program.
N00
M9050 M9082
N01
X axis
Y axis
error
error
detection
detection
N04
JMP
N05
Program format 5
P255
Due to the jump
instruction, the
Y00
END instruction
is not executed.
P255
END
5-4

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Fx2n-20gm

Table of Contents