You are on page 1of 250

PROGRAMMABLE CONTROLLERS

FXe-SERIES PROGRAMMABLE CONTROLLERS


FX2 SERIES PROGRAMMABLE CONTROLLERS
(Japanese Specification)

HANDY MANUAL

f \
FOREWORD

This manual is a comprehensive manual which includes information on the hardware and
installation as well as programming information of the Mitsubishi FX2 series programmable
controllers sold in Japan.
Users should ensure that the details of this manual is studied and understood before attempting
to install or use the units.
Information concerning the programming of the system and the use of the programmers is
covered in other manuals.

\ J
CONTENTS

I GENERAL HARDWAREAND 3.4 OPERATION MODES ...........................68


INSTALLATION............................................. 1
4 DEVICE DETAILS ........................................75
1.1 OVERVIEW OF THE FX2 .........................2
1.2 PERIPHERAL DEVICES ......................... 6 INPUTIOUTPUT RELAYS .....................76
MODEL NAME ....................................... 8 AUXILIARY RELAYS ......................... 78
WORLD SPEC. AND JAPANESE SPEC . .
.
STATES .................... ...................... 83
TYPES .................................................... 9 POINTERS (P. I).................................... 82
INSTALLATION ..................................... 10 CONSTANTS ........................................ 83
POWER SUPPLY CIRCUIT................... 12 TIMERS ............................................ 84
INPUT CIRCUIT CONNECTION ........... 14 .
.
COUNTERS ............................. ........ 86
OUTPUT CIRCUIT CONNECTION....... 16 DATA REGISTERS ...............................95
PRELIMINARY CHECKS ...................... 22 INDEX REGISTERS ............................. 96
ERROR CHECK ................................. 23 4.10 SUMMARY OF MEMORY
MAINTENANCE AND INSPECTION .... 26 ALLOCATIONS .................................... 97
1.12 EXTERNAL DIMENSIONS AND 5 APPLIED INSTRUCTION .............................99
GENERAL SPECIFICATIONS .............. 27
5.1 GENERAL RULES OF APPLIED
1.13 TERMINAL LAYOUT ........................... 28
INSTRUCTIONS .................................. 100
1.14 PERFORMANCE SPECIFICATIONS
5.2 PROGRAM FLOW
.
.
LIST ............................. ...................... 31
(FNC 00 TO FNC 09) ..........................104
1.15 DEVICE NUMBER LIST ........................32
5.3 MOVE AND COMPARE
2 BASIC SEQUENCE INSTRUCTIONS ...........33 (FNC 10TO FNC 19) ..........................112
5.4 ARITHMETIC AND LOGICAL OPERA-
2.1 RELAYS AND TIMERS...................... .... 34
TlONS (FNC 20 TO FNC 29) .............. 118
2.2 LOGICAL LOAD AND OUT COILS ....... 36
ROTATION AND SHIFT
2.3 SERIAL CONTACTS .............................38 (FNC 30 TO FNC 39) ......................... 126
2.4 PARALLEL CONTACTS....................... 39 DATA OPERATION
2.5 PARALLEL CONNECTION OF SERIAL (FNC 40 TO FNC 49) ..........................132
CIRCUIT BLOCKS ................................. 40 HIGH-SPEED PROCESSING
2.6 SERIAL CONNECTION OF PARALLEL (FNC 50 TO FNC 59) ......................... 136
.
.
CIRCUIT BLOCKS............. ............. 41 HANDY INSTRUCTIONS
2.7 MULTIPLE OUTPUT CIRCUITS............ 42 (FNC 60 TO FNC 69) ..........................145
2.8 COMMON SERIAL CONTACTS...........44 EXTERNAL FX 110 DEVICES
2.9 RETAINING AND RESETTING (FNC 70 TO FNC 79) ..........................154
OPERATION STATUS .......................... 46 EXTERNAL FX SERIAL DEVICES
2.10 COUNTERS AND TIMERS ...................47 (FNC 80 TO FNC 89) ......................... 165
2.1 1 PULSE OUTPUT ................................ 48 EXTERNAL F2 UNITS
2.12 NO PROCESSING INSTRUCTION ...... 49 (FNC 90 TO FNC 99)......................... 167
2.13 PROGRAM END.................................... 50 LlST .OF INSTRUCTION
MNEMONICS .............................. ..... 177
3 STEP LADDER INSTRUCTIONS..................51
6 SPECIAL DEVICE AND INSTRUCTION
3.1 HOW TO READ SEQUENTIAL LISTS .........................................................179
FUNCTION CHARTS ........................... 52
6.1 SPECIAL DEVICES ............................. 180
3.2 PROGRAMMING................................... 58
6.2 INSTRUCTION AND EXECUTION
3.3 STATE FUNCTION RULES ..................66
..
TIME LIST .................................... . . . 191
7 USING SPECIAL UNITS 17. EXTENSION BLOCKS AND
EFFECTIVELY ...........................................203 EXTENSION UNIT CABLES ............... 239
7.1 D(2-24EI SPECIAL BLOCKS .............. 204 18. PERIPHERAL COMPATIBILITY .......... 240
7.2 FX-232AW INTERFACE UNIT ............ 210
7.3 FX-8AV VOLUME ADAPTER ..............211 19. EQUIVALENT LADDER FOR Fi. F2
7.4 D(2-40APtAW PARALLEL LINK .
.
SFT ................... ............................ 241
ADAPTERS ..................................... 212
7.5 SPECIAL BLOCKS .............................. 214
APPENDIX ..................................................215
1. LIMITATIONS OF SOME INSTRUC
TlONS .................................................. 216

2. 2-INPUT RUNISTOP SWITCH


CONTROL ....................................... 218

3. MEASURING PULSE WIDTHS ........... 219

4 . PROGRAM FLOW CONTROL


INSTRUCTIONS .................................. 220

5. CONSTANT SCAN MODE .................222

6. MEMORY HOLD STOP....................... 223

7. REAL-TIME CLOCK FUNCTION


(CPU Version V2.0 and after) ............ 223
8. FROM INSTRUCTION
(Ver.2.O and after) .............................. 224

9. TO INSTRUCTION
.....
(Ver.2.0 and after) ............... .. 226

10. NOTES ON USING THE MTR


INSTRUCTION .................................. 227

11. DISTRIBUTION OF POWER ............... 228

12. PROGRAM DURING RUN ..................231

13. HlGH CURRENT TRlAC


OUTPUT BLOCKS .............................. 232

14. HlGH CURRENT TRANSISTOR


OUTPUT BLOCKS .............................. 233

15. POWER AND INPUT WIRING


FOR DC POWERED UNITS ............... 234

16. DC POWER SUPPLY UNIT................. 238


BASIC SEQUENCE INSTRUCTIONS

Fl
STEP LADDER INSTRUCTIONS
-

DEVICE DETAILS

APPLIED INSTRUCTION

SPECIAL DEVICE AND INSTRUCTION LISTS

USING SPECIAL UNITS EFFECTIVELY


I. GENERAL HARDWARE AND INSTALLATION

1.1 OVERVIEW OF THE FX2


This section provides general information to help users select the modules necessary to configure the
required system.

1.1.1 SELECTION BASED ON 110 POINTS


The FX2 Series Programmable Controller (PC) is configured from four products :
a base unit, extension units, extension blocks, and special adapters.
A variety of systems can be designed by combining these products or by using the base unit only.
A base unit, when combined with extension units and/or extension blocks, can control up to 256 110
(inputloutput) points for version V2.10 and after( 128 110's for versions before this).
O ~ e r a t e sa t a wide ranae o f Dower s u ~ o l v: 100 to 240V AC. 50160 Hz
All of the terminal blocks of the b a s e unit and
extension units are detachable.

I < Base units > I <Extension unit >

(1) OUTPUT TYPE SELECTION


Relay output (R) : Contact output; used to drive AC or DC loads.
SSR output (S) : Non-contact output; used to drive AC loads.
Transistor output (TI : Non-contact output; used to drive DC loads.
(2) INTERNAL POWER SUPPLY
Both base units and extension units have a built-in 24V DC power supply for the input circuits.
(3) AVAILABLE MODELS

Base unit (MI : Contains the CPU and memory. A base unit must always be used.
Extension unit ( E ) : A module(s) used to expand the number of 110 points.
Note that some models may not be available in some countries. The model names in this and the
following page have not been written in full since there are many model variations. See page 8
for the explanation of the model name.
,
' 1. GENERAL HARDWARE AND INSTALLATION

OVERVIEW OF THE FX2

1.1.2 EXTENDING 110 POINTS


Each extension block adds in units of 8 110 points. Both input and output points can be increased
independently by selecting the appropriate input or output extension blocks.
Extension blocks differ from base units and extension units in that they do not contain a built-in power
supply. Power must be supplied from the base unit or an extension unit. Also, unlike base units and
extension units, extension blocks have fixed terminal blocks.
FX-8ER (combination block) uses 414 points of 818 110 points, leaving the remaining 414 points vacant.
Similarly, FX2-24MR leaves 414 points of 16/16 110 points vacant. Therefore, when these are used, the
maximum I10 combination be less than 256 points.

< Extension blocks>

(1) OUTPUT TYPE


Extension blocks provide the same output types as those provided by the base unit and extension
units. Different output types can be combined.
For example, a base unit with SSR output, an extension unit with relay output, and an extension
block vvith transistor output can be configured together.
(2) POWER SUPPLY
Extension blocks do not include built-in power supplies. Power must be supplied from the base
unit or an extension unit.
(3) AVAILABLE MODELS

- -
..........................................................
..............
018 FX-8EYR FX-8EYS FX-8EYT
0116 FX-16EYR FX-16EYS FX-16EYT
810 FX-8E X
1610 FX-16EX
....................................
....................................
....................................
........................................................................
....................................
:...
. .: . : : : ~ g +
.....................
. . . . . . . ...........................................
...
...................................................
~ i :1618
~ ~ ~ FXz-24E I
.................
............................................
.............. . For connecting F2 Series special-function modules

Note: The number of l/O points o f a 16724/32-point base unit and 32-point extension units can be
expanded to up to a further 16points with extension blocks. ( M e n the F&-24El is used,
only 8 l/O points can be expanded.)
The number of l/O points o f a 48/64/8@point base unit and 48-point extension units can be
expanded to up to 32points with extension blocks. ( M e n the F&-24El is used, only 24 //O
points can be expanded.)
I GENERAL HARDWARE AND INSTALLATION

OVERVIEW OF THE FX2

1.1.3 SPECIAL FUNCTION ADAPTERS


The FX2 Series provides the following special function adapters. Connect a special function adapter
to the special port on the left side of the base unit.
The FX-232AW interface module can be used in combination with other special function adapters.
Special function adapters do not contain a built-in power supply. Power must be supplied from the
base unit. The FX2-40AW has a fixed terminal block.

(1) AVAILABLE MODELS

communlcatlon o
and 10 points of 16-bit data between
two base units.

Fiber-optic or twisted-pair cable


I . GENERAL HARDWARE AND INSTALLATION

OVERVIEW OF THE FX2

1.1.4 PRODUCT OUTLINE

(1 (2) (3) (4)

<Extension block>
<Extension unit >

The base unit, extension units, extension blocks, and adapters/modules


can be mounted to the DIN rail (1) or mounted directly using the
mounting holes (2). Pull the hook (8) to mount a unit to the DIN rail.
Extension units and extension blocks are connected to the base unit
by opening the connector cover (6) and connecting the cable as
illustrated.
Connect the special adapter (with an exception of FX-232AW) to the
connector on the left side of the base unit.
The input terminal block (3)and output terminal block (9)are protected
by transparent terminal covers, (4) and (10) respectively. Input status
indicators (5) and output status indicators (7)can be observed through
the cover. The base unit is provided with POWER, RUN, BATT.V, and
( ~ z )CPU-E status indicators (13).
When writing or monitoring a program, connect the FX-20P-E HPP to
the connector under the connector cover (12).
The removable F2-40BL lithium battery (14) is fitted to the connector
(15) under the panel cover (11). The following memory cassettes can
be installed in the memory cassette connector (16).
1. GENERAL HARDWARE AND INSTALLATION

1.2 PERIPHERAL DEVICES

1.2.1 PERIPHERAL DEVICE HIERARCHY


Base unit RAM EEPROM EPROM
cassette .,

rssetj

-8 FX-EEPROM-4 FX-EPROM-8
FX-EEPROM-8

- I Note: EEPROM and RAM cassettes may cause PR0G.E


error to occur when first inserted into the PC.
Deleting their contents will remove this error.

HGP for FX2

GP-80 HGP
Handy graphic programming panel.
GP-80FX-KIT (Japanese)
FX-20P HPP GP-80FX-E-KIT(English)
Handy programming panel Up-grade is necessary.
(Note programming is up to 4K only and does not
allow the use of the GP-80 ROW ROM writer.)

FX-20P-ADP
For offline programming with FX-20P
and transfer between FX-20P and
GPPIPHP programmers.
ki@SiEFX-POP-R WM

I
Q ; ---------.
; 0
t .----..----.
8
w

FX-20P-RWM
ROM wnter module
I. GENERAL HARDWARE AND INSTALLATION

PERIPHERAL DEVICES

,,ERj@
............. Programming function
r----'l Circuit display function
Floppy disk
Monitor function Comment (alphanumeric)
r'--j
RRT.
.............
.....
.... Printer output function
r'---j
,ROM ROM w riter function .;:$I#Japanese Kanji

1
ux tx+hu' .+mx..

.
>-
1.<.
__a,
3LI.I. om,
om

1
1
11
1111
2
!

FX-20DU
Data Access
Unit

NEC 9 8 series
or compatible personal
computer

Printer LLPR]
......
J@
- jp
....../.....::<.:

FX-AGGPP-KIT Japanese software may be used. FX-PCS-KIT198 Japanese software may be used.
1. GENERAL HARDWARE AND INSTALLATION

1.3 MODEL NAME

GENERAL FORMAT

I -A UL listed
product I
F X2 - 16 M R - E S /UL
Model
variations

: AC supply. Japanese specification


Omitted
D : 24VDC supply. Japanese spec.
DS : 24V DC supply. World specificaf on
ES : World specification
(if transistor, sink output)
M : Basic unit ESS: World specification
E : Extension unit (if transistor, source output)
EX
EY
: Extension input block
: Extension o u t ~ u block
t
4
1
-
R : Relay
S : Triac (SSR)
T : Transistor

EXCEPTIONS :
The mixed 110 Extension Block FX-8ER and some special adaptor blocks are slightly different
to the above rule.
Examples :
FX-8ER ............ 4 input, 4 output relay Extension Block
FX2-40AP ........ Parallel link (optical) Adaptor Block
FX-8AV ............ Analog setting input Adaptor Block
etc ...

Note I: Unless otherwise stated, h e n model names are witten in this manual without the model
variation part, it implies that all model variation types are valid to the information written.
Please ensure that the correct model is referred to in order to avoid any disastrous errors.
Note that in some countries, some o f the above mentioned models may not be available.
Note 2: M r l d specification indicates that the unit can be used around the world because it has a
wide supply voltage tolerance and the inputs can be configured for sink or source connec-
tion methods by the user.
1 GENERAL HARDWARE AND INSTALLATION

1.4 WORLD SPEC. AND JAPANESE SPEC. TYPES

WORLD SPEC. JAPANESE SPE ClFlCATlON


These are designed to be used throughout the These are designed to be sold in Japan butthey
world and are sold outside Japan. are sometimes exported to elsewhere in the
world via secondary machine makers.

DlSTlNG UISHABLE FEATURES DISTINGUISHABLE FEATURES


The inputs are configurable (via the ISISI The inputs are of 1-1 common (sink) type.
terminal) for I+Icommon (source) or 1-1 There is no ISIS1 terminal.
common (sink) connections.
The outputs may be of sink or of source The outputs are of sink connection when the
c o n n e c t i o n d e p e n d i n g o n the m o d e l output type is transistor.
variation.
The m o d e l name i n d i c a t e s w o r l d The m o d e l name i n d i c a t e s Japanese
specification by an "E" or by otherwise in s p e c i f i c a t i o n b y t h e o m i s s i o n or b y
the model variation part of the model name. otherwise, of the model variation part of the
example: FX-24MR-ES model name. The name of the series is also
different.
example: FX2-32MT
Unless stated elsewhere in the manual, other functions and specification are the same for the Input
Configurable Type and the Japanese Specification Type.

(1) THE DIFFERENCES OF I + ]


COMMON (SOURCE) AND [-I COMMON (SINK) INPUT TYPES
An input of a programmable controller may take the form of I+I common or 1-1 common depending
on whether the current flows into or out of the input terminal of the programmable controller. The
FX programmable controllers sold outside of Japan can be configured for both types.

I+ICOMMON INPUT (SOURCE)


I+Icommon input refers to a connection
where the common point of the input
devices are relatively positive.
The current flows into the input terminals
of the programmable controller.
The sourcelsink (SIS) select terminal
should be connected to the 0 V terminal
as shown.
[-I COMMON INPUT (SINK)
1-1 common input refers to a connection
where the common point of the input
devices are relatively negative.
The current flows out of the input ter-
minals of the programmable controller.
Basic unit
Remove any short links between the ISISI
and 10 Vl and connect the ISISI terminal
to the [24 Vl terminal as shown.
1. GENERAL HARDWARE AND INSTALLATION

1.5 INSTALLATION
1.5.1 MOUNTING AND WIRING
(1) MOUNTING DIMENSIONS
(a) DIN RAIL MOUNT
Units and blocks can be mounted to a DIN46277 rail (width : 35 mm (1.38 in)).
Pull the hook down to detach the units and blocks from the DIN rail.
Caution: Do not mount on DIN rail in cases &ere there is excessive vibration. Direct
mounting is a better alternative in this case.
(b) DIRECT MOUNT
Mount holes (M4 (0.16') screw holes) provided as illustrated below can be used for direct
mount.

The holes marked with asterisks (*) in


the illustration are not used on the FX
models listed that are marked with an
asterisk (*) in the table to the right.
Base and extension units can be ar-
ranged in two rows as shown on the
next page.
Note I : To prevent a rise in temperature,
mount the units to walls. Never mount
them to the floor or ceiling.
Units are i n mm(inch).

Note 2: The FX2-40AP requires at least 21 mm (0.837distance from the basic unit for good noise
immuity purposes.
(2) HANDLING OF ACCESSORIES
See general view in Section 1.1.4.
(a) EXTENSION CABLE CONNECTION
Connect the extension cables to the correct connector.
(b) MEMORY CASSETTE
Remove the memory cassette by raisingethe
r iw lever as illustrated and carefully pulling it
upward.
Caution: Turn off the power before removing the memory cassette.
Programs in the RAM memory cassette will be lost when the
cassette is removed from the base unit.
(c) PLACING THE I10 NUMBER LABELS
Input
The number labels that are supplied with the extension units and blocks labels
should be placed at every 8 points on the I t 0 terminals of the extension
units and blocks.
The numbers must be- consecutive from the numbers used for the base unit.
Output
The upper and lower terminals of the FX-16EX and FX-16EY are assigned labels
l o w r and higher numbers respectively.
1. GENERAL HARDWARE AND INSTALLATION

l N STAL LATl ON
(3) WIRING

Wiring cautions :
10.27in) Use the crimp terminals as shown to the left.
b k 5 Tinhten the terminal screws to between 5 and 8 kg-cm (5.76and 9.22
in-jb). They must be secure enough to prevent a loose connection from
Less than
15.8mm causing a malfunction.
10.27 in)
Do not connect a cable to a vacant terminal ( [ . I ) .

Do n o t run both input signal lines and output signal lines through the same cable.

I10 signal lines should n o t be laid with power cables or run i n the same d u c t as power cables.
I10 lines can be extended to between 50 and 100 m (164.05and 328.1 ft). However, it is
advisable that I10 lines be limited to 20 m (65.62ft) as a precaution against noise inter-
ference.
(a) TWO-ROW ARRANGEMENT

Each extension unit is provided with an exten-


sion cable.
Single-row arrangement : 55 mm (2.17in)
Two-row arrangement : 650 mm (25.59in)
Extension blocks are supplied with permanent-
ly connected extension cables.
Extension cables are very susceptible to noise.
They should b e laid a t least 30 to 50 m m ( 1 .I 8
to 1.97in) away from from PC output lines and
power cables.
Leave a t least 50 m m (1.97in) between units
and other structures to allow good ventilation.

f CAUTION
>
Environment :
Do n o t install in areas subject to excessive dust, oily mist, conductive dust, corrosive
gas, or flammable gas.
Do n o t mount i n areas subject to shock or vibration.
Do n o t mount in areas subject to high temperature, moisture, or rain.
During Mounting :
Do notallowcutwires, filings, or shavings to fall inside a unit or block when drilling holes
or connecting cables/lines.
Remove the protective cover from a unit or block once it has been mounted to prevent
overheating.
Leave a t least 50 m m (1.97in) between a unit or block and other device or structure.
Ensure that mounted units and blocks are kept as far as possible from high-voltage
cables, high-voltage equipment, and power equipment.
J
1. GENERAL HARDWARE AND INSTALLATION

1.6 POWER SUPPLY CIRCUIT

1.6.1 POWER SUPPLY CIRCUIT CONFIGURATION AND SPECIFICATIONS

(1) POWER SUPPLY CONNECTION CIRCUIT EXAMPLE


The following is an example of power supply connection circuit. See Section 1.1 1 for the actual
arrangement of the terminals.
Circuit breaker Emergency

P o m r supply for loads


connected to PC output

P o m r supply p ~ l o ~t n d ~ c s t o r
100 to 240V AC. 60160 Hz
N.B.
Do not connect '24V' term~nalsbetneen

Extens~onunlt

-----
Input block Output block
I I I
I. GENERAL HARDWARE AND INSTALLATION

POWER SUPPLY CIRCUIT


(2) POWER SUPPLY SPECIFICATIONS

WIRING CAUTION
Power Supply :
The power supply is a 120/240V AC system. Either system should be connected to terminals
"L" or "N".
Do not connect the power supply to an input terminal or the [24+1 terminal. If connected, it will
severely damage the PC.
The base unit and an extension unit power supply should be turned ONIOFF simultaneously.
During emergencies, the PC output circuits should be turned off using a switch external to the
PC.
-
The PC will continue to operate during a momentary power failure of less than 10 msec. If a
momentary power failure exceeding 10 msec or an abnormal voltage drop occurs, PC operation
ceases and output is turned off. Once the proper power supply operation is restored, the PC
will restart automatically (provided that the RUN input is set to ON).
Power cables must be at least 2 mm2 (AWG 14) to avoid voltage drops.
Grounds :
Use a cable at least 2 mm2 (AWG 14) to ground the equipment. Ground resistance must be
less than 1000 (class 3). Note that the ground cable must not be connected to the same ground
point as the power circuits. Providing a ground is recommended, although, if a proper ground
is impossible, the PC will still operate correctly even if grounding is not used.
When an extension unit is used, connect the ground terminals of the extension unit to the base
unit ground terminal and ground the base unit. The extension unit ground terminal should be
connected to the base unit ground terminal even if the base unit itself is not grounded. Connect
the "SG" terminals of base unit, extension units, and extension blocks with a cable of at least 2
mm2 (AWG 14). '
Sensor Power Supply :
The output current of a 24V DC power supply for sensors varies from 0.1 to 0.4 A as shown in
the table above. This variation depends on the type of PC model and whether or not an
extension block is used.
If an overload occurs, .the voltage is lowered automatically, deactivating the PC inputs. Do not
connect an external power supply to the [24+lterminal.
Do not connect the [24+1 terminals on the base unit and extension units.
Connect the [COMI terminals on the base unit and extension units to each other.
I.GENERAL HARDWARE AND INSTALLATION

1.7 INPUT CIRCUIT CONNECTION

1.7.1 DC INPUT SIGNAL CIRCUITS


(1) INPUT SPECIFICATIONS
The folloMng figure shows the PC input signal circuit (including the RUN input) specifications.
(a) INPUT TERMINALS

The input signal is turned ON when current


flows through the input terminal. The input
device is connected between an input and
the [COMI terminal.NPN open collector
transistor sensors can a1s.o be used.
The input indicator will light when the input
is turned ON.
Note: Isolate input commons from out-
--- put ICOMI terminals to minimize
noise from heavy loads.

(b) INPUT CIRCUIT


The pri.mary and secondary input circuits are isolated by a photocoupler, with the secondary
input circuit provided with a C-R filter. This prevents operation errors due to input contact'
chattering or other noises that may enter via the input line.
- For this reason, ONYOFF status changes (from ON to OFF or from OFF to ON) in the PC will
be delayedafor approximately 10 msec.
(c) INPUT SENSITIVITY
The input current'is 24V DC, 7 mA with input sensitivity current between 2.5 to 3 mA.
. However, correct ON and OFF,operation can be ensured by currents of at least 4 mA for ON
and not more than 1.5 mA for OFF.
For this reason, it is important that the precautions given on the following page be followed
if a diode or resistor is connected to the input contact in series, in parallel, or if there is a
leak inhibiting component.
(d) SENSOR 'EXTERNAL CIRCUIT
The input current is supplied from the 24V DC power supply contained in the PC.
Therefore, if a sensor, such as a
. photoelectric swtcih, is driven by . ---
-an external power supply, the volt-
age should be 24 *
4V DC and NPN sensor 1 1
sensor's output transistor must be External
an NPN type. power

----- --- I
-
1. GENERAL HARDWARE .AND INSTALLATION

INPUT CIRCUIT CONNECTION


(2) INPUT CONNECTION EXAMPLE
Theowln
ofg
li diagram provides an example of an input connection. For the actual arrangement
of the terminals, see Section 1.1 3.

-
- -
-?
I

-0 *

I
-424+1~0~1
-.
- 1 IRUN~ XO 1XI 1x2 1 TH:
24+1 1
XO - X
1
L-T ----- - - - -
f \
CONNECTION CAUTIONS
Selection of lnput Devices :
The input current of the PC is 24V DC, 7 mA. Use only the input devices suitable for operating
at this low current. , I

If large current switches are used, improper contact operatio'n may occur.
Diodes Connected to lnput Contacts in Series :
The voltage drop through a diode should be less than 4 V.

If reed switcheshtw
i serially connected LEDs are used, no more than two
7 should be connected in series.

I
J Resistors Connected to lnput Contacts in Parallel :
Parallel resistance must be greater than 15 KO.

r-- $7
Bleeder
If the resistance of a resistor Rp connected in parallel is smaller than this,
connect a bleeder resistor Rb between the input (IN) and the [SISI ter-
I
minals.

15-Rp
I *

COM An alternative is to hold the leak current I (leak) of a 2-wire proximity switch to
- less than 1.5 m i l while it is ofF If leak current is greater than this, connect a
bleeder resistor Rb which satisfies the following:
Rb /(lea4 - I .B
X-(KQ)
- - -
,*
* I d

--

L J
1.8 OUTPUT CIRCUIT CONNECTION

1.8.1 RELAY OUTPUT CIRCUITS


(1) OUTPUT SPECIFICATIONS

(a) OUTPUT TERMINALS


Each output point on an FX2-16M Series PC is common isolated. Other models provide
between 4 to 8 points of common output. Each common terminal is assigned a number from
[COMlI to lCOM71.
Different voltage systems, such as 200V AC, 100V AC, and 24V DC, can be used for different
common blocks to drive loads of various voltages.
(b) CIRCUIT ISOLATION I

The internal circuits of the PC and external load circuits are electrically isolated (from each
other) by the coils and the contacts of the output relays. Common blocks are also isolated
from each other.
(cIOPERATION INDICATORS
When the an output relay is energized, an LED will light and the output contact is ON.
( d l RESPONSE TIME ,

The response time between the energizing or de-energizing of an output relay contact and the
turning ON or OFF of an output contact is approximately 10 msec.
(el OUTPUT CURRENT
A circuit voltage lower than 250V AC can drive the following loads :
Pure resistive load : 2 Atpoint
Inductive load : Less that 80 VA (100 or 240V ACI .
Lamp load : Less than 100 W (100 or 240V AC)
The service life of the relay contact points for inductive loads is summarized in the table below.
When using an output contact for a DC inductive load, a surge absorbing diode should be
mounted in parallel with the load and a maximum power supply voltage of 30V DC must be
used.
(f) LEAK CURRENT OPEN CIRCUITS
The neon bulb can be directly driven by an output contact due to the lack of leak current when
the output contact is OFF. ,

Ref.: Relay output contact service life


The rated service life for inductive AC load, such as contactor or solenoid valve, is
500,000 operations a t a load of 35 VA. The following table is based on Mitsubishi
reliability tests.

.......................
..........................................
...........................................
..... 0.35 N1OOV AC S-A10 t o S-A80.
.:.:.:.:.:tsyfis$$i
.....
.....
......................
..................... 3,000,000 t i m e s
......................
........................................... 0.15 Al240V AC
........................................... S-K20 t o S-K 150
%wm3z?K The test uses a I sec ON/OFF
.....................
!yjgg$0.8 N100V AC S-A100t o S-A150
j::::::::::::::::*.::::::::::::::::::
......................
.:.:.:.:.:a
.....
.....
...........
...........................................
........................................... 0.33 N24QV AC
1,000,000 t i m e s cycle. The addition of in-rush
:::::::::::*:::::::::::::::::::::::: S-K180 t o S-K400
. . . ( . . . ................. overcurrent g r e a t l y reduces
$.....
$ ~ ~ $ ~ z $ $ $ ~ $1~-2$ ~A/10 0 V AC
;:g@&:yjq$; relay contact service life.
:.:.:.:.:.:......... ...................
............................................ 200,000 t i m e s S-A220 t o S-A401
:,,.......................
;
;

.:.:,:..::.:.:.:.:.:.:.:.:. 0.5 A/24OV AC


1. GENERAL HARDWARE AND INSTALLATION

OUTPUT CIRCUIT CONNECTION


(2) OUTPUT CONNECTION EXAMPLE
The foo
l vvn
ig is an example of an output connection circuit. For the actual arrangement of the
terminals, see Section 1.13.

LED
AC power supply Solenoid Incandescent Neon Contactor Solenoid D C power LED Electromagnetic
250V AC or lower valve lamp lamp . supply , clutch
' 30V DC or lower

Since fuses are not included in the internal output circuit as shown above, a 5 to 10 A fuse should
be used for each 4 points.

f OUTPUT CIRCUIT CONFIGURATION >


DC Loads :
Connecting a surge absorbing diode in parallel with a load will
greatly lengthen the service life of a contact.
PC output \
Surge absorbing
contact
diode

gg,b,"duvit;Q AC Load :

Connecting a noise suppressor in parallel with an AC inductive


PC output
t - load will reduce noise generation.
contact \
Noise
Noise suppressor : O.1pF + 100 to 1200
suppressor
Load Orientation :

mq '
TKe orientation of the PC output contacts should be the same.
. .

L=
:3
L
q~
a
Interlock :
Forward
rotation Contacts. that control loads, such as those used for for-
Reverse wardlreverse rotation, which may turn on simultaneously con-
rotatton stitute a dangerous hazard. Interlocks external from the PC,
as well as programmed interlocks, should be used to prevent
PC output contacts such loads from simultaneous activation.
L J
1. GENERAL HARDWARE AND INSTALLATION

OUTPUT CIRCUIT CONNECTION

1.8.2 SSR OUTPUT CIRCUIT


(1) OUTPUT SPECIFICATIONS

(a) OUTPUT TERMINALS


Each output point on an F X ~ - 1 series
6~ PC is common isolated. Other FX2 Series models
have their outputs commoned in groups of 4.
Different voltage systems, such as 200V AC and 100V AC, can be used for separately
commoned blocks.
(b) CIRCUIT ISOLATION
PC internal circuits and the output devices (triac) are isolated by a photocoupler. Common
blocks are also isolated from each other.
( c ) OPERATION INDICATOR
An LED will light and the output triac
. .
is ON when the photocouples is being driven.
(dl RESPONSE TIME- ,
The 'response time between the activation and de-activation of the photocoupler and the
turning ON and OFF of the output triac is less than 1 msec and 10 msec respectively.
I - -
(el OUTPUT CURRENT
The circuit can h.andle a maximum current flow of 0.3 Alpoint.
However, the current should be limited by design to 0.8 A14 points in order to prevent
excessively high temperatures to arise. When a high in-rush current is required to turn a load
ONIOFF, the root mean square current should be less than 0.2 A.

,
Example :

4 ~ 1
0.02 sec
1!
I
,or
1 0.7 sec -( 1 10 sec
i u . u L
0.02
7- ".+
+ 0.7 + 10
xu.,

For FX-4EYS-H and FX-8EYS-H high cu'rient output blocks, each point can load 1A
(2Ai4pts). See appendix.
(f) LEAK CURRENT IN OPEN CIRCUITS
AC-R absorber
. . , .is,connected in,.parallel to an output terminal of the PC.

Note: As a result, a leakage current of 1 mN1OOVAC or 2mN240VAC occurs when the


circuit is open and can inadvertently activate loads that require only a l o w current
for operation. Either the load capacitymust be restricted to those requiring greater
than 0.4 VA/lOOVAC or 1.6 VN200VAC or, if a smaller capacity load or a neon lamp
is used, connect the surge absorber specified on the following page in parallel with
the load.

Ref.: Leakage current in SSR output circuits is greater than that o f relay devices and can
cause miniature relays to hold their operation.
-
.I
-. .

-
1. GENERAL HARDWARE AND INSTALLATION

OUTPUT CIRCUIT CONNECTION


(2) OUTPUT CONNECTION EXAMPLE
The following is an example of an output connection circuit. For the actual arrangement of the
terminals, see Section 1.13.

7- - -
PC (FX2-16MS Japanese Spec.)
--

Since a fuse is not included in the output circuit of the PC as shown above, a 5 to .10Afuse should
be used for each 4 points.
-- --

f OUTPUT CIRCUIT CONFIGURATION \


N e o n l a m p or
l o w current load
Weak. Current Loads :

h-a
PC output
\
Noise suppressor
When a neon lamp or a low current load of less than 0.4
VAI100V AC or 1.6 VAl200V AC is connected, connect the
following noise suppressor in paral!el with the load.
Noise suppressor : O.1pF + 100 to 12062

m Load Orientation :
The orientation of the PC output contacts should be the same.

a 1

Forward Interlock :
rota tion
Contacts that control loads, such as those used for for-
Reverse
wardlreverse rotation, which may turn on simultaneously con-
rotation stitute a dangerous hazard. Interlocks external to the PC, as
well as programmed interlocks, should be used to prevent
PC output contacts such loads from simultaneous activation.

L J
GENERAL HARDWARE AND INSTALLATION

OUTPUT CIRCUIT CONNECTION

1.8.3 TRANSISTOR OUTPUT CIRCUIT


(1) OUTPUT SPECIFICATIONS

(a) OUTPUT TERMINALS ,

Each output.point of a FX2-16MT Series PC is common isolated. Other models have their
outputs commoned in groups of 4 or 8.
A 5 to 30V DC smoothed power supply should be used to drive the loads.
(b) CIRCUIT ISOLATION
PC internal circuits are isolated from output transistors with a phbtocoupler. Common blocks
are also isolated from each other.
(c) OPERATION INDICATORS
An LED will light and the output transistor is ON when an output transistor is being driven.
(d) RESPONSE TIME .
The response time bet%en the activation or deactivation of a photocoupler and turning ON
or OFF of an output transistor is less than 0.2 msec. (at 24 V 200 mA)

The circuit can handle a maximum current flow of to 0.5 Npoint.


.- - - -

However current should be limited by design to 0.8 N 4 points (an average of 0.2 Alpoint) in
order to prevent excessively high temperatures from rising.
An output transistor turns ON with a voltage drop of 1.5 V. Take this into consideration when
driving semiconductors.
FX-4EYT-H,FX-8EYT-H allows maximum 1AIpt and 2N4pts.
(R LEAKAGE CURRENT IN OPEN CIRCUITS
Leakage current is less than 100 PA.
(2) OUTPUT CONNECTION EXAMPLE
The following is an example of an output connection. For the actual arrangement of the terminals,
see Section 1.13.
.
- - - ---------
FXZ-24MT

r
I
Noise suppressor i s connected for each output.
I
1 I

Load drive
contactor
1. GENERAL HARDWARE AND INSTALLATION

OUTPUT CIRCUIT CONNECTION

1.8.4 OUTPUT SPECIFICATIONS

Note I: M e n the, external power supply voltage is 24VDC or less, i f possible, allow a t least 5 mA
to flow.
Note 2: The response of 0.2 msec is stated at 24 C! 200 mA. The amount of time required to turn
OFF increases as load current decreases. This response time can be improved with light
loads by increasing the amount current flow through an added dummy resistor.
I f the response time of 0.5msec or better is desired, ensure a current of above 60mA flows
at24VDC.

Note 3: Internal protection and photocoupler


Dummy resistor to improve circuit of the,transistor output.
Programmable response time
controller
v+ 60 to 200mA
Example load: COMo
logic device

Yo
C OM I
-
Programmable c o n t r o l l d
GENERAL HARDWARE AND INSTALLATION

1.9 PRELIMINARY CHECKS

1.9.1 PROGRAMMING AND TESTING


(1) CHECKUP (POWER : OFF)
Incorrect connections at the power supply terminals, a short between the DC input lines and the
power supply cable, or a short in the output lines can seriously damage the PC.
, Before turning on the power; check the power supply and ground connections and the inputlout-
put 1ine.connections.
Ref.: Use the following procedure ifit is necessary~tomeasure the PC withstanding voltage
and insulation resistance. ,
'
- Disconnect the input/output lines and the power supply cable from the PC.
- ~ u m p e each
r terminal to the ground terminal.
Measure the withstanding voltage and insulation resistance between the jumper and
the grounding terminal.
' ~ t h s t a n d i nvoltage
~ : 15OOVAC, I. minute
*Insulation resistance :Higher than 5 M62, measured with 5OOVDC Megger
(2) WRITING AND CHECKING A PROGRAM (POWER : ON, PC : STOP)
Write a programhtw
i a peripheral device.
I

Read the program to make sure it has been written correctly. At the same time, check the program
for circuit and syntax errorsusing the program check function on the peripheral device.
Ref.: ' * . M e n an FIGPOP programming panel is used, the PC will remain in the STOP status
when the power is turned ON i f the IWI key is held down (even i f the PC RUN inputis
- . ON). Therefore, programming is possible without turning OFF the RUN input. The PC
will restart when power is turned off and then on again.
- ' Each output can be forcibly turned ON/OFF with the programming panel.
(3) OPERATION AND TESTING (POWER : ON, PC : RUN)
When the RUN input is turned on; the PC is placed in the RUN state. It is possible to change the
settings for timers, counters, and data registers or to forcibly turn devices ONIOFF while the PC
is running.
Ref.: ~ ~ r o g r a m hpanel
i n ~ can be used to check the ON/OFFstatus of each device and the
continuityof each circuitblock or to read the present data of timers, counters, and data
registers. . ,

Wth a graphic programming panel, the circuit diagram is displayed while monitoring
the devices in the PC. In this way, program debugging is made much easier.
GENERAL HARDWARE AND INSTALLATION

1.10 E R R O R CHECK

1.10.1 CHECKING ERRORS WITH THE LEDS


If a problem occurs while the PC is running, check the power supply voltage, the PC terminal screws,
and the I10 devices for looseness or other abnormalities.
After that, check the LEDs on the PC. The LEDs will help you determine if the PC is faulty or if the
problem is being caused by an external device.

There is a POWER LED on the front panel of the base unit, extension unit, extension block, and
' special function adapter. It is lit by 12V DC, supplied from the base unit or extension unit internal
p o m r supply. If the POWER LED is not lit when the power is turned on, disconnect the 24+
supply terminal. The sensor power load is too high if the POWER LED then lights. In this case,
the 24V DC p o w r to the sensors must be supplied externally.
The fuse in the base unit or extension unit may blow if conductive foreign matter has entered the
PC or other faultir conditions exist. If this is the case, merely changing the fuse does not solve
the problem as the same result will occur again. Please contact your local Mitsubishi service
center.

(2) BATTERY VOLTAGE INDICATION (BATT.V LED : ON)


The BAlT.V LED will light if the battery voltage drops while the PC is running and special auxiliary
relay M8086 is activated. Programs in the RAM or data in memory area backed up by battery can
be retained for one month after the BAlT.V LED has lit. However, the battery should be replaced
as soon as possible if this LED is lit. I t is recommended to replace the battery every 5 years. In
the case when 8K RAM cassette is used, replace the battery every 3 years.
Refer to Section 1.9 for the battery replacement procedure.
Ref: The BATT.VLE0 does notlight even when battery voltage is lowifspecial auxiliaryrelay
M80.30 is activated. Ho wever, special auxiliary relay M8006 will be operational.
Data in a data register, used as a setting for a timer or a counter or other, will become
. unreliable if battery voltage is low.
(3) ERROR INDICATION (PR0G.E LED : FLASH)
The PR0G.E LED may flash when a program is run in cases where the timer or counter constants
are not set; a circuit is' programmed incorrectly; battery voltage is abnormally low; the stored
program has been altered by noise or conductive foreign matter has entered into the PC. When
the PR0G.E LED flashes, check the program, noise sources, the BATT.V LED, and also the inside
of the PC for'conductive foreign'matter.
Ref: . * If an error occurs, a register number (8009, 8060 to 80681 corresponding to the cause
of the error is stored in special data register 08004. Read the register number in 08004
and the data in thatregister to f i d the error code number. Use this error code number
and the table in Section 6.1.8to find the contents of the error and the corrective action.
1 GENERAL HARDWARE AND INSTALLATION

ERRORCHECK
(4) ERROR INDICATION (CPU.E LED : ON) . .

The CPU.E LED may light when the CPU runs out of control due to external noise or conductive
foreign matter in the PC or if the program cycle time exceeds 0.1 sec.
The CPU.E LED may also light when a memory cassette has been removed or installed while
the power supply to the PC is ON.
Turn off the power supply once and then turn it back on again. After.that set the PC in the
RUN status.

q-qq r&m m T
If the PC now operates correctly, check for possible noise sources and inside thee PC for
conductive foreign matter.

device
device device

Class 3
- ground - -- --
Independent grounds C o m m o n ground (acceptable) C o m m o n ground (unacceptable)
(recommended)

Use wire at least 2 mm2 (AWG 14) thick to ground a PC. Keep the ground wire length ground
wire as short as possible. A class 3 ground (ground resistance of less than 100 Q ) is
recommended.
If the PC malfunctions because of an improper ground) disconnect the ground wire from the
on the PC. In this case, the ground terminals of the base unit and the
terminal
extension units ould be connected with each other.
If the error changes from CPU.E to PR0G.E (indicated by a steady On to a flashing LED) when
the ground wire is disconnected from the PC ground terminal, check the program.
If the CPU.E LED remains lit, review the program to check if the operation cycle time might
be excessively long. The operation cycle time is stored in special data register D8012.
(5) INPUT ERRORS
Irrespective of whether the state of the input monitored by the programming panel agrees or not
with the status of the LED of that input, check the following :
A loose contact error will occur if rated current of the input
hct w
is is too large. Another
possibility is that oil has entered.
If the input swctih contains a parallel LED resistor circuit, it is possible that the PC input signal
can be turned on through this circuit even though the switch is in the OFF position.
An inputthat is turned ONIO'FF in a period shorter than the operation cycle time of the PC will
not be accepted.
If there is an overload of the 24V DC power supply or if there is a short in the power circuit,
the protection circuit is activated and voltage is automatically lowered. In this case, each PC
input will become inactive (PC will enter a power off state but POWER LED is dimly lit.).
If a voltage higher than the rated voltage is applied to an input terminal, the input circuit may
be damaged.
Insufficient contact of the input terminal block on the base unit or extension module is another
possible cause of this problem. Remove the terminal block and refit it securely.
1. GENERAL HARDWARE AND INSTALLATION

E R R O R CHECK
(6) OUTPUT INDICATION
The input terminal block can b e
Y
If the load does not turn ONIOFF despite removed b y loosening these screws.
, the status of the LEDs, an open-circuit leak
current (SSRoutput) or one of the following Input LED indicators
may be the cause of the problem. . /

The output contacts may have melted


because of an overload or a short; or
the contact is insufficient because its
surface has eroded.
Since insufficient contact of the input
terminal block on the base unit or ex-. LEDs
tension module is another possible "YE!-.
cause of this problem, remove the ter- RUN 1
minal block and refit it securely.

Output LED indicators


The output terminal block c a n b e
removed b y loosening these screws.
1. GENERAL HARDWARE AND INSTALLATION

1.11 MAINTENANCE AND INSPECTION

1.11.1 MAINTENANCE AND INSPECTION PROCEDURE


(1) PERIODICAL INSPECTION
Most of the parts in the PC will never need to be replaced. However, the service life of the battery
is approximately 5 years* and it should be replaced as necessary. It is necessary to check to the
condition of output relays if they are operated frequently or used to drive large-capacity loads.
See Section 1.8.1.
+ ~ a G e r yservice life will be approximately three years when an 8K RAM memory cassette is used.
Also check to the following points :
The interior temperature of the panel
Airborne or electrically-conductive dust inside the panel
Loose wiring or terminals
(2) REPLACING THE BATTERY
If battery voltage is lower than the allowable limit, the BAlT.V LED on the front panel will light
h e n the power is turned ON. Although, memory data will be retained for approximately one
month aft& this LED lights for the first time, the battery should be replaced as soon as possible.
A memory backup capacitor can be used when an EPROM or EEPROM is used as the memory
cassette type. In this case, image memory data will be retained for approximately three days
(once it has been fully charged before power off; approx. 1 hour.).
(a) BAlTERY REPLACEMENT PROCEDURE
1) Turn off the power supply.
2) Remove the terminal cover and open the panel cover.
3) Remove the battery from the holder and remove the connector.
4) Insert the connector of a new battery immediately (within 30 sec after the removal of the
old battery).
5) Fit the battery or memory backup capacitor into the holder and replace the panel cover.
Note: Replace a memory backup capacitor h i l e the power is OFF but be sure to power ON
again immediately or memory data may be lost. Charging a memory backup
capacitor requires approximately one hour.

I
Fz-40BL battery FX-40CAP M e m o r y Backup Capacitor
I . GENERAL HARDWARE AND INSTALLATION

1.12 EXTERNAL DIMENSIONS AND GENERAL SPECIFICATIONS

1.12.1 EXTERNAL DIMENSIONS

(1) BASE UNITS A N D EXTENSION UNITS


<Accessories >
Extension unit : 110 number label (Iset) .

Extension unit : Extension cable,


6 5 0 m m (25.59 in) ( 1 pc.)
5 5 mm (2.17 in) (1 pc.)

L ~ o u n t i n gholes M3.5 (0.14 in) DIN rail


( 4 - 05.5 m m (0.27 i n ) ) terminal screws (width : 35 rnm (1.38 in))
mounting slot
(2) EXTENSION BLOCKS AND SPECIAL FUNCTION ADAPTERS
95.3 74.1 d < Accessories >
IC 10 34'1 ,
I -
---- -- -.--_ Extension block : I10 number label (1 set)
-. 8

(2 - 05.5 mrn (0.27 i n ) )


M3.5 terminal screws ( A d t h : 35 m m (1.38 i n ) )
mounting slot
(3) GENERAL SPECIFICATIONS
.....................................................................
...........................................................................
.........................................................................
;:;;sggf*;~*g~gf*fijfji~Q'*~gB'*~<:
.......................................................................0 to 55 9:
...
................................................
.....................................................................................
.........................................................................
...
...
j..................................................................... , 35 to 85% R H , n 0 con d en sa ti 0 n
..................................................................................................................................................
.........................................................................
.........................................................................
.........................................................................
.........................................................................
........
... Conforms to JIS 091 1 10 to 55 Hz 0.5 mrn (0.02 in) Max. 2G 0.5 G on DIN rail
:::::,uaij":~p'gg~$ipii&$gg;~j~~~
...
....................................................................................
...............................................................
. . . . . .
...................
............................................................... ................................... 2 hours i n each of 3 axis directions
...................................................................................................
.................................................................
.........................................................................
P
.........................................................................
...
........................................................................ conforms
:... to JIS 09 12 ( 10 G 3 ti i 3 d irecti )
By noise simulator of 1000 Vpp noise voltage, 1 p s noise width a t 30 to 100 Hz
1500V AC for 1 minute
.........................................................................
.........................................................................
.........................................................................
.........................................................................
.........................................................................
............................................................................................................
..................................... Between all terminals and ground
~ ~ : , ~ ~ ~ l ~ P ~ : ~ f i j i ~ 9 ' ~ i j - g ~ ~ ~ ~ j j j j j i j i500V
......................................................................... i j i j i5
j j j i j i j i jDC Mn
ji~ ~ j j jor
i j j jover
i j i w K$en measured
.........................................................................
::
.........................................................................
...............................................................................................................
...................................................................................................
......................................................................... fith a me99er . . '
:.............................................................. ..:,>>:.,.,..:::::...........................
...
j:2:~<K~H&ji$jij;i;jiji~$jijijijijiji;r::~~ijj;jj<jij~$$$~ipij;$
.................................................................................................................................................
.........................................................................
class3 roud;,, rou nd isnotrequired when it is i ossible.
.........................................................................
.........................................................................
iiiiiii To b e free from corrosive gases. Dust should b e minimal.
1. GENERAL HARDWARE AND INSTALLATION

1.13 TERMINAL LAYOUT

1.13.1 BASE UNIT

models.
1. GENERAL HARDWARE AND INSTALLATION

TERMINAL LAYOUT

OR18
o m #
nun
o:=

Note: Do notconnectcables/wires to the undefined terminals (designated b y I . II on the base unit,


extension unit, or extension block.

Output of FX2-16MT
I
1. GENERAL HARDWARE AND INSTALLATION

1.13.2 EXTENSION UNITS AND EXTENSION BLOCKS


1. GENERAL HARDWARE AND INSTALLATION

1.14 PERFORMANCE SPECIFICATIONS LIST

Operation control method Cyclic operation b y stored program Performed b y dedicated logic control LSI
'I0
mfresh. method - - - Batch processing method (when END , Direct 110 instructions and i n p u t filter
. -. instruction is executed) adjust instructions are available
Operation processihg time,,; - Basic instruction : 0.74 psec . Applied instruction:Und.er several 100 psec
Programming language , - , . Relay symbolic language + Step ladder SFC expression possible
I 2K step RAM incorporated (standard) Comment registration i s possible (program
Program capacity and memory used)
.. 4K step EEPROM cassette (optional) - Alphanumerics (15 characterslcomment)
memorytype, . ' '
8K step RAM, EEPROM* EPROM cassette 10 steps~comment;program memory is
, ' \
(optional) reserved i n units of 50 comments
. . .
Number of instructions sequence instruction ': 20, Step ladder instruction : 2, Applied instruction : 87
Input DC i n p u t . ' . 24V DC, 7 mA, isolated b y photocoupler .
. . - - xo t o ~ 1 7(octal)
j
relay- ,-
. .
., , . .,
Relay 250V AC,'3OV DC, 2 A (resistive load) 110 Relay,
,
Output 256 points i n total
SSR 242V AC, 0.3 N p o i n t , 0.8 A/4 points YO to Y177 (octal)
relay
Transistor 30V DC, 0.5 Alpoint. 0.8 A14 points
.:.:..:.....-:.:
.....................................
u 0 to M499 .................................
..... :.::::(. .......................:.........................
General yse : : ~ g ~ g ; a g ~ ~ ~
(500 points) . ~:gh~c~~gggEq;8~gggtss;
pm- -
Auxiliary
relay . :
..
~.gPOliiiixiaiiiiij~ijijijijijiIiIiIiIijijij~j~ii3ii
.::
.:..:.:
:.i:..
:.::
.:..
Special purpose
:~ .:.:.2.:.'::w.jjjj.jjjilw
................................................................
................................................ .. :
.....
..aFikd
:
:......... .
...
.:
.... w
.. .
....................
..............
:C' .
...............'......o... .................;..........:..................................................................... :.:.:.:.: ....................... M500 to M 1023 .
i........:.:..'.................................
..~ .............................................................................................................................
g s ~ ~ j .............. i ~ ~ .~ ~ g q ~ s j i ; ~ ~
. . . . . . . . . . (524 points)
.............
...........
............
&#$#@$@~##~@&~~$$
; ~ ~ ~ ~ ~ g s ~ ~
.................................................................................................
...............................................
..................................................................................................
M8000 to M8255 (256 points)
Initial use . c a n be used for initial state SO to S9 (10 points)

, , lOOmsec 0.1 to 3,276.7 sec TO to T I 9 9 (200 points)


" '
10 m s e c ; ', 0.01 to 327.67 sec T200 to T245 (46 points)
........................................ ....................................
Timer . ,i$$[~&&fiiiii'~&$$~fi~~ifjij~ii~
............................................. 0.00 1 to 32.767 i ~ j j T246
~ i j :.,,:.:,i:.(:.(:,L:,~~..........................................
............................... ~ jto ~ T249$ ( 4@
poist,)~
... ,
5 -. . . . . . . . .;...:............................ .;g:$$g:$&;w~g@#KgggR
. . . .
...................................:.:.:.:.:.:.:.:.:.:.:.:.:.:.::.:::::2
.......... T250 to T255 ( 6 points)
...............................

i.t.iP. .i't.p
. l.ig
.liIij
...........................................
0.1 to 3.276.7 s ec
jiijijljljjjjjjjjjjjjjjEj .....................................................................
...................%
.................................................................
................................................
..............
........:.................................... .:.:.: .:
.................
' \ - c o t 0 C99
I
16 bits . use . (100 points)
up counter . ,,
I

0;c 199
,
1 to 32i767 counts - ~ ; : ~ ~~ ~ 1 0 to i ~ ~ ~ ; ; ~ ; ~
................
'. , , , i...................
i $ $.,..w $.........................................
$ ~ ~ $ ~ @ Q ~ # I $( 100 ~ ~ points)
~r~ 3
Counter . . 32'bits - - General use - - + C200 C219
(20 points)
Up I d own counter -2: 147,483,648 to ...................
t ., 2,147,483,647 ;sg=K&@@@gK@gf<@mi
~ . ~ x , ~ 2 : ~ : ~ , ~ ~ ~ K ~ w , 5 ~ ~ ~ . , : .
...................
..................................................
. :. ................................................
...............................
,,,,,,, ,,,,, ,, ,,,,,,,,,,.,.,.,,,, ,,,,,:,:,:ti,:,:,
...............................................
............................. ......................................................
.................................................................... :.:.._....................:
High-speed-, 6 points i n C235 to C255 (1-phase count)
counter
32,bits Upldown i:,g#$~#@#@~#i~@t:~gi~
.:::::::::::::::::::jj::::::::::.:,:,:,.;.~~::::::::::::::::::::~::::::c.j:::::.:,:.::::.:~
j
j~
.:
.y
.j
jj
jj
jj
j:
:.
.:
.:
.j
:.
:.
:.
:,
:.
:.
:,
~.
(.
.~
.j
j~
.:
:(
DO to D l 9 9 .:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.>:.:.>>:...:.:.:.:.:
.......................
ls'bits General use (200 points) j:kggg$+g~gmjz~~~~~;?~~;
............. .
General-purpose
+
, I
data register . - I t ::....
::::::::::::::j:j:j:;:;:;:;:j:j:;:;:j:$:,;:I::j:j:j:;:;:j:j:j:j:j:ij:;:;:;:
D200 to D51 1
2:$Fgtilgai;
........... j.8%g~:B'K#8B
.............................................................
. . .
. 16'bits , ' .............................. y
...... a
" g g ~
....................... : ~ : ~ ~~ ~....... ~......................
e ;~ t t j $ @~ ~ j i ; i~:
. .I:. .
Register
j................ ~ ~
:~.:.:.:.:.:.:.:.:.:.:,:,:,:,:,::::.:.:.:.~:~:~~::;:;:::::::::::::~::::::2:~:::::::::::::::::
: ~ f
(312 points) ~
. . :.............
.................
~
............
.................. ......
..::.:.:.:.:.:.:.:.:.:.:.>:.>:
~

pecial register -16 bits I D8000 to 08255 (256 points)


::' In'dex '
1 16 bits
........
V. Z ( 2 points) '
......
.&pB)ijij;~;ji;jij;~; :;;jjj;j;jjjjjj~;;$$$ij;;ijjii;~
'1.6 bits (in ' Dl00o to D2999c Max- 'OoO points. set b y
File
.I.
a & n ~ ; ;...............
program memory) I;i:::::::::;:j:::::::::::::::.:.:.:.:.:.:.:.:.:.:.:.:.:
:.
................................................. I.:
a~#ifl~ #j~$I~~~I
parameter
, For JUMPICALL
. . .. , PO to P63 ( 6 4 points)
Pointer- - - - Input interrupt using XO to X5, and timer
Interrupt . ., .
interrupt
to (9 p.oints)
. - .- ., ,

Nesting For master control NO to N 7 (8 points)


'
Decirnal.(K) . , 16 bits : -32;768 to 32,767, 3 2 bits : -2,147,483,648 to 2,147,483,647, . '
'Constant . .
Hexadecimal (H) 16 bits : 0 to FFFFH, 32 b i t s : 0 to FFFFFFFFH ,.> . . a .

Ref.: Power supply specification.. .... Section 1.6.1 (21


Output specification ............ Section 1.8.4
General specification ........... Section 1.12.1
1. GENERAL HARDWARE AND INSTLLATION

1.15 DEVICE NUMBER LIST

1.15.1 DEVICE NUMBER ALLOCATION


For the functions and operations of each device, see Section 4.
The devices marked with (BIU) are backed up by the battery.

T2W to T245 - T246 to T249

For master control Branch pointer for jump

T and C can-be used as data registers when they are not being used as timers or counters. In this
case, each point of C200 to C255 correspond to a 32-bit register.
GENERAL HARDWARE AND INSTALLATION

STEP LADDER INSTRUCTIONS

rl DEVICE DETAILS

APPLIED INSTRUCTION

SPECIAL DEVICE AND INSTRUCTION LISTS

USING SPECIAL UNITS EFFECTIVELY


i

APPENDIX
2. BASIC SEQUENCE INSTRUCTIONS

2.1 RELAYS AND TIMERS

2.1.1 OUTLINE OF MAJOR DEVICES


The table belowshows that a large number of relays, timers, and counters are built into a programmable
controller, each with an unlimited number of normally-open and normally-closed contacts. The
sequence circuits define the connections between these contacts and coils.
The signals are transferred in the directions shown by the arrows.
2. BASIC SEQUENCE INSTRUCTIONS

RELAYS AND TIMERS


(1) INPUT AND OUTPUT RELAYS
For the base unit, I10 numbers are assigned in octal numbers (XO to X7, X I 0 to X17, ..., YO to Y7,
YlO to Y17, ,..I. Decimal numbers are used for all other devices.
For extension units and extension blocks, numbers consecutive with those assigned to the base
unit are used.
I n p u t XO to X7, ~ 1 to0 X17, X20 to X27, X30 to X37, Y30 to ~ 3 3

assigned consecutively from the


unitlblock closetst to the base
unit.

Output YO to Y7, Y10 to Y17,'Y20 to Y27, X40 to X47, Y34 to Y37


-
<

(2) AUXILIARY RELAYS

500 auxiliary relay points (MOto M499) are provided for general use. These are sometimes called
internal relays.
524 points (M500 to M1023) are backed up by the battery. These points are called latch relays
because their operation status is retained when power is lost.

The state relays are used for step ladder instructions. They are explained in detail in Section 3.
They can be used as general auxiliary relays or latch relays when step ladder instructions are not
used. Other relays, called annunciators, are also used.
SO to S499 : For general use
S500 to S899 : For latch relays
2 ,

S900 to's999 : For a'nnunciator . .

(4) TIMERS
TO to TI99 : Can be set in the range of 0.1 to 3,276.7 sec in units of 0.1 sec.
T200 to T245 : Can be set in the range of 0.01 to 327.67 sec in units of 0.01 sec.
In addition to these- timer relays, retentive timers (10 pointsj, which can hold its operation
immediately before a power failure, are also available.
(5) - COUNTERS .
CO to C99 : Up counters operating in the range of 1 to 32,767.
ClOO to C199 : Up counters that store the operation immediately before a power failure.
-Reversible (up/down) counters operating in the range of -2,147,483,648 to + 2,147,483,647 are
_also available (37 points + high speed counters).
In addition to the timers, counters, and relays outlined above, data registers D which can handle
numerical~valuesare available. Data registers are explained in detail in Section 4.
2. BASIC SEQUENCE INSTRUCTIONS

2.2 LOGICAL LOAD AND O U T COILS

0 LD X 0 connection to b"s tine

1 OUT Y
2 LDI X
3 OUT
4
I--
OUT
SP
M LOO
T 0
K 19
-
-
Drive instruction

Timer drive instruction

Constant setting

/
Bus line
7 L D
8 OUT
,
,
T.
Y
. .
0
1
L Program steps are m a n a g e d automatically
(SP : space key)

* All of the timers used by FX Series PCs are incremental timers. For details,
see Section 4.6.1.
(1) DESCRIPTION
LD and LDI instructions are used'for contacts connected to the bus line.
They are also combined with an ANB instruction (explained later) to start a ladder rung
(circuit).
OUT instructions are coil drive instructions for output relays, auxiliary relays, state, timers,
and counters. They are not usedhtwi input relays.
Parallel OUT instructions can be used repeatedly (OUT TO and OUT MlOO in the program
above).
(2) TIMER AND COUNTER PROGRAM
Constant K must be set for the timer and counter coil OUT instructions.
The setting range of constant K, the actual timer setting and the number of program steps
(including the setting) for the OUT instruction are shown in the table below.

: 1 to 32,767 . 0.01 to 327.67 sac. t 3 . .


0 . 1 to 3,276.7 sec.

-2,147,483,648 to
+ 2,147,483,647
I
For program examples using counters and retentive timers, see Section 2.10.1.

-36-
2. BASIC SEQUENCE INSTRUCTIONS

LOGICAL LOAD AND O U T COILS


(3) DOUBLE-COIL DESIGNATION

lnput processing This is howthe coil operates when the same


X1 = ON, X2 = OFF coil is used for more than once. The pro-
' gram example to the left uses output Y3
1st twice. The operation of Y 3 is explained
X1 1 belowassuming that inputs X I = ON and X2
II = OFF.
The first Y3 is turned on because X I is ON.
Its image memory is turned on and output
Y3 Y 4 is turned on accordingly.
II
However, the second Y3 is turned off be-
cause input X2 is OFF. The image memory
2nd
of Y3 is rewritten to OFF.
X2 1 Therefore, the final outputs are Y3 = OFF
1 I
and Y4 = ON.

Output processing
Y3 = OFF, Y 4 = O N
I

In double-coil designation, the coil operation designated last is effective. For details of operation
processing, see Section 4.1.2.

INPUT PULSES OF SHORT DURATION CANNOT BE RECOGNIZED

OFF ON
This input O N

I
'

- This input
ON state is
recognized

ON OFF
This input OFF state is
not recognized

1
. -
Program Program Program Program
processing processing processing processing

Cycle time
Input processing Time
Output processing

The 'ON dr OFF &ration of the PC inputs must be longer than the operation cycle time of the PC.
Taking-the 10 msec input filter response delay into consideration,
-- .
the ON and OFF duration must
be longer than 20 msec if operation cycle time is 10 msec.
Therefore, input pulses of more than 25 Hz [1000/(20 + 20)l cannot be handled. There are
applied instructions provided to handle such input pulses.
2. BASIC SEQUENCE INSTRUCTIONS

23 SERIAL CONTACTS

Serial connection o f NO
AND.(And'. . contacts : . X,Y,M,~.T,C.' 1
. .
. . ..
I

(And ,,nve;sb, Se'rial connection of NC


contacts b l y O (- X, Y, M, S, T, C 1

. .>t -*
O L D
1
2
AND
OUT
X
X
Y
2
0
3
- Serial contact

3 L D Y 3
4 ANI - -X 3- Serial contact

5 OUT M 101
6 AND T 1 -Serial contact

7 OUT Y 4- Continuous OUT

(1) DESCRIPTION
The AND and AN1 instructions are used for the serial connection of a contact. Contacts can
be connected in series as many as required.
The output processing to a coil through a contact after writing the OUT instruction is called a
followon output (OUT Y4 in the program example above).
Followon outputs are permitted repeatedly as long as output order is correct.
Cautions : - -

x3
-
Ti

z
~4
As shown in the example above, Y4 can be
driven through contact Y1 after driving M101.
However, if the drive order should be reversed
as in the program shown to the left, it is neces-
Mi01 sary to use an MPS instruction.-
r7t!r,-li-
Although there are no limitations on the number of contacts that can be connected in series
or followon output repetitions, the programming panel screen or printer will not be able to
display or print the program if it exceeds the limit of the hardware.
It is recommended that each line contain up to 10 contacts and 1 coil and that the number of
lines for continuous outputs is a maximum of 24 lines.
2. BASIC SEQUENCE INSTRUCTIONS

2.4 PARALLEL CONTACTS

Parallel connection of 1
O R (Or) X, l.M, ,S. T. C
NO contacts

Parallel connection of 1
OR1 (Or Inverse) X. Y. M, S, T. C
NC contacts

0 LD
1 OR ' X
Parallel
connection

Parallel
3 OR . M 103 connection
7 AN1 X 10
' 3 OR Mi10
3 OUT M I03

(1) DESCRIPTION
The OR and OR1 instructions &e used for parallel connection of a 'contact.
To con"ect a dircuit block that contains more than one contact connected in series to another
circuit block in parallel, use an ORB instruction.
The OR or OR1 instruction connects the step to the preceding LD or LDI step in parallel.
- .
Although there are no limitations on the number. of parallel connections, the programming
panel screen or printer will not be able' to display or print the program if it exceeds the limit
of the'hardware (maximum 24 lines).
Cautions :
The parallel connection using the
OR or OR1 instruction connects the
step to the preceding LD or LDI
point. After an ANB instruction is
designated, parallel connection is
made to the LD or LDI point which
is given following the ANB instruc-

kEC?c-l
tion.

Parallel connection point


2. BASIC SEQUENCE INSTRUCTIONS

2.5 PARALLEL CONNECTION OF SERIAL CIRCUIT BLOCKS

2.5.1 ORB
Fomet and Dsvbs s

Parallel connection of
ORB (Or Block,
serial circuit blocks
Device: None .

Recommended Program Program Not Recommended

O L D X 0
1 AND X 1 I AND X 1
2 L D X 2 2 LD X. 2
3 AND X 3 3 AND X 3
a 4 ORB - 4 LDI X 4
5 L D I X 4 5 AND X 5

1
6 AND
7 ORB
8 OUT
X

Y
5

6
- 6 ORB
7
8
ORB
OUT Y 6
C-

-
Serial circuit block

(1) DESCRIPTION
Circuits in which more than one contact is connected in series are called serial circuit blocks.
To connect the serial circuit blocks in parallel, use an LD or LDI instruction at the beginning
of a branch and an ORB instruction at the end of a branch.
An ORB instruction is an independent instruction and is not associated with any device
number.
Cautions :
There is no limitation to the number of parallel circuits
'
when an ORB instr"ction is used for
each circuit block (recommended program).
ORB instructions can be used in batch. When using ORB instructions in batch, be sure not
to use more than 8 LD or LDI instructions (program error results if attempted).
2. BASIC SEQUENCE INSTRUCTIONS

2.6 SERIAL CONNECTION OF PARALLEL CIRCUIT BLOCKS

2.6.1 ANB

Serial connection of
(And Block, . ~ e v i c e : one 1
parallel circuit blocks

0 LD
I OR
2 LO Branch start point
2T
3 AND
4 LO1
5 AND
6 ORB Parallel block complete
3-
7 OR
8 AN6
9 OR
6

3
- Serial connection to preceding
circuit

10 OUT 7
OR after AN0

ANB and LD, OR

(1) DESCRIPTION
Use an ANB instruction to connect the branch circuit (parallel circuit block) to the preceding
circuit in series.
. To declare the starting point of the branch, use an LD or LDI instruction. After completing a
parallel circuit block, connect it to the preceding block in series using an ANB instruction.
The ANB instruction can be used as many times as necessary to connect a number of parallel
circuit blocks to the preceding block in series.
It is possible to use ANB instructions in batches. However, the maximum allowable of use (8
times) of LD and LDI instructions'must be taken into consideration as with the case of an ORB
instruction.
2. BASIC SEQUENCE INSTRUCTIONS

2.7 MULTIPLE OUTPUT CIRCUITS


2.7.1 MPSIMRDIMPP

rT-3 1 1
M P S (Push) Push dew" stack
M R D (Read) Read from stack HAD

M P P (Pop) Pop u p stack WP + ,

This group of instructions allow points in the circuit to be stored so that circuit connections can be
made later. ,
I

The PC has 11 memory areas, called a stack, where operation results are temporarily, stored.
When an MPS instruction is executed, the result of the operation
obtained at this time is stored in the first stage of the stack. Execute
',/'
an MPS instruction again and the latest operation result is stored in
the first stage of the stack. The previously stored data in the stack is
shifted to the second stage.
The data at the first stage dictates where the next device is to be
- . , ,
connected from in the ladder circuit.
An MPP instruction shifts the data in the stack to the upper stage.
Data in the first stage is read and lost.
An MRD instruction is used to read the latest stack data. With this
instruction, data does not shift in the stack.
The MPS, MRD, and MPP instructions does not have any PC devices
associated with them.

(1) SIMPLE CIRCUIT EXAMPLE (1-STAGE STACK) ' ''0' L D X 0..


AND
MPS In this program ex-
ample, o n l y the
AND first stage stack is
OUT used.
MPP
OUT
LO
WS
AND
OUT
MPP
I MPS I \ 12AND X 5
1
21 MRD
Xi0 15 MPS 22 AND X I1
16 AND X 7 23 OUT Y 6
X iI 17 OUT Y 4 24 MPP
/' 18 MRD 25 AND X 12
MAD 25 OUT Y 7
19 AND X 10
f 20 OUT Y 5
MPP I
2. BASIC SEQUENCE INSTRUCTIONS

MULTIPLE OUTPUT CIRCUITS


1-STAGE STACK WITH ANB AND ORB INSTRUCTIONS

WS . 1 13 OUT Y. 1
14 'MPP - .
OR X 2 .I5 AND X 7
/ AN0 1 6 OUT
I
Y 2
OUT Y 0 1 7 LD . X 10
MRD - 1 8 OR X 11
LD. x 3 1 9 AN8
/ri/ '
AND X 4 1 20 OUT Y 3
MPP

(3) 2-STAGE STACK


LD
MPS 10 AND X 4
AND 11 MPS,
MPS 1 2 AND X 5
AND 1 3 OUT' Y 2
OUT 1 4 MPP
MPP 15 AND X 6
AND 16OUT Y 3
OUT
I
4-STAGE STACK
MPSMPSMPSMPS ".
0 LO X ' O
1 MPS
2 AND X 1 11 OUT Y 1

.- MPP 3 MPS . 12, &P


4 AND X 2 13OUT Y 2
MPP 5MPS , - ?
1 , 1 4 MPP ,

6 AND X 3-
P'
MPP a 7 MPS
8 AND X
MPP , (

Note: Atanyprogrammingstep,thedifferencebetweenthenumbersofMPSandMPPinstructions
must 11 or less. These numbers must agree with each other within a program.
2. BASIC SEQUENCE INSTRUCTIONS

2.8 C O M M O N SERIAL CONTACTS

MC (Master Denotes the start o f the


Control) M C control b l o c k I ly.~H
T Special M relays are n o t allowed.
N : Nesting
MCR (Master Denotes the e n d ' o f t h e
Control Reset) M C control b l o c k ~-~HcAI N ]
' .
-----
T O L D X 0
An M C i s a 3-step

I
4 L D X 1
--------- 5 OUT Y 0
X i 6 L D X 2
7 OUT Y 1
8 MCR N
-x2 0- An MCR i s a 2-step
instruction
The nesting level f o r N i s 0 t o T.
, , SP i s the s y m b o l for the space k e y o n t h e
p r o g r a m m i n g panel.
Special relays c a n n o t b e u s e d as o b j e c t
{KRI NO k devices f o r M.
N : Nesting level ( 0 to 7)
SP : Space k e y
(1) DESCRIPTION
lnput X : ON
All instructions between MC and MCR are executed.
lnput X : OFF
Present status is retained for :
- Retentive timers, counters, and devices driven by SETIRST instructions
Devices turned OFF are : I

- Timers and devices driven by.OUT instruction.


After the execution of an MC instruction, the bus line (LD, LDI point) shifts to a point after the
MC instruction. An MCR instruction returns this to the original bus line. After the MC
instruction is designated, it is necessary to write an MCR NO instruction.
An MC instruction can be used as many times as necessary by changing device numbers Y
and M. If the same device number is used, it is processed as a double-coil designation as
explained in Section 2.2 ( 4 ) . -
To use an MC instruction bile a previous MC instruction is active, increase the nesting level
number (N).8 i.

The nesting level can be decreased by designating an MCR instruction.


2. BASIC SEQUENCE INSTRUCTIONS

COMMON SERIAL CONTACTS


(2) NESTING LEVEL

Level NO
Bus line ( B ) becomes active when XO is ON.

Level N1
Bus line (C) becomes active when both XO
and X2 are ON. ,

Level N 2 ,
Bus line ( D l becomes active when all o f XO,
=,-and X4 are ON.

I _
Level N1
With MCR N 2 executed, bus line (C) is res-
tored.

Level NO
With MCR N 1 executed, bus line (B) is res-
tored.

Initial state
With MCR NOexecuted, the initial bus line (A)
is restored.
Output Y5 is turned ONIOFF according to
ONIOFF state o f X I 0 and regardless of
ONIOFF state o f XO, X2, and X4.
2. BASIC SEQUENCE INSTRUCTIONS

2.9 RETAINING AND RESETTING OPERATION STATUS

SET (Set) Setting a device ON /*:-I SET. I Y. '. M. S H *


Y, M :, 1
. .

I
. . S, Special M: 2

Resetting a device to
RST (Reset) OFF.
Clearing registers
I-::-[. RST (Y. M. S. D. V. ZH D. V, Z.
Special D : 3

3 RST Y 0
4 L D X 2
5 SET M 0,
6 LD X 3'
RST
7 W P M 0
. x 4

pp+=-, "'11
9 SET

12 RST
S

S
0:'
5
0

15 RST D 0

( 1 ) DESCRIPTION
Once XO is turned ON, YO operates and remains ON even after XOis turned OFF.
Once X I is turned ON, YO turns OFF and remains in "non-operating" status even after X I is
turned OFF.
These are also true for M and S.
SET ai-id 'RST instructions can be used for the same device as many times as necessary.
Although they can be used in any order, the instruction executed last is effective.
The RST instruction can be used to reset the data in data register D and index registers Vand
Z to "On. The same effect is obtained by using the constant KO transfer instruction.
2. BASIC SEQUENCE INSTRUCTIONS

2.10 COUNTERS AND TIMERS

(1) RETENTIVE TIMERS ( 1 msec TIMERS, 100 rnsec


TIMERS)
I ^ '

X1 K 1234 T246 counts 1 msec clock pulses while input X I is ON.


t YO operates when the count data reaches 1,234.
1245 Turning XO ON resets output contact T246 and the timer
current value to "0".
(2) NORMAL 32-BIT COUNTERS (SEE SECTION 4.7.1)
X2
Ma200
The 32-bit counter C200 counts (up-count, down-count)
X3
1 -
m \ according to the ONIOFF state of M8200 (counts the
number of OFF -. ON times of X4).
The output contact is set or reset depending on the
direction of count upon reaching the setting according
to D l DO contents.
/ The output contact is reset and the current value of the
counter is reset to "On when input X3 is turned ON.
II 1 (3) HIGH-SPEED COUNTERS (SEE SECTION 4.7.2)
Counting direction '
The I-phase, I-input counters (C235 to C245) are
used in combination with special auxiliary relays
(M8235 to M8245) which designate the counting
I I direction. . -
Sequence reset circuit
Count down when X I 0 is ON
Count up when X I 0 is OFF
The output contact of counter CAAA is reset and the
current value of the counter is reset to "0" when XI 1
is turned ON.
Counters (C241, C242, ... C255)htwi a reset input
operate similarly .hthout requiring any further
programming when the corresponding reset
Counting coil input is turned ON.
- .
When X I 2 is turned ON, ONIOFF of the correspond-
ing counter input (XO to X5) is counted.
I r
KorD ' With co""ters (C244, C245, C249, C250, C254,
- I
C255), counting does not start unless the cor-
responding start input is turned ON.
The output'contact is set when the counter value
increases to the setting (K or D data). It is reset
when the counter value decreases to that setting.
2. BASIC SEQUENCE INSTRUCTIONS

2.11 PULSE O U T P U T

g edge triggered

0 LO
1 PLS
3 L D
X
M
M
0 .
0
0
- 2-step instruction

4 SET Y 0
5 L D
6 PLF
E L 0
X
M
M
1
1
1
- 2-step instruction

9 RST Y 0 -

(1) DESCRIPTION
*' When.a PLS instruction is executed, object devices Y and M operate one operation cycle after
the drive'input signal has turned ON.
When a PLF instruction is executed, object devices Y and M operate one operation cycle after
the drive input signal has turned OFF.' .
Special relays cannot be object devices of PLS or PLF.
When the PC status is changed from RUN to STOP to RUN with the input signal ON, PLS MO
is operated while for example, PLS M600 (backed up by the battery) is not operated. This is
because M600 is a retainable relay and its operation is retained as when the PC was in the
"STOP state.
2. BASIC SEQUENCE INSTRUCTIONS

2.12 N O PROCESSING INSTRUCTION

2.12.1 NOP

NOP (NOP) No operation. ! . Device;


. .
None' 1

. CHANGING CIRCUITS USING NOP INSTRUCTION

ANO-NOP ANI-NOP
(a) Shorting contacts (bl Shorting entire preceding circuit
(This may cause circuit error)

OUT-NO?

ORB -NOP

(c) Cutting circuits ( d l Cutting an entire preceding circuit


(This may cause circuit error)

(el Connecting to preceding OUT instruction


. .

(1) DESCRIPTION
Writing NOP instructions in the middle of a program minimizes step number changes when
changing or editing a program.
It is also possible to change a circuit by replacing programmed instructions with NOP
instructions.
changing an LD, LDI, AN,B, or ORB instruction into an NOP instruction changes the circuit
considerably.
After the program all clear operation is executed, all of the instructions in the program are
over-writtenhtw
i NOPS.
- ..
2. BASIC SEQUENCE INSTRUCTIONS

2.13 P R O G R A M END

2.13.1 END

END (End)
Inputloutput p,rocessing
end retuining'to step 0
Device: None
I
The PC repeats the execution of input processing, program, and
output processing. By writing an END instruction, the steps after
the END instruction are skipped and output processing is executed
Step directly.
Inserting END instructions in the middle of the program'helps
program debugging as the section after the END instruction is
'disabled and isolated from the area that is being checked. Delete
the -END instructions from the blocks which have already been
checked.
The watchdog timer is refreshed when the END instruction is ex-
ecuted.

...
PROGRAMMING TIP
GENERAL HARDWARE. AND INSTALLATION

I BASIC, SEQUENCE INSTRUCTIONS I

1 SPECIAL DEVICE AND INSTRUCTION LISTS I


USING SPECIAL UNITS EFFECTIVELY I
3. STEP LADDER INSTRUCTIONS

3.1 H O W TO R E A D SEQUENTIAL FUNCTION CHARTS

3.1.1 STATE FUNCTIONS


Writing a relay ladder sequence for sequential process control requires some expertise. Also the
completed sequence can be difficult to read.
However, when machine operation is expressed using a sequence chart (called a Sequential
Function Chart), programming is made much simpler.
A device (called "state")is the important element in making a Sequential Function Chart. A total of
90.0 points of state in the range of SO to S899 are used with SOto S19 assigned for reserved functions,
(which will be explained in a later section). For example, SO to S9 are called initial states and are
used as the head states of the sequential function chart.

Driven b y OUT

U s e SET for the outpu


to b e retained

(2) The operation


state changes from
S30 to S31 if X20 is
turned ON (even
momentarily).
(11 Outputs Y 10 and Y 1 1 operate (3) State transfer is operated
nhen state S30 operates. The from S30 to S31, causing Y 10
program is waiting for the opera- to stop operating and Y12 to
tion of transfer condition X20. start operating.
Y 11 continues to operate be-
cause it is driven by the SET
instruction.

Note: Transfer conditions often take the form of a single contact, however, in actual fact, a
combination of X Y, M, S, T, C devices are possible in the form of parallel or serial
connections.
For output loads (Y, M, S, T, CI and applied instructions driven b y the states, it is possible
to have these connected in various forms of series and parallel combinations.
3. STEP LADDER INSTRUCTIONS

H O W TO READ SEQUENTIAL FUNCTION CHARTS


-
3.1.2 SINGLE FLOW

x4 -
A
Y4
Righttraverse x3
Left traverse
Downward
TO make the explanation of function charts
simple, a pick-and-place operation, moving a
workpiece from point A to point B with the robot

L--#
?x2
y2 11
motion
YO
XI
hand as shown on the left, is used as an example.
A double-solenoid valve is used for rightlleft
traverse and u p l d o w n motion with a single

f
-- --.
- clamp
Unclamp
y1
solenoid valve used for clamp operation. The
double-solenoid valve holds an actuator at the
actuated position even after the signal for the
Workpieqe, actuator motion has turned off. The workpiece is
clamped only while the solenoid is energized.
r I point ~1
( 1) MANUAL OPERATION
-----
Zero return
This is for example the manual
1 operation required to return the
robot hand to the initial position
before starting the automatic se-
quence.
State S5 is driven by special
auxiliary relay M8002, which is
pulsed on when the PC operation
status is changed from STOP to
---
1) Pressing start button X26 after manually locating the
robot hand to the intial position changes the operation
state from S5 to S20. The downward motion solenoid
valve output YO is turned on. Lower limit LS X I is turned
on when the hand reaches the lower limit position.
2) The operation state changes from S20 to S21 and the
downward motion output YO is turned off. After that,
clamp output Y1 is set.
3) Timer TO operates one second later to change the state
to S22 which turns on upward motion output Y2. Upper
limit LS X2 is turned on when the robot hand reaches
the upper limit.
41 At state S23, the right traverse output Y3 is turned on.
Right traverse limit LS X3 is turned on when the robot
hand reaches the right traverse limit.
5) At state S24, downward motion output YO is turned on
again. Lower end limit LS X I is turned on when the
robot hand reaches the lower limit, changing the state
from S24 to S25.
6) Clamp output Y1, which has been set, is reset.
7) One second after the clamp output is reset, the state
I (8) Left changes to S26, turning on the upward motion output
traverse
Y2.
I ~4 f- Left traverse end
8) When Upper limit LS X2 is turned on, the operation state
changes to S27 and lefttraverse outputY4 is turned on.
As left traverse limit LS X4 is-turned on, the operation
state returns to S5,on
w
glial the next cycle to start.
3. STEP LADDER INSTRUCTIONS

HOW TO READ SEQUENTIAL FUNCTION CHARTS

3.1.3 SELECTIVE BRANCH AND MERGE EXAMPLE


The following illustration shoM an example of h o w t o sort large and small balls with a conveyor.
With the initial position set atthe'"pper left pointlthe sorting cycle is executed in the following order:
dowhward motion, ball hold, upward motion, right traverse, downward motion, release, upward
motion, and left t7averse. Large balls and small balls are recognized b y the activation of lower
end position LS2 switch (OFF for large balls and ON for small balls).
Zero-point indication I

e
X4 X5

RightY3
Lefty4 LS3 Upper limit
6
- -
'8 .
9 .

The piston does not reach the lower end when a large
Downward motion YO ball is attracted, thus X2 not activated.
X2
LS2 Lower limit
I

Magnet

Proximity
switch
PSO container container
1 I
XO

I SELECTIVE BRANCHES AND MERGES

..
I
S20 Branch state
The process of selecting a single flowfrom mul-
tiple flows is called a selective branch.
-- XO --Xi0 . ' As this is a selective branch example, XO, X10,
1~21 ~ 3 1 1 and X20 must not be turned on s'imultaneously.
Xi Xi1 When XO is turned ON while S20 is operating,
the operation state changes to S21, and S20
IS22 15321 stops operating. *

-- X 2 xi2 -- X22 If X I 0 or X20 is turned ON after this state trans- '


fer, X31 or X41 is not turned ON.

0S50 Merge state


The merge state S50 is activated by S22, S32,
or S42.
3. STEP LADDER INSTRUCTIONS

HOW TO READ SEQUENTIAL FUNCTION CHARTS


The Sequential Function Chart for the sorting process is illustrated below.

Manual operation In this example, initial position return opera-


sequence
tion is executed manually. The procedure to
1 j- execute initial position return automatically

lT-g
x12 Start is explained in a later section.
Y7 + Zero position ( U p p e r limit, left traverse limit, un-
clamp)

w
:d
ar mo-

w
Indicates NC contact of
TO -- X2
X2 4 Lower limit (Small Lower limit not reached (Large ball)

K10

UP-
Upward ward
motion
The flow is selected ac-
c o r d i n g t o b a l l size
(large or small); leftflow
Right
for small ball (X2=ON)
traverse and right flow for large
ball (X2=OFF).
X4 -f Right (Small ball con- X5 Right (Large ball container)

9-a
X2
tainer)

Lower limit
-;ward m-
e The operation state changes to S30when X4
(small ball) or X5 (large ball) is turned ON.

The special auxiliary relay M8040 disables


state transfer if it is turned on. For S24, S27
and S33, appropriate interlock contacts are
connected in series to the right traverse out-
put Y3 and the left traverse output Y4.
The sequence shown on the left is an ex-
ample of how to execute a one cycle se-
quence by pressing the start button X12.
X1 t Left traverse limit
Automatic continuous operation and step-
by-step operation is explained in a later sec-
tion.
3. STEP LADDER INSTRUCTIONS

HOW TO READ SEQUENTIAL FUNCTION CHARTS

3.1.4 PARALLEL BRANCH AND MERGE EXAMPLE


Parallel branches are necessary in cases where for example, individual components A, B and C are
processed independently and are then assembled together.
This parallel branch format is applicable also to the sequential operation of signals in the example
case shown below.

Y2 : Green : Red
Y1 : Yellow : Green
I

YO : Red

A Parallel branch is a sequence in which multiple


branches of flow proceed simultaneously.
In the figure shown on the left, XO is turned on
when S20 is operating. S21, S24 and S27 start
operating simultaneously, initiating the operation
flow of each branch.
When X7 is turned on only after the operation of
all the branch flows have finished. Merge state
S30 starts operating. All the states S23, S26 and
S29 are disabled.
A MERGE of this kind is sometimes referred to as
a queuing MERGE.

&'
~ 3 0MERGE state
3. STEP LADDER INSTRUCTIONS

H O W TO READ SEQUENTIAL FUNCTION CHARTS


The Sequential Function Chart for a crosswalk signal is illustrated below. in this example, parallel
flow is repeated with the green light of the pedestrian flashing being created in the form of a loop.
, .
When the PC status chan-
ges from STOP to RUN, the
f .. initial state SO operates to
Traffic signal : Green
light the green traffic signal
and the red crosswalk sig-
Crosswalk signal :'Red rial. (via M8002)
xo -- --XI When crosswalk switch XO
- Crosswalk switch or X1 is pressed, the state
c h a n g e s to S21 (traffic)
I a n d S30 (crosswalk). In
Crosswalk
these states, the light state
Green signal : Red remains uncha,nged (green
for the traffic signal and red
for the crosswalk signal).
. After 3 0 seconds, the yel-
Crosswalk
signal : Green l o w traffic s i g n a l lights.
The red traffic signal lights
K150 10 seconds later.
When the red traffic signal
lights, timer T 2 begins
operating. The green
crosswalk signal lights
after timer T2 counts 5
Crosswalk seconds.
signal : Green
;I 5 seconds later, the green
crosswalk signal begins to
flash 1S32 = OFF, S33 =
ON).. .

While the green crosswalk


Contact CO is activated at - signal flashes, states S32
the fifth counting. and S33 repeat operation.
S32 The state changes to S34
when counter CO (setting =
Crosswalk 5) operates, lighting the
signal : Red
red crosswalk signal. The
state then changes to the
initial state (SO) 5 seconds
after the red crosswalk sig-
nal lights.
Crosswalk switches XO and
X I are inoperative once the
-operation h a s started to
flow.
3. STEP LADDER INSTRUCTIONS

3.2 PROGRAMMING

3.2.1 STATE PROGRAM EXAMPLE


Illustration ( a ) shows an example of a state program. Each state consists of some loads transfer
destinations,'and transfer conditions.
a ..
1ll"stration ib)- shows a step ladder in which the sequential function chart is expressed in relay
sequence chart.form..
It is'p'ossible td write a program using either a sequential function chart or a steb ladder chart. In
either case, the program should be written in the order of load drive processing then state transfer
processing.

S20

.-.
-
xo XI1
X1

S2 1 xo

Sub b u s line
I ,
(a) Sequential function (b) Step ladder chart

0 STL S20
The program for the sequence function chart or step ladder
. chart is shown on the left.
3 OR . Xi1
An STL instruction is the NO contact instruction connected
4. OUT Y l i
to the main bus line. A coil can be connected directly to the
5 LD. X O

-
sub-bus line created by the STL contact or it can be driven
6 AN1 ,X 1
through some contacts. , .
1 7 SET S21
Use the LD (LDI) instruction for the contact connected to the
sub-bus line. Use a RET instruction to return the sub-busline
T h e S E T or R S T
instruction for: a state to the main bus line. If a state S is driven through the STL
contact, the state of that STL contact is reset automatically.
. . .
isa 2-step instruction.
,

., .
Sequential function charts and step ladder charts are two representations of the same program.
Their advantage is that they allowthe user easy programming by isolating one state from another so
that the user only have to consider the circuits of only one state at one time. The order of the states
is not important. However, do not forget to write a RET instruction at the end of a program when
using STL instructions.'
Note: ' An M C instruction cannot be used in the STL circuit.
An MPS instruction cannot be used immediately after the STL contact.
3. STEP LADDER INSTRUCTIONS

PROGRAMMING
3.2.2 INITIAL STATE PROGRAMMING

The state at the head of a sequential function chart is called


an initial state. States SO to S9 are used as initial states.
' An initial state is driven by another state (S23 in this case).
However, at the beginning of operation, the initial state should
be driven by different means.
In this example,-the initial state is first driven b y the special
auxiliary relay M8002 which operates momentarily when the PC
status is changed from STOP to RUN.
A state other than an initial state must be driven b y other state
using an STL instruction. These states can be driven only by
. state elements.
When the initial state must be programmed
before any other states in the sequence.

Use S E T

drive of ~ n ~ a a l
' 1
, MEMO %
\
If states S500 to S899 are used, the status of the
sequence is backed up by the battery. This al-
lows the machine to be restarted with these
states when power supply is restored fromfailure.
5 SET S 20
In such a case, re-consider the way the initial
state is driven. Better ways of driving the initial
State s20 state are shown at the later pages.
9 LD X 1 1
1

Use the RET instruction always at the end of a


10 SET S 21
series of STL instructions, as shown on the left.
If the R E T instruction is not given, the PC.regards
State s21 the LD instruction of step 0 as a connection0 to
14LD X 2 - the sub-bus of STL S23 in its cyclic operation and
15 SET , S 22 will cause a malfunction. (Actually, a program
(error occurs and the operation is disabled.)
\ J
19LD X 3
20 SET S 23

-
24LD X' 4

( S e e Section 3.2.6)
27 RET
28 END
1
Use R E T a t the end o / a series o f STL instructions
3. STEP LADDER INSTRUCTIONS

PROGRAMMING

3.2.3 SELECTIVE BRANCH AND MERGE PROGRAMMING


( 1 ) SELECTIVE BRANCH PROGRAMMING
,
STL S20
OUT Y 0 - Drive processing
LO X 0
SET S21 - Transfer to the 1st branch state
LD X 1
SET S31 - Transfer to the 2nd branch state
LD X 2
SET S41 - Transfer to the 3rd branch state

As in the general case, the! state drives a load before setting the transfer conditions. It is
necessary to program the setting of the states in the order of leftto right as shown in the function
chart.
( 2 ) MERGE STATE PROGRAM

In branchlmerge transfer
programming, do not use MPS,
-- X i 0 --XI2 MRD, MPP, ANB, or ORB
instructions.
S50

STL S 29 L
-
OUT Y 10
Output processes
STL
LD
SET
29
X 70
S 50
] Merge transfer from the 1st
branch flow

STL
OUT
S 39
Y11 *
- Output processes
.
STL
L.
SET
39
XI1
S 50
] Merge transfer from the 2nd
branch f l o w '

STL S49
Merge transfer from the 3rd
STL * S 49. branch flow '
OUT Y 12 - Output processes

Program the output processes for each state before merging. After that, it is necessary to
program the merge transfer processes sequentially from left to right.
This rule is added to allowthe SFC screen to be created automatically.
3. STEP LADDER INSTRUCTIONS

PROGRAMMING

3.2.4 PARALLEL BRANCH AND MERGE PROGRAMMING


(1) PARALLEL BRANCH PROGRAMMING

STL S20
OUT Y 0 - Drive processing
LD X 0
SET S21 - Transfer to the 1st parallel branch state
SET S31 -Transfer to the 2nd parallel branch state
SET S41 - Transfer to the 3rd parallel branch state

As in the general case, the state drives a load before setting the transfer conditions. It is
necessary to program the setting of the states in the order of left to right as shown in the function
chart.
(2) MERGE STATE P R O G R A M

XI0 1
Program the output processes for
STL S29
each state before merging. After that,
it is necessary to program the merge OUT Y10 - Output processing
transfer processing sequentially from
left to right. 5
STL S39
S50 OUT Yii - Output processing

Ref.: The following programs are not permitted.


\
STL S49
OUT Y12 - Output processing

-- STL S29.

- STL
STL
LO
S39
SS9
XI0
Merge transfer
processing

The transfer conditions marked by an


asterisk Nil are not permitted. AND XI1
AND X12
SET S50

L STL instructions written consecutively


indicate a parallel merge. The STL
instruction can used eight times
consecutively.
3. STEP LADDER INSTRUCTIONS

PROGRAMMING

3.2.5 COMBINATION OF BRANCHES AND MERGES

Rewrite i n this way:


J3

Program i n this w a y .

STL
0 S 20 STL S 20 STL S 20 STL S 20
LO x 0) LO x 0 )
SET SIOO STL SET 5102 LO X 0
LO X 0 SET S103
SET SlOl STL S103
SET SIOO STL SlOi SET S102
STL S 40 LO S101
LO
SET
X 2)
SIOO
SET
SET
S 50
S 60
) STL

SET
S102

S 40
SET
LO
S 40
S103
STL SiOO, SET S 50
LO SIOO SET S 50
A m
SET x 5 30 )
S
LO
AND
SET
:lo:
S 60
) If processing continues directly from the branch line to the merge
line a state in between, write in a dummy state as shown
above.
S100 and S103 transfer contacts can be omitted.
3. STEP LADDER INSTRUCTIONS

PROGRAMMING

Program permitted
Q Program not permitted

0 Program in this way :

Branch transfer Merge transfer

STL S20 STL


LO X 0 STL
SET 521 LD
SET S23 SET
LO X 1 STL
SET 525 STL
Writing a selective branch condition DJO after
SET 527 LD
parallel branching or a parallel merge after
SET
transfer condition (X ) are not permitted. See
Reference in Section 3.2.4.
3. STEP LADDER INSTRUCTIONS

PROGRAMMING

3.2.6 JUMP AND REPEAT PROCESSES

)'@

OUT
Partial repeat Jump Jump to other program Reset processing

In addition to branching and merging (explained in previous sections), it is also possible to transfer to
a distant state (a state outside of normal consecutive flow).

(31TRANSFER TO A DISTANT STATE


For a transfer to a distant state, an OUT instruction is used instead of a SET
instruction.
S31 is set if S20 = ON and X2 = ON. S20 is then reset automatically. S31
is retained and will be reset when the state transfers to S32.

------------
I
S2I RST S 4 1 (2)RESETTING I
THE STATE I

I
I
I
1
S41 is reset if S 2 0 = O N
andX3=ON.
,
I

(11 MAIN FLOW I


I S 2 0 is not reset.
STL S20 I
LD X I I
OUT Y i

-
I
LO X 2 I
S31 I

-
OUT To discrete state
LD X 3 L - ,
RST S4 1 To discrete state RST
LD
SET
x'o
S21 --
. -
To the succeeding state

LO X c LO x 5
SET S41
3. STEP LADDER INSTRUCTIONS

PROGRAMMING
(1) LIMITS IN THE NUMBER OF BRANCHES

1 I r
1 branch : 8 or less circuits
C
For each initial state, the total
t
number of branch circuits should
(5) -- 6 be 16 or less with each branching
point having no more than 8
I 1 branches.
-- --
'-7
I
I I

L J
v
I n total : 16 or less circuits

Note: A State transfer from a merge line or a state before a merge to a distant state or a reset
process is not a110 wed. In such a case, always provide a dummy state to execute the state
transfer.
(2) SEPARATE FLOWS
If the sequential function chart contains more than one initial state, ensure the program instruc-
tions for one flow is grouped away from another flow.

For the example shown on the left, first program the


flow for the STL instructions for S20 to S39, which
belong to initial state S3. After that, program the flow
beginning with the initial state S4.
In these two separate flows, a state number of another
flow can be used when the instruction used is other
than STL. In this example, the "OUT S41" instruction is
contained in the S3 sequence flow.
3. STEP LADDER INSTRUCTIONS

3.3 STATE FUNCTION RULES

3.3.1 STL INSTRUCTION


+

a As an STL contact is turned on the circuit connected to this contact


operates.
When an STL contact is turned off, the circuit connected to this
contact stops operating. After one operation cycle to reset its load,
the circuit instructions are then jumped and no longer executed.
If the same output is designated in different states like in the
example, output Y2 operates if S21 or S22 is ON. Y2 stops operat-
ing when both S21 and S22 are OFF.
Although a double-coil may be designated with STL circuits, pay
careful attention to double-coil designation for circuits other than
STL.
Designation of the same, state is not permitted
Execution Non-
execution

During the state transfer process, both states will be ON momentari-


Forward rotation ly ( 1 operation cycle).
Therefore, if the state transfer is between opposing outputs that
cannot be ON simultaneously as shown on the left, it is necessary
to make an interlock so that these opposing outputs will not be ON
simultaneously.

. If the same timer is used in a program repeatedly, it cannot be


connected to the two succeeding states since the instructions will
interact and the timer may not be able to reset.
Two separated states can use the same timer.

To transfer the state sequentially with the same signal, the signal
should be a pulse signal. Connect the states as shown to the left.
- -- Just after S50 is operated with MO turned ON, M I opens to prevent
MI
MO -- Pulse signal the state from immediately changing to S51. At the next MO signal,
the state changes transfers to S51.

M7 --
MO --
3. STEP LADDER INSTRUCTIONS

STATE FUNCTION RULES

3.3.2 INSTRUCTIONS

An STL instruction is effective only when it is used with state S. The


following contact and coil instructions can be usedhtw i state S :
LDILDI, ANDIANI, ORIORI, OUT, SETIRST
In the circuit example s h o w on the left, S20 is not reset even after
S30 or S21 is driven b y S20. If S20 is turned off, S30 stops
operating. This is because S21 and S30 are driven directly without
I I
RST S22 1 using an STL instruction.
States can be used as general auxiliary relays when the program
does not use STL instructions at all.

OUT and SET instructions for state S have the same function if
designated for a state which is designated after an STL instruction.
Both of these instructions reset the transfer source automatically.

1I h
I I
1I They also have the retaining function against power downs.
An OUT instruction should be used for the transfer to a distant
state.

I 4-
An MPS instruction cannot be used just after an STL contact.

I Transfer t o distant state


I
f APPLICABLE SEQUENCE INSTRUCTIONS
\

The following table shows whether or not a specific instruction can be used in the steps between
STL instructions or between STL and RET instructions.

Cannot be used

Can be used

An STL instruction cannot be used in an interrupt program or a subroutine program


(explained in a later section).
Although a jump instruction can be used within STL instruction steps, it will make the
flow of processing complicated. It is, therefore, not recommended to use a jump
instruction with STL instruction steps.
\ J
3. STEP LADDER INSTRUCTIONS

3.4 OPERATION MODES


3.4.1 WHAT IS A N OPERATION MODE?
Machine operation modes are largely classified into manual and automatic, which are then further
classified into other modes. The illustration of the operation panel shown below takes these
operation modes into consideration.
The START and EMERGENCY STOP pushbutton switches are connected to the sequence outside
the PC to turn the power ON or OFF to the externally connected loads.

MANUAL I MANUAL
ZERO
: Power supply to individual loads is turned ONIOFF b y using the
separately provided pushbutton switches.
RETURN : In this mode, the actuators return to the initial position when
the ZERO pushbutton switch is pressed.
: The machine operates step-by-step each time the START push-
button switch is pressed.
ONE CYCLE : When the START pushbutton switch is pressed in this mode,
the actuators at the zero position initiate one automatic opera-
tion cycle. After the cycle is completed, the actuators stop at
the zero position. It is possible to stop machine operation
halfway by pressing the STOP pushbutton swtich. The cycle
will be continued when the START pushbutton switch is
pressed.
AUTOMATIC : Fully automatic operation is possible in this mode. The
programmed cycle is executed repeatedly when the START
pushbutton switch is pressed. The cycle will not stop immedi-
ately when the STOP pushbutton switch is pressed. Operation
only stops after the currently executed cycle is completed.
It is not necessary to provide pushbutton switches for each individual actuator in the manual
operation since individual force onloff's can be made with a programming panel.

OPERATION PANEL EXAMPLE

STEP X22
ZERO
ZERO RETURN

MANUAL AUTOMATIC START

LEFT UNCCAMP

X5 x7 START X 2 6
EMG STOP
DOWN RIGHT CLAMP

'@ @ @
XI0 XI1 X 12 STOP X 2 7 .

Pushbutton switches to turn the power ONIOFF to externally connected loads


3. STEP LADDER INSTRUCTIONS

OPERATION MODES
An applied instruction FNC6O (IST), explained in a later section (Section 5.8.1), automatically
reserves an initial state to each corresponding mode.
To use this applied instruction, it is necessary to assign numbers in a consecutive order to the input
signals to as shown below. If it is not possible to assign consecutive numbers, use auxiliary relays
to rearrange the input numbers and use them as the head input when setting FNC6O (ISTI.
X20 : Manual X24 : Automatic
A selector switch is used to select X20 to
X21 : Zero return X25 : Zero return start
X24 so that no more than one input is
X22 : Step X26 : Automatic operation start turned ON simultaneously,
X23 : Cycle X27 : Stop

RE-ARRANGEMENT EXAMPLES:

INPUTS f 013 AUTOMATlC APd

Example : Example : Example :


X30 : Manual X30 : Zero return X30 : Manual
X35 : Zero return X31 : Automatic X31 : Automatic
X33 : Step X32 : Automatic1 X32 : Automatic operation
X40 : Cycle zero return start start
X32 : Automatic X33 : Stop X33 : Stop
X34 : Zero return start
X26 : Automatic operation
start M8000 is a special auxiliary relay (RUN monitor) which
is normally ON when the PC is running.
'5
yr-@ Manual

qf-= zero return

2ff-@ Step

44;-a Cycle

qf-a Auto ma ti c

q; @:;return

Automatic
operation Zero return
start

In these examples, "Mowisused as the head input for the instruction FNC6O (IST).
3. STEP LADDER INSTRUCTIONS

OPERATION MODES

3.4.2 INITIAL STATE INSTRUCTION

If applied instruction FNC6O (IST instruction) is driven using the


F i x---
Irn IST X20 520 S29

(1) (2) (31


program shown on the left, the following initial states and the
corresponding special auxiliary relays will be assigned to the fol-
lowing functions automatically.

( 1 ) Head number of input


(2)Start of range of states used for automatic mode
(3) End of range of states used for automatic mode

SO : Initial state for manual mode


LD M8000
FNC 60 - 1 s t e ~ S1 : Initial state for zero return
X20 S2 : Initial state for automatic mode
2 step each M8040 : Transfer disabled
M8041 : Transfer start
M8042 : Start pulse

f INITIAL STATE OPERATIONS


\

lnitial states SO to S2, which operate automatically in response to an IST instruction, change as indi-
cated below according to the operation mode selection.
lnitial pulse while X21 is ON and X21
While X20 stays ON changes from OFF to ON.

o X21 during automatic

X22 to X24 turned ON after com-

Outputs (Y) are not reset if a special auxiliary relay M8045 is ON.

J
3. STEP LADDER INSTRUCTIONS

OPERATION MODES

The operation details of special


auxiliary relays M8040 to M8042 and
M8047 (all of which are automat-
ically operated b y the IST instruc-
tion) are shown in this equivalent
circuit.
When M8047 is driven, up t o eight
I
PLS M E 0 4 2 ]
Start pulse
state numbers of the states which
are currently operating among SO
and S899 are stored to D8040 to M8040
D8047 from the lowest number.
Transfer disabled

TRANSFER INHIBIT RELAY


(M8040)
Stop
When this auxiliary relay is actuated,
state transfer is inhibited.
Manual :M8040 is always ON.
Zero return, one cycle :
Once the stop pushbutton
I ME040 Retaining I
switch is pressed, its state STL monitor enabled
is retained. until the start
pushbutton is pressed.
One : M8040 is always ON. It is
Step turned OFF only when the
start pushbutton is pressed, enabling state transfer for one step of the flow.
Other :The ON state of M8040 is retained when the PC status is changed from STOP to RUN. It is
turned OFF when the start pushbutton is pressed.

TRANSFER START RELAY (M80411


This is an auxiliary relay used as a state transfer condition from the initial state S2 to another state.
Manual, zero return. :, This relay is not activated.
One step, one cycle : The relay is actuated only while the start pushbutton switch is held down.
Automatic : The relay ON state is retained when the start pushbutton switch is pressed.
It is turned OFF when the stop pushbutton switch is pressed.

START PULSE RELAY (M8042)


This relay is actuated momentarily when the start pushbutton switch is pressed.

Ref.: The special auxiliary relays Ma044 (zero position) and M8043 (zero return complete) should
be controlled by the user 3 circuits, such as initial circuit or zero re turn circuit, as shown
in Section 3.4.3.
The IST instruction executes the control in the range as described in the "Programming
Ep" in Section 3.4.3.
3. STEP LADDER INSTRUCTIONS

OPERATION MODES
3.4.3 WORKPIECE TRANSFER PROGRAM EXAMPLE
The illustration below shows the mechanical system that is used for pick-and-place control with a
robot hand.
With the zero point taken at the upper left traverse end position, a workpiece is carried from the left
table to the right table in the following operation sequence :
Downward motion - Clamp - Upward motion - Right traverse - Downward motion - Unclamp -
Upward motion - Left traverse
Double solenoid valves are used for uptdown and rightlleft traverse control, and a single-solenoid
valve is used for unclamp operation.

Start
traverse 1 i m i t ~ 4

(8) Left traverse


Y4

Zero point
d

(4) Right traverse YJ

( 1 ) Downward Right traverse limit X 3


motion
YO Upper X2
limit (5) Downward motion ( 7 ) Upward motion
(3) Upward motion Yo Y2
Y2

Lower limit Lower limit


X1 X1

(2) Clamp (6) Unclamp


Y 1 ON Y i OFF

Workpiece Transfer Mechanism

-
Operation Panel Example
>
- Right traverse
Left traverse

'IC START

-
UP
8
-- Clamp
Unclamp
Workpiece, -,
DOWN RIGHT CLAMP
ee69 t
3
EMG STOP

I Xi0 XI1 XI2 STOP X27


3. STEP LADDER INSTRUCTIONS

OPERATION M O D E S
INITIAL CIRCUIT AUTOMATIC OPERATION
Zero position condition

Initial state for automatic operation

Upper Unclamp
traverse limit
limit

MANUAL OPERATION
Clamp
X i 2 Clamp input
SET 1 YI 1

Right traverse

limit
ZERO RETURN

Initial state for zero return

Left traverse
Unclamp

Resetting "down" output

uP
Resetting "right SPECIAL AUXILIARY RELAY
traverse" output
M8044 (Zero-position condition)
Left traverse
This relay is driven b y each sensor at the zero posi-
tion. The ON state o f this relay is used as the state
transfer condition to automatic mode.
\
Zero return complete
M8043 (Zero-return complete)
For zero return operation, use states S 1 0 to S19. In
the final state, drive M8043 before resetting itself.

Note: The ISTinstruction must be programmed prior to the STL circui'ts.

All o u t ~ u t swill be turned OFFif a rotary switch is operated to change the mode (MO,
MI,
M2,XL3, or M4I before the zero return complete (M80431 relay is turned ON.
3. STEP LADDER INSTRUCTIONS

OPERATION MODES
PROGRAM EXAMPLE :
The following is the program for the Sequential Function Charts on the previous page.

0
i
2
LD
AND
AN1
32
33
34
STL
LD
SET
S
X
S
1
25
10
) 6 4 STL
6 5 SET
66 OUT
3 OUT 36 STL S 10
5 LD 37 RST Y 1 69 LD
6 FNC 38 RST Y 0 70 SET
39 OUT Y 2 72 STL
4 0 LO X 2 73 OUT
4 1 SET S 11 74 LO
13 STL 4 3 STL S 11 75 SET
1 4 LD 44 RST Y 3 77 STL
15 SET 4 5 OUT Y 4 78 OUT
16 LD 4 6 LO X 4 79 LD
1 7 RST 47 SET S 12 80 SET
1 8 LD 49 STL S 12 82 STL
1 9 AN1 5 0 SET M8043 83 OUT
2 0 OUT 5 2 RST S 12 84 LD
21 LD (RETI 85 SET
2 2 AN1 5 4 STL S 2 87 STL
2 3 OUT 5 5 LD M8041 88 RST
2 4 LD 56 AND M8044 89 OUT
25 AND 5 7 SET S 20
2 6 AN1 59 STL S 20 92 LO
2 7 OUT 60 OUT Y 0 93 SET
2 8 LD 61LD X 1 95 STL
29 AND 62 SET S 21 96 OUT
3 0 AN1 97 LO
31 OUT 98 SET
(RETI 100 STL
1 0 1 OUT
1 0 2 LD
103 OUT
Instructions i n ( ) are not necessary 1 0 5 RET
1 0 6 END

PROGRAMMING TIP
While the applied instruction FNCGO is driven, special auxiliary
relay M8043 (zero-return complete) is controlled automatically
as shown below.

Isow Ma044

Zero position condition


1HH ME041

Transfer start
RST' ] ~ 0 0 4 3 1

&hTiqzq
Zero return start
GENERAL HARDWARE AND INSTALLATION

BASIC SEQUENCE INSTRUCTIONS

STEP LADDER INSTRUCTIONS

APPLIED INSTRUCTION

SPECIAL DEVICE AND INSTRUCTION LISTS

USING SPECIAL UNITS EFFECTIVELY

APPENDIX
4. DEVICE DETAILS

4.1.1 110 NUMBERS AND FUNCTIONS OF I10 RELAYS


External Dower

Program example
lnput signal

lnput termins 'YO --A /- NO contact

kfs
_ - _ - - -
YO +
-
NC contact
i
I
Output terminal

(1) INPUT RELAYS (XO TO XI771


The maximum number of input relays is 128 points.
The external switch signals are received at the input terminals of the PC. Inside the PC, an
optically isolated, electronic input relay (XI is connected to the input terminal. A number of NO
(normally-open) and NC (normally closed) contacts are provided inside the PC and can be used
as often as required.
The input relays cannot be driven within a program.
(21 OUTPUTRELAYS (YOTO Y177)
The maximum number of output relays is 128 points.
Signals processed inside the PC are output externally through the output terminals. External
output contacts (an output device such as a relay contact, SSR, or transistor) of an outputdevice
are connected to the output terminal of the PC. An output relay has a number of NO and NC
contacts that can be used as often as required in the program.
The operational differences between the external output contact (output device) and internal
contact are described in Section 4.1 -2.
(3) 110 NUMBER ASSIGNMENT EXAMPLE

Input input ouwut 110 numbers for extension units and blocks
XO-X7 X10-X17 X20-X27 X30-X37 X30-X33 are assigned consecutively to the base
unit beginning with the units/blocks lo-
cated closest to the base unit. I10 num-
bers are assigned in octal numbers.
Attach number labels to the terminal so
that the I10 numbers can be distinguished
easily.
Both inputs and outputs have numbers in
the range of WYO to WY177 (128 points).
The total number of I10 points should be
YO-~7 Y~O-YI~ ~ 2 0 - ~ 2 7Y40-X47 Y34-~37 256 or less.
Output Input Output
When an FX-8ER or FX2-24MR is used, 414 110
points are left unused and, thus, the total 110
numbers are reduced accordingly.
The base unit and an extension unit both have input terminals (upper terminals) and output
terminals (lower terminals). If an extension block, dedicated for input or output, is used, both
upper and lower terminals are used for inputs or outputs only. Upper terminals are assigned
lower I10 numbers and lower terminals are assigned higher 110 numbers.
DEVICE DETAILS

INPUTIOUTPUT RELAYS

4.1.2 110 RELAY OPERATION TIMING

' Input processing


3 ('1)
1 INPUT PROCESSING
Before all of the program instruc-

xo
XI
-
-
r (1)
Read
4

C
tions are executed, the program-
mable controller reads the ONIOFF
status of all input terminals into its
-. input image memory.

I te r- I lnput image
memory
When an input contact changes
from OFF to ON and then from ON
minab to OFF, a response delay (approx.
I iI 10 msec) exists due to the exist-
iI
I
- I
3
ence of the input filter.
!I PROGRAM PROCESSING
The p r o g r a m m a b l e c o n t r o l l e r
reads the ONIOFF status of all ele-
m e n t s f r o m t h e i n p u t image
memory and the image memories
of other elements and writes the
results of the operations to the
image memory in accordance with
the program instructions.
As a result, the image value of each
element changes as the program is
executed.
Operations of output relay internal
contact are determined by the con-
tents of output image memory.
I) OUTPUT PROCESSING
When all instructions have been ex-
ecuted, the ONIOFF status of the
image memory for the Y outputs is
transferred to the o u t p u t latch
memory and this becomes the ac-
tual output of the programmable
controller.
An external output contact in the
PC operates after an output device
response relay.

The type of processing described above is known as the batch I10 or refresh system.
4. DEVICE DETAILS

4.2 AUXILIARYRELAYS
4.2.1 RELAY NUMBERS AND THE FUNCTIONS OF AUXILIARY RELAYS
A number of auxiliary relays are used in a PC. The coils of these relays are driven b y a contact of
devices in the PC in the same manner that the output relays are driven in the program.
Auxiliary relays have a number of electronic NO and NC contacts which can be used by the PC as
required. Note that these contacts cannot drive an external load directly. Output relays must be
used to drive external loads.
(1) GENERAL-USE RELAYS (MO TO M499 : 500 POINTS)

Auxiliary .Relay Circuit 500 relay points are provided for general-use. These
relays are assigned a decimal relay number in the range
of MO to M499.
Note: All device numbers, with an exception o f l / O
relays (WM, are expressed with decimal num-
bers.

contact
MI W Normally-closed
contact

(2) LATCH RELAYS (M500 TO M1023 : 524 POINTS)


If a power failure occurs while a PC is running, all output relays and general-use relays are
turned OFF. All of the relays remain OFF except for those that are turned ON when the PC
operation is restarted. However, before restarting the PC, the state of some devices must be
set again to where they were just before the power failure.
Relays that retain their status during a power failure, often called latch or keep relays, are
required in such cases. The status is retained by the backup battery incorporated in the PC.
Power Failure Data Retaining circuit

The circuit shown on the left is an example of a self-


retaining circuit. Relay M600 is activated when XO is
turned ON. If XO is turned OFF after the activation of
M600, its activation status is self-retained.
Therefore, the activation status of M600 is retained if XO
is turned OFF due to a power failure. However, M600 is
reset if the NC contact XI opens.
A SET and RST (reset) instruction can be used to retain
the status of a relay being activated momentarily.
Power Failure Data Retaining circuit
(Set/Reset) Note : During the parallel link operation between two
PC's, M8m to M999 are used. See Section
5.10.1.
Auxiliary relays are provided with countless number of
NO contact points and NC contact points, and are freely
usable in the PC.
These contacts cannot drive external loads directly.
External loads should be driven through output relays.
4. DEVICE DETAILS

AUXILIARY RELAYS
(3) SPECIAL-PURPOSE RELAYS (M8000 TO M8255 : 256 POINTS)
A PC has a number of special auxiliary relays. These relays all have specific functions and are
classified into the following two types.
(a) USING CONTACTS OF SPECIAL AUXILIARY RELAYS
Coils are driven automatically by the PC and only the contacts of these coils can be used
Examples: M8000 : RUN monitor (ON during run)
M8002 : Initial pulse (Turned ON momentarily when the PC starts running)
M8012 : 100 msec clock pulse
(b) DRIVING COILS OF SPECIAL AUXILIARY RELAYS
A PC executes a predetermined specific operation when these coils are driven by the user.
Examples: M8030 : BATT.V LED OFF
M8033 : All outputs retained when PC operation stops
M8034 : All outputs disable
M8039 : Constant scan
Note: .* Do not use undefined special auxiliary relays.
f APPLICATION EXAMPLE OF LATCH RELAYS
\

Left traverse limit LS Right traverse limit LS


LSI (xo) L S (XI)
~ Use latch relays to feed the table in the same

9- '2 direction as fed before an occurrence of a


power failure.

Brake motor

Right traverse XO = ON (left traverse limit) -B M600 = ON +


instructi on Table moves right -, Power failure -,Table
stops -, Restart (MGOO = ON) -, X I = ON (right
Left traverse traverse limit) -, M600 = OFF, M601 = ON -,
M60 1 instruction Table moves left

\ J
4. DEVICE DETAILS

43 STATES

4.3.1 STATE NUMBERS AND THEIR FUNCTIONS


States (S) are very important devices when programming step-by-step process control. They are
used in combination ~ 4 t hstep ladder instruction STL.
The four types of states are described below:
For Initial State (SO to S9 10 points)
For Zero Return (S10 to S19 10 points)
For General Use (S20 to S499 480 points)
For Retention (S500 t o S899 400 points)

@Initial state

start XO+

Fjq,- Downward
In the step-by-step process control shown on the left, state S20
Lower motion
limiti!si; is set (ON) when start signal XO is turned ON. At the same time
solenoid valve YO is energized for downward motion.
When the lower limit LS X I is turned ON, state S21 is set (ON) and
Clamp
clamp clamp solenoid valve Y1 is energized.
Y2
When the clamp confirmation LS X2 is turned ON, state S22 is set
(ON).
Upward
limit motion The transfer source state is automatically reset (OFF) as the state
transfers sequentially.

Each state has a number of NO and NC contacts which can be used by the PC as often as required.
When a step ladder instruction is not used, states (S) can be used within a sequence in the same
manner as auxiliary relays (MI.
4. DEVICE DETAILS

STATES

4.3.2 ANNUNCIATOR
Some state ( S ) areas can be used as outputs of external diagnosis.
States Usable for Annunciator (S900 to S999 : 100 points)
By programming an external diagnosis circuit as shown below, monitoring special data register
D8049 will display the lowest activated state (S900 to S999). Each of these states should be
set ON for each fault that may occur.
If more than one fault occurs simultaneously, the next lowest fault number will b e displayed
when the fault is reset.

Monitoring is enabled b y driving special auxiliary relay


M8049.
ANS I TO I KlO Is900
State S900 is activated if movement detection switch XO
is not driven within one second after the forward output
YO has been turned ON.
XI x2 /y FNC46
I J'
AI ANS 1 T 1 I K20 Is90 11 State S901 is activated when both upper limit LS X I and
lower limit LS X2 are OFF for more than tm seconds.

X3 X4 /V FNC46 If the cycle time of a machine in its automatic mode is


ANS I T21~1001~902j less than 10 sec., and X3 stays ON to select this mode,
state S902 will be set ON if the cycle completion sensor
X4 does not activated within this cycle time.

If any state from S900 to S999 is activated (ON), special


auxiliary relay M8048 is activated to turn on failure
indicator output Y10.

The state activated by the extra errorlfailure diagnosis


program is turned OFF by pressing reset pushbutton
switch X5.
Each time X5 is pressed, the activated states are reset
in ascending order of the state numbers.

Note: For an ANS instruction and an ANRlPl instruction, see Section 5.6.7 and 5.6.8.
4. DEVICE DETAILS

4.4 POINTERS (P, I )

4.4.1 POINTER NUMBERS AND THEIR FUNCTIONS

(1) POINTERS FOR BRANCH INSTRUCTIONS (PO TO P63 : 64 POINTS)

---( CJ I PO I CALL^ PI 1
Jump instruction Subroutine call instruction

Label PO
Label P I
Subroutine

When X20 is turned ON, the program sequence When X21 is turned ON, the subroutine of label PI
jumps the step of label PO. that is programmed following an FEND instruction is
executed. The program sequence returns from the
subroutine when an SRET instruction is executed.

As described above, pointers PO to P63 are used as a label to designate a jump destination for
a branch instruction such as CJ and CALL. P63 is the step of the END instruction.
Note: Pointer numbers cannot be used repeatedly.
(2) POINTERS FOR INTERRUPTS (10 TO 18: 9 POINTS)
2 nesting levels

1 000 Input interrupt 1OOrl Timer interruption

L
I .O : lnterrupt at trailing edge
1 : Interrupt at leading edge
Input number ( 0 to 5 )
L..-
-C---.10 to 99 msec
Timer interruption number ( 6 to 8)
Each timer can be used only once
Each input can be used only once
Example : 1001 Example : 1610
The sequence programmed after the label (in- The sequence programmed after label 1610 is
dicated b y this pointer) is executed atthe lead- executed in intervals of 10 msec. The program
ing edge of input XO. The program sequence returns from the interruption program when an
returns from the interruption program when an IRET instruction is executed.
IRET instruction is executed.

Note: An interrupt pointer must be programmed in a step that follows an FEND instruction.
No more than 9 interrupt pointer points can be used.
No more than 2 nesting levels can be used.
The number in the 100's place cannot be repeated.
1100and 1101 ..... Not allowed
1610and 1620 ..... Not allowed
The input used for interrupts mustnotcoincide with inputs used b y the SPD instruction
or any high speed process.
4. DEVICE DETAILS

4.5 CONSTANTS

4.5.1 BINARY DATA (KIH)


(1) BINARY AND DECIMAL
i

Keyed-in detr When decimal X789" is keyed in as a timer or


K789 counter setting, it is automatically converted to
0 : Positive 1 : Negative binary data as shown on the left.

* t 3 g ~ ~ % f i F j s Y 2 = - " - ' When a timer or counter current value stored in


binary is monitored, it is automatically converted
and displayed as a decimal.

1+4+16+256+512-789

K789
K : Indicates decimal constant ~ ~ data ~ i ~ ~ ~ ~ d

(2) BINARY AND HEXADECIMAL

Keyed-in data
H 789 When hexadecimal H789 is keyed in to a data
register, it is converted into binary data as shown
on the left. A hexadecimal digit is a number from
0 : Positive 1 : Negative 0 to 9 or a letter from A (representing 10) to F
(representing 15).
When a data register is monitored, the decimal
K1929 will be displayed first. The display changes
to hexadecimal H789 when the HELP key is
pressed. (when a hand-held panel is used).
i 6 i n l i

1. 024+512+256+128+8+10i. 929 0
Kt929
Monitored data
H : Indicates hexadecimal

I
BCD DATA

All operations executed by the PC, such as arith-


metic calculations, increment instruction, and decre-
ment instruction, use binary (BIN) data.
1
BCD -. BIN Therefore, use the BCD to BIN conversion instruction
to read BCD digital switch data into the PC. Conver-
sely, use the BIN to BCD conversion instruction to
output the data to a BCD seven-segment display
BIN-BCD
unit.

A 1 1 1 However, with special functions such as FNC72


(DSW), FNC74 (SEGL) and FNC75 (ARWS), this

8888 BCDIBIN conversion is automatically made within


these commands.
4. DEVICE DETAILS

4.6 TIMERS
4.6.1 TIMER NUMBERS AND FUNCTIONS
Timers operate by counting clock pulses (1 msec, 10 msec, 100 msec). The timer output contact is
activated when the count data reaches the preset value (setting).
Timers can either be set directly by using the constant K in the program memory or indirectly by
using the data stored in a data register (Dl. For the indirectsetting, data registers backed up by the
battery are usually used to ensure that there is no loss of data. Therefore, timers or counters may
malfunction if battery voltage is lowered.
( 1) TIMERS (TO TO T245)

bxy-@ K123
/L/
When input XO, which drives timer coil T200, is turned
ON, the current value for T200 begins counting in 10-
msec pulses. The timer output contact is turned ON
Setting (integer) when the current value reaches setting K123. In other
words, the output contact is turned ON 1.23 seconds
after the coil is driven.
Reset input
II Both the counter and the output contact are reset when
the drive input XO is turned OFF or a power failure
Counter occurs.
Note: If TI92 to TI99 are used in a subroutine or an
data input
interruption routine, the timing is updated at
the point when an END instruction is executed.
L- - - - - -
10ms clock pulses
contact The output contact is activated when a coil
instruction or an END instruction is executed
&en the timer current value reaches the
preset value.
Other timers cannot count correctly in a sub-
routine.
(2) RETENTIVE TIMERS (T246 TO T255)

E:c@ 1
K345

f RST IT250
When input XI, which drives timer coil T250, is turned
ON, the current value for T250 begins counting 100
msec clock pulses. The timer output contact is turned
ON when the current value reaches setting K345. If X1
is turned OFF or a power failure occurs during counting,
counting continues when the PC restarts operating.
The timer counts 34.5 seconds before operating its
contact.
The counter and the output contact are reset when drive
input X2 is turned ON.
Note: M e n an interrupt timer 11 msec time) is used
in an interruptroutine or subroutine, the output
contact is activated when the first coil instruc-
L-------
1OOms clock pulses Output
contact J tion of that timer is executed after the timer
reaches its preset value.
4. DEVICE DETAILS

TIMERS
4.6.2 CONTACT OPERATION TIMING AND ACCURACY
Timers begin counting after the coil is driven. The output contact is activated when the first coil
instruction is executed after the timer counts up.
Timer counting operation (If the operation cycle is long,
multiple clocks are used.)
The contact is not activated at this point

XI0 = OFF+ON
--
1
, Timer starts
counting I 1-
TO -
Contact
K12 I operation

YIO Y10
I ON
I
t t I t 1
1st cycle 2nd cycle "n"th cycle "n +l"tcycle

The operation accuracy of a timer contact between the time the contact is activated and the time the
coil is driven is expressed in the following manner.
a : 0.001, 0.01, 0.1 sec
(corresponds to 1 msec, 10 msec, and 100 msec timer)
T : Timer setting (sec)
To : Operation cycle (secl
If a contact is written prior to a timer coil, the accuracy of the timer contact will become "+2TOWinthe
vmrst case.
If timer setting is Wn, the output contact is activated when a coil instruction in the next cycle is
executed.
A I-msec timer counts 1-msec clock pulses in the interrupt mode after the execution of a coil
instruction.

DETAILS OF TIMER OPERATION Retentive


Timer
Non-retentive Timer

H
Xl
*
(
k q t l + t 2 = 34.5 sec
I
I

Present value

X2
L J
4. DEVICE DETAILS

4.7 COUNTERS

4.7.1 INTERNAL SIGNAL COUNTERS


(1) 16-BIT UP-COUNTERS (SETTING : 1 TO 32,767)
General-use Counters (CO to C99 : 100 points)
Battery-backed Counters (C100 to C199 : 100 points)

T m types of 16-bit binary up-counters are provided.


The setting range of these counters ranges from K1
to K32,767. KO and K1 have the same meaning and

hPpa
an output contact is activated after the first counting.
KIO

Counters C100 to C199


retain the present data and Present data I
contact setlreset state if a I
power failure occurs.

The current value of the counter increases each time coil CO, is turned ON b y the input X11.
The output contact is activated when the coil is turned ON for the tenth time. After this, the
counter data remains unchanged when X I 1 is turned ON.
The counter present data is reset to VWwhena RST instruction is executed after reset input
X I 0 is turned ON. The output contact is reset at the same time.
Counters can be set directly using constant K or indirectly by using the data stored in a data
register (Dl. In an indirect setting, the designation of D10, which contains for example the
value of "123: has.the same effect as the setting of K123.
If a value greater than the counter setting is written to a current value register (with a MOV
instruction, for example), the counter counts up when the next count input is turned ON.
This is true for all types of counters.
< INTERNAL SIGNAL COUNTERS \
Internal signal counters are counters which countthe signals of internal devices (such
as XI Y, MI S, TI and C) while executing the cyclic operation. Therefore, both the ON
duration and the OFF duration of the count input signals must be longer than the PC
cycle time. Generally, the count input signal frequency should be several cycleslsec.
(Hz).
\ 1
4. DEVICE DETAILS

COUNTERS
(2) 32-BIT UPIDOWN-CO UNTERS (SETTING: -2,147,483,648 TO +2,147,483,647)
General-use Counters (C200 to C219: 20 points)
Battery backed Counters (C220 to C234: 15 points)
Two types of 32-bit binary upldown-counters as shown above are
provided. The setting range of these two types of counters is -
2,147,483,648 to +2,147,483,647. The counting direction is desig-
nated with special auxiliary relays M8200 to M8234.
Note: Up/downcountingdesignation
If M8AAA for CAAA is turned ON, the counter will be a
down-counter. Conversely, the counter is an up-counter
h e n M8AAA is not turned ON.
Counter setting
-
Counters can be set either directly b y using constant K or
indirectly by using data registers D. For the indirect set-
ting, use two,consecutive data registers.

The counter operates when the C200 coil is activated as it counts b y counting input X14.
, The output contact is set when the counter current value increases from "-6" to "-5"and is
reset when counter current value decreases from "-5"to "-6".
The counter current value increases or decreases independent of output contact state
(setlreset). H o ~ \ ~ v eifra, counter counts beyond +2,147,483,647", the counter current value
changes to "-2,147,483,648". Similarly, counting below "-2,147,483,648" changes the
counter data to "+2,147,483,647". Such counters are called "ring counters".
Ifreset input X I 3 is turned ON, the counter present data is reset to "On and the output contact
is reset also.
Counters that are backed up by the battery retain its (current value and output contact)
setlreset state if a power failure occurs.
A 32-bit counter can be used as a 32-bit data register. A 32-bit counter cannot be desig-
nated as a device for a 16-bit instruction.
4. DEVICE DETAILS

COUNTERS
4.7.2 HIGH-SPEED COUNTERS
Although counters C235 to C255 (21 points) are all high speed counters, they all share the same 6
high speed counter inputs (XO to X5) on the PC. Therefore, if an input is already being used by a
high speed counter, it cannot be used for other high speed counters (or any other purpose). In other
words, since there is only 6 high speed counter inputs, only a maximum of 6 high speed counters
can be used simultaneously. High speed applied functions for executing comparisons and direct
outputs are also applicable.
SELECTION
The selection of these high speed counters are not free and are directly dependent on the type of
counter required and, which of the high speed inputs are used.
Available counter types:
(1) 1-PHASE without STARTIRESET C235 to C240
(2) 1-PHASE with STARTIRESET C241 to C245
(31 2-PHASE B ~ ~ D I R E C T ~ O N A L C246 to C250
(4) 2-PHASE A-B PHASE TYPE C251 to C255
All of these are 32-bit upldown counters. The following table shows which counter uses which inputs.
High-speed Counter Table (XO, X2. X3 : 10 kHz or less, X I , X4, X5 : 7 kHz or less1

U : Up-count input, D : Down-count input, A : A-phase input, B : B-phase input, R : Reset input, S : Start input

X6 and X7 are also high speed inputs but functions as a start signal only and cannot be used for
high speed counting.
Different types of counters can be used at the same time but their inputs must not coincide.
Note: Inputs )O to X 7 cannot be used for more than one counter. For example, i f C251 is used,
the following counters and instructions cannot be used.
C235, C236, C24 1, C244, C246, C247, C249,C252, C254, lo* *, 1 1 * *, and the SPD (FNC 56)
instruction of the corresponding input.
4. DEVICE DETAILS

COUNTERS
DRIVING HIGH SPEED COUNTER COILS:
High speed counters operate by the principle of interrupts and are therefore event triggered and
independent of cycle time. The coil of the selected counter should be driven continuously to indicate
that this counter and its associated inputs are reserved and that other high speed processes must
not coincide with this.
Example:
When X20 is ON, high speed counter C235 is selected. From the
above table C235 corresponds to count input XO and will therefore
count pulses from XO, NOT X20.
When X20 is OFF, coil C235 is turned OFF and coil C236 is turned
ON. Therefore, counter C236 is selected and counts from input X I .
Programmable
controller
r-----

L - - - - - J

Caution: Do not use the count inputs as contacts to connect high speed counters.
4. DEVICE DETAILS

COUNTERS
(1) 1-PHASE TYPES (C235 to C245)
With 1-phase high speed counters there are the follovving tm groups:
(a) C235 to C240 Without STARTIRESET Setting range:
(b) C241 to C245 With STARTIRESET -2,147,483,648 to +2,147,483,641
All of these are 32-bit upldown ring counters. Their counting and contact operations are the
same as normal 32-bit upldown counters described in section 4.7.2 (2). When the count value
reaches its setting the contact sets and holds when up-counting but resets when down-count-
ing .
DIRE CTlON:
The direction of count for 1-phase counters is dependent on their corresponding flag M8AAA
where AAA is the corresponding counter number (C235 to C245).
(a) 1-PHASE WITHOUT STARTIRESET (C235 to C240)

These counters only use one input each.


When direction flag M8235 is ON, counter C235 counts down.
When it is OFF, C235 counts up.

H 1-
e K1234
When X l 1 is ON, C235 resets to zero. Contact C235 turns off.
When X12 is ON, C235 is selected. From the table on the last
page, the corresponding count input to C235 is XO. C235
therefore counts the "OFF -r ONnsignals of input XO.

(b) 1-PHASE WITH STARTIRESET (C241 to C245)


These counters have one count input and one reset input each.
Counter C244 and C245 have also a start input.
When direction flag M8425 is ON, C245 counts down. When it
is OFF C245 counts up.
FIST I C245 ]
When X I 4 is on, C245 resets in the same manner as normal
internal 32-bit counters. From the table on the last page, it can
be seen that C245 can also be reset externally b y the input X3.
Counter C245 also has an external start input X7.
When this is ON, C245 starts counting. When it is OFF, C245
stops counting.
X I 5 selects and reserves C245 for counting "OFF -, ONnevents
of its corresponding input X2.
Note that the setting of DO for counter C245 is a paired desig-
nation (DO, D l since the counters are of 32-bits.
Note the external control of start (X7) and reset (X3) have the
advantage of being immediate and not affected b y the program
cycle time.
4. DEVICE DETAILS

COUNTERS
(c) 2-PHASE BI-DIRECTIONAL COUNTERS (C246 to C250)
These counters have one input for up-count and one input for down count. Some of these
have reset and start inputs as well.

When X I 0 is ON, C246 resets in the same way as internal 32-bit


RST 1~2461 uptdown counters.
From the high speed counter table on the previous page,
counter C246 uses XO as up count inputs and X1 as down-count
input. X1 1 must be ON select counter C246 and reserve these
inputs.
XO "OFF -, ON" : C246 increment one
X1 "OFF -, ON" : C246 decrement one

I Programmable
Controller I
From the high speed counter table on the previous page, bi-
directional counter C250 can be seen to have X5 as its reset
input and X7 as its start input. Therefore, reset can be made
externally without the need for the RST C250 instruction.
X I 3 must be ON to select C250. Start input X7 must ON to allow
plus count. Counting stops if X7 is OFF.
Up-count input ' : X3
down-count input : X4
The direction of the counting can be monitored by monitoring
the state of the corresponding flag M8AAA where A A A is the
counter number.
ON: down count, OFF: up count
Programmable
Controller
4. DEVICE DETAILS

COUNTERS
(2) 2-PHASE, A-B PHASE COUNTERS (SETTING : -2,147,483,648 TO +2,147,483,6471
2-PHASE, 2-INPUT ((2251 TO C255 : 2 POINTS OR LESS) (Battery backed)
A maximum of 2 points of 2-phase 32-bit binary upldown counter is provided. The operation
of the output contact in relation to the counted data is the same as the 32-bit counters
described in Section 4.7.1 (2).
With these counters, however, only the inputs indicated in the high speed counter table can
be used for counting. Its interrupt counting is executed independent of sequence operation.
Applied instructions for executing comparisons and outputs independent of sequence
operation are also provided.
Depending on the counter number used, start, reset and such input signals can also be
used.
The A-phase and B-phase input signals determine whether the counter operates as an
up-counter or a down-counter.

While the waveform of the A-phase is in the ON state: A-phase _n_n


B-phase input OFF + ON : Up-counter
B-phase input ON + OFF : Down-counter
Up-count
B-phase JL-r-
A-phase J L r
Down-count
B-phase m
Check the corresponding special relay M8AAA to determine whether the counter is counting
up or down.
C251 counts the "ONIOFF" events of input XO (A-phase) and
RST 1 C251 ] input X I (B-phase) while X1 1 is ON.
C255 starts counting immediately when X7 is turned ON while
K1234 X13 is ON. The counting inputs are X3 (A-phase) and X4
X 12 (B-phase).
1-4 -- CC55 is reset when X5 is turned ON. It can also be reset vvith

Fir-@ m
X12 in the sequence.
4. DEVICE DETAILS

COUNTERS
MAXIMUM COUNTING SPEEDS
The speed of the high speed counters are limited b y 2 factors:
a response of the individual inputs
(b) processing time of all the high speed counters
(a) RESPONSE OF THE INDIVIDUAL INPUTS
This is limited by hardware and the following table gives the maximum countable frequency
when only one count input is used.
Inputs Max. Frequency
XO, X2, X3 10 kHz
XI, X4, X5 7 kHz
(b) PROCESSING THE TIME OF ALL THE HIGH SPEED COUNTERS
This is the main area that limits the speed of the counters. The counters operate mith the
principal of interrupts so that the lower the number of high speed processes, the higher the
countable frequency. Also if the frequency used in one counter is much lower than the rated
frequency specified below, this will allow other counters to count a little faster.
The overall limitation is that the counting frequency of all the counters combined together
must be less than 20 kHz.
COMBINED FREQUENCY
The combined frequency is the sum of the maximum frequencies of all the signals appearing at the
input of the PC simultaneously. The criteria (b) of the above is that in order for the high speed
counters to count correctly. This c6mbined frequency must be less than 20 kHz.
Example:

1-phase Counters Corresponding Input Maximum Signal Frequency


C 235 XO 0.2 kHz
C236 X1 4 kHz
C 237 X2 10 kHz
Combined frequency: 14.2 kHz

The combined frequency of 14.2 kHz is lower than the max. of 20 kHz so this example is valid.
2-phase Counters:
(a) Bi-directional types: -are designed such thatthe up-count signal and the down-countsignal
never operate at the same time. Therefore it is really using only one phase at one time.
Thus, they can be treated in the same way as the 1-phase counters when calculating the
combined frequency.
When pulses arrive at the up and down count inputs at the same time, treat this as 2 single
phase counters when calculating the combined frequency.
When encoders that have clockwise and counter-clockwise format outputs are used, these
bi-directional counters can count at a much higher frequency than the A-B phase type
counters without any loss in resolution.
4. DEVICE DETAILS

COUNTERS
(b) A-B phase types: - are different to other counters in that they can decode simultaneously
the A-phase and 8-phase signals to automatically select up count and down count.
These are recommended to be driven at no higher than 2 kHz when using just one or two
of these counters together.
When calculating for the combined frequency, the maximum signal frequency for each of
these counters should be multiplied by a factor of 4 before adding with the rest of the other
counter signal frequencies.
Example:

Counters Corresponding Input Maximum Signal Frequency


1-phase C237 X2 3 kHz
Bi-directional C246 XO, XI 8 kHz
A-I3 phase C255 X3, X4 2kHzx4
Combined frequency:
3 + 8 + ( 2 x 4 ) =19kHz

Although the combined frequency of 19 kHz is less than the 20 kHz maximum, the input of
bi-directional counters (C246 is using XI which has a hardware restriction of 7 kHz.
The signal frequency must therefore be decreased from 8 kHz to 7 kHz for the counter C246.
SIMPLIFIED GUIDE FOR COUNT SPEEDS
Counters Maximum Frequency (when using 1 point)
1-phase 10 kHz
Bi-directional 7 kHz
A-B phase 2 kHz
When many counters or combination of the 3 counter types are used, their total combined frequency
must not be over 20 kHz (remember to multiply the A-B phase counter frequency by 4).
Example:
1-phase counters : 10 kHz (1 point), 2 kHz (1 point)
A-B phase counter: 2 kHz (1 point)
Combined frequency = 10 kHz + 2 kHz + 2 kHz x 4
= 20 kHz
4. DEVICE DETAILS

4.8 DATA REGISTERS

4.8.1 DATA REGISTER NUMBERS AND FUNCTIONS


Data registers are used.to store numeric data.
Although all data registers are 1&bit devices (the MSB stores a plus or minus sign), 32-bit data can
be stored b y using a pair of 16-bit registers.
(1) GENERAL-USE REGISTERS (DO TO D l 9 9 : 200 POINTS)
Once data is written to a general-use register, it remains unchanged until it is overwritten.
When the PC status is changed from RUN to STOP, all these registers are cleared to "On.
Note: Data can be retained d e n the PC status is changed from RUN to STOP b y setting
special auxiliary relay M8033 ON.
(2) BATTERY BACKED REGISTERS (D200 TO D511 : 312 POINTS)
Once data is written to a battery backed register, it remains unchanged until it is overwritten.
When the PC status is changed from RUN to STOP, the data in these registers is retained.
When the PC is connected in a parallel link, areas D490 to D509 are occupied for link operation.
See Section 5.10.1.
(3) SPECIAL REGISTERS (D8000 TO D8255 : 256 POINTS)
Special registers are used to control or monitor various modes of devices inside the PC.
Data in these registers are set to the default values when the power supply to the PC is turned
ON. (When the power is turned ON, all registers are first cleared to "On and the default values
are then written to some of the registers by the system software.)
For example, the watchdog timer data is set to D8000 by the system software. To change the
setting, write the required value to DSOOO using a transfer instruction.
Data set in these areas remain unchanged when the PC status changes from STOP to RUN.
Note: Do not use undefined special data registers.
(4) FILE REGISTERS ( D l 0 0 0 TO D2999 : 2000 POINTS)
Up to 2000 points of file registers can be secured in the program memory (RAM, EEPROM,
EPROM) in units of 500 points. These registers can be accessed nith a peripheral device.
While the PC is operating, data in the file registers can be read to the general-use registers by
using the BMOV instruction. However, it is not possible to write to a file register with an
instruction. See Section 5.3.6.
16-bitl32-bit data :

I l l l l l l l l ~ ~ ~ ~
L ~ i g n0 : Positive number
1 : Negative number (two's complement)
,b
- D l (higher --16
-)st ib DO (lower 16 btis)-4

1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
Sign 0 : Positive number
1 : Negative number (two's complement)
See Pege 129.
4. DEVICE DETAILS

4.9 I N D E X REGISTERS

4.9.1 MODIFYING DEVICE NUMBERS


Both index registers V and Z are 16-bit registers. Numerical data
can be readtwitten to index registers in the same manner as for
general-use registers.
When executing 32-bit data operation, combine these registers (V
and Z) and designate the register V.

As shown to the left, the processing required to change a device


number according to the data for Z and V is called index address-
ing.
If a constant is used, with K20V and V = 8, the result istherefore
K28 (20 + 8 = 28).

The devices that can be modified with an index register are shown
on the left.
Note: Modifying Kn, which is used to designate the number of
digits, is not possible.
K4MOZ ..... Allowable
KOZMO ..... Not allowable

In Kn, "n" represents the number of digits when 4 bits are taken as 1 digit. For
example, K8MO indicates 32-bit data comprised of bits M31 to MO (bit M31 is a sign
bit). The notation of K1MO indicates the 16- or 32-bit data with leading zeros. In this
case, bits M4 to M31 can be used for other purposese. See Section 5.1.3.
4. DEVICE DETAILS

4.10 SUMMARY OF M E M O R Y ALLOCATIONS

4.10.1 GENERAL CONFIGURATION


The internal configuration of the devices in the PC is shown below. The memory areas marked with
(BIU) are backed up by the battery.

Latch Memory 1
Program Memory

EEPROM
I Data Memory
RAM I Bit Memory
RAM

The e f f e c t o f p o w e r
ONIOFF operation and
PC RUNJSTOP opera-
tion on the data in each
memory area is sum-
marized in the following
table.
Some special auxiliary
relays (special M) and
special data registers
(special Dl are handled
as type-C memory.

Memory Type

A : Memories backed up by battery Not changed


B : Special M and D and index
Cleared Default Not changed
registers
C : Other memories
Cleared
Not changed 1
Cleared
(not backed up by battery) Not changed if M8033 is set
MEMO
n
*
GENERAL HARDWARE AND INSTALLATION

BASIC SEQUENCE INSTRUCTIONS

STEP LADDER INSTRUCTIONS

SPECIAL DEVICE AND INSTRUCTION LISTS

USING SPECIAL UNITS EFFECTIVELY

APPENDIX
5. APPLIED INSTRUCTIONS

5.1 GENERAL RULES OF APPLIED I N S T R U C T I O N S


5.1.1 APPLIED INSTRUCTION EXPRESSION FORMAT
MEAN FNC 45 Object devices :
&,-I -1 4

7 1 I
[K. H KnX KnY KnM ( KnS

+I n
17-1-64
-.0-
I I T

......................7 steps
I C I D ( V . Z]

.
Number of steps : MEAN, MEAN(P)

I
MEAN : Instruction mnemonic FNC45 : Function number
name
(PI : Pulse function MEAN (P) (16) : 16-bit operation only
is available. If (16132) : 16-bit and 32-bit
(e-g. (DIMOV) operation
are available.
(1) INSTRUCTIONS AND OPERANDS
Applied instructions are designated b y a function number (FNCO to FNC99). Each applied
instruction is given a symbol (mnemonic). FNC45 is given the symbol "MEANn, for example.
When writing a program, the FNC number ofthe application function to be used can be found
by using the HELP function to display a list of FNC numbers and symbols. Both the FNC
number and its symbol are displayed when a program is read and displayed.
Some applied instructions require only the instruction (FNC number) to be designated.
Others require the designation of an operand.
(D 0) +(D 1) +(D 2) _. (D 4z,
3
This instruction executes processing to
determine an average. The data stored in "n"
devices, beginning with the device desig-
nated by [ S - I , is added and the sum is
divided b y "n". The obtained quotient is
0 LD X 0 stored in the device designated by ID. I.
1 MEAN 45 [SI : An operand whose data may change
D 0 after the execution of an instruction is
called "source" and is expressed with
0 42 the symbol I S ] . If a n index modifier can
K 3 be used, such an operand is expressed
as [S. I.When more than one source is
8 .... designated, the sources are expressed
as [ S l - I,[S2. I,etc.
[ D l : An operand whose data changes after the execution of an instruction is called
"destinationnand is expressed with the symbol [Dl. If an index modifier can be used,
such a destination is expressed as [D. I. When more than one destination is
designated, the destinations are expressed as [ D l - ;, [D2. I,etc.
m, n : Operands which accept only constant K or H are expressed as "muand "nn. If more
than one such operand is designated, they are expressed as "mln, "m2", etc.
An applied instruction always occupies 1 program step. Operands occupy either 2 or 4
program steps depending on whether the instruction is a 16-bit instruction or a 32-bit
instruction.
Note that with some functions, programming is a l l o w d for only once even ifjumps are used
to separate them. However, index registers are usable for changing the device element
number.
5. APPLIED INSTRUCTIONS

GENERAL RULES OF APPLIED INSTRUCTIONS

5.1.2 DATA LENGTH AND INSTRUCTION EXECUTION FORMAT


(1) 16BlTS AND 32BlTS
Applied instructions that handle numeric values are either 16 bits or 32 bits depending on
the bit length of the numeric data.

MOV 010 012


lnstruction to move the data in D l 0 to D l 2

1
1 (0) MOV 0 20 0 22 lnstruction to move the data in D21 and D20 to 023 and
D22
32-bit instructions are expressed b y appending (Dl to an instruction such as (DIMOV and
FNC(D)12, (FNC12(D)).
Both odd and even numbers can be used to designate a device number. The device
following the designated device may be paired with the designated device (word devices
such as T, C, and D).
To avoid confusion, it is recommended to always use an even number for the device to
be designated by an operand when a 32-bit instruction is used.
A 32-bit counter (C200 to C2551 cannot be used as an operand for a 16-bit instruction.
(21 CONTINUOUS EXECUTION AND PULSE EXECUTION

The symbol (P) appended to an instruction sym- The program shown above is an example of a
bol indicates pulse execution form. This symbol continuous execution instruction. The instruc-
can be used with symbol (Dl like (D)MOV(P). tion is executed repeatedly every operation
With the program shorn above, the instruction cycle while X1 is ON.
is executed only once when the state of XO Some instructions, such as XCH, INC, and DEC,
changes from OFF to ON. This shortens the require care when being used in the continuous
total program processing time because the execution form. These instructions are indi-
instruction is not executed with every operation cated by "!".
cycle. Therefore, it is recommended to use
pulse execution form instructions.

Note: In either case, the instruction is not executed while XO or XI is OFF. The destination
remains unchanged with the instructions unless specified otherwise.
5. APPLIED INSTRUCTIONS

GENERAL RULES OF APPLIED INSTRUCTIONS


5.1.3 BIT DEVICES
Bit devices and word devices :
Devices, such as X, Y, M, and S, which handle only ONIOFF data are called "bit devicesn. Other
devices, such as T, C, M, and D, which handle numeric data are called M r d devices".
Bit devices, however, can be combined handle numeric data. The combination of bit devices is
expressed by a digit "nwfollowingK (Kn) and a head device number.
Assigning grouped bit devices :
Bit devices can be grouped in 4-bit units. The "nnin KnMO defines the number of groups of 4-bits
to be combined for data operation. K1 to K4 are allowed for 16-bit data operation and K1 to K8
are allowed for 32-bit data operation.
K2M0, for example, indicates 2 groups of 4-bits using bit devices MO to M7.

!- Signbit (0 :Positive, 1 :Negative) n Move . W Lower bits

Previous bit data remains unchanged


v
+

Sign bit (0 : Positive, 1 : Negative) Move Dl Lower bits

When a 16-bit data is moved to K1MO, K2M0, or K3M0, the overflowing bit data are not moved.
This is also true for a 32-bit data.
When executing a 16-bit data operation and the digit desig lation for a bit device is K1, K2, or K3,
"Onis placed in the higher digit bit position. This means that only positive numbers are handled.
This is also true when K1 to K7 is designated while a 32-bit data operation is executed.

u >

2-digit BCD data of X4 to X I 3 is converted into


t BIN K2X4 D 0 binary data and transferred to DO.

Any number can be used for the bit device number. However, it is recommended to use a "Owin
the lowest digit place of Xand Y numbers (XO, X10, X20, .....
etc.). For M and S, use of a multiple
of "8"is efficient. However, because the use of such numbers may lead to confusion in assigning
device numbers, it is recommended to use a multiple of "1OWas htw
i X and Y.
Ref.: Designation of or series of words
A series of data registers beginning with D 7 means D 7 , D 2 03, .... M e n w r d s , designated
with a bit device, are handled as a series of w r d s , they should be designated in the
followng manner :
KIM3 K7XQ K7X7O K7X74 ....... K2Y7O K2MO K 2 W .......
K3MO K3M 72 K3M24 K3M36 ....... K4S 76 K4S32 K4S48.......
Thatis, the devices stated above should be used for each digitso thatno device is skipped.
If K2YOnis used in a 32-bit operation, the upper 76 bits are to be regarded as '0': To obtain
32-bit data, use 'K8YOI
5. APPLIED INSTRUCTIONS

GENERAL RULES OF APPLIED INSTRUCTIONS


5.1.4 INDICES
Index registers are used to modify device numbers in addition to object devices for move and
comparison operations. These operations are performed in the same manner as with general-use
data registers.

Expressing object device I K , H ~ K ~ x I K ~ YT I K


I C~ IMD I (Kv ~
. z s~ I
t Current value registers
for timers and counters

The diagram above shows that X n Y to V, Zn can be used as the destination of an applied
instruction. The dot (. ) in [Dm I indicates that an index can be added. However, for 32-bit
instructions, V is used for upper 16 bits and Z for the lower 16 bits. Only the designation of Z is
allowed as it already represents both V and 2.
There are no modifiers for V and Z.

u
I MOV K 10 V Because K10 is moved to V and K20 to Z, the
*
data in V and Z are "10" and "20" respectively.
"(D5V) + (Dl521 -, (D40Z)"means that n(D15) +
(D35) + (D60In.
V and Z can be used to facilitate programming.
C +

f ADD 0 5V D 152 D 402 "(Dl, DO) + (D3, D2) -, (D25, D24In


For 32-bit instructions, V and Z are automat-
M8000 ically used in pair. V is assigned to "Onby the
MOV K 0 V MOV instruction.

FLAGS
For some applied instructions, various flags shown in Section 6.1.3 are used.
Examples :
M8020 : Zero flag (2)
M8021 : Borrow flag (Br)
M8022 : Carry flag (Cy)
M8029 : Execution complete (F)
If there are errors in the syntax of the applied instruction or the object device numbers, an error
will occur (errors are explained in Section 6.1.7). An operation error flag M8067 (E) is set if an
error occurs during the execution of an operation.
1
I These flags are set or reset at each "ON execution" of an instruction. However, their setlresei
state does not change in "OFF execution" or at an occurrence of error. Many instructions will
1 affect the flag state; be careful when programming.
5. APPLIED INSTRUCTIONS

5.2 PROGRAM FLOW (FNC 00 TO FNC 09)

5.2.1 CONDITIONAL JUMP

CJ FNC 00 Object devices : Pointers PO to P63 (index modification allowed).


(P) (16) P63 is equivalent to the END step and a label program is not necessary.
Conditional Jump Number of steps : CJ and CJ(P) ...............
3 steps
......................
Label P f * 1 step

C J and CJ(P),instructions are provided to skip a part of sequence, thereby reducing the operation
cycle time and permits the designation of a double-coil.
In the following example, the sequence jumps from step 1 to step 36 (the step following the label P8)
when XO is ON. If XO is OFF, the sequence is executed consecutively (from step 1 to step 4). If a
jump occurs, the instructions in the skipped sequences are ignored.
The coil do not change even if the contacts do.

15hl RsT IT 2461

40
Label
!Lo Note: YI is a double-coil designation. Its operation is con-
trolled according to the ON/OFF state o f XO. That is,
i t is controlled by XI i f X l i s OFF and by XI2 i f XOis
ON.
The designation of a double coil with one coil inside
the jump routine and the other coil outside the jump
routine is not allowed.
If a resetinstruction for a retentive timer or counter
is designated inside the jump routine, the reset
(resetting of contacts or clearing of current value) is
still effective i f a timer or a counter coil step is
skipped.
5. APPLIED INSTRUCTIONS

PROGRAM FLOW (FNC 00 TO FNC 09)

If the same pointer number is designated as an operand while


only one label is designated in a program, the following opera-
tion occurs.
If X20 is ON, a jump occurs from this step to label P9. If X20 is
OFF and X21 is ON, a CJ instruction in this step becomes
effective and a jump occurs from this step to label P9.
A label number can only be designated once. If the same label
number is used more than once, an error occurs.

It is possible to program a label in a step of a lower step number


than the step number of the CJ instruction. In the program
example, however, if X22 is set ON for more than approximately
100 msec, a watchdog timer error occurs.

The program step shown on the left is an "unconditional jump"


because M8000 is always ON while the PC is running.

I RUN monitor

By using the CJ(P) instruction, the jump only becomes effective


Label {cJ~P)IP 61 immediately following the time that X22 changes from OFF to
ON.

Label The program step shown on the left sets the "CJ P7"instruction
P6 one operation cycle after X23 changes from OFF to ON.

Using this programming method, it is possible to execute a


jump after setting each output between step "CJ P7"and label
Label
P7
737". (useful for setting initial conditions)

The label instructions are programmed as shown below.

LD 7 31 ] OUT Y 11
5. APPLIED INSTRUCTIONS

PROGRAM FLOW (FNC 00 TO FNC 09)


f JUMPING AND MASTER CONTROL AREA \

CJ PO
I (1 Jumping across master control area (from before
the master control area to beyond the master con-
trol area) is unrestricted.
(2) Jumping from outside the master control area to
insidethe master control area :
Jumping is made independent of the operation
of the master control. After PI, MO is regarded
to be "ON" even if MO is "OFF".

Master
control
(3)Jumping within master control area :
Jump is not possible if MO is OFF.

(4) Jumping from within the master control area to


outside the master control area :
Jump is not possible if MO is OFF. Jumping can
occur when MO is ON, and MCR is ignored but
there is no error of operation.

I Fa
I

(5)Jump from within the


master control area to
another master control

Jump is possible if M I is ON. The circuits folloming the


jump operate assuming M2 is ON regardless of the ac-
tual ONIOFF state of M2. The first "MCR NOnis ignored.
J
5. APPLIED INSTRUCTIONS

PROGRAM F L O W (FNC 00 TO FNC 09)

5.2.2 SUBROUTINE

CALL FNC 01 Object devices : Pointers PO to P62 (index modification allowed).


(P) (16) Number of steps : CALL and CALL(PI ......
3 steps
Subroutine Call Label P * * ......................
1 step
Nesting : 5 levels

SRET FNC 02 Object devices : None


Subroutine Return Number of steps : 1 step

The CALL instruction causes a jump to P I 0 when XO is ON.

The subroutine program is executed. After the execution


of the SRET instruction, the program returns to step 104.
Designate the label in the steps after an FEND instruction
(FEND instruction explained in Section 5.2.4).
Label Label numbers should range from PO to P62. Do not use
P 10 the same label for more than once even if the label is used
with a CJ instruction. The same number can be used
Subroutine however, for the operand of many CALL instructions.
program

The "CALL(P1 Pl1"instruction executes a jump to label P I 1


only once when X1 changes from OFF to ON.
If a CALL instruction to call subroutine program P I 2 is
executed while P I 1 subroutine program is executed, the
program step jumps to subroutine program P12. After the
execution of an SRET instruction (21, the program step
returns to the step following the CALL instruction in sub-

p- CALL P 12
routine program P1 1. The program step returns to the main
program after the execution of an SRET instruction (1).

t+ 9
Note: A total o f 4 nesting levels can be programmed inside
a subprogram called b y a CAL L instruction.

Label In a subroutine or an interruption subroutine, use


timers in the range of 7192 to 7199 and T246 to T249.

I ( SUET ] (2)
APPLIED INSTRUCTIONS

PROGRAM FLOW (FNC 00 TO FNC 09)

5.2.3 INTERRUPTS

IRET FNC 03 Object devices : None


Interrupt Return Number of steps : 1 step

El FNC 04 Object devices : None


lnterrupt Enable Number of steps : 1 step

DI FNC 05 Object devices : None


lnterrupt Dis8ble Number of steps : 1 step

Note: An interruptpointer (IY**) uses 1 step. Up to Spoints can be designated.


See Section 4.4.1 for the procedure used to assign interruptpointers.
Multiple interruption is a110 wed for up to 2 points.

lnterrupt signals must be of pulse width wider than 200 psec.

The PC is usually in the interrupt disabled state

If XO and X1 are turned ON while a program step ranging


from instruction El to instruction Dl is being executed,
interrupt routines (1) and (2) are executed respectively.
The program sequence returns to the main program
when an IRET instruction is executed in each interrupt
Interruption
enabled
routine.
range
An interrupt routine will not be executed if the cor-
responding special auxiliary relay is activated. For ex-
ample, interrupt routine [A** will not be executed if relay
M805A is activated.
In the program shown on the left, interrupt routine 1001
is not executed when XO changes from OFF to ON if X I 0
stays ON.

Interruption While an interrupt program is executed, other interrupt


routine (1) calls are disabled. However, 2 levels of interrupt
programs may be nested by programming instruct El
and Dl within the interrupt program.

Interruption
routine (2) In a subroutine or an interrupt subroutine, use timers in
the range of T I 9 2 to T I 9 9 and T246 to T249.

Note: If more than one interrupt occurs sequentially,


priority is given to the interrupt occurring first, If
tw or more interrupt events occur simultaneous-
ly, the interrupt subroutine w'th a lower pointer
number is given priority.
If an interrupt occurs in an interrupt disabled
range (Dl to El range), the occurrence is stored
and is executed after the El instruction is ex-
ecuted (unless special relay M805A is activated).
5. APPLIED INSTRUCTIONS

PROGRAM FLOW (FNC 00 T O FNC 09)

5.2.4 MAIN PROGRAM END

FEND FNC 06 Object devices : None


First End Number of steps : 1 step

An FEND instruction indicates the end of a main routine program. The program step returns to step
0 M e n this instruction is executed after the output processing, input processing, and watchdog timer
are refreshed.

-
2

Main routine program Main routine program -


CJ IP 20
= ON
I -+
I f X l O =OFF I

Main routine program

FEND

P 20 - Subroutine program -
- Main routine program - IfX10 = ON
I 100
{ FEND )
- Interrupt routine
program
-
END END

Write labels for CALL or CALL(P) instructions in the steps following'the FEND instruction. The
subroutine program called by a CALL or CALL(P) instruction must always end with an SRET
instruction.
Similarly, an interrupt pointer should be written after the FEND instruction. The interrupt program
must end with an IRET instruction.
A program will be regarded as an error if the FEND instruction is executed after the CALL or
CALL(P1 instruction is executed and before the SRET instruction is executed. Another cause for
a program to be regarded as an error is if the FEND instruction is executed during a FOR - NEXT
loop.
The subroutine programs and interrupt routine programs should always be written between the
final FEND instruction and the END instruction.
5. APPLIED INSTRUCTIONS

PROGRAM FLOW (FNC 00 TO FNC 09)

5.2.5 WATCHDOG TIMER

WDT FNC 07 Object devices : None


(PI Number of steps : 1 step
Mgtchdog Timer

A WDT instruction refreshes the watchdog timer of the sequence program. If the operation cycle
time (step 0 to END or FEND instruction) of a sequence program exceeds 100 msec, the PC will stop.
In such a case, a WDT instruction is inserted at a proper program step to refresh a watchdog timer
so that the sequence program can be continuously executed to the END instruction.

HI WDT
H -.I
I
Executed in
eve^ scan
u
I

A program of 120
msec cycle time
K"IH program

For example, split a 120


END I
r-i
I
program

END I
msec cycle time program
into two programs (each 60
m s e c ) and designate a
WDT instruction between
these two programs.

If the scan time exceeds 100 msec in each scan, change the data in the special data register
D8000 by using a MOV instruction (FNC12) as indicated below.

0 In addition to the example s h o w above, the WDT instruction is used for theow
lo
nflg
i purposes:
1) It can be designated after a label if the label corresponding to the CJ instruction is desig-
nated in a step of a lower step number than the C J instruction step number.
2) It can be designated inside a FOR-NEXT loop.
5. APPLIED INSTRUCTIONS

PROGRAM FLOW (FNC 00 TO FNC 09)


5.2.6 REPEAT

FOR FNC 08 Objectdevices :


( 16 )
Start o f Repeet s -
Range IK. H I KnX I KnY IKnM I KnS 1 T I C I D IV. Z
Number o f steps : 3 steps
Nesting : 5 levels

NEXT FNC09
End o f Repeet Number of steps : 1 step
Range

The processes within in a FOR-NEXT loop is repeated "n" times (designated b y the object device).
After that, the steps following the NEXT instruction steps are executed.
Repeat number range : 1 to 32,767
If a number in the range of -32,768 to 0 is designated, it is replaced b y 1 and the FOR-NEXTloop is
executed once.

b FOR K 4 \
Program (C)is repeated four times and then the steps
following the 3rd NEXT instruction step are executed.
Program (B) is repeated sixtimes each time program (C)
is executed if the data in data register D OZ is "6".

Therefore, program (B) will be executed 24 times.


Use the CJ instruction ( X I 0 = ON) to skip the FOR-NEXT
loop program (A).

If X I 0 is OFF and the contents of K1XO are 7': program


(A) is executed seven times while program (El is ex-
ecuted once. This means that program (A) is repeated
168 times ( 4 x 6 x 7) in total.
A maximum of 5 FOR-NEXT loops may be nested.

Note: An error wi// occur in the following cases :


- If a NEXTinstruction is designated preceding a
FOR instruction.
- If there is no NEXTinstruction.
- If a NEWinstruction is designated after an
FEND or END instruction.
- If the number of NEXTinstructions does not
agree with the number of FOR instructions.
5. APPLIED INSTRUCTIONS

5.3 MOVE AND COMPARE ( F N C 10 TO F N C 19)


5.3.1 COMPARE

CMP FNC 10
(P) (16132)
Object devices :
s[-t 1 -3 [s24-]*
Compare
I K . H I K ~ X I K ~ Y I K ~TM 1I KC ~I SD~ I v , z ]
l x l Y l M l S ]
OH
HD
Number of steps : CMP and CMP(P) ......................7 steps
(DICMP and (D)CMP(P) ...........13 steps

The data of source [ S l . I and [S2- I are com-


[SI-] [s2-] [D .] pared and destination [Dm I operates ac-
cording to the result of this comparison.

Source data is compared algebraically


(-10 < 2, for example).
ON if K100 > Present data of c 2 0 All source data is regarded as binary data

ON if K100 = Resent data of C20

t-- ON if K100 < Present data of C20

MO, MI,and M 2 remain unchanged if the CMP


instruction is executed with XO = OFF.

Ref.: A CMP applied instruction uses three operands. If only one or tMlo operands are desig-
nated, an error occurs (error code :65031, precluding PC operation.
/ f a device other than those listed above is designated as an operand, an error occurs (error
code :67051. If device X D, T, or C is used as a destination, for example, an error occurs.
If the device number that designated as an operand exceeds the aNowable range, an error
occurs lerror code :67061
Note :It may occur if an index modifier is used.
/fan error occurs due to incorrect operand designation as stated above, see Sections 6.1.7
and 6.1.8.
5. APPLIED INSTRUCTIONS

MOVE AND COMPARE (FNC 10 TO FNC 19)


5.3.2 ZONE COMPARE

ZC P FNC 11 Object devices :


(P) (16132)
Zone Compare [ K . H ( K ~ X I K ~ Y I K ~ M I KT~ S I C I 1 0 IV.ZI

Number of steps : ZCP and ZCP(P) ........................9 steps


(DIZCP and (D)ZCP(P) .:.......... 17 steps

[si.] 1~2.1 [s .] [D .] A ZCP i n s t r u c t i o n is u s e d to c o m p a r e t h e d a t a


with two s o u r c e d a t a v a l u e s .
ZCP K I00 K 120 C 30 M 3

D a t a from s o u r c e [ S l - I must not b e g r e a t e r


ON if K100 > Present data of C30
t h a n t h a t from s o u r c e [ S 2 . I.
+ ON if K100 5 Present data of C30 I K120 For e x a m p l e , if [ S l . I = K l 0 0
& ON if Present data of C30 > K120
[ S 2 . I = K90,
t h e ZCP instruction is e x e c u -
t e d a s s u m i n g [S2. I = K 1 0 0 .
S o u r c e d a t a is c o m p a r e d a l g e b r a i c a l l y
M3, M4, and M5 remain unchanged if the ZCP ( - 1 0 < 2, for e x a m p l e ) .
instruction is executed with XO = OFF.

Note: M3, M4, or M5 is turned ON according to the comparison result.


5 . APPLIED INSTRUCTIONS

MOVE AND COMPARE (FNC 10 TO FNC 19)

5.3.3
MOV
MOVE

FNC 12
( P I (16132)
Move
Object devices

Number of steps
:

:
+--st
IK. H I KnX IKnY I KnM IKnS I
MOV and MOV(P)
(DIMOV and (D)MOV(P)
C
+o
--
......................5 steps
...........9 steps
T

- *
I C I D 1 V, ZI

The source data is moved to the


destination.

Q The data in the source device is moved to the designated destination. If XO = OFF, the data
remains unchanged. . -

Q
Constant K100is automatically converted into binary data when the MOVinstruction is executed.

5.3.4 COMPLEMENT

CML FNC 14 Object devices :


(P) (16132) s -
Complement
T ~ Is IC
IK,HIK~xIK~YIK~MIK I D Iv.z]
+Lo -H
Number of steps : CML and CML(P) ....................... 5 steps
(DICML and (D)CML(P) ...........9 steps

(DO) -, (K1YO) The source data is inverted and


moved to the destination.

o Each data bit in the source device is inverted ( 0 -. 1, 1 -, 0) and moved to the designated
destination. If constant K is used in the source, it is automatically converted to binary data.
o The CML instruction may be used effective to obtain logical inversion for PC output.

- Sign bit (0 : Positive, 1 : Negative)


CC
--- - - -
Remains unchanged Inverted data is moved
5. APPLIED INSTRUCTIONS

MOVE AND COMPARE (FNC 10 TO FNC 19)

5.3.5 SHIFT MOVE


SMOV FNC 13 Object devices :
(PI (16)
Shift Move
[ K . H ( K ~ x I K ~ Y ( K ~T MI ~CK 1~ s I ( v . z I
H -.
mi, m2. n

Number of steps : SMOV and SMOV(P) .................11 steps

Data i s d i s t r i b u t e d o r com-
pounded.

The source data (binary) is con-


verted into BCD first and the shift
move is executed on the converted 1 1 I I IIIII II I 1 I ( I D l (16-bit binary data)
BCD data. The tvm digits (m2 = 2)
of the source BCD data beginning .[ I Converted automatically

. I I lo0 ]
with the 4th digit ( m l = 4; counted 108 108 10s D11(4-digit BCD date)
from the far right digit) are moved .
Shift move
to the destination where the 4th
digit is given the 3rd digit (n = 2)
position. After this, the BCD data
in the destination is automatically
converted back to binary informa-
tion. The 1st and 4th digits BCD 1 e d
Remains
unchanged 1 Converted automatically

data in the destination are not in- ' 2 1 D2 (16-bit binary data)
fluenced b y the shift move func-
tion.
An error occurs if BCD value exceeds 9,999.
(11 EXAMPLE

(X20 to X27) 2digit BCD


-i
(XO to X3) 1digit BCD

SMOV D l K l K l 0 2 K 3

Data input is composed from three 1-digit data (BCD) of D l is moved to the 3rd digit posi-
digital switch,es that are connected tion of D2 in BCD and then automatically converted to
to the discrete input terminals. binary.
In the sequence described above, numerical data input
from the 3-digit digital switches is compounded and
stored in 0 2 as a binary data.
5. APPLIED INSTRUCTIONS

MOVE AND COMPARE ( F N C 10 TO FNC 19)

5.3.6 BLOCK MOVE

BMOV FNC 15 Object devices :


(PI (16)
Block Move
I
[K. H 1 KnX 1 KnY I Knr. KnS I T I C 1 D I A Iregister1
~ V. Z1

I Number of steps : BMOVand BMOV(P) .......7 steps

Cs.1 Co.3 n

D 7
(1)
D 12
} n = 3 points

MT3-Ki}-I
D 22 0 17
n = 3 points

Q
A block of n-point data beginning with the device designated as the source, is moved to the
device designated as the destination. If a device number is beyond the allowable device number
range, data are moved only to the devices within the range.
Q
If the type of device designated for the source and the destination are the same, the device data
is sent in the order shown above (either from l o w r numbered devices to higher numbered
devices or from higher numbered devices to lower numbered devices).
0 This order is determined automaticaIly to prevent the source data from being overwritten by other
moved data moved b y this instruction.
0 If bit devices, which need the number of digits to be designated, are used, the number of digits
designated for source and destination devices must be the same.
0 Data can be read from a file register (01000 to D2999) b y using the BMOV instruction.

5.3.7 FILL MOVE

FMOV FNCl6 Object devices :


(PI (16)
Fill Mo ve I------[S -.
I
[K. H KnX KnY1 1 KnM IKnS I T I C I 0 ( V. Z
I-ii-l D+[ .H
Number o f steps : FMOVand FMOV(P) .................7 steps

[s-I Lo-3 n
KO is moved to DO to D9.
FMOV K 0 D 0 K t 0 The same data is moved to multiple points

Data in the device designated as a source is moved to "n" points of devices beginning with the
device which is designated as the destination. Data in these "n" points of devices are identical.
If a device number is beyond the allowable device number range, data is moved only to the
devices within the range.
5. APPLIED INSTRUCTIONS

MOVE AND COMPARE (FNC 10 TO FNC 19)

5.3.8 EXCHANGE

XCH
(PI
FNC 17
(16132) ("1")
Object devices : 1
D
{- I.] [o t 4
0
1
-
Exchenge I
[K. H ( KnX KnY KnM KnS I I I T 1 C I D IV. 2 ]
Number of steps : XCH and XCH(P) .......................
5 steps
(D)XCH and (D)XCH(P) ............ 9 steps

r02*1 Data is exchanged between the designated destination


devices. Note that data is exchanged in each operation
XCH (PI D 10 0 11
cycle (W!").

Before execution : (Dl01 = 100 + After execution : (Dl01 = 101


(D11) = 101 (D11) = 100

5.3.9 BINARY CODED TO DECIMAL

BCD FNC 18
(PI (16132)
Object devices :
+sr .H
Binary Coded To
Decimal
I K . H I K ~ x ( K ~ Y IT KI ~C MI IDKIv.z]
~s(
+or -]------I
Number of steps : BCD and BCD(P) .......................5 steps
(DIBCD and (D)BCD(P) ............9 steps
Cs -3 CD .I
Binary data in source device is converted to
BCD D 12 K2Y 0 BCD data and moved to the destination device.

If the result of BCD conversion executed by a BCD or BCD(P) instruction is outside the range of
"0 to 9,999: an error occurs.

If the result of BCD conversion executed by a (DIBCD or (D)BCD(P) instruction, is outside the
range of "0 to 99,999,999", an error occurs.
The BCD instruction is used to convert binary data in the PC to be output in a seven segment
display, for example.

5.3.10 BINARY

BIN FNC 19
(PI (16132)
Object devices : s[- - +-I .a
Binary I K , H [ K ~ x I K ~ Y I K ~ M I KT ~ IS C
I I D (v.ZI
~[='-l .I+
Number of steps : BIN and BIN(P) ..........................5 steps
(DIBIN and (D)BIN(P) ...............
9 steps
Range : 0 to 9,999 or 0 to 99,999,999

Cs -1 CD -1
BCD data in source device is convened to binary data and
moved to the destination device.

The BIN instruction is used to input the setting value of BCD digital switches to the PC. If the
source device data is not BCD, an operation error occurs to set M8067 ON. In this case, however,
M8068 (operation error latch) is not set ON.
Constants K are not processed as object devices of this instruction because they are automat-
ically converted to binary data before any processing.
5. APPLIED INSTRUCTIONS

5.4 ARITHMETIC AND LOGICAL OPERATIONS (FNC 20 T O FNC 29)


5.4.1 ADDITION

ADD FNC 20 Objectdevices :


~
[-1
]/. [~2.]-4
(PI (16132)
Addition K. H I KnX I KnY I KnM 1 KnS 1 T I C ) D I V. ZJ

C
+o 4-3-
Number of steps : ADD and ADD(P) .......................
7 steps
(D)ADD and (D)ADD(P) ............
13 steps
Flags : M8020 (zero), M8021 (borrow), and M8022 (carry)

ADD D 10 0 12 D 14. (Dl01 + (Dl21 -, (D14)

The binary data in two designated source devices are added and moved to the designated
destination device. The most significant bit in each piece of data is used as the sign bit (positive
when "Onand negative when "1% The data is added algebraically such as :
(5 + (-8) = -3)
If the result of operation is "Ow,the zero flag is set.
If the result of operation exceeds 32,767 (16-bit operation) or 2,147,483,647 (32-bit operation),
the carry flag is set. See the following page.
If the result of operation is -32,767 or smaller (16-bit operation) or -2,147,483,647 or smaller
(32-bit operation), the borrowflag is set. See the following page.
In a 32-bit operation, the device of the lower 16 bits is designated when a word device is used.
The device which follows the designated device is the upper 16-bit portion of the 32-bit double
word. To avoid using the same device number, it is recommended to use even numbers when
designating a device.
The same device number can be used for the source and destination. If such a designation is
made, the result of the addition change with every operation cycle if a continuous execution
instruction (ADD, (D)ADD) is used.

t; (DO) + 1 -, (DO)

When a program such as that indicated above is written, "1" is added to DO data each time X1
goes from OFF to ON. This change is similar to the change found when an INC(P1 instruction is
executed. The differences are.that wth
i the ADD instruction, the zero, borrow, or carry flag is set
according to the process result.
5. APPLIED INSTRUCTIONS

ARITHMETIC AND LOGICAL OPERATIONS (FNC 20 TO FNC 29)

5.4.2 SUBTRACTION

SUB
(PI (16132)
FNC 21 Object devices : t-[si.] [sz]-.J
Sub traction
[ ~ . H l K n x l K n YIKnMIKnSI T I C I Iv. Z ]

Number of steps : SUB and SUB(P)


b-k
.......................7 steps
.3------1
(DISUB and (D)SUB(P) ............13 steps
Flags : M8020 (zero). M8021 (borrow), and M8022 (carry)

[si.] [s2.] [D -3
(DlO)-(D12)+(D14)
- SUB D 10 0 12 D 14

Data in the device designated by [S2. I is algebraically subtracted from the data in the device
designated by [ S l . I. The result is stored in the device designated b y [D. I.
E'xample : 5 - (-8) = 13
The function of each flag, the device designation method for 32-bit operation, the difference
between continuous execution and pulse execution instructions, etc. are the same as explained
for the ADD instruction in Section 5.4.1.

(Dl, DO) - 1 -, (Dl, DO)

The operation indicated above is very similar to the operation executed b y a (D)DEC(P) instruc-
tion. The difference is that the flags are obtained when a SUB instruction is used.
Howthe flags are set and the relationships between flag setting and positivelnegative numbers
are shown below.

-
Zero flag Zero flag Zero flag

- 2 , - 1 , 0n
, -32, 760
nn
32.767
n
.0.I
-u Borrow flag

Zero flag
~ h e ~ ~ ~ i n t h e <
".
data is "1
1
\
\
4
> The MSB in the
data is "0".
Carry flag

Zero flag

- 2.
-!!
- 1
n
0,-2. 147. 483. 640 --
m
I
m
I - 2. 147. 483.
n
Borrow flag Zero flag Carry flag
5. APPLIED INSTRUCTIONS

ARITHMETIC AND LOGICAL OPERATIONS (FNC 20 TO FNC 29)

5.4.3 MULTIPLICATION

MUL FNC 22 Object devices :


( P I (16132)
Multiplication
K.H(KnXIKnY(KnMIKnSI T 1 C 1 0 Iv.ZI

E
-D
t -I+
Only Z is allowed for 1Bbit operation
--4
Number of steps : MUL and MUL(P) .......................
7 steps
(D)MUL and (D)MUL(P) ...........
13 steps

(1) 16-BIT OPERATION

[sI.] [sz*] [O .] BIN BIN BIN


(DO) x (D2) -, (D5, D4)
-MUL D O 0 2 0 4
16 bits 16 bits 32 bits

The product of the data in the designated source devices is stored at the designated
destination device as a 32-bitdata. The lower 16 bits in the designated device and the upper
16 bits in the next device.
If DO = 8 and D2 = 9, in the program above, (D5, D4) = 72.
The most significant bit indicates the plus or minus sign ( 0 : plus, 1 : minus).
V cannot be designated for [D. I. For bit devices, bits can be designated between K1 and
K8. Remember that the result will be a 32 bit data, so if X4"is designated, the lower 16 bits
only are obtained as the result of the multiplication.
(2) 32-BIT OPERATION

[si.] [sz.] [O a] BIN BIN BIN

PI1 I D I ~ " L J D ~2 (1 ~0 4 -
(32
D l ,bits
DO1 x (D3,
32 bits
D2) -+

If a bit device is designated for the destination in a 32-bit operation, only the lower 32 bits
(D7, 64
D6,bits
D5, D4)

of the product are obtained. The upper 32 bits are discarded. In this case, conduct
operation after moving the data to a word device.
When word devices are used, it is not possible to monitor the contents of this 64-bit data.
In this case, calculate by monitoring the upper and lower 32-bit words of the result by using
the following :

64 bit result = (upper 32-bit) x 232 + (lower 32-bit)


The most significant bit indicates the plus or minus sign.
V and Z cannot be designated for [D- I.
5. APPLIED INSTRUCTIONS

ARITHMETIC AND LOGICAL OPERATIONS (FNC 20 TO FNC 29)

5.4.4 DIVISION

DIV FNC 23
(P) (16/32)
Objective devices : mSi
,] [s2,] 4
Division
[K, H I K ~ X IK~ YI KnS I
1 KnH T I C I D I V. Z 1
E
D
- -+I,. ---I
Only Z i s allowed for 1Sbit operation
Number of steps : DIV and DIV(P) ...........................
7 steps
(DIDIVand (D)DIV(P) ................
13 steps

(1) 16-BIT OPERATION


Dividend Divisor Quotient Remainder
[si .] [s2.] [D -3 BIN BIN BIN BIN
DIV D O D 2 0 4 (DO) + (D2) -, (D4) ..... (D5)
16 bits 16 bits 16 bits 16 bits

Division is executed by taking the data in the device designated as [ S l - I as a dividend and
the data in the device designated as [S2. I as a divisor. The quotient is stored in the device
designated as [Dm I and the remainder in its succeeding device.
V cannot be designated for [D. I.
(21 32-BIT OPERATION

[sI.] [sz.] [D *] Dividend Divisor Quotient Remainder


+ BIN BIN BIN BIN
(o)orvo 0 0 2 D 4 (Dl, DO) + (D3, D2) -, (D5, D4) ..... (D7, D6)
32 bits 32 bits 32 bits 32 bits

In this division process, the dividend is the data in the device designated by [ S l - I and the
following device and the divisor is the data in the device designated b y [S2. I and its
succeeding device. The quotient and remainder are stored in 4 devices beginning with the
device designated as ID. I as s h o r n above.
V and Z cannot be designated for [D. I.

Ref.: If a divisor is D",n operation error occurs and the instruction is not executed.

If a bit device is designated as ID. I, a remainder is not obtained.


The most significant bit in quotient and remainder indicates the plus or minus sign.
5. APPLIED INSTRUCTIONS

ARITHMETIC AND LOGICAL OPERATIONS ( F N C 20 T O F N C 29)


5.4.5 INCREMENT AND DECREMENT

INC FNC 24 Object devices :


(P) (16132) ("13 T ~I KC~ sI [ D
IK.HIK~xIK~Y~K~M Iv.ZI
Increment

DEC FNC 25
+Co .H
(PI (16132) ("1")Number of steps : INC, INC(P), DEC, and DEC(P)...............................3 steps
Decrement (D)INC, (D)INC(P), (DIDEC, and (D)DEC(P) .........5 steps '

to -1 In the example, the numerical value of the device designated

p by iD.1 increases b y "lneach time XO is turned ON.

If the instruction is not a pulse instruction, addition occurs in


each operation cycle.
(D 10) +I+
(D 10)
In 16-bit operation, adding " I " to +32,767 changes the data
to -32,768. No flag is set.

In 32-bit operation, adding "1 "to +2,147,483,647 changes the


data to -2,147,483,648. Again, no flag is set.

In the example, the numerical value of the device designated


-1 b y ID- I decreases b y "In each time XO is turned ON.

t; IDl o ) (' lo)


If the instruction is not a pulse instruction, subtraction occurs
in each operation cycle.
In 16-bit operation, subtracting "In
from -32,768 changes the
data to +32,767. No flag is set.

In 32-bit operation, subtracting "1 "from -2,147,483,648 chan-


ges the data to +2,147,483,647. Again, no flag is set.

(1) APPLICATION EXAMPLE


The c u r r e n t value stored in
counters CO to C9 is converted
into BCD data and output to
K4YO.
(C OZ) (K4Y 0) Z is cleared by the reset input
BCD XI 0.
II
The p r e s e n t d a t a s t o r e d i n
counters CO to C9 is output se-
quentially each time X I 1 is
turned ON.

CMP (PI K 9 Z
5. APPLIED INSTRUCTIONS

ARITHMETIC AND LOGICAL OPERATIONS (FNC 20 T O F N C 29)

5.4.6 LOGICAL AND LOGICAL SUM, AND EXCLUSIVE OR

AND FNC 26 Objectdevices :


(P) (16132)
An d
s[-t -1
I [s2 1-4
/ K . H I K ~ x I K ~ Y ITKI~CMI IDKIv.z]
~sI
OR FNC 27
(P) (16132)
Or
H o- *
Number of steps :
XOR FNC 28
(P) (16132)
Exclusive Or WAND (FNC 26) (D)AND (FNC(D126)
WAND(P) (FNC 26(P)) (D)AND(P) (FNC(D)26(P))
WOR (FNC 27) (D)OR (FNC(D127)
WOR(P) (FNC 27(P)) (D)OR(P) (FNC(D)27(P))
WXO R (FNC 28) (D)XOR (FNC(D128)
WXOR(P) (FNC 28(P)) (D)XOR(P) (FNC(D)28(P)) -
A "W" i s appended to 16-bit instructions.

Logical AND

[si.] c ~ 2 . 3 [D .] Logical multiplication operation is executed in


units of bits.
WAND D l 0 D l 2 D l 4 1 A 1 =I o A 1 =o
(0 10) A (D 12) + (D 14)
1 AO=O OAO=O

Logical OK
Logical addition operation is executed in units
[SI .] [s2 -1 [D -1 of bits.
1 V l =l O V l =l

(0 10) v (D 12)+(D 14) O v O = O 1v o = 1

Exclusive OR

[sI'] [s~'] Co -1 Exclusive OR operation is executed in units of


bits.
WXOR D 10 0 12 0 14
l+1 =o o v o =o

"Exclusive NORWoperationis possible b y combining the XOR instruction with F N C 1 4 (CMLI.


5. APPLIED INSTRUCTIONS

ARITHMETIC AND LOGICAL OPERATIONS (FNC 20 TO F N C 29)

5.4.7 NEGATION

NEG FNC 29 Object devices :


(P) (16132) ("1") [K.HIK~xIK~YIK
T ~
( M
C IK
0 ~I v
s .Iz ]
Negation
or-t -.
Number of steps : NEG and NEG(P) .......................3 steps
(D)NEG and (D)NEG(P) ...........5 steps

Each bit of data in the device designated as [ D - I is inverted ("On+ "I", ,n-I" "0'3 and then "1"is
added to the inverted bits with the result stored at the same device.
This instruction yields an absolute value of a negative binary data (and also vice-versa)

(1) APPLICATION CIRCUIT 1


Obtaining an absolute value of a negative value

Me000 MO is turned ON if the bit 15 of Dl0 is


-1 BON 0 10 M 0 K 15 "1 ".
. The negation instruction is applied to
D l 0 when only MO is turned ON.

(2) APPLICATION CIRCUIT 2


Obtaining an absolute value after subtraction

b % I I i ' CMP 010 020 M I 0

12
1 SUB 020 0 10 030

Using the circuit shown above, D30 always gives an absolute value of the difference between
the data in the two registers without executing complementary operation.
5. APPLIED INSTRUCTIONS

ARITHMETIC AND LOGICAL OPERATIONS (FNC 20 TO FNC 29)

EXPRESSION OF NEGATIVE NUMBERS AND THEIR ABSOLUTE VALUES (REFERENCE)

( 0 10) =2 FX2 Series Programmable Controllers express


~ o I o I o I o I o I o I o I o I o I ~negative
~ ~ ~ numbers
~ ~ ~ ~in~the~ form
~ ~ ~of ]2's comple-
ment as shown on the left.
(D 10) =I . If the most significant bit is "1 ",the number is
~ ~ ) o ~ o ) o ~ o ~ o ~ o ~ o ~ negative.o ~ o ~ Itso absolute
~ o ~ value
o ~ ois obtained
~ o ~ ~using
~
the NEG (complementary)
- - instruction.
( 0 10) -0
[ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 1 0 ] 0 ~ 0 ]

(0 10) =-I (0 10) +1=1


~ 0l~~
[ l ~ l ~ l ~ l ~ l ~ l ~ 0 ~l0~
l 0 l
~ ~
0 ~ l
0 ~
~ 0 l
~ ~
0 ~ l
0 ~
~ 0 l
~ ~
0 ~
-
( 0 10) =-2
-(D 10) +1=2
~ 1 ~ 1 ~ 1 ~ 1 ~ 1 ~ 1 ~ 1 ~ 1 ~ 1 ( 1 ~~ 01~ ~0 1~ ]0 1] ~0 1~ ~0 1~ ~0 0~ ~0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~
-
(D 10) =-3
-
(D 10) +1=3.
~ 1 ~ 1 ~ 1 ~ 1 ~ 1 ~ 1 ~ 1 ~ 1 ~ 1 ~~ o1 l o
~ l1 o ~~ 1o ~~ o1 ~~ o 1~ ~o ~
-
0 o~ ~1 o ~ o ~ o l o l o ~
,(D 10) =-4 (0 -10) +1=4
~ 1 ~ 1 ~ 1 ~ 1 ) 1 ~ 1 ~ 1 ~ 1 ~ 1 ~ 1 ~~ 01 ~~ 0
1 ~~ 10 ~~ 10 ~~ 00~ ~0 0] ~- 0 ~ 0 ~ 0 ~ 0 ~ 0 ~
-
(D 10) -5
~1l1l1~l1~l1l11~l1~11 - (D 10) +1=5
~O l~l 1O ~I 1O 0
~ 1
O ~
~ 1
O ~i l O ~ O ~ O ~ O ~ O I O ~ O

,
I
-
(D 10) -32. 765 (D 10) +1=32. 765
~ 1 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 --r
~ 0~ ~
0 ~0 1 ~~ 01 ~~ 10) ~1 ~0 1~ ] 01 ~ 11 ~~1 1~ 1~ ) 1 ] 1 ~ 1 ~ 1
-
(D 10) -32, 766
[1l0l0l0l0l0l0l0l0l0l0l0l0l0l1l0 - (D 10) +1=32, 766
l0l1l1l1l1l1l1l11111l1lil1ltl1j0
-
(D 10) -32. 767
- (D 10) +I-32. 767
[ 1 ~ 0 ~ 0 ~ 0 [ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~~ 00 ~
~ 0
1 ~
-
~ 01 ~
~ 01 ~~ 01 ~) 11 ~ 1 ~ 1 ~ 1 ~ 1 ~ 1 ~ 1

( 0 10) -32, 768


-(0 10) + I=-32. 768
~ 1 ( 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0~ ~1 0~ ~0 0~ ~0 0~ ~0 0~ ~0 0
~ ~
0 0 j ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~
( 0

.* A
'
The maximum absolute value is 32,767.

\ J
5. APPLIED INSTRUCTIONS

5.5 ROTATION AND SHIFT (FNC 30 TO FNC 39)


5.5.1 ROTATION (RIGHTILEFT)
I I

I
t

II IbP"1613:c(131:
Rotation, Right
Object devices : ~

I K. H 1 KnX I KnY IKnM 1 KnS ( T I C I D I V. Z I


,.

Number of steps . : ROR, ROR(P), ROL, ROL(P) ....................................5 steps


(D)ROR, (D)ROR(P), (D)ROL, (D)ROL(P) ..............9 steps
Rotation amount : n S 16 (16-bit instruction)
n S 32 (32-bit instruction)
Flag , : M8022 (carry)

This instruction rotates 16- or 32- bit data to the right (RORI'or left (ROL).

Rotation Left . ' :


- . . Rotation Right

I
~ e frotation
i Right rotation
C- __C

MSB LSB MSB LSB


1 ~ 1 ~ 1 ~ 1 ~ 1 ~ 1 ~ 1 ~ 1 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0
t
t
'n" bits "n" bits .

MSB
Carry

u After one rotation

LSB MSB
After one rotation
Carry

LSB

I
I 2]
2 . .. I 2 2 pq
b Z

Bit data is rotated "n" bits to the left each . Bit data is rotated "n" bits to the'right each
time XO is turned from OFF $0 ON. The bit time XO is turned from OFF to ON. The bit
data of the final rotation bit is stored in the data of the final rotation bit is stored in the
carry flag. carry flag.
Bit data is rotated in each operation cycle when a continuous execution instruction is used.
8 The explanation abo,ve shows how. the ROR and ROL in-structions are executed for 16-bit
instructions. The same processing occurs
h t i w 32-bit instructions.
For the "digit" number designation of the destination device, only K4 (for 16-bit instructions) or
K8 (for 32-bit instructions) can be used.
. .
Example : K4Y10, K8MO
5. APPLIED INSTRUCTIONS

ROTATION AND SHIFT (FNC 30 TO FNC 39)

5.5.2 ROTATION WITH CARRY (RIGHTILEFTI


-
RCR FNC 32 Objectdevices :
( P I (16132) ("1'7 lK.HIKnXIKnYIKnMIKnS1 T I C I D IV.i!j
Rotation Right
Gth Carry DC+ - .
Number of steps : RCR, RCR(P), RCL, RCL(P) .....................................5 steps
RCL FNC 33 (DIRCR, (D)RCR(P), (DIRCL, (D)RCL(P) ...............9 steps
(P) (16132) ( " ! " ) R o t a t i o n amount : n S 16 (16-bit instruction)
Rotation Leff w-th n S 32 (32-bit instruction)
Carry Flag . : M8022 (carry)

This instruction rotates 162 or 32-bit data to the right (RCR) or left (RCL).

~ o t a t i o nLeft Rotation Right

MSB
Left rotation .
LSB MSB
-
Right rotation
LSB

ME022 ,
Carry
. .

"n" bits
t "n" bits
1 M8022
Carry
Example : M8022 = OFF Exsmple : M8022 = OFF

MSB
a After one rotation

LSB MSB
a After one rotetion

LSB
~ 1 J 1 ~ 1 ~ 1 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~[ 0
0 ~~ 00~ ~0 (0 1~~ 01 )~ 11~ ~1 1
) 1~~ 11 ( 1 ~ 1 ~ 1 ~ 0 ~ 0 ] 0

Bit data is rotated "n" bits to the left each Bit data is rotated "n" bits to the right each
time XO i s turned from OFF to ON. time XO is turned from OFF to ON.

If M8022 is activated before- the execution of a rotation instruction, the carry flag inside the
rotation loop is sent to the destination.
Bit data is rotated in each operation cycle when a continuous execution instruction is used.
The explanation above shows howthe RCR and LCR instructions are executed for 16-bit data.
The same processing occurs for 32-bit instructions.
For the "digit" number designation of the destination device, only K4 (for 16-bit instructions) or
K8 (for 32-bit instructions) can be used.
Example : K4Y10, K8MO
5. APPLIED INSTRUCTIONS

ROTATION AND SHIFT (FNC 30 TO FNC 39)


5.5.3 SHIFT (RIGHTILEFT)

SFTR FNC 34 Object devices :


(P) (16) ("1")
Shie Right
. nr.1
[ x l v l w l s J [ T I
ID -)I n2snis1024
SFTL FNC 35
(P) (16) ("1")
Shift Left Number of steps : SFTR, SFTR(P) ...........................9 steps
SFTL, SFTL(P) ...........................9 steps

The instruction is used.to execute an.n2 number of bit shift to the right (SFTR) or left (SFTL) for
an n l long bit device (n2 5 n l s 1024).
Shift is executed each time the drive input is turned from OFF to ON when a pulse instruction is
used. If a continuous execution instruction is used, shift is executed with each operation cycle.
Bit Shift Right
(I) M 3-44 0 Overflow
Cs:l [o*] ni n2
-c

p;L-STRP)~X
.
0 I M 0 1 K 1 I K 4
(2)M 7-M
( 3 ) M 11-
4 -c

8 --M
M 3-44 0
7-44 4

"n2" bit shift right


- ' (5) X 3-X 0 *M 15-44 12

O ~ M 9lt4 ell4 71M 61M 5 1 ~4 1 ~JIM 2 1 ~$ 1 ~0)

w
(1)
Bit Shift Left

[s.] .] ( I ) M 15-M 12 -c Overflow


[O ni n2 ,
(2) M 11-M 8 --M 15-44 12
p;eVn./X - O I M O K 1 6 I K 4 +
(31 M 7-44 4 *M 1l-M 8 ."
(4) X 3-X 0 -c M 7-44 4

"n2" bit shift left - [X 3 1 ~2 1 ~ ~ I x0


I I I
[M 1 5 1 ~1 4 1 ~1 3 1 ~1 2 1 ~11It-l 10lM 9 1 ~ BIM 7111 6 1 ~S[M 4 1 ~3 1 ~21t4 1 1 ~0

w
i( I 1 .,
5. APPLIED INSTRUCTIONS

ROTATION AND SHIFT (FNC 30 TO FNC 39)

5.5.4 WORD SHIFT (RIGHTILEFT)

WSFR FNC36 Object devices :


( P I (16) (77
Word Shift Right
ws - *
[ K . H I K ~ x I K ~ Y I TK I~ CMI~DK )~v s. zI ~
. .
t-l f12
Ill.
-OH
(WSFL FNC37
(P) (16) ('77 n2sn 1s5 12
Word Shift Left
Number of steps : WSFR, WSFR(P) ........................9 steps .
WSFL, WSFL(P) .........................9 steps

The instruction is used to execute an n 2 number of word shiftto the right (WSFR) or left (WSFL)
for an n l word long word device (n2 5 n l 5 512).
Shift is executed each time the drive input is turned from OFF to ON when a pulse instruction is
used. If a continuous execution instruction is used, shiftis executed with each operation cycle.
For the devices ([S- I and [D. I ) which require the specification of the number of digits, the same
digit number must be specified.

Word Shift Right

-
n2-word shift t o the right
(4) 0 25-0 22 - 0 21-0 18 _

+ I
2510 2410 2310 2210 2110 2010 1910 1810 1710 1610 1510 1410 1310 1210
(5)0 3-0 0 -L D 25-0 22
ill0 l o ]

.-.
(11
Word Shift Left
-
(I0)2550 22 Overflow
[S a] [O .] ni n2
-c

(2) 0 2150 18 -L D 2543 22


W!FL(P) 0 0 0 10 K 16 K 4 (3)0 17-0 14 -- 0 21-0 18

-
n2-word shift to the left

2510 2410 2310 2210 2110 2010 1910 1810 17l0 1610

,
w i (11
--
5 . APPLIED INSTRUCTIONS

ROTATION AND SHIFT {FNC 30 T O FNC 39)

5.5.5 SHIFT REGISTER WRITE

SFWR FNC 38
(P) (16) (1'9
Object devices :
s[o-t
Shift Register W i t e
I
1
[ K H 1 KnX KnY 1 KnH 1 KnS 1 1 I C I D I V, Z 1
C
o-k *H
2SnS512
Number of steps : SFWR, SFWR(P) ........................7 steps
Flag : M8022 (carry)

- - - -

61° 1 SFWR(P) D 0 D 1 K 10

n = 10 points
This is a data writing instruction for FlFO

Source
10 01 o elo 710 610 510
I
o When XO goes ON, the data in DO is stored in 0 2 and the data in D l becomes "1". After changing
the data in DO, turn XO ON and the data in DO is stored in D3. The data in D l changes to "2". The
data in the source device is sequentially stored in the registers.
The data is stored sequentially beginning with the rightmost register. The number of times the
source device data has been written to the destination device is stored in D l . If the data in D l
exceeds "n-l", processing is not executed and carry flag M8022 is set.

5.5.6 SHIFT REGISTER READ

SFRD FNC 39 Object devices :


(P) (16) (BIU) +rs
Shift Register
Read [ K H I K ~ X I K ~ Y I K ~ MT I KI ~C SI I D Iv.21
41-
2SnS512
Number of steps : SFRD, SFRD(P) ..........................7 steps
: M8020 (zero)

SFW)(p) D D 20 K This is a data reading instruction


for FlFO control.

Pointer

Data in D2 is sent to D20 when'X1 goes ON. At the same time, the data in pointer D l decreases
and the data from D3 to D l 0 shift one word to the right. The data is shifted in each operation
cycle when an SFRD instruction is executed.
Data is always read from D2. If the data in pointer D l is zero, process is not executed and the
zero flag M8020 is activated.
@
The data in D l 0 remains unchanged when this reading process is executed.
5. APPLIED INSTRUCTIONS

ROTATION AND SHIFT (FNC 30 T O FNC 39)

1
FIRST-INIFIRST-OUT CONTROL

To take out products-hhich have been stored in a warehouse with the product numbers registered
in the PC memory in the order they were stored, the following circuit example outputs the product
number to be taken out.
In this e ~ a m ' ~ l the
e , product numbers are registered as a hexadecimal (4 digits or less) and the
maximum allowable stock volume is 99 items.

Warehousing (store) request

f
pushbutton switch
A product number is input from XO to X I 7 and
sent to D256.
MOV (PI K4X 0 D 256 D257 is used as a pointer and 99 points (D258
to 0356) are used as data registers to store the
product numbers.
In response to the warehousing (remove) re-
. ' '. Warehousing (remove) request
quest; the product number of the product
/ pushbutton switch stored first is output to D357.
X 21 The product number of the product to be taken
---I,I sSFRD(P1 0 257 D 357 K 100 o u t , i s o u t p u t t o YO t o Y17 as a 4 - d i g i t
hexadecimal.
-
1-
M8000
'
RUN monitor
MOV (D 357 1 K4Y 0

0
1 MOV
LO

K4X
(P)
X 020

000
12 - When writing a program, either FNC12(P) or FNC(P)12
is used. Howver, mhen the program is displayed, it is
shown like this.

6 SFWR (PI 38

14 SFRD (P) 039


D
0
257-
357
- If an index modifier is used, either V or Z is displayed
here.

21 LO Me000
- 22 MOV 12
0 357 The step numbers are managed automatically.

27 END
5. APPLIED INSTRUCTIONS

5.6 DATA OPERATION (FNC 40 TO FNC 49)

5.6.1 ZONE RESET

ZRST FNC 40 Object devices :


(P) (16) IK.HIK~X~K~
T Y
1 CI K
1 0~IM
v . zI] K ~ S I
Zone Reset
Mi w ] [ 0 2 . H
[ D l - 1 number S I D 2 - I number
I x l v l n l s )
Designate the same device.
/-Pi -1Co2 .H
Number of steps : ZRST, ZRST(P) ..........................5 steps

[DI.] [D~o]
ME002 - Bit devices M500 thro,ugh M599 are batch reset.
ZRST M 500 M599

[DI -3 [02-]
Word devices C235 through C255 are batch reset.
ZRST C 235 C 255 (%"is written and the contacts and coil image are cleared)

For [ D l : I and [D2. I , designate the same device. The device numbers must be [ D l . I number s
[D2- I number.
If [ D l - I number > [D2. I number, only the device designated by [ D l . I is reset.
Although the ZRST instruction is processed as a 1&bit instruction, 32-bit counters are designated
for [ D l . I and [D2. I.
Note: Combined,designation ofboth a 16-bit and 32-bit counter (for example, a 16-bit counter for
I D 1. I and 32-bit counter for 102-11 is not a l l o w d .

OTHER RESET INSTRUCTIONS


A RST instruction is provided to reset devices individually.
An FNC16 instruction (FMOV) is provided to block write KO. Using this instruction, it is pos-
sible to write "O'jto devices KnY, KnM, KnS, T, C, and D.
5. APPLIED INSTRUCTIONS

DATA OPERATION (FNC 40 TO FNC 49)

5.6.2 DECODE
DECO FNC 41 Objectdevices :
(PI (16) , I----Cs *H H s -H
Decode
[ X l Y l M l S ] JK.HI T I c I 0 Iv.21
- - -
k-40 .H -0 n -H
n=l4
Number of steps : DECO,.DECO(P) ........................7 steps

X 2 X 1X 0

rrx.
M 1 7 M 1 6 M 1 5 M 1 4 M 1 3 M 1 2 M 1 l M 10

+
t
As the source is "1 2 = 3". "1" is set
t
,

"1" isset for MI0 if


If designated destination device [D. I is T, C, or D,
"n" must be 4 or less. Each bit of the destination
device is controlled.

for MI3 wtich is three places from M I0. the source is all "0"s.

5.6.3 ENCODE
ENCO
(P) (16)
Encode
FNC 42 Objectdevices :
+Cs -1-4 ' +rs .F----l
x l v l ~ l s l IK.HI T 1 c I o Iv.z]
+Con *H
I n- 1-8
Number of steps : ENCO, ENCO(P) .......................7 steps

M 1 7 M 1 6 M 1 5 M 1 4 M 1 3 M 1 2 M 1 l M 10
If designated source device IS.I is T, C, D, V, or
2, "n" must be 4 or less. If more than one bit in
the designated source device is "I", only the
highest position bit for which "1 "is set becomes
effective.
MSB D~O LsB If all of the bit data in the designated source
Because the third position data in the source device is "0: an error occurs.
is "l",value in D l 0 is 3 (1 + 2).

POINTS FOR DECODEIENCODE


I If "n = 0: processing is not executed. I
I If [D. I,designated with a decode instruction, or [S. I,designated with an encode instruc-
tion, is a bit device when "n = 8: the number of points is 256 (28). I
I The designated instruction is not executed if the drive input is OFF. The currently active.
decode output remains active even if the drive input is then turned OFF. I
5. APPLIED INSTRUCTIONS

DATA OPERATION (FNC 40 T O FNC 49)

5.6.4 SUM ..

SUM FNC 43 ' Object devices :


(P) (16132)
SumofONbits - ,
- IK.HIKnXIKnYlKnMIKnSI T I C I D ]V,Z]

-.- - Number of steps .: SUM, SUM(P) .............................7 steps


(D)SUM,(D)SUM(P) ..................9 steps
Flag : M8020 (zero)

[S
- *I - [D. *] - The number of "Ins in DO is stored in D2.

SUM D 0 D 2 If there is not a "In


bit in DO, the zero flag M8020 is set.
P O

When a (D)SUM or (D)SUM(P) instruction is used, all bits in D3 become."Onas the number
. . of "1"s
in the 32 bits of D l and DO is sufficiently stored in D2. . .
. .

5.6.5 BIT ON CHECK


-
BON FNC 44- - object devices :
( P I (16132)
Bit on Check
sc- - *

I K . H I K ~ X ~ K T~ IYC ~( K
D ~ M(K~SI
Iv.z]
k+ [ X l Y l M l s l
n = 0 through 15,, or 0 through 31
t+~ OH
Number of steps : BON, BON(P) .............................7 steps
(D)BON, (D)BON(P) ..................13 steps

Cs -1 [D*] If bit 1'5 ( n = 15) in D l 0 is "In,


MO is turned ON.
EON D 10 M 0 K 15 MO remains unchanged if XO is OFF.

--
~ 0 ~ 0 ~ 1 ~ 0 ~ 1 ~ 0 ~ 1 ~ 0 ~ 1 ~ 0 ~ 1 ] 0 ~ 1 ~ 0 ~ 1 ~ 0 ] -

s The range of "n" is as indicated below:


a \

- .-
, I

16-bit operition : 0 through 15


32-bit operation : 0 through 31
5. APPLIED INSTRUCTIONS

DATA OPERATION (FNC 40 TO FNC 49)

5.6.6 MEAN

MEAN
( P I (16)
FNC 45 Object devices : +rs
, Mean
-
1 ~C S I D
I K . H I K ~ x I K ~ Y I K ~ HT~ K I Iv.z]
H
n +Co *3------.1
4 .
n-1-64
Number of steps : MEAN, MEAN(P) ........................7 steps

j .
- d .
MEAN D .0 ~
D 10 K 3 (0 Ol + (0
3
1) + (0 2)
- (D

The mean value of n number of points of source data is stored in the destination. The algebraic
sum is divided by "n".
The remainder.is discarded. If the device number is out of range, value "n" is automatically made
smaller such that a mean is calculated for the devices that are within range.
If the designated "n" is outside the range of 1 through 64, an error occurs.

5.6.7 ANNUNCIATOR SET

ANS FNC 46 Object devices : [S.]: TO to TI99 [D. I : S900 to S999


(16) rn = 1 t o 32,767 (100 msec increments)
Annunciator Set Number of steps : ANS: ............................................
7 steps-

rs-I m CD.1
A utility instruction used to drive an annun-
S900 ciator.

S900 is set if XO and X1 are ON for more than 1 second simultaneously. If XO and/or X I is turned
OFF after S900 is set, S900 remains set while the timer is reset.
If either XO or X1 is turned OFF in less than 1 second, the timer is reset.

5.6.8 ANNUNCIATOR RESET

ANR FNC 47 Object devices : None


(P) (16) (7") Number of steps : ANR, ANR(P) ..............................1 steps
Annunciator Reset

When X3 is turned ON; the annunciator which has been activated among
S900 through to S999 is reset.
If more than one annunciator is activated, the annunciator with the lowest
number is reset.
The activated annunciator with the next ascending number is reset when X3
is turned ON again.
;C7 ANR (P)
Note: Annunciators which have been activated are sequentially reset
one-by-one each time an operation is executed when an ANR
instruction is executed.
5. APPLIED INSTRUCTIONS,

5.7 HIGH-SPEED PROCESSING (FNC 50 TO FNC 59)

5.7.1 REFRESH

REF FNC 50 Object devices : a [Dl.........X or Y assigned


"0"in its lowest digit place : XO, X10, X20, etc. .
(PI (16) ('77 n .............
K or H assigned with a number of multiple of 8.
Refresh Number of steps : REF, REF(P) ...............................
5 steps

As described before, FX Series Programmable Controllers employ the inputloutput batch refresh
method in which the data at the input terminals are transferred to the input image memory before
beginning execution at step 0. Data is output to the output terminals via the latch memory from the
output image memory after the execution of the END instruction.
This instruction is used either to read the latest input information while an operation is being executed
or to output the result of the operation immediately after the completion of the operation.
Note: The first destination device number to be designated must be a multiple of "10': such as
X l o r YIO. The number ofpoints to be refreshed is a multiple of "8: Designation ofnumbers
other than these causes an error.
There may be cases that a REFinstruction is required in a step in a FOR and NEXTloop and
a step between a label (lower number) and a CJ instruction (higher numberl loop.

(1) INPUT REFRESH

Only 8 points X I 0 to X17 are refreshed.


If X10 to X17 have been ON approximately 10 msec (response delay time of filter) before
this instruction is executed, image memory X1O to XI 7 is turned ON when the REF instruction
is executed.
(21 OUTPUT REFRESH

-
FIEF 1 Y 0 I K 2 4 1
-

24 points (YO to Y7, Y10 to Y17, and Y20 to Y27) are refreshed.
If any point from YO to Y27 is ON, the corresponding output of the output latch'memory is
turned ON when the REF instruction is executed.
The output contact is actuated after the output relay response time elapses.
5. APPLIED INSTRUCTIONS

HIGH-SPEED PROCESSING (FNC5O TO FNC 59)

5.7.2 REFRESH AND FILTER ADJUST


r - - - - .
REFF FNC 51 Object devices :. IX
&----a
0-)( 7 1 (designation not necessary)
-
w
( P I (16)
Refresh and Filter (filter constant : rnsec)
Adjust

Number of steps : REFF, REFF(P) .....................3 steps -


-

The image memory of inputXOto X7 is refreshed, taking the input


filter constant as 1 msec when X I 0 is ON. The input filter
constant is taken as 10 msec until this instruction is executed.

For the steps which follow this step, the input filter constant is
set to 20 msec.

Generally, PCs are provided with a C-R filter of approximately 10 msec filtering time for inputs as
a measure for input contact chattering and noise.
However, this filter is a disadvantage for high-speed data input from electronic solid-state
switches which do not inherit chattering noise.
FX Series PCs are provided with digital filters for inputs XO to Xi'. Filtering time can be changed
by a REFF instruction in the range of 0 to 60 msec.
However, these inputs are also provided with a minimum C-R filter, which cannot be set to less
than 50 psec.
An REFF instruction is executed in each operation cycle when X I 0 is ON. However, an REFF(P)
instruction is executed only when X I 0 goes from ON to OFF.
This instruction is not executed when X I 0 is OFF and the filtering time of input filters for XO
through X I 0 is 10 msec. (values for input processing).

Rei: -0 The filtering time of input filters for these instructions are automatically set to 50psec if an
interruption pointer is used, if X I to A7 is used for high-speed counters or if an FNC56
instruction is used.
. ,
5. APPLIED INSTRUCTIONS

HIGH-SPEED PROCESSING (FNC 50 TO FNC 59)

5.7.3 MATRIX

MTR FNC 5 2 Object devices : [Sl : XO, X10, X20 ......X assigned with a number who& lowest digit is "0".
(16) [ D l ] : YO, Y10, Y20 .....
Y assigned with a number whose lowest digit is "Om.
Matrix ID21 : Y, M , S ..............
The lowest digit place is 0.
n : K,H n = 2 t o 8
Number of steps : MTR ..................................
9 steps
Flag : M8029 (completion of execution)

The MTR instruction is used to read 8


points x "n" rows of input signals se-
quentially using 8 input points and "n"-
rs I $?I 6 2 1
plL
t n,
point outputs.
MTR ~ X i O ~ Y 2 O ~ M 3 3 O ~ K 8 input points of, beginning with an
input designated b y [SI,are oc-
cupied.
Third row "n" points of transistor outputs,
beginning with the output desig-
0.1 A 50 V diode' nated by [Dl1 are occupied.
In the example shown on the left,
three output points (Y20, Y21, and
Y221 are turned ON sequentially and
Second row
repeatedly. Each time an:output is
turned ON, the inputs of the first,
second, third rows are read sequen-
tially and repeatedly and stored to
X 1 4 X 1 5 X 1 6 X 17
M30 through to M37, M40 through to
M47, and M50 through to M57 ac-
Firstrow , cordingly.

a
- " X 6 1 -Readingof the 1st row inputs
.' "
A -
, -

I Reeding of the 2,nd row inputs


'
i PC (transistor output)

, $ > > $ i + $ > . )


L f'
k ~i

Reading of the 3rd row inputs


1 1 -
I

COMS~Y 20(Y 2 l l Y 221Y 231~2 4 1 ~2 5 1 ~261~27


I 1 I I

For each output, I10 processing is imme-


diately executed by the interrupt method
in intervals of 20 msec allowing 10 msec
response delay of input filters.
0 Using this MTR instruction, the inputs of 64 points are read using 8 input points and 8 transistor
output points. For this processing, however, a total of 160 msec (20 x 8) is required to read all
inputs. This is not the proper instruction for inputs which require a quick response. When inputs
XO to X7 are used, the reading time of each row is reduced to approximately
.. 10 msec. Thus,,
approximately 80 msec are required to read all inputs.
~ 3 v t M37
o remain &changed if the drive input is OFF. The execution complete flag M8029 is
set after the completion of initial operation cycle. The flag is reset when the drive input is turned
OFF.
Q
This instruction can only be used once.
5. APPLIED INSTRUCTIONS

HIGH-SPEED PROCESSING (FNC 50 TO FNC 59)

5.7.4 SET BY HIGH SPEED COUNTER

Object devices .. :
( 16/32)
Setby High
Speed CountKr I SC (
[ K . H ~ K ~ X I K ~ Y ( K ~ M ITK ~ I D (v.zj3
[ S 2 - ] : C235 to C255
. .
, *
- (high-speed counter) IX 1 Y I M 1
1 s
, * H o *H
,, ,... .. . -Number of ste,ps , : (D)HSCS ...................................;. 13 steps i

Y l 0 is set immediately when the current value.of C255 changes, for example, from 99 to 100 or
101 to 100.
0 A high speed'ciounter counts the number-of status changes from ON to OFF of the. input
corresponding to the counter number in the interrupt mode as s h o r n in Section 4.7.2 (2).

The counter output contact is activated immediately when the counter current value reaches the
preset value.
Using an FNC53 instruction allows both setting anc! output to be executed in the interrupt mode.
The higher two digits of object output devices should be the same (FNC53, FNC54, FNC55).

f 3
POINT
The instructions FNC53, F N C a~n ~d ' ~ ~ are
~ 5executed
5 by the interrupt method when a
pulse arrives at the input terminal.
Therefore, the output contact Y10 is not activated if there is no input pulse even when X I 0
is turned ON and the conditions of the comparison for which Y10 is set is true.

F--
1U

t - (0)HSCS K 0 C255, Y 10

External Reset Mode Flag:

[[f@ .
1 (0)HSCS K 0 C255 Y 10

If the flag M8025 is driven ON, all the related high speed compare instructions are executed
when the reset input of the counter is turned ON. This will solve the above mentioned prob-
lem in the initial condition where a reset is always necessary.
M8025 applies to the functions FNC53, FNC54, and FNC55.
J
5. APPLIED INSTRUCTIONS

HIGH-SPEED PROCESSING (FNC 50 TO FNC 59)


5.7.5 RESET BY HIGH SPEED COUNTER

HSCR FNC 54 Object devices : -s~


( 16/32)
Reset b y High K. H I K n X I K n Y IK~
IK nM
SI T 1 C I 0 I V. Z
Speed Counter
[S2-1 : C235 to C255
(high-speed counter) X l Y l M l S ]

U o -H
For [D.],designation of the same high-speed counter as designated for [S.]
is possible.
Number of steps : (DIHSCR .....................................13 steps

Y10 is reset immediately when the current value of C255 changes, for example, from 199 to 200
or201to200. - '

C255 output contact ' h


C255 is reset immediately when the current vake of C255 reaches 400. The current value is reset
to 0 and the output contact is reset to the'non-activated state.
-
5. APPLIED INSTRUCTIONS

H I G H - S P E E D P R O C E S S I N G ( F N C 50 TO F N C 59)
5.7.6 ZONE COMPARE FOR H.S.C

I HSZ
( 1 6/32)
FNC 5 5 1 Object devices :
I-' [SI .] [s2.} 4
1 Zone Compere for
KSC 1 [K.HIK~xIK~Y(K~H~T
K ~ S C( I D ( V . 2 1 1
I I [S.] : C 2 3 5 to C 2 5 5 (high-speed counter)

X l Y l M l S

I Number of steps : (D)HSZ ..................................17 steps

RST C 251

In the example shown on the left, FNC55


functions as indicated below.

A-phase : XO
Kg999 Bphase : X ] -, C251 current value
RUN monitor

(DIZCPV] ~ 1 0 0 0 K1200 C 251 Y 10


Y11 is turned ON with other outputs
turned OFF when K1000 4 C252 4 K1200

1 ' ,
(01 HSZ KlOOO K1200 C 251 Y 10
[S2. I data 4 [ S l - Idata
[sI.] [s2.] [s .] [o .]
An Example of High to Low Speed and Stop Counting, comparison, and external out-
Control put are all executed in the interruptmode.
Y10 to Y12 are turned OFF when input
X I 0 is turned OFF.
If a counter current value is rewritten
using for example a MOV instruction, out-
put state remains unchanged until the
succeeding counting operation.
The higher two digits of object output
devices should be the same..

Y I1 Low speed edvance -


Note: FNC53 through to FNC55 can be used
repeatedly like general instructions.
Hoivever, these instructions can be
executed simultaneously for up to 6
points in total only.

An HSZ instruction is only executed when


a pulse is input. Therefore, initial drive is
controlled by a ZCP instruction.
5. APPLIED INSTRUCTIONS

HIGH-SPEED PROCESSING (FNC 50 TO FNC 59)

5.7.7 SPEED DETECT

SPD FNC 56 : J - = = { s a - ]
(16)
Object devices -
4
Speed Detect .. IK.HlKnXIKnYIKnMIKnSI T I C I D Iv,Z]
8 +ED -1-4
F - s l .H
I xo-x5
Number of steps - : SPD..; ; ; ...................................
7 steps
Number of instructions : 1 instruction or less per 1 point of inputs XO through X5

[S1'l rs2'] '1 Input pulses designated b y I S 1 . l are counted


for the duration (in units of msecl designated by
SPD X 0 O
K
O
I D o [S2. I and the result is stored in the device
,
designated b y [D. I.
BY repeating this counting, the pulse' density (a
value which is proportional to rpm) is obtained
b y reading the'data in [D. I. [D. I occupies 3
~m------- devices.'
In the example s h o r n on the left, D l counts the
number.of "OFF to ONnoperations of XO. After
AG.
3,
100 msec, the counting result is stored to DO.
, f
\ 0
DO : Current value 0/ As the counted data is stored to DO, D l is reset
0
0 and begins counting the number of XO opera-
tions.

' looms
--I--
looms +
0 2 is used to measure the remaining time.
Value DO is proportional to rpm as illustrated on
. .
T the left.

D2 : Remaining time (msec)

Here, 2" represents the measuring intervals


'
(msec) designated by [S2. I.
The inputs used in this instruction cannot coin-
cide-with any other high speed process.
Roxinity switch
n pulseshev.
8r
5. APPLIED INSTRUCTIONS

HIGH-SPEED PROCESSlNG (FNC 50 TO FNC 59)

5.7.8 PULSE OUTPUT

:
PLSY
( 16/32)
Pulse Y
FNC 57 Object devices
t. ~si.1[sa*l-i
. 3
[K. H I KnX I KnY I KnM I KnS I T I C I D 1 v. Z]
[o -1 : 1 - q
Number of steps : PLSY ............................................
7 steps
- - - - (DIPLSY .................................
13 steps
Flag : M8029 (completion of execution)

-
.[si.] [ ~ 2 * ] [D .] * Number of pulses (DO)
4
--UU-U-L - n
i

Y O
t
PLSY KlOOO D 0 Y 0

The PLSY instruction is used to generate a specified number of pulses.


With [ S l . I,specify the frequency ( 1 to 1,000 Hz). -
With [S2. I,specify the number of pulses to- be generated. .Allowable number of pulses :
16-bit instruction ..... 1 to 32,767 pulses
32-bit instruction ..... 1 to 2,147,483,647 pulses
If 'Y)" is specified; pulses are generated infinitely.
With [D.I,specify the output number (Y number). . ,

Pulse duty ratio : 50% ON/50% OFF


ONIOFF is directly output by the interrupt meth'od.

Note: Wth a (DIPLSYinstruction, the specified number ofpulses is set with (Dl, DO).
The execution complete flag M8029 is set h e n the specified number of pulses has been
generated. l t is reset when PLSYinstruction is turned from ON to OFF.
Pulse generation stops h e n XI0 is turned OFF. M e n i t is turned ON again, pulse
generation begins from the beginning. During continuous pulse generation, YO is turned
OFF h e n XlOis turned OFF.
The data in IS1.1 can be changed during the execution of the instruction. However, i f the
data of IS2.1 is changed, it is ignored until the completion of operation.
This instruction can only be used once.
The PC should use transistor outputs.
5. APPLIED INSTRUCTIONS

HIGH-SPEED PROCESSING (FNC 50 TO FNC 59)

5.7.9 PULSE WIDTH MODULATION

PWM FNC 58 Object devices :


(16) isk
[- .] [s2.] '
4
Pulse Wdth
Modulation K, H I KnX KnY IKnM [ KnS ( T C I 0 IV. Z]

[D .] : 171
Number of steps : PWM .............................................
7 steps

- [SI-] -[s2.] .[D .]


-tf-t The instruction con-
trols the ratio of "t"
PWM D ~ OK 5 0 Y o n to "Ton(t : TO)
Pulse width Cycle
t TO

With [Sl.I,specify the pulse width in the range of 0 to 32,767 msec.


With [S2.I,specify the cycle TO in the range of 0 to 32,767 msec.
With [D. I,specify the Y number where a pulse is output.
- The ONIOFF control of this output is executed b y the interrupt method. '

Note: By changing the data in DlOin the range of Oto 50in the example above, the mean output
of YO changes in the range of 0 to 100% accordingly.
YOgoes OFF when XlOis turned OFF.
This instruction can only be used once.
5. APPLIED INSTRUCTIONS

5.8 HANDY INSTRUCTIONS (FNC 60 TO FNC 69)

5.8.1 INITIAL STATE

IST FNC 60 ,Object devices :


(16)
initial Stete
*H
Hs
[ x l y l n ( s ]

Number of steps : IST ................................................7 steps

- - -

Roo
I
.-IRUN
monitor
1
IST- X 20
I I
S 20
I
S 40
. I
An instruction to automatically control the initial
states and s ~ e c i aauxiliary
l relays in a s t e ladder.
~

[S- I : Designate the head input number of the operation mode input.
With the~aboveexample :
X20 : Manual operation X24 : Cycle opeiation
X21 : Zero return X25 : Zero return start
X22 : Step operation X26 : Automatic operation start
X23 : One-cycle operation . X27 : Stop
[ D l . I : Designate the lowest state number actually used in the automatic operation.
[D2. I : Designate the highest state number actually used in the automatic operation.
When this instruction is turned ON, the following devices are automatically controlled. If the
instruction drive unit goes OFF, the state does not change. . -
M8040 : Transfer inhib'it SO : Manual operation initial state
~ 8 0 4 1: Transfer start '.SI : Zero return initial state
M8042 : Start pulse S2 : Automatic operation initial state
M8047 : STL monitor enable . '
, . f

An IST instruction can only be used once.


For details concerning h o w t o use this instruction, refer to Section 3.4.1.
States S10 through to S19 (used for zero return) can used as general-purpose states h e n the
IST ii-lstruction'is not used.
In this case, however, it is still necessary to use SO through to S9 for the purpose of initial states
-
but the actual usage of SO to S2 is free.
The IST instruction must be programmed prior to a series of STL circuit such as states SO to S2.
For inputs X20 to X24, a rotary switch must be used so that any two of these inputs wil not be
turned ON at the same time.
If an operation mode is changed between X20 (manual), X21 (zero return), X22, X23, and X24
(automatic) while the zero return complete flag (M80431 is not set, all outputs will be turned OFF.
5. APPLIED INSTRUCTIONS

HANDY INSTRUCTIONS (FNC 60 TO FNC 69)

5.8.2 ABSOLUTE DRUM

ABSD
(16)
FNC 62 Object devices : -k [S 1.]odd nuhers,-(

Absolute Drum
~ K . H I K ~ X I K ~ YT IIKC~IM
0 IIv.21
K~SI
Multiples of "8"for
X, Y, M, and S
t-i
nS64 rs2 -1
\ x l Y l H l s l

Number of steps : ABSD ............................................ 9 steps +Lo el---A


An instruction to generate a variety of out-
. ABSD I 1 I '1
D300 C 0 M 0 K 4 put patterns in response to the counter
data

b0
x?i 1 IC 01
RST

1
4\ K350 An example program example to control the ONIOFF status of
auxiliary relays MO to M3 during one rotation of a rotary table.

Rotating angle signal (1 deglpulse)

Write the following data to D300 to D307 b y using MOVE instruction.

D300 = 40 0301 = 140 MO


0302 = 100 ~ 3 0 3= 200 . MI Store the turn ON point data in even num-
~304
= 160 0305 = 60 . , ~2- .
bered devices and the turn OFF point
I I
data in odd numbered devices.
D306 = 240 0307 = 280 M3

MO to M3 change as described below as XO is turned ON. The turn ON points and turn OFF points
can be changed individually by rewriting the data in D300 to D307.
40 140
M 0 1 7 The n u m b e r o f o u t p u t
100 200 points is determined by
the value set for "n".
M 1 I 1
o u t p u t s r e m a i n un-
60 160 c h a n g e d w h e n XO i s
M 2- t turned OFF.

0 The ABSD instruction can only be used once.


5. APPLIED INSTRUCTIONS

HANDY INSTRUCTIONS (FNC 60 TO FNC 691


5.8.3 INCREMENTAL DRUM

INCD
(16)
FNC 63

Incremental Drum
Object devices :
+ rs1.3 --i
- - . - - I K . H I K ~ x I K ~ YT( K
I C~ IMD ~Iv.21
K~sI
Multiples of "8"for
- .. ,. l-4 s,. H
-
_. . , nS64 cs2 -1
l
x l v l ~ l s
. - : INCD : .......................................
,Number of steps
Flag - : M8029 (execution complete)
9 steps
t---- [o -1-----I
i ,
I . I [sI.]' [sz-] '[D -1 n
An instruction to,generate a variety of out-
put patterns using a pair of counters.

1 sec clock

The following is an example of controlling four points (MO to M3).


Write the following-data to [SI.I in advance by using a MOVE instruction.

Counter CO is reset automatically in


, . .sequence as its data reaches the
values set for D300 to D303.
Process counter C1 counts the number
2 3 I I of reset times.
C1 current
data 0 1 fl p-Li. ! O
a
MO to M3 operates in sequence ac-
I I cording to the counter data of C1.
Flag M8029 is turned ON when the final
process designated b y "n" is com-
p l e t e d . Then, the same cycle is
repeated again.
Both CO and C1 are cleared when XO is
turned OFF. MO to M3 are turned OFF
at the same time. The operation starts
from the beginning when XO is turned
ON.

M8029 complete flag


n
The INCD instruction can only be used once.
5. APPLIED INSTRUCTIONS

HANDY INSTRUCTIONS ( F N C 60 T O FNC 69)

5.8.4 TEACHING TIMER

TTMR
(16)
FNC 64 Object devices : [D. ] :
n :
mJ n=0to2
Teaching Timer Number of steps : TTMR .................................. 5 steps

The duration of the period in which pushbutton


Co.1 n switch X I 0 is pressed is measured by D301. The,
~("TTMRlD3OOlK 01 nated
measured
withperiod
"n" and
is multiplied
stored to by
D300.
the value
Using
desig-
this
. instruction, the timer setting time can be adjusted
' -with a pushbutton switch.
x m I
3; D300
O W *
Assume that the duration in which pushbutton
switch X I 0 is pressed to be "r0" (see), the value
stored in D300 changes as shown below accord-
ing to value "n". .

i-t ro m
to
Switch pressing time

. ,
. ,
D301 is reset when XO is turned OFF. D300
remains unchanged.

( 1 ) CIRCUIT EXAMPLE

Values are set in D400 to D409 in advance.


These timers are 100 msec timers. The actual operating time is 1/10 of
the teaching data.

I RUN monitor
Ma000
The input of the 1-digit digital switch connected to XO
kh[n:b"tton
'
I I
.
BIN KIX 0
I Z
I to
through
2. X3 is converted into binary data and moved

The duration (sec) i n which X I 0 has been held


pressed is stored a t D300.

Detection of release of teaching pushbutton switch.

Teaching time D300 is moved to D400Z, the timer


setting register that is selected by the digital switch.
5. APPLIED INSTRUCTIONS

HANDY INSTRUCTIONS (FNC 60 TO FNC 69)

5.8.5 SPECIAL TIMER


. . .

STMR F N C 65 Object devices : [S.] : 1- TO to T I 9 9 (100 msec timer)


( 1 6)
Special Timer

I ( Number of steps : STMR .................................. 7 steps


An-STMR'instruction facilitates the generation of off-delay timers, one-shot timers, and flash timers.

Cs -1 m Co .I
PIo [STMIIT ~OIK~OO(H 01 A value designated with "m" is taken as the
setting for the timer designated with [S. I.
b
I

X O ]
I I ,

I I I
M O I I I

1 MO is an off-delay time.
I I I
M 1 '% I
I
M I is an one-shot timer.
I I I I
M 2 n I
I II

, M2 and M3 are for flashing. Connect as shown


I 1 1 below.
M 3 I I

- * .

X A - - ,
Connect M3 as shown on the left. M2 and M I
provide flashing outputs.
- M a When XO is turned OFF, MO, MI, and M3 are
turned OFF after an elapse of the set time. T I 0
is reset also.
M 1
Do not use these timers in other general cir-
cuits.
5. APPLIED INSTRUCTIONS

HANDY INSTRUCTIONS (FNC 60 T O FNC 69)


5.8.6 ALTERNATE OUTPUT

ALT FNC 66 Object devices :


(PI (16) (7'7 l x l Y , l M l S ]
Alterne te

. .
Number of'steps : ALT, ALT(P)
.
., .............................
- .
. .~...
3 steps
. - ... .

CD *I MO state is inverted each time input XO is turned from


OFF to ON.

->
M 0
'Note that the inversion' occurs with everv o ~ e r a t i o n
cycle when an ALT instruction is driven contin"ously,

Using the above programmed MO as the input, driving


ti- . , ,MI htw
i an. ALT(P) instruction will provide a further
digital divides stage. i

(1) CIRCUIT EXAMPLE

, .
The start output Y1 operates when pushbutton switch XO is

w Y 0 Stop
, .
pressed. . , -.,

The stop output Yooperates when pushbutton switch XO is


pressed again.
5. APPLIED INSTRUCTIONS

HANDY INSTRUCTIONS (FNC 60 TO FNC 691


5.8.7 RAMP

RAMP FNC 67 Object devices : [S1.], [ s 2 . ] , [ D . ] : . .


(16) n : . n = 1 to 32.767
Ramp
Number of steps : RAMP ...................................
9 steps
Flag : M8029 (execution complete)

. ..
After writing an initial and target value to D l and D2, respectively, turn ON XO. The data in D3
changes gradually beginning with the value set for D l to the value set for D2. The time required
for this change, is "n" scans.

he number of scans is stored


(0 1) in D4.

t- n scans I- n scans
J

3 *

B; driving ~ 8 0 3 after
9 writing a scan time (a little longer tha'n the actual scan time) to D8039, will
make the PC enter constant scan mode. If the set value is 20 msec, for example, the value in D3
changes from the value set for D l to the value set for 0 2 in 20 seconds.
Ramp operationstops halfway if XO is turned OFF during ramping. Turning XO ON again clears
D4 and operation starts from the value set for D l . . I

After completion, flag M8029 operates and the value of D3 returns to the value of D l .
Cushion starttstop control can be perfarmed by combining a RAMP instruction with an analog
output.
To enter RUN while XO is ON, clear 0 4 before starting operation if D4 is made retentive.
HOLD AND REPEAT MODES
With the hold flag M8026 in its ON state, the final With the hold flag M8026 in its OFF state, D3 resets
value at the completion of the*RA,MPinstruction is to D l and repeats .
held.'
M8026 = ON HOLD MODE M8026 = OFF REPEAT MODE
!

XO xo 0

(0 1) Q 1)
5. APPLIED INSTRUCTIONS

HANDY INSTRUCTIONS (FNC 60 TO FNC 69)

5.8.8 ROTARY TABLE CONTROL

ROTC FNC 68 Object devices : [S.] : . .


(16)
Rotary Table
ml,m2 : a .

Control

Number of steps : ROTC .....Z...; ..............................9 steps -

The rotary table has ten index positions ( m l = 10) as illustrated below. Table rotation is controlled
so that a required item is brought to the specified position (INIOUT position) via the shortest path.

The conditions necessary to use an ROTC instruction are described below.


Detection Signals :
Install a 2-phase switch, used to detect table rotation direction (forwardlreverse), and switch X2
which is actuated when product No. 0 is brought to # O position.

A-phase (XO)
Upcount signals for forward rotation

B-phase ( X I )
Drive MO to M 2 with XO to X2 inputs
(Select any X and M number for the head number)

-
Counting Register Designation I S - I : . 4

Designation of D200, for example, is used as the counter which detects the position of the table.
Number of Divisions ( m l ) and Low-speed Rotation Zone (m2):
It is necessary to designate the number of table positions (divisions) m l , (10 in the above
example) and the lowspeed rotation zone m2, (2-position intervals in the above example).
Call Condition Registers [S-I :
The iS.1 setting of D200 automatically puts D201 as the register to store the position number of
the take out window., The postion number of the product to be called should be set in D202.
When the conditions described above are set, outputs such as forwardlreverse rotation and high
speedlldwspeedlstop are obtained in the destination designated in the ROTC instruction.
5. APPLIED INSTRUCTIONS

HANDY INSTRUCTIONS (FNC 60 TO FNC 69)

m l : Number of divisions
[SO] mi m2 [D.] (2 to 32,767)
14
&i{l ?OTC 1 0700 I I
K i0 K 1
2 H 0 ] m2 : Lowspeed rotation zone
(0 to 32,767 position interval)
m l r m2

D200 : Used .as counter register


0201 : Set the take INIOUT position number
D202 : Set the called item position number I Set in advance by using a move instruction.

MO
MI
M2
: A-phase signal
:.-B-phase
--
signal
: Zero-point detection signal I Configure the circuits for these components first
which are operated in response to inputs X. - -

1
M3 : High-speed forward rotation
M4 : Lowspeed forward rotation Driving the ROTC instruction by turning ON X I 0
M5 :Stop gives the results M3 to M7 automatically.
Turning X I 0 OFF turns OFF M3 to M7.
Lowspeed reverse rotation
M7 : High-speed reverse rotation J
. .
The data in the.counter register D200 is cleared to 0 when the zero point detection signal (M2)
is turned ON when X I 0 is ON. Before starting any operation, it is necessary to execute this clear
operation.
If the rotation detection signal (MO, M I ) is operated ten times in the zone of one item, the setting for
the number of divisions, call position number, and item number must all be scaled appropriately ten
times the value of the example.
Example :
If the rotation detection signal is 100 pulses per rotation with the table divided into ten positions,
m l must be 100 and item numbers and the take INIOUT position numbers must be 0, 10, 20, ...,
90.
To obtain 1.5 position intervals for lowspeed rotation zone, set m2 = 15.
The ROTC instruction can only be used once.
5 . APPLIED INSTRUCTIONS

5.9 EXTERNAL FX If0 DEVICES (FNC 70 TO FNC 79)


5.9.1 TEN KEY INPUT

TKY
( 16/32)
FNC 70 Object devices :
.b- [~i.] -.I
Ten Key
T MI ~C K I~ 0s ~Iv.
K . H ] K ~ x ~ K ~ Y ~ K ~ ZI
+ Cs.1
l x l v l n l s l
4
-I C~2.l--rl.
Number of steps : TKY ...............................................7 steps
(DITKY .........................................13 steps

[s -3 [ol-] [02.]
An instruction to write a number by using push-

An example to connect the


number keys ( 0 to 9) with XO
taken as the head of inputs.

Pressing the number keys in the order of (a), (b),'(c),


and ( d l stores 2,130 in DO. If a number greater than
9,999 is stored in the register, the highest digit over-
flows and is lost. (Data is stored in DO as binary data.)
With the (D)TKY instruction, registers D l and DO are
used in combination. A number greater than
99,999,999 overflows.
When X2 is pressed, M12 keeps operating until another
key is pressed. This is also true with other.keys.
M I 0 to M I 9 operate in response to the input of XO to
X11.
If any key is pressed, the key sense input M20 keeps
operating while the key is held down.
M 13
When two or more keys are pressed, the key pressed
I
first is effective.
I
I Key sense output Data in DO remains unchanged if X30 is turned OFF.
However, M I 0 to M20 are all turned OFF.
The TKY instruction can only be used once.
5. APPLIED INSTRUCTIONS

EXTERNAL FX I 1 0 DEVICES (FNC 7 0 T 0 FNC 79)

5.9.2 HEXADECIMAL KEY


I
; HKY.
( 1 6/32)
FNC 71 Object devices : +C~2*1+ .
I
Hexadecimal Key [ K . H I K ~ x I K ~ Y ITK I~CM1 /DK Iv.z]
~sI

Number of steps : HKY ..............................................


9 steps
.. (D)HKY .........................................
17 steps [S '1 [DI '1
Flag : M8029 (execution complete)

s[]: [Dl.] Co2.3 [03.] An instruction used to read a number or a


function from a hexadecimal keypad.
(1) NUMBER KEYS

I BCD J Digits
- ' - \\
OW 1 to3 I l o 2 110' I 1001
-qwuw/

A number up to "9,999" is stored in


DO in binary when keys are pressed.
Any. number greater than this over-
flows.
With a (DIHKY instruction, a number
up to "99,999,999" can be stored in
D l and DO.
When tw or more keys are pressed,
the key pressed first is effective.
After the pressing of a key is sensed,
the M8029 flag (execution complete)
is set.
(2)KEY-SENSE OUTPUTS (3) FUNCTION KEYS
- ,
Pressing a,ny of the A to F keys causes M6
to stay ONwhile the key is held down.
Pressing 'any of the 1 to 9 keys causes M7
to stay ON while the key is held down.
DO remains unchanged when input X4 is when the "A" key is pressed, MO isset and
-.
turned OFF. MO to M7 are all turned OFF. stays ON. pressing the UDW key next causes
'Nbte: Key selising rbquires eight scans. MO to be turned OFF and M3 is set and stays
See Appendix 5. ON. If ma or more keys are pressed, the key
pressed first is effective.
The HKY instruction can only be used
once.
5. APPLIED INSTRUCTIONS

EXTERNAL FX I10 DEVICES (FNC 70 TO FNC 79)

5.9.3 DIGITAL SWITCH

DSW
(16)
F N C 72

Digital Switch
Object devices :
+ C D .I~ 4
I K . H I K ~ x I K ~ Y I K ~ M ~ K ~ Is I 1 I v . z ~
T C D

I- C ~ 3 a I - i

X l Y l M l S ]

Number of steps : DSW


. .
........................................9 steps
t-+-i
Flag : M8029 (execution complete) Cs -1Col.l
[S -1 [ ~[02i n An instruction used to read the setting of
PIo
a] a]

one (nt = 1) or two sets ( n = 2) of 4-digit


(dsw l x i o l ~ ~ l o l iOJ ~ K11 digital switches.

(1) INPUT F R O M 1ST


SET
BCD digital
snitches The BCD 4-digit digi-
tal switch connected
Example shows a 1+1 to XlO to X I 3 is read
common input (source)
connection. b y Y10 t o Y13 se-
quentially and
stored i n DO i n bi-
nary.
(2) INPUT F R O M 2ND
SET

2nd set input


i The BCD 4-digit digi-
tal switch connected
to X I 4 to X I 7 is read
b y Y10 t o Y13 se-
quentially and
stored in D l i n bi-
nary. '

This is only effective


when the setting for
X1 O I 7 "n"is2.
~ e ~ 8 t i t i voperation
.e
YOto Y13 operate sequentially while XO
y 10 I 0.1 1 stays ON. After the completion of one
sec sec sec operation cycle, the execution com-
plete flag M8029 is set.
sec Suspended
Y 12 I
I
A relay output PC can be used by con-
- , sec
figuring the circuit as shown in Appen-
Y 13 dix 1.
. .
sec The DSW instruction can only be used
M8029 Complete flag once.
5 . APPLIED INSTRUCTIONS

SEGD

_
EXTERNAL FX I10 DEVICES (FNC 70 TO FNC 79)

5.9.4

(PI (16)

a
FNC 73

Seven-Segment
Decoder

.
"
SEVEN-SEGMENT DECODER

O b j e c t devices

~ u k b e of

1 [
r steps

SEGD 1
[s
D
:
I-T----
IK.H~K~XIK~YIK~HIK~SJ
is .I

: SEGD, SEGD(P) ......................... 5 steps

-3 [D

0 lK2Y
.]
01
"

Hexadecimal data (0to F) set with the lower four bits of [S-Iis decoded into data to drive the
seven-segment display and stored in [D. I. The higher eight bits of [D. I are not changed.
Decoded data is indicated below.
7-segment Decode Table
T

. .
.I
1
-+
C
I

Head (YO in this example) of b i t device or LSB of the word


device corresponds to 00.
D
4
(v.z]

I
5. APPLIED INSTRUCTIONS

EXTERNAL FX I10 DEVICES (FNC 70 TO FNC 79)

5.9.5 SEVEN-SEGMENT WITH LATCH

SEGL F N C 74 Objectdevices :
(16)
Seven-Segment - - .
with Latch . - .
I !
IK. S ZI(
H I K ~ X I K ~ Y ( KT ~IMC II KD~Iv. :
u
1.N~rnb.r of steps
Flag
. - --

: M8029 (execution complste)


1
.
: SEGL .... ......... .......... ............. 7 steps
-. .

v./O
An instruction used to control one or two sets of
Cs .I CD -1 n
7 - s e g m e n t display. For details o f "n", see
I (SEGL~.D O I Y OIK 01 "PARAMETER "n" 6ELE CTION" on the following
page. &

- - PC (transistor output)
- - -
I I
The example shows
a source output _
I
connection.

I , rb
-- I
1 4. ..- I .. I
1

8
=
c B4-
G O ~ L O ~ r l o ~ l rlo0
r r r r r r r r
jJ B-'4
b4-
j-4
)-t 4b-
1-4 -
I - .
-
'r-
- V+
110' 110' 110' 1100

7
1 - I
1st set 2nd set -
1
- - -

I
I
* The SEGL instructiontakes the time of 12 operation cycles to display the four-digit data (one or
two sets). After completing the four-digit data display, the complete flag M8029 is set.
I
* As long as the drive input for this instruction is ON, the instruction is executed repeatedly. Ifthe
drive-input i s turned OFF halfway through the operation series, operation is interrupted.- When
the drive input is turned ON again, operation starts from the beginning. See Appendix 1.

-
The
.
n s -t- r .t k..t i o n c a n be
~. ~ ~ ~. ; ' i .- . o nused
-
l y. - once:

(1) ONE SET ( n =- 0 -to231


BCD-convertdd data of DO (stored in binary data, up to 9,999 in BCDI is output sequentially
. -
(YO to Y3I. - F

With the skobe-signals (Y4 to'Y71, the sibn'a~is latched with the latched 7 segments.
I
1 I
(2) TWO SETS (n = 4 to 7 ) -
I I

- .As with one set of 7-segment displdy, datain DO is output to YO to'Y3 and the'data in D l to
YlO to Y13. Data .in DO and D l should be 0 to 9,999 in BCD.
- 2

Note: '.* For strobe signals, the outputs of Y4 to- M are used.
5. APPLIED INSTRUCTIONS

EXTERNAL FX I10 DEVICES (FNC 70 TO FNC 79)

f . - - PARAMETER 'hWSELECTlON 3
. ,

Parameter "nn selects the positivelnegative logic of the 7-segment data input and strobe sig-
nals, and also.the .number of display unit sets (one or two).
PC Logic :
SINK OUTPUT (NEGATIVE LOGIC) SOURCE OUTPUT (POSITIVE LOGIC)
, 1 %
v+
7
,.+VI
- v+
Pull-up resistor HlGH ,
. . - . - LOW
. . -- (Positive)
Logic 1
HIGH
-
, LOW- , '
Logic 1
(Negative)
OV
"con 0
- ov
PC
. .
- PC Pull-down resistor

With a sink output,aan output is LOW with a source output, an output is


when the internal logic is "1 ". HIGH when the internal logic is "1 ".
This is called "negative logic". This is called "positive logic".
7-Segment Display Logic :

. . .
~a'rarndter'h"s;?liction. :
5 .

',

Select.the.parameter "nWsettingdepe'nding on whether the PC logic and the 7-segment display


. logic agree with .each other. ' , ' ,

' . Two sets of 4-digit display :


One 'set of 4-digit dibplay : '
................................. .................................................. .............................................................................
........................................................................................................
....................................................................................................
....................................
j ~ a ; g ~ g gga .~m# g
....................................................................................... ~~ m~
LLI... fl

:::::::::::i::~gf~f#p~rj;j;j;j;j;j;j
.......
........
........
2

.......................................................................................
......................
.......................'%................. .................................................................. :::::::::::::::::::::::::59:::::::::::::::::::9::::

, : Agree

Disagree
- Disagree .
. !- .

. .*
,. -
v . ~ x a m ~:l e . .

The setfing,.should .be "n = 1"for one set and "n = 5" for twq sets if the logic o f each factor is
as indicated below.
. L

PC : Negative logic
Display data input : Negative logic (agree)
Display strobe signal : Positive logic (disagree)
L J
5. APPLIED INSTRUCTIONS

EXTERNAL FX I10 DEVICES (FNC 70 TO FNC 79)

5.9.6 ARROW SWITCH , - - . - . - .

ARWS
(16)
FNC 75

Atro w Switch
Object devices :
+ C01~1 ---I
I K . H I K ~ X ( K ~ Y ( K ~T HI I K
C ~( S
D( I v . z ~

H
n=~-3 t---- Cs *I---+
X I Y ~ ~ ~ S

umber of steps : ARWS ...........................................9 steps Hco2d


[s -3 [oi.] [o2*] n

I ' A S 1 X 0 1 0 0 1 0 K 1 0 I An instruction for digit position shikand data


input with thg arrowswitches. .

Digit position
LED indicator Digit shift (left)

,
7-segment display unit with latch to Arrow switches change the digit position and
view the number currently being set. , the numerical value of each digit.

Although 16-bit binary data (BCD value range : 0 to 9,999) is stored in DO, all numerical values
are expressed in BCD for the sake of simplicity as explained below. '
When input XO is turned ON, the digit designation is lo3. Each time the digit shift right arrow key
is pressed, the digit designation changes in the following order : lo3 -, lo2 -, 10' -, lo0-, lo3.
When the digit shift left arrow key is used, the digit designation changes in the following order:
lo3-, lo0-, 10' -, lo2-, lo3. The designated digit position is displayed by an LED with a strobe
signal (Y4 to Y7).
For the designated
.
digit the value is input by either the increment or decrement key.
. . -

Increment key : Data in DO changes in the following order : 0 -, 1 -, 2 -, ... -, 8 -, 9 -, 0 -, 1.


I

Decrement key: Data in DO changes in the following order-: 0 -, 9 -, 8 -, 7 ... 1 -, 0 -, 9.


The currently set number ca.n be viewed b y the 7-segment display unit.
AS described above, an ARWS instruction is used to write the required number to DO while viewing
the indication on the 7-segment display. Parameter "nnshould be selected and set as described
on the preceding page.
The ARWS instruction can only be used once. A transistor output PC must be used.
5. APPLIED INSTRUCTIONS

EXTERNAL FX I10 DEVICES (FNC 70 TO FNC 79)

-- CHANGING -THE TIMER SETTING AND THE CURRENT VALUE


.*.
'0 Designate the timer number with the Set a constant with the arrow switches.
3-digit digital timer switches.
- -

Y7 Y6 Y5 Y4

Read
Y14 :o:
Y15 ,q
Write

1- Write

Operations :
Each time a readlwrite key is pressed, the status of the corresponding LED changes.
For the read operation, set the timer number with the digital swctih and press the X3 switch.
For the write operation, set the required number with the arrow switches while viewing the
indication on the 7-segment display and press the X3 switch.

F;&~' IX IO ~ZY
101. .( K 1
Read Set Digital switch -. Z 4digit, 1 'set
circuit ,
Y 14
IFEC 1 ' 0 I I 4digit. 1 set

L: Lo Decrement
II
,Reed
SER
T OZ -* 7 segments
O O Negativelogic

4 l
& OIncrement-

5:'&o
RUN monitor
Digit shift (right)
Y 15X 3
(MOto M3)-. (D511) -. (YO t o n ) -. 7 segments
Qdigit, 1 set

2FI$It4 loo z~~~IcJ 51110 3002


Readlwrite

L-00~ Display for read

qilF@Display for write


5 . APPLIED INSTRUCTIONS

EXTERNAL FX I10 DEVICES (FNC 70 TO F N C 79)

5.9.7 ASCll CODE CON\iERSION


r
ASC FNC 7 6 Object devices : [Sl : Up to 8 alphanumeric characters keyed i n from the A6GPP (AGPHP).
( 16) ro.1 : I .

ASCII Code
Number of steps : ASC ........................................
7 steps

Cs -1 Co -1

-
Characters "A" to W " are converted into
l o [ASC 1* B.CO E F GI4 ID~OO] ASCII code and sent to D300 to D303.
Hiaher Lower
100LD X 0 / 8its 8 bits '

101 ASC. ABCDEFGH, D 300


0300 1 42 (8) 1 4 1 (A) I

An ASC instruction is appropriate for selecting and displaying an error message with an external
display unit.

f 3
ASCII CODE '

An expression composed of alphanumerics and special symbols in hexadecimal.


Numeral ASCII Letter ASCII Letter ASCII Letter ASCII
0 A- 41 K 40
1 B . 42 L 4 C ,
2 32 C 43 M 4D
3 33 D 44 N 4E 58
4 34 E 45 0 . 4F 59
5 . 35 - F - 46 ' L P 50 5A
I 6 36 G 47 Q 51
7 37 . H 48 R 52
8 38 I 49 S 53
9 39 J 4A T 54 '
. +

L J
5. APPLIED INSTRUCTIONS

EXTERNAL FX I10 DEVICES (FNC 7 0 TO FNC 79)

5.9.8 PRINT
. .
. . .
PR FNC 77 ' Object devices : : [S. ] ,:.
( 1 6) ID. 1 :
Print
Number of steps : PR ......................................5 steps
. .,

If ASCII data is stored in D300 to D303 as shown in Section 5.9.7, the codes "A" to "H" are sent.
The send outputs are YO ( l o w s t bit) to Y7 (highest bit). Besides these outputs, Y10 (strobe
signal) and Y11 (execution flag) also operate.
.
XO Drive input J

"I YOtoY7Data - XC)(DK--HX *"


-. >
-,
- - TO TO : Scan time (msec)
Y10 Strobe signal
--
Y11 Execution flag I * . ---L
If input XO is turned OFF while the instruction is being executed, data sending operation stops.
Data is sent again from the beginning when XO is turned ON again.
A transistor output PC should be used.
The PR instruction can only be used once.
If the scan time is too long, the PR instruction can be driven by timer interrupts.
5. APPLIED INSTRUCTIONS

EXTERNAL FX 110 DEVICES (FNC 70 TO FNC 79)


16-DATA mode:
The PR instruction normally sends only 8 pieces of data. However with the 1 SDATAmode flag M8027
driven ON, 16 pieces of data are sent in one complete operation of the PR instruction. .

Waveform when M8027 = ON

-AN- OFF
- - -ON-signal
-.
- -starts
- -the- PR- instruction.
----
m
Note that even if XO is kept ON
Data YO to YI continuously, the PR instruction
T: Program cycle time does not automatically repeat its
operation.

Strobe Y 1 0

Busy Y11 . ,

Completion flag M8029

The sending of data will terminate when the data to be sent has a value of OOH (NULL).
APPLIED INSTRUCTIONS

5.10 EXTERNAL F X SERIAL D E V I C E S ( F N C 80 T O F N C 89)

5.10.1 PARALLEL RUNNING

: [S. I : KnX, K n M ( n = 1 to 8)
PRUN FNC 81
(PI (16132)
Pera'lelRunning
FX-40AP/A W
Object devices

Number of steps
I D . I : KnM, KnY ( n = 1 to 8)
: PRUN, PRUN(P)
3
~ h ,number inthe lowest digit place
the designated device number is "0".
........................
5 steps
of

(D)PRUN,'(D)PRUN(P) .............
9 steps

Master Station's Program :


Cs -1 [D -1
P q 7 O 1 PRW IK~X ~oIKa(Bio] -
inputs-xlO to X I 7 of the master station are sent to
M810 to M817 of the master station. An input num-
ber is handled in octal.
Slave Station's Program :
rs -1 CD .I -
Po('1 PRUH J(4X ZO(KW920]
Inputs X20 to X37 of the slave station are sent to
M920 to M937 of the slave station. An input num-
ber is handled in octal.

K4X20
[X 3 7 1 ~3 6 1 ~3 5 1 ~3 4 1 ~3 3 1 ~32lX 3llX 30lX 27lX 2 6 1 ~2 5 1 ~
241~ DIX 2 2 1 ~2 1 1 ~201

1 By using the same numbers at 10' and 10'st digit pleces for X and M, the
~ 4 M 9 2 0 correspondence between the source and the destination can be found easily. 1
- The instruction handles .an auxiliary relay number as an octal
.-. . number.
.
By using parallel link adaptor Fa-40P or Fa-40AW, the following data is sent automatically.
(Communication itself is executed without using a PRUN instruction.)

Autmk
I communication
M80044.1899
instruction
M9005M999
M8000 - ME000
0490!-Q499 0490-!0499
050040509
o A u t - ~
0500--0509 -
:
Master station -

The master station drives M8070


I communication
I Slave station

The slave sfation drives M8071

The input data atthe slave station can be checked'by r e a d i n g ~ a u x i ~ irelays


a r ~ M920through M930
of the master station when a PRUN instruction is used.
Similarly, the input data of the master station can be checked b y reading auxiliary relays M810
through M817 of the slave station.
The auxiliary relays and data registers in the above indicated range can be used in the parallel
link. In this link, data communications are possible in 1001100 points for the ON/OFF signals and
10 words110 words for 16-bit data.
Required communication time (send and receive):
70 (msec) + operation cycle time in master station (msec) + operation cycle time in slave
station (msec) -
I :
5. APPLIED INSTRUCTIONS

EXTERNAL F X SERIAL DEVICES (FNC 80 TO FNC 89)


5.10.2 VOLUME READ

VRRD FNC 85 Object devices :


( P I (16)
Volume Read I-
. -

[S *] :Vdume number (0 t o 7)

Number of steps : WRD, VRRD(P) .:.......................5 steps


1

Cs '1 LD -3 , Analog value read from volume number 0 is converted into


8-bit binary data and transmitted to DO.
As an application example, data in DO can be used as a
timer setting.
This circuit provides an analog timer.

Example using an analog timer


., ,

5.10.3 VOLUME SCALE


I

VRSC FNC 86 Object devices . :


(P) (16)
Volume Scale
FX-8AV

[S -1:Vdume number (0t o 7 )


Number of steps : VRSC, VRSC(P) .........................5 steps

Setting (0 to 10) of volume number 1 is stored in D l as


[s -1 [D .I - binary data. If the volume is not set correctly at the num-
bered position, the read value is rounded to an integer in
VASC K -1 D i' the range of 0 to 10.

& ON wkn,?ysetting is "9:

ON when the setting is "1"

ON when the setting is "10" Note: The symbol '7R"used in an applied


instruction name stands for Variable
Resistor l
5. APPLIED INSTRUCTIONS

5.11 EXTERNAL F2 UNITS (FNC 90 TO FNC 99)

5.1 1.1 MELSEC.NETIMINI

MNET FNC 90 Object devices : [S] :


(p) (16) [Dl :
Me'sec' Mini. ~ u r n b e rof sfeps ; : MNET; MNETtP) .......................5 steps , .

. . Csl 1 0 1
I ' MNET.~X 1 ] 30 Communication with ~ ~ I 6 N P I N T
Head 110 number

. .
The MNET instruction is used for communicating ONIOFF signals between an FX2 PC and an
F-l6NPiNT interface module.
The head I/O number is determined according to the connection position of FX2-24EI special
block as shown in Section 7.1 -1.
The following signals are sent :
-

. . ' I.,' "


5. APPLIED INSTRUCTIONS

EXTERNAL F2 UNITS (FNC 90 TO FNC 99)

OVERVIEW OF MELSEC NETIMINI

An F-16NPlNT interface module is used to communicate ONIOFF signals between an A-Series


PC and a micro PC.
F-16NP
A fiber-optic cable is used to connect an A-Series PC lAJ71P32 master module) and an F2 Series
PC. Communication is possible for the tw stations to be up to 50 meters apart.
F-16NT
A twisted-pair cable is used to connect an A-Series PC (AJ71T32 master module) and
Series PC. Communication is possible for the two stations to be up to 100 meters apart.
2 - *' I

. . Master module
+ I
4 4 4 + ,
110.modules

A Series PC
Power
~ U P P ~ VCPU Fiber-optic cable
module (or twisted-pair cable)

I
FX basic unit No. 1 4 FX basic unit No. 32
(Max. 32 stations)

Using an F-l6NPlNT interface module, 8-point ONIOFF signals can be transmitted between
the A-Series PC and the FX2 PC.
I Up to 32 2x2 PCs can be linked. I
5. APPLIED INSTRUCTIONS

EXTERNAL F2 UNITS (FNC 90 TO FNC 99)


5.1 1.2 ANALOG READ

ANRD FNC 91 Object devices :


(P) (16)
Analog Read ' . . .
F2- 6;4 I K . H I K ~ x I K ~ Y ~T KI ~
C M Iv.zI
( DI K ~sI
H
n [ x ~
1
Y ~ M ~ s ]

H--l
Number of steps : ANRD, ANRD(P) .......................9 steps C S I C D ~ I

. Csl 1 [02.1 n
I 1 1. Analog input data at channel 10 is read
A

'I~~&/'ANRD 1.x 40 Y 30 1 ~ 3 0 0 K 10 and stored to D300.

Head 110 number

ir ANRD instruction is,used to read the analog data input from an F2-6A analog'l/O module to
A
the FX2 PC. For details, see Section 7.1;1..
"n" represents an analog input channel number (n = 10, 11, 12, 13).
[SI ande[D11are deteimined according to the connection position ofthe FX2-24EIspecial adaptor.
See Section 7.1 .l.
[D2- I stores 8-bit binary analog data.

(1) CIRCUIT EXAMPLE


The following circuit is used to calculate an average of 3-point data which is obtained in intervals
of 100 msec to minimize the variation in analog inputs.

/FNC 91
M8000 Taking X40 and Y30 as the head I10
number, the data at channel 10 of
RUN monitor F2-6A analog I10 unit is read and
Head I10 number Channel
number stored in D20.

Contents in D20 are shifted to DO,


Dl, and D2 in intervals of 100 msec.

The average of the values in DO, D l ,


and D2 is stored in D10.
5. APPLIED INSTRUCTIONS

EXTERNAL F 2 UNITS (FNC 90 TO FNC 99)


5.1 1.3 ANALOG WRITE

ANWR
(PI (16)
FNC 92 Object devices :
Cs1.3 4
Analog Wife , , '
I K . H I K ~ x ~ K ~ Y I K ~TMI ~CK ~I sD I Iv.z]
I n4 n=O, i [ x l y l ~ l s l
H--l,
Number of steps : ANWR, ANWR(P) .: ....................9 steps
Cs2 IC 03

Cs1.3 C.21 C D I n
GI0 I 1 (A&R D310 X 40 1.Y 30 1 K 0 I An instruction to output the data in D310
to analog output channel-10.
Head 110 number

The ANWR instruction is used to write data from an FX2 Series PC to an F2-6A analog I10 unit
and then output the data in analog. For details, see Section 7.1 -1.
"n" represents an analog output channel number ( n = 0, 1);
IS21 and [Dl are determined according to the connection position o f the FX2-24EI special adaptor.
See Section 7.1 -1. . .
[ S l . I stores &bit binary analog data. . .
5. APPLIED INSTRUCTIONS

EXTERNAL F 2 UNITS (FNC 90 TO FNC 99)


5.1 1.4 RM START

RMST FNC 93 Object devices :


(16) -I C~2.1 -i
RM-start
F2-32RM IK,HI X l Y l M l s

H
n-O. I
m
C s ICoi I
Number of steps : RMST ..................:.................. 9 steps
- .

Csl Coi I C~2.1 n


/--I(}' I a RMS? I I X 40 Y 30.1 Ha00 1 K 01
FX2 + Fz-32RM
Fz-32RM -, FX2
Start instruction
Status information
Head I10 number

An RMST instruction is used to output a start instruction from an FX2 PC to an Fz-32RM PC and
to receive status information froin an F2-32RM to an FX2 PC.
"n". is. either "0"or "lndepending on the F2-32RM program number (bank 0 or bank 1).
[ ~ l ' a n [dD ~ Ii r e deteimineb according to the connection position ofthe FX2-24EI special adaptor.
An example of this and further details are given in Section 7.1.1.
7 , . .
[D2. I stores the status information'as deskibed below.

ON + Normal Normal CW Normally ON ID" START - BANK1

OFF + Software Hardware ccw - 05" STOP Normally OFF BANK0


t-
II
.
. error ' error
' .
For the me'q/.ling pf ea'ch status, refer to the Fz-32RM Programmable Cam Switch User's Manual.
5. APPLIED INSTRUCTIONS

EXTERNAL F 2 UNITS (FNC 90 TO FNC 99)

5.1 1.5 RM WRITE

RMWR FNC 94 Object devices :


(P) (16132)
R M wit8
-t rs1.1 -I
F2-32RM X l Y l M l S

t-t-4
C S ~ I C ~ I
Number of steps : RMWR, RMWR(P) ......................
7 steps
(D)RMWR, (D)PMWR(P) ........... 13 steps - -

. [si.] [02.] [o]


I I
I
RlrWR 1 H500 1 X 40 1
I
Y 30 1
1
Writing output disable information

. Head I10 number


An RMWR instruction is used to send output disable information from an FX2 PC to an F2-32RM
programmable cam snitch.
IS21 and [Dl are determined according to the connection position' ofthe FX2-24EIspecial adaptor.
An example of this and further details are given in Section 7.1 . I .
[ S l . Iis the outputdisable information table and the data in the table is handled in octal as,shown
below.

number

If M500 is turned ON,


for example, YO is
output disabled and
cannot be turned ON.

RMWR
(0)

- L + - - -\ I F X auxiliary
relay~number
5. APPLIED INSTRUCTIONS

EXTERNAL F2 UNIT (FNC 90 TO FNC 99)

5.11.6 R M READ

RMRD FNC 95
(PI (16132)
Object devices :
-t r02-I -4
R M read I

Fz-32RM X I Y ~ M ~ S

H-l
CslC01 I
Number of steps : RMRD, RMRD(P) .......................
7 steps
(DIRMRD, (D)RMRD(P) ............ 13 steps

- - [ s 3- Lo1 ] [02-] - -

PIo lRMRD/X 4 1 1 ~
3O)YSOOI
Reading ONIOFF data

~ e a I10
d number
An RMRD instruction is used to read the ON/OFF status of an F2-32RM programmable cam switch
output to an FX2 PC.
IS1 and [ D l 1 are determined according to the connection position ofthe FX2-24EI special adaptor.
An example of this and further details are given in Section 7.1.1.
- [D2- I is the device where ONIOFF data, which is handled in octal, is stored. ..

M600 is turned ON
if YO is ON, for ex-

Y 27 Y 26 Y 25 Y 2 4 Y 23 Y 22 Y 21 Y 20

(0)RMRD

FX2 auxiliary relay

The contents of [D2- I do not change if XO is turned OFF.


5. APPLIED INSTRUCTIONS

EXTERNAL F2 UNITS (FNC 90 TO FNC 99)


5.1 1.7

RMMN
(PI (16)
RM MONITOR

FNC 96

RM rnonitur
Object devices :
-
T 1~CKI ~DM
[K.H~K~xIK~Y IK~sI
Iv.z]
CD2 *I 4 ,

I x l v l n l s ~

- -
a .

I---H - -
Number of steps .....................7 steps-
: RMMN, RMMN(P) C s l C D l l

CsI [Dl I CD2.1

pio [RMHN l X 40 I Y 30 1 0 1 0 0 1
Monitoring the speed (rpm) or present angle

Head I10 number

An RMMN instruction is used to read the speed (rpm) or present angular position of the resolver
: connected to an F2-32RM programmable cam switch to an FX2 PC.-The # 4 switch on the F2-32RM
determines whether the speed or the angular position is read.
[SIand [ D l 1 are determined according to the connection position ofthe FX2-24EI special adaptor.
An example of this and further details are given in Section 7.1 .l.
[D2- I is the device whe're read speed (rpm) 'or angular position is stored.

D~OO +When rpm is read (binary data)


t .

1-1
O~OO +When present angular position is read (binary with decimal units
"rounded off)
5. APPLIED INSTRUCTIONS

EXTERNAL F2 UNITS ( F N C 90 TO F N C 99)

5.11.8 BLOCK

BLK
(P) (16)
FNC 97 Object devices :
rsl
.)-----------I
Block
F2-30GM
[K.HIK~x(K~Y(K~M ~ s ( D Iv.21
T ( KC I I
- .- I x l v J n l s j

H--l
Number of steps : BLK, BLK(P) ..............................7 steps rs2I [ D ]
Cs1.1 Cs2 I CD I FX+ F2-30GM
BLK
1 O I 40 1 30 ] Block number 0 to 31 (decimal)
..
Head 110 number

A BLK instruction is used to designate the block number to an F2-30GM pulse output unit via an
FX2 PC.
The block number is designated b y the contents of [Sl: I and-stored in binary. When converted
to BCD, the effective range .is from 0 to 31.
If sdo:digital switches are used for [ S l . I, it is necessary to convert the value into binary for
designation. Because constant K is automatically converted into binary, enter any number
between 0 and 31.
[S21 and [Dl are determined according to the connection position of an FX2-24EI special adaptor.
An example of this and further details are given in Section 7.1.1.
When an F2-30GM is used, always use the BLK instruction.
If this instruction is not necessary, w i t e the program as indicated below.

BLK K 0 X 40 Y 30

Head 110 number


5. APPLIED INSTRUCTIONS

EXTERNAL F 2 UNITS (FNC 90 TO FNC 99)


5.1 1.9 MACHINE CODE

MCDE
(PI (16)
FNC 98 Object devices
'- : [DI 3:
Machine Code
[oa 1: m
I

Fz-30G M j
Lowest digit = 0
Number of steps : MCDE, MCDE(P) ......................7 steps

CsJ ti1 I C02 I


!21 - -
MCiE 1 5 X 4 0 1 Y 30 1 6 0 0. . ] Fz-30GM 4 FX2
M'code signal MO to M77 (octal)
Head I10 number

The MCDE instruction is used to send an M code number (MO to M77) from an F2-30GM pulse
output unit to an FX2 PC. 1
'
IS1 and [ D l 1 are determined according to the connection position ofthe FX2-24EI special adaptor.
An example of this and further details are given in Section 7.1.1.
When an M code output.instruction-is executed by an FZ-~OGM,inputs X operate according to
the M code number (0 to 77 in octal). The results are stored to M500 to M577 in octal. I

If the.M.code to be o u t ~ uis
t M23, M523 is turned ON.
To make M code numbers correspond between.a PC and an F Z - 3 0 G ~it; is recommended to use
"OOn'in the lower two digit places of M and S device numbers which are designated b y [D21.
- *
5. APPLIED INSTRUCTIONS

5.12 LIST O F INSTRUCTION MNEMONICS

5.4.6

5.3.8

5.3.2

ZRST 40 5.6.1
MEMO
GENERAL HARDWARE AND INSTALLATION

.STEP
- LADDER INSTRUCTIONS
~

, ,
1

1 7 1 1 USING SPECIAL UNITS EFFECTIVELY


APPENDIX -

. .
( -,-
. '. .. . .. . .
_-
J

I ., ' I .
6. SPECIAL DEVICE AND INSTRUCTION LISTS

6.1 SPECIAL DEVICES


6.1.1 PC STATUS (M8000 TO M8009, D8000 TO D8009)

. . .-. 8060 to 8068 (M8004 ON)


M8005 (5) ON when battery voltage is D8005 (§) JJJJJ-p B c D COnVer-
Low battery abnormally low. Battery voltage sion data
voltage . .
Current battery volt- . (in
age (Example: 3.6 V) :;:'""'-
Of

M8006 (§) ON state retained after low D8006 (1) Initial value : 3.0 V
Low battery battery voltage is detected. Low battery (System ROM data is used when
voltage latch detection level the power to the PC is turned
ON.)
M8007 (8) See the diagram below. 08007 (5) ~ t o ' r e st h e n u m b e r of t i m e s
Momentary power The PC will continue operating if Momentary power M8007 is set ON. The stored data
failure detected M8007 is ON for less time than failure. is cleared when the power is
D8008. occurrence times turned OFF.
M8008 (§) See the diagram below. -. D8008 (5) I n i t i a l s e t t i n g : 1 0 msec ( i n
Power failure Reset if turned from ON to OFF. Power failure increments of 1 msec)
detection period: (System ROM data is used when
the power to the PC is turned
ON.) See the diagram below.
M8009 (5) Set if there is a shut-down of D8009 (5) The lowest input device number
24V DC OFF circuits i n the extension's 24V DC 24V DC OFF unit of a unitor block affected by the

-
supply. number s h u t - d o w n of t h e 24V DC i s
stored.
AC power
1
I
Ref.: Do not drive devices marked with
"(9) " by user's programs.
M8000 RUN
D data i s expressed as a decimal
~8007 when monitored unless otherwise in-
Momentary power failure I dicated.
M8008 I
Power failure Power failure
ID8008 detection period
10 msec
s When the power supply used is an AC 220 V system, the power down detect period determined
by the value in D8008 can be altered by the program in the range of 10 to 100 msec.
6. SPECIAL DEVICE AND INSTRUCTION LISTS

SPECIAL DEVICES

6.1.2 CLOCK (Ma010 TO Me019, D8010 TO 08019)

D8010 (4) C u r r e n t o p e r a t i o n cycle


Present scan data time (in units of 0.1 msac)
08011 (5) Minimum scan time (in
Minimum scan time units of 0.1 msec)
.D801 2 (4) Maximum scan time* (in
Maximum scan time units o f 0.1 msec)
D8013 Range : 0-59
Second
D8014 Range : 0-59
Minute

I D8015
Hour
. Range : 0-23

I D8016 1 Ranae
- : 1-31 I
Day I
D8017 1 -
Ranae : 1-12
Month
08018 Range : 0-99
Clock available Year
M8019 Clock data i s o u t of range. D8019 , Range : 0-6
Setting error Day of the Week
*: Waiting time for.constant scan when M3089 i s set ON
i s not included.

6.1.3 FLAG (M8020TO M8029,08020 TO D8029)

M8020 (-4)- -- - Set when.the result o f D8020 . .


additionlsubtraction is "On.

M8021-(4) -- - - Set when the result of D8021


Borrow subtraction is smaller than ' . ,'
the minimum negative
value. ..
08022

D8023

D8024
I
M8025 External reset HSC mode- D8025
. ..

M8026 ' 1 RAMP ~ o l d ' m o d e D8026

M8027 PR 16-data mode" ' D8027

I Interrupt
FROMffO
modes
1
M8029 ( 5) Set a t the completion o f D8029 ( 4) V register data
Instruction execution operation such as FNC72
com~lete (DSW.
4 :Do n o t drive device marked with "(4)" b y user's programs.
6. SPECIAL DEVICE AND INSTRUCTION LISTS

SPECIAL DEVICES

6.1.4 PC MODE (M8030TO M8039. D8030 TO D8039)

+ 1: M relays marked with an asterisk are t u r n e d ' when-the


~~~ PC operation status is changed
from RUN to STOP.
*2: The PC is set to RUN when M8035 or M8036 is forcibly turned ON b y the programming panel
even if the RUN input is OFF.

-- - The PC stops running if M8037 is forcibly set.OFF while the PC is running.


.
6. SPECIAL DEVICE AND INSTRUCTION LISTS

SPECIAL DEVICES
6.1.5 STEP LADDER (M8040TO M8049, D8040 TO D m 9 1

STL state set ON ON'state number 7

RUN to STOP.
All registers concerriing. STL states are update.d when the END instruction is executed.

M8059-

5: Do not drive devices marked with "(5)" by usier's programs.


6. SPECIAL DEVICE AND INSTRUCTION LISTS

SPECIAL DEVICES
6.1.7 ERROR DETECTION (M8060 TO M8069, D8060 TO D8069)
If any one of M8060 to M8067 is ON, the lowest number is stored to D8004 and M8004 is turned ON.

110 configuration
error . . OFF 1 RUN ~ = D 8 0 6 0 I § T) h e . f i r s t 110 n u m b e r o f the u n i t l b l o c k
causing the 110 configuration error '1
I
IM8061 i f ) l PC hardware error
Flash - ( STOP ' 1 ( 0 8 0 6 1 (4)
E r r o r c o d e n u m b e r o f t h e PC
hard ware error

I M ~ ~ ~ ~("1 rCr!Kunication error


O F F 1. RUN . ~ I D 8 0 6 2 ( 5 )
E r r o r c o d e n u m b e r o f the PCIPP
communication error
I
D8063 (5) Error code number of the parallel link
-OFF - RUN
I Error
W""

*3 error

Flash - I STOP )(0806415)


Error code number o f the parameter
error- 1 Code
Tabla
M8065 (5)) Syntax error
M8066 (511 Circuit error
Flash I STOP
', 1 08065 ( 5)

I 'I I
M8067 (5) Operation error Error code number o f the operation
error
Step number (latched) of the operation
error
I10 bus check '2
-. - . ... 3
'
Step number o f errors M8065 to M8067
1
I:Do not drive devices marked with "(I)"b y user's programs,
1: If the unit or,block corresponding to a programmed I/O number is not actually loaded, M8060
is set ON and the first device number is written to
08060. Example : X20 is n o t loaded
2: An I/O bus check is executed when M8069 is turned
ON. I f an erior occurs,,errdr code 6103 is written and .

M8061 is turned ON.


Device number : ...
3: These. are OFF when the PC operating status i s 10 to 177
changed from STOP to RUN.
1 : Input X ,
I 0 : Ournut Y
TIMING OF ERROR CHECKS ,

M8060 I10 configuration error Checked Checked '- While i n RUN


M8061 PC hardware error Checked - While i n RUN
PClPP communication - - '
When a signal from PP
M8062 error is received.
. . .

M8063 Parallel link error - - When a mating station


signal i s received.
. .
- , When program i s
M8064 Parameter error
M8065 . Synta-x error Checked Checked changed (STOP)
When program i s
M8066 Circuit error
transferred (STOP)
M8067 ----OperationError - - When, i n the RUN state
M8068 operation Error Latch

-- .
Note : W "= Programming panel.
6. SPECIAL DEVICE AND INSTRUCTION LISTS

SPECIAL DEVICES

6.1.8 ERROR CODES .

ERROR CODE 1 .

D8061 0000 No error


PC hardware error 6101 R A M error Check whether the
e x t e n s i o n c a b l e s are
6102 ' Operation circuit error connected properly.
1 610 3 1 110 bus error (when M8069 i s ON)
D8062 0000 No error
PClPP .. 6201 Parity error
communication Overrun error _ Check whether the
error , Framing error
I programming panel (PP)
6202 Communication character error .and t h e p r o g r a m m a b l e
controller (PC) are
6203 - Communication data sum check error connected properly.
6 . . 6204 Data format error
6205 Command error
08063 0000 No error
Parallel link error 630 1 Parity error Check the following :
I I Overrun error I W h e t h e r t h e ~ o w e ri s
Framing error turned ON for b b t h PCs.
6302 Communication character error Whether the link adapter
and the PC ere connected
6303 Communication date sum check error
~rooerlv.
6304 Data format error whethe; the link adapters
6305 Command error are connected properly.

1 6306 1 Watchdoa timer error I


D8064 0000 No error
Parameter error 6401 Program sum check'error . '

6402 - Memory capacity setting error


- . Stop the PC, select the
6403 Keep area setting error
parameter mode, and set

r:
6404 Comment area setting error the correct data.
6405 File reaister are settina error

- -
6409 I Other settina error
D8065 0000 No error
Syntax error 6501 Incorrect instructionldevice symbolldevice number
combination.
No O U l T or OUTC prior to setting value.
1) No setting value following OUTT or OUTC. During programming,
2) Insufficient number of operands for an applied each instruction is
instruction. checked. If a syntax error
i s detected, correct the
1) The same label number i s used more than once. instruction in the
2) The same interrupt input or high-speed counter programming mode.
inout i s used more than once.
6505 1 Device number i s outside the allowable range.
1I Other error
-
6. SPECIAL DEVICE AND INSTRUCTION LISTS

SPECIAL DEVICES
ERROR CODE 2

lrcult error

A cir=uit error occurs


if a c o m b i n a t i o n o f
instructions

paired instructions is

the instructions.
6. SPECIAL DEVICE AND INSTRUCTION LISTS

SPECIAL DEVICES
ERROR CODE 3

. . . . . .
even when a syntax or cir-
' '
c u i t error does n o t occur.
-. . 6704 6 or more FOR-NEXT levels are nested. An example.of this is given
6705 A device is used for an applied,instruction operand . below. '

. . . that is n o t the object device for that applied iristr'uction. Example : .


.. 6706 The device range or data range designated as an D500Z does not cause an
applied instruction operand i s outside theallowable- error. However, if value 2, '

. -.
"range. .- ; . . .. . - .
obtained as the result of
A
, ,

. . 6707 - . A f i l e register i s accessed without setting a file register. is loo (z=lOO)*


-
D500Z becomes D600 ex-
- 6708 - FROMITO instruction erior. . . .
-ceeding the allowable n u m
.... 6709 - - Other.(no IRET or'SRET, illegal relationship between - ber range; this.will cause en
. . . . . FOR-NEXT, etc.). . . - .
error.

f RELATIONSHIPSOF ERROR RELATED SPECIAL M'S AND SPECIAL D'S \


.. -

I
. . - .
I 08009 -. M8009 . 24V DC failure
. ..
~8060 -. ~ 8 0 6 0 110 configuration error
-. -
M8069 08061 --. M8061
. .
PC hardware error
110 bus D8062 .-. M8062 PCIPP commu"ication errpr Special M num-
check . - Turned ON
ber involved
. .__D8063. -. M8063 Parallel link error - -- with error occur- -
i f an error
. occurs

r,
.-. . -. M8073 ..Parallel link mode ... rence (lower
D8064 - -. .M8064 Parameter error
.D 8 0 6 5 - --• M8065- -- Syntax error - .
..
D8066 + M8066 Circuit error '-
Error code
can b e ~8667 M8067 Execution error
found b y - ... .-
monitoring -, - - , . -. L.
M8068 Operation ~ r r o Ir
the con-
. ~ .-
tents-of D; - --.
. . . - . . ' I

. ., .
.. . ber at which the error
.I
. . occurred is latched.
\ J
6. SPECIAL DEVICE AND INSTRUCTION LISTS

SPECIAL DEVICES

6.1.9 LINK AND SPECIAL OPERATIONS (M8070 TO M8099, D8070 TO D8099)


A sampling trace is effective when an A6GPP or A6PHP is used. When a device number is monitored,
a special numerical value is read.

M8072 ( f )
O N while the PC is operating in a -
parallel link.
ON when the M8070/M8071 setting
M8073 19)
is incorrect in a parallel link.

4: Do not drive devices marked with "(9)" by user's programs.


MEMO
6. SPECIAL DEVICE AND INSTRUCTION LISTS

SPECIAL DEVICES

6.1.10 UPIDOWN COUNTERS (M8200 TO M8234, D8200 TO D82341

functions as a
d o m counter. When M8
not operated, the corresponding
f u n c t i o n s as a n u p

Note: M8100 to M8199 and 08100 to 08199 are not used.

6.1.1 1 HIGHSPEED COUNTERS (M8235 TO M8255, D8235 TO 082551

, a 1-phase high-speed
counter functions as a d o w n
counter. When M8
operated, the corresponding
counter functions as an u p

. .
1 ~8249(4) WhenC ,a 1-phase 2-input
counter or a 2-phase counter,
M8250(4)
M8251(4)
functions as a down counter,
operates. M8
. M8252(4)
turns off in the up counter mode.
M8253 ( 4)
M8254 ( 4)
M8255 ( 5)
5: Do not drive devices marked with "(9)" by us programs.
6. SPECIAL DEVICE AND INSTRUCTION LISTS

6.2 INSTRUCTION AND EXECUTION TIME LIST


6.2.1 SEQUENCE AND STEP LADDER INSTRUCTION

p 0 t o 63 1 0.74
Label
I 0 " * t o 8" 1 0.74

*1: "n" indicates the number of continuous STL instructions (number of parallellmerge instruc-
tions).
2: In the STL circuit block, 45.2 + 14.2n for turning ON and 25.5 for turning OFF.
"n" indicates ,the number of continuous STL instructions (number of parallellmerge instruc-
tions).
3: Execution time is 7.6 psec longer when an in direct designation (T-D, C-D) is used.
After counting up (time or.count1, the turning ON time becomes the same as the turning OFF
time.
6. SPECIAL DEVICE AND INSTRUCTION LISTS

INSTRUCTION AND EXECUTION TIME LIST

6.2.2 PROGRAM FLOW

aln program en

These instructions are driven


a directly without using any con-
tacts.
N/A : Not Available.
6. SPECIAL DEVICE AND INSTRUCTION LISTS

INSTRUCTION AND EXECUTION TIME LIST

6.2.3 MOVE, COMPARE, AND OTHER INSTRUCTIONS

s f r o m the m l
re moved to the

180.5 +17.ln

107.6 + 5.3 n

BCD BIN
6. SPECIAL DEVICE AND INSTRUCTION LISTS

INSTRUCTION AND EXECUTION TIME LIST

6.2.4 ARITHMETICAL AND LOGICAL OPERATIONS


Z : M8020 Br : M8021 CY : M8022 F : M8029

w2 - I--
= The destination varies in each opera-
tion, cycle if - a 'continuous execution
instruction is -used. Take note.of this
+w4kwJk-
[K.HIK~xIK~YIK~MIK~s~ T
wi------t
I c I o Iv.21
when using these instructions. kw4(J3&
w2*- +- WI*+
6. SPECIAL DEVICE AND INSTRUCTION LISTS

INSTRUCTION AND EXECUTION TIME LIST

6.2.5 ROTATION SHIFT


6 . SPECIAL DEVICE AND INSTRUCTION LISTS

INSTRUCTION AND EXECUTION TIME LIST

6.2.6 DATA OPERATIONS

. .
Resetting S900 to ~ 9 9 9 .

ii..
...
.
N I A

yggg.....
..:
....I.

%;:[$$$$
1- ,

ANNUNCIATOR RESET
86.5 25.5
The lowest device number
is given priority. ,

..:..:..:..::::...:....:....,
...:.:
..
- .

I
6. SPECIAL DEVICE AND INSTRUCTION LISTS

-
INSTRUCTION AND EXECUTION TIME LIST
- -

6.2.7 HIGH-SPEED PROCESSING


Can only be used once.

... n=8, 16, 24, ...128

By reading "n x 8" points


in time-sharing, the read
data is stored to ID21.

1 .I =[S2-I. Interrupt is

and stored to [D.].

. . . . . .

, .

l3 ---+ Note: The combination of hh?ifc


-.. - -
w2 - k-
(K. H (MX I K ~I KYn n I K ~I ST I
wlA
I IV. Z]
[ X 1-Y 1 M 1 S] must not exceed
instructions
C 0

I- e*-+
6pts. h e n t h e y a r e t-
W4' W 3 '
w2- k- W1'---4
. . driven ON simul-
taneously. * Repeated use is not allowed
6. SPECIAL DEVICE AND INSTRUCTION LISTS

INSTRUCTION AND EXECUTION TIME LIST

6.2.8 HANDY INSTRUCTION


* Can only be used once.

Initial state*
rS.1 : M o d e designation
i n p u t ( 8 points)
272.9 33'3
[ D l - ] to ID2.1 : Automatic
NIA operationstate
INITIAL STATE S20 5 Si < Sj 5 S899

Drum sequence*
An output pattern of up to
141.4 -. 33.3 6 4 points is generated
+61.4n
NIA - (absolute).
ABSOLUTE DRUM SEQUENCE
Drum sequence*
n = l to 64 An output pattern of up to
39.9 6 4 points i s generated
208.8
NIA , (incremental).
INCREMENTAL DRUM SEQUENCE
Teaching timer

~ ~ * ~ nK= O t o 2 ~ for
In'response
H n (0, 1, 2).tothe
~theset
setting
time
69.6
81.3 (seconds) is multiplied b y
NIA 1, 10, or 100 and stored to
TEACHING TIMER ID.].
Special timer
NIA Sets constant m ( 1 to
32,767) for the 100 msec
176.6 167.8
timer [S.].
NIA Off-delay, one-shot timer
SPECIAL TIMER i s obtained with ID.].

.__5
j..,:p.]'.:q 105.6 33.3
Alternate output
T h e i n v e r s e o f [Dm] i,s
taken each time the
fittsifabi instruction i s executed.
te i ALTERNATE
Ramp signal
Value o f ID-] changes
321767 134.5 from the [ S l - I value to the
181.8
NIA IS2.1 v a l u e i n n scans.
RAMP n =l to 32,767
Rotation control
S o mi m2 0 -
Y AOTC
6 8 ~ ' D TK.H'-fK.Hy 0.7
I
m l =2 to 32,767
m2=0 to 32,767 209.1
m l = 2 to 32,767 (number

m
of2divisions)
= 0 to 32,767 ( l o w
232.5
NIA speed range)
ROTARY TABLE CONTROL m l 5 m2

+~---t 1541-i,31--w2 - k W I ------t


X l Y l n l S [ ~ . ~ l K n ~ l t C n ~ l K nTwI l ~
c nI ~D~ I V . Z ]
I- a*---+ t-W 4 I--' W 3-t' w2- I-- Mi0--1
6. SPECIAL DEVICE AND INSTRUCTION LISTS

INSTRUCTION AND EXECUTION TIME LIST


6.2.9 EXTERNAL FX 110 DEVICES
Can only be used once.

Keypad i n p u t
Keypad i n p u t from [S-I is
stored i n [ D l . ] and sensed
b y ID2-I.

HEXADECIMAL KEY

DIGITAL SWITCH
n
(32) 338.0

n=l
205.8
n =2
208.1
-
45.5

39.9
1Hex keypad i n p u t *
Matrix input
hexadecimal input keys is

D igital switch*
from

received b y [ S - I and [Dl.],


stored i n rD2.1, and s,ensed
b y ID3.1.

Data from one set ( n = l ) or


two sets (n=2) o f 4-digit
switches are read i n time-
sharing and stored to
, ID2.1. .

-
7-segment decoder
BIN data o f the 4 lowest
b i t s o f I S - ] are decoded
and o u t p u t to [ D l for 7-
segment display.
7-segment time-sharing
For one set : display
209.7 For one set or two sets of

I NlA I SEVEN S E G M E NWITH


~ LATCH
For two sets :
246.9
+digit switches
n =O to 7 (eccording to the
number of sets and logic).
Arrow switch*
[Dl.] is controlled b y the
[S-I i n p u t and the result i s
o u t p u t and displayed b y
fD2.1.
n =O to 3 (logic
designation)
ASCII 'conversion
[s) After ASCll conversion of
FNC 76 Alphanumeric
- ASC - (up to 8-characters) - - (S.1, the result is stored to
[Dl.
ASCll CODE
During printing: ASCll code print output*
ASCll data [S.] i s output to
207.1
Print complete: [D-1 i n serial (&bit).
112.1

n words are read from the


address m 2 from the
special b l o c k m l to
destination [D.].

n words are written to the


address m 2 of the special
block m l from the source
[S.I.
6. SPECIAL DEVICE AND INSTRUCTION LISTS

INSTRUCTION AND EXECUTION TIME LIST


6.2.10 EXTERNAL FX SERIAL DEVICES
6. SPECIAL DEVICE AND INSTRUCTION LISTS

INSTRUCTION AND EXECUTION TIME LIST

6.2.1 1 EXTERNAL F p UNITS

I are the head


rs of the FX2-

i t B I N source

area
Fr3OG M block
designation
669.3 [Sl.]:Block number 0 to 31
[S2][Dl: Head 110 number

Fr30GM M code read


[S][D11 : Head I10 number
740.3 33.3 ID21 : M code transfer
destination
6. SPECIAL DEVICE AND INSTRUCTION LISTS

INSTRUCTION AND EXECUTION TlME LIST

f INSTRUCTION EXECUTION TlME (REFERENCE), , .

(1) CALCULATING OPERATION CYCLE TlME


(a) Basic operation cycle time :
The, total'execution time of all instructions from step 0 to the END or FEND instruction
and I10 processing time. I10 processing time is 30 psec x number of blocks; each
block is in unitsaof 8 110 points.
(b) Execution.cycle time : . -
, If a high speed processing instruction is used in a program, the program execution
cycle time is n times the basic operation cycle time (described above).
Example : High-speed counter
I-phase; 10 kHz, 1 point n = Approx. 1.4
. .
1-phase, 10 kHz, 2 points n = Approx. 3
I

(21 TlME DIFFERENCE ACCORDING TO OPERANDS


The instruction execution time varies according to whether the object device is digit-
'designation
. device
. such as KnX, KnY, KnM, KnS, K, H, T, C, or D.
lnstruction ~xe'cutionTime When a MOV lnstruction is Used :

Without index modifier With index modifier


. I

Instruction ~ x e c u t i o nTime When (D) MOV Instruction is Used :

Without index modifier With index modifier


' I

[ I : Values listed.
Note: If the designated device number of the bit device is n o t a multiple 0F8, the instruction
execution time will be slightly longer.
I

The execution time o f a pulse instruction is the same as the execution time of a
continuous instruction.
I
I 1 1 GENERAL HARDWARE AND INSTALLATION I
1 2 1 IBASIC SEQUENCE INSTRUCTIONS . I
STEP LADDER lNsTRucTloNs
I ,

APPLIED INSTRUCTION
-

SPECIAL DEVICE AND INSTRUCTION LISTS

APPENDIX I
7. USING SPECIAL UNITS EFFECTIVELY

7.1 FX2-24EI SPECIAL BLOCKS


7.1.1 HOW TO USE SPECIAL BLOCKS
(1) HEAD 110 ADDRESS NUMBERS
An FX2-24EI special block is a simple interface unit used for communication between an FX2
Series PC and the following special units:

F2-6A analog I10 unit


Fz-32RM programmable cam unit
Fz-30GM pulse output unit
For communication between these special modules and a PC, the head I10 number determined
b y the position where the FX2-24EI special block is connected must be made clear. An example
is shown below.
X30 X40 X60 XI00 FXz-14EI special block
Inputs XO to X27 to X37 to X57 to X77 to X I 17 /

Up to three units can


be connected to up to
256 points (ver.2.10
and after), including
general inputslout-
puts.
An FX2-24EI special
block occupies 16
input points and 8 out-
Outputs YO to Y27 Y30 Y40 Y50
- to Y37 to Y47 to Y57 put points.
No.1 No. 2 No. 3
(3) Control power is sup-
plied from a base unit
- or extension unit. As-
In the configuration s h o w above, the head I10 numbers are sume that it is an 8 110
determined as shown below from the block nearest to the base block when calculat-
unit. ing power consump-
No. 1 (X, Y) = X40, Y30
No. 2 (XI Y) = X60, Y40
No. 3 (XI Y) = X100, Y50 I 72 110 points
A total of 128 110 points in the PC

An F a - 4 8 M allows connection of up to 32 points of extension


blocks. In this example, the FX2-24EI special blocks occupy 24
points (3 x 8 points). Use this figure to calculate power consump-
tion. Add the 8 points occupied b y the FX-8EX to the 24 points.
With special units of the F2-series, connect the earth terminal
to the earth or the [SGI terminal of the FX2-series PC.
7. USING SPECIAL UNITS EFFECTIVELY

FX2-24EI SPECIAL BLOCKS


(2) F-16NPINT (M-NETIMINI INTERFACE UNIT)

FZ SERIES PC FX2 SERIES PC

F- IGNP/NT FX2 Series PC F- IGNP/NT


------
Fz Series PC '
------

T T ~ o .oa, XOl4-X027 -I x 40 I X 44-X 57

Internal
devices
\
- Connector y040~y027

.d - x414-X427
""ector Y440-Y447
. Internal
devices
\
-
? ' I
y 30

x 60
40
Y 30-Y 37

X 64-x 77
Y 40-Y 47

X514uX527 I xi00 X l O 4 - X i 17
I
C
nnector Y540-Y547 a Y So Y 50-Y 57
------A

,e
Extension Cable Connector Numbers
, , - - - - I

0
Head 110 numbers (an example given in Section 7.1.1 ( 1 ) )

I10 numbers for F-16NPINT correspond- • The F-16NPINT 110 numbers are based
ing to the extension cable connector on the head I10 number as shown above.
-numbers as shown above.

For details, see the F-l6NPlNT Interface Unit User's Manual. The 110 numbers in that manual
are based on the F2 Series PC. Change the I10 numbers based on the numbers described
. above to create a program for an FX2 Series PC.

Example of I10 Number Correspondence

The SG terminal of the F-16NT is different to that of the FX2-series PC. DO NOT connect
them together.
7. USING SPECIAL UNITS EFFECTIVELY

FX2-24EI SPECIAL BLOCKS


(31 F2-6A (ANALOG I10 UNIT)

F L SERIES PC FX2 SERIES PC

F 2 Series PC
----FX2 Series PC
I
F2 -6A
4

devices
f

Extension Cable Connector Numbers Head 110 numbers


I .
(an example given in Section 7.1 . I ( 1 1)

The Fz-6A analog I10 channels cor- • Analog F2-6A I10 channel numbers are
responding to :he extension cable con- -. .identical to each other as shown above.
nector numbers are shown above. Each Fz-6A is automatically identified by
the differences in the head I10 numbers.
For details, see the F2-6A Analog 110 Unit User's Manual. The I10 numbers in that manual
, are based on the F2 Series PC..
Analog I10 channels for FX;! Series PC programs, are th'e same as described below,
regardless of the number of F2-6A units connected.
Analog output channel : KO00 to KO01
Analog input channel : KO10 to KO13
7. USING SPECIAL UNITS EFFECTIVELY

FX2-24E1 SPECIAL BLOCKS


(4) F2-32RM (PROGRAMMABLE C A M SWITCH)

F2 SERIES PC FX2 SERIES PC

----F2 Series PC

- OO0 ' Y
F2 -32RM
0-Y-37-
----FX2 Series PC
1 - F2 -32RM

internal
L
ecmr , 3ANK 0,I

Internal
devices
\
I

0.400 Y 0-Y
nnector) SANK
37
0, 1
devices
60
40
1-j BANK 0. 1
I

No.500' Y 0-Y 37
onnector SANK 0. I BANK 0.1

0
Connector Numbers for Extension Cable Head 110, numbers
(an example given'inSection 7.1.1 (1))

For data communication between a PC For data communication between a PC


' ' and an F2-32RM, each F2-32RM is iden- - and an F2-32RM, each F2-32RM is iden-
tified by its extension cable connector tified by its extension cable connector
number. number.

: 9 . ~ o r d e t a i l s ,see the F ; - 3 2 ~ Programmable


~ Cam Switch User's Manual.
The explanation in that manual is based on the F2 Series PC. However, programs can b e
created in the.same manner as for the F2-32RM. Use output numbers YO to Y37 and bank
numbers 0 and 1.
7. USING SPECIAL UNITS EFFECTIVELY

FX2-24EI SPECIAL BLOCKS


(5) F2-30GM (PULSE OUTPUT UNIT FOR POSITIONING)

F2 SERIES PC FX2 SERIES PC

------
F2 Series PC F2 -30GM FX2 Series PC F2 -30GM ,

i
-~ 0 i 4 3 000
* X 0-X
X014-X027
6
X 40
X OyX 6
XM4-m7
, 'YO40-YO47 y 30 % ~ 0 4 0 ~ ~ 1 3 4 7
Internal Y 0-Y 6 Internal Y 0-Y 6
devices
: X 0 4 X 6
\ 400 , X414-X427
Y440-Y447
Y 0-Y 6
. X 0-X 6
500 , X514-X527
Y540-Y547
------ Y547j Y 0-Y 6

.- U
~ x t e n s i o nCable Connector Numbers Head I10 numbers
(an example given in Section 7.1.1 (1))

Create programs for the F2 Series PC and The device numbers described above
the Fz-30GM using the device numbers are used for FX2 Series PC and F2-30GM
d e s ~ r i b e dabove. To identify the F2- programs. '

30GMs during communication between


A value of 0, 4, or 5 can be selected for
the PC and an Fz-30GM, use different
device that corresponds to the extension
. Using "Ow will simplify programming.
cable connector numbers. When Y37 is turned ON b y the FX2 Series
PC, Y 47 of the F2-30GM is turned ON.
When X 14 of the Fz-30GM is turned
ON, X44 of FX Series PC is turned ON.

For details, see the F2-30GM Pulse Output Unit Handy Manual. The I10 signals in that
manual are based on the F2 Series PC.
Even h e n block selection is made at the F2-30GM side, the programming of FNC97 (BLK)
as s h o r n in Section 5.1 1.8 in the FX2 PC is still necessary.
7. USING SPECIAL UNITS EFFECTIVELY

FX2-24EI SPECIAL BLOCKS


(6) FX2-24EI SPECIFICATIONS (SPECIAL BLOCK) .

(a) I10 POINTS '

A total of 24 110 points (16 input points and 8 outputpoints) are occupied. Although up
to three units can be connected to the base unit, the total number of I10 points is limited.
These limits are listed below:
Total number of I10 points : 256 points (ver. 2.10 and after)
Allowable maximum input points : 128 points
Allowable maximum output points : 128 points
In a special unit, 12 of the 16 input points and all 8 output points are actually used.
An FX2-24EI must be connected at the most distant position from the base unit. General
I10 blocks and extension units cannot be connected beyond the FX2-24EI unit.
(b) POWER CONSUMPTION
Power is supplied to this special block from a base unit or extension unit. The special
< . .block consumes power equivalent to 8 points of a general I10 block.
General I10 blocks with up to 16 110 points can be connected to a base unit or extension
unit of 32 points or less. Extension blocks with up to 32 110 points can be connected to
a base unit or extension unit of 48 points or more.
See the FX2 Series PC specifications for the general environmental requirements;

I
--- --- -- --.-:-; -
- I - - --
2-05.5 (00.22')
Mounting holes

DIN rail (width : 3 5 rnm (1.38 in))


mounting recess

/ Weight . : Approx. 0.3 kg (0.66 Ib) .


Special unit connector Attachment : Labels for extension 110 numbers
(a cable is supplied with each special unit)
7. USING SPECIAL UNITS EFFECTIVELY

7.2 FX-232AW INTERFACE UNIT

7.2.1 FX-232AW INTERFACE UNIT SPECIFICATIONS


The FX-232AW interface unit converts the RS422 signals output from the PC into RS232C signals to
allow communication between a PC and a personal computer.
use this:interface unit vhen,creating a program with a personal computer. In addition to this, the
folowing signals can be handled by the interface unit :
(11 SIGNALS

(a) ONJOFF status monitoring of devices such .as X Y, M, S, T, and C.


(b) Monitoring present value data of devices such as T, C, and D.
(c) Forcible onloff cont;'ol of devices such as X, Y, M, S, and T.

( d l Rewiting present values of devices such as T, C, and D.


Signal transmission speed : 9600 bps
Required environment : Refer tb the g'eneral environmental requirements described
in Section 1.10.1.
..

I( 05 (3.58') .

2-r5.5 (r0.22")
Mounting holes

ble connector

DIN rail (width : 35 mm (1.38 in))


mounting recess

232C connector Weight : Approx. 0.3 kg (0.66 Ib)

Optional Cables :
1. FX-422CAB : for connecting to PC (0.3m(11.87)
2. FX-232CAB : for connecting to computer (3m(9.8ft.)l
7. USING SPECIAL UNITS EFFECTIVELY

7.3 FX-8AV VOLUME ADAPTER

7.3.1 VOLUME ADAPTER SPECIFICATIONS


The FX-8AV volume adapter is connected to the panel on the left side of the base unit.
Eight miniature volumes are provided on this adapter. They can be adjusted a screwdriver from
the front of the adapter.
( 1 ) USE
The adapter is generally used as an analog timer. It can also be used in place of a rotary swtich.
(2) SPECIFICATIONS
See Section .1.10.1 for the general environmental requirements.

in))

Weight : Approx. 0.3 kg (0.66 Ib)


7. USING SPECIAL UNITS EFFECTIVELY

7.4.1 PARALLEL LINK ADAPTER SPECIFICATIONS


(1) FX2-40AP (FOR FIBER-OPTIC LINK]
The FX2-40AP parallel link adapter for .fiber-optic cables is used for data communication
b e t w e n two PCs is connected to the port on the left side of base unit.

Master station Slave station


(drive M8070) (drive M8071)
Transmission distance : 50 m (164.05 ft)
F X Series PC .
Transmission signals :
/ :;
I

Master-Slave 100points (~800toM899).


10 points
Slave -. Master loo points
(D490 to D499) --
5-w

(M900 to M999)
10 points (D500 to D509) .
Communication time : hv
70 msec + Master and slave station
cable connector operation cycle time to send and receive Fiber-optical cable
connector

d
Fiber-optic cables
F-OFC-MI0 fiber-optic (10 m (32.81 ft))
F-OFC-M30 fiber-optic (30 m (98.43 ft))
\
1 Equipped with a
CA9104AP con-
' . F-OFC-M50 fiber-optic (50 m (164.05 ft)) ' nector

See Section 1.10.1 for the general environmental requirements. ~wo.fiber-opticcables are
required for connections. Note that the fiber-optical adapters must be located as far from
the power cables as possible.
It is advised that only light loads should be driven from the output terminals of the PC that
are close to the fiber-optic link adapter.

- 3
10 ( 0 . 3 9 ' ) -,
r - --- 1 245 ( r o .22-1
-----:--. I-=:-/
~o u n t i n gholes

DIN rail (v4dth : 3 5 rnm (1.38 in))


mounting recess

Weight : Approx. 0.3 kg (0.66 Ib)


Fiber-optic cable
connector port
7. USING SPECIAL UNITS EFFECTIVELY

FX2-4OAPlAW PARALLEL LINK ADAPTER


(2) FX2-40AW (FOR WIRE LINKS)
The F X Z - ~ O A W
dira~~
link
e ~adapter used for data communication between tw PCs for twisted-
pair cables is connected to the port on the left side of the base unit.

Master station (drive M8070) Slave station (drive M8071)

FX Series PC

Transmission distance : 10 m (32.81 ft)

Communication time : See Section 7.4.1 (1)

----- ----
the [SGI terminal of each adapter to the [SG]
Twisted-pair cable terminal of each base unit.

Ground.the ierminal.of base units with a class 3 ground. If this is not possible, connec:t the
earth terminals of each unit with a 2 mm2 cable (AWG 14).
See Section 1.10.1 for the general environmental requirements.

2-15.5 110.227
Mounting holes

DIN rail (width : 3 5 m m (1.38 in))


mounting recess

Twisted-pair cable
connector Weight : Approx. 0.3 kg (0.66 Ib)

Special relays : M8072 - Link RUN flag to indicate that they are under communication
mode.
M8073 - Setting error. Masterklave designation have not been set
correctly.
M8063 - Link error. Communication error or sum error.
7. USING SPECIAL UNITS EFFECTIVELY

7.5 SPECIAL BLOCKS

The F X - 1 6 ~ ~ 1 ~ ~ 16 uses
points of i n p u t and 8 points
of output.
FX-16NP FX-16NT
M-NETIMINI Interface. M-NETIMINI Interface.
Optical-link type, Max. Twisted-pair link type.
station distance = 50 Max. station distence
m ( 164ft.) = 100m (328ft.)
5VDC 80mA 5V DC 80mA
Optical Cables
F-OFC-IOM
F-OF=-3OM
F-OFC-50M
can b e used.

FX-2DA FX-2AD-PT
Analog Output block. Analog i n p u t for FX-4AD
12-bit . PT100. Analog Output block.
2-channel, Includes amp. for 12-bit
5V DC 30mA PT100 sensor. +channel,
12-bit 5V DC 30mA
2-channel,
5V DC 30mA

FX-1HC FX-1GM
H i g h Speed Counter Block. One axis pulse output.
2-phase 50 kHz 1-channel, positioning control unit.
5V DC 70mA Stand alone or link to FX2 is .
possible.
Power : AC85 to 264V
max. 100kpps.
GENERAL HARDWARE AND INSTALLATION

BASIC SEQUENCE ~ N S T R U C ~ I O N S

SPECIAL DEVICE AND INSTRUCTION LISTS


-

1 USING SPECIAL UNITS EFFECTIVELY -


I
APPENDIX

1. LIMITATIONS OF SOME INSTRUCTIONS


The following applied instructions can only be used once.
FNC52 MTR FNC 60 IST FNC 70 TKY
FNC 57 PLSY FNC 62 ABSD FNC 71 HKY
FNC 58 PWM FNC 63 INCD FNC 72 DSW
FNC 68 ROTC FNC 74 SEGL
FNC75 ARWS
With the following instructions, a maximum of 6 instructions can be driven simultaneously.
FNC 53 HSCS FNC 54 HSCR FNC 55 HSZ

- USING THE EXECUTION COMPLETE FLAG -


Special registers are provided to process each instructions listed above
Most of these instructions execute a series of operations over several cycles with the transient
state registered in these special registers.
With an FNC72 (DSWI instruction, for example, four-point outputs operate automatically in 0.1
second intervals. If the instruction drive input is turned OFF before an operation series is
completed, the operation is suspended. When the instruction is turned ON again, the operation
series starts again from the beginning.
To avoid suspending an operation, drive the instruction with the following sequence using
execution complete flag M8029.

Po 1-1 SET IM 01 FNC72 operates while XO stays ON.


If XO is turned OFF, MO keeps operating until
FNC72 has been completely executed.

When programmed in this way, FNC72 reads the digital switches


through a series of operations b u t it only reads them once. This
means the outputs Y10 to Y13 are not operated continuously so
that there is no need to worry about the service life even if the
outputs are of relay type.
APPENDIX

LIMITATIONS OF SOME INSTRUCTIONS


- MODIFYING WITH INDEX -
The use of instructions whose designation in a program is limited can be expanded by modifying
the object device number with index register V or Z.

. X 10-
(K O)-L(Z) The number of pulses determined by the data in
( D l 0 1 and ( D l 1 1 is output t o Y20 and Y21
respectively.
(K 1)+(Z) Whether the (Dl01 data or the ( D l 1) data is used
is determined b y the ONIOFF state of X10.

I I I
Pulse Frequency Output
output Number number ,
of pulses

If the ONIOFF state of X I 0 is changed while a series of pulses is output with a FNC57 instruction,
the change in the ONIOFF state is not accepted until th,e set number of puises has been output.
To change the output immediately by suspending the present operation, one possible method is
to turn OFF the FNC57 instruction with the sequence shown below.
APPENDIX

2. 2-INPUT RUNISTOP SWITCH CONTROL


The FX2 Series PC has one RUN input terminal. When this terminal is ON, the PC is in the RUN state
and when it is OFF the PC is in the STOP state. This is the same as with the F i Series PC..
An F2 Series PC, in comparison to an FX2 Series PC, has both RUN and STOP input terminals. By
driving these terminals momentarily with a pushbutton switch, the RUN or STOP state can be
maintained.
With an FX2 Series PC, RUN/STOP control equivalent to that of F2 series can be accomplished with
a special auxiliary relay. ,The general input shown below is used as the-STOP input.
(JAPANESE SPECIFICATION)

-A number can b e
selected a s necessary
for a n i n p u t terminal.

( FXz Programmable controller I

RUN monitor M8000 is turned ON when the RUN input pushbutton is pressed and special auxiliary
relays M8035 and M8036 are operated.
The RUN status is self-maintained by this relay operation.
The self-maintained RUN status is canceled when the END instruction is executed after the STOP
input ( X I ) turned ON. The PC stops.
Therefore, the RUN input is given priority when the RUN and STOP input pushbutton switches
are pressed at the same time.
To give priority to the STOP input, interlock with the external input circuit so that the RUN input
is turned OFF while the STOP pushbutton is pressed. ,
Q When a STOP input is given, M8035, M8036, and M8037 are turned OFF.
APPENDIX

3. MEASURING PULSE WIDTHS


.. ' ' ,, ., ,.. ' ' ...(... , , , , . ,

Pulse width can be measured in increments of 1 msec w'th a 1 msec timer or 0.1 msec with special
data register D8099.
Preparing
to
X 10 measure

sw (X 0, X 1)

( P C (Japanese Spec.) -1 k
To measure this duration
L:- -J -
When a 1 msec timer is used When D8099 is used

I 001
--
Me000
RST T 246
, - .
Reset of RST image
-

KF FEND
ving D8099

P ~ J .
RST D 0
.: ,

I Q T 246 K32767 Timer

I- IRET
Measured data
1. I
P MOV 08099 D
a 0

data

, 1 b]- Measuring comp

1 4 , X 1 stop timir +ENDj


-- @1-T I T 245 ] Reset timer

, IRET

..
. .+
I
1.

1-msec timer T246 is driven b y the interrupt This is the same process as described on the
of 1001 when XO is turned ON.
, left, except that D8099 is used instead of a 1
msec timer.
When XI is turned OFF, the present value of
~ 2 4 6id-vansferred
' to the8measured value The special data register counts the opera-
storage data register DO by the interruption tion cycle to be initiated after M8099 is driven
o f 1100. , Then, completion signal MO is -with a 0.1 msec clock. If the counted value
operated, . exceeds 32,767, counting begins again froni
*: 0.
An interrupt enable instruction (El) must be witten into the main program.
APPENDIX

4. PROGRAM FLOW CONTROL INSTRUCTIONS


The relationship between an MC-MCR instruction and a CJ instruction are detailed in Section 5.2.1.
The other program flow instructions are explained below.
In .the following tables, the symbol "
"a
a
"indicates an "iclusive" relationship and the symbol
"indicates cases where the zones overlap.
Upper r o w Upper r o w instruction
instruction
Left column instrucf o Left column
instruction

MC-MCR CJ-P El-Dl FOR-NEXT STL-RET

MC-MCR
e o e o a 0 a0 - a0
CII)A =A a0 aX (6607) X (6605)

CJ-P
a 0. a0 , a 0 G30 @o
UDA m A m o &A UDA

a 0 a 0 a 0 a 0 a0
El-Dl
m o a o w o m o UDO

FOR-NEXT
@X (6607) a0 a0 o n@ X (6607)

aX (6607) aA a 0 C(T) % 2 aX (6607)

STL-RET
aX (6605) aA a0 @ 0"JVifiin
one STL) a0
x (6605) aA m o w x (6607) ao
P-SRET aX (6606) a0 a0 G O @X (6606)

CII) X (6608) CII) A a 0 C(13 X (6607) CII> X (6605)

I-IRET a X (6606) a0 a 0 a0 aX (6606)

X (6606) A a 0 ce> X (66071 aX (6606)

FEND-END a0 a0 a0 a0
X (6608) aX (6701) aN 1 aX (6607) X (66051

0-FEND a0 a0 a0 a0
ax (6608) a0 a0 aX (6607) aX (6605)

0-END a 0 a0 a0 a0
(NO FEND)
a0
aX (66081 aX (6701) WC 1 aX (6607) aX (6605)
1
APPENDIX

PROGRAM FLOW CONTROL INSTRUCTIONS


0 : Combinations which can be used without restrictions.
X : Inhibited combinations - the numbers in parentheses indicates error numbers.
A : These combinations are not inhibited, although they are not recommended for use.

a 1 Enters a state as i f Dl instruction i s missing.


An error does not occur.

s2 FOR FOR
-
c--=--a=----,

NEXT
Sequence i s controlled as indicated
b y the solid lines.
NEXT

3 ~ h first
e FEND or END instruction becomes
effective, precluding the expected program flow.

The combination of instructions that have an "inclusive"


relationship is permissible with some exceptions.
Note the following exceptions.

(1) MC-MCR c a n n o t b e used i n blocks with FOR-NEXT,


P-SUET, or I-IRET.

( 2 ) STL-RET cannot b e used i n blocks with FOR-NEXT,


P-SUET, or I-IRET.

(3) Program flow may n o t b e discontinued while inside


blocks of MC-MCR, FOR-NEXT, P-SRET, or I-IRET
with an I, IRET, SRET, FEND, or END instruction.
APPENDIX

5. CONSTANT SCAN MODE


When special auxiliary relay M8039 is driven, the scan time cannot be shortened to less than the
scan time designated by 08039.
Use the constant scan mode when executing an instruction such as FNC67 (RAMP), FNC71 (HKY),
and FNC77 (PR).that is executed in synchronization hw
ti the scan.
When an FNC71 instruction is used, it is important to designate more than 20 msec for the scan time
because a response delay due to the input filter is inevitable.
If the constant scan mode is not required, use a timer interrupt routine.
A circuit that processes an HKY instruction in the timer interrupt mode is shown belowas an example.

Inputs XO to X3 can be refreshed in 10 msec


intervals with 1610 b y setting the filter constant ,
to approximately 7 msec with en REFF instruction.
APPENDIX

6. MEMORY HOLD STOP


By maintaining special auxiliary relay M8033 in the ON state, the output status obtained during the
RUN state can be maintained when the PC operation status is changed from RUN to STOP.
For example, if a PC is used to control a heater, the operation state of the heater and other equipment
can be maintained even after the PC is changed to the STOP state and then restarted after changing
the program.

7. REAL-TIME CLOCK FUNCTION (CPU Version V2.0 and after)

HARDWARE OPTIONS I

When one of the following real-time cassettes is connected to the memory cassette connector of the
FX2, real-time clock function becomes available.
. - - - .

UNITS DETAILS
FX-RTC .. Real-time clock function only
FX-RAM-8C- . Real-time clock function + 8 K RAM
FX-EEPROM-4C Real-time clock function + 4 K EEPROM

FUNCTIONS
This battery-backed real-time clock provides calendar information as well as time information.
This data is stored in special data registers D8013 to D8019 as shown below:
~8013 seconds 0 - 59
D8014 minutes 0 - 59
D8015 hours 0 - 23
D8016 day 1-31
08017 month 1 - 12
D8018 year 0 - 99 ( 1980 - 1999, 2000 - 2079)
D8019 day of the week 0 - 6 (Sunday - Saturday]
The calendar caters for leap years in the peiiod 1980 to 2079.

CONTROL FLAGS:-

I M8015 I Time setting


I Clock val"es can now be corrected b y programming
c an el.
Clock restarts when set from ON to OFF.
When ON, clock data registers hold their values.
M8016 data hold
The clock itself continues however.
. .
When driven OFF to ON, rounding to the nearest minute
M8017 Minute rounding .. . . .
I
occurs.

II
I

M8018 I Clock available I Automatically set to indicate clock function is available.


I M8019 I Setting error 1 Sets when clock data is out of their allowable range.

BATTERY-BACKUP' AND ACCURACY -.

(11 In the backup mode, negligible current is used for the real-time Clock compared with the RAM
memory. Thus, only the memory portion is required to be considered for the life of the battery.

(2) Worst case accuracy is f45 sec. per month at 25OC.


APPENDIX

8. FROM INSTRUCTION (Ver. 2.0 and after)


8.1 FROM

FROM FNC 78 Object devices


(P) (16/32) IK.HIK~xIK~Y(K~MIK~sI T I C I D IV.Z~
Reading from
Special blocks /-I k---4°-l------d*
mi
m2
n
Number o f steps : FROM, FROM(P)........................ 9 steps
(D)FROM, (D)FROM(P)............. 17 steps

The FROM instruction reads n words of data from the special block m l starting from the buffer
address of m2 to destinations [Dl in the base unit.

m l : Special block number (range: 0-71


Special blocks assigned with this number in ascending order from the base unit as shown below:
example:

FX-32MR
c
1
Analog FX-
1
Analog
1
Analog
Special blocks

FX-
input 8E X ouiput output 8EYR

Special , Special
X20-X27 Special Y20-Y27
block 0 block 1 block 2

m2: start address (range: 0-311 . ,

n: no. of data words (range: 1-32) [ I - 1 6 for (DIFROM, (DlFROM(PI1 ,

Buffer Memory o f Word d e v i c e


S p e c i a l BlocK of FX-CPU
.-
Transfer
m 2 -' [D-I
n Words
?

Example:
When X I 0 is on, from the buffer memory
address of K1O of the special block num-
FROM ,ti 0
. .
K 1 0 . D 0 K 1 ber 0, one word of data is read to DO of
the base unit.

If X I 0 is off, execution is not performed.


APPENDIX

8. F R O M INSTRUCTION (Ver. 2.0 a n d after)


8.2 l108S TAKEN UP BY SPECIAL BLOCKS
Special blocks that require the use of applied functions TO and FROM takes up 8 110 points per unit.
When 2 special blocks are uked, 8 x 2 = 16 points of I10 are taken up'by these.
Although, I10 points are takes up the special blocks, they do not affectthe addressing order of normal
I/Ofs.

3 2 pts. 1 6 pts. 8 pts. , 8 pts. 8 P@. 8 pa. total


= 8 0 pts.
Special Special FX- FX-
FX-32M FX-16EX of 110 is
block block 8EX 8EYR
take u p
XO-XI7 X20- X37 - - X40- X47 -
YO-Y17 - - - - -Y20-Y27

8.3 INTERRUPT DURING THE EXECUTION OF FROMITO (M8028)

M8028 = OFF
When M8028 is"not driven or.is OFF, jumps When M8028 is driven ON, jumps caused by
caused by interrupts will occur after the interrupts will occur immediately.
completion of the transfer of the FROMITO
instruction.
A small delay of (800 m + 200) psec. can be Data transfer will resume upon return from
expected in the m r s t case (m = no. of 32 bit the interrupt program. This may not be
words). desirable if a FROMITO instruction operates
on the same memory area in the interrupt
program.
Driving M8028 OFF ensures that FROMITO Drive M8028 ON only when a very short
instructions in the interrupt program do not delay is required in applications where
interact with others elsewhere. timing and accuracies are important.
APPENDIX

9. TO INSTRUCTION (Ver. 2.0 and after)

TO FNC 79 Object devices


(P) (16132) [K.HIK~xIK~Y~K~M[K~sI T I C 1 D [v.z~
Witing to
Special blocks I m i4 k - - - - [ D - l ~
m2
n
Nu$er ofsteps : TO, TO(P) .................................... 9 steps -
(D)TO, (D)TO(P) ......................... 17 steps
*

I
rn 1 : Ot07 I

*, rn2 : 0 t 0 31
n : 1 to 32

The TO instruction writes n number of words to special block number m l , starting at buffer address
m2 from the source,device [S-I of the base unit.

m l : Special block number (range: 0-7) ,


Special blocks which use the TO instruction takes the same amount of 110's as blocks that use the
FROM instruction (8 IIO's). ' . '
m2: Start address o f buffer (range: 0-31)
n: no. of words (range: 1-32) 17-16 for (DITO, (D)TO(P)I

~ uf ef r emo or y
S p e c i a l BlocK
of word d e v i c e
o f FX-CPU

m2 - .-
Transfer
7

n Words
-

Example:
When XI1 is on, the contents of D l (1
word) is sent to the buffer memory ad-
dress K20 of the special block number 1.

When X I 2 is on, the contents of D2 and


D3 ( 2 word) are s e n t t o the buffer
memory address K20 & K21 of the spe-
cial block number 2.

If X11, X I 2 are off, execution is not performed.


APPENDIX

10. NOTES ON USING THE MTR INSTRUCTION


Whenever the matrix input MTR applied function is used in the FX. Please pay attention to the fol-
lowing important points. Failure to do so may result in an input of incorrect data.
1. . Driving the Instruction
ln the program, the MTR instruction must be driven continuously on, b y for example, the R U N
relay M8000: a

Y 40 M . 0 K 8
--
(always ON)
. ..

2. ~ a r d w a r -connections
e I

(a) If possible use inputs'dther than XO to X7.


(b) In the case when-any of the inputs XO to X7 is used, connect an additional resistor to each
output in a similar manner shown in the following example:
. ,

Transistor Output
APPENDIX

11. DlSTRlBUTlON OF POWER


11.1 A MORE ACCURATE METHOD
For the sake of simplicity, power consumption of various units which drawcurrent from the base unit
have been represented elsewhere as an equivalent of a number of extendable I10 points. In doing
so, a wasteful margin is created and the I10 flexibility of the system reduces. The following is a more
accurate method to determine the true maximum of extendable blocks and adapters.
POWER RAILS
For the sake of easy calculation, the following items may be considered theoretically to beg
nw
aird
current from the stated volta,ge rails of the power regulator of the base unit:

Current drawn from Comments


Extension blocks 24 V rail Connects to the right of the base unit.
Special adapters 5 V rail Connects to the left of the base unit.
Special blocks 5 V rail Connects to the right of the base unit.
. -
Therefore, the maximum number of extendable blocks can be determined from the powe'r available
from the 24 V rail. For the extension adapters and special blocks, only the 5 V rail needs to be
considered.

9 1.2 E V E N D I N G 110 BLOCKS


Extendable block I10 is-limited by the following:
I
( 1 ) TOTAL OCCUPIED I10 OF THE SYSTEM MUST BE 256 O R LESS.

(2) POWER REQUIRED MUST NOT EXCEED THAT O F THE.24 V RAIL.


The following chartlshows the maximum current that can be drawn from the 24 V supply in
relation to the number of extendable block I/O1s: I
I
APPENDIX

DISTRIBUTION OF POWER

Current Available for 24 V DC Sensors '

I n Relation to Extended I10 Blocks


.. . . * 1

.,
. 1 . .

(mA)-
-

for sensors
from 24 V Block 110 ratio:

Outputs blocks only

0 8 16 24 32 40 48 56 64 72
Total Number of Block 110's
Using the Chart

(1) From the model of the base or extension Example (A):


unit, determine the lower or upper group present configuration:
of lines. (In example: upper) FX-64MR + 24 input block + 16 output block
(2) From the present configuration deter-
mine which graph to look at from this
group of lines. ( In example: 16 outputs,
so 3rd from the top)
APPENDIX

DISTRIBUTION OF POWER
(3) Total numbers of block 110's connected to this unit will meet this line at the available current on
the Y-axis. (In example: point (A),<(40I/O1s, 140 mA))
In the example, if current drawn from the 24 V DC terminals is reduced to 40 mA or less, it can
be seen that this meets the line in which point (A) lies at around 56 extension block 110's. This
means FX-64MR can , in fact, be connected with 56 block 110's without the need of an extension
unit (8 points more than the provisional specification of 48).

11.3 EXTENDING SPECIAL BLOCKS AND ADAPTERS , ,

The number of special blocks that can be connected to the base unit is limitea by the8following:
(1) TOTAL NUMBER OF SPECIAL BLOCKS WHICH USE FROMITO MUST BE 8 OR LESS.
'
(2) TOTAL OCCUPIED.II0 OF THE SYSTEM MUST BE 256 POINTS OR LESS.
(3) POWER REQUIRED MUST N O T EXCEED THAT AVAILABLE F R O M THE 5 V RAIL.
In the case o'f special adapters, only one can-be connected to the base unit at any time. The
maximum, curl;ent draw allowed from the 5 V rail for the use of special blocks and adapters are
I
as follows: I .

Base unit 1 290 mA


I Extension unit , . , 1 690 mA
Current Consumption of Special Blocks and ~ d ' a p t e r s
. .
Product Occupied I10 1 Current draw (5 V) Commands
I
FX-8AV none 25 m A 01;ly one o f these can be
FX2-40 AP none 80 mA connected at any time.
FX2-40 AW none 70mA ,
FX2- 24E I 16 in., 8 out. 5mA , -
FX-1 6NPINT 16 in:, 8 out. . 80 mA
FX-1HC 70 mA Although %-points of I10 is
FX-4AD
FX-2DA
. 8 points'
30 m A
30 m A
taken, the addressing
order of normal I t 0 IS n o t
FX-2AD-PT 30 m A affected.
APPENDIX

12 PROGRAM CHANGE DURING RUN


With version V2.1 or later-types of FX2 series, program instructions in the controller can be altered
using our personal computer software and A6GPPlPHP.
Some key points to note are as follows :
Software versions of A6GPPlPHP for FX2 and personal computer PC98, J3100 etc must be
--
I .
version V2.O-or later:
, . function is only possible with the RAM memory of the FX2. EPROM or EEPROM cassettes
-This
- ' do-not allowthis function to operate. -
, Change-are made in ladder mode only. Changes cannot be made in SFC or LIST mode. Also
max no.-of steps that can be changed at once is 127 steps. - -
. -

~F+G~
-~F
~+G
* ,
Example 1. Change 7 steps+7 steps
o XO is changed from normally-open to
Y 0 T 0 normally-close. No change in number of
K 10 K losteps.
,

I
1
Example 2. Insert 3 steps+7 steps
10
1 MIY y 2 I C I ~X2 and
~ CO is +
added. G ~

0 x 2 No. of steps has changed.


I I

Example 3. Delete 5 steps+.5 steps

Y , 3
y f - y
.

+
.

a Q50p
?&--a
Y 3
. -
. .

MI5 is deleted.
Delete is made by overwriting-with NOP.
BEFORE AFTER No. of steps is unchanged.

Labels P.1 for jumps and subroutines must not be altered added or deleted.
Examdle
6 ' -

P I cannot be added and PO cannot be


Po changed.

F ~ E F O R E
i
I AFTER
Ladder contents such as Y2 can be al-
tered.

High speed counters ( ~ 2 3 to


5 ~ 2 5 )5 or applied functions FNC9O to 99 cannot be added,
altered or deleted. I
1
Note :
I

With version V2.0 or versions before, timer, counter and data register settings are alterable by all
versions of peripheral software.
-
APPENDIX

13 HIGH CURRENT TRlAC OUTPUT BLOCKS


FX-4EYS-H and FX-8EYS-H are triac output blocks which allowa higher AC current load to be driven.
The rating of standard output blocks is 0.3 A while these allon 1A.
SPECIFICATION

Load Voltage AC 85 to 242V Leakage 1m AIAC 100V, 2mAIAC 200V

Resistive loed 1Alp t, 2AMp ts. Min. Load 0.4VAIAC 100V. 1.6VAIAV 200V

Inductive load
50VlAC 100V
100VAlAC 200V
1. Responce I OFF-.ON lms,ON-.OFFlOms or less 1
Lamp load 10OW Isolation Photo-isolation

Display LED ON when active


,
Environmental specifications are as base unit.

r---------
022pF
1 022$ FX-BEYS
R

Occupies 8pts
i
i
FX-4EYS-H
i
I
APPENDIX

14 HIGH CURRENT TRANSISTOR OUTPUT BLOCKS


FX-4EYT-H and FX-8EYT-H are transistor output blocks which allowa higher DC currnet load to be
driven. The rating of standard transistor outputs is 0.5A while there allow 1A.
SPECIFICATION

I Response
, I OFF-ON 0.2 ms or less
ON--OFF 0.4 ms or less I
Lamp load Isolation Photo-isolation

I Display
I LED ON when active I

Loads
Y 4 2, I

External
T?rc( y - 6 1 power

Dimensions mm(inch1

m FX-8EY T-H
APPENDIX

15 DC POWERED UNITS
Basic or extension unit models
ht i v their part numbers ending in -D or -DS are 24V DC p o w r e d
models. -D is Japanese specification, and -DS is overseas specification models.
Extension blocks and special blocks which are modules which derive thier power from the basic and
extension units are connected to these in the same way as AC powered types.

x2
Sensor
switch
i
,
-
- j-DC24V --

DCIDC
~ohverter ii
Base unit , , Extension block
L - - ~ ~ ~ w L- _ -J ~ ~ ~

NOTES

*1 :Connect the [24V+l1[24V- I terminals of the DC powered basic and extension unit to a power
supply of the rating 24V+/-8V DC. Power consumption of the controller is listed in the table on the
next page.
When undesirable levels of ripple voltage appear on the power lines, it may be necessary to connect
a suitable smoothing capacitor across the p o w r lines.
"2 :For the prevention of burnt-outs, an external fuse of 3 to 5A is rec,ommended at the output of the
power supply unit.
'3 :Do not connect the [24Vl termiqnalof the base or extension units to any external load.
This prevents any damage to the controller in the event of faults in the external circuit.
I

'4 :Connect the earth terminal of the external unit to the earth terminal of the base unit which should
be earthed with class 3 earthing'of less than 100Q (Earthing is not necessary if not suitable)
"5 :Connect all [SGI terminals of all units and blocks together to maintain the system's
immunity to noise.
' 6 :Connect the commonlof input switches of the extension block to [COMI terminal of the base unit.
*7-:Connect the common of input switches of the extension block to [COMI terminal of the
I
extension unit. ..
APPENDIX

DC POWERED UNITS

FXZ-48MR-D -
_ _ t 1 Fa-24MR-D
FX-48ER-D
Fa-64MR-D 'FXZ-80MR-D

CONSUMPTION 30W 50W 50W 50W

INTERNAL FUSE 3A 5A 5A 5A

POWER DC24Vf 8V. Max. allowed power break of 5ms 1

BOX OUTLINE Same as AC powered types.

i
+24V

\I

Extenelon U n ~ t E n e n s ~ o nBlock ,
L _I L A
MAXIMUM NUMBER OF BLOCK EXTENSION 110 :
Basically, the maximum block I10 that can be connected t o the DC powered base and extension units
are the same as that of AC powered units.
SIMPLE GUIDE :
FX2-48MR-D, FX-48ER-D
FX2-64MR-D,FX2-80MR-D
A MORE EFFICIENT GUIDE :

I
4
FX2-48MR-D,FX-48ER-D
FXZ-64MR-D
24 FXZ-80MR-D

16
Block
Extension

-
INPUTS

Extension
Block extension OUTPUTS
0 I I

Block extension OUTPUTS

block arrangements of input and outputs are acceptable in the shaded regions.
I I

-
APPENDIX

DC POWERED UNITS
ATTE NTlON
. .

When using DC powered FX programmable controllers, it is necessary to add the following instruc-
tions to the beginning of your program in the programmable controller : - -

Step 0

- r Writes the
value-4 to
D8008
-.

Explanation :
With AC powered types of FX programmable controllers, the power break detection period can be
adjusted by writing the desried period into special data register D8008.
In the case of DC types, this detection period cannot be adjusted and is fixed at 5msec. Since this
is not adjustable, a special code, "-4" is required to be written to D8008. This is necessary to ensure
the 5msec. power break period will be detected correctly.
APPENDIX

DC POWERED UNITS
TERMINAL LAYOUTS
APPENDIX

16 DC POWER SUPPLY UNIT


The power supply units FX-1OPSU and FX-20PSU provide DC 24V p o w r to sensors an8 other general
devices from an AC souce. FX-1OPSU has a maximum load current of 1A while FX-20PSU is 2A.
Example connection Diagram

AC power 'lass
earthing
(<loon)

-
-

/ N 1 FG I-,
Power supply u n i t
i
Class 3 AC power 'lass
earthing QW
earthing
(<1000) ' (<loon)

Loeds
-
-
r\ I\ ,-\ /\ r.

- L I N I * L I N I iG I-,
Prograrnmeble
controller Power supply u n i t
i
'
L L----------- A
SPECIFICATION (environmental spec. is as base unit 1
I

I lnput source I AC85 to 264V 50160 Hz I


I o u t p u t Voltage ] DC24V*10% I
I Over load Protection 1 110 to 220% c u t beck (auto-reset) I
'Parallel connection with
another supply u n i t is not
permitted.

DIN rail
36rnm11.387

L rnmlinch)
APPENDIX

17 EXTENSION BLOCK AND EXTENSION U N l T CABLES


The following extension cables are available. Only one of the following can be used at any one time.
(1) FX-6OBC extension block cablelength : 0.6m
(2) FX-150EC extension unit cablelength : 1.5m
(3) FX-300EC extension unit cablelength : 3.0m

'EXTENSION BLOCK CABLE : FX-6OBC

Connect [ S G ] terminals
-----7/

Base or extensions. secure with Ext. Ext.


lock lever on Block Block
connector

EXTENSION UNlT CABLE : FX-150EC, FX-300EC

Class 3 earthing .-------------x--------------.


I

I
, DO n o t connect!!
I
- Do n o t connect the [SG] ter-
1 rninals o f the units connected
G
p
J b y the long extension cables.

-
-
-
-
FX-ISOEC
m-33Ec
Base Unit Extension Extension
Unit Block
Class 3 earthing
- --------- -x -- - - - - - -- - - - --;f Do "0' Conn'c" 1
I

I I
I I

\
SGI I+Iss]

Base Unit Extension Extension Extension


Block Unit Block
Class 3 earthing
,-------------x-----------------.
I Do n o t connect!!
I
-- I

i Shielded Cable *i
FX-ISOEC
FX-300EC
Base unit Extension Extension Extension
Unit Unit Block
APPENDIX

18 PERIPHERAL COMPATIBILITY
Peripheral compatibility with the version change to V2.1 (serial no. 1 4 x x x x and after 1 of the
FX2-series programmable controller is as follows :
Max I10 Real-time Program FROMTTO
Peripheral Version (Japanese o n l y )
128+ 256 clock during RUN addition
FX-20P System cassette FX-2OP-MFXB
V2.1 date:91/4 0 0 X 0
System cassette GP-80MFXA
GP-80
V1.l d a t e : g l l l 0 0 x 0
System FD SWIGP-GPPFX
A6G PP
V2.0 date:91/6 0 0 0 0
A6HGP System FD SW1-SFCFX
A6PHP V1.1 date 9111 0 0 x 0
System FD SW1-HGPFX
V2.0 date:91ll 0 0 0 0
PC9801 System FD SWlPC-FXGP198-3
Personal
computer
SW1 PC-FXGPl98-5
V2.0 9114(98-3) ,91 l(98-5)
L
0 0 0 0
MAW System FD SWlPC-FXGPIAX-3
computer V2.0 date:91/6 0 0 0 0
System FD SWlPC-FXGPlJ3-3
A computer V1.O date:91/6
0 0 0 0
: Old versions of programming software are also useable.
X : Even newversions will not be useable.
The following are not affected b y the version change of FX2- series
1. FX-20P-FKIT : for F1,Fz-series
2. SW1GP-GPPFFX : F1,F2 -+FX program comversion (A6GPPlPHP)
3. SW1GP-FXPCIF : Transfer between programmers (A6GPPlPHP)
4. SWOG P-F2GM : for FX-1G M,Fz-30GM(A6G PPIPHP)
Notes : F1,F2+ FX program conversion
1. Conversion possible with FX-20P-FKIT (common instructions only)
2. Conversion possible with SW1GP-GPPFX (A6GPP/PHP)(commoninstructions only).
GP-80FX-KIT or personal computer software do not include such program conversion functions.
APPENDIX

19 EQUIVALENT LADDER FOR F1,F2 SFT


The following is an example to show how the SFTL (FNC35) instruction can replace the SFT shift
instruction used in F i and Fn-series programmable controllers.

OUT M I 0 0 : input data


M I 0 1 to M I 1 7 : Shift register
(octal) (15 elements)
--------- SFT MI00 - M I 1 7

RST

XOOO data input M I 0 1 - M I 1 5 : shift register (15 elements)

li'
(Decimal)

XOO 1 shift input


I SFTLP
~ 1 i0 1~K IS
FNC 3 5 j 1~ ~ I I K 1 I
Input First Length 1-bit
data element shift
X002 set input
FNC 40 ~ 1 0 t1o M 1 1 5
ZRST all reset
MEMO
MEMO
REVISIONS

Edition Date Manual Number Revision


Sept. 1991 JY992D26201A First edition.
Nov. 1991 JY992D26201 B Additions :
P.6 FX-20P-ADP. P7 FX-20DU.
P.181 clock M & D's, M8028. P210 option cables.
P.218 FX-1GM. P227 MTR note.
P.228 power graph. P231 prog. in RUN.
P.232 FX-4EYS-H, FX-8EYS-H.
P.233 FX-4EYT-H, FX-8EYT-H.
P.234-P.237 DC powered types.
P.238 DC power supplies.
P.239 Extension cables
P.240 Peripheral compatibility
P.241 Equivalent Ladder SFT.
FROM / TO addition :
P.22,P.177,P.187,P.199,P.224,P.226.
128+256 110 : P.2,P.3, P.31, P.32, P.76, P.204, P.209.
Renumber: P.lO, P.12, P.15, P.17, P.19, P.26, P.31.
Sentence revision : P.20,P.90.
Sentence added : P.18, P.20.
Other : P.27 0.34"+0.39".
U n d e r n o circumstances will Mitsubishi Electric b e liable or responsible for a n y consequential d a m a g e that m a y arise
as a result of the installation or use o f this equipment.

All examples and diagrams s h o w in this manual are i n t e n d e d o n l y as a n aid to understanding the text, n o t t o guarantee
operation. Mitsubishi Electric ~ laccept
l no responsibility for actual u s e o f the p r o d u c t based o n these illustrative
examples.

Owing to the very g r e a t variety i n possible applications o f this equipment, you m u s t satisfy yourself as to its suitability
for your specific application.