N700-Programing 1 Manual
N700-Programing 1 Manual
1. Basic Instruction
Basic Sequence Instruction
ST Start ..........................................................................................103
ST/ Start not ...................................................................................103
OT Out .............................................................................................103
OR OR ...............................................................................................104
OR/ OR not ........................................................................................104
AN And .............................................................................................105
AN/ And/.............................................................................................105
/ Not .............................................................................................106
ANS AND Stack ...................................................................................107
ORS OR Stack .....................................................................................107
PSHS Push Stack .................................................................................108
RDS Read Stack .................................................................................108
POPS Pop Stack ...................................................................................108
KP Keep ...........................................................................................109
NOP No operation ..............................................................................110
DF Leading edge differential ........................................................111
DF/ Trailing edge differential .......................................................111
F48( DB- ) P43( PDB- ) 8-digit BCD [S1+1, S1) - (S2+1, S2)
-> (D+1, D)] ......................222
F51( DB* ) P51( PDB* ) 8-digit BCD [S1+1, S1) x (S2+1, S2)
-> (D+1, D)] ......................226
F53( DB% ) P53( PDB% ) 8-digit BCD [S1+1, S1) / (S2+1, S2)
-> (D+1,D)] (DT9016, DT90150] .................230
F55( B+1 ) P55( PB+1 ) 4-digit BCD increnent [D+1 ->D] ...................232
F56(DB+1 ) P56( PDB+1 ) 8-digit BCD increment [D+1,D) + 1
-> (D+1, D)] ......................234
F57( B-1 ) P57( PB-1 ) 4-digit BCD decrenent [D-1 ->D] ...................236
F58(DB-1 ) P58( PDB-1 ) 8-digit BCD decrenent [D+1,D) - 1
-> (D+1, D) ........................238
Data Comparision Instructions
F80( BCD) P80( PBCD ) 16-bit data -> 4-digit BCD ......................262
F81( BIN ) P81( PBIN ) 4-digit BCD -> 16bit data ...........................264
F82( DBCD ) P82( PDBCD ) 32-bit data -> 8-digit BCD ......................266
F83( DBIN ) P83( PDBIN ) 8-digit BCD -> 32bit data ...........................268
F84( INV ) P84( PINV ) 16 bit data Invert .......................................270
F85( NEG ) P86( PNEG ) 16 bit data Two's complement ......................272
F86( DNEG ) P86( PDNEG ) 32 bit data Two's complement ......................274
F87( ABS ) P87( PABS ) 16 bit data Absolute ...................................276
F88( DABS ) P88( PDABS ) 32 bit data Absolute ...................................278
F89( EXT ) P89( PEXT ) 16 bit data Sign extension .........................280
F90( DECO ) P90( PDECO ) Decode ...........................................................282
F91( SEGT ) P91( PSEGT ) 16 bit data 7-segment decode ......................285
F92( ENCO ) P92( PENCO ) Encode ...........................................................287
F93( UNIT ) P93( PUNIT ) 16 bit data Combine .....................................290
F94(DIST ) P94( PDIST ) 16 bit data Distribute ................................292
F95( ASC ) P95( PASC ) Character -> ASCII code ..............................294
F96( SRC ) P96( PSRC ) Table data Search ........................................296
Special instructions
-9-
Chapter 1
Data Memory(Operand)
1-1. Data Memory(Operands)
Number
Names of Operand of points Data No. Functions
X External input relay 2,048 Bit 0∼127F A total of 2,048 I/0 points can be used.
Any external output relay ( Y ) which is not
used as an external output can be assigned
Y External output relay 2,048 Bit 0∼127F as an internal relay.
R Internal relay 1,568 Bit 0∼97F Relay which can be used only in the
PLC
Relay for the transfer of data used in the
L Link relay 2,048 Bit 0∼127F PLC Link. Any link relay ( L ) which is
not used for the link can be assigned as
an internal relay.
DT Special data register 256 Wor 0∼255 Data register having a specific
d application.
Timer /Counter 256 Wor 0∼255 Data memory in which the Preset ( Set
SV Set value area
d ) value of timer / counter is stored.
Timer /Counter 256 Wor 0∼255 Data memory in which the Elapsed
EV Elapsed value area
d value of timer / counter is stored.
Notes :
These are the maximum values which can be used when the sequence program area is set to
2k steps (minimum).
The lowest digit for X, Y, R and L is in hexadecimal and the second and higher digits are
in decimal to enable both bit and word processing.
All other numbers are in decimal.
■ Bit No. and Word No.
Correspondence between bit No. and word No.
Place a" W" before the relay symbol to address a relay ( which can be addressed in bit units ) in word units.
Example 1 : For Y
Y 5 7 D W 5 7
Y
Bit No. in hexadecimal 0 to F
X7 X7 X7D X7C X7 X7 X79 X78 X77 X76 X75 X74 X73 X72 X71 X70
WX7 F E B A
X0 to XF WX0
X10 to X1F WX1
External input relay
X1260 to X126F WX126
X1270 to X127F WX127
Y0 to YF WY0
Y10 to Y1F WY1
External output relay
Y1260 to Y126F WY126
Y1270 to Y127F WY127
R0 to RF WR0
R10 to R1F WR1
Internal Relay
Y960 to Y96F WR96
Y970 to Y97F WR97
L0 to LF WL0
L10 to L1F WL1
Link relay
L1260 to L126F WL126
L1270 to L127F WL127
1. External I/0 Relays ( X, Y )
The external I/0 relays exchange data with the external I/0 units.
This relay feeds signals to the PLC from an external device ( e.g. limit switch,
photoelectric sensor ).
LS6 X6
PB10
XA
LS13
XC
This relay outputs the operation result of the PLC and activates an external device such as a
solenoid or display unit.
External output relays ( Y ) in the area in which the Input Unit is installed and in the area in
which the unit is not installed can be both used as internal relays.
However, this case is not of the hold type.
Remark :
Both external input relays ( X ) and external output relays ( Y ) can be handled as WX and WY in
1-word units. (Data can be processed in 1-bit units when X and Y are specified and in 16-bit units
when WX and WY are specified.)
2. Internal Relay ( R )
The internal relay(R) does not provide an external output and can be used only within the PLC.
R0
∫
Non-hold area
R59F
60 WR60 ∼ R600
∫
Hold area
R97F
Remark :
Assigning timer/ counter and hold/ non-hold area is performed in system registers.
0
∫
Specify the start No. of the counter Timer area
in System register No. 5. 199
(It can be specified in 1-point units within the
range 0 to 256. 200 200
If K256 is specified, all area become timers.) Counter area ∫
255
default value
0
Specify the start No. of the hold type ∫
Non-hold area
in System register No. 6. 199
( It can be specified in 1-point
units within the range 0 to 256. 200 200
if K256 is specified, the entire Hold area ∫
area will be the non-hold type. )
255
default value
Note :
2) The next scan continues and when the operating trigger tums ON, the Count ( Elapsed ) time of the
previous scan is subtracted from the Count ( Elapsed ) value area ( EVn ) arid the result is placed
back into the Count( Elapsed ) value area ( EVn ).
If the result is 0 or negative, the timer times out, the timer contact turns ON and the Count
( Elapsed ) value area is set to O.
3) If the trigger turns OFF while the timer is in the timing operation or has timed out, the Count
( Elapsed ) value area is set to 0 and the timer contact tums OFF.
4) Since the timer instruction ( TM ) subtracts the elapsed time of the previous scan from the Count
(Elapsed) value area ( EVn ) when the trigger tums ON, be sure to execute it once during each scan.
If the timer instruction ( TM ) is not executed ( e.g. due to a jump instruction ) during a scan, the
Count ( Elapsed ) value will not be decremented.
( During this period, the timer's Count ( Elapsed ) value will remain unchanged. )
5) The Preset ( Set ) value area ( SVn ) and Count ( Elapsed ) value area ( EVn ) can be read from
and written to as desired.
[2] Timer accuracy
1) The period from when the trigger of the timer instruction (TM ) tums ON to the point when the timer times out,
time accuracy is:
Data registers represent data memory that can be used within the PLC.
When Dn is specified : Dn + 1 Dn
Assignment of the hold/ non-hold type area is performed in the System register.
2047
The file registers are for data register expansion and use the user program area.
They are used in the same manner as data registers.
The start of the hold area can be specified in 1 -word units in system register No. 9.
Description
The link relay is for the PLC Link and cannot be used as an external output.
The range of memory used for the link register, the starting address of the send area, the number of
words in the send area, and the starting address of the hold area can be specified using the System
register.
Specify the settings above separately for Link Loop 0 and Link Loop 1.
The size of the area for each is fixed at 1,024 points.
7. Link register (Ld)
Description
The link register is a data register for the PLC link and cannot be used as an external output.
The range of memory used for the link register, the starting address of the send area, the number of
words in the send area, and the starting address of the hold area can be specified using the System
register.
Specify the settings above separately for Link Loop 0 and Link Loop 1.
The size of area for each is fixed at 128 words.
8. Special relays ( R : R9000 to R910F )
Description
These are special relays which have specific applications.
These special relays cannot be used for output. Use them only as contacts.
R9001 Voltage dip *1 The times of voltage dips are set on DT9001.
R9002 Fuse blow The fuse blown slots are set on DT9002, DT9003.
R9003 Advanced unit error The error slots are set on. DT9006,DT9007.
R9004 I/O verify error The verify error slots are set on DT9010, DT9011.
Error : ON *2
R9006 Battery error holding
Once a battery error is found, that is held even after restoring.
HOLD.
R9007 Operation error flag
The error address is set on DT9017.
WR900 NEWEST.
R9008 Operation error flag
The error address is set on DT9018
R900E Unused
R900F Unused
*1. When a voltage dip less than 10millisec. occurs, the PLC continues to run. When
more than 20millisec., it stops and its output becomes OFF. When from 10 to 20
millisec., the operation is decided by the condition.
*2. To turn off the battery error holding relay, turn off the power or initialize it.
Notes :
1. When a voltage dip less than 10ms. occurs, The PLC continues to run.
When more than 20ms, it stops and its output becomes OFF. When from 10 to 20ms, the
operation is decided by the condition.
2. To turn off the battery error holding relay, turn off the power or initialize it.
WORD NO. NUMBER ITEM DESCRIPTION
Turns OFF only at the first scan of the program run and
R9014 Initial pulse (OFF)
turns ON after the second scan.
Step initial pulse With SSTP instruction, turns ON only at the first scan
R9015
(ON) of a job run.
R9016 Unused
R901F Unused
WORD NO. NUMBER ITEM DESCRIPTION
R9020 RUN mode flag RUN mode : ON, PROG mode : OFF
R9021 Test mode flag Test run mode : ON, Run mode : OFF
Output refresh flag in Turns ON when output refresh is specified in TEST RUN
R9024
TEST RUN mode.
Single instruction
R9025 Turns ON when single instruction execution is specified.
execution flag
External interrupt
R902A Turns ON when external interrupts are enabled.
EIflag
R905C
R905D
R906E
R905F
WORD
NUMBER ITEM DESCRIPTION
NO.
Unit No.1 Normal transmission : ON,
R9060
error or stop : OFF
Unit No. 2 Normal transmission :ON,
R9061
error or stop : OFF
Unit No.3 Normal transmission :NO,
R9062
error or stop : OFF
Unit No. 4 Normal transmission :ON,
R9063
error or stop : OFF
Unit No. 5 Normal transmission : ON,
R9064
error or stop : OFF
Unit No. 6 Normal transmission : ON,
R9065
error or stop : OFF
Unit No. 7 Normal transmission : ON,
R9066
error or stop : OFF
R9067
Transmission Unit No. 8 Normal transmission : ON,
Assurance Relay for error or stop : OFF
WR906 Unit No. 9 Normal transmission : ON,
R9068 PLC LINK 0
error or stop : OFF
Unit No. 10 Normal transmission : ON,
R9069
error or stop : OFF
Unit No. 11 Normal transmission : ON,
R906A
error or stop : OFF
Unit No. 12 Normal transmission : ON,
R906B
error or stop : OFF
Unit No. 13 Normal transmission : ON,
R906C
error or stop : OFF
Unit No. 14 Normal transmission : ON,
R906D
error or stop : OFF
Unit No. 15 Normal transmission : ON,
R906E
error or stop : OFF
Unit No. 16 Normal transmission : ON,
R906F
error or stop : OFF
WORD
NUMBER ITEM DESCRIPTION
NO.
R9077 Operation Mode Unit No.8 RUN mode : ON, PROG mode : OFF
WR907 Relay for PLC
R9078 LINK 0 Unit No.9 RUN mode : ON, PROG mode : OFF
R9096 Operation Mode Unit No. 7 RUN mode : ON, PROG mode : OFF
Relay for PLC
R9097 LINK 1 Unit No. 8 RUN mode : ON, PROG mode : OFF
WR909
R9098 Unit No. 9 RUN mode : ON, PROG mode : OFF
Data cannot be written to special data registers except for the step ladder condition display ( DT9060 to DT9122 )
Note :
The special data registers ( DT9060 to DT9122 ) can be written with the FPST-software or Handy loader
.
Using this function. the step ladder programs can be forced ON or OFF optionally.
However, the values cannot be changed w th h gh leve nstructions [e.g. move instruction ( MV ) ]
DT9004 Unused
DT9005 Unused
DT9012 Unused
DT9013 Unused
Operation auxiliary
DT9014 Used by BSR, BSL instructions.
register
Operation expansion
DT9015 Remainder of 16-bit division.
register (0)
Operation expansion Remainder of 32-bit division. Use with
DT9016
register (1) expansion register (0).
Operation error Hold. Keeps the latest address where an
DT9017
address operation error occurs.
Operation error
DT9018 Newest. Keeps the latest address where an operation error occurs.
address
Increments by one every 2.5millisec. You can know time by
DT9019 2.5msec. RING counter subtracting the previlus value from current value and dividing the
difference by 2.5.
NUMBER NAME DESCRIPTION
Keeps the maximum program address of the program area size
DT9020 Program max. value
of SYSTEM REGISTER SETTING.
File register max.
DT9021 Keeps the maximum no. of the file register.
value
Current value : Shows the current value of scan time.
DT9022 Scan time ex.) within 5millisec. when the display is K50,
and within 12.5millisec. when K125
DT9023 Scan time Minimum value : Keeps the minimum value of the scan time.
DT9024 Scan time Maximum value : Keeps the maximum value of the scan time.
DT9070
during Operation Running: 1 Bit 0 ∼ Bit 15
Waiting: 0 →Step 160 →Step 175
Running: 1 Bit 0 ∼ Bit 15
DT9071
Waiting: 0 →Step 176 →Step 191
Running: 1 Bit 0 ∼ Bit 15
DT9072
Waiting: 0 →Step 192 →Step 207
Running: 1 Bit 0 ∼ Bit 15
DT9073
Waiting: 0 →Step 208 →Step 223
Running: 1 Bit 0 ∼ Bit 15
DT9074
Waiting: 0 →Step 224 →Step 239
Running: 1 Bit 0 ∼ Bit 15
DT9075
Waiting: 0 →Step 240 →Step 255
Running: 1 Bit 0 ∼ Bit 15
DT9076
Waiting: 0 →Step 256 →Step 271
Running: 1 Bit 0 ∼ Bit 15
DT9077
Waiting: 0 →Step 272 →Step 287
Running: 1 Bit 0 ∼ Bit 15
DT9078
Waiting: 0 →Step 288 →Step 303
DT9079 Running: 1 Bit 0 ∼ Bit 15
Waiting: 0 →Step 304 →Step 319
NUMBER NAME DESCRIPTION
Running: 1 Bit 0 ∼ Bit 15
DT9080
Waiting: 0 →Step 320 →Step 335
Running: 1 Bit 0 ∼ Bit 15
DT9081
Waiting: 0 →Step 336 →Step 351
Running: 1 Bit 0 ∼ Bit 15
DT9082
Waiting: 0 →Step 352 →Step 367
Running: 1 Bit 0 ∼ Bit 15
DT9083
Waiting: 0 →Step 368 →Step 383
Running: 1 Bit 0 ∼ Bit 15
DT9084
Waiting: 0 →Step 384 →Step 399
Running: 1 Bit 0 ∼ Bit 15
DT9085
Waiting: 0 →Step 400 →Step 415
Running: 1 Bit 0 ∼ Bit 15
DT9086
Waiting: 0 →Step 416 →Step 431
Running: 1 Bit 0 ∼ Bit 15
DT9087
Waiting: 0 →Step 432 →Step 447
Running: 1 Bit 0 ∼ Bit 15
DT9088
Waiting: 0 →Step 448 →Step 463
Running: 1 Bit 0 ∼ Bit 15
DT9089
Process display Waiting: 0 →Step 464 →Step 479
DT9090
during operation Running: 1 Bit 0 ∼ Bit 15
Waiting: 0 →Step 480 →Step 495
Running: 1 Bit 0 ∼ Bit 15
DT9091
Waiting: 0 →Step 496 →Step 511
Running: 1 Bit 0 ∼ Bit 15
DT9092
Waiting: 0 →Step 512 →Step 527
Running: 1 Bit 0 ∼ Bit 15
DT9093
Waiting: 0 →Step 528 →Step 543
Running: 1 Bit 0 ∼ Bit 15
DT9094
Waiting: 0 →Step 544 →Step 559
Running: 1 Bit 0 ∼ Bit 15
DT9095
Waiting: 0 →Step 560 →Step 575
Running: 1 Bit 0 ∼ Bit 15
DT9096
Waiting: 0 →Step 576 →Step 591
Running: 1 Bit 0 ∼ Bit 15
DT9097
Waiting: 0 →Step 592 →Step 607
Running: 1 Bit 0 ∼ Bit 15
DT9098
Waiting: 0 →Step 608 →Step 623
DT9099 Running: 1 Bit 0 ∼ Bit 15
Waiting: 0 →Step 624 →Step 639
NUMBER NAME DESCRIPTION
Running: 1 Bit 0 ∼ Bit 15
DT9080
Waiting: 0 →Step 320 →Step 335
Running: 1 Bit 0 ∼ Bit 15
DT9081
Waiting: 0 →Step 336 →Step 351
Running: 1 Bit 0 ∼ Bit 15
DT9082
Waiting: 0 →Step 352 →Step 367
Running: 1 Bit 0 ∼ Bit 15
DT9083
Waiting: 0 →Step 368 →Step 383
Running: 1 Bit 0 ∼ Bit 15
DT9084
Waiting: 0 →Step 384 →Step 399
Running: 1 Bit 0 ∼ Bit 15
DT9085
Waiting: 0 →Step 400 →Step 415
Running: 1 Bit 0 ∼ Bit 15
DT9086
Waiting: 0 →Step 416 →Step 431
Running: 1 Bit 0 ∼ Bit 15
DT9087
Waiting: 0 →Step 432 →Step 447
Running: 1 Bit 0 ∼ Bit 15
DT9088
Waiting: 0 →Step 448 →Step 463
Running: 1 Bit 0 ∼ Bit 15
DT9089
Process Display Waiting: 0 →Step 464 →Step 479
DT9090
during Operation Running: 1 Bit 0 ∼ Bit 15
Waiting: 0 →Step 480 →Step 495
Running: 1 Bit 0 ∼ Bit 15
DT9091
Waiting: 0 →Step 496 →Step 511
Running: 1 Bit 0 ∼ Bit 15
DT9092
Waiting: 0 →Step 512 →Step 527
Running: 1 Bit 0 ∼ Bit 15
DT9093
Waiting: 0 →Step 528 →Step 543
Running: 1 Bit 0 ∼ Bit 15
DT9094
Waiting: 0 →Step 544 →Step 559
Running: 1 Bit 0 ∼ Bit 15
DT9095
Waiting: 0 →Step 560 →Step 575
Running: 1 Bit 0 ∼ Bit 15
DT9096
Waiting: 0 →Step 576 →Step 591
Running: 1 Bit 0 ∼ Bit 15
DT9097
Waiting: 0 →Step 592 →Step 607
Running: 1 Bit 0 ∼ Bit 15
DT9098
Waiting: 0 →Step 608 →Step 623
DT9099 Running: 1 Bit 0 ∼ Bit 15
Waiting: 0 →Step 624 →Step 639
NUMBER NAME DESCRIPTION
Running: 1 Bit 0 ∼ Bit 15
DT9100
Waiting: 0 →Step 640 →Step 655
Running: 1 Bit 0 ∼ Bit 15
DT9101
Waiting: 0 →Step 656 →Step 671
Running: 1 Bit 0 ∼ Bit 15
DT9102
Waiting: 0 →Step 672 →Step 687
Running: 1 Bit 0 ∼ Bit 15
DT9103
Waiting: 0 →Step 688 →Step 703
Running: 1 Bit 0 ∼ Bit 15
DT9104
Waiting: 0 →Step 704 →Step 719
Running: 1 Bit 0 ∼ Bit 15
DT9105
Waiting: 0 →Step 720 →Step 735
Running: 1 Bit 0 ∼ Bit 15
DT9106
Waiting: 0 →Step 736 →Step 751
Running: 1 Bit 0 ∼ Bit 15
DT9107
Waiting: 0 →Step 752 →Step 767
Running: 1 Bit 0 ∼ Bit 15
DT9108
Waiting: 0 →Step 768 →Step 783
Running: 1 Bit 0 ∼ Bit 15
DT9109
Process Display Waiting: 0 →Step 784 →Step 799
DT9110
during Operation Running: 1 Bit 0 ∼ Bit 15
Waiting: 0 →Step 800 →Step 815
Running: 1 Bit 0 ∼ Bit 15
DT9111
Waiting: 0 →Step 816 →Step 831
Running: 1 Bit 0 ∼ Bit 15
DT9112
Waiting: 0 →Step 832 →Step 847
Running: 1 Bit 0 ∼ Bit 15
DT9113
Waiting: 0 →Step 848 →Step 863
Running: 1 Bit 0 ∼ Bit 15
DT9114
Waiting: 0 →Step 864 →Step 879
Running: 1 Bit 0 ∼ Bit 15
DT9115
Waiting: 0 →Step 880 →Step 895
Running: 1 Bit 0 ∼ Bit 15
DT9116
Waiting: 0 →Step 896 →Step 911
Running: 1 Bit 0 ∼ Bit 15
DT9117
Waiting: 0 →Step 912 →Step 927
Running: 1 Bit 0 ∼ Bit 15
DT9118
Waiting: 0 →Step 928 →Step 943
DT9119 Running: 1 Bit 0 ∼ Bit 15
Waiting: 0 →Step 944 →Step 959
NUMBER NAME DESCRIPTION
Running: 1 Bit 0 ∼ Bit 15
DT9120
Waiting: 0 →Step 960 →Step 975
Process Display Running: 1 Bit 0 ∼ Bit 15
DT9121
during Operation Waiting: 0 →Step 976 →Step 991
Running: 1 Bit 0 ∼ Bit 15
DT9122
Waiting: 0 →Step 992 →Step 999
DT9123 Unused
DT9124 Unused
DT9125 Unused
DT9126 Unused
DT9129 Unused
DT9130 Unused
DT9138 Unused
DT9139
Unused
NUMBER NAME DESCRIPTION
RING counter
DT9140
DT9159
System use, PLC Link 1, work for sending interval measurement
NUMBER NAME DESCRIPTION
Link Unit No.
DT9160 Keeps Unit No. of Link Loop 1.
(Link 1)
DT9161 Error flag Keeps error flag of Link Loop 1.
Link Unit No.
DT9162 Keeps Unit No. of Link Loop 2.
(Link 2)
DT9163 Error flag Keeps error flag of Link Loop 2.
Link Unit No.
DT9164 Keeps Unit No. of Link Loop 3.
(Link 3)
Keeps error flag of Link Loop 3.
DT9165 Error flag
DT9166 Unused
DT9167 Unused
DT9168 Unused
DT9169 Unused
DT9175
Link 1 status Times of synchronization errors
DT9179
Send WACK
NUMBER NAME DESCRIPTION
DT9195 Unused
DT9196 Unused
DT9197 Unused
DT9198 Unused
DT9199 Unused
NUMBER NAME DESCRIPTION
DT9225 Unused
DT9226 Unused
DT9227 Unused
DT9228 Unused
DT9229 Unused
DT9255 Unused
Chapter 2
System Register
2-1. System Register
Various PLC settings, such as memory area allocations or wait time, are stored in the System registers.
Set them to match your operating environment.
Check or change the system register settings using an Handy loader[the operational
instruction 50 ( OP 50 ) ] or the FPST-software's function.
The system register settings can be changed only when the CPU is in the program mode.
1. Memory Allocation
Set the size of the program area and file register area and configure the memory area to
match the operating environment.
The size of the memory area differs according to the CPU.
Address Default
No. Description Value Settable range
3 Unused
4 Unused
Notes :
Set the sequence program area and machine language program area so that their
combined
total does not exceed 16 k words for the N70, N700, N7000 PLC.
2. Internal I/O Setting
Allocate the area or set the hold conditions for the various contacts and data.
Refer to 「2-6. Operands」.
Address Default
No. Description Value Settable range
0∼98
7 Internal relay hold area start No. 60
( word unit setting )
setting ( see notes 2 and 3 )
0∼2,048
8 Data register hold area start No. setting 0
( word unit setting )
( see notes 2 and 3 )
0∼22,525
9 File register hold area start No. setting 0
( word unit setting )
( see notes 2 and 3 )
0∼64
10 Link relay hold area setting for 0
PLC Link 0 ( word unit setting )
( see notes 2 and 3 )
64∼128
11 Link relay hold area setting for 64
PLC Link 1 ( word unit setting )
( see notes 2 and 3 )
0∼128
12 Link register hold area setting for 0
PLC Link 0 ( word unit setting )
( see notes 2 and 3 )
128∼256
13 Link register hold area setting for 128
PLC Link 1 ( word unit setting )
( see notes 2 and 3 )
16 Unused
17 Unused
18 Unused
19 Unused
Notes :
1. Although system register Nos. 5 and 6 can be set to different numbers, it is recommended that
they should be set to the same number.
[ The Preset ( Set ) value area ( SV ) and Count ( Elapsed ) value area ( EV ) also will be set
to the hold type or non-hold type according to the setting of system register No. 6. ]
3. In order to make all of the area non-hold ( or a timer area ). set the range to one number
larger than the actual range.
2. For the hold and non-hold setting, the area after the set word No. is of the hold type and the area
before it is of the non-hold type.
3. Run Mode During an Error
Set the operation of the PLC in the event an error occurs during a run.
The default value has been set so that the PLC will stop when an error occurs.
Address Default
No. Description Value Settable range
25 Unused
29 Unused
Notes :
Set the scan check watchdog timer with system register No. 30.
The scan check watchdog timer function is available only in the N70, N700, N7000 PLC.
4. Wait Time Setting
Set the wait time for the time-out error detection of the various operations.
The relationship between the Preset ( Set ) value and set time is given below.
No. 30 to 32 : Set time ( ms ) = Preset ( Set ) value x 2.5 [ Preset ( Set ) value in decimal ]
No. 33 : Set time (μs ) = Preset ( Set ) value x 2.0 [ Preset ( Set ) value in decimal ]
Address Default
No. Description Value Settable range
30 Watchdog timer time out time setting 120 4 ∼256 ( 10ms to 640ms /
( see note 1. ) default : 300ms )
32 Time for SENT/ RECV, RMRD, RMWT 800 4 ∼32,760 ( 10ms to 81,9s /
( see note 3. ) default : 2.0s ) ( see note 5. )
Notes :
1. The scan check watchdog timer function is available only in the N70, N700 , N7000 PLC.
2. Setting for the delimiter processing wait time.
3. Setting for the time-out time for data transfer with the advanced unit connected
to the Slave Unit. PLC or computer connected to the Link Unit.
4. Setting for the scan time when modifying multiple instructions at once in the RUN mode.
5. Normally. use the default setting.
6. PLC Link Setting
Set the communication condition for PLC link 0 and PLC link 1.
Also set the link range and send area for the link relay(L) and link register(Ld).
Address Default
No. Description Value Settable range
46 Unused
47 Unused
48 Unused
49 Unused
Address Default
No. Description Value Settable range
56 Unused
57 Unused
58 Unused
59 Unused
Chapter 3.
INSTRUCTIONS
3-1. Programming Procedure ..............................................................................91
3-2. Basic operation of instruction ....................................................................92
3-3. High level instruction ..................................................................................93
3-3-1. Configuration of High level instruction .............................................93
3-3-2. Scan Execution type (F) and Pulse Execution type(P)
instruction...............................................................................................93
3-3-3. Consecutive Execution of High level instruction. .............................94
3-3-4. Over flow and Underflow ...................................................................94
3-3-5. Index register (IX, IY) ........................................................................95
3-3-6. Operation error .....................................................................................96
3-3-7. Constants (K, H, M )...........................................................................97
3-4. Table of Operands .......................................................................................99
3-5. Description of Instruction ..........................................................................101
1. Basic Instruction .........................................................................................103
2. High level instruction .................................................................................148
3-1. Programming Procedure
Be sure to check the following items before turning ON the power for the first time.
Is the ROM / RAM specification correct ?
Is the battery connector connected ?
Programming start
Turn ON PLC
NO Create the
new Program
YES
Write program
NO Write
completed ?
NO Errors
Programming end
3-2. Basic Operation of Instruction
The instruction words can be divided into two types.
1-step instruction : 1-step instructions where one instruction is described in one step
Multiple-step instruction : Multiple-step instructions where one instruction is described in multiple steps
Sequence basic instructions : perform logical operations in bit units and can perform equivalent
operations with relay sequence circuit.
Basic function instructions : Timer / Counter, a shift register instruction, etc.
Control instructions : master control, jump, steps ladder, subroutine, etc.
High level instructions : transfer instructions, BIN arithmetic operation, BCD arithmetic operation,
translation instructions and special instructions.
Check the following when entering a new program or modifying an existing program :
1. Is the PLCwhich is the target of operation by the peripheral device ( Handy loader , FPST software ) the same
as the Programmable Controller (PC) which is to input and modify a program ?
[ The remote programming function enables programs to be created and modified for all PLC in a link loop. ]
The Link Unit No. and link loop No. can be checked by the peripheral device ( Handy loadetr OP20 and
OP21, FPST-software : System register ).
3. If comments are to be provided for contacts, is the comment function installed in the PLC ?
The CPUs with the comment function are the CPL5221 for the N-7000 , N-700 PLC.
With the N-7000 , N-700 PLC., a sub program such as an interrupt program or subroutine
program can be programmed separately from the main program.
Programs the sub program after the main program.
Also be sure to enter the end instruction ( ED ) in the last step of the main program.
Main program
( E D )
Sub program
(interrupt
program,
subroutine, etc. )
3-3. High Level Instruction
In high level instructions, some instructions function both in 16-bit and 32-bit equally.
"D"( double words ) is placed before the name of 16-bit instructions ( Boolean ) for the 32-bit instructions.
High level instructions specify the processing object. This object is called operand.
Example : [ FO MV S , D ]
Instruction (Boolean)
[ F27 (-) S1 , S2 , D ]
Instruction (Boolean)
Note : When you operate in 32-bit, the lower 16-bit should be specified.
There are two types of high level instructions :the scan execution type and the pulse execution
type which executes only the leading edge scan of the trigger
The pulse execution type are effective in shortening programs and execution time ( scan time ) when the
differential instruction (DF) is needed as a trigger of the high level instruction.
3-3-3. Consecutive Execution of High Level Instructions
The high level instructions can be executed faster by using them in a consecutive execution format (
high level instruction --> high level instruction --> basic instruction ) instead of in a single execution
format ( high level instruction --> basic instruction --> high level instruction --> ).
Therefore, it is recommended that a number of high level instructions be used consecutively.
However, it is not possible to use scan execution type and pulse execution type instructions consecutively.
Example
X0
[FO MV. WRO, WRl]
In the program example above, the second and third instructions are operated using the trigger ( X0 )
of the first F0( MV ) instruction. ( The triggers shown by the dotted lines are not required. )
In the instructions, the word ( 16-bit ) data or the double-word ( 32-bit ) data is treated. Sometimes the
operation result may exceed the maximum or go below the minimum in the range of 16-bit or 32-bit
data. They are called "overflow" and "underflow".
When "overflow" or "underflow" occurs, the carry flag ( R9009 )tums ON.
The result becomes negative minimum value if it is over positive maximum value ( overflow ).
The result becomes positive maximum value if it is under negative minimum value (underflow).
BCD operation ( 4-digit or 8-digit )
There are two ihdex registers ( IX and IY, each 16-bit available ).
The index register can be used as a address modifier for WX ( word input ), WY ( word
output ), WR ( word internal relay ), WL ( word link relay ), SV ( timer/counter set value area
), EV ( Timer/ Counter elapsed value area ), DT ( data register ), FL ( file register ) and
K ( decimal )/ H( hexadecimal ).
The index register, like the data register, can be used as an operand for high level instructions.
When used as an operand for 32-bit instructions. IX and IY are used as a set.
( IX : lower 16-bit, IY : higher 16-bit )
Example
Used as address modifier
X0
[FO MV. IXDT10, DT20]
In the example above, the memory contents of address DT (10 + n) will be transferred to
DT2O. The source data address is modified from the DTI0 by "n" with
the index register ( IX ). ( The "n" is the contents of IX )
Used as register
X0
[F1 DMV. DT10, IX ]
Notes :
You cannot add address modifier to the index registers. (IXIX, IXIY, IYIX, IYIY are impossible.)
If the index register is used as an address modifier, be sure each modified area does not exceed the
limit. If the limit is exceeded, the error flag turns ON.
When operation error occurs at the high level instruction, the operation of the high level instruction
is stopped. At the same time, operation error flag R9007 and R9008 turn ON and the error code
(K45) is set at DT9000, and then ERROR LED lights.
The condition at the error can be selected ( operation stop / continue ) according to the setting of
the system register No. 26.
The error condition ( LED, R9008, DT9000 etc ) cannot be cleared until the power supply is once
turned OFF.
Operation errors
1) Address modifier ERROR : when the area modified by the index register exceeds the limit.
2) BCD data ERROR : when data except for BCD data is processed while BCD operation executes.
3) Parameter ERROR : when specified data is outside the range of instructions which need to
specify control data
4) Over area EEEOR : when the instructions execute in blocks and the target exceeds the range
of memory (see Note)
Notes :
Over area ERROR :
Do not specify last address of a memory area ( DT, FL, WY, WR, etc.) as a destination
for an instruction treating 32 or more bits length.
If the error of this kind occurs, the following probrems will occur.
( The data that will be destroyed is the maximum of 3 words. )
If the WL area is exceeded, the contact area for the Timer / Counter will be destroyed.
If the WY area is exceeded, the area for the input (X) wil! be destroyed.
Care should be taken when an input is begun at slot 0.
If the EV [ Count ( Elapsed ) value ] area is exceeded, the SV [ Preset ( Set ) value ] area
for the Timer / Counter will be destroyed.
If the LD ( Link data register ) area is exceeded, the start of the DT ( Data register ) will be
destroyed.
Although no area will be affected even if the WR ( Word internal relay ), DT ( Data register )
or FL( File register ) area is exceeded, the range of each area should not be exceeded.
3-3-7. Constants ( K, H, M )
You can use 16-bit constants in a 16-bit processing high level instruction and 32-bit
constants in a 32-bit processing high level instruction.
These decimal constants (K) can be set in the program by the Handy loader or the FPST-
software. However, the decimal constants (K) are stored into the PLC after they are translated into
binary data with sign.
In loading, they also are translated into decimal digits by a peripheral device.
Correspondence between decimal constants (K) and binary data with sign.
K10 H A
K1 H 1
KO H O
K-1 H FFFF
K-I0 H FFF6
K 2147483647 H 7FFFFFFF
K1024 H 400
K1 H 1
KO H O
K-1 H FFFFFFFF
K-I024 H FFFFFC00
K-2147483648 H 80000000
Operation in the PLC is designed with binary data as a basis, so use a binary operation
instruction if possible.
Range of numbers that can be handled when a decimal constant is used as an operand of
Timer / Counter instructions.
KI ∼ K32767
(2) Hexadecimal Constants (H)
The hexadecimal constants (H) specify data divided per 4-bit as 1-digit of hexadecimal
digits. The hexadecimal constants (H) include 16-bit constants and 32-bit constants.
Range of number when you use 16-bit constants : HO ∼ HFFFF (4 digits)
Range of number when you use 32-bit constants: HO ∼ HFFFFFFFF (8 digits)
A hexadecimal constant can also be used as an operand for high level instruction.
A hexadecimal constant is also used as logic operations or inputting BCD data for BCD operations.
BCD constants includes 16-bit BCD constants and 32-bit BCD constants.
Setting of BCD data is performed with H constants. H constants are specified by data
devided per 4-bit with the same symbol as hexadecimal constants.
Range of number when you use 16-bit constants : HO ∼ H9999 (4 digits)
Range of number when you use 32-bit constants : HO ∼ H99999999 (8 digits)
Notes :
Use K constants when numbers are compared with the elapsed value of the Timer /
Counter.
If K constants are specified with BCD operation instruction, BCD error occurs.
Usable character constants on the N-7000 , N-700 PLC are shown below.
Notes :
The character "K", "H" or "M" preceding the constant represent decimal, hexadecimal
numbers, and character respectively.
3-4. Table of Operands
Control Instructions
MC Mater control relay ..............................................................122
MCE Mater control relay End .......................................................122
JP-LBL Jump-Label .............................................................................124
LOOP-LBL Loop-Label...............................................................................126
BRK Break .....................................................................................128
ED End ........................................................................................129
CNDE Control End ...........................................................................130
NSTP Next Step ...............................................................................131
SSTP Start Step .............................................................................131
CSTP Clear Step .............................................................................131
STPE Step End ................................................................................131
CALL Subroutine call .....................................................................137
SUB Subroutine .............................................................................137
RET Return ....................................................................................137
INT Interrupt ..............................................................................139
IRET Interrupt return ...................................................................139
ICTL Interrupt control .................................................................140
ST START
OT OUT
■ Operands
Bit operands
INSTRUCTION Steps
X Y R L T C
ST 1
OT 1
ST / 1
: Available
Description ■ ST, ST /
∙ Use the start instruction ( ST ) instead of the start not
(ST/) when Form B ( normally closed ) contact is used
for the external input device such as emergency stop
input.
X0 Y30
〔 〕
■ OT
Special relays ( R9000 to R901F ) can not be used as outputs.
Specify the send area or the area unused by the link function when the link relay of
station itself are used.
(If the link relays of another station are used, the data of the station will be over
written)
Duplicate use of same No. designation in the out ( OT ) and keep ( KP ) instruction
are prohibited.
NOTE :
lf the "DUPLICATE OUT" is set to "ENABLE" in system register, the error
dose not occur with the error check function (FPST Software ; SRCH ERROR
ADRS, Handy Loader : OP9) and the state of larger address No. has priority.
OR OR
OR/ OR not
■ Operands
Bit operands
INSTRUCTION Steps
X Y R L T C
OR, OR/ 1
: Available
Description ■ OR
The OR instruction ( OR ) can be used consecutively.
X0
Address Boolean
(Address0) 0 ST X
X1 0
1 OR X
(Address1)
1
X2 2 OR X
2
(Address2)
■ OR /
The OR not instruction (OR./) can also be used consecutively.
X0
Address Boolean
(Address0) 0 ST X
X1 0
1 OR/ X
(Address1)
1
X2 2 OR/ X
2
(Address2)
AN AND
Program
Address Command
example
X0 X1 X2 Y30
0 ST X 0
〔 〕 1 AN X 1
2 AN/ X 2
3 OT Y 30
■ Operands
Bit operands
INSTRUCTION Steps
X Y R L T C
AN, AN/ 1
: Available
Description ■ AN
∙The AND instruction (AN ) can be used consecutively.
Address Boolean
X0 X1 X2
0 ST X 0
(Address0) (Addressl) (Address2) 1 AN X 1
2 AN X 2
■ AN/
∙The AND not instruction (AN/) can also be used consecutively.
Address Boolean
X0 X1 X2
0 ST X 0
(Address0) (Addressl) (Address2) 1 AN/ X 1
2 AN/ X 2
Examples
The AND instruction(AN) can also be used to program in the following example.
Address Boolean
X0 Y30
0 ST X 0
〔 〕
(Address1) 1 OT Y 30
(Address0)
X1 Y31 2 AN X 1
〔 〕 3 OT Y 31
(Address2) (Address3)
/ not Steps : 1
Description The Not instruction ( NOT ) inverts the result of the operated condition.
ANS ٛ ND Stack
X1 X3 5)
(Address1) (Address3)
Block Block
(Address4)
■ ORS
Use OR stack instruction (ORS) to group
blocks inparallel.
A block begins whh the start X0 X2 Y21
instruction(ST). 〔 〕
(Address0) (Address1) (Address
5)
X1 X3
(Address2) (Address3)
Block
(Address4)
NOTE :
STK : Abbreviation of stack
The AND stack instruction (ANS) and OR stack instruction(ORS) takes the last
block of the entered instructions, combines it with the instructions which
were formed into the previous block, and forms a blocks as one group.
Block : Denotes a group of steps.
A section of program from the start instruction (ST) to the next start
instruction (ST),or until the out instruction (OT) comprises a block.
PSHS Push Stack
POPS
■ POPS
(Address7)
X2 Y42
Reads the operated condition stored by the
push 〔 〕
stack instruction (PSHS)and, using its (Address8) (Address
contents, 9)
continues operation from the next step
Also clears the operated condition stored by
the
push stack instruction ( PSHS )
NOTE :
■ Operands
Bit operands
INSTRUCTION Steps
X Y R L T C
KP 1
: Available
Description In the program example above, in the trigger XI turns OFF, output Y50 turns ON when
the leading edge of the trigger X0 is detected.
Furthermore. if a leading edge of the trigger K1 is detected, output Y50 turns OFF.
( Once the keep relay is turned ON. its ON state is rnaintained until a leading edge
of the trigger X1 is detected regardless of the ON or OFF states of the trigger X0)
Set trigger : X0
Reset trigger : X1
Output : Y50
If the set trigger and reset trigger turn ON simultaneously, the reset trigger has priority.
The keep relay maintains its state even during operation of the master control.
The output state is reset when the reset input turns ON.
The state of keep instruction ( KP ) is reset when switching from the RUN to PROG.
mode or turning OFF the power.
Use the hold-type internal relay if you want to keep the output state also when
switching from the RUN to PROG, mode or turning OFF the power.
Special relays can not be used as keep relays.
Specify the send area or the area unused by the link function when the link relays
of station itself are used.
( 1f the link relays of another station are used, the data of the station will be over
written. )
Duplicate use of same No. designation in the keep ( KP ) and out ( OT ) instructions
is prohibited.
NOTE :
lf the "DUPLICATE OUT" is set to "ENABLE" in system register, the error
dose not occur with the error check function (FPST Software ; SRCH ERROR
ADRS, Handy Loader : OP9) and the state of larger address No. has priority.
NOP Not operation Steps : 1
Examples
Deletion of an instruction :
To delete a certain instruction, overwrite it with a not operation instruction (
NOP ).
The instruction is deleted without affecting subsequence addresses.
Adjustment of addresses :
To move the starting point of a program block from address 999 to address
1000,
insert a not operation instruction ( NOP ) to address 999.
This moves the starting point to address 1000.
DF Leading edge differential
Outline DF : Turns ON the contact only when the leading edge of the trigger
is detected.
DF/ : Turns ON the contact only when the trailing edge of the trigger
is detected.
Program
X0 Y40 Address Command
example
0 ( DF ) 〔 〕 0 ST X 0
X0 Y41 1 DF
2 OT Y 40
( DF /) 〔 〕 3 ST X 0
4 DF/
5 OT Y 41
Description In the program example above, the leading edge differential instruction ( DF ) executes
and tums ON output Y40 only for one scan duration when the tngger X0 changes from
the OFF to ON state.
The trailing edge differential instruction (DF/) executes and turns ON output Y41 only
for one scan duration when the trigger X0 changes from the ON to OFF state.
The program above operates as shown below.
trigger: X0
Output : Y40
→ ←
1 scan
Output : Y41
→ ←
1 scan
In the program shown at the right, when trigger X9 tums ON, the differential output is
active only for one scan.
Output Y35 does not turn ON even if XA subsequently turns ON or OFF.
X9 XA Y35
( DF ) 〔 〕
(Address (Address (Address (Address
0) 1) 2) 3)
There is no limit on the number of times the leading edge ( DF ) and trailing edge
(DF/) differential instructions can be used.
The differential output detects only changes in conditions after the mode is set to the
RUN mode.
The differential output is not active while the hold-type relay is ON or while the trigger is
ON from the first RUN scan.
The leading edge differential instruction ( DF ) is executed comparing the current condition
with the previously executed condition.
Even if the trigger for the leading edge differential instruction ( DF ) turns ON at the first
scan [ OFF for the trailing edge differential instruction ( DF /) ], no output is performed
since there is no previous value.
Furthermore, when it becomes re-executable after the master control relay ( MC ) or jump
( JP ) instruction, the previously executed condition is compared.
Examples
If the same input is specified as the trigger of X
the differential instruction and that of the master 0
control relay (MC) or jump (JP) instruction, ( MC 0)
the output (both leading edge and trailing edge)
is not produced. X Y35
0 ( DF ) 〔 〕
In the programs shown at the right. the leading
edge differential instruction (DF) will not be ( MCE 0)
executed at the leading edge of the trigger X0.
Examples
TM X 20 K267 (0.1s x 267 = 26.7s)
The circuit above operates as shown below.
X0
X1
Y3
9
26.7s
Timer operation
The timer instruction (TM) is a Down type preset timer.
The area used for the instruction are ;
Preset (Set) value area : SV n
Count (Elapsed) value area : EV n
n = timer instruction number
When the mode is set to the RUN mode, the Preset (Set) value is transferred to
the "SV n"
When the trigger of the timer instruction (TM) turns ON. the Preset (Set) value
is transferred to the "EV n" from the "SV n".
During the timing operation. the time is subtracted from the "EV n".
The scan time is also subtracted from the "EV n" in the next scan.
The timer contact turns ON. when the "EV n" becomes 0.
NOTE :
Since the Preset (Set) value (SV) and the Count (Elapsed) value (EV) areas
from 0 to 255 will be occupied with the timer (TM) and counter (CT) instructions
automatically, pay attention n'ot to specify the area in conflict with the timer (TM)
and counter (CT) instructions when using them as the operands other instructions.
CT Counter Steps : 3
NOTE :
When the trailing edge of the reset trigger and the leading edge of the count
trigger are detected simultaneously, the reset trigger has priority.
Counter operation
The counter instruction (CT) is a DOWN type preset counter.
The area used for the instruction are ;
① Preset ( Set ) value area ; SV n
② Count ( Elapsed ) value area ; EV n
n = counter instruction number
When the mode is set to the RUN mode. the Preset(Set) value is transferred to
the "SV n". When the trailing edge of reset input is detected, the Preset(Set)
value is transferred to the "EV n" from the "SV n".
When the leading edge of count input is detected, the count value is subtracted from
the "EV n". The counter contact turns ON, when the "EV n" becomes 0.
NOTE :
Since the Preset(Set) value (SV) and the Count(Elapsed) value (EV)
areas from 0 to 255 will be occupied with the timer(TM) and counter(CT)
instructions automatically, pay attention not to specify the area in conflict
with the timer (TM)and counter (CT) instructions when using other instructions.
F118 (UDC), F37 and F38 instructions can also be used as counter instructions.
F118 Up / Down Counter Steps : 5
■ Operands
Word Operands Constant
Preset (Set) Index
value WX WY WR WL SV EV DT Ld IX IY K H modifier
FL
S
D
: Available
Reset trigger
(D)←0
50(D) 50(S)
Count trigger
5 4 4 4 4 4 4 4 4 4 5
0 9 8 7 6 5 6 7 8 9 0
UP /DOWN trigger
DOWN UP
Subtraction Addition
NOTE :
When the trailing edge of the reset trigger and the leading edge of the count
trigger are detected simultaneously, the reset trigger has priority.
The flag ( special relay ) can be used as the counter contact.
Regarding flag explanation, refer to the "Flag condition" below.
NOTE :
Since the area for Count( Elapsed )value of the instruction is the hold-type,the
Count( Elapsed ) value is not reset when the power is supplied. If you need to
program the counter with reset at the power up, use the special relay ( R9013 ).
[The R9013 turns ON only for one scan duration when the Programmable Logic
Controller(PLC) is RUN mode.]
■ Flag condition
= flag ( R900B ) : Tums ON for an instant when the Count (Elapsed) value becomes 0.
Carry flag (R9009) : Tums ON for an instant, when the Count (Elapsed) value of the
counter becomes outside the countable range.
NOTE :
When using the special relays ( R900B and R9009 ) as flags of this instruction, be
sure to program the flags at the address right after the instruction.
Even if the same special relay is used also in the other part of the program. the
result of this instruction can be picked up using the internal relay.
Operation :
The Count ( Elapsed ) value is stored to the DT0.
The special relay R9010 is nom~ally ON relay.
With the compare instruction [ F60 ( CMP ) ], the value stored in the DT0 and K constant
are compared and the result of the comparison can be judged with the special relays
( R9009 to R900C ).
In the example, R900B becomes ON when the value in the DT0 is 50.
NOTE :
Regarding the expalanation of the compare instruction [F60 (CMP)], refer to
"F60 (CMP) 16-bit data Compare".
SR Shift register (left shift) Steps : 1
■ Operands
Word Operands Constant
Preset (Set) Index
value WX WY WR WL SV EV DT Ld IX IY K H modifier
FL
D
: Available
Description Shifts one bit of the specified data area to the left.
When programming the shift register instruction (SR), be sure to program the data
input, shift and reset triggers.
① Data input : specifies the 11'0 state of new shift-in data
- new shift-in data 1 ; when the input is ON
0 ; when the input is OFF
② Shift trigger : shifts one bit to the Left when the leading edge of the trigger.
③ Reset trigger : tums all the bits of the data area to 0 when the trigger is ON.
NOTE :
The area available for this instruction is only the word internal realy (WR)
If the specified area is set as the hold type. the data in the data area are
not reset (become "0") when the mode is set to the RUN mode. If it is needed
to reset the data. turn ON the trigger of the reset trigger before use.
F119 ( LRSR ), F100 ( SHR ), F101 (SHL). F120 ( ROR ), F121 ( ROL ), F122
( RCR ) and F123 ( RCL ) can also be used as shift register instructions.
Program Address Command
example X0
0 SR WR 0 ST X 0
X1 3 1 ST X 1
2 ST X 2
3 SR WR
X2 3
In the example above, 16 internal relays (R30 to R3F) are the shift register operation
field. The bit data of trigger X1 is shifted to the left bit by bit.
R
WR3
3F 3E 3D 3C 3B 3A 39 38 37 36 35 34 33 32 31 30
Data 0 0 0 1 1 0 0 1 0 0 1 1 1 0 0 0
Data trigger 1
R
WR3
3F 3E 3D 3C 3B 3A 39 38 37 36 35 34 33 32 31 30
Data 0 0 1 1 0 0 1 0 0 1 1 1 0 0 0 1
Data trigger 1
R
WR3
3F 3E 3D 3C 3B 3A 39 38 37 36 35 34 33 32 31 30
Data 0 1 1 0 0 1 0 0 1 1 1 0 0 0 1 1
NOTE :
Regarding the expalanation of the compare instruction [F60 ( CMP )], refer to
"F60 ( CMP ) 16-bit data Compare".
F118(LRSR) Left / right shift register Steps : 5
D1
Shift trigger
D2
Reset trigger
■ Operands
D1
D2
: Available
Description Shifts one bit of the specified data area range to the left / right.
When programming the left / right shift register instruciton ( LRSR ), be sure to
program the left / right, data, shift and reset triggem.
① Left /right trigger : specifies the direction of the shift-out
ON ; shifting out to the left
OFF; shifting out to the right
The data of the shift-out bit is moved out to the carry flag.
NOTE :
If the specified area is set as hold type, the data in the data area are not reset
(become "0") when the mode is set to the RUN mode. If it is needed to reset all
the data, turns, ON the trigger of the reset trigger using the special relay (R9013)
ON the trigger of the reset trigger using the special relay ( R9013 ).
[The R9013 turns ON only for one scan duration when the Programmable Logic
Controller(PLC) is set to RUN mode.]
■ Flag condition
Error flag ( R9007 ) : Turns ON and keeps the ON state when the specified number of
"the start 16-bit data area ( D1 )" is larger than that of "the last
16-bit data area ( D2 )". (Turns ON when D1 > D2)
The error address is transferred in the DT9017 and held.
Error flag ( R9008 ) :Turns ON for an instant when the specified number of "the start
16-bit data area ( D1 )" is larger than that of "the last 16-bit data
area ( D2 )". (Turns ON when D1 > D2)
The error address is transferred in the DT9018.
Carry flag ( R9009 ) Turns ON for an instant when the bit shifted-out is recognized
as "1".
:
NOTE :
When using the special relays ( R9O08 and R9009 ) as flags of this instruction, be
sure to program the flag at the address right after the instruction.
Even if the special relay (R9008 and R9009) are used also in the other part of the
program, the result of this instruction can be picked up using the internal relays
The special relay ( R9007 ) also detects the error of other instructions.
If the error of the instructions with the flag ( R9007 ) is detected. the error
detected in the first place has priority.
ٛ utline Executes the program between the master control relay (MC) and master
control relay end (MCE) instructions when the trigger turns ON.
Program Condition
Keep instruction ( KP ) Holds the state at the time just before the trigger turns OFF.
Counter instruction Holds Count ( Elapsed ) value at the time just before the
CT, UDC ) trigger turns OFF
Differential instructions
Holds the state at the time just before the trigger turns OFF.
DF, DF/)
Other instructions Not executed
MCE 2
MCE 1
NOTE :
The differential instruction memorizes and keeps its trigger state ( ON or OFF )
at the time just before the trigger of the master control relay instruction (MC)
turns OFF while the master control relay instruction (M ) is in OFF state.
When the trigger of the master control relay instruction (MC) turns ON, the
differential instruction is executed comparing its trigger condition at the first
scan with its memorized tirgger condition.
X X
0 ( MC 2 0
X ) Y25
1 ( DF ) 〔 〕 X
1
( MCE 2
Y2
)
5
Change in X1 during this
interval are ignored
If the same trigger is used for the master control relay (MC) and differential
instructions, the differential instructions cannot be used. Use the differential
instructions outside the master control instruction set.
JP Jump
2
Steps
LBL Label 1
Outline Jumps steps to the specified label with the same number when the
trigger turns ON.
Program
X Address Command
example
40 1 ( JP 1) 40 ST X 1
41 JP 1
50 ( LBL 1) 50 LBL 1
NOTE :
The label structions (LBL) are specified as destinations of the jump (JP),
loop (LOOP)instructions within the numbering range of 0 to 255.
The jump instpaction (JP) jumps all the instructions between the jump instruciton
(JP) and label instruction (LBL) with the same numbering when the trigger
turns ON, When the jump instruction (JP) is executed, the execution time of
the skipped instructions is not included in the scan time.
The 1/0 state between the instruction set when the trigger ts in ON state.
Program Condition
Keep instruction ( KP )
Timer instruction (TM)
Holds the condition state at the time just before the
Counter instruction trigger
( CT, UDC ) turns ON .
Shift register instruction [ including Count (Elapsed) value ]
( SR, LRSR )
LBL 1
LBL 0
NOTE :
The differential instruction memorizes and keeps its trigger state (ON or OFF) at
the time just before the trigger of the jump instruction (JP) turns ON while the
trigger of the jump instruction (JP) is in ON state.
When the trigger of the jump instruction (JP) turns OFF, the differential
instruction is executed comparing its trigger condition at the first scan with its
memorized tirgger condition.
X X
0 ( JP 0 ) 0
X Y25
1 ( DF ) 〔 〕 X
1
( LBL 0
Y2
)
5
Change in X1 during this
interval are ignored
The label instruction (LBL) can be programmed at the smaller number address
than the jump instruction (JP). However, if the scan time becomes longer than the
specified duration [System check : 640ms (N-7000 / N-700 PLC), Scan check :
10ms
to 640ms (N-7000 / N-700 PLC )] the error occurs. Be sure that the end (ED) or
conditional end(CNDE)is executed within the specified duration.
LOOP Loop
4
LBL Label Steps
1
Outline Jumps steps to the specified label with the same number and repeats
the same operation until the set value in the data area becomes "0".
Basic style
of instruction
[ LOOP n , S ]
■ Operands
Word Operands Constant
Preset Index
(Set) WX WY WR WL SV EV DT Ld IX IY K H modifier
FL
value
S
: Available
Description Up to 256 ( 0 to 255 ) instruction sets available.
NOTE :
The label instructions (LBL) are specified as destinations of the jump(JP)
The loop instruction (LOOP) jumps all the instructions between the loop (LOOP)
and label (LBL) instructions with the same numbering.
Each time this instruction is executed, one is decreased froin the value in the data
area. This repeats the same operation until the set value in the data area becomes
"0" while the trigger is in ON state.
NOTE :
If the set value in the data area is "0" from the beginning, this instruction
is not executed (ignored)
The label instruction (LBL) can be programmed at the smaller or larger number
address than the loop instruction (LOOP). However. if the scan time becomes
longer than the specified duration [System check : 640ms (N-7000 /N-700 PLC),
Scan check : 10ms to 640ms (N-7000 /N-700 PLC)], the error occurs.
Be sure that the end (ED) or conditional end (CNDE) is executed within the
specified duration.
■ Flag condition
Error flag (R9007) : Turns ON and keeps the ON state when the specified value
in
the data area becomes less than "0". ( when the MSB of the
specified data area becomes "1".)
The efforaddress is transferred in the DT9017 and held.
Error flag (R9008) : Tums ON for an instant when the specified value in the
data
area becomes less than "0".
(when the MSB of the specified data area becomes "1" )
The error address is transferred in the DT9018.
NOTE :
The special relay ( R9007 ) also detects the error of other instructions.
If the error of the instructions with the flag ( R9007 ) is detected, the error etected in the first
place has priority.
When using the special relay( R9008 ) as flag of this instruction, be sure to
program the flag at the address right after the instruction.
Even if the special relay ( R9008 ) is used also in the other part of the program,
the result of this instruction can be picked up using the internal relay.
Program
example Address Command
10 ( LBL 1) 10 LBL 1
20 ST X 1
20 [ LOOP 1 , DT 0 21 LOOP 1
DT 0
]
BRK Break Steps : 1
Program
example Address Command
X0 Y40
0 ( BRK ) 〔 〕 0 ST X 0
1 BRK
2 OT Y 40
Description Stops the execution at the address of this instruction during the TEST RUN mode
when the trigger X0 turns ON.
In the step RUN mode, the program is executed instruction per instruction regardless of
the instructions and in the countinuous RUN mode, the program is executed until it is
stopped by the next break instruction (BRK) or end instruciton (ED).
NOTE :
The test run mode is executed. when the mode selector switch is set to RUN mode
with setting the INITIALIZE/ TEST switch to the TEST mode.
If the mode selector switch is set to the PROG. mode at the break condition
[while the break instruction ( BRK ) is being executed] and if the mode
selector is set[ again to the RUN mode without changing the test run condition registered
before, the program halts at the '0" address.
In the normal RUN mode. the break instruction (BRK)is treated as NOP
instruction(NOP).
ED End Steps : 1
Program
X1 X2 R10 Address Command
example
0 ( ) 0 ST X 1
1 AN/ X
2 2OT R 10
R0 R1 R2 Y30
85 ( )
85 ST R 0
89 ( ED ) 86 AN/ R
87 1AN/ R
88 2OT Y 30
89 ED
Example :
Sequence program
Conditional end
instruction (CNDE) Normal scan← Use the Conditional end instruction ( CNDE )
area
if end processing is necessary within the
Sequence program main program ( normal scan ).
Program
X1 R7 R50 Address Command
example
0 ( ) 0 ST X 1
1 AN/ R
2 7OT R 50
R9 X2 Y31
60 ( ) 60 ST R 9
61 AN/ X
X3 62 2OT Y 31
63 ( CNDE ) 63 ST X 3
64 CNDE
Description The instruction ends the program (the scan) at the address of the instruction
when the trigger X3 is in ON state.
X0
( CNDE )
Sequence
program
( ED )
NOTE :
Outline NSTP : Opens the process of the step ladder and reset the process
including the instruciton itself.
SSTP : Indicates the start of step ladder process.
CSTP : Resets the specified process.
STPE : Ends the step ladder area and returns to the normal scan
area.
Basic style
of instruction Trigger
2 ( NSTP n1 )
0
2 ( NSTP n1 )
4 Output
2 ( ) Process n1
7 Trigger R9015
2 ( NSTP n2 )
8
3 ( SSTP n2 )
3
Process n2
Trigger
12 ( CSTP n40)
0
12 ( STPE )
4
① SSTP
The process is specified as :
∙the program from the start step instruction to the address just before the next
start step instruction
∙the program from the start step instruction to the address just before the step
end instruction (STPE).
The out instruction (OT) can be programmed at the next address of the start
step instruction (SSTP).
The process number can be specified in the range of 0 to 999.
The instruciton with the same process number can not be used.
② NSTP
This instruction is executed only for one scan when the leading edge of the
trigger
is detected.
This instruction can also be programmed outside the step ladder area.
The process number can be specified in the range of 0 to 999.
NOTE :
In the process
The next step instruction can not be executed if the trigger has been in ON
state before the process including the instruction is executed.
To execute the next step instruction in this case, use the special relay
(R9015) as shown in the program example.
(The R9015 is the special relay that turns ON only for one scan at the first
scan of the process including this relay.)
When the next step instruction (NSTP) is executed, it proceeds to the next
step during the same scan. However, the reset operation is executed in the
next scan.
③ CSTP
This instruction can also be programmed outside the step ladder
area.
The process number can be specified in the range of 0 to 999.
④ STPE
Two or more step end instructions (STPE) can not be used.
■ Others
The instructions that can not be programrned in the step ladder area [from the
first start step instruction (SSTP) to the step end instruction (STPE) ] are;
jump ( JP ), label ( LBL ), loop ( LOOP ),
master control relay [ MC ), master control relay end ( NICE ),
conditional end ( CNDE ), end ( ED ), subroutine call ( CALL, ),
subroutine enlrv ( SUB ), return ( RET ), interrupt ( INT ),
interrupt return ( IRET ) and other control type instructions
There is no restriction regarding the order of the process numbering.
The I/0 state between the instruction set when the process is reset;
The step ladder program cannot be programmed in the subroutine or the interrupt
program.
Program Condition
Keep instruction (KP) Holds the state at the time just before the trigger turns OFF.
To reset all the step ladder area, use the master control instruction set.
When the Forced. ON/ OFF operation is performed while the process is in OFF state,
The output is not changed before the process is executed again.
The state of the processes are transferTed into the special data registers
(DT9060 to DT9122).
■ Application examples
The sequence control, selection branch control of a process and the parrallel
branch merge control of a process can be easily realized.
1) Sequence control
Basic style
of instruction Trigger
[ F0 MV , S , D ]
■ Operands
Word Operands Constant
Preset (Set) Index
value WX WY WR WL SV EV DT Ld IX IY K H modifier
FL
S
D
: Available
Description The 16-bit data or constant value specified by S is copied to the area specified
by
D when the trigger tums ON.
■ Flag condition
Error flag ( R9007 ) : Turns ON and keeps the ON state when the area specified
using the index modifier exceeds the limit.
The error address is transferred in the DT9017 and held.
Error flag ( R9008 ) : Turns ON for an instant when the area specified using
the index modifier exceeds the limit.
The error address is transferred in the DT9018.
Note :
Refer to " 2-6. (8) Special Relays ( R: R9000 to R910F ) ", for further
information of error flag.
Program
example Address Command
X0 20 ST X 0
[ F0 MV ,WX 5 , WR 1 ] 21 F 0 ( M V )
WX 5
WR 1
In the example above, the contents of WX5 are copied to WR1 when the X0
turns ON.
Bit 15∙∙12 11∙∙ 8 7∙∙ 4 3∙∙0
WX5 1 0 1 1 1 0 1 1 1 0 1 1 1 0 1 1
X0 : ON
WR1 1 0 1 1 1 0 1 1 1 0 1 1 1 0 1 1
F1 (DMV)
32 Bit data Move
P1 (PDMV) Steps : 7
Basic style
of instruction Trigger
[ F1 DMV , S , D
]
■ Operands
Word Operands Constant
Preset (Set) Index
value WX WY WR WL SV EV DT Ld IX IY K H modifier
FL
S
D
: Available
Description The 32-bit data or constant value is copied to the specified area as follows when
the
trigger tums ON :
Source Trigger turns ON Destination
1.When specifying 32-bit data
S : Lower 16-bit D : Lower 16-bit
S+1 : Higher 16-bit D+1 : Higher 16-bit
S : K ( decimal ) or
H ( hexadecimal ) constant
Note :
When processing 32-bit data, the higher 16-bit areas ( S+1, D+1 ) are automatic
-ally decided if the lower 16-bit areas ( S, D ) are specified.
S (lower) = WR0 D (lower) = LD1
S+1( higher )= WRl, D+1 ( higher )= LD2
■ Flag condition
Error flag ( R9007 ) : Turns ON and keeps the ON state when the area specified
using the index modifier exceeds the limit.
The error address is transferred in the DT9017 and held.
Error flag ( R9008 ) : Turns ON for an instant when the area specified using
the index modifier exceeds the limit.
The error address is transferred in the DT9018.
Note :
Refer to " 2-6. (8) Special Relays ( R: R9000 to R910F ) ", for further
information of error flag.
Program
example Address Command
X0 10 ST X 0
10 [ F1 DMV ,WR 8 , DT 4 11 F 1 ( DMV )
] WR 8
DT 4
In the example above, the contents of WR8 and WR9 are copied to DT4 and DT5
when
the X0 turns ON.
Bit 15∙∙12 11∙∙ 8 7∙∙ 4 3∙∙0 Bit 15∙∙12 11∙∙ 8 7∙∙ 4 3∙∙0
WR9 1 1 1 1 1 0 1 1 0 0 0 0 1 1 1 1 WR8 1 0 1 1 1 0 1 1 1 0 1 1 1 0 1 1
Bit 15∙∙12 11∙∙ 8 7∙∙ 4 3∙∙0 Bit 15∙∙12 11∙∙ 8 7∙∙ 4 3∙∙0
DT5 1 1 1 1 1 0 1 1 0 0 0 0 1 1 1 1 DT4 1 0 1 1 1 0 1 1 1 0 1 1 1 0 1 1
Outline Inverts the specified 16-bit data and write the inverted result to
another area.
( P2 : executed only when the leading edge of the trigger is detected. )
Basic style
of instruction Trigger
[ F2 MV/ , S , D ]
■ Operands
S
D
: Available
Description The 16-bit data or constant value specified by S is inverted and written into the
area specified by D when the trigger tums ON.
■ Flag condition
Error flag ( R9007 ) : Turns ON and keeps the ON state when the area specified
using the index modifier exceeds the limit.
The error address is transferred in the DT9017 and held.
Error flag ( R9008 ) : Turns ON for an instant when the area specified using
the index modifier exceeds the limit.
The error address is transferred in the DT9018.
Note :
Refer to " 2-6. (8) Special Relays ( R: R9000 to R910F ) ", for further
information of error flag.
Program
example Address Command
X0 30 ST X 0
30 [ F2 MV/ , WX 2 , WY4 ] 21 F 2 ( M V / )
WX 2
WY 4
In the example above, the contents of WX2 are inverted and written into WY4
when the X0 turns ON.
WX2 1 0 1 1 1 0 1 1 1 0 1 1 1 0 1 1
X0 : ON
WY4 0 1 0 0 0 1 0 0 0 1 0 0 0 1 0 0
F3 (DMV/)
32 Bit data Invert and move
P3 (PDMV/) Steps : 7
Outline Inverts the specified 32-bit data and write the inverted result to
another area.
( P3 : executed only when the leading edge of the trigger is detected. )
Basic style
of instruction Trigger
[ F3 DMV/ , S , D ]
■ Operands
Word Operands Constant
Preset (Set) Index
value WX WY WR WL SV EV DT Ld IX IY K H modifier
FL
S
D
: Available
Description The 32-bit data or constant value is inverted and written to the specified area as
follows when the trigger tums ON :
Note :
When processing 32-bit data, the higher 16-bit areas ( S+1, D+1 ) are
automatically decided if the lower 16-bit areas ( S, D ) are specified.
S (Lower) = WXO D (Lower) = WR6
S+1(Higher)= WXl, D+1 (higher)= WR7
■ Flag condition
Error flag ( R9007 ) : Turns ON and keeps the ON state when the area specified
using the index modifier exceeds the limit.
The error address is transferred in the DT9017 and held.
Error flag ( R9008 ) : Turns ON for an instant when the area specified using
the index modifier exceeds the limit.
The error address is transferred in the DT9018.
Note :
Refer to " 2-6. (8) Special Relays ( R: R9000 to R910F ) ", for further
information of error flag.
Program
example Address Command
X0 10 ST X 0
10 [ F3 DMV/ ,WX 3 , WY 7 ]
11 F 3 ( DMV/ )
WX 3
WY 7
In the example above, the contents of WX3 and WX4 are inverted and written into
WY7 and WY8 when the X0 turns ON.
Bit 15∙∙12 11∙∙ 8 7∙∙ 4 3∙∙0 Bit 15∙∙12 11∙∙ 8 7∙∙ 4 3∙∙0
WX4 1 1 1 1 1 0 1 1 0 0 0 0 1 1 1 1 WX3 1 0 1 1 1 0 1 1 1 0 1 1 1 0 1 1
Bit 15∙∙12 11∙∙ 8 7∙∙ 4 3∙∙0 Bit 15∙∙12 11∙∙ 8 7∙∙ 4 3∙∙0
WY8 0 0 0 0 0 1 0 0 1 1 1 1 0 0 0 0 WY7 0 1 0 0 0 1 0 0 0 1 0 0 0 1 0 0
Outline Copies a bit of the specified 16-bit data to one of another 16-bit data area.
( P5 : executed only when the leading edge of the trigger is detected. )
Basic style
of instruction Trigger
[ F5 BTM , S , n , D ]
n Constant value or 16-bit data (specified source and destination bit No.)
■ Operands
Word Operands Constant
Preset (Set) Index
value WX WY WR WL SV EV DT Ld IX IY K H modifier
FL
S
D
: Available
Description One bit of lu-bit data or constant value specified by S is copied to a bit of 16-bit
area specified by D when the trigger turns ON.
Specifications of "n"
Error flag ( R9008 ) : Turns ON for an instant when the area specified using
the index modifier exceeds the limit.
The error address is transferred in the DT9018.
Note :
Refer to " 2-6. (8) Special Relays ( R: R9000 to R910F ) ", for further
information of error flag.
Program
example Address Command
X0 30 ST X 0
30 [ F5 BTM , WR 0 , LD 1 , WY 31 F 5 ( BTM )
WR 0
2 ] LD 1
WY 2
Ld 1 ∙∙∙∙ 1 1 0 0 ∙∙∙∙ 0 1 0 0
In the example above, Ld1 is set so that bit 4 of WR0 is copied to bit 12 of WY2
when the X0 turns ON as follows :
Bit 15∙∙12 11∙∙ 8 7∙∙ 4 3∙∙0 Bit 15∙∙12 11∙∙ 8 7∙∙ 4 3∙∙0
WR0 1 1 0 1 0 0 1 1 0 0 0 0 1 1 1 1 WY2 0 1 1 1 1 0 1 0 1 0 1 0 1 0 0 1
BIT 4 BIT 12
X0 : ON
Bit 15∙∙12 11∙∙ 8 7∙∙ 4 3∙∙0 Bit 15∙∙12 11∙∙ 8 7∙∙ 4 3∙∙0
WR0 1 1 0 1 0 0 1 1 0 0 0 0 1 1 1 1 WY2 0 1 1 0 1 0 1 0 1 0 1 0 1 0 0 1
COPY
F6 (DGT)
Digit data Move
P6 (PDGT) Steps : 7
ٛ utline Copies the digits of the specified 16-bit data to the digits of
another 16-bit data area
( P6 : executed only when the leading edge of the trigger is detected. )
Basic style
of instruction Trigger
[ F6 DGT , S , n , D ]
■ Operands
Word Operands Constant
Preset (Set) Index
value WX WY WR WL SV EV DT Ld IX IY K H modifier
FL
S
n
D
: Available
Description The digits of 16-bit data or constant value specified by S are copied to the digits
of 16-bit area specified by D when the trigger turns ON.
The copy of multiple digits is also possible.
See following page for multiple digits copy.
One digit means 4-bit unit.
The " n " specifies the bit No. as follows ;
Bit No. 0 and 1 : source digit No. ( H0 to H3 )
Bit No. 4 and 5 : number of digits to be copied ( H0 to H3 )
Bit No. 8 and 9 : destination digit No. ( H0 to H3 )
(The bits 2, 3, 6, 7 and 10 through 15 are invalid.)
00 : Copies 1-digit
Number of digits to be copied 01 : Copies 2-digit(1byte)
(H0 to H3 ) 10 : Copies 3-digit
11 : Copies 4-digit(2byte)
Error flag ( R9008 ) : Turns ON for an instant when the area specified using
the index modifier exceeds the limit.
The error address is transferred in the DT9018.
Note :
Refer to " 2-6. (8) Special Relays ( R: R9000 to R910F ) ", for further
information of error flag.
Program
example Address Command
X0 10 ST X 0
10 [ F6 DGT , WR 0 , WX 1 , WY 11 F 6 ( DGT )
WR 0
2 ] WX 1
WY 2
WX 1 ∙∙∙∙ 0 0 1 1 ∙∙∙∙ 0 0 0 1
In the example above, WX1 is set so that digit 1 of WR0 is copied to digit 3 of
WY2when the X0 turns ON as follows :
Digit 3 2 1 0 Digit 3 2 1 0
Bit 15∙∙12 11∙∙ 8 7∙∙ 4 3∙∙0 Bit 15∙∙12 11∙∙ 8 7∙∙ 4 3∙∙0
WR0 0 1 0 1 0 0 1 0 0 1 0 0 1 1 1 1 WY2 0 1 1 1 0 1 1 0 0 0 1 0 1 0 0 1
X0 : ON
Digit 3 2 1 0 Digit 3 2 1 0
Bit 15∙∙12 11∙∙ 8 7∙∙ 4 3∙∙0 Bit 15∙∙12 11∙∙ 8 7∙∙ 4 3∙∙0
WR0 0 1 0 1 0 0 1 0 0 1 0 0 1 1 1 1 WY2 0 1 0 0 0 1 1 0 0 0 1 0 1 0 0 1
S : S : S :
D : D : D :
S : S : S :
D : D : D :
n : H 0230 n : H 0232
Bit 15∙∙12 11∙∙ 8 7∙∙ 4 3∙∙ 0 Bit 15∙∙12 11∙∙ 8 7∙∙ 4 3∙∙ 0
n 1 0 1 1 0 0 n 1 0 1 1 1 0
S : S :
D : D :
F10 (BKMV)
Block Move
P10 (PBKMV Steps : 7
Basic style
of instruction Trigger
[ F10 BKMV , S1 , S2 , D ]
■ Operands
Word Operands Constant
Preset (Set) Index
value WX WY WR WL SV EV DT Ld IX IY K H modifier
FL
S1
S2
D
: Available
Description The block specified by SI and S2 is copied to the block starting from the area
specified by D when the trigger tums ON.
The SI and S2 should be ;
∙in the same operand
∙S1 ≤ S2
In case that S1, S2 and D is in the same data area ;
S1 = D : Data will be re-copied to the same data
area.
■ Flag condition
Error flag ( R9007 ) : Turns ON and keeps the ON state.
① when the area specified using the index modifier exceeds the
limit.
② when SI > S2.
③ when the data block to be copied exceeds the limit of the
area
for destination.
The error address is transferred in the DT9017 and held,
Error flag ( R9008 ) : Turns ON for an instant.
① when the area specified using the index modifier exceeds the
limit.
② when SI > S2.
③ when the data block to be copied exceeds the limit of the
area
for destination.
Note : The error address is transferred in the DT9018.
Refer to " 2-6. (8) Special Relays ( R: R9000 to R910F ) ", for further
information of error flag.
Program
example Address Command
R0 10 ST R 0
10 [ F10 BKMV, WX 0 , WX 3 , WY 5 ] 11 F 10 ( BKMV )
WX 0
WX 3
WY 5
In the example above, the data block of from WX0 to WX3 are copied to the
block
starting from WY5 when the R0 turns ON.
WX1 1 1 0 1 1 1 1 0 0 1 0 1 1 0 0 1
WX2 0 0 0 1 1 0 1 0 0 1 0 1 1 1 1 1
WX3 1 1 0 1 1 1 1 0 1 0 0 1 1 1 1 0
R0 : ON
WY6 1 1 0 1 1 1 1 0 0 1 0 1 1 0 0 1
WY7 0 0 0 1 1 0 1 0 0 1 0 1 1 1 1 1
WY8 1 1 0 1 1 1 1 0 1 0 0 1 1 1 1 0
F11 (COPY)
Block Copy
P11 (PCOPY Steps : 7
Outline Copies the specified 16-bit data to the block with one or more 16-
bit area.
( P11 : executed only when the leading edge of the trigger is detected. )
Basic style
of instruction Trigger
[ F11 COPY , S , D1 , D2 ]
■ Operands
Word Operands Constant
Preset (Set) Index
value WX WY WR WL SV EV DT Ld IX IY K H modifier
FL
S
D1
D2
: Available
Description The 16-bit data or constant value specified by S is copied to the block specified by
D1 and D2 when the trigger tums ON.
The DI and D2 should be ;
∙in the same operand
∙Dl ≤ D2
COPY D1
S Repeatedly
copy
D2
■ Flag condition
Error flag ( R9007 ) : Turns ON and keeps the ON state.
① when the area specified using the index modifier exceeds the
limit.
② when DI > D2.
The error address is transferred in the DT9017 and held,
R0 10 ST R 0
10 [ F11 COPY, WX 0 , WY 6 , WY 9 ] 11 F 11 ( COPY )
WX 0
WY 6
WY 9
In the example above, the data of WX0 are copied to the block starting from WY6
to
WY9 when the R0 turns ON.
R0 : ON
WY9 1 0 0 1 1 1 1 0 0 0 0 1 1 1 0 0
F15 (XCH)
16 Bit data Exchange
P15 (PXCH) Steps : 5
Basic style
of instruction Trigger
[ F15 XCH , D1 , D2 ]
■ Operands
Word Operands Constant
Preset (Set) Index
value WX WY WR WL SV EV DT Ld IX IY K H modifier
FL
D1
D2
: Available
Description The content of 16-bit data specified by D1 and D2 are exchanged when the
trigger tums ON.
■ Flag condition
Error flag ( R9007 ) : Turns ON and keeps the ON state when the area specified
using the index modifier exceeds the limit.
The error address is transferred in the DT9017 and held.
Error flag ( R9008 ) : Turns ON for an instant when the area specified using
the index modifier exceeds the limit.
The error address is transferred in the DT9018.
Note :
Refer to " 2-6. (8) Special Relays ( R: R9000 to R910F ) ", for further
information of error flag.
Program
example Address Command
X0 20 ST X 0
20 [ F15 XCH , WR 5 , WR 6 ] 21 F 15 ( XCH )
WR 5
WR 6
In the example above, the contents of WR5 and WR6 are exchanged when the
X0 turns ON.
WR5 1 0 0 1 1 0 1 1 1 0 1 1 1 0 1 1
WR6 1 0 1 1 1 1 1 1 1 0 0 1 1 0 1 0
X0 : ON Exchange
WR5 1 0 1 1 1 1 1 1 1 0 0 1 1 0 1 0
WR6 1 0 0 1 1 0 1 1 1 0 1 1 1 0 1 1
F16 (DXCH)
32 Bit data Exchange
P16 (PDXCH Steps : 5
Basic style
of instruction Trigger
[ F16 DXCH , D1 , D2 ]
■ Operands
Word Operands Constant
Preset (Set) Index
value WX WY WR WL SV EV DT Ld IX IY K H modifier
FL
D1
D2
: Available
Description The content of 32-bit data are exchanged as folows when the trigger tums ON ;
Trigger turns ON
D1 : lower 16-bit D1 : lower 16-bit
D1+1: higher 16-bit D1+1: higher 16-bit
Note :
When processing 32-bit data, the higher 16-bit areas ( D1+1, D2+1 ) are
automatically decided if the lower 16-bit areas (D1, D2 ) are specified.
D1 ( lower) = WRO D2 (lower) = DT0
D1+1( higher ) = WRl, D2+1 ( higher )= DT1
■ Flag condition
Error flag ( R9007 ) : Turns ON and keeps the ON state when the area specified
using the index modifier exceeds the limit.
The error address is transferred in the DT9017 and held.
Error flag ( R9008 ) : Turns ON for an instant when the area specified using
the index modifier exceeds the limit.
The error address is transferred in the DT9018.
Note :
Refer to " 2-6. (8) Special Relays ( R: R9000 to R910F ) ", for further
information of error flag.
Program
example Address Command
R0 20 ST R 0
20 [ F16 DXCH , WR 5 , DT 0 21 F 16 ( DXCH )
] WR 5
DT 0
In the example above, two 32-bit data [ (WR5, WR6 ) ] and [ (DT0, DT1) ] are
exchanged when the R0 turns ON.
(WR5, WR6 -> DT0, DT1 ) and ( DT0, DT1 -> WR5, WR6)
Bit 15∙∙12 11∙∙ 8 7∙∙ 4 3∙∙0 Bit 15∙∙12 11∙∙ 8 7∙∙ 4 3∙∙0
WR6 1 0 1 1 1 0 1 0 1 0 1 1 1 0 1 1 WR5 1 0 0 1 1 0 0 1 1 1 1 1 0 0 1 1
Bit 15∙∙12 11∙∙ 8 7∙∙ 4 3∙∙0 Bit 15∙∙12 11∙∙ 8 7∙∙ 4 3∙∙0
DT1 1 0 1 0 1 0 1 1 1 0 0 1 1 1 1 0 DT0 1 1 1 1 1 1 0 1 1 0 1 0 1 1 1 0
R0 : ON
Bit 15∙∙12 11∙∙ 8 7∙∙ 4 3∙∙0 Bit 15∙∙12 11∙∙ 8 7∙∙ 4 3∙∙0
WR6 1 0 1 0 1 0 1 1 1 0 0 1 1 1 1 0 WR5 1 1 1 1 1 1 0 1 1 0 1 0 1 1 1 0
Bit 15∙∙12 11∙∙ 8 7∙∙ 4 3∙∙0 Bit 15∙∙12 11∙∙ 8 7∙∙ 4 3∙∙0
DT1 1 0 1 1 1 0 1 0 1 0 1 1 1 0 1 1 DT0 1 0 0 1 1 0 0 1 1 1 1 1 0 0 1 1
F17 (SWAP)
High /Low bytee Exchange
P17 (PSWAP) Steps : 3
ٛ utline Exchanges high and low order bytes of the specified 16-bit data.
( P17 : executed only when the leading edge of the trigger is detected. )
Basic style
of instruction Trigger
[ F17 SWAP , D ]
■ Operands
Word Operands Constant
Preset (Set) Index
value WX WY WR WL SV EV DT Ld IX IY K H modifier
FL
D
: Available
The high order one byte ( higher 8-bit ) and low order one byte ( lower 8-bit )
of
16-bit data specified by D are exchanged when the trigger tums ON.
■ Flag condition
Error flag ( R9007 ) : Turns ON and keeps the ON state when the area specified
using the index modifier exceeds the limit.
The error address is transferred in the DT9017 and held.
Error flag ( R9008 ) : Turns ON for an instant when the area specified using
the index modifier exceeds the limit.
The error address is transferred in the DT9018.
Note :
Refer to " 2-6. (8) Special Relays ( R: R9000 to R910F ) ", for further
information of error flag.
Program
example Address Command
X0 10 ST X 0
10 [ F17 SWAP , WY 1 ] 11 F 17 ( SWAP )
WY 1
In the example above, high and low order bytes of the 16-bit data WY1 are exchanged
when the X0 turns ON as follows :
WY 1 1 1 0 1 1 1 0 0 1 0 0 0 0 1 0 0
X0 : ON
WY 1 1 0 0 0 0 1 0 0 1 1 0 1 1 1 0 0
BIN Arithmetic Instructions
Notes :
You can monitor 16-bit data by operational instruction 8 ( OP8 ) with the HANDY LOADER.
You can monitor 32-bit data by operational instruction 12 ( OP12 ) with the HANDY LOADER.
F20 (+) 16 Bit data
P20 (P+) [D + S -> D]
Steps : 5
Outline Adds two 16-bit data and stores the result into the augend area.
( P20 : executed only when the leading edge of the trigger is detected. )
Basic style
of instruction Trigger
[ F20 + , S , D ]
■ Operands
Word Operands Constant
Preset (Set) Index
value WX WY WR WL SV EV DT Ld IX IY K H modifier
FL
S
D
: Available
Description The 16-bit data or constant value specified by S and the 16-bit data specified by D
are added together as follows when the trigger tums ON.
The added result is stored into D ( area for augend )
Note :
When this instruction is used, the area for augend ( D ) is overwritten by the
addedresult. If you want to avoid the overwrite, we recommend you the use of
F22 / P22 instructions instead of F20 / P20 instructions.
■ Flag condition
Error flag ( R9007 ) : Turns ON and keeps the ON state when the area specified
using the index modifier exceeds the limit.
The error address is transferred in the DT9017 and held.
Error flag ( R9008 ) : Turns ON for an instant when the area specified using
the index modifier exceeds the limit.
The error address is transferred in the DT9018.
Carry flag ( R9009 ) : Turns ON for an instant when the calculated result
exceed the range of 16-bit data (overflow and underflow)
※ Range of 16-bit data : K-32768 to K32767
Note : H8000 to H7FFF
Refer to " 2-6. (8) Special Relays ( R: R9000 to R910F ) ", for further
information of error flag.
Program
example Address Command
R0 10 ST R 0
10 [ F20 + , WR 5 , WR 6 ] 11 F 20 ( + )
WR 5
WR 6
In the example above, the contents of WR5 ( K1234 ) and WR6 ( K5678 ) are added
together when the R0 tums ON.
WR 5
K 1234
+
WR 6
K 5678
R0 : ON
WR 6
K 6912
F21 (D+) 32 Bit data
P21 (PD+) [(D+1,D) + (S+1,S) -> (D+1,D)]
Steps : 7
Outline Adds two 32-bit data and stores the result into the augend area.
( P21 : executed only when the leading edge of the trigger is detected. )
Basic style
of instruction Trigger
[ F21 D+ , S , D ]
■ Operands
Word Operands Constant
Preset (Set) Index
value WX WY WR WL SV EV DT Ld IX IY K H modifier
FL
S
D
: Available
Description The 32-bit data or constant value specified by S and the 32-bit data specified by D
are added together as follows when the trigger tums ON.
The added result is stored into D+1 and D.
Note :
When processing 32-bit data, the higher 16-bit areas ( S+1, D+1 ) are
automatically decided if the lower 16-bit areas ( S, D ) are specified.
S (lower) = WR0 D (lower) = DT1
S+1(higher) = WR1, D+1 (higher) = DT2
Note :
When this instruction is used, the area for augend ( D+1, D ) is overwritten
by the addedresult. If you want to avoid the overwrite, we recommend you the
use of F23/ P23 instructions instead of F21/ P21 instructions.
■ Flag condition
Error flag ( R9007 ) : Turns ON and keeps the ON state when the area specified
using the index modifier exceeds the limit.
The error address is transferred in the DT9017 and held.
Error flag ( R9008 ) : Turns ON for an instant when the area specified using
the index modifier exceeds the limit.
The error address is transferred in the DT9018.
Carry flag ( R9009 ) : Turns ON for an instant when the calculated result
exceeds the range of 32-bit data (overflow and underflow)
Note :
Refer to " 2-6. (8) Special Relays ( R: R9000 to R910F ) ", for further
information of error flag.
Program
example Address Command
X20 10 ST X 20
10 [ F21 D+ , DT 0 , WR 0 ] 11 F 21 ( D+ )
DT 0
WR 0
In the example above, the contents of WR1 and WR0 ( K080877102 ) and the contents
of DT1 and DT0 ( K226501428 ) are added together when the X20 turns ON.
WR 1 WR 0
K 080877102
+
DT 1 DT 0
K 226501428
X20 : ON
WR 1 WR 0
K 307378530
F22 (+) 16 Bit data
P22 (P+) [S1 + S2 -> D]
Steps : 7
Outline Adds two 16-bit data and stores the result into the specified area.
( P22 : executed only when the leading edge of the trigger is detected. )
Basic style
of instruction Trigger
[ F22 + , S1 , S2 , D ]
■ Operands
Word Operands Constant
Preset (Set) Index
value WX WY WR WL SV EV DT Ld IX IY K H modifier
FL
S1
S2
D
: Available
Description The 16-bit data or constant value specified by S1 and the 16-bit data or constant
value specified by S2 are added together as follows when the trigger tums ON.
■ Flag condition
Error flag ( R9007 ) : Turns ON and keeps the ON state when the area specified
using the index modifier exceeds the limit.
The error address is transferred in the DT9017 and held.
Error flag ( R9008 ) : Turns ON for an instant when the area specified using
the index modifier exceeds the limit.
The error address is transferred in the DT9018.
Carry flag ( R9009 ) : Turns ON for an instant when the calculated result
exceed the range of 16-bit data (overflow and underflow)
※ Range of 16-bit data : K-32768 to K32767
H8000 to H7FFF
Note :
Refer to " 2-6. (8) Special Relays ( R: R9000 to R910F ) ", for further
information of error flag.
Program
example Address Command
X0 10 ST X 0
10 [ F22 + , WR 5 , WR 6 , 11 F 22 ( + )
DT100 ] WR 5
WR 6
DT 100
In the example above, the contents of WR5 ( K1234 ) and WR6 ( K5678 ) are added
together when the X0 tums ON.
The added result ( K6912 ) is stored into DT100.
WR 5
K 1234
+
WR 6
K 5678
X0 : ON
DT100
K 6912
F23 (D+) 32 Bit data
P23 (PD+) [(S1 + 1, S1) + (S2 +1,S2) -> (D+1,D)]
Steps :11
Outline Adds two 32-bit data and stores the result into the specified area.
( P23 : executed only when the leading edge of the trigger is detected. )
Basic style
of instruction Trigger
[ F23 D+ , S1 , S2 , D ]
■ Operands
Word Operands Constant
Preset (Set) Index
value WX WY WR WL SV EV DT Ld IX IY K H modifier
FL
S1
S2
D
: Available
Description The 32-bit data or constant value specified by S1 and S2 are added together as
follows when the trigger tums ON.
The added result is stored into D+1 and D.
Note :
When processing 32-bit data, the higher 16-bit areas ( S1+1, S2+1, D+1 ) are
automatically decided if the lower 16-bit areas ( S1, S2, D ) are specified.
S1 (lower) = DT0 S2 (lower) = WR1 D (lower) = WY1
S1+1 (higher) = DT1, S2+1 (higher) = WR2, D+1 (higher) = WY2
■ Flag condition
Error flag ( R9007 ) : Turns ON and keeps the ON state when the area specified
using the index modifier exceeds the limit.
The error address is transferred in the DT9017 and held.
Error flag ( R9008 ) : Turns ON for an instant when the area specified using
the index modifier exceeds the limit.
The error address is transferred in the DT9018.
Carry flag ( R9009 ) : Turns ON for an instant when the calculated result
exceeds the range of 32-bit data (overflow and
underflow)
※ Range of 32-bit data : K-2147483648 to K2147483647
H80000000 to H7FFFFFFF
Note :
Refer to " 2-6. (8) Special Relays ( R: R9000 to R910F ) ", for further
information of error flag.
Program
example Address Command
X20 10 ST X
10 [ F23 D+ , DT 0 , WR 1, WY 11 20
1 ] F 23 ( D+ )
DT 0
WR 1
WY 1
In the example above, the contents of DT1 and DT0 ( K226500306 ) and the contents
of WR2 and WR1 ( K080877102 ) are added together when the X20 turns ON.
DT 1 DT 0
K 226500306
+
WR 2 WR 1
K 080877102
X20 : ON
WY 2 WY 1
K 307377408
F25 (-) 16 Bit data
P25 (P-) [D - S -> D]
Steps : 5
Outline Subtracts two 16-bit data from the minuend and stores the result into the
minuend area.
( P25 : executed only when the leading edge of the trigger is detected. )
Basic style
of instruction Trigger
[ F25 - , S , D ]
■ Operands
Word Operands Constant
Preset (Set) Index
value WX WY WR WL SV EV DT Ld IX IY K H modifier
FL
S
D
: Available
Description Subtracts the 16-bit data or constant value specified by S from the 16-bit data
specified by D are as follows when the trigger tums ON.
The subtracted result is stored into D ( minuend area )
Note :
When this instruction is used, the area for minuend ( D ) is overwritten by the
subtracted result. If you want to avoid the overwrite, we recommend you the use
of F27 / P27 instructions instead of F25 / P25 instructions.
■ Flag condition
Error flag ( R9007 ) : Turns ON and keeps the ON state when the area specified
using the index modifier exceeds the limit.
The error address is transferred in the DT9017 and held.
Error flag ( R9008 ) : Turns ON for an instant when the area specified using
the index modifier exceeds the limit.
The error address is transferred in the DT9018.
Carry flag ( R9009 ) : Turns ON for an instant when the calculated result
exceed the range of 16-bit data (overflow and underflow)
※ Range of 16-bit data : K-32768 to K32767
H8000 to H7FFF
Note :
Refer to " 2-6. (8) Special Relays ( R: R9000 to R910F ) ", for further
information of error flag.
Program
example Address Command
R0 10 ST R
10 [ F25 - , WR 5 , WR 6 ] 11 0
F 25 ( - )
WR 5
WR 6
In the example above, subtracts the contents of WR5 ( K7890 ) and WR6 ( K9876 )
when the R0 tums ON.
The asubtracted result ( K1986 ) is stored into WR6.(minuend area)
WR 6
K 9876
-
WR 5
K 7890
R0 : ON
WR 6
K 1986
F26 (D-) 32 Bit data
P26 (PD-) [(D+1,D) - (S+1,S) -> (D+1,D)]
Steps : 7
Outline Subtracts the 32-bit data from the minuend and stores the result into the
minuend area.
( P26 : executed only when the leading edge of the trigger is detected. )
Basic style
of instruction Trigge
r [ F26 D- , S , D ]
■ Operands
Word Operands Constant
Preset (Set) Index
value WX WY WR WL SV EV DT Ld IX IY K H modifier
FL
S
D
: Available
Description Subtracts the 32-bit data or constant value specified by S from the 32-bit data
specified by D as follows when the trigger tums ON.
The subtracted result is stored into D+1 and D.(minuend area)
Note :
When processing 32-bit data, the higher 16-bit areas ( D+1, S+1 ) are
automatically decided if the lower 16-bit areas ( D, S ) are specified.
D (lower) = WR0 S (lower) = DT1
D+1( higher )= WRl, S+1 ( higher )= DT2
Note :
When this instruction is used, the area for minuend ( D+1, D ) is overwritten
by the subtracted result. If you want to avoid the overwrite, we recommend you
the use of F28/ P28 instructions instead of F26/ P26 instructions.
■ Flag condition
Error flag ( R9007 ) : Turns ON and keeps the ON state when the area specified
using the index modifier exceeds the limit.
The error address is transferred in the DT9017 and held.
Error flag ( R9008 ) : Turns ON for an instant when the area specified using
the index modifier exceeds the limit.
The error address is transferred in the DT9018.
Carry flag ( R9009 ) : Turns ON for an instant when the calculated result
exceeds the range of 32-bit data (overflow and
underflow)
※ Range of 32-bit data : K-2147483648 to K2147483647
H80000000 to H7FFFFFFF
Note :
Refer to " 2-6. (8) Special Relays ( R: R9000 to R910F ) ", for further
information of error flag.
Program
example Address Command
X20 40 ST X 20
40 [ F26 D- , DT 0 , WR 0 ] 41 F 26 ( D- )
DT 0
WR 0
In the example above, subtracted the contents of DT1 and DT0 ( K080877102 ) from
the contents of WR1 and WR0 ( K647238968 ) when the X20 turns ON.
The subtracted result ( K566361866 ) is stored into WRI and WR0.
WR WR
1 K 647238968 0
-
DT 1 DT 0
K 080877102
X20 : ON
WR WR
1 K 566361866 0
F27 (-) 16 Bit data
P27 (P-) [S1 - S2 -> D]
Steps : 7
ٛ utline Subtracts the 16-bit data from the minuend and stores the result into the
specified area.
( P27 : executed only when the leading edge of the trigger is detected. )
Basic style
of instruction Trigger
[ F27 - , S1 , S2 , D ]
■ Operands
Word Operands Constant
Preset (Set) Index
value WX WY WR WL SV EV DT Ld IX IY K H modifier
FL
S1
S2
D
: Available
Description Subtracts the 16-bit data or constant value specified by S2 from the 16-bit data or
constant value specified by S1 as follows when the trigger tums ON.
The subtracted result is stored into D.
■ Flag condition
Error flag ( R9007 : Turns ON and keeps the ON state when the area specified
using the index modifier exceeds the limit.
) The error address is transferred in the DT9017 and held.
Error flag ( R9008 ) : Turns ON for an instant when the area specified using
the index modifier exceeds the limit.
The error address is transferred in the DT9018.
Carry flag ( R9009 : Turns ON for an instant when the calculated result
exceed the range of 16-bit data (overflow and underflow)
) ※ Range of 16-bit data : K-32768 to K32767
H8000 to H7FFF
Note :
Refer to " 2-6. (8) Special Relays ( R: R9000 to R910F ) ", for further
information of error flag.
Program
example Address Command
X0 10 ST X 0
10 [ F27 - , WR 9 , WR 8 , 11 F 27 ( - )
DT105 ] WR 9
WR 8
DT 105
In the example above, subtracts the contents of WR8 ( K3333 ) from the contents
WR9 ( K5555 ) when the X0 tums ON.
The subtracted result ( K2222 ) is stored into DT105.
WR 9
K 5555
-
WR 8
K 3333
X0 : ON
DT105
K 2222
F28 (D-) 32 Bit data
P28 (PD-) [(S1 +1, S1) - (S2 +1, S2) -> (D+1, D)]
Steps :11
Outline Subtracts the 32-bit data from the minuend and stores the result into the
specified area.
( P28 : executed only when the leading edge of the trigger is detected. )
Basic style
of instruction Trigge
r [ F28 D- , S1 , S2 , D ]
■ Operands
Word Operands Constant
Preset (Set) Index
value WX WY WR WL SV EV DT Ld IX IY K H modifier
FL
S1
S2
D
: Available
Description Subtracts the 32-bit data or constant value specified by S2 from the 32-bit data or
constant value specified by S1 as follows when the trigger tums ON.
The subtracted result is stored into D+1 and D.
Note :
When processing 32-bit data, the higher 16-bit areas ( S1+1, S2+1, D+1 ) are
automatically decided if the lower 16-bit areas ( S1, S2, D ) are specified.
S1 (lower) = DT0 S2 (lower) = WR1 D (lower) = WY1
S1+1 (higher) = DTl, S2+1 (higher) = WR2, D+1 (higher) = WY2
■ Flag condition
Error flag ( R9007 ) : Turns ON and keeps the ON state when the area specified
using the index modifier exceeds the limit.
The error address is transferred in the DT9017 and held.
Error flag ( R9008 ) : Turns ON for an instant when the area specified using
the index modifier exceeds the limit.
The error address is transferred in the DT9018.
Carry flag ( R9009 ) : Turns ON for an instant when the calculated result
exceed the range of 32-bit data (overflow and underflow)
※ Range of 32-bit data : K-2147483648 to K2147483647
H80000000 to H7FFFFFFF
Note :
Refer to " 2-6. (8) Special Relays ( R: R9000 to R910F ) ", for further
information of error flag.
Program
example Address Command
X20 10 ST X 20
10 [ F28 D- , DT 0 , WR 1, WY 11 F 28 ( D- )
1 ] DT 0
WR 1
WY 1
In the example above, subtracts the contents of DT1 and DT0 ( K080877102 )
from the
contents
The of WR2
subtracted resultand WR1 ( K566297810
( K-485420708 ) are
) is stored into added
WY2 together when the X20
and WY1.
turns ON.
DT 1 DT 0
K 080877102
-
WR WR
2 K 566297810 1
X20 : ON
WY WY
2 K -485420708 1
F30 (*) 16 Bit data
P30 (P*) [S1 x S2 -> (D+1, D)]
Steps :7
Outline Multiples two 16-bit data and stores the result into the specified 32-bit area.
( P30 : executed only when the leading edge of the trigger is detected. )
Basic style
of instruction Trigge
r [ F30 * , S1 , S2 , D ]
■ Operands
Word Operands Constant
Preset (Set) Index
value WX WY WR WL SV EV DT Ld IX IY K H modifier
FL
S1
S2
D
: Available
Description Multiples the 16-bit data or constant value specified by S1 and the 16-bit data or
constant value specified by S2 as follows when the trigger tums ON.
The multiplied result is stored into D+1 and D (32-bit area).
Note :
The multipled result is stored into the 32-bit area.
The higher 16-bit area ( D+1 ) is automatically when the lower 16-bit area (D)
is specified.
D (lower) = WR6
D+1 (higher) = WR7
■ Flag condition
Error flag ( R9007 ) : Turns ON and keeps the ON state when the area specified
using the index modifier exceeds the limit.
The error address is transferred in the DT9017 and held.
Error flag ( R9008 ) : Turns ON for an instant when the area specified using
the index modifier exceeds the limit.
The error address is transferred in the DT9018.
Note :
Refer to " 2-6. (8) Special Relays ( R: R9000 to R910F ) ", for further
information of error flag.
Program
example Address Command
R0 10 ST R 0
10 [ F30 * , WX 0 , WX 1 , WR 5 ] 11 F 30 ( * )
WX 0
WX 1
WR 5
In the example above, multiplies the contents of WX0 ( K1010 ) and the contents of
WX1 ( K1234 ) when the R0 tums ON.
The multiplied result ( K1246340) is stored into WR6 and WR5.
WX 0
K 1010
X
WX 1
K 1234
R0 : ON
WR 6 WR 5
K 1246340
F31 (D*) 32 Bit data
P31 (PD*) [(S1 +1, S1) X (S2 +1, S2) -> (D+3, D+2, D+1, D)]
Steps :11
Outline Multiplies two 32-bit data and stores the result into the specified 64-bit area.
( P31 : executed only when the leading edge of the trigger is detected. )
Basic style
of instruction Trigger
[ F31 D* , S1 , S2 , D ]
■ Operands
Word Operands Constant
Preset (Set) Index
value WX WY WR WL SV EV DT Ld IX IY K H modifier
FL
S1
S2
D
: Available
Description Multiplies the 32-bit data or constant value specified by S1 and one specified by S2
when the trigger tums ON.
The multiplied result is stored into D+3, D+2, D+1 and D. (64-bit
area)
Note :
When processing 32-bit data, the higher 16-bit areas ( S1+1, S2+1) are
automatically decided if the lower 16-bit areas ( S1, S2 ) are specified.
S1 (lower) = DT0 S2 (lower) = WR1
S1+1 (higher) = DTl, S2+1 (higher) = WR2
The multipled result is stored into the 64-bit area.
The areas ( D+3 ,D+2, D+1 ) other than the lowest 16-bit area(D) are
automatically decided when the lowest 16-bit area is specified.
e.g. D = DT10
D+1 = DT11
D+2 = DT12
D+3 = DT13
■ Flag condition
Error flag ( R9007 ) : Turns ON and keeps the ON state when the area specified
using the index modifier exceeds the limit.
The error address is transferred in the DT9017 and held.
Error flag ( R9008 ) : Turns ON for an instant when the area specified using
the index modifier exceeds the limit.
The error address is transferred in the DT9018.
Note :
Refer to " 2-6. (8) Special Relays ( R: R9000 to R910F ) ", for further
information of error flag.
Program
example Address Command
R0 10 ST R 0
10 [ F31 D* , WX 0 , WX 2 , DT 0 ] 11 F 31 ( D* )
WX 0
WX 2
DT 0
In the example above, multiplies the contents of WX0 and WX1( K1638411) and the
contents of WX2 and WX3 ( K458761 ) when the R0 tums ON.
The multiplied result (K751639068771) is stored into DT3, DT2,DT1 and DT0.
WX 1 WX 0
K 1638411
X
WX 3 WX 2
K 458761
R0 : ON
DT 3 DT 2 DT 1 DT 0
K 751639068771
F32 (%) 16 Bit data
P32 (P%) [S1 / S2 -> D...(DT9015)]
Steps : 7
Outline Devides the 16-bit data by the devisor and stores the result and remainder
in to the specified area.
( P32 : executed only when the leading edge of the trigger is detected. )
Basic style
of instruction Trigger
[ F32 % , S1 , S2 , D ]
■ Operands
Word Operands Constant
Preset (Set) Index
value WX WY WR WL SV EV DT Ld IX IY K H modifier
FL
S1
S2
D
: Available
Description The 16-bit data or constant value specified by S1 is devided by the 16-bit data or
constant value specified by S2 when the trigger tums ON.
The quotient is stored into D and remainder is stored into the special data
register
(DT9015).
■ Flag condition
Error flag ( R9007 ) : Turns ON and keeps the ON state.
∙ when the area specified using the index modifier
exceeds the limit.
∙ when the constant value or 16-bit data for devisor
specified by S2 is 0.
The error address is transferred in the DT9017 and held.
Carry flag ( R9009 ) : Turns ON for an instant when negative minimum value.
(K-32768 or H8000 is devided by -1(K-1 or HFFFF)
Note :
Refer to " 2-6. (8) Special Relays ( R: R9000 to R910F ) ", for further
information of error flag.
Program
example Address Command
X0 10 ST X 0
10 [ F32 % , DT 0 , DT 1 , WR 0 11 F 32 ( % )
] DT 0
DT 1
WR 0
In the example above, devides the contents of DT0 ( K1138 ) by the contents of
DT1 ( K35 ) when the X0 tums ON.
The quotient (K32) is stored into WR0 and remainder (K5) is stored into the special data
register (DT9015).
DT 0
K 1138
DT 1
K 35
X0 : ON
WR 0
Quoient
K 32
DT9015
Remainder
K 5
F33 (D%) 32 Bit data
[(S1 +1, S1) / (S2 +1, S2) ->
P33 (PD%) (D+1, D)...DT9016, DT9015] Steps :11
Outline Devides the 32-bit data by the devisor and stores the result and remainder
into the specified area.
( P33 : executed only when the leading edge of the trigger is detected. )
Basic style
of instruction Trigge
r [ F33 D% , S1 , S2 , D ]
■ Operands
Word Operands Constant
Preset (Set) Index
value WX WY WR WL SV EV DT Ld IX IY K H modifier
FL
S1
S2
D
: Available
Description The 32-bit data or constant value specified by S1 is devided by the 32-bit data or
constant value specified by S2 when the trigger tums ON.
The quoient is stored into D+1 and D and the remainder is stored into the special
data registers (DT9016) and (DT9015).
Note :
When processing 32-bit data, the higher 16-bit areas ( S1+1, S2+1, D+1 ) are
automatically decided if the lower 16-bit areas ( S1, S2, D ) are specified.
S1 (lower) = DT0 S2 (lower) = WR1 D (lower) = WY1
S1+1 (higher) = DTl, S2+1 (higher) = WR2, D+1 (higher) = WY2
■ Flag condition
Error flag ( R9007 ) : Turns ON and keeps the ON state.
∙ when the area specified using the index modifier
exceeds the limit.
∙ when the constant value or 16-bit data for devisor
specified by S2 is 0.
The error address is transferred in the DT9017 and held.
Carry flag ( R9009 ) : Turns ON for an instant when negative minimum value.
(K-2147483648 or H80000000) is devided by -1 (K-1 or
H7FFFFFFF)
Note :
Refer to " 2-6. (8) Special Relays ( R: R9000 to R910F ) ", for further
information of error flag.
Program
example Address Command
X0 10
ST X
10 [ F33 D% , DT 0 , DT 10 , WR 0 011
] F 33 ( D% )
DT 0
DT 10
WR 0
In the example above, devides the contents of DT1 and DT0 ( K16908416) by the
contents of DT11 and DT10( K589828 ) when the X0 tums ON.
The quotient (K28) is stored into WR1 and WR0 and remainder (K393232) is stored into the
special data register (DT9016 and DT9015).
DT 1 DT 0
K 16908416
DT 11 DT 10
K 589828
X0 : ON
WR 1 WR 0
Quoient
K 28
DT9016 DT9015
Remainder
K 393232
F35 (+1) 16 Bit data increment
P35 (P+1) [D+1 -> D]
Steps : 3
Outline Adds 1 to the 16-bit data and stores the result into the augend area.
( P35 : executed only when the leading edge of the trigger is detected. )
Basic style
of instruction Trigge
r [ F35 +1 , D ]
■ Operands
Word Operands Constant
Preset Index
(Set) WX WY WR WL SV EV DT Ld IX IY K H modifier
FL
value
D
: Available
Description Add 1 to the 16-bit data specified by D when the trigger tums ON.
The added result is stored into D.
■ Flag condition
Error flag ( R9007 ) : Turns ON and keeps the ON state when the area specified
using the index modifier exceeds the limit.
The error address is transferred in the DT9017 and held.
Error flag ( R9008 ) : Turns ON for an instant when the area specified using
the index modifier exceeds the limit.
The error address is transferred in the DT9018.
Carry flag ( R9009 ) : Turns ON for an instant when the calculated result
exceeds the maximum value of 16-bit data (overflows)
※ Range of 16-bit data : K-32768 to K32767
Note :
Refer to " 2-6. (8) Special Relays ( R: R9000 to R910F ) ", for further
information of error flag.
Program
example Address Command
X0 10 ST X 0
10 [ F35 +1, WR 0 ] 11 F 35 ( +1 )
WR 0
In the example above, adds 1 to the contents of WR0 ( K1) when the X0 tums ON.
The added result ( K2 ) is stored into WR0.
WR 0
K 1
X0 : ON
WR 0
K 2
F36 (D+1) 32 Bit data increment
P36 (PD+1) [(D+1, D) +1 -> (D+1,D)]
Steps : 3
Outline Adds 1 to the 32-bit data and stores the result into the augend area.
( P36 : executed only when the leading edge of the trigger is detected. )
Basic style
of instruction Trigger
[ F36 D+1 , D ]
■ Operands
Word Operands Constant
Preset (Set) Index
value WX WY WR WL SV EV DT Ld IX IY K H modifier
FL
D
: Available
Description Add 1 to the 32-bit data specified by D when the trigger tums ON.
The added result is stored into D+1, D.
Note :
When processing 32-bit data, the higher 16-bit area ( D+1 ) is automatically
decided if the lower 16-bit area(D) is specified.
D (lower) = WR6
D+1 (higher) = WR7
■ Flag condition
Error flag ( R9007 ) : Turns ON and keeps the ON state when the area specified
using the index modifier exceeds the limit.
The error address is transferred in the DT9017 and held.
Error flag ( R9008 ) : Turns ON for an instant when the area specified using
the index modifier exceeds the limit.
The error address is transferred in the DT9018.
Carry flag ( R9009 ) : Turns ON for an instant when the calculated result
exceed the maximum value of 32-bit data (overflows)
※ Range of 32-bit data : K-2147483648 to K2147483647
Note :
Refer to " 2-6. (8) Special Relays ( R: R9000 to R910F ) ", for further
information of error flag.
Program
example Address Command
X0 10 ST X 0
10 [ F36 D+1, WR 0 ] 11 F 36 ( D+1 )
WR 0
In the example above, adds 1 to the contents of WR1 and WR0 ( K10 ) when the X0
tums ON.
The added result ( K2 ) is stored into WR1 and WR0.
WR 1 WR 0
K 10
X0 : ON
WR 1 WR 0
K 11
F37 (-1) 16 Bit data decrement
P37 (P-1) [D-1 -> D]
Steps : 3
Outline Substracts 1 from the 16-bit data and stores the result into the minuend area.
( P37 : executed only when the leading edge of the trigger is detected. )
Basic style
of instruction Trigger
[ F37 -1 , D ]
■ Operands
Word Operands Constant
Preset (Set) Index
value WX WY WR WL SV EV DT Ld IX IY K H modifier
FL
D
: Available
Description Substracts 1 from the 16-bit data specified by D when the trigger tums ON.
The substracted result is stored into D.
■ Flag condition
Error flag ( R9007 ) : Turns ON and keeps the ON state when the area specified
using the index modifier exceeds the limit.
The error address is transferred in the DT9017 and held.
Error flag ( R9008 ) : Turns ON for an instant when the area specified using
the index modifier exceeds the limit.
The error address is transferred in the DT9018.
Carry flag ( R9009 ) : Turns ON for an instant when the calculated result
becomes below the mimimum value of 16-bit data overflow)
※ Range of 16-bit data : K-32768 to K32767
Note :
Refer to " 2-6. (8) Special Relays ( R: R9000 to R910F ) ", for further
information of error flag.
Program
example Address Command
X0 10 ST X 0
10 [ F37 -1, WR 0 ] 11 F 37 ( -1 )
WR 0
In the example above, substracts 1 from the contents of WR0 ( K100) when the
X0
tumssubstracted
The ON. result ( K99) is stored into WR0.
WR 0
K 100
X0 : ON
WR 0
K 99
F38 (D-1) 32 Bit data decrement
P38 (PD-1) [(D+1, D) -1 -> (D+1,D)]
Steps : 3
Outline Subtracts 1 from the 32-bit data and stores the result into the minuend area.
( P38 : executed only when the leading edge of the trigger is detected. )
Basic style
of instruction Trigger
[ F38 D-1 , D ]
■ Operands
Word Operands Constant
Preset (Set) Index
value WX WY WR WL SV EV DT Ld IX IY K H modifier
FL
D
: Available
Description Subtracts 1 from the 32-bit data specified by D when the trigger tums ON.
The subtracted result is stored into D+1, D.
Note :
When processing 32-bit data, the higher 16-bit area ( D+1 ) is automatically
decided if the lower 16-bit area(D) is specified.
D (lower) = WR6
D+1 (higher) = WR7
■ Flag condition
Error flag ( R9007 ) : Turns ON and keeps the ON state when the area specified
using the index modifier exceeds the limit.
The error address is transferred in the DT9017 and held.
Error flag ( R9008 ) : Turns ON for an instant when the area specified using
the index modifier exceeds the limit.
The error address is transferred in the DT9018.
Carry flag ( R9009 ) : Turns ON for an instant when the calculated result
becomes below the minimum value of 32-bit data
(underflows)
※ Range of 32-bit data : K-2147483648 to K2147483647
Note :
Refer to " 2-6. (8) Special Relays ( R: R9000 to R910F ) ", for further
information of error flag.
Program
example Address Command
X0 10 ST X
10 [ F38 D-1, WR 0 ] 11 0
F 38 ( D-1 )
WR 0
In the example above, subtracts 1 from the contents of WR1 and WR0 ( K100000)
when the X0 tums ON.
The subtracted result ( K99999 ) is stored into WR1 and WR0.
WR 1 WR 0
K 100000
X0 : ON
WR 1 WR 0
K 99999
F160 (DSQR) 32 Bit data square root
[ ( S + 1 , S ->
) (D+1,D) ]
P160 (PDSQR) Steps : 7
Outline Finds the square root of the 32-bit data and stores the specified 32-bit area.
(P160 : executed only when the leading edge of the trigger is detected. )
Basic style
of instruction Trigger
[ F160 DSQR , S , D ]
■ Operands
Word Operands Constant
Preset (Set) Index
value WX WY WR WL SV EV DT Ld IX IY K H modifier
FL
S
D
: Available
Description The square root of the 32-bit data or constant value specified by S is calculated
when the trigger tums ON.
The result(square root) is stored into D+1, D.
※ The figures of the first decimal place and below are disregarded.
Note :
When processing 32-bit data, the higher 16-bit area ( S1+1, D+1 ) is
automatically decided if the lower 16-bit area(S, D) is specified.
S (lower) = WR6 D (lower) = DT0
S+1 (higher) = WR7, D+1 (higher) = DT1
■ Flag condition
Error flag ( R9007 ) : Turns ON and keeps the ON state.
∙ when the area specified using the index modifier
exceeds the limit.
∙ when the constant value or 32-bit data specified by
S is negative value.
The error address is transferred in the DT9017 and held.
X0 10 ST X
10 [ F160 DQSR, DT 0, WY 0 ] 11 0
F 160 (
DQSR)
DT 0
WY 0
In the example above, the square root of DT1 and DT0 ( K246813) is calculated
when the X0 tums ON.
The square root( K496 ) is stored into WY1 and WY0.
DT 1 DT 0
K 246813
X0 : ON
WY 1 WY 0
K 496
BCD Arithmetic Instructions
F40( B+ ) P40( PB+ ) 4-digit BCD [D+S -> D] ..................................208
F41( BD+ ) P41( PDB+ ) 8-digit BCD [D+1,D) + (S+1,S)
-> (D+1, D)] ......................210
F42( B+ ) P42( PD+ ) 4-digit BCD [S1+S2 -> D] ................................212
F43( DB+ ) P43( PDB+ ) 8-digit BCD [S1+1, S1) + (S2+1, S2)
-> (D+1, D)]........................214
F45( B- ) P45( PB- ) 4-digit BCD [D-S -> D] ....................................216
F48( DB- ) P43( PDB- ) 8-digit BCD [S1+1, S1) - (S2+1, S2)
-> (D+1, D)] ......................222
F51( DB* ) P51( PDB* ) 8-digit BCD [S1+1, S1) x (S2+1, S2)
-> (D+1, D)] ......................226
F53( DB% ) P53( PDB% ) 8-digit BCD [S1+1, S1) / (S2+1, S2)
-> (D+1,D)] (DT9016, DT90150] .................230
F55( B+1 ) P55( PB+1 ) 4-digit BCD increnent [D+1 ->D] ...................232
F57( B-1 ) P57( PB-1 ) 4-digit BCD decrenent [D-1 ->D] ...................236
F58(DB-1 ) P58( PDB-1 ) 8-digit BCD decrenent [D+1,D) - 1
-> (D+1, D) ........................238
Notes :
You can monitor 16-bit data by operational instruction 8 ( OP8 ) with the HANDY LOADER.
You can monitor 32-bit data by operational instruction 12 ( OP12 ) with the HANDY LOADER.
F40 (B+) 4-digit BCD
P40 (PB+) [D + S -> D]
Steps : 5
Outline Adds two 4-digit BCD data and stores the result into the augend area.
( P40 : executed only when the leading edge of the trigger is detected. )
Basic style
of instruction Trigger
[ F40 B+ , S , D ]
■ Operands
Word Operands Constant
Preset (Set) Index
value WX WY WR WL SV EV DT Ld IX IY K H modifier
FL
S
D
: Available
Description The 4-digit BCD data or constant value specified by S and the 4-digit BCD data
specified by D are added together as follows when the trigger tums ON.
The added result is stored into D ( area for augend )
Note :
When this instruction is used, the area for augend ( D ) is overwritten by the
addedresult. If you want to avoid the overwrite, we recommend you the use of
F42 / P42 instructions instead of F40 / P40 instructions.
■ Flag condition
Error flag ( R9007 ) : Turns ON and keeps the ON state.
∙ when the area specified using the index modifier
exceeds the limit.
∙ when the data is not BCD data.
The error address is transferred in the DT9017 and held.
Note :
Refer to " 2-6. (8) Special Relays ( R: R9000 to R910F ) ", for further
information of error flag.
Program
example Address Command
R0 10 ST R
10 [ F40 B+ , WR 5 , WR 6 ] 11 0
F 40 ( B+ )
WR 5
WR 6
In the example above, the contents of WR5 ( H1111 ) and WR6 ( H2222 ) are added
together when the R0 tums ON.
The added result ( H3333 ) is stored into WR6.
+
WR 5
1 1 1 1
R0 : ON
WR 6
3 3 3 3
F41 (DB+) 8 digit BCD
P41 (PDB+) [(D+1,D) + (S+1,S) -> (D+1,D)]
Steps : 7
Outline Adds two 8-digit BCD data and stores the result into the augend area.
( P41 : executed only when the leading edge of the trigger is detected. )
Basic style
of instruction Trigger
[ F41 DB+ , S , D ]
■ Operands
Word Operands Constant
Preset (Set) Index
value WX WY WR WL SV EV DT Ld IX IY K H modifier
FL
S
D
: Available
Description The 8-digit BCD data or constant value specified by S and the 8-digit BCD data
specified by D are added together as follows when the trigger tums ON.
Note :
When processing 8-digit BCD data, the higher 4-digit areas ( S+1, D+1 ) are
automatically decided if the lower 4-digit areas ( S, D ) are specified.
S (lower) = WR0 D (lower) = DT1
S+1( higher )= WRl, D+1 ( higher )= DT2
Note :
When this instruction is used, the area for augend ( D+1, D ) is overwritten
by the addedresult. If you want to avoid the overwrite, we recommend you the
use of F43/ P43 instructions instead of F41/ P41 instructions.
■ Flag condition
Error flag ( R9007 ) : Turns ON and keeps the ON state.
∙ when the area specified using the index modifier
exceeds the limit.
∙ when the data is not BCD data.
The error address is transferred in the DT9017 and held.
Carry flag ( R9009 ) : Turns ON for an instant when the calculated result
exceeds the maximum value of 8-digit BCD data.(overflows)
※ Range of 8-digit BCD data : H0 to H99999999
Note :
Refer to " 2-6. (8) Special Relays ( R: R9000 to R910F ) ", for further
information of error flag.
Program
example Address Command
X20 10 ST X 20
10 [ F41 DB+ , DT 0 , WR 0 ] 11 F 41 ( DB+ )
DT 0
WR 0
In the example above, the contents of WR1 and WR0 ( H12345678 ) and the contents
of DT1 and DT0 ( H98765432 ) are added together when the X20 turns ON.
The added result ( H11111110 ) is stored into WRI and WR0.
+
DT 1 DT 0
9 8 7 6 5 4 3 2
X20 : ON
WR 1 WR 0
1 1 1 1 1 1 1 0
F42 (B+) 4-digit BCD
P42 (PB+) [S1 + S2 -> D]
Steps : 7
Outline Adds two 4-digit BCD data and stores the result into the specified area.
( P42 : executed only when the leading edge of the trigger is detected. )
Basic style
of instruction Trigger
[ F42 B+ , S1 , S2 , D ]
■ Operands
Word Operands Constant
Preset (Set) Index
value WX WY WR WL SV EV DT Ld IX IY K H modifier
FL
S1
S2
D
: Available
The 4-digit BCD data or constant value specified by S1 and the 4-digit BCD data or
Description
constant value specified by S2 are added together as follows when the trigger tums
ON. added result is stored into D.
The
■ Flag condition
Error flag ( R9007 ) : Turns ON and keeps the ON state.
∙ when the area specified using the index modifier
exceeds the limit.
∙ when the data is not BCD data.
The error address is transferred in the DT9017 and held.
Note :
Refer to " 2-6. (8) Special Relays ( R: R9000 to R910F ) ", for further
information of error flag.
Program
example Address Command
X10 10 ST X 10
10 [ F42 B+ , DT 0 , DT 1 , WY2 11 F 42 ( B+ )
] DT 0
DT 1
WY 2
In the example above, the contents of DT0 ( H1111 ) and DT1 ( H2222 ) are added
together when the X10 tums ON.
The added result ( H3333 ) is stored into WY2.
+
DT 1
2 2 2 2
X10 : ON
WY 2
3 3 3 3
F43 (DB+) 8-digit BCD
P43 (PDB+) [(S1 + 1, S1) + (S2 +1,S2) -> (D+1,D)]
Steps :11
Outline Adds two 8-digit BCD data and stores the result into the specified area.
( P43 : executed only when the leading edge of the trigger is detected. )
Basic style
of instruction Trigger
[ F43 DB+ , S1 , S2 , D ]
S1 Constant value or lower 4-digit area of 8-digit BCD data (for augend)
S2 Constant value or lower 4-digit area of 8-digit BCD data (for addend)
■ Operands
Word Operands Constant
Preset (Set) Index
value WX WY WR WL SV EV DT Ld IX IY K H modifier
FL
S1
S2
D
: Available
Description The 8-digit BCD data or constant value specified by S1 and 8-digit BCD data or
constant value specified by S2 are added together as follows when the trigger tums
ON.
The added result is stored into D+1 and D.
Note :
When processing 8-digit BCD data, the higher 4-digit areas ( S1+1, S2+1, D+1 ) are
automatically decided if the lower 4-digit areas ( S1, S2, D ) are specified.
S1 (lower) = DT0 S2 (lower) = WR1 D (lower) = WY1
S1+1 (higher) = DTl, S2+1 (higher) = WR2, D+1 (higher) = WY2
■ Flag condition
Carry flag ( R9009 ) : Turns ON for an instant when the calculated result
exceeds the maximum value of 8-digit BCD data.(overflows)
※ Range of 8-digit BCD data : H0 to H99999999
Note :
Refer to " 2-6. (8) Special Relays ( R: R9000 to R910F ) ", for further
information of error flag.
Program
example Address Command
X20 10 ST X
10 [ F43 DB+ , DT 0 , WR 0 , WY 3] 11 20
F 43 ( DB+ )
DT 0
WR 0
WY 3
In the example above, the contents of DT1 and DT0 ( H12345678 ) and the contents
of WRI and WR0 ( H11111111 ) are added together when the X20 turns ON.
The added result ( H23456789 ) is stored into WY4 and WY3.
+
WR 1 WR 0
1 1 1 1 1 1 1 1
X20 : ON
WY 4 WY 3
2 3 4 5 6 7 8 9
F45 (B-) 4-digit BCD
P45 (PB-) [D - S -> D]
Steps : 5
Outline Subtracts two 4-digit BCD data from the minuend and stores the result into
theminuend area.
( P45 : executed only when the leading edge of the trigger is detected. )
Basic style
of instruction Trigger
[ F45 B- , S , D ]
■ Operands
Word Operands Constant
Preset (Set) Index
value WX WY WR WL SV EV DT Ld IX IY K H modifier
FL
S
D
: Available
Description Subtracts the 4-digit BCD data or constant value specified by S from the 4-digit BCD
data specified by D are as follows when the trigger tums ON.
The subtracted result is stored into D ( minuend area )
Note :
When this instruction is used, the area for minuend ( D ) is overwritten by the
subtracted result. If you want to avoid the overwrite, we recommend you the use
of F47 / P47 instructions instead of F45 / P45 instructions.
■ Flag condition
Error flag ( R9007 ) : Turns ON and keeps the ON state.
∙ when the area specified using the index modifier
exceeds the limit.
∙ when the data is not BCD data.
The error address is transferred in the DT9017 and held.
Note :
Refer to " 2-6. (8) Special Relays ( R: R9000 to R910F ) ", for further
information of error flag.
Program
example Address Command
R0 10 ST R 0
10 [ F45 B- , WR 5 , WR 6 ] 11 F 45 ( B- )
WR 5
WR 6
In the example above, subtracts the contents of WR5 ( H1111 ) from the contents of
WR6 ( H2222 ) when the R0 tums ON.
The subtracted result ( H1111 ) is stored into WR6.(mnuend area)
-
WR 5
1 1 1 1
R0 : ON
WR 6
1 1 1 1
F46 (DB-) 8-digit BCD
Outline Subtracts the 8-digit BCD data from the minuend and stores the result into
the minuend area.
(P46 : executed only when the leading edge of the trigger is detected. )
Basic style
of instruction Trigge
r [ F46 DB- , S , D ]
D Lower 4-digit area of 8-digit BCD data (for minuend and result)
■ Operands
Word Operands Constant
Preset Index
(Set) WX WY WR WL SV EV DT Ld IX IY K H modifier
FL
value
S
D
: Available
Description Subtracts the 8-digit BCD data or constant value specified by S from the 8-digit BCD
data specified by D as follows when the trigger tums ON.
Note :
When processing 8-digit BCD data, the higher 4-digit areas ( D+1, S+1 ) are
automatically decided if the lower 4-digit areas ( D, S ) are specified.
D (lower) = WR0 S (lower) = DT1
D+1( higher )= WRl, S+1 ( higher )= DT2
Note :
When this instruction is used, the area for minuend ( D+1, D ) is overwritten
by the subtracted result. If you want to avoid the overwrite, we recommend you
the use of F48/ P48 instructions instead of F46/ P46 instructions.
■ Flag condition
Carry flag ( R9009 ) : Turns ON for an instant when the calculated result
becomes below the minimum value of 8-digit BCD data.
(underflows)
※ Range of 8-digit BCD data : H0 to H99999999
Note :
Refer to " 2-6. (8) Special Relays ( R: R9000 to R910F ) ", for further
information of error flag.
Program
example Address Command
X20 40 ST X 20
40 [ F46 DB- , DT 0 , WR 0 ] 41 F 46 ( DB- )
DT 0
WR 0
In the example above, subtracted the contents of DT1 and DT0 ( H111111111 ) from
the contents of WR1 and WR0 ( H87654321 ) when the X20 turns ON.
The subtracted result ( H76543210 ) is stored into WRI and WR0.(minuend area)
-
DT 1 DT 0
1 1 1 1 1 1 1 1
X20 : ON
WR 1 WR 0
7 6 5 4 3 2 1 0
F47 (B-) 4-digit BCD
P47 (PB-) [S1 - S2 -> D]
Steps : 7
Outline Subtracts the 4-digit BCD data from the minuend and stores the result into
the specified area.
( P47 : executed only when the leading edge of the trigger is detected. )
Basic style
of instruction Trigger
[ F47 B- , S1 , S2 , D ]
■ Operands
Word Operands Constant
Preset (Set) Index
value WX WY WR WL SV EV DT Ld IX IY K H modifier
FL
S1
S2
D
: Available
Description Subtracts the 4-digit BCD data or constant value specified by S2 from the 4-digit
BCD data or constant value specified by S1 as follows when the trigger tums ON.
The subtracted result is stored into D.
■ Flag condition
Program
example Address Command
R0 10 ST R
10 [ F47 B- , WR 5 , WR 6 , WY 11 0
3 ] F 47 ( B- )
WR 5
WR 6
WY 3
In the example above, subtracts the contents of WR6 ( H2222 ) from the contents of
WR5 ( H5678 ) when the R0 tums ON.
The subtracted result ( H3456 ) is stored into WY3.
-
WR 6
2 2 2 2
R0 : ON
WY 3
3 4 5 6
F48 (DB-) 8-digit BCD
P48 (PDB-) [(S1 + 1, S1) - (S2 +1,S2) -> (D+1,D)]
Steps :11
ٛ utline Subtracts the 8-digit BCD data from the minuend and stores the result into
the specified area.
( P48 : executed only when the leading edge of the trigger is detected. )
Basic style
of instruction Trigger
[ F48 DB- , S1 , S2 , D ]
S1 Constant value or lower 4-digit area of 8-digit BCD data (for minuend)
S2 Constant value or lower 4-digit area of 8-digit BCD data (for addend)
■ Operands
Word Operands Constant
Preset (Set) Index
value WX WY WR WL SV EV DT Ld IX IY K H modifier
FL
S1
S2
D
: Available
Description Subtracts the 8-digit BCD data or constant value specified by S2 from the 8-digit
BCD data or constant value specified by S1 as follows when the trigger tums ON.
Note :
When processing 8-digit BCD data, the higher 4-digit areas ( S1+1, S2+1, D+1 ) are
automatically decided if the lower 4-digit areas ( S1, S2, D ) are specified.
S1 (lower) = DT0 S2 (lower) = WR1 D (lower) = WY1
S1+1 (higher) = DTl, S2+1 (higher) = WR2, D+1 (higher) = WY2
■ Flag condition
Error flag ( R9007 ) : Turns ON and keeps the ON state.
∙ when the area specified using the index modifier
exceeds the limit.
∙ when the data is not BCD data.
The error address is transferred in the DT9017 and held.
Carry flag ( R9009 ) : Turns ON for an instant when the calculated result
becomes below the minimum value of 8-digit BCD data.
(underflows)
※ Range of 8-digit BCD data : H0 to H99999999
Note :
Refer to " 2-6. (8) Special Relays ( R: R9000 to R910F ) ", for further
information of error flag.
Program
example Address Command
R10 10 ST R 10
10 [ F48 DB- , WX 0 , WX3 , DT50] 11 F 48 ( DB- )
WX 0
WX 3
DT 50
In the example above, subtracts the contents of WX4 and WX3 ( H11111111 ) from
the contents of WX1 and WX0 ( H88888888 ) when the R10 turns ON.
The subtracted result ( H77777777 ) is stored into DT51 and DT50.
-
WX 4 WX 3
1 1 1 1 1 1 1 1
R10 : ON
DT 51 DT 50
7 7 7 7 7 7 7 7
F50 (B*) 4-digit BCD
P50 (PB*) [S1 x S2 -> (D+1, D)]
Steps :7
Outline Multiples two 4-digit BCD data and stores the result into the specified
8-digit BCD area.
( P50 : executed only when the leading edge of the trigger is detected. )
Basic style
of instruction Trigger
[ F50 * , S1 , S2 , D ]
■ Operands
Word Operands Constant
Preset (Set) Index
value WX WY WR WL SV EV DT Ld IX IY K H modifier
FL
S1
S2
D
: Available
Description Multiples the 4-digit BCD data or constant value specified by S1 and the 4-digit BCD
data or constant value specified by S2 as follows when the trigger tums ON.
The multiplied result is stored into D+1 and D (32-bit area).
Note :
The multipled result is stored into the 8-digit area.
The higher 4-digit area ( D+1 ) is automatically when the lower 4-digit area(D)
is specified.
D (lower) = WR6
D+1 (higher) = WR7
■ Flag condition
Error flag ( R9007 ) : Turns ON and keeps the ON state.
∙ when the area specified using the index modifier
exceeds the limit.
∙ when the data is not BCD data.
The error address is transferred in the DT9017 and held.
Program
example Address Command
X0 10 ST X 0
10 [ F50 B* , WR 0 , WR 1, DT 100] 11 F 50 ( B* )
WR 0
WR 0
DT 100
In the example above, multiplies the contents of WR0 ( H1111 ) and the contents of
WR1 ( H1122 ) when the X0 tums ON.
x
WR 1
1 1 2 2
X0 : ON
DT 101 DT 100
0 1 2 4 6 5 4 2
F51 (DB*) 8-digit BCD
P51 (PDB*) [(S1 +1, S1) X (S2 +1, S2) -> (D+3, D+2, D+1, D)]
Steps :11
Outline Multiplies two 8-digit BCD data and stores the result into the specified
16-digit BCD area.
( P51 : executed only when the leading edge of the trigger is detected. )
Basic style
of instruction Trigger
[ F51 DB* , S1 , S2 , D ]
S1 Constant value or lower 4-digit area of 8-digit BCD data (for multiplicand)
S2 Constant value or lower 4-digit area of 8-digit BCD data (for multiplier)
■ Operands
Word Operands Constant
Preset (Set) Index
value WX WY WR WL SV EV DT Ld IX IY K H modifier
FL
S1
S2
D
: Available
Description Multiplies the 8-digit BCD data or constant value specified by S1 and one specified
by S2 when the trigger tums ON.
The multiplied result is stored into D+3, D+2, D1 and D.(16-digit
area)
Note :
When processing 8-digit BCD data, the higher 4-digit areas ( S1+1, S2+1) are
automatically decided if the lower 4-digit areas ( S1, S2 ) are specified.
S1 (lower) = DT0 S2 (lower) = WR1
S1+1 (higher) = DTl, S2+1 (higher) = WR2
Note :
Refer to " 2-6. (8) Special Relays ( R: R9000 to R910F ) ", for further
information of error flag.
Program
example Address Command
X0 10 ST X 0
10 [ F51 DB* , DT 0 , DT 2, DT 11 F 51 ( DB* )
200] DT 0
DT 2
DT 200
In the example above, multiplies the contents of DT1 and DT0( H01966100 ) and the
contents of DT3 and DT2( H03279840 ) when the X0 tums ON.
The multiplied result ( H0006442595124000 ) is stored into DT203, DT202,DT201
and DT200
DT 1 DT 0
0 1 9 6 6 1 0 0
x
DT 3 DT 2
0 3 2 7 9 8 4 0
X0 : ON
Outline Devides the 4-digit BCD data by the devisor and stores the result and
remainder in to the specified area.
( P52 : executed only when the leading edge of the trigger is detected. )
Basic style
of instruction Trigge
r [ F52 B% , S1 , S2 , D ]
■ Operands
Word Operands Constant
Preset Index
(Set) WX WY WR WL SV EV DT Ld IX IY K H modifier
FL
value
S1
S2
D
: Available
Description The 4-digit BCD data or constant value specified by S1 is devided by the 4-digit
BCD data or constant value specified by S2 when the trigger tums ON.
The quotient is stored into D and remainder is stored into the special data register
(DT9015).
■ Flag condition
Error flag ( R9007 ) : Turns ON and keeps the ON state.
∙ when the area specified using the index modifier
exceeds the limit.
∙ when the data is not BCD data.
∙ when the constant value or 4-digit BCD data for
devisor specified by S2 is 0.
The error address is transferred in the DT9017 and held.
X0 10 ST X 0
10 [ F52 B% , DT 0 , DT 1 , WR 0 11 F 52 ( B% )
] DT 0
DT 1
WR 0
In the example above, devides the contents of DT0 ( H1156 ) by the contents of
DT1 ( H0292 ) when the X0 tums ON.
The quotient ( H0003 ) is stored into WR0 and the remainder ( H0280 ) is stored into the
special data register (DT9015).
DT 1
0 2 9 2
X0 : ON
WR 0
Quoient
0 0 0 3
DT 9015
Remainder
0 2 8 0
F53 (DB%) 8-digit BCD
[(S1 +1, S1) / (S2 +1, S2) ->
P53 (PDB%) (D+1, D)...DT9016, DT9015] Steps :11
Outline Devides the 8-digit BCD data by the devisor and stores the result and
remainder into the specified area.
( P53 : executed only when the leading edge of the trigger is detected. )
Basic style
of instruction Trigge
r [ F53 DB% , S1 , S2 , D ]
S1 Constant value or lower 4-digit area of 8-digit BCD data (for devidend)
S2 Constant value or lower 4-digit area of 8-digit BCD data (for devisor )
■ Operands
Word Operands Constant
Preset Index
(Set) WX WY WR WL SV EV DT Ld IX IY K H modifier
FL
value
S1
S2
D
: Available
Description The 8-digit BCD data or constant value specified by S1 is devided by 8-digit BCD
data or constant value specified by S2 when the trigger tums ON.
The quoient is stored into D+1 and D and the remainder is stored into the special
data registers (DT9016) and (DT9015).
Note :
When processing 8-digit BCD data, the higher 4-digit areas ( S1+1, S2+1, D+1 )
are automatically decided if the lower 4-digit areas (S1, S2, D) are specified.
S1 (lower) = DT0 S2 (lower) = WR1 D (lower) = WY1
S1+1 (higher) = DTl, S2+1 (higher) = WR2, D+1 (higher) = WY2
■ Flag condition
Program
example Address Command
X0 10 ST X 0
10 [ F53 DB% , DT 0 , DT 2 , WR 11 F 53 ( DB% )
0 ] DT 0
DT 2
WR 0
In the example above, devides the contents of DT1 and DT0 ( H12851156 ) by the
contents of DT3 and DT2 ( H00000020 ) when the X0 tums ON.
The quotient ( H00642557 ) is stored into WR1 and WR0 and the remainder
( H00000016 ) is stored into the special data register (DT9016 and DT9015).
DT 3 DT 2
0 0 0 0 0 0 2 0
X0 : ON
WR 1 WR 0
Quoient
0 0 6 4 2 5 5 7
DT 9016 DT 9015
Remainder
0 0 0 0 0 0 1 6
F55 (B+1) 4-digit BCD increment
P55 (PB+1) [D+1 -> D]
Steps : 3
Outline Adds 1 to the 4-digit BCD data and stores the result into the augend area.
( P55 : executed only when the leading edge of the trigger is detected. )
Basic style
of instruction Trigger
[ F55 B+1 , D ]
■ Operands
Word Operands Constant
Preset (Set) Index
value WX WY WR WL SV EV DT Ld IX IY K H modifier
FL
D
: Available
Description Add 1 to the 4-digit BCD data specified by D when the trigger tums ON.
The added result is stored into D.
■ Flag condition
Error flag ( R9007 ) : Turns ON and keeps the ON state.
∙ when the area specified using the index modifier
exceeds the limit.
∙ when the data is not BCD data.
The error address is transferred in the DT9017 and held.
Carry flag ( R9009 ) : Turns ON for an instant when the calculated result
exceed the maximum value of 4-digit BCD data.(cverflows)
※ Range of 4-digit BCD data : H0 to H9999
Note :
Refer to " 2-6. (8) Special Relays ( R: R9000 to R910F ) ", for further
information of error flag.
Program
example Address Command
X0 10 ST X
10 [ F55 B+1, WR 0 ] 11 0
F 55 ( B+1 )
WR 0
In the example above, adds 1 to the contents of WR0 ( H1111 ) when the X0 tums
ON.
The added result ( H1112 ) is stored into WR0.
X0 : ON
WR 0
1 1 1 2
F56 (DB+1) 8-digit BCD increment
P56 (PDB+1) [(D+1, D) +1 -> (D+1,D)] Steps : 3
Outline Adds 1 to the 8-digit BCD data and stores the result into the augend area.
( P56 : executed only when the leading edge of the trigger is detected. )
Basic style
of instruction Trigger
[ F36 DB+1 , D ]
■ Operands
Word Operands Constant
Preset (Set) Index
value WX WY WR WL SV EV DT Ld IX IY K H modifier
FL
D
: Available
Description Add 1 to the 8-digit BCD data specified by D when the trigger tums ON.
The added result is stored into D+1, D.
Note :
When processing 8-digit BCD data, the higher 4-digit area ( D+1 ) is
automatically decided if the lower 4-digit area(D) is specified.
D (lower) = WR6
D+1 (higher) = WR7
■ Flag condition
Carry flag ( R9009 ) : Turns ON for an instant when the calculated result
exceed the maximum value of 8-digit BCD data.(cverflows)
※ Range of 8-digit BCD data : H0 to H99999999
Note :
Refer to " 2-6. (8) Special Relays ( R: R9000 to R910F ) ", for further
information of error flag.
Program
example Address Command
X0 10 ST X 0
10 [ F56 DB+1, WR 0 ] 11 F 56 ( DB+1 )
WR 0
In the example above, adds 1 to the contents of WR1 and WR0 ( H11111130 ) when
the X0 tums ON.
The added result ( H11111131 ) is stored into WR1 and WR0.
X0 : ON
WR 1 WR 0
1 1 1 1 1 1 3 1
F57 (B-1) 4-digit BCD decrement
P57 (PB-1) [D-1 -> D] Steps : 3
Outline Substracts 1 from the 4-digit BCD data and stores the result into the
minuend area.
( P57 : executed only when the leading edge of the trigger is detected. )
Basic style
of instruction Trigge
r [ F57 B-1 , D ]
■ Operands
Word Operands Constant
Preset Index
(Set) WX WY WR WL SV EV DT Ld IX IY K H modifier
FL
value
D
: Available
Description Substracts 1 from the 4-digit BCD data specified by D when the trigger tums ON.
The substracted result is stored into D.
■ Flag condition
Error flag ( R9007 ) : Turns ON and keeps the ON state.
∙ when the area specified using the index modifier
exceeds the limit.
∙ when the data is not BCD data.
The error address is transferred in the DT9017 and held.
Carry flag ( R9009 ) : Turns ON for an instant when the calculated result
becomes below the minimum value of 4-digit BCD data.
(Underflows)
※ Range of 4-digit BCD data : H0 to H9999
Note :
Refer to " 2-6. (8) Special Relays ( R: R9000 to R910F ) ", for further
information of error flag.
Program
example Address Command
X0 10 ST X
10 [ F57 B-1, WR 0 ] 11 0
F 57 ( B-1 )
WR 0
In the example above, substracts 1 from the contents of WR0 ( H1104) when the X0
tums ON.
The substracted result ( H1103 ) is stored into WR0.
X0 : ON
WR 0
1 1 0 3
F58 (DB-1) 8-digit BCD decrement
P58 (PDB-1) [(D+1, D) -1 -> (D+1,D)] Steps : 3
Outline Subtracts 1 from the 8-digit BCD data and stores the result into the
minuend area.
( P58 : executed only when the leading edge of the trigger is detected. )
Basic style
of instruction Trigger
[ F58 DB-1 , D ]
■ Operands
Word Operands Constant
Preset (Set) Index
value WX WY WR WL SV EV DT Ld IX IY K H modifier
FL
D
: Available
Description Subtracts 1 from the 8-digit BCD data specified by D when the trigger tums ON.
The subtracted result is stored into D+1, D.
Note :
When processing 8-digit BCD data, the higher 4-digit area ( D+1 ) is
utomatically decided if the lower 16-bit area(D) is specified.
D (lower) = WR6
D+1 (higher) = WR7
■ Flag condition
Error flag ( R9007 ) : Turns ON and keeps the ON state.
∙ when the area specified using the index modifier
exceeds the limit.
∙ when the data is not BCD data.
The error address is transferred in the DT9017 and held.
Carry flag ( R9009 ) : Turns ON for an instant when the calculated result
becomes below the minimum value of 8-digit BCD data.
(Underflows)
※ Range of 8-digit BCD data : H0 to H99999999
Note :
Refer to " 2-6. (8) Special Relays ( R: R9000 to R910F ) ", for further
information of error flag.
Program
example Address Command
X0 10 ST X 0
10 [ F58 DB-1, WR 3 ] 11 F 58 ( DB-1 )
WR 3
In the example above, subtracts 1 from the contents of WR4 and WR3 ( H66665553 )
when the X0 tums ON.
The subtracted result ( H66665552 ) is stored into WR4 and WR3.
X0 : ON
Notes :
You can monitor 16-bit data by operational instruction 8 ( OP8 ) with the HANDY LOADER.
You can monitor 32-bit data by operational instruction 12 ( OP12 ) with the HANDY LOADER.
F60 (CMP)
16 Bit data Compare
P60 (PCMP) Steps : 5
Basic style
of instruction Trigger
[ F60 CMP , S1 , S2 ]
■ Operands
Word Operands Constant
Preset (Set) Index
value WX WY WR WL SV EV DT Ld IX IY K H modifier
FL
S1
S2
: Available
Description Compares the 16-bit data specified by S1 with one specified by S2 when the
trigger tums ON.
■ Compared result
The compared result is sytored into the special relay (R900A , R900B , R900C).
Special relay
Comparision
DATA between R900A R900B R900C R9009
S1 and S2 ( >flag ) ( =flag ) ( <flag ) (Carry flag)
S1 < S2 0 0 1 ↕
16-bit data
S1 = S2 0 1 0 0
with sign
S1 > S2 1 0 0 ↕
S1 < S2 ↕ 0 ↕ 1
16-bit data
S1 = S2 0 1 0 0
without sign
S1 > S2 ↕ 0 ↕ 0
"0" : means OFF , "1" : means ON , "↕" : means flag changes to ON or OFF by conditions.
■ Flag condition
Error flag ( R9007 ) : Turns ON and keeps the ON state when the area specified
using the index modifier exceeds the limit.
The error address is transferred in the DT9017 and held.
Error flag ( R9008 ) : Turns ON for an instant when the area specified using
the index modifier exceeds the limit.
The error address is transferred in the DT9018.
Program
example Address Command
R0 20 ST R 0
20 [ F60 CMP , WX 2 , EV 201 ] 21 F 60 ( CMP )
R0 R900A Y40 WX 2
26 ( ) EV 201
26 ST R 0
R0 R900B Y41 27 AN R 900A
29 ( ) 28 OT Y 40
R0 R900C Y42 29 ST R 0
32 ( ) 30 AN R 900B
31 OT Y 41
32 ST R 0
33 AN R 900C
34 OT Y 42
In the example above, compares the Count (Elapsed) value of Timer /Counter " EV201"
with value of WX2 when the R0 turns ON.
① When the value of WX2 is greater than the Count ( Elapsed ) value of Timer /
Counter "EV201" output Y40 turns ON.
( Turns ON when WX2 > EV201 )
② When the value of WX2 and the Count ( Elapsed ) value of Timer / Counter
"EV201" are equal, output Y41 turns ON.
( Turns ON when WX2 = EV201 )
③ When the value of WX2 is less than the Count ( Elapsed ) value of Timer /
Counter "EV201" output Y42 turns ON.
( Turns ON when WX2 < EV201 )
Notes :
When using the special relays ( R9009, R900A, R900B and R900C ) as the flags
of the compared result. be sure to program them at the address right after the
Instruction and do not forget to program the same trigger as the instruction* to get
the accurate comparision result.
* If the special relays are programmed also In the other parts of the program,
the trigger prevents the result of the other instruction from affecting them.
If you program the F60 (CMP) instruction using the special relay 「R9010」 (ON
all the time ), the same trigger as the Instruction need not be programmed as
shown below.
R9010
20 [ F60 CMP , WX 2 , EV 201 ]
R900A Y40
26 ( )
R900B Y41
28 ( )
R900C Y42
32 ( )
F61 (DCMP)
32 Bit data Compare
P61 Steps : 9
(PDCMP)
Outline Compares one 32-bit data with another one.
( P61 : executed only when the leading edge of the trigger is detected. )
Basic style
of instruction Trigger
[ F61 DCMP , S1 , S2 ]
■ Operands
Word Operands Constant
Preset (Set) Index
value WX WY WR WL SV EV DT Ld IX IY K H modifier
FL
S1
S2
: Available
Description Compares the 32-bit data or constant value specified by S1 with one specified by
S2 when the trigger tums ON.
Note :
When processing 32-bit data, the higher 16-bit areas ( S+1, S2+1 ) are
automatically decided if the lower 16-bit areas ( S1, S2 ) are specified.
■ Compared result
The compared result is sytored into the special relay (R900A , R900B , R900C).
Special relay
Comparision
DATA between R900A R900B R900C R9009
S1 and S2 ( >flag ) ( =flag ) ( <flag ) (Carry flag)
S1 < S2 0 0 1 ↕
32-bit data
S1 = S2 0 1 0 0
with sign
S1 > S2 1 0 0 ↕
S1 < S2 ↕ 0 ↕ 1
32-bit data
S1 = S2 0 1 0 0
without sign
S1 > S2 ↕ 0 ↕ 0
"0" : means OFF , "1" : means ON , "↕" : means flag changes to ON or OFF by conditions.
■ Flag condition
Error flag ( R9007 ) : Turns ON and keeps the ON state when the area specified
using the index modifier exceeds the limit.
The error address is transferred in the DT9017 and held.
Error flag ( R9008 ) : Turns ON for an instant when the area specified using
the index modifier exceeds the limit.
The error address is transferred in the DT9018.
Program
example Address Command
R0 20 ST R 0
20 [ F61 DCMP , WX 0 , DT 0 ] 21 F 61 ( DCMP )
WX 0
R0 R900A Y50
DT 0
30 ( ) 30 ST R 0
R0 R900B Y51 31 AN R 900A
33 32 OT Y 50
( )
33 ST R 0
R0 R900C Y52 34 AN R 900B
36 ( ) 35 OT Y 51
36 ST R 0
37 AN R 900C
38 OT Y 52
In the example above, compares the 32-bit data(WX0, WX1) with the 32-bit data(DT1
, DT0) when the R0 turns ON.
The compared result is stored into the special relay (R9009, R900A, to R900C ).
① When the value of 「WX0 and WX1」is greater than the value of 「DT0 and
DT1」 output Y50 turns ON.
( Turns ON when WX1, WX0 > DT1, DT0 )
② When the value of 「WX0 and WX1」and the value of 「DT0 and DT1」are
equal, output Y51 turns ON.
( Turns ON when WX1, WX0 = DT1, DT0 )
③ When the value of 「WX0 and WX1」is less than the value of「DT0 and DT1」
output Y52 turns ON.
( Turns ON when WX1, WX0 < DT1, DT0 )
Notes :
When using the special relays ( R9009, R900A, R900B and R900C ) as the flags
of the compared result. be sure to program them at the address right after the
Instruction and do not forget to program the same trigger as the instruction* to get
the accurate comparison result.
* If the special relays are programmed also In the other parts of the program,
the trigger prevents the result of the other instruction from affecting them.
If you program the F61 (DCMP) instruction ualng the special relay「R9010」(ON
all the time ), the same trigger as the Insruction need not be programmed as
shown below.
R9010
20 [ F61 DCMP , WX 0 , DT 0 ]
R900A Y50
30 ( )
R900B Y51
32 ( )
R900C Y52
34 ( )
F62 (WIN) 16 Bit data range
Compare
P62 (PWIN) Steps : 7
Outline Compares one 16-bit data with the range specified by two other 16-bit data.
( P62 : executed only when the leading edge of the trigger is detected. )
Basic style
of instruction Trigger
[ F62 WIN , S1 , S2, S3 ]
■ Operands
Word Operands Constant
Preset (Set) Index
value WX WY WR WL SV EV DT Ld IX IY K H modifier
FL
S1
S2
S3
: Available
Description Compares the 16-bit data or constant value with sign specified by S1 with the
range specified by S2 ( lower limit 16-bit data or constant value with sign ) and S3
( upper limit 16-bit data or constant value with sign ) when the trigger tums ON.
Since the BCD data is also treated as 16-bit data with sign, we recommend you the
use of the BCD data within the range of H0 to H7999 to avoid confusion.
■ Compared result
The compared result is sytored into the special relay (R900A , R900B , R900C).
Comparision
Special relay
between
R900A R900B R900C
S1, S2 and S3
( >flag ) ( =flag ) ( <flag )
S1 < S2 0 0 1
S2 ≤S1≤S3 0 1 0
S1 > S3 1 0 0
"0" : means OFF , "1" : means ON
■ Flag condition
Error flag ( R9007 ) : Turns ON and keeps the ON state.
∙ when the area specified using the index modifier
exceeds the limit.
∙ when S2 > S3.
The error address is transferred in the DT9017 and held
Error flag ( R9008 ) : Turns ON for an instant.
∙ when the area specified using the index modifier
exceeds the limit.
∙ when S2 > S3.
The error address is transferred in the DT9018.
Program
example Address Command
R0 20 ST R 0
20 [ F62 WIN , WX 0 , DT 0 , WR 21 F 62 ( WIN )
R0 5] R900A Y50 WX 0
DT 0
28 ( ) WR 5
R0 R900B Y51 28 ST R 0
31 29 AN R 900A
( )
30 OT Y 50
R0 R900C Y52 31 ST R 0
34 ( ) 32 AN R 900B
33 OT Y 51
34 ST R 0
35 AN R 900C
36 OT Y 52
In the example above, compares the 16-bit data with sign specified by 「WX0」with
the range of 「DT0」(lower limit 16-bit data with sign ) to 「WR5」(upper limit 16-bit
data with sign ) when the R0 turns ON.
The compared result is stored into the special relay( R900A, to R900C ).
① When the value of 「WX0 」is greater than the value of 「WR5」, output Y50
turns ON.
( Turns ON when WX0 > WR5 )
② When the value of 「WX0 」is equal and greater than the value of 「DT0」
and one is equal and less than value of 「WR5」, output Y51 turns ON.
( Turns ON when DT0 ≤ WX0 ≤ WR5 )
③ When the value of 「WX0」is less than the value of「DT0」, output Y52 turns
ON.
( Turns ON when WX0 < DT0 )
Notes :
When using the special relays ( R900A, R900B and R900C ) as the flags of the
compared result. be sure to program them at the address right after the Instruction
and do not forget to program the same trigger as the instruction* to get the
accurate comparision result.
* If the special relays are programmed also In the other parts of the program,
the trigger prevents the result of the other instruction from affecting them.
If you program the F62 (WIN) instruction ualng the special relay 「R9010」(ON
all the time ), the same trigger as the Instruction need not be programmed as
shown below.
R9010
20 [ F62 WIN , WX 0 , DT 0 , WR
R900A 5] Y50
28 ( )
R900B Y51
30 ( )
R900C Y52
32 ( )
F63 (DWIN) 32 Bit data range
Compare
P63 (PDWIN) Steps :13
Outline Compares one 32-bit data with the range specified by two other 32-bit data.
( P63 : executed only when the leading edge of the trigger is detected. )
Basic style
of instruction Trigge
r [ F63 DWIN , S1 , S2, S3 ]
S2 Constant value or lower 16-bit area of 32-bit data for lower limit
S3 Constant value or lower 16-bit area of 32-bit data for upper limit
■ Operands
Word Operands Constant
Preset Index
(Set) WX WY WR WL SV EV DT Ld IX IY K H modifier
FL
value
S1
S2
S3
: Available
Description Compares the 32-bit data or constant value with sign specified by S1 with the
range specified by S2 ( lower limit 32-bit data or constant value with sign ) and S3
( upper limit 32-bit data or constant value with sign ) when the trigger tums ON.
Note :
When processing 32-bit data, the higher 16-bit areas ( S+1, S2+1, S3+1 ) are
automatically decided if the lower 16-bit areas ( S1, S2, S3 ) are specified.
Since the BCD data is also treated as 32-bit data with sign, we recommend you the
use of the BCD data within the range of H0 to H79999999 to avoid confusion.
■ Compared result
The compared result is sytored into the special relay (R900A to R900C).
Comparision
Special relay
between
R900A R900B R900C
S1, S2 and S3
( >flag ) ( =flag ) ( <flag )
S1 < S2 0 0 1
S2 ≤S1≤S3 0 1 0
S1 > S3 1 0 0
"0" : means OFF , "1" : means ON
■ Flag condition
Error flag ( R9007) : Turns ON and keeps the ON state.
∙ when the area specified using the index modifier
exceeds the limit.
∙ when (S2+1, S2) > (S3+1, S3)
The error address is transferred in the DT9017.
Error flag ( R9008 ) : Turns ON for an instant.
∙ when the area specified using the index modifier
exceeds the limit.
∙ when (S2+1, S2) > (S3+1, S3).
The error address is transferred in the DT9018.
Program
example Address Command
R0 20 ST R
20 [ F63 DWIN , WX 0 , DT 0 , 21 0
R0 WRR900A
5] Y50 F 63 ( DWIN
)
34 ( ) WX 0
R0 R900B Y51 34 DT 0
37 35 WR 5
( )
36 ST R 0
R0 R900C Y52 37 AN R
40 ( ) 38 900A
39 OT Y 50
40 ST R 0
41 AN R
42 900B
OT Y 51
In the example above, compares the 32-bit data with sign specified byST「WX1,R WX0」0
with the range of 「DT1 , DT0」 to 「WR6, WR5」 when the R0 turns AN ON. R
The compared result is stored into the special relay( R900A, to R900C900C
).
① When the value of 「WX1, WX0 」is greater than the value ofOT 「WR6,Y WR5」,
52
output Y50 turns ON.
[ Turns ON when (WX1, WX0) > (WR6, WR5 ) ]
② When the value of 「WX1, WX0 」is equal and greater than the value of
「DT1, DT0」 and one is equal and less than value of 「WR6, WR5」, output
Y51 turns ON.
[ Turns ON when (DT1, DT0) ≤ (WX1, WX0) ≤ (WR6, WR5 ) ]
③ When the value of 「WX1, WX0」is less than the value of「DT1, DT0」,
output Y52 turns ON.
[ Turns ON when (WX1, WX0) < (DT1, DT0 ) ]
Notes :
When using the special relays ( R900A, R900B and R900C ) as the flags of the
compared result. be sure to program them at the address right after the Instruction
and do not forget to program the same trigger as the instruction* to get the
accurate comparisin result.
* If the special relays are programmed also In the other parts of the program,
the trigger prevents the result of the other instruction from affecting them.
If you program the F63 (DWIN) instruction using the special relay 「R9010」 (ON
all the time ), the same trigger as the Instruction need not be programmed as
shown below.
R9010
20 [ F63 DWIN , WX 0 , DT 0 ,
R900A WR 5] Y50
34 ( )
R900B Y51
36 ( )
R900C Y52
38 ( )
Logic Operation Instructions
Notes :
You can monitor 16-bit data by operational instruction 8 ( OP8 ) with the HANDY LOADER.
You can monitor 32-bit data by operational instruction 12 ( OP12 ) with the HANDY LOADER.
F65 (WAN) 16 Bit data
Basic style
of instruction Trigger
[ F66 WAN , S1 , S2, D ]
■ Operands
Word Operands Constant
Preset (Set) Index
value WX WY WR WL SV EV DT Ld IX IY K H modifier
FL
S1
S2
D
: Available
Description Executed AND operation of each bit 16-bit data or in constant value specified by S1
and S2 when the trigger tums ON :
The AND operated result is stored into D.
S1 S2 D
0 0 0
0 1 0
1 0 0
1 1 1
■ Flag condition
Error flag ( R9007 ) : Turns ON and keeps the ON state when the area specified
using the index modifier exceeds the limit.
The error address is transferred in the DT9017 and held.
Error flag ( R9008 ) : Turns ON for an instant when the area specified using
the index modifier exceeds the limit.
The error address is transferred in the DT9018.
Note :
Refer to " 2-6. (8) Special Relays ( R: R9000 to R910F ) ", for further
information of error flag.
Program
example Address Command
X0 10 ST X
10 [ F65 WAN , WR 0 , WR 1 , WY 11 0
5] F 65 ( WAN )
WR 0
WR 1
WY 5
In the example above, executes AND operation of each bin in 16-bit data 「WR0」and
「WR1」 when the X0 turns ON.
The AND operated result is stored into 「WY5」.
You can use this instruction to turn OFF the certain bits of 16-bit data as follows.
WR0 0 1 1 1 1 0 1 1 0 0 1 0 1 1 1 0
WR1 1 1 0 1 1 0 0 1 0 0 0 0 1 0 1 1
X0 : ON
WY5 0 1 0 1 1 0 0 1 0 0 0 0 1 0 1 0
Basic style
of instruction Trigge
r [ F66 WOR , S1 , S2, D ]
■ Operands
Word Operands Constant
Preset Index
(Set) WX WY WR WL SV EV DT Ld IX IY K H modifier
FL
value
S1
S2
D
: Available
Description Executed OR operation of each bit 16-bit data or in constant value specified by S1
and S2 when the trigger tums ON :
The OR operated result is stored into D.
S1 S2 D
0 0 0
0 1 1
1 0 1
1 1 1
■ Flag condition
Error flag ( R9007 ) : Turns ON and keeps the ON state when the area specified
using the index modifier exceeds the limit.
The error address is transferred in the DT9017 and held.
Error flag ( R9008 ) : Turns ON for an instant when the area specified using
the index modifier exceeds the limit.
The error address is transferred in the DT9018.
X0 10 ST X
10 [ F66 WOR , WR 0 , WR 1 , WY 11 0
5] F 66 ( WOR )
WR 0
WR 1
WY 5
In the example above, executes OR operation of each bin in 16-bit data 「WR0」and
「WR1」 when the X0 turns ON.
The OR operated result is stored into 「WY5」.
You can use this instruction to turn ON the certain bits of 16-bit data as follows.
WR0 0 1 1 1 1 0 1 1 0 0 1 0 1 1 1 0
WR1 1 1 0 1 1 0 0 1 0 0 0 0 1 0 1 1
X0 : ON
WY5 1 1 1 1 1 0 1 1 0 0 1 0 1 1 1 1
F67 (XOR) 16 Bit data
Exclusive OR
P67 (PXOR) Steps : 7
Basic style
of instruction Trigge
r [ F67 XOR , S1 , S2, D ]
■ Operands
Word Operands Constant
Preset (Set) Index
value WX WY WR WL SV EV DT Ld IX IY K H modifier
FL
S1
S2
D
: Available
Description Executed exclusive OR operation of each bit 16-bit data or in constant value specified
by S1 and S2 when the trigger tums ON :
The exclusive OR operated result is stored into D.
S1 S2 D
0 0 0
0 1 1
1 0 1
1 1 0
■ Flag condition
Error flag ( R9007 ) : Turns ON and keeps the ON state when the area specified
using the index modifier exceeds the limit.
The error address is transferred in the DT9017 and held.
Error flag ( R9008 ) : Turns ON for an instant when the area specified using
the index modifier exceeds the limit.
The error address is transferred in the DT9018.
Note :
Refer to " 2-6. (8) Special Relays ( R: R9000 to R910F ) ", for further
information of error flag.
Program
example Address Command
X0 10 ST X 0
10 [ F67 XOR , WR 0 , WR 1 , WY 11 F 67 ( XOR )
5] WR 0
WR 1
WY 5
In the example above, executes exclusive OR operation of each bin in 16-bit data
「WR0」and 「WR1」 when the X0 turns ON.
The exclusive OR operated result is stored into 「WY5」.
You can use this instruction to check how many bits in two 16-bit data same.
WR0 0 1 1 1 1 0 1 1 0 0 1 0 1 1 1 0
WR1 1 1 0 1 1 0 0 1 0 0 0 0 1 0 1 1
X0 : ON
WY5 1 0 1 0 0 0 1 0 0 0 1 0 0 1 0 1
F68 (XNR) 16 Bit data
Exclusive NOR
P68 (PXNR) Steps : 7
Outline Executes exclusive NOR operation of each bit in two 16-bit data.
( P68 : executed only when the leading edge of the trigger is detected. )
Basic style
of instruction Trigger
[ F68 XNR , S1 , S2, D ]
■ Operands
Word Operands Constant
Preset (Set) Index
value WX WY WR WL SV EV DT Ld IX IY K H modifier
FL
S1
S2
D
: Available
Description Executed exclusive NOR operation of each bit 16-bit data or in constant value
specified by S1 and S2 when the trigger tums ON :
The exclusive OR operated result is stored into D.
S1 S2 D
0 0 1
0 1 0
1 0 0
1 1 1
■ Flag condition
Error flag ( R9007 ) : Turns ON and keeps the ON state when the area specified
using the index modifier exceeds the limit.
The error address is transferred in the DT9017 and held.
Error flag ( R9008 ) : Turns ON for an instant when the area specified using
the index modifier exceeds the limit.
The error address is transferred in the DT9018.
X0 10 ST X 0
10 [ F68 XNR , WR 0 , WR 1 , WY 11 F 68 ( XNR )
5] WR 0
WR 1
WY 5
In the example above, executes exclusive NOR operation of each bin in 16-bit data
「WR0」and 「WR1」 when the X0 turns ON.
The exclusive NOR operated result is stored into 「WY5」.
You can use this instruction to check how many bits in two 16-bit data same.
WR0 0 1 1 1 1 0 1 1 0 0 1 0 1 1 1 0
WR1 1 1 0 1 1 0 0 1 0 0 0 0 1 0 1 1
X0 : ON
WY5 0 1 0 1 1 1 0 1 1 1 0 1 1 0 1 0
DATA Conversion Instructions
F80( BCD) P80( PBCD ) 16-bit data -> 4-digit BCD ......................262
F81( BIN ) P81( PBIN ) 4-digit BCD -> 16bit data ...........................264
F82( DBCD ) P82( PDBCD ) 32-bit data -> 8-digit BCD ......................266
F83( DBIN ) P83( PDBIN ) 8-digit BCD -> 32bit data ...........................268
F84( INV ) P84( PINV ) 16 bit data Invert .......................................270
F85( NEG ) P86( PNEG ) 16 bit data Two's complement ......................272
F86( DNEG ) P86( PDNEG ) 32 bit data Two's complement ......................274
F87( ABS ) P87( PABS ) 16 bit data Absolute ...................................276
F88( DABS ) P88( PDABS ) 32 bit data Absolute ...................................278
F89( EXT ) P89( PEXT ) 16 bit data Sign extension .........................280
F90( DECO ) P90( PDECO ) Decode ...........................................................282
F91( SEGT ) P91( PSEGT ) 16 bit data 7-segment decode ......................285
F92( ENCO ) P92( PENCO ) Encode ...........................................................287
F93( UNIT ) P93( PUNIT ) 16 bit data Combine .....................................290
F94(DIST ) P94( PDIST ) 16 bit data Distribute ................................292
F95( ASC ) P95( PASC ) Character -> ASCII code ..............................294
F96( SRC ) P96( PSRC ) Table data Search ........................................296
Notes :
You can monitor 16-bit data by operational instruction 8 ( OP8 ) with the HANDY LOADER.
You can monitor 32-bit data by operational instruction 12 ( OP12 ) with the HANDY LOADER.
F80 (BCD)
16-bit binary data -> 4-digit BCD
P80 (PBCD) Steps : 5
Basic style
of instruction Trigger
[ F80 BCD , S , D ]
■ Operands
Word Operands Constant
Preset (Set) Index
value WX WY WR WL SV EV DT Ld IX IY K H modifier
FL
S
D
: Available
Description Converts the 16-bit binary by specified by S to 4-digit BCD data when the trigger
tums ON.
The converted data is stored into D.
■ Flag condition
Error flag ( R9007 ) : Turns ON and keeps the ON state.
∙ when the area specified using the index modifier
exceeds the limit.
∙ when the 16-bit binary data exceeds K9999(decimal)
or H270F(Hexadecimal).
The error address is transferred in the DT9017 and held.
Note :
Refer to " 2-6. (8) Special Relays ( R: R9000 to R910F ) ", for further
information of error flag.
Program
example Address Command
X0 10 ST X 0
10 [ F80 BCD , WR 5 , WR 6 ] 11 F 80 ( BCD )
WR 5
WR 6
In the example above, converts the contents of WR5 [ K9883 (decimal) ] to the
4-digit BCD data when the X0 tums ON.
X0 : ON
WR 6
9 8 8 3 BCD data
1 0 0 1 1 0 0 0 1 0 0 0 0 0 1 1
F81 (BIN)
4-digit BCD -> 16-bit binary data
P81 (PBIN) Steps : 5
Basic style
of instruction Trigger
[ F81 BIN , S , D ]
■ Operands
Word Operands Constant
Preset (Set) Index
value WX WY WR WL SV EV DT Ld IX IY K H modifier
FL
S
D
: Available
Description Converts the 4-digit BCD data by specified S to 16-bit binary data when the trigger
tums ON.
The converted data is stored into D.
■ Flag condition
Error flag ( R9007 ) : Turns ON and keeps the ON state.
∙ when the area specified using the index modifier
exceeds the limit.
∙ when the BCD data exceeds H9999(BCD).
The error address is transferred in the DT9017 and held.
Note :
Refer to " 2-6. (8) Special Relays ( R: R9000 to R910F ) ", for further
information of error flag.
Program
example Address Command
X0 10 ST X
10 [ F81 BIN , WR 5 , WR 6 ] 11 0
F 81 ( BIN )
WR 5
WR 6
In the example above, converts the contents of WR5 [ H7269 (BCD) ] to the 16-bit
data when the X0 tums ON.
The converted data [ K7269 (decimal) ] is stored into WR6.
X0 : ON
WR 6
K7269 decimal
0 0 0 1 1 1 0 0 0 1 1 0 0 1 0 1
F82 (DBCD)
32-bit binary data -> 8-digit BCD
P82 (PDBCD) Steps : 7
Basic style
of instruction Trigger
[ F82 DBCD , S , D ]
■ Operands
Word Operands Constant
Preset (Set) Index
value WX WY WR WL SV EV DT Ld IX IY K H modifier
FL
S
D
: Available
Description Converts the 32-bit binary by specified by S to 8-digit BCD data when the trigger
tums ON.
The converted data is stored into D+1, D.
Note :
When processing 32-bit(8-digit BCD) data, the higher 16-bit(4-digit) areas [( S+1), (D+
1)] is automatically decided if the lower 16-bit(4-digit) areas [ S(D)] is specified.
■ Flag condition
Error flag ( R9007 : Turns ON and keeps the ON state.
∙ when the area specified using the index modifier
) exceeds the limit.
∙ when the 32-bit binary data exceeds K99999999
(decimal) or H5F5E0FF(Hexadecimal).
The error address is transferred in the DT9017 and held.
Note :
Refer to " 2-6. (8) Special Relays ( R: R9000 to R910F ) ", for further
information of error flag.
Program
example Address Command
X0 10 ST X 0
10 [ F82 DBCD , WR 5 , WR 7 ] 11 F 82 ( DBCD )
WR 5
WR 7
In the example above, converts the contents of WR6 and WR5 [ K72811730 (decimal) ]
to the 8-digit BCD data when the X0 tums ON.
The converted data [ H72811730 (BCD) ] is stored into WR8 and WR7.
decimal
X0 : ON
WR 8 WR 7
7 2 8 1 1 7 3 0
0 1 1 1 0 0 1 0 1 0 0 0 0 0 0 1 0 0 0 1 0 1 1 1 0 0 1 1 0 0 0 0
BCD
data
F83 (DBIN)
8-digit BCD -> 32-bit binary data
P83 (PDBIN) Steps : 7
Basic style
of instruction Trigger
[ F83 DBIN , S , D ]
■ Operands
Word Operands Constant
Preset (Set) Index
value WX WY WR WL SV EV DT Ld IX IY K H modifier
FL
S
D
: Available
Description Converts the 8-digit BCD data by S to 32-bit binary data when the trigger tums ON.
Note :
When processing 8-digit BCD(32-bit) data, the higher 4-digit(16-bit) areas [( S+1), (D+
1) ] is automatically decided if the lower 4-digit(16-bit) areas [ S(D) ] is specified.
■ Flag condition
Error flag ( R9007 ) : Turns ON and keeps the ON state.
∙ when the area specified using the index modifier
exceeds the limit.
∙ when the BCD data exceeds K99999999(BCD).
The error address is transferred in the DT9017 and held.
X0 10 ST X 0
10 [ F83 DBIN , WR 5 , WR 7 ] 11 F 83 ( DBIN )
WR 5
WR 7
In the example above, converts the contents of WR6 and WR5 [ H56781234
(BCD) ] to tthe 32-bit binary data when the X0 tums ON.
The converted data [ K56781234 (decimal)] is stored into WR8 and WR7.
BCD
X0 : ON
data
WR 8 WR 7
K56781234
0 0 0 0 0 0 1 1 0 1 1 0 0 0 1 0 0 1 1 0 1 0 0 1 1 0 1 1 0 0 1 0
decimal
F84 (INV)
16-bit data Invert
P84 (PINV) Steps : 3
Basic style
of instruction Trigger
[ F84 INV , D ]
■ Operands
Word Operands Constant
Preset (Set) Index
value WX WY WR WL SV EV DT Ld IX IY K H modifier
FL
D
: Available
Description Inverts the contents (0 or 1) of 16-bit data when the trigger tums ON.
The inverted result is stored into the D.
This instruction is useful to control an external device of negative logic.
■ Flag condition
Error flag ( R9007 ) : Turns ON and keeps the ON state when the area specified
using the index modifier exceeds the limit.
The error address is transferred in the DT9017 and held.
Error flag ( R9008 ) : Turns ON for an instant when the area specified using
the index modifier exceeds the limit.
The error address is transferred in the DT9018.
Note :
Refer to " 2-6. (8) Special Relays ( R: R9000 to R910F ) ", for further
information of error flag.
Program
example Address Command
X0 10 ST X 0
10 [ F84 INV , DT 0 ] 11 F 84 ( INV )
DT 0
In the example above, inverts the contents of DT0 ( 0011 1110 1010 0101 ) when the
X0 tums ON.
The inverted result ( 1100 0001 0101 1010 ) is stored into DT0.
X0 : ON
DT 0
HC15A Hexadecimal
1 1 0 0 0 0 0 1 0 1 0 1 1 0 1 0
F85 (NEG) 16-bit data
P85 (PNEG) Two's complement Steps : 3
Basic style
of instruction Trigger
[ F85 NEG , D ]
D 16-bit area
■ Operands
Word Operands Constant
Preset (Set) Index
value WX WY WR WL SV EV DT Ld IX IY K H modifier
FL
D
: Available
Description Get' two's complement of 16-bit data specified by D when the trigger tums ON.
The two's complement of 16-bit data is stored into the D.
This instruction is useful to invert the sign bits aof 16-bit data.
※ The two's complement is obtained by inverting all the bits and adding 1 to the
inverted result.
■ Flag condition
Error flag ( R9007 ) : Turns ON and keeps the ON state when the area specified
using the index modifier exceeds the limit.
The error address is transferred in the DT9017 and held.
Error flag ( R9008 ) : Turns ON for an instant when the area specified using
the index modifier exceeds the limit.
The error address is transferred in the DT9018.
Note :
Refer to " 2-6. (8) Special Relays ( R: R9000 to R910F ) ", for further
information of error flag.
Program
example Address Command
X0 10 ST X 0
10 [ F85 NEG , DT 0 ] 11 F 85 ( NEG )
DT 0
In the example above, gets two's complement of DT0 [ K19897 (decimal) ] when the
X0 tums ON.
The two's complement [K-19897 (decimal)] is stored into DT0.
X0 : ON
DT 0
K-19897 decimal
1 0 1 1 0 0 1 0 0 1 0 0 0 1 1 1
F86 (DNEG) 32-bit data
P86 (PDNEG) Two's complement
Steps : 3
Basic style
of instruction Trigger
[ F86 DNEG , D ]
■ Operands
Word Operands Constant
Preset (Set) Index
value WX WY WR WL SV EV DT Ld IX IY K H modifier
FL
D
: Available
Description Get' two's complement of 32-bit data specified by D when the trigger tums ON.
The two's complement of 32-bit data is stored into the D+1, D.
Note :
When processing 32-bit data, the higher 16-bit ( D+1), is automatically decided if the lower
16-bit (D) is specified.
This instruction is useful to invert the sign bits aof 32-bit data.
※ The two's complement is obtained by inverting all the bits and adding 1 to the
inverted result.
■ Flag condition
Error flag ( R9007 ) : Turns ON and keeps the ON state when the area specified
using the index modifier exceeds the limit.
The error address is transferred in the DT9017 and held.
Error flag ( R9008 ) : Turns ON for an instant when the area specified using
the index modifier exceeds the limit.
The error address is transferred in the DT9018.
Note :
Refer to " 2-6. (8) Special Relays ( R: R9000 to R910F ) ", for further
information of error flag.
Program
example Address Command
X0 10 ST X 0
10 [ F86 DNEG , DT 0 ] 11 F 86 ( DNEG )
DT 0
In the example above, gets two's complement of DT1 and DT0 [K13039254031
(decimal
)] when the X0 tums ON.
The two's complement of DT1 and DT0 [ K13039254031 (decimal) ] is stored into
DT1 and DT0.
BCD
X0 : ON
data
DT 1 DT 0
K-1303925403
1 0 1 1 0 0 1 0 0 1 0 0 0 1 1 0 0 0 1 0 0 1 1 0 1 1 0 0 0 1 0 1
decimal
F87 (ABS) 16-bit data
P87 (PABS) Absolute
Steps : 3
Basic style
of instruction Trigger
[ F87 ABS , D ]
D 16-bit area
■ Operands
Word Operands Constant
Preset (Set) Index
value WX WY WR WL SV EV DT Ld IX IY K H modifier
FL
D
: Available
Description Gets absolute value of 16-bit data specified by D when the trigger tums ON.
The absolute value of 16-bit data is stored into the D.
This instruction is useful to operate the data whose sign(+ /-) may vary.
■ Flag condition
Error flag ( R9007 ) : Turns ON and keeps the ON state.
∙when the area specified using the index modifier
exceeds the limit.
∙when the 16-bit data is "K-32768(decimal)" or "H8000
(Hexadecimal)"
The error address is transferred in the DT9017 and held.
Carry flag ( R9009 ) : Turns ON for an instant when the 16-bit data is "K-1
(decimal) to K-32767(decimal)" or "HFFFF(Hexadecimal) to
H8001(Hexadecimal)".
Note :
Refer to " 2-6. (8) Special Relays ( R: R9000 to R910F ) ", for further
information of error flag.
Program
example Address Command
X0 50 ST X 0
50 [ F87 ABS , DT 0 ] 51 F 87 ( ABS )
DT 0
In the example above, gets absolute value of DT0 [ K-12871 (decimal) ] when the X0
tums ON.
The absolute value [ K12871 (decimal) ]is stored into DT0.
X0 : ON
DT 0
K12871 decimal
0 0 1 1 0 0 1 0 0 1 0 0 0 1 1 1
F88 (DABS) 32-bit data
P88 (PDABS) Absolute
Steps : 3
Basic style
of instruction Trigge
r [ F88 DABS , D ]
■ Operands
Word Operands Constant
Preset Index
(Set) WX WY WR WL SV EV DT Ld IX IY K H modifier
FL
value
D
: Available
Description Gets absolute value of 32-bit data specified by D when the trigger tums ON.
The absolute value of 32-bit data is stored into the D+1, D.
This instruction is useful to operate the data whose sign(+ /-) may vary.
■ Flag condition
Error flag ( R9007 ) : Turns ON and keeps the ON state.
∙when the area specified using the index modifier
exceeds the limit.
∙when the 32-bit data is "K-2147483647(decimal)" or
"H80000000 (Hexadecimal)"
The error address is transferred in the DT9017 and held.
Carry flag ( R9009 ) : Turns ON for an instant when the 32-bit data is "K-1
(decimal) to K-2147483647(decimal)" or "HFFFF
(Hexadecimal) to H80000001(Hexadecimal)".
Note :
Refer to " 2-6. (8) Special Relays ( R: R9000 to R910F ) ", for further
information of error flag.
Program
example Address Command
X0 10 ST X 0
10 [ F88 DABS , DT 0 ] 11 F 88 ( DABS )
DT 0
In the example above, gets absolute value of DT1 and DT0 [K-843458245 (decimal)]
when the X0 tums ON.
The absolute value [ K843458245 (decimal) ] is stored into DT1 and DT0.
decimal
X0 : ON
DT 1 DT 0
K843458245
0 0 1 1 0 0 1 0 0 1 0 0 0 1 1 0 0 0 1 0 0 1 1 0 1 1 0 0 0 1 0 1
decimal
F89 (EXT) 16-bit data
P89 (PEXT) Sign extension
Steps : 3
Outline Copies the sign bit of the specified 16-bit data to all the bits of the 16-bit
area with one higher area No.
( P89 : executed only when the leading edge of the trigger is detected. )
Basic style
of instruction Trigger
[ F89 EXT , D ]
■ Operands
Word Operands Constant
Preset (Set) Index
value WX WY WR WL SV EV DT Ld IX IY K H modifier
FL
D
: Available
Description Copies the sign bit of the 16-bit data specified by D to all tje bits of D+1 when the
trigger tums ON.
The 16-bit data can be converted to the 32-bit data using this instruction.
■ Flag condition
Error flag ( R9007 ) : Turns ON and keeps the ON state when the area specified
using the index modifier exceeds the limit.
The error address is transferred in the DT9017 and held.
Error flag ( R9008 ) : Turns ON for an instant when the area specified using
the index modifier exceeds the limit.
The error address is transferred in the DT9018.
Note :
Refer to " 2-6. (8) Special Relays ( R: R9000 to R910F ) ", for further
information of error flag.
Program
example Address Command
X0 10 ST X 0
10 [ F89 EXT , DT 0 ] 11 F 89 ( EXT )
DT 0
In the example above, copies the sign bit of 16-bit data specified by DT0 to all the
bits of DT1 when the X0 tums ON.
The result as 32-bit data is stored into DT1 and DT0.
decimal
X0 : ON
Basic style
of instruction Trigger
[ F90 DECO , S , n , D ]
■ Operands
Word Operands Constant
Preset (Set) Index
value WX WY WR WL SV EV DT Ld FL IX IY K H modifier
S
n
D
: Available
Description Decodes the constant value or 16-bit data specified by S according to the contents of
the "n" when the trigger tums ON.
The result is stored into the area specified by D.
The "n" specifies ;
Bit No. 0 to 3 : number of bits to be decoded
Bit No. 8 to 11 : start bit No. to be decoded
(The bits No. 4 through No. 12 through No. 15 are invalid. )
Specifications of "n"
Program
example Address Command
R0 50 ST R 0
50 [ F90 DEC0 ,WX0 , DT0 , WR5 ] 51 F 90 ( DECO )
WX 0
DT 0
WR 5
Bit 15∙∙12 11∙∙ 8 7∙∙ 4 3∙∙0 4 bits from bit No.4 to No.7 are
WX0 - - - - - - - - 0 1 1 1 - - - - decoded (0111 = K7)
R0 : ON
Number of bits to Occupied data area for Valid bits in the area for
be decoded(nL) the result the result
1 1-word 2-bit *
2 1-word 4-bit *
3 1-word 8-bit *
4 1-word 16-bit
5 2-word 32-bit
6 4-word 64-bit
7 8-word 128-bit
8 16-word 256-bit
* Invalid bits in the occupied data area for the result are set to "0".
Example :
In tje case of decoding the 4-bit data (conditions ; nL=4, nH=0), the 16-bit data for
the decoded result is shown below.
Basic style
of instruction Trigger
[ F91 SEGT , S , D ]
■ Operands
Word Operands Constant
Preset (Set) Index
value WX WY WR WL SV EV DT Ld IX IY K H modifier
FL
S
D
: Available
Description Converts the constant value or 16-bit data specified by S to 4-digit data for
7-segment indication when the trigger tums ON.
The converted data is stored into D+1, D.
■ Flag condition
Note :
Refer to " 2-6. (8) Special Relays ( R: R9000 to R910F ) ", for further
information of error flag.
Program
example Address Command
X0 10 ST X 0
10 [ F91 SEGT , DT 0 , WY 4 ] 11 F 91 ( SEGT )
DT 0
WY 4
In the example above, converts the contents of DT0[ H159F (Hexadecimal) ] to 4-digit
data for 7-segment indication.
The converted data is stored into WY5 and WY4.
X0 : ON
7-segment
7-segment convertion table indication
F92 (ENCO)
Encode
P92 (PENCO) Steps : 7
Basic style
of instruction Trigger
[ F92 ENCO , S , n , D ]
■ Operands
Word Operands Constant
Preset (Set) Index
value WX WY WR WL SV EV DT Ld FL IX IY K H modifier
D
: Available
Encodes the contents of specified number of bits starting from the bit No.0 in the area
Description specified by S according to the contents of the "n" when the trigger tums ON.
The result is stored into the area specified by D starting from the specified bit No.
The "n" specifies ;
Bit No. 0 to 3 : specifies the number of bits to be encoded
(specifies the factorial of "2")
Bit No. 8 to 11 : start bit No. in the area for the result
(The bits No. 4 through No. 7 and No.12 to No.15 are invalid. )
Specifications of "n"
Note :
Invalid bits in the specified area for the result are set to "0".
When two or more bits are in ON state in the area to be encoded, the highest bit
has the priority.
■ Flag condition
Error flag ( R9007 : Turns ON and keeps the ON state.
) ∙when the area specified using the index modifier
exceeds the limit.
nL
∙when the "nL" [number of bits( 2 ) to be encoded]
becomes outside the range of 1 to 8.
∙when the sum of the "nL" and "nH" becomes outside
the range of 1 to 16.
∙when the data to be encoded is 0.
The error address is transferred in the DT9017 and held.
Refer to " 2-6. (8) Special Relays ( R: R9000 to R910F ) ", for further
information of error flag.
Program
example Address Command
R0 50 ST R 0
51 F 92 ( ENCO )
50 [ F92 ENCO ,WX0 , DT0 , WX 0
WR5 ] DT 0
WR 5
Encodes the contents of 26 (64) bits specified by WX0 accoding to the contents of
DT0.
The result is stored into the start bit No.(nH) of WR5.
Contents of "DT0" .
Bit 15∙∙12 11∙∙ 8 7∙∙ 4 3∙∙0 Bit 15∙∙12 11∙∙ 8 7∙∙ 4 3∙∙0
WX1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 WX0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
WX3 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 WX2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
The 59th bit of 64-bit data "WX0" turns ON
when R0 turns ON. The decoded result
R0 : ON "K59(decimal)" is stored into WR5,
1 2-bit
2 4-bit
3 8-bit (1 byte)
4 16-bit (1 word)
5 32-bit (2 words)
6 64-bit (4 words)
7 128-bit (8 words)
8 256-bit(16 words)
Example :
In case of encoding the 16-bit data (conditions ; nL=4, nH=0), the encoded result is
shown below.
Outline Combines lower 4 bits of 16-bit data (up to 4 data) and stores the resuilt
as 16-bit data.
( P93 : executed only when the leading edge of the trigger is detected. )
Basic style
of instruction Trigger
[ F93 UNIT , S , n , D ]
■ Operands
S
n
D
: Available
Description Combines lower 4 bits of 16-bit data (number of 16-bit data defines by "n".) specified
by S.
The combined data is stored into the area specified by D.
The number of combined data can be specified by "n" from 1 to 4.
※ When 0 is specified by "n", this instruction is not execute.
■ Operation of combination
Program
example Address Command
R0 50 ST R 0
51 F 93 ( UNIT )
50 [ F93 UNIT, WX1 , K 4 , WR5 ]
WX 1
K 4
WR 5
In the example above, combine lower 4 bits WX1 to WX4 when the R0 turns ON.
The combined data is stored into WR5.
R0 : ON
Outline Divides 16-bit data by 4-bit units and stores each 4-bit into the lower 4-bit
of the specified 16-bit data.
( P94 : executed only when the leading edge of the trigger is detected. )
Basic style
of instruction Trigger
[ F94 DIST , S , n , D ]
■ Operands
Word Operands Constant
Preset (Set) Index
value WX WY WR WL SV EV DT Ld FL IX IY K H modifier
S
n
D
: Available
Description Divides the 16-bit data specified by S into 4 (4-bit units) and distributes them to the
lower 4-bit (bit No. 0 to No.3) of each area by D when the trigger turns ON.
The number of destination areas can be specified by "n" from 1 to 4.
※ When 0 is specified by "n", this instruction is not execute.
■ Operation of division
Program
example Address Command
R0 50 ST R 0
51 F 94 ( DIST )
50 [ F94 DIST , WX0 , K 4 , WX 0
WY5 ] K 4
WY 5
In the example above, divides 16-bit data of WX0 by 4-bit units when the R0 turns
ON.
The combined data is stored into WY5.
R0 : ON
Basic style
of instruction Trigger
[ F95 ASC , S , D ]
■ Operands
Word Operands Constant
Preset (Set) Index
value WX WY WR WL SV EV DT Ld FL IX IY M modifier
D
: Available
Description Converts the characters specified by S into the ASCII code when the trigger turns
ON.
The converted ASCII code data is stored into the 6-word data area starting from D.
■ Flag condition
Error flag ( R9007 ) : Turns ON and keeps the ON state when the last area for
the ASCII code exceeds the limit.
The error address is transferred in the DT9017 and held.
Error flag ( R9008 ) : Turns ON for an instant when the last area for the
ASCII code exceeds the limit.
The error address is transferred in the DT9018.
Note :
Refer to " 2-6. (8) Special Relays ( R: R9000 to R910F ) ", for further
information of error flag.
Program
example Address Command
R0 60 ST R 0
61 F 96 ( ASC )
60 [ F95 ASC ,M ABC1230 DEF9, DT 0]
M ABC1230
DEF9
DT 0
Converts the character constants [ M ABC1230 DEF9 (Character) ] into the ASCII
code
when the R0 turns ON.
The convered ASCII code data is stored into DT5 to DT0.
M ABC1230 DEF9 character constants (M)
R0 : ON
DT 0 H 42 (B) H 41 (A)
DT 1 H 31 (1) H 43 (C)
DT 2 H 33 (3) H 32 (2)
DT 3 H 20 ( ) H 30 (0)
DT 4 H 45 (E) H 44 (D)
DT 5 H 39 (9) H 46 (F)
* ASCII CODE
b8
b7 0 0 0 0 1 1 1 1
b6 0 0 1 1 0 0 1 1
b5 0 1 0 1 0 1 0 1
b8 b7 b6 b5 b4 b3 b2 b1 C 0 1 2 3 4 5 6 7
R
0 0 0 0 0 NUL DEL SPAC 0 @ P ` p
E
0 0 0 1 1 SOH DC1 ! 1 A Q a q
0 0 1 0 2 STX DC2 “ 2 B R b r
0 0 1 1 3 ETX DC3 # 3 C S c s
0 1 0 0 4 EOT DC4 $ 4 D T d t
0 1 0 1 5 ENQ NAK % 5 E U e u
1 0 0 0 8 BS CAN ( 8 H X h x
1 0 0 1 9 HT EM ) 9 I Y i y
1 0 1 0 A LF SUB * : J Z j z
1 0 1 1 B VT ESC + ; K 〔 k {
1 1 0 0 C FF FS ‘ < L ₩ l |
1 1 0 1 D CR GS - = M 〕 m }
1 1 1 0 E SO RS . > N ∧ n ~
1 1 1 1 F SI US / ? O _ o DEL
F96 (SRC) Table data
Search
P96 (PSRC) Steps : 7
Outline Searchs the specified 16-bit data from the specified block.
( P96 : executed only when the leading edge of the trigger is detected. )
Basic style
of instruction Trigger
[ F96 SRC , S1, S2 , S3 ]
■ Operands
Word Operands Constant
Preset (Set) Index
value WX WY WR WL SV EV DT Ld FL IX IY K H modifier
S1
S2
S3
: Available
Description Searchs the 16-bit data specified by S1 from the block specified by the areas from S2
(starting area) through S3 ( last area ) when the trigger turns ON.
The number of found data is transferred in the special data register "DT9037".
The position of the first found data from the starting 16-bit area ( S2=0 ) is
ransferred in the special data register "DT9038".
※ Be sure to set S2 ≤ S3 .
■ Flag condition
Error flag ( R9007 ) : Turns ON and keeps the ON state.
∙when the area specified using the index modifier
exceeds the limit.
∙when S2 ≥ S3.
The error address is transferred in the DT9017 and held.
Note :
Refer to " 2-6. (8) Special Relays ( R: R9000 to R910F ) ", for further
information of error flag.
∙
Program
example Address Command
X0 20 ST X
21 0
20 [ F96 SRC ,DT 0 , WR 0 , WR20]
F 98 ( SRC )
DT 0
WR 0
WR 20
In the example above, searches the contents of DT0 from the block from
WR0(starting
area) through WR20 (last area) when the X0 turns ON.
The number of found data is transferred in DT9037.
The position of the first found data from WR0 (WR0=0) is transferred in DT9038.
15 ∙∙∙∙∙∙∙∙ ∙∙∙∙∙∙∙0
WR0 1 0 1 0 0 0 1 1 0 0 1 1 1 1 0 1 0
∙
∙ ∙ ∙
∙ ∙ ∙
∙ ∙ ∙
∙ ∙ ∙
∙ ∙ ∙ Searching
∙ ∙ ∙
∙ ∙ ∙∙
∙ ∙ 19
WR20 0 1 1 0 1 1 1 0 0 1 1 1 0 0 0 0
Notes :
You can monitor 16-bit data by operational instruction 8 ( OP8 ) with the HANDY LOADER.
You can monitor 32-bit data by operational instruction 12 ( OP12 ) with the HANDY LOADER.
F100 (SHR) 16-bit data
Outline Shift the specified number of bits to the right in the 16-bit data.
(P100 : executed only when the leading edge of the trigger is detected. )
Basic style
of instruction Trigger
[ F100 SHR , D , n ]
■ Operands
Word Operands Constant
Preset (Set) Index
value WX WY WR WL SV EV DT Ld FL IX IY K H modifier
n
: Available
Description Shift "n" bits (number of bits defines by "n".) to the right in the 16-bit data specified
by D when the trigger turns ON.
The data of significant bits "n" as shown below :
When n bits are shifted to the right, n bits starting from the bit No.15 are filled with
0 (The shift-in data = 0)
The data (0 or 1) of bit No. n-1 is shifted out to the carry flag (special relay
R9009)
Error flag ( R9008 ) : Turns ON for an instant when the area specified using
the index modifier exceeds the limit.
The error address is transferred in the DT9018.
Carry flag ( R9009 ) : Turns ON for an instant when the bit No. n-1 is recogn-
-ized as "1".
Note :
Refer to 「4-7. SPECIAL RELAYS( R :R9000 TO R901F )」 , for future information
of error flag.
Program
example Address Command
R0 10 ST R 0
11 F 100 ( SHR )
10 [ F100 SHR , DT 5 , H 4 ]
DT 5
H 4
In the example above, shifts 4 bits to the right in the contents of DT5 (101001101100
1011) when the R0 turns ON.
The DT5 becomes (0000101001101100) .
The bit data of bit No.3 is shifted out to the carry flag.
Outline Shift the specified number of bits to the left in the 16-bit data.
(P101 : executed only when the leading edge of the trigger is detected. )
Basic style
of instruction Trigger
[ F101 SHL , D , n ]
■ Operands
Word Operands Constant
Preset (Set) Index
value WX WY WR WL SV EV DT Ld FL IX IY K H modifier
n
: Available
Description Shift "n" bits (number of bits defines by "n".) to the left in the 16-bit data specified
by D when the trigger turns ON.
The data of significant bits "n" as shown below :
When n bits are shifted to the left, n bits starting from the bit No.0 are filled with
0 (The shift-in data = 0)
The data (0 or 1) of bit No. 16-n is shifted out to the carry flag (special relay R9009)
bit No.15-(n-1)
Error flag ( R9008 ) : Turns ON for an instant when the area specified using
the index modifier exceeds the limit.
The error address is transferred in the DT9018.
Carry flag ( R9009 ) : Turns ON for an instant when the bit No.16-n is recogn-
-ized as "1".
Note :
Refer to " 2-6. (8) Special Relays ( R: R9000 to R910F ) ", for further
information of error flag.
Program
example Address Command
R0 10 ST R 0
11 F 101 ( SHL )
10 [ F101 SHL , DT 5 , K 4 ]
DT 5
K 4
In the example above, shifts 4 bits to the left in the contents of DT5 (101001101100
1011) when the R0 turns ON.
The DT5 becomes (0110110010110000) .
The bit data of bit No.12 is shifted out to the carry flag.
Shift-out R0 : ON
Outline Shift one digit (4 bits) of the specified 16-bit data to the right.
(P105 : executed only when the leading edge of the trigger is detected. )
Basic style
of instruction Trigger
[ F105 BSR , D ]
■ Operands
Word Operands Constant
Preset (Set) Index
value WX WY WR WL SV EV DT Ld FL IX IY K H modifier
D
: Available
Description Shift one digit (4 bits) of the area specified by D to the right when the trigger turns
ON.
The shift-out 1 digit (bit No. 0 to 3) is shifted in the special data register DT9014 to
the left.
When 1 digit is shifted to the right, 1 digit data from bit No.12 to No.15 becomes 0.
[ The shift-in data = "0000 (H0)" ]
15 ∙∙ 12 15 ∙∙ 12 15 ∙∙ 12 15 ∙∙ 12
Shift-in Digit 4 Digit 3 Digit 2 Digit 1
DT9014 : 0 0 0
■ Flag condition
Error flag ( R9007 ) : Turns ON and keeps the ON state when the area specified
using the index modifier exceeds the limit.
The error address is transferred in the DT9017 and held.
Error flag ( R9008 ) : Turns ON for an instant when the area specified using
the index modifier exceeds the limit.
The error address is transferred in the DT9018.
Note :
Refer to " 2-6. (8) Special Relays ( R: R9000 to R910F ) ", for further
information of error flag.
Program
example Address Command
R0 10 ST R 0
11 F 105 ( BSR )
10 [ F105 BSR , WY 3 ]
WY 3
In the example above, shifts the one digit of WY3 (Digit 1 to 4) to the right when
R0 turns ON.
The contents of Digit 1 is shifted in the bit 0 to 3 of DT9014.
R0 : ON
DT9014 0 0 0 Digit 1
F106 (BSL) 16-bit data
Outline Shift one digit (4 bits) of the specified 16-bit data to the left.
(P106 : executed only when the leading edge of the trigger is detected. )
Basic style
of instruction Trigger
[ F106 BSL , D ]
■ Operands
Word Operands Constant
Preset (Set) Index
value WX WY WR WL SV EV DT Ld FL IX IY K H modifier
D
: Available
Description Shift one digit (4 bits) of the area specified by D to the left when the trigger turns
ON.
The shift-out 1 digit (bit No. 0 to 3) is shifted in the special data register DT9014 to
the left.
When 1 digit is shifted to the left, 1 digit data from bit No.12 to No.15 becomes 0.
[ The shift-in data = "0000 (H0)" ]
15 ∙∙ 12 15 ∙∙ 12 15 ∙∙ 12 15 ∙∙ 12
Digit 4 Digit 3 Digit 2 Digit 1 Shift-in data
"0000 (H0)"
DT9014 : 0 0 0
■ Flag condition
Error flag ( R9007 ) : Turns ON and keeps the ON state when the area specified
using the index modifier exceeds the limit.
The error address is transferred in the DT9017 and held.
Error flag ( R9008 ) : Turns ON for an instant when the area specified using
the index modifier exceeds the limit.
The error address is transferred in the DT9018.
Note :
Refer to " 2-6. (8) Special Relays ( R: R9000 to R910F ) ", for further
information of error flag.
Program
example Address Command
R0 10 ST R 0
11 F 106 ( BSL )
10 [ F106 BSL , WY 3 ]
WY 3
In the example above, shifts the one digit of WY3 (Digit 1 to 4) to the left when
R0 turns ON.
The contents of Digit 4 is shifted in the bit 0 to 3 of DT9014.
R0 : ON
DT9014 0 0 0 Digit 4
F110 (WSHR) Block
Basic style
of instruction Trigger
[ F110 WSHR , D1, D2 ]
D1 Starting 16-bit area [one word (16 bits) shifted to the right]
D2 Last 16-bit area [ one word (16 bits) shifted to the right ]
■ Operands
Word Operands Constant
Preset (Set) Index
value WX WY WR WL SV EV DT Ld FL IX IY K H modifier
D1
D2
: Available
Description Shifts one word (16 bits) of the block specified by D1 and D2 to the right when the
trigger turns ON.
The shift-out word is deleted.
The shift-in word is "0".
D2 D2 - 1 D1 + 2 D1 + 1 D1
Before execution
Trigger : ON
shift out
After execution 0
shift in "0"
■ Flag condition
Error flag ( R9007 ) : Turns ON and keeps the ON state.
∙when the area specified using the index modifier
exceeds the limit.
∙when D1≥D2
The error address is transferred in the DT9017 and held.
Note :
Refer to " 2-6. (8) Special Relays ( R: R9000 to R910F ) ", for further
information of error flag.
Program
example Address Command
R0 50 ST R 0
51 F 110( WSHR )
50 [ F110 WSHR , DT 0 , DT 5 ]
DT 0
DT 5
In the example above, shifts the one word (16 bits) of the block from DT0 though
DT5
to the right when the R0 turns ON.
The shift-out word "H0232" is deleted.
Basic style
of instruction Trigger
[ F111 WSHL , D1, D2 ]
D1 Starting 16-bit area [one word (16 bits) shifted to the left]
D2 Last 16-bit area [ one word (16 bits) shifted to the left ]
■ Operands
Word Operands Constant
Preset (Set) Index
value WX WY WR WL SV EV DT Ld FL IX IY K H modifier
D1
D2
: Available
Description Shifts one word (16 bits) of the block specified by D1 and D2 to the left when the
trigger turns ON.
The shift-out word is deleted.
The shift-in word is "0".
D2 D2 - 1 D1 + 2 D1 + 1 D1
Before execution
Trigger : ON
shift out
After execution 0
shift in "0"
■ Flag condition
Error flag ( R9007 ) : Turns ON and keeps the ON state.
∙when the area specified using the index modifier
exceeds the limit.
∙when D1≥D2
The error address is transferred in the DT9017 and held.
Note :
Refer to " 2-6. (8) Special Relays ( R: R9000 to R910F ) ", for further
information of error flag.
Program
example Address Command
X0 20 ST X
21 0
20 [ F111 WSHL , DT 0 , DT 5 ]
F 111( WSHL
)
DT 0
DT 5
In the example above, shifts the one word (16 bits) of the block from DT0 though DT5
to the left when the X0 turns ON.
The shift-out word "H0010" is deleted.
Shift-out
X0 : ON
H000 H001 H021 H001 H021 H003
0 0 0 2 2 0
F112 (WBSR) Block
Basic style
of instruction Trigger
[ F112 WBSR , D1, D2 ]
■ Operands
Word Operands Constant
Preset (Set) Index
value WX WY WR WL SV EV DT Ld FL IX IY K H modifier
D1
D2
: Available
Description Shifts one digit (4 bits) of the block specified by D1 and D2 to the right when the
trigger turns ON.
The shift-out digit is deleted.
The shift-in digit is "0".
The D1 and D2 should be ;
- in the same operand
- D1 ≤ D2
D2 D1 + 1 D1
Before execution
After execution 0
shift in "0"
■ Flag condition
Error flag ( R9007 ) : Turns ON and keeps the ON state.
∙when the area specified using the index modifier
exceeds the limit.
∙when D1≥D2
The error address is transferred in the DT9017 and held.
Program
example Address Command
R0 50 ST R 0
51 F 112( WBSR )
50 [ F112 WBSR , DT 0 , DT 10 ]
DT 0
DT 10
In the example above, shifts the one digit (4 bits) of the block from DT0 though DT10
to the right when the R0 turns ON.
The shift-out digit "2" is deleted.
0 2 1 2 0 0 3 0 0 2 3 2
R0 : ON shift-out
0 0 2 1 1 0 0 3 0 0 2 3
F113 WBSL) Block
Basic style
of instruction Trigger
[ F113 WBSL , D1, D2 ]
■ Operands
Word Operands Constant
Preset (Set) Index
value WX WY WR WL SV EV DT Ld FL IX IY K H modifier
D1
D2
: Available
Description Shifts one digit (4 bits) of the block specified by D1 and D2 to the left when the
trigger turns ON.
The shift-out digit is deleted.
The shift-in digit is "0".
The D1 and D2 should be ;
- in the same operand
- D1 ≤ D2
D2 D1 + 1 D1
Before execution
Trigger : ON
Shift out
After execution 0
shift in "0"
■ Flag condition
Error flag ( R9007 ) : Turns ON and keeps the ON state.
∙when the area specified using the index modifier
exceeds the limit.
∙when D1≥D2
The error address is transferred in the DT9017 and held.
Note :
Refer to " 2-6. (8) Special Relays ( R: R9000 to R910F ) ", for further
information of error flag.
Program
example Address Command
R0 50 ST R 0
51 F 113( WBSL )
50 [ F113 WBSL , DT 0 , DT 10 ]
DT 0
DT 10
In the example above, shifts the one digit (4 bits) of the block from DT0 though DT10
to the left when the R0 turns ON.
The shift-out one digit "0" is deleted.
0 2 1 2 0 0 3 0 0 2 3 2
shift-out R0 : ON
2 1 2 1 0 3 0 0 2 3 2 0
FIFO (First-in First-out) Instruction
Notes :
You can monitor 16-bit data by operational instruction 8 ( OP8 ) with the HANDY LOADER.
You can monitor 32-bit data by operational instruction 12 ( OP12 ) with the HANDY LOADER.
F115 (FIFT) FIFO buffer
Define
P115 (PFIFT)
F116 (FIFR)
Data read from FIFO buffer
P116 (PFIFR)
F117 (FIFW)
Data write into FIFO buffer
P117 (PFIFW) Steps : 5
FIFO (First-in First-out) ; The order that data is written into, and read from, the the FIFO buffer.
Basic style
of instruction Trigger
[ F115 FIFT , n , D1 ]
Trigger
[ F117 FIFW , S , D1 ]
Trigger
[ F116 FIFR , D1, D2 ]
■ Operands
Word Operands Constant
Preset (Set) Index
value WX WY WR WL SV EV DT Ld FL IX IY K H modifier
D1
D2
: Available
Procedure 1. Defines the area of FIFO buffer [ Instructions: F115 ( FIFT ), P115 ( PFIFT ) ]
and Specifies the starting area for FIFO buffer and the memory size of FIFO buffer.
description D1 : the starting 16-bit area of FIFO buffer
n : memory size of FIFO buffer
D1+3+(n-1) n-1
Notes :
"K" and "PL" are set to 0 when the instruction is executed.
2. Writes the data Into the FIFO buffer [ Instructions: F117 ( FIFW ), P117 (
PFIFW ) ]
Writes the data specified by S into the FIFO buffer specified by D1.
D1 : the starting 16-bit area of FIFO buffer
S : the constant value or 16-bit area the data to be written into the FIFO
buffer
is stored in.
Notes :
"K"and "PL" are increased by 1, each time one data is written into the FIFO buffer.
Write operation
Bit 15∙∙12 11∙∙8 7 ∙∙4 3 ∙∙ 0
D1 n
D1+1 K
D1+2 PH PL
Writes the data.
D1+3 0 S
1
2
3
FIFO IN data
D1+3+(n-1) n-1
3. Reads the data from the FIFO buffer [ Instructions: F116 ( FIFR ), P116 (PFIFR ) ]
Reads the data in the memory area starting from D1 and stores it into the area specified by
D2.
D1 : the starting 16-bit area of FIFO buffer
D2 : the 16-bit area the be read from FIFO buffer .
Notes :
"K" is deccreased by 1, each time the data is read from the memory of FIFO buffer.
"PH" is deccreased by 1, each time the data is read from the memory.
Read operation
Bit 15∙∙12 11∙∙8 7 ∙∙4 3 ∙∙ 0
D1 n
D1+1 K
D1+2 PH PL
Reads the data.
D1+3 0 D2
1
2
3
FIFO OUT direction
D1+3+(n-1) n-1
■ Flag condition
Error flag ( R9007 : Turns ON and keeps the ON state.
) [ F115 (FIFT) , P115 (PFIFT) ]
when the area specified using the index modifier exceeds the limit.
when "n" > 256.
when "n" = 0
when the last address of FIFO buffer exceed the limit.
when "n" = 0
when "K" > "n"
when "PL" > "n"
when "PL" > 256
when the last address of FIFO buffer exceed the limit.
[ F116 (FIFR) , P116 (PFIFR) ]
when the area specified using the index modifier exceeds the limit.
when "n" > 256.
when "n" = 0
when "K" > "n"
when "K" = 0
when "PH" > "n"
when "PL" > 256
when the last address of FIFO buffer exceed the limit.
The error address is transferred in the DT9017 and held.
Error flag ( R9008 ) : Turns ON for an instant.
[ F115 (FIFT) , P115 (PFIFT) ]
when the area specified using the index modifier exceeds the limit.
when "n" > 256.
when "n" = 0
when the last address of FIFO buffer exceed the limit.
when "n" = 0
when "K" > "n"
when "PL" > "n"
when "PL" > 256
when the last address of FIFO buffer exceed the limit.
[ F116 (FIFR) , P116 (PFIFR) ]
when the area specified using the index modifier exceeds the limit.
when "n" > 256.
when "n" = 0
when "K" > "n"
when "K" = 0
when "PH" > "n"
when "PL" > 256
when the last address of FIFO buffer exceed the limit.
The error address is transferred in the DT9017 and held.
Program
example Address Command
X0
10 [ F115 FIFT , K256 , DT 0 ] 10 ST X 0
11 F 115( FIFT )
X1 K 256
DT 0
16 [ F117 FIFW , WR 0 , DT 0 ] 16 ST X 1
17 F 117( FIFW )
X2 WR 0
DT 0
22 [ F116 FIFR , DT 0 , EV 0 ] 22 ST X 2
23 F 116( FIFR )
DT 0
EV 0
Notes :
You can monitor 16-bit data by operational instruction 8 ( OP8 ) with the HANDY LOADER.
You can monitor 32-bit data by operational instruction 12 ( OP12 ) with the HANDY LOADER.
F120 (ROR) 16-bit data
Right rotate
P120 (PROR) Steps : 5
Outline Rotate the specified number of bits without carry flag to the right in the 16-
bit data.
(P120 : executed only when the leading edge of the trigger is detected. )
Basic style
of instruction Trigger
[ F120 ROR , D , n ]
■ Operands
Word Operands Constant
Preset (Set) Index
value WX WY WR WL SV EV DT Ld FL IX IY K H modifier
n
: Available
Description Rotate "n" bits (number of bits defines by "n".) without carry flag to the right in
the
16-bit data specified by D when the trigger turns ON.
Specification of "n"
Invalid
Significant data : K0 to K255 (decimal) or
H00 to HFF(hexadecimal)
Notes :
n = 32 : same operation as n = 0
Shifts n bits to the right and the shift-out bits are shifted in from the left.
The data of bit No. n-1 is copied to the carry flag.
15 ∙∙ ∙ ∙∙∙∙ ∙∙∙∙ ∙ ∙ ∙0
D :
n bits n bits
Carry flag
■ Flag condition
Error flag ( R9007 ) : Turns ON and keeps the ON state when the area specified
using the index modifier exceeds the limit.
The error address is transferred in the DT9017 and held.
Error flag ( R9008 ) : Turns ON for an instant when the area specified using
the index modifier exceeds the limit.
The error address is transferred in the DT9018.
Carry flag ( R9009 ) : Turns ON for an instant when the bit No. n-1 is recogn-
-ized as "1".
Note :
Refer to " 2-6. (8) Special Relays ( R: R9000 to R910F ) ", for further
information of error flag.
Program
Address Command
example
R0 10 ST R 0
11 F 120 ( ROR )
10 [ F120 ROR , DT 0 , K 4 ]
DT 0
K 4
In the example above, rotates 4 bits specified by K4 to the right in the 16-bit data
DT0 when the R0 turns ON.
The bit No.3 "0" is copieed to carry flag.
R0 : ON
Carry 0
F121 (ROL) 16-bit data
Left rotate
P121 (PROL) Steps : 5
Outline Rotate the specified number of bits without carry flag to the left in the 16-bit
data.
(P121 : executed only when the leading edge of the trigger is detected. )
Basic style
of instruction Trigger
[ F121 ROL , D , n ]
■ Operands
Word Operands Constant
Preset (Set) Index
value WX WY WR WL SV EV DT Ld FL IX IY K H modifier
n
: Available
Description Rotate "n" bits (number of bits defines by "n".) without carry flag to the left in the
16-bit data specified by D when the trigger turns ON.
Specification of "n"
Invalid
Significant data : K0 to K255 (decimal) or
H00 to HFF(hexadecimal)
Notes :
n = 32 : same operation as n = 0
n bits n bits
Carry flag
■ Flag condition
Error flag ( R9007 ) : Turns ON and keeps the ON state when the area specified
using the index modifier exceeds the limit.
The error address is transferred in the DT9017 and held.
Error flag ( R9008 ) : Turns ON for an instant when the area specified using
the index modifier exceeds the limit.
The error address is transferred in the DT9018.
Carry flag ( R9009 ) : Turns ON for an instant when the bit No. 16-n is recogn
-nized as "1".
Note :
Refer to " 2-6. (8) Special Relays ( R: R9000 to R910F ) ", for further
information of error flag.
Program
Address Command
example
R0 10 ST R 0
11 F 121 ( ROL )
10 [ F121 ROL , DT 0 , K 4 ]
DT 0
K 4
In the example above, rotates 4 bits specified by K4 to the left in the 16-bit data
DT0 when the R0 turns ON.
The bit No.12 "1" is copieed to carry flag.
Number of bits "K4 (decimal)" : 4 bits
R0 : ON
Carry 1
F122 (RCR) 16-bit data
Right rotate with carry flag
P122 (PRCR) Steps : 5
Outline Rotate the specified number of bits with carry flag to the right in the 16-bit
data.
(P122 : executed only when the leading edge of the trigger is detected. )
Basic style
of instruction Trigger
[ F122 RCR , D , n ]
■ Operands
Word Operands Constant
Preset (Set) Index
value WX WY WR WL SV EV DT Ld FL IX IY K H modifier
n
: Available
Description Rotate "n" bits (number of bits defines by "n".) with carry flag to the right in the
16-bit data specified by D when the trigger turns ON.
Specification of "n"
Invalid
Significant data : K0 to K255 (decimal) or
H00 to HFF(hexadecimal)
Notes :
n = 34 : same operation as n = 0
Shifts out n bits to the right and the counter of the carry flag and shift-out n-1 bits
are shifted in from the left.
The data of bit No. n-1 is copied to the carry flag.
Carry flag
■ Flag condition
Error flag ( R9007 ) : Turns ON and keeps the ON state when the area specified
using the index modifier exceeds the limit.
The error address is transferred in the DT9017 and held.
Error flag ( R9008 ) : Turns ON for an instant when the area specified using
the index modifier exceeds the limit.
The error address is transferred in the DT9018.
Carry flag ( R9009 ) : Turns ON for an instant when the bit No. n-1 is recogn-
-ized as "1".
Note :
Refer to " 2-6. (8) Special Relays ( R: R9000 to R910F ) ", for further
information of error flag.
Program
Address Command
example
R0 10 ST R 0
11 F 122 ( RCR )
10 [ F122 RCR , DT 0 , K 4 ]
DT 0
K 4
In the example above, rotates 4 bits with carry flag specified by K4 to the right in
the 16-bit data DT0 when the R0 turns ON.
The bit No.3 "0" is moved to carry flag.
Carry 1
R0 : ON
Carry 0
F123 (RCL) 16-bit data
Left rotate with carry flag
P123 (PRCL) Steps : 5
Outline Rotate the specified number of bits with carry flag to the left in the 16-bit
data.
(P123 : executed only when the leading edge of the trigger is detected. )
Basic style
of instruction Trigger
[ F123 RCL , D , n ]
■ Operands
Word Operands Constant
Preset (Set) Index
value WX WY WR WL SV EV DT Ld FL IX IY K H modifier
n
: Available
Description Rotate "n" bits (number of bits defines by "n".) with carry flag to the left in the
16-bit data specified by D when the trigger turns ON.
Specification of "n"
Invalid
Significant data : K0 to K255 (decimal) or
H00 to HFF(hexadecimal)
Notes :
n = 34 : same operation as n = 0
Shifts n bits to the right and the shift-out bits are shifted in from the left.
The data of bit No. n-1 is copied to the carry flag.
D :
n bits n-1 bits
Carry flag
■ Flag condition
Error flag ( R9007 ) : Turns ON and keeps the ON state when the area specified
using the index modifier exceeds the limit.
The error address is transferred in the DT9017 and held.
Error flag ( R9008 ) : Turns ON for an instant when the area specified using
the index modifier exceeds the limit.
The error address is transferred in the DT9018.
Carry flag ( R9009 ) : Turns ON for an instant when the bit No. 16-n is recog-
-nized as "1".
Note :
Refer to " 2-6. (8) Special Relays ( R: R9000 to R910F ) ", for further
information of error flag.
Program
Address Command
example
R0 10 ST R 0
11 F 123 ( RCL )
10 [ F123 RCL , DT 0 , K 4 ]
DT 0
K 4
In the example above, rotates 4 bits with carry flag specified by K4 to the left in the
16-bit data DT0 when the R0 turns ON.
The bit No.12 "1" is moved to carry flag.
Carry 0
R0 : ON
Carry 1
Bin Manipulation instructions
Notes :
You can monitor 16-bit data by operational instruction 8 ( OP8 ) with the HANDY LOADER.
You can monitor 32-bit data by operational instruction 12 ( OP12 ) with the HANDY LOADER.
F130 (BTS) 16-bit data
Bit set
P130 (PBTS) Steps : 5
Basic style
of instruction Trigger
[ F130 BTS , D , n ]
■ Operands
Word Operands Constant
Preset (Set) Index
value WX WY WR WL SV EV DT Ld FL IX IY K H modifier
n
: Available
Description Turns ON the bit No. "n" of 16-bit data specified by D when the trigger turns ON.
Specification of "n"
Invalid
Significant data : K0 to K15 (decimal) or
H0 to HF(hexadecimal)
■ Flag condition
Error flag ( R9007 ) : Turns ON and keeps the ON state when the area specified
using the index modifier exceeds the limit.
The error address is transferred in the DT9017 and held.
Error flag ( R9008 ) : Turns ON for an instant when the area specified using
the index modifier exceeds the limit.
The error address is transferred in the DT9018.
Note :
Refer to " 2-6. (8) Special Relays ( R: R9000 to R910F ) ", for further
information of error flag.
Program
Address Command
example
R0 20 ST R 0
21 F 130 ( BTS )
20 [ F130 BTS , DT 0 , DT4 ] DT 0
DT 4
In the example above, turns ON the bit No. 7 of 16-bit data DT0 when the R0
turns ON.
R0 : ON
Basic style
of instruction Trigger
[ F131 BTR , D , n ]
■ Operands
Word Operands Constant
Preset (Set) Index
value WX WY WR WL SV EV DT Ld FL IX IY K H modifier
n
: Available
Description Turns OFF the bit No. "n" of 16-bit data specified by D when the trigger turns
ON.
Specification of "n"
Invalid
Significant data : K0 to K15 (decimal) or
H0 to HF(hexadecimal)
■ Flag condition
Error flag ( R9007 ) : Turns ON and keeps the ON state when the area specified
using the index modifier exceeds the limit.
The error address is transferred in the DT9017 and held.
Error flag ( R9008 ) : Turns ON for an instant when the area specified using
the index modifier exceeds the limit.
The error address is transferred in the DT9018.
Note :
Refer to " 2-6. (8) Special Relays ( R: R9000 to R910F ) ", for further
information of error flag.
Program
Address Command
example
R0 20 ST R 0
21 F 131 ( BTR )
20 [ F131 BTR , DT 0 , DT4 ] DT 0
DT 4
In the example above, turns OFF the bit No. 7 of 16-bit data DT0 when the R0 turns
ON.
R0 : ON
Basic style
of instruction Trigger
[ F132 BTI , D , n ]
■ Operands
Word Operands Constant
Preset (Set) Index
value WX WY WR WL SV EV DT Ld FL IX IY K H modifier
n
: Available
Description Inverts the bit No. "n" of 16-bit data specified by D when the trigger turns ON.
Specification of "n"
Invalid
Significant data : K0 to K15 (decimal) or
H0 to HF(hexadecimal)
■ Flag condition
Error flag ( R9007 ) : Turns ON and keeps the ON state when the area specified
using the index modifier exceeds the limit.
The error address is transferred in the DT9017 and held.
Error flag ( R9008 ) : Turns ON for an instant when the area specified using
the index modifier exceeds the limit.
The error address is transferred in the DT9018.
Note :
Refer to " 2-6. (8) Special Relays ( R: R9000 to R910F ) ", for further
information of error flag.
Program
Address Command
example
X0 20 ST X 0
21 F 132 ( BTI )
20 [ F132 BTI , DT 0 , WR0 ] DT 0
WR 0
In the example above, inverts the bit No. 7 of 16-bit data DT0 when the X0 turns
ON.
X0 : ON
Basic style
of instruction Trigger
[ F133 BTT , D , n ]
■ Operands
Word Operands Constant
Preset (Set) Index
value WX WY WR WL SV EV DT Ld FL IX IY K H modifier
n
: Available
Description Checks the bit No. "n" of 16-bit data specified by D when the trigger turns ON.
The contents of checked result is stored into "= flag(R900B)".
※ Checked result :
When the checked bit is "0", = flag (R900B) turns ON(1).
When the checked bit is "1", = flag (R900B) turns OFF(0).
Specification of "n"
Invalid
Significant data : K0 to K15 (decimal) or
H0 to HF(hexadecimal)
■ Flag condition
Error flag ( R9007 ) : Turns ON and keeps the ON state when the area specified
using the index modifier exceeds the limit.
The error address is transferred in the DT9017 and held.
Error flag ( R9008 ) : Turns ON for an instant when the area specified using
the index modifier exceeds the limit.
The error address is transferred in the DT9018.
Note :
Refer to " 2-6. (8) Special Relays ( R: R9000 to R910F ) ", for further
information of error flag.
Program
Address Command
example
X0 20 ST X 0
21 F 133 ( BTT )
20 [ F133 BTT , DT 0 , WR0 ] DT 0
WR 0
In the example above, Checks the bit No. 7 of 16-bit data DT0 when the X0
turns
ON.
X0 : ON
Bit No.7 to be checked
Basic style
of instruction Trigger
[ F135 BCU , S , D ]
■ Operands
Word Operands Constant
Preset (Set) Index
value WX WY WR WL SV EV DT Ld FL IX IY K H modifier
D
: Available
Description Counts 1's number of 16-bit data specified by S when the trigger turns ON.
The result (total of 1's numbers) is stored into the area specified by D.
■ Flag condition
Error flag ( R9007 ) : Turns ON and keeps the ON state when the area specified
using the index modifier exceeds the limit.
The error address is transferred in the DT9017 and held.
Error flag ( R9008 ) : Turns ON for an instant when the area specified using
the index modifier exceeds the limit.
The error address is transferred in the DT9018.
Note :
Refer to " 2-6. (8) Special Relays ( R: R9000 to R910F ) ", for further
information of error flag.
Program
Address Command
example
X0 20 ST X 0
21 F 135 ( BCU )
20 [ F135 BCU , WY 5 , WR0 ] WY 5
WR 0
In the example above, counts 1's numbers of WY5 [ H 0135 (hexadecimal) ] when the
X0 turns ON.
The counted result (total of 1's number) [ K5 (decimal) ] is stored into WR0.
X0 : ON
Basic style
of instruction Trigger
[ F136 BCU , S , D ]
■ Operands
Word Operands Constant
Preset (Set) Index
value WX WY WR WL SV EV DT Ld FL IX IY K H modifier
D
: Available
Description Counts 1's number of 32-bit data specified by S+1 and S when the trigger turns
ON.
The result (total of 1's numbers) is stored into the 16-bit area specified by D.
Note :
When processing 32-bit data, the higher 16-bit area (S+1) is automatically
decided if the lower 16-bit area(S) is specified.
■ Flag condition
Error flag ( R9007 ) : Turns ON and keeps the ON state when the area specified
using the index modifier exceeds the limit.
The error address is transferred in the DT9017 and held.
Error flag ( R9008 ) : Turns ON for an instant when the area specified using
the index modifier exceeds the limit.
The error address is transferred in the DT9018.
Note :
Refer to " 2-6. (8) Special Relays ( R: R9000 to R910F ) ", for further
information of error flag.
Program
Address Command
example
X0 20 ST X 0
21 F 136 ( DBCU )
20 [ F136 DBCU , WX 3 , DT0 ] WX 3
DT 0
Bit 15∙∙12 11∙∙ 8 7∙∙ 4 3∙∙0 Bit 15∙∙12 11∙∙ 8 7∙∙ 4 3∙∙0
3 2 0 1 0 1 3 6
WX4 WX3
0 0 1 1 0 0 1 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 1 0 0 1 1 0 1 1 0
X0 : ON
Notes :
You can monitor 16-bit data by operational instruction 8 ( OP8 ) with the HANDY LOADER.
You can monitor 32-bit data by operational instruction 12 ( OP12 ) with the HANDY LOADER.
F140 (STC) Carry flag (R9009)
Set
P140 (PSTC) Steps : 1
Basic style
of instruction Trigger
[ F140 STC ]
Description The carry flag (R9009) turns ON when the trigger turns ON.
Program
Address Command
example
X0
20 ST X 0
20 [ F140 STC ] 21 F 140 ( STC )
F141 (CLC) Carry flag (R9009)
Reset
P141 (PCLC) Steps : 1
Basic style
of instruction Trigger
[ F141 CLC ]
Description The carry flag (R9009) turns OFF when the trigger turns ON.
Program
Address Command
example
X0
20 ST X 0
20 [ F141 CLC ] 21 F 141 ( CLC )
F142 (WDT) Watchdog Timer
Update
P142 (PWDT) Steps : 3
Basic style
of instruction Trigger
[ F142 WDT , S ]
■ Operands
Word Operands Constant
Preset (Set) Index
value WX WY WR WL SV EV DT Ld FL IX IY K H modifier
S
: Available
Description The scan check watchdog timer is preset with the constant specified by S when
the trigger tums ON.
The value specified by S is 1 to 255 and the preset time becomes;
2.5ms x S
The scan check watchdog timer is automatically set at the start of a scan with
the value of the system register( No.30 ).
To monitor the transit of a processing block, set the watchdog timer with this
instruction immediately before transition and set again immediately after that.
Notes :
Although this instruction can be used any number of times, the system
watchdog timer activates to stop operation and turns OFF the output when the
total scan time exceeds 640ms.
It is necessary to turn OFF power of the CPU when the scan check watchdog
timer is timed out.
Refer to 「 Watchdog timer」.
Program
Address Command
example
R0 20 ST R 0
21 F 142 ( WDT )
20 [ F142 WDT , K 128 ]
K 128
F143 (IORF) Partial I/O
Update
P143 (PIORF) Steps : 5
Basic style
of instruction Trigger
[ F143 IORF , D1 , D2 ]
■ Operands
Word Operands Constant
Preset (Set) Index
value WX WY WR WL SV EV DT Ld FL IX IY K H modifier
D1
D2
: Available
Description External I/0 range specified by DI and D2 is updated when the trigger turns ON.
X : updates the input data. and outputs. )
Y : updates the output data
The partial 1/0 update instruction ( 10RF, PIORF ) is executed only for the I/0
units on the basic base plate or expansion base plate.
It is not executed for the I/0 unit in the slave station of the Remote I/0 System
Notes :
Even if the H constant (hexadecimal) can be used to specify the base word of external I/Os.
However, as the word No. of N-700 , N-7000 PLC is based on decimal system, it is
recommended that K constant ( decimal ) be used.
Program
Address Command
example
R0 20 ST R 0
21 F 143 ( IORF )
20 [ F143 IORF , K 0 , K1 ]
K 0
K 1
F145 (SEND) Link data
Send
P145 (PSEND) Steps : 9
Basic style
of instruction Trigger
[ F145 SEND, S1, S2 , D , N ]
■ Operands
Word Operands Constant
Preset (Set) Index
value WX WY WR WL SV EV DT Ld FL IX IY K H modifier
S1
S2
: Available
Description
LK UN n2 n1
F
S1
1. Word unit send selection
F=0 : Word unit selection
n2=0 : Set "0" when the word unit is selected.
n1=1 to 16 : Specify the numberof words to be sent.
2. Bit unit send selection
F=1 : Bit unit selection
n2=0 to 15 : Destination bit No.
n1=0 to 15 : Source bit No.
S1+1
1. LINK No, Selection ( LK : 1 to 3, the station itself )
1) Up to 3 Link Units can be connected to one CPU. This ( LK ) selects the source
Link Unit in the three
Notes :
The LINK No. is specified by the position of each Link Unit on the Basic Base Plate.
The Link Units are designated as LINK1, 2 and 3. starting from the unit nearest to
the CPU.
Notes :
Two or more F145 ( P145 ), F146 ( P146 ) instructions cannot be executed in one scan. If
the triggers of two or more F145 ( P145 ), F146 ( P146 )
instructions turn ON in one scan, the instruction with the smallest address No. is executed.
■ Flag condition
R9030 0 : When the data cannot be sent. ( including when the data is
being sent. )
1 : When the data can be sent.
Notes :
Error code( time-out error )
H71 (hexadecimal) : Response signal of send operation cannot be received.
H72 (hexadecimal) : Buffer of the Link Unit is full.
H73 (hexadecimal) : Response command cannot be received.
When the above mentioned errors occur, check the set value of the time-out in the system
register No. 32. The value can be set in the range of 10ms to 81.9s.( default=2ms )
Program
Address Command
example
R0
20 ST R 0
20 [ F145 SEND , DT0, LD30 ,WR0, K0 ] 21 F 145 ( SEND )
DT 0
LD 30
WR 0
K 0
F146 (RECV) Link data
Receive
P146 (PRECV) Steps : 9
Basic style
of instruction Trigger
[ F146 RECV, S1, S2 , N , D ]
■ Operands
Word Operands Constant
Preset (Set) Index
value WX WY WR WL SV EV DT Ld FL IX IY K H modifier
S1
S2
: Available
Description
LK UN n2 n1
F
S1
1. Word unit receive selection
F=0 : Word unit selection
n2=0 : Set "0" when the word unit is selected.
n1=1 to 16 : Specify the numberof words to be sent.
2. Bit unit receive selection
F=1 : Bit unit selection
n2=0 to 15 : Destination bit No.
n1=0 to 15 : Source bit No.
S1+1
1. LINK No, Selection ( LK : 1 to 3, another station )
1) Up to 3 Link Units can be connected to one CPU. This ( LK ) selects the source
Link Unit in the three
Notes :
The LINK No. is specified by the position of each Link Unit on the Basic Base
Plate. The Link Units are designated as LINK1, 2 and 3. starting from the unit
nearest to the CPU.
Notes :
■ Flag condition
R9030 0 : When the data cannot be sent. ( including when the data is
being received. )
1 : When the data can be received.
Notes :
Error code( time-out error )
H71 (hexadecimal) : Response signal of send operation cannot be received.
H72 (hexadecimal) : Buffer of the Link Unit is full.
H73 (hexadecimal) : Response command cannot be received.
When the above mentioned errors occur, check the set value of the time-out in the
system register No. 32.
The value can be set in the range of 10ms to 81.9s.( default=2ms )
Program
Address Command
example
X0
20 ST X 0
20 [ F146 RECV , DT0, WR0 , K0, LD20 ] 21 F 146 ( RECV )
DT 0
WR 0
K 0
LD 20
F147 (PR ) Print out Steps : 5
Basic style
of instruction Trigger
(DF) [ F147 PR , S , D ]
R9033
■ Operands
Word Operands Constant
Preset (Set) Index
value WX WY WR WL SV EV DT Ld FL IX IY K H modifier
D
: Available
Description ASCII codes for 12 characters stored in 6 word area specified by S are sent to the
area specified by D.
As shown below, four scans are required for 1 character output.
Therefore, 37 scan are required until all character are output.
Connection example for output unit
■ Flag condition
Error flag ( R9007 ) : Turns ON and keeps the ON state.
∙when the S+5 exceeds the limit.
∙when the trigger of another print out instruction(PR)
turns ON while one print out instruction (PR) is
being executed.
The error address is transferred in the DT9017 and held.
Notes :
Since several print out instructions (PR) cannot be executed in one scan, use
executing flag R9033 to be sure sure they are not executed simultaneously.
Program
Address Command
example X0
20 (DF) [ F147 PR , DT 0, WY1 20 ST X 0
21 DF
R903 ] OR R 9033
3 147 ( PR )
DT 0
WY 1
F148 (ERR) Self-diagnostic error
P148 (PERR) Set
Steps : 3
Outline Sets the specified error code to the special register DT9000.
(P148 : executed only when the leading edge of the trigger is detected. )
Basic style
of instruction Trigger
[ F148 ERR , n ]
n Error number
■ Operands
Word Operands Constant
Preset (Set) Index
value WX WY WR WL SV EV DT Ld FL IX IY K H modifier
n
: Available
Description The error No. specified by n is placed into special data register DT9000.
At the same time, the self-diagnostic error flag ( R9000 ) is set and ERROR LED on
the CPU is turned ON.
The contents can be read and checked using the programming tool ( FPST software,
Handy loader )
■ Flag condition
Error flag ( R9007 ) : Turns ON and keeps the ON state when the "n" exceeds
the limit.
Error flag ( R9008 ) : Turns ON for an instant when the "n" exceeds the limit.
Program
Address Command
example
X0
20 ST X 0
20 [ F148 ERR , K 100 ] 21 F 148 ( ERR )
K 100
F149 (MSG)
Message display
P149 (PMSG) Steps :13
Outline Displays the specified charcters on the programming tools (FPST software ,
Handy loader)
(P149 : executed only when the leading edge of the trigger is detected. )
Basic style
of instruction Trigger
[ F149 MSG , S ]
S Charcter constant
■ Operands
Word Operands
Preset (Set) Index
value WX WY WR WL SV EV DT Ld FL IX IY M K H modifier
S
: Available
Program
Address Command
example
X0
20 ST X 0
20 [ F149 MSG , M TEST PROGRAM 21 F 149 ( MSG )
M TEST
PROGRAM
F150 (READ)
Data read from advanced units
P150 (PREAD) Steps : 9
Basic style
of instruction Trigger
[ F150 READ, S1, S2 , n , D ]
■ Operands
Word Operands Constant
Preset (Set) Index
value WX WY WR WL SV EV DT Ld FL IX IY K H modifier
S1
S2
D
: Available
Program
Address Command
example
X0
20 ST X 0
20 [ F150 READ , K 3, K 0 , K 5 , WR0] 21 F 150 ( READ )
K 3
K 0
K 5
WR 0
In the example above, reads the 5-word data from the address 0 of advanced
unit "
slot No. 3" on base plate when the XI0 tums ON.
The result is stored into the data area of WR0.
F151 (WRT)
Data write into advanced units
P151 (PWRT) Steps : 9
Basic style
of instruction Trigger
[ F151 WRT, S1, S2 , n , D ]
■ Operands
Word Operands Constant
Preset (Set) Index
value WX WY WR WL SV EV DT Ld FL IX IY K H modifier
S1
S2
D
: Available
Program
Address Command
example
X0 20 ST X 0
21 F 151 ( WRT )
20 [ F151 WRT , K 0, DT 5, K 2 , K 0
K 0
DT 5
K 2
WR 0
In the example above, writes the 2-word data starting from DT5 into the address 0 of
advanced unit " slot No. 0" on base plate when the X0 tums ON.
The result is stored into the address 0 of advanced unit.
F152 (RMRD)
Data read from the slave units
P152 (PRMRD) Steps : 9
Outline Reads the data from the specified advanced unit of the slave unit.
(P152 : executed only when the leading edge of the trigger is detected. )
Basic style
of instruction Trigger
[ F152 RMRD, S1, S2 , n , D ]
■ Operands
Word Operands Constant
Preset (Set) Index
value WX WY WR WL SV EV DT Ld FL IX IY K H modifier
S1
S2
D
: Available
Description 1. Specifies the advanced unit of slave station by data "S1 + 1 and S1"
2. Reads the n-word data from the address No. of the specified slave station
specified by S2.
3. The read result is stored into the data area specified by D.
Bit 15∙∙12 11∙∙ 8 7∙∙ 4 3∙∙ 0 Bit 15∙∙12 11∙∙ 8 7∙∙ 4 3∙∙ 0
S1+1 0 0 0 0 0 0 0 0 S1
Two or more F152 ( P152 ), F153 ( P153 ) instructions cannot be executed in one scan. If
the triggers of two or more these instructions turn ON in one
scan, the instruction with the smallest address No. is executed.
■ Flag operation
Executable flag (R9035) 0 : When the data cannot be read or being read
1 : When the data can be read.
Notes :
Error codes are as follows :
H5B (hexadecimal) : Time-out error.
H68 (hexadecimal) : Access area missing error
H71 (hexadecimal) : Response signal of send operation cannot be received.
H72 (hexadecimal) : Buffer of the Mster Unit is full.
H73 (hexadecimal) : Response command cannot be received.
When the 71,72,73 errors occur, change the set value of the time-out in 10ms to 81.9
s. the syatrm register No.32 within. ( default=2ms )
Note :
Refer to " 2-6. (8) Special Relays ( R: R9000 to R910F ) ", for further
information of error flag.
F153 (RMWT)
Data write into the slave units
P153 (PRMWT) Steps : 9
Outline Writes the data into the specified advanced unit of the slave unit.
(P153 : executed only when the leading edge of the trigger is detected. )
Basic style
of instruction Trigger
[ F153 RMWT, S1, S2 , n , D ]
■ Operands
Word Operands Constant
Preset (Set) Index
value WX WY WR WL SV EV DT Ld FL IX IY K H modifier
S1
S2
D
: Available
Description 1. Specifies the advanced unit of slave station by data "S1 and S1+1"
2. Writes the n-word data starting from the area specified by S2 into the area
starting from the area specified by D.
Bit 15∙∙12 11∙∙ 8 7∙∙ 4 3∙∙ 0 Bit 15∙∙12 11∙∙ 8 7∙∙ 4 3∙∙ 0
S1+1 0 0 0 0 0 0 0 0 S1
Two or more F152 ( P152 ), F153 ( P153 ) instructions cannot be executed in one scan. If
the triggers of two or more these instructions turn ON in one
scan, the instruction with the smallest address No. is executed.
■ Flag operation
Executable flag (R9035) 0 : When the data cannot be written or read.
1 : When the data can be written.
Notes :
Error codes are as follows :
H5B (hexadecimal) : Time-out error.
H68 (hexadecimal) : Access area missing error
H71 (hexadecimal) : Response signal of send operation cannot be received.
H72 (hexadecimal) : Buffer of the Mster Unit is full.
H73 (hexadecimal) : Response command cannot be received.
When the 71,72,73 errors occur, change the set value of the time-out in 10ms to 81.9
s. the syatrm register No.32 within. ( default=2ms )
Note :
Refer to " 2-6. (8) Special Relays ( R: R9000 to R910F ) ", for further
information of error flag.
Program
example Address Command
In the example above, writes /reads the 15-word data memory of advanced unit
(slot No.1) on slave station.
F154 (MCAL)
Machine language call
P154 (PMCAL) Steps : 3
Basic style
of instruction Trigger
[ F154 MCAL , n ]
■ Operands
Word Operands Constant
Preset (Set) Index
value WX WY WR WL SV EV DT Ld FL IX IY K H modifier
n
: Available
Program
example Address Command
R0 10 ST R 0
10 [ F154 MCAL , H0 ] 11 F 154 ( MCAL )
H 0
In the example above, calls the address 0 of machine language program area
when the
R0 tums ON.
F155 (SMPL)
Sampling Start
P155 (PSMPL)
F156 (STRG)
Sampling Stop
P156 (PSTRG) Steps : 1
Outline F155 : Transfers the sampling data specified by FPST software into the
sampling memory.
(P155 : executed only when the leading edge of the trigger is detected. )
Basic style
of instruction Trigge
r [ F155 SMPL ]
Trigge
r [ F156 STRG ]
Description The sampling trace function samples the relays and data according to the previously
set with using the FPST software and transfers the specified points to the sampling
memory.
Procedure
1. Specify the sampled points using the FPST software.
∙The points can be sampled are ;
1) Relay contacts: 16 points [ available for External input (X), External output (Y), Inter
-nal relay (R), Timer (T), Counter (C) and Link relay (L)]
2) Data :3 words [ available for Special data register (DT), Link register (LD),
File register (FL), Preset (Set) value (SV), Count (Elapsed)
value (EV) and Word Input / Output (WX, WY, WR, WL)]
3. The specified data is transferred to the sampling memory when the trigger of F155
( P155 ) tums ON.
4. The sampling is stopped after the specified delay when the trigger of F156 ( P156 )
turns ON.
Notes :
This operation can also be performed with the FPST software
Program
Address Command
example X0
10 ST X 0
10 [ F155 SMPL ]
11 F 155 ( SMPL
)
X1
30 [ F156 STRG ]
30
ST X 1
F 156 ( STRG
)