0% found this document useful (0 votes)
304 views257 pages

Programming Manual: Programmable Controller

This document is a programming manual for TOYOPUC Programmable Controllers. It contains 6 chapters that describe how to create sequence programs and circuits using the controller's programming functions. These include instructions for using inputs, outputs, internal relays, timers, counters, and other logic elements. It also covers application instructions, data registers, and special registers. The manual provides safety information and guidelines for proper use of the controller to prevent injuries during operation and maintenance.

Uploaded by

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

Programming Manual: Programmable Controller

This document is a programming manual for TOYOPUC Programmable Controllers. It contains 6 chapters that describe how to create sequence programs and circuits using the controller's programming functions. These include instructions for using inputs, outputs, internal relays, timers, counters, and other logic elements. It also covers application instructions, data registers, and special registers. The manual provides safety information and guidelines for proper use of the controller to prevent injuries during operation and maintenance.

Uploaded by

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

Programmable Controller

PROGRAMMING MANUAL
1. MAKING SEQUENCE CIRCUITS 1

2. EXECUTION OF PROGRAM 2

3. PARAMETER 3

4. USER MEMORY STRUCTURE 4

5. INSTRUCTION WORDS 5

PROGRAMMING MANUAL 6. Appendix 6


FOREWORD

Thank you very much for purchasing our Programmable Controller.

This operation manual is the programming manual for TOYOPUC-PCk05/PCk06 series.

For safety use of this product, read carefully this manual and other related individual operation
manuals altogether. Further, keep these manuals in file at an easily accessible place so that
persons concerned can read them anytime as necessary.

The distributor or dealer of this product is requested to hand over the said manuals to the end
user without fail.

The specification and other relevant information included in this Manual are subject to change
due to better improvement without prior notice.

Any product applicable to the strategic goods (or services) stipulated in the Foreign Exchange
and Foreign Trade Control Act is subject to export license of the Japanese Government, where
exported to overseas.

Should this product result in trouble during the guarantee period due to somewhat cause
attributed to our responsibility, necessary device(s) or parts(s) shall be repaired or replaced at
our discretion. For any other trouble or accident out of our responsibility, our company shall
be released from the responsibility for injury which may arise from such a trouble or accident.

i
FOR SAFETY OPERATION

Before installing, operating, maintaining and checking, read carefully this Manual without fail for
proper and safety operation and work. Any operator and any maintenance man who relate to
this product (Programmable Controller) are requested to acquire the knowledge on devices,
safety information and cautions before being engaged in the operation and maintenance. This
Manual classifies the safety caution level into "WARNING" and "CAUTION" using alert symbols
as follows.

Failure to observe the instructions given in this Manual could result


in death or bodily injury of the operator.

Failure to observe the instructions given in this Manual could result in


risk of bodily injury or physical damage to equipment, etc.

Don't overhaul the module and don't touch the module internals,
with the power switch kept ON.
Failure to observe this instruction could result in electric shock.

Don't touch the terminals with the power switch kept ON.
Failure to observe this instruction could result in electric shock.

Execute write during PC run (write during run) only when cyclic
operation of main equipment/machine is in shutdown.
Failure to observe this instruction could result in breakdown of its
device(s) and bodily injury from mis-operation, if any.

In handling the lithium battery, read and observe " Lithium Battery
Handling Cautions " given in this Manual. Improper handling
would cause liquid leak, overheat, sparking, and fracture, which
could then result in breakdown of units and devices and bodily
injury.

Regarding safe-related signals and emergency stop circuit, etc.,


handle those signals in external units without through this system.

ii
Use this product under an environment which meets the
environmental general specification specified in this Manual.

Don't attach/detach each module to/from its base, with the power
switch kept ON.

Don't touch directly the electronic circuits inside the module.


Failure to observe this instruction could result in breakdown of the
module by static electricity.

iii
REVISION HISTORY OF OPERATION MANUAL
Operation manual revision No. is added as a part of Manual No. described on the cover sheet of
the manual.
Operation Manual No.

T – 361 # E

N: Japanese E: English
Series No.
Revision symbol

Revision Date of Revision Revision Details


No.

1 Sep.2007 1st revision

Composition of Related Operation Manuals


Operation Title Outline
manual No.

T-360*E PCk05/PCk06 Instruction Manual It describes the basic operation, function,


specifications and so on of PCk05/PCk06.

T-A50*E PCwin-PCk Instruction Manual It describes the operation of PCwin-PCk


(Programmer for PCk05/PCk06).

This manual describes programming with the TOYOPUC-PCk05/PCk06 series.


Although the basic programming method is common to all the PCK05/PCk06 series, there are
differences in the application instructions and the external I/O devices which can be used and in
the program capacities, etc. Model-specific functions are marked as shown below. Common
functions are not marked.
Along with this manual, it is recommended that you read the operation manuals for TOUOPUC.

PCk05-specific functions------------------PCk05

PCk06-specific functions------------------PCk06

iv
Contents
FOREWORD
FOR SAFETY OPERATION
REVISION HISTORY OF OPERATION MANUAL
Composition of Related Operation Manuals

1. MAKING SEQUENCE CIRCUITS ........................................................................................................................ 1-1


1.1. Usage of TOYOPUC ...................................................................................................................................... 1-1
1.1.1. Connection between I/O devices and TOYOPUC................................................................................... 1-1
1.1.2. I/O address .............................................................................................................................................. 1-1
1.2. Circuit diagram configuration ......................................................................................................................... 1-3
1.3. I/O circuit ........................................................................................................................................................ 1-3
1.3.1. Input section ............................................................................................................................................ 1-3
1.3.2. Output section ......................................................................................................................................... 1-4
1.4. Logic section .................................................................................................................................................. 1-5
1.4.1. Internal relay (dummy output) ................................................................................................................. 1-5
1.4.2. Timer........................................................................................................................................................ 1-6
1.4.3. Counter .................................................................................................................................................... 1-7
1.4.4. Keep relay ............................................................................................................................................... 1-8
1.4.5. Edge detection......................................................................................................................................... 1-9
1.4.6. Special relay .......................................................................................................................................... 1-10
1.4.7. Link relay ............................................................................................................................................... 1-19
1.5. Application instruction .................................................................................................................................. 1-20
1.5.1. Application instruction............................................................................................................................ 1-20
1.5.2. Data register .......................................................................................................................................... 1-20
1.5.3. Current value register ............................................................................................................................ 1-20
1.5.4. Special register ...................................................................................................................................... 1-21
1.5.5. CPU error code table............................................................................................................................. 1-25
1.5.6. PCk05/PCk06 input parameter setting table ......................................................................................... 1-28
1.5.7. PCk05/PCk06 input parameter setting program example..................................................................... 1-29
1.5.8. CPU PORT2 setting table...................................................................................................................... 1-30
1.5.9. CPU PORT2 setting program example ................................................................................................. 1-32
1.6. Network slave operation............................................................................................................................... 1-33
1.6.1. Network slave ........................................................................................................................................ 1-33
1.6.2. MODBUS function code supported ....................................................................................................... 1-33
1.6.3. Determining the MODBUS address ...................................................................................................... 1-33
1.6.4. DirectNET address ................................................................................................................................ 1-37
2. EXECUTION OF PROGRAM ............................................................................................................................... 2-1
2.1. Processing operation ..................................................................................................................................... 2-1
2.2. Subroutine ...................................................................................................................................................... 2-2
2.3. Interrupt program ........................................................................................................................................... 2-3
2.3.12. Interrupt program considerations .......................................................................................................... 2-3
2.4. Scan time ....................................................................................................................................................... 2-3
3. PARAMETER........................................................................................................................................................ 3-1
3.1. Contents of parameters.................................................................................................................................. 3-1
3.2. Setting the parameters................................................................................................................................... 3-1
3.2.1. Setting with a peripheral device .............................................................................................................. 3-1
4. USER MEMORY STRUCTURE ........................................................................................................................... 4-1
4.1. Program memory structure ............................................................................................................................ 4-1
4.2. Data memory structure................................................................................................................................... 4-2
4.2.1.1. Data memory address....................................................................................................................... 4-2
5. INSTRUCTION WORDS ...................................................................................................................................... 5-1
5.1. Basic instructions ........................................................................................................................................... 5-1
1. STR, STR NOT................................................................................................................................ 5-2
2. AND, AND NOT ............................................................................................................................... 5-3
3. OR, OR NOT ................................................................................................................................... 5-4
4. AND STR......................................................................................................................................... 5-5
5. OR STR ........................................................................................................................................... 5-6
6. OUT ................................................................................................................................................. 5-7
7. SET.................................................................................................................................................. 5-8
8. RST ................................................................................................................................................. 5-9
9. PTS, NTS ...................................................................................................................................... 5-10
5.2. Timer and counter instructions ..................................................................................................................... 5-12
1. TMRH (Direct mode 10ms timer) .............................................................................................. 5-15
2. TMRH (Indirect mode 10ms timer)............................................................................................ 5-16
3. TMR (Direct mode 100ms timer)............................................................................................... 5-17
4. TMR (Indirect mode 100ms timer) ............................................................................................ 5-18
5. TMRSH (Direct mode 10ms integrating timer).......................................................................... 5-19
6. TMRSH (Indirect mode 10ms integrating timer) ....................................................................... 5-20
7. TMRS (Direct mode 100 ms integrating timer) ......................................................................... 5-21
8. TMRS (Indirect mode 100 ms integrating timer)....................................................................... 5-22
9. CNT (Direct mode up counter).................................................................................................. 5-23
10. CNT (Indirect mode up counter) ............................................................................................... 5-24
11. CNTH (Direct mode up/down counter)...................................................................................... 5-25
12. CNTH (Indirect up/down counter) ............................................................................................. 5-27
5.3. Contact type application instructions ........................................................................................................... 5-29
1. W=H 4-digit hexadecimal constant comparison (=) .................................................................. 5-31
2. W=N Word data comparison (=) ............................................................................................... 5-32
3. W<>H 4-digit hexadecimal constant comparison (<>).............................................................. 5-33
4. W<>N Word data comparison (<>) ........................................................................................... 5-34
5. W>=H 4-digit hexadecimal constant comparison (>=).............................................................. 5-35
6. W>=N Word data comparison (>=) ........................................................................................... 5-36
7. W<H 4-digit hexadecimal constant comparison (<) .................................................................. 5-37
8. W<N Word data comparison (<) ............................................................................................... 5-38
5.4. Output type application instructions ............................................................................................................. 5-39
5.4.1. Transfer instructions .............................................................................................................................. 5-49
1. WMOV 4-digit Hex constant transfer (FUN101) ....................................................................... 5-50
2. DMOV 8-digit Hex constant transfer (FUN102) ........................................................................ 5-51
3. WMOVT 4-digit Hex constant transfer to two places (FUN 110) .............................................. 5-52
4. WMOVE 2-byte data direct transfer (FUN0) ............................................................................. 5-53
5. DMOVE 4-byte data direct transfer (FUN111) .......................................................................... 5-54
6. WBMOV Word data block transfer (FUN119) ........................................................................... 5-55
7. WXCH 16-bit data exchange(FUN2)......................................................................................... 5-56
8. DXCH 32-bit data exchange(FUN133) ..................................................................................... 5-57
9. WBXCH Word data block exchange (FUN 135) PCk06 ........................................................... 5-58
10. WFIL Word data fill (FUN 129) PCk06...................................................................................... 5-59
5.4.2. Arithmetic operations ............................................................................................................................. 5-60
11. W+ Word data binary addition (FUN 92)................................................................................... 5-61
12. D+ 32-bit data binary addition (FUN 169) PCk06 ..................................................................... 5-62
13. W+P 4-digit BCD addition (FUN 10) ......................................................................................... 5-63
14. D+P 8-digit BCD addition (FUN 178) ........................................................................................ 5-64
15. W- Word data binary subtraction (FUN 93)............................................................................... 5-65
16. D- 32-bit data binary subtraction (FUN 171) PCk06................................................................. 5-66
17. W-P 4-digit BCD subtraction (FUN 11) ..................................................................................... 5-67
18. D-P 8-digit BCD subtraction (FUN 180) .................................................................................... 5-68
19. W* Word data binary multiplication (FUN 94) ........................................................................... 5-69
20. W*P 4-digit BCD multiplication (FUN 182)................................................................................ 5-70
21. D*P 8-digit BCD multiplication (FUN 183)................................................................................. 5-71
22. W/ Word data binary division 2 (FUN 175) ............................................................................... 5-72
23. W/P 4-digit BCD division (FUN 185) ......................................................................................... 5-73
24. D/P 8-digit BCD division (FUN 186).......................................................................................... 5-74
25. W+H Addition of hexadecimal 4-digit constant (FUN 324) ....................................................... 5-75
26. D+H Addition of hexadecimal 8-digit constant (FUN 325) PCk06 ............................................ 5-76
27. W+HP Addition of BCD 4-digit constant (FUN 327).................................................................. 5-77
28. D+HP Addition of BCD 8-digit constant (FUN 328) .................................................................. 5-78
29. W-H Subtraction of hexadecimal 4-digit constant (FUN 330) ................................................... 5-79
30. D-H Subtraction of hexadecimal 8-digit constant (FUN 331) PCk06........................................ 5-80
31. W-HP Subtraction of BCD 4-digit constant (FUN 333) ............................................................. 5-81
32. D-HP Addition of BCD 8-digit constant (FUN 334) ................................................................... 5-82
33. W*H Multiplication of hexadecimal 4-digit constant (FUN 336) ................................................ 5-83
34. W*HP Multiplication of BCD 4-digit constant (FUN 339) .......................................................... 5-84
35. W/H Divide of hexadecimal 4-digit constant (FUN 342) ........................................................... 5-85
36. W/HP Divide of BCD 4-digit constant (FUN 345)...................................................................... 5-86
5.4.3. Logical operation instructions................................................................................................................ 5-87
37. WAND Word data logical product(AND) (FUN 187) ................................................................. 5-88
38. DAND 32-bit data logical product(AND) (FUN 188).................................................................. 5-89
39. WOR Word data logical sum(OR) (FUN 189) ........................................................................... 5-90
40. DOR 32-bit data logical sum(OR) (FUN 190) ........................................................................... 5-91
41. WNOT Word data inversion (FUN 191) .................................................................................... 5-92
42. DNOT 32-bit data inversion (FUN 192)..................................................................................... 5-93
43. WXOR Word data exclusive logical sum(XOR) (FUN 193) ...................................................... 5-94
44. DXOR 32-bit data exclusive logical sum(XOR) (FUN 194)....................................................... 5-95
45. WANDH Logical product (AND) of hexadecimal 4-digit constant (FUN 348) ........................... 5-96
46. DANDH Logical product (AND) of hexadecimal 8-digit constant (FUN 349) ............................ 5-97
47. WORH Logical sum (OR) of hexadecimal 4-digit constant (FUN 351)..................................... 5-98
48. DORH Logical sum (OR) of hexadecimal 8-digit constant (FUN 352)...................................... 5-99
49. WXORH Exclusive logical sum (XOR) of hexadecimal 4-digit constant (FUN 354) ............... 5-100
50. DXORH Exclusive logical sum (XOR) of hexadecimal 8-digit constant (FUN 355)................ 5-101
5.4.4. Increment and decrement.................................................................................................................... 5-102
51. WINC Word data binary increment (FUN 63) ......................................................................... 5-103
52. WINCP 4-digit BCD increment (FUN 200) .............................................................................. 5-104
53. WDEC Word data binary decrement (FUN 64)....................................................................... 5-105
54. WDECP 4-digit BCD decrement (FUN 203) ........................................................................... 5-106
5.4.5. Search ................................................................................................................................................. 5-107
55. WSRH2 Word data search 2 (FUN 213) PCk06..................................................................... 5-108
5.4.6. Data conversion................................................................................................................................... 5-109
56. WBIN 4-digit BCD to 16-bit binary (FUN 3) .............................................................................5-110
57. DBIN 8-digit BCD to 32-bit binary (FUN 153) ..........................................................................5-111
58. WBCD 16-bit binary to 4-bit BCD (FUN 4)...............................................................................5-112
59. DBCD 32-bit binary to 8-digit BCD (FUN 155).........................................................................5-113
60. JBIN JIS code to binary (FUN 156)..........................................................................................5-114
61. BJIS Binary to JIS code (FUN 157) .........................................................................................5-116
62. DECO 4 to 16 decoder (FUN 50).............................................................................................5-118
63. ENCO 16 to 4 encoder (FUN 51)............................................................................................ 5-120
5.4.7. Comparison ......................................................................................................................................... 5-123
64. WCP Word data comparison (FUN 12)................................................................................... 5-124
65. DCP 32-bit data comparison (FUN 211) ................................................................................. 5-125
5.4.8. Bit operation ........................................................................................................................................ 5-126
66. WSUM Word data ON-bit count (FUN 209) ............................................................................ 5-127
67. DSUM 32-bit data ON-bit count (FUN 210) ............................................................................ 5-128
5.4.9. Shift...................................................................................................................................................... 5-129
68. SFR Byte data 1 bit right shift (FUN 217) ............................................................................... 5-130
69. WSFR Word data 1 bit right shift (FUN 36)............................................................................. 5-131
70. DSFR 32-bit data 1 bit right shift (FUN 218) ........................................................................... 5-132
71. WBSFR Word data n bits right shift (FUN 225) ...................................................................... 5-133
72. DBSFR 32-bit data n bits right shift (FUN 226)....................................................................... 5-134
73. SFL Byte data 1 bit left shift (FUN 219) .................................................................................. 5-135
74. WSFL Word data 1 bit left shift (FUN 37)................................................................................ 5-136
75. DSFL 32-bit data 1 bit left shift (FUN 220) .............................................................................. 5-137
76. WBSFL Word data n bits left shift (FUN 228) ......................................................................... 5-138
77. DBSFL 32-bit data n bits left shift (FUN 229).......................................................................... 5-139
78. SUP 4 bit data upper-digit direction shift (FUN 251) PCk06................................................... 5-140
79. UP2 Byte data upper-digit direction shift 2 (FUN 252) PCk06................................................ 5-141
80. WUP Word data upper-digit direction shift (FUN 253) PCk06................................................ 5-142
81. DUP 32-bit data upper-digit direction shift (FUN 254) PCk06 ................................................ 5-143
82. SDOWN 4 bit data lower-digit direction shift (FUN 255) PCk06............................................. 5-144
83. DOWN Byte data lower-digit direction shift (FUN 256) PCk06............................................... 5-145
84. WDOWN Word data lower-digit direction shift (FUN 257) PCk06 .......................................... 5-146
85. DDOWN 32-bit data lower-digit direction shift (FUN 258) PCk06 .......................................... 5-147
5.4.10. Rotate ................................................................................................................................................ 5-148
86. DRR 32-bit data right rotate without carry (FUN 244) PCk06................................................. 5-149
87. DRL 32-bit data left rotate without carry (FUN 247) PCk06.................................................... 5-150
5.4.11. Programmed branch .......................................................................................................................... 5-151
88. JMP JUMP (FUN 272) PCk06 ................................................................................................ 5-152
89. CALL Subroutine call (FUN 273) ............................................................................................ 5-153
90. RET Return from subroutine (FUN 464) ................................................................................. 5-154
91. CRET Return from subroutine (FUN 285)............................................................................... 5-155
92. FOR Start repetition (FUN 472) .............................................................................................. 5-156
93. FORN Start repetition (indirect) (FUN 476)............................................................................. 5-157
94. NEXT End of repetition (FUN 480) ......................................................................................... 5-158
5.4.12. Master control.................................................................................................................................... 5-159
95. MC Master control set (FUN 440) ........................................................................................... 5-160
96. MCR Master control reset (FUN 444) ..................................................................................... 5-161
5.4.13. Sequential interrupt ........................................................................................................................... 5-162
97. DI Interrupt inhibit (FUN 276).................................................................................................. 5-163
98. EI Interrupt enable (FUN 277)................................................................................................. 5-164
99. RETI Return from interrupt routine (FUN 468)........................................................................ 5-165
5.4.14. Label .................................................................................................................................................. 5-166
100. START Main program start (FUN 448).................................................................................... 5-167
101. END Main program end (FUN 452) ........................................................................................ 5-168
102. PEND End of program (FUN 456) .......................................................................................... 5-169
103. LABEL Label (FUN 460) ......................................................................................................... 5-170
5.4.15. Special module data transfer............................................................................................................. 5-171
104. SPR Special module data readout (FUN 304) ........................................................................ 5-171
105. SPW Special module data write (FUN 306)............................................................................ 5-173
5.4.16. Other application instruction.............................................................................................................. 5-175
106. STOP Program stop (FUN 287) .............................................................................................. 5-175
107. WDR Scan timer reset (FUN 46) ............................................................................................ 5-176
5.4.17. Clock / Calendar instruction .............................................................................................................. 5-177
108. SYS Date instruction (FUN 300) PCk06................................................................................... 5-177
109. SYS Time instruction (FUN 300) PCk06 .................................................................................. 5-178
5.4.18. MODBUS RTU instruction ................................................................................................................. 5-179
110. SYS MODBUS Read from Network (FUN 300) PCk06............................................................ 5-179
111. SYS MODBUS Write to Network (FUN 300) PCk06 ................................................................ 5-183
6. Appendix Difference with DL05/06 ................................................................................................................... 6-1
6.1. Boolean Instructions....................................................................................................................................... 6-1
6.2. Bit of Word Boolean Instructions.................................................................................................................... 6-1
6.3. Comparative Boolean Instructions ................................................................................................................. 6-2
6.4. Immediate Instructions ................................................................................................................................... 6-2
6.5. Timer, Counter and Shift Register .................................................................................................................. 6-3
6.6. Accumulator Data Instructions ....................................................................................................................... 6-3
6.7. Logical Instructions ........................................................................................................................................ 6-4
6.8. Math Instructions............................................................................................................................................ 6-5
6.9. Transcendental Functions .............................................................................................................................. 6-6
6.10. Bit Instructions.............................................................................................................................................. 6-6
6.11. Number Conversion Instructions .................................................................................................................. 6-6
6.12. Table Instructions ......................................................................................................................................... 6-7
6.13. Clock / Calender Instructions ....................................................................................................................... 6-7
6.14. CPU Control Instructions.............................................................................................................................. 6-7
6.15. Program Control Instructions ....................................................................................................................... 6-8
6.16. Interrupt Instructions .................................................................................................................................... 6-8
6.17. Message Instructions ................................................................................................................................... 6-8
6.18. Network Instructions..................................................................................................................................... 6-8
6.19. MODBUS Instructions .................................................................................................................................. 6-8
6.20. ASCII Instructions......................................................................................................................................... 6-9
6.21. Drum Instructions ......................................................................................................................................... 6-9
6.22. Intelligent I/O Instructions............................................................................................................................. 6-9
6.23. RLL plus Instructions.................................................................................................................................... 6-9
Index of instruction words
1. MAKING SEQUENCE CIRCUITS

1.1. Usage of TOYOPUC

1.1.1. Connection between I/O devices and TOYOPUC

The equipment is provided with limit switches (LS) which provide information on the location of
machine components and with pushbutton switches (PB) which give instructions to the machine.
The devices defining the conditions of action, generically called I/O devices, should be connected
to the input module on the TOYOPUC.
The equipment is also provide with solenoid valves (SOL) which drive and control, by hydraulic
medium, the cylinders used as actuator and with magnetic switches (MS) which turn on or off the
motors. These devices, generically called output devices, should be connected to the output
module on the TOYOPUC.

1.1.2. I/O address

First specify a terminal to which an input or output device is to be connected. Each terminal has its
proper number and this is called I/O address. In a sequence program, the I/O address specifies
the I/O device.

(1) I/O coding

The I/O address is shown by three figure digits of the hexadecimal number, and the number of
I/O with built-in CPU that starts from Y400 is an output from input X000. The number of the
option I/O module that starts from Y440 is an output from input X040.

Example 1 PCk05

Option slot IN-k93 IN-k14 OUT-k12 kDLNK

I/O with built-in CPU


AC(L) AC(N) C0 X001 X003 X004 X006 C2 Y401 Y403 Y405
G LG X000 X002 C1 X005 X007 Y400 Y402 Y404 +V
Input 8 points X000 ~ X007 Output 6 points Y400 ~ Y405

Option I/O module

IN-k93 Input 10 points X040 ~ X049

IN-k14 Input 16 points X040 ~ X04F

OUT-k12 Output 16 points Y440 ~ Y44F

Note) An intelligent module such as kDLNK doesn't occupy the I/O address.

1-1
Example 2 PCk06
Option slot 1 2 3 4

I/O with built-in CPU


Output terminal
G LG 0V Y400 Y402 V1 Y405 Y407 Y408 Y40A V3 Y40D Y40F
AC(L) AC(N) 24V V0 Y401 Y403 Y404 Y406 V2 Y409 Y40B Y40C Y40E C0
Output 16 points Y400 ~ Y40F

Input terminal

C0 X001 X003 X004 X006 C2 X009 X00B X00C X00E C4 X011 X013 N.C.
X000 X002 C1 X005 X007 X008 X00A C3 X00D X00F X010 X012 N.C.
Input 20 points X000 ~ X013

Option I/O module


Example 1
Slot no Option module Mounting point Input address Output address
1 IN-k14 Input 16 points X040 ~ X04F Unused
2 OUT-k12 Output 16 points Unused Y440 ~ Y44F
3 IN-k93 Input 10 points X050 ~ X059 Unused
4 IN-k93 Input 10 points X060 ~ X069 Unused

Example 2
Slot no Option module Mounting point Input address Output address
1 kDLNK It is not Unused Unused
2 OUT-k12 Output 16 points Unused Y440 ~ Y44F
3 IN-k93 Input 10 points X040 ~ X049 Unused
4 IN-k14 Input 16 points X050 ~ X05F Unused

Example 3
Slot no Option module Mounting point Input address Output address
1 kDLNK It is not Unused Unused
2 IN-k14 Input 16 points X040 ~ X04F Unused
3 OUT-k12 Output 16 points Unused Y440 ~ Y44F
4 OUT-k12 Output 16 points Unused Y450 ~ Y45F

1-2
1.2. Circuit diagram configuration
Usually, a circuit diagram representing sequence circuit including TOYOPUC is drawn in a form of
relay circuit (ladder diagram). The figures below show recommendable expression of circuit
configuration which make the design and maintenance of control board easier.

Machine unit (A) Machine unit(B)

Input Logic Output Input Logic Output


section section section section section section

Circuits and components of the same function in a machine should be represented in a respective
block, such as input, logic and output section on a machine basis.

1.3. I/O circuit

1.3.1. Input section

Devices to which TOYOPUC sends input signals (such as pushbutton switch and limit switch) are
written in the input section.

Example of circuit

1-3
1.3.2. Output section

Devices to which TOYOPUC sends outputs (such as solenoid-operated


directional control valve, electro-magnetic vale and magnetic switch) are
written in output section.

Example of circuit

1-4
1.4. Logic section

1.4.1. Internal relay (dummy output)

Internal relay (dummy output) for temporary storage which does not drive external devices such as
solenoid-operated valve or magnetic switch is written in logic section.

Example of circuit

Advance memorized

Address Example of Example of symbol


Type
identifier address (Coil) (Contact)

Internal
M M000
relay

1-5
1.4.2. Timer

The timers used are divided into the following categories and are to be expressed in the logic
section.

Function Mnemonic
Unit in 10ms TMRH
Direct setup
Unit in 100ms TMR
Timer
Indirect Unit in 10ms TMRH
setup Unit in 100ms TMR
Unit in 10ms TMRSH
Direct setup
Integrating Unit in 100ms TMRS
timer Indirect Unit in 10ms TMRSH
setup Unit in 100ms TMRS

Example of circuit

End of advance timer


0.2sec

Address Example of Example of symbol


Type
identifier address (Coil) (Contact)
T012

Timer T T012
T012

1-6
1.4.3. Counter

The counters used are divided into the following categories and are to be expressed in the logic
section.

Function Mnemonic
Direct setup CNT
Up counter
Indirect setup CNT
Direct setup CNTH
Up/Down counter
Indirect setup CNTH

Example of circuit

1-7
1.4.4. Keep relay

Relays used to hold the current condition when power is removed.


They are to be represented in the logic section.

Example of circuit

Address Example of Example of symbol


Type
identifier address (Set coil) (Reset coil) (Contact)

Keep
K K00A
relay

1-8
1.4.5. Edge detection

Turns on for a period equal to one scan of sequence when conditions are met( )or not
met ( ). This part should be expressed in logic section.

Example of circuit

Address Example of Example of symbol


Type
identifier address (Rise contact) (Fall contact)

Edge
P P001
detection

(Note) The address must not be used duplication.


512 edge detection, P000 to P1FF, are possible.

or can be used only after in PCk05/PCk06.

It is not possible to use it on other conditions. Moreover, the device that can be
used in a point of contact instruction at this time is only input (X), output (Y),
internal relay (M PCk05:M000-0FF,PCk06:M000-M1FF), Keep relay (K),
timer (T), counter (C), and link (L) relays.

1-9
1.4.6. Special relay

Special relays are internal relays whose application and function are predetermined by the TOYOPUC, the
primary applications being to indicate operation status of this machine and result of arithmetic operation
made through application instruction.

Example of circuit

Address Example of Example of symbol


Type
identifier address (Coil) (Contact)

Special relay V V51

The number to which the name is provided might be an empty column in other TOYOPUC while
having a look at the special relay shown since next page. Please note that it is not used by the
difference of the function of the main body of CPU in the usage about them.
Please use only a special relay of the number explained in the table of the list.
Because all are the reservation areas, the user cannot use it for the address that doesn't exist in
the list.

1-10
Address Name Outline Description
V00
0: No ERR0 On when a critical error such as I/O
V01 MAJOR ERROR
1: ERR0 in occurring communication loss has occured.
0: No ERR1
V02 MINOR ERROR On when a non critical error has occured.
1: ERR1 in occurring
V03

V04 NORMALLY ON Normally 1 Normally ON irrespective of run status

Normally OFF irrespective of run status.


V05 NORMALLY OFF Normally 0 It is possible to use it only with PCK06.
It is not possible to use it with PCK05.

V06 1ST SCAN Only the first scanning is ON. ON by resetting and OFF by END processing.

V07
V08
V09
V0A
V0B
V0C
V0D
V0E
V0F
V10
V11
0:not TERMINAL RUN On when the mode switch is in the TERM position
V12 TERMINAL RUN
1:TERMINAL RUN and the CPU is in the run mode.
0:not TEST RUN
V13 TEST RUN On when the CPU is in the test run mode.
1:TEST RUN
V14
0:not TEST STOP
V15 TEST STOP On when the CPU is in the test stop mode.
1:TEST STOP
0:not TERMINAL STOP On when the mode switch is in the TERM position
V16 TERMINAL PGM
1:TERMINAL STOP and the CPU is in program mode.
V17
0:Excluding while stopping
V18 FORCED STOP On when the STOP instruction is executed.
1:Stopping
V19
INTERRUPT 0:Inhibit On when interrupts have been enabled using the
V1A
ENABLED 1:Enable EI instruction.
V1B
V1C
V1D
V1E
V1F

1-11
Address Name Outline Description
V20
V21
V22
V23
V24
V25
0:Excluding while stopping
V26 FORCED STOP On when the mode switch is in the STOP position.
1:Stopping
0:Excluding while running On when the mode switch is in the RUN position
V27 FORCED RUN
1:running and the CPU is running.
V28
V29
V2A
V2B
V2C
V2D
V2E
V2F
V30
V31
V32
V33
V34
V35
V36
V37
V38
V39
V3A
V3B
V3C
V3D
V3E
V3F

1-12
Address Name Outline Description
V40
V41
V42
V43
V44
V45
V46
V47
V48
V49
V4A
V4B
COMMUNICATION 0: No error On when RX,WX,instuctions are executed with
V4C
ERROR 1: Error the wrong parameters.
V4D
V4E
V4F
0: No error
V50 SOLVE LOGIC ERROR On if CPU cannot solve the logic.
1: Error

0: Comparative result not small


V51 < Result of comparison with applied command.
1: Comparative result small

0: Comparative result unequal


V52 = Result of comparison with applied command.
1: Comparative result equal

0: Comparative result not larege


V53 > Result of comparison with applied command.
1: Comparative result larege
0: Result not 0 On when computation result of applied
V54 ZERO (Z)
1: Result 0 command is 0.
HALF BORROW 0: No digit down On when the 16 bit subtraction instruction
V55
(HBO) 1: Digit down results in a borrow.
0: No digit up On when the 16 bit addtion instruction
V56 HALF CARRY (HCY)
1: Digit up results in a carry.
0: No digit down On when the 32 bit subtraction instruction
V57 BORROW (BO) 1: Digit down results in a borrow.
0: No digit up On when the 32 bit addtion instruction results in
V58 CARRY (CY)
1: Digit up a carry.
V59
V5A
V5B
V5C
V5D
DATA ERROR 0: No error On if a BCD number is expected and a
V5E
(DER) 1: Error non-BCD number is encountered.
V5F

1-13
Address Name Outline Description

CPU PORT BUSY 0: No busy On when port2 is the master and sending
V60
PORT2 1: Busy data.
COMMUNICATIONS 0: No error On when port2 is the master and has s
V61
ERROR PORT2 1: Error communication error.
V62

V63

V64

V65

V66

V67

V68

V69

V6A
V6B
V6C
V6D
V6E
V6F
Repetition of 50msecOFF
V70 0.1 SEC CLOCK Clock of cycle 0.1 sec and duty 50%
and 50msecON

V71

Repetition of 0.5secOFF and


V72 1 SEC CLOCK Clock of cycle 1 sec and duty 50%
0.5secON

V73

Repetition of 30secOFF and


V74 60 SEC CLOCK Clock of cycle 60 sec and duty 50%
30secON
V75
V76
V77
Clock to turn ON/ OFF SCAN
V78 SCAN CLOCK It starts from the state of ON.
every 1 scan.
V79
V7A
V7B
V7C
V7D
V7E
V7F

