FX1 Hardware Programming Manual JY992D26301 A
FX1 Hardware Programming Manual JY992D26301 A
(Japanese Specification)
FOREWORD
CONTENTS
-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
-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.
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
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) AVAILABLEMODELS
-4-
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
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
-7-
1. GENERAL HARDWARE AND INSTALLATION
'GENERAL FORMAT
I I
Model
of series variations
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
(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
!
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 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
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
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
- 14-
1. GENERAL HARDWARE ,AND INSTALLATION
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.
- 15-
1. GENERAL HARDWARE AND INSTALLATION
- 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 :
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.
,k==
ON/OFF, the root mean square current should be less than 0.2 A.
Example :
4 y - , $A
Ref.:.Leakage current in SSR output circuits is greater than that of relay devices and can
cause miniature relaysto hold their operation.
- 18-
”, . , ,*.. .
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
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
-22-
I. GENERAL HARDWARE AND INSTALLATION
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
-25-
I.GENERAL HARDWARE AND INSTALLATION
-26-
1 GENERAL HARDWARE ANQ,.INSTALLATION
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-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)
KI
Extension block : I/O number label ( 1 set)
I’ Mounting holes
( 2 - 05.5 mm (0.27 i n ) )
M3.5 terminalscrem(wdth
rai
: 35 mm (1.38 in))
mounting slot
-27 -
1. GENERAL HARDWARE AND INSTALLATION
-28-
1. GENERAL HARDWARE AND INSTALLATION
-29-
.. __. .
I GENERAL HARDWARE AND INSTALLATION
I I I I
-30-
1 GENERAL HARDWARE ANQ,.INSTALLATION
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)
-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
-34-
2. BASIC SEQUENCE INSTRUCTIONS
1 1 .
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
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
I I
H HI
I 1
Output processing
Y3 = OFF, Y4 = ON
I 1 1
OFF ON ON OFF
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.
-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
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
. .
‘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
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
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.
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
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
(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.13.1 END
Input/output processing
END (End) Device: None 1
and returning to step 0
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
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 , , , ./
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-
(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
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.
-54-
I
3. STEP LADDER, INSTRUCTION,,S.
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
I
S30 0 The operation state changesto S30 when X4
x2 -- Lowerlimit
(small ball) or X5 (large ball) is turned ON.
-55-
. . __
3. STEP LADDER INSTRUCTIONS
Y2 : Green 3 : Red
Y1 : Yellow 4 : Green
YO : Red
-- 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.
Y-
s20
- Yll
XI x1I
s21 Af
Main bus line
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
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
STL S20
s20 OUT Y 0 - Drive
processing
LO x 0
SET S2i -Transfer tothe 1stbranchstate
In brancWmerge transfer
STL S 29
- 1
]
Outputprocesses
OUT Y 10 STL 29 Merge
transfer
from
1st
the
LD
SET
xS 50
lo branch
flow
STL S 49
STL
LD
SET
S49
X12
S 50
] Mergetransfer
branch
flow
from
the
3rd
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
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
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
x0 -- x1 --
&I 0 Programinthisway :
Branch
transfer
Merge
transfer
-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).
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
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
~~~ ~ ~~ ~
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.
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
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,
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
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.
~~~ ~~
<<<:x:;&#:;<:$
m~$$j Can
used
be
Can
used
be
Cannot used
be
Can
used
beCan
used
beCannot
used
be
- 67-
3. STEP LADDER INSTRUCTIONS
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.
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
-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:
Automatic
Operation
0 In these examples, "MO" is used as the head input for the instruction FNCGO (ET).
-69-
. . .
3. STEP LADDER INSTRUCTIONS
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
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
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.
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
Zero point
2
traverse Right
(1) Downward limit X3
motion
YO
(5) Downward motion (7) Upward motion
YO Y2
Lower limit
Xi
1 I
-.
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
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
Left traverse
I W
I I
AST YO Resetting
"down"
output J
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
-75-
4. DEVICEDETAILS
I
p+
----------- YO ++ , NC contact
-i
Output terminal
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 , . ,
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
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
-78-
4. DEVICE
DETAILS . ,_ .,,.
9- n
failure.
direction as fed before an occumence of a
power
Brake motor
-79-
....
4. DEVICE DETAILS
-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.
LS X1 and
State S901 is activated when both upper limit
lower limit LS X2 are OFF for more than two seconds.
Note: 0 For anANS instruction and an ANR(P) instruction, see Section 5.6.7 and 5.6.8.
-81 -
. .
4.
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
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
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
(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 . ..
'
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)
x10 n
x11
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
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
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
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
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.
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
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
I I I
~ ~~ ~~~ ~~
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:
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
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
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
Latch Memory
I I
Program Memory
RAM
EEPROM
EPROM
-96-
.-1 l__c-.__ ....... .,....,-.. .. -
I
DEVICE DETAILS I
I
I I
APPENDIX
-97-
5. APPLIED INSTRUCTIONS
.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
-98-
5. APPLIED INSTRUCTIONS
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.
-99-
5. APPLIED INSTRUCTIONS
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.
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.
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 )
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 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
- 102 -
5 . APPLIED INSTRUCTIONS
1
Master
control
(3)Jumping within master control area :
Jump is notpossible if MO is OFF,
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,
I Subroutine
SRET Return
FNC O2 I Object
devices
Number of steps
: None
: 1 step
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
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
- 106-
5. APPLIED INSTRUCTION,S,, L-
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.
'h IP 2 0 h
u
CJ
f X 1 0 = OFF I
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
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.
-109-
5. APPLIED INSTRUCTIONS
53.1 COMPARE
Compare
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-
........
ZCP FNC 11
(P) (16/32)
Zone Compare
-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
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
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
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
~~ ~
+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]
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
[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
(1) 16-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 :
-116-
5. APPLIED INSTRUCTIONS . _..
5.4.4 DIVISION
DIV 23
FNC Objective
devices : sb[i- .] [sa.)-A
( P ) (16/32)
Division
(1) 16-BITOPERATION
[SI *
BIN
J [s2.] [D
BIN BIN
-3 Dividend
Divisor
BIN
Quotient Remainder
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
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
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
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,,
I -- - -
Logical AND
-
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
-119-
5. APPLIED INSTRUCTIONS
-
-
(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 ~
- 120-
5. APPLIED INSTRUCTIONS
5.4.7 SHIFT
(RIGHT/LEFT)
~~ ~~~
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
- 121 -
5. APPLIED INSTRUCTIONS
[Dl -3 [02 6 3
[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
-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
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
+
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
[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.
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)
Y10 is reset immediately when the current value of C235 changes, for example, from 199 to 200
or 201 to 200.
x 12
400
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
- 128-
5. APPLIED INSTRUCTIONS
#
Example using an anslog timer
- 129 -
5. APPLIED INSTRUCTIONS
I I
WDT
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
+
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
- 132 -
6. SPECIAL DEVICE AND INSTRUCTION LtSTS
6.1.2 CLOCK(M8010TOM8019,D8010TOD8019)
1
I
M8017 08017
I I
M8018 D8018
M8019
I 08019
6.1.3 RAGW2
0 TO M8
029
,D8020 TO D8029)
addition/rubtrection is 'D".
'
Dm26
M8028
V register data
-133-
6. SPECIAL DEVICE AND INSTRUCTION LISTS
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.
- 135-
6. SPECIAL DEVICE AND INSTRUCTION LISTS
See
.
7...x...m
....m.....m....E. m .:..
check
I/O bus '2 M8067 to M8065
errors of number
g jm
...(x......... j$
:.................
.... ................
,:::.:.:+:.:.:.: *3
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
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
- 136-
6. SPECIAL DEVICE AND INBTRUCTION.LlSTS
6509 O U w r error
- 137 -
6. SPECIAL DEVICE AND INSTRUCTION LISTS
ERROR CODE 2
08066
Circuit error I
~~~ ~~
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.
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
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
~~
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
ditional jump
P 6 3 is equivalentto
.............. 143 75 END
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
I-[ NEXT
85
End of repeat range
Theseinstructionsaredriven
1 directlywithoutusingany con-
tacts.
N/A : Not Available.
- 142 -
6. SPECIAL DEVICE AND lN.S,TRUCTlONLISTS
- 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
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
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
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
- 147 -
-8pL -
. . ._
oaeruolnv : [.za] 01 [.tal
uopeu8!sopopow : [.SI
SlSll N0113n~lSNIaNW 331A3a lW133dS '9
,. ,
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
modifier
Without index modifier
With index
~~~~ ~~~
[ 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
n t APPENDIX I
I I
- 151 -
7. USING SPECIAL UNITS EFFECTIVELY
PC program
cable connector
/
,)
Y
DIN rail (width : 35 rnm (1.38 in))
mounting recess
-152-
7. USING SPECIAL UNITS EFFECTIVELY
I’c
- 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
-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
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
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
-
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.
- 158-
REVISIONS
~~~ ~ ~ ~~
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.
f
A MfTSUBlSHl ELECTRIC AUTOMATION, INC.
JY992D26301A
HI-IB-073-A9204