Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
37 views165 pages

FX1 Hardware Programming Manual JY992D26301 A

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
37 views165 pages

FX1 Hardware Programming Manual JY992D26301 A

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 165

FXI SERIES PROGRAMMABLE CONTROLLERS

(Japanese Specification)

FOREWORD

This manualis a comprehensivemanualwhichincludes informationon the hardware and


installation as w l l as programminginformationof the Mitsubishi FXi series programmable
controllers sold in Japan.
Users should ensure t h a t t h e details of this manual is studied and understood before attempting
to install or use the units.
Informationconcerningtheprogramming of the system and the use of theprogrammers is
covered in other manuals.
..

CONTENTS

1 GENERAL HARDWARE AND 3.4 OPERATIONMODES ........................... 68


INSTALLAnON ............................................ 1
4 DEVICE DETAILS ........................................75
1.1 OVERVIEW OF THE FXi ........................ 2
12 PERIPHERAL DEVICES ......................... 6 4.1 INPUT/OUTPUT RELAYS ..................... 76
1.3 MODEL NAME........................................ 8 4 2 AUXILIARY RELAYS ............................. 78
1.4 WORLD SPEC. AND JAPANESE SPEC. 43 STATES ................................................. 83
TYPES ..................................................... 9 4.4 POINTERS (P. I).................................... 82
1.5 INSTALLATION ..................................... 10 4.5 CONSTANTS ........................................ 83
1.6 POWER SUPPLY CIRCUIT ................... 12 4.6 TIMERS ................................................. 84
1.7 INPUT CIRCUIT CONNECTION........... 14 4.7 COUNTERS .......................................... 86
1.8 OUTPUT CIRCUIT CONNECTION....... 16 4.8 DATA REGISTERS ............................... 9Q
1.9 PRELIMINARY CHECKS ...................... 22 4.9 INDEX REGISTERS .............................. 95
1.10 ERROR CHECK .................................... 23 4.10 SUMMARY OF MEMORY ALLOCA
1.1 1 MAINTENANCE AND INSPECTION .... 26 TlONS .................................................... 96
1.12 EXTERNAL DIMENSIONS AND 5 APPLIED INSTRUCTION ............................. 97
GENERAL SPECIFICATIONS.............. 27
5.1 GENERAL RULESOFAPPLIED
1.13 TERMINAL LAYOUT ............................. 28
INSTRUCTIONS.................................... 98
1.14 PERFORMANCE SPECIFICATIONS
52 PROGRAM FLOW
LIST........................................................ 31
(FNC 00 TO FNC 09) .......................... 102
1.15 DEVICE NUMBER LIST ........................ 32
53 MOVE AND COMPARE
2 BASIC SEQUENCE INSTRUCTIONS ...........33 (FNC 10 TO
FNC 19) .......................... 110
5.4 ARITHMETICANDLOGICALOPERA-
2.1. RELAYS AND TIMERS .......................... 34 TIONS (FNC 20 TO FNC 29) .............. 114
22 LOGICAL LOAD AND OUT COILS....... 36
5.5 DATAOPERATION
23 SERIAL CONTACTS ............................. 38 (FNC 40 TO FNC 49) .......................... 122
2.4 PARALLEL CONTACTS........................ 39 5.6 HIGH-SPEED PROCESSING
2.5 PARALLEL CONNECTION OF SERIAL (FNC 50 TO FNC 59) .......................... 124
CIRCUIT BLOCKS................................. 40 5.7 HANDY INSTRUCTIONS
2.6 SERIAL CONNECTION OF PARALLEL (FNC 60 TO FNC 69) .......................... 128
CIRCUIT BLOCKS................................. 41 5.8 EXTERNAL FX SERIAL DEVICES
2.7 MULTIPLE OUTPUT CIRCUITS............42 (FNC 80 TO FNC 89) .......................... 129
2.8 COMMON SERIAL CONTACTS........... 44 5.9 LIST
OFINSTRUCTION
2.9 RETAINING AND RESETTING OPERA- MNEMONICS ...................................... 130
TION STATUS ....................................... 46
6 SPECIALDEVICE AND INSTRUCTION
2.10 COUNTERS
TIMERS
AND ...................47 LISTS......................................................... 131
2.1 1 PULSEOUTPUT ................................... 48
2.12 NOPROCESSINGINSTRUCTION ...... 49 6.1DEVICES
SPECIAL ............................. 132
6 2 INSTRUCTION AND EXECUTION
2.13END
PROGRAM .................................... 50 TIME LIST ............................................ 134
3 STEP LADDER INSTRUCTIONS..................51
7 USING SPECIAL UNITS EFFECTIVELY ....151
3.1 HOW TO READSEQUENTIALFUNCTION
7.1 FX-232AW INTERFACEUNIT ............ 152
CHARTS ................................................ 52
32 PROGRAMMING................................... 58
72 FX-8AV
VOLUME
ADAPTER .............. 153
33 STATEFUNCTIONRULES .................. E

-I-

__ - . ....... . . . -.
8 APPENDIX ................................................. 1~
8.1 2-INPUT
RUNETOP SWITCH
CONTROL ........................................... 156
82 PROGRAM FLOW CONTROL
. INSTRUCTIONS.................................. 157

ii-
1 1 2 IBASlC SEQUENCE INSTRUCTIONS

I 3 I ISTEP LADDERINSTRUCTIONS
I 4 I IDEVlCE DETAILS

\ I I 6 ISPECIALDEVICE AND INSTRUCTION LISTS

1 I 7 /USING SPECIAL UNITS EFFECTIVELY

-1 -
1 GENERALHARDWAREANDINSTALLATION

This section provides general information to help users select the modules necessary to configure the
required system.
1.1.1 SELECTIONBASEDON I/O POINTS
The FX1 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 128 I/O
(input/output) points.
Operates at a wide range of power supply : 100 to 240V AC, 50/60 Hz
A l l of the terminal blocks of the base unit and
extension units are detachable.

OUTPUT TYPE SELECTION


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

Base unit (M) : Contains the CPU and memory. A base unit must always be used.
Extension unit (E) : A module(s) used to expand the number of I/O 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.

-2-
1. GENERAL HARDWARE AND INSTALLATION

1.I.2 EXTENDING I10 POINTS


Each extension block adds in units of 8 I10 points. Both input and output points can be increased
independently by selecting the appropriate input or output extension blocks.
Extension blocks differ frombase units and extension units in thatthey do not contain a built-inpower
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 I/O points, leaving the remaining414 points vacant.
Similarly, FX1-24MR leaves 4/4 points of 16/16 I/O points vacant. Therefore, when these are used, the maximum I/O
combination will be less than 128 points.(with V2.0,1281/0 points can be attained even with FX-8ER)

c Extension blocks >

OUTPUT TYPE
Extension blocks provide thesame output typesas those providedby the base unit and extension
urrits. Different output types can be combined.
For example, a base unit with SSR output, an extension unit with relay output, and an extension
block with transistor outputcan be configured together.
POWER SUPPLY
Extension blocks do not include built-in power supplies. Power must be supplied from the base
unit or an extension unit.
AVAILABLE MODELS

Note: @Thenumber of I10 points of a 16124I32-point base unit and 32-pOint extension units can be
expanded to up to a further 16 points with extension blocks. (When the FX2-24EI is used,
only 8 I10 points can beexpanded.)
.The number of I10 points of a 48164180-point base unit and 48-point extension units can be
expanded to up to 32 points with extension blocks. (When the FX2-24EI is used, only 24 110
points can be expanded.)

-3-

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

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 functionadapters.
Special function adapters do not contain a built-in power supply. Power must be supplied from the
base unit.

(1) AVAILABLEMODELS

Fiber-optic or twisted-pair cable

The potentiometers on this adapter provide 8 points of control for analoa


timers, mode setting, or rotary switches. - 1

-4-
1. GENERAL HARDWARE AND INSTALLATION

1.1.4 PRODUCT OUTLJNE

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


canbe mounted to the DIN rail (1) or mounted directlyusing 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
byopening the connector cover (6) and connectingthe 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, BAlT.V, and
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 (1 1). The following memory cassettes can
be installed in the memory cassette connector (16).
1. GENERAL HARDWARE AND INSTALLATION

r;ti
1.2.1 PERIPHERAL DEVICE HIERARCHY
Base unit EEPROM RAM EPROM

rssettl

FX-EEPROM4
FX-EPROM-8
FX-RAM-8
FX-EEPROM-8

Note: *EEPROM and RAM cassettes may cause PR0G.E


error to occur when first inserted intothe PC.
5
L.

Deleting their contents will remove this error.

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

FXQOP-RWM
ROM writer module

-6-
1. GENERAL HARDWARE AND INSTALLATION

181 Floppy
disk
.:.:PRO::' Programming
function
J--r.a
.,.L.QR. Circuit
display
Comment
function
(alphanumeric)
Monitor function

AGPHP

NEC Q8series
or compatible perso
computer

jJ3#$iqmmm
./....../....I......_ ../....../.....,...,
:. ............. Printer