1-14
Address Name Outline Description
V80
V81
V82
V83
V84
V85
V86
V87
V88
V89
V8A
V8B
V8C
V8D
V8E
V8F
V90
V91
V92
V93
V94
V95
V96
V97
V98
V99
V9A
V9B
V9C
V9D
V9E
V9F

1-15
Address Name Outline Description
VA0
VA1
VA2
VA3
VA4
VA5
VA6
VA7
VA8
VA9
VAA
VAB
VAC
VAD
VAE
VAF
VB0
VB1
VB2
VB3
VB4
VB5
VB6
VB7
VB8
VB9
VBA
VBB
VBC
VBD
VBE
VBF

1-16
Address Name Outline Description
0: No error
VC0 CPU ERROR ON upon detection of CPU module error.
1: Error
VC1
0: No error On when a memory error such as a memory parity
VC2 MEMORY DATA ERROR
1: Error error has occurred.
VC3
VC4
VC5
VC6
I/O MODULE ERROR( Fuse 0: No error On when an I/O error such as a blown fuse
VC7
blown, etc.) 1: Error occurs.
VC8
0: No error On if a grammatical error has occurred either
VC9 USER PROGRAM ERROR while the CPU is running of if the syntax
1: Error check is run.
VCA
VCB
VCC
VCD
VCE
VCF
VD0
VD1
VD2
VD3
VD4
VD5
VD6
VD7
VD8
VD9
VDA
VDB
VDC
VDD
VDE
VDF

1-17
Address Name Outline Description
VE0
0: No error ON upon detection of SCAN TIME OVER .OFF after
VE1 SCAN TIME-OVER
1: Error reset or power on.

VE2

VE3
VE4
VE5
VE6
VE7
VE8
VE9
VEA
VEB
VEC
VED
VEE
VEF
On when the CPU battery voltage is low.
0: No error
It detects it with PCk06 only at a battery
VF0 LOW BATTERY ERROR
circuit effective bit ON
1: Error
(special register S05B bit 12).
VF1
VF2
VF3
VF4
VF5
VF6
VF7
VF8
VF9
VFA
VFB
VFC
VFD
VFE
VFF

1-18
1.4.7. Link relay

Link relays are internal relays used foe data linking between PLCs and communication between
remote I/Os.
These relays can also be used for applications basically made for the general purpose internal
relay (M***), when they are not used as communication relays.

Example of circuit

1-19
1.5. Application instruction

1.5.1. Application instruction

TOYOPUC can store data and process numerical data through arithmetic operations, in addition to
operation of sequential processing. To enable the controller to handle this numerical data, special
instructions called application instructions (or function instructions) are available.
Application instructions are roughly classified as follows:

(1) Contact type application instruction


Compares values of 2 pieces of data and when the conditions are met, closes the specified
contact.

Example of circuit diagram

(2) Output type application instruction

Used to transfer data, process arithmetic and logical operations and to handle other data
process oriented functions. The instruction will be executed when the previous operation
resulted in ON. (The instruction will be executed every scan as long as the operation result
is ON. To execute only once at the start, use .)

1.5.2. Data register

Used to store data when application instruction is executed.

PCk05:Provided with 3200-point (D0000-D0C7F) registers of 16-bit configuration.


PCk06:Provided with 7296-point (D0000-D0C7F,D1000-D1FFF) registers of 16-bit configuration.

1.5.3. Current value register

Stores the current value of a timer or counter. The current contents of a this register from an
application instruction.

Timer current value


PCk05:Provided with 128-point (N000-N07F) current value registers.
PCk06:Provided with 256-point (N000-N0FF) current value registers.
Counter current value
PCk05 and PCk06:Provided with 128-point (N100-N17F) current value registers.

1-20
1.5.4. Special register
The special registers listed in the table below are available for special applications such as CPU
status, built-in clock, link modules, etc. These special registers are in Basic area and extended
area.
It is all reservation area for the address that doesn't exist in the list. Therefore, the user cannot use
its address.

Address Name Description


S000
S001 SCAN TIME max value Maximum scan time in sequence program (ms) (Binary)
S002 SCAN TIME min value Minimum scan time in sequence program (ms) (Binary)
S003 SCAN TIME Present value Updated scan time in sequence program (ms) (Binary)
S004 Time (Sec) 0 ~ 59 (BCD)
S005 Time (Minutes) 0 ~ 59 (BCD)
S006 Time (Hours) 0 ~ 23 (BCD)
S007 Time (Day) 1 ~ 31 (BCD)
S008 Time (Month) 1 ~ 12 (BCD)
S009 Time (Year) 0 ~ 99 (BCD)
S00A Day of week 0 ~ 6 (BCD) which correspond to Sun. ~ Sat.
S00B
S00C
S00D
S00E
S00F
S010
S011
S012
S013 PROGRAM ERROR ADDRESS Program address where syntax error exists.
S014 PROGRAM ERROR CODE Syntax error code.
Scan counter - stores the total number of scan cycles that have
S015 SCAN COUNTER occurred since the last Program Mode to Run Mode transition.
(Binary)

S016
S017
Location contains a 10mS counter (0-99). This location increments
S018 10ms COUNTER
once every 10mS.

S019
S01A
S01B
S01C
S01D FATAL ERROR CODE Error code - stores the fatal error code.
S01E MAJOR ERROR CODE Error code - stores the major error code.
S01F MINOR ERROR CODE Error code - stores the minor error code.

As for the content of the error code, it is 1.5.5. Refer to the CPU error code table.

1-21
Address Name Description
S020
S021
S022
S023
S024
S025
S026
S027
S028
S029
S02A
S02B
S02C
S02D
S02E
S02F
S030
S031
S032
S033
S034
S035
S036
S037
S038
S039
S03A
S03B
S03C
S03D
S03E
S03F

1-22
Address Name Description
S040
S041
S042
S043
S044
S045
S046
S047
S048 kDLNK MODULE PARAMETER kDLNK MODULE PARAMETER AREA
S049 kDLNK MODULE PARAMETER kDLNK MODULE PARAMETER AREA
S04A kDLNK MODULE PARAMETER kDLNK MODULE PARAMETER AREA
S04B kDLNK MODULE PARAMETER kDLNK MODULE PARAMETER AREA
S04C kDLNK MODULE PARAMETER kDLNK MODULE PARAMETER AREA
S04D kDLNK MODULE PARAMETER kDLNK MODULE PARAMETER AREA
S04E kDLNK MODULE PARAMETER kDLNK MODULE PARAMETER AREA
S04F kDLNK MODULE PARAMETER kDLNK MODULE PARAMETER AREA
S050
S051
S052
S053
S054
S055
S056
S057
S058 PCk05/PCk06 INPUT PARAMETER
S059 PCk05/PCk06 INPUT PARAMETER
S05A PCk05/PCk06 INPUT PARAMETER
S05B PCk05/PCk06 INPUT PARAMETER Sets the desired function code for X0 ~ X3.
X0 Setup Register for High-Speed I/O functions.
S05C PCk05/PCk06 INPUTPARAMETER
Default:1006
X1 Setup Register for High-Speed I/O functions.
S05D PCk05/PCk06 INPUT PARAMETER
Default:1006
X2 Setup Register for High-Speed I/O functions.
S05E PCk05/PCk06 INPUT PARAMETER
Default:1006
X3 Setup Register for High-Speed I/O functions.
S05F PCk05/PCk06 INPUT PARAMETER
Default:1006

As for the content of the PCk05/PCk06 Input parameter, it is 1.5.6. Refer to the PCk05/PCk06
Input parameter setting table.

1-23
Address Name Description
S060
S061
S062
S063
S064
S065
S066
S067
S068
S069
S06A
S06B
S06C
S06D CPU PORT2 PROTOCOL Setup for the protocol, time-out, and the response delay time.
S06E CPU PORT2 CONDITION Setup for the station number, baud rate, STOP bit, and parity.
Setup completion code used to notify the completion of the parameter
S06F CPU PORT2 COMPLETION
setup.

S070
S071
S072
S073
S074
S075
S076
S077
S078
S079
S07A
S07B
S07C
S07D
S07E
S07F

As for the content of CPU PORT2, it is 1.5.8. Refer to the CPU PORT2 setting table.

Address Name Description

S080 ~
S0BF
S0C0 ~
S0FF
S100 ~
S3FF

1-24
1.5.5. CPU error code table

Error code PCk05 PCk06 Description

The error might be able to be released by


E001
○ resetting the power supply of CPU. Please
CPU FATAL ERROR
exchange PCk06 when the error relapses.

This error occurs when the timer of the scanning


time when the scanning time of the program was
E003
○ ○ set is exceeded. VE1 is turned on, and the error
SOFTWARE TIME-OUT
code is preserved in S01D. Please change set
time of the scanning time timer long.

When CPU starts executing the instruction code,


the parity error is detected. When the program
E004
○ memory changes due to the malfunction by the
SUB CPU PARITY ERROR
noise etc. , it is generated. Please do the writing
operation of the program again.

PCk06 built-in battery voltage has decreased


and exchange it, please. VF0 is turned on, and
E041
○ the error code is preserved in S01F. This error
CPU BATTERY LOW
occurs only at the option battery use (Bit 12 of
S05B is turned on).

It failed in writing in CPU. Please reset the


E104
○ ○ power supply of CPU. Please exchange CPU
WRITE FAILED
when the error occurs.

The parity error was generated in the application


program. VC2 is turned on, and the error code is
preserved in S01D. This problem has the
E151
○ ○ possibility of originating in the noise. Please do
BAD COMMAND
the writing operation of the program again.
Please confirm the earth. Please exchange CPU
when the error relapses.

1-25
Error code PCk05 PCk06 Description
The checksum error occurred in system RAM.
VC2 is turned on, and the error code is
preserved in S01D. This problem has the
possibility of originating in the decrease, the
E155
○ noise, and the CPU RAM breakdown in the
RAM FAILURE
voltage of the battery. Please do the writing
operation of the program again. Please confirm
the earth. Please exchange CPU when the error
relapses.

E200
○ The I/O module broke down.
I/O MODULE FAILURE

The I/O module failed in the communication with


E202 CPU. Or, the module is not mounted on the slot.

MISSING I/O MODULE VC7 is turned on, and the error code is
preserved in S01E.

E210 A short duration power drop-out occurred on the



POWER FAULT main power line supplying power to the PCk06.

1-26
Error code PCk05 PCk06 Description
Please give the last execution instruction of the
ladder program to me as END. Please insert the
E401
○ ○ END instruction in the position where the ladder
MISSING END STATEMENT
program is correct. VC9 is turned on, and the
error code is preserved in S01D.

There is no LABEL instruction to confront the


E402
○ JMP instruction. VC9 is turned on, and the
MISSING LBL
error code is preserved in S01D.

The subroutine in the ladder program doesn't


E403 end because of the RET instruction. VC9 is
○ ○
MISSING RET turned on, and the error code is preserved in
S01D.

There is no FOR(FORN) instruction to confront


E404
○ ○ the NEXT instruction. VC9 is turned on, and the
MISSING FOR
error code is preserved in S01D.

There is no NEXT instruction to confront the


E405
○ ○ FOR(FORN) instruction. VC9 is turned on, and
MISSING NEXT
the error code is preserved in S01D.

The interrupt routine in the ladder program


E406 doesn't end because of the RETI instruction.
○ ○
MISSING IRT VC9 is turned on, and the error code is
preserved in S01D.

It cannot be nesting (The FOR/NEXT loop is


E423
○ ○ programmed in another loop). VC9 is turned on,
NESTED LOOPS
and the error code is preserved in S01D.

The LABEL instruction that the JMP instruction


E432 confronts cannot be programmed after the END

INVALID JUMP ADDRESS instruction (in the subroutine etc.). VC9 is turned
on, and the error code is preserved in S01D.

1-27
1.5.6. PCk05/PCk06 input parameter setting table

PCk05/PCk06 input parameter setting table


Special
register Name Description
address
Low byte
bit07-bit00 Setting of input mode (BCD 2 digit)
00: Unused
10: High-speed counter
20: Up/down counter
30: Pulse output
40: High-speed interrupt
50: Pulse catch input
60: Discrete inputs with filter (Default)
Input
S05B High byte
setting
bit15-bit08 Other settings (BCD 2 digit)
00: Unused (PCk05 is only unused.)
The following setting is only PCk06.
10: The battery can be used.
20: Power-up in RUN, if Mode switch is in
TERM position.
30: The battery can be used. And
Power-up in RUN, if Mode switch is in
TERM position.

The filter time constant (delay) is programmable from 0 to 99 ms (the


input acts as a normal discrete input when the time constant is set to
S05C X0 Setup 0).The code for this selection occupies the upper byte of the
configuration register in BCD. We combine this number with the
required “06” in the lower byte to get “xx06”, where xx = 0 to 99.

S05D X1 Setup xx06 ( xx = filter delay time ) 0 to 99 ms (BCD) (Default)

S05E X2 Setup xx06 ( xx = filter delay time ) 0 to 99 ms (BCD) (Default)

xx06 ( xx = filter delay time ) 0 to 99 ms (BCD) (Default)


S05F X3 Setup
Only PCk06 can be set. Input X3 of PCk05 is only a normal input.

1-28
1.5.7. PCk05/PCk06 input parameter setting program example

Program Example : Filtered Inputs

1-29
1.5.8. CPU PORT2 setting table

Special
register Name Description
address
bit02,bit01,bit00 RTS off delay. Waiting time until RTS signal is off
after data is transmitted.
000: 0 ms
001: 2 ms
010: 5 ms
011: 10 ms
100: 20 ms
101: 50 ms
110: 100 ms
111: 500 ms

bit03 Remote I/O


bit04 Non-sequence
bit05 MODBUS
bit06 DirectNet
bit07 PCwinPCk
bit10,bit09,bit08 Timeout. Time to wait for the response after
message is transmitted. When this is exceeded, it is
assumed that it makes an error.
000: 1000 ms
001: 500 ms
010: 780 ms
Protocol 011: 2500 ms
S06D
setting 100: 5000 ms
101: 10000 ms
110: 25000 ms
111: 60000 ms

bit11 Undefined (0)

bit14,bit13,bit12 RTS on delay. Waiting time until data is actually


transmitted after on RTS signal.
000: 0 ms
001: 2 ms
010: 5 ms
011: 10 ms
100: 20 ms
101: 50 ms
110: 100 ms
111: 500 ms

bit15 Undefined (0)


RTS on delay is set when using it on the multidrop network and 5msec
or more and RTS off delay are set in 2msec or more. When the
problem occurs, the delay time is increased.

1-30
Special
register Name Description
address
At protocol DirectNet
bit06-bit00 Communication station number(1-90)
bit07 Communication data format Hex(0) ASCII(1)

At protocol MODBUS
bit07-bit00 Communication station number(1-247)
PORT2 is selected and (1) is selected in case of MODBUS
(master). The range that can be set as MODBUS slave is
up to (1-247).
bit10,bit09,bit08 Communication baud rate
000: 300 bps
001: 600 bps
010: 1200 bps
011: 2400 bps
Communication 100: 4800 bps
S06E
setting 101: 9600 bps
110: 19200 bps
111: 38400 bps

bit11 Echo Suppression RS422/RS485(4-wire)(0) RS232C(4-wire)(0)


RS485(2-wire)(1)

bit12 Undefined(0)

bit13 Stop bit 1bit(0) 2bit(1)

bit15,bit14 Communication parity


00: No parity
10: Odd parity
11: Even parity

It writes in S06D (protocol setting) and S06E (communication setting)


Setup
and after writing of the setting data, 0500h is written in S06F (setup
S06F completion
completion code). When CPU recognizes the setting, the setting of
code
PORT2 is completed by writing 0A00h in S06F (setup completion code).

1-31
1.5.9. CPU PORT2 setting program example

Program Example : CPU PORT2 MODBUS

CPU PORT2 setting


Protocol MODBUS
Timeout 1000msec
RTS on delay 0msec
RTS off delay 0msec
Station no 1
Baud rate 9600bps
STOP bit 1
Parity ODD
Echo Suppression RS422(4-wire)/RS485(4-wire)/RS232C(4-wire)

1-32
1.6. Network slave operation
1.6.1. Network slave
This section describes how other devices on a network can communicate with a CPU PORT2 that you
have configured as a DirectNET slave or MODBUS slave (PCk05/PCk06). A MODBUS host must use
the MODBUS RTU protocol to communicate with the PCk05/PCk06 as a slave. The host software must
send a MODBUS function code and MODBUS address to specify a PLC memory location the
PCk05/PCk06 comprehends. The DirectNET host uses normal I/O addresses to access applicable
PCk05/PCk06 CPU and system. No CPU ladder logic is required to support either MODBUS slave or
DirectNet slave operation.

1.6.2. MODBUS function code supported


The MODBUS function code determines whether the access is a read or a write, and whether to access
a single data pointer or a group of them. The PCk05/PCk06 supports the MODBUS function codes
described below.

MODBUS Function
Function Data Types Available
Code
01 Read a group of coils Y,M,K,T,C,L
02 Read a group of inputs X,L
05 Set / Reset a single coil Y,M,K,T,C,L
15 Set / Reset a group of coils Y, Y,M,K,T,C,L
03,04 Read a value from one or more registers D,N
06 Write a value into a single register D,N
16 Write a value into a group of registers D,N

1.6.3. Determining the MODBUS address


There are typically two ways that most host software conventions allow you to specify a PLC memory
location. These are:
・ By specifying the MODBUS data type and address
・ By specifying a MODBUS address only

(1) If Your Host Software Requires the Data Type and Address
Many host software packages allow you to specify the MODBUS data type and the MODBUS address
that corresponds to the PLC memory location. This is the easiest method, but not all packages allow
you to do it this way.
The actual equation used to calculate the address depends on the type of PLC data you are using.
The PLC memory types are split into two categories for this purpose.
・ Discrete – X,Y,M,K,T,C,L (contacts)
・ Word – D,N
In either case, you basically convert the PLC octal address to decimal and add the appropriate
MODBUS address (if required). The table below shows the exact equation used for each group of
data.

1-33
For PCk05
MODBUS
PLC MODBUS Data
PCk05 Memory Type QTY(Dec.) Address
Range(Hex) Type
Range(Dec.)
Convert PLC Addr. To Dec. + Start of Range + Data Type
Link Relays (L) 1024 L000 - L3FF 0 - 1023 Input
Inputs (X) 256 X000 - X0FF 2048 - 2303 Input
Link Relays (L) 1024 L400 - L7FF 0 - 1023 Coil
Outputs (Y) 256 Y400 - Y4FF 2048 - 2303 Coil
Internal Relays (M) 256 M000 - M0FF 3072 - 3327 Coil
Keep-Relays (K) 256 K000 - K0FF 3328 - 3583 Coil
Timer Contacts (T) 128 T000 - T07F 6144 - 6271 Coil
Counter Contacts (C) 128 C000 - C07F 6400 - 6527 Coil
Timer Current Values (N) 128 N000 - N07F 0 - 127 Input Register
Counter Current Values (N) 128 N100 - N17F 512 - 639 Input Register
Data Registers (D) 3200 D0000 - D0C7F 640 - 3839 Holding Register
Non-volatile Registers (D) 128 D0C80 - D0CFF 3840 - 3967 Holding Register

For PCk06
MODBUS
PLC MODBUS Data
PCk06 Memory Type QTY(Dec.) Address
Range(Hex) Type
Range(Dec.)
Convert PLC Addr. To Dec. + Start of Range + Data Type
Link Relays (L) 1024 L000 - L3FF 0 - 1023 Input
Inputs (X) 512 X000 - X1FF 2048 - 2559 Input
Link Relays (L) 1024 L400 - L7FF 0 - 1023 Coil
Outputs (Y) 512 Y400 - Y5FF 2048 - 2559 Coil
Internal Relays (M) 512 M000 - M1FF 3072 - 3583 Coil
Keep-Relays (K) 512 K000 - K1FF 3584 - 4095 Coil
Timer Contacts (T) 256 T000 - T0FF 6144 - 6399 Coil
Counter Contacts (C) 128 C000 - C07F 6400 - 6527 Coil
Timer Current Values (N) 256 N000 - N0FF 0 - 255 Input Register
Counter Current Values (N) 128 N100 - N17F 512 - 639 Input Register
3200 D0000 - D0C7F 640 - 3839 Holding Register
Data Registers (D)
4096 D1000 - D1FFF 4096 - 8191 Holding Register
Non-volatile Registers (D) 128 D0C80 - D0CFF 3840 - 3967 Holding Register

The following examples show how to generate the MODBUS address and data type for hosts which
require this format.

Example 1: D0440
Find the MODBUS address for Data Register D0440.
1. Find Data Registers in the table.
2. Convert D0440 into decimal (1088).
3. Add the starting address for the range (640) 1088 + 640 = 1728
4. Use the MODBUS data type from the table.

Holding Register 1728

1-34
Example 2: Y410
Find the MODBUS address for output Y410.
1. Find Y outputs in the table.
2. Subtract the starting address for the range (400) 410 – 400 = 10h
3. Convert 10h into decimal (16).
4. Add the starting address for the range (2048). 16 + 2048 = 2064
5. Use the MODBUS data type from the table.

Coil 2064

Example 3: T008 Current Value


Find the MODBUS address to obtain the current value from Timer T008
1. Find Timer Current Values in the table.
2. Convert N008 into decimal (8).
3. Use the MODBUS data type from the table.

Input Register 8

Example 4: M02C
Find the MODBUS address for Internal Relay M02C
1. Find Internal Relays in the table.
2. Convert M02C into decimal (44).
3. Add the starting address for the range (3072). 44 + 3072 = 3116
4. Use the MODBUS data type from the table.

Coil 3116

(2) If Your MODBUS Host Software Requires an Address ONLY


Some host softwere does not allow you to specify the MODBUS data type and address. Instead, you
specify an address only. This method requires another step to determine the address, but it’s still fairly
simple. Basically, MODBUS also separates the data types by address range as well. So this means an
address alone can actually describe the type of data and location. This is often referred to as “adding
the offset”. One important thing to remember here is that two different addressing modes may be
available in your host software package.
These are:
・ 484 Mode
・ 584/984 Mode
We recommend that you use the 584/984 addressing mode if your host software allows you to choose.
This is because the 584/984 mode allows access to higher number of memory locations within each
data type. If your software only supports 484 mode, then there may be some PLC memory locations
that will be unavailable. The actual equation used to calculate the address depends on the type of PLC
data you are using. The PLC memory types are split into two categories for this purpose.
・ Discrete – X,Y,M,K,T,C,L (contacts)
・ Word – D,N
In either case, you basically convert the PLC hex address to decimal and add the appropriate
MODBUS address (as required). The table below shows the exact equation used for each group of
data.

1-35
For PCk05
MODBUS Address Address
PCk05 Memory PLC MODBUS
QTY(Dec.) Address (484 (584/984
Type Range(Hex) Data Type
Range(Dec.) Mode) Mode)
Convert PLC Addr. To Dec. + Start of Range + Data Type
Link Relays (L) 1024 L000 - L3FF 0 - 1023 1001 100001 Input
Inputs (X) 256 X000 - X0FF 2048 - 2303 1001 100001 Input
Link Relays (L) 1024 L400 - L7FF 0 - 1023 1 1 Coil
Outputs (Y) 256 Y400 - Y4FF 2048 - 2303 1 1 Coil
Internal Relays M000 -
256 3072 - 3327 1 1 Coil
(M) M0FF
Keep-Relays (K) 256 K000 - K0FF 3328 - 3583 1 1 Coil
Timer Contacts
128 T000 - T07F 6144 - 6271 1 1 Coil
(T)
Counter Contacts
128 C000 - C07F 6400 - 6527 1 1 Coil
(C)
Timer Current Input
128 N000 - N07F 0 - 127 3001 30001
Values (N) Register
Counter Current Input
128 N100 - N17F 512 - 639 3001 30001
Values (N) Register
D0000 - Holding
Data Registers (D) 3200 640 - 3839 4001 40001
D0C7F Register
Non-volatile D0C80 - Holding
128 3840 - 3967 4001 40001
Registers (D) D0CFF Register

For PCk06
MODBUS Address Address
PCk06 Memory PLC MODBUS
QTY(Dec.) Address (484 (584/984
Type Range(Hex) Data Type
Range(Dec.) Mode) Mode)
Convert PLC Addr. To Dec. + Start of Range + Data Type
Link Relays (L) 1024 L000 - L3FF 0 - 1023 1001 100001 Input
Inputs (X) 512 X000 - X1FF 2048 - 2559 1001 100001 Input
Link Relays (L) 1024 L400 - L7FF 0 - 1023 1 1 Coil
Outputs (Y) 512 Y400 - Y5FF 2048 - 2559 1 1 Coil
Internal Relays M000 -
512 3072 - 3583 1 1 Coil
(M) M1FF
Keep-Relays (K) 512 K000 - K1FF 3584 - 4095 1 1 Coil
Timer Contacts
256 T000 - T0FF 6144 - 6399 1 1 Coil
(T)
Counter Contacts
128 C000 - C07F 6400 - 6527 1 1 Coil
(C)
Timer Current N000 - Input
256 0 - 255 3001 30001
Values (N) N0FF Register
Counter Current Input
128 N100 - N17F 512 - 639 3001 30001
Values (N) Register
D0000 - Holding
3200 640 - 3839
D0C7F Register
Data Registers (D) 4001 40001
D1000 - Holding
4096 4096 - 8191
D1FFF Register
Non-volatile D0C80 - Holding
128 3840 - 3967 4001 40001
Registers (D) D0CFF Register

1-36
The following examples show how to generate the MODBUS address and data type for hosts which
require this format.

Example 1: D0440 (584/984 Mode)


Find the MODBUS address for Data Register D0440.
1. Find Data Registers in the table.
2. Convert D0440 into decimal (1088).
3. Add the starting address for the range (640) 1088 + 640 = 1728
4. Add the MODBUS starting address for the mode (40001). 1728 + 40001 = 41729

MODBUS address 41729

Example 2: Y410 (584/984 Mode)


Find the MODBUS address for output Y410.
1. Find Y outputs in the table.
2. Subtract the starting address for the range (400) 410 – 400 = 10h
3. Convert 10h into decimal (16).
4. Add the starting address for the range (2048). 16 + 2048 = 2064
5. Add the MODBUS address for the mode (1). 2064 + 1 = 2065

MODBUS address 2065

Example 3: T008 Current Value (484 Mode)


Find the MODBUS address to obtain the current value from Timer T008.
1. Find Timer Current Values in the table.
2. Convert N008 into decimal (8).
3. Add the MODBUS starting address of the mode (3001). 8 + 3001 = 3009

MODBUS address 3009

Example 4: M02C (584/984 Mode)


Find the MODBUS address for Internal Relay M02C.
1. Find Internal Relays in the table.
2. Convert M02C into decimal (44).
3. Add the starting address for the range (3072). 44 + 3072 = 3116
4. Add the MODBUS address for the mode (1). 3116 + 1 = 3117

MODBUS address 3117

1.6.4. DirectNET address


The DirectNET master uses this machine with PCk05/PCk06 and the DirectNET slave uses a usual
address of the slave device as it is at use.
For instance, to access memory address (D0400) of slave PLC by way of DirectNET, the network
master demands D0400 from the slave.

1-37
2. EXECUTION OF PROGRAM
2.1. Processing operation

Sequential program starts at the first location in the sequential program area and stops on an
END instruction followed by internal post-processings such as updating of external I/O data and
self diagnosis. And then the program returns back to the step in which START instruction resides
and repeats steps through the END instruction. The portion of whole program starting from the
beginning of the program to START instruction is called the initial sequential program (initial
program) and a program from START to END instructions is called main sequential program (main
program). A START instruction can be stored at the beginning of whole program to have the main
program only. It becomes a composition only of the main program in PCk05/PCk06.
The processing for external I/O data starts by reading the external I/O data onto the image
memory before the initial sequence program. Then, the initial sequence program and main
sequence program are executed for the data on the image memory.
After executing the END instruction, the data on the image memory is output to the external output
module. That is the end of one scan.
After that, the current external I/O data is read onto the image memory before the START
instruction and the processing shown above is executed as(2), (3), and so on.

2-1
2.2. Subroutine

A part of program which is repeatedly used in different parts of the program is called subroutine
and stored in an area together with other subroutines. When a CALL instruction in a program is
encountered, a subroutine having the label in which the subroutine number denoted by the CALL
instruction is executed. A RET instruction causes the program to return to the step where
processing was made before issuing of the CALL.
Processing order

START (1)

CALL S***
(3) Followed by repetition of
steps (1) to (5)
CALL S***
(5)

END

LABEL S***
(2) (4)
Subroutine
RET

Available number of subroutines are (PCk05:64,S000 to S063) and (PCk06:128, S000 to Sl27).
These subroutines can be nested as shown below.

Processing order

START (1)

CALL S***
Followed by repetition of
(5) steps (1) to (5)

END

LABEL S***
(2)

CALL S###
(4)

RET

LABEL S###
(3)

RET

2-2
2.3. Interrupt program

The PCk05/PCk06 can handle interruption. It is processing of a special sequence as external


interrupt event occurs.

2.3.12. Interrupt program considerations

(1) Interrupt program can be enabled and prohibited by application instructions EI and DI,
respectively.

(2) Default setting upon power-up and reset start is an interrupt program prohibited state(DI
state).EI instruction must be executed beforehand to execute the interrupt program.

(3) When an interruption occurs during execution of basic or application instruction, the interrupt
program is started upon completion of the current execution. This means that an interruption
during execution of an application program requiring a long processing period such as the
block transfer will have a long interrupt latency.

2.4. Scan time

The timer interval between the start of the program and the execution of START instruction, i.e. the
execution period of initial program is called the scan time of initial program; and the interval
between the end of execution of START instruction and the starting of the next execution of START
instruction, i.e. the cycle time of main program, is the scan time of main program.
These scan times are continuously compared with the contents of the scan timer set by parameter
and cause a scan timer over error when one or both of them exceed the preset value. For
obtaining correct comparison result, these parameters should be set to match the scan time of
corresponding program.
The scan time value of program being executed is stored in special register, S001-S003, and can
be read out on the I/O monitor or by an appropriate application instruction.

Address Contents
S001 Maximum scan time in the sequence program (Binary : ms)
S002 Minimum scan time in the sequence program (Binary : ms)
S003 Current scan time in the sequence program (Binary : ms)

2-3
3. PARAMETER
Some functions of the TOYOPUC, such as processing upon occurrence of error are user settable
and are called parameters.

3.1. Contents of parameters


In the parameter that can set the user, the following one is, and it sets it with the peripheral
equipment.
(Refer to the manual of the peripheral devices for the setting method. )

(1) Time length of scan time

Set the time length of scan timer for initial program and main program in unit of milliseconds.
The time length should be within 2 to 9998 ms. If the scan exceeds the time set by this
parameter, the scan time over error will occur.

(2) Program name

Store the program name as a parameter, and the contents of program are easily recognizable.

3.2. Setting the parameters


3.2.1. Setting with a peripheral device

Setting with PCwin-PCk (For other peripheral devices, refer to their instruction manuals).

(1) Parameter setting


For parameter setting, if the Folder of parameter on the Project Screen is double
clicked, following parameter setting items will be displayed.
Next by double clicking the items to be set, setting dialog will be displayed.

Double-click the
item to be set

3-1
(2) CPU operation mode

Decide PLC model (PCk05/PCk06) that uses it.

(3) Scan time timer

Scan Time Value of overall Program of the System Scan Time value of Main Program are
set. At the time of Program execution, if set scan time is executed, CPU error will occur.

(4) Program name

Program name can be respectively set in the system. Input Range is maximum 8 half size
characters.
Program Name set here will be displayed in the Program Folder of the Project
Screen.

3-2
4. USER MEMORY STRUCTURE
4.1. Program memory structure
The program memory is divided two areas in the program area and the parameter area, and
when each area is blacked out, too maintains the content by the flash memory.

Program PCk05 : 2048 words(6k bytes)


Area PCk06 : 7679 words(22.5k bytes)

Parameter
1536 bytes
area

(1) Program area

The memory space to store the sequential program.

(2) Parameter memory area

Some of the CPU functions such as processing upon occurrence of error and intervals
Periodic interrupts are user settable.
These setting values area called parameters and stored in this area.

Note) All the comments are kept with the file of PCwin-PCk because there is no comment data
area.

4-1
4.2. Data memory structure
4.2.1.1. Data memory address
PCk05 PCk06 Data
holding area
No. Identifier Name at power cut
Word Word
Bit address Points Bit address Points off
address address
X000 X00W X000 X00W
1 X Input 256 512 -
∼0FF ∼0FW ∼1FF ∼1FW
Y400 Y40W Y400 Y40W
2 Y Output 256 512 -
∼4FF ∼4FW ∼5FF ∼5FW
Internal M000 M00W M000 M00W
3 M 256 512 -
relay ∼0FF ∼0FW ∼1FF ∼1FW
K000 K00W K000 K00W
4 K keep-relay 256 512 O
∼0FF ∼0FW ∼1FF ∼1FW
Special V000 V00W V000 V00W
5 V 256 256 -
relay ∼0FF ∼0FW ∼0FF ∼0FW
Extend
M400 M40W M400 M40W
6 M special 256 256 -
relay ∼4FF ∼4FW ∼4FF ∼4FW
T000 T00W T000 T00W
7 T Timer 128 256 -
∼07F ∼07W ∼0FF ∼0FW
C100 C10W C100 C10W
8 C Counter 128 128 -
∼17F ∼17W ∼17F ∼17W
Link relay L000 L00W L000 L00W
9 L 1024 1024 -
input ∼3FF ∼3FW ∼3FF ∼3FW
Link relay L400 L40W L400 L40W
10 L 1024 1024 -
output ∼7FF ∼7FW ∼7FF ∼7FW
Edge P000 P000
11 P - 512 - 512 -
detection ∼1FF ∼1FF
D0000 D0000 3200
∼0C7F ∼0C7F
Data
12 D - 3200 - O
register D1000 4096
∼1FFF

