Micro Eh Eng
Micro Eh Eng
APPLICATION MANUAL
NJI-350 (X)
WARNING
To ensure that the equipment described by this manual. As well as all equipment connected
to and used with it, operate satisfactorily and safety, all applicable local and national codes
that apply to installing and operating the equipment must be followed. Since codes can vary
geographically and can change with time, it is the user’s responsibility to determine which
standard and codes apply, and to comply with them.
FAILURE TO COMPLY WITH APPLICABLE CODES AND STANDARDS CAN RESULT IN
DAMAGE TO EQUIPMENT AND/OR SERIOUS INJURY TO PERSONNEL.
INSTALL EMARGENCY POWER STOP SWITCH, WHICH OPERATES INDEPENDENTLY OF
THE PROGRAMMABLE CONTROLLER TO PROTECT THE EQUIPMENT AND/OR
PERSONNEL IN CASE OF THE CONTROLLER MALFUNCTION.
Personnel who are to install and operate the equipment should carefully study this manual
and any other referred to by it prior to installation and/or operation of the equipment. Hitachi
Industrial Equipment Systems Co., Ltd. constantly strives to improve its products, and the
equipment and the manual(s) that describe it may be different from those already in your
possession.
If you have any questions regarding the installation and operation of the equipment, or if
more information is desired, contact your local Authorized Distributor or Hitachi Industrial
Equipment Systems Co., Ltd.
IMPORTANT
THIS EQUIPMENT GENERATES, USES, AND CAN RADIATE RADIO FREQUENCY
ENERGY AND, IF NOT INSTALLED AND USED IN ACCORDANCE WITH THE
INSTRUCTION MANUAL, MAY CAUSE INTERFERENCE TO RADIO COMMUNICATIONS.
AS TEMPORARILY PERMITTED BY REGULATION, IT HAS NOT BEEN TESTED FOR
COMPLIANCE WITH THE LIMITS FOR CLASS A COMPUTING DEVICES PURSUANT TO
SUBPART J OF PART 15 OF FCC ROULES, WHICH ARE DESIGNED TO PROVIDE
PEASONABLE PROTECTION AGAINST SUCH INTERFERENCE.
OPERATION OF THIS EQUIPMENT IN A RESIDENTIAL AREA IS LIKELY TO CAUSE
INTERFERENCE IN WHICH CASE THE USER, AT HIS OWN EXPENSE, WILL BE
REQUIRED TO TAKE WHATEVER MEASURES MAY BE REQUIRED TO CORRECT THE
INTERFERENCE.
LIMITED WARRANTY AND IMITATION OF LIABILITY
Hitachi Industrial Equipment Systems Co., Ltd. (Hitachi) warrants to the original purchaser
that the programmable logic controller (PLC) manufactured by Hitachi is free from defects in
material and workmanship under normal use and service. The obligation of Hitachi under this
warranty shall be limited to the repair or exchange of any part or parts which may prove
defective under normal use and service within eighteen (18) months from the date of
manufacture or twelve (12) months from the date of installation by the original purchaser
which ever occurs first, such defect to be disclosed to the satisfaction of Hitachi after
examination by Hitachi of the allegedly defective part or parts. This warranty in expressly in
lieu of all other warranties expressed or implied including the warranties of merchantability
and fitness for use and of all other obligations or liabilities and Hitachi neither assumes, nor
authorizes any other person to assume for Hitachi, any other liability in connection with the
sale of this PLC. This warranty shall not apply to this PLC or any part hereof which has been
subject to accident, negligence, alternation, abuse, or misuse. Hitachi makes no warranty
whatsoever in respect to accessories or parts not supplied by Hitachi. The term “original
purchaser”, as used in this warranty, shall be deemed to mean that person for whom the
PLC in originally installed.
To obtain warranty service, return the product to your distributor, or send it with a description
of the problem, proof of purchase, post paid, insured, and in a suitable package to:
However, depending on the situation, items marked with CAUTION may result in major accidents.
Both of these items contain important safety information, so be sure to follow them closely.
Icons for prohibited items and required items are shown below:
: Indicates a prohibited ite (ite that cannot be performed). For example, when open flames are prohibited,
is shown.
: Indicates a required ite (ite that must be performed). For example, when grounding must be performed,
is shown.
1. About Installation
CAUTION
• Use this product in an environment as described in the catalogue and this document.
If this product is used in an environment subject to high temperature, high humidity, excessive dust, corrosive
gases, vibration or shock, it may result in an electric shock, fire or malfunction.
• Never allow foreign objects such as wire chips to enter the unit.
They may cause a fire, malfunction, or failure.
2. About Wiring
REQUIRED
• Always perform grounding (FE terminal).
If grounding is not performed, there is a risk of an electric shock or malfunction.
CAUTION
• Connect a power supply that meets the rating.
If a power supply that does not meet the rating is connected, it may result in a fire.
DANGER
• Never touch the terminals while the power is on.
There is a risk of an electric shock.
• Configure the emergency stop circuit, interlock circuit and other related circuits external to the programmable
controller (referred to as the PLC in this document).
Otherwise, a failure in the PLC may damage the equipment or result in a serious accident.
Never interlock the unit with the external load via the relay drive power supply of the relay output module.
CAUTION
• Before performing program change, forced output, run, stop and other operations while the unit is in operation,
be sure to check the validity of the applicable operation and safety.
An operation error may damage the equipment or result in a serious accident.
DANGER
• Never connect the and of the battery in reverse. Also, never charge, disassemble, heat, place in fire, or
short circuit the battery.
There is a risk of an explosion or fire.
PROHIBITED
• Never disassemble or modify the unit.
These actions may result in a fire, malfunction, or failure.
CAUTION
• Be sure to turn off the power supply before removing or attaching the module/unit.
Otherwise, it may result in an electric shock, malfunction, or failure.
Revision History
Chapter 12 Error Code List and Special Internal Outputs .....................................................................12-1 to 12-14
Chapter 1 Features
1. Multifunctional all-in-one type PLC
The MICRO-EH is a multifunctional all-in-one type PLC that contains all necessary parts—a power supply and
CPU parts as well as I/O units--within one unit.
Three sizes of PLCs are available: 10, 14, and 28 points. A type with 23 points plus three points of analog I/O
having the same size as the 28-point PLC is also available. Moreover, for PLCs with more than 14 points, it is
possible to install additional 14-point PLCs in up to four stages. Thus, the MICRO-EH can control a wide range of
systems from small to medium size.
5. Easy maintenance through removable terminal blocks and installation on a DIN rail
All models of the MICRO-EH series support the DIN rail so that the PLC can easily be mounted and dismounted. In
addition, the I/O section of the 14-point PLC or more utilizes a removable terminal block. Thus, erroneous and
faulty wiring that may occur when connecting to external devices can be reduced.
1-1
Chapter 2 System Configuration
1] Basic unit
1] Basic unit
2-1
Chapter 2 System Configuration
1] Basic unit
1] Basic unit
2-2
Chapter 3 Function and Performance Specifications
3-1
Chapter 3 Function and Performance Specifications
3-2
Chapter 3 Function and Performance Specifications
3-3
Chapter 3 Function and Performance Specifications
3-4
Chapter 3 Function and Performance Specifications
Note: There are functions supported by H series that are not supported by this PLC (debug, trace, force, and simulation functions).
3-5
Chapter 3 Function and Performance Specifications
*1: The same numbers cannot be used with the timer counter.
*2: Only timers numbered 0 to 63 can use 0.01 s for their timer base.
*3: To be developed.
3-6
Chapter 3 Function and Performance Specifications
(1) DC input
(2) AC input
3-7
Chapter 3 Function and Performance Specifications
3-8
Chapter 3 Function and Performance Specifications
3-9
Chapter 3 Function and Performance Specifications
3-10
Chapter 3 Function and Performance Specifications
3-11
Chapter 3 Function and Performance Specifications
3.3.10 Backup
(1) Batter
The contents of data in memory can be retained for two months using an EH-MBAT battery (at 0 to 55 °C).
The battery can be replaced from the front of the main unit. (Batteries can only be mounted for the 23-point and 28-
point types).
If the calendar clock is used with the 23-point or 28-point type, be sure to use the EH-MBAT.
(2) Capacitor
14-point type: Data can be maintained for 72 hours (at 25 °C) by the capacitor in the main unit
23-point and 28-point types: Data can be maintained for 30 minutes (at 25 °C) by the capacitor in the main unit
Please note that the contents of data in memory cannot be retained for the 10-point type.
3.3.11 Expansion
• Up to four 14-point expansion units may be installed.
• A cable with a length of up to 1 m can be used to connect between units.
• The total extension cable length can be up to 2 m (from the basic unit to the expansion unit at the end).
• The 10-point type unit cannot be expanded.
3-12
Chapter 3 Function and Performance Specifications
• Current value display area: Always displays the current value of the clock (all BCD data).
• Reading value/setting value area: Displays the clock reading value or stores the setting value.
(All BCD data)
Note 1: The day of the week data is expressed as follows. (The upper three digits are always 000.)
0: Sunday, 1: Monday, 2: Tuesday, 3: Wednesday, 4: Thursday, 5: Friday, 6: Saturday
Note 2: The upper two digits of the second data are always 00.
3-13
Chapter 3 Function and Performance Specifications
3-14
Chapter 4 System Equipment
EH - D 28 † D T P
[None]: Sink, T: Sink, P: Source (except in the cases of relay output and SSR output)
R: Relay output, T: Transistor (DC) output, S: SSR (AC) output
D: DC input, A: AC input
[None]: Basic unit, E: Expansion unit
10: 10-point type, 14: 14-point type, 23: 23-point type, 28: 28-point type
A: AC power supply type, D: DC power supply type
4-1
Chapter 4 System Equipment
(4) Others
4-2
Chapter 4 System Equipment
9] Mounting hole
1] POW LED
2] OK LED
3] RUN LED
4] Serial port
7] Output terminals
8] Power terminal
10] DIN rail installation clip
4-3
Chapter 4 System Equipment
1] POW LED
2] OK LED
3] RUN LED
9] DIP SW cover
6] Output terminals
4] Serial port cover 12] DIN rail installation clip
7] Power terminal
5] Input terminals Terminals for wiring the external input units. See Chapter 10.
Recommended terminals are shown in the 6 (Make sure that the terminals will not
figure to the right. disengage due to loose screws.)
4-4
Chapter 4 System Equipment
1] POW LED
2] OK LED
3] RUN LED
11] Mountin
8] Expansion
hole
connector cover
9] DIP SW cover
7] Power terminal
5] Input terminals Terminals for wiring the external input units. See Chapter 10.
Recommended terminals are shown in the figure 6 (Make sure that the terminals will not
to the right. disengage due to loose screws.)
4-5
Chapter 4 System Equipment
9] Terminal cover
4] Input terminals
1] POW LED
2] OK LED
8] Dummy cover
6] Power terminal
4-6
Chapter 4 System Equipment
RUN NC 0 1 2 3 C0 4 5
In case of EH-D10DTP
24 V 0V 0 1 2 3 C0 V0
In case of EH-D10DT
Power supply
Load power suppl
24 V DC
12/24 V DC
EH-D10DR
* Since the DC input is bidirectional, it is possible to reverse the polarity of the power supply.
RUN NC 0 1 2 3 C0 4 5
24V 0V NC 0 1 2 3 C0
4-7
Chapter 4 System Equipment
14-point type
EH-A14DR (AC power supply type), EH-D14DR (DC power supply type)
* Since the DC input is bidirectional, it is possible to reverse the polarity of the power supply.
24+ 1 3 4 6 C1
0V 0 2 C0 5 7
AC 0 1 2 4 C2
AC C0 C1 3 5
Load power supply
24 V DC,
AC power supply type 100 to 240 V AC
100 to 240 V AC
0V
24V
EH-A14EDR (AC power supply type), EH-D14EDR (DC power supply type)
* Since the DC input is bidirectional, it is possible to reverse the polarity of the power supply.
24+ 1 3 4 6 C1
0V 0 2 C0 5 7
AC 16 17 18 20 C2
AC C0 C1 19 21
4-8
Chapter 4 System Equipment
EH-A14AS
NC 1 3 4 6 C1
NC 0 2 C0 5 7
AC NC 1 2 4 C1
AC 0 C0 3 5
EH-D14DTP
* Since the DC input is bidirectional, it is possible to reverse the polarity of the power supply.
24+ 1 3 4 6 C1
0V 0 2 C0 5 7
0V 0 NC 3 5 C0
24V 1 2 4 V0
0V 0 NC 3 5 C0
24V 1 2 4 V0
4-9
Chapter 4 System Equipment
EH-D14EDTP
* Since the DC input is bidirectional, it is possible to reverse the polarity of the power supply.
24+ 1 3 4 6 C1
0V 0 2 C0 5 7
0V 16 NC 19 21 C0
24V 17 18 20 V0
0V 16 NC 19 21 C0
24V 17 18 20 V0
4-10
Chapter 4 System Equipment
23-point type
EH-A23DRP
* Since the DC input is bidirectional, it is possible to reverse the polarity of the power supply.
AC 0 V0 2 4 5 6 7 8 C5 IO VO
AC C0 1 3 C1 C2 C3 C4 9 IC VC
AC 0 NC 2 4 5 6 7 8 C5 IO VO
AC C0 1 3 C1 C2 C3 C4 9 IC VC
Analog output
IO VO
IC VC +
-
4-11
Chapter 4 System Equipment
28-point type
EH-A28DRP (AC power supply type)
* Since the DC input is bidirectional, it is possible to reverse the polarity of the power supply.
Power supply
for input 24 V DC
24+ 1 3 4 6 C1 9 11 C2 13 15 C3
0V 0 2 C0 5 7 8 10 C2 12 14 C3
AC 0 V0 2 4 5 6 7 8 9 11 C6
AC C0 1 3 C1 C2 C3 C4 C5 10 C6
4-12
Chapter 4 System Equipment
EH-A28AS
Power supply for input
100 to 115 V AC
NC 1 3 4 6 C1 C2 9 11 C3 13 15
NC 0 2 C0 5 7 C2 8 10 C3 12 14
AC NC 1 2 4 C1 NC C2 7 C3 9 11
AC 0 C0 3 5 NC C2 6 C3 8 10
EH-D28DTP
* Since the DC input is bidirectional, it is possible to reverse the polarity of the power supply.
24+ 1 3 4 6 C1 9 11 C2 13 15 C3
0V 0 2 C0 5 7 8 10 C2 12 14 C3
0V 0 NC 3 5 C0 C1 V1 6 8 NC 11
24V 1 2 4 V0 NC C1 V1 7 9 10
4-13
Chapter 4 System Equipment
4-14
Chapter 4 System Equipment
70 80
4.4
65
8
75 47
80 90
4.8
85
8.4
95 76
80 90
140 4.8
8.4
150 76
4-15
Chapter 5 Instruction Specifications
5-1
Chapter 5 Instruction Specifications
Instruction
Process
R7F4
R7F3
R7F2
R7F1
R7F0
symbol
Steps
Instruction time
Ladder symbol Process descriptions I/O types used Remarks
name (µs)
DER ERR SD V C MICRO-EH
1 LD Logical Indicates the X, Y z z z z z 0.9 1
Sequence instructions
8 DIF AND Leading edge Indicates detection of the DIF0 to DIF511 z z z z z 1.0 3 Number
DIF detection input rise. (Decimal) 4 overlap not
allowed
DIF OR
DIF
9 DFN AND Trailing edge Indicates detection of the DFN0 to z z z z z 1.2 3 Number
DFN detection input fall. DFN511 4 overlap not
(Decimal) allowed
DFN OR
DFN
RES
13 MCS Set master Indicates master control MCS0 to MCS49 z z z z z 0.7 3 Number
control set operation. overlap
allowed
MCS
14 MCR Reset master Indicates master control MCR0 to MCR49 z z z z z 0.7 2 Number
control reset operation. overlap
allowed
MCR
5-2
Chapter 5 Instruction Specifications
Instruction
Process
R7F4
R7F3
R7F2
R7F1
R7F0
symbol
Steps
Instruction time
Ladder symbol Process descriptions I/O types used Remarks
name (µ s)
DER ERR SD V C MICRO-EH
15 MPS MPS Operation Stores the previous None z z z z z — 0
result push operation result.
Instruction
Process
R7F4
R7F3
R7F2
R7F1
R7F0
symbol
Steps
Instruction time
Ladder symbol Process descriptions I/O types used Remarks
name (µ s)
DER ERR SD V C MICRO-EH
22 OUT On delay Indicates an on delay timer TD0 to TD255 z z z z z 1.4 5 Number
TD TD timer operation. When 0.01 s, it is overlap not
possible to use allowed
until 0 to 63.
23 OUT Single shot Indicates a single shot SS0 to SS255 z z z z z 1.4 5
SS SS operation. When 0.01 s, it is
possible to use 0
to 63.
z z z z z
Counter
5-3
Chapter 5 Instruction Specifications
Instruction
Process
R7F4
R7F3
R7F2
R7F1
R7F0
symbol
Steps
Instruction time
Ladder symbol Process descriptions I/O types used Remarks
name (µ s)
DER ERR SD V C MICRO-EH
28 s1 LD = Relational When s1 = s2: Continuity [Word] z z z z z 27 5 *1
(s1== box When s1 ≠ s2: WX, WY, WR, 6 *2
==
s2) Noncontinuity WM, 7 Upper
s2 Timer Counter 8 case: W
[Double word]
AND DX, DY, DR, 35 Lower
s1 (s1== DM case: DW
== s2)
s2 Constant
OR
s1 (s1==
== s2)
s2
29 LD Signed = When s1 = s2: Continuity DX, DY, DR, z z z z z 35 5 *2
s1 (s1 Relational When s1 ≠ s2: DM 6
S== S== box Noncontinuity 7
s2 s2) s1 and s2 are compared as Constant 8
signed 32-bit binary.
AND
s1 (s1
S== S==
s2 s2)
OR
s1 (s1
S==
S==
s2)
s2
30 LD <> When s1 = s2: [Word] z z z z z 26.8 5 *1
s1 (s1< Relational Noncontinuity WX, WY, WR, 6 *2
<> >s2) box When s1 ≠ s2: Continuity WM, 7 Upper
s2
Timer Counter 8 case: W
[Double word]
AND DX, DY, DR, 34.5 Lower
s1 (s1< DM case: DW
<> >s2)
Constant
s2
OR
s1 (s1<
>s2)
<>
s2
31 LD Signed <> When s1 = s2: DX, DY, DR, z z z z z 34.5 5 *2
s1 (s1 Relational Noncontinuity DM 6
S<>
S<> box When s1 ≠ s2: Continuity 7
s2) s1 and s2 are compared as Constant 8
s2 signed 32-bit binary.
AND
s1 (s1
S<> S<>
s2)
s2
OR
s1 (s1
S<>
S<>
s2)
s2
*1: In the case of word, it requires five steps for LD (s1†s2) and AND (s1†s2), and six steps for OR (s1†s2).
*2: In the case of double word, for LD (s1†s2) and AND (s1†s2), it requires five steps when the combination of s1 and s2 is I/O
and I/O, six steps when the combination is either I/O and constant or constant and I/O, and seven steps when the combination
is constant and constant. For OR (s1†s2), one step is added respectively.
5-4
Chapter 5 Instruction Specifications
Instruction
Process
R7F4
R7F3
R7F2
R7F1
R7F0
symbol
Steps
Instruction time
Ladder symbol Process descriptions I/O types used Remarks
name (µ s)
DER ERR SD V C MICRO-EH
32 LD < Relational When s1 < s2: Continuity [Word] z z z z z 26.8 5 *1
s1 (s1< box When s1 ≥ s2: WX, WY, WR, 6 *2
< s2) Noncontinuity WM, 7 Upper
s2 Timer Counter 8 case: W
[Double word]
AND DX, DY, DR, 37.5 Lower
s1 (s1< DM case: DW
< s2)
Constant
s2
OR
s1 (s1<
s2)
<
s2
33 LD Signed < When s1 < s2: Continuity DX, DY, DR, z z z z z 37.5 5 *2
s1 (s1 Relational When s1 ≥ s2: DM 6
S< S< box Noncontinuity 7
s2 s2) s1 and s2 are compared as Constant 8
signed 32-bit binary.
AND
s1 (s1
S< S<
s2)
s2
OR
s1
(s1
S< S<
s2 s2)
OR
s1 (s1
<= <=
s2)
s2
35 LD Signed <= When s1 ≤ s2: Continuity DX, DY, DR, z z z z z 37.5 5 *2
s1 (s1 Relational When s1 > s2: DM 6
S<= S<= box Noncontinuity 7
s2 s2) s1 and s2 are compared as Constant 8
signed 32-bit binary.
AND
s1 (s1
S<= S<=
s2)
s2
OR
s1 (s1
S<= S<=
s2)
s2
*1: In the case of word, it requires five steps for LD (s1†s2) and AND (s1†s2), and six steps for OR (s1†s2).
*2: In the case of double word, for LD (s1†s2) and AND (s1†s2), it requires five steps when the combination of s1 and s2 is I/O
and I/O, six steps when the combination is either I/O and constant or constant and I/O, and seven steps when the combination
is constant and constant. For OR (s1†s2), one step is added respectively.
5-5
Chapter 5 Instruction Specifications
4. Arithmetic instructions
Classification
Item number
Instruction
Process
R7F4
R7F3
R7F2
R7F1
R7F0
symbol
Steps
Instruction time
Ladder symbol Process descriptions I/O types used Remarks
name (µ s)
DER ERR SD V C MICRO-EH
1 d=s Substitution d ← s [Bit] ↕ z z z z 32 3 I/O: I/O
Substitution statement
5-6
Chapter 5 Instruction Specifications
Instruction
Process
R7F4
R7F3
R7F2
R7F1
R7F0
symbol
Steps
Instruction time
Ladder symbol Process descriptions I/O types used Remarks
name (µ s)
DER ERR SD V C MICRO-EH
12 d=s1 OR s2 Logical OR d ← s1+s2 [Bit] z z z z z 62 4 Upper
d: Y, R, M case: B
s1, s2: X, Y, R, 33 4 Middle
M case: W
[Word] 86 6 Lower
d: WY, WR, case: DW
13 d=s1 AND s2 Logical d ← s1 x s2 WM, z z z z z 46 4 Upper
AND Timer Counter case: B
s1, s2: WX, WY, 36 4 Middle
WR, WM, Timer case: W
Counter, Constant 49 6 Lower
[Double word] case: DW
14 d=s1 XOR s2 Exclusive d ← s1 ⊕ s2 d: DY, DR, DM z z z z z 42 4 Upper
OR s1, s2: DX, DY, case: B
DR, DM, 33 4 Middle
Constant case: W
66 6 Lower
case: DW
= Relational When s1 = s2, d ← 1 z z z z z
Relational expression
5-7
Chapter 5 Instruction Specifications
Instruction
Process
R7F4
R7F3
R7F2
R7F1
R7F0
symbol
Steps
Instruction time
Ladder symbol Process descriptions I/O types used Remarks
name (µ s)
DER ERR SD V C MICRO-EH
21 d=s1 <= s2 ≤ Relational When s1 < s2, d ← 1 [Word] z z z z z 40 4 Upper
expression When s1 ≥ s2, d ← 0 d: Y, R, M case: W
s1, s2: WX, WY,
WR, WM, Timer
Counter,
Constant
[Double word] 71 6 Lower
d: Y, R, M case: DW
s1, s2: DX, DY,
DR, DM,
Constant
22 d=s1 S<= s2 Signed ≤ When s1 ≤ s2, d ← 1 [Double word] 50 6
Relational When s1 > s2, d ← 0 d: Y, R, M
expression s1 and s2 are compared as s1, s2: DX, DY,
signed 32-bit binary. DR, DM,
Constant
5. Application instructions
Process
Bit operations C lassification
Item num ber
R7F4
R7F3
R7F2
R7F1
R7F0
Instruction
symbol
time
Steps
Instruction
Ladder symbol Process descriptions I/O types used (µ s) Remarks
name
DER ERR SD V C MICRO-EH
5-8
Chapter 5 Instruction Specifications
Shift/rotate Classification
Item number
Instruction
Process
R7F4
R7F3
R7F2
R7F1
R7F0
symbol
Steps
Instruction time
Ladder symbol Process descriptions I/O types used Remarks
name (µ s)
DER ERR SD V C MICRO-EH
10 BSR(d, n) BCD shift [Word] z z z z z 32 3 Upper
right d d: WY, WR, WM, case: W
TC Lower
n: WX, WY, WR, 40 3 case: DW
0→
WM, TC,
Shifts BCD to right by n Constant
digits.
11 BSL(d, n) BCD shift [Double word] z z z z z 32 3 Upper
d
left d: DY, DR, DM case: W
n: WX, WY, WR, Lower
←0 WM, TC, 39 3 case: DW
constant
Shifts BCD to left by n
digits.
z z z z
Transfer
5-9
Chapter 5 Instruction Specifications
Conversion Classification
Item number
Instruction
Process
R7F4
R7F3
R7F2
R7F1
R7F0
symbol
Steps
Instruction time
Ladder symbol Process descriptions I/O types used Remarks
name (µ s)
DER ERR SD V C MICRO-EH
18 BCD(d, s) Binary → Converts the value of s into [Word] ↕ z z z z 79 3 Upper
BCD BCD and stores it in I/O d: WY, WR, WM case: W
conversion number d. If the value of s s: WX, WY, WR, Lower
is an error, DER (R 7F4) = WM, TC, 89 4 case: DW
1 is set. Constant
19 BIN(d, s) BCD → Converts the value of s into [Double word] ↕ z z z z 49 3 Upper
Binary binary and stores it in I/O d: DY, DR, DM case: W
conversion number d. If the value of s s: DX, DY, DR, Lower
is an error, DER (R 7F4) = DM, Constant 75 4 case: DW
1 is set.
20 DECO(d, s, n) Decode Decodes the value indicated d: R, M ↕ z z z z 105 4 *3
by the least significant n s: WX, WY, WR,
bits of s, and sets the bit WM, TC,
that corresponds to the Constant
decoding result of the bit n: Constant(1-8)
row starting from I/O
number d, to 1.
21 ENCO(d, s, n) Encode Encodes the bit location in • ` • ` ` ` • ` ` ↕ z z z ↕ 128 4 *3
which 1 is set within the bit ` • ` • `
row, which starts with I/O ` ` • ` ` ` ` ` •
number s and lasts for the ` ` ` ` ` ˜ • • • t
amount of nth power of 2, (1-8)
and stores it in I/O number
d. If multiple bits that
contain 1 exist, the one with
` • ` • ` • ` • ` ` ` • ` •
` • ` • ` ` ` • ` • ` • ` •
*3: Processing time when n=1. ` ` ` • ` • ` • ` • ` ` `
Application instruction Classification
Item number
Instruction
Process
R7F4
R7F3
R7F2
R7F1
R7F0
symbol
Steps
Instruction time
Ladder symbol Process descriptions I/O types used Remarks
name (µ s)
DER ERR SD V C MICRO-EH
22 BCU(d, s) Bit count Among the contents of s [Word] z z z z z 33 3 Upper
(word, double-word), stores d: WY, WR, WM case: W
the number of bits that are s: WX, WY, WR,
set to 1 in I/O number d. WM, TC,
Constant
[Double word] 42 4 Lower
d: WY, WR, WM case: DW
s: DX, DY, DR,
DM, Constant
23 SWAP(d) Swap Swaps the upper 8 bits and d: WY, WR, WM z z z z z 25 2
the lower 8 bits of the value
(word) for I/O number d.
24 UNIT(d, s, n) Unit Stores the lower 4 bit values d: WY, WR, WM ↕ z z z z 100 4 *4
of the n words starting with s: WR, WM
s in the lower 4 bits each of n: Constant(0-4)
d (word).
25 DIST(d, s, n) Distribute Extracts the value of s d: WR, WM ↕ z z z z 87 4 *4
(word) in 4 bit units from s: WX, WY, WR,
the least significant bits, WM, TC,
and sets them in the lower 4 Constant
bits of each word starting n: Constant(0-4)
with I/O number d (word).
The upper bits are set to 0.
*4: Processing time when n = 1
5-10
Chapter 5 Instruction Specifications
6. Control instructions
Control instructions Classification
Item number
Instruction
Process
R7F4
R7F3
R7F2
R7F1
R7F0
symbol
Steps
Instruction time
Ladder symbol Process descriptions I/O types used Remarks
name (µ s)
DER ERR SD V C MICRO-EH
1 END Normal Indicates the end of a None z z z z z 714 1
scan end normal scan and re-executes
normal scan from the
beginning of the normal
scan.
2 CEND(s) Scan Re-executes normal scan s: X, Y, R, M z z z z z 5 2 *5
conditional from the beginning of the
end normal scan when s=1,
while the next instruction is 707 *6
executed when s=0.
3 JMP n Unconditio- Jumps to LBL n of the same n: Constant(0- z 1] z z z 32 2
nal jump No. n. 255)
4 CJMP n (s) Conditional When s=1, jumps to the n: Constant(0- z 1] z z z 3 3 *5
jump LBL n of the same No.; 255)
when s=0, executes the next s: X, Y, R, M 32 *6
instruction.
5 LBL n Label Indicates the jump n: Constant(0- z z z z z 0.5 1
destination of JMP or 255)
CJMP of the same No.
6 FOR n (s) FOR When s=0, jumps to the n: Constant(0-49) z 1] z z z 33 3
location after the NEXT n s: WY, WR, WM
of the same No.; when s is
not 0, executes the next
instruction.
7 NEXT n NEXT Subtracts 1 from the s value n: Constant(0-49) z 1] z z z 38 2
of the FOR n of the same
No. and jumps to FOR n.
8 CAL n Call Executes the SB n n: Constant(0-99) z 1] z z z 24 2
subroutine subroutine of the same No.
n.
9 SB n Start Indicates the start of No. n n: Constant(0-99) z 1] z z z 0.5 1
subroutine subroutine.
10 RTS RETURN Returns from subroutine. None z z z z z 25 1
SUBROUTIN
11 INT n Start Indicates the start of No. n n: Constant(0-2, z z z z z 0.5 1
interrupt interrupt scan. 16-19, 20-27)
scan
12 RTI RETURN Returns from interrupt scan. None z z z z z 0.5 1
INTERRUPT
7. FUN instructions
FUN instructions Classification
Item number
Instruction
Process
R7F4
R7F3
R7F2
R7F1
R7F0
symbol
Steps
Instruction time
Ladder symbol Process descriptions I/O types used Remarks
name (µ s)
DER ERR SD V C MICRO-EH
1 FUN 80 (s) I/O refresh Refreshes all external I/O s: WR,WM ↕ z z z z 432 3
(ALREF (s)) (all points) ranges.
2 FUN 81 (s) I/O refresh Refreshes only the input ↕ z z z z 244 3
(IOREF (s)) (I/O /link range, output range or link
designation) range.
3 FUN 82 (s) I/O refresh Refreshes the I/O at the ↕ z z z z 311 3
(SLREF (s)) (any slot) designated slot.
5-11
Chapter 5 Instruction Specifications
Instruction
Process
R7F4
R7F3
R7F2
R7F1
R7F0
symbol
Steps
Instruction time
Ladder symbol Process descriptions I/O types used Remarks
name (µ s)
DER ERR SD V C MICRO-EH
4 FUN 140 (s) High-speed Performs the starting and s: WR, WM ↕ z z z z 147 3
counter stopping of the count
operation operation of the specified
control counter.
5 FUN 141 (s) High-speed Performs the enabling and s: WR, WM ↕ z z z z 138 3
counter disabling of the coincidence
coincidence output of the specified
output counter.
control
6 FUN 142 (s) High-speed This controls the up- s: WR, WM ↕ z z z z 156 3
counter up- count/down-count of the
count / specified counter. (Single-
down-count phase counters only)
control
7 FUN 143 (s) High-speed The counter value of the s: WR, WM ↕ z z z z 175 3
counter specified counter number s+1: WR, WM
current value will be replaced by the data
replacement stored in the replacement
value storage area.
8 FUN 144 (s) High-speed This function reads the s: WR, WM ↕ z z z z 132 3
counter count value of the specified s+1: WR, WM
current counter number and writes
value it to the current value
reading storage range
9 FUN 145 (s) High-speed Clears the count value of the s: WR, WM ↕ z z z z 157 3
counter specified counter number.
current
value clear
10 FUN 146 (s) High-speed The on-preset value and s: WR, WM ↕ z z z z 162 3
counter off-preset value will be set s+1: WR, WM
preset according to the preset s+2: WR, WM
specifications in respect to
the specified counter
number.
11 FUN 147 (s) PWM Starts PWM output of the s: WR, WM ↕ z z z z 135 3
operation specified PWM output
control number.
12 FUN 148 (s) PWM Sets the frequency value s: WR, WM ↕ z z z z 173 3
Frequency and the on-duty value of the s+1: WR, WM
on-duty PWM output number s+2: WR, WM
changes specified by the on-duty
value and the specified
frequency value.
13 FUN 149 (s) Pulse Starts pulse output of the s: WR, WM ↕ z z z z 149 3
output specified pulse number and
control the output is stopped when
the specified number of
pulses are output.
14 FUN 150 (s) Pulse Pulse output is commenced s: WR, WM ↕ z z z z 217 3
frequency at the specified frequency. s+1: WR, WM
output Output is stopped when the s+2: WR, WM
setting number of pulses specified
changes have been output.
15 FUN 151 (s) Pulse output Divides the time band and s: WR, WM ↕ z z z z 919 3
with frequency into 10 levels and s+1: WR, WM
acceleration/ performs s+2: WR, WM
deceleration acceleration/deceleration. s+3: WR, WM
s+4: WR, WM
16 FUN 254 (s) BOX No processing is performed s: WR, WM z z z z z — 3
(BOXC (s)) comment in the CPU.
17 FUN 255 (s) Memo No processing is performed z z z z z — 3
(MEMC (s)) comment in the CPU.
5-12
Chapter 5 Instruction Specifications
5-13
Chapter 5 Instruction Specifications
Item number Basic instructions-1, 2 Name Logical operation start (LD, LDI)
Ladder format Condition code Processing time (µs) Remark
n R7F4 R7F3 R7F2 R7F1 R7F0 Average Maximum
LDI
LD
n DER ERR SD V C
z z z z z
n
n
Constant
R, TD, SS, WR, DR,
Usable I/O Other
X Y M CU, CT WX WY WM TC DX DY DM
n I/O number { { { {
Function
n
Starts the a-contact logical operation. Enters the continuity state when input is on.
LD n
n
Starts the b-contact logical operation. Enters the continuity state when input is off.
LDI n
Notes
Y100 will not change while monitored. It will remain the same value previously set using functions such as
set/reset.
For example, if Y100 is off, the Y100 status will not change while being monitored and WRO will also remain
unchanged.
Program example
Program description
• When input X00000 is on, output Y00100 is on; when off, the output is off.
• When input X00001 is off, output Y00101 is on; when on, the output is off.
5-14
Chapter 5 Instruction Specifications
Item number Basic instructions-3, 4 Name Contact serial connection (AND, ANI)
Ladder format Condition code Processing time (µs) Remark
n R7F4 R7F3 R7F2 R7F1 R7F0 Average Maximum
n
n
DER ERR SD V C
n
z z z z z
AND
ANI
Instruction format Number of steps 0.8 ←
AND n Condition Steps
ANI n 1
Constant
R, TD, SS, WR, DR,
Usable I/O Other
X Y M CU, CT WX WY WM TC DX DY DM
n I/O number { { { {
Function
n
Obtains AND of the previous operation result and the a-contact operation.
AND
n
Obtains AND of the previous operation result and the b-contact operation.
ANI
Notes
Y100 will not change when monitored. It will remain the same value previously set using functions such as
set/reset.
For example, if Y100 is off, the Y100 status will not change while being monitored and WRO will also remain unchanged.
Program example
LD X00002
X00002 R010 Y00100 AND R010
OUT Y00100
Program description
• When input X00002 and R010 are both on, output Y00100 is on and all others are off.
• When input X00003 is on and R011 is off, output Y00101 is on and all others are off.
5-15
Chapter 5 Instruction Specifications
Item number Basic instructions-5, 6 Name Contact parallel connection (OR, ORI)
Ladder format Condition code Processing time (µs) Remark
n R7F4 R7F3 R7F2 R7F1 R7F0 Average Maximum
ORI
OR
n DER ERR SD V C
z z z z z
n
←
n
Constant
R, TD, SS, WR, DR,
Usable I/O Other
X Y M CU, CT WX WY WM TC DX DY DM
n I/O number { { { {
Function
n
Obtains OR of the previous operation result and the a-contact operation.
OR n
n
Obtains OR of the previous operation result and the b-contact operation.
ORI n
Notes
Y100 will not change when monitored. It will remain the same value previously set using functions such as
set/reset.
For example, if Y100 is off, the Y100 status will not change while being monitored and WRO will also remain unchanged.
Program example
X00000 Y00105
LD X00000
OR X00001
X00001 ORI X00002
OUT Y00105
X00002
Program description
• When X00000 is on, X00001 is on, or X00002 is off, the operation is “1” and Y00105 turns on.
5-16
Chapter 5 Instruction Specifications
NOT
z z z z z
Instruction format Number of steps 0.8
Condition Steps
NOT 2
Constant
R, TD, SS, WR, DR,
Usable I/O Other
X Y M CU, CT WX WY WM TC DX DY DM
Function
Program example
LD X00000
X00000 X00001 R100
AND X00001
NOT
OUT R100
Program description
• When input X00000 and input X00001 are both on, the operation is “1,” but due to , the calculation turns into “0”
and R100 turns off.
• In all other cases, R100 turns on.
5-17
Chapter 5 Instruction Specifications
Item number Basic instructions-8 Name Leading edge detection (AND DIF, OR DIF)
Ladder format Condition code Processing time (µs) Remark
DIF n DIF n R7F4 R7F3 R7F2 R7F1 R7F0 Average Maximum
OR
AND DIF
z z z z z
Instruction format Number of steps 1.0 ←
n
n
Constant
R, TD, SS, WR, DR,
Usable I/O Other
X Y M CU, CT WX WY WM TC DX DY DM
• Detects the rise of an input signal and retains the operation result only for one scan.
( ) indicates the display when the Ladder Editor is used.
Notes
• DIF number may not be overlapped. (However, no error is generated even if overlapped numbers are used.)
• DIF cannot use the b contact.
Program example
Program description
Time chart
X00000
R123
1 scan time
• Upon leading of X00000 on, R123 turns on only for one scan.
• If b-contact is used for X00000, operation will be the same as the a-contact DFN operation.
5-18
Chapter 5 Instruction Specifications
Item number Basic instructions-9 Name Trailing edge detection (AND DFN, OR DFN)
Ladder format Condition code Processing time (µs) Remark
DFN n DFN n R7F4 R7F3 R7F2 R7F1 R7F0 Average Maximum
AND DFN n
OR DFN n
DFN n DFN n
DER ERR SD V C
z z z z z
Instruction format Number of steps 1.0 ←
AND DFN n Condition Steps
OR DFN n AND DFN n 3
OR DFN n 4
Bit Word Double word
Constant
R, TD, SS, WR, DR,
Usable I/O Other
X Y M CU, CT WX WY WM TC DX DY DM
• Detects the fall of an input signal and retains the operation result only for one scan.
( ) indicates the display when the Ladder Editor is used.
Notes
• DFN number may not be overlapped. (However, no error is generated even if overlapped numbers are used.)
• DFN cannot use the b contact.
Program example
Program description
Time chart
X0
R124
1 scan time
5-19
Chapter 5 Instruction Specifications
DER ERR SD V C
z z z z z
n
Constant
R, TD, SS, WR, DR,
Usable I/O Other
X Y M CU, CT WX WY WM TC DX DY DM
n I/O number { { {
Function
• Switches on the coil when the operation result obtained up to that point is “1.”
• Switches off the coil when the operation result obtained up to that point is “0.”
Notes
• L becomes the internal output when link modules are not used.
Program example
X00000 Y00100
LD X00000
OUT Y00100
X00001 Y00101
LD X00001
OUT Y00101
OUT Y00102
Y00102
Program description
• When input X00000 is on, the operation is “1” and Y00100 turns on.
• When input X00001 is on, the operation is “1,” and Y00101 and Y00102 turn on.
5-20
Chapter 5 Instruction Specifications
Item number Basic instructions-11, 12 Name Set/reset coil output (SET, RES)
Ladder format Condition code Processing time (µs) Remark
n n R7F4 R7F3 R7F2 R7F1 R7F0 Average Maximum
n
n
SET S SET
n n DER ERR SD V C Upper case: SET
R
RES RES
z z z z z ←
RES
SET
0.9 Lower case: RES
Instruction format Number of steps
SET n Condition Steps
RES n 1 0.9 ←
Constant
R, TD, SS, WR, DR,
Usable I/O Other
X Y M CU, CT WX WY WM TC DX DY DM
n I/O number { {
Function
n
SET
Switches on the device when the operation result obtained up to that point is “1.”
SET n
The device that is switched on will not be switched off even if the operation result is “0.”
n
RES
Switches off the device when the operation result obtained up to that point is “1.”
RES n
( ) indicates the display when the Ladder Editor is used.
Notes
• When a set/reset coil is used on a multi-layer coil, it must be set to the highest level or an arbitrar contact must be entered
immediately before the use.
Example of OK Example of NG
SET
SET
SET
SET SET
Program example
X00000 R100
SET LD X00000
SET R100
LD X00001
X00001 R100
RES R100
RES
Program description
• When input X00000 turns on, output R100 turns on. Even if X00000 turns off, R100 remains on.
• When input X00001 turns on, output R100 turns off.
• When input X00000 and X00001 both turn on, the one executed later than the other during programming takes a higher
priority.
5-21
Chapter 5 Instruction Specifications
Item number Basic instructions-13, 14 Name Set (start)/reset (cancel) master control (MCS, MCR)
Ladder format Condition code Processing time (µs) Remark
MCS n MCS n R7F4 R7F3 R7F2 R7F1 R7F0 Average Maximum
S
MCR
MCS
Constant
R, TD, SS, WR, DR,
Usable I/O DL, Other
X Y M CU, CT WX WY WM TC DX DY
DM
n Number { 0 to 49 (Decimal)
Function
• Controls the input to the circuit sandwiched by the master control set (MCS n) and reset (MCR n).
(An AND operation is performed with respect to each input and MCS.)
• The master control can be used up to eight layers.
( ) indicates the display when the Ladder Editor is used.
Notes
Program example
MCS0
X00000 MCS1 LD X00000
MCS1 MCS1
X00001 Y00100 LD X00001
OUT Y00100 MCS2
MCR1 MCR1
MCR2 Up to eight layers
are allowed.
MCR1
MCR0
Program description
X00000
X00001
Y00100
• When input X00000 is on, the circuits surrounded by MCS and MCR obeys input X00001, and output Y00100 turns on/off.
• When input X00000 is off, the circuits surrounded by MCS and MCR are independent of input X00001, and output Y00100
turns off.
5-22
Chapter 5 Instruction Specifications
Item number Basic instructions-15, 16, 17 Name Save/read/clear operation result (Branching of ladder)
Ladder format Condition code Processing time (µs) Remark
Sav R7F4 R7F3 R7F2 R7F1 R7F0 Average Maximum
MRD Read
MPP Clear
MPS Save
Read DER ERR SD V C
Clear z z z z z
Instruction format Number of steps
MPS Save Condition Steps
MRD Read 0
MPP Clear
Bit Word Double word
Constant
R, TD, SS, WR, DR,
Usable I/O Other
X Y M CU, CT WX WY WM TC DX DY DM
Function
LD X00100
MPS
X00100 R001 Y00101
AND R001
MPS
R002 Y00102 OUT Y00101
MPP
R003 Y00103 AND R002
OUT Y00102
R004 Y00104 MRD
AND R003
OUT Y00103
MPP
AND R004
OUT Y00104
5-23
Chapter 5 Instruction Specifications
Item number Basic instructions-18 Name Logical block serial connection (ANB)
Ladder format Condition code Processing time (µs) Remark
R7F4 R7F3 R7F2 R7F1 R7F0 Average Maximum
(See Function column) DER ERR SD V C
ANB
z z z z z
Instruction format Number of steps
Condition Steps
ANB 0
Constant
R, TD, SS, WR, DR,
Usable I/O Other
X Y M CU, CT WX WY WM TC DX DY DM
Function
This instruction is used to perform AND operation with respect to the logical operation blocks (dotted line area ).
5-24
Chapter 5 Instruction Specifications
Item number Basic instructions-19 Name Logical block parallel connection (ORB)
Ladder format Condition code Processing time (µs) Remark
R7F4 R7F3 R7F2 R7F1 R7F0 Average Maximum
(See Function column) DER ERR SD V C
ORB
z z z z z
Instruction format Number of steps 0.7
Condition Steps
ORB 1
Constant
R, TD, SS, WR, DR,
Usable I/O Other
X Y M CU, CT WX WY WM TC DX DY DM
Function
This instruction is used to perform OR operation with respect to the logical operation blocks (dotted line area).
5-25
Chapter 5 Instruction Specifications
Item number Basic instructions-20 Name Processing box start and end (PROCESSING BOX)
Ladder format Condition code Processing time (µs) Remark
R7F4 R7F3 R7F2 R7F1 R7F0 Average Maximum
[
DER ERR SD V C
z z z z z
]
Constant
R, TD, SS, WR, DR,
Usable I/O Other
X Y M CU, CT WX WY WM TC DX DY DM
Function
LD X00001
X00001
WY0010=WX0000 [
WY0010=WX0000
]
• In the above example, the operation inside the processing box will be executed when input X00001 is on.
5-26
Chapter 5 Instruction Specifications
Item number Basic instructions-21 Name Relational box start and end (RELATIONAL BOX)
Ladder format Condition code Processing time (µs) Remark
R7F4 R7F3 R7F2 R7F1 R7F0 Average Maximum
(
DER ERR SD V C
z
z z z z z
)
Instruction format Number of steps 0.8
z
Condition Steps
( ) — 0
Constant
R, TD, SS, WR, DR,
Usable I/O Other
X Y M CU, CT WX WY WM TC DX DY DM
Function
5-27
Chapter 5 Instruction Specifications
Item number Basic instructions-22 Name On delay timer (ON DELAY TIMER)
Ladder format Condition code Processing time (µs) Remark
OUT TD n t s
Constant
R, TD, SS, WR, DR,
Usable I/O Other
X Y M CU, CT WX WY WM TC DX DY DM
• The progress value is updated when the startup condition is on, and the coil turns on when the progress value is greater than
or equal to the set value.
• If the startup condition is turned off, the progress value is cleared and the coil turns off.
• The progress value is set in TC n and does not exceed 65535 (decimal).
• If the progress value is updated during RUN, the operation will be performed using the new progress value at that point.
• If an I/O is set for the set value, the set value can be changed during operation by changing the I/O value, since the set
values are updated during each scan.
Notes
• The .01s time base can only be used for timer numbers 0 to 63 (64 points).
• The .1 s and 1 s time bases can be used for all timer numbers (0 to 255).
• A maximum of 256 points can be used for the timers TD, SS, CU, CTU and CTD in total.
However, the same area as the counter is used. The timer numbers and counter numbers may not be overlapped.
Program example
• An example of a word I/O being used as the set value for the circuit shown above.
LD R7E3
R7E3
WR0010=12345 [
WR0010=12345
X00000 TD10 ]
0.01S WR0010
LD X00000
TD10 R100 OUT TD10 0.01S WR0010
LD TD10
OUT R100
5-28
Chapter 5 Instruction Specifications
Program description
[Time chart]
OUT TD n t s
1] When input X00000 turns on, TD progress value is updated.
2] When input X00000 turns off, the TD progress value is cleared.
X00000
3] TD10 turns on when progress value ≥ set value.
TD10 4] While X00000 is on, the progress value increases, but will not
R100 65 535 increase exceeding 65535.
Set valu 12345 5] When X00000 turns off, TD10 also turns off and the progress value
is cleared.
Progress value
of TD10 (TC10)
1] 2] 3] 4] 5]
5-29
Chapter 5 Instruction Specifications
Constant
TD, SS,
WDT, MS,
Usable I/O Other
R, TMR, CU, WR, DR,
X Y M RCU, CT WX WY WM TC DX DY DM
n Timer number { 0 to 255 (Decimal)
t Time base .01s, .1s, 1s
s Set value { { { { 1 to 65535 (Decimal)
Function
• Detects the leading edge of the startup condition, starts updating progress values, and turns on the coil.
• The coils turns off when the progress value is greater than or equal to the set value. If a leading edge is detected while the
progress value is less than the set value, the progress value is set to 0 and the counter is reset.
• The progress value is set in TC n and does not exceed 65535 (decimal).
• If the progress value is updated during RUN, the operation will be performed using the new progress value at that point.
• If an I/O is set for the set value, the set value can be changed during operation by changing the I/O value, since the set
values are updated during each scan.
Notes
• The .01 s time base can only be used for timer numbers 0 to 63 (64 points).
• The .1 s and 1s time bases can be used for all timer numbers (0 to 255).
• A maximum of 256 points can be used for the timers TD, SS, CU, CTU and CTD in total.
However, the same area as the counter is used. Timer number and counter number may not be overlapped.
• Since the startup condition of a single shot is edge detection, the condition for one scan cannot be detected during the first
scan after RUN starts.
Program example
• An example of a word I/O being used as the set value for the circuit shown above.
LD R7E3
R7E3
WR0011=12567 [
WR0011=12567
X00001 SS11 ]
0.01S WR0011
LD X00001
SS11 R101 OUT SS11 0.01S WR0011
LD SS11
OUT R101
5-30
Chapter 5 Instruction Specifications
Program description
[Time chart] 1] The progress value is updated and SS11 turns on at the leading edge
OUT SS n t s
of X00001.
2] SS11 turns off when set value ≥ progress value.
X00001
X00001 is turned on at this time, but the single shot startup
conditions are ignored because it uses edge trigger.
SS11
R101
3] SS11 is turned on at the leading edge of X00001 again, and the
progress value is updated.
Set value 12 567 4] When the leading edge of X00001 is detected while the progress
Progress value does not reach the set value, the single shot timer is triggered
value of SS11 again and the progress value returns to 0, then starts increasing. The
(TC11) 1] 2] 3] 4] SS11 remains on.
5-31
Chapter 5 Instruction Specifications
z z z z z
Instruction format Number of steps 1.4
s
Condition Steps
OUT CU n s — 5
Constant
R, TD, SS, WR, DR,
Usable I/O Other
X Y M CU, CT WX WY WM TC DX DY DM
• Increments the progress value by 1 each time the leading edge of the startup condition is detected, and switches on the coil
when the progress value is greater than or equal to the set value. The coil that is switched on turns off when the counter
clear CL n is switched on, and the progress value is cleared to 0.
• The progress value is set in TC n and does not exceed 65535 (decimal).
• If the progress value is updated while the system is running, the operation will be performed using the new progress value at
that point.
• If an I/O is set for the set value, the set value can be changed during operation by changing the I/O value, since the set
values are updated during each scan.
Notes
• A maximum of 256 points can be used for the timers and counters TD, SS, CU, CTU and CTD in total.
• The timer numbers and counter numbers can not be overlapped.
• While the counter clear CL n is on, the rise of startup condition is ignored.
• Since the startup condition of the counter is edge detection, the condition for one scan can not be detected during the first
scan after RUN starts.
• If the set value is set to 0, it is regarded as a coil that is always on and controlled by the CL n.
Program example
X00005 CU15
4 LD X00005
OUT CU15 4
X00006 CL15
LD X00006
OUT CL15
CU15 R105 LD CU15
OUT R105
• An example of a word I/O being used as the set value for the circuit shown above.
R7E3 LD R7E3
WR0015=4 [
WR0015=4
X00005 CU15 ]
WR0015 LD X00005
X00006 CL15 OUT CU15 WR0015
LD X00006
CU15 R105 OUT CL15
LD CU15
OUT R105
5-32
Chapter 5 Instruction Specifications
Program description
s
clear (CL15). While the counter clear is on, the progress
CU n
Ignored Ignored value will not be updated.
2] The progress value is updated at the leading edge of
X00005 X00005.
3] Counter coil (CU15) is turned on since the progress value ≥
OUT
CL15 set value.
4] The count value will not exceed 65535 (decimal).
CU15
5] The progress value and counter coil are cleared by counter
65 535 clear (CL15).
5 • The clear is performed under the conditions set
Set value 4 immediately prior to the execution of the counter coil
4
3 3 instruction.
Progress
value of 2
CU15 (TC15) 1
1] 2] 3] 4] 5]
5-33
Chapter 5 Instruction Specifications
Constant
R, TD, SS, WR, DR,
Usable I/O Other
X Y M CU, CT WX WY WM TC DX DY DM
• For the UP counter, increments the progress value by 1 each time the leading edge of the startup condition is detected , while
it decrements the progress value by 1 for the DOWN counter. The coil switches on when the progress value is greater than
or equal to the set value and switches off when the progress value is less than the set value. When the counter clear CL n
switches on, the progress value is cleared to 0 and the coil switches off.
• The progress value is set in TC n, and the value will be in the range of 0 to 65535 (decimal).
• If the progress value is updated during RUN, the operation will be performed using the new progress value at that point.
• If an I/O is set for the set value, the set value can be changed during operation by changing the I/O value, since the set
values are updated during each scan.
Notes
• A maximum of 256 points can be used for the timers and counters TD, SS, CU, CTU and CTD in total.
• The timer numbers and counter numbers cannot be overlapped.
• The numbers for the UP coil and DOWN coil must be the same.
• While the counter clear CL n is on, the rise of startup condition is ignored.
• Since the startup condition of the counter is edge detection, the condition for one scan may not be detected during the first
scan after RUN starts.
• If the set value is set to “0”, it is regarded as a coil that is always on and controlled by the CL n.
5-34
Chapter 5 Instruction Specifications
Program example
X00007 CTU17
OUT CTU n s
4 LD X00007
OUT CTD n
OUT CTU17 4
X00008 CTD17
LD X00008
OUT CTD17
X00009 CL17 LD X00009
OUT CL17
CT17 R107 LD CT17 z
OUT R107
• An example of a word I/O being used as the set value for the circuit shown above.
LD R7E3
R7E3
WR0017=4 [
WR0017=4
X00007 CTU17 ]
WR0017
LD X00007
X00008 CTD17 OUT CTU17 WR0017
LD X00008
X00009 CL17 OUT CTD17
LD X00009
OUT CL17
CT17 R107
LD CT17
OUT R107
Program description
6] The progress value will not exceed 65535 (decimal). Also, it will not be below 0.
7] When the counter clear (CL17) turns on, the progress value and the counter coil are cleared. The progress value is not
updated while the counter clear is on.
• The clear is performed under the conditions set immediatel before execution of the counter coil instruction.
• Example using the word I/O as the set value
When RUN is commenced, the set value is set to word I/O.
Or, the word I/O for the set value is designated to store in the power failure memor .
5-35
Chapter 5 Instruction Specifications
z z z z z
Instruction format Number of steps 0.9
s
Condition Steps
OUT CL n s — 1
Constant
R, TD, SS, WR, DR,
Usable I/O Other
X Y M CU, CT WX WY WM TC DX DY DM
• Clears the progress values of the integral timer and switches off the timer coil.
• In the case of WDT, the time monitor check is performed (see WDT for details).
• In the case of counters, the progress value is cleared and the counter coil is switched off.
• The clearing operation is conducted immediately before execution of the counter or timer coil instruction indicated by the
clear coil.
Example:
X00000 CL10 1) When X00000 is turned on, the CL10 immediately prior to CU10, and CU10
is cleared.
X00001 CU10 2) Even if X00002 turns on, if X00001 is off, the CL10 is turned off by the
circuit before CU10 is executed. Thus, the CU10 will not be cleared.
X00002 CL10
Notes
• The same number should be used for the timer number and counter number.
5-36
Chapter 5 Instruction Specifications
(s1 == s2)
OR (s1 == s2)
(See Function column) DER ERR SD V C Upper case: W
z z z z z 27 40 Lower case: DW
Instruction format Number of steps
LD
LD (s1 == s2) Condition Steps
AND (s1 == s2) Word (See Notes) 35 50
OR (s1 == s2) Double word (See Notes)
Bit Word Double word
Constant
R, TD, SS, WR, DR,
Usable I/O Other
X Y M CU, CT WX WY WM TC DX DY DM
s1 Relational number 1 { { { { { { { {
s2 Relational number 2 { { { { { { { {
Function
[Ladder format] s1 s1 s1
== == ==
s2 s2 s2
Notes
[Number of steps]
Program example
Program description
5-37
Chapter 5 Instruction Specifications
Item number Basic instructions-29 Name Signed = Relational box (SIGNED = RELATIONAL BOX)
Ladder format Condition code Processing time (µs) Remark
AND (s1 == s2)
OR (s1 == s2)
LD
z z z z z
Command format Number of steps 35 50
LD (s1 S== s2) Condition Steps
AND (s1 S== s2) Double word (See Cautionary notes)
OR (s1 S== s2)
Bit Word Double word
Constant
R, TD, SS, WR, DR,
Usable I/O X Y L, CU, CT WX WY WM TC DX DY DM Other
M
s1 Relational number 1 { { { {
s2 Relational number 2 { { { {
Function
[Ladder format] s1 s1 s1
S== S== S==
s2 s2 s2
b31 b0
z Compares s1 and s2 as signed double-word numbers, and
if s1 is equals to s2, it enters the continuity status (on) and
if s1 is not equal to s2, enters the noncontinuity status(off). Sign bit: 0 - Positive; 1 - Negative
Cautionary notes
[Number of steps]
Program example
Program description
5-38
Chapter 5 Instruction Specifications
Item number Basic instructions-30 Name <> Relational box (<> RELATIONAL BOX)
Ladder format Condition code Processing time (µs) Remark
LD
LD (s1 <> s2) Condition Steps
AND (s1 <> s2) Word (See Notes) 34.5 50
OR (s1 <> s2) Double word (See Notes)
Bit Word Double word
Constant
R, TD, SS, WR, DR,
Usable I/O Other
X Y M CU, CT WX WY WM TC DX DY DM
s1 Relational number 1 { { { { { { { {
s2 Relational number 2 { { { { { { { {
Function
[Ladder format] s1 s1 s1
<> <> <>
s2 s2 s2
Notes
[Number of steps]
Program example
Program description
5-39
Chapter 5 Instruction Specifications
LD
Constant
R, TD, SS, WR, DR,
Usable I/O X Y L, CU, CT WX WY WM TC DX DY DM Other
M
s1 Relational number 1 { { { {
s2 Relational number 2 { { { {
Function
[Ladder format] s1 s1 s1
S<> S<> S<>
s2 s2 s2
b31 b0
z Compares s1 and s2 as signed double-word numbers, and
if s1 is equals to s2, it enters the noncontinuity status (off) and
if s1 is not equal to s2, enters the continuity status (on). Sign bit: 0 - Positive; 1 - Negative
Cautionary notes
[Number of steps]
Program example
Program description
5-40
Chapter 5 Instruction Specifications
Constant
R, TD, SS, WR, DR,
Usable I/O Other
X Y M CU, CT WX WY WM TC DX DY DM
s1 Relational number 1 { { { { { { { {
s2 Relational number 2 { { { { { { { {
Function
[Ladder format] s1 s1 s1
< < <
s2 s2 s2
Notes
[Number of steps]
Program example
Program description
5-41
Chapter 5 Instruction Specifications
Item number Basic instructions-33 Name Signed<Relational box (SIGNED < RELATIONAL BOX)
Ladder format Condition code Processing time (µs) Remark
AND (s1 S < s2)
OR (s1 S < s2)
LD
z z z z z
Command format Number of steps 37.5 53
LD (s1 S< s2) Condition Steps
AND (s1 S< s2) Double word (See Cautionary notes)
OR (s1 S< s2)
Bit Word Double word
Constant
R, TD, SS, WR, DR,
Usable I/O X Y L, CU, CT WX WY WM TC DX DY DM Other
M
s1 Relational number 1 { { { {
s2 Relational number 2 { { { {
Function
[Ladder format] s1 s1 s1
S< S< S<
s2 s2 s2
b31 b0
z Compares s1 and s2 as signed double-word numbers, and
if s1 is less than s2, it enters the continuity status (on) and
if s1 is greater than or equal to s2, enters the noncontinuity status Sign bit: 0 - Positive; 1 - Negative
(off).
z s1, s2 – 2147483648 to + 2147483647 (decimal)
H80000000 to H7FFFFFFF (hexadecimal)
Cautionary notes
[Number of steps]
Program example
Program description
5-42
Chapter 5 Instruction Specifications
Constant
R, TD, SS, WR, DR,
Usable I/O Other
X Y M CU, CT WX WY WM TC DX DY DM
s1 Relational number 1 { { { { { { { {
s2 Relational number 2 { { { { { { { {
Function
[Ladder format] s1 s1 s1
<= <= <=
s2 s2 s2
Notes
[Number of steps]
Program example
Program description
5-43
Chapter 5 Instruction Specifications
Item number Basic instructions-35 Name Signed ≤ Relational box (SIGNED ≤ RELATINAL BOX)
Ladder format Condition code Processing time (µs) Remark
AND (s1 S <= s2)
OR (s1 S <= s2)
LD
Constant
R, TD, SS, WR, DR,
Usable I/O X Y L, WDT, MS, WX WY WL, TC DX DY DL, Other
M TMR, CU, WM DM
RCU, CT
s1 Relational number 1 { { { {
s2 Relational number 2 { { { {
Function
[Ladder format] s1 s1 s1
S<= S<= S<=
s2 s2 s2
b31 b0
z Compares s1 and s2 as signed double-word numbers, and
if s1 is less than or equal to s2, it enters the continuity status (on) and
if s1 is greater than s2, it enters the noncontinuity status (off). Sign bit: 0 - Positive; 1 - Negative
Cautionary notes
[Number of steps]
Program example
Program description
5-44
Chapter 5 Instruction Specifications
d=s
Bit Word Double word
Constant
R, TD, SS, WR, DR,
Usable I/O Other
X Y M CU, CT WX WY WM TC DX DY DM
d Substitution destination { { { { { { {
s Substitution source { { { { { { { { { { {
() Index value { { {
Function
Notes
• When using an array variable, DER is set to 1 if the usable I/O number exceeds the maximum value, and DER is reset to “0”
if it is normal.
• The combinations of d and s are as follows:
d s
Bit Bit
Word Word
Double word Double word
5-45
Chapter 5 Instruction Specifications
Program example
X00000 DIF0
WR0000 =WX0000 1]
X00001 DIF1
WR0000(WM000)=WX0000 2] Array variables are used at the
substitution destination
X00002 DIF2
WR0000 =WR0000(WM001) 3] Array variables are used at the
d=s
substitution source
X00003 DIF3
WR0000(WM000)=WR0000(WM001) 4] Array variables are used at both
substitution destination and source
Program description
1] The value of WX0000 is substituted into WR0000 at the leading edge of input X00000.
2] The value of WX0000 is substituted into the WR number designated by WR0000 + WM000 at the leading edge of input
X00001.
1) When WM000 = H0010, it holds the same meaning as WR0010 = WX0000.
3] The word number of the I/O advanced by the amount designated by WR0000 + WM001 due to the I/O assignment is
substituted into WR0000 at the leading edge of input X00002.
1) When WM001 = H0010, it hods the same meaning as WR0000 = WR0010.
4] The I/O value designated by WR0000 + WM001 at the leading edge of input X00003 is substituted into the I/O of the value
designated by WR0000 + WM000.
Example) When WM000 = H0010 and WM001 = H0015, it holds the same meaning as WR0010 = WR0015.
5-46
Chapter 5 Instruction Specifications
d = s1 + s2
Double word 6
Bit Word Double word
Constant
R, TD, SS, WR, DR,
Usable I/O Other
X Y M CU, CT WX WY WM TC DX DY DM
d Substitution destination { { { { {
s1 Augend { { { { { { { {
s2 Addend { { { { { { { {
Function
• Adds s1 and s2 as the binary data, and substitutes the result into d as the binary data.
• The C flag is set to “0” if the operation result is within the range of H0000 to HFFFF for word and H00000000 to
HFFFFFFFF for double word. Otherwise, It is set to “1.”
C = s1m x s2m + s1m x dm + s2m x dm
• The V flag is set to “1” if the operation result is meaningless as signed binary data, and “0” if it is meaningful.
s1 s2 d V
Positive Positive Positive 0 Most significant bit
Notes
d s1 s2
Word Word Word
Double word Double word Double word
Program example
Program description
• The sum of WR0000 and WR0001values is substituted into WR0002 at the leading edge of input X00000.
5-47
Chapter 5 Instruction Specifications
d = s1 B+ s2 Word 4 177
Double word 6
Bit Word Double word
Constant
R, TD, SS, WR, DR,
Usable I/O Other
X Y M CU, CT WX WY WM TC DX DY DM
d Substitution destination { { { { {
s1 Augend { { { { { { { {
s2 Addend { { { { { { { {
Function
• Adds s1 and s2 as the BCD data, and stores the result in d as the BCD data.
• The C flag is set to “1” if there is a digit increase, and “0” if not.
• The DER flag is set to “1” if the operation result s1 and s2 are invalid as the BCD data. If so, operation is not performed
and the C flag retains the previous state without outputting to d. If the s1 and s2 are valid as the BCD data, the DER is set to
“0.”
• When s1, s2 are words: 0000 to 9999 (BCD)
• When s1, s2 are double words: 00000000 to 99999999 (BCD)
Notes
d s1 s2
Word Word Word
Double word Double word Double word
Program example
Program description
• The sum of WR000 and WR001 values is substituted into WR002 as the BCD data at the leading edge of input X00000.
5-48
Chapter 5 Instruction Specifications
d = s1 – s2
Double word 6
Bit Word Double word
Constant
R, TD, SS, WR, DR,
Usable I/O Other
X Y M CU, CT WX WY WM TC DX DY DM
d Substitution destination { { { { {
s1 Minuend { { { { { { { {
s2 Subtrahend { { { { { { { {
Function
• Subtracts s2 from s1 as the binary data, and substitutes the result into d as the binary data.
• The C flag is set to “1” if there is a digit decrease, and “0” if not.
C = s1m x s2m + s1m x dm + s2m x dm
• The V flag is set to “1” if the operation result is a meaningless signed-binary data, and “0” if it has meaning.
s1 s2 d V
Most significant bit
Positive Positive Positive/Negative 0
s1m 0 s1
Negative Negative Positive/Negative 0
Positive Negative Positive 0 s2m 0 s2
−
Positive Negative Negative 1
Negative Positive Positive 1 C dm 0 d
Notes
d s1 s2
Word Word Word
Double word Double word Double word
Program example
X00000 LD X00000
WR0002 = WR0000 - WR0001 [
WR0002 = WR0000 - WR0001
]
Program description
• When input X00000 is on, the difference between WR0000 value and WR0001 value is substituted into WR0002.
5-49
Chapter 5 Instruction Specifications
d = s1 B– s2 Word 4 163
Double word 6
Bit Word Double word
Constant
TD, SS,
WDT, MS,
Usable I/O Other
R, TMR, CU, WR, DR,
X Y M RCU, CT WX WY WM TC DX DY DM
d Substitution destination { { { { {
s1 Minuend { { { { { { { {
s2 Subtrahend { { { { { { { {
Function
• Subtracts s2 from s1 as the BCD data, and substitutes the result into d as the BCD data.
• The C flag is set to “1” if there is a digit decrease, and “0” if not.
• The DER flag is set to “1” if s1 or s2 is not a valid BCD data. If so, operation is not performed and the C flag retains the
previous state without outputting to d. If the s1 and s2 are valid BCD data, the DER is set to “0.”
Notes
d s1 s2
Word Word Word
Double word Double word Double word
Program example
X00000 LD X00000
WR0003 = WR0004 B- WR0005 [
WR0003 = WR0004 B- WR0005
]
Program description
• When input X00000 is on, the difference between WR0004 value and WR0005 value is substituted into WR0003 as BCD
data.
5-50
Chapter 5 Instruction Specifications
d = s1 x s2
Double word 6
Bit Word Double word
Constant
R, TD, SS, WR, DR,
Usable I/O Other
X Y M CU, CT WX WY WM TC DX DY DM
d Substitution destination { { { { {
s1 Multiplicand { { { { { { { {
s2 Multiplier { { { { { { { {
Function
• Multiplies s1 and s2 as the binary data, and substitutes the result into d+1 (upper digit) and d (lower digit) in binary.
• The DER flag is set to “1” if d+1 exceeds the usable I/O range (in this case only the lower word is substituted), and “0”
when it does not exceed.
DR0016 DR0014
Notes
d s1 s2
Word Word Word
Double word Double word Double word
• Since the operation results are always substituted into d and d + 1, note that the word or double-word at d + 1 is not used as
the I/O of others.
Program example
X00000 LD X00000
WR0002 = WR0000 * WR0001 [
WR0002 = WR0000 * WR0001
]
Program description
• When input X00000 is on, the product of WR0000 value and WR0001 value is substituted into WR0002.
5-51
Chapter 5 Instruction Specifications
d = s1 B× s2 Word 4 447
Double word 6
Bit Word Double word
Constant
R, TD, SS, WR, DR,
Usable I/O Other
X Y M CU, CT WX WY WM TC DX DY DM
d Substitution destination { { { { {
s1 Multiplicand { { { { { { { {
s2 Multiplier { { { { { { { {
Function
• Multiplies s1 and s2 as the BCD data, and substitutes the result into d+1 (upper digit) and d (lower digit) as the BCD data.
• The DER flag is set to “1” if s1 or s2 is an invalid BCD data. In this case, the operation is not performed. Also, if d+1
exceeds the usable I/O range, the DER flag is set to “1” and only the lower digit word is substituted. The DER flag is set to
“0” if s1 and s2 are valid BCD data and d+1 is within the usable I/O range.
DR0024 DR0022
Notes
d s1 s2
Word Word Word
Double word Double word Double word
• Since the operation results are always substituted into d and d + 1, note that the word or double-word at d + 1 is not used as
the I/O of others.
Program example
X00000 LD X00000
WR0016 = WR0014 B* WR0015 [
WR0016 = WR0014 B * WR0015
]
Program description
• When input X00000 is on, the product of WR0014 value and WR0015 value is substituted into WR0016 as the BCD data.
5-52
Chapter 5 Instruction Specifications
Condition Steps
d = s1 S x s2
d = s1 S× s2 Double word 6
Constant
R, TD, SS, WR, DR,
Usable I/O X Y L, CU, CT WX WY WM TC DX DY DM Other
M
d Substitution destination { {
s1 Multiplicand { { { {
s2 Multiplier { { { {
Function
z Multiplies s1 and s2 as signed binary data, and substitutes the result into d+1 (upper digit) and d (lower digit) as signed
binary.
z The DER flag is 1 if d+1 exceeds the usable I/O range (in this case only the lower digit word is substituted), and 0 when it
does not.
DR0033 DR0031
The sign of the operation result is entered in the most significant bit.
z s1, s2 – 2147483648 to +2147483647 (decimal)
H80000000 to H7FFFFFFF (hexadecimal)
Cautionary notes
z The operation result is always assigned to d and d+1. Be sure not to use word or double word d+1 as the I/O of other
functions.
Program example
X00000 LD X00000
DR0031 = DR0026 S * DR0028 [
DR0031 = DR0026 S * DR0028
]
Program description
z When input X00000 turns on, the product of the values in DR0026 and DR0028 is substituted into DR0031 as signed
binary data.
5-53
Chapter 5 Instruction Specifications
d = s1 / s2 Word 4 110
Double word 6
Bit Word Double word
Constant
R, TD, SS, WR, DR,
Usable I/O Other
X Y M CU, CT WX WY WM TC DX DY DM
d Substitution destination { { { { {
s1 Dividend { { { { { { { {
s2 Divisor { { { { { { { {
Function
• Divides s1 by s2 as the binary data and substitutes the quotient into d in binary. The remainder is set in the special internal
output WRF016 (DRF016 in the case of double word).
• The DER flag is set to “1” if s2 is “0,” and the operation is not performed. As long as s2 is not set to “0”, the flag is set to
“0” and the operation is performed.
WR0041 WR0040
WR0041 WR0043 WR0046 WR0045
DR0043 DR0045
Notes
d s1 s2
Word Word Word
Double word Double word Double word
Program example
X00000 LD X00000
WR0042 = WR0040 / WR0041 [
WR0042 = WR0040 / WR0041
]
Program description
• When input X00000 is on, the value of WR0040 is divided by the value of WR0041, then substituted into WR0042. The
remainder is substituted into special internal output WRF016.
5-54
Chapter 5 Instruction Specifications
d = s1 B/. s2
d = s1 B/ s2 Words 4 253
Double word 6
Bit Word Double word
Constant
R, TD, SS, WR, DR,
Usable I/O Other
X Y M CU, CT WX WY WM TC DX DY DM
d Substitution destination { { { { {
s1 Dividend { { { { { { { {
s2 Divisor { { { { { { { {
Function
• Divides s1 by s2 as the BCD data, and substitutes the quotient into d in the BCD data. The remainder is set in the special
internal output WRF016 (DRF016 in the case of double word).
• The DER flag is set to “1” if s1 or s2 is an invalid BCD data or when s2 is set to “0”. In this case the operation is not
performed. If both s1 and s2 are valid BCD data and s2 is not set to “0,” the operation is performed.
WR0050 WR0049
Notes
d s1 s2
Word Word Word
Double word Double word Double word
Program example
X00000 LD X00000
WR0051 = WR0049 B/ WR0050 [
WR0051 = WR0049 B/ WR0050
]
Program description
• When input X00000 is on, the value of WR0049 is divided by the value of WR0050, then substituted into WR0051 as the
BCD data.
The reminder is substituted into WRF016 as the BCD data.
5-55
Chapter 5 Instruction Specifications
Item number Arithmetic instructions-11 Name Signed binary division (SIGNED BINARY DIVISION)
Ladder format Condition code Processing time (µs) Remark
R7F4 R7F3 R7F2 R7F1 R7F0 Average Maximum
d = s1 S/ s2 DER ERR SD V C
↕ z z ↕ z
Command format Number of steps 101
Condition Steps
d = s1 S/ s2
d = s1 S/ s2 Double word 6
Constant
R, TD, SS, WR, DR,
Usable I/O X Y L, CU, CT WX WY WM TC DX DY DM Other
M
d Substitution destination { {
s1 Dividend { { { {
s2 Divisor { { { {
Function
z Divides s1 by s2 as signed binary data, and substitutes the quotient into d in signed binary data. The remainder is set in the
special internal output DRF016 signed binary data.
z The DER flag is 1 if s2 is 0, and the operation is not performed. As long as s2 is not 0, it is 0 and the operation is
performed.
z The V flag is 1 when the quotient is a positive value and exceeds H7FFFFFFF. Otherwise, it is 0.
Program example
X00000 LD X00000
DR0060 = DR0056 S/ DR0058 [
DR0060 = DR0056 S/ DR0058
]
Program description
z When input X00000 turns on, the value of DR0056 is divided by the value in DR0058, then substituted into DR0060 as
signed binary data. The remainder is substituted into special internal output DRF016 as signed binary data.
5-56
Chapter 5 Instruction Specifications
d = s1 OR s2
d = s1 OR s2 Bit, word 4 86
Double word 6
Bit Word Double word
Constant
R, TD, SS, WR, DR,
Usable I/O Other
X Y M CU, CT WX WY WM TC DX DY DM
d Substitution destination { { { { { { {
s1 Comparand { { { { { { { { { { {
s2 Relational number { { { { { { { { { { {
Function
s1 s2 d
0 0 0
0 1 1
1 0 1
1 1 1
Notes
d s1 s2
Bit Bit Bit
Word Word Word
Double word Double word Double word
Program example
Program description
• At the leading edge of X00110, the OR of WR0100 and WR0101 is set in WR0102.
5-57
Chapter 5 Instruction Specifications
Constant
R, TD, SS, WR, DR,
Usable I/O Other
X Y M CU, CT WX WY WM TC DX DY DM
d Substitution destination { { { { { { {
s1 Comparand { { { { { { { { { { {
s2 Relational number { { { { { { { { { { {
Function
s1 s2 d
0 0 0
0 1 0
1 0 0
1 1 1
Notes
d s1 s2
Bit Bit Bit
Word Word Word
Double word Double word Double word
Program example
Program description
• At the leading edge of X00111, the AND of WR0100 and WR0101 is set in WR0102.
5-58
Chapter 5 Instruction Specifications
d = s1 XOR s2
d = s1 XOR s2 Bit, word 4 66
Double word 6
Bit Word Double word
Constant
R, TD, SS, WR, DR,
Usable I/O Other
X Y M CU, CT WX WY WM TC DX DY DM
d Substitution destination { { { { { { {
s1 Comparand { { { { { { { { { { {
s2 Relational number { { { { { { { { { { {
Function
• Obtains exclusive OR (XOR) of s1 and s2, and substitutes the result into d.
s1 s2 d
0 0 0
0 1 1
1 0 1
1 1 0
Notes
d s1 s2
Bit Bit Bit
Word Word Word
Double word Double word Double word
Program example
Program description
• At the leading edge of X00112, the XOR of WR0100 and WR0101 is set in WR0102.
5-59
Chapter 5 Instruction Specifications
d = s1 == s2 s is a word 4 48
s is a double word 6
Bit Word Double word
Constant
R, TD, SS, WR, DR,
Usable I/O Other
X Y M CU, CT WX WY WM TC DX DY DM
d Substitution destination { {
s1 Comparand { { { { { { { {
s2 Relational number { { { { { { { {
Function
• Substitutes “1” when s1 is equal to s2 and otherwise “0” into d, assuming s1 and s2 as binary data.
Notes
d s1 s2
Bit Word Word
Bit Double word Double word
Program example
[
M0000 = WX0000 = = WX0001 M0000 = WX0000 = = WX0001
]
Program description
• When WX0000 = WX0001, M0000 is set to “1.” Otherwise, M0000 is reset to “0.”
5-60
Chapter 5 Instruction Specifications
d = s1 S== s2
d = s1 S== s2 s is a double word 6
Constant
R, TD, SS, WR, DR,
Usable I/O X Y L, CU, CT WX WY WM TC DX DY DM Other
M
d Substitution destination { {
s1 Comparand { { { {
s2 Relational number { { { {
Function
z Substitutes 1 when s1 is equal to s2 and otherwise 0 into d, assuming s1 and s2 as signed binary data.
z s1 and s2 are both signed binary data. When the most significant bit is 0, the value is positive; when the most significant
bit is 1, the value is negative.
s1, s2 – 2147483648 to +2147483647 (decimal)
H80000000 to H7FFFFFFF (hexadecimal)
Program example
[
M0000 = DR0000 S== DR0002 M0000 = DR0000 S== DR0002
]
Program description
z When the values of DR0000 and DR0002 are equal, 1 is set in M0000. Otherwise, M0000 is reset to 0.
5-61
Chapter 5 Instruction Specifications
d = s1 <> s2 s is a word 4 46
s is a double Word 6
Bit Word Double word
Constant
R, TD, SS, WR, DR,
Usable I/O Other
X Y M CU, CT WX WY WM TC DX DY DM
d Substitution destination { {
s1 Comparand { { { { { { { {
s2 Relational number { { { { { { { {
Function
• Substitutes 1 when s1 is not equal to s2 and otherwise 0 into d, assuming s1 and s2 as binary data.
Notes
d s1 s2
Bit Word Word
Bit Double word Double word
Program example
[
Y00000= WR0000 < > WR0001 Y00000= WR0000 < > WR0001
]
Program description
• When WR0000 ≠ WR0001, “1” is set in Y00000. Otherwise, Y00000 is reset to “0.”
5-62
Chapter 5 Instruction Specifications
d = s1 S<> s2
d = s1 S<> s2 s is a double word 6
Constant
R, TD, SS, WR, DR,
Usable I/O X Y L, CU, CT WX WY WM TC DX DY DM Other
M
d Substitution destination { {
s1 Comparand { { { {
s2 Relational number { { { {
Function
z Substitutes 1 when s1 is not equal to s2 and otherwise 0 into d, assuming s1 and s2 as signed binary data.
z s1 and s2 are both signed binary data. When the most significant bit is 0, the value is positive; when the most significant
bit is 1, the value is negative.
s1, s2 – 2147483648 to +2147483647 (decimal)
H80000000 to H7FFFFFFF (hexadecimal)
Program example
[
Y00100 = DR0000 S<> DR0002 Y00100 = DR0000 S<> DR0002
]
Program description
z When the values of DR0000 and DR0002 are not equal, Y00100 is turned on. Otherwise, Y00100 is turned off.
5-63
Chapter 5 Instruction Specifications
Item number Arithmetic instructions-19 Name < Relational expression (< RELATIONAL EXPRESSION)
Ladder format Condition code Processing time (µs) Remark
R7F4 R7F3 R7F2 R7F1 R7F0 Average Maximum
d = s1 < s2 DER ERR SD V C Upper case: W
z z z z z 40 Lower case: DW
Instruction format Number of steps
Condition Steps
d = s1 < s2
d = s1 < s2 s is a word 4 70
s is a double word 6
Bit Word Double word
Constant
R, TD, SS, WR, DR,
Usable I/O Other
X Y M CU, CT WX WY WM TC DX DY DM
d Substitution destination { {
s1 Comparand { { { { { { { {
s2 Relational number { { { { { { { {
Function
• Substitutes “1” when s1 is less than s2 and otherwise “0” into d, assuming s1 and s2 as binary data.
Notes
d s1 s2
Bit Word Word
Bit Double word Double word
Program example
[
R0 = TC100 < TC101 R0 = TC100 < TC101
]
Program description
5-64
Chapter 5 Instruction Specifications
d = s1 S< s2
d = s1 S< s2 s is a double word 6
Constant
R, TD, SS, WR, DR,
Usable I/O X Y L, CU, CT WX WY WM TC DX DY DM Other
M
d Substitution destination { {
s1 Comparand { { { {
s2 Relational number { { { {
Function
z Substitutes 1 when s1 is less than s2 and otherwise 0 into d, assuming s1 and s2 as signed binary data.
z s1 and s2 are both signed binary data. When the most significant bit is 0, the value is positive; when the most significant
bit is 1, the value is negative.
s1, s2 – 2147483648 to +2147483647 (decimal)
H80000000 to H7FFFFFFF (hexadecimal)
Program example
[
R100 = DM000 S< DM002 R100 = DM000 S< DM002
]
Program description
z When the value in DM000 is less than the value in DM002, 1 is set in R100. Otherwise, R100 is reset to 0.
5-65
Chapter 5 Instruction Specifications
d = s1 <= s2 s is a word 4 71
s is a double word 6
Bit Word Double word
Constant
R, TD, SS, WR, DR,
Usable I/O Other
X Y M CU, CT WX WY WM TC DX DY DM
d Substitution destination { {
s1 Comparand { { { { { { { {
s2 Relational number { { { { { { { {
Function
• Substitutes “1” when s1 is less than or equal to s2 and otherwise “0” into d, assuming s1 and s2 as binary data.
Notes
d s1 s2
Bit Word Word
Bit Double word Double word
Program example
[
Y00001 = WR10 <= WR100 Y00001 = WR10 <= WR100
]
Program description
• When WR10 ≤ WR100, Y00001 is set to “1.” Otherwise, Y00001 is reset to “0.”
5-66
Chapter 5 Instruction Specifications
d = s1 S<= s2
d = s1 S<= s2 s is a double word 6
Constant
R, TD, SS, WR, DR,
Usable I/O X Y L, CU, CT WX WY WM TC DX DY DM Other
M
d Substitution destination { {
s1 Comparand { { { {
s2 Relational number { { { {
Function
z Substitutes 1 when s1 is less than or equal to s2 and otherwise 0 into d, assuming s1 and s2 as signed binary data.
z s1 and s2 are both signed binary data. When the most significant bit is 0, the value is positive; when the most significant
bit is 1, the value is negative.
s1, s2 – 2147483648 to +2147483647 (decimal)
H80000000 to H7FFFFFFF (hexadecimal)
Program example
[
Y00100 = DR10 S<= DR100 Y00100 = DR10 S<= DR100
]
Program description
z When the value in DR10 is less than or equal the value in DR100, Y00100 is turned on. Otherwise, Y00100 is turned off.
5-67
Chapter 5 Instruction Specifications
Constant
R, TD, SS, WR, DR,
Usable I/O Other
X Y M CU, CT WX WY WM TC DX DY DM
BEST (d, n)
• Sets the nth bit in the I/O (word or double word) specified by d to “1.”
• Other bit contents are unaltered.
“1” is set.
If d is a word: Designates the bit location depending on the contents (0 to 15) of the lower 4 bits (b3 to b0) of n (WX,
WY, WR, WM, TC). (Upper bits are ignored and considered as “0.”)
The n (constant) can be set to 0 to 15 (decimal).
If d is a double word: Designates the bit location depending on the contents (0 to 31) of the lower 5 bits (b4 to b0) of n (WX,
WY, WR, WM, TC). (Upper bits are ignored and considered as “0.”)
The n (constant) can be set to 0 to 31 (decimal).
5-68
Chapter 5 Instruction Specifications
Constant
R, TD, SS, WR, DR,
Usable I/O Other
X Y M CU, CT WX WY WM TC DX DY DM
BRES (d, n)
d I/O to be set the bit { { { { {
The constant is set in
n Bit location to be reset { { { { {
decimal.
Function
• Sets the nth bit in the I/O (word or double word) specified by d to “0.”
• Other bit contents are unaltered.
Reset to “0”.
If d is a word: Designates the bit location depending on the contents (0 to 15) of the lower 4 bits (b3 to b0) of n (WX,
WY, WR, WM, TC). (Upper bits are ignored and considered as “0.”)
The n (constant) can be set to 0 to 15 (decimal).
If d is a double word: Designates the bit location depending on the contents (0 to 31) of the lower 5 bits (b4 to b0) of n (WX,
WY, WR, WM, TC). (Upper bits are ignored and considered as “0.”)
The n (constant) can be set to 0 to 31 (decimal).
5-69
Chapter 5 Instruction Specifications
Constant
R, TD, SS, WR, DR,
Usable I/O Other
X Y M CU, CT WX WY WM TC DX DY DM
BTS (d, n)
d I/O to be tested { { { { {
The constant is set in
n Bit location to be tested { { { { {
decimal.
Function
• Checks the contents of the nth bit of the I/O (word or double word) specified b d, and if the result is “1,” '1' is set to C
(R7F0). If the result is “0,” C (R7F0) is reset to “0.”
• The contents of d remains unaltered.
C (R7F0)
If d is a word: Designates the bit location depending on the contents (0 to 15) of the lower 4 bits (b3 to b0) of n (WX,
WY, WR, WM, TC). (Upper bits are ignored and considered as “0.”)
The n (constant) can be set to 0 to 15 (decimal).
If d is a double word: Designates the bit location depending on the contents (0 to 31) of the lower 5 bits (b4 to b0) of n (WX,
WY, WR, WM, TC). (Upper bits are ignored and considered as “0.”)
The n (constant) can be set to 0 to 31 (decimal).
Program example
5-70
Chapter 5 Instruction Specifications
Program description
If DR0100 = H00000000, DR0102 = HFFFFFFFF and DR0104 = H5555AAAA are set, the 20th bit of DR0100 is set to “1” b
the BSET at the leading edge of X00000.
b31 b20 b0
DR0100=00000000000000000000000000000000
BTS (d, n)
b31 b20 b0
DR0102=11111111111111111111111111111111
b31 b20 b0
DR0104=01010101010101011010101010101010
5-71
Chapter 5 Instruction Specifications
Constant
R, TD, SS, WR, DR,
Usable I/O Other
X Y M CU, CT WX WY WM TC DX DY DM
SHR (d, n)
d I/O to be shifted { { { { {
Number of bits to be The constant is set in
n { { { { {
shifted decimal.
Function
• Shifts the contents of d to the right (toward the lower digits) by n bits.
• Sets n bits of SD (R7F2) contents starting with the most significant bit.
• Sets the content of the nth bit from the least significant bit in C (R7F0).
Before execution
d
n bits
SD B
SD (R7F2) C (R7F0)
After execution
SD SD SD SD SD B
n bits
If d is a word: Designates the shift amount, depending on the contents (0 to 15) of the lower 4 bits (b3 to b0) of n
(WX, WY, WR, WM, TC). (Upper bits are ignored and considered as “0.”)
The n (constant) can be set to 0 to 15 (decimal).
If d is a double word: Designates the shift amount, depending on the contents (0 to 31) of the lower 5 bits (b4 to b0) of n
(WX, WY, WR, WM, TC). (Upper bits are ignored and considered as “0.”)
The n (constant) can be set to 0 to 31 (decimal).
Notes
• If n is equal to “0,” the shifting is not performed. The previous state is retained in C.
5-72
Chapter 5 Instruction Specifications
Program example
LD X00000
X00000 R7F2
OUT R7F2
X00000 . . . . . Defective unit input
To SD LD X00001
X00001 DIF1 AND DIF1
SHR (DR0000,1) X00001 . . . . . Conveyor movement [
SHR (DR0000,1)
R7F0 Y00100 ]
Y00001 . . . . . Defective unit output LD R7F0
Carry
OUT Y00100
Program description
• There exists a conveyor that has 16 stands and is moving to the right.
• Each time the conveyor moves one stand to the right, a pulse input enters X1.
• There is a sensor on the left end of the conveyor, and when a defective unit is placed on the conveyor, X00000 turns on.
SHR (d, n)
X00000 (sensor input) and X00001 (conveyor movement) signals are as follows:
X00000
X00001
• As the conveyor moves to the right, the data is also shifted one bit at a time, and when data exits to the carry (on the right
end of the conveyor), the (Y00100) solenoid valve turns on and rejects the defective unit.
X00001
Conveyor movement
X00000 Y00000
b16 b0
0 1 0 0 1 0 0 0 0 1 0
SD (R7F2) C (R7F0)
Shifts one bit at a time
5-73
Chapter 5 Instruction Specifications
Constant
R, TD, SS, WR, DR,
Usable I/O Other
X Y M CU, CT WX WY WM TC DX DY DM
SHL (d, n)
d I/O to be shifted { { { { {
Number of bits to be The constant is set in
n { { { { {
shifted decimal.
Function
• Shifts the contents of d to the left (toward the upper digits) by n bits.
• Sets n bits of SD (R7F2) contents starting with the least significant bit.
• Sets the content of the nth bit from the most significant bit in C (R7F0).
d
Before execution
n bits
B SD
C (R7F0) SD (R7F2)
After execution
B SD SD SD SD SD
n bits
Most significant bit (MSB) Least significant bit (LSB)
If d is a word: Designates the shift amount, depending on the contents (0 to 15) of the lower 4 bits (b3 to b0) of n
(WX, WY, WR, WM, TC). (Upper bits are ignored and considered as “0.”)
The n (constant) can be set to 0 to 15 (decimal).
If d is a double word: Designates the shift amount, depending on the contents (0 to 31) of the lower 5 bits (b4 to b0) of n
(WX, WY, WR, WM, TC). (Upper bits are ignored and considered as “0.”)
The n (constant) can be set to 0 to 31 (decimal).
Notes
• If n is equal to “0,” the shifting is not performed. The previous state is retained in C.
Program example
Program description
5-74
Chapter 5 Instruction Specifications
Constant
R, TD, SS, WR, DR,
Usable I/O Other
X Y M CU, CT WX WY WM TC DX DY DM
ROR (d, n)
d I/O to be rotated { { { { {
Number of bits to be The constant is set in
n { { { { {
rotated decimal.
Function
• Rotates the contents of d to the right (toward the lower digits) by n bits.
• The content of the least significant bit is input to C (R7F0) while the content of C (R7F0) is input to the most significant bit.
This is repeated n times.
• The content of C (R7F0) is set in the nth bit from the most significant bit.
• The content of the nth bit from the least significant bit is set in C (R7F0).
Before execution d
n bits
Bn B3 B2 B1
C (R7F0)
After execution
Bn-1 B3 B2 B1 C Bn
n bits
Most significant bit (MSB) Least significant bit (LSB)
If d is a word: Designates the shift amount, depending on the contents (0 to 15) of the lower 4 bits (b3 to b0) of n
(WX, WY, WR, WM, TC). (Upper bits are ignored and considered as “0.”)
The n (constant) can be set to 0 to 15 (decimal).
If d is a double word: Designates the shift amount, depending on the contents (0 to 31) of the lower 5 bits (b4 to b0) of n
(WX, WY, WR, WM, TC). (Upper bits are ignored and considered as “0.”)
The n (constant) can be set to 0 to 31 (decimal).
Notes
• If n is equal to “0,” the rotation is not performed. The previous state is retained in C.
Program example
Program description
5-75
Chapter 5 Instruction Specifications
Constant
R, TD, SS, WR, DR,
Usable I/O Other
X Y M CU, CT WX WY WM TC DX DY DM
ROL (d, n)
d I/O to be rotated { { { { {
Number of bits to be The constant is set in
n { { { { {
rotated decimal.
Function
• Rotates the contents of d to the left (toward the upper digits) by n bits.
• The content of C (R7F0) is set in the nth bit from the least significant bit.
• The content of the nth bit from the least significant bit is set in C (R7F0).
Before execution
d
n bits
B1 B2 B3 Bn
C (R7F0)
After execution
Bn C B1 B2 B3 Bn-1
n bits
Most significant bit (MSB) Least significant bit (LSB)
If d is a word: Designates the shift amount, depending on the contents (0 to 15) of the lower 4 bits (b3 to b0) of n
(WX, WY, WR, WM, TC). (Upper bits are ignored and considered as “0.”)
The n (constant) can be set to 0 to 15 (decimal).
If d is a double word: Designates the shift amount, depending on the contents (0 to 31) of the lower 5 bits (b4 to b0) of n
(WX, WY, WR, WM, TC). (Upper bits are ignored and considered as “0.”)
The n (constant) can be set to 0 to 31 (decimal).
Notes
• If n is equal to “0,” the rotation is not performed. The previous state is retained in C.
5-76
Chapter 5 Instruction Specifications
Program example
Program description
• When X00001 rises, the 64-bit data is shifted one bit at a time.
The space after the shift is filled with “0.”
Overall movement
ROL (d, n)
C b31 DR0002 b0 C b31 DR0000 b0 C (R7F0)
0 0
DR0000 b31
5-77
Chapter 5 Instruction Specifications
Item number Application instructions-8 Name Logical shift right (LOGICAL SHIFT RIGHT)
Ladder format Condition code Processing time (µs) Remark
R7F4 R7F3 R7F2 R7F1 R7F0 Average Maximum
LSR (d, n) DER ERR SD V C Upper case: W
z z z z ↕ 36 Lower case: DW
Instruction format Number of steps
Condition Steps
LSR (d, n) 3 45
Constant
R, TD, SS, WR, DR,
Usable I/O Other
X Y M CU, CT WX WY WM TC DX DY DM
LSR (d, n)
d I/O to be shifted { { { { {
Number of bits to be The constant is set in
n { { { { {
shifted decimal.
Function
• Shifts the contents of d to the right (toward the lower digits) by n bits.
• “0” is set from the most significant bit to the nth bit.
• The content of the nth bit from the least significant bit is set in C (R7F0).
Before execution d
n bits
B
C (R7F0)
After execution
0 0 0 0 0 B (R7F0)
n bits
Most significant bit (MSB) Least significant bit (LSB)
If d is a word: Designates the shift amount, depending on the contents (0 to 15) of the lower 4 bits (b3 to b0) of n
(WX, WY, WR, WM, TC). (Upper bits are ignored and considered as “0.”)
The n (constant) can be set to 0 to 15 (decimal).
If d is a double word: Designates the shift amount, depending on the contents (0 to 31) of the lower 5 bits (b4 to b0) of n
(WX, WY, WR, WM, TC). (Upper bits are ignored and considered as “0.”)
The n (constant) can be set to 0 to 31 (decimal).
Notes
• If n is equal to “0,” the shifting is not performed. The previous state is retained in C.
Program example
Program description
• When X00001 rises, the content of WR0000 is shifted to the right by one bit.
At this time, “0” is set in b15 and the value of b0 immediately prior to the shift is set in R7F0.
5-78
Chapter 5 Instruction Specifications
Item number Application instructions-9 Name Logical shift left (LOGICAL SHIFT LEFT)
Ladder format Condition code Processing time (µs) Remark
R7F4 R7F3 R7F2 R7F1 R7F0 Average Maximum
LSL (d, n) DER ERR SD V C Upper case: W
z z z z ↕ 36 Lower case: DW
Instruction format Number of steps
Condition Steps
LSL (d, n) 3 45
Constant
R, TD, SS, WR, DR,
Usable I/O Other
X Y M CU, CT WX WY WM TC DX DY DM
LSL (d, n)
d I/O to be shifted { { { { {
Number of bits to be The constant is set in
n { { { { {
shifted decimal.
Function
• Shifts the contents of d to the left (toward the upper digits) by n bits.
• “0” is set from the least significant bit to the nth bit.
• The content of the nth bit from the most significant bit is set in C (R7F0).
Before execution d
n bits
B
C (R7F0)
After execution
B 0 0 0 0 0
n bits
Most significant bit (MSB) Least significant bit (LSB)
If d is a word: Designates the shift amount, depending on the contents (0 to 15) of the lower 4 bits (b3 to b0) of n
(WX, WY, WR, WM, TC). (Upper bits are ignored and considered as “0.”)
The n (constant) can be set to 0 to 15 (decimal).
If d is a double word: Designates the shift amount, depending on the contents (0 to 31) of the lower 5 bits (b4 to b0) of n
(WX, WY, WR, WM, TC). (Upper bits are ignored and considered as “0.”)
The n (constant) can be set to 0 to 31 (decimal).
Notes
• If n is equal to “0,” the shifting is not performed. The previous state is retained in C.
Program example
Program description
• When X00001 rises, the content of WR0000 is shifted to the left by one bit.
At this time, “0” is set in b0 and the value of b15 immediately prior to the shift is set in R7F0.
5-79
Chapter 5 Instruction Specifications
Item number Application instructions-10 Name BCD shift right (BCD SHIFT RIGHT)
Ladder format Condition code Processing time (µs) Remark
R7F4 R7F3 R7F2 R7F1 R7F0 Average Maximum
BSR (d, n) DER ERR SD V C Upper case: W
z z z z z 32 Lower case: DW
Instruction format Number of steps
Condition Steps
BSR (d, n) 3 40
Constant
R, TD, SS, WR, DR,
Usable I/O Other
X Y M CU, CT WX WY WM TC DX DY DM
BSR (d, n)
d I/O to be shifted { { { { {
Number of digits to be The constant is set in
n { { { { {
shifted decimal.
Function
• Shifts the contents of d to the right (toward the lower digits) by n digits (1 digit is equivalent to 4 bits).
• “0” is set from the most significant bit to the nth digit.
• The digits from least significant bit to the nth digit are discarded.
0 0000 0000
n digits
Most significant bit (MSB) Least significant bit LSB)
If d is a word: Designates the shift amount, depending on the contents (0 to 3) of the lower 2 bits (b1, b0) of n (WX,
WY, WR, WM, TC). (Upper bits are ignored and considered as “0.”)
The n (constant) can be set to 0 to 3 (decimal).
If d is a double word: Designates the shift amount, depending on the contents (0 to 7) of the lower 3 bits (b2 to b0) of n
(WX, WY, WR, WM, TC). (Upper bits are ignored and considered as “0.”)
The n (constant) can be set to 0 to 7 (decimal).
Notes
Program example
Program description
• When X00001 rises, the content of WR0000 is regarded as BCD code and shifted to the right by four bits.
At this time, the values in the lower 4 bits (b3 to b0) are deleted and “0000” is set in the upper four bits (b1 2 to b15).
5-80
Chapter 5 Instruction Specifications
Item number Application instructions-11 Name BCD shift left (BCD SHIFT LEFT)
Ladder format Condition code Processing time (µs) Remark
R7F4 R7F3 R7F2 R7F1 R7F0 Average Maximum
BSL (d, n) DER ERR SD V C Upper case: W
z z z z z 32 Lower case: DW
Instruction format Number of steps
Condition Steps
BSL (d, n) 3 39
Constant
R, TD, SS, WR, DR,
Usable I/O Other
X Y M CU, CT WX WY WM TC DX DY DM
BSL (d, n)
d I/O to be shifted { { { { {
Number of digits to be The constant is set in
n { { { { {
shifted decimal.
Function
• Shifts the contents of d to the left (toward the upper digits) by n digits (one digit is equivalent to 4 bits).
• “0” is set from the least significant bit to the nth digit.
• The digits from the most significant bit to the nth digit are discarded.
d
Before execution n digits
Discarded
After execution 0
0000 0000
n digits
Most significant bit (MSB) Least significant bit (LSB)
If d is a word: Designates the shift amount, depending on the contents (0 to 3) of the lower 2 bits (b1, b0) of n (WX,
WY, WR, WM, TC). (Upper bits are ignored and considered as “0.”)
The n (constant) can be set to 0 to 3 (decimal).
If d is a double word: Designates the shift amount, depending on the contents (0 to 7) of the lower 3 bits (b2 to b0) of n
(WX, WY, WR, WM, TC). (Upper bits are ignored and considered as “0.”)
The n (constant) can be set to 0 to 7 (decimal).
Notes
Program example
Program description
• When X00001 rises, the content of WR0000 is regarded as BCD code and shifted to the left by four bits.
At this time, the data of the lower four bits are deleted and “0000” is set in the upper four bits.
5-81
Chapter 5 Instruction Specifications
MOV (d, s, n) 4
Constant
R, TD, SS, WR, DR,
Usable I/O Other
X Y M CU, CT WX WY WM TC DX DY DM
MOV (d, s, n)
n bits (words)
Before execution
s+n-1
s
After execution
d+n-1 d
If n is a word: The contents (0 to 255) of the lower 8 bits (b7 to b0) of n (WX, WY, WR, WM, TC) are set to the
number of bits (words) to be transferred.
If n is a constant: 0 to 255 (decimal) can be designated for the number of bits (words) to be transferred.
Notes
• Use this instruction so that d + n − 1 and s + n − 1 do not exceed the I/O range (R7BF, M3FFF, WRFFF, and WM3FF). If
the I/O range is exceeded, DER is equal to '1' and the transfer is performed to the maximum range.
• If n is equal to “0,” the block transfer is not performed and DER (R7F4) will be set to “0.”
5-82
Chapter 5 Instruction Specifications
Program example
R001 DIF0
MOV (WR020,WM000,32)
R7F4 Y00100
SET
LD R001
AND DIF0
[
MOV (WR020,WM000,32)
]
LD R7F4
SET Y00100
MOV (d, s, n)
Program description
WM020
WR01F
WM03F
5-83
Chapter 5 Instruction Specifications
COPY (d, s, n) 4
Constant
R, TD, SS, WR, DR,
Usable I/O Other
X Y M CU, CT WX WY WM TC DX DY DM
COPY (d, s, n)
s s s s s s s s s s
d+n-1 d
n bits (words)
If n is a word: The contents (0 to 255) of the lower 8 bits (b7 to b0) of n (WX, WY, WR, WM, TC) are set to the
number of bits (words) to be copied.
If n is a constant: 0 to 255 (decimal) can be designated for the number of bits (words) to be copied.
Notes
• Use this instruction so that d + n - 1 does not exceed the I/O range (R7BF, M3FFF, WRFFF, and WM3FF). If it exceeds the
I/O range, DER is equal to '1' and transfers to the maximum range.
• If n is equal to “0,” the block copy is not be performed and DER (R7F4) will be set to “0.”
5-84
Chapter 5 Instruction Specifications
Program example
R7E3 LD R7E3
COPY (WR0100, H2020,255)
[
COPY (WR0100, H2020, 255)
]
Program description
WR0100 to WR01FE is considered as the communication data area and is filled with space code (H20) as the default value
during the first scan after RUN starts.
R7E3: The first scan ON after RUN
WR0100 WR0100
Not fixed Not fixed H20 H20
COPY (d, s, n)
H20 H20
• •
• •
• •
• •
• •
• • 255 words
• •
• • (510 bytes)
After RUN
H20 H20
Not fixed Not fixed H20 H20
WR01FE WR01FE
5-85
Chapter 5 Instruction Specifications
Constant
R, TD, SS, WR, DR,
Usable I/O Other
X Y M CU, CT WX WY WM TC DX DY DM
XCG (d1, d2, n)
Exchange destination
d1 { {
head I/O
d2 Exchange source head I/O { {
Number of bits (words) The constant is set in
n { { { { {
to be exchanged decimal.
Function
• Exchanges the contents of the n bits from d1 to d1 + n - 1 and the contents between d2 and d2 + n - 1.
• Bits are exchanged with bits and words are exchanged with words.
n bits (words)
d1+n-1
d1
d2
d2+n-1
If n is a word: The contents (0 to 255) of the lower 8 bits (b7 to b0) of n (WX, WY, WR, WM, TC) are set to the
number of bits (words) to be exchanged.
If n is a constant: 0 to 255 (decimal) can be designated for the number of bits (words) to be exchanged.
Notes
• Use this instruction so that d1 + − 1 and d2 + n - 1 do not exceed the I/O range (R7BF, M3FFF, WRFFF, and WM3FF). If they
exceeds the I/O range, DER is equal to '1' and the exchange is performed up to the maximum range with respect to the smaller number
of bits (words) specified in d1 and d2.
• If n is equal to “0,” the block exchange is not performed and DER (R7F4) will be set to “0.”
Program example
Program description
• When X00001 rises, the contents of WM000 to WM0FF are exchanged with the contents of WM100 to WM1FF.
P rocessing tim e (µs) (A verage)
n
Bit Word
1 139 120
16 338 159
32 528 207
64 918 284
128 1899 449
255 3695 779
5-86
Chapter 5 Instruction Specifications
Constant
R, TD, SS, WR, DR,
Usable I/O Other
X Y M CU, CT WX WY WM TC DX DY DM
NOT (d)
d I/O to be reversed { { { { { {
Function
Before execution
1 1 1 1 0 0 0 0 1 1 1 1 0 0 0 0
After execution
0 0 0 0 1 1 1 1 0 0 0 0 1 1 1 1
Notes
Program example
LD R000
AND DIF0
R000 DIF0
[
NOT (WR0000)
NOT WR0000
]
Program description
5-87
Chapter 5 Instruction Specifications
Constant
R, TD, SS, WR, DR,
Usable I/O Other
X Y M CU, CT WX WY WM TC DX DY DM
NEG (d)
• Calculates two's complements of d (Reverses each bit contained in d and adds “1.” However, C (R7F0) remains
unchanged).
Before execution 1 1 0 0 1 1 0 0 0 0 0 1 1 0 1 0
0 0 1 1 0 0 1 1 1 1 1 0 0 1 0 1
1
+
After execution 0 0 1 1 0 0 1 1 1 1 1 0 0 1 1 0
Notes
Program example
LD R000
AND DIF0
R000 DIF0
NEG (WR0000) [
NEG WR0000
]
Program description
5-88
Chapter 5 Instruction Specifications
Constant
R, TD, SS, WR, DR,
Usable I/O Other
X Y M CU, CT WX WY WM TC DX DY DM
ABS (d, s)
I/O after absolute value is
d { { { {
taken
I/O before absolute value
s { { { { { { { {
is taken
Function
Example:
R000 DIF0
ABS (WR0000, WM0000)
d s d s+1
R7F0 R7F0
WM0000 0 1 0 0 1 1 0 0 0 0 0 1 1 0 1 0 0 WM0000 1 1 0 0 1 1 0 0 0 0 0 1 1 0 1 0 0
s s
0011001111100101
+ 1
WR0000 0 1 0 0 1 1 0 0 0 0 0 1 1 0 1 0 0 WR0000 0 0 1 1 0 0 1 1 1 1 1 0 0 1 1 0 1
d d
Notes
5-89
Chapter 5 Instruction Specifications
Constant
R, TD, SS, WR, DR,
Usable I/O Other
X Y M CU, CT WX WY WM TC DX DY DM
BCD (d, s)
Before execution s
1 B 4 F
0 0 0 1 1 0 1 1 0 1 0 0 1 1 1 1 (Binary
1B4FH=6991
After execution d
6 9 9 1
0 1 1 0 1 0 0 1 1 0 0 1 0 0 0 1 (BCD)
Combinations of d and s.
d s
Word Word
Double word Double word
Notes
Program example
X00000 LD X00000
BCD (WM0010, WR000 ) [
BCD (WM0010, WR000)
]
Program description
• When X00000 turns on, the content of WR000 is converted from binary to BCD and output to WM0010.
WR000 H1B4F
After conversion
WM0010 H6691
5-90
Chapter 5 Instruction Specifications
Constant
R, TD, SS, WR, DR,
Usable I/O Other
X Y M CU, CT WX WY WM TC DX DY DM
BIN (d, s)
d I/O after conversion (BIN) { { { {
I/O before conversion
s { { { { { { { {
(BCD)
Function
Before execution s
6 9 9 1
0 1 1 0 1 0 0 1 1 0 0 1 0 0 0 1 (BCD)
After execution d
1 B 4 F
0 0 0 1 1 0 1 1 0 1 0 0 1 1 1 1 (Binary
Combinations of d and s.
d s
Word Word
Double word Double word
Notes
Program example
X00000 LD X00000
BIN (WM0010, WR000 ) [
BIN (WM0010, WR000)
]
Program description
• When X00000 turns on, the content of WR000 is converted from BCD to binary and output.
WR000 H6691
After conversion
WM0010 H1B4F
5-91
Chapter 5 Instruction Specifications
DECO (d, s, n) 4
Constant
R, TD, SS, WR, DR,
Usable I/O Other
X Y M CU, CT WX WY WM TC DX DY DM
DECO (d, s, n)
• Decodes the lower n bits of s to 2 n and outputs '1' to the decoded bits in the bit rows between d and d + 2 n – 1 (where n = 1
to 8). Note that the value “0” is output for bits other than the decoded bits in the bit row d + 2 n – 1.
• If n is “0,” the instruction will not be executed, and the contents of d to d + 2 n – 1 remain unchanged.
n bits (n = 1 to 8) n
2
Notes
• Use this instruction so that d + 2 n– 1 does not exceed the I/O range (R7BF and M3FFF). If it exceeds the I/O range, DER is
equal to '1' and the decoding is performed at the maximum range starting from d.
• Use 1 to 8 for n.
Program example
LD R100
R100 DIF1 AND DIF1
DECO (R000, WX0000, 4) [
DECO (R000, WX0000, 4)
]
Program description
• When WX0000 = H000F, R00F, which is the 15th bit from R000 among the bits indicated by the lower four bit values of
WX0000, is set to “1” upon leading of R100.
5-92
Chapter 5 Instruction Specifications
ENCO (d, s, n) 4
Constant
R, TD, SS, WR, DR,
Usable I/O Other
X Y M CU, CT WX WY WM TC DX DY DM
ENCO (d, s, n)
d Decode destination head I/O { {
s Word I/O to be encoded {
Number of bits to be
n { 1 to 8 (decimal)
encoded
Function
• Encodes the bit location 2 n in the range between s and s + 2 n – 1 where the bit is “1,” and outputs the result to d (n = 1 to 8).
Upper bits (16-n) of d are set to “0.”
• If n is “0,” the instruction will not be executed and the contents of d retain the original values.
• If there are more than one bits that are set to “1” between s and s + 2 n – 1, the upper bit location will be encoded.
• If all the bits from s to s + 2 n – 1 are '0', '0' is output to d, and C (R7F0) is equal to '1.' In other cases, C (R7F0) is set to '0.'
n
s+2 -1 s+B s b15 b7 b0
0 1 0 0 d 0BH
n
2 n bits (1 to 8)
Notes
• Use this instruction so that s + 2n− 1 does not exceed the I/O range (R7BF and M3FFF). If it exceeds the I/O range, DER is
set to '1' and the encoding is performed at the maximum range starting from s.
• Use 1 to 8 for n.
Program example
LD X00001
X00001 DIF1 AND DIF1
ENCO (WR0000, R000, 4)
[
ENCO (WR0000, R000, 4)
]
Program description
• Upon the leading of X00001, the most significant bit that is set to “1” is detected within the row of bits R000 to R00F (2 4 –1
= 15 bits), and a four-bit binary number is set in the word I/O of d.
Example) If “1” is set in the 7th and 6th bits of R000 to R00F, H0007 is set in WR0000.
Processing time (µs)
n
Average Maximum
1 128 –
2 128 –
3 128 –
4 187 –
5 126 –
6 126 –
7 126 –
8 126 –
5-93
Chapter 5 Instruction Specifications
Constant
R, TD, SS, WR, DR,
Usable I/O Other
X Y M CU, CT WX WY WM TC DX DY DM
BCU (d, s)
• Of the contents of s (16 bits for word and 32 bits for double word), the number of bits that are set to “1” are output to d (0 to
32).
15 5 0 15(32) 0
• • • • • • • • • • • • • • • • • • • •
d s 1 1 1 1 1 1 1 1 1
Program example
LD X00002
X00002 DIF2 AND DIF2
BCU (WR0000, DR0020)
[
BCU (WR0000, DR0020)
]
Program description
• At the leading edge of X00002, the number of bits that are set to “1” among the data input to DR0020 is counted, and set to
WR0000.
Example)
In the case of
A 7 1 4 F 1 5 3
DR0020 = 1 0 1 0 0 1 1 1 0 0 0 1 0 1 0 0 1 1 1 1 0 0 0 1 0 1 0 1 0 0 1 1
5-94
Chapter 5 Instruction Specifications
Constant
R, TD, SS, WR, DR,
Usable I/O Other
X Y M CU, CT WX WY WM TC DX DY DM
SWAP (d)
d I/O to be exchanged { {
Function
(Before execution) d 0 0 0 1 1 1 0 1 0 1 1 0 1 1 0 1
(After execution) d 0 1 1 0 1 1 0 1 0 0 0 1 1 1 0 1
Notes
Program example
Program description
• The upper and lower bits of WR0010 are swapped at the leading edge of X00000, and are stored in WR0010.
WR0010 H1234 Before execution
WR0010 H3412 After execution
Note: Since a scan is executed when there is no leading edge DIF0, the upper and lower bits of WR0010 are swapped ever
time a scan is executed.
5-95
Chapter 5 Instruction Specifications
UNIT (d, s, n) 4
Constant
R, TD, SS, WR, DR,
Usable I/O Other
X Y M CU, CT WX WY WM TC DX DY DM
UNIT (d, s, n)
• Sets the values in the lower four bits of each of the n (1 to 4) words starting from s to the lower four bits of each word in d.
• If n is 1 to 3, the bits not set in d will be “0.”
• The data stored in s to s + n – 1 will be retained even if UNIT is executed.
• Use this instruction so that s + n - 1 does not exceed the I/O range (WRFFF and WM3FF). If it exceeds the I/O range, DER
is equal to '1' and the lower four bits within the range between s and I/O will be set in d.
Notes
5-96
Chapter 5 Instruction Specifications
Program example
X00001 DIF0
UNIT (WY0010, WR0000, 3)
LD X00001
AND DIF0
[
UNIT (WY0010, WR0000, 3)
]
Program description
A 3-digit BCD input display device is connected to the WY0010, and each digit displays WR0000 to WR0002 data
independently. (Only the lower four bits are considered the valid data for WR0000 to WR0002.)
UNIT (d, s, n)
3-digit BCD input display device
Input
Line No. Conveyor No. Product No.
28-point type
Output
3 2 7
WR0002
(Line No.) Data “3”
WR0001
(Conveyor No.) Data “2”
WR0000
(Product No.) Data “7”
5-97
Chapter 5 Instruction Specifications
DIST (d, s, n) 4
Constant
R, TD, SS, WR, DR,
Usable I/O Other
X Y M CU, CT WX WY WM TC DX DY DM
DIST (d, s, n)
• Distributes s into four bit sections and sets to the lower four bits of the n words starting from d.
• The upper 12 bits of the range d to d + n – 1 will be “0.”
• The value of s will be retained even if DIST is executed.
• Use this instruction so that d + n - 1 does not exceed the I/O range (WRFFF and WM3FF). If it exceeds the I/O range, DER
is equal to '1' and the distribution data for s will be set in the lower four bits within the range between d and the I/O.
d 0 0 B1
d+1 0 0 B2
d+2 0 0 B3
d+3 0 0 B4
Notes
5-98
Chapter 5 Instruction Specifications
Program example
X01001 DIF0
DIST (WR0000, WX0000, 4)
LD X00001
AND DIF0
[
DIST (WR0000, WX0000, 4)
]
Program description
A 4-bit 4-digit Digit switch is connected to the WX0000, and the data for each digit is stored in WR0000 to WR0003 as
independent data.
Input
DIST (d, s, n)
28-point type
Output
9 7 4 6
WR0002
=H0007
WR0001
=H0004
WR0000
=H0006
5-99
Chapter 5 Instruction Specifications
Constant
R, TD, SS, WR, DR,
Usable I/O Other
X Y M CU, CT WX WY WM TC DX DY DM
Function
• Indicates the end of a normal scan program. (The execution of this instruction returns to the beginning of the program, and
a normal scan is executed.)
• This instruction is not required when there are no subroutine programs or interrupt scan programs.
•
END
If there is a subroutine program or interrupting program, write this instruction at the end of the normal scan program.
• This instruction is used only once in a program. Do not use any startup conditions with this instruction.
Notes
• The END instruction is checked prior to the execution, and if there is an error, the following error codes are set in the
special internal output WRF001. Also, the CPU error code '34' is set to special internal output WRF000.
CPU error code Special internal output Error code Error description
H0010 There is no END instruction.
34 WRF001 H0022 There are two or more END instructions.
A startup condition is used with the END
H0032
instruction.
SB n Subroutine program
5-100
Chapter 5 Instruction Specifications
Item number Control instructions-2 Name Scan conditional end (CONDITIONAL END)
Ladder format Condition code Processing time (µs) Remark
R7F4 R7F3 R7F2 R7F1 R7F0 Average Maximum
CEND (s) DER ERR SD V C Upper case :
z z z z z 5 Conditions
Instruction format Number of steps do not meet
Condition Steps Lower case :
CEND (s) 2 707 Conditions meet
Constant
R, TD, SS, WR, DR,
Usable I/O Other
X Y M CU, CT WX WY WM TC DX DY DM
• If the scan end condition (s) is on, the execution of this instruction returns to the head of the scan program and executes the
program.
• If (s) is off, the next instruction is executed.
CEND (s)
• This instruction can only be used in normal scan programs, and can be used as many times as desired.
• This instruction can specify a startup condition. In this case, if the startup condition and (s) are both on, this ins truction is
executed.
Notes
• The CEND instruction is checked prior to the execution, and if there is an error, the following error codes are set in the
special internal output WRF001. Also, the CPU error code '34' is set to special internal output WRF000.
CPU error code Special internal output Error code Error description
The CEND instruction is found after the END
34 WRF001 H0023
instruction.
Program head
Normal scan program When R000 is on, to
program head
CEND (R000)
When R000 is off, the next
instruction is executed.
Normal scan program When R001 is on, to
program
CEND (R001)
When R001 is off, the next
instruction is executed.
Normal scan program
END
5-101
Chapter 5 Instruction Specifications
Constant
R, TD, SS, WR, DR,
Usable I/O Other
X Y M CU, CT WX WY WM TC DX DY DM
• If the startup condition of JMP n switches on, the control jumps the program from this instruction to the LBL n of the same
code number. Always use JMP n and LBL n in pairs.
• If the startup condition is not established, the next instruction will be executed.
JMP n
• To set this instruction in conjunction with other instructions in the same arithmetic-operation box, insert this instruction at
the end of the box.
• The JMP n instruction is valid only within the same scan program. (A jump to a subroutine or interrupt scan cannot be
performed from a normal scan, nor vice versa.)
• Nesting of JMP n instructions is possible, but note so that an overload error does not occur.
Notes
• This instruction is checked prior to the execution, and if there is an error, the following error codes are set in the special
internal outputs R7F3 and WRF015. In this case, jump is not performed and the next instruction will be executed.
LBL n
Program
5-102
Chapter 5 Instruction Specifications
Constant
R, TD, SS, WR, DR,
Usable I/O Other
X Y M CU, CT WX WY WM TC DX DY DM
• If the jump condition (s) of CJMP n(s) switches on, the control jumps the program from this instruction to the LBL n of the
CJMP n (s)
same code number. Always use CJMP n(s) and LBL n in pairs.
• If the startup or jump condition is not established, the next instruction will be executed.
• To set this instruction in conjunction with other instructions in the same arithmetic-operation box, caution must be used
because the jump takes place without performing the operations specified after the instruction.
• The CJMP n(s) instruction is valid only within the same scan program. (A jump to a subroutine or interrupt scan cannot be
performed from a normal scan, nor vice versa.)
• Nesting of CJMP n(s) instructions is possible, but note so that an overload error does not occur.
Notes
• This instruction is checked prior to the execution, and if there is an error, the following error codes are set in the special
internal outputs R7F3 and WRF015. In this case, jump is not performed and the next instruction will be executed.
R101
CJMP n (R000)
• When the startup condition and the R000 jump condition bit I/O are both on, it
jumps to LBL n.
• If there is a timer within the program it jumped to, the progress value is updated,
Program but since instructions are not executed, output will not be turned on even if the
ON conditions are met.
LBL n
Program
?????
5-103
Chapter 5 Instruction Specifications
1] LBL n with the same code number as the code 6] An overlap of JMP instructions with the same code
number n of the JMP instruction is required. number is valid.
JMP 5
JMP 1 • If JMP 1 is executed when there JMP 5
Program A
is no LBL 1, an LBL undefined CJMP 5
error occurs. JMP 1 will do
LBL 2 nothing and execute the next
Program B
processing of program A.
LBL 5
X00003
LBL 4
Subroutine area JMP 5 similar processing. Program C
LBL 6
LBL 0
PTS
INTO
Interrupt scan area JMP 6
LBL 5
JMP 7 8] The CJMP instruction also follows the same syntax as 1]
LBL 1 through 7]
RTI
5-104
Chapter 5 Instruction Specifications
Constant
R, TD, SS, WR, DR,
Usable I/O Other
X Y M CU, CT WX WY WM TC DX DY DM
• This instruction indicates the destination of the jump when the JMP n or CJMP n instruction is executed (n is always used in
pairs).
• The n in the LBL n cannot be used multiple times in the same program.
LBL n
• This instruction itself does not perform any operation.
• Even if a startup condition is used with LBL n, it will be ignored.
Notes
• This instruction is checked prior to execution, and when there is an error, the following error code is set in the special
internal output WRF001. Also, the CPU error code '34' is set to special internal output WRF000.
CPU error code Special internal output Error code Error description
34 WRF001 H0001 Duplicate definition of LBL
R100 (00001)
JMP 0
LBL 0 (00003)
R100 (00004)
JMP 1
LBL 1 (00006)
• When R100 is on, JMP 0 will be executed but JMP 1 will not be executed.
Therefore, the content of WR0000 will decrement by one during each scan.
• When R100 is off, JMP 0 will not be executed but JMP 1 will be executed.
Therefore, the content of WR0000 will increment by one during each scan.
5-105
Chapter 5 Instruction Specifications
Constant
R, TD, SS, WR, DR,
Usable I/O Other
X Y M CU, CT WX WY WM TC DX DY DM
• Jumps from the NEXT n of the same code number to this instruction.
FOR n (s)
• If the number of times repeated (s) is greater than 0, the instruction following the FOR n (s) is executed.
• If the number of times repeated (s) is equal to 0, it jumps to the instruction following the NEXT n.
• Use FOR n (s) and NEXT n in pairs. Also, place the NEXT n after FOR n.
• The FOR n (s) may not be used more than once.
• Use the FOR n (s) and NEXT n in the same program area. (It is not allowed to include FOR n (s) in the normal scan and
NEXT n in the subroutine area.)
• The FOR n (s) to NEXT n nesting can be made up to five levels.
Notes
• This instruction is checked prior to execution, and when there is an error, the following error code is set in the special
internal output WRF001. Also, the CPU error code '34' is set to special internal output WRF000.
CPU error code Special internal output Error code Error description
34 WRF001 H0001 Duplicate definition of FOR
• If an error is generated during the execution of the instruction, an error code will be set in the special internal outputs R7F3
and WRF015, and the following program will be executed.
5-106
Chapter 5 Instruction Specifications
Constant
R, TD, SS, WR, DR,
Usable I/O Other
X Y M CU, CT WX WY WM TC DX DY DM
• Subtracts 1 from the number of times repeated (s) for the FORn (s) instruction of the same code number, then jumps to
FORn (s).
NEXT n
Notes
• This instruction is checked prior to execution, and when there is an error, the following error code is set in the special
internal output WRF001. Also, the CPU error code '34' is set to special internal output WRF000.
CPU error code Special internal output Error code Error description
34 WRF001 H0003 Duplicate definition of NEXT
• If an error is generated during the execution of the instruction, an error code will be set in the special internal outputs R7F3
and WRF015, and the following program will be executed.
R000 DIF0
• When R000 is turned on, the progress value (TC n) of the timer or counter is
WR0000 = 512 cleared with 0 for 512 points.
WR0001 = 0
• Once the FOR to NEXT starts, the instruction keeps executing until (s) is “0.”
When
WR0000 > 0
FOR 0(WR0000 • FOR0 (WR0000) performs instructions after TC0 (WR0001) = 0 while
TC0(WR0001) = 0
WR0001 = WR0001 + 1 WR0000>0, subtracts “1” from WR0000 at NEXT0, then jumps to FOR0
NEXT 0 (WR0000).
When
• FOR0 (WR0000) jumps to the next instruction within the current box upon
WR0000 = 0 WR0000 = 0.
To the next program
5-107
Chapter 5 Instruction Specifications
1] A NEXT instruction with the same code number as the 5] It is possible to escape from a FOR to NEXT loop
code number n of the FOR instruction is required after using a jump instruction.
the FOR instruction.
FOR 1 (WR0010) FOR 1 (WM001) The FOR 1 to NEXT 1 loop is
Program • NEXT undefined error escaped when X00000 turns
The NEXT instruction wit CJMP 10 (X00000) before the loop has been repeated
NEXT 2 respect to the FOR instruction NEXT 1 for the set number of repeats
Program does not exist within the user (content of WM001)
program. LBL10
INT0
Interrupt scan NEXT 4 Program A
NEXT 1
RT1 R005
WR0010=1
5-108
Chapter 5 Instruction Specifications
Constant
R, TD, SS, WR, DR,
Usable I/O Other
X Y M CU, CT WX WY WM TC DX DY DM
• If the startup condition of CAL n is on, this instructions executes the subroutine program (the program sandwiched by SB n and
RTS) of the same code number.
• If the startup condition is off, the next program is executed.
CAL n
• Up to 5 levels of CAL (nesting) for another subroutine can be performed within a subroutine.
• It is possible to call a subroutine from within an interrupt scan program.
Notes
• If an error is generated during the execution of the instruction, an error code will be set in the special internal outputs R7 F3 and
WRF015, and the following program will be executed.
SB n
Subroutine program
RTS
5-109
Chapter 5 Instruction Specifications
Constant
R, TD, SS, WR, DR,
Usable I/O Other
X Y M CU, CT WX WY WM TC DX DY DM
• This instruction indicates the start of a subroutine program (processing is not performed).
• The n in the SB n cannot be used more than once in the same program.
• Even if a startup condition is used for SB n, it will be ignored.
•
SB n
Notes
• This instruction is checked prior to execution, and when there is an error, the following error code is set in the special
internal output WRF001. Also, the CPU error code '34' is set to special internal output WRF000.
CPU error code Special internal output Error code Error description
34 WRF001 H0004 Duplicate definition of SB
H0013 SB undefined
SB 0
Subroutine 0 program
SB 1
5-110
Chapter 5 Instruction Specifications
Item number Control instructions-10 Name End of subroutine program (RETURN SUBROUTINE)
Ladder format Condition code Processing time (µs) Remark
R7F4 R7F3 R7F2 R7F1 R7F0 Average Maximum
RTS DER ERR SD V C
z z z z z
Instruction format Number of steps 25
Condition Steps
RTS 1
Constant
R, TD, SS, WR, DR,
Usable I/O Other
X Y M CU, CT WX WY WM TC DX DY DM
Function
RTS
the subroutine.
• Do not set a startup condition with this instruction.
Notes
• This instruction is checked prior to execution, and when there is an error, the following error code is set in the sp ecial
internal output WRF001. Also, the CPU error code '34' is set to special internal output WRF000.
CPU error code Special internal output Error code Error description
H0011 SB undefined
34 WRF001 H0020 SB area error
H0030 RTS startup condition error
1] 2] 3] 1] The program is executed when R000 and R001 are both off
R000 2] The program is executed when R000 is on and R001 is off
CAL 0
CAL 0 is executed, then the subroutine 0 program is executed.
END
CAL 1 is not executed, the subroutine 0 program is terminated and the
SB 0
Subroutine 0 execution is returned to the code following the CAL 0.
R001 program 3] The program is executed when R000 and R001 are both on
CAL 1
Subroutine 0 program CAL 0 is executed, then the subroutine 0 program is executed.
RTS CAL 1 is executed, then the subroutine 1 program is executed.
SB 1
The subroutine 1 program is completed and execution is returned to the code
Subroutine 1 program
following the CAL 1.
RTS
The subroutine 0 program is completed and execution is returned to the code
following the CAL 0.
5-111
Chapter 5 Instruction Specifications
Item number Control instructions-11 Name Start interrupt scan program (INTERRUPT)
Ladder format Condition code Processing time (µs) Remark
R7F4 R7F3 R7F2 R7F1 R7F0 Average Maximum
INT n DER ERR SD V C
z z z z z
Instruction format Number of steps 0.5
Condition Steps
INT n 1
Constant
R, TD, SS, WR, DR,
Usable I/O Other
X Y M CU, CT WX WY WM TC DX DY DM
0 to 2 , 16 to 19, 20
n Interrupt priorit {
to 27 (Decimal)
Function
• It is set to the 10 ms periodic scan when n = 0, 20 ms periodic scan when n = 1, and 40 ms periodic interrupt scan when n =
2.
• The smaller the number n, the higher the interrupt priority.
• Always use INT n and RTI in pairs.
• Even if a startup condition is used for INT n, it will be ignored.
• Code the INT n to RTI subroutine program after the END instruction.
• The n in INT n cannot be used more than once within the same program.
Notes
• This instruction is checked prior to execution, and when there is an error, the following error code is set in the special
internal output WRF001. Also, the CPU error code '34' is set to special internal output WRF000.
CPU error code Special internal output Error code Error description
34 WRF001 H0005 Duplicate definition of INT
H0014 INT undefined
• The program between INT0 and RTI is started and executed every 10 ms.
END
INT 0 INT 0
10 ms interrupt scan program scan
RTI
5-112
Chapter 5 Instruction Specifications
Item number Control instructions-12 Name End interrupt scan program (RETURN INTERRUPT)
Ladder format Condition code Processing time (µs) Remark
R7F4 R7F3 R7F2 R7F1 R7F0 Average Maximum
RTI DER ERR SD V C
z z z z z
Instruction format Number of steps 0.5
Condition Steps
RTI 1
Constant
R, TD, SS, WR, DR,
Usable I/O Other
X Y M CU, CT WX WY WM TC DX DY DM
Function
RTI
performed.
• Do not set a startup condition with this instruction.
Notes
• This instruction is checked prior to execution, and when there is an error, the following error code is set in the special
internal output WRF001. Also, the CPU error code '34' is set to special internal output WRF000.
CPU error code Special internal output Error code Error description
H0012 RTI undefined
34 WRF001 H0021 RTI area error
H0031 RTI startup condition error
INT 0
• A 0.01s timer is created using 10 ms interval interrupt.
• WM000, WR0000 and R000 are used for the set value, progress value
X00000 WR0000=0 and timer coil, respectivel .
R000=0 • When X00000 is off, the progress value and timer coil are cleared.
• When X00000 is on, the progress value increments by 1 every 10 ms.
X00000
WR0000=WR0000+1 • The timer coil is turned on upon WM000 is less than or equal to
WR0000.
WM000
R000
<= SET
WR0000
RTI
5-113
Chapter 5 Instruction Specifications
1] A subroutine can be programmed between a normal scan 5] It is also possible to program a subroutine wit
and interrupt scan, between two interrupt scans, or after multiple entry points and one exit.
the final interrupt scan.
SB 1
JMP 1
SB 1 SB 2 SB 3
Program head SB 2
SB 1 JMP 1 JMP 1
Normal scan Subroutine 1
END RTS JMP 1
Subroutine area SB 2
Subroutine 2 LBL 1 SB 3
Interrupt INT 1 RTS
scan RTI RTS
SB 10 Subroutine 10
Subroutine area RTS LBL 1
Interrupt INT 2 RTS
SB 11
scan RTI Subroutine 11
RTS
Subroutine area
SB 12 Subroutine 12
Program end RTS
6] It is also possible to program a interrupt scan with
many entry points and one exit.
2] Program the subroutine start (SB n) and subroutine INT 0 INT 1 INT 2 INT 0
end (RTS) instructions without specifying startup JMP 1
JMP 1 JMP 1
conditions. INT 2
JMP 1
INT 1
Startup LBL 1
condition SB n
RTI
RTI LBL 1
Program RTI
1st level 2nd level 3rd level 4th level 5th level
3] Program the interrupt scan start (INT n) and scan complete SB 1
SB 20
(RTI) instructions without specifying startup conditions. SB 30
CAL 30 SB 40
SB 50
CAL 20 CAL 40 CAL 50
RTS
RTS RTS
Startup RTS
condition INT n RTS
Program
Startup
condition RT1 Program head
END
SB 20
RTS (1) As shown to the left, the subroutine
4] The same subroutine can be called from a normal scan, SB 1 program order and nesting order
interrupt scan or subroutine. RTS have no relationship.
INT 0
5-114
Chapter 5 Instruction Specifications
Constant
R, TD, SS, WR, DR,
Usable I/O Other
X Y M CU, CT WX WY WM TC DX DY DM
s Argument (dummy) {
Function
• This instruction performs I/O refresh of all data in the external I/Os (including link area) during scanning.
* ( ) indicates the display when the Ladder Editor is used.
Notes
FUN 80 (s)
Program example
FUN 80 (WR0) 1]
X0 Y100
2]
FUN 80 (WR0) 3]
Program description
1 scan 1 scan
I/O refresh
I/O refresh
FUN 80 1] FUN 80 3]
Program execution 2]
5-115
Chapter 5 Instruction Specifications
Constant
R, TD, SS, WR, DR,
Usable I/O Other
X Y M CU, CT WX WY WM TC DX DY DM
s Type {
Function
• Depending on the I/O type of the area specified by s, refresh is performed with respect to I/O modules only, output modules
only.
• Refresh is performed by each slot assignment according to the I/O assignment.
• If the refresh processing is completed normally, DER is set to '0.'
FUN 81 (s)
Notes
• If the I/O type is other than H00 or H01, DER is set to “1” and no processing will be performed.
• If the argument s exceeds the maximum I/O number, DER is set to “1” and no processing will be performed.
Program example
Program description
5-116
Chapter 5 Instruction Specifications
Constant
R, TD, SS, WR, DR,
Usable I/O Other
X Y M CU, CT WX WY WM TC DX DY DM
s Number of points {
s+1 and Designate the slot
beyond
Slot location number {
location.
Function
: :
: :
FUN 82 (s)
s+n Refresh slot location number
• Performs refresh of the designated module for the number of points specified by s, starting with area s+1.
• Refresh is performed by slot.
• The slot location numbers stored in areas s+1 and subsequent are designated by the unit number and slot number.
• The maximum number of points to be refreshed (n) is 64 points. The points exceeding 64 points are not refreshed.
• If refresh processing is completed normally, DER is set to “0.”
* ( ) indicates the display when the Ladder Editor is used.
Program example
Program description
• Upon leading of R000, the two slots designated after WR0001 (unit 0, slot 0) and (unit 1, slot 0) are refreshed.
5-117
Chapter 5 Instruction Specifications
Notes
• Set the unit number (0 to 3) and slot number (0 to 1) after s+1. For other set values, DER is set to “1” and that slot will not
be processed.
• If there is no I/O assignment to the designated slot, DER is set to “1” and that slot will not be processed.
• If the number of s+n points exceeds the maximum I/O number, DER is set to “1” and no processing will be performed.
• If the number of points exceeds 64, DER is set to “1” and the points exceeding 64 will not be processed (refresh will be
performed for up to 64 points).
b15 b12 b7 b3 b0
0 to 0 0 to 0 Unit number Slot number
FUN 82 (s)
5-118
Chapter 5 Instruction Specifications
Constant
R, TD, SS, WR, DR,
Usable I/O Other
X Y M CU, CT WX WY WM TC DX DY DM
Argument (Counter
s number, operation {
control value)
Function
15 87 0
Counter number: H01 to H04
S Counter number Operation instruction Operation instruction: H00 – Stop,
H01 – Start
• Performs the starting and stopping of the count operation for the specified counter.
• If a value other than H01 to H04 is specified for the counter number and the operation instruction is set to a value other than
H00 or H01, DER will be set to “1” and no processing will be performed.
• If the specified counter number is set to a function other than a corresponding external I/O counter (single-phase counter,
two-phase counter), DER will be set to “1” and no processing will be performed.
• Since Counter 4 is invalid when a 10-point CPU is used, if Counter 4 is specified, DER will be set to “1” and no processing
will be performed.
• If the specified counter number is unable to make an output (PI/O function setting result by R7F5), DER will be set to “1”
and no processing will be performed.
• This instruction is only used to start and stop the counter operation. Other counter settings will not be changed.
• The counter operation will start after the power is turned back on even if the power is turned off when the count operation is
stopped by this instruction. The operation of the high-speed counter will be stopped only when this instruction specifies the
stop instruction.
• The counter operation will continue when the CPU operation is stopped.
• When the count operation stops, the progress value update also stops. When starting the count operation, the progress value
is cleared and then the operation starts.
Program example
LD R0
R0 DIF0 AND DIF0
WR0 = H0101 [
FUN 140 (WR0) WR0 = H101
FUN 140 ( WR0 )
]
Program description
• Prior to starting a counter operation, various settings required for the counter operation are reflected in the special internal
outputs, and the PI/O function setting flag (R7F5) is turned on while the CPU is being stopped.
For details on the special internal output settings, see Chapter 8.
Starts the counter No. 1 operation.
5-119
Chapter 5 Instruction Specifications
Item number FUN instructions-5 Name High-speed Counter Coincidence Output Control
Ladder format Condition code Processing time (µs) Remark
R7F4 R7F3 R7F2 R7F1 R7F0 Average Maximum
FUN 141 (s) DER ERR SD V C
↕ z z z z
Instruction format Number of steps 138
Condition Steps
FUN 141 (s) — 3
Constant
R, TD, SS, WR, DR,
Usable I/O Other
X Y M CU, CT WX WY WM TC DX DY DM
Argument (Counter
s number, output {
instruction)
Function
• Performs the enabling and disabling of the coincidence output for the specified counter.
• Output is turned off when the coincidence output disabling instruction is issued while coincidence output is being performed
(while coincidence output is on).
FUN 141 (s)
Notes
• If a value other than H01 to H04 is specified for the counter number and the output instruction is set to a value other than
H00 or H01, DER will be set to “1” and no processing will be performed.
• If the specified counter number is set to a function other than a corresponding external I/O counter (single-phase counter,
two-phase counter), DER will be set to “1” and no processing will be performed.
• Since Counter 4 is invalid when a 10-point CPU is used, if Counter 4 is specified, DER will be set to “1” and no processing
will be performed.
• If the specified counter number is unable to make an output (PI/O function setting result by R7F5), DER will be set to “1”
and no processing will be performed.
• This instruction is only used to enable and disable the coincidence output. Other counter settings will not be changed and it
will not affect the count operation.
• When coincidence output is enabled by this instruction when the coincidence conditions are alread established,
coincidence output will be turned on when the instruction is issued.
• The control contents of this instruction will be reflected in the output control flag (R7FC to R7FF) of the corresponding
counter number.
• When the CPU is not operating, the counter coincidence output continues/stops according to the setting of the special
internal output (output selection at R7DC stop).
Program example
LD R1
R1 DIF1
WR1 = H0101 AND DIF1
FUN 141 (WR1) [
WR1 = H101
FUN 141 ( WR1 )
]
Program description
5-120
Chapter 5 Instruction Specifications
Constant
R, TD, SS, WR, DR,
Usable I/O Other
X Y M CU, CT WX WY WM TC DX DY DM
Argument (Counter {
s number, Up/Down
instruction)
Function
15 87 0
Counter number: H01 to H04
S Counter number Up/Down instruction Up/down instruction: H00 – Up-count,
H01 – Down-count
• If a value other than H01 to H04 is specified for the counter number and the up/down instruction is set to a value other than
H00 or H01, DER will be set to “1”and no processing will be performed.
• If the specified counter number is set to a function other than single-phase counter, DER will be set to “1” and no processing
will be performed.
• Since Counter 4 is invalid when a 10-point CPU is used, if Counter 4 is specified, DER will be set to “1” and no processing
will be performed.
• If the specified counter number is unable to make an output (PI/O function setting result by R7F5), DER will be set to “1”
and no processing will be performed.
• This instruction is only used to control the up-count and down-count. Other counter settings will not be changed and it will
not affect the count operation.
• The control contents of this instruction will be reflected in bits 11 to 8 of the special internal output WRF07E of the
corresponding counter number.
Program example
LD R2
R2 DIF2
WR2 = H0101 AND DIF2
FUN 142 (WR2) [
WR2 = H101
FUN 142 ( WR2 )
]
Program description
5-121
Chapter 5 Instruction Specifications
Item number FUN instructions-7 Name High-speed Counter Current Value Replacement
Ladder format Condition code Processing time (µs) Remark
R7F4 R7F3 R7F2 R7F1 R7F0 Average Maximum
FUN 143 (s) DER ERR SD V C
↕ z z z z
Instruction format Number of steps 175
Condition Steps
FUN 143 (s) — 3
Constant
R, TD, SS, WR, DR,
Usable I/O Other
X Y M CU, CT WX WY WM TC DX DY DM
Argument (counter
s {
number)
Argument
s+1 (Replacement value {
storage area)
Function
15 8 7 0
Counter number: H01 to H04
S Counter number ** **: Disable area
• The counter value of the specified counter number will be replaced by the data stored in the replacement value storage area.
Notes
• If a value other than H01 to H04 is specified for the counter number, DER will be set to “1” and no processing will be
performed.
• If the specified counter number is set to a function other than a corresponding external I/O counter (single-phase counter,
two-phase counter), DER will be set to “1”and no processing will be performed.
• Since Counter 4 is invalid when a 10-point CPU is used, if Counter 4 is specified, DER will be set to “1” and no processing
will be performed.
• If the specified counter number is unable to make an output (PI/O function setting result by R7F5), DER will be set to “1”
and no processing will be performed.
• This instruction is only used to rewrite the count value. Other counter settings will not be changed and will not affect the
count operation.
• If the range for S exceeds the valid range of the I/O, DER will be set to “1” and no processing will be performed.
Program example
LD R3
R3 DIF3
WR30 = H0100 AND DIF3
WR31 = 1000 [
FUN 143 (WR30) WR30 = H100
WR31 = 1000
FUN 143 (WR30)
]
Program description
5-122
Chapter 5 Instruction Specifications
Item number FUN instructions-8 Name High-speed counter current value reading
Ladder format Condition code Processing time (µs) Remark
R7F4 R7F3 R7F2 R7F1 R7F0 Average Maximum
FUN 144 (s) DER ERR SD V C
↕ z z z z
Instruction format Number of steps 132
Condition Steps
FUN 144 (s) — 3
Constant
R, TD, SS, WR, DR,
Usable I/O Other
X Y M CU, CT WX WY WM TC DX DY DM
Argument (counter
s {
number)
Argument
s+1 (Current value storage {
area)
Function
• This function reads the count value of the specified counter number and writes it to the current value storage area.
Notes
• If a value other than H01 to H04 is specified for the counter number, DER will be set to “1” and no processing will be
performed.
• If the specified counter number is set to a function other than a corresponding external I/O counter (single-phase counter,
two-phase counter), DER will be set to “1”and no processing will be performed.
• Since Counter 4 is invalid when a 10-point CPU is used, if Counter 4 is specified, DER will be set to “1” and no processing
will be performed.
• If the specified counter number is unable to make an output (PI/O function setting result by R7F5), DER will be set to “1”
and no processing will be performed.
• This instruction is only used to read the count value. Other counter settings will not be changed and it will not affect the
count operation.
• The execution of this instruction will not change WRF07A to WRF07D (strobe area) and WRF056 (strobe complete flag).
• If the range for S exceeds the valid range of the I/O, DER will be set to “1” and no processing will be performed.
Program example
R4 DIF4 LD R4
WR40 = H0100 AND DIF4
FUN 144 (WR40) [
WR40 = H100
R144 FUN 144 ( WR40 )
WR41 ]
<
2000 LD (WR41 < 2000)
OUT R144
Program description
5-123
Chapter 5 Instruction Specifications
Item number FUN instructions-9 Name High-speed counter current value clear
Ladder format Condition code Processing time (µs) Remark
R7F4 R7F3 R7F2 R7F1 R7F0 Average Maximum
FUN 145 (s) DER ERR SD V C
↕ z z z z
Instruction format Number of steps 157
Condition Steps
FUN 145 (s) — 3
Constant
R, TD, SS, WR, DR,
Usable I/O Other
X Y M CU, CT WX WY WM TC DX DY DM
Argument (counter
s {
number)
Function
15 87 0
Counter number: H01 to H04
S Counter number ** **: Disable area
• The output value will be changed according to the output condition (on-preset value, off-preset value settings) if the count
value of the specified counter number is cleared and coincidence output is possible.
FUN 145 (s)
Notes
• If a value other than H01 to H04 is specified for the counter number, DER will be set to “1” and no processing will be
performed.
• If the specified counter number is set to a function other than a corresponding external I/O counter (single-phase counter,
two-phase counter), DER will be set to “1” and no processing will be performed.
• Since Counter 4 is invalid when a 10-point CPU is used, if Counter 4 is specified, DER will be set to “1” and no processing
will be performed.
• If the specified counter number is unable to make an output (PI/O function setting result by R7F5), DER will be set to “1”
and no processing will be performed.
• This instruction is used only to clear the count value. Other counter settings will not be changed and it will not affect the
count operation.
Program example
LD R5
R5 DIF5
WR5 = H0100 AND DIF5
FUN 145 (WR5) [
WR5 = H100
FUN 145 ( WR5 )
]
Program description
5-124
Chapter 5 Instruction Specifications
Constant
R, TD, SS, WR, DR,
Usable I/O Other
X Y M CU, CT WX WY WM TC DX DY DM
Argument (counter
s number, preset {
specification)
Argument
s+1 {
(on-preset value)
Argument
s+2 {
(off-preset value)
Function
• The on-preset value and off-preset value will be set according to the preset specifications for the specified counter number.
• The coincidence output value will remain unchanged even when coincidence output is possible.
Notes
• If a value other than H01 to H04 is specified for the counter number and a value other than H00 to H02 is set for the preset
specification, DER will be set to “1” and no processing will be performed.
• Since Counter 4 is invalid when a 10-point CPU is used, if Counter 4 is specified, DER will be set to “1” and no processing
will be performed.
• If the specified counter number is set to a function other than a corresponding external I/O counter (single-phase counter,
two-phase counter), DER will be set to “1” and no processing will be performed.
• The specified preset value will be checked using the criteria shown below. If an error occurs, DER will be set to “1” and no
processing will be performed.
If there is no error, the bit respective to the setting error detail information WRF057 will be set to “0” and releases the
operation disabled status.
1] When the preset specification is 00H
If S+1 (on-preset) and S+2 (off-preset) values are equal, and error is generated.
2] When the preset specification is 01H
If S+1 (on-preset) and the off-preset value of WRF076 to WRF079 are equal, an error is generated.
3] When the preset specification is 02H
If S+2 (on-preset) and the off-preset value of WRF072 to WRF075 are equal, an error is generated.
• This instruction is used only to set the on-preset value and off-preset value. Other counter settings will not be changed and it
will not affect the count operation.
• The settings made using the instruction will be reflected in the special internal output (WRF072 to WRF075 and WRF076 to
WRF078). However, it is not reflected if DER becomes equal to “1.”
• If the range for S exceeds the valid range of the I/O, DER will be set to “1” and no processing will be performed.
5-125
Chapter 5 Instruction Specifications
Program example
LD R6
R6 DIF6 AND DIF6
WR60 = H0100
WR61 = 5000 [
WR62 = 10000 WR60 = H100
FUN 146 (WR60) WR61 = 5000
WR62 = 10000
FUN 146 ( WR60 )
]
Program description
• Sets both the on-preset value and off-preset value in the counter No. 1.
Sets 5000 for the on-preset value and 10000 for the off-preset value.
FUN 146 (s)
5-126
Chapter 5 Instruction Specifications
Constant
R, TD, SS, WR, DR,
Usable I/O Other
X Y M CU, CT WX WY WM TC DX DY DM
Argument (PWM output
s {
number)
Function
15 87 0
PWM output number: H01 to H04
S PWM output number Operation instruction Operation instruction: H00 – Stop,
H01 - Start
Notes
Program example
LD R7
R7 DIF7
WR7 = H0101 AND DIF7
FUN 147 (WR7) [
WR7 = H101
FUN 147 ( WR7 )
]
Program description
• Prior to starting a PWM output operation, various settings required for the PWM output operation are reflected in the special
internal outputs, and the PI/O function setting flag (R7F5) is turned on while the CPU is being stopped.
For details on the special internal output settings, see Chapter 8.
Starts the PWM output No. 1 (Y100) operation.
5-127
Chapter 5 Instruction Specifications
Constant
R, TD, SS, WR, DR,
Usable I/O Other
X Y M CU, CT WX WY WM TC DX DY DM
Argument (PWM output
s {
number)
Argument (Frequency
s+1 {
value)
Argument (On-duty
s+2 {
value)
Function
15 8 7 0
PWM output number: H01 to H04
S
PWM number ** **: Disable area
Frequency: 10 to 2000 (Hz)
S+1
FUN 148 (s)
• Sets the frequency value and on-duty value of the PWM output number specified by the on-duty value and the specified
frequency value.
• Sets the frequency value in Hz.
Example: To set a frequency of 1 kHz, set 1000 (H3B8) as internal output.
• Sets the on-duty value in %.
Example: To set an on-duty of 80 %, set 80 (H50) as internal output.
• When the on-duty is set to be auto-corrected, the effective range of the on-duty is calculated using the following
expressions.
On-duty lower limit value (%) = Hardware delay time (µs) x Frequency used (Hz) x 10-4
On-duty upper limit value (%) = 100 − Hardware delay time (µs) x Frequency used (Hz) x 10-4
If the CPU model is EH-***DRP and the PWM output is 2 kHz,
On-duty lower limit value = 50 x 2000 x 10 -4 = 10 %
On-duty upper limit value = 100 − (50 x 2000 x 10-4) = 90 %
Thus, the effective range of the on-duty will be 10 % to 90 %.
5-128
Chapter 5 Instruction Specifications
Notes
• If a value other than H01 to H04 is specified as the PWM output number, and if the on-duty value is outside the effective
range, DER will be set to “1” and no processing will be performed.
• If the external I/O corresponding to the PWM output number is set to a function other than PWM output, DER will be set to
“1” and no processing will be performed.
• The settings made using the instruction will be reflected in the special internal output (WRF072 to WRF075 and WRF076 to
WRF079). However, it is not reflected if DER becomes equal to “1.”
• The minimum frequency that can be supported is 10 kHz. If a frequency value smaller than 10 kHz is specified, it will be
changed to 10 kHz internally by the system.
• The maximum frequency that can be supported is 2 kHz. Do not set to more than 2 kHz. Operation above 2 kHz is not
guaranteed.
• If the range for S exceeds the valid range of the I/O, DER will be set to “1” and no processing will be performed.
Program example
LD R8
R8 DIF8 AND DIF8
WR80 = H0100
WR81 = 2000 [
WR82 = 30 WR80 = H100
FUN 148 (WR80) WR81 = 2000
WR82 = 30
FUN 148 ( WR80 )
]
Program description
• Sets both the frequency and on-duty value of the PWM output No. 1 (Y100).
Sets 2000 (Hz) for the frequency and 30 (%) for the on-duty value.
5-129
Chapter 5 Instruction Specifications
Constant
R, TD, SS, WR, DR,
Usable I/O Other
X Y M CU, CT WX WY WM TC DX DY DM
Argument (Pulse output
s {
number)
Function
15 0
Pulse output number: H01 to H04
S Pulse output number Operation instruction Operation instruction: H00 – Stop,
H01 - Start
• Starts pulse output of the specified pulse number and the output is stopped once the specified number of pulses are output.
Notes
FUN 149 (s)
• If the pulse output number is set to a value other than H01 to H04 and the pulse output number is set to “0,” DER will be set
to “1”and no processing will be performed.
• If the external I/O corresponding to the pulse output number is set to a function other than pulse output, DER will be set to
“1”and no processing will be performed.
• If the specified counter number is unable to make an output (PI/O function setting result by R7F5), DER will be set to “1”
and no processing will be performed.
• The pulse that is output with this instruction will be a pulse having a duty of 30 to 50 %. (To output a pulse having a dut
ratio of 50 %, set the value corresponding to the CPU model in the special internal output WRF06B, by referring to Section
8.1.4.)
• When pulse output is commenced with this instruction, the output control flag (R7FC to R7FF) that corresponds to the pulse
output number will turn on while the pulse is output. It will turn off when the specified number of pulses have been output.
• When the CPU is not operating, the pulse output continues/stops according to the setting of the special internal output
(output selection at R7DC stop).
• This instruction does not have an acceleration/deceleration function.
• Only pulse output stop operation can be executed for the I/O that is outputting a pulse with the acceleration/deceleration
function.
• If this instruction is executed while the backup memory is being written (R7EF=1), DER will be set to “1” and no
processing will be performed.
• The backup memory will not be written during pulse output. Be extremely careful when you change a program during RUN.
Program example
LD R9
R9 DIF9
WR9 = H0101 AND DIF9
FUN 149 (WR9) [
WR9 = H101
FUN 149 ( WR9 )
]
Program description
• Prior to starting a pulse output operation, various settings required for the pulse output operation are reflected in the special
internal outputs, and the PI/O function setting flag (R7F5) is turned on while the CPU is being stopped.
For more details on the special internal output settings, see Chapter 8.
Starts the pulse output No. 1 (Y100) operation.
5-130
Chapter 5 Instruction Specifications
Item number FUN instructions-14 Name Pulse frequency output setting changes
Ladder format Condition code Processing time (µs) Remark
R7F4 R7F3 R7F2 R7F1 R7F0 Average Maximum
FUN 150 (s) DER ERR SD V C
↕ z z z z
Instruction format Number of steps 217
Condition Steps
FUN 150 (s) — 3
Constant
R, TD, SS, WR, DR,
Usable I/O Other
X Y M CU, CT WX WY WM TC DX DY DM
Argument (Pulse
s {
number)
Argument (Frequency
s+1 {
value)
Argument (Number of
s+2 {
output pulses)
Function
• Pulse output is commenced at the specified frequency. Output is stopped once the number of pulses specified have been
output.
• Sets the frequency value in Hz.
Example: To set a frequency of 3 kHz, set 3000 (HBB8) as internal output.
• Sets the count for the number of output pulses.
Example: To set output of 10,000, set 10,000 (H2710) as internal output.
5-131
Chapter 5 Instruction Specifications
Notes
• If the pulse output number is set to a value other than H01 to H04, DER will be set to “1”and no processing will be
performed.
• If the external I/O corresponding to the pulse output number is set to a function other than pulse output, DER will be set to
“1”and no processing will be performed.
• The minimum frequency that can be supported is 10 kHz. If a frequency value smaller than 10 kHz is specified, it will be
changed to 10 kHz internally by the system.
• If the specified frequency value is greater than 5 kHz, or even when it is 5 kHz or less, and if the total sum with other set
pulse output frequencies becomes greater than 5 kHz, DER will be set to “1” and no processing will be performed.
• If the specified frequency value is 5 kHz or less, and the total sum with other set pulse output frequencies is also 5 kHz or
less, the bit corresponding to the setting error detail WRF057 will be set to “0” and the operation enable state becomes
active.
• The settings by this instruction will be reflected in the special internal output (WRF072 to WRF075 and WRF07A to
WRF07D).
• If the range for S exceeds the valid range of the I/O, DER will be set to “1” and no processing will be performed.
• If the pulse output number is set to “0,” pulse output will not be performed even when the pulse output start (R7FC to R7FF
is set to “1” or FUN149) is set.
• If this instruction is executed for the I/O that is outputting a pulse with the acceleration/deceleration function, DER will be
set to “1” and no processing will be performed.
Program example
LD R10
R10 DIF10 AND DIF10
WR100 = H0100
WR101 = 219 [
WR102 = 1000 WR100 = H100
FUN 150 (WR100) WR101 = 219
WR102 = 1000
FUN 150 ( WR100 )
]
FUN 150 (s)
Program description
• Sets both the frequency and pulse output count of the pulse output No. 1 (Y100).
Sets 500 (Hz) for the frequency and 3,000 for the number of pulse outputs.
5-132
Chapter 5 Instruction Specifications
Constant
TD, SS,
R, WDT, MS,
Usable I/O Other
L, TMR, CU, WR, DR,
X Y M RCU, CT WX WY WM TC DX DY DM
s Pulse output No. {
Total No. of output
s+1 {
pulses
Maximum frequenc
s+2 {
(Hz)
s+3 Initial frequency (Hz) {
Acceleration/deceleration
s+4 {
time (ms)
Function
15 8 7 0
F:S+2
T / 10 9 1
8 2
7 3
(F-F0) / 10 6 4
5 5
4 6
3 7
2 8
1 9
F0:S+3
0 10
Time (sec)
Acceleration time Deceleration time
T:S+4 T:S+4
5-133
Chapter 5 Instruction Specifications
Notes
When this instruction is executed, the maximum frequency is stored in the special internal output’s pulse output frequenc
(WRF072 to WFR075), and the number of output pulses is stored in the special internal output’s number of output pulses
(WRF07A to WRF07D) respectively.
This instruction will not be executed if the specified pulse output is generating pulse output.
If the output that corresponds to the specified pulse output number has not been set for pulse output, DER will be set to “1” and
pulse output will not be generated.
If the total of the frequency set with this instruction and the frequency set for another pulse output exceeds 5 kHz, DER will be
set to “1” and pulse output will not be generated.
If the maximum frequency is larger than the initial frequency, DER will be set to “1” and pulse output will not be generated.
If the same value is specified for the maximum frequency and initial frequency, pulses will be output for the number of pulses
set with the maximum cycle without acceleration/deceleration.
If the maximum frequency and initial frequency are set to a value smaller than 10 Hz, the specified values will be changed to 10
Hz by the system.
If the total number of output pulses is small, deceleration will be performed without accelerating up to the maximum frequency.
In this case, the specified acceleration/deceleration time will not be used as the acceleration/deceleration time; it will be
accelerated (or decelerated) for each pulse.
For the acceleration/deceleration time, set a value equal to or larger than (1 / maximum frequency + 1 / initial frequency) x 5. If
an acceleration/deceleration time smaller than this value is specified, the specified acceleration/deceleration will not be set.
Acceleration and deceleration are performed in 10 steps, and at least one or more pulses are always output. Thus, if a small
initial frequency value is specified, an error in the acceleration/deceleration time will become large.
Pulse frequency (Hz) Pulse frequency (Hz)
F:S+2 F:S+2
(F-F0) / 10
(F-F0) / 10
F0:S+3 F0:S+3
0 0
Time (sec)
Specified acceleration time Specified acceleration time Specified deceleration time set
T:S+4 T:S+4 T:S+4
Program example
LD R7E3
R7E3 [
WR0100 = 2 WR0100 = 2
WR0101 = H1000 WR0101 = H1000
WR0102 = 1000 WR0102 = 1000
WR0103 = 500 WR0103 = 500
WR0104 = 300 WR0104 = 300
]
X00001 DIF0 LD X00001
FUN 151(WR0100)
AND DIF0
[
FUN 151 (WR0100)
]
Program description
Sets the required parameters in the special internal outputs at the first scan after RUN start.
At the leading edge of X00001, pulses are output starting from Y101 using the following settings: acceleration/deceleration time
of 300 (Hz), initial frequency of 500 (Hz), maximum frequency of 1000 (Hz), and number of output pulses of 4,096 pulses.
5-134
Chapter 5 Instruction Specifications
Constant
R, TD, SS, WR, DR,
Usable I/O Other
X Y M CU, CT WX WY WM TC DX DY DM
Argument (dumm
s {
constant)
Function
• This instruction does not perform any operations. It is used to print comments on the right side of the calculation box in
conjunction with the Ladder Editor.
• A comment can contain a maximum of 32 characters.
* ( ) indicates the display when the Ladder Editor is used.
• This instruction does not perform any operations. It is used to print comments on the right side of the calculation box in
conjunction with the Ladder Editor.
• A comment can contain a maximum of one screen (66 characters × 16 lines).
* ( ) indicates the display when the Ladder Editor is used.
5-135
Chapter 6 I/O Specifications
Size
Item
Function Name
Number of Number of Number of Number of
points points points points
1 External I/O X B Bit external input 6 bits 8 bits 13 bits 16 bits
WX W Word external input 1 word 1 word 1 word 2 words
DX D Double-word external input
Y B Bit external output 4 bits 6 bits 10 bits 12 bits
WY W Word external output 1 word 1 word 1 word 1 word
External I/O*
Timer counter TD B On delay timer Timer 256 points (0.01 s timer has only 0 to 63)
SS B Single-shot timer Counter 256 points (The same area as the timer is used.)
CU B Up counter (The same timer counter number cannot be used more
CTU B Up-down counter up input than once.)
CTD B Up-down counter down input
CL B Clear progress value
*: The external I/O, counter I/O, interrupt input, pulse/PWM outputs use the same area by specifying the operation I/O
operation mode (WRF070). For more details, see Chapter 8.
Note: The MICRO-EH does not support the CPU link area.
An error will not occur when data is written to the CPU link area by peripheral and other units, but the data will not
be written.
The value will remain 0 when it is referenced after the data is written.
Note: B and W in the Size column represent bit and word (16 bits), respectively.
6-1
Chapter 6 I/O Specifications
6-2
Chapter 6 I/O Specifications
Time
RUN start
Time
RUN stop
The user programs are executed in sequence, normally beginning with the program in the beginning of the scan area till
the last program, or until the END instruction. Then, I/O data is refreshed prior to the execution of the next user program.
As shown above, external I/O data is updated in batch mode in the refresh processing after the user program is executed.
If it is necessary to update (refresh) the I/O data while the user program is being executed, use the refresh instruction.
When designing a system, take into account the above refresh operation from when the input data is received and
operated until output data is obtained.
6-3
Chapter 6 I/O Specifications
The followin explains the external I/O assignment. The external I/O numbers for the MICRO-EH system are expressed
with the following conventions.
6-4
Chapter 6 I/O Specifications
Basic unit
Double-word DX DX0, DY10
type DY Expansion unit
DX100, DX200, DX300,
Word number within the module DX400
(Basic DX:0 DY:0)
DY101, DY201, DY301,
(Expansion DX:0 D:1)
DY401
Slot number (Basic DX:0 DY:1)
(Expansion DX:0 DY:0)
Unit number (0 to 4)
The external I/O word type is a collection of 16 points of the corresponding bits, and the double-word type is a collection
of 32 points.
(Example) Basic unit (I/O type: X48) Relationships among DX0, WX0, and X00 to X15 are as follows:
Use prohibited (10-point: X06 to 31, 14-point: X08 to 31, 23-point: X13 to 31, 28 point: X16 to 31)
WX1 WX0
DX0
DX1
(Example) Expansion unit (I/O type: B1/1) Relationships among DX100, WX100, and X1000 to X1007, and among
DY101, WY101, and Y1016 to Y1021 are as follows:
WY101 WX100
DX100
DY101
6-5
Chapter 6 I/O Specifications
WM120
<Double word> DM DM0
DM11
H0000 to DM234
Expresses as hexadecimals.
Expresses DM for 2 words in continuation.
• Internal outputs R, WR and DR are completely separate areas. Bit-based operations cannot be performed in the WR.
(Example) Relationships among R100, WR10, and DR10
R area R100
WR11 WR10
DR10
DR11
• Because internal outputs M, WM and DM share the same area, bit-based operations are allowed.
(Example) Relationships among M100, WM10, and DM10
M10A
M11F ....... M110 M10F M109 ....... M100
WM11 WM10
DM10
DM11
6-6
Chapter 7 User Program
Chapter 7 Programming
7.1 Memory Size and Memory Assignment
Table 7.1. Lists the programming specifications for the MICRO-EH.
7-1
Chapter 7 User Program
7-2
Chapter 7 User Program
Install Install
Install Install
7-3
Chapter 7 User Program
Initialize PLC Regenerate from FD, etc. Regenerate from FD, etc.
Transfer program
(CPU → PLC)
Out-line of opera-ting procedure
NG NG
OK Operation
OK check
NG Program check
Conduct test operation
Program check
OK OK
OK NG Enter in FD, etc.
Change the name and Operation
OK check
Save in FD, etc. save in FD, etc. End
OK To modification
End End End
When creating a new When modifying a program When transferring a created When modifying a program
Situation
A program can be created When using a program that When performing CPU error To enter the on-direct mode,
without executing MICRO- was used in another H-series, check, make sure the I/O match the contents in the
EH. specify H-302 as the CPU assignment matches the CPU’s memory and personal
Point
7-4
Chapter 7 User Program
The user program is managed in circuit units. One circuit can describe nine contact points (a-type contact point or b-type
contact point) and seven coils as shown in the figure below.
Or, one relational box can be described using the width of three contact points. The relational box can be considered as an
a-type contact point that turns on when the conditions in the box are established (Figure 7.2).
7-5
Chapter 7 User Program
In addition, if loop symbols are used, a circuit containing up to 57 contact points and one coil can be entered within seven
lines.
However, an OR circuit cannot be input after a loop.
* *
* *
* *
* *
* *
A processing box can be placed at the coil position. The processing instructions, application instructions, control
instructions, transfer instruction and fun instructions can be described in a processing box. A maximum of 19 instructions
can be described in one processing box. The processing box is executed when the conditions in the contact section to be
connected directly in advance is established. The processing box is not executed if the condition is not established.
See the chapter on the “Instruction Specifications” for details on each instruction.
Note: For the LADDER EDITOR for Windows, a processing box can be displayed in one contact point width, so a circuit of nine
contact points and one processing box can be entered.
For more details, refer to the user's manual for the LADDER EDITOR for Windows.
7-6
Chapter 7 User Program
In addition to the user programs, the settings to be stored in the special internal outputs can be transferred to the backup
memory. The transfer of the special internal outputs for various settings (Note 1) can be executed by turning ON the
Memory Request for Various Settings Flag (R7F6). As with the transfer of the user programs, the Backup Memory
Writing Progress Flag (R7EF) will be turned ON during this transfer.
Figure 7.5 below shows the operation of the Backup Memory Writing Progress Flag (R7EF) during the backup of the
special internal output for various settings and the backup of the user programs. Note that when one is being transferred,
the next transfer will not start until the current transfer is complete.
1] 3] 6] 4], 5] 6] 3] 1] 4] 5] 6]
2] 4], 5] 1] 2] 2] 3]
When there is no conflict When a setting memory When a user program writ
between the user program request of the special internal is generated during the
write and the setting memory output is generated during the transfer of the specia
request of the special internal transfer of the user program internal output
output
Figure 7.5 Operation of the bit special internal output when backup memory is being accessed
Note:
• The backup memory cannot be written during pulse output. If a program is changed during RUN with respect to the CPU
during pulse output, turn off the power supply approximately two minutes after pulse output stops.
• Pulses cannot be output while the backup memory is being written. Commence pulse output once again after the Backup
Memory Writing Progress Flag turns off.
7-7
Chapter 7 User Program
Note 1) The following lists the special internal outputs for various settings that can be transferred to the backup memory by the
Memory Request for Various Settings Flag (R7F6).
7-8
Chapter 8 Operation Methods for Various Functions
Set the number 0 to 3 corresponding to the mode you want to set in WRF070.
1] Set the operation mode Refer to Table 8.1 for the details of each mode.
Note 1) If nothing is set, the settings stored in the FLASH memory become valid.
Note 2) If a number larger than 4 is set, mode 0 will be selected.
Note 3) After the settings are stored in the FLASH memory, it is not necessary to perform the settings
after step 1] from the next time.
5] Change The settings performed in steps 1] to 3] are stored in the FLASH memory by turning R7F6
individual setting on.
It is not necessary to perform the settings again when the power supply is turned on for the
next time.
6] Store the settings in the memory. Note 7) If R7F6 is not turned on, the settings will be changed to the ones stored in the FLASH
memory when the power supply is turned on for the next time (if nothing is stored in the
FLASH memory, the initial values will be set).
Note 8) When the CPU is operating, the settings are not stored in the FLASH memory by turning
R7F6 on.
Note 9) R7EF turns on while the settings are transferred to the FLASH memory. If the power suppl
to the main unit is turned off while R7EF is on, the settings are not properly stored in the
FLASH memory; there is a possibility that the parameter settings are initialized when the
power supply is turned on for the next time.
8-1
Chapter 8 Operation Methods for Various Functions
8-2
Chapter 8 Operation Methods for Various Functions
Terminal Bit Value Bit Value Function Terminal Bit Value Bit Value Function
Y100 i 0 j 0 Normal output Y100 i 0 j 0 Counter coincidence output
1 PWM output 1 (independent of bit status)
1 0 Pulse output 1 0
1 Normal output 1
Y101 k 0 l 0 Normal output Y101 k 0 l 0 Counter coincidence output
1 PWM output 1 (independent of bit status)
1 0 Pulse output 1 0
1 Normal output 1
Y102 m 0 n 0 Normal output Y102 m 0 n 0 Normal output
1 PWM output 1 PWM output
1 0 Pulse output 1 0 Pulse output
1 Normal output 1 Normal output
Y103 o 0 p 0 Normal output Y103 o 0 p 0 Normal output
1 PWM output 1 PWM output
1 0 Pulse output 1 0 Pulse output
1 Normal output 1 Normal output
Mode 2 Mode 3
Terminal Bit Value Function Terminal Bit Value Function
X0 a 0 Counter input (independent of bit X0 a 0 Counter input 1A (independent
1 status) 1 of bit status)
X1 b 0 Counter preload X1 b 0 Counter preload
1 Counter strobe 1 Counter strobe
X2 c 0 Counter input (independent of bit X2 c 0 Counter input 1B (independent
1 status) 1 of bit status)
X3 d 0 Counter preload X3 d 0 Counter input 1Z (independent
1 Counter strobe 1 of bit status)
X4 e 0 Counter input (independent of bit X4 e 0 Normal input (independent of
1 status) 1 bit status)
X5 f 0 Counter preload X5 f 0 Normal input
1 Counter strobe 1 Interrupt input
X6 g 0 Counter input (independent of bit X6 g 0 Counter input (independent of
1 status) 1 bit status)
X7 h 0 Counter preload X7 h 0 Counter preload
1 Counter strobe 1 Counter strobe
Terminal Bit Value Bit Value Function Terminal Bit Value Bit Value Function
Y100 i 0 j 0 Counter coincidence output Y100 i 0 j 0 Counter coincidence output
1 (independent of bit status) 1 (independent of bit status)
1 0 1 0
1 1
Y101 k 0 l 0 Counter coincidence output Y101 k 0 l 0 Normal output
1 (independent of bit status) 1 PWM output
1 0 1 0 Pulse output
1 1 Normal output
Y102 m 0 n 0 Counter coincidence output Y102 m 0 n 0 Normal output
1 (independent of bit status) 1 PWM output
1 0 1 0 Pulse output
1 1 Normal output
*1
Y103 o 0 p 0 Counter Normal output Y103 o 0 p 0 Counter Normal output *1
1 coincidence PWM output *1 1 coincidence PWM output *1
1 0 output Pulse output *1 1 0 output Pulse output *1
1 (independen Normal output *1 1 (independen Normal output *1
t of bit t of bit
status) status)
*1: Selectable only for 10-point type CPU. *1 Selectable only for 10-point type CPU.
Note: Using an interrupt input without writing the INT instruction in the program may cause a problem in the system operation.
8-3
Chapter 8 Operation Methods for Various Functions
8.1.4 Controlling Special Outputs when the CPU is in the STOP State
Generally the coincidence output, PWM output and pulse output are not generated if the CPU is in the STOP state. To
output these outputs when the CPU is in the STOP state, turn on the special internal output R7DC. By turning on the
special internal output R7DC for controlling the special outputs in the STOP state, the operation of the special outputs at
the time of test operation can be checked, and the outputs that are independent of the RUN and STOP states of the CPU
can be output. Note that the R7DC is set to 0 when the power is turned on. Also, if the output control flag (R7FC to
R7FF) is turned on while the CPU is in the STOP state and the R7DC is off, the output flag is turned off by the system.
R7DC
5]
R7FC toR7FF 1]
RUN/STOP RUN
STOP
Coincidence ON 5]
output OFF
5]
PWM output
5]
Pulse output
2] 3] 4]
Figure 8.4 Operation of special outputs when the CPU is in the RUN/STOP states
1] When the R7DC is off, the output control flag is turned off by the system.
2] When the R7DC is on, the corresponding special output turns on by turning on the output control flag.
* The coincidence output of the counter turns on when the condition is satisfied.
3] The special outputs turn on and off according to the user program.
4] The special outputs are being output while the output condition is satisfied or the R7DC is on.
5] The special outputs turn on and off according to the RUN/STOP states of the CPU. The output control flag is turned
off by the system when the CPU operation stops.
* The special outputs continue to be output as long as the CPU operation continues, even if an error has occurred
when the operation is set to be continued when I/O assignments do not match or when a congestion error occurs.
Figure 8.3 Special internal outputs for setting PWM/pulse output correction
8-4
Chapter 8 Operation Methods for Various Functions
1] 7] 5]
On preset
6]
0000H
U: Up counter
D: Down counter U U D U U D
D D
Coincidence ON
output OFF
R7FC to R7FF ON
Coincidence OFF
interrupt ON
n: Even number OFF
m: Odd number INT2n INT2m INT2n INT2n INT2m INT2n INT2n INT2m INT2n INT2n INT2m
1] 4]
Up counter
1] The coincidence output turns on* when the current counter value becomes larger than the on-preset value. The
interrupt process (INT2n) starts up if an interrupt program is used in the running user program.
2] The coincidence output turns off when the current counter value becomes larger than the off-preset value. The
interrupt process (INT2m) starts up if an interrupt program is used in the running user program.
3] The counter values wrap around in a ring. That is, the current counter value goes back to 0h when one more pulse
is counted after the maximum value (FFFFH) is reached.
Down counter
4] The coincidence output turns on* when the current counter value becomes smaller than the off-preset value. The
interrupt process (INT2m) starts up if an interrupt program is used in the running user program.
5] The coincidence output turns off when the current counter value becomes smaller than the on-preset value. The
interrupt process (INT2n) starts up if an interrupt program is used in the running user program.
6] The counter values wrap around in a ring. That is, the current counter value becomes FFFFH when one more
pulse is counted after the minimum value (0H) is reached. Note also that the initial value of the counter is 0H, and
the value reaches FFFFH after the first pulse is counted after the start of operation.
8-5
Chapter 8 Operation Methods for Various Functions
Others
7] The user program can switch from using a counter as an up counter to a down counter, as well as from a down
counter to an up counter while the counter is operating (using FUN142).
* The coincidence output does not turn on unless the control output flag (R7FC to R7FF) is turned on.
FFFFH
Off preset
Preload value
On preset
0000H
Coincidenc ON
output OFF
FFFFH
Off preset
On preset
0000H
Coincidenc ON
output
OFF
Figure 8.7 Current value clear instruction operation of high-speed counter (single-phase)
8-6
Chapter 8 Operation Methods for Various Functions
Bit: 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
WRF07E: a b c d e f g h Not used
Initial value: 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
Setting Setting
Bit Count edge Bit Count operation
value value
Counter 1 a 0 Leading edge e 0 Up count operation *1
1 Trailing edge 1 Down count operation *1
Counter 2 b 0 Leading edge f 0 Up count operation *1
1 Trailing edge 1 Down count operation *1
Counter 3 c 0 Leading edge g 0 Up count operation *1
1 Trailing edge 1 Down count operation *1
Counter 4 d 0 Leading edge h 0 Up count operation *1
1 Trailing edge 1 Down count operation *1
*1 Can also be made valid by executing FUN142.
In case of mode 1, the settings for counter 3 and 4 are ignored.
In case of mode 3, the settings for counter 1 to 3 are ignored.
In case of mode 1, WRF074 and WRF075 are used to set the frequency for the PWM/pulse outputs.
In case of mode 3, WRF073 and WRF074 are used to set the frequency for the PWM/pulse outputs.
In case of mode 1, WRF078 and WRF079 are used to set the on-duty for the PWM/pulse outputs.
In case of mode 4, WRF077 and WRF078 are used to set the on-duty for the PWM/pulse outputs.
8-7
Chapter 8 Operation Methods for Various Functions
This special internal output becomes valid immediately after the setting.
In case of mode 1, WRF07C and WRF07D are used to set the number of pulse outputs.
In case of mode 4, WRF07B and WRF07B are used to set the number of pulse outputs.
Bit: 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
WRF057: a Not used b c d e f g h i
Figure 8.12 Special internal output for setting error displa
15 2 1 0
WRF058: Counter 1 Not used a b
Bit Description
a Off-preset change request
b On-preset change request
In case of mode 1, WRF05A and WRF05B are used to set individual PWM/pulse outputs.
In case of mode 4, WRF059 and WRF05A are used to set individual PWM/pulse outputs.
8-8
Chapter 8 Operation Methods for Various Functions
Input 1A
Input 1B
Count
value
Off preset
value
On prese
value
Coincidenc
output
8-9
Chapter 8 Operation Methods for Various Functions
Input 1A
Input 1B
Count value
Off preset
On preset
Coincidenc
output
Input 1A
Input 1B
Count
value
Off preset
On preset
Coincidenc
output
8-10
Chapter 8 Operation Methods for Various Functions
Input 1A
Input 1B
Count
value
Off preset
On preset
Coincidenc
output
(5) Clear input operation (common to all the phase counting modes)
The count value is cleared at the leading edge of input 1Z. As an example, the clear operation of phase counting mode 4
is shown in Figure 8.18. (The clear operation works identically for all four phase counting modes.)
Input 1A
Input 1B
Input 1Z
Count
value
Off preset
On preset
Coincidenc
output
8-11
Chapter 8 Operation Methods for Various Functions
This special internal output becomes valid immediately after the setting.
Bit: 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
WRF057: a Not used b c d e f g h I
Figure 8.22 Special internal output for input/output function abnormality
8-12
Chapter 8 Operation Methods for Various Functions
15 2 1 0
Two-phase
WRF058: Not used a b
counter
Figure 8.23 Special internal output for individual setting of counter setting values
Bit Description
a Off-preset change request
b On-preset change request
8-13
Chapter 8 Operation Methods for Various Functions
Frequen
On dut
t
Output pulse
Figure 8.24 Basic operation of PWM output
(2) Operation when setting values are changed
The settings of each PWM output (frequency and on-duty) can be changed by the FUN instruction or the special internal
outputs (WRF072 to 79) regardless of whether the CPU is operating or stopped.
R7FC to R7FF Change in both
frequency and
On dut
Change in On dut Change in
Frequen frequen
On dut
t
Output pulse
Figure 8.25 Operation of PWM output when setting values are changed.
(3) Operation at abnormal settings
The PWM output is not output if the on-duty is set to a value other than the range in use. However, the FUN instruction
does not execute setting change when the setting value is abnormal.
R7FC to R7FF
On-duty setting value: On-duty setting value:
exceeding the range within the range
Frequen
On dut
t
Output pulse
Abnormal
Normal settings settings Normal settings
8-14
Chapter 8 Operation Methods for Various Functions
In case of mode 1, WRF072 and WRF073 are used to set the on-preset value of a counter.
In case of mode 4, WRF072 and WRF075 are used to set the on-preset value of a counter.
In case of mode 1, WRF076 and WRF077 are used to set the off-preset value of a counter.
In case of mode 4, WRF076 and WRF079 are used to set the off-preset value of a counter.
8-15
Chapter 8 Operation Methods for Various Functions
On-duty lower limit value (%) = Hardware delay time (µs) x Frequency used (Hz) x 10-4
On-duty upper limit value (%) = 100 - Hardware delay time (µs) x Frequency used (Hz) x 10-4
Table 8.2 Transistor output delay time for each CPU model
Example: If the CPU model is EH-***DRP and the PWM output is 2 kHz,
On-duty lower limit value = 50 x 2000 x 10-4 = 10 %
On-duty upper limit value = 100 - (50 x 2000 x 10-4) = 90 %
Thus, the effective range of on-duty values will be 10 % to 90 %.
If correction is not performed (0 is set in WRF06B), on-duty values can be set in the range of 0 to 100 %. However,
caution must be exercised since there will be an error for the period of transistor output delay time between the specified
on-duty and the on-duty that is actually output.
15 2 1 0
WRF058: PWM output 1 Not used a
Bit Description
a PWM output: individual setting value change request
8-16
Chapter 8 Operation Methods for Various Functions
Frequency/2
t
Output pulse
R7FC to R7FF
Frequency
Frequency change
change
Frequency Frequency
change (set to change
Frequency exceed 5 kHz)
Frequency/2
Output pulse
In case the frequency becomes 5 kHz or more, the previous setting value is used for operation.
8-17
Chapter 8 Operation Methods for Various Functions
To change the number of output pulses, the following operation will be performed:
1] When the number of pulses is to be changed to a value larger than the number of pulses currently being output,
pulses will be output until the number of newly changed pulses is reached, and then the pulse output stops.
2] When the number of pulses is to be changed to a value smaller than the number of pulses currently being output,
the pulse output stops when the current number of pulses is reached.
R7FC to R7FF 1] 2]
Change of the number Change of the number
of pulses 2 → 4 of pulses 6 → 3
Frequenc
Frequency/2
t
Output pulse
(Example 1) Assuming there is one point of pulse output and the output frequency is 5 kHz:
Setting value = 5000 (H1388)
(Example 2) Assuming there are three points of pulse output and the output frequencies are 1 kHz, 1 kHz, and 3 kHz,
respectively (the settings should be made so that the sum of the output frequencies set for each of the
pulse outputs becomes 5 kHz or less.):
Setting value = 1000 (H3E8)
Setting value = 1000 (H3E8)
Setting value = 3000 (HBB8)
WRF072: Output frequency for pulse output 1
In case of mode 1, WRF072 and WRF073 are used for setting the on-preset value of a counter.
In case of mode 4, WRF072 and WRF075 are used for setting the on-preset value of a counter.
In case of mode 1, WRF07A and WRF07B are used for setting the preload strobe value.
In case of mode 4, WRF07A and WRF07D are used for setting the preload strobe value.
8-18
Chapter 8 Operation Methods for Various Functions
Bit: 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
WRF057: a Not used b c d e f g h i
Figure 8.35 Special internal output for input/output function abnormality
15 2 1 0
WRF058: Pulse output 1 Not used a b
Bit Description
a Number of output pulse change request
b Output pulse frequency change request
8-19
Chapter 8 Operation Methods for Various Functions
The above-mentioned setting is stored immediately upon the completion of the setting. Moreover, it is invalid for inputs
assigned to counter input.
8-20
Chapter 8 Operation Methods for Various Functions
8.8 Potentiometers
CPUs other than of the 10-point type are equipped with two potentiometers. Through the use of these potentiometers, it
becomes possible to change values in the special internal outputs from the outside using a tool that looks like a
screwdriver. The resolution is 10 bits, so it is possible to adjust the values from 0 to 3FFH (1 to 1,023).
The potentiometers are found under the cover on the left side of the main unit. The value becomes larger when the dial i
turned clockwise and smaller when turned counterclockwise. In addition, this value is always stored in the special
internal output, regardless of whether the CPU is operating or stopped.
VR1 VR2
L H L H
This special internal output is stored in the FLASH memory by turning on various setting write requests (R7F6). Once it
is stored in the memory, it is not necessary to set the value again when the power is turned on for the next time.
(3) Example
The following shows a simple ladder program using the potentiometers:
8-21
Chapter 8 Operation Methods for Various Functions
Bit: 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
WRF06E: a b Not used
Initial value: 0 0
Figure 8.41 Special internal output for selecting the analogue type
WRF06E Function
Setting value Analogue CH0 (Bit a) Analogue CH1 (Bit b)
C000H Current input Current input
8000H Current input Voltage input
4000H Voltage input Current input
0000H Voltage input Voltage input
Please note that the external wiring is different for voltage input and current input. See the section regarding analogue
system wiring for the details.
Through the above-mentioned settings, the input data of channel 0 is stored in WX 30 and the input data of channel 1 is
stored in WX31. The correspondence between analogue data and digital data is shown in the figure 8.40 (divide 0 to 10 V
and 0 to 20 mA in 0 to 4000). The voltage data is converted to 0.0025 [V] per 1H and the current data is converted to
0.005 [mA] per 1H. Therefore, the value ranges that can be measured from the output channel are 0 to 10.2375 [V] for
voltage data and 0 to 20.475 [mA] for current data, respectively.
FA0H FA0H
(4000) (4000)
7D0H 7D0H
(2000) (2000)
V mA
0 5 10 0 10 20
Figure 8.42 Correspondence diagrams of digital and analogue input
(Example)
If analogue input channel 0 is set to voltage input and the analogue input channel 1 is set to current input, and 3V and
14mA are applied respectively, 4B0H (1200) is stored in WX30 and AF0H (2800) is stored in WX31.
5 10
8-22
Chapter 9 Operating and Stopping the MICRO-EH
Cauti
The MICRO-EH cannot handle a REMOTE
specification. A 10-point type CPU becomes
the RUN mode when the RUN input is On.
The MICRO-EH can be operated or stopped under the conditions as shown in Figure 9.1. If an error is detected during
operation or stop, output is shut off, an error is displayed and the MICRO-EH stops. There are fatal error, serious error,
minor error and warning. The operating status for each error is listed in Table 9.1.
9-1
Chapter 9 Operating and Stopping the MICRO-EH
n = 16 to 19
If the counter value exceeds the preset value, a Described in the area after the END
corresponding interrupt program (INT20 to instruction
INT27) starts up according to the counter
number. INTn
Interrupt scan
program
RTI
n = 20 to 27
4 Subroutine This is a program called by the CALL Described in the area after the END
instruction. instruction
SBn
Subroutine
program
RTS
n = 0 to 99
9-2
Chapter 9 Operating and Stopping the MICRO-EH
Each program is executed in the order of the priority shown in Figure 9.2. Each program is executed while monitoring
the execution time of each program area. If the monitored time exceeds the specified time, this causes a congestion error
and operation stops. When continued operation has been specified, operation continues.
The timing for scan execution is shown in Figure 9.2. System processing is performed at set periods (every 5 ms),
followed by communication system processing. *1 The maximum execution time of communication system processing
equals the duration of time until the next periodical system processing is started. If the communication system
processing ends before the maximum execution time is up, execution of scan processing is started upon completion of
the communication system processing. When the next periodical processing is executed, scanning is performed until the
next periodical processing is executed.
5 ms
1] 2] 1] 2]
Periodic system processing
Scan processing
Note: Processing 1 takes extremely short period of time as compared with Processing 2. Therefore, in the following
diagram Processing 1 is omitted in order to avoid complexity.
As shown in Figure 9.3, scan processing is done while periodical scanning is performed. Periodical scanning is
processed at the point when switching to normal scan. Periodical scans are performed at intervals of every 10 ms, 20 ms,
or 40 ms. In terms of priority of execution, 10 ms scans have the highest priority. Use the refresh instruction when you
wish to perform data processing for the external I/O (X, Y) in the periodical scan.
Update processing of timer progress value is performed as a part of system processing.
10 ms
System processing
Normal scan
9-3
Chapter 9 Operating and Stopping the MICRO-EH
(b) When both a normal scan program and a periodical scan program are used
The congestion check time was exceeded because the periodical scan program was executed and the normal scan
time became longer.
(c) When both a normal scan program and an interrupt scan program are used
The congestion check time was exceeded because the interrupt scan program was executed due to an interrupt
input and the normal scan time became longer.
However, note that this setting does not stop the execution of the scan when a congestion error occurred even when an
infinite loop is formed within the normal scan by the JMP instruction.
9-4
Chapter 9 Operating and Stopping the MICRO-EH
Scan every 10 ms
Periodical program 20 ms
Scan every 20 ms
Periodical system processing
(including interrupt analysis Periodical program
processing)
Scan every 40 ms
Periodical scan Periodical program
Program execution
Normal scan
Similarly, when executing with a periodical scan at every 20 ms or with a combination of periodical scans at every 20 ms
and 40 ms, a congestion error occurs if the periodical scan at 20 ms is started up again before all the periodical scans are
completed (i.e., the periodical system processing at INT1 to INT2 does not end within 20 ms). Finally, when using a
periodical scan at every 40 ms, a congestion error occurs if the periodical scan at 40 ms is started up again before all the
periodical scans are completed (i.e., the periodical system processing at INT2 does not end within 40 ms).
9-5
Chapter 9 Operating and Stopping the MICRO-EH
Periodical system 10 ms
Normal scan Interrupt sca
processing
RTI RTI
Interrupt analysis processing
RTI RTI
INT16
RTI RTI
Interrupt analysis INT17
processing INT20
Normal scan
Execution of
interrupt program INT20 INT16 INT16
INT17 INT20
INT17
Figure 9.12 Operation of interrupt scan
9-6
Chapter 9 Operating and Stopping the MICRO-EH
9-7
Chapter 9 Operating and Stopping the MICRO-EH
10 ms 10 ms 10 ms 10 ms
Periodical scan
Interrupt scan
Normal sca
Periodical 10 ms periodical
sca program
20 ms periodical
program
40 ms periodical
program
9-8
Chapter 9 Operating and Stopping the MICRO-EH
Program modification
Assemble NG
chec
Program change
OK Error stop
while running
Scanning stops (output shuts off) Displays that program change
including control
at END scan comma while running is being performed
(programming device)
Transfer to operation
execution memory HALT time
Scan resumes
Note
The special internal output R7EF turns on during the transfer to the FLASH memory.
Transfer to If the power supply to the CPU is turned off during transferring to the FLASH memory, the programs may be
FLASH memory destroyed. Before the power supply to the CPU is turned off it should be confirmed that R7EF is off, or it should
not be turned off until after approximately two minutes upon the completion of program transfer.
(If the pulse is being output, turn off the power supply approximately two minutes after the pulse output stops.)
9-9
Chapter 9 Operating and Stopping the MICRO-EH
AC power supply
Internal 5 V DC
Internal reset
24 V DC
ON
RUN
OFF
MICRO-EH operation
(1) Powering on
The MICRO-EH starts operations after a maximum of 3.5 seconds have elapsed after power-up. If the power for
input module is not completely started when the operation is commenced, the input that is supposed to be on will
be received as Off and operation proceeds, so make sure that the power for I/O module is completel turned on
before operation is commenced.
Note: When extending with a CPU larger than 14-point type, turn on the power supply for both base and
extension sides at the same time.
Note: Make arrangement so that the power for input module is supplied while the CPU continues its operation. If
the power is not supplied, the CPU will perform operation assuming the input data as Off. Exercise caution
especially when performing operation that changes the contents of the power failure memory using input
signals, since the contents of the power failure memor may have been altered unintentionally due to an
instantaneous power failure.
9-10
Chapter 9 Operating and Stopping the MICRO-EH
*: 10-point type CPU does not have the power failure memory function. Even though it is possible to set a power
failure memory area from a peripheral unit, the values that are stored here will not be persistent; do not set this
function.
Moreover, 14-point type CPU can maintain power failure memory only up to 72 hours. Note that non-persistent
values will be stored if the power supply to the main unit is not turned on after these hours have passed. 23- and 28-
point CPUs without a battery can maintain power failure memory for only up to 30 minutes. The data can be
retained for approximately two months by installing a battery.
9-11
Chapter 9 Operating and Stopping the MICRO-EH
Note:
1] The actual external output status and the external output information stored internally in the CPU may be different
when the CPU is stopped. At this point, if a forced set/reset is performed to the external output, the external output
information stored internally in the CPU is output from other external output. Thus, the forced output function can
be used in order to check the wiring for the external output.
2] Only I/O points assigned by the I/O assignment written in the CPU can be set for external input and external output
I/O numbers.
9-12
Chapter 10 PLC Installation, Loading, Wiring
L1
50 mm or more
10 mm or more 10 mm or more
L2
PLC
50 mm or more
50 mm or more
10 mm or more 10 mm or more Figure 10.2 External dimensions
PLC
Dimensional table
50 mm or more Unit L1 L2
10-point 65 70
14-point, expansion 85 80
Wiring duct 23-point, 28-point 140 80
Unit: mm
Figure 10.1 Mounting clearances
2]
10-1
Chapter 10 PLC Installation, Loading, Wiring
1]
10-2
Chapter 10 PLC Installation, Loading, Wiring
10.2 Wiring
(1) Separation of the power system
The power supplies include power for the MICRO-EH main unit/power for the I/O signals/power for general
equipment. These power supplies should be wired from separate systems as much as possible.
When these power supplies are supplied from one main power source, separate the wiring with a transformer or
similar device, so that each power supply is a separate system.
Transformer
NF
10-3
Chapter 10 PLC Installation, Loading, Wiring
Clamping
Unit Screw
torque
10-point M2.5 0.3 to 0.4 Nxm
14, 23, 28-point,
M3.0 0.5 to 0.6 Nxm
expansion
10-4
Chapter 10 PLC Installation, Loading, Wiring
24 V DC
24+ 1] 3] 4] 6] C1
0V 0] 2] C0 5] 7]
Example of a 14-point type
(a) DC input
1] When all input terminals (X0, X1, ...) and the common terminal (C) are loaded with 24 VDC, the input
becomes ON status, and approximately 7.5 mA of current flows to the external input contacts.
2] For sensors such as a proximity switch or photoelectric switch, current output type (transistor open
collector) can be connected directly. For voltage-output-type sensors, connect them to the input terminal
after first going through the transistor.
3] Take measures to prevent faulty contact in a strong electric contact.
Strong electric
contact The current that flows to a contact when external contacts
1] are closed is approximately 7.5 mA. If a strong electric
Approx. 50 mA contact must be used, add resistance as shown in the diagram
3W
560 Ω
at left and supply sufficient current to the contact to prevent
24 V DC
a faulty contact.
C
DC input module
10-5
Chapter 10 PLC Installation, Loading, Wiring
FUSE FUSE
Transistor output
Item (sink type)
(EH-*XXDT**)
External
wiring POW 0] NC 3] 5] C
POW 1] 2] 4] V
FUSE
Diode
Transistor output
Item (source type)
(EH- XXDTP**)
External
wiring POW 0] NC 3] 5] C
POW 1] 2] 4] V
FUSE
Diode
10-6
Chapter 10 PLC Installation, Loading, Wiring
1
0 1 2 3 4 5 6
Contact switching current (A)
Figure 2 Life characteristics (250 V AC)
1000
500
Switching life (10,000 times)
1
0 1 2 3 4 5 6
Contact switching current (A)
Figure 3 Life characteristics
1000
500
Switching life (10,000 times)
DC 30 V L/R=1 ms
100
50
DV 30 V L/R=7 ms
20
10
DC 30 V L/R=15 ms
1
0 1 2 3 4 5 6
Contact switching current (A)
2] Surge killer
For inductive load, connect a surge killer (condenser 0.1 µF, + resistance of approx. 100 Ω) in parallel to
the load. Also, for DC load, connect a flywheel diode.
3] Fuse
A built-in fuse is not used in this module. Install a 6 A fuse in the common to prevent the external wiring
from burning out.
For the independent contact output section, install a 2A fuse per circuit.
10-7
Chapter 10 PLC Installation, Loading, Wiring
AC power supply
NF
Connection of a noise
filter is recommended.
Expansion cable
Always segregate power
line, I/O signal and
power supply cable
Ground wiring
2
Use a cable 2 mm or
more for the wiring.
Class D grounding
10-8
Chapter 11 Communication Specifications
11.1 Port 1
Table 11.1 lists the specification of port 1.
Port 1 can be connected with the peripheral unit that supports a high protocol. (Portable diagram programming tool and
instruction language programming tool cannot be used.) By connecting port 1 with a peripheral unit, the created
programs can be transferred, the programs stored in the CPU can be read/verified, and the CPU operating status can be
monitored. In addition, a monitoring system that connects display device, etc. may be configured.
The 14-point type or higher CPU is also provided with a modem connection function in port 1. So, by switching the
setting, it can be connected to a modem. For more information on connecting with the modem, see the section regarding
the modem control function.
Transmission code Sent out from the lowest bit in character units
outgoing sequence
Error control Vertical parity check, checksum, overrun check, framing check
Transmission unit Message unit (variable length)
Maximum message 503 bytes (including control characters)
length
Interface Conforms to RS-232C (maximum cable length: 15 m)
Control procedure H-series dedicated procedure (high protocol)
Standard procedure (transmission control procedure 1), Simplified procedure (transmission
control procedure 2)
Connector used CPU side: 8-pin modular connector
*: Portable diagram programming tool and instruction language programming tool cannot be used.
*: Please note that if DIP switch 1 is set to On, +12V is output from pin 4.
*: 10-point type CPU cannot be connected to GPCL01H because the transmission speed is fixed at 4800 bps.
*: If the negative acknowledge command (NAK) is sent from the host using the transmission control procedure 1 or 2,
allow at least 10 ms before sending the next text.
*: Specify a value of 20 ms or higher for the response TM of the high protocol. (When the response TM is set to OK
and the specification is omitted, the default value of 20 ms will be used.)
11-1
Chapter 11 Communication Specifications
DIPSW
ON OFF OFF OFF 19.2 k bps
OFF OFF ON OFF 9600 bps
1 2 3 4 OFF OFF OFF OFF 4800 bps Default
OFF ON OFF OFF Connection via modem
Table 11.2 Dip switch setting
2] Setting the special internal output
The transmission control procedure and transmission speed when connected via modem are set using the special internal output.
This special internal output is stored in the FLASH memory by turning the various setting write request (R7F6) On. Once stored
in the FLASH memory, it is not necessary to make the setting again when the power supply is turned on next time.
Note: If transmission control procedure 2 is set for port 1 and the special internal output setting is stored in the FLASH
memory by R7F6, port 1 starts up with transmission control procedure 2 when the power is turned on next time. Thus,
note that the peripheral units that only support transmission control procedure 1 will not be connected.
Bit: 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
WRF01A: a Not used b Not used
Initial value 0 0 0 0 0 0
Figure 11.1 Special internal output for setting port 1
Area Setting value Content Note
a 0 Transmission control procedure 1 H0***
1 Transmission control procedure 2 H8***
b 0 Transmission speed when connecting 4800 bps Setting of bits 00000 (H*0**)
via mode 8 to 12
1 9600 bps 00001 (H*1**)
2 19.2 kbps 00010 (H*2**)
3 38.4 kbps 00011 (H*3**)
4 57.6 kbps 00100 (H*4**)
5 2400 bps 00101 (H*5**)
Other than above 4800 bps
DCD1 3]
4] CD1 4]
TX1 5]
5] SD1
6]
RX1 6] RD1 7]
DR1 8]
7] DR1
RS1 8] RS1
12 V
Figure 11.2 Circuit diagram and pin numbers for port 1
Table 11.3 List of port 1 signals
Pin No. Signal Direction Meaning
abbreviation CPU Host
1] SG1 Ground for signals
2] VCC 5 V DC is supplied. (Protective fuse is connected.)
3] DTR1 (ER) Communication enabled signal
When this signal is high level, communication is possible.
4] CD1 (DCD) 12V is output when DIP switch 1 is turned On.
5] SD1 (TXD) Data sent by the CPU
6] RD1 (RXD) Data received by the CPU
7] DR1 (DSR) Peripheral units connected signal
When this signal is high level, indicates that dedicated peripherals are connected.
8] RS1 (RTS) Transmission request signal
When this signal is high level, indicates that the CPU can receive data.
11-2
Chapter 11 Communication Specifications
11.2 Port 2
The specifications of port 2 are listed in Table 11.4. 1:n station communication by the high protocol is possible with port
2. By creating and including a control procedure based on the high protocol on the personal computer which will become
the host, it becomes possible to control a maximum of 32 stations from one host. The systems can thus be configured in
several ways.
Bit: 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
WRF03D: a b c d e
Initial value: 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
Figure 11.3 Special internal output for setting port 2
11-3
Chapter 11 Communication Specifications
Table 11.5 Transmission control procedure and interface – control procedure correspondence
RS-422 RS-485
Transmission control 1:1 Possible Possible
procedure 1 1:n Possible Possible
Transmission control 1:1 Possible Impossible
procedure 2 1:n Possible Impossible
7] SG
5] VCC
VCC 8]
15]
RS2 14] RSP 7]
14]
Micro processo
6] RSN 6]
13]
CS2 15] CSN 5]
12]
8] CSP 4]
13] SDP 11]
TX2 3]
12] SDN 10]
2]
10] RDN 9]
RX2 1]
11] RDP
9] RT
11-4
Chapter 11 Communication Specifications
11.3.1 Configuration
Personal
Modem Modem MICRO-EH
computer
RS-232C
(MAX 57.6 kbps)
Public line
11.3.2 AT Commands
The AT commands are used to make various modem settings, and are set from the host computer. The MICRO-EH
issues the AT commands automatically for initial setting. Other than this, the AT commands are not used.
Refer to instruction manual or other documents furnished by modem manufacturers for details on the AT commands.
In AT commands, an instruction sent to the modem from the host is called a “command,” and the character string in
response to the “command” returned to the host from the modem is called a “result code.”
AT commands always begin with the character string “AT,” and a return code is input at the end of the command.
However, A/ is excluded. The command that follows the “AT” can have multiple inputs in a single line.
Example)
A T &C 1 &S 0 P 2 CR LF
11-5
Chapter 11 Communication Specifications
2] S register
S register Set value Function
S0 0 no automatic Setting for automatic reception/reception ring count
reception
1 to 255
S2 0 to 127 Escape code setting
(43 [+] )
S3 0 to 127 CR code setting
(13 [CR] )
S4 0 to 127 LF code setting
(10 [LF] )
3] Result codes
Number format Word format Meaning
0 OK Normal execution
1 CONNECT Connection complete
2 RING Reception detected
3 NO CARRIER Line disconnected
4 ERROR Command error
5 CONNECT 1200 1200 bps connection
6 NO DIAL TONE Cannot hear dial tone
7 BUSY Busy signal detected
8 NO ANSWER No tone heard
10 CONNECT 2400 2400 bps connection
11 CONNECT 4800 4800 bps connection
12 CONNECT 9600 9600 bps connection
13 CONNECT 14400 14400 bps connection
11-6
Chapter 11 Communication Specifications
(3) Sequence
An example of a communication sequence using the Omron-made modem ME3314A is given below.
2 CR 2 CR 2 CR
Modem
MICRO-EH 3]
Forced connection when three rings are detected
3 CR
Modem
4]
Port communication begins from here
MICRO-EH ATA CR LF
Reception complete
1] The PLC issues the AT command that performs the initial setting of the modem.
2] If initial setting is OK, the modem returns “0.”
3] The PLC detects the result code “2” three times while in the reception wait state.
4] It connects the modem.
1] The PLC disconnects the line when the result code “3” is returned from the modem.
Note 1: Since the modem initial setup sets only minimal items from the MICRO-EH side, connect a personal computer
and perform necessary settings before making the connection. (Set the DR signal to always on.) Moreover, do
not change the following initial settings.
Note 2: The modem timeout (WRF03C) stored in the special internal output refers to the time from data transmission
from the MICRO-EH to the data reception from the opposite station (STX, ENQ, NAK). Normally, this special
internal output should be set to “0000” (default) or “H8000” (no timeout). Set the timeout only when it is
especially necessary to monitor the reception time from the opposite station. When a timeout is detected, the
MICRO-EH cuts off the line. When setting the timeout, set the time in the ** part of H80. The unit is * seconds
(hexadecimal).
Note 3: Before actually cutting off the line, issue the task code of the line cut off request (HIC--see Appendix 2, “Task
code list” for details) from the host side.
11-7
Chapter 11 Communication Specifications
11.4.1 Port 1
Port 1 of the MICRO-EH is a communication port that uses the RS-232C protocol as interface. It is also a dedicated port
with which to perform communication by the H series dedicated procedure (high protocol). Table 11.8 lists the types of
peripheral units and cables that can be connected to port 1.
28-/23-point type
EH-RS05
GPCL01H GPCB02H
(Ladder Editor, HI-Ladder)
14-point type
14-point type
EH-RS05
10-point type
WVCB02H
Pro-H
EH-VCB02
*1: Set the DIP switches to 19.2 kbps when connecting to a GPCL01H.
*2: Adjust the DIP switch settings to the speed with which to communicate when connecting a LADDER EDITOR or
Pro-H. (The speed is fixed at 4800 bps for 10-point type CPU.)
11-8
Chapter 11 Communication Specifications
11.4.2 Port 2
Port 2 of the MICRO-EH is a communication port that uses either the RS-422 or RS-485 protocol as interface. It is also a
dedicated port with which to perform communication by the H series dedicated procedure (high protocol), which allows
1:n station communication. Figure 11.6 and 11.7 show examples of port 2 connections for 1:n station communication.
Moreover, the connection for communicating 1:1 is performed by connecting only the first CPU in the figure below.
Relay terminal block Relay terminal block Relay terminal block Relay terminal block
Note:
Please note that 1:n station communication by transmission control procedure 2 cannot be performed when connected
with RS485.
11-9
Chapter 12 Error Code List and Special Internal Outputs
Related special
Error Error name Classifi RUN OK Ope-
Description ration
internal output
code [detection timing] -cation LED LED
Bit Word
11 System ROM error Fatal The system ROM has a checksum Stops
[when power is turned on] error error or cannot be read
Error in built-in ROM/FLASH )
12 System RAM error Fatal The system RAM cannot be read Stops
[when power is turned on] error and/or written properl
13 Micro computer error Fatal Address error interrupt, undefined Stops R7C8
[always checking] error instruction interrupt occurred in the
micro computer
Reset processing in CPU is being reset. Stops
progress
[when power is turned on]
1F System program error Fatal System program in FLASH memory Stops
[always checking] error has a checksum error
23 Undefined instruction Serious Error is detected when an attempt is Stops R7C9
[when starting RUN] error made to execute a user program
instruction that cannot be decoded
(undefined instruction)
27 Data memory error Serious Data memory cannot be read/written Stops
[when power ON, when error properly.
initializing CPU]
31 User memory error Serious A checksum error is detected in user Stops R7CA
[when power is turned on, error memory.
when RUN starts, during
RUN]
33 User memory size error Serious User program capacity set by the Stops R7CC
[when RUN starts] error parameter is other than 280 HEX.
34 Grammar/assemble error Serious There is a grammatical error in the Stops R7D4 WRF001
[when RUN starts, when error user program.
changing during RUN]
41 I/O information Minor • I/O assignment information and *1 Stops R7CD WRF002
verification error error actual loading of module do not *2
[always checking] match
• Assignment is made for expansion
level 5 or greater.
• There exists assignment of 5 slots or
greater.
44 Overload error Minor Execution time for normal scan *1 Stops R7D1
(normal scan) error exceeded the overload check time set *2
[during END processing] by the parameter.
45 Overload error Minor Execution time for periodical scan *1 Stops R7D2
(periodical scan) error exceeded the execution period. *2
[periodical processing]
46 Overload error Minor An interrupt of the same cause *1 Stops R7D3
(interrupt scan) error occurred during interrupt scan *2
[during interrupt
processing]
12-1
Chapter 12 Error Code List and Special Internal Outputs
Related special
Error Error name Classifi RUN OK Ope-
Description ration
internal output
code [detection timing] -cation LED LED
Bit Word
5F Backup memory error Warning Data cannot be written to the backup *1 Runs
[when program writing is memory.
executed, when PI/O
function setting is
requested]
61 Port 1 transmission error Warning A parity error was detected during *1 Runs
(parity) transmission.
[when transmitting]
62 Port 1 transmission error Warning A framing error or overrun error was *1 Runs
(framing/overrun) detected during transmission.
[when transmitting]
63 Port 1 transmission error Warning A time out error was detected during *1 Runs
(time out) transmission.
[when transmitting]
64 Port 1 transmission error Warning A protocol (transmission procedure) *1 Runs
(protocol error) error was detected during transmission.
[when transmitting]
65 Port 1 transmission error Warning A checksum error was detected during *1 Runs
(BCC error) transmission.
[when transmitting]
67 Port 2 transmission error Warning A parity error was detected during *1 Runs
(parity) transmission.
[when transmitting]
68 Port 2 transmission error Warning A framing error or overrun error was *1 Runs
(framing/overrun) detected during transmission.
[when transmitting]
69 Port 2 transmission error Warning A time out error was detected during *1 Runs
(time out) transmission.
[when transmitting]
6A Port 2 transmission error Warning A protocol (transmission procedure) *1 Runs
(protocol error) error was detected during transmission.
[when transmitting]
6B Port 2 transmission error Warning A checksum error was detected during *1 Runs
(BCC error) transmission.
[when transmitting]
71 Battery error Warning • Battery voltage dropped below the *1 Runs R7D9
*3 (data memory) specified value
[always checking] • Battery not installed
94 Port 1 Warning There is no response with the AT *1 Runs
No modem response command.
[when modem is
connected]
*1: Depends on the CPU’s operating state. The RUN LED is lit while the CPU is in operation; the RUN LED is unlit while the
CPU is not in operation.
*2: Depending on the settings of the operating parameters from the peripherals, the operation may be continued even when an error
occurs.
*3: Although batteries cannot be mounted on the 10- or 14-point type, battery errors are monitored by the system. Set R7EE to
OFF prior to the use.
12-2
Chapter 12 Error Code List and Special Internal Outputs
12-3
Chapter 12 Error Code List and Special Internal Outputs
Originating
Error code Error name Description of error
instruction
H0013 SB undefined SBn instruction corresponding to the instruction CAL
number n in the CALn instruction is not
programmed
H0015 LBL undefined LBLn instruction corresponding to the instruction JMP
number n in the JMPn and CJMPn instructions is CJMP
not programmed
H0016 FOR undefined FORn instruction corresponding to the instruction NEXT
number n in the NEXTn instruction is not
programmed
H0017 NEXT undefined NEXTn instruction corresponding to the FOR
instruction number n in the FORn instruction is
not programmed
H0040 LBL area error LBLn instruction corresponding to the instruction JMP
number n in the JMPn and CJMPn instructions is CJMP
not programmed in the same program area
H0041 CAL nesting overflow There are more than 6 levels of subroutine nesting CAL
H0042 CAL undefined RTS instruction was executed without executing RTS
the CAL instruction
H0043 FOR to NEXT error There is a NEXTn with the same instruction FOR
number n prior to the FORn instruction
H0044 NEXT area error There is no NEXTn instruction with the same FOR
instruction number n as the FORn instruction in
the same program area
H0045 FOR to NEXT nesting The FORn and NEXTn instructions are not nested FOR
overflow
H0046 FOR nesting overflow There are more than 6 nesting levels of FOR to FOR
NEXT NEXT
12-4
Chapter 12 Error Code List and Special Internal Outputs
Setting Resetting
No. Name Meaning Description
condition condition
R7C0 Continue when 0: Stop running when Designates continue/stop running when
overload error occurs overload error occurs a normal scan overload error occurs
(normal scan) 1: Continue running when Turned off by
overload error occurs the user,
turned off
R7C1 Continue when 0: Stop running when Designates continue/stop running when
when power
overload error occurs overload error occurs a periodic-scan overload error occurs Turned on by
failure
(periodic scan) 1: Continue running when the user
memory is
overload error occurs
cleared, or
R7C2 Continue when 0: Stop running when Designates continue/stop running when the CPU is
overload error occurs overload error occurs an interrupt-scan overload error occurs initialized.
(interrupt scan) 1: Continue running when
overload error occurs
R7C3 Undefined Do not use.
R7C4 Undefined Do not use.
R7C5 Undefined Do not use.
R7C6 Undefined Do not use.
R7C7 Modification during 0: Modification during Designates whether online change in
RUN allowed RUN prohibited RUN is allowed in the user program Turned on by
1: Modification during user Turned off by
RUN allowed the user,
turned off
R7C8 Serious failure flag 0: Normal Indicates whether there is an abnormal
when power
1: Abnormal in the microcomputer
failure
(Address error, undefined instruction)
memory is
R7C9 Microcomputer 0: Normal Indicates whether there is an abnormal Turned on by
cleared, or
abnormal 1: Abnormal in the microcomputer the system
the CPU is
(Computation error)
initialized.
R7CA User memory 0: Normal Indicates whether there is an abnormal
abnormal 1: Abnormal in the user memory
R7CB Undefined Do not use.
R7CC Memory size over 0: Normal Indicates whether the capacity set by Turned off by
1: Abnormal the parameter exceeds loaded memor the user,
capacit turned off
R7CD I/O verify mismatch 0: Normal Indicates whether I/O assignment and when power
Turned on by
1: Unmatched loading are matched (Mismatched failure
the system
information output to WRF002) memory is
cleared, or
the CPU is
initialized.
R7CE Undefined Do not use.
R7CF Undefined Do not use.
R7D0 Undefined Do not use.
R7D1 Overload error 0: Normal Indicates whether the normal scan
(normal scan) 1: Scan time over execution time has exceeded the Turned off by
designated time the user,
R7D2 Overload error 0: Normal Indicates whether the periodic scan was turned off
(periodic scan) 1: Scan time over completed within cycle time when power
Turned on by
R7D3 Overload error 0: Normal Indicates whether an interrupt of the failure
the system
(interrupt scan) 1: Scan time over same factor occurred during interrupt memory is
scan execution. cleared, or
R7D4 Grammar/assemble 0: Normal Indicates whether there is a grammar the CPU is
error 1: Error error in the user program (Detailed initialized.
information output to WRF001)
R7D5 Blown fuse detection 0: Normal Indicates whether or not a fuse
1: Error connected to the second pin (see Turned on by Turned off by
Chapter 11) of serial port 1 has blown the system the system
out.
R7D6 Undefined Do not use.
12-5
Chapter 12 Error Code List and Special Internal Outputs
Setting Resetting
No. Name Meaning Description
condition condition
R7D7 Undefined Do not use.
R7D8 Undefined Do not use.
R7D9 0: Normal Indicates whether battery voltage is Turned on by Turned off by
Battery error
1: Abnormal low the system the system *1
R7DA Undefined Do not use.
R7DB Indicates whether there is a self- Turned off by
0: Normal Turned on by
Self-diagnostic error diagnostic error (Detailed information the user,
1: Error the system
output to WRF000) turned off
R7DC when power
Selects whether or not the PWM failure
Output selection at 0: Stops output output, pulse output and counter Turned on by memory is
stop 1: Continues output coincidence output are performed when the user cleared, or
the system is in the stop state. the CPU is
initialized.
R7DD Undefined Do not use.
R7DE Undefined Do not use.
R7DF Undefined Do not use.
R7E0 0: Any key switch location
Key switch location except STOP Turned on by Turned off by
One of these is on
(STOP) 1: Key switch location at the system the system
STOP
R7E1 Undefined Do not use.
R7E2 0: Any key switch location
Key switch location except RUN
One of these is on
(RUN) 1: Key switch location at
Turned off by
RUN
the system
R7E3 0: From the second scan Turns on for one scan after operation is
1 scan ON after RUN after RUN commenced and then turns off
1: One scan after RUN afterwards.
R7E4 0: Non-status of 0 Always outputs 1 regardless of CPU Cannot be
Always ON
1: Alway status turned off.
R7E5 0: 0.01 seconds Toggles between on and off every 0.01
0.02 second clock
1: 0.01 seconds seconds. Turned on by
R7E6 0: 0.05 seconds Toggles between on and off every 0.05 the system
0.1 second clock
1: 0.05 seconds seconds.
R7E7 0: 0.5 seconds Toggles between on and off every 0.5
1.0 second clock
1: 0.5 seconds seconds.
Turned off by
R7E8 0: Unoccupied Indicates occupancy status from the
Occupied flag the system
1: Occupied peripheral unit
R7E9 0: Operation allowed Indicates whether it is operation
RUN prohibited
1: Operation prohibited prohibited status
R7EA Indicates whether operation is
Executing a online 0: Not being executed
temporarily stopped (output hold) due
change in RUN 1: Being executed
to online change in RUN
*1: The battery error (R7D9) will turn off when the error cause is eliminated b replacing the battery, etc.
12-6
Chapter 12 Error Code List and Special Internal Outputs
Setting Resetting
No. Name Meaning Description
condition condition
R7EB Power off memor Clear with 1 Clears the power off memory area.
Turned on by Turned off by
R7EC Clear error special Clear with 1 Clears error special internal output
user the system
internal output (WRF000 to F00A, R7C8 to 7DE)
R7ED Undefined Do not use.
R7EE Battery error display 1: Detection allowed Sets whether or not the battery error is Turned off by
selection to be detected. the user,
turned off
when power
Turned on by
failure
user
memory is
cleared, or
the CPU is
initialized.
R7EF Backup memor 0: Write complete Indicates whether or not data is being
writing execution 1: Write in progress written to the backup memory.
flag
Turned on by Turned off by
R7F0 Carry flag (CY) 0: No carr Indicates whether there is a carryover
the system *2 the system
1: Carry from the operation result
R7F1 Overflow flag (V) 0: No overflow Indicates whether there is overflow in
1: Overflow the operation result
R7F2 Shift data (SD) 0: Shift data “0” Designates the shift data used in shift Turned on by Turned off by
1: Shift data “1” instructions, etc. user user
R7F3 Operation error 0: Normal Indicates whether there is an operation
(ERR) 1: Error error when operation is executed Turned on by
R7F4 Data error (DER) 0: Normal Indicates whether there is a data error the system
1: Error when operation is being executed.
R7F5 PI/O function setting 1: Setting request Performs the PI/O function setting
flag according to WRF06F through
WRF07E.
Turned on by
R7F6 Individual setting 1: Write request Writes the parameters set by the user
user
write request (operation mode settings and
*3 communication function settings) to the
backup memory.
Turned off by
R7F7 PI/O function setting 0: Normal Indicates the results of the PI/O Turned on by
the system
error 1: Error function settings. the system
R7F8 Calendar, clock read 1: Read Read the present values of calendar,
request clock and set in WRF01B to WRF01F
R7F9 Calendar, clock 1: Set Set the data set in WRF01B to
setting request WRF01F in the calendar and clock Turned on by
R7FA Clock ± 30 second 1: Request adjustment When second data (WRF00F) is 0 to user
adjustment request 29, it becomes 0 seconds and when it is
30 to 59, +1 minute is added and
second data becomes 0
R7FB Calendar and clock 0: Normal Indicates whether there is an error in Turned on by
set data error 1: Error calendar and clock set data the system
R7FC Output control 1 0: Output disabled Sets the enabling and disabling when Turned off by
R7FD Output control 2 1: Output enabled Y100 through Y103 is used as PWM the user
R7FE Output control 3 output, pulse output, and counter (Turned off
R7FF Output control 4 coincidence output. by the system
Turned on by
during pulse
user
output)
Also turned
off by CPU
initialization
12-7
Chapter 12 Error Code List and Special Internal Outputs
12-8
Chapter 12 Error Code List and Special Internal Outputs
a: Unit number (0 to 5)
b: Slot number (0 to F)
WRF003 Undefined Do not use.
WRF004 Undefined Do not use.
WRF005 Undefined Do not use.
WRF006 Undefined Do not use.
WRF007 Undefined Do not use.
WRF008 Undefined Do not use.
WRF009 Undefined Do not use.
WRF00A Undefined Do not use.
WRF00B Calendar and clock Year Always displays the 4 digit year
WRF00C present value (4 digit Month/day Always displays month/day data
WRF00D BCD) Day of the week Always displays day of the week data.
(Sunday: 0000 to Saturday: 0006) Set by the Alway
WRF00E Hour/minute Always displays hour/minute data. system displayed
(24-hour system)
WRF00F Seconds Always displays seconds data.
(Lower 2 digits, upper 2 digits are 00)
WRF010 Scan time Maximum execution time Maximum execution time for a normal
(maximum value) for a normal scan scan is stored in 10 ms units
WRF011 Scan time Present value of Present value of execution time for a Cleared by
(present value) execution time for a normal scan is stored in 10 ms units the system (in
normal scan the RUN
WRF012 Scan time Minimum execution time Minimum execution time for a normal starts)
(minimum value) for a normal scan scan is stored in 10 ms units (the first
scan after RUN is HFFFF) Set by the
WRF013 CPU status system
15 14 13 12 11 8 7 6 5 4 3 2 1 0
Unused a b c d e f g h i
Alway
a: CPU type (0011), b: Battery error (1=error, 0=no error), displayed
c: Not used, d-g: Not used (Fixed to 0),
h: Halt (1=executing, 0=not executing),
i: CPU operation (1=RUN, 0=STOP)
12-9
Chapter 12 Error Code List and Special Internal Outputs
Setting Resetting
No. Name Storage data Description
condition condition
WRF014 Word internal output Number of words for Displays one of the following: H0400,
Alway
capacit word internal output H0800, H1000, H2000.
displayed
(WR)
WRF015 Operation error code Operation error code Operation error code is stored Cleared by
(4 digit hexadecimal) Set by the user
WRF016 Division remainder Remainder data when For a double word operation: WRF017 system
register (lower) division instruction (upper), WRF016 (lower)
Cleared by
executed
the system
WRF017 Division remainder For a word operation: WRF016 onl
register (upper)
WRF018 Undefined Do not use.
WRF019 Undefined Do not use.
WRF01A Communication port
1 15 14 13 12 8 7 0
Communication
a b c d Unused
setting
a: Transmission control procedures (0- Standard, 1-Simplified) Set b the Cleared by
b-c: Not used user the user
d: Baud rate during modem connection
= 00000: 4800 bps, = 00001: 9600 bps, = 00010: 19.2 kbps
= 00011: 38.4 kbps, = 00100: 57.6 kbps, = 00101: 2400 bps
= 4800 bps for other than the above
WRF01B Read and set values Year Stores the 4 digit year value that is read
for calendar and or sets the set value
WRF01C clock Month/day Stores the read month/day value or sets
(4 digit BCD) the set value
WRF01D Day of the week data Stores the read day of the week data or
Set by the Cleared by
(Sunday: 0000 to sets the set value
system or user the user
Saturday: 0006)
WRF01E Hour/minute (24-hour Stores the read hour/minute value or
system) sets the set value
WRF01F Seconds Stores the read second value or sets the
set value
WRF020 Undefined Do not use.
to F021
WRF022 Undefined Do not use.
to F023
WRF024 Undefined Do not use.
to F025
WRF026 Undefined Do not use.
to F027
WRF028 Undefined Do not use.
to F029
WRF02A Undefined Do not use.
to F02B
WRF02C Undefined Do not use.
to F02D
WRF02E Undefined Do not use.
to F02F
WRF030 Undefined Do not use.
to F031
WRF032 Undefined Do not use.
to F035
12-10
Chapter 12 Error Code List and Special Internal Outputs
Setting Resetting
No. Name Stored data Description
condition condition
WRF036 Undefined Do not use.
to F03B
WRF03C Dedicated port 1
Modem timeout time
15 8 7 0
a Not used Modem timeout time
12-11
Chapter 12 Error Code List and Special Internal Outputs
Setting Resetting
No. Name Stored data Description
condition condition
WRF057 Detailed information
of counter setting 15 14 8 7 6 5 4 3 2 1 0
errors a Not used b c d e f g h i
12-12
Chapter 12 Error Code List and Special Internal Outputs
Setting Resetting
No. Name Stored data Description
condition condition
WRF06B Pulse and PWM 01: For EH-***DTP The output waveforms of the pulses and
output auto 02: For EH-***DT PWM are automatically corrected by
correction setting 03: For EH-***DRP setting the value corresponding to the
04: For EH-***DRT CPU model.
Other than above: No
auto correction
WRF06C Potentiometer CH1 Sampling number: 0 to Sets the sampling number
WRF06D Potentiometer CH2 40
Values 41 and more are
set to 40.
WRF06E Analog input type
selection
15 14 13 0
a b Not used
12-13
Chapter 13 Troubleshooting
Chapter 13 Troubleshooting
13.1 Error Display and Actions
The display locations of errors detected by individual device in the MICRO-EH system are shown in Figure 13.1. When
an error occurs, take an action according to the error code list.
OK Lam
L/E error display L/E for Windows® error display
13-1
Chapter 13 Troubleshooting
The following shows the range of the special internal output that is cleared when R7EC is set to “1.”
No. Bit special internal output No. Word special internal output
R7C8 Fatal error flag WRF000 Self-diagnostic error code
9 Microcomputer error 1 Syntax/assembler error details
A User memory error 2 I/O verify mismatch details
B (Undefined)
C Memory size over
D I/O verify mismatch
E (Undefined)
R7CF (Undefined)
R7D0 (Undefined)
1 Congestion error (normal scan)
2 Congestion error (periodical scan)
3 Congestion error (interrupt scan)
4 Syntax/assembler error
5 (Undefined)
6 (Undefined)
7 (Undefined)
8 (Undefined)
9 Battery error
A (Undefined)
R7DB Self-diagnostic error
When all of the special internal output data cannot be cleared during program execution, refer to the self-
diagnostic error code list and clear only the corresponding error flags by using forced set of the programmer
or peripheral unit.
Caution
If the internal output for a self-diagnostic error R7DB (WRF000) is used as a system error for the stop condition of CPU
RUN, the R7DB may be turned on even with an error of the warning level (battery error, etc.), causing the CPU to stop.
Therefore, do not use the internal output of the self-diagnostic error as a condition for stopping the CPU.
13-2
Chapter 13 Troubleshooting
Error occurre
Verify the self-diagnostic error code (WRF000) with the RUN and OK
LED statuses or using a peripheral unitand refer to error code list.
Remove the error cause according to the corrective action for each error code as shown below.
If there are spare parts available, replace the parts. Contact our service
department.
13-3
Chapter 13 Troubleshooting
13-4
Chapter 13 Troubleshooting
Cautions
(a) When returning the unit for repair, please notify us of the malfunctioning conditions in as much detail as possible
(including error codes, malfunctioning I/O bit number, will not turn on or off, etc.).
(b) The tools and devices necessary for troubleshooting are briefly as follows:
Phillips/flathead drivers, digital multimeter, tester, oscilloscope (necessary depending on the case) etc.
13-5
Chapter 13 Troubleshooting
Problem occurred
Reference
Major problems Verification points Typical causes of problem
item
PLC will not start Power LED, CPU error Power supply problem, power shut-off, (a)
code insufficient power supply capacity, fatal CPU
error
Will not operate CPU error code, CPU I/O assignment problem, incorrect parameter (b)
(will not RUN) LED, Internal output of settings, incorrect user program, syntax error,
error operating conditions not established, write-
occupied status
Operation stopped Power LED, CPU LED, Power supply problem, expansion power suppl (c)
(RUN stopped) CPU error code problem/shut-off, CPU problem, memory
problem
Erroneous input, no input CPU LED, I/O LED User program timings, input power supply, bad (d)
(abnormal operation) Monitoring by peripheral connection, problem in input area, I/O inductive
units noise
Counter input does not Input LED, special Input power supply, bad connection, problem in (e)
operate internal output setting input area, I/O inductive noise, operating mode
setting error
Output error, no output CPU LED, I/O LED, User programming, bad connection, problem in (f)
(abnormal operation) Monitoring by peripheral output area, I/O inductive noise
units, Forced setting
PWM pulse output does Output LED, special Bad connection, problem in output area, I/O (g)
not operate internal output setting inductive noise, operating mode setting error
Peripheral unit problem CPU error code, fuse, Fatal CPU error, peripheral unit problem, (h)
peripheral units peripheral unit setting error, cable problem,
broken fuse
Operation
13-6
Chapter 13 Troubleshooting
NO
POWER LED is lit
YES
Occur frequently?
NO
Contact our service department
Malfunction due to noise
13-7
Chapter 13 Troubleshooting
Caution
If the CPU is WRITE-occupied, the CPU will not run even if the RUN switch is switched from “STOP” to “RUN.” The
CPU starts running by pressing the GRS key after peripheral units are connected.
13-8
Chapter 13 Troubleshooting
POWER LED is li NO
(Power supply is
normal)
13-9
Chapter 13 Troubleshooting
NO LED error
∗ LED replacement may not be
performed by the user, so a
Check for input error repair request must be
• Check input signal source submitted.
• Check input program
• Malfunction due to noise
13-10
Chapter 13 Troubleshooting
Is there a wiring
error, disconnection YES
or loose screw on th
terminal block?
Perform rewiring
NO
Is there input
when the voltage is NO
checked betwee
the common and bi
on the input side? Check the wiring systems
Change the voltage to satisfy
YES the specifications
NO
Is the LED lit?
13-11
Chapter 13 Troubleshooting
Does it operate as NO
normal input?
Check the input area
YES • Check the input signal source
• Malfunction due to noise
• Cable is disconnected
13-12
Chapter 13 Troubleshooting
(f) Wrong output from output module or output module will not output (operation problem)
The CPU operates, but output signals are not correct.
NO LED error
∗ LED replacement may not be
performed by the user, so a
Check for output error
repair request must be
• Check the output power submitted
suppl
• Check the output program
• Malfunction due to noise
13-13
Chapter 13 Troubleshooting
13-14
Chapter 13 Troubleshooting
Does it operate as NO
normal output?
Check the output area
YES • Output signal voltage
• Power supply voltage for the
load
• Terminal stand wiring
• Terminal stand connection
• Voltage between the
common and bit
• Wiring
Especially for the S terminal on
the transistor
YES
Pulse is output using
the relay output
The expected pulse output fro
the relay is not output
NO
NO
Are the operating mode
settings correct?
Set the operating mode for the
peripheral devices
YES Note:The operating mode can
only be changed while the
CPU is being stopped
Are the I/O function NO
settings correct?
13-15
Chapter 13 Troubleshooting
NO
Is there 5 V DC output NO
when a 5 V DC power
supply is required?
Broken fuse
∗ Fuse replacement may not be
YES
performed by the user, so a
replacement request must be
Replace the connection cable submitted
13-16
Chapter 14 Operation Examples
Start
®
Start the LADDER EDITOR for Windows STEP 1
End
A personal computer and LADDER EDITOR for Windows® are used as the peripheral units in the example. For
details, refer to the user's manual for each peripheral unit.
14-1
Chapter 14 Operation Examples
Startup
GRS screen
Mode switching
14-2
Chapter 14 Operation Examples
STEP 2 Initialization
Settings for the CPU type, memory type and I/O assignment are performed.
Pull-down menu
14-3
Chapter 14 Operation Examples
Pull-down menu
3. Assigning I/O
Click [Utility] → [CPU Setting] → [I/O
Assign] in the Menu bar.
Pull-down menu
14-4
Chapter 14 Operation Examples
v
2] Click the ▼ of the data and select I/O type
from the pull-down display.
3] Click the [OK] button to close the Assignment
Setting dialogue box.
If a wrong value has been entered, the slot is left blank by assigning [Vacant 0] and is treated as though nothing is
assigned to it.
14-5
Chapter 14 Operation Examples
For online mode, it is possible to read the I/O mounted on the CPU by the “Mount” button. For details, refer to the
“Reading Mounted I/O” of the programming device.
14-6
Chapter 14 Operation Examples
Read/Edit screen
Output window
Symbol bar
3] Input the desired function (I/O, comparison expression, arithmetic expression) in the dialogue box for the symbol
displayed.
4] Click the [OK] button in the dialogue box.
Symbol selection
Contact property
14-7
Chapter 14 Operation Examples
Display of symbol
Symbol selection
14-8
Chapter 14 Operation Examples
The input of the horizontal line symbol, which connects between symbols, may be omitted. (Symbols are connected by
horizontal lines by the automatic wiring function at circuit write.)
Symbol selection
Coil property
Display of symbols
Symbol selection
14-9
Chapter 14 Operation Examples
Always enter a space between an I/O number and comparison operator (in this case, between “WY10” and “= =“), as
well as between a comparison operator and comparison data (“= =“ and “0”).
Display of symbols
Display of symbol
14-10
Chapter 14 Operation Examples
Pull-down menu
(Note)
For example, if the I/O assignment of bit Y32 is
missing for unit 1, WY10 of the sample is treated
as undefined; the error is displayed as in the figure
to the right.
If there are any errors, correct the errors of the program before check the program again.
14-11
Chapter 14 Operation Examples
Pull-down menu
14-12
Chapter 14 Operation Examples
GRS screen
GRS screen
Pull-down menu
14-13
Chapter 14 Operation Examples
Pull-down menu
Program transfer
CPU Read: PC (personal computer) ← CPU
CPU Write: PC (personal computer) → CPU
14-14
Chapter 14 Operation Examples
[Circuit monitor]
Click [Mode] → [Monitor] in the Menu bar.
Pull-down menu
Match check
[I/O monitor]
The I/O monitor can be operated while in monitor
mode.
Click [Window] → [I/O Monitor] in the Menu
bar.
The I/O Monitor dialogue box is displayed.
Pull-down menu
14-15
Chapter 14 Operation Examples
I/O monitor
14-16
Chapter 15 Daily and Periodic Inspection
15-1
Chapter 15 Daily and Periodic Inspection
R7D9 Y00100
The battery error can be output to external output Y00100 by
Y00100 using the ladder shown to the left.
* The battery error is not detected unless R7EE is on.
• The self-diagnostic error code “71” indicates that the battery is not loaded or that it has reached its life.
• Exchange the battery every two years even if it is still functional.
• Use the battery within one year after purchase.
Blue Red
Connector on battery side
- +
15-2
Appendix 1 H-series Instruction Support Comparison Chart
A-1
Appendix 1 H-series Instruction Support Comparison Chart
A-2
Appendix 1 H-series Instruction Support Comparison Chart
[Arithmetic instructions]
No. Instruction Instruction name MICRO- EH-150 H-64 H-200 H-250 H-252 H-2000 H-2002 H-4010
EH ~ H-700 H-1002
format H-20 H-300 H-702
H-302
1 d=s Assignment statement { { { { { { { { {
2 d = s1 + s2 Binary addition { { { { { { { { {
3 d = s1 B+ s2 BCD addition { { { { { { { { {
4 d = s1 – s2 Binary subtraction { { { { { { { { {
5 d = s1 B– s2 BCD subtraction { { { { { { { { {
6 d = s1 × s2 Binary multiplication { { { { { { { { {
7 d = s1 B× s2 BCD multiplication { { { { { { { { {
8 d = s1 S× s2 Signed binary multiplication { { × × { { { { {
9 d = s1 / s2 Binary division { { { { { { { { {
10 d = s1 B/ s2 BCD division { { { { { { { { {
11 d = s1 S/ s2 Signed binary division { { × × { { { { {
12 d = s1 OR s2 Logical OR { { { { { { { { {
13 d = s1 AND s2 Logical AND { { { { { { { { {
14 d = s1 XOR s2 Exclusive OR { { { { { { { { {
15 d = s1 == s2 = comparison expression { { { { { { { { {
16 d = s1 S== s2 Signed = comparison expression { { × × { { { { {
17 d = s1 < > s2 ≠ comparison expression { { { { { { { { {
18 d = s1 S< > s2 Signed ≠ comparison expression { { × × { { { { {
19 d = s1 < s2 < comparison expression { { { { { { { { {
20 d = s1 S< s2 Signed < comparison expression { { × × { { { { {
21 d = s1 <= s2 ≤ comparison expression { { { { { { { { {
22 d = s1 S<= s2 Signed ≤ comparison expression { { × × { { { { {
A-3
Appendix 1 H-series Instruction Support Comparison Chart
[Control instructions]
No. Instruction Instruction name MICRO- EH-150 H-64 H-200 H-250 H-252 H-2000 H-2002 H-4010
EH ~ H-700 H-1002
format H-20 H-300 H-702
H-302
1 END End normal scan { { { { { { { { {
2 CEND (s) End scan condition { { { { { { { { {
3 JMP n Unconditional jump { { { { { { { { {
4 CJMP n (s) Conditional jump { { { { { { { { {
5 RSRV n Reserve × × × × × × { { {
6 FREE Free reserve × × × × × × { { {
7 LBL n Label { { { { { { { { {
8 FOR n (s) For { { × × { { { { {
9 NEXT n Next { { × × { { { { {
10 CAL n Call subroutine { { { { { { { { {
11 SB n Start subroutine progra { { { { { { { { {
12 RTS Return subroutine { { { { { { { { {
13 START n Start basic task × × × × × × { { {
14 INT n Start interrupt scan progra { { { { { { { { {
15 RTI Return interrupt { { { { { { { { {
A-4
Appendix 1 H-series Instruction Support Comparison Chart
A-5
Appendix 1 H-series Instruction Support Comparison Chart
A-6
Appendix 1 H-series Instruction Support Comparison Chart
A-7
Appendix 1 H-series Instruction Support Comparison Chart
A-8
Appendix 1 H-series Instruction Support Comparison Chart
A-9
Appendix 2 Task Code Specifications
The following explains the details of each task code function and response command function.
Each task code is explained using the format shown below:
Response,
CPU control,
Task code Task code Task code
Classification memory read,
Response task code number description
memory write
or I/O control
Function
Execution condition
Format
Description
Example
A-10
Appendix 2 Task Code Specifications
The table indicates the CPU status in which the task code is executable and the memory occupancy status.
For the details of the CPU status, refer to CPU status read of task code H10.
CPU status
STOP RUN HALT ERROR
× × × × READ occupanc Occupanc
{ × × { WRITE occupanc status
{: Executable
×: Not-executable
In example 1, the task code can only be executed when the CPU is in the STOP or ERROR status and the memory is
WRITE-occupied.
CPU status
STOP RUN HALT ERROR
{ { { { READ occupanc Occupanc
{ { { { WRITE occupanc status
A-11
Appendix 2 Task Code Specifications
A-12
Appendix 2 Task Code Specifications
Indicates that the requested task code has been executed normally.
Format
Indicates that there is an error in the task code requested for execution.
(Task code undefined, parameter error, etc.)
Format
Description
A-13
Appendix 2 Task Code Specifications
Indicates that the local terminal does not occupy the CPU during monitoring.
Format
Format
Description
A-14
Appendix 2 Task Code Specifications
Indicates that the requested task code was not executed because another task code was being executed.
(Note) Create a program so that transmission is retried from a request task code when BUSY is responded.
Format
Format
Description
Indicates that there was a communication error or the designated destination address does not exist.
A-15
Appendix 2 Task Code Specifications
Execution condition
CPU status
STOP RUN HALT ERROR
{ { { { READ occupanc Occupanc
{ { { { WRITE occupanc status
{ { { { Not occupied
Format
Response
1] Read CPU status (subcommand H00)
A-16
Appendix 2 Task Code Specifications
(a) H10 (b) (c) (d) (e) (f) (g) (h) (i)
A-17
Appendix 2 Task Code Specifications
Description
(1) CPU status (4 digits) b area details (response to the subcommand “H00”)
bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
0 0 0 0 0 0 0 0
α β α1 β1 αn βn
A-18
Appendix 2 Task Code Specifications
Example
1 0 0 0
Response
0 0 1 0 0 3 0 1 0 1
1 0 0 1
Response
0 0 1 0 0 2 0 0 1 0 0 0 4 C
A-19
Appendix 2 Task Code Specifications
Declares that the user memory will be accessed. The user memory cannot be accessed by the host unless the CPU is occupied
using this task code. Also, depending on the function selection, it performs the same processing as the parameter modification
completion processing (task code H27).
Execution condition
CPU status
STOP RUN HALT ERROR
Function H01 { { { { READ occupancy Occupancy
selection × × × × WRITE occupanc status
sub- H02 × × × × READ occupancy
command { { { { WRITE occupanc
H05 { { { { READ occupancy
{ { { { WRITE occupanc
H06 { *1 { *1 { *1 { *1 READ occupancy
{ { { { WRITE occupanc
H00 { { { { READ occupancy
{ { { { WRITE occupanc
Format
Request
(a) Function selection (subcommand)
H16 (a) 1] H01: READ occupanc
2] H02: WRITE occupanc
3] H05: Modifies the local station occupancy mode from WRITE occupanc
to READ occupancy.
4] H06: Modifies the local station occupanc mode from READ occupancy to
WRITE occupancy.
5] H00: Cancels the local station occupancy.
Response
(a) Response task code (H00 when executed normally)
(a) H16 (b) For task codes other than the normal task codes, refer to the “Response list b
task code” at the end of this chapter.
(b) User program version (H00 to HFF)
A-20
Appendix 2 Task Code Specifications
Description
3] Occupancy mode modification (modification from WRITE occupancy to READ occupancy) (subcommand H05)
Modifies the CPU occupancy mode of the local station to the READ occupancy.
This command cannot be executed when the local station is not occupying the CPU.
When modifying from WRITE occupancy to READ occupancy, the parameter modification completion processing is
performed.
4] Occupancy mode modification (modification from READ occupancy to WRITE occupancy) (subcommand H06)
Modifies the CPU occupancy mode of the local station to WRITE occupancy.
This command cannot be executed when the local station is not occupying the CPU.
This command cannot be executed when another station is occupying the CPU.
From the viewpoint of host A, host A is the local station and host B is the other station.
From the viewpoint of host B, host B is the local station and host A is the other station.
A-21
Appendix 2 Task Code Specifications
Forces the cancel of CPU occupancy. This command is used in situations such as when another programming device has been
down due to an error while occupying the user memory of the CPU (function selection H00).
When connecting the host to the CPU and occupying it for the first time, use function selection H01 so the local occupanc
status is canceled forcibly.
This task code can also be executed when the CPU is not occupied.
Execution condition
CPU status
STOP RUN HALT ERROR
{ { { { READ occupanc Occupanc
{ { { { WRITE occupanc status
{ { { { Not occupied
Format
Request
(a) Function selection (subcommand)
H17 (a) 1] H00: Forced cancel of all occupanc
2] H01: Forced cancel of local station occupanc
Response
(a) Response task code (H00 when executed normally)
(a) H17 (b) For task codes other than the normal task codes, refer to the “Response list b
task code” at the end of this chapter.
Description
With forced cancel, if there are modification in the parameter area, the same processing as parameter modification completion
processing is performed (refer to the task code H27) as well as the canceling of memory occupancy.
1] Forced cancel of all occupancy (subcommand H00)
All occupancy is canceled unconditionally, so when this command has been executed the peripheral that is reading the user
memory, for example, will not be able to perform reading. Therefore, verify the registered peripherals by monitoring the
occupancy table (WRF040 to WRF04B) when executing this command.
A
READ
B request
Not-executable error
A-22
Appendix 2 Task Code Specifications
Description
A A
B C
Example
Function selection H00 Function selection H01
Request
1 7 0 0 1 7 0 1
Response
0 0 1 7 0 0 1 7
A-23
Appendix 2 Task Code Specifications
Sets data to or reads data from the internal calendar clock of the CPU module.
Execution condition
Request
Response
*1: Added as response data only when the function selection is H00.
Description
A-24
Appendix 2 Task Code Specifications
Example
1 8 0 0
Response
0 0 1 8 1 9 9 1 0 3 2 1 0 4 0 8 0 5 3 0
1 8 0 1 1 9 9 1 0 4 2 0 0 6 1 6 5 0 3 0
Response
0 0 1 8
Normal execution
A-25
Appendix 2 Task Code Specifications
Task code H1C Line disconnection when the modem is Classification CPU control
connected
Function
Execution condition
CPU status
STOP RUN HALT ERROR
{ { { { READ occupanc Occupanc
{ { { { WRITE occupanc status
{ { { { Not occupied
Format
Request
H1C
Response
(a) Response task code (H00 when executed normally)
(a) H1C For task codes other than the normal task codes, refer to the “Response list b
task code” at the end of this chapter.
Description
This task code will not be accepted unless the modem is connected. The response will not be processed and will end normally.
A-26
Appendix 2 Task Code Specifications
Execution condition
CPU status
STOP RUN HALT ERROR
× × × × READ occupanc Occupanc
{ × × { WRITE occupanc status
Format
Description
Assignment capacit
Parameter area ((A), (B) total) : H0280
H0000
Ladder area : Load capacity *2 – H0280
*2: Obtain the installation capacity from the user memory capacity of the task code H10 CPU status lead.
When the subcommand H00 or H03 is executed using task code H20, always execute the task code H27 of parameter
modification completion, when the write processing to each user-memory area is completed.
A-27
Appendix 2 Task Code Specifications
Task code H23 Program transfer with address designation Classification Memory write
Function
Writes the designated number of program steps to the user memory, starting with the designated address.
Execution condition
CPU status
STOP RUN HALT ERROR
× × × × READ occupanc Occupanc
{ × × { WRITE occupanc status
Format
Request
Response
(a) H23
A-28
Appendix 2 Task Code Specifications
Description
Ladder area
*1: For the designated data and program, use the data and program read using task code H31 “read program with
address designation.” If an invalid data or program is written, the CPU module may stop due to an error.
A-29
Appendix 2 Task Code Specifications
Execution condition
CPU status
STOP RUN HALT ERROR
× × × × READ occupanc Occupanc
{ × × { WRITE occupanc status
Format
Request
H00 H 0 0 0 0 0 2 8 0
H26 (c)
(a) (b)
(d)
Response
(a) Response task code (H00 when executed normally)
(a) H26 For task codes other than the normal task codes, refer to the “Response list b
task code” at the end of this chapter.
Description
Request
Parameter area Hi-Ladder user
H26 H00 memory capacity H00000000 memory capacity
Parameter area
memory capacity
After this task code is executed, always execute task code H27 “parameter modification completion,” when the memory write
processing is complete.
A-30
Appendix 2 Task Code Specifications
Notifies the CPU that the parameter area data has been modified.
Execution condition
CPU status
STOP RUN HALT ERROR
× × × × READ occupanc Occupanc
{ × × { WRITE occupanc status
Format
Request
H27
Response
(a) Response task code (H00 when executed normally)
(a) H27 For task codes other than the normal task codes, refer to the “Response list b
task code” at the end of this chapter.
Description
(1) Conducts I/O assignment based on the parameter information stored in parameter area (A) of the user memory so that the
I/O and communication actions are performed according to the new I/O assignment.
(2) When the initialization of all user memory areas, zero clear, change in parameter area (A), or the writing of memor
assignment is performed, always execute this task code when the memory write processing is completed.
(3) If the I/O assignment of each communication module is erased, or if the slots are changed after this task code has been
executed, communication between the CPU and the connected host cannot be performed. In such cases, connect the
programming device to the CPU and perform the necessary operations such as I/O assignment to recover.
A-31
Appendix 2 Task Code Specifications
Task code H28 Timer/counter set value modification Classification Memory write
Function
Modifies the set value for the Hi-Ladder program timer or counter.
Execution condition
1] CPU status
CPU status
STOP RUN HALT ERROR
× × × × READ occupancy Occupancy
{ { { { WRITE occupancy status
2] The special internal output R7C7, which allows modification during RUN, must be on.
3] Normal scan time must be less than three seconds during RUN.
4] When an error occurs, it is not in the fatal error status.
While a modification is performed in a status other than STOP or ERROR, the special internal output R7EA (modify in
progress while running) will be turned on.
Format
Request
H28 H02 (b) (c) (d) (e) (f1) (f2) (g1) (g2)
(a)
A-32
Appendix 2 Task Code Specifications
(Example) When “H03” (change time base and set value number 1) is set as the modification code, set “0” for the I/O code
(f1) and the I/O number (f2) of the set value number 2, which is not to be modified.
(a) (b) (c) (d) (e) (f1) (f2) (g1) (g2)
2 8 0 2 T D No 0 3 0 2 0 0 0 0 0 7 0 0 0 0 1 A 0 0 0 0 0 0 0 0
(f1) Set value number 1 I/O code Type I/O code I/O number
(f2) Set value number 1 I/O number Constant H07 H000000 to H00FFFF
(g1) Set value number 2 I/O code WX H08 H000000 to H000010 *
(g2) Set value number 2 I/O number WY H09 H000000 to H00000C *
WR H0A H000000 to H000FFF
Response WL H0B -
WM H0C H000000 to H0003FF
(a) H28
*1: This will differ depending on the CPU type. See Chapter 6 for details.
Description
Modifies the timer counter set value within the ladder program. While the CPU is running, the set values are modified without
stopping the scan when the normal scan END command is executed.
Note: When an address other than H0000 is designated, the settings will be modified if an error with the return code H04
(address error) or H0F (program not logical) occurs or if the timer is written to the designated address (user program
area).
A-33
Appendix 2 Task Code Specifications
Task code H31 Program read with address designation Classification Memory read
Function
Reads the designated number of program steps, starting with the designated address.
Execution condition
CPU status
STOP RUN HALT ERROR
{ { { { READ occupanc Occupanc
{ { { { WRITE occupanc status
Format
Request
H00
H31 (b) (c)
(a)
Response
Description
Request
H31 H00 Head address Number of steps
1st step
Number of steps 2nd step
3rd step
A-34
Appendix 2 Task Code Specifications
Example
3 1 0 0 1 A B 0 0 3
Response
0 0 3 1 4 4 1 0 0 8 0 0 4 0 8 0 4 0 0 0
4 2 D 0 8 0 0 0
3rd step
A-35
Appendix 2 Task Code Specifications
Returns the circuit number, head address and the number of steps of the final circuit. (Hi-Ladder only)
Execution condition
CPU status
STOP RUN HALT ERROR
{ { { { READ occupanc Occupanc
{ { { { WRITE occupanc status
Format
Request
H33
* This will be ignored even when the subcommand is disabled. (This is because there are peripheral equipment that request
from 3300)
Response
A-36
Appendix 2 Task Code Specifications
Description
User memory
H33
Final circuit
Number of steps
Example
Assume the final circuit number as 100 (H64), the head address as H1C80 and the number of steps as 10 (H0A).
Request
3 3
Response
0 0 3 3 0 0 6 4 1 C 8 0 0 0 0 A
A-37
Appendix 2 Task Code Specifications
Execution condition
CPU status
STOP RUN HALT ERROR
{ { { { READ occupanc Occupanc
{ { { { WRITE occupanc status
Format
Request
Response
(d)
A-38
Appendix 2 Task Code Specifications
Description
Request
H35 H00
Response
Parameter area Ladder user memory
H00 H35 H00000000
memory capacity capacity
Parameter area
memory capacity
Ladder user
memory capacity
Example
Assume that 640 (H0280) steps are assigned as the parameter area and 3 K (H0C00) steps as the ladder memory capacity.
Request
3 5 0 0
Response
0 0 3 5 0 0 0 0 0 2 8 0 0 0 0 0 0 0 0 0
0 0 0 0 0 C 0 0
LADDER
A-39
Appendix 2 Task Code Specifications
Task code H40 Monitoring with I/O number designation (N continuous Classification I/O control
points)
Function
Reads N continuous points (words) of monitor data, starting with the specified I/O number.
* This task code can also be executed even when the CPU is not occupied. However, the response task code will be “H02”
(local station is not occupying the CPU).
Execution condition
CPU status
STOP RUN HALT ERROR
{ { { { READ occupanc Occupanc
{ { { { WRITE occupanc status
{ { { { Not occupied
Format
Response
(a) Response task code (H00 when executed
(a) H40 (b) normally)
For task codes other than the normal task codes,
refer to the “Response list by task code” at the
end of this chapter.
(b) Monitor data
bit7 0
1st 2nd 8th
point point point
(Word data)
Number of words
H L
A-40
Appendix 2 Task Code Specifications
Description
I/O N points
H40 I/O No.
code
(Request)
Data memory
N points
(N<17)
8th point
Bit
(Request)
Data memory
N words
Nth word
The CPU detects the head of the monitor data according to the
requested I/O code and I/O number, then in response returns
the monitor data for the number of words requested.
Word
A-41
Appendix 2 Task Code Specifications
I/O number
Symbol I/O code Decimal Hexadecimal
(partially hexadecimal)
X H00 00000 to 4FF95 H000000 to H4FF5F
Y H01 00000 to 4FF95 H000000 to H4FF5F
Timer, counter H05 0 to 511 H000000 to H0001FF
CL H06 0 to 511 H000000 to H0001FF
WX H08 0000 to 4FF9 H000000 to H004FF9
WY H09 0000 to 4FF9 H000000 to H004FF9
TC H0D 0 to 511 H000000 to H0001FF
DIF H0E 0 to 511 H000000 to H0001FF
DFN H0F 0 to 511 H000000 to H0001FF
Note:
1. In the decimal expression of X and Y, the lower two digits are decimal and the upper three digits are hexadecimal.
Perform conversion from decimal to hexadecimal with respect to the lowest two digits.
(Example) 4FF90 → 4FF5A
2. In the decimal expression of WX, WY, the lowest digit is decimal and the upper three digits are hexadecimal.
A-42
Appendix 2 Task Code Specifications
Task code H42 Forced set/reset with I/O number designation (N Classification I/O control
continuous points)
Function
Forcibly sets and resets the designated data in N continuous points (words) of data area, starting with the designated I/O. Valid
I/O codes are 00 to 06 and 08 to 0F
Execution condition
CPU status
STOP RUN HALT ERROR
{ { { { READ occupanc Occupanc
{ { { { WRITE occupanc status
Format
(Word data)
Word number value
H L
A-43
Appendix 2 Task Code Specifications
Task code H44 Monitoring with I/O number designation (N random Classification I/O control
points)
Function
Reads the monitor data by designating N random points (words) of I/O numbers.
* This task code can also be executed when the CPU is not occupied. However, the response task code will be “H02 ” (local
station is not occupying the CPU).
Execution condition
CPU status
STOP RUN HALT ERROR
{ { { { READ occupanc Occupanc
{ { { { WRITE occupanc status
{ { { { Not occupied
Format
Request
1st point (word) Nth point (word)
Response
Monitor data (1st point, 1st word) Monitor data (Nth point, Nth word)
(Bit data)
0 0 0 "0" or "1"
One point
(Word data)
H0000 to HFFFF
One word
A-44
Appendix 2 Task Code Specifications
Description
H44 N points I/O code I/O No. I/O code I/O No.
1st point
Nth point
The CPU detects the head of the monitor data according to
the requested I/O code and I/O number, then in response
returns the monitor data for the number of bits requested.
Bit
H44 N points I/O code I/O No. I/O code I/O No.
1st word
Nth word
The CPU detects the head of the monitor data according to
the requested I/O code and I/O number, then in response
returns the monitor data for the number of words requested.
Word
A-45
Appendix 2 Task Code Specifications
Task code H45 Forced set/reset with I/O number designation (N random Classification I/O control
points)
Function
Designates N points (words) of I/O numbers randomly, and forcibly sets the designated data or resets the data area.
Valid I/O codes are 00 to 06 and 08 to 0F.
Execution condition
CPU status
STOP RUN HALT ERROR
{ { { { READ occupanc Occupanc
{ { { { WRITE occupanc status
Format
Request
(Bit data)
0 0 0 "0" or "1"
(Word data)
H0000 to HFFFF
Response
(a) Response task code
(a) H45 For task codes other than the normal task codes, refer to the “Response list b
task code” at the end of this chapter.
A-46
Appendix 2 Task Code Specifications
Task code HA0 Monitoring with I/O number designation (N continuous Classification I/O control
points)
Function
Reads N continuous points (words) of monitor data, starting with the designated I/O number.
* This task code can also be executed when the CPU is not occupied.
Execution condition
CPU status
STOP RUN HALT ERROR
{ { { { READ occupanc Occupanc
{ { { { WRITE occupanc status
{ { { { Not occupied
Format
Request
(a) I/O code Refer to the task
HA0 (a) (b) (c) (b) I/O number code H40.
(c) Number of bits H01 to HF0 (1 to 240)
Number of words H01 to H78 (1 to 120)
Response
(a) Response task code (H00 when executed
(a) HA0 (b) normally)
For task codes other than the normal task
codes, refer to the “Response list by task
code” at the end of this chapter.
(b) Monitor data
(Word data)
Number of words
H L
A-47
Appendix 2 Task Code Specifications
Description
(Request)
Data memory
N points
(N<17)
8th point
Bit
(Request)
Data memory
N words
Nth word
The CPU detects the head of the monitor data according to the
requested I/O code and I/O number, then in response returns
the monitor data for the number of words requested.
Word
A-48
Appendix 2 Task Code Specifications
Task code HA2 Forced set/reset with I/O number designation (N Classification I/O control
continuous points)
Function
Forcibly sets and resets the designated data in N continuous points (words) of data area, starting with the specified I/O.
* This task code can also be executed when the CPU is not occupied.
Execution condition
CPU status
STOP RUN HALT ERROR
{ { { { READ occupanc Occupanc
{ { { { WRITE occupanc status
{ { { { Not occupied
Format
Request
(a) I/O code
HA2 (a) (b) (c) (d) (b) I/O number *1
(c) Number of bits
H01 to HC8 (1 to 200)
Number of words
H01 to H64 (1 to 100)
*1 Refer to task code H40
(d) Set/reset data
(Word data)
Number of words
H L
A-49
Appendix 2 Task Code Specifications
Task code HA4 Monitoring with I/O number designation (N random Classification I/O control
points)
Function
Reads the monitor data by designating N random points (words) of I/O numbers.
* This task code can also be executed when the CPU is not occupied.
Execution condition
CPU status
STOP RUN HALT ERROR
{ { { { READ occupanc Occupanc
{ { { { WRITE occupanc status
{ { { { Not occupied
Format
Request
1st point (word) Nth point (word)
Response
Monitor data (1st point, 1st word) Monitor data (Nth point, Nth word)
(Bit data)
0 0 0 “0” or “1”
One point
(Word data)
H0000 to HFFFF
One word
A-50
Appendix 2 Task Code Specifications
Description
HA4 N points I/O code I/O No. I/O code I/O No.
1st point
Nth point
The CPU detects the head of the monitor data according to
the requested I/O code and I/O number, the in response
returns the monitor data for the number of bits requested.
Bit
1st word
Nth word
The CPU detects the head of the monitor data according to
the requested I/O code and I/O number, then in response
returns the monitor data for the number of words requested.
Word
A-51
Appendix 2 Task Code Specifications
Task code HA5 Forced set/reset with I/O number designation (N random Classification I/O control
points)
Function
Designates N points (words) of I/O numbers randomly, and forcibly sets the designated data or resets the data area.
* This task code can also be executed when the CPU is not occupied.
Execution condition
CPU status
STOP RUN HALT ERROR
{ { { { READ occupanc Occupanc
{ { { { WRITE occupanc status
{ { { { Not occupied
Format
Request
(Bit data)
0 0 0 “0” or “1”
(Word data)
H0000 to HFFFF
A-52
Appendix 2 Task Code Specifications
A-53
Appendix 2 Task Code Specifications
A-54
Appendix 2 Task Code Specifications
A-55
Appendix 2 Task Code Specifications
A-56
Appendix 2 Task Code Specifications
A-57