FX-AGGPP-K[T Japanese software may be used. ~ x - ~ C S K r r / 9Japanese


8 software may beused.

-7-
1. GENERAL HARDWARE AND INSTALLATION

'GENERAL FORMAT

I I

Model
of series variations

Omitted : AC supply. Japanese specification


D : 24V DC supply. Japanese spec.
I

DS : 24V DC supply. World specification


ES : World specification
(if transistor, sink output)
M : Basic unit ESS: World specification
E : Extension unit f(i transistor, source output)
E%type
: block
Output
Extension
input
EY : Extensionoutputblock
R : Relay
S : Triac (SSR)
T : Transistor
I

EXCEPTIONS :
The mixed I/O 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 1: @Unlessotherwise stated, when model names are written in this manual without the model
variation part, it implies that all model variation types are valid to the information written.
Please ensure that thecorrect model is referred to in order to avoid any disastrous errors.
Note that in some countries, some of the above mentioned models may not be available.
Note 2: .World specification indicates that the unit can be used around the world becauseit has a
wide supply voltage tolerance and the inputs can be configured for
sink or source connec-
tion methods by the user.

-8-

J
1= GENERAL HARDWAR-E AND . . . IdNSTALLATION

WORLD SPEC. JAPANESE SPECIFICATION


These are designed to be used throughout the These are designed to be sold in Japan but they
world and are sold outside Japan. aresometimesexported to elsewhereinthe
world via secondary machine makers.

DISTINGUISHABLE FEATURES DISTINGUISHABLE FEATURES


0 The inputs are configurable (via the [S/S] The inputs are of [-I common (sink) type.
terminal) for [ + ] common(source) or [-] There is no [S/S] terminal.
common (sink) connections.
0 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 nd e p e n d i n go nt h em o d e l output type is transistor.
variation.
0 Themodel name indicates world ThemodelnameindicatesJapanese
specification by an "E" or by otherwise in the s p e c i f i c a t i o nb yt h eo m i s s i o no rb y
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 [ + ] COMMON (SOURCE) AND [-] COMMON (SINK) INPUT TYPES
An input of a programmable controller may take the form of [ + ] common or [-I 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.
0 [ + ] COMMON INPUT (SOURCE)
[ + ] common input refers to a connection
wherethecommonpoint of the input
devices are relatively positive.
The current flows into the input terminals
of the programmable controller.
The source/sink (S/S) selectterminal
should be connectedto the 0 V terminal as
shown.
[-I COMMON INPUT (SINK)
[-Icommon input refers to a connection
wherethecommonpoint of theinput
devices are relatively negative.
The current flowsout of the input terminals
of the programmable controller.
Remove any short links between the [S/S]
and [0VI and connect the [S/S] terminal to
the [24 VI terminal as shown.
1. GENERAL HARDWARE AND INSTALLATION

1.5.1 MOUNVNG AND


WIRING
(1) MOUNTINGDIMENSIONS
(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 theunits and blocks from the DINrail.
Caution: e Do not mount on DIN rail in cases where there i s excessive vibration. Direct
mounting isa better alternativein this case.
(b) DIRECT MOUNT
Mount holes (M4 (0.16") screw holes) provided as illustrated below can be used for direct

FXl-lGM, 24M 140(5.51')


FX1-32M 150(5.91')
FX1-48M 220(8.66")
FX1-64M 260(10.24')
FX1-80M 320(12.60")
The holes marked with asterisks (*) in
the illustration are not used on the FX FX-32E

!
models listed that are marked with
220(8.66') an FX-48 E
asterisk (*) inthetabletothe right.
Base andextensionunitscan bear- * FXdE, SEX, 8EY (1.38") 35
ranged intwo rowsas63(2.48')
shownon the next
16EY FX-16EX,
page.
35(1.38") FX2-24EI
Note 1: e To prevent a rise in temperature, FXZ-~OAP,40AW
35(1.38')
mount the units to walls. Never mount
them to the floor or ceiling.
Units are in mm(inch).
Note 2: *The FX2-40AP requires at least 2 1 mm (0.83'1) distance from the basic unit for good noise
immuity purposes.
(2) HANDLING OF ACCESSORIES
See general view in Section 1.1.6.
(a) EXTENSION CABLE CONNECTION
Connect the extension cablesto the correct connector.
(b) MEMORY CASSETTE
Remove the memory cassette by raising the wire lever as illustrated and carefully pulling it
upward.
Caution: e Turn off the power before removing the memory cassette.

pJ
Programs in the RAM memory cassette will be lost when the
cassette i s removed from the base unit.
(c) PLACING THE I/O NUMBER LABELS
Thenumber labelsthataresuppliedwiththeextensionunits andblocks yl;s
should be placed atevery 8 points on theI/O terminals of the extension units
and blocks.
The numbers must be consecutive from the numbersused for the base unit.
The
upper and
lower
terminals of the FX-16EX and FX-16EY are assigned labels
lower and higher numbers respectively.

-10-
1. GENERAL HARDWARE AND INSTALLATION

(3) WIRING
I

0 Use the crimp terminals as shown to the left.


M3.5 0 Tighten theterminal screws to between 5 and 8 kg-cm (5.76 and 9.22
in-lb). They must be secure enough to prevent a loose connection from
causing a malfunction.
(0.27in)
0 Do not connect a cable to a vacant terminal ( [ e ] ) .

0 Do not run both input signal lines and output signal lines through the same cable.

I/O signal lines should not be laid with power cables or run in the same duct as power cables.
0 I/O linescanbe extended to between 50 and 100 m (164.05 and 328.1 ft). However, it is
advisable thatI/O lines be limited to 20 m (65.62 ft) as a precautionagainst noise interference.
(a) TWO-ROW ARRANGEMENT
0 Each extension unit is provided with an exten-
sion cable.
Single-row arrangement : 55 mm (2.17 in)
Two-row arrangement : 650 mm(25.59 in)
0 Extension blocks are supplied with permanently
connected extension cables.
0 Extension cables are very susceptible to noise.
an They should be laidat least 30 to 50 mm (1.1 8 to
@.OW 1.97 in) away fromfrom PC outputlines and
power cables.
Extension unit
0 Leave at least 50 mm (1.97 in) between units and
other structures to allow good ventilation.

f Environment :
CAUTION

0 Do not install inareas subject to excessive dust, oily mist, conductivedust, corrosive gas,
or flammable gas.
0 Do not mount in areas subject to shock or vibration.
0 Do not mount in areas subject t o high temperature, moisture, or rain.
During Mounting :
0 Do not allow cut wires, filings, or shavings to fall inside a unit or block when drilling holes
or connecting cables/lines.
0 Remove the protective cover from a unit or block once it has been mounted to prevent
overheating.
0 Leaveat least 50 mm (1.97 in) between a unit or block and other device or structure.
Ensure that mounted unitsand blocks are kept as far as possible from high-voltage
cables,
, high-voltage equipment, and power equipment.
1. GENERAL HARDWARE AND INSTALLATION

1.6.1 POWERSUPPLY CIRCUIT CONFIGURATIONANDSPECIFICATIONS


(1) POWERSUPPLY 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 brraker Emrwnsy

Power supply for loads


connected to PC output

Powrr aupply
1 0 0 to 240V AC, 50/60 Hz
N.B.

+=
Do not connect '24V' terminals betwwn
a bsrr unit and an .xlension unit.

+ COH SG

'rl
1 I 5 " I
I
relay drive
- -
Base unit
Output relay drive
- -
Extension unit

-
block Output block
I I

- 12-
1 GENERALHARDWAREANDI,b!,STALLATION

(2) POWERSUPPLY SPECIFICATIONS

f WIRING CAUTION
Power Supply :
0 The power supply is a 120/240V AC system. Either system should be connected to terminals
"L" or "N".
or the [24+] terminal. If connected, it will
DO not connect the power supply to an input terminal
severely damage the PC.
0 The base unit and an extension unit power supply should be turned ON/OFF simultaneously,
0 During emergencies, the PC output circuits should be turned off using a switch external to the
PC.
0 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 theRUN input is set to ON).
0 Power cables must be at least 2 mm2 (AWG 14) to avoid voltage drops.
Grounds :
0 Use a cable at least 2 mm2 (AWG 14) to ground the equipment. Ground resistance must be
less than OOQ
1 (class 3). Note that the ground cable must not be connected to thesame 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.
0 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 terminaleven if the base unit itself is not grounded. 'Connect
the "SO" terminals of base unit, extension units, and extensionblocks with a cableof at least 2
mm2 (AWG 14).
Sensor Power Supply :
0 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.Thisvariationdepends 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 thePC inputs. Do not
connect an external power supply to the [24+]terminal.
I 0 Do not connect the [24+] terminals on the base unit and extension units.
0 Connect the [COM] terminals on the base unit and extension units to each other

- 13-
1. GENERAL HARDWARE AND INSTALLATION

1.7.1 DCINPUT SIGNAL


CIRCUITS
(1) INPUTSPECIFICATIONS
The following figure shows the PC input signal circuit (including the RUN input) specifications,
(a)INPUTTERMINALS

The input signal is turned ON when current


flows through the input terminal. The input
device is connected between an input and
the [COM] terminal.NPN open collector tran-
sistor sensors can also be used.
The input indicator will light when the input
is turned ON.
Note: e Isolate inputcommonsfromout-
put [COM] terminals to minimize
noise from heavy loads.

(b) INPUT CIRCUIT


The primary and secondary input circuits are isolated by a photocoupler, with thesecondary
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, ON/OFF status changes (from ON to OFF or from OFF to ON) in the PC will
be delayed for approximately 10 msec.
(c)INPUTSENSITIVITY
The input current is 24V DC, 7 mA with input sensitivity current between2.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 followingpage 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 switch, is drivenby
an external power supply, the volt-
age should be 24 2 4V DC and
Sensor’s output transistor must be External
an NPN type.

- 14-
1. GENERAL HARDWARE ,AND INSTALLATION

(2) INPUT CONNECTION EXAMPLE


The following diagram provides an example of an input connection. For the actual arrangement
of the terminals, see Section 1.1 1.

f
CONNECTION CAUTIONS
Selection of Input Devices :
The input current of the PC is 24V DC, 7 rnA. Use only the input devices suitable for operating at
this low current.
If large current switches are used, improper contact operation may occur.
Diodes Connected to Input Contactsin Series :
The voltage drop through a diodeshould be less than 4 V.

If reed switches with serially connected LEDs are used, no more than two
should be connected in series.

Resistors Connected to Input Contacts in Parallel :

Parallel resistance must be greater than 15 KQ.


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 [S/S] ter-
minals.
Rb I 2
15-Rp
(Ks2)

An alternative is to hold the leak current I (leak) of a 2-wire proximity switch tc


less than 1.5 mA while it is off. If leak current is greater than this, connect i
bleeder resistor Rb which satisfies the following:

- 15-
1. GENERAL HARDWARE AND INSTALLATION

1.8.1 RELAY OUTPUT


CIRCUITS
(1) OUTPUTSPECIFICATIONS
OUTPUT TERMINALS
Eachoutputpoint on an FX1-16MSeriesPC iscommonisolated.Othermodelsprovide
between 4 to 8 points of common output. Each common terminal is assigned a number from
[COMl] to [COM7].
Different voltage systems, such as 200V AC, lOOV AC, and 24V DC, can be used for different
common blocks to drive loads of various voltages.
CIRCUIT ISOLATION
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.
OPERATION INDICATORS
When the an output relay is energized, an LED will light and the output contact isON.
RESPONSE TIME
The response timebetween the energizingor de-energizing of an output relay contact and the
turning ON or OFF of an output contact is approximately10 msec.
OUTPUT CURRENT
A circuit voltage lower than 250V AC can drive the following loads:
Pure resistive load : 2 A/point
Inductive load : Less that 80 VA (100 or 240V AC)
Lamp load : Less than 100 W (100 or 240V AC)
The service life.of therelay contact points for inductive loads is summarized
in the tablebelow.
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.
LEAK CURRENT OPEN CIRCUITS
The neon bulb can be directly driven by an output contact
to the
duelackof leak currentwhen
the output contact is OFF.

- 16-
1 GENERALHAR.DWAREANDI,NSTALLATION

(2) OUTPUTCONNECTIONEXAMPLE
The following is an example of an output connection circuit. For the actual arrangement of the
terminals, see Section 1.11.

250V AC or l o w e r lamp
lamp
valve 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.
r-
OUTPUT CIRCUIT CONFIGURATION
~

Inductivyd Q Loads
DC :
Connecting a surge absorbing diode inparallel with a load will
greatly lengthen the service life of a contact.
:tntoaubPutSurge 7
absorbing
diode

p-;du;tivq Load AC :

\ \e Connecting a noise suppressor in parallel with anAC inductive


load will reduce noise generation.

rn
PC output
contact
Noise
Noise suppressor : 0.1pF + 100 to 12022
suppressor
Load Orientation :
The orientation of the PC output contacts shouldbe the same.

L=
:3 Forward
Interlock :
rotation Contactsthat
control
loads,
such as those
used
for
for-

. Reverse
rotation
wardheverse rotation,which may turnon simultaneously con-
a dangerous hazard. Interlocks external fromthe PC,
stitute
as well as programmed interlocks, should be used to prevent
PC output
contacts such
loads
from simultaneous activation.

- 17-
1.

1.8.2 SSR OUTPUT CIRCUIT


(1) OUTPUT SPECIFICATIONS
OUTPUT TERMINALS
Each output point on an FX2-16M Series PC is common isolated. Other FX2 Series models
have their outputs commoned in groups of 4.
Different voltage systems, such as 200V AC and lOOV AC, canbe used for separately
commoned blocks.
CIRCUIT ISOLATION
PC internal circuits and the output devices (triac) are isolated by a photocoupler. Common
blocks are also isolated from each other.
OPERATION INDICATOR
An LED will light and the output triac is ON when the photocouples is being driven.
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.
OUTPUT CURRENT
The circuit can handle a maximum current flow of 0.3 A/point.
However, thecurrent should be limitedbydesignto 0.8 A/4 pointsin order to prevent
excessively high temperatures to arise. When a high in-rush current is required to turna load

,k==
ON/OFF, the root mean square current should be less than 0.2 A.
Example :

4 y - , $A

0.02 sec 0.7sec 10 sec

LEAK CURRENT IN OPEN CIRCUITS


A C-R absorber is connected in parallel to an output terminal of the PC.
Note: .As a result, a leakage current of 1 mAllOOV AC or 2mAt24OV AC occurs when the
circuit is open and can inadvertently activate loads that require only a low current
for operation. Either the load capacity must berestricted to those requiring greater
than 0.4 VAIlOOV AC or 1.6 VAIPOOV AC or, if a smaller capacity load ora neon lamp
is used, connect the surge absorber specified on the following pagein parallel with
the load.

Ref.:.Leakage current in SSR output circuits is greater than that of relay devices and can
cause miniature relaysto hold their operation.

- 18-
”, . , ,*.. .

1. GENERAL HARDWARE AND INSTALLATION

The following is an example of an output connection circuit. For the actual arrangement of the
terminals, see Section 1.1 1.

-
FX-BEYS Japanese Spec.
-------
I’ - L
I
Extension 4- 4-
block *’ *’ +I

L-*-*-*---(Yoo3I
I
5A

HC

Solenoid
incandescent
Contactor
Solenoid
Solenoid
Electromagnetic
Neon
lamp valve lamp

Since a fuse is not included in the output circuit


the PC
of as shown above, a 5 to 10 Afuse should
be used for each 4 points.
OUTPUT CIRCUIT CONFIGURATION

h-&J
Neon lamp or
low current load Weak Current Loads :
When a neon lamp or a low current load of less than 0.4
VN100V AC or 1.6 VN200V AC is connected, connect the
folloAng noise suppressor in parallel with the load.
\
-
output
PC
Noise suppressor : 0.1pF + 100to 1203
Noise suppressor

Load Orientation :
The orientation of thePC output contactsshould be the same.

Forward Interlock :
rotation
Contacts that control loads, such as thoseusedforfor-
Reverse wardheverse rotation, which may turn onsimultaneously con-
rotation stitute a dangerous hazard. Interlocks external to the PC, as
well as programmedinterlocks,should be used to prevent
P C output contacts such loads from simultaneous activation.

-19-
1. GENERAL HARDWARE AND INSTALLATION

1.8.3 TRANSISTOR
OUTPUT CIRCUIT
(1) OUTPUTSPECIFICATIONS
OUTPUT TERMINALS
Each output point of a FX1-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.
CIRCUIT ISOLATION
PC internal circuits are isolated from output transistors with a photocoupler. Common blocks
are also isolated from each other.
OPERATION INDICATORS
An LED will light and the output transistor is ON when an output transistor is being driven.
RESPONSE TIME
The response time between 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)
OUTPUT CURRENT
The circuit can handle a maximum current flow of to 0.5 A/point.
However current should be limited by design to 0.8 A/4 points (an average of 0.2 A/point) 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.
LEAKAGE CURRENT IN OPEN CIRCUITS
Leakage current is less than 100 FA.
(2) OUTPUTCONNECTIONEXAMPLE
The following is an example of an output connection. For the actual arrangementof the terminals,
see Section 1. l l .
FXl-24MT

I 1
-------------,--

connected
suppressor
is Noise for each
output.
I I I

interlock with an
2A 2A 2A
external circuit 2A

Load drive
contactor

-20-
1. GENERAL HARDWARE AND_lNSTALLljTION

Note 1: .When the external power supply voltage is 24V DC or less, if possible, allow at least 5 mA
to flow.
Note 2: *The response of 0.2 msec is stated at 24 V, 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 theamount current flow throughan added dummy resistor.
.If the response timeof 0.5 msec or better is desired,ensure a current ofabove 60 mA flows
at 24V DC. Note 3: .Internal protection and phpt-coupler
current of the transistor output.

Example load:
F o i r G ' G e1, logic device
,controller I 63t0200&4 /

I
I
p r c r 2 ,
Dummy resistor to improve
response time

-21 -
I. GENERAL HARDWARE AND INSTALLATION

1.9.1 PROGRAMMING AND TESTING


(1) CHECKUP(POWER : OFF)
Incorrect connections a t the power supply terminals, a short betvveen the DC input lines and
the power supply cable, or a short in the output lines can seriously damage the PC.
Before turning onthe power, checkthe power supply and ground connections and
t h e inpuvout-
put line connections.
Ref: Use the followng procedure ifit is necessary to measure the PC whstanding voltage
and insulation resistance.
- Disconnect the input/oufputlines and the p o w r supply cable fromthe PC.
- Jumper each terminal to the ground terminal.
Measure the w'thstanding voltage and insulation resistance betweenthe jumper and
the grounding terminal.
Wthstanding voltage : 15oOVAC, 1 minute
Insulation resistance :Higher than 5 Mn, measured w-th5oOVDC Megger
(2) WRITING AND CHECKING A PROGRAM (POWER : ON, PC : STOP)
Write a program with a peripheral device.
Read the program to make sure it has been written correctly. At the same time, check the
program for circuit and syntaxerrors usingthe program checkfunction onthe peripheral device.
Ref: M e n an FX2OP programming panel is used, the PC w'll remain in the STOP status
when thepower is turnedON i f the [MI keyis heldd o m (even if the PC RUN inputis
ON). Therefore, programming is possible withoutturning OFF the RUN input. The PC
will restart h e n p o wisr turned off and then on again.
Each output canbe 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 devicesON/OFF while the
PC is running.
Ref: A programming panel can be used to check the ON/OFF status of each device and the
continuityofeach circuitblockor to reed the presentdafa oftimers, counters, and
data
registers.
Wth a graphic programming panel, the circuit diagram is displayed uhile monitoring
the devices in the PC. In this way, program debugging is made much easier.

-22-
I. GENERAL HARDWARE AND INSTALLATION

1.10.1 CHECKING ERRORS WITH THE LEDs


If a problem occurs while the PCrunning,
is check the power supply voltage, the PC terminal screws,
and the I/O 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.
(1) POWER INDICATOR(POWERLED : OFF)
There is a POWER LED on the front panel of the base unit, extension unit, extension block, and
special function adapter.It is lit b y 1 2 VDC, supplied from the base unit or extension unit internal
power 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 power to the sensors must be supplied externally.
The fuse in the base unit or extension unit m a y b l o w if conductive foreign matter has entered
the PC or other faulty 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 ) BATTERYVOLTAGE INDICATION (BATT.V LED : ON)
The BA7T.VLEDw’ll light if the battery voltage drops while PC theis 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 BATT.V LED has lit. However, the battery should be
replaced as soon as possible if this LED is lit. It 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.VLED does notlighteven d e n batteryvoltage islowifspecialauxiliaryrelay
M8030 is activated. However, special auxiliaryrelay Ad8006 w.11 be operational.
Data in a data register, used as a setting for a timer or a counter or other, will become
unreliable if batteryvoltage is low.
(3) ERROR INDICATION(PR0G.ELED : FLASH)
The PROG.E LED may flash when a program is in run
cases where the timer or counter constants
are n o t 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 LEDflashes, check the program, noise sources,the BATT.VLED, and also the inside
ofthe 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 register08004. Read the register number in08004
and the data in thatregister to find the error code number. Use this error code number
and the table in Section 6.1.8tofind the contents ofthe error and the corrective action.
I GENERAL HARDWARE AND INSTALLATION

(4) ERRORINDICATION(CPU.ELED : ON)


The CPU.E LED may light when the CPU runsoutofcontroldueto externalnoise 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 installedwhile
the power supply to the PC is ON.
Turn off the power supply once and then turn it back on again. After t h a t set the PC in the

Fqq F6-q
RUN status.
If the PC now operates correctly, check for possible noise sources and inside the PC for
conductive foreign matter.

device device
device

Class 3
- ground - -
Independent
grounds
Common
ground
(acceptable)
Common
ground
(unacceptable)
(recommended)

Use wire a t least 2 mm2 (AWG 14) thick to ground a PC. Keep the ground wire length ground
wireas short as possible. A class 3 ground (ground resistance of lessthan 100 Q ) is
recommended.
If t h e PC malfunctions because of an improper ground,disconnectthe ground wire from the
on the PC. In this case, the ground terminals of the base unit and the
extension untt s ould be connected vith each other.
terminal
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, reviewthe program to check if t h e operation cycle time might
be excessively long. The operation cycle time is stored in special data register D8012.
(5) INPUTERRORS
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 n i l 1 occur if rated current of the input switch is too large. Another
possibility is that oil has entered.
If the input switch contains a parallel LED resistor circuit, it is possible t h a t the PC input
signal can be turned on through this circuit even though the switch is in the OFF position.
An input that is turned ON/OFF 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 extensionmodule is
another possible cause of this problem. Remove t h e terminal block and refit it securely.

-24-
I. GENERAL HARDWARE AND INSTALLATION

(6) OUTPUTINDICATION
The input terminal block can be
If the load does not turn ON/OFF despite removed by loosening these screws.
the statusofthe LEDs,an open-circuitleak
current (SSR output) or one of the follow Input LED indicators
ing may be the cause of the problem.
The outputcontacts mayhave melted
because of an overload or a short; or
the contact is insufficient because its
surface has eroded.
I PaSFxI-IGMI -I I
Since insufficientcontactof the input
terminal block on the base unit or ex-
=3mn.*
LEDs
tensionmoduleisanotherpossible
m
POWER
cause of this problem, remove the ter- RUN
minal block and refit it securely. 6AlT.V
PROG .E
CPU.E

Output LED indicators


The output terminal block can be
removed b y loosening these screws.

-25-
I.GENERAL HARDWARE AND INSTALLATION

1.11.1 MAINTENANCE AND INSPECTION PROCEDURE


PERIODICAL INSPECTION
Most of the parts of the battery
in the PC w i l l never need to be replaced. However, the service life
is approximately 5 years+ andit 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.6.1.
8K RAM memory cassette is used.
Battery service lifewill be approximately three years when an
Also check to the following points :
The interior temperature of the panel
Airborne or electrically-conductive dust inside the panel
Loose wiring orterminals
REPLACING THE BATTERY
If battery voltage is lower than the allomble limit, the BAlT.V LED on the front panel w i l l light
when the power is turned ON. Although, memory data w i l l be retained for approximately one
month after this LED lightsfor the first time, the battery should be replaced assoon 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 w i l l be retained for approximately three days
(once it has been fully charged before power off; approx. 1 hour.).
(a) BATTERY REPLACEMENT PROCEDURE
1) Turn off t h e power supply.
2) Remove the terminal cover and open the panel cover.
3) Remove the battery from the holder and remove the connector.
(within 30 sec after the removal of the
4) Insert the connector of a new battery immediately
old battery).
5) Fit the battery or memory backup capacitor into the holder and replace the panel cover.
Note: Replace a memorybackup capacitor d i l e the p o w r is OFFbutbe sure to p o w r O N
againimmediately or memorydatamaybelost.Charging a memorybackup
capacitor requires approximately one hour.

Fz-40BL battery FX-4OCAP M e m o r y Backup Capacitor

-26-
1 GENERAL HARDWARE ANQ,.INSTALLATION

1.12 EXTERNAL DIMENSIONS AND GENERAL SPECIFICATIONS

1.12.1 EXTERNAL
DIMENSIONS
( 1 ) BASEUNITSANDEXTENSIONUNITS
<Accessories >
Extension unit : I/O number label ( 1 set)
Extension unit : Extension cable,
650 mm (25.59 in). (. 1 DC.)
, ~ .
55 mm (2.17 in) ( 1 PC.)

x2- 16M 1.o (2.2)


150 (5.91)
rx2-24M (2.86) 1.3
x2-32M
160 (6.30) 1.5 (3.3)

X2-48M
230 (9.06) 2.0 (4.4)
X- 48E
I I
- Fx2-64M
I
270 (10.63)
I
2.5 (5.5)

/Mountingholes 1 M3.5
(0.14 in) DIN rail
Fx2-80M 330
(1 2.99) 3.0 (6.6)

‘ NBL.OCKS AND SPECIAL FUNCTION ADAPTERS


< Accessories>

KI
Extension block : I/O number label ( 1 set)

FX-232AW 45 (1.77) 0.3 (0.66)


FXz-4OAP, FXT40AW 45 (1.77) 0.3 (0.66)
FX-8AV 45 (1.77) 0.3 10.66)

I’ Mounting holes
( 2 - 05.5 mm (0.27 i n ) )
M3.5 terminalscrem(wdth
rai
: 35 mm (1.38 in))
mounting slot

(3) GENERAL SPECIFICATIONS

-27 -
1. GENERAL HARDWARE AND INSTALLATION

1.13.1 BASE UNIT

Note :Except for MI- 1 6 M T the terminal


layouts for the triac and transistor output
models are the same asrelay output
models.

-28-
1. GENERAL HARDWARE AND INSTALLATION

Note: Do notconnectcables/wles to the undefined terminals (designated b y l . / j on the base unit,


extension unit, or extension block.

-29-

.. __. .
I GENERAL HARDWARE AND INSTALLATION

1.13.2 EXTENSION UNITS ANDEXTENSION BLOCKS

I I I I

-30-
1 GENERAL HARDWARE ANQ,.INSTALLATION

1.14.1 PERFORMANCE SPECIFICATIONS

Performed by dedicated logic control LSI


Batch processing method (when END Direct I/O instructions and in ut filter
I/O refresh method instruction is executed) adjust instructions are availagle
Operation processing time Basic instruction : 1 psec Applied instructi0n:Under several 100 psec
Programming language Relay symbolic language + Step ladder SFC expression possible
2K step RAM incorporated (standard) Comment registration is possible (program
memorv used)
Alphanimerics (15 characterslcomment)
Program capacity and 4K step EEPROM cassette (optional) 10 steps/comment; program memory is
memory type 8K step RAM, EEPROM, EPROM cassette reserved in units of 50 comments

I
(optional) Even if cassetttes are used, the m a . pro-
I gram area remains at 2k steps.
Numberof
instructions 1 Seauenceinstruction : 20,. SteD. ladderinstruction : 2.. Amlied
, . instruction : 35
DC input 124V DC, 7 mA, isolated by photocoupler
Input
relay - I - X0 to X177 (octal)

Ref.: .Power supply specification . . . . . .Section 1.4. 1 (2)


.Output specification . . . . . . . . . . . .Section 1.6.4
.General specification . . . . . . . . . . .Section 1.10.I

-31 -

.
I . GENERAL HARDWARE AND INSTLIATION

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 C235 to C254 correspond to a 32-bit register.

-32 -
I I ( (GENERAL HARDWAREAND INSTALLATION I

n l
I 3 ( ISTEP LADDER INSTRUCTIONS I
I

r l
t
I 1

DEVICE DETAILS

/51
- 1
APPLIED INSTRUCTION
I

16)
I 1
SPECIAL DEVICE AND INSTRUCTION LISTS
I
nI 7
t
I IUSING SPECIAL UNITS EFFECTIVELY
1

-33-
2. BASIC SEQUENCE INSTRUCTIONS

2.1.1 OUTLINE OF MAJOR DEVICES


The table below shows that a largenumber of relays, timers, and countersare built intoa programmable
controller,eachwithanunlimited number of normally-openandnormally-closedcontacts. The
sequence circuits define the connectionsbetween these contacts and coils.
The signals are transferred in the directions shown by the arrows.

-34-
2. BASIC SEQUENCE INSTRUCTIONS
1 1 .

INPUT AND OUTPUT RELAYS


For the base unit, I/O numbers are assigned in octal numbers (X0 to X7, X10 to X17, ..., YO to Y7,
Y10 to Y17, ,..). 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.
Input X0 to X7, X10 to X17, X20 to X27, X30 to X37, Y30 to Y33

Extension I/O relay numbers are


assigned consecutively from the
unit/block closest tothe base

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

AUXILIARY RELAYS

500 auxiliary relay points (MO to M499) are provided for general use. These are sometimes called
internal relays.
524 points (M500to M1023) are backed up by the battery. These points are called latch relays
because their operation status is retained when power is lost.
STATE
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 instructionsare not
used. Other relays, called annunciators, are also used.
SO to S499 : For general use
S500 to S899 : For latch relays
S900 to S999 : For annunciator
TIMERS
TO to T199 : 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.
Inaddition to thesetimer relays, retentive timers (10 points),which can holditsoperation
immediately before a powerfailure, are also available.
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 values are available. Data registers are explained in detail in Section 4.
2. BASIC SEQUENCE INSTRUCTIONS

2.2.1 LD/LDI/OUT

NO (normally open)
(Load)
LDcontact
logical
operation /+H- X, Y, M, S,T, c
start

b++a
NC (normally closed)
LDI (Load Inverse) contact logical operation X, Y, M, S,T, C 1
start

OUT (Out) Coil drive kc(:-- Y, M, S, T, C S,Special M : 2


T:3 C:3to5

0 LD x 0 Connection to bus line


YLD
3
J
-
x0 1 OUT Y
2 LDI
I I
X

-xi 3 OUT M io0


-
-
Drive instruction

P
4 T 0 Timer
drive
instruction
SP K 19 Constant
setting

/
Bus line TO
\MI TO

8 o u T Y
T O
1
I I
11 Yl Program steps are managed 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
0 LD and LDI instructions are used for contacts connected to the bus line.
They are alsocombinedwith an A N B instruction (explained later) to startaladderrung
(circuit).
0 OUT instructions are coil drive instructions for output relays, auxiliary relays, state, timers,
and counters. They are not used with input relays.
0 Parallel OUT instructions can be used repeatedly (OUT TO and OUT MlOO in the program
above).
(2) TIMER ANDCOUNTERPROGRAM
0 Constant K must be set for the timer and counter coil OUT instructions.
0 The setting range of constant K, the actual timer setting and the number of program steps
(including the setting) for theOUT instruction are shown in the table below.

0 For program examples using counters and retentive timers, see Section 2.10.1

-36-
2. BASIC SEQUENCE INSTRUCTIONS

(3) DOUBLE-COILDESIGNATION
t

Input processing This is howthe coil operateswhen the same


X1 = ON, X2 = OFF coil is used for more than once. The pro-
gram example to the left uses output Y3
twice. The operation of Y3 is explained
below assuming that inputs X1 = ON and X2
= OFF.
The first Y3 is turned on because X1 is ON.
Its image memory is turned on and output
Y4 is turned on accordingly.
However, the second Y3 is turned off be-
cause input X2 is OFF. The image memory
of Y3 is rewritten to OFF.
Therefore, the final outputs are Y3 = OFF
and Y4 = ON.

I I
H HI
I 1
Output processing
Y3 = OFF, Y4 = ON
I 1 1

In double-coildesignation, the coil operationdesignated last is effective. For details of operation


processing, see Section 4.1.2.

INPUT PULSES OF SHORT DURATION CANNOT BE RECOGNIZED


This input
This
input
state is not
ON
recog-
recognized
ON state is
r This input OFF state
not recognized
is

OFF ON ON OFF

Program Program Program Program


processing processing processing
processing
Cycle time
Input processing Time
Output processing

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

2.3.1 ANDIANI

Serial connection of NO
AND (And) contacts

1 b mY, I ' 1

r r
ANI (And inverse) Serialconnection of NC
contacts X, M, S, T, C

OLD
1 AND
X
x
2
0 - Serial
contact

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

5 OUT M 101
6 AND T 1-Serial
contact

I
ANI
AH)
/ Y4
I
7 OUT Y 4- Continuous OUT

DESCRIPTION

r?2y7q
(1)
. 0 The AND and ANI instructions are used for the serial connection of a contact. Contacts can
be connected in series as many as required.
0 The output processing to a coil through a contactafter writing the OUT instruction is called a
follow-on output (OUT Y4 in the program example above).
Follow-on outputs are permitted repeatedly as long as output order is correct.
Cautions :

-
=
As shown in the example above, Y4 can be
driven through contact Y1 after driving M101.
However, if the order
drive
should
as in the program
shown
be reversed
to the left, it is neces-
sary to use an MPS instruction.

Although there are no limitations on the number of contacts that can be connected in series
or follow-on 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.

-38-
2. BASIC SEQUENCE INSTRUCTIONS

2.4.1 OR/ORI

Parallel connection of
oRI( o r Inverse) NC contacts X, Y, M, S, T, C
1

ti”‘ I
0 LD
1 OR
2 OR1
3 3UT
x
X
M 102
Y 5
Parallel
connection

4 iDi
5 ANE Parallel
5 OR H 103 connection
7 &Ni
W 3 OR M i10
3 3UT M 103

(1) DESCRIPTION
0 The OR and OR1 instructions are used for parallel connection of a contact.
To connect a circuit blockthat contains more thanone 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
/ W0 LO OR or OR1 instruction connectsthe
step to thepreceding 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-
tion.

Parallel connection point

-39-
2. BASIC SEQUENCE INSTRUCTIONS

Parallel connection of
Device: blocks oRB(or Block)
circuit serial 1

~~-~‘-~-l RecommendedProgramProgramNotRecommended
0 LO X 0
O L D X 0
1 AND X 1 1 AND X 1
2 L D X 2 2 L D x 2
3 AND
4 ORB
X 3
- 3 AND
4 LDI
X
X
3
4
5 LDI
6 AND
7 m
X
X
4
5
-
5 AND
6 ORB
7 ORB
X 5
-
c.

\
Serial circuit block
8 OUT Y 6 8 OUT Y 6

(1) DESCRIPTION
0 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.
0 An ORB instruction is an independent instructionand is notassociatedwith any device
number.
Cautions :
e There is no limitationto the number of parallel circuits when an ORB instruction is used for
each circuit block (recommended program).
0 ORB instructions can be used in batch. When using ORB instructions inbatch, be sure not
to use more than 8 LD or LDI instructions (program error results if attempted).

-40-
2. BASIC SEQUENCE INSTRUCTIONS

2.6.1 ANB

ANB Block) Serial connection of


parallel circuit blocks

O L D x 0
1 O R X 1

;
4
D; ;
LDI
,"
x
"J Branch

4
start point

5 AND X 5
6 ORB
3-
Parallel block complete

block
7 0 R
eAN8
9 O A
X

X
6

3
- Serial
connection
circuit
preceding
to

10 OUT Y 7
\ OR before ANB
OR after ANB
ANB and LD. OR
(1) DESCRIPTION
0 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.
0 The ANB instruction can be used as many times as necessary to connect a number of parallel
circuit blocks to the preceding block inseries.
0 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 thecase of an ORB
instruction.

-41 -
2. BASIC SEQUENCE INSTRUCTIONS

2.7.1 MPS/MRD/MPP

~ ~~

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

0 LD X 0
1 AND X 1
2 ws In this program ex-
ample,onlythe
3 AND X 2 first stage stack is
4 W T Y 0 used.

i
5 MPP
WP
6 OUT
~~ Y I
7 LO x 3
8 WS
9 AND x 4
10 OUT Y 2
11 WP
12 AND x 5
13 OUT Y 3
14 LO X 6
15 WS 22 AND X 11
23 OUT 6
f 16 AND x 7 Y
MRO 17 OUT Y 4 24 W P
f 18 MRO 25 AND X 12
HRD 25 OUT 7
19 AND x 10 Y
f 20 OUT Y 5
HPP I
-42-
2. BASIC SEQUENCE INSTRUCTIONS
. .

(2) 1-STAGE STACK WITH ANB AND ORB INSTRUCTIONS


OLD X 0
I
12 ANB
1 Hps 13 OUT Y 1
2 L D x I 14 MPP
308 x 2 15 AND X 7
4 AN8 16 OUT Y 2

‘fa
5 OUT Y 0 17 LO X 10
6MRD 18 OR X 11
7 L D x 3 19 ANB
8 AND X 4 20 OUT Y 3
WP 9 L D x 5
10 AND X 6
11 ORB
I

(3) 2-STAGESTACK
O L D X 0
1
9 MPP
1 MPS 10 AND X 4
2 AND X 1 11 MPS
3 MPS 12 AND X 5
X6
13 OUT
4
4 AND X 2 Y 2

I
HPP MPS 5 OUT Y 0 1 4 MPP
6 MPP 15 AND X 6
/v’
WP 7 AND X 3 16 OUT Y 3
8 OUT Y i

(4)4-STAGESTACK
MPsMpsHpsHps
x0
1
jx1
1 1
jX2 jX3 jx4
O L D x
1
9 OUT Y
+ M H H M
YO ~ 1 WS
0
10 HPP
2 AN0 X I I1 OUT Y

MPP
/c/ 3 ws 12 Hpp
4 AND X 2 13 OUT Y
/c/ 5 MPS 14 MPP
wpp
rv’ 6 AND X 3 15 OUT Y
MPP 7 HPS 16 MPP
8 AND X 4 17 OUT Y
1

Note: At any programming step, the difference betweenthe numbers of MPS and MPPinstructions
must I 1 or less. These numbers must agree with each other within a program.

-43-
2. BASIC SEQUENCE INSTRUCTIONS

2.8.1 MC/MCR

MC
(Master
Denotes
the
start of the
MC control block
T Special M relaysarenotallowed.
N : Nesting
MCR (Master Denotes the end of the
Control Reset) MC control block

sp J instruction

/ i 4 L D X I

p'7a 6 L D
7 OUT
8 MCR
X
Y
N
2
I
0- AnMCR is
2-step
a
instruction
0 The nesting level for N is 0 to T.
SP is the symbol for the space key on the
programming panel.
0 Special relays cannot be used as object
NO devices for M.
N : Nesting level (0 to 7)
SP : Space key
(1) DESCRIPTION
Input X : ON
All instructions between MC and MCR are executed.
Input X : OFF
Present status is retained for :
- Retentive timers, counters, and devices driven by SET/RST instructions
Devices turned OFF are :
- 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 thisto the originalbus 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 while a previous MC instruction is active, increase the nestinglevel
number (N).
The nesting level can be decreased by designating an MCR instruction.

-44-
2. BASIC SEQUENCE INSTRUCTIONS

(2) NESTING LEVEL

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

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

5
N2 fMIOP Level N2
Bus line (D) becomes active when all of XO,
X2, and X4 are ON.

1 [- WCFI I N2 Level N1

t-J tX6
With MCR N2 executed, bus line (C) is res-
tored.

+
Level NO
With MCR N1 executed, bus line (B) is res-
tored.
IX7
5
Initial state
With MCR NO executed, the initialbus line (A)
is restored.
Output Y5 is turned ON/OFF according to
ON/OFFstate of X10 andregardless of
ON/OFF state of XO, X2, and X4.

-45 -
2. BASIC SEQUENCE INSTRUCTIONS

2.9.1 SET/RST

SET (Set)
Setting a device ON
Y,M: 1
S, Special M : 2

RST (Reset)
registers
Resetting a device to
OFF.
Clearing
I-}: RST IY. M. S. D. V. Z H
D, V, Z ,
Special D : 3

xL
0 LD x 0
I SET Y O
2 LD X I

k
3 RST Y O x1
4 LD
5 SET Mx O
2 YO
6 LO x 3
7 RST I40
8 LD x 4
9 SET s o
1 1 LO x 5
12 RST s o
14 LO X 6
15 RST 0 0

(1) DESCRIPTION
0 Once X0 is turned ON, YO operates and remains ON even after X0 is turned OFF.
Once X1 is turned ON,YO turns OFF and remains in "non-operating" status even after X1 is
turned OFF.
These are also true for M and S.
0 SET and 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.
0 The RST instruction can be used to reset the data in data registerD and index registers V and
2 to "0".The same effect is obtained by using the constant KO transfer instruction.

-46-
2. BASIC SEQUENCE INSTRUCTIONS

2.10.1 OUT/RST

32-bit counter:
Driving timer coil
OUT (Out) Driving counter coil 5 steps
Other: 3 steps

Resetting output contact


RST (Reset) Resetting present data 2
to '0"

(1) RETENTIVETIMERS (1 msec TIMERS, 100 msec

G'P CO
TIMERS)
0 Counter Co counts upeach time input X1 1 turns ON
until Co equals its setting of 10. Atthis point contact
Co turns ON which in turnsON Yo.
Co and Yo are reset when X10 is turned ON.
Counters ClOO to C135are backed by battery so
that their contents remain even if power is turned
OFF.

Countins direction (2) HIGH-SPEEDCOUNTERS (SEESECTION4.7.2)


The1-phase, 1-input counters (C235 to C245) are

7
used in combination with special auxiliary relays
I Sequenceresetcircuit I (M8235 to M8245) whichdesignate the counting
direction.
m T CAAA
Count down when X10 is ON
Count up when X10 is OFF
The output contact of counter CAAAis reset and the
current value of the counter is reset to "0" when X1 1

v1
is turned ON.
Counters (C241,C244, ... ) with a reset input
operate similarlywithoutrequiring any further
programmingwhenthecorresponding reset
input is turned ON.
When X12 is turnedON, ON/OFF of the correspond-
ing counter input (X0 to X5) is counted.
With counters (C244,C249,C254,), counting
does notstart unless the corresponding 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 t o that setting.

-47-
2. BASIC SEQUENCE INSTRUCTIONS

O L D X 0
1 pLS M 0 r~ 2-step instruction
3 L D M 0
SET I YO
4 SET Y 0
5 L D
6 pLF
O L D
X
M
M
1
1
1
- 2-step instruction

9 RST Y 0

x0 1 t
I
1
I
t I I

(1) DESCRIPTION
0 When a PLS instruction is executed, object devicesY and M operate one operation cycleafter
the drive input signalhas turned ON.
0 When a PLF instruction is executed, object devicesY and M operate one operation cycleafter
the drive input signal has turnedOFF.
0 Special relays cannot be object devices of PLS or PLF.
0 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.

-48-
2. BASIC SEQUENCE INSTRUCTIONS

2.12.1 NOP

NOP (NOP) No operation Device: None 1

CHANGING CIRCUITS USING NOP INSTRUCTION

AM--Nap
\
ANI-NOP
pr v r I
(a) Shorting
contacts (b) Shorting entire preceding
circuit
(This may cause circuit error)

OUT -NO?

ORB-NOP

-
(c) Cutting circuits (d) Cutting an entire preceding circuit
(This may cause circuit error)

I I I "

io-w ANO-LI

(e) Connecting to preceding OUT instruction

(1)
DESCRIPTION
e 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 acircuitbyreplacing programmed instructionswith NOP
instructions.
e Changing an LD, LDI, ANB, or ORB instruction into an NOP instruction changes the circuit
considerably.
e After the program all clear. operation is executed, ail of the instructions in the program are
over-written with NOPS.

-49-

.. . . ..--
- .......... .. ............. - ................. ..... ...

2. BASIC SEQUENCE INSTRUCTIONS

2.13.1 END

Input/output processing
END (End) Device: None 1
and returning to step 0

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 000 directly.
001
002
Inserting END instructions in the middle of theprogram helps
program debugging as the sectionafterthe END instruction is
disabled and isolated from the area that is being checked. Delete
the END instructionsfrom the blocks which have already been
checked.
The watchdog timer is refreshed when the END instruction is ex-
ecuted.

PROGRAMMING TIP
A program is executed generally from top to bottom and from left to right,

13

-50-
, . ,.. . ,.. ~ _... .- .,_ ._*

I 4 I DEVICE DETAILS
U I I

n
rl
I
U
5 I APPLIED INSTRUCTION
I I

1
6 1 ISPECIAL DEVICE AND INSTRUCTION LISTS
I 7 I USING SPECIAL UNITS EFFECTIVELY
n t i

- 1 I

n t
I I APPENDIX 1

-51 -
3. STEP LADDER INSTRUCTIONS

3.1.1 STATE FUNCTIONS


Writing a relay ladder sequence for sequential process control requires some expertise. Also the
completed sequence can be difficult toread.
However,when machineoperationisexpressedusingasequencechart(calledaSequential
Function Chart), programming is made much simpler.
A device (called 'state') is the important element in making a Sequential Function Chart. A total of
900 points of state in the range of SO to S899 areused with SO to 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 statesof the sequential function chart.

Driven by OUT

+
. -
Use SET for the output
to be retained
/

(2) The
operation
state changesfrom
S30 to S31 if X20 is
t turned ON (even
momentarily).
(1) Outputs Y10 and Y11operate (3) Statetransferisoperated
when State S30 operates. The from S30to S31, causing Y10
program iswaiting forthe opera- to stop operating andY12 to
tion of transfer condition B O . Stan operating.
Y11 continues to operate b e
cause it is driven by the SET
instruction.

Note: 0 Transfer conditions often take the formof a single contact, however, in actual fact, a
combination of X, Y, M, S, TI C devices are possible in the form of parallel or serial
connections.
0 For output loads(Y, M, SI TI C) and applied instructions driven by thestates, it is possible
to have these connected in various forms of series and parallel combinations.

-52-
3. STEP LADDER INSTRUCTIONS , , , ./

3.1.2 SINGLE FLOW


+ Righttraversex3
x4 - Lefttraverse
To maketheexplanationoffunctioncharts
simple,
pick-and-place
a operation,moving a
c
x2
Downward
motion
workpiecefrompointAtopoint B withtherobot
hand as shownonthe left, isused as anexample.
Adouble-solenoidvalve is usedforright/left
traverse and up/down motion with a single
solenoid valve used forclampoperation. The
r
-L

c -. clamp
Unclamp
Workpieqe,
y1 double-solenoid valve holds an actuator at the
actuatedpositioneven
actuatormotionhasturned
after thesignalforthe
off. The workpieceis
clamped only while the solenoidis energized.
I I Point Bl
(1) MANUALOPERATION
-------
1
Zero return
example
for
This
is manual
the
operation
required to return the
robot hand to the initial position
before starting the automatic se-

State S5 is driven by special


auxiliaryrelay M8002, which is
pulsed on when PC theoperation
status is changed fromSTOP to

AUTOMATIC CYCLE OPERATION


Pressing start button X26 after manually locating the
robot hand to the intial position changes the operation
SET Y1 state from S5 to S20. The downward motion solenoid
valve output YO is turnedon. Lower limitLS X1 is turned
TO on when the hand reaches the lower limit position.
The operation state changes from S20 to S21 and the
Upward downward motion output YO is turned off. After that,
motion
clamp output Y1 is set.
Timer TO operates one second later to change the state
to S22 which turns on upward motion output Y2. Upper
X3 + Right traverse limit
limit LS X2 is turned on when the robot hand reaches
the upper limit.
At state S23, the right traverse outputY3 is turned on.
X&nd, Unclamp Right traverse limit LS X3 is turned on when the robot
hand reaches the right traverse limit.
~

(6) RST Yl
J At state S24, downward motion output YO is turned on
again. Lower end limit LS X1 is turned on when the
T l t KlO robot hand reaches the lowerlimit, changing the state
from S24 to S25.
Clamp output Y1, which has been set, is reset.
One second after the clamp output is reset, the state
changes to S26, turning on the upward motion output

L
X4 t Left traverse end
Y2.
When Upper limitLS X2 is turnedon, the operation state
changes toS27 and left traverseoutput Y4 is turned on.
As left traverse limit LS X4 is turned on, the operation
state returns to S5, allowing the next cycle to start.
P

-53-
3. STEP LADDER INSTRUCTIONS

3.1.3 SELECTIVE BRANCHAND MERGE EXAMPLE


The following illustration shows an exampleof how to sort large andsmall balls with a conveyor.
With the initial positionset at the upper left point, the sorting cycleis executed in the following order:
downward motion, ball hold, upward motion, right traverse, downward motion, release, upward
motion, and left traverse. Large balls and small balls are recognized by the activation of lower
end position LS2 switch (OFF for large balls and ON for small balls).
Zero-point indication

Y7 ‘0;
/
XI
LSI Lefttraverse
x4 x5

RightY3 x3
Y4 Left LS3 Upper limit

Magnet

Proximity
0 switch

-
SELECTIVE BRANCHES AND MERGES

+r
S20 Branch state
0 The process of selecting a single flow from mul-
tiple flows is called a selective branch.
0 As this is a selective branch example, XO, X10,
and X20 must not be turnedon simultaneously.

x11 0 When X0 is turned ON while S20 is operating,


the operation state changes to S21, and S20
stops operating.
-- x 2 I f X10 or X20 is turned ON after this state trans-
fer, X31 or X41 is not turned ON.
0 The merge state S50 is activated by S22, S32,
or S42.

-54-

I
3. STEP LADDER, INSTRUCTION,,S.

The Sequential Function Chart for the sorting process is illustratedbelow.

Manual operation 0 In this example, initial position return opera-


sequence tion is executed manually. The procedure to
execute initial position return automatically
x12-- Start is explained in a later section.
y7 -- Zero porition (Upper limit, left traverse limit, un-

W
TO --
Indicates NC contact of
x2
x2 4 Lower
limit
(Small G-/-Lower
limit
not
reached
(Large
ball)

TI -- a KIO T i -- KIO

S23 motion Upward 526


0The flow is selected ac-
X3
limn -- Upper X3 -- Upperlimit
cordingtoballsize
(large or small); left flow
x4 small (X2=0N) for ball
S24 if traverseRight S27 flow right and for large
ball (X2-OFF).
X4 -- Right
(Small
tainer)
ball
con- X5 -- Right
(Large
ball
container)

I
S30 0 The operation state changesto S30 when X4
x2 -- Lowerlimit
(small ball) or X5 (large ball) is turned ON.

0 The special auxiliary relay M8040 disables


state transfer if it is turned on. For S24, S27
and S33,appropriate interlock contacts are
connected inseries to the righttraverse out-
x3 -- Upperlimit
put Y3 and the left traverse output Y4.
0 Thesequenceshownontheleft isan ex-
s33 ample of how to executeaonecycle se-
quence by pressingthestartbutton X12.
x 1 -- Lefttraverselimit Automaticcontinuousoperationandstep-
by-step operation isexplained in a later sec-
tion.

-55-

. . __
3. STEP LADDER INSTRUCTIONS

3.1.4 PARALLELBRANCHAND MERGE EXAMPLE


Parallel branches are necessary in caseswhere 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 3 : Red
Y1 : Yellow 4 : Green
YO : Red

PARALLEL BRANCHES AND MERGES

0 A Parallel branch is a sequence in which multiple


branches of flow proceed simultaneously.
0 In the figure shown on the left, X0 is turnedon
when S20 is operating. S21, S24 and S27 start
operating simultaneously, initiating the operation
flow of each branch.
0 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.
0 A MERGE of this kind is sometimes referred to as
a queuing MERGE.

-- x7

-56-
3. STEP LADDER lNSTRUCTl0.N.S

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 formof a loop.
When the PC status chan-
ges fromSTOP to RUN, the
initial state SO operates to
Traffic signal : Green
light the green traffic signal
and the red crosswalk sig-
Crosswalk signal : Red nal. (via M8002)
XI When crosswalk switch X0
Crosswalk switch or X1 is pressed, the state
changes to S21 (traffic)
and S30 (crosswalk).In
these states, the light state
remains unchanged (green
for the traffic signal and red
for the crosswalk signal).
I W After 30 seconds, the yel-
s22 low traffic signal lights.
The red traffic signal lights
TI -- 10 seconds later.
When the red traffic signal
S23 lights, timer T2 begins
o p e r a t i n gT.hger e e n
crosswalk signal lights
after timer T2 counts 5
seconds.
15 seconds later, the green
crosswalk signal begins to
flash (S32 = OFF, S33 =
Counter which counb the number of
ON).
times state 533 operates. I i While the green crosswalk
Contact CO is activated at signalflashes,states S32
the fifth counting. T5 and S33 repeat operation.
S32 The state changes to S34
when counter CO (setting =
Crosswalk 5) operates,lightingthe
signal : Red
red crosswalksignal.The
state then changes to the
initial state (SO)5 seconds

I
I
W
K50
after the red crosswalk sig-
nal lights.

T6 -- Crosswalk switches X0 and


X1 are inoperative oncethe
I
operation has started to
flow.
3. STEP LADDER INSTRUCTIONS

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.
Illustration (b) shows astep ladder in which thesequential function chart is expressed in relay sequence
chart form.
It is possible to write a program using
either a sequential function chart or a step ladder chart.In either
case, the program should be written in the order of load drive processing thenstate transfer processing.
Sequential function charts and step ladder charts are two representations of the same program. Their
,Use STL

Y-
s20

- Yll
XI x1I
s21 Af
Main bus line

Sub bus line


1
(a) Sequential function (b) Step ladder chart

o sn s20
1 OUT Y10 The program for the sequence function chart or step ladder
2 LO x10 chart is shown on the left.
3 OR x11
An STL instruction is theNO contact instruction connectedto
4 OUT Yil
the main bus line. A coil can be connecteddirectly to the
5 LO x 0
sub-bus line created by the STL contact or it can be driven
6 ANI X 1
through some contacts.

rc
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
The SET or RST
instruction for a state to the main bus line. If a state S is driven through the STL
isa 2-step instruction. contact, the state of that STL contact is reset automatically.

advantage is that they allow the user easyprogramming by isolatingone 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 R E T instruction at the end of a program when using STL
instructions.
Note: An MC instruction cannot be usedin the STL circuit.
An MPS instruction cannot be usedimmediately after the STL contact.

-58-
3. STEP LADDER ,INSTRUCTIONSa

3.2.2 INITIAL STATE PROGRAMMING

0 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.
0 In this example, the initial state is first driven by the special
auxiliary relay M8002 which operates momentarily when the PC
status is changed from STOP to RUN.
0 A state other than an initial state must be driven by other state
using an STL instruction. These states can be driven only by
state elements.

X3 + 0 When programming,theinitialstatemustbe
before any other states in the sequence.
programmed

f-
0 LO M8002 ) Initial drive of initial
MEMO
I SET S 0 state 0 If states S500 to S899 are used, the status of the
3 STL sequence is backed up by the battery.This allows
4 LO the machine to be restarted withthese states when
power supply is restored from failure.
5 SET s 20
7 STL s 20 \ 0 In such a case, re-consider the way the initial state
is driven. Better ways of driving the initialstate are
8 OUT shown at the later pages.
9
10
12
LD
SET
STL
s
s
21
21 \
' 0 Use the RET instruction always at the end of a
series of STL instructions, as shown on the left.
If the RET instruction is not given, the PC regards
OUT
0
13 the LD instruction of step 0 as a connection0 to
14 LO the sub-bus of STL S23 in its cyclicoperation and
15 SET s 22 1 will causeamalfunction.(Actually,aprogram

'
17 STL s 22 \ error occurs and the operation is disabled.)
18 OUT \ J
I9 LO X
20 SET S 23
22 STL
"
)
23 OUT
24 LD x 4
OUT - U s e S23
State OUT

1
25
(See Section 3.2.6)
27 RET
28 END

I
Use RET at the end o t a w r i e sof STL instructions

-59-
3. STEP LADDER INSTRUCTIONS

3.2.3 SELECTIVE BRANCH AND MERGEPROGRAMMING


(1) SELECTIVEBRANCHPROGRAMMING

STL S20
s20 OUT Y 0 - Drive
processing
LO x 0
SET S2i -Transfer tothe 1stbranchstate

SET S31 - Transfertothe2ndbranchstate


LO x 2
s21 I S311 SET S41 - Transfer t o the3rdbranchstate
As in thegeneral 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)MERGESTATEPROGRAM

In brancWmerge transfer

-- x10 programming, do not use MPS,


MRD, MPP, ANB, or ORB instruc-
tions.

STL S 29
- 1
]
Outputprocesses
OUT Y 10 STL 29 Merge
transfer
from
1st
the
LD
SET
xS 50
lo branch
flow

Merge transfer from the 2nd


STL
OUT
S 39
Y 11
- Outputprocesses
SET S 50
branch flow

STL S 49
STL
LD
SET
S49
X12
S 50
] Mergetransfer
branch
flow
from
the
3rd

OUT Y 12 - Output processes

Program the outputprocesses for each state before merging. After that, it is necessary t o program
the merge transfer processes sequentially from left to right.
This rule is addedto allow the SFC screen to be created automatically.

-60-
3. STEP LADDER INSTRUCTIONS

3.2.4 PARALLELBRANCHANDMERGEPROGRAMMING
PARALLEL BRANCH PROGRAMMING

S20
STL
520
OUT Y 0 - Drive
processing

x0 -- LD X 0
SET S21 - Transfer to the 1st parallel branch state
I 1 SET S31 -Transfer to the 2nd parallel branch state
SET S4 1 - Transfer to the 3rd parallel branch state

s21 I
As in the general case, the state drives a load before setting the transfer conditions.It is necessary
to program the settingof the states in the order of left to right as shown in the function chart.
MERGE STATE PROGRAM

-@@@)@STL

Program the output processes for each


I
STL S29
state before merging. After that,R is
necessary to program
the
merge
trans- OUT YiO - Output
processing

I
x12

)Ity
fer processingsequentially fro6 left to
right.
S39
STL
Y i1 - Outputprocessing
Ref.: e The following programs are not permitted.
I
STL S49
OUT Y12 - Output
processing

)It
I
STL S29
STL S39
Merge transfer

LO x10
The transfer conditionsmarked by an
asterisk (w) are not permitted. AND X11
AND X12
SET S50

I
STL instructions written consecutively
indicate a parallel merge. The STL
instruction can used eight times
consecutively.

-61 -
P xrg
3.2.5 COMBINATION OF BRANCHESAND MERGES

t
x0

X3-f X 4 t x1

a a a
v -c
Rewrite in this way:
0
+0
SI01 Dummystate
x0
x0

SI01 f

Program in this way


a STL
a STL
a S 20 STL S 20
LO x 0)
SET
SI00 SET SI02 LD X 0
LD X 0 SET SI03
SET Si01 STL SI03
SET SI00 STL SI01 SET SI02
STL S 40 LD SI01 STL SI02
LO
SET
x
SiOO
2) SET
SET S 50
S 60 ) SET S 40
SET S 40
STL SiOO SET S 50
SET S 50
SET S 50

SET S 60 If processing continues directly from the branch line to the merge
line without a state in between, write in a dummy state as shown
above.
SlOO and S103 transfer contacts can be omitted.

-62-
3. STEP LADDER INSTRUCTIzONS, *,' .

XI X14

x3

Program permitted a Program


permitted
not

x0 -- x1 --

&I 0 Programinthisway :

Branch
transfer
Merge
transfer

STL S20 STL S22


LO x 0 STL S24
SET S21 LO X 6
SET S23 SET S29
LO x 1 STL S26
SET 525 STL S28
Writing a selective branch condition&) after
SET S27 LO X 7
parallel branching or a parallel merge after
transfer condition &) are not permitted. See
S 2S9E T

Reference in Section 3.2.4.

-63-
# 6 gig
3. STEP LADDER INSTRUCTIONS

3.2.6 JUMPANDREPEATPROCESSES

s22

S23 SCC

523
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).

(3) TRANSFER TO A DISTANT STATE


For a transfer to a distant state, anOUT 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 transfersto S32.

520

-----------
I
52 1 RST s41 (2) RESElTlNG I
THE STATE I

I
I
J SSl is reset if S20 = ON ,
I
I and X3 = ON.
I
(1) MAIN FLOW I S20 is not
reset.
STL S20 I I
I
I
x
I

LO 1 I
OUT Y i I
LO x 2
,
-
I
OUT 531 c To discrete state x4
LO x 3 -+$I
-
RST 541 To discrete
state RST
t
OUT
LO x 0
SET S21 To the succeeding
state STL ScO STL S30
OUT Y 2 OUT Y 3
LO x c LO x 5
SET sci SET 531

-64-
3. STEP LADDER INSTRUCTIONS

(1) LIMITS IN THE NUMBER OF BRANCHES

I 1 r
1 branch : 8 or less circuits
c
\
each
For
number
of
initii state,
branch
total
the
circuits should
(6) be 16 or less wfth &ch branching
~~~ ~ ~~ ~

point having no more than 8


OUT RfT branches.

t t +
c

In total : 16 or
. less circuits

Note: e A Stare transfer from a merge line or a state before a merge to a distant state or a reset
process is nor allowed. In such a case, always provide a dummy state to execute the state
transfer.
SEPARATE FLOWS
If the sequential function chart contains more than one initial state, ensure the program instruc-
tions for one flow is groupedaway from another flow.

For the example shown on the left, first program the


flow for the STL instructions for S20 to S39. which
r---
1
r-----1 belong to initial state S3. After that, program the flow
1
i
beginningwith
the
initial
state S4.
In these two separate flows, a state number of another
flow can be used when the instruction used is other

i
than STL. In this example, the "OUT S41" instruction is

I / f-ic
I contained in the S3 sequence flow.

-65-

~
-
3. STEP LADDER INSTRUCTIONS

3.3.1 STL INSTRUCTION

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 cycleto reset its load,
the circuit instructions are then jumped and no longer executed.
If the same outputisdesignatedindifferentstateslikeinthe
example, output Y2 operates if 521 or S22 is ON. Y2 stops operat-
ing when bothS21 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
Scan time
STL.
Designation of the same state is not permitted.
Execution
Non-
execution

I&@q
During the state transfer process, both states will
ONbemomentari-
I 4 Forward rotation1 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
Reverse rotation to make an interlock so that these opposing outputs will not beON
simultaneously.

w
TI K1o
If the same timer is used in a program repeatedly,

interact and the timermay not be ableto reset.


Two separated states can use the
same timer.
it cannot be
connected to the two succeeding states since the instructionswill

To transfer the state sequentially with the same signal, the signal
should be a pulsesignal. Connect the statesas shown to theleft.
Just after S50 is operated with MO turned ON, M1 opens to prevent

T-
the state from immediately changing to S51. At the next MO signal,
the state changes transfersto S51.

HO

-66-
3. STEP LADDER INSTRUCTIONS

3.3.2 INSTRUCTIONS

An STL instruction is effectiveonly when it is used with state


S. The
following contact and coil instructions can be used with state S :
LD/LDI, AND/ANI, OWORI, OUT, SET/RST
In the circuitexample shown on the left,S20 is not reseteven after
S30 or S21 isdrivenby S20. If S20 is turned off, S30 stops
operating. This is becauseS21 and 530 are driven directly without
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 afteran STL instruction.
Both of these instructions reset the transfer source automatically.
They also have the retaining function against power downs.
AnOUT instruction should be used for the transfer to a distant

I 4@
state.
0 An MPS instruction cannot be used iust after an STL contact.

Transfer to distant state

~~~ ~~

APPLICABLE SEQUENCE INSTRUCTIONS


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

<<<:x:;&#:;<:$
m~$$j Can
used
be
Can
used
be
Cannot used
be

Can
used
beCan
used
beCannot
used
be

Cannot beused Cannot beused

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


(explained in a later section).
0 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.

- 67-
3. STEP LADDER INSTRUCTIONS

3.4.1 WHAT IS AN 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 thepower ON or OFF to the externally connected loads.

7
MANUAL : Power supply to individual loads is turnedON/OFF by using the
separately provided pushbutton switches.
MANUAL ZERO RETURN : In this mode, the actuators returnto 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
I actuators at the zero position initiate one automatic operation
cycle. After the cycle is completed, the actuators stop at the
zero position. It is possible to stop machine operation halfway
bypressingthe STOP pushbuttonswitch. The cyclewillbe

1 AUTOMATIC
continued when the START pushbutton switch is pressed.
: Fullyautomaticoperation is possibleinthismode.
programmedcycle is executedrepeatedlywhenthe
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 necessaryto provide pushbuttonswitches for each individual actuatorin themanual operation
since individual force on/off's canbe made with a programming panel.

OPERATION PANEL EXAMPLE

STEP X22 I

X25

MANUAL START
x20
UP LEU

x5 X6 x7 START X26
EM0 STOP
DOWN RIGHT CLAMP

@
xi0 x11 x12 STOP X27
\ J

Pushbutton switches to turn the power ON/OFF to externally connected loads

-68-
3. STEP LADDER INSTRUCTI.QNS
- .. ,. ., , . , , .

An applied instruction FNC6O (IST), explained in a later section (Section5.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 (IST).
X20 : Manual X24 : Automatic
X21 : Zero return X25 : Zero returnstart A selector switch is used to select X20 to
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:

Example : Example : Example :


X30 : Manual X30 : Zero return X30 : Manual
x35 : Zero return X31 : Automatic X31 : Automatic
x33 : Step X32 : Automatic/ X32 : Automatic operation
X40 : Cycle zero
start return 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.

Automatic
Operation

0 In these examples, "MO" is used as the head input for the instruction FNCGO (ET).

-69-

. . .
3. STEP LADDER INSTRUCTIONS

3.4.2 INITIAL STATE INSTRUCTlON

F r---
n
If applied instructionFNCGO (IST instruction) is driven using the
I S T X20 SZO 529 programshownonthe left,the fdlowing initialstatesandthecor-
responding spechl auxiliaryrelays wil be assigned to thefollow-
(1) (21 (3) functions
ing automatically.
(1) Head number of input
(2) Start of range of states usedfor automatic mode
(3) End of range of states used for automatic mode

so : Initial state for manual


mode
LD M8000
FNC 60 - 1 steD s1 : Initial
state
for
zero
return
x20 s2 : Initial
state
for
automaticmode
M8040 : Transfer disabled
S29 J
M8041 : Transfer start
M8042 : Startpulse

INITIAL STATE OPERATIONS

lnitiil states SO to S2, which operate automaticallyin response to an IST instruction, changeas indi-
cated M o w according to the operation mode selection.
Initial pulse while X21 is ON and X21
While X20 stays ON changes from OFF to ON.
I
3. STEP LADDER INSTRUCT&QNS

The operation details of special


auxiliary relays M8040 to M8042 and
M8047 (all of which are automatically
operated by the IST instruction) are
shown in this equivalent circuit.
When M8047 is driven,up to eight
state numbersof the states whichare
x26 Start

return
Zero start
{-
I
H
x20
start
Manual
I
PLS H8042
Dulse
1
currentlyoperatingamong SO and
S899 are stored to D8040 to D8047 H-
from the lowest number. X20 Manual
M8040
Transfer disabled
TRANSFER INHIBIT RELAY
(M8040) Start pulse
When this auxiliary relay is actuated,
state transfer is inhibited.
X23 Cycle
Manual : M8040 is always ON.
Zero return, one cycle :
Once the stop pushbutton
E 0 2
1
pulse
Initial
1
-e
switch is pressed, its state
i s retaineduntilthestart STL monitor enabled
pushbutton is pressed.
One : M8040 is always ON. It is
Step
turned OFF onlywhenthe
start
pushbutton
is
pressed, enabling state transfer forone 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 (M8041)


This is an auxiliary relay usedas a state transfercondition fromthe initial stateS2 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 pushbuttonswitch 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.: e The special auxiliary relays M8044 (zero position) and M8043 (zero return complete) should
be controlled by the user's circuits, such as initial circuit or zero returncircuit, as shown
in Section 3.4.3.
e The IST instruction executes the control in the range as described in the 'Programming
Tip" in Section 3.4.3.
3. STEP LADDER INSTRUCT IONS

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 takenat 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 up/down and right/left traverse control, and a single-solenoid
valve is used for unclamp operation.

(8) Left traverse


Y4

Zero point
2

(4) Right traverse y3

traverse Right
(1) Downward limit X3
motion
YO
(5) Downward motion (7) Upward motion
YO Y2

Lower limit
Xi

1 I

(2) Clamp (6) Unclamp


Y l ON Y l OFF

Workpiece Transfer Mechanism

-.
Omration Panel ExamDle

- Right traverse
Left traverse
e
ZERO

X25

i5
IC START

@
--
a
c Clamp x5

e e e
E M 0 STOP

e9
Unclamp DOWN RIGHT CLAMP
Workpiecg -,
I \Point p.I [Point 81 x10 x11 X12 STOP X27

-72-
3. STEP LADDER INSTRU,

CIRCUIT INITIAL
Zero Dosition condition

Initial state for automatic operation

Upper
Unclamp
traverse
limit

,
18044 Zero
position
condition
limit
Down

I
SET Yl Clamp
MANUAL OPERATION
Clamp
X 1 2 Clamp input
-SET) YI

for manual
x 7 Unclamp input
R S T ) YI I
operation
UP Right traverse

Down
x3 Right
traverse
limit

Down

limit
ZERO RETURN

Initial state for zero return

Left traverse

I W
I I
AST YO Resetting
"down"
output J

SPECIAL AUXILIARY RELAY


0 M8044 (Zero-positioncondition)
Left traverse
This relay is driven by each sensor at the zero posi-
tion. The ON state of this relay is used as the state
transfer condition to automaticmode.
0 M8043 (Zero-returncomplete)
Zero return complete
For zero return operation, use states S10 to S19. In
the final state, drive M8043 before resetting itself.

Note: 0 The IST instruction must be programmed prior to the STL circuits.
0 All outputs will beturned OFF if a rotary switchis operated to change the mode (X20, X21,
X22, X23, or X24) before the zero return complete(M8043) relay is turned ON.

- 73-
3. STEP LADDER INSTRUCTIONS

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

0 LO 32 STL s i
1 AND 33 LD X 25
2 ANI Y l 3 4 SET s 10
3 OUT M8044 36 STL s 10 K 10
5 LD MEOOO 37 RST Y l
6 FNC 38 RST Y O
39 OUT Y 2
s 20 40 LO x 2
S 27 4 1 SET s 11 74 LD X 2
13 STL s o 43 STL s 11 7 5 SET S 23
14 LO 44 RST Y 3
15 SET 4 5 OUT Y 4
16 LD 46 LD x 4
17 RST Y l 47 SET s 12 80 SET S 24
18 LD 49 STL s 12 82 STL S 24
19 ANI 50 SET M8043
20 OUT Y 2 52 RST s 12
21 LD (RET) 85 SET S 25
22 ANI Y 54 STL s 2 87 STL S 25
23 OUT 5 5 LD M804 I
24 LO 56 AND M8044
25 AND 57 SET s 20 K 10
26 ANI Y 3 59 STL s 20 92 LD T I
27 OUT Y 4 60 OUT Y O 93 SET S 26
28 LD 61 LD x i
29 AND 62 SET s 21
30 ANI Y 4 97 LO X 2
31 W T Y 3 98 SET S 27
(RET) S

-
I 0 0 STL 27

N 103 OUT S 2
Instructions in ( ) are not necessary
105 RET
106 END

PROGRAMMING TIP
While the appliedinstruction FNCGO is driven, special auxiliary
relay M8W3 (zero-retum complete) is controlled automatically
as shown below.

Zero position
condition Transfer
start

T
I"]'-
Zero return start
. I

I I GENERAL
I t I

I HARDWARE AND INSTALLATION

I 2 I IBASlC SEQUENCE INSTRUCTIONS I


I 3 I STEP LADDER INSTRUCTIONS I

-75-
4. DEVICEDETAILS

I
p+
----------- YO ++ , NC contact
-i
Output terminal

INPUT RELAYS (X0 TO X177)


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
A number of NO
optically isolated, electronic input relay (X) is connected to the input terminal.
(normally-open) andNC (normally closed) contacts are provided inside thePC and can beused
as often as required.
The input relays cannot be driven within a pro.gram.
OUTPUT RELAYS (YO TO 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 suchas a relay contact,SSR, or transistor)of an output device
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 Section4.1.2.
I/O NUMBER ASSIGNMENT EXAMPLE

Input
Input
Output 0 I/O numbers
for
extension unitsand
blocks
xo-~ x1o-x17 X3O-X37 X3O-X33 assigned
are consecutively the
to base
unit beginning with the units/blocks lo-
cated closest to the base unit. I/O num-
bers are assigned in octal numbers.
Attach number labels to the terminal so
that the I/O numbers can be distinguished
easily.
0 Both inputs and outputs have numbers in
the range of X/YO to X/Y177 (128 points).
The total number of I/O points should be
Yo-Y7 Ylo-Y17
Y20-Y27 y40-y.47 Y34-Y37 128 or less.
Output Input output
When an FX8ER or FX2-24MR is used, 4/4 I/O
points are left unused and, thus, the total 1/0
numbers arereduced accordingly.
0 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, isused, both
upper and lower terminals are used for inputs or outputs only. Upper terminals are assigned
lower I/O numbers and lower terminals are assigned higher I/O numbers.

-76-
4. DEVICE
DETAILS . . I , .. , . A , . ,

4.1.2 I/O RELAY OPERATION TIMING

f (1) INPUTPROCESSING
Before all of the program instruc-
tionsareexecuted,theprogram-
mable controller reads the ON/OFF
status of all input terminals into its
input image memory.
Whenaninputcontactchanges
from OFF to ON and then from ON
to OFF, a response delay (approx.
10 msec) exists due to the exist-
ence of the input filter.
(2) PROGRAMPROCESSING
T h ep r o g r a m m a b l ec o n t r o l l e r
reads the ON/OFF status of all ele-
m e n t sf r o mt h ei n p u ti m a g e
memory and the image memories
of otherelements and writesthe
results of the operations to the
(2)Program
Read Processing
image memory in accordance with
the program instructions.
As a result, the image
value of each
x0 Write element changes as the program is
executed.
Elemeni Operations of output relay internal
image
YO memory contact are determined by the con-
tents of output image memory.
Write
I Auxiliary relay (3) OUTPUTPROCESSING
When all instructions havebeen ex-
ecuted, the ON/OFF status of the
image memory for the Y outputs is
transferred to the output latch
memory and this becomes the ac-
tualoutput of the programmable
Repeat controller.
Output processing
One cylce of (6) Output An external output contact in the
this is refenoc PC operates after an output device
as the prograr t 1 response relay.
cycle or scan. YO
Yl
Y2
output
latch
momory

J
4. DEVICE DETAILS

4.2.1 RELAYNUMBERSAND THE FUNCTIONSOFAUXILIARYRELAYS


A number of auxiliary relays are used in a PC. The coils of these relays are driven by a contact of
devices in the PC in the same manner that the output relays are drivenin 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 (MOTO 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.

MlOO Normally-closed
contact 'I
(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 towhere they were just beforethe 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-


retainingcircuit.Relay M600 isactivatedwhen X0 is
turned ON. If X0 is turned OFF after the activation of
M600, its activation status is self-retained.
Therefore, the activation statusof M600 is retainedif X0
is turned OFF due to a powerfailure. However, M600 is
reset if the NC contact X i 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 : e During the parallel link operation betweentwo
PC's, MBOO to M999 areused. 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 thePC.
These contacts cannot drive external loads directly.

I PC External loads should be driven through output relays.

-78-
4. DEVICE
DETAILS . ,_ .,,.

(3) SPECIAL-PURPOSE RELAYS (M8000TO 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 thePC and only the contacts of these coils can be used.
Examples: M8000 : RUN monitor (ON duringrun)
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.VLED OFF
M8033 : All outputs retained when PC operation stops
M8034 : All outputs disable
M8039 : Constant scan
Note: 0 Do not use undefined special auxiliary relays.
r
APPLICATION EXAMPLE OF LATCH RELAYS

Left traverrr limit LS Right traverse limit LS


LS1 (XO) LS2 (xi) relays to feed the table in the same
Use latch

9- n
failure.
direction as fed before an occumence of a
power

Brake motor

Righttravrne X0 = ON (Mt r a v e r ~ 8limit) + M600 = ON +


instruction Tablemoves right -. Powerfailure + Table
Stops + RestaR (Me00 = ON) -.X1 = ON (right
traverse limit) + M600 = OFF, M601 = ON -.
M60 1 instruction
Table movesl e f t

-79-

....
4. DEVICE DETAILS

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 with step ladder instruction STL.
The four types of states are described below:
For Initial State (SO to S9 10 points)
For Zero Return (Si0to Si9 10 points)
For General Use (S20 to S499 480 points)
For Retention (S500 to S899 400 points)

In the step-by-step process control shown on the left, state S20


is set (ON) when start signal X0 is turned ON. At the same time
solenoid valve YO is energized for downward motion.
When the lower limitLS X1 is turnedON, state S21 is set (ON) and
clamp solenoid valveY1 is energized.
When the clamp confirmationLS X2 is turnedON, state S22 is set
(ON)
The transfer source stateis automatically reset(OFF) as the state
transfers sequentially.

Each state has a numberof 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 (M).

-80-
4. DEVICEDETAILS

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 be displayed
when the fault isreset.

Monitoring is enabled by driving special auxiliary relay


M8049.
t

State S900is activatedif movement detection switchX0


is not driven within one second
after the forward output
YO has been turned ON.

LS X1 and
State S901 is activated when both upper limit
lower limit LS X2 are OFF for more than two seconds.

If the cycle time of a machine in its automatic mode is


less than 10sec., and X3 stays ON to select this mode,
state S902 willbe set ON if the cycle completionsensor
X4 does not activated within this cycle time.

If any state from S900 to S999 is activated


(ON), special
auxiliaryrelay M8048 isactivated to turn onfailure
indicator output Y10.

The state activated by the extra error/failure diagnosis


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

Note: 0 For anANS instruction and an ANR(P) instruction, see Section 5.6.7 and 5.6.8.

-81 -

. .
4.

4.4.1 POINTERNUMBERS AND THEIR FUNCTIONS


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

x21
CALLIPI 1
x20
i I { CJ 1 PO I -I
H
Subroutine call instruction

5
Jump instruction

I 1- FEND 1
Label PO
Label P1
Subroutine

When X20 is turned ON, the program sequence When X21 is turned ON, the subroutine of label P1
jumps the stepof label PO. that is programmedfollowing an FEND instruction is
executed. The program sequence returnsfrom the
subroutine when anSRET instruction is executed.

As described above, pointers PO to P63 are used as a labelto designate a jump destination for
a branch instruction such as CJ and CALL. P63 is the step of the END instruction.
Note: 0 Pointernumberscannot be used repeatedly.
(2) POINTERS FOR INTERRUPTS (IO TO 12 : 3 POINTS)

(3)
I 0 0 0Input interrupt

I
1 ,O : Interrupt at trailingedge
1 : Interrupt at leading edge
Input number (0 to 5)
Each input can be used only once
Example : 1001
The sequence programmed after the label (in-
dicated by this pointer) is executed
at the lead-
ing edge of input XO. The program sequence
returns from the interruption program when an
IRET instruction is executed.

Note: 0 An interrupt pointer must be programmed in a step that follows an FEND instruction.
0 No morethan 3 interrupt pointer pointscan be used.
0 No more than 2 nesting levels canbe used.
0 The number in the 100's place cannot berepeated.
1100 and 1101 ..... Not allowed
0 The input used for interrupts must not coincide with inputs used by
any high speed
process.(e.g. high speed counter).

-82-
4. DEVICE DETAILS

4.5.1 BINARY
DATA (WH)
(1) BINARYANDDECIMAL

Keyed-in dal Whendecimal 'K789' iskeyedin as a timer or


countersetting, it isautomaticallyconvertedto
0 : Poaitive 1 : Negative binary data as shown on the left.

ig$g;#!a#o--N- When a timer or counter current value stored in


binary is monitored, it is automatically converted
$ d ' " i and displayed as a decimal.

1+4+16+256+5i2=789

K789
K : Indicate8
decimal
constant
Monitored date

(2) BINARYANDHEXADECIMAL
~~ ~

Keyed-in data
H789 Whenhexadecimal H789 iskeyedintoa data
n register, it is converted into binary data as shown

r 0 : Positive 1 : Negative v on the left. A hexadecimal digit is a number from


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

1
[olo o l o l o l l l l l l l l l o l o l o l l ~ o l o l l ] to hexadecimal H789 whenthe HELP key is
j p j g % ~ ~ ~ l j a # 3 a - - pressed. (when a hand-held panel is used).

0
9 " ' " ;
1. 024+512+256+120+0+1-1, 929 K1929
Monitored data
H : Indicate8 hexadecimal

*
BCD DATA

All operations executed by the PC, such as arith-


metic calculations, increment instruction, and decre-
ment instruction, use binary (BIN) data.
Therefore, usethe BCD to BIN conversion instruction
to read BCD digital switch data into thePC. Conver-
sely, use the BIN to BCD conversion instruction to
output the data to a BCD seven-segment display
unit.
However,withspecialfunctionssuch as FNC72
(DSW), FNC74 (SEGL) and FNC75 (ARWS), this

(818I8I8I
I I I I J
BCD/BIN conversionisautomaticallymadewithin
these commands.

-83-
4. DEVICE DETAILS

4.6.1
TIMER NUMBERS AND FUNCTIONS
Timers operate by counting clock pulses(1 msec, 10 rnsec, 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 storedin a data register(D). For the indirect setting, data registers backedup by the
battery are usually used to ensure that there is noloss of data. Therefore, timers or counters may
malfunction if battery voltage is lowered.
(1)TIMERS (TO TO T245)

b'7-a K123
/
When input XO, which drives timer coil T200, is turned
ON, the current value for T200 begins counting in 10-
rnsec pulses. The timer output contact is turned ON
Setting (integer) when the current value reaches setting K123. In other
------- words, the output contact is
after the coil is driven.
turned ON 1.23 seconds

Reset input Both the counter and the output contactare reset when
thedriveinput X0 is turned OFF orapowerfailure
Counter occurs.
4-
x0 Note: 0 If T192 to T199 are used in a subroutine or an
data input
interruption routine, the timing is updated at
L 1Oms clock pulrer
the point when an END instruction is executed.
The output contact i s activated when a coil
instruction or an END instruction is executed
when the timer current value reaches the
preset value.
Other timers cannot count correctly in a sub-
routine.

-84-
4. DEVICE DETAILS . ..

4.6.2 CONTACT OPERATION TIMING ANDACCURACY


Timers begin counting after the coil is driven. The output contact is activated when the first coil
instruction is executed after the timer countsup.
Timer counting operation (H the operation cycle is long,

'
X10 = OFF-ON
, Timerstarts
counting Contact
K12 operation

Y 10
1 ON
I
c 1 I t 1
cycle
'n+l'th
cycle
'n"th
cycle
1st
2nd
cycle

The operation accuracy of a timer contact between the time the contact is activated the
andtime the
coil is driven is expressed in the followingmanner.
a : 0.001, 0.01, 0.1 sec
+To (corresponds to 1 msec, I O msec, and 100 msec timer)
T -a T : Timer setting (sec)
To : Operationcycle (sec)
to atimer coil, the accuracy of the timer contactwill become '+2TO' in the
If a contact is written prior
worst case.
If timer setting is 'OB, the output contact is activated when a coil instruction in the next cycle is
executed.
A 1-msec timer counts I-msec clock pulses in the interrupt mode after the execution of a coil
instruction.
+
DETAILS OF TIMER OPERATION

w
xo n I t\ I
1.23 sec I

Present value A
tl + i2 = 34.5 c
-
f
YO

-85-
4. DEVICE DETAILS

4.7.1 INTERNAL
SIGNAL COUNTERS
(1) 16-BIT UP-COUNTERS(SETTING : 1 TO32,767)
General-use Counters (CO to C99 : 100 points)
Battery-backed Counters (C 100 to C135 : 36 points)

TKO typesof 16bit binary up-counters are provided.


The setting range of these counters ranges fromK1
to K32,767. KO and K1 have the same meaning and
an output contact is am'vated after thefirst counting.

x10 n
x11

Counters C100 to C199


retain the present data and
contact set/reset state if a
power failure occurs.

The current value of the counter increases eachtime coil CO, is turned ON b y the input X1 1.
The output contact is activated when the coil is turned ON for t h e tenth time. After this, the
counter data remains unchanged when X1 1 is turned ON.
The counter present data is reset to " O w when a RST instruction is executed after reset input
X10 is turned ON. The output contact is reseta t the same time.
Counters can be set directly using constant K or indirectly by usingthe 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 t h e setting of K123.
If a value greater than the counter setting is witten 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.
6
COUNTERS SIGNAL INTERNAL \
Internal signal counters are counters which countthe signals of internal devices (such
as X, Y, M, S, T, and C) while executing the cyclic operation. Therefore, both t h e ON
duration and theOFF duration of the count input signals must be longer than the PC
cycle time. Generally, the count input signal frequency should several
be cycles/sec.
(Hz).

-86-
4. DEVICE DETAILS

4.7.2 HIGH-SPEED
COUNTERS
Although counters C235 to C255 (21 points) are all high speed counters, they all share the same 3
high speed counter inputs onthe 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 w r d s ,
since there is only 3 high speed counter inputs, only a maximum of 3 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 START/RESET C235 toC237
(2) 1-PHASE with START/RESET C241,C244.
(3) 2-PHASE
BI-DIRECTIONAL
C246,C247,C249.
(4) 2-PHASE
A-B
PHASE TYPE C251
,C252,C254.
All of these are 32-bit up/dovm counters.The following table shows whichcounter uses vhich inputs.
High-speed Counter Table

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 a t the same time but their inputs must not coincide.
Note: Inputs AD to X7 cannot be used for more than one counter. For example, if C251 is used,
the followng counters and instructions cannot be used:

C235, C236, C241, C244, C246, C247, C249, C252, C254, IO**, /I**, and any high speed
instruction using the corresponding input.
4. DEVICE DETAILS

DRIVING HIGH SPEED COUNTER COILS:


High speed counters operate by the principle of interrupts and are therefore event trigQered and
independent ofcycle time. The coil ofthe selected counter should be driven continuously to indicate

Eifg
that this counter and its associated inputs are reserved and t h a t other high speed processes must
not coincide with this.
Example:
When X20 is ON, high speed counter C235 is selected. From the
K4789 above table C235 corresponds to count input
X0 and w i l l therefore
count pulses from XO, NOT X20.
C236 0 4 When X20 is OFF, coil C235 isturned OFF andcoil C236 isturned
ON. Therefore, counter C236 is selected and countsfrom input X1.
Programmable
controller

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

-88-
4. DEVICE DETAILS

(1) 1-PHASE TYPES (C235 to C244)(max.3pts.)


with 1-phase high speed counters there are t h e folloving two groups:
(a) I C235 to
C237 I Without START/RESET Setting
range:
(b) I C241,C244 I With START/RESET -2,147,483,648 to +2,147,483,641
All of these are 32-bit up/down ring counters. When the count value reaches its setting t h e
contact sets and holds when up-counting but resets when down-counting.
DIRECTION:
The direction of count for 1-phase counters is dependent on their corresponding flag M8AAA
where A A A is the corresponding counter number (C235 to C244).
(a) 1-PHASE WITHOUT START/RESET (C235 to C237)
x12 UP ] Down I UP

X13 n i\

X14
I I I I

Present data n

turned ON

Yl

The counter operates when the C200 coil is activated as it counts by counting inputX14.
The output contact is set when the counter current value increases from "-6" to "-5" and is
reset h e n counter current value decreases from "-5"to "-6".
The countercurrent value increases or decreases independent of output contact state
(setheset). Howver, if a counter counts beyond+2,147,483,647", the counter currentvalue
changesto "-2,147,483,648". Similarly, countingbelow "2,147,483,648" changes the
counter data to "+2,147,483,647". Such counters are called "ring counters".
4 If reset inputX13 is turned ON, the counter presentdata is reset toV a n d the output contact
is reset also.
Counters t h a t are backed up b y the battery retain its (current value and output contact)
setheset state if a power failure occurs.
4 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

These counters only use one input each.


When direction flag M8235 is ON, counter C235 counts d o w .
When it is OFF, C235 counts up.
When X1 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 ON" signals of input XO.
-+

EL& '
(b) 1-PHASE WITH START/RESET (C241,C244)
These counters have one count input andone reset input each.
X13 When direction flag M8244 is ON, C244 counts up. When it is
-@
I OFF, C244 counts d o m .
i

When X14 is on, C244 resets in the same manner as normal


internal 32-bit counters. From t h e table on the last page, it
can be seenthat C244 can also be reset externally by the input
x1.
RST C244
Counter C244 also has an external start input X6.

When this is ON, C244 starts counting. When it is OFF, C244


stops counting.
X15 selects and reserves C244 for counting "OFF ON" events
of its corresponding input XO.
Note t h a t thesetting of DO forcounterC244 is apaired
designation (DO, D l ) since the counters are of 32-bits.
Note the external control of start (X61 and reset (X11 have t h e
advantage of being immediate and not affected by the pro-
gram cycle time.
(c) 2-PHASE BI-DIRECTIONAL COUNTERS (C246,C247,C2491(max.lpt.1
These counters have one input for up-count and one input for down count. Some of these

EraD]
have reset and start inputsas wall.
x 10
RST IC246 WhenX10 is ON, C246resets inthe same w a y as internal32-bit
u p l d o m counters.
2 Fromthehighspeedcountertable ontheprevious page,
counter C246 usesX0 asup count inputs and X1 as dom-count
input. X1 1 must be ON select counter C246 and reserve these
inputs.
X0 "OFF -+ ON": C246 increment one
X1 "OFF -+ ON" : C246 decrementone

Programmable
Controller

-90-
4. DEVICE DETAILS

I
1
4
M
M
X13

- K1234
From the high speedcountertableon the previous page,
bi-directional counterC249 can be seen to have X2 as its reset
input and X6 as its start input. Therefore, reset can be made
externally without the need for the RST C249 instruction.

X13 must be ON to select C249. Start input X6 must ON to


allow plus count. Counting stops if X6 is OFF.

Up-countinput :X0
down-count input: X1
n The direction of t h e counting can be monitored by monitoring
the state of the corresponding flag M8AAA where AAA is the
J- counter number.

I
Programmable ON: down count, OFF: up count
Controller

(2) 2-PHASE, A-B PHASE COUNTERS (SETTING : -2,147,483,648 TO + 2,147,483,647)


2-PHASE, 2-INPUT (C251 C252,C254 : 1 POINT) (Battery backed)
A maximum of 1 point of 2-phase 32-bit binary u p / d o m 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 t h e inputs indicated inthe high speed counter table can
be used for counting. Its interrupt countingis executed independent of sequence operation.
Appliedinstructionsforexecutingcomparisonsandoutputsindependentof 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 signalsdetermine whether the counteroperates as an
up-counter or a dom-counter.

B-phase input OFF ON : Up-counter -


While the waveform of the A-phase is in the ON state: Up-count
A-phaoe

E-phase
M
J L r
m
B-phase input ON + OFF : Down-counter Domcount
A-phaw

B-pha~e

E:pa
Check the corresponding special relayM8AAA to determine h e t h e r the counter is counting
up or down.
. I c251 1 C251 counts the "ON/OFF" events of input X0 (A-phase) and
input X1 (B-phase) while X1 1 is ON.
C251 K1234

,--1mI
x12
.. , , , -1 1. .. , ,. C254 starts counting immediately when X6 is turned ON vvhile

A'L-
X13 is ON. The countinginputs are X3 (A-phase)and X2
DO (6-phase).
C254 is reset when X0 is turned ON. It can also be reset with
X12 in the sequence.

-91 -

. .
4. DEVICEDETAILS

MAXIMUM COUNTING SPEEDS


The speed of the high speed counters are limited by 2 factors:
(a) response of theindividualinputs
(b) processing time of all the high speed counters
(a) RESPONSE OFTHE 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, x 2 , x3 5 kHz
x1, x4, x5 5 kHz
(b) PROCESSING THE TIME OF ALL THE HIGH SPEED COUNTERS
This is the main area t h a t limits the speed of the counters. The counters operate with 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 muchlower than the rated
frequency specified below, this w i l l allow other counters to counta little faster.
The overall limitation is t h a t the counting frequency of all the counters combined together
must be less than 5 kHz.
COMBINED FREQUENCY
The combined frequency is the sum of the maximum frequencies of all the signals appearing a t t h e
input of the PC simultaneously. The criteria (b) of the above is t h a t in order for the high speed
counters to count correctly. This combined frequency must be less than 5 kHz.
Example:

I I I
~ ~~ ~~~ ~~

1-phase Counters Correspondina Input Maximum Sianal F r e r I


C235 x0 0.2 kHz
C 236 x1 4 kHz
C237 x2 0.1 kHz
Combined frequency: 4.3 kHz

The combined frequency of 4.3 kHz is lower than the max. of 5 kHz so this example is valid.
2-phase Counters:
(a) Bi-directional types: -are designed such that
the up-count signal and the down-count signal
never operate a t 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 l-phase counters when calculating the
combined frequency.
When pulses arrive a t the up and domn count inputs atthe same time, treat this as 2 single
phase counters when calculating the combined frequency.
When encoders t h a t 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.

-92-
. .- .."A"-

4. DEVICE DETAILS

(b) A-B phase types: - are different to other counters in that they can decode simultaneously
the A-phase and B-phase signals to automatically select up count and d o w count.
These are recommended to be driven at no higher than 1.5 kHz.
When calculating for the combined frequency, t h e 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 C235 x0 1 kHz


A-B phase C251 x3, x2 1 kHz x 4

Combined frequency:
1 +(1 x4) =5kHz

The combined frequency is not above the limit of 5kHz, therefore the combination is valid,
SIMPLIFIED GUIDE FOR COUNT SPEEDS
Counters Maximum Frequency ( h e n using 1 point)
1-phase 5 kHz
Bi-directional 5 kHz
A-B phase 1.5 kHz
When many countersor combination of t h e 3 counter types areused, their total combined frequency
must notbe over 5 kHz (remember to multiply theA-B phase counter frequency by 4).
Example:
1-phasecounters : 3 kHz (1 point)
Bi-directional counter : 1 kHz (lpoint)
Combined frequency = 3 kHz + 1 kHz
= 4 kHz

-93-

. -. -
4. DEVICEDETAILS

4.8.1 DATA REGISTERNUMBERS AND FUNCTIONS


Data registers are used to store numeric data.
Although all data registers are 16-bit devices (the MSB stores a plus or minus sign), 32-bitdata can
be stored by using a pair of 16-bit registers.
(1) GENERAL-USE REGISTERS (DOTO D99 : 100 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 "0".
Note: Data can be retained h e n the PC statusis changed from RUN to STOP by setting
special auxiliary relay M80.33 ON.
(2) BATTERY BACKED REGISTERS ( D l 0 0 TO D l 2 7 : 28 POINTS)
Once data is written to a battery backed register, it remains unchanged until it is overwritten.
When the PC status is changed from R U N to STOP, the data in these registers is retained.

(3) SPECIAL REGISTERS (D8000 TO 08069 : 70 POINTS)


Special registers are used to control or monitorvarious modes of devices inside t h e PC.
Data in these registers are set to the default values h e n the power supply to the PC is turned
ON. (When the power is turned ON, all registers are first cleared to "0" and the default values
are then written to some of the registers by the system software.)
For example, t h e watchdog timer data is set to D8000 by the system software. To change the
setting, write the required value to D8000 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.
16-bit/32-bit data :

I r l r r r r l r r r r r r r r j
L S i g n 0 : Positivenumber
1 : Negativenumber (two's complement)
-k D l (higher 16
,-)stib Do (lower 16 +s-bt)i

Sign 0 : Positivenumber
1 : Negativenumber (two's complement)
See Page 129.

-94-
4. DEVICE DETAILS

4.9.1 MODIFYING DEVICE NUMBERS


Both index registers V and Z are 16-bit registers. Numerical data
can be read/witten 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 s h o w to the left, the processing required to change a device


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

The devices t h a t can be modified vrith an index registerare s h o w


on the left.
Note: Modifying Kn, nhich is used to designate the number of
digits, is notpossible.
K4MQz .....Allowable
KQzMO ..... Not allowable

f
PROCESSING NUMERIC DATA WITH BIT DEVICES
In Kn, "n" represents the numberof 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 vith leading zeros. In this
case, bits M4 to M31 can be used for other purposese. See Section 5.1.3.

-95-
4. DEVICEDETAILS

4.10.1 GENERAL CONFIGURATION


The internal configuration of t h e devices in the PC is s h o r n below. The memory areas marked with
(B/U) are backed up bythe battery.

Latch Memory

I I
Program Memory
RAM
EEPROM
EPROM

The effect of power


ON/OFF operationand
PC RUN/STOP opera-
tion on the data in each
memoryareaissum-
marized in the following
table.
Some specialauxiliary
relays (special M) and
specialdataregisters
(special Dl are handled
as type-C memory.

A : Memories backed up by battery Not changed


B : Special M and D and index
Cleared Not changed Default
resisters
C : Other memories
Cleared
Not
changed ICleared
(not backed up by battery) Not changed ifM8033 is set

-96-
.-1 l__c-.__ ....... .,....,-.. .. -

r l GENERAL HARDWARE AND INSTALLATION

Fl BASIC SEQUENCE INSTRUCTIONS

STEP LADDER INSTRUCTIONS

I
DEVICE DETAILS I

ISPECIAL DEVICE AND INSTRUCTION LISTS


I I

II USING SPECIAL UNITS EFFECTIVELY


b
I
I

I
I I

APPENDIX

-97-
5. APPLIED INSTRUCTIONS

5.1.1 APPLIED INSTRUCTION EXPRESSION


FORMAT
DECO
(PI (161
FNC 41 Object devices
: +-(s .I--4 .H
HS
J K H IT I c I o I v , ~ ]
Mean
[ X l Y l M . l S ]

.H
HD WQ
n .I-+
n-1-B
Number of steps : DECO,DECO(P) ........................ 7 steps
-DECO : Instruction mnemonic FNC41 : Function
number
name
(PI : Pulse function MEAN (PI (16) : 16-bit
operation
only
is available. If (16/32) : 16-bit 32-bit
and
(i.e. (D)MOV) operation
are available.
(1) INSTRUCTIONSANDOPERANDS
Applied instructions are designated by a function number (FNCO to FNC99). Each applied
instruction is givena symbol (mnemonic). FNC41 is given the symbol PECO", for example.
When witing a program, the FNC number ofthe application functionto be used canbe found
by using the HELP function to display a list of FNC numbers and symbols. Both the FNC
number and its symbol are displayed M e n a program is read and displayed.
Some appliedinstructionsrequireonly the instruction (FNC number)to be designated.
Others require the designation of an operand.
[s .] (0 .] n 42) + (D

Pel Thisinstructionexecutesprocessing
determine an average. The data stored in h"
devices, beginning with thedevicedesig-
to

LD X4 nated b y IS. 1 , is added and thesum is


41DECO divided
by "n". The obtained
quotient is
stored in the device designated by [D.1.
x 0
[SI : An operandwhosedatamaychange
M 10 after
instruction
t han
e execution
of is
K 3 "source"
called is and expressed with
the symbol [SI. If an index modifier can
be used, such an operandis expressed
as [S. I . When more than one source is
designated, the sources are expressed
as [ S l . I, [S2- I,etc.
[Dl : An operand whose data changes after the execution of aninstruction is called
"destinationnand is expressed with the symbol [ D l . If anind.ex modifier can beused,
such a destinationis expressed as [De 1. When more than one destination is
designated, the destinations are expressed as [ D l . 1, [D2.1, etc.
m, n : Operands which accept only constant K or H are expressed as " m a and 71". If more
than one such operand is designated, they are expressed as Ml", "m2", etc.
An appliedinstruction always occupies 1 programstep.Operandsoccupyeither2 or 4
programstepsdependingon whether the instruction is a 16-bitinstruction or a 32-bit
instruction.
Note t h a t w'th some functions, programming is allowed for only once even ifjumps are used
to separate them. However, index registers are usable for changing the device element
number.

-98-
5. APPLIED INSTRUCTIONS

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

Instruction to move the data in D21 and D20 to D23 and


D22
32-bit instructions are expressed by appending (D) to an instruction such as (D)MOV and
FNC(Dl12, (FNC12(D)).
Both odd and even numberscan be usedtodesignate a devicenumber. The device
folloAng the designated device may be paired with the designated device (word devices
such as T, C, and Dl.
To avoid confusion, it is recommended to always use an even number for the device to
be designated by an operand h e n a 32-bit instruction is used.
A 32-bit counter (C200 to C255) cannot be used as an operand for a 16-bit instruction.
(2) CONTINUOUSEXECUTION 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 insmc-
can be used with symbol (Dl like (DIMOV(P). tion isexecuted repeatedly every operation
With the program s h o w above, the insmction cycle while X1 is ON.
is executed only once when the state of X0 Some instructions, such as XCH, INC, and DEC,
changes from OFF to ON. This shortens the require care when being usedin the continuous
total program processing timebecausethe execution form. These instructions are indi-
instNction isnot executed with every operation cated by u ! " .
cycle.Therefore, it isrecommended to use
p u l s e execution form instructions.

Note: In either case, the instruction is not executed uhile X


I or XI is OFF. The destination
remains unchanged d t h the instructions unless specified otherw'se.

-99-
5. APPLIED INSTRUCTIONS

L Sigr'tit (0:Positive, 1 : Negative) m Lower bits

Previous bit data remeins unchanged K2m

When a 16-bit data is moved to KlMO, 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 andthe digit designation for a bit device is K1, K2, or K3,
' V i s placed in the higher digit bit position. This means that only positive numbers are handled.
This is also true h e n K1 to K7 is designated vvhile a 32-bit data operation is executed.

2-digit BCD data of X4 to X13 is converted into


BIN K2X4 0 0
binary data and transferred to DO.

Any number can be used for the bit device number. However, it is recommended to use a "Onin
the l o w s t 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 "1O"as with Xand Y.
Ref.: Designation of or series of nards
Aseries of data registers beginningw*thD 1 me8ns DI , D2,D3, ....
W e n nards, designated
w*th a bit device, are handled as a series of w r d s , they should be designated in the
follo w n g manner :
K l mK I M KlXlOKlX14 .......
K2YlO K2MO K2KiO .......
K3MO K3M 12 K3M24 K3M36 .......
K G 1 6 K4S32 K G 4 8 .......
Thatis, the devices statedabove should be used for each digitso thatno device is skipped.
the upper 16bits are to be regarded8s V : To obtain
If X2yO"is used in a 32-bit operation,
32-bit data, use X8YO:

- 100-
5. 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 inthe same manner as with general-use
data registers.

Expressing object device IKHIKnXIKnYIKnHIKnSI T 1 C I 0 IV,Zj


t ' Cunent vdue registera
for timers and countera

The diagram above shows t h a t XnY to V, 2" canbeused as the destinationof an applied
instruction. The dot in [De I indicates that an indexcan 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
( e )

allowed as it already represents both V and Z.


There are no modifiers for V and 2 .

POI 1 MOV K 10 V Because K10 is moved to V and K20 to Z, the


data in V and 2 are "10" and 7 0 " respectively.
"(D5V) + (Dl521 -. (D40Z)"means that "(Dl51 +
HOV K 20 Z
A
(D35) -c (D60)".
V and Z can be used to facilitate programming.
x 2
-il 0 5V 0 152 0 402 "(Dl, DO) + (D3, 02) -. (D25, D24)"
For 32-bit instructions, V and Z are automat-
HBOOO ically
assigned
used
is Vin pair. to '0" by the
-It MOV instruction.

t;l' I
I I I 1

FLAGS
For some applied instructions, various flags shorn 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 errorsin the syntax ofthe applied instruction or the object device numbers, an error
vdl 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.
These flags are set or reset at each 'ON execution" of an instruction. However, their setheset
state does not change in 'OFF execution" or a t an occurrence of error. Many instructions will
affect the flag state; be careful h e n programming.

- 101 -
5. APPLIED INSTRUCTIONS

a
5.2.1 CONDITIONAL JUMP

CJ FNC 00 Objectdevices : Pointers PO to P63(indexmodificationallowed).


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

CJ 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 followingexample, the sequence jumps from step 1 to step 36 (the step following the labelP8)
vhen X0 is ON. If X0 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 notchange even if t h e contacts do.

11

15

I8

22

25

29
Label
P8
36

40 Note: Y l is a double-coil designation. Its operation is con-


Lebd trolled according to the ON/OFF state of XI. That is,
P9 it is conzYolled b y X I if )43 is OFF and byX12 i f X I is
43 0N.
w'th one coil inside
The designation of a double coil
the jump routine andthe other coil outsidethe jump
routine is not alloned.
If a reset instruction for a retentive timer or counter
isdesignatedinside the jumproutine, the reset
(resetting of contacts or clearing of current value) is
still effective i f a timer or a counter coil step is
skipped.

- 102 -
5 . APPLIED INSTRUCTIONS

JUMPING AND MASTER CONTROL AREA

CJ Po 1 (11 Jumping acrossmastercontrol area (from before

(2) Jumping from outside the master control area to


inside the master controlarea :
Jumping is made independentof the operation
of the master control. After P1, Mo is regarded
to be 'ON" even if MO is 'OFF".

1
Master
control
(3)Jumping within master control area :
Jump is notpossible if MO is OFF,

(4) Jumping from within the master control area to


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

I Po
I

Mestar
contrd (5) Jump from nithin the
master control area to
another master control
area : I

M a r
control
Jump is possible if M1 is ON. The circuits follovcing the
jump operate assuming M2 is ON regardless ofthe ac-
I MCR, NO
I tual ON/OFF state of M2. The first " C R N0"is ignored.

i
- 104-
~
5. APPLIED INSTRUCTIONS,

CALL FNC 01 Objectdevices : Pointers PO to P62(index modificationallowed).


(PI (16) Number of steps : CALL endCALL(P) ......3 steps
Subroutine Cell Label P a * ......................
1 step
Nesting : Blevels

I Subroutine
SRET Return
FNC O2 I Object
devices
Number of steps
: None
: 1 step

x 0 The CALL instruction causes a jump to P10 h e n X0 is ON.


1 LCALL~P
0

100 IO]
The subroutine program is executed. After t h e 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).
0 Label numbers should range from PO to P62. Do not use
the same label for more than once even if the label is used
with a C J instruction. Thesame numbercan be used
Subroutine howver, for the operand of many CALL instructions.
program

The CALL(P1 P11 "instruction executes a jump to labelP11


only once h e n X1 changes from OFF to ON.
If a CALL instructiontocallsubroutineprogram P12 is
executed while P11 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-
routine program Pll. The program step returnsto the main
program after the execution of an SRET instruction (1).

py
Note: A total o f 4 nesbng levels can be programmed inside
a subprogram called by a CALL instruction.
In a subroutine or an interruptionsubroutine, use
timers in the range of T192 to T199end T246to T249.
Label
p12

-105-
5. APPLIED INSTRUCTIONS

5.2.3 INTERRUPTS

1 IRET
I
Number
h t e r r u p t ~ ~
Object
devices
~ ~ of steps
: None
: 1 step
~~ ___

El FNC 04 Object
devices : None
hterrupt Enable Number of steps : 1 step

Dl FNC 05 Object
devices : None
Interrupt Diseble Number of steps : 1 step

Note: An interruptpointer (I"**)uses I step. Up to 9points can be designated.


See Section 4.4.1 for the procedure used to assign interruptpointers.
Multiple interruption is a l l o w d for up to 2points.
Interrupt signals must be ofpulse
rcidth wider than 500psec.

The PC is usually in the interrupt disabled state.


If X0 and X1 are turned ON while a program stepranging
from instruction E l to instruction Dl is being executed,
interrupt routines (1) and (2)are executed respectively.
The program sequencereturnstothe main program
when an IRET instruction is executed in each interrupt
Interruption
enabled routine.
range
An interruptroutine w i l l notbeexecuted if thecor-
responding special auxiliary relay is activated. For ex-
ample, interrupt routine IA** w i l l not be executed if relay
M805A is activated.
In the program shorn on the left, interrupt routine 1001
is not executed when X0 changes from OFF to ON if X10
stays ON.

While an interruptprogram is executed, other interrupt


callsaredisabled.However, 2 levels of interrupt
programs may be nested by programming instruct E l
and Dl within the interrupt program.

In a subroutine or an interrupt subroutine, use timers in


the range of T192 to T199.

Note: If more than one interruptoccurs sequentially,


priority is givento the interrupt occurring first. If
twa or more interrupt events occur simultaneous-
ly, the interrupt subroutine w'th a I o w r pointer
number is given priority,
If an interrupt occurs in an interrupt disabled
range (Dl to El range), the occurrence is stored
and is executedafter the El insbuction is ex-
ecuted (unless special relay M805A is activated).

- 106-
5. APPLIED INSTRUCTION,S,, L-

5.2.4 MAIN PROGRAM END

FEND FNC 06 Object


devices : None
First End Number of steps : 1 step

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

Main routine progrsm Main routine program

'h IP 2 0 h

u
CJ
f X 1 0 = OFF I

I Main routice progrem


Main routine program

u
{- FEND
FEND

P 20 Subroutine program
Main routine program

FEND I L
Interrupt routine
program t
END END

Write labels for CALL or CALL(P1 instructions in the steps followhg t h e FEND instruction. The
subroutine program called by a CALL or CALL(P) instruction must always end with an SRET
instruction.
Similarly, an interrupt pointershould be witten after the FEND instruction. The interrupt program
must end with an RET instruction.
A program will be regarded as an error if the FEND instruction is executed afte'r the CALL or
CALL(P1instruction 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 witten between t h e
final FEND instruction and t h e END instruction.

- 107 -

-
5. APPLIED INSTRUCTIONS

H H

w
A p r o q s o o f 120 program
60msrc
msbc cycle time I ' ' I

Forexample,split a 120
.mseccycletimeprogram
program into tva programs (each 60
msec)anddesignate a
WDT instructionbetween
I END I these tva 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.

He000
HOV K 150 08000

In addition to the example shown above, the WDT instruction is used for the folloving purposes:
1) It can be designated after a label if t h e 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.

- 108-
5. APPLIED INSTRUCTIONS

5.2.6 REPEAT

FOR FNC 08 Objectdevices :


(16)
start of Repeat I - s -.
Range IK.HIKnXIKnYjKnHIKnS1 T I C I 0 IV.Zl
Number of steps : 3 steps
Nesting : 5 levels
~ ~~~~

NEXT FNC09
End of Repeat Number of steps : 1 step
Range

The processes within in a FOR-NEXT loop is repeated 71" times (designated by 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 by 1 and the FOR-NEXT loop is
executed once.

Program (C)is repeated four times and then the steps


following the 3rd NEXT instruction step are executed.
Program (B) is repeated sixtimes eachtime program (C)
\ is executed if the data in data register D OZ is "6".
Therefore, program (8)will be executed 24 times.
Use the C J instruction (X10 = ON) to skipthe FOR-NEXT
loop program (A).

If X10 is OFF and t h e contents ofK1XO are 7",


program
(A) is executed seven times while program (B) is ex-
ecuted once. This means that program (A) isrepeated
168 times ( 4 x 6 x 7) in total.
P 22 A maximum of 5 FOR-NEXT loops may benested.

Note: An error w71 occur in the folloning cases :


- If a NEXTinsbuction is designated preceding a
FOR instruction.
- If there is no NEXTinstruction.
- If a NEXTinstrucb'on is designated after an
FEND or END inspuction.
- If the number of NEXTinstructions does not
agree with the number of FOR instructions.

-109-
5. APPLIED INSTRUCTIONS

53.1 COMPARE

Compare

I Number of steps : CMP and CMP(P) ...........


(DICMP and (D)CMP(P)
7 steps
_.........13 steps

The data of source [Sl.1 and [S2. I are com-


[Si -3 [S2 -3 [D *] paredanddestination [D.1 operatesac-
0
L;t CMP K 100 C 20 M 0
cording to the result ofthis comparison.

Source data is compared algebraically


H O (-10 < 2, for example).
+bONifKlOO>Rssentdm~ofC20 All source
data isregarded as binarydata.
M i
4 ON if KlOO = Rsbem data of C20
M 2
;-I k,ON if K1OO < Prosant data of C20

t
MO,M1, and M2 M n uncha& if the CMP
insbuction is exeatd with X 0 = OFF.

Ref: A CMP applied instruction uses three operands. I f only one or tw operands are desig-
nated, an error occurs (error code :65031, precluding PC operation.
I f a device other thanthose listed above is designated as an operand, an erroroccurs (error
code :67051. If device X D, T, or Cis used as a destination, for example, an error occurs.
I f the device number that designated as an operand exceeds the allowable range, an error
occurs (error code :67061
Note :It may occur ifan index modifier is used.
I f an erroroccurs dueto incorrect operand designation as stated above, see Sections6.1.7
and 6.1.8.

-110-
........

5. APPLIED INSTRUCTIONS . ......

53.2 ZONE COMPARE

ZCP FNC 11
(P) (16/32)
Zone Compare

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


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

[Sl.] Cs2-J [s .J [o .I A ZCP instruction is used to compare the data


with two source data values.

Data from source [ S l . 1 must not begreater


+ ONifKlOO > Presentdataof C30 than that from source [S2.1.
M 4
4+ ONifKlOO sResentdataof C30 sK120 For example, if [ S l . 1 = K100

+ ONifRessntdstaofC30> K l 2 O
[S2* 1 = K90,
the ZCP instruction is execu-
ted assuming IS2.1 = K100.
Source data is compared algebraically
M3, M 4 , and M5 remain unchanged if the ZCP (-10 c 2, for example).
instNctiDn is executed with X 0 = OFF.

Note: M3, M4, or M 5 i s turned ON according to the comparison result.

-111 -
5. APPLIED INSTRUCTIONS

5.3.3 MOVE

MOV FNC 12
(PI (16/32)
Objectdevices :
r 4 -s 4
I v. z 1
Mo ve
[K. H lKnX lKnY IKnMIKnS I T I C I D

-
0 -I+
Number of steps : MOV and MOV(P)........... 5 steps
(D)MOV and (D)MOWP) ........... 9 steps

MOV KlOO D 10 (K100) + (Dl01 The


source datamoved
is the
to
destination.

The data in the source device ismoved to the designateddestination. If X0 = OFF, the data
remains unchanged.
Constant K 1 0 0 is automatically converted into binary data *en the MOV instruction is executed.

-112-
5. APPLIED INSTRUCTIONS

5.3.4 BINARY
CODED TO DECIMAL

BCD
FNC 18 Object
devices :
(P)(1 6/32) 7 s
Binary Coded To
Decimal IYHfKnXIKnYIKnMIKnSI T I C 1 0 IV.Zj

Number of steps : BCDand BCD(P)... .......... 5 steps


(DIBCD and (D)BCD(P), .......... 9 steps

Ls -1 1' '1 Binary data in sourcedevice is converted to


BCD data and moved to the destination device.
BCD D 12 K2Y 0
I I I I 1

If the result of BCD conversion executed b y a BCD or BCD(P) instruction is outside the range of
'
0 to 9,999: an error occurs.
If t h e 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 P C to be output in a seven segment
display, for example.
5.3.5 BINARY

19
FNC
BIN Objectdevices :
(P) (16/32)
t-----------cs - *
Bin 81 y YHIKnXIKnYIKnHIKnSI T I C I 0 IV,Z]
-
0
Number of steps : BIN and BIN(P) ..........................
5 steps
(D)BIN and (D)BIN(P) ...............
9 steps
Range : 0 to 9,999
or 0 to 99,999,999

cs [' *' BCD data in sourcedevice is converted to binarydataand


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 datais not BCD, an operation error occursto set M8067 ON. In this case, however,
M8068 (operation error latch) is not set ON.
C o n s t a n t s K are not processed as object devices of this instruction because they are automat-
ically converted to binary data before any processing.

-113-
5. APPLIED INSTRUCTIONS

5.4.1 ADDITION

s[-h J
~~ ~

ADD FNC 20 Object devices : 1* [s2


(P) (16/32)
Addition [K. H l K n X l K n Y ( K n H I K n S I T I C I 0 IV. 21

+c-o 41-
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)

[SI -1 [S2 -1 [D e]

ADD D 10 D 12 D 14 (Dl01 + (Dl21 + (Dl41

The binary data in tvlro designatedsourcedevices are addedand movedto the designated
each piece of data is used as the sign bit (positive
destination device. The most significant bit in
when '0" and negative when "1 7 . The data is added algebraically such as :
(5 + (-8) = -3)
If t h e result of operation is TI", 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 borrow flag is set. See the following page.
In a 32-bit operation, t h e 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, t h e result ofthe addition will change with every operation cycle if a continuous execution
instruction (ADD, (DIADD) is used.

When a program such as t h a t indicated above is witten, "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(P) instruction is
executed. The differences are t h a t with the ADD instruction, the zero, borrow, or carry flag is set
according to the process result.

- 114-
5. APPLIED INSTRUCTIONS

5.4.2 SUBTRACTION

21
FNC
SUB
(P) ( 16/32)
Object
devices : t = [ s 1 J [s2
* . ] p i

Subtraction [K.HIKnXlKnYIKnHIKnSI T I C 1 0 1V,Z]


b-k
Number of steps : SUBandSUB(P) ............ 7 steps
(DISUB and (D)SUB(P) ............13 staps
Flags : M8020
(zero),
M8021(borrow),
and
M8022 (carry)

[si -3 [s2 *3 [o
(Dl01 - (D12)+ (D14)
a 3

SUB D 10 D 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 by [D. I .
Example : 5 - (-8) = 13
The function of each flag, the device designation method for 32-bit operation, the difference
between continuous execution andpulse execution instructions, etc. are the same as explained
for the ADD instruction in Section 5.4.1.

I I I
I I J

The operation indicated above is very similar to the operation executed by 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 b e w e n flag setting and positivehegative numbers
are shown below.

-
Zero flag Zero flag Zero flag

- 2, - 1 . 0,n nn n.0,1
\
-32.768 32. 767
U !
Borrow flag

TbMSBinthe
dsta is -1".
( The MSB in the
data is 3".
Carry flw

-115-
5. APPLIED INSTRUCTIONS

5.4.3 MULTIPLICATION

MUL
FNC
(PI (16/32)
22 Object
devices : s[ - t 1 .J s
[24
-].
Multiplication
1K,H(KnX(KnYlKnH(KnS] T I C I 0 lV,Zl

Only 2 is allowed for l b b i t operation


Number of steps : MUL and MUL(P) ...........
7 steps
...........
I

(D)MUL and (D)MUL(P) 13 steps

(1) 16-BITOPERATION

BIN BIN BIN

The product of the datain t h e designatedsourcedevicesisstored a t the designated


destination device as a 32-bitdata. The lower 16 bitsin the designated device andt h e upper
16 bits in the next device.
If DO = 8 and D2 = 9, in t h e 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 w i l l 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-BITOPERATION

[si.] .] BIN
I(OIWL( 1 1
[s2.] [o
BIN BIN
(Dl, DO) x (D3, D2) + (D7, D6,D5, D4)
D o o 2 o 4 1
32
bits
32
bits 64 bits

If a bit device is designated for the destination in a 32-bit operation, only the I o w r 32 bits
of the product are obtained. The upper32bits are discarded.Inthis case, conduct
operation after moving the data to a ward 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 w r d s 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. 1.

-116-
5. APPLIED INSTRUCTIONS . _..

5.4.4 DIVISION

DIV 23
FNC Objective
devices : sb[i- .] [sa.)-A
( P ) (16/32)
Division

Only 2 is allowed for l b b i t operation


Number of steps : DIVandDIV(P) ........................... 7 steps
(D)DIVand (D)DIV(P)................ 13 steps

(1) 16-BITOPERATION

[SI *
BIN
J [s2.] [D
BIN BIN
-3 Dividend
Divisor
BIN
Quotient Remainder

DIV D O 0 2 0 4 (DO) + (D2) + (D4) ..... (D5)


16bits bits
16 16bits
16bits

Division is executed by taking the data in the device designated as [Sl.1 as a dividend and
the data in the device designated as [S2.1 as a divisor. The quotient is stored in the device
designated as [D. 1 and the remainder in its succeeding device.
V cannot be designated for [D.I .
(2) 32-BITOPERATION

[SI.] Cs2.J [o .] Dividend Divisor


Quotient
Remainder
BIN BIN BIN BIN
(Dl, DO) + (D3, D2) + (05, D4) ..... (D7, D6)
32bits
bits
bits
32
bits
32
32

In this division process, the dividend is the data in t h e device designated by [Sl.1 and the
followingdeviceand the divisor is the data in the devicedesignated by [S2. 1 and its
succeeding device. The quotient and remainder are stored in 4 devices beginningwith the
device designated as [D. 1 as s h o r n above.
V and Z cannot be designated for [D. 1.

Ref.: If a divisor is lo: an operation error occurs and the instruction is not executed.
If a bit device is designated8s [D* I, a remainder is not obtained.
The most significant bitin quotient and remainder indicates the plus or minus sign.

-117-
5. APPLIED INSTRUCTIONS

5.4.5 INCREMENT AND DECREMENT

Object
devices :
(PI (16/32) (13 [ K. H [ KlnKXlnKY]nKHn S I T [ C I 0 [ V, 2)
Increment
-
0 - -. -
25
FNC
DEC
(PI (16/32) (17 Number of steps : INC,INC(P),DEC, and DEC(P) ............................... 3 steps
Decrement (D)INC, (D)INC(P), (D)DEC,and (D)DEC(P) -.......5 steps

In t h e example, the numerical value of the device designated


by ID. 1 increases by "1"each time X0 is turned ON.

Ifthe instruction is not a pulse instruction, addition occurs in


each operation cycle.
In 1 6 b i t operation, adding "1" to +32,767 changes the data
to -32,768. N o 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


by ID. 1 decreases by "1"each time X0 is turned ON.

If the instruction is not a pulse instruction, subtraction occurs


in each operation cycle.
In 16-bit operation, subtracting "1"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.

APPLICATION EXAMPLE
Thecurrentvaluestoredin
counters CO to C9 is converted
into BCD data and output to
K4YO.
I I
Z iscleared by theresetinput
x10.
Thepresentdatastoredin
counters CO to C 9 is output se-
quentially each time X1 1 is
turned ON.

I 1 I I I

-118-
5. APPLIED INSTRUCTIONS ,... 1,,

5.4.6 LOGICALAND LOGICAL SUM, ANDEXCLUSIVE OR

I -- - -

Logical AND

Logical multiplication operation is executed in


units of bits.

-
1 A 1 -1 oA1 =o
(D 10) A (0 12) (0 14)
1 A o = o oAo=o
Logical OK
Logical addition operation is executed in units
of bits.
1 v l = 1 O V l = 1
ovo=o 1 v o - 1

Exclusive OR operation is executed in units of


bits.
l + l= o O Y O -0
l-ttO=l OYl=l

"Exclusive N0R"operation is possible by combining t h e XOR instruction with FNC14 (CML).

-119-
5. APPLIED INSTRUCTIONS

EXPRESSION OF NEGATIVE NUMBERS AND THEIR ABSOLUTE VALUES (REFERENCE)

(D 10)=2 FX Series Programmable Controllers express


~OlOlOlololololololo(ololololllo] negativenumbersin the form of 2's comple-
ment as shornon the left.
(0 101-1 most
If the significant bit is '1: the number is
O ~ O ~ IOt s ~absolute
~ O ~ O ~ O ~ O ~ O ~ O ~ O ~ O ~ O ~ O ~negative. O ( O ~ value
l ] is obtainedusin€
the NEG (complementary) instruction.
(0 I O ) -0
~ o ~ o ~ o ~ o ~ o ~ o ~ o ~ o l o ~ o ~ o ~ o ~ o ) o ~ o ~ o ~

-
-
(0 10)=-1 (0 10)ti-1
~ 1 ~ 1 ~ 1 ~ 1 ~ 1 ~ 1 ~ 1 ~ 1 ~ 1~ ~o ~1 o~ l 1o ~~ 1o ~~ o1 l ~o 1J o~ ~1 o~ ~1 o ~~ o ~ o ~ o ~ o
(0 10)-2
-
(0 101 +1=2
~ 1 ~ 1 ~ 1 ~ 1 ~ 1 ~ 1 ~ 1 ~ 1 ~ 1 ~ 1 [~ o1 ~~ o1 ~~ o1 ~~ o1 ~
J 1o ~~ 0o ]~ -o ~ o ~ o ~ o ~ o ~ o ~

The tnaxknm absdute vdue is 32,767.

- 120-
5. APPLIED INSTRUCTIONS

5.4.7 SHIFT
(RIGHT/LEFT)
~~ ~~~

SFTR FNC 34 Objectdevices :


(PI (16) ( 7 7
Shift Right
[ x I I w I S I m
HD
Y
3-4- n2snis1024
SFTL
FNC 35
(P) (16) (77
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 tothe right (SFTR) or left (SFTL) for
an n l long bit device (n2 ZG 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

-3 -3 (1) M --
p;o
3-44 0 M o w
[D ni n2

I 1 I
[S
(2) M 744 4 M 344 0

--
.SfTRml X 0 M 0 K 16 K 4
(3)M 1144 8 - M 744 4

x 3lx
I I
2lx
I
ilx
1
01 'n2" -
bit stlift right
(4) M 1544 12

(5) X 3-X
M 1144 8
0 M 1544 12

Bit Shift Left

- 121 -
5. APPLIED INSTRUCTIONS

5.5.1 ZONE RESET

ZRST F N C 40 Object devices :


(P) (16) IK,HlKnXIKnYlKnHIKnSI T I C 1 0 Iv.z\
Zone Reset
HoI.J[o~.H
I X ( Y 1 M l S ) [Dl * 1 number s [D2.I number
Designate the same device.
f-coi .][I32 .J+
I I Number of steps : ZRST, ZRST(P) .......................... 5 steps

[Dl -3 [02 6 3

Bit devices M500 through M599 are batch reset.

[D 1 -1 [D2
Word devices C235 through C255 are batch reset.
(3”is witten and the contacts and coil imageare cleared)

For [Dl.1 and ID2.1, designate the same device. The device numbers must be [ D l . 1 number s
[D2.1 number.
If [ D l . 1 number > LD2.1 number, only t h e device designated b y [ D l .1 is reset.
Although the ZRST instruction is processedas a 1 &bitinstruction, 32-bit counters are designated
for [ D l . 1 and ID2.1.
Note: Combined designation of both a 16bit and 32-bit counter (for example, a 1 6 b i t counter for
I D 1. I and 32-bit counter for 102.1) is not a l l o w d .

f INSTRUCTIONSOTHER RESET \
A RST instruction is provided to reset devices individually.
An FNCl6 instruction (FMOV) is provided to block write KO. Using this instruction, it is pos-
sible to M i t e “0”to devices KnY, KnM, KnS, T, C, and D.

- 122-
5. APPLIED INSTRUCTIONS

5.5.2 DECODE
DECO
(PI (16)
Decode
FNC 41 Object
devices :
H s * H H s .H

n=I+
Number of steps : DECO, DECO(P) ........................ 7 steps

pi4 rDECO/Y 0 I H l O I K 3 1

x 2x i x 0
r o l l l l l
4 2 1
I' ,- If designated
destination
device [De1 is T,C, or D,
"nu must be 4 or less. Each bit of the destination
0 ( 0 ~ 0 ( 0 ~ 1 ~ 0 ~device
0 is~ controlled.
0

t
M 17M16H 15M 1 4 M 13H12H l l M 10
f
Asthsarmis'l + 2 =3","l"isw '1"issetforMlOif
for M13 wtich is thue places from M10. the source is dl '0"s.

5.5.3 ENCODE
ENCO FNC 42 Objectdevices :
(P) I161 H s - H
Encode

n-1-8
Number of steps : ENCO, ENCO(P) ............ 7 steps

H 17M 16M 15M 1 4 H 13H12H I I M 10


If designated source device [S. I is T, C, D, V, or
0 ~ 0 ~ 0 ~ 0 ~ 1
Z, ~#nu must
0 ~
be4 or0 less.~ If more
0
than one bit in
7 6 5 4 3 2 1 0
the designatedsourcedeviceis '1: only the
4 4 2 I,
highest position bit for which "1 is set becomes
~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 effective. ~ 0 ~ 0 ~ 0 ~ 0 ~ 0 ~ 1 ~ 1
MSB Dl0 LSB If all of the bit data in the designated
source
&muse the third position data in the source device is 'On, anerroroccurs.
is"l",vdwinDlOis3(1 + 2).
POINTS FOR DECODEIENCODE
If "n = On, processing is not executed.
If [De1, designated M h a decode instruction, or [S. 1, designated M h an encode instruc-
tion, is a bit device when 'n = 8: the number of points is 256 (28).
The designated instruction is not executed if t h e drive input is OFF, The currently active
decode output remains active even if the drive input is then turnedOFF.

-123-
5.

5.6.1 REFRESH

,.......
~ ~~

REF FNC 50 Object devices : ID1 X or Y assigned'0"in its lowest digit place : XO, X10, X20, e@.
(PI (16) (17 .............
K or H assigned with 8 number of multiple of 8.
Number of steps
n
: REF,REF(P) -.............................
5 steps Refresh

As described before, FX Series Programmable Controllers employ the input/output batch refresh
method in which the data at t h e input terminals are transferred to t h e input image memory before
beginning execution at step 0. Data is output to the output terminals via t h e latch memory from the
output image memory after the execution of t h e END instruction.
This instruction is used either to readthe latest inputinformation 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 ylO: such as
N o r YIO. The number ofpoints to be refreshedis a mulbple of"8: Designab*on ofnumbers
other than these causes an error.
There may be cases that REF a instrucb'on is required in astep in a FOR and NEXJloop and
a step b e m e n a label l l o w r number) and a CJinsrruction (higher number) loop.

(1) INPUTREFRESH

Only 8 points X10 to X17 are refreshed.


IfX10 to X17 have been ON approximately 10 msec (response delay time of filter) before
this instruction isexecuted, image memory XlOto X17 is turnedON h e n the REF instruction
is executed.
(2) OUTPUTREFRESH

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.

- 124-
5. APPLIED INSTRUCTIONS

5.6.2 REFRESH AND FILTER ADJUST

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

The image memoryof inputX0 to X7 is refreshed, takingthe input


filterconstant as 1 msecwhen X10 is ON. The input filter

+
constant is taken as 10 msec until this instructionis executed.

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

0 Generally, PCs are provided with a C-R filter of approximately 10 msec filtering time for inputs as
a measure for input contact chattering andnoise.
However, thisfilteris a disadvantageforhigh-speeddata input fromelectronicsolid-state
switches which do not inherit chattering noise.
FX Series PCs are provided with digital filters for inputs X0 to X7. Filtering time can be changed
b y 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 X10 is ON. However, an REFF(P)
instruction is executed only when X10 goes from ON to OFF.
This instruction is not executed when X10 is OFF and the filtering time of input filters for X0
through X10 is 10 msec. (values for input processing).

Ref.: The filtering time of input filters for these instructions are automatically set to 50psec if an
interruption pointer is used, if m to X 7 is used for high-speed counters or if an FNC56
instruction is used.

- 125-
5. APPLIED INSTRUCTIONS

5.6.3 SET BY HIGH SPEED COUNTER


HSCS
( 16/32)
FNC 53 Object devices :
is- +- I*
Set b y High
Speed Counter IK.HIKnXIKnY(KnHIKnSI T I c I D Iv,z\
1 I
~

LS2.1: C235 to C255


(high-speed
counter) x I Y I M 1 S

Number of steps : (D)HSCS ...................................... 13 steps

[Si.] Cs2.J [o .]
I
I(Dl HSCS
I I
KlOO
I
C235
I
Y 10
I
Y10 is set immediately when the current value of C235 changes, for example, from 99 to 100 or
101 to 100.
A highspeedcountercounts t h e number of statuschangesfrom ON to OFF of t h e 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 contactis activated immediately when the counter currentvalue reaches the
preset value.
Using an FNC53 instruction allows both setting and output to be executed in the interrupt mode.
The higher two digits of object output devices should be the same (FNC53, FNC54).

POINT
The instructions FNC53, FNC54 are executed by the interrupt method when a pulse arrives
a t t h e input terminal.
Therefore, the output contact Y10 is not activated ifthere is no input pulseeven when X10
is turned ON and the conditions ofthe comparison for which Y10 is set is true.

ExternalReset Mode Flag:

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

- 126-
5.6.4 RESET BY HIGH SPEED COUNTER
T
HSCR
FNC 54 devices
Object : r S 1 . ] - 4
( 16/32)
Reset b y High
Speed Counter
[SZ.] : C235 to C255
(high-speed counter)

For ID.],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 C235 changes, for example, from 199 to 200
or 201 to 200.
x 12

400

C255 arpxrt contact

C235 is reset immediately when the currentvalue of C235 reaches 400. The current value is reset
to 0 and the output contactis reset to the non-activated state.

- 127 -
5. APPLIED INSTRUCTIONS

5.7.1 INITIAL STATE

I I Number o f steps : IST .............. .................... 7 steps


p .J
I
p1-3 ~02.1
An instruction to automatically control t h e initial
IST X 20 S 20 S 40 states and special auxiliary relays ina step ladder.
E N o o
monitor

[ S a 1 : Designate the head input number of the operation mode input.


With the above example :
X20 : Manual
operation X24 : Cycle operation
X21 : Zero
return X25 : Zero return
start
X22 : Step
operation X26 : Automatic operation
start
X23 : One-cycle
operation X27 : stop
[ D l . 1 : 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 inhibit SO : Manual operation initial state
M8041 : Transfer
start S1 : Zero return
initial
state
M8042 : Start
pulse S2 : Automatic operation
initial state
M8047 : STL monitor enable
An IST instruction can only be used once.
For details concerning how to use this instruction, refer to Section 3.4.1.
States S f 0 through to S19 (used for zero return) can used as general-purpose states h e n the
IST instruction 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 t h a t any two of these inputs will not be
turned ON at t h e 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 (M8043) is not set, all outputs will be turned OFF.

- 128-
5. APPLIED INSTRUCTIONS

5.8.1 VOLUME READ

VRRD FNC 85 Object


devices :
(P) (18)
Lblume Read

I Number of steps : MIRD, VRRD(P) ......................... 5 steps

Cs *I Eo -3 Analogvalue read from volume number 0 is converted into


8-bit binary data and transmitted to DO.
V R R D K O D O
As an application example, data in DO can be used as a
timer setting.
This circuit provides an analog timer

#
Example using an anslog timer

- 129 -
5. APPLIED INSTRUCTIONS

ADD 5.4.1 20 HSCS 53 5.7.4 I SFTL 1 35 I 5.5.3 I


BCD 18 5.3.9 INC 5.4.5 24 I SFTR 1 34 I 5.5.3 1
I BIN I 19 I 5.3.10 I IRET 5.2.3 03 I SUB I 21 I 5.4.2 1
I CALL I 01 I 5.2.2 I IST 60 5.8.1 I SUM I 43 I 5.6.4 I
MOV 12 5.3.3 I WAND I 26 I 5.4.6 I
MU L 5.4.3 22 07 5.2.5

I I
WDT

DEC I 25 I 5.4.5 WO R 27 5.4.6

I DECO I 41 I 5.6.2 I WXO R 5.4.6 28

I Dl I 05 I 5.2.3 I I REFF I 51 I 5.7.2 I zc P 11 5.3.2


5.4.4 ZRST 40 5.6.1

5.2.3

5.6.3

FEND 5.2.4

I HSCR I 54 I 5.7.5 I

- 130-
n l 1
I
U
1 I (GENERAL HARDWARE AND INSTALLATION
I I

n t
1 2 I IBASIC SEQUENCE INSTRUCTIONS i

r
l
u t 1

DEVICE DETAILS
- 1 I

n l I
I 5 1 (APPLIEDINSTRUCTION

n
1 7
l
I IUSlNG SPECIAL UNITS EFFECTIVELY I
I

-131 -

. . ..
6. SPECIAL DEVICE AND INSTRUCTION LISTS

6.1.1 PC STATUS (M8OOO TO M8009. D8000 TO D8009)

+
Initialsetting : 100 msec(Initial
R O M data is set when the power
to the PC is turned ON.)
Can be changed in increments of
1 msec.
M8001 ( 5 ) D8001 ( 5 ) BCD convev
PC time and sion data
svstem version FX1 i V1.02
M8002 ( 5) D8002 ( 5 ) 0002 ..... 2K steps
Initial pulse Memory capacity

RAMIEPROMIEEPROM
pulse
Initial ,+ time
Scan Memory type Built-inlcassette
NC contact Memory protect sHitchONIOFF
M8004 ( 5 ) ON h e n M8060
andlor
M8067
is
Error
occurrence ON. Error M number

8060 to 8068 (M8004 ON)


M8005 ( 5) O N w h e nb a t t e r yv o l t a g ei s D8005 ( 5 )
Low battery abnormally low. Battery voltage
voltage 2urrent battery volt- (in
age (Example: 3.6 V)
Of

M8006 ( 5 ) O N s t a t er e t a i n e da f t e rl o w D8006 ( 5 ) Initial value : 3.0 V


Low battery battery voltage is detected. Low battery (System R O M data is used when
voltage latch detection level thepowertothe PC isturned
ON.)
M8007 ( 5 ) See the diagram below. D8007 ( 5 ) Storesthenumberoftimes
The PC b i l l continue operating if Momenmry power M8007 is setON. The stored data
Momentary power
failure detected M8007 is ON for less time than . failure isclearedwhenthepoweris
D8008. occurrence times turned OFF.
M8008 ( 5) See the diagram below. D8008 ( 5 ) I n i t i a ls e t t i n g : 10 m s e c( 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
thepowerto the PC isturned
ON.) See the diagram below.
M8009 ( 5) Set if there is a shut-down of D m 9 (5) The lowest input device number
24V DC OFF circuits i n the extension's 24VDC . 24VDC OFF unit of a unitor block affected b y the
supply. number s h u t - d o w n o f the24VDCis
stored.
AC power
Ref.: Do not drive devicesmarked w?h
M8000 RUN
I
Y § 1 b y user's programs.
D dataisexpressed as adecimal
M8007 h e n monitored unless otherw*se in-
Momentarypowerfailure I dicated.
M8008 I
Power failure Power failure
!~-8-
0I
0 8 detectionperiod
10 msec
When the p o w r supply used is an AC 200 V system, the p o w r d o mdetect period determined
by the value in D8008 can be altered by the program in the range of 10 to 1 0 0 msec.

- 132 -
6. SPECIAL DEVICE AND INSTRUCTION LtSTS

6.1.2 CLOCK(M8010TOM8019,D8010TOD8019)

M8010 Dm10 (5) Current operation cycle


Present scan data time (in units of 0.1 msec)
M8011 ( 5 ) Oscillates in 10 msec D8011 (5) Minimum s c a nt i m e (in
10 msec clock cycles. Minimum scan time units of 0.1 msec)
M8012 ( 5 ) Oscillates in 100 msec D8012 ( 5 ) Maximum scan time' (in
100 msec clock cycles. units of 0.1 msec) hbximum scan time
M8013 ( 5 ) Oscillates in 1 sec cycles. ~8013
1 sac clock
M8014 ( 5 ) Oscillates in 1 min cycles. D8014
1 min clock
M8015 D8015
I I I I I
M8016 D8016

1
I
M8017 08017
I I
M8018 D8018

M8019
I 08019

*: Waiting time for constant scan t h e n M3089 is set ON


is not included.

6.1.3 RAGW2
0 TO M8
029
,D8020 TO D8029)

addition/rubtrection is 'D".

M8025 External reset HSC mode Dm25


I

'
Dm26

M8028

V register data

5 :Do not drive device markedvith "(5)" b y user's programs.

-133-
6. SPECIAL DEVICE AND INSTRUCTION LISTS

6.1.4 PC MODE (M8030 TO M8039, D8030 TO D8039)

D8031

I
08033

DE035

-
08036

-
Dm37

-
M8038 D8038

-
1: M relays marked with an asterisk are turned OFF when the PC operation status is changed
from RUN to STOP.
2: The PC is set to RUN h e n M8035 or M8036 is forcibly turned ON by the programming panel
even if the RUN input is OFF.
The PC stops running if M8037 is forcibly set O F F while the PC is running.

- 134-
6. SPECIAL DEVICE AND, INSTRUCTION LISTS

n u m b e r( s t a t e s SO t o
S899) is stored in D8040.
ON state number 2 Oat hcse
ttia
rv tee
n u m b e r sa r es t o r e d in
ascendingorder(upto 8

ON state number 6

1
O N i f any one of SO to
S899 i s ON while ME047 is
ON. t
effective
when
ME047 is ON state
number 8
I
I

Minimum ON state
annunciator
sUte
number

*: M relays marked with an asterisk are turned OFF when the PC operation status is changed from
RUN to STOP.
All registers concerning STL states are updated when the END instruction is executed.

6.1.6 INTERRUPTION DISABLED (M8050 TO M8059, D8050 TO D8059)

5: Do not drive devices marked hth "(9.


b y user's programs.

- 135-
6. SPECIAL DEVICE AND INSTRUCTION LISTS

6.1.7 ERROR DmCTlON (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.

See

Parameter error Error code number of the parameter Code


M8064 ( * ) Table
Flash STOP . D8064
error
M8065 ( 5 ) Syntax error
D8065 Flash (5) Error code number ofthe syntaxerror
M8066 (5) Circuit error
D8066
Operation error
Flash - - (5)
D8067 ( 5 )
Error code number ofthe circuiterror
Error code number of the operation
M8067 ( 5 ) OFF
03 *3 error
m::::i::,::
....................................... number (latched) of the
r n $ Operation error latch
@i<l:i:X~~::::~i:::::::i:

.
7...x...m
....m.....m....E. m .:..
check
I/O bus '2 M8067 to M8065
errors of number
g jm
...(x......... j$
:.................
.... ................
,:::.:.:+:.:.:.: *3

0: Do not drive devices marked w*th "(0)" by user's programs.


1: If the unit or block corresponding to a programmed 1/0 number is not actually loaded, M8060
is set ON andthe first devicenumber is written to
08060. loaded notExample : X20 is
'2 : An I/O bus check is executed when M8069 is turned
ON. If an error occurs, error code 6103 is written and
M8061 is turned ON.

T
'3 : Theseare OFF when the PC operating status is 7Device .number :
1 0 t o 177
changed from STOP to RUN.
1 : Input X
0 : Ournut Y
TIMING OF ERROR CHECKS

I M8060 110 confiouretion


error I Checked I Checked I While in RUN I
I M8061 PC hardware
error I Checked I - While i n RUN

M8062 P C P P communication
error
- - When a signal from PP
is received.
I I I

When program is
M8064 Parameter
error
changed (STOP)
M8065
Syntax
error Checked Checked
When program is
M8066
Circuit
error

1
transferred (STOP)

I M8067
M8068
Operation
Error
oneration
Error
Latch 1 - 1 - When in the RUN state 1

Note : 'PP" = Programmingpanel.

- 136-
6. SPECIAL DEVICE AND INBTRUCTION.LlSTS

6.1.8 ERROR CODES


ERROR CODE 1

R A M error whether Check . . the


e x t e n s i o nc a b l e as r e
6102 Operation circuit error connected properly.
6103 I/O bus error (when M8069 is ON)
Dm62 oo00 No error
PClPP 6201 Parity error
communication Overrun error
anor C h ewchke t thheer
Framing error programmingpanel (PPI
6202 Communication character error a n dt h ep r o g r a m m a b l e
c o n t r o l(lPeaC
rr e)
Communication data sum check error 6203 connected properly.
6204 Data format error
Command error 6205
D8064 N o error
Parameter error 6401 Program sum check error ~~

6402 Memory capacity setting error


6403 Keep area setting error StopthePC,selectthe
parameter mode, and set
6404 Comment area setting error ~
the correct data.
6405 File reaister are setting error
~~

6409 Other setcing error


Dm65 oo00 N o error
Syntax error 6501 Incorrect instruction/device symbol/device number
combination.
6502 N o O U T or OUTC prior to setting value.
6503 1) N o setting value following OUlT or OUTC. D u r i n pg r o g r a m m i n g ,
2) Insufficient number of operands for an applied e ai cn hs t r u c t i o n is
instruction. checked. If a syntnx error
is detected, correct the
6504 1) The same label number is used more than once. i n s ttrhueci nt i o n
2) The same interrupt input or high-speed counter programming ,,,ode.
input is used more than once.
6505 Device number is outside the allowable range.

6509 O U w r error

- 137 -
6. SPECIAL DEVICE AND INSTRUCTION LISTS

ERROR CODE 2

08066
Circuit error I
~~~ ~~

6601 LD or LDI is used 9 or more times continuously.


6602 I 1) No LDorLDIinstruction.Illegal use of LDlLDland
ANBIORB.
2) The following instructions are not connected to the
bus line :
STL. RET, MCR, P (pointer), I (interrupt), El, Dl,
SRET, IRET, FOR, NEXT, FEND, and END

MPS is used 12 or more times continuouslv. A circuit error occurs


6604 Illegal
use of MPSlMRD
and MPP. if a combination of
6605 1) STL is used 9 ormoretimescontinuously.
i n s t r uicst i o n s
2) MC, MCR, or I (interrupt) is designated within STL. incorrect when the
3) RET is designated outside STL or not designated entire circuit block is
at all. c h e c k e d o r if the
6606 1) No P (pointer) or I (interrupt) relationship between
2) No SRET or RET. paired instructions is
3) I (interrupt), SRET, or IRE1 is designated within a
main program. incorrect.
4) STL, RET, MC, or MCR is designated in a subroutine Selectprogramming
or interrupt routine. modeandcorrect
6607 1) Illegal FOR-NEXT relationship. 6 ormorelevelare t h e instructions.
-
nested.
2) The followina instructions are desianated i n the
FOR-NEXT 100p :
STL, RET, MC, MCR, IRET, SRET, FEND,and END
6608 I 1) llleaal MC-MCR relationshiD.

II 2) NO-MCR NO.
3) SRET, IRET. or I (interrupt) is desienated between
MC and MCR blocks.

- 138-
6. SPECIAL DEVICE AND lNSTR,U,CTlONLISTS

ERROR CODE 3

....
the execution of a n opera-

:::;
Execution error 6701 1) N o jump destination for CJ or CALL.
2) A label is designated in a block that comes after the
END instruction. " , o ~ p ~ ~ ~ ~
c h a n gt ehme o dt eo
3) An independent label is designated Hithin the
programming,andcorrect
FOR-NEXT loop or in a subroutine.
. -
t h e Droaram.
6702 6 or more CALL levels are nested. An executionerroroccurs
even when a syntax or cir-
cuiterrordoesnotoccur.
An example of this is given
6705 A device is used for an applied instruction operand below.
that is not the object device for that applied instruction. Example :
6706 The device range or data range designated as an D500Z does not cause an
applied instruction operand is outside the allowable error. Howwar, if value 2,
range. obtained as the result of
6707 Afile register is accessed without setting a file register. '. operation, io loo a=100),
r D m 2 becomes DaOO ex-
ceeding the allowsbla num
6709 Other (no [RET or SRET, illegal relationship between ber range; this will cause an
FOR-NEXT, etc.) error.

RELATIONSHIPS OF ERROR RELATED SPECIAL M'S AND SPECIAL D'S

M8069 -
DE009
DE060

D8061
-
-. ME009
M8060
D8004
+ME061 error
24V DC failure
It0 configuration
PC hardware
error -
I/O bus DE062 -. ME062 PC/PP communication
error
Special M num- Turned ON
check ber involved i f an arror
with error occur-

-
rence (lowsr
M8064 Paremeter error -1 number)

-
-. ME065 Syntax error

-
DE066 M8066
Error code
~8067 be can M8067
found by
monitoring
the con-
tents of D.

-139-
6. SPECIAL DEVICE AND. INSTRUCTION LISTS

6.2.1 SEQUENCE AND STEPLADDERINSTRUCTION

LD
X Y . M. S, T, 1 1
i C, Special M
The same as
LDI 1 1
above
The same as
AND 1 1
Contact above

'::
Instruc- The same as 0 UT
tion ANI above 1 1 T-K, D 3 156

I OR I
I
The same as
above
I I
C-K, D
( 1 6 bits)
3
't
103

The same as
OR' above 1 1

output
nstruc-
I Y.M
tion

I ; D, V, Z, Special

I
~~

Step STL S 1 114+104n *1 PLF Y, M 2 157 145


Ladder
InStruc- RET None 1 118
tion
I I I 1 I I

p 0 to 63 1 1
Label
I o *.to 2" 1 1

1: 7-1" indicates the number of continuous STL instructions (number of parallel/merge instruc-
tions).
2: In the STL circuit block, 152+54n(s) for turning ON and 68(s) for turning OFF.
h"indicates the number of continuous STL instructions (number of parallel/merge instruc-
tions).
3: Execution time is 45msec longer when an in direct designation (T-D, C-D) is used.
t h e turning ON time becomes the same as the turning OFF
After counting up (time or count),
time.

- 141 -
6. SPECIAL DEVICE AND INSTRUCTION LISTS

6.2.2 PROGRAM FLOW

ditional jump
P 6 3 is equivalentto
.............. 143 75 END

......... CONDITIONAL JUMP


ubroutine call
NIA Nesting level : Up to 5
,.*&$
..................
..(.
.:.l.. 75 155 levels
.....
::, .:.........
igw~iii
............. SUBROUTINE CALL ~ ~ ~~

Subroutine return
To be programmed

I
104 after FEND
NIA SUBROUTINE
RETURN

1-1
~ ~~ ~~~

Interrupt return
To be programmed
122 after FEND
INTERRUPT RETURRN
Interrupt enabled

t
m
136
I N'A I INTERRUPTENABLE
Interrupt disable
NIA
67
I NIA I INTERRUPT
DISABLE I
Main program end

Watchdog timer refresh

Start of repeat range


Nesting level : Up to 5
133 levels

I-[ NEXT
85
End of repeat range

Theseinstructionsaredriven
1 directlywithoutusingany con-
tacts.
N/A : Not Available.

- 142 -
6. SPECIAL DEVICE AND lN.S,TRUCTlONLISTS

6.2.3 MOVE, COMPARE,ANDOTHERINSTRUCTIONS

- 3
Zone comparison
fS1.1 to 152.1 [S.]
(D.1

111

Shih
m 2d i g i t sf r o m the m l
33.3 position are moved to the
nth place.
m l . m2. n = 1 to 4

conversion
BCD96

BCD
IS.1
BIN
-(D.1
113 16/32 4/8 digits,
posi-
number
tlve
bits
BIN conversion
96 [S-I -. ID.1
- BCD
4/8
BIN
bits
16/32
113
;

- 143-
6. SPECIAL DEVICE AND INSTRUCTION LISTS

6.2.4 ARITHMETICAL AND LOGICAL


OPERATIONS
2 : M8020 Br : M8021 CY : M8022 F : M8029

N16) 650
-[Del + 1 [D.]
MULTIPLICATION
BINARY 113 (32) 1380

(16) 1500
___ division
BIN
[Sl.l+[S2.1-[D.I ...[D.] +1
DIV Dividend Quotient
113 '321 2710

-
DIVISION BINARY Divisor Reminder

.. ... BIN increment


96 ID.] + 1 tD.1

The destination variesin each opera- w2 - t-- wi-------$


kw4+w31---
tion cycleif a continuousexecution

k W 4 V 3 k +wi---+
instruction is used.Take note of this [K.HIKnXlKnYlKnnlKnSI 1 I C I 0 iV.21
h e n using these instructions. w2-

- 144-
6. SPECIAL DEVICE AND INSTRUCTION LISTS

6.2.5 ROTATION SHIFT

I I I Bit n2 right shift

I
n2=4 instruction for bit n l

t t
NiA

SHIFT RIGHT
*19
+153nl I 91 I
I
[::;'isthe n2bit
device. n 2 s n l s 1 0 2 4
I Bit n2 left shift
n2 = 4
802 89 I ID.].
instruction for bit n l

SHIFT LEFT I d e i c e .n 2 L n 1 5 1 0 2 4

- 145-
8'8Z S'SZ 1
-
3(3033(-~ .............
8'8Z 8't 11
SlSll N0113~tllSNIQNW 331A3Q lW133dS '9
6. SPECIAL DEVICE AND INSTRUCTION LISTS

6.2.7 HIGH-SPEED PROCESSING


Can only be used once

___$ Note: The combination o f F-- W I +


I I
+
X l Y l M l S ] must instructions not lKnHlKnSl T
exceedthese /K.HIKnXIKnY C 0 IV.Z]
W 4 ' W3'
1 k- a'+ 6pts. d e n theyare
driven ON simul-
w2-
w
i '_f
taneously.

- 147 -
-8pL -
. . ._
oaeruolnv : [.za] 01 [.tal
uopeu8!sopopow : [.SI
SlSll N0113n~lSNIaNW 331A3a lW133dS '9
,. ,

6. SPECIAL DEVICE AND INSTRUCTION LISTS

6.2.9 EXTERNAL FX SERIAL DEVICES

H I

I I-

I I
Volume read
T hvea l u e o f volume
371 91 number IS.] =O to 7 is read
to ID.1 i n &bit binary.

-149-
6 . SPECIAL DEVICE AND INSTRUCTION LISTS

INSTRUCTION EXECUTION TIME (REFERENCE)


CALCULATING OPERATION CYCLE TIME
(a) Basic operation cycle time :
The total executiontime of all instructions from step 0 to the END or FEND instruction
and 1/0 processing time. I/O processing time is 56 psec x number of blocks; each
block is in units of 8 I/O 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
1-phase, 2 kHz, 1 point n = Approx. 1.4
1-phase, 2 kHz, 2 points n = Approx. 2.0
TIME 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.
Instruction Execution Time When a MOV Instruction is Used :

modifier
Without index modifier
With index

Instruction Execution Time When (D) MOV Instruction is Used :

~~~~ ~~~

Without index modifier With index modifier

[ 1 : Values listed.
Note: If the designated device number ofthe bitdevice is n o t a multiple of8, the instruction
execution time w71 be slighdylonger.
Theexecutiontime of a pulseinstruction is thesame as theexecutiontime of a
continuous instruction.

- 150- 1
I t .
C . I

n t
I 2 I IBASIC SEQUENCE INSTRUCTIONS i
I

I
- I
4 I IDEVlCE DETAILS I
I

1 5 I 1 APPLIED INSTRUCTION
n r i

161 SPECIAL DEVICE AND INSTRUCTION LISTS

n t APPENDIX I
I I

- 151 -
7. USING SPECIAL UNITS EFFECTIVELY

7.1.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 when creating a program with a personal computer. In addition to this, the
following signals can be handled by the interface unit :
(1) SIGNALS

( a ) ON/OFF 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 on/off control of devices such as X, Y, M, S, and T.
(dl Rewiting present values of devices such as T, C, and D.
Signal transmission speed : 9600 bps
Requiredenvironment : Refer to the generalenvironmentalrequirementsdescribed
in Section 1.10.1.

PC program
cable connector
/

,)
Y
DIN rail (width : 35 rnm (1.38 in))
mounting recess

I Weight : Approx. 0.3 kg (0.00 Ib)

-152-
7. USING SPECIAL UNITS EFFECTIVELY

7.2.1 VOLUME ADAPTER


SPECIFICATIONS
The FX-8AV volume adapter is connected to the panel on the left sideof the base unit.
Eight miniature volumesare provided on this adapter. They can be adjusted witha screwdriver from
the front of the adapter.
(1) USE
The adapter is generally used
as an analog timer.It can also be usedin place of a rotary switch.
(2) SPECIFICATIONS
See Section 1.10.1 for the general environmental requirements.

DIN rail (Mdth : 35 mrn (1.38 in))


mounting recess

I’c

Weight : Approx. 0.3 kg (0.66 Ib)

- 153-
MEMO

- 154-
,, .

I 1 I IGENERAL HARDWAREANDINSTALLATION
1 2 I IBASlC SEQUENCE INSTRUCTIONS
u t J

U I I

I
U
5 I 1 APPLIED INSTRUCTION
I I

1 I 6
SPECIAL DEVICE AND INSTRUCTION LISTS

I 7 I IUSING SPECIAL UNITS EFFECTIVELY I

-155-
The FX2 Series PC has one RUN input terminal. When this terminal is ON, the PC is in t h e RUN state
and when it is OFF the PC is in t h e STOP state. This is the same as with the FI Series PC.
An F2 Series PC, in comparison to an FX2 Series PC, has both RUN and STOP input terminals. By
drivingtheseterminalsmomentarilywith a pushbutton switch, the RUN or STOP state can be
maintained.
With an FX2 Series PC, RUN/STOP control equivalent to that ofF2 series can be accomplished with
a special auxiliary relay. The general input s h o w below is usedas the STOP input.
(JAPANESE SPECIFICATION)

1 RUN STOP

x-7
A number can be
,+COMIRUN(X
I I I
selected as necessary
olx i I for an input terminal.
i Fx2Programmablecontroller i

p3
M8000 RUN monitor
NO35 Forced RUN mode

-036 Forced RUN


command

4 ti
RUN monitor M8000 is turned ON when t h e
RUN input pushbutton is pressedand spe-
cial 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 isexecuted after theSTOP
input (X11 turned ON. The PC stops.
Therefore, the RUN input is given priority when the RUN and STOP input pushbutton switches
are pressed a t the same time.
To give priority to the STOP input, interlock ~4tht h e external input circuit so that the RUN input
is turned OFF while the STOP pushbutton is pressed.
When a STOP input is given, M8035, M8036,
and M8037 are turned OFF.

I
I

- 156-
APPENDIX

The relationship b e t w e n an MC-MCR instruction and a C J instruction are detailed in Section 5.2.1.
The other program flow instructionsare explained below.
In the followingtables, the symbol " "indicates an 7nclusive"relationshipand the symbol
" "indicates cases where the zones overlap.

-&
row
7-Upper
row
Upper instruction
instruction
instructio
Left column Left column
instruction

MC-MCR CJ-P El-Dl FOR-NEXT STL-RET

a 0 e 0 a0 @O a 0
MC-MCR
W A W A w o X (6607) wX (6605)

l a0 l
a0 l a0 l a0 I@ 0 I

STL-RET

P-SR ET

- 157-
APPENDIX

0 : Combinations h i c h 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.
(1)

P-SRET I-IRET FEND-END Remarks

a 1 Enters a state as if Dl instruction is missing.

-
An error does not occur.

----=r-I=----,
2 FOR FOR NEXT
NEXT
Sequence i s controlled as indicated
b y the solid lines.
a 3 T h e first FEND or END instruction becomes
effective, precluding the expected program flow.

The combination of instructions that have an linclusive’


relationship is permissible Hlith some exceptions.
Note the following exceptions.
(1) MC-MCR cannot be used in blocks with FOR-NEXT,
P-SRET, or I-IRET.

(2) STL-RET cannot be used in blocks with FOR-NEXT,


P-SRET, or I-IRET.

(3) Program flow may not be discontinued while inside


blocks of MC-MCR, FOR-NEXT, P-SRET, or I-IRET
~4than I, IRET, SRET, FEND, or END instruction.

- 158-
REVISIONS
~~~ ~ ~ ~~

Edition Dade Manual Number Revision


SeP. '91 JY992D26301A First edition.

c
f-"

Under no circumstances w i l l Mtsubishi Electric be liable or responsible for any consequeneal damage that mayarise
as a result of the installation or use of this equipment.

A l l examples and diagrams shown in this manual


ere intended only as an aid to understanding the text, not to guarantee
operation. Mitsubishi Electric All accept no responsibility for actual use of the product based on these illustrative
examples.

Owing to the very great variety in possible applications of this equipment,


you must satisfy yourself as to its suitability
for your specific application.

f
A MfTSUBlSHl ELECTRIC AUTOMATION, INC.

JY992D26301A
HI-IB-073-A9204

You might also like