Data
D0C80 D0C80
13 D register - 128 - 128 -
EEPROM ∼0CFF ∼0CFF
Timer N0000 N0000
14 N present - 128 - 256 -
value ∼007F ∼00FF
Counter N0100 N0100
15 N present - 128 - 128 O
value ∼017F ∼017F
S0000 S0000 128
∼007F ∼007F

S0080 64
∼00BF
Special
16 S - 128 - O
register
S00C0 64
∼00FF

S0100 768
∼03FF
4-2
(1) Bit devices area external I/O, internal relay, etc. which are usually set or reset by 1 bit and
designated by the bit address.
Word devices are devices such as the data register handled by a unit of 16 bits and are
designated by the word address.

(2) A bit device can be handled by a unit of 16 bits as if it is a word device. This can be done by
using an application instruction and replacing the lowest bit of a bit address with the
character W (as it implies).

Example 1 : X10W…..Represents 16 points, X100-X10F

Example 2 : M03W…..Represents 16 points, M030-M03f

(Note) When handling the data in a unit of 16 bits or 2 bits, use word address. Designation
cannot be made using bit or byte address (refer to the following). Therefore, for
example, 16-point data from X108 to X117 or from D0H to D1L cannot be handled as
1-word data.

(3) When data is divided into two 8 bits, it should be distinguished from the other in addressing
by suffixing H (upper byte) and L (lower byte). For bit devices, W in a word address is
replaced by H or L.

Example 1 : D1000L…..Represents the lower 8 bits of D1000.

Example 2 : X10H……..Represents upper 8 bits of X10W (X100-X10F),


i.e. X108-X10F.

(Note) When handling the data in a unit of 16bits (word) or 32bits, designation starting with
the upper byte of the register cannot be made.
Example: H L
D0 D0H and D1L cannot be designated as one word.
D1

4-3
(EX.)
Bit address Word address Byte address
X000 (LSB) (LSB)
X001
X002
X003
X00L Lower byte
X004
X005
Bit X006
address X007 (MSB)
X00W
area X008 (LSB)
X009
X00A
X00B
X00H Upper byte
X00C
X00D
X00E
X00F (MSB) (MSB)
D0000-0 (LSB) (LSB)
D0000-1
D0000-2
D0000-3
D0000L Lower byte
D0000-4
D0000-5
Word D0000-6
address D0000-7 (MSB)
D0000
area D0000-8 (LSB)
(Example) D0000-9
D0000-A
D0000-B
D000H Upper byte
D0000-C
D0000-D
D0000-E
D0000-F (MSB) (MSB)

Bit address Bit data Byte data Word data

0 0
1 0
2 1
3 0
34h
4 1
5 1
6 0
7 0
8 1234h
9 0
A 1
B 0
0
C 12h
D 1
E 0
F 0
0

h:Indicated with hexadecimal number.

(4) The address cannot be used in identifier X, Y, T, and C at equal cost.

4-4
5. INSTRUCTION WORDS
5.1. Basic instructions
Processing time μs
Step
No. Symbol Language number Function
PCk05 PCk06
Computing start
1 STR 1 2.0 0.67
(normally ON)
Computing start
2 STR NOT 1 2.3 0.67
(normally OFF)
Series connection
3 AND 1 1.4 0.42
(normally ON)
AND Series connection
4 1 1.6 0.51
NOT (normally OFF)
Parallel connection
5 OR 1 1.6 0.51
(normally ON)
Parallel connection
6 OR NOT 1 1.9 0.55
(normally OFF)
Logic block series
7 AND STR 1 1.3 0.37
connection
Logic block parallel
8 OR STR 1 1.3 0.37
connection

9 OUT 1 Coil output 6.8 1.82

10 SET 1 Keep-relay setting 32.2 9.2

11 RST 1 Keep-relay resetting 34.4 9.2

12 PTS 1 Rise differentiation 20.2 5.4

13 NTS 1 Fall differentiation 20.1 7.3

14 FPS 1 Multi-coil branching start Not used Not used

15 FRD 1 Multi-coil branching Not used Not used

16 FPP 1 Multi-coil branching end Not used Not used

17 FST 1 Unconditional output 2.0 0.67

18 NOT 1 Condition reversing Not used Not used

19 NOP 1 Non-processing Not used Not used

or can be used only after in PCk05/PCk06.


It is not possible to use it on other conditions. Moreover, the device that can be
used in a point of contact instruction at this time is only input (X), output (Y),
internal relay (M PCk05:M000-0FF,PCk06:M000-M1FF), Keep relay (K),
timer (T), counter (C), and link (L) relays.

5-1
1. STR, STR NOT

(1) Usable devices

M
X Y K V T C L P D N S Constant
PCk05 000 - 0FF 400 - 4FF
OP1 ○ ○ ○ ○ ○ ○ ○ ○ ○

M
X Y K V T C L P D N S Constant
PCk06 000 - 1FF 400 - 4FF
OP1 ○ ○ ○ ○ ○ ○ ○ ○ ○

(2) Number of steps 1

(3) Symbol

STR

STR NOT

(4) Function
STR is the instruction to start operation at normally ON and STR NOT at normally OFF, each
storing ON/OFF information of the designated device in the accumulator as the operation
result.

(5) Example

5-2
2. AND, AND NOT

(1) Usable devices

M
X Y K V T C L P D N S Constant
PCk05 000 - 0FF 400 - 4FF
OP1 ○ ○ ○ ○ ○ ○ ○ ○ ○

M
X Y K V T C L P D N S Constant
PCk06 000 - 1FF 400 - 4FF
OP1 ○ ○ ○ ○ ○ ○ ○ ○ ○

(2) Number of steps 1

(3) Symbol

AND

AND NOT

(4) Function
AND is the instruction to make serial connection at normally ON and AND NOT instruction at
normally OFF. AND operation(logical product) is carried out between ON/OFF information of
the specified device and the operation result stored in the accumulator. The logical product is
stored into the accumulator, replacing the current content.

(5) Example of program

5-3
3. OR, OR NOT

(1) Usable devices

M
X Y K V T C L P D N S Constant
PCk05 000 - 0FF 400 - 4FF
OP1 ○ ○ ○ ○ ○ ○ ○ ○ ○

M
X Y K V T C L P D N S Constant
PCk06 000 - 1FF 400 - 4FF
OP1 ○ ○ ○ ○ ○ ○ ○ ○ ○

(2) Number of steps 1

(3) Symbol

OR

OR NOT

(4) Function
OR is the instruction to make parallel connection at normally ON and OR NOT instruction at
normally OFF. OR operation(logical sum) is carried out between ON/OFF information of the
specified device and the operation result stored in the accumulator. The logical sum is stored
in the accumulator, replacing the current content.

(5) Example of program

5-4
4. AND STR

(1) Usable devices

M
X Y K V T C L P D N S Constant
PCk05 000 - 0FF 400 - 4FF
OP1

M
X Y K V T C L P D N S Constant
PCk06 000 - 1FF 400 - 4FF
OP1

(2) Number of steps 1

(3) Symbol

(4) Function
Carries out AND operation between two logical blocks and makes the logical product as the
new operation result.

(5) Example of program

(6) Notes
Available instructions are up to 8 when using AND STR consecutively. Use of more than 8
instructions will have unexpected result.

5-5
5. OR STR

(1) Usable devices

M
X Y K V T C L P D N S Constant
PCk05 000 - 0FF 400 - 4FF
OP1

M
X Y K V T C L P D N S Constant
PCk06 000 - 1FF 400 - 4FF
OP1

(2) Number of steps 1

(3) Symbol

(4) Function
Carries out OR operation between two logical blocks and makes the logical sum as the new
operation result.

(5) Example of program

(6) Notes
Available instructions are up to 8 when using OR STR consecutively. Use of more than 8
instructions will have unexpected result.

5-6
6. OUT

(1) Usable devices

M
X Y K V T C L P D N S Constant
PCk05 000 - 0FF 400 - 4FF
OP1 ○ ○ ○ ○

M
X Y K V T C L P D N S Constant
PCk06 000 - 1FF 400 - 4FF
OP1 ○ ○ ○ ○

(2) Number of steps 1

(3) Symbol

(4) Function
Outputs the operation result stored in the accumulator to the specified device.

(5) Example of program

5-7
7. SET

(1) Usable devices

M
X Y K V T C L P D N S Constant
PCk05 000 - 0FF 400 - 4FF
OP1 ○

M
X Y K V T C L P D N S Constant
PCk06 000 - 1FF 400 - 4FF
OP1 ○

(2) Number of steps 1

(3) Symbol

(4) Function
Turns on specified keep relay if the operation result before SET instruction is ON("1").

(5) Example of program

5-8
8. RST

(1) Usable devices

M
X Y K V T C L P D N S Constant
PCk05 000 - 0FF 400 - 4FF
OP1 ○

M
X Y K V T C L P D N S Constant
PCk06 000 - 1FF 400 - 4FF
OP1 ○

(2) Number of steps 1

(3) Symbol

(4) Function
Turns off the specified keep relay if the operation result before RST instruction is ON("1").

(5) Example of program

5-9
9. PTS, NTS

(1) Usable devices

M
X Y K V T C L P D N S Constant
PCk05 000 - 0FF 400 - 4FF
OP1 ○

M
X Y K V T C L P D N S Constant
PCk06 000 - 1FF 400 - 4FF
OP1 ○

(2) Number of steps 1

(3) Symbol

(4) Function
PTS turns on("1")the previous operation result for 1 scan period when the previous result
changes from OFF to ON.
NTS turns on("1")the previous operation result for 1 scan period when the previous result
changes from ON to OFF.

(5) Example of program

Time chart

(6) Notes
The address of device "P" available for instructions PTS and NTS is 512 points. Use only one
address for one device and avoid address overlapping.
Refer to the following page restrictions upon use.

5-10
Notes on use in a subroutine or interrupt
When used in a subroutine or interrupt, the PTS or NTS instruction may not be detected in
some cases.

Example
As shown in the time chart, if X20 is ON when X10 turns OFF from ON, Y100 does not turn
ON for one scan even when X10 and X20 turn ON next.
If X20 turns OFF when X10 is ON, Y100 functions normally (that is, when X20 functions as
shown by the dotted line, Y100 and P000 function as shown by the dotted line, as well)

Program example

Time chart

or can be used only after in PCk05/PCk06.


It is not possible to use it on other conditions. Moreover, the device that can be
used in a point of contact instruction at this time is only input (X), output (Y),
internal relay (M PCk05:M000-0FF,PCk06:M000-M1FF), Keep relay (K),
timer (T), counter (C), and link (L) relays.

5-11
5.2. Timer and counter instructions
(1) Timer and counter commands
Processing time μs
Classifi
Function Mnemonic
Step
Symbol (example) Content of
cation number computation PCk05 PCk06
T000 10ms timer of 99.99
Direct-desig
sec at setup value
nated 10ms TMRH 3 59.5 48.4
TMRH K=99.99
timer
T001 10ms timer on which
Indirect-desi
D0100 content is set up
gnated TMRH 2 64.8 51.4
TMRH S=D0100 (as a setup value)
10ms timer
Timer
T002 100ms timer of 999.9
Direct-desig
sec at setup value
nated TMR 3 58.1 20.0
TMR K=999.9
100ms timer
T003 100ms timer on which
Indirect-desi
D0101 content is set up
gnated TMR 2 64.0 26.8
TMR S=D0101 (as a setup value)
100ms timer

Direct-desig T004 10ms integrating timer


nated 10ms T of 123.45 sec at setup
TMRSH 3 65.2 50.3
integrating TMRSH K=123.45 value
timer R
Indirect-desi
T006 10ms integrating time
gnated
T on which D0102,D0103
10ms TMRSH 2 71.4 54.2
TMRSH S=D0102 content is set up (as a
integrating
Integr R setup value).
ating
timer
timer Direct-desig T008 100ms integrating timer
nated
T of 1234.5 sec at setup
100ms TMRS 3 65.7 45.0
TMRS K=1234.5 value
integrating
R
timer
Indirect-desi
T00A 100ms integrating time
gnated
T on which D0104,D0105
100ms TMRS 2 72.2 48.9
TMRS S=D0104 content is set up (as a
integrating
R setup value).
timer
C100 UP-counter of 9999 at a
Direct-desig
CK setup value
nated UP CNT 3 73.7 22.2
CNT K=9999
counter R
UP
counter C101 UP-counter on which
Indirect-desi
CK D0106 content is set (as
gnated UP CNT 3 79.5 25.8
CNT S=D0106 a setup value).
counter R
C102
UP-DOWN counter of
Direct-desig CK
65535 at setup value
nated
CNTH 3 D CNTH K=65535 111.8 35.4
UP-DOWN
counter R
UP-DO
WN C104
counter CK UP-DOWN counter on
Indirect-desi
which D0108,D0109
gnated
CNTH 2 D CNTH S=D0108 content is set up (as a 118.3 39.8
UP-DOWN
setup value).
counter R

K,S : Value set to counter or timer


T : Timer input for integration
R : Clear
CK : Up count input
D : Down count input

5-12
(Note) PCk05 becomes (T000-T07F) in the address that can be used for the timer.
PCk05 becomes (T000-T0FF) in the address that can be used for the timer.
The address that can be used for the counter becomes it in case of both
(C100-C17F) PCk05 and PCk06.

The value becomes BCD set now a set value of the timer and the counter of PCk05/PCk06.
Do not set the binary.

Notes on use of the timer instruction

(1) When “1” is set (0.1S for 100ms timer and 0.01S for 10ms timer),the timer may expire
instantaneously. Timer accuracy is 0 to -1 or –(scan time). Thus, when the increment of the
timer (100ms or 10ms) is smaller than the scan time, the timer may expire instantaneously
with a setting other than “1”.

(2) In a subroutine or interrupt :

When the timer instruction is used in a subroutine or interrupt, it may turn ON immediately in
some cases.
If X20 is OFF when X10 turns ON and the timer instruction is executed when X10 and X20
turns ON next, the timer adds the time lapsed in the section indicated by the arrow in the time
chart and thus, does not function normally.
If the subroutine is such that it is executed every scan, use of the timer in the subroutine
causes no problem.

Program example

Time chart

Since the instruction is executed during the period indicated by T, the timer
cannot determine when X20 has turned ON. Therefore, the timer assumes that the condition
has been satisfied (X20=ON) immediately after the previous instruction was executed and
thus adds the lapsed time T to the current value. Therefore, when the timer set value is less
than or equal to T, the timer turns ON immediately after the timer instruction is executed.

5-13
(3) Present value register (N****)
Each timer counter is stored in the present value register(N****) by the BCD4 digit now. It is
also possible to monitor each present value, and to change the value directly by the
application instruction now.

[Example] The value is being stored in N0023 about T023 now.


The value is being stored in N0156 about C156 now.

The value becomes BCD set now a set value of the timer and the counter of PCk05/PCk06.
Do not set the binary.

5-14
1.TMRH (Direct mode 10ms timer)

(1) Usable devices

M
X Y K V T C L P D N S Constant
PCk05 000 - 0FF 400 - 4FF
Device ○
Setting value ○

M
X Y K V T C L P D N S Constant
PCk06 000 - 1FF 400 - 4FF
Device ○
Setting value ○

(2) Number of steps 3

(3) Symbol

(4) Function
The count value of this timer is directly set by a constant in 10ms units. If the operation done
before the issue of TMRH instruction has resulted in ON, the timer counting the time end when
the terminal time is reached, turns on the specified device
(PCk05:T000-T07F,PCk06:T000-T0FF).

(5) Example of program


Turns on Y402 when 50ms elapsed after turning on of X000.

5-15
2.TMRH (Indirect mode 10ms timer)

(1) Usable devices

M
X Y K V T C L P D N S Constant
PCk05 000 - 0FF 400 - 4FF
Device ○
Setting value ○ ○ ○ ○ ○ ○

M
X Y K V T C L P D N S Constant
PCk06 000 - 1FF 400 - 4FF
Device ○
Setting value ○ ○ ○ ○ ○ ○

(2) Number of steps 2

(3) Symbol

(4) Function
The timer loads the count value(BCD 1-9999)stored in the specified register. If the operation
before the issue of TMRH instruction has resulted in ON, the timer counts out time in 10 ms
units and when the terminal count is reached, turns on the specified device
(PCk05:T000-T07F,PCk06:T000-T0FF).

(5) Example of program


Sets the count value with a BCD input data(X000-X00F). Turns on Y400 when the specified
time elapsed after turning on of Y401.

5-16
3.TMR (Direct mode 100ms timer)

(1) Usable devices

M
X Y K V T C L P D N S Constant
PCk05 000 - 0FF 400 - 4FF
Device ○
Setting value ○

M
X Y K V T C L P D N S Constant
PCk06 000 - 1FF 400 - 4FF
Device ○
Setting value ○

(2) Number of steps 3

(3) Symbol

(4) Function
The count value of this timer is directly set by a constant in 100ms units. If the operation done
before the issue of THR instruction has resulted in ON, the timer counting the timer end when
the terminal time is reached, turns on the specified device
(PCk05:T000-T07F,PCk06:T000-T0FF).

(5) Example of program


Turns on Y402 when 10 sec. elapsed after turning on of X000.

5-17
4.TMR (Indirect mode 100ms timer)

(1) Usable devices

M
X Y K V T C L P D N S Constant
PCk05 000 - 0FF 400 - 4FF
Device ○
Setting value ○ ○ ○ ○ ○ ○

M
X Y K V T C L P D N S Constant
PCk06 000 - 1FF 400 - 4FF
Device ○
Setting value ○ ○ ○ ○ ○ ○

(2) Number of steps 2

(3) Symbol

(4) Function
The timer loads the count value(BCD 1-9999)stored in the specified register. If the operation
before the issue of TMR instruction has resulted in ON, the timer counts out time in 100 ms
units and when the terminal count is reached, turns on the specified device
(PCk05:T000-T07F,PCk06:T000-T0FF).

(5) Example of program


Sets the count value with the contents of D100. Turns on Y400 when the specified time
elapsed after turning on of Y401.

5-18
5.TMRSH (Direct mode 10ms integrating timer)

(1) Usable devices

M
X Y K V T C L P D N S Constant
PCk05 000 - 0FF 400 - 4FF
Device ○
Setting value ○

M
X Y K V T C L P D N S Constant
PCk06 000 - 1FF 400 - 4FF
Device ○
Setting value ○

(2) Number of steps 3

(3) Symbol

(4) Function
The count value of this integrating timer is directly set by a constant in 10ms units. If the
operation done on the T input has resulted in ON, the timer starts counting the time and when
the terminal time is reached, turns on the specified device
(PCk05:T000-T07F,PCk06:T000-T0FF).
The contents(current value)is kept unclear until the next R input becomes ON.

The passage value stores specified device number T(n) in both registers of value register
N(n) and N(n+1) by the BCD8 digit now. Therefore, it is noted not to be able to use T(n+1).
For instance, when the timer of T010 is used, T011 cannot be used.

Example) Four T010→N010 passage value subordinate position digits.


Four high rank of T011→N011 passage value digits.

(5) Example of program


Turns on Y402 when the accumulated ON-time of X000 is 50 ms. Turns off Y402 when X001
is ON.

5-19
6.TMRSH (Indirect mode 10ms integrating timer)

(1) Usable devices

M
X Y K V T C L P D N S Constant
PCk05 000 - 0FF 400 - 4FF
Device ○
Setting value ○ ○ ○ ○ ○ ○

M
X Y K V T C L P D N S Constant
PCk06 000 - 1FF 400 - 4FF
Device ○
Setting value ○ ○ ○ ○ ○ ○

(2) Number of steps 2

(3) Symbol

(4) Function
The integrating timer loads the count value(1-65535)stored in the specified register. If the
operation done on T input has resulted in ON, the timer counts out time in 10 ms units and
when the terminal count is reached, turns on the specified device
(PCk05:T000-T07F,PCk06:T000-T0FF).
The contents(current value)is kept unclear until the next R input becomes ON.

A set value is set to both registers of specified register number (n) and (n+1) by BCD8 digit
(1~65535).
Example) For set value D102.
D102 setting value subordinate position BCD4 digit.
D103 setting value high rank BCD4 digit.
The passage value is stored in both registers of value register N(n) and N(n+1) by the BCD8
digit about specified device number T(n) now. Therefore, it is noted not to be able to use
T(n+1).
For instance, when the timer of T010 is used, T011 cannot be used.
Example) Four T010→N010 passage value subordinate position digits.
Four high rank of T011→N011 passage value digits.

(5) Example of program


Turns on Y402 when the accumulated ON-time of X000 is the value specified by the contents
of D102,D103.Turns off Y402 when X001 is ON.

5-20
7.TMRS (Direct mode 100 ms integrating timer)

(1) Usable devices

M
X Y K V T C L P D N S Constant
PCk05 000 - 0FF 400 - 4FF
Device ○
Setting value ○

M
X Y K V T C L P D N S Constant
PCk06 000 - 1FF 400 - 4FF
Device ○
Setting value ○

(2) Number of steps 3

(3) Symbol

(4) Function
The count value of this integrating timer is directly set by a constant in 100 ms units. If the
operation done on the T input has resulted in ON, the timer starts counting the time and when
the terminal time is reached, turns on the specified device
(PCk05:T000-T07F,PCk06:T000-T0FF).
The contents(current value)is kept unclear until the next R input becomes ON.

The passage value is stored in both registers of value register N(n) and N(n+1) by the BCD8
digit about specified device number T(n) now. Therefore, it is noted not to be able to use
T(n+1).
For instance, when the timer of T010 is used, T011 cannot be used.
Example) Four T010→N010 passage value subordinate position digits.
Four high rank of T011→N011 passage value digits.

(5) Example of program


Turns on Y402 when the accumulated ON-time of X000 is 10 sec.
Turns off Y402 when X001 is ON.

5-21
8.TMRS (Indirect mode 100 ms integrating timer)

(1) Usable devices

M
X Y K V T C L P D N S Constant
PCk05 000 - 0FF 400 - 4FF
Device ○
Setting value ○ ○ ○ ○ ○ ○

M
X Y K V T C L P D N S Constant
PCk06 000 - 1FF 400 - 4FF
Device ○
Setting value ○ ○ ○ ○ ○ ○

(2) Number of steps 2

(3) Symbol

(4) Function
The integrating timer loads the count value(1-65535)stored in the specified register. If the
operation done on T input has resulted in ON, the timer counts out time in 100 ms units and
when the terminal count is reached, turns on the specified device
(PCk05:T000-T07F,PCk06:T000-T0FF).
The contents(current value)is kept unclear until the next R input becomes ON.

A set value is set to both registers of specified register number (n) and (n+1) by BCD8 digit
(1~65535).
Example) For set value D104.
D104 setting value subordinate position BCD4 digit.
D105 setting value high rank BCD4 digit.
The passage value is stored in both registers of value register N(n) and N(n+1) by the BCD8
digit about specified device number T(n) now. Therefore, it is noted not to be able to use
T(n+1).
For instance, when the timer of T010 is used, T011 cannot be used.
Example) Four T010→N010 passage value subordinate position digits.
Four high rank of T011→N011 passage value digits.

(5) Example of program


Turns on Y402 when the accumulated ON-time of X000 is the value specified by the contents
of D104,D105.Turns off Y402 when X001 is ON.

5-22
9.CNT (Direct mode up counter)

(1) Usable devices

M
X Y K V T C L P D N S Constant
PCk05 000 - 0FF 400 - 4FF
Device ○
Setting value ○

M
X Y K V T C L P D N S Constant
PCk06 000 - 1FF 400 - 4FF
Device ○
Setting value ○

(2) Number of steps 3

(3) Symbol

(4) Function
An up counter whose quantity is directly set with a constant. If the R input is OFF, the counter
increments the current value by 1 upon turning on of the CK input and turns on the specified
device (C100-C17F)when the terminal count is reached. The counter clears the current value
upon ON of R input, turning off the specified device.

The count value (present value) is stored in value register N(n) by the BCD4 digit about
specified device number C(n) now. Therefore, the upper bound of the count value becomes
9999.

(5) Example of program


Turns on Y402 on the 5th ON of X000 and turns off Y402 on the ON of X001.

5-23
10.CNT (Indirect mode up counter)

(1) Usable devices

M
X Y K V T C L P D N S Constant
PCk05 000 - 0FF 400 - 4FF
Device ○
Setting value ○ ○ ○ ○ ○ ○

M
X Y K V T C L P D N S Constant
PCk06 000 - 1FF 400 - 4FF
Device ○
Setting value ○ ○ ○ ○ ○ ○

(2) Number of steps 2

(3) Symbol

(4) Function
The up counter loads the count value(BCD 1-9999)stored in the specified register. If the R
input is OFF, the counter increments the current value by 1 upon turning on of the CK input
and turns on the specified device(C100-C17F)when the terminal count is reached. The
counter clears the current value upon ON of R input, turning off the specified device.

The count value (present value) is stored in value register N(n) by the BCD4 digit about
specified device number C(n) now. Therefore, the upper bound of the count value becomes
9999.

(5) Example of program


Turns on Y403 when the number of ON of X000 is the set value specified by the contents of
D106.Turns off Y403 when the X001is ON.

5-24
11. CNTH (Direct mode up/down counter)

(1) Usable devices

M
X Y K V T C L P D N S Constant
PCk05 000 - 0FF 400 - 4FF
Device ○
Setting value ○

M
X Y K V T C L P D N S Constant
PCk06 000 - 1FF 400 - 4FF
Device ○
Setting value ○

(2) Number of steps 3

(3) Symbol

(4) Function
It is ups and downs counter that specifies a set value directly by the constant.
Whenever the UP input is turned on when R input is turned off, +1 does the count value
(present value). And, whenever the DOWN input is turned on, -1 does the count value
(present value).
Specified device (C000~C17F) is turned on when the value is corresponding to a set value
now. It assumes it any more as turning on. Moreover, when R input is turned on, the count
value (present value) becomes 0.

When the UP input and the DOWN input simultaneous are input, it doesn't count. Moreover,
the DOWN input when the count value (present value) is 0 is 0. After the value of the count
(present value), the limit becomes 99999999 of the BCD 8 digits though the upper bound of a
set value is 65535.

The count value (present value) stores specified device number C(n) in both registers of value
register N(n) and N(n+1) by the BCD8 digit now. Therefore, it is noted not to be able to use
C(n+1).
For instance, when the counter of C110 is used, C111 cannot be used.
Example) Four C110→N110 passage value subordinate position digits.
Four high rank of C111→N111 passage value digits.

5-25
(5) Example of program

Time chart

5-26
12.CNTH (Indirect up/down counter)

(1) Usable devices

M
X Y K V T C L P D N S Constant
PCk05 000 - 0FF 400 - 4FF
Device ○
Setting value ○ ○ ○ ○ ○ ○

M
X Y K V T C L P D N S Constant
PCk06 000 - 1FF 400 - 4FF
Device ○
Setting value ○ ○ ○ ○ ○ ○

(2) Number of steps 2

(3) Symbol

(4) Function
It is a set value and a done ups and downs counter as for the content of the specified
register (..digit.. 1~65535-BCD8).
Whenever the UP input is turned on when R input is turned off, +1 does the count value
(present value). And, whenever the DOWN input is turned on, -1 does the count value
(present value).
Specified device (C000~C17F) is turned on when the value is corresponding to a set value
now. It assumes it any more as turning on. Moreover, when R input is turned on, the count
value (present value) becomes 0.

When the UP input and the DOWN input simultaneous are input, it doesn't count. Moreover,
the DOWN input when the count value (present value) is 0 is 0. After the value of the count
(present value), the limit becomes 99999999 of the BCD 8 digits though the upper bound of a
set value is 65535.

The count value (present value) stores specified device number C(n) in both registers of value
register N(n) and N(n+1) by the BCD8 digit now. Therefore, it is noted not to be able to use
C(n+1).
For instance, when the counter of C110 is used, C111 cannot be used.
Example) Four C110→N110 passage value subordinate position digits.
Four high rank of C111→N111 passage value digits.

5-27
(5) Example of program

Time chart

* The initial value of the register D108 is "2".


The initial value of the register D109 is "0".

5-28
5.3. Contact type application instructions
These are applied instructions and function as contact, i. e. they compare the values of two data,
and when the result meets the predetermined condition, turn ON. The instructions are roughly
classified into STR, AND OR, as appropriate to use in the sequence circuit.

(1) STR format

This type of instruction is used at the beginning of an operation as the basic STR instruction is.
The result of the comparison or operation is stored in the accumulator as ON/OFF information.

(2) AND format

Used for serial connection as the basic AND instruction is. The result of the previous
operation and the one obtained from the comparison done by this instruction are ANDed and
the logical product is stored in the accumulator.

(3) OR format

Used for parallel connection as the basic OR instruction is.


The result of the previous operation and the one obtained from the comparison done by this
instruction are ORed and the logical sum is stored in the accumulator.

5-29
Contact type applied commands

S : Register H : Hexadecimal constant

5-30
1. W=H 4-digit hexadecimal constant comparison (=)

(1) Usable devices

M
X Y K V T C L P D N S Constant
PCk05 000 - 0FF 400 - 4FF
OP1 ○ ○ ○ ○ ○ ○ ○ ○ ○ ○
OP2 ○

M
X Y K V T C L P D N S Constant
PCk06 000 - 1FF 400 - 4FF
OP1 ○ ○ ○ ○ ○ ○ ○ ○ ○ ○
OP2 ○

(2) Number of steps 2

(3) Symbol

(4) Function
Compares a 16-bit data from the register with hexadecimal 4-digit constant. If they are equal,
provides ON state.

(5) Example of program

1) Turns on Y40F if the data in X000-X00F is 1234 in hexadecimal number.

2) Turns on Y40F if the data register D0200 is FFFF in hexadecimal number and X000 is ON.

3) Turns on Y40F if the data register D0200 is AAAA in hexadecimal number or if X000 is ON.

5-31
2. W=N Word data comparison (=)

(1) Usable devices

M
X Y K V T C L P D N S Constant
PCk05 000 - 0FF 400 - 4FF
OP1 ○ ○ ○ ○ ○ ○ ○ ○ ○ ○
OP2 ○ ○ ○ ○ ○ ○ ○ ○ ○ ○

M
X Y K V T C L P D N S Constant
PCk06 000 - 1FF 400 - 4FF
OP1 ○ ○ ○ ○ ○ ○ ○ ○ ○ ○
OP2 ○ ○ ○ ○ ○ ○ ○ ○ ○ ○

(2) Number of steps 2

(3) Symbol

(4) Function
Compares two 16-bit data and provides ON state if they are equal.

(5) Example of program

1) Turns on Y423 if the current count of C100(contents of the current value register N100)and
that of C101(current value counter N101)are equal.

2) Turns on Y423 if the contents of Y410-Y41F and D0100are equal and X000 is ON.

3) Turns on Y423 if the contents of the data registers D0200 and D0201 are equal or if X000 is
ON.

5-32
3. W<>H 4-digit hexadecimal constant comparison (<>)

(1) Usable devices

M
X Y K V T C L P D N S Constant
PCk05 000 - 0FF 400 - 4FF
OP1 ○ ○ ○ ○ ○ ○ ○ ○ ○ ○
OP2 ○

M
X Y K V T C L P D N S Constant
PCk06 000 - 1FF 400 - 4FF
OP1 ○ ○ ○ ○ ○ ○ ○ ○ ○ ○
OP2 ○

(2) Number of steps 2

(3) Symbol

(4) Function
Compares a 16-bit data from the register with 4-digit hexadecimal constant. If they are not
equal, provides ON state.

(5) Example of program

1) Turns on Y40F if the data in X000-X00F is not 1234 in BCD number.

2) Turns on Y40F if the data register D0200 is not FFFF in hexadecimal number and X000 is ON.

3) Turns on Y40F if the data register D0200 is not AAAA in hexadecimal number or if X000 is
ON.

5-33
4. W<>N Word data comparison (<>)

(1) Usable devices

M
X Y K V T C L P D N S Constant
PCk05 000 - 0FF 400 - 4FF
OP1 ○ ○ ○ ○ ○ ○ ○ ○ ○ ○
OP2 ○ ○ ○ ○ ○ ○ ○ ○ ○ ○

M
X Y K V T C L P D N S Constant
PCk06 000 - 1FF 400 - 4FF
OP1 ○ ○ ○ ○ ○ ○ ○ ○ ○ ○
OP2 ○ ○ ○ ○ ○ ○ ○ ○ ○ ○

(2) Number of steps 2

(3) Symbol

(4) Function
Compares two 16-bit data and provides ON state if they are not equal.

(5) Example of program

1) Turns on Y423 if the current count of C100(contents of the current value register N100)and
that of C101(current value counter N101)are not equal.

2) Turns on Y423 if the contents of Y410-Y41F and D0100 are not equal and X000 is ON.

3) Turns on Y423 if the contents of the data registers D0200 and D0201 are not equal or if X000
is ON.

5-34
5. W>=H 4-digit hexadecimal constant comparison (>=)

(1) Usable devices

M
X Y K V T C L P D N S Constant
PCk05 000 - 0FF 400 - 4FF
OP1 ○ ○ ○ ○ ○ ○ ○ ○ ○ ○
OP2 ○

M
X Y K V T C L P D N S Constant
PCk06 000 - 1FF 400 - 4FF
OP1 ○ ○ ○ ○ ○ ○ ○ ○ ○ ○
OP2 ○

(2) Number of steps 2

(3) Symbol

(4) Function
Compares a 16-bit data from the register with 4-digithexadecimal constant, and if the register
data is larger than or equal to the constant, provides ON state.

(5) Example of program

1) Turns on Y40F if the data in X000-X00F is larger than or equal to 1234 in BCD number.

2) Turns on Y40F if the data register D0100 is larger than or equal to 5555 in hexadecimal
number and X000 is ON.

3) Turns on Y40F if the data register D0200 is larger than or equal to AAAA in hexadecimal
number or if X000 is ON.

5-35
6. W>=N Word data comparison (>=)

(1) Usable devices

M
X Y K V T C L P D N S Constant
PCk05 000 - 0FF 400 - 4FF
OP1 ○ ○ ○ ○ ○ ○ ○ ○ ○ ○
OP2 ○ ○ ○ ○ ○ ○ ○ ○ ○ ○

M
X Y K V T C L P D N S Constant
PCk06 000 - 1FF 400 - 4FF
OP1 ○ ○ ○ ○ ○ ○ ○ ○ ○ ○
OP2 ○ ○ ○ ○ ○ ○ ○ ○ ○ ○

(2) Number of steps 2

(3) Symbol

(4) Function
Compares two 16-bit data and if the first data is larger than or equal to the second, provides
ON state.

(5) Example of program

1) Turns on Y423 if the current count of C100(contents of the current value register N100)is
larger than or equal to that of C101(current value counter N101).

2) Turns on Y423 if the value represented by Y410-Y41F is larger than or equal to the contents
of D0100 and X000 is ON.

3) Turns on Y423 if the contents of the data register D0200 is larger than or equal to that of
D0201 or if X000 is ON.

5-36
7. W<H 4-digit hexadecimal constant comparison (<)

(1) Usable devices

M
X Y K V T C L P D N S Constant
PCk05 000 - 0FF 400 - 4FF
OP1 ○ ○ ○ ○ ○ ○ ○ ○ ○ ○
OP2 ○

M
X Y K V T C L P D N S Constant
PCk06 000 - 1FF 400 - 4FF
OP1 ○ ○ ○ ○ ○ ○ ○ ○ ○ ○
OP2 ○

(2) Number of steps 2

(3) Symbol

(4) Function
Compares a 16-bit data from the register with 4-digit hexadecimal constant, and if the register
data is smaller than the constant, provides ON state.

(5) Example of program

1) Turns on Y40F if the data in X000-X00F is smaller than 1234 in BCD number.

2) Turns on Y40F if the data register D0100 is smaller than 5555 in hexadecimal number and
X000 is ON.

3) Turns on Y40F if the data register D0200 is smaller than AAAA in hexadecimal number or if
X000 is ON.

5-37
8. W<N Word data comparison (<)

(1) Usable devices

M
X Y K V T C L P D N S Constant
PCk05 000 - 0FF 400 - 4FF
OP1 ○ ○ ○ ○ ○ ○ ○ ○ ○ ○
OP2 ○ ○ ○ ○ ○ ○ ○ ○ ○ ○

M
X Y K V T C L P D N S Constant
PCk06 000 - 1FF 400 - 4FF
OP1 ○ ○ ○ ○ ○ ○ ○ ○ ○ ○
OP2 ○ ○ ○ ○ ○ ○ ○ ○ ○ ○

(2) Number of steps 2

(3) Symbol

(4) Function
Compares two 16-bit data and if the first data is smaller than the second, provides ON state.

(5) Example of program

1) Turns on Y423 if the current count of C100(contents of the current value register N100)is
smaller than that of C101 (current value counter N101).

2) Turns on Y423 if the value represented by Y410-Y41F is smaller than the contents of D0100
and X000 is ON.

3) Turns on Y423 if the contents of the data register D0200 is smaller than that of D0201 or if
X000 is ON.

5-38
5.4. Output type application instructions
Output type application instructions are used to process numeric data and are executed if the previous
operation resulted in ON.
The output type application instructions are classified as follows :

Transfer
Arithmetic operation
Logical operation
Increment/decrement
Search
Data exchange
Comparison
Bit operation
Shift
Rotate
Programmed branch
Master control
Sequential interrupt
Label
Special unit data transfer
Others

5-39
Note1 : Some output type application instructions alter the resulting flag prepared in the special relay
in accordance with the result of operation made by these instructions. The altered flag can
be used as one of the conditions for the next operation. The table below shows the
available resulting flags.

Symbol Name Address


HCY Half carry flag V56
HBO Half borrow flag V55
Z Zero flag V54
> Greater-than flag V53
= Equal flag V52
< Less-than flag V51
ER Error flag V50

How to use resulting flag

(1) Application instructions which are always executed


The resulting flags are updated every scan. Therefore, they can be used as contacts until an
application instruction whose output includes these flags is next executed.

(2) Application instructions executed only when conditions are met


When the application instruction is not executed (when conditions are not met), the resulting flags
are not updated. In such a case, use the flags in the AND operation with these conditions.

(3) Application instructions executed in rise or fall


Note that the flags are only output once. To always use the resulting flags as contacts, they must
be connected to a keep relay.

5-40
(4) Output-type application instructions

Flag Execution time (µs)


Classification No. Command
Symbol Function V5E V58 V57 V56 V55 V54 V53 V52 V51 V50 PCk05 PCk06
word
Not Not
(DER) (CY) (BO) (HCY) (HBO) (Z) (>) (=) (<) (ER) Execution execution
Execution execution
Hexadecimal constant
Hexadecimal 4 digits 101 WMOV WMOV H D
H (4, 8
59.3 7.4 18.3 2.0
constant transfer
DMOV
digits ) ...transferred to
- - - - - - - - - -
8 digits 102 DMOV D. 60.9 7.5 19.2 2.0

Hexadecimal constant WMOT H D1 D2 Hexadecimal constant


transfer to two 4 digits 110 WMOVT H (4 digits) ..transferred - - - - - - - - - - 75.9 11.1 27.6 3.0
destinations to D1, D2.
Register to register

WMOVE S D
transfer

Direct
16bits 0 WMOVE DMOVE S data transferred to 60.3 7.4 21.1 2.0
transfer
- - - - - - - - - -
D

32bits 111 DMOVE 65.2 7.5 22.4 2.0


Data of the number
indicated with K which
transfer

WBMOV S D K
Block

Direct of head address is S


transfer
16bits 119 WBMOV are transferred to the
- - - - - - - - - 148.4+16xK 10.7 78.2+9.5xK 2.9
area which of head
Transfer

address is D.

WXCH D1 D2
16bits 2 WXCH For 16bit change, the 161.7 17.5 50.6 5.0
Data change DXCH contents of D1 and D2 - - - - - - - - - -
are changed.

32bits 133 DXCH 171.5 17.7 53.2 5.0

Data in the areas which


WBXCH D1 D2 K of respective head
addresses are D1 and


Block change 16bits 135 WBXCH D2 addresses and - - - - - - - - - 102.1 3.0
which are shown with
constant K are
changed.

WFIL H S K H is transferred to an
area wherein head


Data fill 16bits 129 WFIL address is S and the
- - - - - - - - - 44.2+8.0xK 3.0
number of data is K.
S,D : register H : hexadecimal constant K : Decimal constant
5-41
Flag Execution time (µs)
Classification No. Command
Symbol Function V5E V58 V57 V56 V55 V54 V53 V52 V51 V50 PCk05 PCk06
word
Not Not
(DER) (CY) (BO) (HCY) (HBO) (Z) (>) (=) (<) (ER) Execution Execution
execution execution

16bits 92 W+ W+ S1 S2 D The respective contents of S1 and 6.4 1 35.7 2


Binary

D+ S2 are added and the result is


stored in D. Data are all handled
- - - - - - -
169 D+ as binary number. 43.8 2.5
32bits
Add

4digits 10 W+P W+P S1 S2 D 6.4 1 35.7 2


The respective contents of S1 and
D+P
BCD

S2 are added and the result is


stored in D. The data are all
- - - - - -
178 D+P handled as BCD. 8 1.25 43.8 2.5
8digits

16bits 93 W- W- S1 S2 D The content of S2 is deducted from 6.4 1 35.7 2


Binary

that of S1 and the result is stored


D- - - - - - - -
in D. The data are all handled as
171 D- binary number. 43.8 2.5
32bits
Deduct

11 W-P W-P S1 S2 D 6.4 1 35.7 2


4digits
Arithmetic calculation

The content of S2 is deducted from


D-P
BCD

that of S1 and the result is stored


in D. The data are all handled as
- - - - - -
5-42

180 D-P BCD. 8 1.25 43.8 2.5


8digits
42

W* S1 S2 D The content of S1 is multiplied by 6.4 1 35.7 2


Binary

the content of S2. The result is


16bits 94 W* stored in D. The data are all
- - - - - - - - -
handled as binary number. 8 1.25 43.8 2.5
Multiply

4digits 182 W*P W*P S1 S2 D The content of S1 is multiplied by 6.4 1 35.7 2


D*P
BCD

the content of S2. The result is


stored in D. The data are all
- - - - - - - -
183 D*P handled as BCD. 8 1.25 43.8 2.5
8digits

W/ S1 S2 D The content of S1 is divided by 6.4 1 35.7 2


that of S2. The quotient is stored
Binary


16bits 175 W/ in D and the remainder stored in - - - - - - - -
D+1. The data are all handled as
binary number. 8 1.25 43.8 2.5
Divide

W/P S1 S2 D The content of S1 is divided by


4digits 185 W/P D/P
6.4 1 35.7 2
that of S2. The quotient is stored
BCD


in D and the remainder stored in - - - - - - -
D+1. The data are all handled as
8digits 186 D/P BCD. 8 1.25 43.8 2.5

S,D : register H : hexadecimal constant K : Decimal constant


Flag Execution time (µs)
Command V5E V58 V57 V56 V55 V54 V53 V52 V51 V50 PCk05 PCk06
Classification No. word
Symbol Function
Not Not
(DER) (CY) (BO) (HCY) (HBO) (Z) (>) (=) (<) (ER) Execution Execution
execution execution
After S content and constant H were
16bit 324 W+H W+H S H D added, the result is stored in D. Data are 2.4 0.4 2.4 0.4
Binary

all handled as binary value.


- - - - - - -
Constant addition

S content and constant H are added and the result


32bit 325 D+H D+H S H1 H2 is stored in the address next to S. The data are all 4.04 0.4
handled as binary number.

After S content and constant K were


W+HP
4 digits 327 W+HP S K D added, the result is stored in D. 23.8 0.4 23.8 0.4
BCD

The data are all handled as BCD.


- - - - - -
S content and constant K are added and
D+HP S K
8 digits 328 D+HP the result is stored in the address next to 58∼64 0.4 58∼64 0.4
S. The data are all handled as BCD.
After S content and constant H were
W-H S H D 3.2 0.4 3.2 0.4
16bit 330 W-H deducted, the result is stored in D. The
Binary

data are all handled as binary value.


Constant deduction

- - - - - - -
S content and constant H are deducted
D-H S H
32bit 331 D-H and the result is stored in D. The data 4.52 0.4
are all handled as binary number.
W-HP After S content and constant K were
S K D
4 digits 333 W-HP deducted, the result is stored in D. The 22.76 0.4 22.76 0.4
data are all handled as BCD.
BCD


- - - - - -
S content and constant K are deducted and the
8 digits 334 D-HP D+HP S K result is stored in the address next to S. The 55∼67 0.4 55∼67 0.4
Arithmetic computation

data are all handled as BCD.


5-43

After S content and constant H were


Binary

W*H S H D


336 W*H 4.6 0.4 4.6 0.4
multiplication

16bit multiplied, the result is stored in D. The - - - - - - - - -


Constant

data are all handled as binary value.

After S content and constant K were


BCD

W*HP S K D 39∼50 39∼50


4 digits 339 W*HP multiplied, the result is stored in D. The - - - - - - - - 0.4 0.4
data are all handled as BCD.

After S content and constant H were


Constant dividing

W/H
Binary

S H D divided, the result is stored in D and


28∼30 28∼30


16bit 342 W/H - - - - - - - - 0.4 0.4
remainder stored in next address. The
data are all handled as binary value.
After S content and constant K were
W/HP
BCD

S K D divided, the result is stored in D and


4 digits 345 W/HP - - - - - - - 56.92 0.4 56.92 0.4
remainder stored in next address. The
data are all handled as BCD.

WINC S D After +1 to the content of D, it is


16bit 63 WINC - - - - - - - 4.6 0.4 4.6 0.4
Increment

compared with the content of S1. The


Binary

data are handled as binary number.


After +1 to the content of D, it is
WINCP S D
39∼50 39∼50


4 digits 200 WINCP compared with the content of S1. The - - - - - - 0.4 0.4
data are handled as BCD.
-1 is deducted from the content of D.
WDEC D
28∼30 28∼30


0.4 0.4
Decrement

16bit 64 WDEC The data are all handled as binary - - - - - - - - -


number.
BCD

WDECP D -1 is deducted from the content of D.



4 digits 203 WDECP - - - - - - - - 56.92 0.4 56.92 0.4
The data are all handled as BCD.

S,D : Register , H : Hexadecimal constant K : decimal constant


Flag Execution time (µs)
Command V5E V58 V57 V56 V55 V54 V53 V52 V51 V50 PCk05 PCk06
Classification No. word
Symbol Function
Not Not
(DER) (CY) (BO) (HCY) (HBO) (Z) (>) (=) (<) (ER) Execution Execution
execution execution

Logical 16bits 187 WAND WAND S1 S2 D Logical product(AND) of S1 content 83.8 11.3 29.0 3.0
DAND


product and S2 content is determined. The - - - - - - - - -
(AND) result is stored in D.
32bits 188 DAND 88.5 11.2 31.3 3.0

16bits 189 WOR Logical sum (OR) of S1 content and 84.2 11.1 29.2 3.0
Logical sum WOR S1 S2 D


(OR) DOR S2 content is determined. The result - - - - - - - - -
is stored in D.
32bits 190 DOR 89.0 11.3 31.4 3.0

16bits 191 WNOT WNOT S D


The content of S is reversed (to 0 if 66.5 9.7 23.6 3.0
Reverse DNOT


(NOT)
each bit is 1 and to 1 if it is 0.). The - - - - - - - - -
result is stored in D.
32bits 192 DNOT 71.4 9.8 24.9 3.0

Exclusive 16bits 193 WXOR Exclusive logical sum (XOR) of S1 83.8 11.3 29.1 3.0
WXOR S1 S2 D


logical sum DXOR content and S2 content is determined. - - - - - - - - -
(XOR) The result is stored in D.
11.2 3.0
Logic calculation

32bits 194 DXOR 88.5 31.4

After logic product (AND) of S content


5-44

ANDH S H D
16bits 348 WANDH and constant H was computed, the 79.3 11.3 26.8 3.0
Constant result is stored in D.


logic - - - - - - -
- -
product After logic product(AND) of S content
32bits 349 DANDH DANDH H
and constant H was computed, the 84.2 11.4 28.1 3.0
S result is stored in address next to S.

WORH After logic sum (OR) of S content and


S H D
16bits 351 WORH constant H was computed, the result is 79.7 11.1 26.9 3.0
Constant stored in D.


logic - - - -
- - - - -
sum After logic sum (OR) of S content and
32bits 352 DORH DORH S H constant H was computed, the result is 84.6 11.2 28.2 3.0
stored in address next to S.

WXORH S H D After exclusive logic sum (XOR) of S


Constant 16bits 354 WXORH content and constant H was 79.3 11.3 26.5 3.0
computed, the result is stored in D.
exclusive


logic After exclusive logic sum (XOR) of S - - - - - - - - -
sum content and constant H was
32bits 355 DXORH DXORH S H
computed, the result is stored in
84.2 11.4 27.8 3.0
address next to S.

S,D : register H : hexadecimal constant K : Decimal constant


Flag Execution time (µs)
Command V5E V58 V57 V56 V55 V54 V53 V52 V51 V50 PCk05 PCk06
Classification No. word
Symbol Function
Not Not
(DER) (CY) (BO) (HCY) (HBO) (Z) (>) (=) (<) (ER) Execution Execution
execution execution

If an data matching S1 content exists


WSRH2 S1 S2 K
Search

in the area of data number designated


104.5 5.0


Data search 2 16bits 213 WSRH2 with K from the address of S2, - - - - - - - - -
CARRY FLAG is turned and the
position data is stored in S1+1 and the
matched data stored in S2
respectively.

4 digits ->
136.1 9.7 121.3 2.9


16bits 3 WBIN WBIN S D - - - - - - - -
BCD -> BCD data stored in S is converted to
Conversion to DBIN
binary data and, thereafter, stored in D.
binary data 8 digits ->
141 9.8 122.6 2.9


32bits 153 DBIN - - - - - - - -

16bits -> 4
220.2 9.6 116.3 2.9


digits 4 WBCD WBCD S D - - - - - - - - -
Binary ->
DBCD Binary data stored in S is converted to
Conversion to BCD data and, thereafter, stored in D.
BCD data 32bits -> 8
225.1 9.7 117.6 2.9


digits 155 DBCD - - - - - - - - -

Character and numeral data shown


Conversion

with K from the address of S are


JIS ->Conversion to binary deemed as JIS code and then stored 182.4+20x
10.7 44.8 3.0


156 JBIN JBIN S D K - - - - - - - - -
5-45

data in the area having D as its head K


address, after converted to binary
number.
The digit number shown with K from
the address of S is deemed as
Binary data -> Conversion to BJIS S D K 183.4+20x
10.7 44.8 3.0


157 BJIS hexadecimal number and the stored in - - - - - - - - -
JIS
the area having D as its head address, K
after converted to JIS code.
DECO S D The content of S is stored in D, after its
4 ->16 DECODER 50 DECO lower 4bit was decoded to - - - - - - - - - - 99.6 13.6 32.5 4.0
hexadecimal data.
ON bit position, of 16 bits in the S
content, is converted to binary data
176.1 24.7 89.9 6.9


16 ->4 DECODER 51 ENCO ENCO S D
(two or more ON bits; Priority is given - - - - - - - - -
to the lower bit.) and the converted
data is stored in lower 4 bits of D.

69.1 7.4 21.2 2.0


Comparison

16bits 12 WCP WCP S1 S2


- - - - - - -
Upon comparison of S1 content with S2
DCP content, either one of >, =, < FLAGS
Comparison is turned ON from the size relation
between the two.
84.4 7.6 22.1 2.0


32bits 211 DCP - - - - - - -
Bit operation

79.5 9.7 27.8 3.0


16bits 209 WSUM - - - - - - - - -
WSUM S D The sum of bits under ON, of bits in S
On bit counter DSUM content, is counted and the result is
stored in D.
82.9 9.7 28.2 3.0


32bits 210 DSUM - - - - - - - - -

S,D : register H : hexadecimal constant K : Decimal constant


Flag Execution time (µs)
Command V5E V58 V57 V56 V55 V54 V53 V52 V51 V50 PCk05 PCk06
Classification No. word
Symbol Function
Not Not
(DER) (CY) (BO) (HCY) (HBO) (Z) (>) (=) (<) (ER) Execution Execution
execution execution

8bits 217 SFR SFR S 250.5 33.7 25.67 9.8


S content is shifted by 1 bit to the right.
D WSFR The content entered in D is shifted to
1 bit right shift 16bits 36 WSFR DSFR most significant bit and the content of - - - - - - - - - - 455.3 33.7 32.87 9.8
least significant bit is shifted to CARRY
T FLAG.
32bits 218 DSFR 864.9 33.7 47.27 9.8

16bits 225 WBSFR WBSFR S K 80.6 10.7 29.5+0.1*K 2.9


S content is shifted by designated bit
n-bit right shift DBSFR number (K) to the right.
- - - - - - - - - -
32bits 226 DBSFR 85.5 10.8 30.8+0.1*K 2.9

8bits 219 SFL 250.5 33.7 25.67 9.8


SFL S S content is shifted by 1 bit to the left. the
D content entered in D is shifted to most
1 bit left shift 16bits 37 WSFL WSFL
significant bit and the content of least
- - - - - - - - - - 455.3 33.7 32.87 9.8
DSFL significant bit is shifted to CARRY FLAG
T
32bits 220 DSFL 864.9 33.7 47.27 9.8

16bits 228 WBSFL WBSFL S K 80.6 10.7 29.5+0.1*K 2.9


Shift

DBSFL S content is shifted by designated bit


n bit left shift number (K) to the left.
- - - - - - - - - -
32bits 229 DBSFL 85.5 10.8 30.8+0.1*K 2.9
5-46

4bits 251 SUP 153.4 3.0


Data in area with S on its head address
SUP S K
and with data number designated with K
8bits 252 UP2 UP2 153.4 3.0
Upper significant are shifted to upper significant direction.


shift
WUP The least significant data is 0. - - - - - - - - -
16bits 253 WUP DUP 153.4 3.0

32bits 254 DUP 153.4 3.0

4bits 255 SDOWN 153.3 3.0


SDOWN S K
DOWN
8bits 256 DOWN Data in area with S on its head address 153.3 3.0
Lower significant WDOWN and with data number designated with K


shift DDOWN are shifted to lower significant direction.
- - - - - - - - -
16bits 257 WDOWN Most significant data is 0. 153.3 3.0

32bits 258 DDOWN 153.3 3.0

DRR S K
Rotate to right S content is rotated to the right, by the bit
32bits 244 DRR - - - - - - - - - - 35.3 3.0
without carry number designated with K.
Rotate

Rotate to left DRL S K S content is rotated to the left, by the bit


32bits 247 DRL - - - - - - - - - - 35.1 3.0
without carry number designated with K.

S,D : register H : hexadecimal constant K : Decimal constant


Flag Execution time (µs)
Command V5E V58 V57 V56 V55 V54 V53 V52 V51 V50 PCk05 PCk06
Classification No. word
Symbol Function
Not Not
(DER) (CY) (BO) (HCY) (HBO) (Z) (>) (=) (<) (ER) Execution Execution
execution execution

JMP Ln
Jump 272 JMP Jumped into label No. Ln. - - - - - - - - - - 5.1 4.8

Sub routine of label No. Sn is executed and


Sub-routine call 273 CALL CALL Sn steps following this command example are - - - - - - - - - - 27.5 14.8 27.5 14.8
executed.

After termination of subroutine, the steps


Return from sub routine 464 RET RET following the CALL command which called - - - - - - - - - - 21.2 21.2 21.2 21.2
Program branching

applicable subroutine are executed.

Subroutine is closed when the conditions


CRET are met, and applicable subroutine is called
Conditional return 285 CRET - - - - - - - - - - 25.7 12.1 25.7 12.1
and executed from step next to CALL
command.

This command - NEXT command are


Repeating start 472 FOR FOR K repeated K times. - - - - - - - - - - 127.9 16.5 126.6 14.5

This command - NEXT command are


5-47

FORN S repeated by the frequency shown with S


Repeating start (indirect) 476 FORN - - - - - - - - - - 127.9 16.5 126.6 14.5
content. -1 is deducted from S content
whenever executed.

Program from FOR and FORN commands


NEXT up to this command is repeated by the
Repeating end 480 NEXT - - - - - - - - - - 64.4 64.4 64.4 64.4
frequency designated with FOR, FORN
commands.

START
Program start 448 START Indicating start-up of sequence program. - - - - - - - - - -

END
Program end 452 END Indicating end of main sequence program. - - - - - - - - - -
Label

PEND Indicating end of sequence program


Program end 456 PEND - - - - - - - - - - - - - -
including subroutine.

LABEL Ln Indicating division and jump of sequence


Label 460 LABEL - - - - - - - - - - 5.7 -
program .

S,D : register H : hexadecimal constant K : Decimal constant


Flag Execution time (µs)
Command V5E V58 V57 V56 V55 V54 V53 V52 V51 V50 PCk05 PCk06
Classification No. word
Symbol Function
Not Not
(DER) (CY) (BO) (HCY) (HBO) (Z) (>) (=) (<) (ER) Execution Execution
execution execution

DI
Interrupt inhibit 276 DI Inhibits sequence interrupt - - - - - - - - - - 9.4 2.3 9.4 2.3
Sequential interrupt

EI
Interrupt enable 277 EI Permits sequence interrupt - - - - - - - - - - 24.2 2.7 24.2 2.7

Return from
interrupt RETI
468 RETI Indicating end of the interrupt program - - - - - - - - - - 6.6 - 6.6 -
processing
routine

MC K Output command of the master control range from SET up


Set 440 MC - - - - - - - - - - 35.2 35.2 35.2 35.2
Master control

MCR to RESET is controlled . Normally controlled if MO


command input is ON and all OFF if the same command
input is OFF.
5-48

Reset 444 MCR - - - - - - - - - - 30.9 30.9 30.9 30.9


Special module

Special module SPR S1 S2 S3


304 SPR Directly reads internal memory of serial I/O module. - - - - - - - - - - 982.1 15.5 886 7.4
byte data read

Special module SPW S1 S2 S3


306 SPW Directly write data in internal memory of serial I/O module. - - - - - - - - - - 1744 15.5 1648 7.4
byte data write

STOP
Program stop 287 STOP Run of sequence program is stopped. - - - - - - - - - - 10 1.1 10 1.1
Others

WDR
Scan time reset 46 WDR The scan time monitor timer is reset. - - - - - - - - - - 5.9 2.2 5.9 2.2

S,D : register H : hexadecimal constant K : Decimal constant


5.4.1. Transfer instructions

Transfer instruction is used to store numeric data into register or to transfer data between registers.
Transfer instructions are classified as follows.

Constant transfer…….Stores numeric data into register.

Register to register……Transfers one piece of data from register to register


transfer.

Block transfer…………..Transfers packages of data from register to register

Data exchange…………Exchanges data between registers.

JIS code storage……….Stores character data into register.

Data fill…………………..Stores the same data into successive register locations.

5-49
1. WMOV 4-digit Hex constant transfer (FUN101)

(1) Usable devices

M
X Y K V T C L P D N S Constant
PCk05 000 - 0FF 400 - 4FF
OP1 ○
OP2 ○ ○ ○ ○ ○ ○ ○ ○

M
X Y K V T C L P D N S Constant
PCk06 000 - 1FF 400 - 4FF
OP1 ○
OP2 ○ ○ ○ ○ ○ ○ ○ ○

(2) Number of steps 2

(3) Symbol

(4) Function
Stores a hexadecimal constant into the register. The available constants are 0 to FFFF for
WMOV.

(5) Flag
No change

(6) Example of program

Transfers "AAAA",(hex) to Y410-Y41F after the OFF to ON transition of X001.

5-50
2. DMOV 8-digit Hex constant transfer (FUN102)

(1) Usable devices

M
X Y K V T C L P D N S Constant
PCk05 000 - 0FE 400 - 4FE
OP1 ○
OP2 ○ ○ ○ ○ ○ ○ ○

M
X Y K V T C L P D N S Constant
PCk06 000 - 1FE 400 - 4FE
OP1 ○
OP2 ○ ○ ○ ○ ○ ○ ○

(2) Number of steps 3

(3) Symbol

(4) Function
Stores a hexadecimal constant into the register. The available constants are 0 to FFFFFFFF
for DMOV.

(5) Flag
No change

(6) Example of program

Transfers "FEDCBA98" (hex) to data register D0003 and D0002 when K000 is ON.

5-51
3. WMOVT 4-digit Hex constant transfer to two places (FUN 110)

(1) Usable devices

M
X Y K V T C L P D N S Constant
PCk05 000 - 0FE 400 - 4FE
OP1 ○
OP2 ○ ○ ○ ○ ○ ○ ○ ○

M
X Y K V T C L P D N S Constant
PCk06 000 - 1FE 400 - 4FE
OP1 ○
OP2 ○ ○ ○ ○ ○ ○ ○ ○

(2) Number of steps 3

(3) Symbol

(4) Function
Stores the same Hex constant into two registers, the available constants are 0 to FFFF for
WOVT instruction.

(5) Flag
No change

(6) Example of program


Transfers "1234" (hex) to data register D0000 and D0100 after the OFF to ON transition of
X001.

5-52
4. WMOVE 2-byte data direct transfer (FUN0)

(1) Usable devices

M
X Y K V T C L P D N S Constant
PCk05 000 - 0FF 400 - 4FF
OP1 ○ ○ ○ ○ ○ ○ ○ ○ ○ ○
OP2 ○ ○ ○ ○ ○ ○ ○ ○

M
X Y K V T C L P D N S Constant
PCk06 000 - 1FF 400 - 4FF
OP1 ○ ○ ○ ○ ○ ○ ○ ○ ○ ○
OP2 ○ ○ ○ ○ ○ ○ ○ ○

(2) Number of steps 2

(3) Symbol

(4) Function
Transfers data from OP1 register to OP2register, leaving OP1 register data intact.

(5) Flag
No change

(6) Example of program


Transfers the data in data register D0123 to Y420-Y42F after the OFF to ON transition of
X001.

5-53
5. DMOVE 4-byte data direct transfer (FUN111)

(1) Usable devices

M
X Y K V T C L P D N S Constant
PCk05 000 - 0FE 400 - 4FE
OP1 ○ ○ ○ ○ ○ ○ ○ ○ ○
OP2 ○ ○ ○ ○ ○ ○ ○

M
X Y K V T C L P D N S Constant
PCk06 000 - 1FE 400 - 4FE
OP1 ○ ○ ○ ○ ○ ○ ○ ○ ○ ○
OP2 ○ ○ ○ ○ ○ ○ ○

(2) Number of steps 2

(3) Symbol

(4) Function
Transfers data from OP1 register to OP2register, leaving OP1 register data intact.

(5) Flag
No change

(6) Example of program


Transfers the 32-bit data in data register D0001 and D0000 to D0101 and D0100 if K000 is
ON.

5-54
6. WBMOV Word data block transfer (FUN119)

(1) Usable devices

M
X Y K V T C L P D N S Constant
000 - 0FF 400 - 4FF

PCk05 OP1 ○ ○
OP2 ○ ○ ○ ○ ○ ○ ○ ○ ○
OP3 ○

M
X Y K V T C L P D N S Constant
000 - 1FF 400 - 4FF

PCk06 OP1 ○ ○
OP2 ○ ○ ○ ○ ○ ○ ○ ○ ○
OP3 ○

(2) Number of steps 3

(3) Symbol

(4) Function
Transfers data in OP1 and subsequent registers to locations covered by OP2 and subsequent
registers with the number of data being specified by OP3. The maximum transferred data is
1024 words for WBMOV.

(5) Flag

V50 Error flag(ER): Is set when the transfer source and destination are outside of the data
memory area or when the transferred data exceeds the specified value.

(6) Example of program


Transfers 10 words of data from D0000 to the locations starting at D1000, when M000is ON.

5-55
7. WXCH 16-bit data exchange(FUN2)

(1) Usable devices

M
X Y K V T C L P D N S Constant
000 - 0FF 400 - 4FF

PCk05 OP1 ○ ○ ○ ○ ○ ○ ○ ○
OP2 ○ ○ ○ ○ ○ ○ ○ ○

M
X Y K V T C L P D N S Constant
000 - 1FF 400 - 4FF

PCk06 OP1 ○ ○ ○ ○ ○ ○ ○ ○
OP2 ○ ○ ○ ○ ○ ○ ○ ○

(2) Number of steps 5

(3) Symbol

(4) Function
Swaps the contents of OP1 register and those in OP2.

(5) Flag
No change

(6) Example of program


Exchanges the current value of the timer T010(content of the current value register N010) with
the content of D0010 after the OFF to ON transition of X000.

5-56
8. DXCH 32-bit data exchange(FUN133)

(1) Usable devices

M
X Y K V T C L P D N S Constant
000 - 0FE 400 - 4FE

PCk05 OP1 ○ ○ ○ ○ ○ ○ ○
OP2 ○ ○ ○ ○ ○ ○ ○

M
X Y K V T C L P D N S Constant
000 - 1FE 400 - 4FE

PCk06 OP1 ○ ○ ○ ○ ○ ○ ○
OP2 ○ ○ ○ ○ ○ ○ ○

(2) Number of steps 5

(3) Symbol

(4) Function
Swaps the contents of OP1 register and those in OP2.

(5) Flag
No change

(6) Example of program


Exchanges the contents of D0001 and D0000 with the contents of D0003 and D0002 after the
OFF to ON transition of Y400.

5-57
9. WBXCH Word data block exchange (FUN 135) PCk06

(1) Usable devices

M
X Y K V T C L P D N S Constant
000 - 1FF 400 - 4FF

PCk06 OP1 ○ ○
OP2 ○ ○ ○ ○ ○ ○ ○ ○ ○
OP3 ○

(2) Number of steps 4

(3) Symbol

(4) Function
Swaps data stored in the locations starting at OP1 address with the data in the locations
starting at OP2 address. The number of piece of data to be swapped is up to 256 each and
specified by OP3.

(5) Flag

V50 Error flag(ER) : Is set if the locations to be exchanged are outside of the data memory
area.

(6) Example of program


Exchanges the current values of counters C100-C104 (contents of current value register
N100ON104)with the contents of D0100-D0104.

5-58
10. WFIL Word data fill (FUN 129) PCk06

(1) Usable devices

M
X Y K V T C L P D N S Constant
000 - 1FF 400 - 4FF

PCk06 OP1 ○
OP2 ○ ○
OP3 ○

(2) Number of steps 4

(3) Symbol

(4) Function
Stores the Hex constant to the location starting at the address specified by content of OP2
and has the number of data specified by OP3.
The length of the location is 1024 data at maximum.

(5) Flag

V50 Error flag(ER) : Is set when the transfer destination is outside of the data memory.

(6) Example of program


Fills all 384 words, N000-N17F, of the current value register with "0" when X000 is ON.

5-59
5.4.2. Arithmetic operations

Instructions which carry out arithmetic operation on contents of registers are divided into the
following four.

Addition................Adds data of register to another register and stores the result into another
register.

Subtraction...........Subtracts data of register from another register and stores the result into
another register.

Multiplication........Multiplies data of register with another register and stores the result into
another register.

Division................Divides data of register by data of another register and stores the register
into another register.

5-60
11. W+ Word data binary addition (FUN 92)

(1) Usable devices

M
X Y K V T C L P D N S Constant
0W - 0FW 40 W- 4FW

PCk05 OP1 ○ ○ ○ ○ ○ ○ ○ ○ ○ ○
OP2 ○ ○ ○ ○ ○ ○ ○ ○ ○ ○
OP3 ○ ○ ○ ○ ○ ○ ○ ○

M
X Y K V T C L P D N S Constant
0W - 1FW 40W - 4FW

PCk06 OP1 ○ ○ ○ ○ ○ ○ ○ ○ ○ ○
OP2 ○ ○ ○ ○ ○ ○ ○ ○ ○ ○
OP3 ○ ○ ○ ○ ○ ○ ○ ○

(2) Number of steps 3

(3) Symbol

(4) Function
Adds the content of OP1 register to that of OP2 and stores the result to OP3 register. All data
is processed as unsigned binary numbers.

(5) Flag

V58 Carry flag(CY) : Is set when carrying is generated from bit 31 as a result of addition.
V56 Half carry flag(HCY) : Is set when carrying is generated from bit 15 aiming at bit 16 as a
result of addition.
V54 Zero flag(Z) : Is set when add operation results in 0.

(6) Example of program


When X001 is ON, adds the current value of counter C100 (content of N100) to the current
value of counter C001 (content of N001) and stores the result into D0234.

5-61
12. D+ 32-bit data binary addition (FUN 169) PCk06

(1) Usable devices

M
X Y K V T C L P D N S Constant
0W – 1EW 40W – 4EW

PCk06 OP1 ○ ○ ○ ○ ○ ○ ○ ○ ○
OP2 ○ ○ ○ ○ ○ ○ ○ ○ ○
OP3 ○ ○ ○ ○ ○ ○ ○

(2) Number of steps 3

(3) Symbol

D+

(4) Function
Adds the content of OP1 register to that of OP2 and stores the result to OP3 register. All data
is processed as unsigned binary numbers.

(5) Flag

V58 Carry flag(CY) : Is set when carrying is generated from bit 31 as a result of addition.
V56 Half carry flag(HCY) : Is set when carrying is generated from bit 15 aiming at bit 16 as a
result of addition.
V54 Zero flag(Z) : Is set when add operation results in 0.

(6) Example of program


When M000 turns ON from OFF, adds the contents of D0149 and D0148 to the contents of
D014B and D014A and stores the result into D014D and D014C.

5-62
13. W+P 4-digit BCD addition (FUN 10)

(1) Usable devices

M
X Y K V T C L P D N S Constant
0W - 0FW 40W - 4FW

PCk05 OP1 ○ ○ ○ ○ ○ ○ ○ ○ ○ ○
OP2 ○ ○ ○ ○ ○ ○ ○ ○ ○ ○
OP3 ○ ○ ○ ○ ○ ○ ○ ○

M
X Y K V T C L P D N S Constant
0W - 1FW 40W - 4FW

PCk06 OP1 ○ ○ ○ ○ ○ ○ ○ ○ ○ ○
OP2 ○ ○ ○ ○ ○ ○ ○ ○ ○ ○
OP3 ○ ○ ○ ○ ○ ○ ○ ○

(2) Number of steps 3

(3) Symbol

(4) Function
Adds the content of OP1 register to that of OP2 register, both as BCD codes, and stores the
resultant BCD codes into OP3 register.

(5) Flag

V58 Carry flag(CY) : Is set when carrying is generated from bit 31 as a result of addition.
V56 Half carry flag(HCY) : Is set when carrying is generated from bit 15 aiming at bit 16 as a
result of addition.
V54 Zero flag(Z) : Is set when add operation results in 0.
V5E Data error flag(DER) : Is set if content of OP1 register or OP2 register is not in BCD
format

(6) Example of program


When X410 is ON, adds BCD 4-digit data stored in D0123 to that of D0234 and outputs the
result into Y400-Y40F.

5-63
14. D+P 8-digit BCD addition (FUN 178)

(1) Usable devices

M
X Y K V T C L P D N S Constant
0W – 0EW 40W – 4EW

PCk05 OP1 ○ ○ ○ ○ ○ ○ ○ ○ ○
OP2 ○ ○ ○ ○ ○ ○ ○ ○ ○
OP3 ○ ○ ○ ○ ○ ○ ○

M
X Y K V T C L P D N S Constant
0W - 1EW 40W - 4EW

PCk06 OP1 ○ ○ ○ ○ ○ ○ ○ ○ ○
OP2 ○ ○ ○ ○ ○ ○ ○ ○ ○
OP3 ○ ○ ○ ○ ○ ○ ○

(2) Number of steps 3

(3) Symbol

(4) Function
Adds the content of OP1 register to that of OP2 register, both as BCD codes, and stores the
resultant BCD codes into OP3 register.

(5) Flag

V58 Carry flag(CY) : Is set when carrying is generated from bit 31 as a result of addition.
V56 Half carry flag(HCY) : Is set when carrying is generated from bit 15 aiming at bit 16 as a
result of addition.
V54 Zero flag(Z) : Is set when add operation results in 0.
V5E Data error flag(DER) : Is set if content of OP1 register or OP2 register is not in BCD
format

(6) Example of program


When M000 changes from OFF to ON, adds BCD 8-digit data stored in D0149 and D0148 to
that of D014B and D014A and stores the result into D014D and D014C.

5-64
15. W- Word data binary subtraction (FUN 93)

(1) Usable devices

M
X Y K V T C L P D N S Constant
0W - 0FW 40W - 4FW

PCk05 OP1 ○ ○ ○ ○ ○ ○ ○ ○ ○ ○
OP2 ○ ○ ○ ○ ○ ○ ○ ○ ○ ○
OP3 ○ ○ ○ ○ ○ ○ ○ ○

M
X Y K V T C L P D N S Constant
0W - 1FW 40W - 4FW

PCk06 OP1 ○ ○ ○ ○ ○ ○ ○ ○ ○ ○
OP2 ○ ○ ○ ○ ○ ○ ○ ○ ○ ○
OP3 ○ ○ ○ ○ ○ ○ ○ ○

(2) Number of steps 3

(3) Symbol

(4) Function
Subtracts the content of OP2 register from that of OP1 register and stores the result into OP3
register. All data in unsigned binary format.

(5) Flag

V57 Borrow flag(BO) :


Is set when the digit lowering to bit 31 is generated as a result of the
subtraction.
V55 Half borrow flag(HBO) : Is set when the digit lowering is generated from bit 16 aiming at
bit 15 as a result of the subtraction.
V54 Zero flag(Z) : Is set when subtract operation results in 0.

(6) Example of program


When X001 is ON, subtracts the current value of counter C100 (content of N100) from the
current value of counter C100 (content of N100) and stores the result into D0234.

5-65
16. D- 32-bit data binary subtraction (FUN 171) PCk06

(1) Usable devices

M
X Y K V T C L P D N S Constant
0W - 1EW 40W - 4EW

PCk06 OP1 ○ ○ ○ ○ ○ ○ ○ ○ ○
OP2 ○ ○ ○ ○ ○ ○ ○ ○ ○
OP3 ○ ○ ○ ○ ○ ○ ○

(2) Number of steps 3

(3) Symbol

(4) Function
Subtracts the content of OP2 register from that of OP1 register and stores the result into OP3
register. All data in binary format.

(5) Flag

V57 Borrow flag(BO) :


Is set when the digit lowering to bit 31 is generated as a result of the
subtraction.
V55 Half borrow flag(HBO) : Is set when the digit lowering is generated from bit 16 aiming at
bit 15 as a result of the subtraction.
V54 Zero flag(Z) : Is set when subtract operation results in 0.

(6) Example of program


When M000 turns ON from OFF, subtracts the contents of D014B and D014A from the
contents of D0149 and D0148 and stores the result into D014D and D014C.

5-66
17. W-P 4-digit BCD subtraction (FUN 11)

(1) Usable devices

M
X Y K V T C L P D N S Constant
0W - 0FW 40W - 4FW

PCk05 OP1 ○ ○ ○ ○ ○ ○ ○ ○ ○ ○
OP2 ○ ○ ○ ○ ○ ○ ○ ○ ○ ○
OP3 ○ ○ ○ ○ ○ ○ ○ ○

M
X Y K V T C L P D N S Constant
0W - 1FW 40W - 4FW

PCk06 OP1 ○ ○ ○ ○ ○ ○ ○ ○ ○ ○
OP2 ○ ○ ○ ○ ○ ○ ○ ○ ○ ○
OP3 ○ ○ ○ ○ ○ ○ ○ ○

(2) Number of steps 3

(3) Symbol

(4) Function
Subtracts the content(BCD code)of OP2register from that(BCD code)of OP1 register and
stores the result into OP3register in BCD code.

(5) Flag

V57 Borrow flag(BO) :


Is set when the digit lowering to bit 31 is generated as a result of the
subtraction.
V55 Half borrow flag(HBO) : Is set when the digit lowering is generated from bit 16 aiming at
bit 15 as a result of the subtraction.
V54 Zero flag(Z) : Is set when subtract operation results in 0.
V5E Data error flag(DER) : Is set if content of OP1 register or OP2 register is not in BCD
format

(6) Example of program


When Y410 is ON, subtracts BCD 4-digit data stored in D0234 from that of D0123 and outputs
the result to Y420-Y42F.

5-67
18. D-P 8-digit BCD subtraction (FUN 180)

(1) Usable devices

M
X Y K V T C L P D N S Constant
0W – 0EW 40W - 4EW

PCk05 OP1 ○ ○ ○ ○ ○ ○ ○ ○ ○
OP2 ○ ○ ○ ○ ○ ○ ○ ○ ○
OP3 ○ ○ ○ ○ ○ ○ ○

M
X Y K V T C L P D N S Constant
0W - 1EW 40W - 4EW

PCk06 OP1 ○ ○ ○ ○ ○ ○ ○ ○ ○
OP2 ○ ○ ○ ○ ○ ○ ○ ○ ○
OP3 ○ ○ ○ ○ ○ ○ ○

(2) Number of steps 3

(3) Symbol

(4) Function
Subtracts the content(BCD code)of OP2register from that(BCD code)of OP1 register and
stores the result into OP3register in BCD code.

(5) Flag

V57 Borrow flag(BO) :


Is set when the digit lowering to bit 31 is generated as a result of the
subtraction.
V55 Half borrow flag(HBO) : Is set when the digit lowering is generated from bit 16 aiming at
bit 15 as a result of the subtraction.
V54 Zero flag(Z) : Is set when subtract operation results in 0.
V5E Data error flag(DER) : Is set if content of OP1 register or OP2 register is not in BCD
format

(6) Example of program


When M000 changes from OFF to ON, subtracts BCD8-digit data stored in D014B and D014A
from that of D0149 and D0148 and stores the result into D014D and D014C.

5-68
19. W* Word data binary multiplication (FUN 94)

(1) Usable devices

M
X Y K V T C L P D N S Constant
0W - 0FW 40W - 4FW

PCk05 OP1 ○ ○ ○ ○ ○ ○ ○ ○ ○ ○
OP2 ○ ○ ○ ○ ○ ○ ○ ○ ○ ○


OP3 ○ ○ ○ ○ ○ ○
0W -0EW

M
X Y K V T C L P D N S Constant
0W - 1FW 40W - 4FW

PCk06 OP1 ○ ○ ○ ○ ○ ○ ○ ○ ○ ○
OP2 ○ ○ ○ ○ ○ ○ ○ ○ ○ ○


OP3 ○ ○ ○ ○ ○ ○
0W - 1EW

(2) Number of steps 3

(3) Symbol

(4) Function
Multiplies contents of OP1 and OP2 registers and stores the result into OP3 register. All data
handled as unsigned binary numbers.

(5) Flag

V54 Zero flag(Z) : Is set when multiply operation results in 0.

(6) Example of program


When X001 is ON, multiplies the current value(content of N100)of counter C100 with the
current value(content of N101)of C101 and stores the result into D0234 and D0235.

5-69
20. W*P 4-digit BCD multiplication (FUN 182)

(1) Usable devices

M
X Y K V T C L P D N S Constant
0W - 0FW 40W - 4FW

PCk05 OP1 ○ ○ ○ ○ ○ ○ ○ ○ ○ ○
OP2 ○ ○ ○ ○ ○ ○ ○ ○ ○ ○


OP3 ○ ○ ○ ○ ○ ○
0W - 0EW

M
X Y K V T C L P D N S Constant
0W - 1FW 40W - 4FW

PCk06 OP1 ○ ○ ○ ○ ○ ○ ○ ○ ○ ○ ○
OP2 ○ ○ ○ ○ ○ ○ ○ ○ ○ ○ ○


OP3 ○ ○ ○ ○ ○ ○
0W - 1EW

(2) Number of steps 3

(3) Symbol

(4) Function
Multiplies the contents of OP1 and OP2 registers as BCD code and stores the resultant BCD
code into OP3 register.

(5) Flag

V54 Zero flag(Z) : Is set when multiply operation results in 0.


V5E Data error flag(DER) : Is set when the content of OP1 register or OP2 register is not in
BCD format.

(6) Example of program


When Y410 is ON, multiplies BCD 4-digit data stored in D0123 with that in D0234 and outputs
the result to Y420-Y42F.

5-70
21. D*P 8-digit BCD multiplication (FUN 183)

(1) Usable devices

M
X Y K V T C L P D N S Constant
0W - 0EW 40W - 4EW

PCk05 OP1 ○ ○ ○ ○ ○ ○ ○ ○ ○
OP2 ○ ○ ○ ○ ○ ○ ○ ○ ○


OP3 ○ ○ ○ ○ ○ ○
0W - 0CW

M
X Y K V T C L P D N S Constant
0W - 1EW 40W - 4EW

PCk06 OP1 ○ ○ ○ ○ ○ ○ ○ ○ ○
OP2 ○ ○ ○ ○ ○ ○ ○ ○ ○


OP3 ○ ○ ○ ○ ○ ○
0 W- 1CW

(2) Number of steps 6

(3) Symbol

(4) Function
Multiplies the contents of OP1 and OP2 registers as BCD code and stores the resultant BCD
code into OP3 register.

(5) Flag

V54 Zero flag(Z) : Is set when multiply operation results in 0.


V5E Data error flag(DER) : Is set when the content of OP1 register or OP2 register is not in
BCD format.

(6) Example of program

When M000 turns ON from OFF, multiplies BCD 8-digit data stored in D0149 and D0148 with
that in D014B and D014A and stores the result into D014D and D014C, and D014F and
D014E.

5-71
22. W/ Word data binary division 2 (FUN 175)

(1) Usable devices

M
X Y K V T C L P D N S Constant
0W - 0FW 40W - 4FW

PCk05 OP1 ○ ○ ○ ○ ○ ○ ○ ○ ○ ○
OP2 ○ ○ ○ ○ ○ ○ ○ ○ ○ ○


OP3 ○ ○ ○ ○ ○ ○
0W -0EW

M
X Y K V T C L P D N S Constant
0W - 1FW 40W - 4FW

PCk06 OP1 ○ ○ ○ ○ ○ ○ ○ ○ ○ ○
OP2 ○ ○ ○ ○ ○ ○ ○ ○ ○ ○


OP3 ○ ○ ○ ○ ○ ○
0W - 1EW

(2) Number of steps 5

(3) Symbol

(4) Function
Divides the content of OP1 register by that of OP2 register and stores the quotient into OP3
register and the remainder into the register at the address following that of OP3.

(5) Flag

V54 Zero flag(Z) : Is set when divide operation results in 0.


V50 Error flag(ER) : Is set when the content of OP2 register is 0.

(6) Example of program


When X001 is ON, divides the current value of counter C100 (content of N100) by the current
value of counter C101 (content of N101) and stores the quotient into D0234 and the remainder
into D0235.

5-72
23. W/P 4-digit BCD division (FUN 185)

(1) Usable devices

M
X Y K V T C L P D N S Constant
0W - 0FW 40W - 4FW

PCk05 OP1 ○ ○ ○ ○ ○ ○ ○ ○ ○ ○
OP2 ○ ○ ○ ○ ○ ○ ○ ○ ○ ○


OP3 ○ ○ ○ ○ ○ ○
0W - 0EW

M
X Y K V T C L P D N S Constant
0W - 1FW 40W - 4FW

PCk06 OP1 ○ ○ ○ ○ ○ ○ ○ ○ ○ ○
OP2 ○ ○ ○ ○ ○ ○ ○ ○ ○ ○


OP3 ○ ○ ○ ○ ○ ○
0W - 1EW

(2) Number of steps 5

(3) Symbol

(4) Function
Divides the content of OP1 register(BCD code) by the content of OP2 register (BCD code) and
stores the quotient into OP3 register and the remainder into the register at the address
following that of OP3.

(5) Flag

V54 Zero flag(Z) : Is set when divide operation results in 0.


V50 Error flag(ER) : Is set when the content of OP2 register is 0.
V5E Data error flag(DER) : Is set when the content of OP1 register or OP2 register is not in
BCD format.

(6) Example of program


When X000 is ON, divides. BCD4-digit data stored in D0224 by BCD4-digit data stored in
D0225 and outputs the quotient to Y400-Y40F and the remainder to Y410-Y41F.

5-73
24. D/P 8-digit BCD division (FUN 186)

(1) Usable devices

M
X Y K V T C L P D N S Constant
0W - 0EW 40W - 4EW

PCk05 OP1 ○ ○ ○ ○ ○ ○ ○ ○ ○
OP2 ○ ○ ○ ○ ○ ○ ○ ○ ○


OP3 ○ ○ ○ ○ ○ ○
0W - 0CW

M
X Y K V T C L P D N S Constant
0W - 1EW 40W - 4EW

PCk06 OP1 ○ ○ ○ ○ ○ ○ ○ ○ ○
OP2 ○ ○ ○ ○ ○ ○ ○ ○ ○


OP3 ○ ○ ○ ○ ○ ○
0 W- 1CW

(2) Number of steps 6

(3) Symbol

(4) Function
Divides the content of OP1 register(BCD code) by the content of OP2 register (BCD code) and
stores the quotient into OP3 register and the remainder into the register at the address
following that of OP3.

(5) Flag

V54 Zero flag(Z) : Is set when divide operation results in 0.


V50 Error flag(ER) : Is set when the content of OP2 register is 0.
V5E Data error flag(DER) : Is set when the content of OP1 register or OP2 register is not in
BCD format.

(6) Example of program


When M000 turns ON from OFF, BCD8-digit data stored in D0228 and D0227 by BCD 8-digit
data stored in D022A and D0229 and stores the quotient into D022C and D022B and the
remainder into D022E and D022D.

5-74
25. W+H Addition of hexadecimal 4-digit constant (FUN 324)

(1) Usable devices

M
X Y K V T C L P D N S Constant
0W - 0FW 40 W- 4FW

PCk05 OP1 ○ ○ ○ ○ ○ ○ ○ ○ ○ ○
OP2 ○
OP3 ○ ○ ○ ○ ○ ○ ○ ○

M
X Y K V T C L P D N S Constant
0W - 1FW 40W - 4FW

PCk06 OP1 ○ ○ ○ ○ ○ ○ ○ ○ ○ ○
OP2 ○
OP3 ○ ○ ○ ○ ○ ○ ○ ○

(2) Number of steps 3

(3) Symbol

(4) Function
Adds the register content of OP1 and hexadecimal number and stores the result in the register
of OP3. The range of constants is 0 ~ FFFF.

(5) Flag

V58 Carry flag(CY) : Is set when carrying is generated from bit 31 as a result of addition.
V56 Half carry flag(HCY) : Is set when carrying is generated from bit 15 aiming at bit 16 as a result
of addition.
V54 Zero flag(Z) : Is set when add operation results in 0.

(6) Program (EX.)


Program to adds hexadecimal "AB12" from the contents of D0100, when X001 is ON, and to
store the result in D0234.

5-75
26. D+H Addition of hexadecimal 8-digit constant (FUN 325) PCk06

(1) Usable devices

M
X Y K V T C L P D N S Constant
0W – 1CW 40W – 4CW

PCk06 OP1 ○ ○ ○ ○ ○ ○ ○
OP2 ○

(2) Number of steps 4

(3) Symbol

(4) Function
Adds the register content of OP1 and hexadecimal number and stores the result in the register
of address wherein 2 is added to the address of OP1. The range of constants is 0 ~
FFFFFFFF.

(5) Flag

V58 Carry flag(CY) : Is set when carrying is generated from bit 31 as a result of addition.
V56 Half carry flag(HCY) : Is set when carrying is generated from bit 15 aiming at bit 16 as a result
of addition.
V54 Zero flag(Z) : Is set when add operation results in 0.

(6) Program (EX.)


Program to add the contents of D0149, D0148 and hexadecimal "FEDCBA98" and to store the
result in D014B, D014A respectively.

5-76
27. W+HP Addition of BCD 4-digit constant (FUN 327)
(1) Usable devices

M
X Y K V T C L P D N S Constant
0W - 0FW 40 W- 4FW

PCk05 OP1 ○ ○ ○ ○ ○ ○ ○ ○ ○ ○
OP2 ○
OP3 ○ ○ ○ ○ ○ ○ ○ ○

M
X Y K V T C L P D N S Constant
0W - 1FW 40W - 4FW

PCk06 OP1 ○ ○ ○ ○ ○ ○ ○ ○ ○ ○
OP2 ○
OP3 ○ ○ ○ ○ ○ ○ ○ ○

(2) Number of steps 4

(3) Symbol

(4) Function
Deeming register content of OP1 as BCD code, adds it together with BCD constant and stores
the result in the register of OP3. The range of constants is 0 ~ 9999.

(5) Flag

V58 Carry flag(CY) : Is set when carrying is generated from bit 31 as a result of addition.
V56 Half carry flag(HCY) : Is set when carrying is generated from bit 15 aiming at bit 16 as a result
of addition.
V54 Zero flag(Z) : Is set when add operation results in 0.
V5E Data error flag(DER) : Is set if content of OP1 register is not in BCD format.

(6) Program (EX.)


Program to add the BCD 4-digit data stored in D0123, when X010 is ON, and "3456" of BCD
and to output the result to Y400 ~ Y40F.

5-77
28. D+HP Addition of BCD 8-digit constant (FUN 328)

(1) Usable devices

M
X Y K V T C L P D N S Constant
0W – 0EW 40W – 4EW

PCk05 OP1 ○ ○ ○ ○ ○ ○ ○
OP2 ○

M
X Y K V T C L P D N S Constant
0W - 1EW 40W - 4EW

PCk06 OP1 ○ ○ ○ ○ ○ ○ ○
OP2 ○

(2) Number of steps 4

(3) Symbol

(4) Function
Deeming register content of OP1 as BCD code, adds it together with BCD constant and stores
the result in the register of address wherein 2 is added to the address of OP1. The range of
constants is 0 ~ 99999999.

(5) Flag

V58 Carry flag(CY) : Is set when carrying is generated from bit 31 as a result of addition.
V56 Half carry flag(HCY) : Is set when carrying is generated from bit 15 aiming at bit 16 as a result
of addition.
V54 Zero flag(Z) : Is set when add operation results in 0.
V5E Data error flag(DER) : Is set if content of OP1 register is not in BCD format.

(6) Program (EX.)


Program to add BCD 8-digit data stored in D0149, D148, when M000 turned ON from OFF, and
"12345678" of BCD, and to store the result in D014B and D014A respectively.

5-78
29. W-H Subtraction of hexadecimal 4-digit constant (FUN 330)

(1) Usable devices

M
X Y K V T C L P D N S Constant
0W - 0FW 40 W- 4FW

PCk05 OP1 ○ ○ ○ ○ ○ ○ ○ ○ ○ ○
OP2 ○
OP3 ○ ○ ○ ○ ○ ○ ○ ○

M
X Y K V T C L P D N S Constant
0W - 1FW 40W - 4FW

PCk06 OP1 ○ ○ ○ ○ ○ ○ ○ ○ ○ ○
OP2 ○
OP3 ○ ○ ○ ○ ○ ○ ○ ○

(2) Number of steps 3

(3) Symbol

(4) Function
Subtracts hexadecimal 4-digit constant from the register content of OP1 and stores the result in
OP3 register. The range of constants is 0 ~ FFFF.

(5) Flag

V57 Borrow flag(BO) :


Is set when the digit lowering to bit 31 is generated as a result of the
subtraction.
V55 Half borrow flag(HBO) : Is set when the digit lowering is generated from bit 16 aiming at bit 15
as a result of the subtraction.
V54 Zero flag(Z) : Is set when subtract operation results in 0.

(6) Program (EX.)


Program to subtract hexadecimal "AB12" from the contents of D0100 , when X001 is ON, and to
store the result in D0234.

5-79
30. D-H Subtraction of hexadecimal 8-digit constant (FUN 331) PCk06

(1) Usable devices

M
X Y K V T C L P D N S Constant
0W – 1CW 40W – 4CW

PCk06 OP1 ○ ○ ○ ○ ○ ○ ○
OP2 ○

(2) Number of steps 4

(3) Symbol

(4) Function
Subtracts hexadecimal 8-digit constant from the register content of OP1 and stores the result in
the register of address wherein 2 was added to the address of OP1. The range of constants is
0 ~ FFFFFFFF.

(5) Flag

V57 Borrow flag(BO) :


Is set when the digit lowering to bit 31 is generated as a result of the
subtraction.
V55 Half borrow flag(HBO) : Is set when the digit lowering is generated from bit 16 aiming at bit 15
as a result of the subtraction.
V54 Zero flag(Z) : Is set when subtract operation results in 0.

(6) Program (EX.)


Program to subtract hexadecimal "FEDCBA98" from the contents of D0149, D0148, when X001
turned ON from OFF and to store the result in D014B,D014A .

5-80
31. W-HP Subtraction of BCD 4-digit constant (FUN 333)
(1) Usable devices

M
X Y K V T C L P D N S Constant
0W - 0FW 40 W- 4FW

PCk05 OP1 ○ ○ ○ ○ ○ ○ ○ ○ ○ ○
OP2 ○
OP3 ○ ○ ○ ○ ○ ○ ○ ○

M
X Y K V T C L P D N S Constant
0W - 1FW 40W - 4FW

PCk06 OP1 ○ ○ ○ ○ ○ ○ ○ ○ ○ ○
OP2 ○
OP3 ○ ○ ○ ○ ○ ○ ○ ○

(2) Number of steps 4

(3) Symbol

(4) Function
Deeming register content of OP1 as BCD code, subtracts it together with BCD constant and
stores the result in the register of OP3. The range of constants is 0 ~ 9999.

(5) Flag

V57 Borrow flag(BO) : Is set when the digit lowering to bit 31 is generated as a result of the
subtraction.
V55 Half borrow flag(HBO) : Is set when the digit lowering is generated from bit 16 aiming at bit 15
as a result of the subtraction.
V54 Zero flag(Z) : Is set when subtract operation results in 0.
V5E Data error flag(DER) : Is set if content of OP1 register or OP2 register is not in BCD format.

(6) Program (EX.)


Program to subtract BCD "3456" from BCD 4-digit data stored in D0123, when X010 is ON, and
to output the result to Y400 ~ Y40F.

5-81
32. D-HP Addition of BCD 8-digit constant (FUN 334)

(1) Usable devices

M
X Y K V T C L P D N S Constant
0W – 0EW 40W – 4EW

PCk05 OP1 ○ ○ ○ ○ ○ ○ ○
OP2 ○

M
X Y K V T C L P D N S Constant
0W - 1EW 40W - 4EW

PCk06 OP1 ○ ○ ○ ○ ○ ○ ○
OP2 ○

(2) Number of steps 4

(3) Symbol

(4) Function
Deeming the register content of OP1 as BCD code, subtracts BCD constant and stores the
result in the register of address wherein 2 was added to the address of OP1. The range of
constants is 0 ~ 99999999.

(5) Flag

V57 Borrow flag(BO) :


Is set when the digit lowering to bit 31 is generated as a result of the
subtraction.
V55 Half borrow flag(HBO) : Is set when the digit lowering is generated from bit 16 aiming at bit 15
as a result of the subtraction.
V54 Zero flag(Z) : Is set when subtract operation results in 0.
V5E Data error flag(DER) : Is set if content of OP1 register or OP2 register is not in BCD format.

(6) Program (EX.)


Program to subtract BCD "12345678" from BCD 8-digit data which was stored in D0149, D148
when M000 turned ON from OFF, and to store the result in D014B,D014A .

5-82
33. W*H Multiplication of hexadecimal 4-digit constant (FUN 336)

(1) Usable devices

M
X Y K V T C L P D N S Constant
0W - 0FW 40W - 4FW

PCk05 OP1 ○ ○ ○ ○ ○ ○ ○ ○ ○ ○
OP2 ○


OP3 ○ ○ ○ ○ ○ ○
0W -0EW

M
X Y K V T C L P D N S Constant
0W - 1FW 40W - 4FW

PCk06 OP1 ○ ○ ○ ○ ○ ○ ○ ○ ○ ○
OP2 ○


OP3 ○ ○ ○ ○ ○ ○
0W - 1EW

(2) Number of steps 3

(3) Symbol

(4) Function
Multiplies the register content of OP1 by hexadecimal constant and stores the result in OP3.
The range of constants is 0 ~ FFFF.

(5) Flag

V54 Zero flag(Z) : Is set when multiply operation results in 0.

(6) Program (EX.)


Program to multiply the contents of D0100 by hexadecimal "AB12" , when X001 is ON, and to
store the result in D0234, D0235.

5-83
34. W*HP Multiplication of BCD 4-digit constant (FUN 339)
(1) Usable devices

M
X Y K V T C L P D N S Constant
0W - 0FW 40W - 4FW

PCk05 OP1 ○ ○ ○ ○ ○ ○ ○ ○ ○ ○
OP2 ○


OP3 ○ ○ ○ ○ ○ ○
0W - 0EW

M
X Y K V T C L P D N S Constant
0W - 1FW 40W - 4FW

PCk06 OP1 ○ ○ ○ ○ ○ ○ ○ ○ ○ ○
OP2 ○


OP3 ○ ○ ○ ○ ○ ○
0W - 1EW

(2) Number of steps 3

(3) Symbol

(4) Function
Deeming the register content of OP1 as BCD code, multiplies BCD constant and stores the
result in the register of OP3. The range of constants is 0 ~ 9999.

(5) Flag

V54 Zero flag(Z) : Is set when multiply operation results in 0.


V5E Data error flag(DER) : Is set when the content of OP1 register or OP2 register is not in
BCD format.

(6) Program (EX.)


Program to multiply BCD 4-digit data stored in D0123, when X010 is ON, by BCD "3456" and to
store the result in Y400 ~Y41F.

5-84
35. W/H Divide of hexadecimal 4-digit constant (FUN 342)

(1) Usable devices

M
X Y K V T C L P D N S Constant
0W - 0FW 40W - 4FW

PCk05 OP1 ○ ○ ○ ○ ○ ○ ○ ○ ○ ○
OP2 ○


OP3 ○ ○ ○ ○ ○ ○
0W -0EW

M
X Y K V T C L P D N S Constant
0W - 1FW 40W - 4FW

PCk06 OP1 ○ ○ ○ ○ ○ ○ ○ ○ ○ ○
OP2 ○


OP3 ○ ○ ○ ○ ○ ○
0W - 1EW

(2) Number of steps 5

(3) Symbol

(4) Function
Divides the register content of OP1 by hexadecimal constant and stores the quotient in OP3
register and remainder in the register of address next to OP3. The range of constants is 0 ~
FFFF.

(5) Flag

V54 Zero flag(Z) : Is set when divide operation results in 0.

V50 Error flag(ER) : Is set when the content of OP2 register is 0.

(6) Program (EX.)


Program to divide the contents of D0100 by hexadecimal “AB12”, when X001 is ON, and to
stored the quotient in D0234 and remainder in D0235.

5-85
36. W/HP Divide of BCD 4-digit constant (FUN 345)
(1) Usable devices

M
X Y K V T C L P D N S Constant
0W - 0FW 40W - 4FW

PCk05 OP1 ○ ○ ○ ○ ○ ○ ○ ○ ○ ○
OP2 ○


OP3 ○ ○ ○ ○ ○ ○
0W - 0EW

M
X Y K V T C L P D N S Constant
0W - 1FW 40W - 4FW

PCk06 OP1 ○ ○ ○ ○ ○ ○ ○ ○ ○ ○
OP2 ○


OP3 ○ ○ ○ ○ ○ ○
0W - 1EW

(2) Number of steps 5

(3) Symbol

(4) Function
Deeming the register content of OP1 as BCD code, divides it by BCD constant and stores the
quotient in OP3 register and the remainder in the register of address next to OP3. The range
of constants is 0 ~ 9999.

(5) Flag
V54 Zero flag(Z) : Is set when divide operation results in 0.
V50 Error flag(ER) : Is set when the content of OP2 register is 0.
V5E Data error flag(DER) : Is set when the content of OP1 register or OP2 register is not in
BCD format.

(6) Program (EX.)


Program to divide BCD 4-digit data stored in D0123, when X010 is ON, by BCD "3456" and to
output the quotient in Y400 ~ Y40F and the remainder to Y41F from Y410.

5-86
5.4.3. Logical operation instructions

Instructions carrying out logical operations on contents of registers are classified as follows.

Logical product (AND)…….Carries out AND operation between data in registers and stores
the result into another register.

Logical sum (OR)…………..Carries out OR operation between data in registers and stores the
result into another register.

Inversion (NOT)…………....Inverts register data and stores the result into another register.

Exclusive logical sum ……..Carries out exclusive OR between register (XOR) data and stores
the result into another register.

5-87
37. WAND Word data logical product(AND) (FUN 187)

(1) Usable devices

M
X Y K V T C L P D N S Constant
0W - 0FW 40 W- 4FW

PCk05 OP1 ○ ○ ○ ○ ○ ○ ○ ○ ○ ○
OP2 ○ ○ ○ ○ ○ ○ ○ ○ ○ ○
OP3 ○ ○ ○ ○ ○ ○ ○ ○

M
X Y K V T C L P D N S Constant
0W - 1FW 40W - 4FW

PCk06 OP1 ○ ○ ○ ○ ○ ○ ○ ○ ○ ○
OP2 ○ ○ ○ ○ ○ ○ ○ ○ ○ ○
OP3 ○ ○ ○ ○ ○ ○ ○ ○

(2) Number of steps 3

(3) Symbol

(4) Function
Carries out AND operation between contents of OP1 and OP2 registers and stores the result
into OP3 register.

(5) Flag

V54 Zero flag(Z) : Is set when the operation result is 0.

(6) Example of program


When X001 is ON, sets the highest digit of BCD 4-digit data stored in D0234 to 0 and stores
the result back into D0234.

5-88
38. DAND 32-bit data logical product(AND) (FUN 188)

(1) Usable devices

M
X Y K V T C L P D N S 定数
0W – 0EW 40 W- 4EW

PCk05 OP1 ○ ○ ○ ○ ○ ○ ○ ○ ○
OP2 ○ ○ ○ ○ ○ ○ ○ ○ ○
OP3 ○ ○ ○ ○ ○ ○ ○

M
X Y K V T C L P D N S 定数
0W – 1EW 40W – 4EW

PCk06 OP1 ○ ○ ○ ○ ○ ○ ○ ○ ○
OP2 ○ ○ ○ ○ ○ ○ ○ ○ ○
OP3 ○ ○ ○ ○ ○ ○ ○

(2) Number of steps 3

(3) Symbol

(4) Function
Carries out AND operation between contents of OP1 and OP2 registers and stores the result
into OP3 register.

(5) Flag

V54 Zero flag(Z) : Is set when the operation result is 0.

(6) Example of program


When M000 is ON, carries out AND operation between the contents of D0237 and D0236 and
the contents of D0239 and D0238 and outputs the result to Y430-Y44F.

5-89
39. WOR Word data logical sum(OR) (FUN 189)

(1) Usable devices

M
X Y K V T C L P D N S Constant
0W - 0FW 40 W- 4FW

PCk05 OP1 ○ ○ ○ ○ ○ ○ ○ ○ ○ ○
OP2 ○ ○ ○ ○ ○ ○ ○ ○ ○ ○
OP3 ○ ○ ○ ○ ○ ○ ○ ○

M
X Y K V T C L P D N S Constant
0W - 1FW 40W - 4FW

PCk06 OP1 ○ ○ ○ ○ ○ ○ ○ ○ ○ ○
OP2 ○ ○ ○ ○ ○ ○ ○ ○ ○ ○
OP3 ○ ○ ○ ○ ○ ○ ○ ○

(2) Number of steps 3

(3) Symbol

(4) Function
Carries out OR operation between contents of OP1 and OP2 registers and stores the result
into OP3register.

(5) Flag

V54 Zero flag(Z) : Is set when the result is 0.

(6) Example of program


When X001 is ON, sets the upper 8bits of data stored in D0234 to "1".

5-90
40. DOR 32-bit data logical sum(OR) (FUN 190)

(1) Usable devices

M
X Y K V T C L P D N S Constant
0W – 0EW 40 W- 4EW

PCk05 OP1 ○ ○ ○ ○ ○ ○ ○ ○ ○ ○
OP2 ○ ○ ○ ○ ○ ○ ○ ○ ○ ○
OP3 ○ ○ ○ ○ ○ ○ ○

M
X Y K V T C L P D N S Constant
0W – 1EW 40W – 4EW

PCk06 OP1 ○ ○ ○ ○ ○ ○ ○ ○ ○ ○
OP2 ○ ○ ○ ○ ○ ○ ○ ○ ○ ○
OP3 ○ ○ ○ ○ ○ ○ ○

(2) Number of steps 3

(3) Symbol

(4) Function
Carries out OR operation between contents of OP1 and OP2 registers and stores the result
into OP3register.

(5) Flag

V54 Zero flag(Z) : Is set when the result is 0.

(6) Example of program


When M000 is ON, carries out OR operation between the contents of D237 and D236, and
D239 and D238, and outputs the result to Y430-Y44F.

5-91
41. WNOT Word data inversion (FUN 191)

(1) Usable devices

M
X Y K V T C L P D N S Constant
0W - 0FW 40 W- 4FW

PCk05 OP1 ○ ○ ○ ○ ○ ○ ○ ○ ○ ○
OP2 ○ ○ ○ ○ ○ ○ ○ ○

M
X Y K V T C L P D N S Constant
0W - 1FW 40W - 4FW

PCk06 OP1 ○ ○ ○ ○ ○ ○ ○ ○ ○ ○
OP2 ○ ○ ○ ○ ○ ○ ○ ○

(2) Number of steps 3

(3) Symbol

(4) Function
Inverts the contents of OP1 register ("1"bit to "0" and "0" bit to "1") and stores them into OP2
register.

(5) Flag

V54 Zero flag(Z) : Is set when the result is 0.

(6) Example of program


When X001 turns ON from OFF, inverts the data stored in D0234 and stores the result back to
D0234.

5-92
42. DNOT 32-bit data inversion (FUN 192)

(1) Usable devices

M
X Y K V T C L P D N S Constant
0W – 0EW 40 W- 4EW

PCk05 OP1 ○ ○ ○ ○ ○ ○ ○ ○ ○
OP2 ○ ○ ○ ○ ○ ○ ○

M
X Y K V T C L P D N S Constant
0W – 1EW 40W – 4EW

PCk06 OP1 ○ ○ ○ ○ ○ ○ ○ ○ ○
OP2 ○ ○ ○ ○ ○ ○ ○

(2) Number of steps 3

(3) Symbol

(4) Function
Inverts the contents of OP1 register ("1"bit to "0" and "0" bit to "1") and stores them into OP2
register.

(5) Flag

V54 Zero flag(Z) : Is set when the result is 0.

(6) Example of program


When M000 is ON, inverts the data stored in D0254 and D0233 and stores the result to D0256
and D0255.

5-93
43. WXOR Word data exclusive logical sum(XOR) (FUN 193)

(1) Usable devices

M
X Y K V T C L P D N S Constant
0W - 0FW 40 W- 4FW

PCk05 OP1 ○ ○ ○ ○ ○ ○ ○ ○ ○ ○
OP2 ○ ○ ○ ○ ○ ○ ○ ○ ○ ○
OP3 ○ ○ ○ ○ ○ ○ ○ ○

M
X Y K V T C L P D N S Constant
0W - 1FW 40W - 4FW

PCk06 OP1 ○ ○ ○ ○ ○ ○ ○ ○ ○ ○
OP2 ○ ○ ○ ○ ○ ○ ○ ○ ○ ○
OP3 ○ ○ ○ ○ ○ ○ ○ ○

(2) Number of steps 3

(3) Symbol

(4) Function
Carries out exclusive OR (XOR) between contents of OP1 and OP2 registers and stores the
result into OP3 register.

(5) Flag

V54 Zero flag(Z) : Set when the result is 0.

(6) Example of program


When X001 is ON, carries out XOR operation between the content of D0233 and the content
of D0234 and stores the result into D0235.

5-94
44. DXOR 32-bit data exclusive logical sum(XOR) (FUN 194)

(1) Usable devices

M
X Y K V T C L P D N S Constant
0W – 0EW 40 W- 4EW

PCk05 OP1 ○ ○ ○ ○ ○ ○ ○ ○ ○
OP2 ○ ○ ○ ○ ○ ○ ○ ○ ○
OP3 ○ ○ ○ ○ ○ ○ ○

M
X Y K V T C L P D N S Constant
0W – 1EW 40W – 4EW

PCk06 OP1 ○ ○ ○ ○ ○ ○ ○ ○ ○
OP2 ○ ○ ○ ○ ○ ○ ○ ○ ○
OP3 ○ ○ ○ ○ ○ ○ ○

(2) Number of steps 3

(3) Symbol

(4) Function
Carries out exclusive OR (XOR) between contents of OP1 and OP2 registers and stores the
result into OP3 register.

(5) Flag

V54 Zero flag(Z): Set when the result is 0.

(6) Example of program


When M000 is ON, carries out XOR operation between the contents of D0237 and D0236 and
the contents of D0239 and D0238 and outputs the result to Y430-Y44F.

5-95
45. WANDH Logical product (AND) of hexadecimal 4-digit constant (FUN 348)

(1) Usable devices

M
X Y K V T C L P D N S Constant
0W - 0FW 40 W- 4FW

PCk05 OP1 ○ ○ ○ ○ ○ ○ ○ ○ ○ ○
OP2 ○
OP3 ○ ○ ○ ○ ○ ○ ○ ○

M
X Y K V T C L P D N S Constant
0W - 1FW 40W - 4FW

PCk06 OP1 ○ ○ ○ ○ ○ ○ ○ ○ ○ ○
OP2 ○
OP3 ○ ○ ○ ○ ○ ○ ○ ○

(2) Number of steps 4

(3) Symbol

(4) Function
Determines logical product (AND) of the register content of OP1 by hexadecimal constant and
stores the result in OP3 register. The range of constants is 0 ~ FFFF.

(5) Flag
V54 Zero Flag (Z) : Turns ON when the calculated result is 0.

(6) Program (EX.)


Program to bring the most significant digit of BCD 4-digit data stored in D0234, when X001 is ON,
and to re-store it in D0234.

5-96
46. DANDH Logical product (AND) of hexadecimal 8-digit constant (FUN 349)

(1) Usable devices

M
X Y K V T C L P D N S Constant
0W – 0CW 40 W- 4CW

PCk05 OP1 ○ ○ ○ ○ ○ ○ ○
OP2 ○

M
X Y K V T C L P D N S Constant
0W – 1CW 40W – 4CW

PCk06 OP1 ○ ○ ○ ○ ○ ○ ○
OP2 ○

(2) Number of steps 4

(3) Symbol

(4) Function
Determines logical product (AND) of the register content of OP1 by hexadecimal constant and
stores the result in the register of address wherein 2 was added to the address of OP1. The
range of constants is 0 ~ FFFFFFFF.

(5) Flag

V54 Zero Flag (Z) : Turns ON when the calculated result is 0.

(6) Program (EX.)


Program to determine logical product of the contents of D0237, D0236 by hexadecimal
"FEDCBA98", when M000 is ON, and to store the result in D0239, D0238.

5-97
47. WORH Logical sum (OR) of hexadecimal 4-digit constant (FUN 351)

(1) Usable devices

M
X Y K V T C L P D N S Constant
0W - 0FW 40 W- 4FW

PCk05 OP1 ○ ○ ○ ○ ○ ○ ○ ○ ○ ○
OP2 ○
OP3 ○ ○ ○ ○ ○ ○ ○ ○

M
X Y K V T C L P D N S Constant
0W - 1FW 40W - 4FW

PCk06 OP1 ○ ○ ○ ○ ○ ○ ○ ○ ○ ○
OP2 ○
OP3 ○ ○ ○ ○ ○ ○ ○ ○

(2) Number of steps 4

(3) Symbol

(4) Function
Determines logical sum (OR) of the register content of OP1 and hexadecimal constant and
stores the result in OP3 register. The range of constants is 0 ~ FFFF.

(5) Flag

V54 Zero Flag (Z) : Turns ON when the calculated result is 0.

(6) Program (EX.)


Program to bring all upper significant 8bits of data stored in D0234 to "1" , when X001 is ON.

5-98
48. DORH Logical sum (OR) of hexadecimal 8-digit constant (FUN 352)

(1) Usable devices

M
X Y K V T C L P D N S Constant
0W – 0CW 40 W- 4CW

PCk05 OP1 ○ ○ ○ ○ ○ ○ ○
OP2 ○

M
X Y K V T C L P D N S Constant
0W – 1CW 40W – 4CW

PCk06 OP1 ○ ○ ○ ○ ○ ○ ○
OP2 ○

(2) Number of steps 4

(3) Symbol

(4) Function
Determines logical sum (OR) of the register content of OP1 and hexadecimal constant and
stores the result in the register of address wherein 2 was added to the address of OP1. The
range of constants is 0 ~ FFFFFFFF.

(5) Flag

V54 Zero Flag (Z) : Turns ON when the calculated result is 0.

(6) Program (EX.)


Program to determine logical sum of the data stored in D0237, D0236 and hexadecimal
"FEDCBA98h", when M000 is ON, and to store the result in D0239, D0238.

5-99
49. WXORH Exclusive logical sum (XOR) of hexadecimal 4-digit constant (FUN 354)

(1) Usable devices

M
X Y K V T C L P D N S Constant
0W - 0FW 40 W- 4FW

PCk05 OP1 ○ ○ ○ ○ ○ ○ ○ ○ ○ ○
OP2 ○
OP3 ○ ○ ○ ○ ○ ○ ○ ○

M
X Y K V T C L P D N S Constant
0W - 1FW 40W - 4FW

PCk06 OP1 ○ ○ ○ ○ ○ ○ ○ ○ ○ ○
OP2 ○
OP3 ○ ○ ○ ○ ○ ○ ○ ○

(2) Number of steps 4

(3) Symbol

(4) Function
Determines exclusive logical sum (XOR) of the register content of OP1 and hexadecimal
constant and stores the result in OP3 register. The range of constants is 0 ~ FFFF.

(5) Flag

V54 Zero Flag (Z) : Turns ON when the calculated result is 0.

(6) Program (EX.)


Program to determine exclusive logical sum (XOR) of the data stored in D0233 and
hexadecimal "AB12" , when X001 is ON, and to store the result in D0234.

5-100
50. DXORH Exclusive logical sum (XOR) of hexadecimal 8-digit constant (FUN 355)

(1) Usable devices

M
X Y K V T C L P D N S Constant
0W – 0CW 40 W- 4CW

PCk05 OP1 ○ ○ ○ ○ ○ ○ ○
OP2 ○

M
X Y K V T C L P D N S Constant
0W – 1CW 40W – 4CW

PCk06 OP1 ○ ○ ○ ○ ○ ○ ○
OP2 ○

(2) Number of steps 4

(3) Symbol

(4) Function
Determines exclusive logical sum (XOR) of the register content of OP1 and hexadecimal
constant and stores the result in the register of address wherein 2 was added to the address of
OP1. The range of constants is 0 ~ FFFFFFFF.

(5) Flag

V54 Zero Flag (Z) : Turns ON when the calculated result is 0.

(6) Program (EX.)


Program to determine exclusive logical sum (XOR)of the data stored in D0237, D0236 and
hexadecimal "FEDCBA98h", when M000 is ON, and to store the result in D0239, D0238.

5-101
5.4.4. Increment and decrement

Execution of this instruction will increment or decrement data by one.

Increment……..Increases data value by 1.

Decrement……..Decreases data value by 1.

5-102
51. WINC Word data binary increment (FUN 63)

(1) Usable devices

M
X Y K V T C L P D N S Constant
0W - 0FW 40 W- 4FW

PCk05 OP1 ○ ○ ○ ○ ○ ○ ○ ○ ○ ○
OP2 ○ ○ ○ ○ ○ ○ ○ ○ ○ ○

M
X Y K V T C L P D N S Constant
0W - 1FW 40W - 4FW

PCk06 OP1 ○ ○ ○ ○ ○ ○ ○ ○ ○ ○
OP2 ○ ○ ○ ○ ○ ○ ○ ○ ○ ○

(2) Number of steps 5

(3) Symbol

(4) Function
Increments the content of OP2 register by l and compares the new value with the content of
OP1 register. Data is regarded as binary numbers.

(5) Flag

V53 Greater-than flag(>) : Is set if the content of OP1 register is greater than that of OP2
register.
V52 Equal flag (=) : Is set if the content of OP1 register equals that of OP2 register.
V51 Less-than flag(<) : Is set if the content of OP1 register is smaller than that of OP2
register.

(6) Example of program


Increments the content of D0123 by 1 upon the OFF to ON transition of X001.

(D0123 of OP1 has no effect on operation.)

5-103
52. WINCP 4-digit BCD increment (FUN 200)

(1) Usable devices

M
X Y K V T C L P D N S Constant
0W - 0FW 40W- 4FW

PCk05 OP1 ○ ○ ○ ○ ○ ○ ○ ○ ○ ○
OP2 ○ ○ ○ ○ ○ ○ ○ ○ ○ ○

M
X Y K V T C L P D N S Constant
0W - 1FW 40W - 4FW

PCk06 OP1 ○ ○ ○ ○ ○ ○ ○ ○ ○ ○
OP2 ○ ○ ○ ○ ○ ○ ○ ○ ○ ○

(2) Number of steps 5

(3) Symbol

(4) Function
Increments the content of OP2 register by 1 and compares the new value with the content of
OP1 register. Data is regarded as BCD numbers.

(5) Flag

V53 Greater-than flag(>) : Is set if the content of OP1 register is greater than that of OP2
register.
V52 Equal flag (=) : Is set if the content of OP1 register equals that of OP2 register.
V51 Less-than flag(<) : Is set if the content of OP1 register is smaller than that of OP2
register.
V5E Data error flag(DER) : Is set When content of OP2 register is not in BCD format.

(6) Example of program


Increments BCD data stored in D0275 by 1 upon the OFF to ON transition of X001. (D0275of
OP1 has no effect on operation.)

5-104
53. WDEC Word data binary decrement (FUN 64)

(1) Usable devices

M
X Y K V T C L P D N S Constant
0W - 0FW 40W- 4FW

PCk05 OP1 ○ ○ ○ ○ ○ ○ ○ ○ ○ ○

M
X Y K V T C L P D N S Constant
0W - 1FW 40W - 4FW

PCk06 OP1 ○ ○ ○ ○ ○ ○ ○ ○ ○ ○

(2) Number of steps 2

(3) Symbol

(4) Function
Decrements content of OP1 register by 1. Data is regarded as binary numbers.

(5) Flag

V54 Zero flag(Z) : Is set when the result is 0.

(6) Example of program


When X001 changes from OFF to ON, decrements content of D0123 by 1 and if the result is 0,
sets Y410 to ON.

5-105
54. WDECP 4-digit BCD decrement (FUN 203)

(1) Usable devices

M
X Y K V T C L P D N S Constant
0W - 0FW 40W - 4FW

PCk05 OP1 ○ ○ ○ ○ ○ ○ ○ ○ ○ ○

M
X Y K V T C L P D N S Constant
0W - 1FW 40W - 4FW

PCk06 OP1 ○ ○ ○ ○ ○ ○ ○ ○ ○ ○

(2) Number of steps 2

(3) Symbol

(4) Function
Decrements content of OP1 register by 1. Data is regarded as BCD numbers.

(5) Flag

V54 Zero flag(Z) : Is set when the result is 0.


V5E Data error flag(DER) : Is set when the content of OP1 register is not in BCD format.

(6) Example of program


When X001 changes from OFF to ON, decrements BCD data stored in D0282 by 1 and if the
result is 0, sets Y410 to on.

5-106
5.4.5. Search

Instruction used to locate specified data in a group of data.

5-107
55. WSRH2 Word data search 2 (FUN 213) PCk06

(1) Usable devices

M
X Y K V T C L P D N S Constant
0W – 1FW 40W – 4FW


PCk06 OP1 ○ ○
0W – 1EW
○ ○ ○ ○

OP2 ○ ○ ○ ○ ○ ○ ○ ○ ○

OP3 ○

(2) Number of steps 6

(3) Symbol

(4) Function
Searches the area, starting at OP2 address and containing the number of data specified by
OP3, for the data matching the content of OP1 register. If found, sets carry flag(CY) and
stores the location data(the Nth address with respect to OP2 address =1) into the word
address location following OP1.
Also stores the number of pieces of coincident data into address location next to the address
following the OP1 address. The maximum area can be searched is 256 pieces of data long.

(5) Flag

V50 Error flag(ER) : Is set when the data designated by OP1 not exists in the specified
range.

(6) Example of program


When X000 is ON, searches the area, starting at D0100 and containing the number of pieces
of data specified by OP3, for the data matching the content of D0000 register. If found, stores
the location data into D0001. When not found, V50 operation error flag (ER) is turned on.

5-108
5.4.6. Data conversion

Used to convert data format and are classified into the following.

BCD to binary…….........Converts BCD format data into binary data.

Binary to BCD……........Coverts binary data into BCD data.

JIS to binary……….......Coverts JIS code representing numeric values to binary data.

Binary to JIS……………Converts binary data to JIS code expressions.

4 to 16 decoder………..Sets one of 16 bits which represents equivalent of the value expressed


by 4-bit binary.

16 to 4 decoder………..Sets bit(s) in a set of 4 bits which represents equivalent of the value


expressed by one of 16 bits.

5-109
56. WBIN 4-digit BCD to 16-bit binary (FUN 3)

(1) Usable devices

M
X Y K V T C L P D N S Constant
0W - 0FW 40W - 4FW

PCk05 OP1 ○ ○ ○ ○ ○ ○ ○ ○ ○ ○
OP2 ○ ○ ○ ○ ○ ○ ○ ○

M
X Y K V T C L P D N S Constant
0W - 1FW 40W - 4FW

PCk06 OP1 ○ ○ ○ ○ ○ ○ ○ ○ ○ ○
OP2 ○ ○ ○ ○ ○ ○ ○ ○

(2) Number of steps 3

(3) Symbol

(4) Function
Converts BCD data stored in OP1 register into binary data and stores it into OP2register.

(5) Flag

V54 Zero flag(Z) : Is set when the result is 0.


V5E Data error flag(DER) : Is set when the data stored in OP1 register is not in BCD format.

(6) Example of program


When X000 is ON, converts 4-digit BCD data stored in D0000 into binary data and stores the
new data into D0001.

5-110
57. DBIN 8-digit BCD to 32-bit binary (FUN 153)

(1) Usable devices

M
X Y K V T C L P D N S Constant
0W ‒ 0EW 40W - 4EW

PCk05 OP1 ○ ○ ○ ○ ○ ○ ○ ○ ○
OP2 ○ ○ ○ ○ ○ ○ ○

M
X Y K V T C L P D N S Constant
0W ‒ 1EW 40W ‒ 4EW

PCk06 OP1 ○ ○ ○ ○ ○ ○ ○ ○ ○
OP2 ○ ○ ○ ○ ○ ○ ○

(2) Number of steps 4

(3) Symbol

(4) Function
Converts BCD data stored in OP1 register into binary data and stores it into OP2register.

(5) Flag

V54 Zero flag(Z) : Is set when the result is 0.


V5E Data error flag(DER) : Is set when the data stored in OP1 register is not in BCD format.

(6) Example of program


When X000 is ON, converts 8-digit BCD data stored in D0001 and D0000 into binary data and
stores the new data into D0003 and D0002.

5-111
58. WBCD 16-bit binary to 4-bit BCD (FUN 4)

(1) Usable devices

M
X Y K V T C L P D N S Constant
0W - 0FW 40W - 4FW

PCk05 OP1 ○ ○ ○ ○ ○ ○ ○ ○ ○ ○
OP2 ○ ○ ○ ○ ○ ○ ○ ○

M
X Y K V T C L P D N S Constant
0W - 1FW 40W - 4FW

PCk06 OP1 ○ ○ ○ ○ ○ ○ ○ ○ ○ ○
OP2 ○ ○ ○ ○ ○ ○ ○ ○

(2) Number of steps 3

(3) Symbol

(4) Function
Converts binary data stored in OP1 register into BCD data and stores it into OP2 register.
The BCD data of four subordinate position digits is stored in the register of OP2
when exceeding it to 9999 as a result of conversion.

(5) Flag

V54 Zero flag(Z) : Is set when the result is 0.

(6) Example of program


When X000 is ON, converts binary data stored in D0000 into 4-digit BCD data and stores the
new data into D0001.

5-112
59. DBCD 32-bit binary to 8-digit BCD (FUN 155)

(1) Usable devices

M
X Y K V T C L P D N S 定数
0W ‒ 0EW 40W - 4EW

PCk05 OP1 ○ ○ ○ ○ ○ ○ ○ ○ ○
OP2 ○ ○ ○ ○ ○ ○ ○

M
X Y K V T C L P D N S 定数
0W ‒ 1EW 40W ‒ 4EW

PCk06 OP1 ○ ○ ○ ○ ○ ○ ○ ○ ○
OP2 ○ ○ ○ ○ ○ ○ ○

(2) Number of steps 3

(3) Symbol

(4) Function
Converts binary data stored in OP1 register into BCD data and stores it into OP2 register.
The BCD data of eight subordinate position digits is stored in the register of OP2
when exceeding it to 99999999 as a result of conversion.

(5) Flag

V54 Zero flag(Z) : Is set when the result is 0.

(6) Example of program


When X000 is ON, converts binary data stored in D0001 and D0000 into 8-digit BCD data
and-stores the new data into D0003 and D0002.

5-113
60. JBIN JIS code to binary (FUN 156)
(1) Usable devices

M
X Y K V T C L P D N S 定数
0W - 0FW 40W - 4FW

PCk05 OP1 ○ ○ ○ ○ ○ ○ ○ ○ ○
OP2 ○ ○ ○ ○ ○ ○ ○ ○ ○
OP3 ○

M
X Y K V T C L P D N S 定数
0W - 1FW 40W - 4FW

PCk06 OP1 ○ ○ ○ ○ ○ ○ ○ ○ ○
OP2 ○ ○ ○ ○ ○ ○ ○ ○ ○
OP3 ○

(2) Number of steps 4

(3) Symbol

(4) Function
It stores it in the area where the JIS code data of the number of words (even number value)
shown from the address of OP1 by OP3 is considered to be a hexadecimal number, this is
converted into the binary number, and OP2 is assumed to be the first address.
The number of maximum conversion data (word) is 32.
When OP3 is specified by the odd number value, the even number value of the value +1
becomes the number of conversion data.
It becomes a no function treatment when OP3 is 0 and it doesn't become an error.

(5) Flag

V50 Error flag(ER) : Is set when the register number exceeds it.

(6) Example of program

1) JIS code of six words (12 characters) is converted from D0123 into the binary number when
X000 is ON, and it stores it in the area where D0160 is assumed to be the first address.

5-114
2) Four characters' worth of JIS code input from X040 to the input card of X05F when X101 is
ON is converted into the binary number, and it stores it in the area where D0100 is assumed
to be the first address.

5-115
61. BJIS Binary to JIS code (FUN 157)

(1) Usable devices

M
X Y K V T C L P D N S Constant
0W - 0FW 40W - 4FW

PCk05 OP1 ○ ○ ○ ○ ○ ○ ○ ○ ○
OP2 ○ ○ ○ ○ ○ ○ ○ ○ ○
OP3 ○

M
X Y K V T C L P D N S Constant
0W - 1FW 40W - 4FW

PCk06 OP1 ○ ○ ○ ○ ○ ○ ○ ○ ○
OP2 ○ ○ ○ ○ ○ ○ ○ ○ ○
OP3 ○

(2) Number of steps 4

(3) Symbol

(4) Function
Interprets the binary data stored, starting at OP1 address, as hexadecimal numeric value with
the number of characters specified by OP3, and converts the data into JIS codes and then
stores them into area starting at OP2 address.
The maximum number of convertable pieces of data is 32.
It becomes a no function treatment when OP3 is 0 and it doesn't become an error.

(5) Flag

V50 Error flag(ER) : Is set when the register number exceeds it.

(6) Example of program


1) The stored binary data is converted from D013F into JIS code by three words (12 digits)
when X100 is turned on, and it stores it in the area where D0120 is assumed to be the
first address.

5-116
2) The stored binary data is converted from the subordinate position byte of D0150 into JIS
code by four digits when X101 is ON, and it outputs it to the output card of Y440-Y45F.

5-117
62. DECO 4 to 16 decoder (FUN 50)

(1) Usable devices

M
X Y K V T C L P D N S Constant
0W ‒ 0EW 40W - 4EW

PCk05 OP1 ○ ○ ○ ○ ○ ○ ○ ○ ○ ○
OP2 ○ ○ ○ ○ ○ ○ ○ ○

M
X Y K V T C L P D N S Constant
0W ‒ 1EW 40W ‒ 4EW

PCk06 OP1 ○ ○ ○ ○ ○ ○ ○ ○ ○ ○
OP2 ○ ○ ○ ○ ○ ○ ○ ○

(2) Number of steps 5

(3) Symbol

(4) Function
Decodes lower 4 bits of the content of OP1 register into 16-bit data and stores it in OP2
address location.

(5) Flag
No change

(6) Example of program


1) When X100 is ON, decodes lower 4 bits of D0110 lower byte into 16-bit data and stores it
into D0125.

5-118
2) When X000 is ON, decodes lower 4 Points of input cards, X010-X01F, and distributes the
decoded data to output cards, Y440-Y44F.

5-119
63. ENCO 16 to 4 encoder (FUN 51)

(1) Usable devices

M
X Y K V T C L P D N S Constant
0W ‒ 0EW 40W - 4EW

PCk05 OP1 ○ ○ ○ ○ ○ ○ ○ ○ ○ ○
OP2 ○ ○ ○ ○ ○ ○ ○ ○

M
X Y K V T C L P D N S Constant
0W ‒ 1EW 40W ‒ 4EW

PCk06 OP1 ○ ○ ○ ○ ○ ○ ○ ○ ○ ○
OP2 ○ ○ ○ ○ ○ ○ ○ ○

(2) Number of steps 8

(3) Symbol

(4) Function
Bit position (0-15) of ON(=1) is converted into the binary number among 16 bits of the content
of the register of OP1 and it stores it in four subordinate position bits of the register of OP2.
It gives priority to the subordinate position bit when there are two bits or more that have been
ON. Moreover, when there is no bit that has been turned on, V50 operation error flag (ER) is
ON, and the content of the register of OP2 is not changed.

(5) Flag

V50 Error flag(ER) : Is set if the 16-bit content of OP1 register is all OFF(filled with 0).
Or, is set when two or more bits have been ON.

(6) Example of program

5-120
1) When X100is ON, encodes the data of D0200(finds ON-bit) and stores the equivalent
value in the lower 4bits of D0210 lower byte.

5-121
2) When X000 is ON, encodes the data of D0220 and routes the result to lower 4points of
output cards, Y440-Y44F.

5-122
5.4.7. Comparison

Instruction used to compare the size of data.

5-123
64. WCP Word data comparison (FUN 12)

(1) Usable devices

M
X Y K V T C L P D N S Constant
0W - 0FW 40W - 4FW

PCk05 OP1 ○ ○ ○ ○ ○ ○ ○ ○ ○ ○
OP2 ○ ○ ○ ○ ○ ○ ○ ○ ○ ○

M
X Y K V T C L P D N S Constant
0W - 1FW 40W - 4FW

PCk06 OP1 ○ ○ ○ ○ ○ ○ ○ ○ ○ ○
OP2 ○ ○ ○ ○ ○ ○ ○ ○ ○ ○

(2) Number of steps 2

(3) Symbol

(4) Function
Compares contents of OP1 and OP2 registers and sets either of >, = or < flag, depending on
which one of the contents is larger.

(5) Flag

V53 Greater-than flag(>) : Is set if the content of OP1 register is greater than that of OP2
register.
V52 Equal flag (=) : Is set if the content of OP1 register equals that of OP2 register.
V51 Less-than flag(<) : Is set if the content of OP1 register is smaller than that of OP2
register.

(6) Example of program


When X000 is ON, compares upper 8 bits of D0100 and that of D0200 and sets or resets
appropriate flag.

5-124
65. DCP 32-bit data comparison (FUN 211)

(1) Usable devices

M
X Y K V T C L P D N S Constant
0W – 0EW 40W - 4EW

PCk05 OP1 ○ ○ ○ ○ ○ ○ ○ ○ ○
OP2 ○ ○ ○ ○ ○ ○ ○ ○ ○

M
X Y K V T C L P D N S Constant
0W – 1EW 40W – 4EW

PCk06 OP1 ○ ○ ○ ○ ○ ○ ○ ○ ○
OP2 ○ ○ ○ ○ ○ ○ ○ ○ ○

(2) Number of steps 2

(3) Symbol

(4) Function
Compares contents of OP1 and OP2 registers and sets either of >, = or < flag, depending on
which one of the contents is larger.

(5) Flag

V53 Greater-than flag(>) : Is set if the content of OP1 register is greater than that of OP2
register.
V52 Equal flag (=) : Is set if the content of OP1 register equals that of OP2 register.
V51 Less-than flag(<) : Is set if the content of OP1 register is smaller than that of OP2
register.

(6) Example of program


When M000 is ON, compares the contents of D0201 and D0200 and those of D0301 and
D0300 and sets or resets appropriate flag.

5-125
5.4.8. Bit operation

Used to test ON or OFF state of bits and to set or reset a bit. The instructions are classified as
follows :

ON-bit count………..Counts the number of ON-state bits in the specified data.

5-126
66. WSUM Word data ON-bit count (FUN 209)

(1) Usable devices

M
X Y K V T C L P D N S Constant
0W - 0FW 40W - 4FW

PCk05 OP1 ○ ○ ○ ○ ○ ○ ○ ○ ○ ○
OP2 ○ ○ ○ ○ ○ ○ ○ ○

M
X Y K V T C L P D N S Constant
0W - 1FW 40W - 4FW

PCk06 OP1 ○ ○ ○ ○ ○ ○ ○ ○ ○ ○
OP2 ○ ○ ○ ○ ○ ○ ○ ○

(2) Number of steps 3

(3) Symbol

(4) Function
Count all ON-bits ("1" level) in the content of OP1 register and stores the number data into
OP2.

(5) Flag

V54 Zero flag(Z) : Is set when there is no bit.

(6) Example of program


When X001 is ON, stores the total number of "1" bits in D0200 into D0300. When D0200 =
1234H, then D0300 = 5H after execution of this instruction.

5-127
67. DSUM 32-bit data ON-bit count (FUN 210)

(1) Usable devices

M
X Y K V T C L P D N S Constant
0W – 0EW 40W - 4EW

PCk05 OP1 ○ ○ ○ ○ ○ ○ ○ ○ ○
OP2 ○ ○ ○ ○ ○ ○ ○

M
X Y K V T C L P D N S Constant
0W – 1EW 40W – 4EW

PCk06 OP1 ○ ○ ○ ○ ○ ○ ○ ○ ○
OP2 ○ ○ ○ ○ ○ ○ ○

(2) Number of steps 3

(3) Symbol

(4) Function
Count all ON-bits ("1" level) in the content of OP1 register and stores the number data into
OP2.

(5) Flag

V54 Zero flag(Z) : Is set when there is no bit.

(6) Example of program


When M000 is ON, stores the total number of "1" bits in D0100 and D0101 into D0200. When
D0101 and D0100 = FFFFFFFFH, then D0200 = 20H after execution of this instruction.

5-128
5.4.9. Shift

Instructions used for shifting which are classified as follows :

1 bit shift……….Shifts data left or right 1 bit position.

n bits shift……...Shifts data left or right any bit positions within the length of data.

Data shift……….Shifts addresses of data group forward or backward in unit of data set.

5-129
68. SFR Byte data 1 bit right shift (FUN 217)

(1) Usable devices

M
X Y K V T C L P D N S Constant
0L - 0FH 40L - 4FH

PCk05 OP1 ○ ○

M
X Y K V T C L P D N S Constant
0L - 1FH 40L - 4FH

PCk06 OP1 ○ ○

(2) Number of steps 3

(3) Symbol

(4) Function
If T input condition is met, shifts the content of OP1 register right 1 bit position (lower digit).
After the shift the content of D input enters the highest bit.

(5) Flag
No change

(6) Example of program


When X000 changes from OFF to ON, shifts M000L 1 bit right.
When this instruction is executed while M000L = 49H and X001 is ON, M000L becomes A4H.

5-130
69. WSFR Word data 1 bit right shift (FUN 36)

(1) Usable devices

M
X Y K V T C L P D N S Constant
0W - 0FW 40W - 4FW

PCk05 OP1 ○ ○

M
X Y K V T C L P D N S Constant
0W - 1FW 40W - 4FW

PCk06 OP1 ○ ○

(2) Number of steps 3

(3) Symbol

(4) Function
If T input condition is met, shifts the content of OP1 register right 1 bit position (lower digit).
After the shift the content of D input enters the highest bit.

(5) Flag
No change

(6) Example of program


When M000 changes from OFF to ON, shifts M03W 1 bit right.
When this instruction is executed while M03W = 8024H and M001 is OFF, M03W becomes
4012H.

5-131
70. DSFR 32-bit data 1 bit right shift (FUN 218)

(1) Usable devices

M
X Y K V T C L P D N S Constant
0W – 0EW 40W – 4EW

PCk05 OP1 ○ ○

M
X Y K V T C L P D N S Constant
0W – 1EW 40W – 4EW

PCk06 OP1 ○ ○

(2) Number of steps 3

(3) Symbol

(4) Function
If T input condition is met, shifts the content of OP1 register right 1 bit position (lower digit).
After the shift the content of D input enters the highest bit.

(5) Flag
No change

(6) Example of program


When X000 changes from OFF to ON, shifts M05W and M04W 1 bit right.
When this instruction is executed while M05W and M04W = 12345678H and X001 is ON,
M05W and M04W becomes 891A2B3CH.

5-132
71. WBSFR Word data n bits right shift (FUN 225)

(1) Usable devices

M
X Y K V T C L P D N S Constant
0W - 0FW 40W - 4FW

PCk05 OP1 ○ ○ ○ ○ ○ ○ ○ ○ ○ ○
OP2 ○

M
X Y K V T C L P D N S Constant
0W - 1FW 40W - 4FW

PCk06 OP1 ○ ○ ○ ○ ○ ○ ○ ○ ○ ○
OP2 ○

(2) Number of steps 4

(3) Symbol

(4) Function
Shifts the content for OP1 register right (lower digit) N bit positions with N being specified by
OP2. The upper unoccupied bit positions will be filled with "0s". When number of bits specified
by OP2 is larger than data length, the data bits are zeroed.

(5) Flag
No change

(6) Example of program


When X001 changes from OFF to ON, shifts D0100 5 bits right.
When this instruction is executed while D0100 = 4000H, D0100 become 0200H.

5-133
72. DBSFR 32-bit data n bits right shift (FUN 226)

(1) Usable devices

M
X Y K V T C L P D N S Constant
0W – 0EW 40W - 4EW

PCk05 OP1 ○ ○ ○ ○ ○ ○ ○ ○ ○
OP2 ○

M
X Y K V T C L P D N S Constant
0W – 1EW 40W – 4EW

PCk06 OP1 ○ ○ ○ ○ ○ ○ ○ ○ ○
OP2 ○

(2) Number of steps 4

(3) Symbol

(4) Function
Shifts the content for OP1 register right (lower digit) N bit positions with N being specified by
OP2. The upper unoccupied bit positions will be filled with "0s".
The number of bits specified with OP2 is specified within the range of 1-32.

(5) Flag
No change

(6) Example of program


When M000 changes from OFF to ON, shifts D0101 and D0100 2 bits right.
When this instruction is executed while D0101 and D0100 = 12345678H, D0101 become
48D159EH.

5-134
73. SFL Byte data 1 bit left shift (FUN 219)

(1) Usable devices

M
X Y K V T C L P D N S Constant
0L - 0FH 40L - 4FH

PCk05 OP1 ○ ○

M
X Y K V T C L P D N S Constant
0L - 1FH 40L - 4FH

PCk06 OP1 ○ ○

(2) Number of steps 3

(3) Symbol

(4) Function
If T input condition is met, shifts the content of OP1 register left 1 bit position (upper digit).
After the shift the content of D Input enters the lowest bit.

(5) Flag
No change

(6) Example of program


When X000 changes from OFF to ON, shifts M000L 1 bit left.
When this instruction is executed while M000L = 83H and X001 is ON, M000L becomes 07H.

5-135
74. WSFL Word data 1 bit left shift (FUN 37)

(1) Usable devices

M
X Y K V T C L P D N S Constant
0W - 0FW 40W - 4FW

PCk05 OP1 ○ ○

M
X Y K V T C L P D N S Constant
0W - 1FW 40W - 4FW

PCk06 OP1 ○ ○

(2) Number of steps 3

(3) Symbol

(4) Function
If T input condition is met, shifts the content of OP1 register left 1 bit position (upper digit).
After the shift the content of D Input enters the lowest bit.

(5) Flag
No change

(6) Example of program


When M000 changes from OFF to ON, shifts M03W 1 bit left.
When this instruction is executed while M03W = 1234H and M001 is ON, M03W becomes
2469H.

5-136
75. DSFL 32-bit data 1 bit left shift (FUN 220)

(1) Usable devices

M
X Y K V T C L P D N S Constant
0W – 0EW 40W – 4EW

PCk05 OP1 ○ ○

M
X Y K V T C L P D N S Constant
0W – 1EW 40W – 4EW

PCk06 OP1 ○ ○

(2) Number of steps 3

(3) Symbol

(4) Function
If T input condition is met, shifts the content of OP1 register left 1 bit position (upper digit).
After the shift the content of D Input enters the lowest bit.

(5) Flag
No change

(6) Example of program


When X000 changes from OFF to ON, shifts M05W and M04W 1 bit left. When this
instruction is executed while M05W and M04W = 87654321H and X101 is OFF, M05W and
M04W becomes 0ECA8642H.

5-137
76. WBSFL Word data n bits left shift (FUN 228)

(1) Usable devices

M
X Y K V T C L P D N S Constant
0W - 0FW 40W - 4FW

PCk05 OP1 ○ ○ ○ ○ ○ ○ ○ ○ ○ ○
OP2 ○

M
X Y K V T C L P D N S Constant
0W - 1FW 40W - 4FW

PCk06 OP1 ○ ○ ○ ○ ○ ○ ○ ○ ○ ○
OP2 ○

(2) Number of steps 4

(3) Symbol

(4) Function
Shift the content of OP1 register left (upper digit) N bit position with N being specified by OP2.
The lower unoccupied bit positions will be filled with "0s".
When number of bits specified by OP2 is larger than data length, the data bits are zeroed.

(5) Flag
No change

(6) Example of program


When X001 changes from OFF to ON, shifts D0100 5 bits left. When this instruction is
executed while D0100 = 4821H, D0100 becomes 0420H.

5-138
77. DBSFL 32-bit data n bits left shift (FUN 229)

(1) Usable devices

M
X Y K V T C L P D N S Constant
0W – 0EW 40W - 4EW

PCk05 OP1 ○ ○ ○ ○ ○ ○ ○ ○ ○
OP2 ○

M
X Y K V T C L P D N S Constant
0W – 1EW 40W – 4EW

PCk06 OP1 ○ ○ ○ ○ ○ ○ ○ ○ ○
OP2 ○

(2) Number of steps 4

(3) Symbol

(4) Function
Shift the content of OP1 register left (upper digit) N bit position with N being specified by OP2.
The lower unoccupied bit positions will be filled with "0s".
The number of bits specified with OP2 is specified within the range of 1-32.

(5) Flag
No change

(6) Example of program


When M000 changes from OFF to ON, shifts D0101 and D0100 2 bits left. When this
instruction is executed while D0101 and D0100 = 12345678H, D0101 and D0100 become
48D159E0.

5-139
78. SUP 4 bit data upper-digit direction shift (FUN 251) PCk06

(1) Usable devices

M
X Y K V T C L P D N S Constant
0W - 1FW 40W - 4FW

PCk06 OP1 ○ ○ ○ ○ ○ ○ ○ ○ ○
OP2 ○

(2) Number of steps 4

(3) Symbol

(4) Function
OP1 is assumed to be the first address, and four bit data of the areas of the number of data
(word) specified with OP2 is shifted in the direction of the high rank (direction where the
address grows). At this time, the low rank data becomes “0".

(5) Flag

V50 Error flag (ER) : Is set when the shift area is outside of the data memory area.

(6) Example of program


When X000 changes from OFF to ON, it shifts from D0100 in the direction of the high rank by
one data in the area for two data (two data = two words). After the shift, the lowest data field is
filled with "0s" and the uppermost is lost (replaced by the second uppermost one).
If D0100 = 4321H and D0101 = 8765H, then D0100 = 3210H and D0101 = 7564H after the
shift.

5-140
79. UP2 Byte data upper-digit direction shift 2 (FUN 252) PCk06

(1) Usable devices

M
X Y K V T C L P D N S Constant
0W - 1FW 40W - 4FW

PCk06 OP1 ○ ○ ○ ○ ○ ○ ○ ○ ○
OP2 ○

(2) Number of steps 4

(3) Symbol

(4) Function
OP1 is assumed to be the first address, and eight bit data of the areas of the number of data
(word) specified with OP2 is shifted in the direction of the high rank (direction where the
address grows). At this time, the low rank data becomes “0".

(5) Flag

V50 Error flag (ER) : Is set if the shifted data enters location for a device which is not
available for the current purpose or if the shift range exceeds the
limits.

(6) Example of program


When X000 changes from OFF to ON, it is a direction of the high rank in the area of two
words from D0100 as for data. It shifts by one byte. Byte data that exists in most significant
disappears.
If D0100 = 4321H, D0101 = 8765H, then D0100 = 2100H, D0101 = 6543H after the shift.

5-141
80. WUP Word data upper-digit direction shift (FUN 253) PCk06

(1) Usable devices

M
X Y K V T C L P D N S Constant
0W - 1FW 40W - 4FW

PCk06 OP1 ○ ○ ○ ○ ○ ○ ○ ○ ○
OP2 ○

(2) Number of steps 4

(3) Symbol

(4) Function
OP1 is assumed to be the first address, and 16 bit data of the areas of the number of data
(word) specified with OP2 is shifted in the direction of the high rank (direction where the
address grows). At this time, the low rank data becomes “0".

(5) Flag

V50 Error flag (ER) : Is set if the shifted data enters location for a device which is not
available for the current purpose or if the shift range exceeds the
limits.

(6) Example of program


When X000 changes from OFF to ON, shifts each piece of data within a 4-word area starting
at D0100 upward 1 word position. If D0100 = 4321H, D0101 =87653H, D0102 = CBA9H,
D0103 = 0FED, then D0100 = 0000H, D0101 = 4321H, D0102 = 8765H and D0103 = CBA9H
after the shift.

5-142
81. DUP 32-bit data upper-digit direction shift (FUN 254) PCk06

(1) Usable devices

M
X Y K V T C L P D N S Constant
0W - 1FW 40W - 4FW

PCk06 OP1 ○ ○ ○ ○ ○ ○ ○ ○ ○
OP2 ○

(2) Number of steps 4

(3) Symbol

(4) Function
OP1 is assumed to be the first address, and 32 bit data of the areas of the number of data
(word) specified with OP2 is shifted in the direction of the high rank (direction where the
address grows). At this time, the low rank data becomes “0".

(5) Flag

V50 Error flag (ER) : Is set if the shifted data enters location for a device which is not
available for the current purpose or if the shift range exceeds the
limits.

(6) Example of program


When X000 changes from OFF to ON, shifts each piece of data within a 8-word area starting
at D0100 upward 2-word positions. If D0101/D0100 = 00020001H, D0103/D0102 =
00040003H, D0105/D0104 = 00060005H, D0107/D0106 = 00080007H, then D0101/D0100 =
00000000H, D0103/D012 = 00020001H, D0105/D014 = 00040003H and D0107/D016 =
00060005H.

5-143
82. SDOWN 4 bit data lower-digit direction shift (FUN 255) PCk06

(1) Usable devices

M
X Y K V T C L P D N S Constant
0W - 1FW 40W - 4FW

PCk06 OP1 ○ ○ ○ ○ ○ ○ ○ ○ ○
OP2 ○

(2) Number of steps 4

(3) Symbol

(4) Function
OP1 is assumed to be the first address, and four bit data of the areas of the number of data
(word) specified with OP2 is shifted in the direction of the subordinate position (direction
where the address becomes small). At this time, the most significant data becomes “0".

(5) Flag

V50 Error flag (ER) : Is set when the shift area is outside of the data memory area.

(6) Example of program


When X000 change from OFF to ON, it shifts from D0100 in the direction of the subordinate
position by four bits in the area for two data (word). “0" enters for the data of most significant,
and the data that is the low rank disappears.
If D0101 = 8765H and D0100 = 4321H, then D0101 = 0876H and D0100 = 5432H after the
shift.

5-144
83. DOWN Byte data lower-digit direction shift (FUN 256) PCk06

(1) Usable devices

M
X Y K V T C L P D N S Constant
0W - 1FW 40W - 4FW

PCk06 OP1 ○ ○ ○ ○ ○ ○ ○ ○ ○
OP2 ○

(2) Number of steps 4

(3) Symbol

(4) Function
OP1 is assumed to be the first address, and eight bit data of the areas of the number of data
(word) specified with OP2 is shifted in the direction of the subordinate position (direction
where the address becomes small). At this time, the most significant data becomes “0".

(5) Flag

V50 Error flag (ER) : Is set when the shifted data enters location for a device which is
outside of the data memory area.

(6) Example of program


When X000 changes from OFF to ON, data is shifted from D0101 in the direction of the
subordinate position by one byte in the area of two words.
If D0101 = 8765H and D0100 = 4321H, then D0101H = 0087H and D0100H = 6543H after the
shift.

5-145
84. WDOWN Word data lower-digit direction shift (FUN 257) PCk06

(1) Usable devices

M
X Y K V T C L P D N S Constant
0W - 1FW 40W - 4FW

PCk06 OP1 ○ ○ ○ ○ ○ ○ ○ ○ ○
OP2 ○

(2) Number of steps 4

(3) Symbol

(4) Function
OP1 is assumed to be the first address, and 16 bit data of the areas of the number of data
(word) specified with OP2 is shifted in the direction of the subordinate position (direction
where the address becomes small). At this time, the most significant data becomes “0".

(5) Flag

V50 Error flag (ER) : Is set when the shifted data enters location for a device which is
outside of the data memory area.

(6) Example of program


When X000 changes from OFF to ON, shifts each piece of data within a 4-word area starting
at D0100 downward 1 word position. If D0103 = 0FEDH, D0102 = CBA9H, D0101 = 8765H,
D0100 = 4321H, then D0103 = 0000H, D0102 = 0FEDH, D0101 = CBA9H and D0100 = 8765H
after the shift.

5-146
85. DDOWN 32-bit data lower-digit direction shift (FUN 258) PCk06

(1) Usable devices

M
X Y K V T C L P D N S Constant
0W - 1FW 40W - 4FW

PCk06 OP1 ○ ○ ○ ○ ○ ○ ○ ○ ○
OP2 ○

(2) Number of steps 4

(3) Symbol

(4) Function
OP1 is assumed to be the first address, and 32 bit data of the areas of the number of data
(word) specified with OP2 is shifted in the direction of the subordinate position (direction
where the address becomes small). At this time, the most significant data becomes “0".

(5) Flag

V50 Error flag (ER) : Is set when the shifted data enters location for a device which is
outside of the data memory area.

(6) Example of program


When X000 changes from OFF to ON, shifts each piece of data within a 8-word area starting
at D0100 downward 2-word positions. If D0107/D0106 = D008007H, D0105/D0104 =
00060005H, D0103/D0102 = 00040003H, D0101/D0100 = 00020001H, then D0107/D0106 =
00000000H, D0105/D014 = 00080007H, D0103/D0102 = 00060005H and D0101/D0100 =
00040003H.

5-147
5.4.10. Rotate

Instructions used to rotate or circulate data are classified as follows :

Rotate without carry…..Rotates any number of bit-data right or left without a carry flag.

5-148
86. DRR 32-bit data right rotate without carry (FUN 244) PCk06

(1) Usable devices

M
X Y K V T C L P D N S Constant
0W – 1EW 40W – 4EW

PCk06 OP1 ○ ○ ○ ○ ○ ○ ○ ○ ○
OP2 ○

(2) Number of steps 4

(3) Symbol

(4) Function
Rotates content of OP1 register right (lower bit) by the number of bits specified by OP2. The
LSB is shifted into MSE position.

(5) Flag
No change

(6) Example of program


When M014 changes from OFF to ON, rotates 32 bits of D0101 and D0100 right (lower bit
position) 10 bits, storing them in D0101 and D0100.

5-149
87. DRL 32-bit data left rotate without carry (FUN 247) PCk06

(1) Usable devices

M
X Y K V T C L P D N S Constant
0W – 1EW 40W – 4EW

PCk06 OP1 ○ ○ ○ ○ ○ ○ ○ ○ ○
OP2 ○

(2) Number of steps 4

(3) Symbol

(4) Function
Rotates content of OP1 register left (upper bit) by the number of bits specified by OP2. The
MSB is shifted into LSB position.

(5) Flag
No change

(6) Example of program


When M01A changes from OFF to ON, rotates 32 bits of D0205 and D0204 left (upper bit
position) 12 bits, storing them in D0205 and D0204.

5-150
5.4.11. Programmed branch

Instruction used to change program execution order and classified as follows :

Jump………………..Executes a program starting with the specified label first.

Subroutine call........Executes a subroutine bearing the specified label.

Repetition…………..Repeats the specified loop any desired times.

5-151
88. JMP JUMP (FUN 272) PCk06

(1) Usable devices

Constant
X Y M K V T C L P D N S
L S EL
PCk06 OP1 ○

(2) Number of steps 2

(3) Symbol

(4) Function
When the input condition is ON, executes a program bearing the label number specified by
OP1.
When the input condition is OFF, executes the program at the next step. Labels numbered
L0-L255 are available for this instruction.

(5) Flag
No change

(6) Example of program


When M015 is ON, jumps to label numbered L3.
When M015 is off, executes the program at the next step, without jumping.

5-152
89. CALL Subroutine call (FUN 273)

(1) Usable devices

Constant
X Y M K V T C L P D N S
L S EL
PCk05 OP1 ○

Constant
X Y M K V T C L P D N S
L S EL
PCk06 OP1 ○

(2) Number of steps 2

(3) Symbol

(4) Function
When the input condition is ON, executes a subroutine bearing the label number specified by
OP1 and will reenter the main program on the "RET" instruction, then go to a step following
the step where it branched. When the input condition is OFF, executes the next program step.
Labels numbered PCk05:S0-S63 and PCk06:S0-S127 are available.

(5) Flag
No change

(6) Example of program


When M016 is ON, executes the subroutine having label number S0. When M016 is OFF,
executes the next program stop, without jumping to a subroutine.

Subroutine is written between the END and PEND instructions, starting with the LABEL
instruction and ending with the RET instruction.
Nesting is allowed, that is another subroutine call can be made in a current subroutine.

5-153
90. RET Return from subroutine (FUN 464)

(1) Number of steps 1

(2) Symbol

(3) Function
Indicates the end of subroutine called by the CALL instruction.
This instruction, when executed forces the system to go to a step following the step where the
CALL instruction was executed to call the subroutine.

Note) The RET instruction is not omissible though the CRET instruction can be omitted.

(4) Flag
No change

(5) Example of program


Terminates subroutine S0 and executes the program at the step following the step where the
CALL instruction was used to call the subroutine.

The RET instruction cannot include condition (contact).

5-154
91. CRET Return from subroutine (FUN 285)

(1) Number of steps 1

(2) Symbol

(3) Function
Terminates the subroutine if the calculated result up to CRET is ON .

Note) The RET instruction is not omissible though the CRET instruction can be omitted.

(4) Flag
No change

(5) Program (EX.)


Program to terminate subroutine when M000 is ON.

5-155
92. FOR Start repetition (FUN 472)

(1) Usable devices

X Y M K V T C L P D N S Constant
PCk05 OP1 ○

X Y M K V T C L P D N S Constant
PCk06 OP1 ○

(2) Number of steps 3

(3) Symbol

(4) Function
Repeatedly executes the program between this and NEXT instruction for the number of times
defined by OP1. The number of repetitions definable from OP1 is 1-9999. Number 0 executes
the program between FOR and NEXT only once.

Note) “FOR"-“NEXT" It is “FOR"-“NEXT" instruction or further “FORN"- “NEXT" The instruction


exists, and cannot be so-called nesting (nest).

(5) Flag
No change

(6) Example of program


Executes program between this and NEXT instructions 10 times.

The FOR instruction cannot include condition (contact).


The FOR is always paired with NEXT instruction when used.

5-156
93. FORN Start repetition (indirect) (FUN 476)

(1) Usable devices

M
X Y K V T C L P D N S Constant
0W - 0FW 40W - 4FW

PCk05 OP1 ○ ○ ○ ○ ○ ○ ○ ○ ○ ○

M
X Y K V T C L P D N S Constant
0W - 1FW 40W - 4FW

PCk06 OP1 ○ ○ ○ ○ ○ ○ ○ ○ ○ ○

(2) Number of steps 3

(3) Symbol

(4) Function
Repeats the program between this instruction and NEXT for the number of times defined by
the content(BCD) of OP1 register which will decrement the counts by 1 upon execution of this
instruction.
The program between FORN and NEXT is executed only once if OP1 register contains a 0.

Note) “FOR"-“NEXT" It is “FOR"-“NEXT" instruction or further “FORN"- “NEXT" The instruction


exists, and cannot be so-called nesting (nest).

(5) Flag
No change

(6) Example of program


Repeats the program between this instruction and NEXT for the number of times defined by
the content of register D0100.

The FORN instruction cannot include condition (contact). When the program has run for the
number specified, D1000 will contain 0.
The FORN is always paired with NEXT instruction when used.

5-157
94. NEXT End of repetition (FUN 480)

(1) Number of steps 1

(2) Symbol

(3) Function
Runs the program between FOR or FORN instruction and this instruction for the number of
times defined by the FOR or FORN instruction.

(4) Flag
No change

(5) Example of program


Runs the program written between FOR instruction and this instruction 5 times.

The NEXT instruction is paired with FOR or FORN instruction.


The NEXT instruction cannot include condition(contact).

5-158
5.4.12. Master control

Sets the range of master control.

5-159
95. MC Master control set (FUN 440)

(1) Usable devices

X Y M K V T C L P D N S Constant
PCk05 OP1 ○

X Y M K V T C L P D N S Constant
PCk06 OP1 ○

(2) Number of steps 1

(3) Symbol

(4) Function
This instruction indicates the start of the master control whose number is defined by OP1. The
range of the master control begins with this instruction and ends with MCR instruction starting
the same master control number with this instruction. When the input condition is ON, normal
program operation is performed within the area of master control. If the input condition is OFF,
however, all output instructions within the area are made off, and output type application
instructions cannot be executed. Master control numbers selectable from OP1 are 0 to 6.It
sequentially uses it from a small number at two or more use.

(5) Flag
No change

(6) Example of program


Executes the program written between No.5 MC instruction and No.5 MCR instruction while
M017 is ON. During off state of M017, output instructions are turned OFF regardless of the
input condition and any output type application instruction is not executed.

(When M017 is OFF, (L0 = OFF and W0VEare not executed regardless of X0 and X1
statuses.)
MC instruction is always paired with MCR instruction when used, MCR instruction cannot
include a condition (contact).

5-160
96. MCR Master control reset (FUN 444)

(1) Usable devices

X Y M K V T C L P D N S Constant
PCk05 OP1 ○

X Y M K V T C L P D N S Constant
PCk06 OP1 ○

(2) Number of steps 1

(3) Symbol

(4) Function
This instruction indicates the end of master control whose number is defined by OP1.
The range of the master control begins with MC instruction and ends with this MCR instruction.
Both instruction should carry the same master control number. For details, refer to MC
instruction described above.

(5) Flag
No change

5-161
5.4.13. Sequential interrupt

Enables or inhibits sequential interrupt (external interrupt).

5-162
97. DI Interrupt inhibit (FUN 276)

(1) Number of steps 1

(2) Symbol

(3) Function
Inhibits interrupt programs (external interrupt) until EI instruction is executed.

(4) Flag
No change

(5) Example of program


Inhibits interrupt when M01A switches from OFF to ON.

The DI instruction effectively inhibits interrupts until EI instruction is released: no need to


repeat DI instruction every scan cycle.

5-163
98. EI Interrupt enable (FUN 277)

(1) Number of steps 1

(2) Symbol

(3) Function
Releases interrupt inhibit status kept after power-up, reset-start or DI instruction and enables
execution of interrupt program.

(4) Flag
No change

(5) Example of program


Enables interrupt when M01C switches from OFF to ON.

Once executed, the DI instruction remains effective until the DI instruction is issued or an
interrupt is generated; no need to issue DI instruction every scan.

5-164
99. RETI Return from interrupt routine (FUN 468)

(1) Number of steps 1

(2) Symbol

(3) Function
This instruction indicates the end of interrupt program.
The Program that has been interrupted by the interrupt input can start again at the next step.

(4) Flag

(5) Example of program


Indicates the end of interrupt Program E0 (external interruption level 0) and I0 (fixed-cycle
interruption level 0).

The RETI instruction cannot contain condition(contact).


Interrupt programs are to be written between END and PEND instructions.

5-165
5.4.14. Label

This instruction is used to define a program range and to indicate a jump address.

5-166
100.START Main program start (FUN 448)

(1) Number of steps 0

(2) Symbol

(3) Function
Indicates the start of main sequential program.

(4) Flag
No change

(5) Example of program

START, END, LABEL, RET, RETI and PEND instructions cannot contain condition (contact).
START and LABEL instruction are non-operative instructions i.e. they do not perform effective
operation even when executed.

5-167
101.END Main program end (FUN 452)

(1) Number of steps 1

(2) Symbol

(3) Function
Indicates the end of main sequential Program.
After completion of this instruction, START instruction is used to run the program (restart of
the main sequence program from the beginning).

(4) Flag
No change

(5) Example of program


Refer to START instruction.

5-168
102.PEND End of program (FUN 456)

(1) Number of steps 0

(2) Symbol

(3) Function
Indicates the end of sequential program including subroutines and interrupt programs.

(4) Flag
No change

(5) Example of program


Refer to START instruction.
(This instruction is not used during normal operation.)

5-169
103.LABEL Label (FUN 460)

(1) Number of steps 2

(2) Symbol

(3) Function
Indicates the jump destination upon issuing of JMP instruction, CALL instruction or interrupt.

(4) Example of program


1) Indicates that the jump destination of JMP instruction is L0.

Indicates that the jump destination of JMP instruction is L0-L255. (decimal)

2) Indicates that the jump destination of CALL instruction is S0.

Indicates that the jump destination of CALL instruction is


PCk05:S0-S63(decimal) and PCK06:S0-S127(decimal).

3) Indicates that the jump destination of external interrupt is E1.

Indicates that the jump destination of external interrupt is


PCk05:E0-E1(decimal) and PCk05:E0-E3(decimal).

LABEL instruction cannot contain condition(contact).

5-170
5.4.15. Special module data transfer

104.SPR Special module data readout (FUN 304)

(1) Usable devices

M
X Y K V T C L P D N S Constant
0W - 0FW 40W - 4FW

PCk05 OP1 ○ ○ ○ ○ ○ ○ ○ ○ ○
OP2 ○ ○ ○ ○ ○ ○ ○ ○ ○
OP3 ○ ○ ○ ○ ○ ○ ○ ○ ○

M
X Y K V T C L P D N S Constant
0W - 1FW 40W - 4FW

PCk06 OP1 ○ ○ ○ ○ ○ ○ ○ ○ ○
OP2 ○ ○ ○ ○ ○ ○ ○ ○ ○
OP3 ○ ○ ○ ○ ○ ○ ○ ○ ○

(2) Number of steps 5

(3) Symbol

(4) Explanation
The module corresponding to the special module data reading is current CPU port2 only.
The SPR instruction is read and executed networking as an instruction. The data block is read
from the slave device on the same network. The function parameter is written in a consecutive
data register of two words beforehand by using the WMOV instruction twice. To use the SPR
instruction, the steps necessary is shown in the following.
・Step 1: Master PLC port2(F2 hex) is written in a high byte of the data register of the first
word and slave station number (0-90 BCD) is written in the subordinate position
byte.
・Step 2: The forwarded number of bytes is written in the second word of the data register in
BCD.
・Step 3: The data register in step 1 is executed in the first operand of the SPR instruction,
and reading beginning memory on the slave is executed in the second operand
and the memory is executed specifying it at the copy destination of the data read
from the slave to the third operand.

(5) Example of program


The program example is shown in next page.

5-171
In the following example, M000 turns on port2, and it accesses CPU port2 by the SPR
instruction when V60 (Refer to a special relay) shown while using it is off. Ten bytes' worth of
data (D0400-D0404) consecutive from slave CPU of child station number 5 is read, and it
copies it to data register position (D04C0-D04C4) of CPU via port2 of master CPU.

5-172
105. SPW Special module data write (FUN 306)

(1) Usable devices

M
X Y K V T C L P D N S Constant
0W - 0FW 40W - 4FW

PCk05 OP1 ○ ○ ○ ○ ○ ○ ○ ○ ○
OP2 ○ ○ ○ ○ ○ ○ ○ ○ ○
OP3 ○ ○ ○ ○ ○ ○ ○ ○ ○

M
X Y K V T C L P D N S Constant
0W - 1FW 40W - 4FW

PCk06 OP1 ○ ○ ○ ○ ○ ○ ○ ○ ○
OP2 ○ ○ ○ ○ ○ ○ ○ ○ ○
OP3 ○ ○ ○ ○ ○ ○ ○ ○ ○

(2) Number of steps 5

(3) Symbol

(4) Explanation
The module corresponding to the special module data writeing is current CPU port2 only.
The SPW instruction is networking written and it executes it as an instruction. The data block
is written in the slave device on the same network. The function parameter is written in a
consecutive data register of two words beforehand by using the WMOV instruction twice. To
use the SPW instruction, the steps necessary is shown in the following.
・Step 1: Master PLC port2(F2 hex) is written in a high byte of the data register of the first
word and slave station number (0-90 BCD) is written in the subordinate position
byte.
・Step 2: The forwarded number of bytes is written in the second word of the data register in
BCD.
・Step 3: The data register in step 1 is executed in the first operand of the SPW instruction,
and reading beginning memory on the master is executed in the second operand
and the memory ..the third operand.. is executed specifying it at the destination of
writing the slave.

(5) Example of program


The program example is shown in next page.

5-173
In the following example, M001 turns on port2, and it accesses CPU port2 by the SPW
instruction when V60 (Refer to a special relay) shown while using it is off. Ten bytes' worth of
data (D04C0-D04C4) consecutive from CPU on the master is read, and it copies it to data
register position (D0400-D0404) of slave CPU of station number 5 via master CPU port2.

5-174
5.4.16. Other application instruction

106.STOP Program stop (FUN 287)

(1) Number of steps 1

(2) Symbol

(3) Function
Halts the running sequential program. All the output relays are turned off.
To return from the state of STOP, the condition of abnormality is released. After that, it
changes to the RUN mode by using mode SW or PCwin-PCk of CPU.

1.It returns to operate of TERM→RUN (Stop in the TERM mode) or RUN→TERM→RUN


(Stop in compulsion RUN mode) in mode SW of CPU. Note) When compulsion RUN and
the STOP instruction is executed especially, STOP is done.

2.It makes it to the RUN mode by reset/starting CPU→CPU of the menu in Pcwin-PCk.

(4) Flag

V18:STOP relay and V16:TERM-STOP are turned on.

(5) Example of program


Stops the sequential program when M100 is ON.

5-175
107.WDR Scan timer reset (FUN 46)

(1) Number of steps 1

(2) Symbol

(3) Function
Resets the scan time monitor timer.

(4) Flag
No change

(5) Example of program


Resets the scan time monitor timer when M100 is ON.

The setup value for the scan time monitor timer can be set by parameter (refer to Chapter 3
"PARAMETER"). When the scan time is longer than the time set by the scan time monitor
timer due to the program construction, the CPU will output an error. When you don't want it to
be an error, either change the scan time setup value parameter or reset the current value of
the scan time monitor timer.

5-176
5.4.17. Clock / Calendar instruction

108.SYS Date instruction (FUN 300) PCk06

(1) Usable devices

M
X Y K V T C L P D N S Constant
0W - 1FW 40W - 4FW

PCk06 OP1 ○
OP2 ○
OP3 ○

(2) Number of steps 2

(3) Symbol

(4) Function
The setting at the date of CPU is executed.
OP1: System call number and 7F06h fixation.
OP2: Beginning house number of set data address of date.
It specifies it by the relative address of the data register.
(Two data address numbers are multiplied and + does offset value 2000h. )
(D0000-D0C7E)The done relative address for is (2000h-39FCh).
(D1000-D1FFE)The done relative address for is (4000h-5FFCh).
OP3:0 fixation.

Instruction execution time At execution 24.0usec At non-execution 1.2usec

(5) Flag
No change

(6) Example of program

The data of two words that starts from D0000 when M000 is turned on is assumed to be date data
and the date of CPU is set.
The data of two words that starts from D0000 is the order (day and day of the week)(year and
month). 0-6 corresponds to Sunday - Saturday on a day of the week.
Only data in each setting range of BCD becomes effective as for date set data, and other codes
are disregarded. (00-99) becomes the year, (01-12) becomes the month, (01-31) becomes the
day, and a day of the week becomes a range where (00-06) can be set.

CPU date is set on Monday, June 25,'07 in the place where it is D0000, and D0001=2501,0706.

The confirmation of CPU at the date now is a special register.


It does by reading S007 (day), S008 (month), S009 (year), and S00A (day of the week).

5-177
109.SYS Time instruction (FUN 300) PCk06

(1) Usable devices

M
X Y K V T C L P D N S Constant
0W - 1FW 40W - 4FW

PCk06 OP1 ○
OP2 ○
OP3 ○

(2) Number of steps 2

(3) Symbol

(5) Function
The setting of the time of CPU is executed.
OP1: System call number and 7F07h fixation.
OP2: Beginning house number of set data address of date.
It specifies it by the relative address of the data register.
(Two data address numbers are multiplied and + does offset value 2000h. )
(D0000-D0C7E)The done relative address for is (2000h-39FCh).
(D1000-D1FFE)The done relative address for is (4000h-5FFCh).
OP3:0 fixation.

Instruction execution time At execution 50.8usec At non-execution 1.2usec

(7) Flag
No change

(8) Example of program

The data of two words that starts from D0002 when M000 is turned on is assumed to be time data
and the time of CPU is set.
The data of two words that starts from D0002 is the order (minute and second) (unused and
time).
Only data in each setting range of BCD becomes effective as for time set data, and other codes
are disregarded. (00-59) becomes the second, (00-59) becomes the minute, and time becomes a
range where (00-23) can be set.

CPU time is set at 13:34:56 when it is D0002, and D0003=3456,0013.

CPU is confirmed by reading the special register, S004 (second), S005 (minute), and S006 (time)
at time now.

5-178
5.4.18. MODBUS RTU instruction

110.SYS MODBUS Read from Network (FUN 300) PCk06

(1) Usable devices

M
X Y K V T C L P D N S Constant
0W - 1FW 40W - 4FW

PCk06 OP1 ○
OP2 ○
OP3 ○

(2) Number of steps 6

(3) Symbol

(4) Function
Settled data is read from the slave device connected with CPU port2 at the MODBUS
network master, and the data is written in the memory of CPU.
The MODBUS network reading is executed by describing the SYS function three instructions
continuously.
In OP1, order is fixation in this order by the system call number, 7F10h, 7F11h, 7F12h, and
fixation.
(4)-1.OP1=7F10h
OP2= A high byte is a data size specification type.
00h Data addressing(Specify it by the relative address. )
01h Constant specification
A low byte is MODBUS data form + port number. (2 fixation)
00h 584/984 MODBUS data form modes
80h 484 MODBUS data form modes
Therefore, the data that can be specified with OP2 becomes only the following
four kinds.

0002h = data size specification is data addressing, and the MODBUS


data form is 584/984 modes.

0102h = data size specification is constant specification, and the


MODBUS data form is 584/984 modes.

0082h = data size specification is data addressing, and the MODBUS


data form is 484 modes.

0182h = data size specification is constant specification, and the


MODBUS data form is 484 modes.

5-179
OP3= A high byte is MODBUS function code.
01 Read a group of coils
02 Read a group of inputs
03 Read holding registers
04 Read input registers
07 Read Exception status
A low byte is specify a slave station address. (0-247)

(example) 0302h= The holding register of the slave station address 2 is read.

(4)-2. OP1=7F11h
OP2= Start master memory address
Specifies the starting memory address in the master where the data will be
placed.
Master Memory Address Ranges
Relative address
Operand Data Type PCk06 Range
(OP2 setting)
Inputs X000~X1FF 1000~11FF
Outputs Y400~Y5FF 1400~15FF
Internal Relays M000~M1FF 1800~19FF
Keep Relays K000~K1FF 0200~03FF
Timer Bits T000~T0FF 0600~06FF
Counter Bits C100~C17F 0700~077F
Link Relays input L000~L3FF 0800~0BFF
Link Relays output L400~L7FF 0C00~0FFF
D0000~D0C7F 2000~39FE
Data Registers
D1000~D1FFF 4000~5FFE

OP3= Start slave memory address


Specifies the starting slave memory address of the data to be read.
Slave Address Ranges
Start memory
MODBUS Slave Address
Function Code address
Data Format Range
(OP3 setting)
01-Read Coil 1~65535 0001~FFFF
02-Read Input Status 100001~165535 0001~FFFF
584/984
03-Read Holding Register 400001~465535 0001~FFFF
Mode
04-Read Input Register 300001~365535 0001~FFFF
07-Read Exception Status N/a 0000
01-Read Coil 1~999 0001~03E7
02-Read Input Status 1001~1999 0001~03E7
484 Mode 03-Read Holding Register 4001~4999 0001~03E7
04-Read Input Register 3001~3999 0001~03E7
07-Read Exception Status N/a 0000

5-180
(4)-3. OP1=7F12h
OP2= Number of elements
Specifies how many coils, input, holding registers or input register will be
read.
Number of Elements
Operand data PCk05/PCk06 Number of
Function Code elements
Type Range (OP2 setting)
. The specified content of the
Data D0000~D0C7F 2000~39FE
addressing
data register is assumed to
D1000~D1FFF 4000~5FFE
be data size specification
01-Read Coil 1~2000 0001~07D0
02-Read Input Status 1~2000 0001~07D0
Constant
specification
03-Read Holding Register 1~125 0001~007D
04-Read Input Register 1~125 0001~007D
07-Read Exception Status N/a 0000

OP3= Exception response buffer


Specifies the master memory address where the exception response will be
placed.
It specifies it by the relative address of the data register.
(Two data address numbers are multiplied and + does offset value 2000h. )
(D0000-D0C7E)The done relative address for is (2000h-39FCh).
(D1000-D1FFE)The done relative address for is (4000h-5FFCh).

Instruction execution time At execution 120.2usec At non-execution 1.3usec

(5) Flag
No change

(6) Example of program


PCk06 port2 has two special relay contacts associated with it (see 1.4.6. Special relay).
One indicates “Port busy”(V60), and the other indicates “Port Communication Error”(V61).
The “Port Busy” bit is on while the PLC communicates with the slave. When the bit is off the
program can initiate the next network request. The “Port Communication Error” bit turns on
when the PLC has detected an error and use of this bit is optional. When used, it should be
ahead of any network instruction boxes since the error bit is rest when an MODBUS read or
MODBUS write instruction executed. Typically network communications will last longer than 1
CPU scan. The program must wait for the communications to finish before starting the next
transaction.

The program example is shown in next page.

5-181
Example of program
Six holding registers that start from address 464601 of slave address number 2 are done and the
MODBUS reading is done. 96 bits are written in the master side memory that starts from M140.
The error response data is stored in D1F00.

5-182
111.SYS MODBUS Write to Network (FUN 300) PCk06

(1) Usable devices

M
X Y K V T C L P D N S Constant
0W - 1FW 40W - 4FW

PCk06 OP1 ○
OP2 ○
OP3 ○

(2) Number of steps 6

(3) Symbol

(4) Function
Data to which CPU memory is settled is read at the MODBUS network master, and it writes it
in the MODBUS memory address in the slave device on the network connected with CPU
port2.
The MODBUS network writing is executed by describing the SYS function three instructions
continuously.
In OP1, order is fixation in this order by the system call number, 7F20h, 7F21h, 7F22h, and
fixation.
(4)-1.OP1=7F20h
OP2= A high byte is a data size specification type.
00h Data addressing(Specify it by the relative address. )
01h Constant specification
A low byte is MODBUS data form + port number. (2 fixation)
00h 584/984 MODBUS data form modes
80h 484 MODBUS data form modes
Therefore, the data that can be specified with OP2 becomes only the following
four kinds.

0002h = data size specification is data addressing, and the MODBUS


data form is 584/984 modes.

0102h = data size specification is constant specification, and the


MODBUS data form is 584/984 modes.

0082h = data size specification is data addressing, and the MODBUS


data form is 484 modes.

0182h = data size specification is constant specification, and the


MODBUS data form is 484 modes.

5-183
OP3= A high byte is MODBUS function code.(decimal)
05 Force single coil
06 Preset single register
15 Force multiple coils
16 Force multiple registers
A low byte is specify a slave station address. (0-247)

(example)1002h= The preset value is set to two or more registers of the slave
station address 2.
Function code 16(decimal) of a high byte converts into the
hexadecimal and becomes 10h.
The slave station address of low byte is converted into the
hexadecimal and it specifies it.

(4)-2. OP1=7F21h
OP2= Start master memory address
Specifies the starting address of the data in the master that is to written to
the slave.
Master Memory Address Ranges
Relative address
Operand Data Type PCk06 Range
(OP2 setting)
Inputs X000~X1FF 1000~11FF
Outputs Y400~Y5FF 1400~15FF
Internal Relays M000~M1FF 1800~19FF
Keep Relays K000~K1FF 0200~03FF
Timer Bits T000~T0FF 0600~06FF
Counter Bits C100~C17F 0700~077F
Link Relays input L000~L3FF 0800~0BFF
Link Relays output L400~L7FF 0C00~0FFF
D0000~D0C7F 2000~39FE
Data Registers
D1000~D1FFF 4000~5FFE

OP3= Start slave memory address


Specifies the starting slave memory address where the data will be written.
Slave Address Ranges
Start memory
MODBUS Slave Address
Function Code address
Data Format Range
(OP3 setting)
05-Force Single Coil 1~65535 0001~FFFF
584/984 06-Preset Single Register 400001~465535 0001~FFFF
Mode 15-Force Multiple Coils 1~65535 0001~FFFF
16-Preset Multiple Registers 400001~465535 0001~FFFF
05-Force Single Coil 1~999 0001~03E7
06-Preset Single Register 4001~4999 0001~03E7
484 Mode
15-Force Multiple Coils 1~999 0001~03E7
16-Preset Multiple Registers 4001~4999 0001~03E7

5-184
(4)-3. OP1=7F22h
OP2= Number of elements
Specifies how many consecutive coils or registers will be written to.
This field is only active when either function code 15 or 16 is selected.
Number of Elements
Operand data PCk05/PCk06 Number of
Function Code elements
Type Range (OP2 setting)
The specified content of the
Data D0000~D0C7F 2000~39FE
addressing
data register is assumed to be
D1000~D1FFF 4000~5FFE
data size specification
05-Force Single Coil N/a 1
Constant 06-Preset Single Register N/a 1
specification 15-Force Multiple Coils 1~2000 0001~07D0
16-Preset Multiple Registers 1~125 0001~007D

OP3= Exception response buffer


Specifies the master memory address where the exception response will be
placed.
It specifies it by the relative address of the data register.
(Two data address numbers are multiplied and + does offset value 2000h. )
(D0000-D0C7E)The done relative address for is (2000h-39FCh).
(D1000-D1FFE)The done relative address for is (4000h-5FFCh).

Instruction execution time At execution 21.3usec At non-execution 1.3usec

(5) Flag
No change

(6) Example of program


PCk06 port2 has two special relay contacts associated with it (see 1.4.6. Special relay).
One indicates “Port busy”(V60), and the other indicates “Port Communication Error”(V61).
The “Port Busy” bit is on while the PLC communicates with the slave. When the bit is off the
program can initiate the next network request. The “Port Communication Error” bit turns on
when the PLC has detected an error and use of this bit is optional. When used, it should be
ahead of any network instruction boxes since the error bit is rest when an MODBUS read or
MODBUS write instruction executed. Typically network communications will last longer than 1
CPU scan. The program must wait for the communications to finish before starting the next
transaction.

The program example is shown in next page.

5-185
Example of program
The master side memory that starts from K000 is read by 112 bits, and MODBUS is written in 7
registers that start from address 464101 of slave station address 2. The error response data is
stored in D1F10.

5-186
6. Appendix Difference with DL05/06
Note that the ladder program to PCk05/06 cannot be converted when you use the instruction word
assumed to be not corresponding in the following table when the device that uses DirectLOGIC05/06 is
replaced with PCk05/06.

6.1. Boolean Instructions

DL Instruction DL05 DL06 PCk05/PCk06


STR STR STR
STRN STRN STR NOT
OR OR OR
ORN ORN OR NOT
AND AND AND
ANDN ANDN AND NOT
ANDSTR ANDSTR AND STR
ORSTR ORSTR OR STR
OROUT OROUT Not correspond
OUT OUT OUT
Boolean
NOT NOT NOT
Instructions
SET SET SET
RST RST RST
PAUSE PAUSE Not correspond
STRPD STRPD STR PTS
STRND STRND STR NTS
ORPD ORPD Not correspond
ORND ORND Not correspond
ANDPD ANDPD Not correspond
ANDND ANDND Not correspond
PD PD Not correspond 1 Scan on

6.2. Bit of Word Boolean Instructions


DL Instruction DL05 DL06 PCk05/PCk06
STRB Not correspond
STRNB Not correspond
ORB Not correspond
Bit of Word ORNB Not correspond
Boolean ANDB Not correspond
Instructions ANDNB Not correspond
OUTB Not correspond
SETB Not correspond
RSTB Not correspond

6-1
6.3. Comparative Boolean Instructions

DL Instruction DL05 DL06 PCk05/PCk06


STR STR W>=H W>=N
STRN STRN W<H W<N
OR OR W>=H W>=N
ORN ORN W<H W<N
AND AND W>=H W>=N
Comparative
ANDN ANDN W<H W<N
Boolean
STRE STRE W=H W=N
Instructions
STRNE STRNE W<>H W<>N
ORE ORE W=H W=N
ORNE ORNE W<>H W<>N
ANDE ANDE W=H W=N
ANDNE ANDNE W<>H W<>N

6.4. Immediate Instructions

DL Instruction DL05 DL06 PCk05/PCk06


STRI STRI Not correspond
STRNI STRNI Not correspond
ORI ORI Not correspond
ORNI ORNI Not correspond
ANDI ANDI Not correspond
ANDNI ANDNI Not correspond
Immediate
OROUTI OROUTI Not correspond
Instructions
OUTI OUTI Not correspond
OUTIF Not correspond
SETI SETI Not correspond
RSTI RSTI Not correspond
LDI Not correspond
LDIF Not correspond

6-2
6.5. Timer, Counter and Shift Register
DL Instruction DL05 DL06 PCk05/PCk06
TMR TMR TMR
TMRF TMRF TMRH
TMRA TMRA TMRS
Timer, Counter
TMRAF TMRAF TMRSH
and Shift
CNT CNT CNT
Register
SGCNT SGCNT Not correspond
UDC UDC CNTH
SR SR SFR SFL WSFR WSFL DSFR DSFL

6.6. Accumulator Data Instructions


DL Instruction DL05 DL06 PCk05/PCk06
LD LD It uses it in the application instruction.
LDSX LDSX It uses it in the application instruction.
LDD LDD It uses it in the application instruction.
LDX LDX It uses it in the application instruction.
LDA LDA It uses it in the application instruction.
LDF LDF Not correspond
RLDD Not correspond It doesn't do for the floating point.
Accumulator RLDDC Not correspond It doesn't do for the floating point.
Data LDSIX Not correspond
Instructions LDIX Not correspond
OUT OUT It uses it in the application instruction.
OUTD OUTD It uses it in the application instruction.
OUTF OUTF Not correspond
OUTL Not correspond
OUTM Not correspond
OUTIX Not correspond
POP POP It uses it in the application instruction.

6-3
6.7. Logical Instructions
DL Instruction DL05 DL06 PCk05/PCk06
AND AND WAND
ANDD ANDD DAND
ANDC ANDC WANDH DANDH
ANDF Not correspond
ANDS Not correspond
OR OR WOR
ORD ORD DOR
ORC ORC WORH DORH
ORF Not correspond
ORS Not correspond
Logical XOR XOR WXOR
Instructions XORD XORD DXOR
XORC XORC WXORH DXORH
XORF Not correspond
XORS Not correspond
CMP CMP WCP
CMPD CMPD DCP
CMPR CMPR Not correspond
CMPF Not correspond
RCMPR Not correspond It doesn't do for the floating point.
RCMPRC Not correspond It doesn't do for the floating point.
CMPS Not correspond

6-4
6.8. Math Instructions
DL Instruction DL05 DL06 PCk05/PCk06
ADD ADD W+P
ADDD ADDD D+P
ADDC ADDC W+HP D+HP
SUB SUB W-P
SUBD SUBD D-P
SUBC SUBC W-HP D-HP
MUL MUL W*P
MULS MULS W*HP
MULD MULD D*P
DIV DIV W/P
DIVS DIVS W/HP
DIVD DIVD D/P
INC INC WINCP
DEC DEC WDECP
INCB INCB WINC
DECB DECB WDEC
ADDB ADDB W+
BADDS BADDS W+H
ADDBD D+
BADDC D+H
SUBB SUBB W-
BSUBS BSUBS W-H
SUBBD D-
BSUBC D-H
Math MULB MULB W*
Instructions BMULS BMULS W*H
DIVB DIVB W/
BDIVS BDIVS W/H
ADDR Not correspond It doesn't do for the floating point.
RADDC Not correspond It doesn't do for the floating point.
SUBR Not correspond It doesn't do for the floating point.
RSUBC Not correspond It doesn't do for the floating point.
MULR Not correspond It doesn't do for the floating point.
RMULC Not correspond It doesn't do for the floating point.
DIVR Not correspond It doesn't do for the floating point.
RDIVC Not correspond It doesn't do for the floating point.
ADDF Not correspond Arbitrary bit
SUBF Not correspond Arbitrary bit
MULF Not correspond Arbitrary bit
DIVF Not correspond Arbitrary bit
ADDS Not correspond Stack operation
SUBS Not correspond Stack operation
MULS Not correspond Stack operation
DIVS Not correspond Stack operation
ADDBS Not correspond Stack operation
SUBBS Not correspond Stack operation
MULBS Not correspond Stack operation
DIVBS Not correspond Stack operation

6-5
6.9. Transcendental Functions
DL Instruction DL05 DL06 PCk05/PCk06
SQRTR Not correspond It doesn't do for the floating point
SINR Not correspond It doesn't do for the floating point
COSR Not correspond It doesn't do for the floating point
Transcendental
Functions TANR Not correspond It doesn't do for the floating point
ASINR Not correspond It doesn't do for the floating point
ACOSR Not correspond It doesn't do for the floating point
ATANR Not correspond It doesn't do for the floating point

6.10. Bit Instructions


DL Instruction DL05 DL06 PCk05/PCk06
SUM SUM WSUM DSUM
SHFR SHFR WBSFR DBSFR
SHFL SHFL WBSFL DBSFL
Bit Instructions ROTR DRR
ROTL DRL
ENCO ENCO ENCO
DECO DECO DECO

6.11. Number Conversion Instructions


DL Instruction DL05 DL06 PCk05/PCk06
BIN BIN WBIN DBIN
BCD BCD WBCD DBCD
INV INV WNOT DNOT
BCDPL Not correspond
ATH ATH JBIN
Number HTA HTA BJIS
Conversion GRAY GRAY Not correspond
Instructions SFLDGT SFLDGT Not correspond
BTOR Not correspond It doesn't do for the floating point
RTOB Not correspond It doesn't do for the floating point
RADR Not correspond It doesn't do for the floating point
DEGR Not correspond It doesn't do for the floating point
SEG Not correspond

6-6
6.12. Table Instructions
DL Instruction DL05 DL06 PCk05/PCk06
MOV MOV WBMOV
MOVMC MOVMC Not correspond
LDLBL LDLBL Not correspond
FILL WFIL
FIND WSRH2
FDGT Not correspond
FINDB Not correspond
TTD Not correspond
RFB Not correspond
Table STT Not correspond
Instructions RFT Not correspond
ATT Not correspond
TSHFL SUP UP2 WUP DUP
TSHFR SDOWN DOWN WDOWN DDOWN
ANDMOV Not correspond
ORMOV Not correspond
XORMOV Not correspond
SWAP WBXCH
SETBIT Not correspond
RSTBIT Not correspond

6.13. Clock / Calender Instructions


DL Instruction DL05 DL06 PCk05/PCk06
Clock / DATE SYS
Calender
Instructions TIME SYS

6.14. CPU Control Instructions


DL Instruction DL05 DL06 PCk05/PCk06
NOP NOP NOP
CPU Control END END END
Instructions STOP STOP STOP
RSTWDT RSTWDT WDR

6-7
6.15. Program Control Instructions
DL Instruction DL05 DL06 PCk05/PCk06
GOTO JMP
LBL LBL LABEL
FOR FOR FOR FORN
NEXT NEXT NEXT
Program GTS GTS CALL
Control
Instructions SBR SBR LABEL
RTC RTC CRET
RT RT RET
MLS MLS MC
MLR MLR MCR

6.16. Interrupt Instructions


DL Instruction DL05 DL06 PCk05/PCk06
ENI ENI EI
DISI DISI DI
Interrupt
Instructions
INT INT LABEL
IRTC IRTC Not correspond
IRT IRT RETI

6.17. Message Instructions


DL Instruction DL05 DL06 PCk05/PCk06
FAULT FAULT Not correspond
DLBL DLBL Not correspond
Message ACON ACON Not correspond
Instructions NCON NCON Not correspond
PRINT PRINT Not correspond
LCD Not correspond

6.18. Network Instructions


DL Instruction DL05 DL06 PCk05/PCk06
Network RX RX SPR
Instructions WX WX SPW

6.19. MODBUS Instructions


DL Instruction DL05 DL06 PCk05/PCk06
MODBUS MRX SYS
Instructions MWX SYS

6-8
6.20. ASCII Instructions
DL Instruction DL05 DL06 PCk05/PCk06
AIN Not correspond
AFIND Not correspond
AEX Not correspond
ASCII CMPV Not correspond
Instructions SWAPB Not correspond
VPRINT Not correspond
PRINTV Not correspond
ACRB Not correspond

6.21. Drum Instructions


DL Instruction DL05 DL06 PCk05/PCk06
DRUM DRUM Not correspond
Drum EDRUM EDRUM Not correspond
Instructions MDRMD Not correspond
MDRMW Not correspond

6.22. Intelligent I/O Instructions


DL Instruction DL05 DL06 PCk05/PCk06
Intelligent I/O RD RD Not correspond
Instructions WT WT Not correspond

6.23. RLL plus Instructions


DL Instruction DL05 DL06 PCk05/PCk06
ISG ISG Not correspond
SG SG Not correspond
JMP JMP Not correspond
NJMP NJMP Not correspond
RLL plus
Instructions
CV CV Not correspond
CVJMP CVJMP Not correspond
BCALL Not correspond
BLK Not correspond
BEND Not correspond

6-9
Index of instruction words

AND STR 5-5


AND, AND NOT 5-3

BJIS Binary to JIS code (FUN 157) 5-116

CALL Subroutine call (FUN 273) 5-153


CNT (Direct mode up counter) 5-23
CNT (Indirect mode up counter 5-24
CNTH (Direct mode up/down counter) 5-25
CNTH (Indirect up/down counter) 5-27
CRET Return from subroutine (FUN 285) 5-155

D- 32-bit data binary subtraction (FUN 171) PCk06 5-66


D*P 8-digit BCD multiplication (FUN 183) 5-71
D/P 8-digit BCD division (FUN 186) 5-74
D+ 32-bit data binary addition (FUN 169) PCk06 5-62
D+H Addition of hexadecimal 8-digit constant (FUN 325) PCk06 5-76
D+HP Addition of BCD 8-digit constant (FUN 328) 5-78
D+P 8-digit BCD addition (FUN 178) 5-64
DAND 32-bit data logical product(AND) (FUN 188) 5-89
DANDH Logical product (AND) of hexadecimal 8-digit constant (FUN 349) 5-97
DBCD 32-bit binary to 8-digit BCD (FUN 155) 5-113
DBIN 8-bit BCD to 32-bit binary (FUN 153) 5-111
DBSFL 32-bit data n bits left shift (FUN 229) 5-139
DBSFR 32-bit data n bits right shift (FUN 226) 5-134
DCP 32-bit data comparison (FUN 211) 5-125
DDOWN 32-bit data lower-digit direction shift (FUN 258) PCk06 5-147
DECO 4 to 16 decoder (FUN 50) 5-118
D-H Deduction of hexadecimal 8-digit constant (FUN 331) PCk06 5-60
D-HP Addition of BCD 8-digit constant (FUN 334) 5-82
DI Interrupt inhibit (FUN 276) 5-163
DMOV 8-digit Hex constant transfer (FUN102) 5-51
DMOVE 4-byte data direct transfer (FUN111) 5-54
DNOT 32-bit data inversion (FUN 192) 5-93
DOR 32-bit data logical sum(OR) (FUN 190) 5-91
DORH Logical sum (OR) of hexadecimal 8-digit constant (FUN 352) 5-99
DOWN Byte data lower-digit direction shift (FUN 256) PCk06 5-145
D-P 8-digit BCD subtraction (FUN 180) 5-68
DRL 32-bit data left rotate without carry (FUN 247) PCk06 5-150
DRR 32-bit data right rotate without carry (FUN 244) PCk06 5-149
DSFL 32-bit data 1 bit left shift (FUN 220) 5-137
DSFR 32-bit data 1 bit right shift (FUN 218) 5-132
DSUM 32-bit data ON-bit count (FUN 210) 5-128
DUP 32-bit data upper-digit direction shift (FUN 254) PCk06 5-143
DXCH 32-bit data exchange(FUN133) 5-57
DXOR 32-bit data exclusive logical sum(XOR) (FUN 194) 5-95
DXORH Exclusive logical sum (XOR) of hexadecimal 8-digit constant (FUN 355) 5-101

EI Interrupt enable (FUN 277) 5-164


ENCO 16 to 4 encoder (FUN 51) 5-120
END Main program end (FUN 452) 5-168

FOR Start repetition (FUN 472) 5-156


FORN Start repetition (indirect) (FUN 476) 5-157

JBIN JIS code to binary (FUN 156) 5-114


JMP JUMP (FUN 272) PCk06 5-152

LABEL Label (FUN 460) 5-170

MC Master control set (FUN 440) 5-160


MCR Master control reset (FUN 444) 5-161

NEXT End of repetition (FUN 480) 5-158

OR STR 5-6
OR, OR NOT 5-4
OUT 5-7

PEND End of program (FUN 456) 5-169


PTS, NTS 5-10

RET Return from subroutine (FUN 464) 5-154


RETI Return from interrupt routine (FUN 468) 5-165
RST 5-9

SDOWN 4 bit data lower-digit direction shift (FUN 255) PCk06 5-144
SFL Byte data 1 bit left shift (FUN 219) 5-135
SFR Byte data 1 bit right shift (FUN 217) 5-130
SPR Special module byte-data read (FUN 304) 5-171
SPW Special module byte-data write (FUN 306) 5-173
START Main program start (FUN 448) 5-167
STOP Program stop (FUN 287) 5-175
STR, STR NOT 5-2
SUP 4 bit data upper-digit direction shift (FUN 251) PCk06 5-140
SYS Date setting (FUN 300) PCk06 5-177
SYS Time setting (FUN 300) PCk06 5-178
SYS MODBUS Network read (FUN 300) PCk06 5-179
SYS MODBUS Network write (FUN 300) PCk06 5-183

TMR (Direct mode 100ms timer) 5-17


TMR (Indirect mode 100ms timer) 5-18
TMRH (Direct mode 10ms timer) 5-15
TMRH (Indirect mode 10ms timer) 5-16
TMRS (Direct mode 100 ms integrating timer) 5-21
TMRS (Indirect mode 100 ms integrating timer) 5-22
TMRSH (Direct mode 10ms integrating timer) 5-19
TMRSH (Indirect mode 10ms integrating timer) 5-20

UP2 Byte data upper-digit direction shift 2 (FUN 252) PCk06 5-319

W- Word data binary subtraction (FUN 93) 5-65


W* Word data binary multiplication (FUN 94) 5-69
W*H Multiplication of hexadecimal 4-digit constant (FUN 336) 5-93
W*HP Multiplication of BCD 4-digit constant (FUN 339) 5-84
W*P 4-digit BCD multiplication (FUN 182) 5-70
W/ Word data binary division 2 (FUN 175) 5-72
W/H Divide of hexadecimal 4-digit constant (FUN 342) 5-85
W/HP Divide of BCD 4-digit constant (FUN 345) 5-86
W/P 4-digit BCD division (FUN 185) 5-73
W+ Word data binary addition (FUN 92) 5-61
W+H Addition of hexadecimal 4-digit constant (FUN 324) 5-75
W+HP Addition of BCD 4-digit constant (FUN 327) 5-77
W+P 4-digit BCD addition (FUN 10) 5-63
W<>H 4-digit hexadecimal constant comparison (<>) 5-33
W<>N Word data comparison (<>) 5-34
W<H 4-digit hexadecimal constant comparison (<) 5-37
W<N Word data comparison (<) 5-38
W=H 4-digit hexadecimal constant comparison (=) 5-31
W=N Word data comparison (=) 5-32
W>=H 4-digit hexadecimal constant comparison (>=) 5-35
W>=N Word data comparison (>=) 5-36
WAND Word data logical product(AND) (FUN 187) 5-88
WANDH Logical product (AND) of hexadecimal 4-digit constant (FUN 348) PC3J 5-96
WBCD 16-bit binary to 4-bit BCD (FUN 4) 5-112
WBIN 4-digit BCD to 16-bit binary (FUN 3) 5-110
WBMOV Word data block transfer (FUN119) 5-55
WBSFL Word data n bits left shift (FUN 228) 5-138
WBSFR Word data n bits right shift (FUN 225) 5-133
WBXCH Word data block exchange (FUN 135) PCk06 5-58
WCP Word data comparison (FUN 12) 5-124
WDEC Word data binary decrement (FUN 64) 5-105
WDECP 4-digit BCD decrement (FUN 203) 5-106
WDOWN Word data lower-digit direction shift (FUN 257) PCk06 5-146
WDR Scan timer reset (FUN 46) 5-176
WFIL Word data fill (FUN 129) PCk06 5-59
W-H Deduction of hexadecimal 4-digit constant (FUN 330) PC3J 5-79
W-HP Addition of BCD 4-digit constant (FUN 333) PC3J 5-81
WINC Word data binary increment (FUN 63) 5-103
WINCP 4-digit BCD increment (FUN 200) 5-104
WMOV 4-digit Hex constant transfer (FUN101) 5-50
WMOVE 2-byte data direct transfer (FUN0) 5-53
WMOVT 4-digit Hex constant transfer to two places (FUN 110) 5-52
WNOT Word data inversion (FUN 191) 5-92
WOR Word data logical sum(OR) (FUN 189) 5-90
WORH Logical sum (OR) of hexadecimal 4-digit constant (FUN 351) PC3J 5-98
W-P 4-digit BCD subtraction (FUN 11) 5-67
WSFL Word data 1 bit left shift (FUN 37) 5-136
WSFR Word data 1 bit right shift (FUN 36) 5-131
WSRH2 Word data search 2 (FUN 213) PCk06 5-108
WUP Word data upper-digit direction shift (FUN 253) PCk06 5-142
WXCH 16-bit data exchange(FUN2) 5-56
WXOR Word data exclusive logical sum(XOR) (FUN 193) 5-94
WXORH Exclusive logical sum (XOR) of hexadecimal 4-digit constant (FUN 354) PC3J 5-100
· The descriptive contents of this Manual are subject to change due
to better improvement of applicable product without prior notice.
· This Manual is issued after careful check and review of the contents
thereof. However, should any doubt or any descriptive error be
found in the contents, please feel free to contact us.
· It is prohibited to copy and transfer , wholly or partly, the descriptive
contents of this Manual to others.

1st Edition : Sep.2007


∗ We are ready to comply with your request for maintenance ,
Please forward: Service Group (Phone: 0566-21-8621), Higashi-Kariya Plant

Machine Tools&MECHATRONICS DIVISION


HIGASHI KARIYA Plant KitaJizoyama1-7,Nodacho,Kariya, Aichi-Pref.
Post Code 448-0803 Japan
Manual No.
TEL 81-566-21-8611 FAX 81-566-23-6670
T-3611E
©
JTEKT CORPORATION 2007-2007.

* The specification and other given in this manual are subject to change due to improvement without prior notice.
* Any product applicable to the strategic goods (or the services) stipulated in the Foreign Exchange and Foreign Trade Control Act is
subject to export license of the Japanese Government, where exported to overseas.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy