Escolar Documentos
Profissional Documentos
Cultura Documentos
FP0
Programming
LIMITED WARRANTY
If physical defects caused by distribution are found, Matsushita Electric Works, Ltd.,
will replace/repair the product free of charge. Exceptions include:
D When physical defects are due to different usage/treatment of the
product other than described in the manual.
D When physical defects are due to defective equipment other than the
distributed product.
D When physical defects are due to modifications/repairs by someone
other than Matsushita Electric Works, Ltd.
D When physical defects are due to natural disasters.
i
Table of Contents FP0
ii
FP0 Table of Contents
Chapter 8 Appendix
iii
Table of Contents FP0
Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . I - 1
Record of changes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . R - 1
iv
FP0 Table of Contents
Basic Instructions
v
Table of Contents FP0
vi
FP0 Table of Contents
vii
Table of Contents FP0
viii
FP0 Table of Contents
ix
Table of Contents FP0
Special instructions
F140 STC Carry flag (R9009) set . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 - 238
F141 CLC Carry flag (R9009) reset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 - 239
F143 IORF Partial I/O update . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 - 240
F144 TRNS Serial data communication control for R232C port . . . . . . . . . . 3 - 241
F147 PR Printout . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 - 247
F148 ERR Self-diagnostic error set . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 - 251
F149 MSG Message display . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 - 253
x
FP0 Table of Contents
xi
Table of Contents FP0
xii
Chapter 1
Relays, Memory Areas and Constants
1- 2
FP0 Relays, Memory Areas and Constants
Notes
3) The points for the timer and counter can be changed by the
setting of system register 5. The numbers given in the table
are the numbers when system register 5 is at its default
setting. For more detailed information section 8.4
1- 3
Relays, Memory Areas and Constants FP0
Decimal number
1, 2, 3⋅⋅⋅⋅⋅⋅⋅⋅12
Hexadecimal number
0, 1, 2, 3,⋅⋅⋅⋅⋅ 9, A, B⋅⋅⋅⋅⋅F
X 0, X 1 . . . . . . . . . . . . . . . . . . . . X F
X 10, X 11 . . . . . . . . . . . . . . . . . . . . X 1F
X 20, X 21 . . . . . . . . . . . . . . . . . . . . X 2F
to to . . . . . . . . . . . . . . . . . . . . . . . . to
X120, X121 . . . . . . . . . . . . . . . . . . . . X12F
Decimal number
0, 1, 2,⋅⋅⋅⋅⋅⋅⋅99
T0, T1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . T99
C100, C101 . . . . . . . . . . . . . . . . . . . . . . . . . . . . C143
Note
Counters and timers share the same area. The division of the
area can be changed with system register 5. (The table and
example are when settings are the default values.)
1- 4
FP0 Relays, Memory Areas and Constants
XFXE XDXCXB XA X9 X8 X7 X6 X5 X4 X3 X2 X1 X0
WX0
WX1
WX12
1- 5
Relays, Memory Areas and Constants FP0
Program
X contact: on
X Y Operation Input
control inter- Input: on
section face
Input
Usage restrictions
The addresses for inputs which do not actually exist cannot be used.
The on or off status of the external input relays cannot be changed by the operation
(program).
There is no limitation regarding the number of times one external input relay is
programmed.
Program
Output relay
Operation Output
X R Y inter-
control Load: on
face
R section output
Operation Output
Usage restrictions
External output relays which are not actually allocated can be used in the same way as
internal relays. However, they cannot be specified as hold types.
When used as contacts, there are no restrictions on the number of times that can be
used.
As a rule, when specified as the output destination for operation results of OT and KP
instructions, use is limited to once in a program (to inhibit double output).
1- 6
FP0 Relays, Memory Areas and Constants
Note
You can permit duplicated use of an output by changing the
system register 20 setting. Even if the same relay is used as an
operand for instructions such as SET and RST, it is not regarded
as duplicated use of outputs.
Example of duplicated use of external output relay (Y3)
Y3
Y3 Duplicated output
R0
F0 MV
Usage restrictions
When used as contacts, there are no restrictions on the number of times that can be
used.
As a rule, when specified as the output destination for operation results of OT and KP
instructions, use is limited to once in a program (to inhibit double output).
Note
You can permit duplicated use of an output by changing the
system register 20 setting. Even if the same relay is used as an
operand for instructions such as SET and RST, it is not regarded
as duplicated use of outputs.
1- 7
Relays, Memory Areas and Constants FP0
For FP0 T32, system register 7 can be used to specify whether a hold type or a non - hold
type is used. If the beginning of a hold type relay is specified using a word number,
relays before that point will be non - hold types, and subsequent relays will be hold
types.
Non-hold
type
Value of system register 7
(initial number of hold type)
Hold type
1- 8
FP0 Relays, Memory Areas and Constants
REFERENCE
For detailed information about the content of special internal relay
section 8.5
1- 9
Relays, Memory Areas and Constants FP0
Timer (T)
Function of timers (T)
When a timer is activated and the set time elapses, the timer contact with the same
number as the timer turns on.
When the timer is in the time - up state and the timer execution condition (trigger) turns
off, the timer contact turns off.
TM n
Time - up
Timer number
Tn: on
Tn
Usage restrictions
When used as contacts, there are no restrictions on the number of times that can be
used.
Counter (C)
Function of counters (C)
When the decrement - type preset counter is activated and the elapsed value reaches
zero, the counter contact with the same number as the counter turns on.
When the counter’s reset input is turned on, the counter contact turns off.
Count input Counter number
CT n
Reset input
Count - up
Cn:on
Cn
Usage restrictions
When used as contacts, there are no resrictions on the number of times that can be
used.
1 - 10
FP0 Relays, Memory Areas and Constants
Set the number of the leading counter in system register 5. The initial setting is 100,
therefore 100 points are timers and 44 points are counters as shown above.
For detailed information about the system register setting section 8.4
In the case of the FP0 C10/C14/C16/C32/SL1, the areas which hold their contents
when the power is turned off are fixed as shown below. System register settings 6 to
8 as well as 14 become invalid.
Timer Non- hold type: all points
Counter Non- hold type C10, C14, C16: From set value to C139
C32, SL1: From set value to C127
Hold type C10, C14, C16: C140 to C143
C32, SL1: C128 to C143
For the FP0 T32, system register 6 can be used to specify whether a hold type or a
non - hold type is used. If the beginning of a hold type is specified using a word number,
the contents of timer/counter contacts before that point will be non - hold types, and
subsequent the contents of timer/counter contacts will be hold types.
Default settings for hold types and non - hold types
Non - hold type Hold type
T0 to T99 (100 points) C100 to C143 (44 points)
If the same value is set for system register 5 and 6, timers are non - hold types, and
counters are hold types. Normally, the same value should be set for both system
registers.
1 - 11
Relays, Memory Areas and Constants FP0
Notes
1 - 12
FP0 Relays, Memory Areas and Constants
3) The points for the timer and counter can be changed by the
setting of system register 5. The numbers given in the table
are the numbers when system register 5 is at its default
setting.
For detailed information section 8.4
When 32-bit (double word) data is handled in data registers, use two data registers as
a set. The number of the data register for the lower 16 bits is specified.
DTn+1 DTn
0 0 0 1 1 0 1 0 0 1 0 1 0 0 1 0 0 0 0 1 1 0 1 0 0 1 0 1 1 0 0 0
1 - 13
Relays, Memory Areas and Constants FP0
In the case of the FP0 C10/C14/C16/C32/SL1, non - hold type and hold type register
numbers are as shown in the following table.
Item C10/C14/C16 C32/SL1
Data register Non - hold type 1652 words (DT0 to DT1651) 6112 words (DT0 to DT6111)
Hold type 8 words (DT1652 to DT1659) 32 words (DT6112 to DT6143)
For the FP0 T32, system register 8 can be used to specify whether hold types or
non - hold types are to be used. If the beginning of a hold type data register is specified
using a word number, data registers before that point will be non - hold types, and
subsequent data registers will be hold types.
Non-hold
type
Value of system register 8
(initial number of hold type)
Hold type
For the default value, all data registers are hold types (set value: 0).
1 - 14
FP0 Relays, Memory Areas and Constants
Note
The values stored for the clock/calendar timer can be overwritten
(to calibrate the date and time). Values should be written to
DT90054 to DT90057 either using the F0 (MV) instruction or
directly, using programming tools.
1 - 15
Relays, Memory Areas and Constants FP0
WX, WY and WR
Function of WX, WY and WR
Relays (X, Y, R) can be handled as blocks of 16 points.
These are one - word (16 - bit) memory areas, thus they can be treated as data memory.
The composition of the one - word memory areas is as follows.
The numbers correspond to the words as shown.
WR0
RF RE RD RC RB RA R9 R8 R7 R6 R5 R4 R3 R2 R1 R0
WR1
R1F R1E · · · · · · · · · · · R12 R11 R10
WR2
R2F R2E · · · · · · · · · · · R22 R21 R20
When R1 is turned on
WR0
0 0 0 0 1 1 0 0 0 1 0 0 1 0 1 1
1 - 16
FP0 Relays, Memory Areas and Constants
SVn
K30
(Decimal number)
A decimal number or SV area number is specified for the set value when the TM or CT
instruction is entered in the program.
An SV is a one - word, 16 - bit memory area which stores a decimal number from K0 to
K32767.
Using set value area (SV)
During RUN mode, a set value for a timer or counter can be changed by rewriting the
corresponding set value area.
The value in a set value area can be read and changed from the program by specifying
the destination and other information in a data transfer instruction.
The value in a set value area can be read and rewritten using a programming tool.
- Using programming tool software (NPST - GR/FPWIN GR)
In the online monitor, execute “MONITOR & TEST RUN”/“Monitoring
Registers” and specify the set value area.
- Using FP Programmer II
Execute “OP8” and specify the set value area.
For detailed information section 4.8
SV and EV areas are in a one - to - one correspondence with timers and counters.
Timer/Counter Set value area Elapsed value
number (SV) area (EV)
T0 SV0 EV0
T1 SV1 EV1
⋮ ⋮ ⋮
T99 SV99 EV99
C100 SV100 EV100
⋮ ⋮ ⋮
1 - 17
Relays, Memory Areas and Constants FP0
Value of EVn 29
Tn
28
Decrements
EVn
Tn turns on when decrement operation ends
0
1 - 18
FP0 Relays, Memory Areas and Constants
IXDT11
Base address IX value Target address
11 + K0 = DT11
11 + K10 = DT21
11 + K - 10 = DT1
Modifying a constant
Constant = Base value + Value in IX or IY
IXK100
Base value IX value Constant
K100 + K0 = K100
K100 + K10 = K110
K100 + K - 10 = K90
IXH10
Base value IX value Constant
H10 + HA = H1A
H10 + H10 = H20
1 - 19
Relays, Memory Areas and Constants FP0
F0 MV, IXWR0, DT 0
Contents of IY Contents of IX
1 - 20
FP0 Relays, Memory Areas and Constants
“+”
“-”
Data is normally handled in units of one word (16 bits), however, it is also occasionally
handled in units of two words (32 bits). In this case, as well, the MSB serves as the sign
bit.
The available range of a decimal constant is:
For 16-bit operation: K-32768 to K32767
For 32-bit operation: K-2147483648 to K2147483647
1 - 21
Relays, Memory Areas and Constants FP0
Data is normally handled in units of one word (16 bits), however, it is also occasionally
handled in units of two words (32 bits).
The available range of a hexadecimal constant is:
For 16-bit operation: H0 to HFFFF
For 32-bit operation: H0 to HFFFFFFFF
1 - 22
FP0 Relays, Memory Areas and Constants
When using an FP programmer II, you can only confirm program. When an F149 (MSG)
instruction is executed, the set characters appear in the display on FP programmer II.
1 - 23
Relays, Memory Areas and Constants FP0
16-bit data
Data which can be handled in the PLC Decimal Hexadecimal
(16-bit binary data) constants constants
0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 K 32767 H7FFF
· · ·
· · ·
· · ·
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 K 1 H0001
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 K 0 H0000
K -1 HFFFF
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
· ·
·
· ·
·
· ·
·
1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 K - 32768 H8000
32-bit data
Data which can be handled in the PLC Decimal Hexadecimal
(32-bit binary data) constants constants
0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 K 2147483647 H7FFFFFFF
· · ·
· · ·
· · ·
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 K 1 H00000001
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 K 0 H00000000
K -1 HFFFFFFFF
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
· · ·
· · ·
· · ·
1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 K - 2147483648 H80000000
1 - 24
FP0 Relays, Memory Areas and Constants
512
256
128
8,192
4,096
2,048
1,024
64
32
16
8
4
2
1
The data size is indicated by the these bits.
1,024 + 512 + 256 + 64 + 8 + 4 = 1,868
A negative number is expressed as a two’s complement (the bits of the 16 - bit binary
data of the positive number are inverted and 1 is added to the result).
1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1
Add 1
1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 Binary expression of
decimal number “ - 4”
1 - 25
Relays, Memory Areas and Constants FP0
BCD is an acronym for binary coded decimal and refers to expressing each digit of a
decimal number by four binary digits.
When the decimal number is expressed in BCD
Decimal number
6 4 5
Each digit is converted to binary
1 - 26
FP0 Relays, Memory Areas and Constants
1 - 27
Relays, Memory Areas and Constants FP0
...
...
Underflow
Overflow
Max. value H 9999
The max. value
.....
Underflow
1 - 28
Chapter 2
Basic Instructions
2- 2
FP0 Basic Instructions
Example:
Input contacts
Internal relay coil
Address
X0 X1 R0
0
ST AN OT
R0
1 OR Output coil
Internal
relay
contacts R0 Y10
4
ST OT
Bus line
There are several relay types which are explained in section 1.1, and the relay which
can be specified depends on the instruction. Refer to the explanation of each
instruction.
Example:
Start (ST) instruction
Read the on or off status of the specified contact.
2- 3
Basic Instructions FP0
Example:
0.1s units timer (Timer 5)
Set value
X0 TMX 5, K 30
Constant of Y0
T5
timer 5
2- 4
FP0 Basic Instructions
Control Instructions
These instructions determine the order and flow of program execution.
It is possible to change the sections to be executed, or to execute only the necessary
segments, depending on the conditions.
Specify the section which will execute. This is composed of several steps.
Master control relay
A certain part of the program (specified with MC or MCE) is only executed when the
appropriate condition is met.
Jump
Skips execution of part of the program (specified with JP or LBL) when the appropriate
condition is met. This shortens program execution time.
Step ladder control
Part of the program (specified with SSTP or STPE) is treated as an independent
“process”, and sequential and branch execution is carried out.
Subroutine program
A program which is repeatedly executed for a particular operation is called as a
subroutine (specified with SUB or RET) and executed when needed.
Interrupt program
In addition to the normal program, enter an interrupt program (specified with INT or
IRET) if you need a program which will execute immediately when a certain condition
is met. When an interrupt is received, the normal program is interrupted and the interrupt
program is executed.
2- 5
Basic Instructions FP0
Example:
2- 6
FP0 Basic Instructions
Read stack RDS Reads the operated result stored by the PSHS 1 2 - 23
instruction.
Pop stack POPS Reads and clears the operated result stored by 1 2 - 23
the PSHS instruction.
Keep KP Set
KP
Outputs at set trigger and holds until reset trig- 1 2 - 32
Reset ger turns on.
2- 7
Basic Instructions FP0
Reset
Control instructions
Master control MC (MC n) Starts the master control program. 2 2 - 52
relay Master control area
Master control MCE Ends the master control program. 2 2 - 52
relay end (MCE n)
Note
NPST - GR Ver. 4.2 or later or FP Programmer II (AFP1114V2) is
needed to enter the TML and F183 (DSTM) instruction.
2- 8
FP0 Basic Instructions
Subroutine instructions
Subroutine call CALL (CALL n)
Executes the specified subroutine pro- 2 2 - 76
gram.
Subroutine entry SUB Indicates the start of the subroutine pro- 1 2 - 76
(SUB n)
gram “n”.
Subroutine RET Ends the subroutine program. 1 2 - 76
return (RET )
Interrupt instructions
Interrupt INT Indicates the start of the interrupt program 1 2 - 79
(INT n)
“n”.
2- 9
Basic Instructions FP0
2 - 10
FP0 Basic Instructions
2 - 11
Basic Instructions FP0
2 - 12
FP0 Basic Instructions
Ladder diagram
This indicates the
ladder diagram
screen displayed
when data is entered
using the program-
ming tool software
(NPST - GR/FPWIN
GR). Number of steps
On the programming This is the number of steps
tool software used with this instruction.
(NPST - GR/FPWIN
GR) screen, coils are
displayed using the
[ ] symbol.
Available
operands
This indicates types
of relays which can
be used with the
instruction, types of
registers and
constants which
can be used as
operands.
For information on
types of relays,
refer to section 1.1.
For information on
types of memory
areas, refer to
section 1.2.
Boolean
Explanation of This indicates
program how codes are
example and used when data
flag conditions is entered using
boolean entry
Using the program with the pro-
given in the above gramming tool
ladder diagram as software (NPST -
an example, the GR/FPWIN GR).
operation and relay Data is also
movements are entered in this
shown, as well as format when
types of flags and using the FP
the conditions under Programmer II.
which they go on
and off.
2 - 13
Basic Instructions FP0
ST Start 1
OT Out 1
Program example
Boolean
Ladder Diagram
Address Instruction
X0 Y0 0 ST X 0
0 1 OT Y 0
X0 Start Out Y1
2 ST/ X 0
2
Start Not Out 3 OT Y 1
Operands
Timer/Counter
Relay
Instruction Contact
X Y R T C
ST, ST/ A A A A A
A: Available
OT N/A A A N/A N/A N/A: Not Available
Explanation of example
Y0 goes on when X0 turns on.
Y1 goes on when X0 turns off.
on
X0 off
on
Y0 off
on
Y1 off
Description
The ST instruction starts logic operations and regards the input contact specified at the start as a Form A
(normally open) contact.
The ST/ instruction starts logic operations and regards the input contact specified at the start as a Form B
(normally closed) contact.
The OT instruction outputs the operation result to a specified coil.
2 - 14
FP0 Basic Instructions
Y1
Y2
When an external switch, such as emergency stop switch with a Form B (normally closed) contact is
programmed, be sure to use the ST instruction.
2 - 15
Basic Instructions FP0
Program example
Boolean
Ladder Diagram
Address Instruction
X0 Y0 0 ST X 0
0
1 OT Y 0
Y1
2 /
Not 3 OT Y 1
Explanation of example
Y0 goes on and Y1 goes off when X0 turns on.
Y0 goes off and Y1 goes on when X0 turns off.
X0 on
off
on
Y0 off
on
Y1 off
Description
The / (Not) instruction inverts the operation result up to this instruction.
2 - 16
FP0 Basic Instructions
AN AND 1
FP0 C10, C14, C16,
C32, T32, SL1
AN/ AND Not 1
Program example
Boolean
Ladder Diagram
Address Instruction
0 ST X 0
X0 X1 X2 Y0
1 AN X 1
0
2 AN/ X 2
AND AND Not
3 OT Y 0
Operands
Timer/Counter
Relay
Instruction Contact
X Y R T C
AN, AN/ A A A A A A: Available
Explanation of example
Y0 goes on when both X0 and X1 turn on and also X2 turns off.
on
X0 off
on
X1 off
on
X2 off
on
Y0 off
Description
Performs a logical AND operation with the results of the immediately preceding serially connected operation.
X2 X3 Y1
2 - 17
Basic Instructions FP0
OR OR 1
FP0 C10, C14, C16,
Operands
Timer/Counter
Relay
Instruction Contact
X Y R T C
OR, OR/ A A A A A A: Available
Explanation of example
Y0 goes on when either X0 or X1 turns on or X2 turns off.
X0 on
off
on
X1 off
on
X2 off
Y0 on
off
Description
Performs a logical OR operation with the results of the immediately preceding operation connected in
parallel.
Precautions during programming
Use the OR instruction when normally open contacts (Form A contacts) are connected in parallel.
Use the OR/ instruction when normally closed contacts (Form B contacts) are connected in parallel.
The OR instruction starts from the bus line.
The OR and OR/ instructions can be used consecutively.
X0 Y0
X1
X2
X3
2 - 18
FP0 Basic Instructions
0 ST X 0
X0 X2 Y0 1 OR X 1
0
2 ST X 2
X1 X3
Block 2 3 OR X 3
4 ANS
Block 1
5 OT Y 0
Explanation of example
Y0 goes on when X0 or X1 and X2 or X3 turn on.
Block 1 Block 2
on
X0 off
on
X1 off
on
X2 off
on
X3 off
on
Y0 off
Description
Blocks connected in parallel are connected in series.
2 - 19
Basic Instructions FP0
Block ST X 0
1 2
Block 1 OR X 1
4 ST X 2
Block
5 X0 X2 X4 Y0 Block
2 OR X 3
Block Block
X1 X3 X5 5 ANS . . . . . . . . . . 1
4
ST X 4
Block
3 OR X 5
Block Block Block
1 2 3 ANS . . . . . . . . . . 2
OUT Y 0
2 - 20
FP0 Basic Instructions
ORS OR stack 1
FP0 C10, C14, C16,
C32, T32, SL1
Program example
Boolean
Ladder Diagram
Address Instruction
0 ST X 0
1 AN X 1
X0 X1 Block 1 Y0
0 2 ST X 2
X2 X3 Block 2 3 AN X 3
4 ORS
5 OT Y 0
Explanation of example
Y0 goes on when both X0 and X1 or both X2 and X3 turn on.
(X0 AND X1) OR (X2 AND X3) → Y0
Block 1 Block 2
on
X0 off
on
X1 off
on
X2 off
on
X3 off
on
Y0 off
Description
Blocks connected in series are connected in parallel.
+
A block begins with the ST instruction.
2 - 21
Basic Instructions FP0
Block ST X 0
Block 4 Block 1 AN X 1
4 ST X 2
X0 X1 Y0
Block Block
2 AN X 3
1 Block
X2 X3 1 ORS . . . . . . . . . 1
Block 5
2
X4 X5 2 Block ST X 4
Block 3 AN X 5
3
ORS . . . . . . . . . 2
Block 5 OUT Y 0
2 - 22
FP0 Basic Instructions
0 ST X 0
1 PSHS
2 AN X 1
X0 X1 Y0
0 3 OT Y 0
X2 Push Stack Y1 4 RDS
5 AN X 2
X3 Read Stack Y2
6 OT Y 1
Pop Stack
7 POPS
8 AN/ X 3
9 OT Y 2
Explanation of example
When X0 turns on:
Stores the operation result up to the PSHS instruction and Y0 goes on when X1 turns on.
Reads the stored result using the RDS instruction and Y1 goes on when X2 turns on.
Reads the stored result using the POPS instruction and Y2 goes on when X3 turns off. Also clears the result
stored by the PSHS instruction.
on
X0 off
on
X1 off
on
Y0 off
on
X2 off
on
Y1 off
on
X3 off
on
Y2 off
2 - 23
Basic Instructions FP0
Description
One operation result can be stored in memory and read, and multiple processes performed.
PSHS (stores operation result):
Stores the operation result up to this instruction and continues execution from the next step.
RDS (reads operation result):
Reads the operation result stored using the PSHS instruction and, using this result, continues operation from
the next step.
POPS (resets operation contents):
Reads the operation result stored using the PSHS instruction and, using this result, continues operation from
the next step. Also clears the operation result stored by the PSHS instruction.
These instructions are used if there is branching from a single contact, followed by another contact or
contacts.
Precautions during programming
You can continue to use the same operation result several times by repeatedly using the RDS instruction.
When you are finished, be sure to issue the POPS instruction.
X0 X1 Y0
PSHS X2 Y1
RDS X3 X4 Y2
POPS
X0 Y0
X1 Y1
X2 X3 Y2
RDS
X4 X5 Y3
X6 X7 Y4
2 - 24
FP0 Basic Instructions
If a POPS instruction is used during repeated use of a PSHS instruction, reading will take place in order
beginning from the last data stored by the PSHS instruction.
X0 X1 X2 X3 X4 X5 Y0 POPS . . . . . 5 Reading
AN X 6
OT Y 1
X6 Y1
POPS . . . . . 4 Reading
AN X 7
1 2 3 4 5
X7 Y2 OT Y 2
POPS . . . . . 3 Reading
Y3 AN X 8
X8
OT Y 3
X9 Y4
XA Y5
2 - 25
Basic Instructions FP0
Outline DF: Turns on the contact for only one scan when the leading edge of
the trigger is detected.
DF/: Turns on the contact for only one scan when the trailing edge of
the trigger is detected. 7
Program example
Boolean
Ladder Diagram
Address Instruction
Explanation of example
Y0 goes on for only one scan when the leading edge (off → on) of X0 is detected.
Y1 goes on for only one scan when the trailing edge (on → off) of X1 is detected.
on
X0 off
X1 on
off
on
Y0 off
↔ ↔
on 1 scan 1 scan
Y1 off
↔ ↔
1 scan 1 scan
Leading Trailing
edge edge
2 - 26
FP0 Basic Instructions
Description
The DF instruction executes and turns on output for only one scan duration when the trigger changes from an
off to an on state.
The DF/ instruction executes and turns on output for only one scan duration when the trigger changes from an
on to an off state.
There is no limit on the number of times the DF and DF/ instructions can be used.
With the DF and DF/ differential instructions, only a change in the on and off status of the contact is detected.
Thus, if the execution condition is initially on such as when the mode is changed to RUN or the power turned
on in RUN mode, output will not be obtained.
X0 on
off
Y0 on
off
DF instruction
Leading
RUN not executed. edge
X0
X1
Y0
1 2 3
2 - 27
Basic Instructions FP0
In the following program the execution condition (trigger) is initially on, therefore output is not obtained.
R9013 Y0
DF R9013 only turns on during the first scan after
RUN begins.
R9010 Y0
DF R9010 is always on.
Exercise caution when used in combination with instructions which change the order of instruction execution
such as MC and MCE or JP and LBL (see below).
For detailed information section 4.5
- MC and MCE instructions
- JP and LBL instructions
- LOOP and LBL instructions
- CNDE instruction
- Step ladder instructions
- Subroutine instructions
When combining a differential instruction with an AND stack or pop stack instruction, take care that the syntax
is correct. For detailed information section 4.6
2 - 28
FP0 Basic Instructions
X0 R0 Y0
DF X0
Y0 X1
X1 R0 R0
DF
Y0
Y0
With no differential instruction
Example 1:
X0 R0
DF
R0 Y0 Y0
R0 Y0
Example 2:
X0 R0
DF
R0 R0 Y0
Y0 Y0
2 - 29
Basic Instructions FP0
SET Set 3
FP0 C10, C14, C16,
Outline SET: When the execution conditions have been satisfied, the output is
turned on, and the on status is retained.
RST: When the execution conditions have been satisfied, the output is
turned off, and the off status is retained.
Program example
Boolean
Ladder Diagram
Address Instruction
Set 20 ST X 0
X0 Y0
20
〈S
〈
21 SET Y 0
X1 Y0 24 ST X 1
〈R
24
〈
25 RST Y 0
Output destination
Reset
Operands
Timer/Counter
Relay
Instruction Contact
X Y R T C
A: Available
SET, RST N/A A A N/A N/A N/A: Not Available
Explanation of example
When X0 turns on, Y0 goes on and holds on.
When X1 turns on, Y0 goes off and stays off.
on
X0 off
X1 on
off
on
Y0 off
Description
The SET instruction executes when the trigger is turned on. Output turns on and holds on even if the trigger’s
state changes.
The RST instruction executes when the trigger is turned on. Output turns off and stays off even if the trigger’s
state changes.
You can use relays with the same number as many times as you like with the SET and RST instructions.
(Even if a total check is run, this is not handled as a syntax error.)
2 - 30
FP0 Basic Instructions
X1 Y0
〈R
〈
I/O update is performed when an ED instruction is executed, therefore the data actually output is determined
by the final operation result. In the above example, the Y0 output is on.
To output a result while operation is still in progress, use a partial I/O update instruction (F143).
Precautions during programming
The output destination of a SET instruction is held even during the operation of an MC instruction.
For detailed information MC and MCE instructions
The output destination of a SET instruction is reset when the mode is changed from RUN to PROG. or when
the power is turned off, except when a hold type internal relay is specified as the output destination.
X0 Y0
〈S
〈
(DF)
X1 Y0
〈R
〈
(DF)
2 - 31
Basic Instructions FP0
Outline This is output which is accompanied by set or reset input, and which is
retained. 4
Program example
Boolean
Ladder Diagram
Address Instruction
Set input
X0 0 ST X 0
KP R 30
0
X1 Reset input 1 ST X 1
1 2 KP R 30
Output destination
Operands
Timer/Counter
Relay
Instruction Contact
X Y R T C
A: Available
KP N/A A A N/A N/A N/A: Not Available
Explanation of example
When X0 turns on, output relay R30 goes on and stays on.
R30 goes off when X1 turns on.
on
X0 off
on
X1 off
on
R30 off
2 - 32
FP0 Basic Instructions
2 - 33
Basic Instructions FP0
Outline No operation 5
Program example
Boolean
Ladder Diagram
Address Instruction
0 ST X 0
X0 X1 X2 Y0 1 AN X 1
0 S
2 NOP
NOP 3 AN/ X 2
4 OT Y 0
Description
This instruction has no effect on the operation result to that point.
The same operation takes place without a NOP instruction.
The NOP instruction can be used to make the program easier to read when checking or correcting.
When you want to delete an instruction without changing addresses, write a NOP instruction (overwrite the
previous instruction).
When you want to move the addresses of one part of a program without changing the program, insert a NOP
instruction.
This is a convenient means of breaking a long program into several blocks.
Example:
To move the starting point of a program block from address 39
to address 40, insert a NOP instruction at address 39.
Address Address
36 ST X0 36 ST X0
S OR X1 S OR X1
S OT Y1 S OT Y1
39 ST X2 This moves the 39 NOP Insert a NOP
40 AN X3 starting point to 40 ST X2 instruction.
S OT R20 address 40. 41 AN X3
S ST R2 S OT R20
S DF S ST R2
44 ST X3 S DF
45 ST X3
2 - 34
FP0 Basic Instructions
Operands
Timer/ Index
Relay Register Constant Index
Instruction Counter register
modifier
WX WY WR SV EV DT IX IY K H
A: Available
Set value N/A N/A N/A A N/A N/A N/A N/A A N/A N/A N/A: Not Available
2 - 35
Basic Instructions FP0
Description
The 100 points from T0 to T99 can be used for the timer.
If there are not enough the point number of timer, you can increase the number by changing the setting of
system register 5. For detailed information section 8.4.
For FP0 C10, C14, C16, C32 CPU Ver. 2.1 or later and FP0 T32, the timer is reset and does not retain its data
when the power is turned off or the mode is changed from the RUN to the PROG mode. (If you need to retain
the operating state, set system register 6.)
When the execution condition (trigger) is on, the set time [n] decrements, and when the elapsed value
reaches zero, timer contact Tn (n is the timer contact number) turns on.
If the execution condition (trigger) turns off during operation, operation stops and the elapsed value is reset
(cleared to 0).
An OT instruction can be entered immediately after a timer coil.
Example:
When K43 is set in TMX, the set time is 0.1 × 43 = 4.3
seconds.
When K500 is set in TMR, the set time is 0.01 × 500 = 5
seconds.
Precautions during programming
The timer value decrements during processing, therefore, create the program so that one decrement occurs
during one scan. (A correct result will not be obtained if no processing operations or multiple processing
operations take place during one scan due to an interrupt program or JP/LOOP instruction.)
Take care that the syntax is correct when combining a timer instruction with an AND stack or pop stack
instruction. For detailed information section 4.6
2 - 36
FP0 Basic Instructions
Timer operation
The following is an example of setting the set value with a K constant. For an explanation of operation when a
set value area (SV) is specified, see page 2 - 39.
1 When the mode is changed to RUN or when the power is turned on with the mode set to RUN, the
timer set value is transferred to the set value area (SV) with the same number.
1 Transfers to SV area
Set value
SV5
X0 TMX 5, K 30 30
T5 Y0
2 When the timer trigger rises from off to on, the setting is transferred from the set value area (SV) to the
elapsed value area (EV) with the same number. (The same operation takes place if the mode is
changed to RUN when the trigger is on.)
3 The value in the elapsed value area (EV) decrements every scan if the trigger stays on.
2 Transfers to EV area
SV5 EV5
X0 TMX 5, K 30 30 30
29
T5 Y0 28
27
3 Decrements
4 When the value in the elapsed value area (EV) reaches zero, the timer contact (T) with same number
turns on.
SV5 EV5
X0 TMX 5, K 30
30 0
4 Decrement operation ends
T5 Y0
See section 1.2 for an explanation of the set value area (SV) and the elapsed value area (EV).
2 - 37
Basic Instructions FP0
T0 Y0 TMX 1 on 3s
T1 off
K 20
2s
T1 Y1 ST T 0 Y0
on
off
OT Y 0
ST T 1 on
Y1 off
OT Y 1
2 - 38
FP0 Basic Instructions
T5 Y0
Specify [n] (the number of the set value area SV) to be the same number as the timer.
Key operation of FP Programmer II: T-TMSV X-STWX 5 ENT T-TMSV 5
Display: Timer number Set value area number (n)
TMX 5 SV 5
Even if the value of the set value area (SV) is changed during decrement operation, the decrement operation
will continue from the value before the change. Timer operation from the new value will not begin until
decrement operation has ended or is interrupted and the execution condition (trigger) subsequently changes
from off to on.
The set value area (SV) is normally a non - hold type which resets if the power is turned off or the mode is
changed from RUN to PROG.
2 - 39
Basic Instructions FP0
2 When the timer execution condition (trigger) rises from off to on, the setting is transferred from the set
value area (SV) to the elapsed value area (EV) with the same number. (The same operation takes
place if the mode is changed to RUN when the execution condition (trigger) is on.)
3 The value in the elapsed value area (EV) decrements if the execution condition (trigger) stays on
every scan.
2 Transfers to EV area
X0
F0 MV, K30, SV5 SV5 EV5
30 30
X1 TMX 5, SV 5 29
28
3 Decrement 27
T5 Y0 operation
4 When the value in the elapsed value area (EV) reaches zero, the timer contact (T) with same number
turns on.
See section 1.2 for an explanation of the set value area (SV) and the elapsed value area (EV).
2 - 40
FP0 Basic Instructions
0 7 9 4 Set value
of timer
WX0 Digital switch
2 - 41
Basic Instructions FP0
Program example
Boolean
Ladder Diagram
Address Instruction
Count number
0 ST X 0
X0 CT 100
Count input 1 ST X 1
0
K 10 2 CT 100
X1 Reset input
1 K 10
Elapsed value
C 100 Set value Y0 5 ST C 100
5 6 OT Y 0
Counter contact for counter no. 100
(example showing a case where
100 and subsequent numbers are
specified for counters)
Operands
Index
Relay Timer/Counter Register Constant Index
Instruction register
modifier
WX WY WR SV EV DT IX IY K H
A: Available
Set value N/A N/A N/A A N/A N/A N/A N/A A N/A N/A N/A: Not Available
Explanation of example
When the leading edge of X0 is detected ten times, counter contact C100 turns on and then Y0 goes on.
The elapsed value is reset when X1 turns on.
on
X0 off ....
on
X1 off 10 times
C100 on
off
Y0 on
off
2 - 42
FP0 Basic Instructions
Description
The counter is a decremental preset counter.
The following point numbers can be used for counters depending on the type of FP0 C10/C14/C16/C32/
T32/SL1.
Type Useable counter point numbers
FP0 C10/C14/C16 44 points (C100 to C143)
Non- hold type: 40 points (C100 to C139)
Hold type: 4 points (C140 to C143)
FP0 C32/SL1 44 points (C100 to C143)
Non- hold type: 28 points (C100 to C127)
Hold type: 16 points (C128 to C143)
FP0 T32 44 points (C100 to C143)
For FP0 C10/C14/C16/C32/SL1, there is a hold type, in which the counter status is retained even if the power
supply is turned off, or if the mode is switched from RUN to PROG, and a non - hold type, in which the counter
is reset under these conditions.
For FP0 T32, there is a hold type, in which the counter status is retained even if the power supply is turned off,
or if the mode is switched from RUN to PROG. System register 6 can be used to specify a non - hold type. For
detailed information section 8.4
At the fall time when the reset input goes from on to off, the value of the set value area (SV) is preset in the
elapsed value area (EV).
When the reset input is on, the elapsed value is reset to 0.
When the count input changes from off to on, the set value begins to decrement, and when the elapsed value
reaches 0, the counter contact Cn (n is the counter number) turns on.
If the count input and reset input both turn on at the same time, the reset input is given priority.
If the count input rises and the reset input falls at the same time, the count input is ignored and preset is
executed.
An OT instruction can be entered immediately after a counter instruction.
2 - 43
Basic Instructions FP0
Counter operation
The following are examples of specifying a K constant as the set value. For an explanation of operation when
a set value area number is specified, see page 2 - 46.
1 When the mode is changed to RUN or the power is turned on with the mode set to RUN, the counter
set value is transferred to the set value area (SV) with the same number.
2 When the reset input falls, the value in the set value area (SV) is preset in the elapsed value area
(EV).
1 Transfer
X0 CT 100 2 Preset
SV100 EV100
K 10 10 10
X1
C100 Y0
3 Each time the count input X0 turns on, the value in the elapsed value area (EV) decrements.
X0 CT 100
SV100 EV100
10 10
K 10
X1 9
8 3 Decrements
7
C100 Y0
4 When the value in the elapsed value area (EV) reaches zero, the counter contact (C) with the same
number turns on.
X0 CT 100
SV100 EV100
10 0
K 10
X1 4 Decrement operation ends
C100 Y0
For information on the set value area (SV) and the elapsed value area (EV), see section 1.2.
2 - 44
FP0 Basic Instructions
RUN
(Power: on)
Counter input
Operation of
instruction
Not counting Counting
When used in combination with instructions which change the order of instruction execution such as MC and
MCE or JP and LBL (see below), the operation of the instruction may change depending on the timing of
instruction execution and the count input. Exercise caution in these cases.
- MC and MCE instructions
- JP and LBL instructions
- LOOP and LBL instructions
- CNDE instructions
- Step ladder instructions
- Subroutine instructions
When combining a counter instruction with an AND stack instruction or pop stack instruction, take care that
the syntax is correct. For detailed information section 4.6
Related instructions
Counter instructions also include an up/down counter instruction (F118).
An increment instruction (F35) can be used to provide the same type of function.
2 - 45
Basic Instructions FP0
X1 CT 100
........... 2
X2 SV 100
C100 Y0
Specify [n] (the number of the set value area SV) to be the same number as the counter.
CT TM
Key input of FP Programmer II: C- EV
1 0 0 ENT T- SV
1 0 0
Counter number
Display:
CT 100
SV 100
Even if the value in the set value area (SV) is changed during decrement operation, the decrement operation
will continue from the value before the change. Counter operation from the new value will not begin until the
counter is reset and the count input subsequently changes from off to on.
In the case of a hold type counter, the set value area (SV) will not reset if the power is turned off or the mode
changed from RUN to PROG. If the SV value is changed during RUN, the set value will be preset the next time
the power is turned on or the mode is changed from PROG. to RUN.
2 - 46
FP0 Basic Instructions
X0
F0 MV, K30, SV100
SV100
X1 CT 100 30
C100 Y0
2 When the reset input is off, the value in the set value area (SV) is preset in the elapsed value area
(EV).
X1 CT 100
SV100 EV100
SV 100 30 30
X2
2 Presetting
C100 Y0
3 Each time the count input X1 turns on, the value in the elapsed value area (EV) decrements.
X1 CT 100
SV100 EV100
SV 100 30 30
X2
29
28 3 Decrements
C100 Y0 27
4 When the elapsed value area (EV) reaches zero, the counter contact C with the same number turns
on.
X1 CT 100
SV100 EV100
SV 100 30 0
X2
4 Decrement operation ends
C100 Y0
See section 1.2 for an explanation of the set value area (SV) and the elapsed value area (EV).
2 - 47
Basic Instructions FP0
SV100 K0 K50
0 7 9 4 Set value
of counter
Digital switch: WX0
Ladder diagram Boolean
R10 ST R 10
F81 (BIN)
F81 BIN, WX 0, SV 100 WX 0
R11 SV 100
CT 100
ST R 11
ST R 12
R12 SV 100 CT 100
SV 100
C100 Y0 ST C 100
OT Y 0
2 - 48
FP0 Basic Instructions
Outline One bit shift of 16-bit [word internal relay (WR)] data to the left. 5
Program example
Boolean
Ladder Diagram
Address Instruction
X0 Data input SR WR 3 0 ST X 0
0 D 1 ST X 1
X1
Shift input 2 ST X 2
1
X2 3 SR WR 3
Reset input
2
Operands
Index
Relay Timer/Counter Register Constant Index
Instruction register
modifier
WX WY WR SV EV DT IX IY K H
A: Available
D: Data area N/A N/A A N/A N/A N/A N/A N/A N/A N/A N/A N/A: Not Available
Explanation of example
If the X1 turns on when X2 is in the off state, the contents of the internal relay WR3 (internal relays R30 to R3F)
are shifted one bit to the left.
“1” is shifted in R30 if X0 is on, and “0” is shifted in R30 if X0 is off.
If the X2 turns on, the contents of WR3 are reset to 0.
on
X0 off
on
X1 off
on
X2 off
on
R30 off
on
R31 off
on
R32 off
on
R33 off
on
R34 off
2 - 49
Basic Instructions FP0
Description
Shifts the specified data area (WR) one bit to the left.
When the shift input turns on (rises), the contents of WR are shifted one bit to the left.
During the shift, 1 is set in the empty bit (least significant bit) if the data input is on, or 0 if the data input is off.
When shift input is turned on:
WR3 3F . . . . . . . . . . . . . . . . 30
Bit position 15 . . 12 11 . . 8 7 . . 4 3 . . 0
Binary data 0 0 0 0 1 0 0 0 1 0 0 0 1 1 0 0
Binary data 0 0 0 1 0 0 0 1 0 0 0 1 1 0 0 0
When the reset input turns on, the contents of WR are cleared.
When reset input is turned on:
WR (Binary data) 0 0 1 1 0 1 0 0 0 0 0 1 1 0 0 1
Contents of WR3 are
cleared to 0.
WR (Binary data) 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
Shift input
Reset input
If the internal relay area is specified as a hold type, take care that the data in the area is not reset to “0” when
the power turns on.
When combining a shift register instruction with an AND stack instruction or pop stack instruction, take care
that the syntax is correct. For details, refer to section 4.6.
2 - 50
FP0 Basic Instructions
RUN
(Power: on)
Shift input
Opration of
instruction
Does not shift Shifts
When used in combination with instructions which change the order of instruction execution such as MC and
MCE or JP and LBL (see below), the operation of the instruction may change depending on the timing of
instruction execution and the shift input.
Exercise caution in these cases.
- MC and MCE instructions
- JP and LBL instructions
- LOOP and LBL instructions
- CNDE instruction
- Step ladder instructions
- Subroutine instructions
Related instructions
In addition to the shift register instruction, there is also a left/right shift register instruction (F119).
The same type of operation can also be implemented using a data shift instructions (F100 to F113) or a data
rotate instructions (F120 to F123).
2 - 51
Basic Instructions FP0
Outline Executes the program between the MC and MCE when the execution
condition (trigger) turns on. 6
When the execution condition (trigger) is off, output between the MC
and MCE is turned off.
Program example
Boolean
Ladder Diagram
Address Instruction
9 (MCE 1 ) 9 MCE 1
Explanation of example
Executes the program from the MC1 instruction to the MCE1 instruction when the execution condition
(trigger) turns on.
If the execution condition (trigger) is off, output is turned off without processing being carried out between the
MC1 and MCE1 instructions.
on
X0 off
Execution
on
condition off
(trigger)
on
X1 off
on
Y1 off
on
X2 off
on
Y2 off
2 - 52
FP0 Basic Instructions
Description
Executes program between the MC and MCE instructions when the execution condition (trigger) turns on.
When the execution condition (trigger) is in the off state, the instructions operate as follows.
Instruction Condition of input and output
OT All off
KP Holds the state.
SET Holds the state.
RST Holds the state.
TM Reset
CT Holds the value.
SR Holds the value.
Differential See next page.
Other instructions Not executed
You must be careful when using one of the instructions below, which are executed by detecting the leading
edge of execution condition such as the differential instruction. For more details, refer to section 4.5.
- DF instruction
- Count input for CT instruction
- Count input for F118 (UDC) instruction
- Shift input for SR instruction
- Shift input for F119 (LRSR) instruction
- NSTP instruction
The numbers of points noted below can be used with the MC and MCE instructions.
Type Number of points
FP0 all types 32 points (MC0 to MC31)
2 - 53
Basic Instructions FP0
X0
MC 0
X1 Y0
DF
MCE 0
Output will not be obtained if the same execution condition (trigger) is specified for an MC instruction and a
differential instruction. If output is needed, enter the differential instruction outside of the MC to MCE
instruction sequence.
X0
MC 0
X0 Y0
DF
MCE 0
X0
MC 0
X0 R0
MCE 0
R0 Y0
DF
2 - 54
FP0 Basic Instructions
X2
MC 1
X3 Y1
X4
MC 2
X5 Y2
MCE 2
MCE 1
MCE 0
MCE 0
X1 Y0
X0
MC 0
There are two or more master control instruction sets with the same number.
X0
MC 0
X1 Duplicated use
MC 0
X2 Y0
MCE 0
MCE 0
2 - 55
Basic Instructions FP0
JP Jump 2
FP0 C10, C14, C16,
C32, T32, SL1
LBL Label 1
Outline Skips to the LBL instruction with the same number as the JP instruction.
Program example
Boolean
Ladder Diagram
Address Instruction
X1 10 ST X 1
10 (JP 1)
11 JP 1
Label number
....
....
20 (LBL 1 ) 20 LBL 1
Explanation of example
When the execution condition (trigger) X1 turns on, the program skips from JP1 to LBL1.
X1 Program
(JP 1) X1: on
No
Program execution
(LBL 1 )
Program
Description
When the execution condition (trigger) turns on, the program jumps to the label (LBL) instruction that has the
same number as the specified jump number.
The program then continues with the instructions starting from the address of the label that is the jump
destination.
The same label is used for the JP and LOOP instructions. Any of these instructions can be used as the
starting point for the jump destination.
The numbers of points noted below can be used with the JP and LBL instructions.
Type Number of points
FP0 all types 64 points (JP0 to 63)
(LBL0 to LBL63)
Two or more JP instructions with the same number can be used in a program.
X0
(JP 1)
R20
(JP 1)
X20
LOOP 1, DT0
(LBL 1 )
2 - 56
FP0 Basic Instructions
Two or more LBL instructions with same number cannot be specified in a program.
If a label for the jump destination is not programmed, a syntax error will occur.
You must be careful when using one of the instructions below, which are executed by detecting the rise of a
execution condition such as the differential instruction. For more details, refer to section 4.5.
- DF (leading edge differential)
- Count input with CT (counter)
- Count input with F118 (up/down counter)
- Shift input with SR (shift register)
- Shift input with F119 (left/right shift register)
- NSTP (next step)
Precautions during programming
If the address of the LBL instruction precedes the address of the JP instruction, the scan will not terminate
and an operation bottleneck error may occur.
The JP instruction and LBL instruction cannot be used in the step ladder area (the area between SSTP and
STPE).
You cannot perform a jump from a main program to a sub program (a subroutine program or interrupt program
after the ED instruction), from a sub program to a main program, or from a sub program to another sub
program.
TM, CT, and SR instruction operation between JP and LBL instructions
When the LBL instruction is located after the JP instruction:
- TM instruction: The TM instruction is not executed. X1
If it is not executed once during a single scan (JP 1)
the correct time cannot be guaranteed.
- CT instruction: Even if the count input is on, counting is not
performed. The elapsed value is preserved. (LBL 1 )
- SR instruction: Even if the shift input is on, no shift is
The program jumps when
performed. The contents of the specified the execution condition
register are preserved. (trigger) turns on.
2 - 57
Basic Instructions FP0
LBL 1
When the execution condition (trigger) for the JP instruction equals the execution condition (trigger) for the
differential instruction, the leading edge (or trailing edge) of the execution condition for the differential
instruction will not be detected.
If the differential output is required, do not write the differential instruction between the JP and LBL
instructions.
X1
JP 1
X1 Y1
DF/ Not executed.
LBL 1
X1 Y1
DF/
X1 Placed outside of the area
JP 1 between JP and LBL.
LBL 1
2 - 58
FP0 Basic Instructions
LOOP Loop 4
FP0 C10, C14, C16,
C32, T32, SL1
LBL Label 1
Outline Skips to the LBL instruction that has the same number as the LOOP
instruction and executes what follows, repeatedly, until the data of a
specified operand becomes “0”. 7
Program example
Boolean
Ladder Diagram
Address Instruction
10 ST X 1
X1
11 F0 (MV)
10 F0 MV, K5, DT 0
K 5
Label number
DT 0
16 (LBL 1 )
16 LBL 1
X1 Number of timers for loop
....
30 LOOP 1 , DT 0
30 ST X 1
S
31 LOOP 1
Label number
DT 0
Operands
Index
Relay Timer/Counter Register Constant Index
Instruction register
modifier
WX WY WR SV EV DT IX IY K H
A: Available
S N/A A A A A A A A N/A N/A A N/A: Not Available
2 - 59
Basic Instructions FP0
Description
When the execution condition (trigger) turns on, 1 is subtracted from the contents of S and if the result is other
than 0, the program jumps to the label (LBL instruction) that has the same number as the specified number.
The program then continues with the instructions starting from the address of the label that is the loop
destination.
Set the number of times to execute the program with the LOOP instruction. When the number of times set in S
(K constant) reaches 0, the jump will not occur even if the execution condition (trigger) turns on.
X0
F0 MV, K5 , DT 0
(LBL 1 )
If the value of DT0 is K5, then after performing the jump 5 times,
X1 even if X1 is set to on, the jump operation is not executed.
LOOP 1 , DT 0
If the contents of memory area specified by S is 0 from the beginning, the jump operation is not executed (it is
ignored).
The numbers of points noted below can be used with the LOOP and LBL instructions.
Type Number of points
FP0 all types 64 points (LOOP0 to 63)
(LBL0 to LBL63)
A label is common for the JP instruction and the LOOP instruction. One can be used as the destination for all
instructions as many times as required.
X0
JP 1
R20
JP 1
LBL 1
X20
LOOP 1, DT0
Two or more LBL instructions with the same number cannot be specified in a program.
If a label for the loop destination is not programmed, a syntax error will occur.
Flag conditions
S Error flag (R9007): Turns on and remains on when the specified value in the data area “S”
becomes less than “0” (when the most significant bit (bit position 15) of the
specified data area becomes “1”).
S Error flag (R9008): Turns on for an instant when the specified value in the data area becomes
less than “0” (when the most significant bit (bit position 15) of the specified
data area becomes “1”).
2 - 60
FP0 Basic Instructions
TM, CT, and SR instruction operation between the LOOP and LBL instructions
When the LBL instruction is located before the LOOP instruction:
- TM instruction: Because the timer will run several times during (LBL 1 )
a single scan, the correct time cannot be
guaranteed.
- CT instruction: If the state of the count input does not change X0
during the scan, it will operate in the usual way. LOOP 1, DT 0
- SR instruction: If the state of the shift input does not change The program is repeated
during the scan, it will operate in the usual way. when the execution
condition (trigger) turns on
(DT0=1).
LBL 10
X5
F0 MV, WR 0, DT 10
F0 MV, WR 1, DT 20
LOOP 10, DT 0
2 - 61
Basic Instructions FP0
The LOOP instruction and LBL instruction cannot be used in the step ladder area (the area between SSTP
and STPE).
You cannot perform a jump from a main program to a sub - program (a subroutine program or interrupt
program after the ED instruction), from a sub - program to a main program, or from a sub - program to another
sub - program.
You must be careful when using one of the instructions below, which are executed by detecting the leading
edge of execution condition (trigger) such as the differential instruction. For more details, refer to section 4.5.
- DF (leading edge differential)
- Count input of CT (counter)
- Count input of F118 (up/down counter)
- Shift input of SR (shift register)
- Shift input of F119 (left/right shift register)
- NSTP (next step)
2 - 62
FP0 Basic Instructions
Program example
Boolean
Ladder Diagram
Address Instruction
0 ST X 0
1 OR R 0
X0 X1 R0
0 2 AN/ X 1
R0 3 OT R 0
....
....
R0 X2 Y0
96 96 ST R 0
97 AN X 2
99 ( ED )
98 OT Y 0
99 ED
Description
Indicates the end of the ordinary program.
Program area
Address 0
Ordinary program
( ED )
Subroutine program
Interrupt program
Program areas are divided into an ordinary program area (main program) and “subroutine” and “interrupt
program” areas (sub - programs) using this instruction.
Enter subroutine programs and interrupt programs after the ED instruction.
2 - 63
Basic Instructions FP0
Outline Ends one scan of the program when the execution condition (trigger)
turns on. 9
Program example
Boolean
Ladder Diagram
Address Instruction
0 ST X 0
1 OR Y 0
X0 X1 Y0 2 AN/ X 1
0
3 OT Y 0
Y0
....
....
Execution condition (Trigger)
X3 96 ST X 3
96 ( CNDE )
97 CNDE
R0 X2 Y1
98 98 ST R 0
99 AN/ X 2
100 OT Y 1
Description
The CNDE instruction enables you to end one scan of the program.
When the execution condition (trigger) turns on, the program finishes and the input, output, and other such
operations are performed. When the operations are completed, the program then returns to the starting
address.
You can adjust the timing that operations are performed by performing the operations only after a required
number of program scans are completed.
The CNDE instruction cannot be performed in sub - programs such as subroutine programs or interrupt
programs. Use the CNDE instruction in the main program area only.
Two or more CNDE instructions can be used within the main program.
You must be careful when using one of the instructions below, which are executed by detecting the leading
edge of a execution condition (trigger) such as the differential instruction. For more details, refer to section
4.5.
- DF (leading edge differential)
- Count input for CT (counter)
- Count input for F118 (UDC) (up/down counter)
- Shift input for SR (shift register)
- Shift input for F119 (LRSR) (left/right shift register)
- NSTP (next step)
2 - 64
FP0 Basic Instructions
Y0
X3
CNDE Program execution
during normal scanning.
This part of the program is
not executed when the CNDE
instruction is executed.
ED
2 - 65
Basic Instructions FP0
22 (SSTP 2) 22 SSTP 2
....
....
X3 100 ST X 3
100 (CSTP 50 )
101 CSTP 50
2 - 66
FP0 Basic Instructions
Description
When the NSTL instruction or the NSTP instruction is executed, the process starting with the SSTP
instruction of the specified number is started and executed.
In a step ladder program, a process is identified as being from one SSTP instruction to the next SSTP or
STPE instruction.
The numbers of points noted below can be controled with the SSTP instruction.
Type Number of points
FP0 all types 128 processes (SSTP0 to SSTP127)
(SSTP 1)
Example:
X0 Y0
X1 Process 1
F0 MV, DT 0, DT 100
(SSTP 2)
Operations such as the sequence control, selection branch control, parallel branch control are easily
executed.
Sequence control
Only the necessary processes are switched and executed in order.
Process 2
Process 1 Process 4
Process 3
Process 1 Process 4
Process 3
Note
The step ladder of FP0 is not held, so be sure to take the
necessary precautions.
2 - 67
Basic Instructions FP0
SSTP 1
Program
Process 1
SSTP 2
Program Process 2
SSTP 5
Program
In a step ladder program, a process n is identified as being from one SSTPn instruction to the next SSTP or
STPE instruction.
No two processes can have the same process number.
The OT instruction can be programmed at the address just after the SSTP instruction.
The SSTP instruction cannot be programmed in sub - program (subroutine or interrupt program area).
The area starting from the first SSTP instruction to the STPE instruction is referred to as the step ladder area.
The programs in this area are all controlled as processes. Other areas are referred to as ordinary ladder
areas.
Ordinary ladder area
SSTP 1
STPE
Ordinary ladder area
There is a special internal relay that turns on for one scan only when a process on the step ladder starts.
(R9015: step ladder initial pulse relay.) This relay is used to perform operations for only one scan for counter
reset or other such process starts.
R0
NSTL 2 R0: on
↓
SSTP 2 SSTP1: Cleared
SSTP2: Starts
2 - 68
FP0 Basic Instructions
Declare the first process to start in the next step instruction in the ordinary ladder area.
A process can be started from the ordinary ladder area or from an already started process.
However, when you start a process with a next step instruction from within a process, the process that is
operating and contains the next step instruction is automatically cleared and the specified process starts.
Be aware that the outputs and other processes are actually turned off by the clear operation during the next
scan.
The NSTP instruction is a differential (pulse) execution type instruction, so it is executed for only one time
when the execution condition (trigger) turns on. Also, since it only detects if the execution condition (trigger)
has changed between on and off, when switched to the RUN mode or when the power supply is turned on
while in the RUN mode and the execution condition (trigger) is already on, the instruction is not executed.
RUN
(Power: on)
Shift input
Operations
with NSTP Not Executed
executed
Operations
with NSTL
Executed Executed
When you use the NSTP instruction with one of the following instructions that changes the order of the
execution of instructions, be aware that the operation of the instructions will differ depending on the timing of
their execution and their triggers.
- MC to MCE instructions
- JP to LBL instructions
- LOOP to LBL instructions
- CNDE instruction
- Step ladder instructions
- Subroutine instruction
When combining the NSTP instruction with an AND stack instruction or POP stack instruction, be careful that
the programming is correct. For more details, refer to section 4.6.
2 - 69
Basic Instructions FP0
SSTP 50
Program Process 50
SSTP 51
A process can also be cleared from the ordinary ladder area or from a process that is already started.
2 - 70
FP0 Basic Instructions
When you need to clear an entire processes in step ladder program, use the master control (MC and MCE)
instructions as shown below.
SSTP 1
STPE
MCE 0
ED
It is not necessary to execute processes in order of process numbers. You can execute two or more
processes at the same time.
Once you force on or off an output that is programmed in a process not yet executed, the output condition is
maintained until the process starts even if the forced on and off operation is canceled.
Step ladder operations
When the step ladder processes are programmed, program execution proceeds in the ordinary ladder area
and in the processes triggered by the next step instructions (NSTL or NSTP). Processes that have not been
triggered are ignored.
SSTP 2
Executing process 2 Executing
SSTP 9
Not executing process 9 Not executing
STPE
Ordinary ladder area Executing
ED
In the diagram, program execution occurs in the ordinary ladder areas and in process 2.
The moment the step ladder process is opened, step ladder internal pulse relay R9015 turns on for an instant
only in the first scan of the process. You can use R9015 to reset a counter or shift register used in the opened
process.
2 - 71
Basic Instructions FP0
The execution state (start/stop) for processes are stored in special data registers DT9060 to DT9067.
For the relationship between the register number and process number, refer to section 8.6.
Example:
SSTP 0
Y1 Y0
X0
NSTP 1
SSTP 1
Y0 Y1
(*): Same operation as when the execution condition (trigger) for the MC instruction turns off. Refer to the
explanation of the MC and MCE instructions.
2 - 72
FP0 Basic Instructions
You must be careful when using one of the instructions below, which are executed by detecting the leading
edge of execution condition (trigger) such as the differential instruction. For more details, refer to section 4.5.
- DF (leading edge differential)
- Count input of CT (counter)
- Count input of F118 (UDC) (up/down counter)
- Shift input of SR (shift register)
- Shift input of F119 (LRSR) (left/right shift register)
- NSTP (next step)
Examples of step ladder instructions
1 Sequence control of a process
This program repeats the same process until the work in a particular process is completed, then
switches to be the next process as soon as the work is completed.
Program an NSTL instruction to trigger the next process in each process. When the NSTL instruction
is executed, the next process is activated, and the currently executing process is cleared.
It is not necessary to execute in order of process number. You can also program the NSTL instruction
to trigger a previous process in response to current conditions.
Process 12 R2 turns on
Program
X4: on
X0
(NSTP 10 )
END
(SSTP 10 )
R0
Time chart
X1 Process 10 on
(NSTL 11 ) X0 off
on
(SSTP 11 ) X1 off
R1
on
X2 Process 11 X2 off
(NSTL 12 ) on
X4 off
(SSTP 12 )
Executing
R2 R0 Cleared Process 10
X4 Process 12 Executing
R1 Cleared Process 11
(CSTP 12 )
(STPE ) R2 Executing
Cleared Process 12
2 - 73
Basic Instructions FP0
X5: on
END
X1 on
X2 off
(NSTL 51 ) Process 50
X2 on
(NSTL 52 ) X3 off
(SSTP 51 ) on
X4 off
R1
on
X5 off
Process 51
X3
(NSTL 60 ) Executing
R0 Cleared Process 50
(SSTP 52 )
Executing
R2 R1 Cleared Process 51
Executing
X4 R2 Cleared
Process 52
(NSTL 60 ) Executing
R3 Cleared Process 60
(SSTP 60 )
R3
Process 60
X5
(CSTP 60 )
(STPE )
2 - 74
FP0 Basic Instructions
X4: on
Program
X0
Time chart
on
(NSTP 0) X0 off
(SSTP 0) on
R0 X1 off
X1 on
Process 0 X2 off
(NSTL 10 )
(NSTL 20 ) on
X3 off
(SSTP 10 )
on
R1 X4 off
Process 10 Executing
X2 R0 Cleared Process 0
(NSTL 11 )
Executing Process 0
(SSTP 20 ) R1 Cleared
R2
Executing Process 10
R2 Cleared Process 20
R100 Process 20
Executing
R3 Cleared
(SSTP 11 )
Executing Process 11
R3 R4 Cleared Process 30
X3 R100 Process 11
(NSTL 30 )
(CSTP 20 )
(SSTP 30 )
R4
Process 30
X4
(NSTL 0 )
(STPE )
2 - 75
Basic Instructions FP0
10 ST X 0
X0
10 (CALL 1) 11 CALL 1
Subroutine program number
....
....
20 (ED )
20 ED
21 (SUB 1) 21 SUB 1
Subroutine
....
....
30 (RET )
30 RET
Description
When the execution condition (trigger) turns on, the CALL instruction is executed and the subroutine
program of the specified number is executed starting with the SUB instruction.
When the subroutine reaches the RET instruction, the program returns to the address after the CALL
instruction of the main program and the execution of the main program resumes.
X0 Main program
1
CALL n
Main program 3
ED
SUB n
2
Subroutine program
RET
When CALLn is executed, the program is executed in the order 1 , 2 , 3 shown above.
2 - 76
FP0 Basic Instructions
The subroutine program n (n: 0 to 15) is the program from the SUBn instruction to the RET instruction. Always
place the address (subroutine) after the ED instruction.
The CALL instruction can be programmed in the main program area, interrupt program area, or subroutine
program area.
Two or more CALL instructions with the same program number can be specified in a program.
Nesting of subroutines is possible until the 5th nesting.
SUB 0 (Stage 2)
CALL1 SUB 1 (Stage 3)
RET CALL2 SUB 2 (Stage 4)
RET CALL3 SUB 3 (Stage 5)
RET CALL4 SUB 4
RET
RET
Called up from inside of the subroutine.
Flag conditions
S Error flag (R9007): Turns on and stays on when performing five nestings and executing the
CALL instruction for the subroutine of the 5th nesting.
S Error flag (R9008): Turns on for an instant when performing five nestings and executing the
CALL instruction for the subroutine of the 5th nesting.
Precautions during programming
In the interrupt program, a subroutine program cannot be used.
INT 1
SUB 11
Subroutine
RET
IRET
SUB 11
INT 0
IRET
RET
2 - 77
Basic Instructions FP0
SUB 0
You must be careful when you use, in a subroutine, one of the instructions below that is executed by detecting
the leading of execution condition (trigger) such as the differential instruction. For more details, refer to
section 4.5.
- DF (leading edge differential)
- Count input of CT (counter)
- Count input of F118 (up/down counter)
- Shift input of SR (shift register)
- Shift input of F119 (left/right shift register)
- NSTP (next step)
2 - 78
FP0 Basic Instructions
INT Interrupt 1
FP0 C10, C14, C16,
C32, T32, SL1
IRET Interrupt return 1
(ED ) 20 ED
20
21 (INT 0) 21 INT 0
....
....
Interrupt program number
26 (IRET ) 26 IRET
Description
When an interrupt is input, the interrupt program of the number specified is executed starting from the INT
instruction.
When the interrupt program reaches the IRET instruction, the program returns to the address where the
interrupt occurred and the main program resumes.
X0 Interrupting
1
DF ICTL, S1, S2
Main program 3
ED
INT n
2
Interrupt
program n
IRET
When the interrupt occurs, the program is executed in the order 1 - 2 - 3 shown above.
Syntax of interrupt program
An interrupt program n is the program between the INTn instruction and the IRET instruction. The interrupt
program must always be placed after the ED instruction.
The number of the interrupt program is decided by the type of the interrupt.
Interrupt program Interrupt input (trigger) setting High - speed counter setting
number <when using F166/F167
instructions>
INT0 X0 Equal to ch0 target value
INT1 X1 Equal to ch1 target value
INT2 X2
INT3 X3 Equal to ch2 target value
INT4 X4 Equal to ch3 target value
INT5 X5
INT24 Periodical interrupt
2 - 79
Basic Instructions FP0
Notes
• If the high - speed counter/pulse catch is set, that contact
cannot be used as the interrupt input (trigger).
• For the high speed counter - initiated interrupts and periodical
interrupts, it is not necessary to indicate the input (trigger)
contact.
The interrupt occurs when the input (trigger) specified at system register 403 rises (on) or falls (off).
2 High - speed counter - initiated interrupt (INT0, INT1, INT3, INT4)
When executing either instruction F166 or instruction F167, the interrupt occurs when the high - speed
counter elapsed value equals the set target value. Refer to the explanations of the F166 instruction
and F167 instruction.
3 Periodical interrupt (INT24)
The interrupt occurs in fixed time intervals. Set the time interval with the ICTL instruction.
Set in 10 ms units ranging from 10 ms to 30 s (ICTL S1 = H2)
Set in 0.5 ms units ranging from 0.5 ms to 1.5 s (ICTL S1 = H3)
When the interrupt occurs, the interrupt program with the corresponding number is executed.
Main program Execution Execution
If interrupts are disabled, an interrupt will occur only at the point when interrupts are enabled with the ICTL
instruction.
on
Interrupt input off
Enabled
2 - 80
FP0 Basic Instructions
When another interrupt program is being executed, an interrupt will occur after the current program is
completed.
Execution
Main program
INT 5
Specify R9010 or other
X5 contact instead of X5.
F0 MV, K10, DT100
IRET
INT 1
SUB 11
Subroutine
RET
IRET
SUB 11
INT 0
IRET
RET
2 - 81
Basic Instructions FP0
INT 0
INT 1
IRET
INT1 program
INT2 program
INT3 program
on
INT1 input off
on
INT2 input off
on
INT3 input off
When more than one interrupt occurs while a interrupt program is being executed, the other programs will be
executed in order from the smallest number to the greatest after the program currently being executed is
finished.
INT1 program
INT2 program
INT3 program
INT4 program
on
INT1 input off
on
INT2 input off
on
INT3 input off
on
INT4 input off
2 - 82
FP0 Basic Instructions
INT1 program
INT2 program
on
INT1 input off
on
INT2 input off
INT1 program
INT2 program
on Clear
INT1 input off
on
INT2 input off
When the execution of interrupt programs is disabled with the ICTL instruction, interrupts that occur are still
placed in the execution waiting state. When the execution is enabled with the ICTL instruction, the waiting
interrupt programs will then be executed. Programs in the execution waiting state can be cleared with the
ICTL instruction.
2 - 83
Basic Instructions FP0
Outline Performs the interrupt enable or disable and the interrupt clear.
Program example
Boolean
Ladder Diagram
Address Instruction
0 ST X 0
X0 1 DF
0 ( DF ) ICTL, H 0, H 1
2 ICTL
S1 S2 H 0
H 1
S1 16-bit equivalent constant or 16-bit area for interrupt control data setting
S2 16-bit equivalent constant or 16-bit area for interrupt condition setting
Operands
Index
Relay Timer/Counter Register Constant Index
Operand register
modifier
WX WY WR SV EV DT IX IY K H
S1 A A A A A A A A A A A
S2 A A A A A A A A A A A A: Available
Description
When the ICTL instruction is executed, the interrupt program enable/disable and interrupt clear are set
according to the settings in S1 and S2.
Be sure to use ICTL instructions so that they are executed once at the leading edge of the execution condition
(trigger) using the DF instruction.
Two or more ICTL instructions can have the same execution condition (trigger).
Before executing an interrupt program, be sure to execute the ICTL instruction and enable the
execution of the interrupt program.
Note
If rewriting is done in the RUN mode while the interrupt function
is being used, the interrupt function will be disabled.
The ICTL instruction must be used to enable execution of the
interrupt program before it can be resumed.
Example of setting a periodical interrupt every 10ms from the
start of operations (enables the interrupt function to be resumed
for rewriting in the RUN mode)
R9013
ICTL, H2, K1 Executes INT24 every 10ms
R9034
2 - 84
FP0 Basic Instructions
Input examples
The R9013 (initial pulse relay) turns on only for the first scan after
operations begin.
Example 3: Clear interrupts other than INT0 after the INT0 program is
completed.
INT 0
R0 Interrupts other than INT0 are
ICTL, H100, H1 cleared when the program of
INT0 is finished
IRET
Bit position 15 . . 12 11 . . 8 7 . . 4 3 . . 0
S1
If execution has been specified as enabled or disabled for INT0 to INT5, S1 = H0.
If an interrupt clear has been specified for INT0 to INT5, S1 = H100.
Set S1 = H2 (for units of 10ms) or S1 = H3 (for units of 0.5ms) to set the time interval for INT24.
2 - 85
Basic Instructions FP0
Example: Clear interrupt programs INT1 and INT2 and do not clear interrupt
programs INT3 through INT5.
Bit position 15 . . 12 11 . . 8 7 . . 4 3 . . 0
INT program
number 5 4 3 2 1 0
S2 (Enabled/ 0: INT program disabled
disabled) 0 0 0 0 0 0 0 0 0 0 1 1 1 0 0 0 1: INT program enabled
K0 to K3000
K0 to K3000
2 - 86
FP0 Basic Instructions
Example:
DF ICTL, H0, H21
S1
S2
S1: H0000
Specifies enabling or disabling of interrupt programs that
correspond to interrupts at specified input (trigger) contact or
to target value match interrupts.
S2: H0021
Enable INT0 and INT5 (set bits 0 and 5 to “1”) and disable all
others.
Bit position 15 . . 12 11 . . 8 7 . . 4 3 . . 0
S2 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 1
INT No. 5 4 3 2 1 0
Input contact
X0 (INT0)
X1 (INT1)
X2 (INT2)
X3 (INT3)
X4 (INT4)
X5 (INT5)
When this ICTL instruction is executed, interrupt programs No. 1 and No. 5 will be executed when their
corresponding interrupt inputs occur.
ICTL instruction
INT5 program
on Execution
INT0 input off
on
INT5 input off
2 - 87
Basic Instructions FP0
Example:
DF ICTL, H100, HFE
S1
S2
S1: H0100
Clears interrupts from specified input (trigger) contact or
target value match interrupts.
S2: HFE
Clears interrupt INT0 (bit 0 is “0”) and does not clear the other
interrupts.
For the relationship between the set value and the interrupt
input (trigger) contact, refer to page 2 - 87 “Example of
enabling the execution of interrupt programs.”
Even though the INT0 interrupt input occured, when the interrupt program is disabled, the ICTL instruction
can still be used to clear the INT0 interrupt.
ICTL instruction
INT1 program
on
INT0 input off Clear Execution
on
INT1 input off
Note
Since INT0 is cleared, the INT0 program will not be executed
even after execution is enabled. Since INT1 is not cleared, the
INT1 program will be executed after execution is enabled.
2 - 88
FP0 Basic Instructions
Example:
DF ICTL, H2, K1500
S1
S2
S1: H0002
Specifies periodical interrupt
S2: K1500
Specifies the time interval for the periodical interrupt.
With K1500, the time interval is K1500 x 10ms = 15000ms (15
sec)
After this ICTL instruction is executed, the periodical interrupt will occur every 15 seconds. At these times, the
INT24 interrupt program will be executed.
ICTL instruction
Execution
INT24 program
15s 15s
To stop the periodical interrupt program (INT24), execute the following program.
DF ICTL, H2, K0
2 - 89
Basic Instructions FP0
Outline Performs start operation by comparing two word data items with the
comparison condition. The contact goes on or off depending on the
result of the comparison.
Program example
Boolean
Ladder Diagram
Address Instruction
0 ST =
DT 0
S1 S2
K 50
Y0
0 =, DT 0, K 50 5 OT Y 0
Y1 6 ST > =
> =, DT 0, K 60
6
DT 0
S1 S2
K 60
11 OT Y 1
Operand
Index
Relay Timer/Counter Register Constant Index
Operand register
modifier
WX WY WR SV EV DT IX IY K H
S1 A A A A A A A A A A A
S2 A A A A A A A A A A A A: Available
2 - 90
FP0 Basic Instructions
Explanation of example
Compares the contents of data register DT0 with the constant K50 and K60. If DT0 = K50, the external output
relay Y0 goes on and if DT0 ≧ K60, the external output relay Y1 turns on.
DT0
60
50
10
on
Y0 off
on
Y1 off
Description
Compares the word data specified by S1 with the word data specified by S2 according to the comparison
condition.
The ST instruction initiates a logical operation as the liaison contact when the comparison result is a specified
status (=, <, >, etc.).
The result of the comparison operation is as follows:
Comparison Condition
instruction
S1 < S2 S1 = S2 S1 > S2
ST= off on off
ST < > on off on
ST> off off on
ST> = off on on
ST< on off off < > indicates ≠
>= indicates ≧
ST< = on on off <= indicates ≦
2 - 91
Basic Instructions FP0
Outline Performs start operation by comparing two double word data items with
the comparison condition. The contact goes on or off depending on the
result of the comparison. 12
Program example
Boolean
Ladder Diagram
Address Instruction
0 STD =
DT 0
S1 S2
DT 100
Y0
0 D =, DT 0, DT 100 9 OT Y 0
Y1 10 STD >
10 D >, DT 0, DT 100
DT 0
S1 S2
DT 100
19 OT Y 1
Operands
Index
Relay Timer/Counter Register Constant Index
Operand register
modifier
WX WY WR SV EV DT IX IY K H
S1 A A A A A A A N/A A A A
A: Available
S2 A A A A A A A N/A A A A N/A: Not Available
2 - 92
FP0 Basic Instructions
Explanation of example
Compares the contents of data registers (DT1, DT0) with the data registers (DT101, DT100).
If (DT1, DT0) = (DT101, DT100), the external output relay Y0 goes on and if (DT1, DT0) > (DT101, DT100),
the external output relay Y1 goes on.
Description
Compares the double word data specified by S1 and S1+1 with the double word data specified by S2 and
S2+1 according to the comparison condition.
The STD instruction initiates a logical operation as the liaison contact when the comparison result is a
specified status (=, <, >, etc.).
The result of the comparison operation is as follows:
Comparison Condition
instruction
(S1+1, S1) < (S1+1, S1) = (S1+1, S1) >
(S2+2, S2) (S2+2, S2) (S2+2, S2)
STD= off on off
STD< > on off on
STD> off off on
STD> = off on on
STD< on off off < > indicates ≠
>= indicates ≧
STD< = on on off <= indicates ≦
When processing 32-bit data, the higher 16-bit areas (S1+1, S2+1) are automatically determined once the
lower 16-bit areas (S1, S2) are specified.
S2+1 S2
2 - 93
Basic Instructions FP0
Outline Performs AND operation by comparing two word data items with the
comparison condition. The contact goes on or off depending on the
result of the comparison. The contacts are connected in series. 13
Program example
Boolean
Ladder Diagram
Address Instruction
0 ST X 0
X0 Y0 1 AN > =
0
> =, DT 0, K 60
DT 0
S1 S2 K 60
6 OT Y 0
Operand
Index
Relay Timer/Counter Register Constant Index
Operand register
modifier
WX WY WR SV EV DT IX IY K H
S1 A A A A A A A A A A A
S2 A A A A A A A A A A A A: Available
2 - 94
FP0 Basic Instructions
Explanation of example
Compares the contents of data register DT0 with the constant K60 when X0 turns on. If DT0 ≧ K60 in the X0
on state, external output relay Y0 goes on. If DT0 < K60 or if X0 is in the off state, external output relay Y0 goes
off.
DT0
60
10
on
X0 off
on
Y0 off
Description
Compares the word data specified by S1 with the word data specified by S2 according to the comparison
condition.
The AN instruction results in serial connection as the liaison contact when the comparison result is a
specified status (=, <, >, etc.).
The result of the comparison operation is as follows:
Comparison Condition
instruction
S1 < S2 S1 = S2 S1 > S2
AN= off on off
AN< > on off on
AN> off off on
AN> = off on on
AN< on off off < > indicates ≠
>= indicates ≧
AN< = on on off <= indicates ≦
2 - 95
Basic Instructions FP0
Outline Performs AND operation by comparing two double word data items with
the comparison condition. The contact goes on or off depending on the
result of the comparison. The contacts are connected in series. 14
Program example
Boolean
Ladder Diagram
Address Instruction
0 ST X 0
X0 Y0 1 AND >=
0
D> =, DT 0, DT100
DT 0
S1 S2 DT 100
10 OT Y 0
Operand
Index
Relay Timer/Counter Register Constant Index
Operand register
modifier
WX WY WR SV EV DT IX IY K H
S1 A A A A A A A N/A A A A
A: Available
S2 A A A A A A A N/A A A A N/A: Not Available
Explanation of example
Compares the contents of data registers (DT1, DT0) with the data registers (DT101, DT100) when X0 turns
on. If (DT1, DT0) ≧ (DT101, DT100) in the X0 on state, the external output relay Y0 goes on.
If (DT1, DT0) < (DT101, DT100) or if X0 is in the off state, the external output relay Y0 goes off.
2 - 96
FP0 Basic Instructions
Description
Compares the double word data specified by S1 and S1+1 with the double word data specified by S2 and
S2+1 according to the comparison condition.
The AND instruction results in serial connection as the liaison contact when the comparison result is a
specified status (=, <, >, etc.).
The result of the comparison operation is as follows:
Comparison Condition
instruction
(S1+1, S1) < (S1+1, S1) = (S1+1, S1) >
(S2+1, S2) (S2+1, S2) (S2+1, S2)
AND= off on off
AND< > on off on
AND> off off on
AND> = off on on
AND< on off off < > indicates ≠
>= indicates ≧
AND< = on on off <= indicates ≦
When processing 32-bit data, the higher 16-bit areas (S1+1, S2+1) are automatically determined once the
lower 16-bit areas (S1, S2) are specified.
S2+1 S2
2 - 97
Basic Instructions FP0
Outline Performs OR operation by comparing two word data items with the
comparison condition. The contact goes on or off depending on the
result of the comparison. The contacts are connected in parallel. 15
Program example
Boolean
Ladder Diagram
Address Instruction
0 ST X 0
X0 Y0
0 1 OR > =
> =, DT 0, K 60 DT 0
K 60
S1 S2
6 OT Y 0
Operand
Index
Relay Timer/Counter Register Constant Index
Operand register
modifier
WX WY WR SV EV DT IX IY K H
S1 A A A A A A A A A A A
S2 A A A A A A A A A A A A: Available
2 - 98
FP0 Basic Instructions
Explanation of example
Y0 goes on when X0 is in the on state, or when DT0 ≧ K60. If DT0 < K60 and if X0 is in the off state, then Y0
goes off.
DT0
60
10
on
X0 off
on
Y0 off
Description
Compares the word data specified by S1 with the word data specified by S2 according to the comparison
condition.
The OR instruction results in parallel connection as the liaison contact when the comparison result is a
specified status (=, <, >, etc.).
The result of the comparison operation is as follows:
Comparison Condition
instruction
S1 < S2 S1 = S2 S1 > S2
OR= off on off
OR< > on off on
OR> off off on
OR> = off on on
OR< on off off < > indicates ≠
>= indicates ≧
OR< = on on off <= indicates ≦
2 - 99
Basic Instructions FP0
Outline Performs OR operation by comparing two double word data items with
the comparison condition. The contact goes on or off depending on the
result of the comparison. The contacts are connected in parallel. 16
Program example
Boolean
Ladder Diagram
Address Instruction
0 ST X 0
X0 Y0
0 1 ORD> =
D> =, DT 0, DT100 DT 0
1
DT 100
S1 S2 10 OT Y 0
Operand
Index
Relay Timer/Counter Register Constant Index
Operand register
modifier
WX WY WR SV EV DT IX IY K H
S1 A A A A A A A N/A A A A
A: Available
S2 A A A A A A A N/A A A A N/A: Not Available
Explanation of example
Compares the contents of data registers (DT1, DT0) with the data registers (DT101, DT100). When X0 turns
on or if (DT1, DT0) ≧ (DT101, DT100), the external output relay Y0 goes on.
If (DT1, DT0) < (DT101, DT100) and if X0 is in the off state, the external output relay Y0 goes off.
2 - 100
FP0 Basic Instructions
Description
Compares the double word data specified by S1 and S1+1 with the double word data specified by S2 and
S2+1 according to the comparison condition.
The ORD instruction results in parallel connection as the liaison contact when the comparison result is a
specified status (=, >, <, etc.).
The result of the comparison operation is as follows:
Comparison Condition
instruction
(S1+1, S1)< (S1+1, S1) = (S1+1, S1) >
(S2+1, S2) (S2+1, S2) (S2+1, S2)
ORD= off on off
ORD< > on off on
ORD> off off on
ORD> = off on on
ORD< on off off < > indicates ≠
>= indicates ≧
ORD< = on on off <= indicates ≦
When processing 32-bit data, the higher 16-bit areas (S1+1, S2+1) are automatically determined once the
lower 16-bit areas (S1, S2) are specified.
The specified data area and the
following data area are handled
S1+1 S1 together as 32 - bit data.
Comparison
S2+1 S2
2 - 101
Basic Instructions FP0
2 - 102
Chapter 3
High-level Instructions
3- 2
FP0 High-level Instructions
3.1.1 Composition
S D
Boolean
F type high- level instruction number: “0”
Operand types
S (Source): Data which is to be processed or data which sets the processing method.
D (Destination): Location where result of processing is stored.
n (number): Numeric data which is to be processed or which sets the processing method.
Operands are specified using constants or memory areas (registers) as explained in
section 1.2.
Refer to the explanations of the instructions as only certain memory areas (registers)
and constants can be used with each instruction.
3- 3
High-level Instructions FP0
High-level instruction numbers are assigned to high-level instructions. For example, the
number assigned to the MV instruction (16-bit data transfer instruction) is F0.
A high- level instruction is entered by entering its high-level instruction number. Enter
“F” and then the number.
F
0
A high-level instruction is always used in a pair with its execution condition (trigger).
When the operation result of the relay sequence circuit specified as the execution
condition (trigger) is on, the high-level instruction is executed.
Example:
When the execution condition (trigger) R0 is on, the F0 (MV)
instruction is executed and K0 is transferred to DT0.
R0
F0 MV, K0, DT0
Execution condition
(Trigger)
F - type High-level
instruction Execution
[ex. F0 (MV)] 1 scan
3- 4
FP0 High-level Instructions
There is no need to program the same execution condition (trigger) many times when
two or more high-level instructions are programmed consecutively with the same
execution condition (trigger).
Example:
R0
F81 BIN, WX3, DT3
R0
F60 CMP, DT3, K50
R0
F81 BIN, WX3, DT3
3- 5
High-level Instructions FP0
Example:
16-bit move: [F0 (MV)]
32-bit move: [F1 (DMV)]
Hexadecimal digit data move: [F6 (DGT)]
Block move: [F10 (BKMV)]
Program Example
R0
F0 MV, K50, DT1
Example:
16-bit data addition: [F22 (+)]
16-bit data subtraction: [F27 ( - )]
16-bit data multiplication: [F30 (*)]
16-bit data division: [F32 (%)]
Program Example
R0
F22 +, DT0, DT10, DT20
3- 6
FP0 High-level Instructions
Example:
4-digit BCD data addition: [F42 (B+)]
4-digit BCD data subtraction: [F47 (B - )]
4-digit BCD data multiplication: [F50 (B*)]
4-digit BCD data division: [F52 (B%)]
Program Example
R0
F42 B+, DT0, DT10, DT20
Example:
16-bit data compare: [F60 (CMP)]
32-bit data compare: [F61 (DCMP)]
Program Example
R0
F60 CMP, DT0, K100
R0 R900B R1
This program compares the value in DT0 and K100, and turns
R1 on if they are equal.
R900B is a flag which turns on when the result of a
comparison is “equal” (=).
3- 7
High-level Instructions FP0
Example:
AND operation: [F65 (WAN)]
OR operation: [F66 (WOR)]
Exclusive OR operation: [F67 (XOR)]
Exclusive NOR operation: [F68 (XNR)]
Program Example
R0
F65 WAN, H1, H3, DT20
H1 : 0 ··· 0 0 0 1
Logic operation (1 when both are 1)
H3 : 0 ··· 0 0 1 1
Example:
Hexadecimal data → ASCII code: [F71 (HEXA)]
ASCII code → Hexadecimal data: [F72 (AHEX)]
16-bit binary data → ASCII code: [F75 (BINA)]
16-bit data invert: [F84 (INV)]
Program Example
R0
F75 BINA, DT0, H4, DT10
3- 8
FP0 High-level Instructions
Example:
Right shift of n bits: [F100 (SHR)]
Right shift of one hexadecimal digit: [F105 (BSR)]
Program Example
Shift 4 bits
R0
F100 SHR, DT0, K4
DT0: 1 1 1 1 0 0 0 0 1 1 1 1 0 0 0 0
DT0: 0 0 0 0 1 1 1 1 0 0 0 0 1 1 1 1
Example:
16-bit data right rotate: [F120 (ROR)]
16-bit data left rotate: [F121 (ROL)]
Program Example
R0
F120 ROR, DT0, K4
DT0: 1 1 1 1 0 0 0 0 1 1 1 1 0 0 0 0
DT0: 0 0 0 0 1 1 1 1 0 0 0 0 1 1 1 1
3- 9
High-level Instructions FP0
Example:
Bit set: [F130 (BTS)]
Bit invert: [F132 (BTI)]
Number of on bits: [F135 (BCU)]
Program Example
R0
F130 BTS, DT0, K15
15
12 11 4 3 0
DT0: 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
Special instructions
These consist of a special instruction for use of the high-speed counter or other
functions and an instruction which performs operation or control for specific purposes.
Example:
On when equals target value: [F166 (HC1S)]
Pulse output: [F169 (PLS)]
Program Example
R0
F166, FC1S, K1, K10000, Y5
Value of
DT0
Elapsed
value
Time
on
Y5
off
3 - 10
FP0 High-level Instructions
Note
The instruction is available for FP0 T32 and FP0 C10/C14/C16/
C32 CPU Ver. 2.1 or later.
The instruction should be input using programming tool software
(FPWIN GR/NPST- GR Ver. 4.3 or later) and FP Programmer II
(AFP1114V2).
3 - 11
High-level Instructions FP0
3 - 12
FP0 High-level Instructions
3 - 13
High-level Instructions FP0
3 - 14
FP0 High-level Instructions
3 - 15
High-level Instructions FP0
3 - 16
FP0 High-level Instructions
Notes
3 - 17
High-level Instructions FP0
Note
To input instructions F166 to F170 and F183, NPST - GR Ver. 4.2 or
later or FP Programmer II (AFP1114V2) is necessary.
3 - 18
FP0 High-level Instructions
F310 Floating point type F+ S1, S2, D ( S1+1, S1) + (S2+1, S2)→(D+1, D) 14 3 - 277
(* Note ) data addition
F311 Floating point type F- S1, S2, D ( S1+1, S1) - (S2+1, S2)→ (D+1,D) 14 3 - 279
(* Note ) data subtraction
F312 Floating point type F* S1, S2, D ( S1+1, S1)×(S2+1, S2)→(D+1, D) 14 3 - 281
(* Note ) data multiplication
F313 Floating point type F% S1, S2, D ( S1+1, S1)÷(S2+1, S2)→(D+1, D) 14 3 - 283
(* Note ) data division
F323 Floating point type PWR S1, S2, D (S1+1, S1) ^ (S2+1, S2)→ (D+1, D) 14 3 - 303
(* Note ) data power
F325 16-bit integer data to FLT S, D Converts the 16-bit integer data- 6 3 - 307
(* Note ) floating point type with sign specified by “S” to real
data conversion number data, and the converted
data is stored in “D.”
Note
The instruction is available for FP0 T32 and FP0 C10/C14/C16/C32
CPU Ver. 2.1 or later.
3 - 19
High-level Instructions FP0
Note
The instruction is available for FP0 T32 and FP0 C10/C14/C16/C32
CPU Ver. 2.1 or later.
3 - 20
FP0 High-level Instructions
Note
The instruction is available for FP0 T32 and FP0 C10/C14/C16/C32
CPU Ver. 2.1 or later.
3 - 21
High - level Instructions FP0
Ladder diagram
This indicates the
ladder diagram
screen displayed
when data is en- Number of steps
tered using the pro- This is the number of
gramming tool soft- steps used with this
ware (NPST - GR/ instruction.
FPWIN GR).
Available
operands
This indicates
types of registers
and constants Boolean
which can be
used as operands. This indicates how
codes are used
For information on
when data is en-
types of memory
tered using bool-
areas, refer to
ean entry with the
section 1.2.
programming tool
software (NPST -
GR/FPWIN GR).
Data is also en-
tered in this format
Explanation of
when using the FP
program Programmer II.
example and
flag
conditions
Using the pro-
gram shown in
the above ladder
diagram as an
example,
changes in
movements and
stored values are
shown, as well as
types of flags and
the conditions un-
der which they go
on and off.
3 - 22
FP0 High- level Instructions
10 ST R 0
Trigger 11 F 0 (MV)
DT 0
R0
F0 MV , DT 0 , DT 1 DT 1
10
S D
Operands
Index
Relay Timer/Counter Register Constant Index
Operand register
modifier
WX WY WR SV EV DT IX IY K H
S A A A A A A A A A A A
A: Available
D N/A A A A A A A A N/A N/A A N/A: Not Available
Explanation of example
The contents of data register DT0 are copied to data register DT1 when execution condition (trigger) R0 turns
on.
Description
The 16-bit data or 16-bit equivalent constant specified by S is copied to the area specified by D.
Application example
Example 1: Transfer K30 to timer set value area SV0 when R1 turns on.
R1
F0 MV, K 30, SV 0
Example 2: Transfer the timer elapsed value EV0 to data register DT0 when
R2 turns on.
R2
F0 MV, EV 0, DT 0
Flag conditions
S Error flag (R9007): Turns on and stays on when the area specified using the index modifier
exceeds the limit.
S Error flag (R9008): Turns on for an instant when the area specified using the index modifier
exceeds the limit.
3 - 23
High - level Instructions FP0
10 ST R 0
Trigger
11 F 1 (DMV)
R0 DT 0
10 F1 DMV , DT 0 , DT100 DT 100
S D
Operands
Index
Relay Timer/Counter Register Constant Index
Operand register
modifier
WX WY WR SV EV DT IX IY K H
S A A A A A A A N/A A A A
A: Available
D N/A A A A A A A N/A N/A N/A A N/A: Not Available
Explanation of example
The contents of data registers DT1 and DT0 are copied to data registers DT101 and DT100 when execution
condition (trigger) R0 turns on.
Higher Lower
16- bit area 16- bit area
.... The content (16 bits) of DT0 and the content (16 bits) of DT1 are joined and
treated as 32- bit data.
Content for Content for
DT1 DT0
.... 32- bit data is separated into the higher 16- bit data and the lower 16- bit data,
and stored in DT101 and DT100.
To DT101 To DT100
Description
The 32-bit data or 32-bit equivalent constant specified by S is copied to the 32-bit area specified by D.
When processing 32-bit data, the higher 16-bit areas (S+1, D+1) are automatically determined once the
lower 16-bit areas (S, D) are specified.
Flag conditions
S Error flag (R9007): Turns on and stays on when the area specified using the index modifier
exceeds the limit.
S Error flag (R9008): Turns on for an instant when the area specified using the index modifier
exceeds the limit.
3 - 24
FP0 High- level Instructions
F2 (MV/) 16-bit data invert and move 5 FP0 C10, C14, C16,
C32, T32, SL1
Outline Inverts 16-bit data and transfers it to the specified 16-bit area.
Program example
Boolean
Ladder Diagram
Address Instruction
10 ST R 0
Trigger 11 F 2 (MV/)
DT 1
R0
10 F2 MV/ , DT 1 , DT 0 DT 0
S D
Operands
Index
Relay Timer/Counter Register Constant Index
Operand register
modifier
WX WY WR SV EV DT IX IY K H
S A A A A A A A A A A A
A: Available
D N/A A A A A A A A N/A N/A A N/A: Not Available
Explanation of example
The contents of data register DT1 are inverted and transferred to data register DT0 when execution condition
(trigger) R0 turns on.
DT DT
0 H 3F 0 H 1111 [D]
1 H 5555 [S] 1 H 23A
2
Source [S]: H5555
H 1234 2 H FFFF
Bit position 15 · · 1211 · · 8 7 · · 4 3 · · 0
DT1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1
R0: on “F2 (MV/)” execution
Invert and transfer
Destination [D]: HAAAA
Invert and
DT DT Bit position 15
transfer · · 1211 · · 8 7 · · 4 3 · · 0
0 H 3F 0 H AAAA [D] 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0
DT0
1 H 5555 1 H 23A
[S]
2 H 1234 2 H FFFF
3 - 25
High - level Instructions FP0
Description
The 16-bit data or 16-bit equivalent constant specified by S is inverted and transferred to the 16-bit area
specified by D.
Bit position 15 · · 1211 · · 8 7 · · 4 3 · · 0
Binary data 0 0 0 0 0 1 0 0 1 1 0 1 0 0 1 0
Flag conditions
S Error flag (R9007): Turns on and stays on when the area specified using the index modifier
exceeds the limit.
S Error flag (R9008): Turns on for an instant when the area specified using the index modifier
exceeds the limit.
3 - 26
FP0 High- level Instructions
5 Step Availability
Outline Inverts 32-bit data and transfers it to the specified 32-bit area.
Program example
Boolean
Ladder Diagram
Address Instruction
10 ST R 0
Trigger 11 F 3 (DMV/)
DT 100
R0
10 F3 DMV/ , DT100 , DT 0 DT 0
S D
Operands
Index
Relay Timer/Counter Register Constant Index
Operand register
modifier
WX WY WR SV EV DT IX IY K H
S A A A A A A A N/A A A A
A: Available
D N/A A A A A A A N/A N/A N/A A N/A: Not Available
Explanation of example
The contents of data registers DT101 and DT100 are inverted and transferred to data registers DT1 and DT0
when execution condition (trigger) R0 turns on.
DT DT
99 H 25AC 0 H 1111 [D]
100 H 2 [S] 1 H 34A
101 H FFFF 2 H FFFF
Invert and
DT transfer DT
99 H 25AC 0 H FFFD [D]
100 H 2 [S] 1 H 0
101 H FFFF 2 H FFFF
3 - 27
High - level Instructions FP0
Description
The 32-bit data or 32-bit equivalent constant specified by S is inverted and transferred to the 32-bit area
specified by D.
S 1 1 0 0 1 1 0 1 0 0 0 1 0 1 0 1
S+1 0 0 0 0 0 1 1 1 0 1 0 1 1 0 1 1
D 0 0 1 1 0 0 1 0 1 1 1 0 1 0 1 0
D+1 1 1 1 1 1 0 0 0 1 0 1 0 0 1 0 0
Flag conditions
S Error flag (R9007): Turns on and stays on when the area specified using the index modifier
exceeds the limit.
S Error flag (R9008): Turns on for an instant when the area specified using the index modifier
exceeds the limit.
3 - 28
FP0 High- level Instructions
Outline Copies bit data of one 16-bit area to the specified bit of another 16-bit
area
Program example
Boolean
Ladder Diagram
Address Instruction
Trigger 10 ST R 0
11 F 5 (BTM)
R0 DT 1
10 F5 BTM , DT 1 , H C04 , DT 0
H C04
S n D DT 0
Operands
Index
Relay Timer/Counter Register Constant Index
Operand register
modifier
WX WY WR SV EV DT IX IY K H
S A A A A A A A A A A A
n A A A A A A A A A A A
A: Available
D N/A A A A A A A A N/A N/A A N/A: Not Available
Explanation of example
The data at bit position 4 in data register DT1 is copied to bit position 12 in data register DT0 when execution
condition (trigger) R0 turns on.
Source [S]
Bit position 15 · · 1211 · · 8 7 · · 4 3 · · 0
DT1 1 1 0 0 1 1 0 1 0 0 0 1 0 1 0 1
Destination [D]
Bit position 15 · · 1211 · · 8 7 · · 4 3 · · 0
DT0 0 0 0 0 0 1 0 0 1 1 0 1 0 0 1 0
R0: on “F5 (BTM)”
Destination [D] execution
Bit position 15
· · 1211 · · 8 7 · · 4 3 · · 0
DT0 0 0 0 1 0 1 0 0 1 1 0 1 0 0 1 0
3 - 29
High - level Instructions FP0
Description
A single bit in the 16-bit data or the 16-bit equivalent constant specified by S is copied to a bit of the 16-bit area
specified by D, as specified by n.
How to specify n
The “n” specifies the source and destination bit positions using hexadecimal data as follows:
n:H j 0 j
Flag conditions
S Error flag (R9007): Turns on and stays on when the area specified using the index modifier
exceeds the limit.
S Error flag (R9008): Turns on for an instant when the area specified using the index modifier
exceeds the limit.
3 - 30
FP0 High- level Instructions
Outline Copies hexadecimal digits at one 16-bit area to the specified digit
position in another 16-bit area
Program example
Boolean
Ladder Diagram
Address Instruction
Trigger 10 ST R 0
11 F 6 (DGT)
R0
DT 100
10 F6 DGT , DT 100 , H 0 , DT 0
H 0
S n D DT 0
Operands
Index
Relay Timer/Counter Register Constant Index
Operand register
modifier
WX WY WR SV EV DT IX IY K H
S A A A A A A A A A A A
n A A A A A A A A A A A
A: Available
D N/A A A A A A A A N/A N/A A N/A: Not Available
Explanation of example
Hexadecimal
3 2 1 0
digit position
Bit position 15 · · 1211 · · 8 7 · · 4 3 · · 0
DT100 0 0 0 0 0 0 0 1 0 1 0 0 1 0 0 1
The lower four bits in the data register
DT100 is copied.
Hexadecimal
digit position
3 2 1 0
Bit position 15 · · 1211 · · 8 7 · · 4 3 · · 0
DT0 0 0 0 0 1 0 0 0 1 0 1 0 1 0 0 1
3 - 31
High - level Instructions FP0
Description
The hexadecimal digits in the 16-bit data or in the 16-bit equivalent constant specified by S are copied to the
16-bit area specified by D, as specified by n.
Digits
Digits are units of 4 bits used when handling data.
With this instruction, 16 - bit data is separated into four digits. The digits are called in order hexadecimal digit 0,
digit 1, digit 2 and digit 3, beginning from the least significant four bits
16-bit data
15 · · 1211 · · 8 7 · · 4 3 · · 0
0 0 0 0 0 0 0 1 0 1 0 0 1 0 0 1
Hexadecimal Hexadecimal
digit 3 digit 1
Hexadecimal Hexadecimal
digit 2 digit 0
Flag conditions
S Error flag (R9007): Turns on and stays on when the area specified using the index modifier
exceeds the limit.
S Error flag (R9008): Turns on for an instant when the area specified using the index modifier
exceeds the limit.
How to specify n
The n specifies the 3 source hexadecimal digit position, the 2 number of digits and the 1 destination
hexadecimal digit position to be copied using hexadecimal data as follows:
n:H j j j
If the value for 1 , 2 and 3 is 0, such as “H000” in the example program on the previous page, use the short
form, “H0.”
3 - 32
FP0 High- level Instructions
Specify n: H 1 0 1
D
digit 3 2 1 0
(2) When hexadecimal digit 3 of the source is copied to hexadecimal digit 0 of the destination:
digit 3 2 1 0
S
D
digit 3 2 1 0
(3) When multiple hexadecimal digits (hexadecimal digits 2 and 3) of the source are copied to multiple
hexadecimal digits (hexadecimal digits 2 and 3) of the destination:
digit 3 2 1 0
S
Specify n: H 2 1 2
D
digit 3 2 1 0
(4) When multiple hexadecimal digits (hexadecimal digits 0 and 1) of the source are copied to multiple
hexadecimal digits (hexadecimal digits 2 and 3) of the destination:
digit 3 2 1 0
S
Specify n: H 2 1 0
D
digit 3 2 1 0
(5) When 4 hexadecimal digits (hexadecimal digits 0 to 3) of the source are copied to 4 hexadecimal
digits (hexadecimal digits 0 to 3) of the destination:
digit 3 2 1 0
Specify n: H 1 3 0
D
digit 3 2 1 0
3 - 33
High - level Instructions FP0
Trigger 10 ST R 0
11 F 10 (BKMV)
R0 DT 0
10 F10 BKMV , DT 0 , DT 3 , DT 11
DT 3
S1 S2 D DT 11
Operands
Index
Relay Timer/Counter Register Constant Index
Operand register
modifier
WX WY WR SV EV DT IX IY K H
S1 A A A A A A N/A N/A N/A N/A A
S2 A A A A A A N/A N/A N/A N/A A
A: Available
D N/A A A A A A N/A N/A N/A N/A A N/A: Not Available
Explanation of example
The data of data register “DT0 to DT3” is copied to the data registers “DT11 to DT14” when execution
condition (trigger) R0 turns on.
DT DT
[S1] 0 K 10 10 K 0
1 K 11 11 K 0
Source
2 K 12 12 K 0
[S2] 3 K 13 13 K 0
4 K 14 14 K 0
DT DT
[S1] 0 K 10 10 K 0
1 K 11 11 K 10 [D]
2 K 12 12 K 11
[S2] 3 K 13 13 K 12
4 K 14 14 K 13
3 - 34
FP0 High- level Instructions
Description
The data block specified by S1 and S2 is copied to the block starting from the 16-bit area specified by D.
Flag conditions
S Error flag (R9007): Turns on and stays on when:
- The area specified using the index modifier exceeds the limit.
- S1 > S2
- The data block to be copied exceeds the limit of the destination area.
S Error flag (R9008): Turns on for an instant when:
- The area specified using the index modifier exceeds the limit.
- S1 > S2
- The data block to be copied exceeds the limit of the destination area.
Precautions if the same type of memory area is specified for S1, S2, and D
The instruction is not executed if the address and type of memory area is the same for S1 and D.
If the block being transferred overlaps the transfer destination, the transfer results will be overwritten.
If S1 < D, the source data is copied starting from the higher address to the lower address in order (DT4 → DT3
→ DT2 → DT1).
DT DT
[S1] 0 K 10 0 K 10
1 K 11 1 K 10 [D]
2 K 12 2 K 11
[S2] 3 K 13 3 K 12
4 K 14 4 K 13
If S1 > D, the source data is copied starting from the lower address to the higher address in order (DT0 → DT1
→ DT2).
DT DT
0 K 10 0 K 12 [D]
1 K 11 1 K 13
[S1] 2 K 12 2 K 14
3 K 13 3 K 13
[S2] 4 K 14 4 K 14
3 - 35
High - level Instructions FP0
Outline Copies the specified 16-bit data to a block with one or more 16-bit
areas.
Program example
Boolean
Ladder Diagram
Address Instruction
Trigger 10 ST R 0
11 F 11 (COPY)
R0
DT 1
10 F11 COPY , DT 1 , DT10 , DT14
DT 10
S D1 D2 DT 14
Operands
Index
Relay Timer/Counter Register Constant Index
Operand register
modifier
WX WY WR SV EV DT IX IY K H
S A A A A A A A A A A A
D1 N/A A A A A A N/A N/A N/A N/A A
A: Available
D2 N/A A A A A A N/A N/A N/A N/A A N/A: Not Available
Explanation of example
The contents of data register DT1 are copied to the block ranging from data register DT10 to DT14 when
execution condition (trigger) R0 turns on.
DT DT
0 K 10 10 K 0 [D1]
[S] 1 K 11 11 K 0
2 K 12 12 K 0
3 K 13 13 K 0
4 K 14 14 K 0 [D2]
DT DT
0 K 10 10 K 11 [D1]
[S] 1 K 11 11 K 11
2 K 12 12 K 11
3 K 13 13 K 11
4 K 14 14 K 11 [D2]
3 - 36
FP0 High- level Instructions
Description
The 16-bit equivalent constant or 16-bit area specified by S is copied to all 16-bit areas of the block specified
by D1 and D2.
Precautions during programming
The starting area D1 and ending area D2 should be the same type of operand.
The area of the lower address for the block being copied should be specified by D1, and the higher address
should be specified by D2. If D1 is specified as higher than D2 and the instruction is executed, an operation
error will occur.
When the same number as D1 and D2 is specified, the 16 - bit data will be copied to the 16 - bit area of that
number.
Flag conditions
S Error flag (R9007): Turns on and stays on when:
- The area specified using the index modifier exceeds the limit.
- D1 > D2.
S Error flag (R9008): Turns on for an instant when:
- The area specified using the index modifier exceeds the limit.
- D1 > D2.
3 - 37
High - level Instructions FP0
Trigger 10 ST R 0
11 F 12 (ICRD)
R0
K 0
10 F12 ICRD , K 0 , K10 , DT0
K 10
S1 S2 D DT 0
S1 Constant for specifying the starting address of EEPROM (for source data)
S2 32- bit equivalent constant or lower 16- bit area of 32- bit data for specifying
number of words to be read
D Starting 16- bit area for storing data read from EEPROM (for destination)
Operands
Index
Relay Timer/Counter Register Constant Index
Operand register
modifier
WX WY WR WL SV EV DT LD FL IX IY K H
S1 N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A A N/A N/A
S2 N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A A N/A N/A
D N/A N/A N/A N/A N/A N/A A N/A N/A N/A N/A N/A N/A N/A
A: Available
N/A: Not Available
Explanation of example
10 blocks of data stored in blocks 0 to 9 of the EEPROM are transferred to data registers DT0 to DT639 when
execution condition (trigger) R0 turns on.
EEPROM area Data register DT
[S1] 0 64 words 0 [D]
1 64 words 64
[S2] 2 64 words 128
9 64 words 576
Address
(Block)
3 - 38
FP0 High- level Instructions
Description
S2 blocks of data stored in the EEPROM starting from S1 are transferred into the data register specified by D.
At this time, the transferred data is handled in units of 1 block/64 words.
Precautions during programming
Values that can be specified by S1, S2 and D
Type
yp Memory area
S1 S2 D
FP0 C10, C14, C16 K0 to K9 K1 to K10 DT0 to DT1595
FP0 C32, T32, SL1 K0 to K95 K0 to K96 DT0 to DT6080
Because the initial data in the EEPROM is not fixed, caution is required when reading data that has not been
written to the EEPROM.
Flag conditions
S Error flag (R9007): Turns on and stays on when:
- The address specified by S1 does not exist in the EEPROM area.
- The area specified by S2 exceeds the limit of the EEPROM area.
- The area is exceeded when blocks specified by D and subsequent
parameters are transferred.
S Error flag (R9008): Turns on for an instant when:
- The address specified by S1 does not exist in the EEPROM area.
- The area specified by S2 exceeds the limit of the EEPROM area.
- The area is exceeded when blocks specified by D and subsequent
parameters are transferred.
3 - 39
High - level Instructions FP0
10 ST R 0
Trigger
11 P 13 (PICWT)
R0 DT 0
10 P13 PICWT , DT 0 , K10 , K0
K 10
S1 S2 D K 0
Operands
Index
Relay Timer/Counter Register Constant Index
Operand register
modifier
WX WY WR WL SV EV DT LD FL IX IY K H
S1 N/A N/A N/A N/A N/A N/A A N/A N/A N/A N/A N/A N/A N/A
S2 N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A A N/A N/A
D N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A A N/A N/A
A: Available
N/A: Not Available
Explanation of example
10 blocks (640 words) of data stored in data registers DT0 to DT576 are transferred to blocks 0 to 9 in the
EEPROM area when execution condition (trigger) R0 turns on.
Data register DT EEPROM area
576 64 words 9
Address
(Block)
3 - 40
FP0 High- level Instructions
Description
S2 blocks of data stored in the data register starting from S1 are transferred into the EEPROM area specified
by D. At this time, the transferred data is handled in units of 1 block/64 words.
Precautions during programming
Values that can be specified by S1, S2 and D
Type
yp Memory area
S1 S2 D
FP0 C10, C14, C16 DT0 to DT1595 K1 to K10 K0 to K9
FP0 C32, T32, SL1 DT0 to DT6080 K0 to K96 K0 to K95
3 - 41
High - level Instructions FP0
10 ST R 0
Trigger 11 F 15 (XCH)
DT 0
R0
10 F15 XCH , DT 0 , DT 12 DT 12
D1 D2
Operands
Index
Relay Timer/Counter Register Constant Index
Operand register
modifier
WX WY WR SV EV DT IX IY K H
D1 N/A A A A A A A A N/A N/A A
A: Available
D2 N/A A A A A A A A N/A N/A A N/A: Not Available
Explanation of example
The contents of data register DT0 and data register DT12 are exchanged when execution condition (trigger)
R0 turns on.
DT DT
[D1] 0 K 10 10 K 20
1 K 11 11 K 21
2 K 12 12 K 22 [D2]
3 K 13 13 K 23
4 K 14 14 K 24
DT DT
[D1] 0 K 22 10 K 20
1 K 11 11 K 21
2 K 12 12 K 10 [D2]
3 K 13 13 K 23
4 K 14 14 K 24
3 - 42
FP0 High- level Instructions
Description
The contents in the 16-bit areas specified by D1 and D2 are exchanged.
Flag conditions
S Error flag (R9007): Turns on and stays on when the area specified using the index modifier
exceeds the limit.
S Error flag (R9008): Turns on for an instant when the area specified using the index modifier
exceeds the limit.
3 - 43
High - level Instructions FP0
5 Step Availability
10 ST R 0
Trigger
11 F 16 (DXCH)
R0 DT 0
10 F16 DXCH , DT 0 , DT12 DT 12
D1 D2
Operands
Index
Relay Timer/Counter Register Constant Index
Operand register
modifier
WX WY WR SV EV DT IX IY K H
D1 N/A A A A A A A N/A N/A N/A A
A: Available
D2 N/A A A A A A A N/A N/A N/A A N/A: Not Available
Explanation of example
The contents of data registers DT1 and DT0 and data registers DT13 and DT12 are exchanged when
execution condition (trigger) R0 turns on.
DT DT
[D1] 0 H 2 10 H 1234
1 H FFFD 11 H 5678
2 H 25AC 12 H 9ABC [D2]
3 H F23 13 H DEF1
DT DT
[D1] 0 H 9ABC 10 H 1234
1 H DEF1 11 H 5678
2 H 25AC 12 H 2 [D2]
3 H F23 13 H FFFD
3 - 44
FP0 High- level Instructions
Description
The contents in the 32-bit areas specified by D1 and D2 are exchanged.
Flag conditions
S Error flag (R9007): Turns on and stays on when the area specified using the index modifier
exceeds the limit.
S Error flag (R9008): Turns on for an instant when the area specified using the index modifier
exceeds the limit.
3 - 45
High - level Instructions FP0
5 Step Availability
Higher/lower byte in FP0 C10, C14, C16,
F17(SWAP) 16-bit data exchange
3
C32, T32, SL1
Outline Exchanges higher and lower order bytes of the specified 16-bit data.
Program example
Boolean
Ladder Diagram
Address Instruction
10 ST R 0
Trigger
11 F 17 (SWAP)
DT 0
R0
10 F17 SWAP , DT 0
Operands
Index
Relay Timer/Counter Register Constant Index
Operand register
modifier
WX WY WR EV DT IX IY K H
A: Available
D N/A A A A A A A N/A N/A A N/A: Not Available
Explanation of example
The higher and lower bytes of data register DT0 are exchanged when execution condition (trigger) R0 turns
on.
Bit position 15 · · 1211 · · 8 7 · · 4 3 · · 0
DT0 0 0 0 0 0 1 0 0 1 1 0 1 0 0 1 0
Hexadecimal 0 4 D 2
Description
The higher order byte (higher 8-bit) and lower order byte (lower 8-bit) of the 16-bit area specified by D are
exchanged.
Flag conditions
S Error flag (R9007): Turns on and stays on when the area specified using the index modifier
exceeds the limit.
S Error flag (R9008): Turns on for an instant when the area specified using the index modifier
exceeds the limit.
3 - 46
FP0 High- level Instructions
5 Step Availability
16-bit data addition
F20 (+) [D + S → D]
5 FP0 C10, C14, C16,
C32, T32, SL1
R0 11 F 20 (+ )
10 F20 +, DT 0 , DT 2 DT 0
DT 2
S D
S 16-bit equivalent constant or 16-bit area (for addend)
D 16-bit area (for augend and result)
Operands
Index
Relay Timer/Counter Register Constant Index
Operand register
modifier
WX WY WR SV EV DT IX IY K H
S A A A A A A A A A A A
A: Available
D N/A A A A A A A A N/A N/A A N/A: Not Available
Explanation of example
The contents of data register DT2 and data register DT0 are added together when execution condition
(trigger) R0 turns on.
When the decimal number 4 is in DT0 and the decimal number 8 is in DT2, as shown below.
Augend [D]: K8
Bit position 15 · · 1211 · · 8 7 · · 4 3 · · 0
DT2 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0
Addend [S]: K4 +
Bit position 15 · · 1211 · · 8 7 · · 4 3 · · 0
DT0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0
Description
The 16-bit equivalent constant or 16-bit area specified by S and the 16-bit area specified by D are added
together.
3 - 47
High - level Instructions FP0
Flag conditions
S Error flag (R9007): Turns on and stays on when the area specified using the index modifier
exceeds the limit.
S Error flag (R9008): Turns on for an instant when the area specified using the index modifier
exceeds the limit.
S = flag (R900B): Turns on for an instant when the calculated result is recognized as “0.”
S Carry flag (R9009): Turns on for an instant when the calculated result exceeds the range of 16-bit
data (overflows or underflows).
3 - 48
FP0 High- level Instructions
5 Step Availability
32-bit data addition
F21(D+) [(D+1, D) + (S+1, S) → (D+1, D)] 7 FP0 C10, C14, C16,
C32, T32, SL1
10 ST R 0
Trigger 11 F 21 (D+)
DT 0
R0
10 F21 D+ , DT 0 , DT 2 DT 2
S D
S 32-bit equivalent constant or lower 16-bit area of 32-bit area (for addend)
D Lower 16-bit area of 32-bit data (for augend and result)
Operands
Index
Relay Timer/Counter Register Constant Index
Operand register
modifier
WX WY WR SV EV DT IX IY K H
S A A A A A A A N/A A A A
A: Available
D N/A A A A A A A N/A N/A N/A A N/A: Not Available
Explanation of example
The contents (32 bits) of data registers DT3 and DT2 and the contents (32 bits) of data registers DT1 and DT0
are added together when execution condition (trigger) R0 turns on.
Higher 16 bits Lower 16 bits
Contents Contents
of DT1 of DT0
(Result is stored.)
3 - 49
High - level Instructions FP0
Description
The 32-bit equivalent constant or the 32-bit area specified by S and the 32-bit data specified by D are added
together.
Flag conditions
S Error flag (R9007): Turns on and stays on when the area specified using the index modifier
exceeds the limit.
S Error flag (R9008): Turns on for an instant when the area specified using the index modifier
exceeds the limit.
S = flag (R900B): Turns on for an instant when the calculated result is recognized as “0.”
S Carry flag (R9009): Turns on for an instant when the calculated result exceeds the range of 32-bit
data (overflows or underflows).
3 - 50
FP0 High- level Instructions
Outline Adds two 16-bit data items and stores the result in the specified area.
Program example
Boolean
Ladder Diagram
Address Instruction
Trigger 10 ST R 0
11 F 22 (+ )
R0
DT 0
10 F22+, DT 0 , DT 1 , DT 100
DT 1
S1 S2 D DT 100
Operands
Index
Relay Timer/Counter Register Constant Index
Operand register
modifier
WX WY WR SV EV DT IX IY K H
S1 A A A A A A A A A A A
S2 A A A A A A A A A A A
A: Available
D N/A A A A A A A A N/A N/A A N/A: Not Available
Explanation of example
The contents of data registers DT0 and DT1 are added when execution condition (trigger) R0 turns on. The
added result is stored in data register DT100.
when the decimal number 8 is in DT0 and the decimal number 4 is in DT1, as shown below.
Augend [S1]: K8
Bit position 15 · · 1211 · · 8 7 · · 4 3 · · 0
DT0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0
3 - 51
High - level Instructions FP0
Description
The 16-bit data or 16-bit equivalent constant specified by S1 and S2 are added together. The added result is
stored in D.
Flag conditions
S Error flag (R9007): Turns on and stays on when the area specified using the index modifier
exceeds the limit.
S Error flag (R9008): Turns on for an instant when the area specified using the index modifier
exceeds the limit.
S = flag (R900B): Turns on for an instant when the calculated result is recognized as “0”.
S Carry flag (R9009): Turns on for an instant when the calculated result exceeds the range of 16-bit
data (overflows or underflows).
3 - 52
FP0 High- level Instructions
Outline Adds two 32-bit data items and stores the result in the specified area.
Program example
Boolean
Ladder Diagram
Address Instruction
Trigger 10 ST R 0
11 F 23 (D+)
R0 DT 0
10 F23 D+ , DT 0 , DT 100 , DT 200
DT 100
S1 S2 D DT 200
S1 32-bit equivalent constant or lower 16-bit area of 32-bit data (for augend)
S2 32-bit equivalent constant or lower 16-bit area of 32-bit data (for addend)
D Lower 16-bit area of 32-bit data (for result)
Operands
Index
Relay Timer/Counter Register Constant Index
Operand register
modifier
WX WY WR SV EV DT IX IY K H
S1 A A A A A A A N/A A A A
S2 A A A A A A A N/A A A A
A: Available
D N/A A A A A A A N/A N/A N/A A N/A: Not Available
Explanation of example
The contents of data registers DT1 and DT0 and the contents of data registers DT101 and DT100 are added
when execution condition (trigger) R0 turns on. The added result is stored in data registers DT201 and
DT200.
Higher 16 bits Lower 16 bits
Contents of Contents of
DT101 DT100
(Result is stored.)
3 - 53
High - level Instructions FP0
Description
The 32-bit data or 32-bit equivalent constant specified by S1 and S2 are added together. The added result is
stored in D+1 and D.
When processing 32-bit data, the higher 16-bit areas (S1+1, S2+1, D+1) are automatically determined once
the lower 16-bit areas (S1, S2, D) are specified.
Precautions during programming
If the result of an arithmetic operation instruction does not fall within the range of values which can be
handled, an overflow or underflow will result.
Under normal circumstances, do not allow an overflow or underflow to occur.
If an overflow or underflow occurs, the carry flag (special internal relay R9009) will turn on.
For detailed information section 1.4.2
Flag conditions
S Error flag (R9007): Turns on and stays on when the area specified using the index modifier
exceeds the limit.
S Error flag (R9008): Turns on for an instant when the area specified using the index modifier
exceeds the limit.
S = flag (R900B): Turns on for an instant when the calculated result is recognized as “0”.
S Carry flag (R9009): Turns on for an instant when the calculated result exceeds the range of 32-bit
data (overflows or underflows).
3 - 54
FP0 High- level Instructions
5 Step Availability
16-bit data subtraction
F25 ( - ) [D - S → D] 5 FP0 C10, C14, C16,
C32, T32, SL1
10 ST R 0
Trigger
11 F 25 (- )
R0 DT 0
10 F25 - , DT 0 , DT 2
DT 2
S D
Operands
Index
Relay Timer/Counter Register Constant Index
Operand register
modifier
WX WY WR SV EV DT IX IY K H
S A A A A A A A A A A A
A: Available
D N/A A A A A A A A N/A N/A A N/A: Not Available
Explanation of example
Subtracts the contents of data register DT0 from the contents of data register DT2 when execution condition
(trigger) R0 turns on.
Example 1: When the decimal number 16 is in DT2 and the decimal number
4 is in DT0.
DT2
D: 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 K16
(Subtraction) -
DT0
S: K4
0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0
=
DT2
D: K12
0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0
Example 2: When the decimal number 3 is in DT2 and the decimal number 5
is in DT0.
DT2
D: 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 K3
(Subtraction) -
DT0
S: K5
0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 1
=
D: DT2
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0
K-2
3 - 55
High - level Instructions FP0
Description
Subtracts the 16-bit equivalent constant or 16-bit area specified by S from the 16-bit area specified by D.
Flag conditions
S Error flag (R9007): Turns on and stays on when the area specified using the index modifier
exceeds the limit.
S Error flag (R9008): Turns on for an instant when the area specified using the index modifier
exceeds the limit.
S = flag (R900B): Turns on for an instant when the calculated result is recognized as “0”.
S Carry flag (R9009): Turns on for an instant when the calculated result exceeds the range of 16-bit
data (overflows or underflows).
3 - 56
FP0 High- level Instructions
10 ST R 0
Trigger 11 F 26 (D- )
DT 0
R0
10 F26 D - , DT 0 , DT 2 DT 2
S D
S 32-bit equivalent constant or lower 16-bit area of 32-bit area (for subtrahend)
D Lower 16-bit area of 32-bit data (for minuend and result)
Operands
Index
Relay Timer/Counter Register Constant Index
Operand register
modifier
WX WY WR SV EV DT IX IY K H
S A A A A A A A N/A A A A
A: Available
D N/A A A A A A A N/A N/A N/A A N/A: Not Available
Explanation of example
Subtracts the contents (32 bits) of data registers DT1 and DT0 from the contents (32 bits) of data registers
DT3 and DT2 when execution condition (trigger) R0 turns on.
Higher 16 bits Lower 16 bits
Contents of Contents of
DT1 DT0
(Result is stored.)
3 - 57
High - level Instructions FP0
Description
Subtracts the 32-bit equivalent constant or the 32-bit data specified by S from the 32-bit data specified by D.
Flag conditions
S Error flag (R9007): Turns on and stays on when the area specified using the index modifier
exceeds the limit.
S Error flag (R9008): Turns on for an instant when the area specified using the index modifier
exceeds the limit.
S = flag (R900B): Turns on for an instant when the calculated result is recognized as “0”.
S Carry flag (R9009): Turns on for an instant when the calculated result exceeds the range of 32-bit
data (overflows or underflows).
3 - 58
FP0 High- level Instructions
Outline Subtracts 16-bit data from the minuend and stores the result in the
specified area.
Program example
Boolean
Ladder Diagram
Address Instruction
Trigger 10 ST R 0
11 F 27 (- )
R0
DT 0
10 F27 - , DT 0 , DT 1 , DT 100
DT 1
S1 S2 D DT 100
Operands
Index
Relay Timer/Counter Register Constant Index
Operand register
modifier
WX WY WR SV EV DT IX IY K H
S1 A A A A A A A A A A A
S2 A A A A A A A A A A A
A: Available
D N/A A A A A A A A N/A N/A A N/A: Not Available
Explanation of example
Subtracts the contents of data register DT1 from the contents of data register DT0 when execution condition
(trigger) R0 turns on. The subtracted result is stored in data register DT100.
Example 1: When the decimal nmber 16 is in DT0 and the decimal number 4
is in DT1.
Minuend [S1]: K16
Bit position 15 · · 1211 · · 8 7 · · 4 3 · · 0
DT0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0
Subtrahend [S2]: K4
- (Subtraction)
Bit position 15 · · 1211 · · 8 7 · · 4 3 · · 0
DT1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0
3 - 59
High - level Instructions FP0
Example 2: When the decimal nmber 3 is in DT0 and the decimal number 5
is in DT1.
Minuend [S1]: K3
Bit position 15 · · 1211 · · 8 7 · · 4 3 · · 0
DT0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1
Subtrahend [S2]: K5
- (Subtraction)
Bit position 15 · · 1211 · · 8 7 · · 4 3 · · 0
DT1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 1
Result [D]: K - 2
Bit position 15 · · 1211 · · 8 7 · · 4 3 · · 0
DT100 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0
Description
Subtracts the 16-bit data or 16-bit equivalent constant specified by S2 from the 16-bit data or 16-bit equivalent
constant specified by S1. The subtracted result is stored in D.
Flag conditions
S Error flag (R9007): Turns on and stays on when the area specified using the index modifier
exceeds the limit.
S Error flag (R9008): Turns on for an instant when the area specified using the index modifier
exceeds the limit.
S = flag (R900B): Turns on for an instant when the calculated result is recognized as “0”.
S Carry flag (R9009): Turns on for an instant when the calculated result exceeds the range of 16-bit
data (overflows or underflows).
3 - 60
FP0 High- level Instructions
Outline Subtracts 32-bit data from the minuend and stores the result in the
specified area.
Program example
Boolean
Ladder Diagram
Address Instruction
Trigger 10 ST R 0
11 F 28 (D- )
R0 DT 100
10 F28 D - , DT 100 , DT 200 , DT 0
DT 200
S1 S2 D DT 0
S1 32-bit equivalent constant or lower 16-bit area of 32-bit data (for minuend)
S2 32-bit equivalent constant or lower 16-bit area of 32-bit data
(for subtrahend)
D Lower 16-bit area of 32-bit data (for result)
Operands
Index
Relay Timer/Counter Register Constant Index
Operand register
modifier
WX WY WR SV EV DT IX IY K H
S1 A A A A A A A N/A A A A
S2 A A A A A A A N/A A A A
A: Available
D N/A A A A A A A N/A N/A N/A A N/A: Not Available
Explanation of example
Subtracts the contents of data registers DT201 and DT200 from the contents of data registers DT101 and
DT100 when execution condition (trigger) R0 turns on. The subtracted result is stored in data registers DT1
and DT0.
Higher 16 bits Lower 16 bits
Contents of Contents of
DT201 DT200
(Result is stored.)
3 - 61
High - level Instructions FP0
Description
Subtracts the 32-bit data or 32-bit equivalent constant specified by S2 from the 32-bit data or 32-bit equivalent
constant specified by S1. The subtracted result is stored in D+1 and D.
When processing 32-bit data, the higher 16-bit areas (S1+1, S2+1 D+1) are automatically determined once
the lower 16-bit areas (S1, S2, D) are specified.
Precautions during programming
If the result of an arithmetic operation instruction does not fall within the range of values which can be
handled, an overflow or underflow will result.
Under normal circumstances, do not allow an overflow or underflow to occur.
If an overflow or underflow occurs, the carry flag (special internal relay R9009) will turn on.
For detailed information section 1.4.2
Flag conditions
S Error flag (R9007): Turns on and stays on when the area specified using the index modifier
exceeds the limit.
S Error flag (R9008): Turns on for an instant when the area specified using the index modifier
exceeds the limit.
S = flag (R900B): Turns on for an instant when the calculated result is recognized as “0”.
S Carry flag (R9009): Turns on for an instant when the calculated result exceeds the range of 32-bit
data (overflows or underflows).
3 - 62
FP0 High- level Instructions
Program example
Boolean
Ladder Diagram
Address Instruction
Trigger 10 ST R 0
11 F 30 (*)
R0 DT 0
10 F30 *, DT 0 , DT 10 , DT 100
DT 10
S1 S2 D DT 100
Operands
Index
Relay Timer/Counter Register Constant Index
Operand register
modifier
WX WY WR SV EV DT IX IY K H
S1 A A A A A A A A A A A
S2 A A A A A A A A A A A
A: Available
D N/A A A A A A A N/A N/A N/A A N/A: Not Available
Explanation of example
Multiplies the contents of data register DT0 and DT10 when execution condition (trigger) R0 turns on.
The result is stored in data registers DT101 and DT100.
When the decimal number 8 is in DT0 and the decimal number 2 is in DT10.
Multiplicand [S1]: K8
Bit position 15 · · 1211 · · 8 7 · · 4 3 · · 0
DT0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0
Multiplier [S2]: K2
Bit position 15 · · 1211 · · 8 7 · · 4 3 · · 0
DT10 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0
The lower 16 bits of the 32 - bit multiplication result are stored in the specified memory area (DT100), and the
higher16 bits are stored in the area following the specified area (DT101).
3 - 63
High - level Instructions FP0
Description
Multiplies the 16-bit data or 16-bit equivalent constant specified by S1 and the 16-bit data or 16-bit equivalent
constant specified by S2. The multiplied result is stored in D+1 and D (32-bit area).
Flag conditions
S Error flag (R9007): Turns on and stays on when the area specified using the index modifier
exceeds the limit.
S Error flag (R9008): Turns on for an instant when the area specified using the index modifier
exceeds the limit.
S = flag (R900B): Turns on for an instant when the calculated result is recognized as “0”.
3 - 64
FP0 High- level Instructions
Trigger 10 ST R 0
11 F 31 (D*)
R0 DT 0
10 F31 D* , DT 0 , DT 100 , DT 200
DT 100
S1 S2 D DT 200
S1 32-bit equivalent constant or lower 16-bit area of 32-bit data (for multiplicand)
S2 32-bit equivalent constant or lower 16-bit area of 32-bit data (for multiplier)
D Lower 16-bit area of 64-bit data (for result)
Operands
Index
Relay Timer/Counter Register Constant Index
Operand register
modifier
WX WY WR SV EV DT IX IY K H
S1 A A A A A A A N/A A A A
S2 A A A A A A A N/A A A A
A: Available
D N/A A A A A A N/A N/A N/A N/A A N/A: Not Available
Explanation of example
16 bits 16 bits
The specified data area and the following data
Contents of Contents of area are handled together as 32- bit data.
DT1 DT0
16 bits 16 bits
Contents of Contents of
DT101 DT100
16 bits 16 bits 16 bits 16 bits
← The 64 bits of multiplication result are stored in
order in DT200 to DT203 beginning from the
Store to Store to Store to Store to lowest 16 bits.
DT203 DT202 DT201 DT200
3 - 65
High - level Instructions FP0
Description
Multiplies the 32-bit data or 32-bit equivalent constant specified by S1 and the one specified by S2.
The multiplied result is stored in D+3, D+2, D+1 and D.
Flag conditions
S Error flag (R9007): Turns on and stays on when the area specified using the index modifier
exceeds the limit.
S Error flag (R9008): Turns on for an instant when the area specified using the index modifier
exceeds the limit.
S = flag (R900B): Turns on for an instant when the calculated result is recognized as “0”.
3 - 66
FP0 High- level Instructions
Trigger 10 ST R 0
11 F 32 (% )
R0 DT 100
10 F32 % , DT 100 , DT10 , DT 0
DT 10
S1 S2 D DT 0
Operands
Index
Relay Timer/Counter Register Constant Index
Operand register
modifier
WX WY WR SV EV DT IX IY K H
S1 A A A A A A A A A A A
S2 A A A A A A A A A A A
A: Available
D N/A A A A A A A A N/A N/A A N/A: Not Available
Explanation of example
Divides the contents of data register DT100 by decimal constant DT10 when execution condition (trigger) R0
turns on. The quotient is stored in data register DT0 and the remainder is stored in special data register
DT9015.
When the decimal number 15 is in DT100 and the decimal number 4 is in DT10, as shown below.
Dividend [S1]: K15
Bit position 15 · · 1211 · · 8 7 · · 4 3 · · 0
DT100 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1
Divisor [S2]: K4
Bit position 15 · · 1211 · · 8 7 · · 4 3 · · 0
DT10 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0
3 - 67
High - level Instructions FP0
Description
The 16-bit data or 16-bit equivalent constant specified by S1 is divided by the 16-bit data or 16-bit equivalent
constant specified by S2.
The quotient is stored in D and the remainder is stored in the special data register DT9015.
Dividend data Divisor Quotient Remainder
(S1) ÷ (S2) (D) .... (DT9015)
3 - 68
FP0 High- level Instructions
Trigger 10 ST R 0
11 F 33 (D%)
R0 DT 200
10 F33 D% , DT 200 , DT 100 , DT 0
DT 100
S1 S2 D DT 0
S1 32-bit equivalent constant or lower 16-bit area of 32-bit data (for dividend)
S2 32-bit equivalent constant or lower 16-bit area of 32-bit data (for divisor)
D Lower 16-bit area of 32-bit data (for quotient) (Remainder is stored in
special data registers DT9016 and DT9015.)
Operands
Index
Relay Timer/Counter Register Constant Index
Operand register
modifier
WX WY WR SV EV DT IX IY K H
S1 A A A A A A A N/A A A A
S2 A A A A A A A N/A A A A
A: Available
D N/A A A A A A A N/A N/A N/A A N/A: Not Available
Explanation of example
Higher 16 bits Lower 16 bits
Contents of Contents of
DT101 DT100
To DT1 To DT0
← The lower 16 bits of the remainder is stored in DT9015 and the higher
16 bits of the remainder is stored in DT9016.
To DT9016 To DT9015
3 - 69
High - level Instructions FP0
Description
The 32-bit data or 32-bit equivalent constant specified by S1 is divided by the 32-bit data or 32-bit equivalent
constant specified by S2. The quotient is stored in D+1 and D and the remainder is stored in the special data
registers DT9016 and DT9015.
Dividend data Divisor Quotient Remainder
S1: lower 16-bit S2: lower 16-bit D: lower 16-bit DT9015
÷
S1+1: higher 16-bit S2+1: higher 16-bit D+1: higher 16-bit DT9016
When processing 32-bit data, the higher 16-bit areas (S1+1, S2+1, D+1) are automatically determined once
the lower 16-bit areas (S1, S2, D) are specified.
3 - 70
FP0 High- level Instructions
10 ST R 0
Trigger 11 F 35 (+1)
DT 0
R0
10 F35 +1 , DT 0
Operands
Index
Relay Timer/Counter Register Constant Index
Operand register
modifier
WX WY WR SV EV DT IX IY K H
A: Available
D N/A A A A A A A A N/A N/A A N/A: Not Available
Explanation of example
Adds 1 to the contents of data register DT0 when execution condition (trigger) R0 turns on.
Original data [D]: K9
Bit position 15 · · 1211 · · 8 7 · · 4 3 · · 0
DT0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 1
+1
Result [D]: K10
Bit position 15 · · 1211 · · 8 7 · · 4 3 · · 0
DT0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 1 0
Description
Adds 1 to the 16-bit data specified by D. The result is stored in D.
Original data Result
(D) + 1 (D)
3 - 71
High - level Instructions FP0
Flag conditions
S Error flag (R9007): Turns on and stays on when the area specified using the index modifier
exceeds the limit.
S Error flag (R9008): Turns on for an instant when the area specified using the index modifier
exceeds the limit.
S = flag (R900B): Turns on for an instant when the calculated result is recognized as “0”.
S Carry flag (R9009): Turns on for an instant when the calculated result exceeds the range of 16-bit
data (overflows).
3 - 72
FP0 High- level Instructions
10 ST R 0
Trigger 11 F 36 (D+1)
DT 0
R0
10 F36 D+1 , DT 0
D
D Lower 16-bit area of 32-bit data to be increased by 1
Operands
Index
Relay Timer/Counter Register Constant Index
Operand register
modifier
WX WY WR SV EV DT IX IY K H
A: Available
D N/A A A A A A A N/A N/A N/A A N/A: Not Available
Explanation of example
Adds 1 to the content of data registers DT1 and DT0 when execution condition (trigger) R0 turns on.
Higher 16 bits Lower 16 bits
The specified data area and the
following data area are handled
Contents of Contents of together as 32- bit data.
DT1 DT0
+1
Description
Adds 1 to the 32-bit data specified by D. The result is stored in D+1 and D.
Original data Result
(D+1, D) + 1 (D+1, D)
3 - 73
High - level Instructions FP0
Flag conditions
S Error flag (R9007): Turns on and stays on when the area specified using the index modifier
exceeds the limit.
S Error flag (R9008): Turns on for an instant when the area specified using the index modifier
exceeds the limit.
S = flag (R900B): Turns on for an instant when the calculated result is recognized as “0”.
S Carry flag (R9009): Turns on for an instant when the calculated result exceeds the range of 32-bit
data (overflows).
3 - 74
FP0 High- level Instructions
10 ST R 0
Trigger
11 F 37 (- 1 )
R0 DT 0
10 F37 - 1 , DT 0
Operands
Index
Relay Timer/Counter Register Constant Index
Operand register
modifier
WX WY WR SV EV DT IX IY K H
A: Available
D N/A A A A A A A A N/A N/A A N/A: Not Available
Explanation of example
Subtracts 1 from the contents of data register DT0 when execution condition (trigger) R0 turns on.
Original data [D]: K10
Bit position 15 · · 1211 · · 8 7 · · 4 3 · · 0
DT0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 1 0
-1
Result [D]: K9
Bit position 15 · · 1211 · · 8 7 · · 4 3 · · 0
DT0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 1
Description
Subtracts 1 from the 16-bit data specified by D. The result is stored in D.
Original data Result
(D) - 1 (D)
3 - 75
High - level Instructions FP0
Flag conditions
S Error flag (R9007): Turns on and stays on when the area specified using the index modifier
exceeds the limit.
S Error flag (R9008): Turns on for an instant when the area specified using the index modifier
exceeds the limit.
S = flag (R900B): Turns on for an instant when the calculated result is recognized as “0”.
S Carry flag (R9009): Turns on for an instant when the calculated result exceeds the range of 16-bit
data (underflows).
3 - 76
FP0 High- level Instructions
10 ST R 0
Trigger
11 F 38 (D- 1)
R0 DT 0
10 F38 D - 1 , DT 0
Operands
Index
Relay Timer/Counter Register Constant Index
Operand register
modifier
WX WY WR SV EV DT IX IY K H
A: Available
D N/A A A A A A A N/A N/A N/A A N/A: Not Available
Explanation of example
Subtracts 1 from the content of data registers DT1 and DT0 when execution condition (trigger) R0 turns on.
Higher 16 bits Lower 16 bits
The specified data area and the
following data area are handled
together as 32- bit data.
Contents of Contents of
DT1 DT0
-1
Description
Subtracts 1 from the 32-bit data specified by D. The result is stored in D+1 and D.
Original data Result
(D+1, D) - 1 (D+1, D)
3 - 77
High - level Instructions FP0
Flag conditions
S Error flag (R9007): Turns on and stays on when the area specified using the index modifier
exceeds the limit.
S Error flag (R9008): Turns on for an instant when the area specified using the index modifier
exceeds the limit.
S = flag (R900B): Turns on for an instant when the calculated result is recognized as “0”.
S Carry flag (R9009): Turns on for an instant when the calculated result exceeds the range of 32-bit
data (underflows).
3 - 78
FP0 High- level Instructions
5 Step Availability
4-digit BCD data addition
F40 (B+) [D + S → D]
5 FP0 C10, C14, C16,
C32, T32, SL1
Outline Adds two BCD data items that express 4-digit decimal numbers (4-digit
BCD H codes).
Program example
Boolean
Ladder Diagram
Address Instruction
10 ST R 0
Trigger 11 F 40 (B+ )
DT 0
R0
10 F40 B+, DT 0 , DT 2 DT 2
S D
S 4-digit BCD equivalent constant or 16-bit area for 4-digit BCD data (for addend)
D 16-bit area for 4-digit BCD data (for augend and result)
Operands
Index
Relay Timer/Counter Register Constant Index
Operand register
modifier
WX WY WR SV EV DT IX IY K H
S A A A A A A A A A A A
A: Available
D N/A A A A A A A A N/A N/A A N/A: Not Available
Explanation of example
The contents of data register DT2 and data register DT0 are added together when execution condition
(trigger) R0 turns on.
When H4 (BCD)is in DT0 and H8 (BCD) is in DT2, as shown below.
Augend [D]: H8 (BCD)
Bit position 15 · · 1211 · · 8 7 · · 4 3 · · 0
DT2 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0
BCD H code 0 0 0 8
3 - 79
High - level Instructions FP0
Description
The 4-digit BCD equivalent constant or 16-bit area for 4-digit BCD data specified by S and the 16-bit area for
4-digit BCD data specified by D are added together.
Flag conditions
S Error flag (R9007): Turns on and stays on when:
- The area specified using the index modifier exceeds the limit.
- The data is not BCD data.
S Error flag (R9008): Turns on for an instant when:
- The area specified using the index modifier exceeds the limit.
- The data is not BCD data.
S = flag (R900B): Turns on for an instant when the calculated result is recognized as “0”.
S Carry flag (R9009): Turns on for an instant when the calculated result exceeds the range of 4-digit
BCD data (overflows).
3 - 80
FP0 High- level Instructions
5 Step Availability
8-digit BCD data Addition
F41(DB+) [(D+1, D) + (S+1, S) → (D+1, D)] 7 FP0 C10, C14, C16,
C32, T32, SL1
Outline Adds two BCD data items that express 8-digit decimal numbers (8-digit
BCD H codes).
Program example
Boolean
Ladder Diagram
Address Instruction
10 ST R 0
Trigger 11 F 41 (DB+)
DT 0
R0
10 F41 DB+ , DT 0 , DT 2 DT 2
S D
S 8-digit BCD equivalent constant or lower 16-bit area for 8-digit BCD data (for
addend)
D Lower 16-bit area for 8-digit BCD data (for augend and result)
Operands
Index
Relay Timer/Counter Register Constant Index
Operand register
modifier
WX WY WR SV EV DT IX IY K H
S A A A A A A A N/A A A A
A: Available
D N/A A A A A A A N/A N/A N/A A N/A: Not Available
Explanation of example
The contents of data registers DT3 and DT2 and the contents of data registers DT1 and DT0 are added
together when execution condition (trigger) R0 turns on.
Higher 16 bits Lower 16 bits
Contents Contents
of DT1 of DT0
(Result is stored.)
3 - 81
High - level Instructions FP0
Description
The 8-digit BCD equivalent constant or 8-digit BCD data specified by S and the 8-digit BCD data specified by
D are added together.
Augend data Addend data Result
D: lower 4-digit S: lower 4-digit D: lower 4-digit
+
D+1: higher 4-digit S+1: higher 4-digit D+1: higher 4-digit
Flag conditions
S Error flag (R9007): Turns on and stays on when:
- The area specified using the index modifier exceeds the limit.
- The data is not BCD data.
S Error flag (R9008): Turns on for an instant when:
- The area specified using the index modifier exceeds the limit.
- The data is not BCD data.
S = flag (R900B): Turns on for an instant when the calculated result is recognized as “0”.
S Carry flag (R9009): Turns on for an instant when the calculated result exceeds the range of 8-digit
BCD data (overflows).
3 - 82
FP0 High- level Instructions
Outline Adds two BCD data items that express 4-digit decimal numbers (4-digit
BCD H codes) and stores the result in the specified area.
Program example
Boolean
Ladder Diagram
Address Instruction
Trigger 10 ST R 0
11 F 42 (B+)
R0 DT 0
10 F42 B+, DT 0 , DT 1 , DT100
DT 1
S1 S2 D DT 100
4-digit BCD equivalent constant or 16-bit area for 4-digit BCD data
S1
(for augend)
4-digit BCD equivalent constant or 16-bit area for 4-digit BCD data
S2
(for addend)
D 16-bit area for 4-digit BCD data (for result)
Operands
Index
Relay Timer/Counter Register Constant Index
Operand register
modifier
WX WY WR SV EV DT IX IY K H
S1 A A A A A A A A A A A
S2 A A A A A A A A A A A
A: Available
D N/A A A A A A A A N/A N/A A N/A: Not Available
Explanation of example
The contents of data register DT0 and data register DT1 are added together when execution condition
(trigger) R0 turns on. The added result is stored in data register DT100.
When H (BCD) 8 is in DT0 and H (BCD) 4 is in DT1, as shown below.
Augend [S1]: H8 (BCD)
Bit position 15 · · 1211 · · 8 7 · · 4 3 · · 0
DT0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0
BCD H code 0 0 0 8
3 - 83
High - level Instructions FP0
Description
The 4-digit BCD equivalent constants or 16-bit areas for 4-digit BCD data specified by S1 and S2 are added
together. The added result is stored in D.
Flag conditions
S Error flag (R9007): Turns on and stays on when:
- The area specified using the index modifier exceeds the limit.
- The data is not BCD data.
S Error flag (R9008): Turns on for an instant when:
- The area specified using the index modifier exceeds the limit.
- The data is not BCD data.
S = flag (R900B): Turns on for an instant when the calculated result is recognized as “0”.
S Carry flag (R9009): Turns on for an instant when the calculated result exceeds the range of 4-digit
BCD data (overflows).
3 - 84
FP0 High- level Instructions
Outline Adds two BCD data items that express 8-digit decimal numbers
(8-digit BCD H codes) and stores the result in the specified area.
Program example
Boolean
Ladder Diagram
Address Instruction
Trigger 10 ST R 0
11 F 43 (DB+)
R0
10 F43 DB+ , DT 0 , DT 2 , DT100 DT 0
DT 2
DT 100
S1 S2 D
S1 8-digit BCD equivalent constant or lower 16-bit area for 8-digit BCD data (for
augend)
S2 8-digit BCD equivalent constant or lower 16-bit area for 8-digit BCD data (for
addend)
D Lower 16-bit area for 8-digit BCD data (for result)
Operands
Index
Relay Timer/Counter Register Constant Index
Operand register
modifier
WX WY WR SV EV DT IX IY K H
S1 A A A A A A A N/A A A A
S2 A A A A A A A N/A A A A
A: Available
D N/A A A A A A A N/A N/A N/A A N/A: Not Available
Explanation of example
The contents of data registers DT1 and DT0 and the contents of data registers DT3 and DT2 are added
together when execution condition (trigger) R0 turns on. The added result is stored in data registers DT101
and DT100.
Higher 16 bits Lower 16 bits
Contents of Contents of
DT3 DT2
(Result is stored.)
3 - 85
High - level Instructions FP0
Description
The 8-digit BCD equivalent constants or 8-digit BCD data specified by S1 and S2 are added together. The
added result is stored in D+1 and D.
Augend data Addend data Result
S1: lower 4-digit + S2: lower 4-digit
D: lower 4-digit
S1+1: higher 4-digit S2+1: higher 4-digit D+1: higher 4-digit
When processing 8-digit BCD data, the higher 16-bit areas for 8-digit BCD data (S+1, D+1) are automatically
determined once the lower 16-bit areas (S, D) are specified.
Precautions during programming
If the result of an arithmetic operation instruction does not fall within the range of values which can be
handled, an overflow will result.
Under normal circumstances, do not allow an overflow to occur.
If an overflow occurs, the carry flag (special internal relay R9009) will turn on.
For detailed information section 1.4.2
Flag conditions
S Error flag (R9007): Turns on and stays on when:
- The area specified using the index modifier exceeds the limit.
- The data is not BCD data.
S Error flag (R9008): Turns on for an instant when:
- The area specified using the index modifier exceeds the limit.
- The data is not BCD data.
S = flag (R900B): Turns on for an instant when the calculated result is recognized as “0”.
S Carry flag (R9009): Turns on for an instant when the calculated result exceeds the range of 8-digit
BCD data (overflows).
3 - 86
FP0 High- level Instructions
Outline Subtracts one BCD data item that expresses a 4-digit decimal number
(4-digit BCD H codes) from another (minuend).
Program example
Boolean
Ladder Diagram
Address Instruction
Trigger 10 ST R 0
11 F 45 (B - )
R0
10 F45 B - , DT 0 , DT 2 DT 0
DT 2
S D
S 4-digit BCD equivalent constant or 16-bit area for 4-digit BCD data (for subtrahend)
D 16-bit area for 4-digit BCD data (for minuend and result)
Operands
Index
Relay Timer/Counter Register Constant Index
Operand register
modifier
WX WY WR SV EV DT IX IY K H
S A A A A A A A A A A A
A: Available
D N/A A A A A A A A N/A N/A A N/A: Not Available
Explanation of example
Subtracts the contents of data register DT0 from the contents of data register DT2 when execution condition
(trigger) R0 turns on.
When H (BCD) 16 is in DT2 and H (BCD) 4 is in DT0, as shown below.
Minuend [D]: H16 (BCD)
Bit position 15 · · 1211 · · 8 7 · · 4 3 · · 0
DT2 0 0 0 0 0 0 0 0 0 0 0 1 0 1 1 0
BCD H code 0 0 1 6
Description
Subtracts the 4-digit BCD equivalent constant or 16-bit area for 4-digit BCD data specified by S from the 16-bit
area for 4-digit BCD data specified by D.
3 - 87
High - level Instructions FP0
Flag conditions
S Error flag (R9007): Turns on and stays on when:
- The area specified using the index modifier exceeds the limit.
- The data is not BCD data.
S Error flag (R9008): Turns on for an instant when:
- The area specified using the index modifier exceeds the limit.
- The data is not BCD data.
S = flag (R900B): Turns on for an instant when the calculated result is recognized as “0”.
S Carry flag (R9009): Turns on for an instant when the calculated result exceeds the range of 4-digit
BCD data (underflow).
3 - 88
FP0 High- level Instructions
Outline Subtracts one BCD data item that expresses an 8-digit decimal number
(8-digit BCD H code) from another (minuend).
Program example
Boolean
Ladder Diagram
Address Instruction
10 ST R 0
Trigger 11 F 46 (DB- )
DT 0
R0
10 F46 DB - , DT 0 , DT 2 DT 2
S D
S 8-digit BCD equivalent constant or lower 16-bit area for 8-digit BCD data (for
subtrahend)
D Lower 16-bit area for 8-digit BCD data (for minuend and result)
Operands
Index
Relay Timer/Counter Register Constant Index
Operand register
modifier
WX WY WR SV EV DT IX IY K H
S A A A A A A A N/A A A A
A: Available
D N/A A A A A A A N/A N/A N/A A N/A: Not Available
Explanation of example
Subtracts the contents of data registers DT1 and DT0 from the contents of data registers DT3 and DT2 when
execution condition (trigger) R0 turns on.
Higher 16 bits Lower 16 bits
Contents of Contents of
DT1 DT0
(Result is stored.)
3 - 89
High - level Instructions FP0
Description
Subtracts the 8-digit BCD equivalent constant or 8-digit BCD data specified by S from the 8-digit BCD data
specified by D.
Augend data Addend data Result
D: lower 4-digit S: lower 4-digit D: lower 4-digit
-
D+1: higher 4-digit S+1: higher 4-digit D+1: higher 4-digit
Flag conditions
S Error flag (R9007): Turns on and stays on when:
- The area specified using the index modifier exceeds the limit.
- The data is not BCD data.
S Error flag (R9008): Turns on for an instant when:
- The area specified using the index modifier exceeds the limit.
- The data is not BCD data.
S = flag (R900B): Turns on for an instant when the calculated result is recognized as “0”.
S Carry flag (R9009): Turns on for an instant when the calculated result exceeds the range of 8-digit
BCD data (underflows).
3 - 90
FP0 High- level Instructions
5 Step Availability
4-digit BCD data Subtraction FP0 C10, C14, C16,
F47 (B - ) [S1 - S2 → D]
7
C32, T32, SL1
Outline Subtracts one BCD data item that expresses a 4-digit decimal number
(4-digit BCD H code) from another (minuend) and stores the result in
the specified area.
Program example
Boolean
Ladder Diagram
Address Instruction
Trigger 10 ST R 0
11 F 47 (B - )
R0
DT 0
10 F47 B - , DT 0 , DT 2 , DT100
DT 2
S1 S2 D DT 100
S1 4-digit BCD equivalent constant or 16-bit area for 4-digit BCD data (for minuend)
S2 4-digit BCD equivalent constant or 16-bit area for 4-digit BCD data (for subtrahend)
D 16-bit area for 4-digit BCD data (for result)
Operands
Index
Relay Timer/Counter Register Constant Index
Operand register
modifier
WX WY WR SV EV DT IX IY K H
S1 A A A A A A A A A A A
S2 A A A A A A A A A A A
A: Available
D N/A A A A A A A A N/A N/A A N/A: Not Available
Explanation of example
Subtracts the contents of data register DT2 from the contents of data register DT0 when execution condition
(trigger) R0 turns on. The subtracted result is stored in data register DT100.
When H (BCD) 16 is in DT0 and H (BCD) 4 is in DT2, as shown below.
Minuend [S1]: H16 (BCD)
Bit position 15 · · 1211 · · 8 7 · · 4 3 · · 0
DT0 0 0 0 0 0 0 0 0 0 0 0 1 0 1 1 0
BCD H code 0 0 1 6
3 - 91
High - level Instructions FP0
Description
Subtracts the 4-digit BCD equivalent constant or 16-bit area for 4-digit BCD data specified by S2 from the
4-digit BCD equivalent constant or 16-bit area for 4-digit BCD data specified by S1.
The subtracted result is stored in D.
Flag conditions
S Error flag (R9007): Turns on and stays on when:
- The area specified using the index modifier exceeds the limit.
- The data is not BCD data.
S Error flag (R9008): Turns on for an instant when:
- The area specified using the index modifier exceeds the limit.
- The data is not BCD data.
S = flag (R900B): Turns on for an instant when the calculated result is recognized as “0”.
S Carry flag (R9009): Turns on for an instant when the calculated result exceeds the range of 4-digit
BCD data (underflows).
3 - 92
FP0 High- level Instructions
Outline Subtracts one BCD data item that expresses an 8-digit decimal number
(8-digit BCD H code) from another (minuend) and stores the result in
the specified area.
Program example
Boolean
Ladder Diagram
Address Instruction
Trigger 10 ST R 0
11 F 48 (DB- )
R0
DT 0
10 F48 DB - , DT 0 , DT 2 , DT100
DT 2
S1 S2 D DT 100
S1 8-digit BCD equivalent constant or lower 16-bit area for 8-digit BCD data (for
minuend)
S2 8-digit BCD equivalent constant or lower 16-bit area for 8-digit BCD data (for
subtrahend)
D Lower 16-bit area for 8-digit BCD data (for result)
Operands
Index
Relay Timer/Counter Register Constant Index
Operand register
modifier
WX WY WR SV EV DT IX IY K H
S1 A A A A A A A N/A A A A
S2 A A A A A A A N/A A A A
A: Available
D N/A A A A A A A N/A N/A N/A A N/A: Not Available
Explanation of example
Subtracts the contents of data registers DT3 and DT2 from the contents of data registers DT1 and DT0 when
execution condition (trigger) R0 turns on. The subtracted result is stored in data registers DT101 and DT100.
Higher 16 bits Lower 16 bits
Contents of Contents of
DT3 DT2
(Result is stored.)
3 - 93
High - level Instructions FP0
Description
Subtracts the 8-digit BCD equivalent constant or 8-digit BCD data specified by S2 from the 8-digit BCD
equivalent constant or the 8-digit BCD data specified by S1. The subtracted result is stored in D+1 and D.
Minuend data Subtrahend data Result
S1: lower 4-digit S2: lower 4-digit D: lower 4-digit
-
S1+1: higher 4-digit S2+1: higher 4-digit D+1: higher 4-digit
When processing 8-digit BCD data, the higher 16-bit areas for 8-digit BCD data (S+1, D+1) are automatically
determined once the lower 16-bit areas (S, D) are specified.
Flag conditions
S Error flag (R9007): Turns on and stays on when:
- The area specified using the index modifier exceeds the limit.
- The data is not BCD data.
S Error flag (R9008): Turns on for an instant when:
- The area specified using the index modifier exceeds the limit.
- The data is not BCD data.
S = flag (R900B): Turns on for an instant when the calculated result is recognized as “0”.
S Carry flag (R9009): Turns on for an instant when the calculated result exceeds the range of 8-digit
BCD data (underflows).
3 - 94
FP0 High- level Instructions
Outline Multiplies two BCD data items that express 4-digit decimal numbers
(4-digit BCD H codes).
Program example
Boolean
Ladder Diagram
Address Instruction
Trigger 10 ST R 0
11 F 50 (B*)
R0
DT 0
10 F50 B*, DT 0 , DT 2, DT 100
DT 2
DT 100
S1 S2 D
S1 4-digit BCD equivalent constant or 16-bit area for BCD data (for multiplicand)
S2 4-digit BCD equivalent constant or 16-bit area for BCD data (for multiplier)
D Lower 16-bit area for 8-digit BCD data (for result)
Operands
Index
Relay Timer/Counter Register Constant Index
Operand register
modifier
WX WY WR SV EV DT IX IY K H
S1 A A A A A A A A A A A
S2 A A A A A A A A A A A
A: Available
D N/A A A A A A A N/A N/A N/A A N/A: Not Available
Explanation of example
When H (BCD) 8 is in DT0 and H (BCD) 2 is in DT2, as shown below.
R0: on
Result [D+1, D]: H16 (BCD)
Bit position 15 · · 1211 · · 8 7 · · 4 3 · · 0 Bit position 15 · · 1211 · · 8 7 · · 4 3 · · 0
DT101 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 DT100 0 0 0 0 0 0 0 0 0 0 0 1 0 1 1 0
BCD H code 0 0 0 0 BCD H code 0 0 1 6
3 - 95
High - level Instructions FP0
Description
Multiplies the 4-digit BCD equivalent constant or 16-bit area for 4-digit BCD data specified by S1 and S2. The
multiplied result is stored in D+1 and D.
Multiplicand data Multiplier data Multiplied result
(S1) × (S2) (D+1, D)
The multiplied result is stored in the 8-digit area (32 - bit area).
The higher 16-bit area (D+1) is automatically determined once the lower 16-bit area (D) is specified.
Flag conditions
S Error flag (R9007): Turns on and stays on when:
- The area specified using the index modifier exceeds the limit.
- The data is not BCD data.
S Error flag (R9008): Turns on for an instant when:
- The area specified using the index modifier exceeds the limit.
- The data is not BCD data.
S = flag (R900B): Turns on for an instant when the calculated result is recognized as “0”.
3 - 96
FP0 High- level Instructions
Outline Multiplies two BCD data items that express 8-digit decimal numbers
(8-digit BCD H codes).
Program example
Boolean
Ladder Diagram
Address Instruction
Trigger 10 ST R 0
11 F 51 (DB*)
R0
DT 0
10 F51 DB* , DT 0 , DT 2 , DT 100
DT 2
DT 100
S1 S2 D
S1 8-digit BCD equivalent constant or lower 16-bit area for 8-digit BCD data (for
multiplicand)
S2 8-digit BCD equivalent constant or lower 16-bit area for 8-digit BCD data (for
multiplier)
D Lowest 16-bit area for 16-digit BCD data (for result)
Operands
Index
Relay Timer/Counter Register Constant Index
Operand register
modifier
WX WY WR SV EV DT IX IY K H
S1 A A A A A A A N/A A A A
S2 A A A A A A A N/A A A A
A: Available
D N/A A A A A A N/A N/A N/A N/A A N/A: Not Available
Explanation of example
16 bits 16 bits
The specified data area and the following data
Contents of Contents of area are handled together as 32- bit data.
DT1 DT0
16 bits 16 bits
Contents of Contents of
DT3 DT2
16 bits 16 bits 16 bits 16 bits
← The 64 bits of multiplication result are stored in
order in DT100 to DT103 beginning from the
Store to Store to Store to Store to lowest 16 bits.
DT103 DT102 DT101 DT100
3 - 97
High - level Instructions FP0
Description
Multiplies the 8-digit BCD equivalent constant or 8-digit BCD data specified by S1 and the one specified by
S2. The multiplied result is stored in D+3, D+2, D+1, and D.
The multiplied result is stored in the 64-bit area (16 - digit BCD).
When processing 8-digit BCD data, the higher 16-bit areas (S1+1, S2+1) are automatically determined once
the lower 16-bit areas (S1, S2) are specified.The areas (D+3, D+2, D+1) other than the lowest 16-bit area (D)
are automatically determined when the lowest 16-bit area is specified.
Flag conditions
S Error flag (R9007): Turns on and stays on when:
- The area specified using the index modifier exceeds the limit.
- The data is not BCD data.
S Error flag (R9008): Turns on for an instant when:
- The area specified using the index modifier exceeds the limit.
- The data is not BCD data.
S = flag (R900B): Turns on for an instant when the calculated result is recognized as “0”.
3 - 98
FP0 High- level Instructions
Outline Divides one BCD data item that expresses a 4-digit decimal number
(4-digit BCD H code) by another (divisor).
Program example
Boolean
Ladder Diagram
Address Instruction
Trigger 10 ST R 0
11 F 52 (B%)
R0 DT 0
10 F52 B% , DT 0 , DT 2 , DT 100
DT 2
DT 100
S1 S2 D
S1 4-digit BCD equivalent constant or 16-bit area for BCD data (for dividend)
S2 4-digit BCD equivalent constant or 16-bit area for BCD data (for divisor)
D 16-bit area for BCD data (for quotient)
(Remainder is stored in special data register DT9015.)
Operands
Index
Relay Timer/Counter Register Constant Index
Operand register
modifier
WX WY WR SV EV DT IX IY K H
S1 A A A A A A A A A A A
S2 A A A A A A A A A A A
A: Available
D N/A A A A A A A A N/A N/A A N/A: Not Available
3 - 99
High - level Instructions FP0
Explanation of example
Divides the contents of data register DT0 by the contents of data register DT2 when execution condition
(trigger) R0 turns on. The quotient is stored in data register DT100 and the remainder is stored in special data
register DT9015.
When H (BCD) 15 is in DT0 and H (BCD) 4 is in DT2, as shown below.
Dividiend [S1]: H15 (BCD)
Bit position 15 · · 12 11 · · 8 7 · · 4 3 · · 0
DT0 0 0 0 0 0 0 0 0 0 0 0 1 0 1 0 1
BCD H code 0 0 1 5
R0: on
Quotient [D]: H3 (BCD)
Bit position 15 · · 12 11 · · 8 7 · · 4 3 · · 0
DT100 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1
BCD H code 0 0 0 3
Remainder: H3 (BCD)
Bit position 15 · · 12 11 · · 8 7 · · 4 3 · · 0
DT9015 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1
BCD H code 0 0 0 3
Description
The 4-digit BCD equivalent constant or the 16-bit area for 4-digit BCD data specified by S1 is divided by the
4-digit BCD equivalent constant or the 16-bit area for 4-digit BCD data specified by S2. The quotient is stored
in the area specified by D and the remainder is stored in a special data register DT9015.
Dividend data Divisor Quotient Remainder
(S1) ÷ (S2) (D)
....
(DT9015)
Flag conditions
S Error flag (R9007): Turns on and stays on when:
- The area specified using the index modifier exceeds the limit.
- The data is not BCD data.
- The 4-digit BCD equivalent constant or 4-digit BCD data for the divisor
(specified by S2) is 0.
S Error flag (R9008): Turns on for an instant when:
- The area specified using the index modifier exceeds the limit.
- The data is not BCD data.
- The 4-digit BCD equivalent constant or 4-digit BCD data for the divisor
(specified by S2) is 0.
S = flag (R900B): Turns on for an instant when the calculated result (quotient) is recognized as
“0”.
3 - 100
FP0 High- level Instructions
Outline Divides one BCD data item that expresses an 8-digit decimal number
(8-digit BCD H code) by another (divisor).
Program example
Boolean
Ladder Diagram
Address Instruction
Trigger 10 ST R 0
11 F 53 (DB%)
R0 DT 0
10 F53 DB% , DT 0 , DT 2 , DT100
DT 2
S1 S2 D DT 100
S1 8-digit BCD equivalent constant or lower 16-bit area for 8-digit BCD data (for
dividend)
S2 8-digit BCD equivalent constant or lower 16-bit area for 8-digit BCD data (for
divisor)
D Lower 16-bit area for 8-digit BCD data (for quotient)
(Remainder is stored in special data registers DT9016 and DT9015)
Operands
Index
Relay Timer/Counter Register Constant Index
Operand register
modifier
WX WY WR SV EV DT IX IY K H
S1 A A A A A A A N/A A A A
S2 A A A A A A A N/A A A A
A: Available
D N/A A A A A A A N/A N/A N/A A N/A: Not Available
3 - 101
High - level Instructions FP0
Explanation of example
Higher 16 bits Lower 16 bits
Contents of Contents of
DT3 DT2
To DT101 To DT100
← The lower 16 bits of the remainder is stored in DT9015 and the higher
16 bits of the remainder is stored in DT9016.
To DT9016 To DT9015
Description
The 8-digit BCD equivalent constant or the 8-digit BCD data specified by S1 is divided by the 8-digit BCD
equivalent constant or the 8-digit BCD data specified by S2. The quotient is stored in the areas specified by
D+1 and D, and the remainder is stored in special data registers DT9016 and DT9015.
Dividend data Divisor Quotient Remainder
S1: lower 4-digit S2: lower 4-digit D: lower 4-digit DT9015
÷ ....
DT9016
S1+1: higher 4-digit S2+1: higher 4-digit D+1: higher 4-digit
When processing 8-digit BCD data, the higher 16-bit areas (S1+1, S2+1, D+1) are automatically determined
once the lower 16-bit areas (S1, S2, D) are specified.
Flag conditions
S Error flag (R9007): Turns on and stays on when:
- The area specified using the index modifier exceeds the limit.
- The data is not BCD data.
- The 8-digit BCD equivalent constant or the 8-digit BCD data for the divisor
(specified by S2) is 0.
S Error flag (R9008): Turns on for an instant when:
- The area specified using the index modifier exceeds the limit.
- The data is not BCD data.
- The 8-digit BCD equivalent constant or the 8-digit BCD data for the divisor
(specified by S2) is 0.
S = flag (R900B): Turns on for an instant when the calculated result (quotient) is recognized as
“0”.
3 - 102
FP0 High- level Instructions
Outline Adds 1 to BCD data that expresses a 4-digit decimal number (4-digit
BCD H code).
Program example
Boolean
Ladder Diagram
Address Instruction
10 ST R 0
Trigger
11 F 55 (B+1)
DT 0
R0
10 F55 B+1 , DT 0
Operands
Index
Relay Timer/Counter Register Constant Index
Operand register
modifier
WX WY WR SV EV DT IX IY K H
A: Available
D N/A A A A A A A A N/A N/A A N/A: Not Available
Explanation of example
Adds 1 to the contents of data register DT0 when execution condition (trigger) R0 turns on.
Original data [D]: H9 (BCD)
Bit position 15 · · 1211 · · 8 7 · · 4 3 · · 0
DT0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 1
BCD H code 0 0 0 9
+1
Result [D]: H10 (BCD)
Bit position 15 · · 1211 · · 8 7 · · 4 3 · · 0
DT0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0
BCD H code 0 0 1 0
Description
Adds 1 to the 4-digit BCD data specified by D. The result is stored in D.
Original data Result
(D) + 1 (D)
3 - 103
High - level Instructions FP0
Flag conditions
S Error flag (R9007): Turns on and stays on when:
- The area specified using the index modifier exceeds the limit.
- The data is not BCD data.
S Error flag (R9008): Turns on for an instant when:
- The area specified using the index modifier exceeds the limit.
- The data is not BCD data.
S = flag (R900B): Turns on for an instant when the calculated result is recognized as “0”.
S Carry flag (R9009): Turns on for an instant when the calculated result exceeds the range of 4-digit
BCD data (overflows).
3 - 104
FP0 High- level Instructions
Outline Adds 1 to BCD data that expresses an 8-digit decimal number (8-digit
BCD H code).
Program example
Boolean
Ladder Diagram
Address Instruction
10 ST R 0
Trigger
11 F 56 (DB+1)
DT 0
R0
10 F56 DB+1 , DT 0
Operands
Index
Relay Timer/Counter Register Constant Index
Operand register
modifier
WX WY WR SV EV DT IX IY K H
A: Available
D N/A A A A A A A N/A N/A N/A A N/A: Not Available
Explanation of example
Adds 1 to the contents (8 - digit BCD data) of data registers DT1 and DT0 when execution condition (trigger)
R0 turns on.
Higher 16 bits Lower 16 bits
The specified data area and the
following data area are handled
Contents of Contents of together as 32- bit data.
DT1 DT0
+1
Description
Adds 1 to the 8-digit BCD data specified by D. The result is stored in D+1 and D.
Original data Result
(D+1, D) + 1 (D+1, D)
3 - 105
High - level Instructions FP0
Flag conditions
S Error flag (R9007): Turns on and stays on when:
- The area specified using the index modifier exceeds the limit.
- The data is not BCD data.
S Error flag (R9008): Turns on for an instant when:
- The area specified using the index modifier exceeds the limit.
- The data is not BCD data.
S = flag (R900B): Turns on for an instant when the calculated result is recognized as “0”.
S Carry flag (R9009): Turns on for an instant when the calculated result exceeds the range of 8-digit
BCD data (overflows).
3 - 106
FP0 High- level Instructions
Outline Subtracts 1 from BCD data that expresses a 4-digit decimal number
(4-digit BCD H code).
Program example
Boolean
Ladder Diagram
Address Instruction
10 ST R 0
Trigger
11 F 57 (B - 1)
DT 0
R0
10 F57 B - 1 , DT 0
Operands
Index
Relay Timer/Counter Register Constant Index
Operand register
modifier
WX WY WR SV EV DT IX IY K H
A: Available
D N/A A A A A A A A N/A N/A A N/A: Not Available
Explanation of example
Subtracts 1 from the contents of data register DT0 when execution condition (trigger) R0 turns on.
Original data [D]: H10 (BCD)
Bit position 15 · · 1211 · · 8 7 · · 4 3 · · 0
DT0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0
BCD H code 0 0 1 0
-1
Result [D]: H9 (BCD)
Bit position 15 · · 1211 · · 8 7 · · 4 3 · · 0
DT0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 1
BCD H code 0 0 0 9
Description
Subtracts 1 from the 4-digit BCD data specified by D. The result is stored in D.
Original data Result
(D) - 1 (D)
3 - 107
High - level Instructions FP0
Flag conditions
S Error flag (R9007): Turns on and stays on when:
- The area specified using the index modifier exceeds the limit.
- The data is not BCD data.
S Error flag (R9008): Turns on for an instant when:
- The area specified using the index modifier exceeds the limit.
- The data is not BCD data.
S = flag (R900B): Turns on for an instant when the calculated result is recognized as “0”.
S Carry flag (R9009): Turns on for an instant when the calculated result exceeds the range of 4-digit
BCD data (underflows).
3 - 108
FP0 High- level Instructions
Outline Subtracts 1 from BCD data that expresses an 8-digit decimal number
(8-digit BCD H code).
Program example
Boolean
Ladder Diagram
Address Instruction
10 ST R 0
Trigger
11 F 58 (DB- 1)
DT 0
R0
10 F58 DB - 1 , DT 0
Operands
Index
Relay Timer/Counter Register Constant Index
Operand register
modifier
WX WY WR SV EV DT IX IY K H
A: Available
D N/A A A A A A A N/A N/A N/A A N/A: Not Available
Explanation of example
Subtracts 1 from the contents (8 - digit BCD data) of data registers DT1 and DT0 when execution condition
(trigger) R0 turns on.
Higher 16 bits Lower 16 bits
The specified data area and the
following data area are handled
together as 32- bit data.
Contents of Contents of
DT1 DT0
-1
Description
Subtracts 1 from the 8-digit BCD data specified by D. The result is stored in D+1 and D.
Original data Result
(D+1, D) - 1 (D+1, D)
3 - 109
High - level Instructions FP0
Flag conditions
S Error flag (R9007): Turns on and stays on when:
- The area specified using the index modifier exceeds the limit.
- The data is not BCD data.
S Error flag (R9008): Turns on for an instant when:
- The area specified using the index modifier exceeds the limit.
- The data is not BCD data.
S = flag (R900B): Turns on for an instant when the calculated result is recognized as “0”.
S Carry flag (R9009): Turns on for an instant when the calculated result exceeds the range of 8-digit
BCD data (underflows).
3 - 110
FP0 High- level Instructions
Outline The two specified 16 - bit data are compared and the result is output to
the special internal relay.
Program example
Boolean
Ladder Diagram
Address Instruction
40 ST R 0
41 F 60 (CMP)
DT 0
Trigger
S1 S2 K 100
R0 46 ST R 0
40 F60 CMP , DT 0 , K 100
47 AN R 900A
R0 R900A Y0
48 OT Y 0
46
R0 R900B Y1 49 ST R 0
49 50 AN R 900B
R0 R900C Y2 51 OT Y 1
52
52 ST R 0
53 AN R 900C
54 OT Y 2
Operands
Index
Relay Timer/Counter Register Constant Index
Operand register
modifier
WX WY WR SV EV DT IX IY K H
S1 A A A A A A A A A A A
S2 A A A A A A A A A A A A: Available
Explanation of example
Compares decimal constant K100 with the contents of data register DT0 when execution condition (trigger)
R0 turns on.
When DT0 > K100, R900A turns on and external output relay Y0 turns on.
When DT0 = K100, R900B turns on and external output relay Y1 turns on.
When DT0 < K100, R900C turns on and external output relay Y2 turns on.
3 - 111
High - level Instructions FP0
Description
Compares the 16-bit data specified by S1 with that specified by S2. The comparison result is output to the
special internal relays R9009, R900A, R900B and R900C.
The following table lists the states of the carry flag (R9009), > flag (R900A), = flag (R900B), and < flag
(R900C), depending on the relative sizes of S1 and S2.
Flag
Comparison between
S1 and S2 R900A R900B R900C R9009
(> flag) (= flag) (< flag) (carry flag)
S1 < S2 off off on ↕
S1 = S2 off on off off
S1 > S2 on off off ↕
“↕”: turns on or off according to the conditions
R9010 R900B Y1
R9010 R900C Y2
You can also program the above using the PSHS, RDS, and POPS instructions.
R0 ↗ PSHS
F60 CMP, DT 0, K 100
R900A Y0
↗
RDS R900B Y1
↗
POPS R900C Y2
↗
This is a program in which operation is the same as the program example on page 3 - 111.
3 - 112
FP0 High- level Instructions
R0 R900B Y1
2
R0 R900C Y2
R1
3 F60 CMP, DT 1, K 200
R1 R900A Y3
R1 R900B Y4
4
R1 R900C Y5
3 - 113
High - level Instructions FP0
Flag operation when comparing BCD data or unsigned 16 - bit data (0 to FFFF)
Flag
Comparison between
S1 and S2 R900A R900B R900C R9009
(> flag) (= flag) (< flag) (carry flag)
S1 < S2 ↕ off ↕ on
S1 = S2 off on off off
S1 > S2 ↕ off ↕ off
“↕”: turns on or off according to the conditions
For example, when S1 = H8000 and S2 = H1000, R900A will turn off and R900C will turn on. For this reason,
the correct comparison result will not be obtained in a program which uses R900A and R900C.
S1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
BCD 8 0 0 0
S2 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0
BCD 1 0 0 0
Flag conditions
S Error flag (R9007): Turns on and stays on when the area specified using the index modifier
exceeds the limit.
S Error flag (R9008): Turns on for an instant when the area specified using the index modifier
exceeds the limit.
3 - 114
FP0 High- level Instructions
Outline The two specified 32 - bit data are compared and the result is output to
the special internal relay.
Program example
Boolean
Ladder Diagram
Address Instruction
50 ST R 0
51 F 61(DCMP)
DT 0
Trigger
S1 S2 DT 100
R0 56 ST R 0
50 F61 DCMP , DT 0 , DT 100 57 AN R 900A
R0 R900A Y0
58 OT Y 0
56
R0 R900B Y1 59 ST R 0
59 60 AN R 900B
R0 R900C Y2 61 OT Y 1
62
62 ST R 0
63 AN R 900C
64 OT Y 2
Operands
Index
Relay Timer/Counter Register Constant Index
Operand register
modifier
WX WY WR SV EV DT IX IY K H
S1 A A A A A A A N/A A A A
A: Available
S2 A A A A A A A N/A A A A N/A: Not Available
Explanation of example
Compares the content (32 - bit data) of data registers DT101 and DT100 with the content (32 - bit data) of data
registers DT1 and DT0 when execution condition (trigger) R0 turns on.
When (DT1 and DT0) > (DT101 and DT100), R900A turns on and external output relay Y0 turns on.
When (DT1 and DT0) = (DT101 and DT100), R900B turns on and external output relay Y1 turns on.
When (DT1 and DT0) < (DT101 and DT100), R900C turns on and external output relay Y2 turns on.
3 - 115
High - level Instructions FP0
Description
Compares the 32-bit data or 32-bit equivalent constant specified by S1 with that specified by S2. The
comparison result is output to special internal relays R9009, R900A, 900B, and R900C.
The following table lists the states of the carry flag (R9009), > flag (R900A), = flag (R900B), and < flag
(R900C), depending on the relative sizes of (S1+1, S1) and (S2+1, S2).
Flag
Comparison between
(S1+1, S1) and (S2+1, S2) R900A R900B R900C R9009
(> flag) (= flag) (< flag) (carry flag)
(S1+1, S1) < (S2+1, S2) off off on ↕
(S1+1, S1) = (S2+1, S2) off on off off
(S1+1, S1) > (S2+1, S2) on off off ↕
“↕”: turns on or off according to the conditions
When processing 32-bit data, the higher 16-bit areas (S1+1, S2+1) are automatically determined once the
lower 16-bit areas (S1, S2) are specified.
Execution condition (Trigger)
In this program example, the comparison will be performed only when R0 turns on.
If ongoing comparison is necessary, relay R9010, which is always on, should be used in the execution
conditions.
↗Always on relay.
R9010
F61 CMP, DT 0, K100
R9010 R900A Y0
R9010 R900B Y1
R9010 R900C Y2
You can also program the above using the PSHS, RDS, and POPS instructions.
R0 ↗ PSHS
F61 DCMP, DT 0, DT100
R900A Y0
↗
RDS R900B Y1
↗
POPS R900C Y2
↗
This is a program in which operation is the same as the program example on page 3 - 115.
3 - 116
FP0 High- level Instructions
Example: Compares DT1 and DT0 with DT101 and DT100, and DT3 and DT2
with DT201 and DT200.
R0
1 F61 DCMP, DT 0, DT 100
R0 R900A Y0
R0 R900B Y1
2
R0 R900C Y2
R1
3 F61 DCMP, DT 2, DT 200
R1 R900A Y3
R1 R900B Y4
4
R1 R900C Y5
3 - 117
High - level Instructions FP0
Flag operation when comparing BCD data or unsigned 32 - bit data (0 to FFFFFFFF)
Flag
Comparison between
(S1+1, S1) and (S2+1, S2) R900A R900B R900C R9009
(> flag) (= flag) (< flag) (carry flag)
(S1+1, S1) < (S2+1, S2) ↕ off ↕ on
(S1+1, S1) = (S2+1, S2) off on off off
(S1+1, S1) > (S2+1, S2) ↕ off ↕ off
“↕”: turns on or off according to the conditions
For example, if an F61 (DCMP) instruction is executed when S1 = H80000000 (K - 2147483648) and S2 =
H10000001 (K+268435457), the result will be S1<S2. Thus R900A will turn off and R900C will turn on. In a
program which uses R900A and R900C, the correct comparison result will not be obtained.
Flag conditions
S Error flag (R9007): Turns on and stays on when the area specified using the index modifier
exceeds the limit.
S Error flag (R9008): Turns on for an instant when the area specified using the index modifier
exceeds the limit.
3 - 118
FP0 High- level Instructions
Outline Compares one 16-bit data item with the data band specified by two
other 16-bit data items and the comparison result is output to the
special internal relay.
Program example
Boolean
Ladder Diagram
Address Instruction
50 ST R 0
51 F 62 (WIN)
Lower limit value
Trigger DT 0
Upper limit value
DT 2
S1 S2 S3
R0 DT 3
50 F62 WIN , DT 0 , DT 2 , DT 3 58 ST R 0
R0 R900A Y0 59 AN R 900A
58 60 OT Y 0
R0 R900B Y1 61 ST R 0
61 62 AN R 900B
R0 R900C Y2 63 OT Y 1
64 64 ST R 0
65 AN R 900C
66 OT Y 2
Operands
Index
Relay Timer/Counter Register Constant Index
Operand register
modifier
WX WY WR SV EV DT IX IY K H
S1 A A A A A A A A A A A
S2 A A A A A A A A A A A
S3 A A A A A A A A A A A A: Available
3 - 119
High - level Instructions FP0
Explanation of example
Compares the contents of data register DT0 with the contents of data register DT2 (lower limit of the data
band) and data register DT3 (upper limit of the data band) when execution condition (trigger) R0 turns on.
R900A : on +500
R900B : on
R900C : on - 500
When DT0 is K - 680, R900C turns on and external output relay Y2 goes on.
When DT0 is K - 500, R900B turns on and external output relay Y1 goes on.
When DT0 is K256, R900B turns on and external output relay Y1 goes on.
When DT0 is K680, R900A turns on and external output relay Y0 goes on.
Description
Compares the 16-bit equivalent constant or 16-bit data specified by S1 with the data band specified by S2
and S3. This instruction checks whether S1 is in the data band between S2 (lower limit) and S3 (upper limit),
larger than S3, or smaller than S2. The comparison result is output to special internal relays R9009, R900A,
R900B, and R900C.
The following table lists the states of the R9009, R900A, R900B and R900C.
Flag
Comparison between
S1, S2 and S3 R900A R900B R900C R9009
(> flag) (= flag) (< flag) (carry flag)
S1 < S2 off off on ———
S2≦S1≦S3 off on off ———
S3 < S1 on off off ———
Flag conditions
S Error flag (R9007): Turns on and stays on when:
- The area specified using the index modifier exceeds the limit.
- S2 > S3.
S Error flag (R9008): Turns on for an instant when:
- The area specified using the index modifier exceeds the limit.
- S2 > S3.
3 - 120
FP0 High- level Instructions
Outline Compares one 32-bit data item with the data band specified by two
other 32-bit data items and the comparison result is output to the
special internal relay.
Program example
Boolean
Ladder Diagram
Address Instruction
50 ST R 0
51 F 63 (DWIN)
Lower limit value
Trigger DT 0
Upper limit value
DT 2
S1 S2 S3
R0 DT 4
50 F63 DWIN , DT 0 , DT 2 , DT 4 64 ST R 0
R0 R900A Y0 65 AN R 900A
64 66 OT Y 0
R0 R900B Y1 67 ST R 0
67 68 AN R 900B
R0 R900C Y2 69 OT Y 1
70 70 ST R 0
71 AN R 900C
72 OT Y 2
Operands
Index
Relay Timer/Counter Register Constant Index
Operand register
modifier
WX WY WR SV EV DT IX IY K H
S1 A A A A A A A N/A A A A
S2 A A A A A A A N/A A A A
A: Available
S3 A A A A A A A N/A A A A N/A: Not Available
3 - 121
High - level Instructions FP0
Explanation of example
Compares the contents of data registers DT1 and DT0 with the contents of data registers DT3 and DT2 (lower
limit of the data band) and data registers DT5 and DT4 (upper limit of the data band), when execution
condition (trigger) R0 turns on.
Example: When K - 50000 is in DT3 and DT2 and K50000 is in DT5 and DT4,
as shown below.
R900A : on +50000
R900B : on
R900C : on - 50000
When (DT1, DT0) is K - 68000, R900C turns on and external output relay
Y2 goes on.
When (DT1, DT0) is K - 50000, R900B turns on and external output relay
Y1 goes on.
When (DT1, DT0) is K25600, R900B turns on and external output relay
Y1 goes on.
When (DT1, DT0) is K68000, R900A turns on and external output relay
Y0 goes on.
Description
Compares the 32-bit equivalent constant or 32-bit data specified by S1 with the data band specified by S2
and S3. This instruction checks whether S1 is in the data band between S2 (lower limit) and S3 (upper limit),
larger than S3, or smaller than S2. The comparison result is output to the special internal relays R9009,
R900A, R900B, and R900C.
The following table lists the states of the R9009, R900A, R900B and R900C.
Comparison between Flag
(S1+1, S1), (S2+1, S2) R900A R900B R900C R9009
and (S3+1, S3) (> flag) (= flag) (< flag) (carry flag)
(S1+1, S1) < (S2+1, S2) off off on ———
(S2+1, S2)≦(S1+1, S1)
off on off ———
≦(S3+1, S3)
(S3+1, S3) < (S1+1, S1) on off off ———
Flag conditions
S Error flag (R9007): Turns on and stays on when:
- The area specified using the index modifier exceeds the limit.
- (S2+1, S2) > (S3+1, S3).
S Error flag (R9008): Turns on for an instant when:
- The area specified using the index modifier exceeds the limit.
- (S2+1, S2) > (S3+1, S3).
3 - 122
FP0 High- level Instructions
Outline Compares one specified data block with another in byte units.
Program example
Boolean
Ladder Diagram
Address Instruction
Trigger 10 ST R 0
S1 S2 S3 11 F 64 (BCMP)
R0 DT 0
10 F64 BCMP , DT 0 , DT 10 , DT 20 DT 10
DT 20
18 ST R 0
R0 R900B R1 19 AN R 900B
18 20 OT R 1
16-bit equivalent constant or 16-bit area (specifies starting byte positions and
S1
number of bytes to be compared)
S2 Starting 16-bit area to be compared
S3 Starting 16-bit area to be compared
Operands
Index
Relay Timer/Counter Register Constant Index
Operand register
modifier
WX WY WR SV EV DT IX IY K H
S1 A A A A A A A A A A A
S2 A A A A A A N/A N/A N/A N/A A
A: Available
S3 A A A A A A N/A N/A N/A N/A A N/A: Not Available
3 - 123
High - level Instructions FP0
Explanation of example
Compares the data block of data register DT10 (4 bytes from DT10 lower order byte) with data register DT20
(4 bytes from DT20 higher order byte) according to the comparison condition in data register DT0 when
execution condition (trigger) R0 turns on. When the contents of the two data blocks are the same, internal
relay R1 turns on.
If H1004 is entered in DT0, the two blocks are as follows.
Higher Lower
byte byte ·
Comparation
Data block DT20
specified by DT21 1
S3
DT22 3 2
4
Area compared
Description
Compares the contents of the data block specified by S2 with the contents of the data block specified by S3
according to content specified by S1.
When the comparison result is S2 = S3, special internal relay R900B (=flag) turns on.
S1 is the control data that determines factors such as the size of the comparison.
How to specify control data “S1”
S1 specifies the starting byte position and the number of bytes to be compared using 4-digit BCD data as
follows:
S1 = H j j j j
Setting example:
To specify the 4 bytes beginning with the lower byte of the data block specified by S2 and the 4 bytes
beginning with the upper byte of the data block specified by S3, set S1 to H1004.
3 - 124
FP0 High- level Instructions
Flag conditions
S Error flag (R9007): Turns on and stays on when:
- The area specified using the index modifier exceeds the limit.
- The data specified by S1 is not BCD data.
- The specified data block area exceeds the limit.
S Error flag (R9008): Turns on for an instant when:
- The area specified using the index modifier exceeds the limit.
- The data specified by S1 is not BCD data.
- The specified data block area exceeds the limit.
R0
F64 BCMP, DT 0, DT 1, WR 5
R0 R900B Y0
Result of F64
R1
F60 CMP, DT 2, K 100
R1 R900B R2
Result of F60
Note
As shown in the above program, be sure to have the trigger (R0
or R1) before flag R900B. However, if you are using R9010 (on all
the time), then it is unnecessary to have the trigger before
R900B.
3 - 125
High - level Instructions FP0
Operands
Index
Relay Timer/Counter Register Constant Index
Operand register
modifier
WX WY WR SV EV DT IX IY K H
S1 A A A A A A A A A A A
S2 A A A A A A A A A A A
A: Available
D N/A A A A A A A A N/A N/A A N/A: Not Available
Explanation of example
Performs AND operation on each bit in data registers DT0 and DT2 when trigger R0 turns on.
The AND operation result is stored in data register DT1.
Bit position 15 · · 12 11 · · 8 7 · · 4 3 · · 0
[S1] DT0 0 1 0 0 1 1 0 1 1 0 1 1 1 0 0 1
Bit position 15 · · 12 11 · · 8 7 · · 4 3 · · 0
[S2] DT2 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1
R0: on
Bit position 15 · · 12 11 · · 8 7 · · 4 3 · · 0
[D] DT1 0 0 0 0 0 0 0 0 1 0 1 1 1 0 0 1
3 - 126
FP0 High- level Instructions
Description
Performs AND operation on each bit in the 16-bit equivalent constant or 16-bit data specified by S1 and S2.
The AND operation result is stored in the 16-bit area specified by D.
(S1) ∧ (S2) → (D)
You can use this instruction to turn off certain bits of the 16-bit data.
AND operation
The AND operation is shown below.
S1 S2 D
0 0 0
0 1 0
1 0 0
1 1 1
Flag conditions
S Error flag (R9007): Turns on and stays on when the area specified using the index modifier
exceeds the limit.
S Error flag (R9008): Turns on for an instant when the area specified using the index modifier
exceeds the limit.
S = flag (R900B): Turns on for an instant when the calculated result is recognized as “0”.
3 - 127
High - level Instructions FP0
Operands
Index
Relay Timer/Counter Register Constant Index
Operand register
modifier
WX WY WR SV EV DT IX IY K H
S1 A A A A A A A A A A A
S2 A A A A A A A A A A A
A: Available
D N/A A A A A A A A N/A N/A A N/A: Not Available
Explanation of example
Performs OR operation on each bit in data registers DT0 and DT2 when execution condition (trigger) R0 turns
on.
The OR operation result is stored in data register DT1.
Bit position 15 · · 12 11 · · 8 7 · · 4 3 · · 0
[S1] DT0 0 1 0 0 1 1 0 1 1 0 1 1 1 0 0 1
Bit position 15 · · 12 11 · · 8 7 · · 4 3 · · 0
[S2] DT2 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1
R0: on
Bit position 15 · · 12 11 · · 8 7 · · 4 3 · · 0
[D] DT1 0 1 0 0 1 1 0 1 1 1 1 1 1 1 1 1
3 - 128
FP0 High- level Instructions
Description
Performs OR operation on each bit in the 16-bit equivalent constant or 16-bit data specified by S1 and S2.
The OR operation result is stored in the 16-bit area specified by D.
(S1) ∨ (S2) → (D)
You can use this instruction to turn on certain bits of the 16-bit data.
OR operation
The OR operation is shown below.
S1 S2 D
0 0 0
0 1 1
1 0 1
1 1 1
Flag conditions
S Error flag (R9007): Turns on and stays on when the area specified using the index modifier
exceeds the limit.
S Error flag (R9008): Turns on for an instant when the area specified using the index modifier
exceeds the limit.
S = flag (R900B): Turns on for an instant when the calculated result is recognized as “0”.
3 - 129
High - level Instructions FP0
Operands
Index
Relay Timer/Counter Register Constant Index
Operand register
modifier
WX WY WR SV EV DT IX IY K H
S1 A A A A A A A A A A A
S2 A A A A A A A A A A A
A: Available
D N/A A A A A A A A N/A N/A A N/A: Not Available
Explanation of example
Performs exclusive OR operation on each bit in data registers DT0 and DT2 when execution condition
(trigger) R0 turns on. The exclusive OR operation result is stored in data register DT1.
Bit position 15 · · 12 11 · · 8 7 · · 4 3 · · 0
[S1] DT0 0 1 0 0 1 1 0 1 1 0 1 1 1 0 0 1
Bit position 15 · · 12 11 · · 8 7 · · 4 3 · · 0
[S2] DT2 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1
R0: on
Bit position 15 · · 12 11 · · 8 7 · · 4 3 · · 0
[D] DT1 0 1 0 0 1 1 0 1 0 1 0 0 0 1 1 0
3 - 130
FP0 High- level Instructions
Description
Performs exclusive OR operation on each bit in the 16-bit equivalent constant or 16-bit data specified by S1
and S2. The exclusive OR operation result is stored in the 16-bit area specified by D.
(S1) ∧ (S2) ∨ (S1) ∧ (S2) → (D)
Detects the bits whose on and off states do not match.
If the values of S1 and S2 are equal, all the bits of the data specified by D become 0.
Exclusive OR operation
The exclusive OR operation is shown below.
S1 S2 D
0 0 0
0 1 1
1 0 1
1 1 0
Flag conditions
S Error flag (R9007): Turns on and stays on when the area specified using the index modifier
exceeds the limit.
S Error flag (R9008): Turns on for an instant when the area specified using the index modifier
exceeds the limit.
S = flag (R900B): Turns on for an instant when the calculated result is recognized as “0”.
3 - 131
High - level Instructions FP0
Outline Performs bit-wise exclusive NOR operation on two 16-bit data items.
Program example
Boolean
Ladder Diagram
Address Instruction
Trigger 10 ST R 0
11 F 68 (XNR)
R0 DT 0
10 F68 XNR , DT 0 , DT 2 , DT 1
DT 2
DT 1
S1 S2 D
S1 16-bit equivalent constant or 16-bit area
S2 16-bit equivalent constant or 16-bit area
D 16-bit area for storing exclusive NOR operation result
Operands
Index
Relay Timer/Counter Register Constant Index
Operand register
modifier
WX WY WR SV EV DT IX IY K H
S1 A A A A A A A A A A A
S2 A A A A A A A A A A A
A: Available
D N/A A A A A A A A N/A N/A A N/A: Not Available
Explanation of example
When the execution condition (trigger) R0 is on, if the values of the bits for the same positions with regard to
the contents of data registers DT0 and DT2 are equal, the bit for that position is turned on (1) for data register
DT1. If the values are not equal, the bit is turned off (0).
Bit position 15 · · 12 11 · · 8 7 · · 4 3 · · 0
[S1] DT0 0 1 0 0 1 1 0 1 1 0 1 1 1 0 0 1
Bit position 15 · · 12 11 · · 8 7 · · 4 3 · · 0
[S2] DT2 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1
R0: on
Bit position 15 · · 12 11 · · 8 7 · · 4 3 · · 0
[D] DT1 1 0 1 1 0 0 1 0 1 0 1 1 1 0 0 1
3 - 132
FP0 High- level Instructions
Description
Performs exclusive NOR operation on each bit in the 16-bit equivalent constant or 16-bit data specified by S1
and S2. The exclusive NOR operation result is stored in the 16-bit area specified by D.
(S1) ∧ (S2) ∨ (S1) ∧ (S2) → (D)
Detects the bits whose on and off states match.
If the values of S1 and S2 are equal, all the bits of the data specified by D become 1.
Exclusive NOR operation
The exclusive NOR operation is shown below.
S1 S2 D
0 0 1
0 1 0
1 0 0
1 1 1
Flag conditions
S Error flag (R9007): Turns on and stays on when the area specified using the index modifier
exceeds the limit.
S Error flag (R9008): Turns on for an instant when the area specified using the index modifier
exceeds the limit.
S = flag (R900B): Turns on for an instant when the calculated result is recognized as “0”.
3 - 133
High - level Instructions FP0
F70 (BCC) Block check code calculation 9 FP0 C10, C14, C16,
C32, T32, SL1
10 ST R 0
Trigger
11 F 70 (BCC)
R0 K 2
10 F70 BCC , K 2 , DT 0 , K 12 , DT 6 DT 0
K 12
S1 S2 S3 D
DT 6
Operands
Index
Relay Timer/Counter Register Constant Index
Operand register
modifier
WX WY WR SV EV DT IX IY K H
S1 A A A A A A A A A A A
S2 A A A A A A N/A N/A N/A N/A A
S3 A A A A A A A A A A A
A: Available
D N/A A A A A A N/A N/A N/A N/A A N/A: Not Available
Explanation of example
Calculates the Block Check Code (BCC) of 12 bytes of ASCII data starting from data register DT0, via an
exclusive OR operation, when execution condition (trigger) R0 turns on. The Block Check Code (BCC) is
stored in the lower byte of data register DT6.
3 - 134
FP0 High- level Instructions
Description
Calculates the Block Check Code (BCC) of S3 bytes of ASCII data starting from the 16-bit area specified by
S2, according to the calculation method specified by S1. The Block Check Code (BCC) is stored in the lower
byte of the 16-bit area specified by D. (BCC is one byte. The higher byte of D does not change.)
S1: Specifying the Block Check Code (BCC) calculation method
K0: Addition
K1: Subtraction
K2: Exclusive OR operation
S2 and S3: Specifying the target data
For instance, if 12 bytes of data from DT0 are to be targeted, the following applies:
S2: DT0
S3: K12 (specified as a decimal number)
Flag conditions
S Error flag (R9007): Turns on and stays on when:
- The area specified using the index modifier exceeds the limit.
- The number of specified bytes for the target data exceeds the limit of the
specified data area.
S Error flag (R9008): Turns on for an instant when:
- The area specified using the index modifier exceeds the limit.
- The number of specified bytes for the target data exceeds the limit of the
specified data area.
Application example
In this example, the block check code of the message being sent, ”%01#RCSX0000”, is calculated and is
added after the message.
Transmission is done using ASCII codes.
BCC is calculated as an exclusive logical OR.
The message should be stored in the memory area as shown below.
Data register DT6 DT5 DT4 DT3 DT2 DT1 DT0
ASCII HEX code 3 0 3 0 3 0 3 0 5 8 5 3 4 3 5 2 2 3 3 1 3 0 2 5
ASCII character 0 0 0 0 X S C R # 1 0 %
12 bytes
Block Check Code (BCC)
The F70 (BCC) instruction is as shown below.
R0
10 F70 BCC, K 2 , DT 0 , K 12 , DT 6
3 - 135
High - level Instructions FP0
calculation
3 - 136
FP0 High- level Instructions
5 Step Availability
Hexadecimal data →
F71 (HEXA) ASCII code 7 FP0 C10, C14, C16,
C32, T32, SL1
Outline Converts 16-bit data to ASCII code that expresses the equivalent
hexadecimals.
Program example
Boolean
Ladder Diagram
Address Instruction
Trigger 10 ST R 0
11 F 71 (HEXA)
R0 DT 0
10 F71 HEXA , DT 0 , K 2 , DT 10
K 2
S1 S2 D DT 10
Operands
Index
Relay Timer/Counter Register Constant Index
Operand register
modifier
WX WY WR SV EV DT IX IY K H
S1 A A A A A A N/A N/A N/A N/A A
S2 A A A A A A A A A A A
A: Available
D N/A A A A A A N/A N/A N/A N/A A N/A: Not Available
Explanation of example
Converts 2 bytes of data stored in data register DT0 to ASCII codes that express the equivalent
hexadecimals when execution condition (trigger) R0 turns on. The converted data is stored in data registers
DT11 and DT10.
DT0
Bit position 15 · · 1211 · · 8 7 · · 4 3 · · 0
Binary data 1 0 1 0 1 0 1 1 1 1 0 0 1 1 0 1
Hexadecimal A B C D
DT11 DT10
ASCII HEX code 4 2 4 1 4 4 4 3
ASCII character B A D C
3 - 137
High - level Instructions FP0
Description
Converts the data starting from the 16-bit area specified by S1 to ASCII codes that express the equivalent
hexadecimals. The converted result is stored in the area starting from the 16-bit area specified by D.
S2 specifies the number of source data bytes to be converted.
Since ASCII code requires eight bits (one byte) to express one hexadecimal character, the data length when
converted to ASCII code becomes double the source data.
Precautions during programming
The two characters that make up one byte are interchanged when stored.
Two bytes are converted as one segment of data.
Hexadecimal data A B C D
Converted
result 4 2 4 1 4 4 4 3
B A D C
D+1 D
S1 1 2 3 4 2 1 4 3
Flag conditions
S Error flag (R9007): Turns on and stays on when:
- The area specified using the index modifier exceeds the limit.
- The number of bytes specified by S2 exceeds the area specified by S1.
- The converted result exceeds the area specified by D.
- The data specified by S2 is recognized as “0”.
S Error flag (R9008): Turns on for an instant when:
- The area specified using the index modifier exceeds the limit.
- The number of bytes specified by S2 exceeds the area specified by S1.
- The converted result exceeds the area specified by D.
- The data specified by S2 is recognized as “0”.
3 - 138
FP0 High- level Instructions
Conversion example
The following shows conversion of hexadecimal data to ASCII codes.
Conversion of four bytes of data (S2 = K4)
Hexadecimal data S1+1 S1
EF 12 AB CD
4 bytes
3 bytes
3 - 139
High - level Instructions FP0
5 Step Availability
ASCII code →
F72 (AHEX) Hexadecimal data
7 FP0 C10, C14, C16,
C32, T32, SL1
Trigger 10 ST R 0
11 F 72 (AHEX)
R0 DT 0
10 F72 AHEX , DT 0 , K 4 , DT 40
K 4
S1 S2 D DT 40
Operands
Index
Relay Timer/Counter Register Constant Index
Operand register
modifier
WX WY WR SV EV DT IX IY K H
S1 A A A A A A N/A N/A N/A N/A A
S2 A A A A A A A A A A A
A: Available
D N/A A A A A A N/A N/A N/A N/A A N/A: Not Available
Explanation of example
Converts 4 ASCII codes stored in data registers DT0 and DT1 to hexadecimal numbers when execution
condition (trigger) R0 turns on. The converted data is stored in data register DT40.
DT1 DT0
ASCII HEX code 4 4 4 3 4 2 4 1
ASCII character D C B A
DT40
Bit position 15 · · 1211 · · 8 7 · · 4 3 · · 0
Binary data 1 1 0 0 1 1 0 1 1 0 1 0 1 0 1 1
Hexadecimal C D A B
3 - 140
FP0 High- level Instructions
Description
Converts ASCII code that expresses hexadecimal characters, starting from the 16-bit area specified by S1, to
hexadecimal numbers as specified by S2. The converted result is stored in the area starting from the 16-bit
area specified by D.
The volume of the results (hexadecimal numeric data) is half that of the converted ASCII code.
Precautions during programming
The data for two ASCII code characters is converted to two numeric digits for one word. When this takes
place, the characters of the upper and lower bytes are interchanged.
Four characters are converted as one segment of data.
ASCII code character
4 4 4 3 4 2 4 1
Converted C D A B
result
Flag conditions
S Error flag (R9007): Turns on and stays on when:
- The area specified using the index modifier exceeds the limit.
- The number of bytes specified by S2 exceeds the area specified by S1.
- The converted result exceeds the area specified by D.
- The data specified by S2 is recognized as “0”.
- ASCII code, not a hexadecimal number (0 to F), is specified.
S Error flag (R9008): Turns on for an instant when:
- The area specified using the index modifier exceeds the limit.
- The number of bytes specified by S2 exceeds the area specified by S1.
- The converted result exceeds the area specified by D.
- The data specified by S2 is recognized as “0”.
- ASCII code, not a hexadecimal number (0 to F), is specified.
Conversion Example
The following shows conversion of ASCII codes to hexadecimal data.
Conversion of eight characters (S2 = K8)
ASCII code
S1+3 S1+2 S1+1 S1
32 31 46 45 44 43 42 41
2 1 F E D C B A
8 characters (8 bytes)
Result of S1 + 3, Result of S1 + 1, S1
S1 + 2 conversion conversion
3 - 141
High - level Instructions FP0
31 46 45 44 43 42 41
1 F E D C B A
7 characters (7 bytes)
10 EF CD AB
46 45 44 43 42 41
F E D C B A
6 characters (6 bytes)
EF CD AB
Note
In the conversion results, only the data for the lower byte is
stored in D + 1 word. The data for the higher byte is left as it is,
and does not change.
3 - 142
FP0 High- level Instructions
44 n n-1 n-2
Converted
result n 0 n-1 n-2
3 - 143
High - level Instructions FP0
5 Step Availability
F73 (BCDA) BCD data → ASCII code 7 FP0 C10, C14, C16,
C32, T32, SL1
Outline Converts 4 - digit BCD code to ASCII code that expresses the
equivalent decimals.
Program example
Boolean
Ladder Diagram
Address Instruction
Trigger 10 ST R 0
11 F 73 (BCDA)
R0 DT 0
10 F73 BCDA , DT 0 , H4 , DT 10
H 4
S1 S2 D DT 10
Operands
Index
Relay Timer/Counter Register Constant Index
Operand register
modifier
WX WY WR SV EV DT IX IY K H
S1 A A A A A A N/A N/A N/A N/A A
S2 A A A A A A A A A A A
A: Available
D N/A A A A A A N/A N/A N/A N/A A N/A: Not Available
Explanation of example
Converts BCD code that express a 4-digit decimal number (4-digit BCD H code) stored in data register DT0 to
ASCII code when execution condition (trigger) R0 turns on. The converted data is stored in data registers
DT10 and DT11.
When S2 = H2 (normal direction, 2 bytes convertion)
DT0
BCD
1 2 3 4
H code
DT11 DT10
ASCII
3 2 3 1 3 4 3 3
HEX code
ASCII
2 1 4 3
character
3 - 144
FP0 High- level Instructions
DT11 DT10
ASCII
3 4 3 3 3 2 3 1
HEX code
ASCII 4 3 2 1
character
Description
Converts the BCD code starting from the 16-bit area specified by S1 to ASCII code that expresses the
equivalent decimals as specified by S2. The converted result is stored in the area starting from the 16-bit area
specified by D. A maximum of four bytes (eight characters of data) can be converted.
S2 specifies the number of source data bytes and the direction of converted data (normal/reverse).
The data length when converted to ASCII code becomes double the BCD data.
How to specify S2
S2 = H j 0 0 j
Since you can specify source data in byte units, it is possible to convert only the lower byte of S1 to ASCII
code.
For information on the direction of conversion, refer to ”Explanation of example”.
3 - 145
High - level Instructions FP0
2 1 4 3 Converted 4 3 2 1
result
D+1 D D+1 D
Flag conditions
S Error flag (R9007): Turns on and stays on when:
- The area specified using the index modifier exceeds the limit.
- The data specified by S1 is not BCD data.
- The number of bytes specified by S2 exceeds the area specified by S1.
- The converted result exceeds the area specified by D.
- The data specified by S2 is recognized as “0”.
- The number of bytes specified by S2 is more than H4.
S Error flag (R9008): Turns on for an instant when:
- The area specified using the index modifier exceeds the limit.
- The data specified by S1 is not BCD data.
- The number of bytes specified by S2 exceeds the area specified by S1.
- The converted result exceeds the area specified by D.
- The data specified by S2 is recognized as “0”.
- The number of bytes specified S2 is more than H4.
Conversion Example
The following shows conversion from BCD data to ASCII codes.
Normal direction convertion of 4 bytes (S2 = H0004)
BCD data
S1+1 S1
BCD H code 12 34 56 78
4 bytes
3 - 146
FP0 High- level Instructions
4 bytes
3 - 147
High - level Instructions FP0
5 Step Availability
F74 (ABCD) ASCII code → BCD data 9 FP0 C10, C14, C16,
C32, T32, SL1
Outline Converts ASCII code that expresses decimal characters to BCD code.
Program example
Boolean
Ladder Diagram
Address Instruction
Trigger 10 ST R 0
11 F 74 (ABCD)
R0 DT 0
10 F74 ABCD , DT 0 , H8 , DT 40
H 8
S1 S2 D DT 40
Operands
Index
Relay Timer/Counter Register Constant Index
Operand register
modifier
WX WY WR SV EV DT IX IY K H
S1 A A A A A A N/A N/A N/A N/A A
S2 A A A A A A A A A A A
A: Available
D N/A A A A A A N/A N/A N/A N/A A N/A: Not Available
Explanation of example
Converts ASCII codes stored in data registers DT1 and DT0 to BCD data when execution condition (trigger)
R0 turns on. The converted data is stored in data register DT40.
When S2 = H4 (normal direction, 4 bytes)
DT1 DT0
ASCII
3 4 3 3 3 2 3 1
HEX code
ASCII
4 3 2 1
character
DT40
BCD
3 4 1 2
H code
3 - 148
FP0 High- level Instructions
ASCII 4 3 2 1
character
DT40
BCD
1 2 3 4
H code
Description
Converts ASCII codes that express decimal characters, starting from the 16-bit area specified by S1, to BCD
data as specified by S2. The converted result is stored in the area starting from the 16-bit area specified by D.
A maximum of eight characters of data can be converted.
S2 specifies the number of source data bytes and the direction of converted data (normal/reverse).
The data length when converted to a BCD number becomes half the ASCII code source data.
How to specify S2
S2 = H j 0 0 j
Number of bytes for ASCII character
H1: 1 byte (1 ASCII character)
H2: 2 bytes (2 ASCII characters)
H3: 3 bytes (3 ASCII characters)
H4: 4 bytes (4 ASCII characters)
H5: 5 bytes (5 ASCII characters)
H6: 6 bytes (6 ASCII characters)
H7: 7 bytes (7 ASCII characters)
H8: 8 bytes (8 ASCII characters)
3 - 149
High - level Instructions FP0
2 1 4 3 ASCII 4 3 2 1
code
1 2 3 4 BCD data 1 2 3 4
Conversion Example
The following shows conversion from ASCII codes to BCD data.
8 ASCII characters convertion (S2=H0008)
ASCII code
S1+3 S1+2 S1+1 S1
ASCII HEX
code 38 37 36 35 34 33 32 31
ASCII 8 7 6 5 4 3 2 1
character
8 ASCII characters (8 bytes)
3 - 150
FP0 High- level Instructions
Flag conditions
S Error flag (R9007): Turns on and stays on when:
- The area specified using the index modifier exceeds the limit.
- ASCII code not corresponding to decimal numbers (0 to 9) is specified.
- The number of bytes specified by S2 exceeds the area specified by S1.
- The converted result exceeds the area specified by D.
- The data specified by S2 is recognized as “0”.
- The number of bytes for ASCII characters in S2 is more than H8.
S Error flag (R9008): Turns on for an instant when:
- The area specified using the index modifier exceeds the limit.
- ASCII code not corresponding to decimal numbers (0 to 9) is specified.
- The number of bytes specified by S2 exceeds the area specified by S1.
- The converted result exceeds the area specified by D.
- The data specified by S2 is recognized as “0”.
- The number of bytes for ASCII characters in S2 is more than H8.
3 - 151
High - level Instructions FP0
5 Step Availability
F75 (BINA) 16-bit data → ASCII code 7 FP0 C10, C14, C16,
C32, T32, SL1
Outline Converts 16-bit data to ASCII code that expresses the equivalent
decimals.
Program example
Boolean
Ladder Diagram
Address Instruction
Trigger 10 ST R 0
11 F 75 (BINA)
R0
DT 0
10 F75 BINA , DT 0 , K 6 , DT 50
K 6
S1 S2 D DT 50
Operands
Index
Relay Timer/Counter Register Constant Index
Operand register
modifier
WX WY WR SV EV DT IX IY K H
S1 A A A A A A A A A A A
S2 A A A A A A A A A A A
A: Available
D N/A A A A A A N/A N/A N/A N/A A N/A: Not Available
Explanation of example
Converts the 16-bit data stored in data register DT0 to ASCII codes that express the equivalent decimals
when execution condition (trigger) R0 turns on. The converted data is stored in data registers DT52 to DT50.
Source DT0
Bit position 15 · · 1211 · · 8 7 · · 4 3 · · 0
Decimal data K - 100
Destination
DT52 DT51 DT50
ASCII HEX code 3 0 3 0 3 1 2 D 2 0 2 0
ASCII character 0 0 1 -
6 bytes
SPACE
3 - 152
FP0 High- level Instructions
Description
Converts the 16-bit data specified by S1 to ASCII codes that express the equivalent decimals. The converted
result is stored in the area starting from the 16-bit area specified by D as specified by S2.
Specify the number of bytes in decimal number in the S2. (This specification cannot be made with BCD data.)
Precautions during programming
If a positive number is converted, the “+” sign is not converted.
When a negative number is converted, the “ - ” sign is also converted to ASCII code (ASCII HEX code: H2D).
If the area specified by S2 is more than that required by the converted data, the ASCII code for “SPACE”
(ASCII HEX code: H20) is stored in the extra area.
Data is stored in the direction towards the final address, so the position of the ASCII code may change,
depending on the size of the data storage area.
When S2=K8 (8 bytes)
D+3 D+2 D+1 D
30 30 31 2D 20 20 20 20
0 0 1 - (Space) (Space) (Space) (Space)
Range specified by S2
If the number of bytes of ASCII codes following conversion (including the minus sign) is larger than the
number of bytes specified by the S2, an operation error occurs. Make sure the sign is taken into consideration
when specifying the object of conversion for the S2.
Conversion Example
The following shows conversion from 16 - bit decimal data to ASCII codes.
When a negative number is converted
16- bit data S1
FF 9C
K - 100
3 - 153
High - level Instructions FP0
Flag conditions
S Error flag (R9007): Turns on and stays on when:
- The area specified using the index modifier exceeds the limit.
- The number of bytes specified by S2 exceeds the area specified by D.
- The data specified by S2 is recognized as “0”.
- The converted result exceeds the area specified by D.
- The number of bytes of converted result exceeds the number of bytes
specified by S2.
S Error flag (R9008): Turns on for an instant when:
- The area specified using the index modifier exceeds the limit.
- The number of bytes specified by S2 exceeds the area specified by D.
- The data specified by S2 is recognized as “0”.
- The converted result exceeds the area specified by D.
3 - 154
FP0 High- level Instructions
F76 (ABIN) ASCII code → 16-bit data 7 FP0 C10, C14, C16,
C32, T32, SL1
Outline Converts ASCII code that expresses decimal digits to 16-bit data that
expresses the equivalent number.
Program example
Boolean
Ladder Diagram
Address Instruction
Trigger 10 ST R 0
11 F 76 (ABIN)
R0
DT 0
10 F76 ABIN , DT 0 , K 6 , DT 50
K 6
S1 S2 D DT 50
Operands
Index
Relay Timer/Counter Register Constant Index
Operand register
modifier
WX WY WR SV EV DT IX IY K H
S1 A A A A A A N/A N/A N/A N/A A
S2 A A A A A A A A A A A
A: Available
D N/A A A A A A N/A N/A N/A N/A A N/A: Not Available
Explanation of example
Converts ASCII codes (6 bytes) that express decimal digits in data registers DT2 to DT0 to 16-bit data when
execution condition (trigger) R0 turns on. The converted data is stored in data register DT50.
Source DT2 DT1 DT0
ASCII HEX code 3 0 3 0 3 1 2 D 3 0 3 0
ASCII character 0 0 1 —
6 bytes
In this case, this position should
be set to “SPACE” or “0”.
Destination DT50
Bit position 15 · · 12 11 · · 8 7 · · 4 3 · · 0
Decimal data K - 100
3 - 155
High - level Instructions FP0
Description
Converts the ASCII codes that express the decimal digits, starting from the 16-bit area specified by S1 to
16-bit data as specified by S2. The converted result is stored in the area specified by D.
S2 specifies the number of source data bytes to be converted using decimal number. (This specification
cannot be made with BCD data.)
Flag conditions
S Error flag (R9007): Turns on and stays on when:
-The area specified using the index modifier exceeds the limit.
-The number of bytes specified by S2 exceeds the area specified by S1.
-The data specified by S2 is recognized as “0”.
-The converted result exceeds the 16-bit area specified by D.
-The converted result exceeds the 16 - bit area.
-ASCII code not corresponding to decimal numbers (0 to 9) or ASCII
characters (+, - , and SPACE) is specified.
S Error flag (R9008): Turns on for an instant when:
- The area specified using the index modifier exceeds the limit.
- The number of bytes specified by S2 exceeds the area specified by S1.
- The data specified by S2 is recognized as “0”.
- The converted result exceeds the 16-bit area specified by D.
- The converted result exceeds the 16 - bit area.
- ASCII code not corresponding to decimal numbers (0 to 9) or ASCII
characters (+, - , and SPACE) is specified.
Conversion Example
The following shows conversion from ASCII codes to decimal data in a 16 - bit configuration.
Example of converting an ASCII code indicating a negative number
ASCII code
S1+2 S1+1 S1
30 30 31 2D 30 30
0 0 1 - (0) (0)
Range specified by S2
3 - 156
FP0 High- level Instructions
Example 1:
ASCII code
S1+2 S1+1 S1
30 30 31 2B 20 20
0 0 1 + (Space) (Space)
Range specified by S2
Example 2:
ASCII code
S1+2 S1+1 S1
30 30 31 20 20 20
0 0 1 (Space) (Space) (Space)
Range specified by S2
3 - 157
High - level Instructions FP0
5 Step Availability
F77 (DBIA) 32-bit data → ASCII code 11 FP0 C10, C14, C16,
C32, T32, SL1
Outline Converts 32-bit data to ASCII code that expresses the equivalent
decimals.
Program example
Boolean
Ladder Diagram
Address Instruction
Trigger 10 ST R 0
11 F 77 (DBIA)
R0
DT 0
10 F77 DBIA , DT 0 , K 10 , DT 50
K 10
S1 S2 D DT 50
Operands
Index
Relay Timer/Counter Register Constant Index
Operand register
modifier
WX WY WR SV EV DT IX IY K H
S1 A A A A A A A N/A A A A
S2 A A A A A A A N/A A A A
A: Available
D N/A A A A A A N/A N/A N/A N/A A N/A: Not Available
Explanation of example
Converts the 32-bit data stored in data registers DT1 and DT0 to ASCII code that expresses the equivalent
decimals when execution condition (trigger) R0 turns on. The converted data is stored in data registers DT54
to DT50 (10 bytes).
Source DT1 DT0
Bit position 15 · · 1211 · · 8 7 · · 4 3 · · 0 15 · · 1211 · · 8 7 · · 4 3 · · 0
Decimal K12345678
3 - 158
FP0 High- level Instructions
Description
Converts the 32-bit data specified by S1 to ASCII code that expresses the equivalent decimals. The
converted result is stored in the area starting from the 16-bit area specified by D as specified by S2.
S2 specifies the number of bytes used to express the destination data using decimal.
Flag conditions
S Error flag (R9007): Turns on and stays on when:
- The area specified using the index modifier exceeds the limit.
- The number of bytes specified by S2 exceeds the area specified by D.
- The data specified by S2 is recognized as “0”.
- The converted result exceeds the area specified by D.
- The number of bytes of converted result exceeds the number of bytes
specified by S2.
- Number of bytes specified by S2 < Number of bytes specified by S1.
S Error flag (R9008): Turns on for an instant when:
- The area specified using the index modifier exceeds the limit.
- The number of bytes specified by S2 exceeds the area specified by D.
- The data specified by S2 is recognized as “0”.
- The converted result exceeds the area specified by D.
- The number of bytes of converted result exceeds the number of bytes
specified by S2.
- Number of bytes specified by S2 < Number of bytes specified by S1.
3 - 159
High - level Instructions FP0
Conversion Example
The following shows conversion from 32 - bit decimal format data to ASCII codes.
Example of converting a negative number
32- bit data S1+1 S1
FF 43 9E B2
K - 12345678
K12345678
ASCII code
3 - 160
FP0 High- level Instructions
5 Step Availability
F78 (DABI) ASCII code → 32-bit data 11 FP0 C10, C14, C16,
C32, T32, SL1
Outline Converts ASCII code that expresses decimal digits to 32-bit data that
expresses the equivalent number.
Program example
Boolean
Ladder Diagram
Address Instruction
Trigger 10 ST R 0
11 F 78 (DABI)
R0
DT 0
10 F78 DABI , DT 0 , K 10 , DT 50
K 10
S1 S2 D DT 50
Operands
Index
Relay Timer/Counter Register Constant Index
Operand register
modifier
WX WY WR SV EV DT IX IY K H
S1 A A A A A A N/A N/A N/A N/A A
S2 A A A A A A A N/A A A A
A: Available
D N/A A A A A A N/A N/A N/A N/A A N/A: Not Available
Explanation of example
Converts ASCII codes (10 bytes) that express decimal digits in data registers DT4, DT3, DT2, DT1 and DT0
to 32-bit data when execution condition (trigger) R0 turns on. The converted data is stored in data registers
DT51 and DT50.
Source DT4 DT3 DT2 DT1 DT0
ASCII HEX code 3 8 3 7 3 6 3 5 3 4 3 3 3 2 3 1 2 0 2 0
ASCII character 8 7 6 5 4 3 2 1
3 - 161
High - level Instructions FP0
Description
Converts ASCII code that expresses the decimal digits, starting from the 16-bit area specified by S1 to 32-bit
data as specified by S2. The converted result is stored in the area starting from the 16-bit area specified by D.
S2 specifies the number of bytes used to express the destination data using decimals.
Flag conditions
S Error flag (R9007): Turns on and stays on when:
-The area specified using the index modifier exceeds the limit.
-The number of bytes specified by S2 exceeds the area specified by S1.
-The data specified by S2 is recognized as “0”.
-The converted result exceeds the area specified by D.
-The converted result exceeds the 32-bit area.
-ASCII code not corresponding to decimal numbers (0 to 9) or ASCII
characters (+, - , and SPACE) is specified.
S Error flag (R9008): Turns on for an instant when:
- The area specified using the index modifier exceeds the limit.
- The number of bytes specified by S2 exceeds the area specified by S1.
- The data specified by S2 is recognized as “0”.
- The converted result exceeds the area specified by D.
- The converted result exceeds the 32-bit area.
- ASCII code not corresponding to decimal numbers (0 to 9) or ASCII
characters (+, - , and SPACE) is specified.
3 - 162
FP0 High- level Instructions
Conversion Example
The following shows conversion from ASCII codes to decimal data in a 32 - bit configuration.
Example of converting an ASCII code indicating a negative number
ASCII code
S1+4 S1+3 S1+2 S1+1 S1
38 37 36 35 34 33 32 31 2D 20
8 7 6 5 4 3 2 1 - (Space)
K - 12345678
Example 1:
ASCII code
S1+3 S1+2 S1+1 S1
38 37 36 35 34 33 32 31
7 8 6 5 4 3 2 1
ASCII code
Example 2:
ASCII code
S1+4 S1+3 S1+2 S1+1 S1
38 37 36 35 34 33 32 31 2B 20
8 7 6 5 4 3 2 1 + (Space)
K12345678
3 - 163
High - level Instructions FP0
3 - 164
FP0 High- level Instructions
Outline Converts 16-bit binary data to BCD code the expresses a 4-digit
decimal.
Program example
Boolean
Ladder Diagram
Address Instruction
10 ST R 0
Trigger 11 F 80 (BCD)
R0 DT 10
10 F80 BCD , DT10 , DT20 DT 20
S D
S 16-bit equivalent constant or 16-bit area for storing 16- bit binary data (source)
D 16-bit area for 4-digit BCD data (destination)
Operands
Index
Relay Timer/Counter Register Constant Index
Operand register
modifier
WX WY WR SV EV DT IX IY K H
S A A A A A A A A A A A
A: Available
D N/A A A A A A A A N/A N/A A N/A: Not Available
Explanation of example
Converts the contents of data register DT10 to BCD code that expresses a 4-digit decimal when execution
condition (trigger) R0 turns on. The converted data is stored in data register DT20.
If DT10 is 16 using decimal number conversion, the following will be stored in DT20.
Source [S]: K16
Bit position 15 · · 1211 · · 8 7 · · 4 3 · · 0
DT10 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0
Decimal K16
3 - 165
High - level Instructions FP0
Description
Converts the 16-bit binary data specified by S to BCD code that expresses a 4-digit decimal. The converted
data is stored in D.
Flag conditions
S Error flag (R9007): Turns on and stays on when:
- The area specified using the index modifier exceeds the limit.
- 16-bit binary data outside the range of K0 (H0) to K9999 (H270F) is
converted.
S Error flag (R9008): Turns on for an instant when:
- The area specified using the index modifier exceeds the limit.
- 16-bit binary data outside the range of K0 (H0) to K9999 (H270F) is
converted.
3 - 166
FP0 High- level Instructions
Outline Converts BCD code that expresses a 4-digit decimal to 16-bit binary
data.
Program example
Boolean
Ladder Diagram
Address Instruction
10 ST R 0
Trigger 11 F 81 (BIN)
R0 DT 10
10 F81 BIN , DT10 , DT0 DT 0
S D
S 4-digit BCD equivalent constant or 16-bit area for 4-digit BCD data (source)
D 16-bit area for storing 16-bit binary data (destination)
Operands
Index
Relay Timer/Counter Register Constant Index
Operand register
modifier
WX WY WR SV EV DT IX IY K H
S A A A A A A A A A A A
A: Available
D N/A A A A A A A A N/A N/A A N/A: Not Available
Explanation of example
Converts the contents of data register DT10 to 16-bit binary data when execution condition (trigger) R0 turns
on. The converted data is stored in data register DT0.
If DT10 is BCD data consisting of H15, the following will be stored in DT0.
Source [S]: H15 (BCD)
Bit position 15 · · 1211 · · 8 7 · · 4 3 · · 0
DT10 0 0 0 0 0 0 0 0 0 0 0 1 0 1 0 1
BCD H code 0 0 1 5
Description
Converts BCD code that expresses a 4-digit decimal specified by S to 16-bit binary data. The converted data
is stored in D.
3 - 167
High - level Instructions FP0
Flag conditions
S Error flag (R9007): Turns on and stays on when:
- The area specified using the index modifier exceeds the limit.
- The data specified by S is not BCD data.
S Error flag (R9008): Turns on for an instant when:
- The area specified using the index modifier exceeds the limit.
- The data specified by S is not BCD data.
3 - 168
FP0 High- level Instructions
5 Step Availability
F82 (DBCD) 32-bit data → 8-digit BCD data 7 FP0 C10, C14, C16,
C32, T32, SL1
Outline Converts 32-bit binary data to BCD code that expresses an 8-digit
decimal.
Program example
Boolean
Ladder Diagram
Address Instruction
10 ST R 20
Trigger
11 F 82 (DBCD)
R20 DT 0
10 F82 DBCD, DT 0 , DT 2 DT 2
S D
S 32-bit equivalent constant or lower 16-bit area of 32-bit data (source)
D Lower 16-bit area for 8-digit BCD code (destination)
Operands
Index
Relay Timer/Counter Register Constant Index
Operand register
modifier
WX WY WR SV EV DT IX IY K H
S A A A A A A A N/A A A A
A: Available
D N/A A A A A A A N/A N/A N/A A N/A: Not Available
Explanation of example
Converts the contents of data registers DT1 and DT0 to BCD code that expresses an 8-digit decimal when
execution condition (trigger) R20 turns on. The converted data is stored in data registers DT3 and DT2.
Description
Converts the 32-bit data specified by S to BCD code that expresses an 8-digit decimal. The converted data is
stored in D+1 and D.
Flag conditions
S Error flag (R9007): Turns on and stays on when:
- The area specified using the index modifier exceeds the limit.
- 32-bit data specified by S outside the range of K0 (H0) to K99999999
(H5F5E0FF) is converted.
S Error flag (R9008): Turns on for an instant when:
- The area specified using the index modifier exceeds the limit.
- 32-bit data specified by S outside the range of K0 (H0) to K99999999
(H5F5E0FF) is converted.
3 - 169
High - level Instructions FP0
5 Step Availability
F83 (DBIN) 8-digit BCD data → 32-bit data 7 FP0 C10, C14, C16,
C32, T32, SL1
Outline Converts BCD code that expresses an 8-digit decimal to 32-bit binary
data.
Program example
Boolean
Ladder Diagram
Address Instruction
10 ST R 10
Trigger
11 F 83 (DBIN)
R10 DT 0
10 F83 DBIN, DT 0 , DT 2 DT 2
S D
S 8-digit BCD equivalent constant or lower 16-bit area for 8-digit BCD code
(source)
D Lower 16-bit area for 32-bit data (destination)
Operands
Index
Relay Timer/Counter Register Constant Index
Operand register
modifier
WX WY WR SV EV DT IX IY K H
S A A A A A A A N/A A A A
A: Available
D N/A A A A A A A N/A N/A N/A A N/A: Not Available
Explanation of example
Converts BCD code that expresses an 8 - digit decimal of data registers DT1 and DT0 to 32-bit binary data
when execution condition (trigger) R10 turns on. The converted data is stored in data registers DT3 and DT2.
Description
Converts BCD code that expresses an 8-digit decimal specified by S to 32-bit binary data. The converted
data is stored in D+1 and D.
For detailed information about the BCD data section 4.2.
Flag conditions
S Error flag (R9007): Turns on and stays on when:
- The area specified using the index modifier exceeds the limit.
- The data specified by S is not BCD data.
S Error flag (R9008): Turns on for an instant when:
- The area specified using the index modifier exceeds the limit.
- The data specified by S is not BCD data.
3 - 170
FP0 High- level Instructions
5 Step Availability
10 ST R 20
Trigger
11 F 84 (INV)
R20 DT 0
10 F84 INV , DT 0
Operands
Index
Relay Timer/Counter Register Constant Index
Operand register
modifier
WX WY WR SV EV DT IX IY K H
A: Available
D N/A A A A A A A A N/A N/A A N/A: Not Available
Explanation of example
Inverts the contents of data register DT0 when execution condition (trigger) R20 turns on.
Destination
Bit position 15 · · 1211 · · 8 7 · · 4 3 · · 0
DT0 0 1 0 1 1 1 1 0 1 0 1 1 1 1 0 1
Description
Inverts each bit (0 or 1) of the 16-bit data specified by D.
This instruction is useful for controlling an external device (7 - segment display) that uses negative logic
operation.
Flag conditions
S Error flag (R9007): Turns on and stays on when the area specified using the index modifier
exceeds the limit.
S Error flag (R9008): Turns on for an instant when the area specified using the index modifier
exceeds the limit.
3 - 171
High - level Instructions FP0
5 Step Availability
F85 (NEG) 16-bit data two’s complement 3 FP0 C10, C14, C16,
C32, T32, SL1
10 ST R 20
Trigger
11 F 85 (NEG)
R20 DT 0
10 F85 NEG , DT 0
D
D 16-bit area for storing original data and its two’s complement
Operands
Index
Relay Timer/Counter Register Constant Index
Operand register
modifier
WX WY WR SV EV DT IX IY K H
A: Available
D N/A A A A A A A A N/A N/A A N/A: Not Available
Explanation of example
Takes two’s complement of data register DT0 when execution condition (trigger) R20 turns on.
Destination
Bit position 15 · · 1211 · · 8 7 · · 4 3 · · 0
DT0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1
Decimal data K3
R20: on
Destination
Bit position 15 · · 1211 · · 8 7 · · 4 3 · · 0
DT0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1
Decimal data K-3
Description
Takes two’s complement of 16-bit data specified by D.
The two’s complement is obtained by inverting all bits and adding 1 to the inverted result.
This instruction is useful for changing the sign of 16-bit data from positive to negative or from negative to
positive.
Flag conditions
S Error flag (R9007): Turns on and stays on when the area specified using the index modifier
exceeds the limit.
S Error flag (R9008): Turns on for an instant when the area specified using the index modifier
exceeds the limit.
3 - 172
FP0 High- level Instructions
5 Step Availability
F86 (DNEG) 32-bit data two’s complement 3 FP0 C10, C14, C16,
C32, T32, SL1
D
D Lower 16-bit area of 32-bit data for storing original data and its two’s
complement
Operands
Index
Relay Timer/Counter Register Constant Index
Operand register
modifier
WX WY WR SV EV DT IX IY K H
A: Available
D N/A A A A A A A N/A N/A N/A A N/A: Not Available
Explanation of example
Takes two’s complement of data registers DT1 and DT0 when execution condition (trigger) R20 turns on.
Destination DT1 DT0
Bit position 15 · · 1211 · · 8 7 · · 4 3 · · 0 15 · · 1211 · · 8 7 · · 4 3 · · 0
Binary data 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1
Decimal data K-3
Description
Takes two’s complement of 32-bit data specified by D.
The two’s complement is obtained by inverting all bits and adding 1 to the inverted result.
This instruction is useful for changing the sign of 32-bit data from positive to negative or from negative to
positive.
Flag conditions
S Error flag (R9007): Turns on and stays on when the area specified using the index modifier
exceeds the limit.
S Error flag (R9008): Turns on for an instant when the area specified using the index modifier
exceeds the limit.
3 - 173
High - level Instructions FP0
5 Step Availability
D
D 16-bit area for storing original data and its absolute value
Operands
Index
Relay Timer/Counter Register Constant Index
Operand register
modifier
WX WY WR SV EV DT IX IY K H
A: Available
D N/A A A A A A A A N/A N/A A N/A: Not Available
Explanation of example
Takes absolute value of data register DT0 when execution condition (trigger) R20 turns on.
For instance, regardless of whether the value of DT0 is K1 or K - 1, it will be K1 when the instruction is
executed.
Description
Takes absolute value of signed 16-bit data specified by D. The absolute value of the signed 16-bit data is
stored in D.
This is effective for processing data in which the polarity (+ or - ) changes.
Flag conditions
S Error flag (R9007): Turns on and stays on when:
- The area specified using the index modifier exceeds the limit.
- The 16-bit data is the negative minimum value “K-32768 (H8000).”
S Error flag (R9008): Turns on for an instant when:
- The area specified using the index modifier exceeds the limit.
- The 16-bit data is the negative minimum value “K-32768 (H8000).”
S Carry flag (R9009): Turns on for an instant when 16-bit data is the negative value “range: K-1 to
K-32767 (HFFFF to H8001).”
3 - 174
FP0 High- level Instructions
5 Step Availability
10 ST R 20
Trigger
11 F 88 (DABS)
R20 DT 0
10 F88 DABS , DT 0
D Lower 16-bit area of 32-bit data for storing original data and its absolute value
Operands
Index
Relay Timer/Counter Register Constant Index
Operand register
modifier
WX WY WR SV EV DT IX IY K H
A: Available
D N/A A A A A A A N/A N/A N/A A N/A: Not Available
Explanation of example
Takes absolute value of data registers DT1 and DT0 when execution condition (trigger) R20 turns on. The
absolute value of DT1 and DT0 is stored in data registers DT1 and DT0.
Description
Takes the absolute value of signed 32-bit data specified by D. The absolute value of the 32-bit data is stored
in D+1 and D.
This is effective for processing data in which the polarity (+ or - ) changes.
Flag conditions
S Error flag (R9007): Turns on and stays on when:
- The area specified using the index modifier exceeds the limit.
- The 32-bit data is the negative minimum value “K-2147483648
(H80000000).”
S Error flag (R9008): Turns on for an instant when:
- The area specified using the index modifier exceeds the limit.
- The 32-bit data is the negative minimum value “K-2147483648
(H80000000).”
S Carry flag (R9009): Turns on for an instant when 32-bit data is negative value “range K-1 to
K-2147483647 (HFFFFFFFF to H80000001).”
3 - 175
High - level Instructions FP0
5 Step Availability
FP0 C10, C14, C16,
F89 (EXT) 16-bit data sign extension 3
C32, T32, SL1
Outline Copies the sign bit of the specified 16-bit data to all the bits of the higher
16-bit area (extended 16-bit area).
Program example
Boolean
Ladder Diagram
Address Instruction
10 ST R 20
Trigger
11 F 89 (EXT)
R20 DT 0
10 F89 EXT , DT 0
Operands
Index
Relay Timer/Counter Register Constant Index
Operand register
modifier
WX WY WR SV EV DT IX IY K H
A: Available
D N/A A A A A A A N/A N/A N/A A N/A: Not Available
Explanation of example
Copies the sign bit (bit position 15) of data register DT0 to all the bits of data register DT1 when execution
condition (trigger) R20 turns on.
If K - 2 is stored in DT0, the data will be as follows.
Sign bit (0: positive, 1: negative)
DT0
Bit position 15 · · 1211 · · 8 7 · · 4 3 · · 0
Binary data 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0
Decimal data K-2
16-bit data
R20: on
DT1 DT0
Bit position 15 · · 1211 · · 8 7 · · 4 3 · · 0 15 · · 1211 · · 8 7 · · 4 3 · · 0
Binary data 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0
Decimal data K-2
32-bit data
3 - 176
FP0 High- level Instructions
Description
16 - bit data is converted to 32 - bit data, without signs and values being changed.
If the sign bit (bit position 15) of the 16 - bit data specified by D is 0, all 16 bits of the next area of D will be set to
0. If the sign bit is 1, all 16 bits will be set to 1.
Double word data with D as the first data can be used as the operand of 32 - bit operation instructions
following execution of the F89 (EXT) instruction.
Flag conditions
S Error flag (R9007): Turns on and stays on when the area specified using the index modifier
exceeds the limit.
S Error flag (R9008): Turns on for an instant when the area specified using the index modifier
exceeds the limit.
3 - 177
High - level Instructions FP0
Operands
Index
Relay Timer/Counter Register Constant Index
Operand register
modifier
WX WY WR SV EV DT IX IY K H
S A A A A A A A A A A A
n A A A A A A A A A A A
A: Available
D N/A A A A A A A A N/A N/A A N/A: Not Available
Explanation of example
Decodes data register DT10 according to the contents of n “H404” when execution condition (trigger) R20
turns on. The decoded result is stored in data register DT20.
When n: H404
Bit position 4
Source
Bit position 15 · · 1211 · · 8 7 · · 4 3 · · 0 4 bits from bit position 4 to 7 of DT10 are decoded.
DT10 0 1 0 0 0 1 1 0 0 1 1 1 1 0 0 1 [Binary: 0111 (decimal: K7)]
4 bits
R20: on
Destination
Bit position 15 · · 1211 · · 8 7 · · 4 3 · · 0 The decoded data “1 (on)” is stored in bit position 7 of
DT20 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 DT20.
The bits except bit position 7 become 0.
Description
Decodes the contents of 16-bit data specified by S according to the contents of n. The decoded result is
stored in the area starting from 16-bit area specified by D.
The length of the area required to store decoding results changes depending on the length of the data being
decoded.
3 - 178
FP0 High- level Instructions
16-bit data
Bit position 15 · · 12 11 · · 8 7 · · 4 3 · · 0
n ———— 0 1 0 0 ———— 0 1 0 0 The bits of “ - ” mark are invalid.
Relationship between number of bits and occupied data area for decoded result
Number of bits to be decoded Data area required for the result Valid bits in the area for 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 data area required for the result are set to “0”.
3 - 179
High - level Instructions FP0
Decoded example
When decoding 4-bit data, 16-bit data for the decoded result is shown below.
Decoding conditions (n)
Starting bit position: H0 (bit position 0)
Number of bits to be decoded: H4 (4 bits)
Flag conditions
S Error flag (R9007): Turns on and stays on when:
- The area specified using the index modifier exceeds the limit.
- The number of bits to be decoded is outside the range of 1 to 8.
- The sum of the number of bits to be decoded and the starting bit position to
be decoded is outside the range of 1 to 16.
- The last data area for the decoded result exceeds the limit.
S Error flag (R9008): Turns on for an instant when:
- The area specified using the index modifier exceeds the limit.
- The number of bits to be decoded is outside the range of 1 to 8.
- The sum of the number of bits to be decoded and the starting bit position to
be decoded is outside the range of 1 to 16.
- The last data area for the decoded result exceeds the limit.
3 - 180
FP0 High- level Instructions
10 ST R 0
Trigger 11 F 91 (SEGT)
DT 0
R0
10 F91 SEGT , DT 0 , DT10 DT 10
S D
Operands
Index
Relay Timer/Counter Register Constant Index
Operand register
modifier
WX WY WR SV EV DT IX IY K H
S A A A A A A A A A A A
A: Available
D N/A A A A A A A N/A N/A N/A A N/A: Not Available
Explanation of example
Converts the contents of data register DT0 to 4-digit data for 7-segment indication when execution condition
(trigger) R0 turns on. The converted data is stored in word internal relays DT11 and DT10.
For example, to display ”ABCD”, the following would be entered.
Source
Bit position 15 · · 12 11 · · 8 7 · · 4 3 · · 0
DT0 1 0 1 0 1 0 1 1 1 1 0 0 1 1 0 1
Hexadecimal A B C D
Destination
Bit position 15 · · 1211 · · 8 7 · · 4 3 · · 0 Bit position 15 · · 1211 · · 8 7 · · 4 3 · · 0
DT11 0 1 1 1 0 1 1 1 0 1 1 1 1 1 0 0 DT10 0 0 1 1 1 0 0 1 0 1 0 1 1 1 1 0
7-segment 7-segment
A B C D
indication indication
3 - 181
High - level Instructions FP0
Description
Converts the 16-bit equivalent constant or 16-bit data specified by S to 4-digit data for 7-segment indication.
The converted data is stored in the area starting from the 16-bit area specified by D.
The relationship between the displayed contents and the contents specified for S, and the data of the
7 - segment display is shown below.
H1 0 0 0 1 0 0 0 0 0 1 1 0
H2 0 0 1 0 0 1 0 1 1 0 1 1 LSB
H3 0 0 1 1 0 1 0 0 1 1 1 1 a
H4 0 1 0 0 0 1 1 0 0 1 1 0 b
H5 0 1 0 1 0 1 1 0 1 1 0 1 c
a
H6 0 1 1 0 0 1 1 1 1 1 0 1 d
f g b
H7 0 1 1 1 0 0 1 0 0 1 1 1 e
H8 1 0 0 0 0 1 1 1 1 1 1 1 f
e c
H9 1 0 0 1 0 1 1 0 1 1 1 1 g
d
HA 1 0 1 0 0 1 1 1 0 1 1 1
HB 1 0 1 1 0 1 1 1 1 1 0 0 MSB
HC 1 1 0 0 0 0 1 1 1 0 0 1
HD 1 1 0 1 0 1 0 1 1 1 1 0
HE 1 1 1 0 0 1 1 1 1 0 0 1
HF 1 1 1 1 0 1 1 1 0 0 0 1
Flag conditions
S Error flag (R9007): Turns on and stays on when:
- The area specified using the index modifier exceeds the limit.
- The last data area for the converted result exceeds the limit.
S Error flag (R9008): Turns on for an instant when:
- The area specified using the index modifier exceeds the limit.
- The last data area for the converted result exceeds the limit.
3 - 182
FP0 High- level Instructions
Operands
Index
Relay Timer/Counter Register Constant Index
Operand register
modifier
WX WY WR SV EV DT IX IY K H
S A A A A A A N/A N/A N/A N/A A
n A A A A A A A A A A A
A: Available
D N/A A A A A A A A N/A N/A A N/A: Not Available
Explanation of example
Encodes contens of data register DT11 and DT10 according to the contents of DT0 when execution condition
(trigger) R0 turns on. The encoded result is stored in 8 bits of data register DT1 starting from bit position 0.
When DT0: H0005
3 - 183
High - level Instructions FP0
Description
Encodes the contents of data specified by S according to the contents of n. The encoded result is stored in the
16-bit area specified by D starting from the specified bit position.
If more than one bit is on in a segment being decoded, the uppermost bit is effective.
The contents of the 2nL segment at the beginning of the area specified by the S are encoded. The encoded
results are stored as decimal data, in the eight bits starting from the bit specified as the nH bit.
Invalid bits in the specified area for the result are set to 0.
How to specify control data “n”
n specifies the starting bit position of destination data and the number of bits to be decoded using
hexadecimal data.
16-bit data
Bit position 15 · · 12 11 · · 8 7 · · 4 3 · · 0
n ———— 0 0 0 0 ———— 0 1 0 1
The bits of “ - ” mark are invalid.
3 - 184
FP0 High- level Instructions
Encoded example
When encoding 16-bit data (nL=4), the encoded results are shown below.
Flag conditions
S Error flag (R9007): Turns on and stays on when:
- The area specified using the index modifier exceeds the limit.
- The number of bits to be encoded is outside the range of 1 to 8.
- The sum of the number of bits to be encoded and the starting bit position to
be encoded is outside the range of 1 to 16.
- The data to be encoded is 0.
S Error flag (R9008): Turns on for an instant when:
- The area specified using the index modifier exceeds the limit.
- The number of bits to be decoded is outside the range of 1 to 8.
- The sum of the number of bits to be decoded and the starting bit position to
be decoded is outside the range of 1 to 16.
- The data to be encoded is 0.
3 - 185
High - level Instructions FP0
Outline Extracts the lower 4 bits (bit positions 0 to 3) of the specified 16-bit areas
and combines them into one word.
Program example
Boolean
Ladder Diagram
Address Instruction
Trigger 10 ST R 0
11 F 93 (UNIT)
R0 DT 0
10 F93 UNIT, DT 0, K 3 , DT 100
K 3
DT 100
S n D
S Starting 16-bit area to be extracted (source)
n 16-bit equivalent constant or 16-bit area to specify number of data to be extracted
D 16-bit area for storing combined data (destination)
Operands
Index
Relay Timer/Counter Register Constant Index
Operand register
modifier
WX WY WR SV EV DT IX IY K H
S A A A A A A N/A N/A N/A N/A A
n A A A A A A A A A A A
A: Available
D N/A A A A A A A A N/A N/A A N/A: Not Available
Explanation of example
Extracts lower 4 bits of data registers DT2 to DT0, combines the extracted data, and stores it in data register
DT100 when execution condition (trigger) R0 turns on.
Bit position 15 · · 12 11 · · 8 7 · · 4 3 · · 0
DT0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1
DT1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0
DT2 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0
Bit position 15 · · 12 11 · · 8 7 · · 4 3 · · 0
DT100 0 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1
3 - 186
FP0 High- level Instructions
Description
Extracts the lower 4 bits (bit positions 0 to 3) of each specified area, starting from the 16-bit area specified by
S and combines the extracted data into one word. The result is stored in the 16-bit area specified by D.
n specifies the number of data areas to be extracted (range of n: K0 to K4).
When K0 is specified for n, this instruction is not executed.
When n < K4, “0” is automatically set to positions at D where the corresponding 16-bit source data does not
exist.
Source
Bit position 15 · · 1211 · · 8 7 · · 4 3 · · 0
S Digit 1
S+1 Digit 2
n
S+2 Digit 3
S+3 Digit 4
Destination
Bit position 15 · · 1211 · · 8 7 · · 4 3 · · 0
D Digit 4 Digit 3 Digit 2 Digit 1
Flag conditions
S Error flag (R9007): Turns on and stays on when:
- The area specified using the index modifier exceeds the limit.
- The number of data areas to be combined “n” is K5 or more.
S Error flag (R9008): Turns on for an instant when:
- The area specified using the index modifier exceeds the limit.
- The number of data areas to be combined “n” is K5 or more.
3 - 187
High - level Instructions FP0
Outline Divides the specified 16-bit data into four 4-bit units and distributes the
divided data into the lower 4 bits of the specified 16-bit areas.
Program example
Boolean
Ladder Diagram
Address Instruction
Trigger 10 ST R 0
11 F 94 (DIST)
R0 DT 100
10 F94 DIST, DT100, K 4 , DT 0
K 4
DT 0
S n D
S 16-bit equivalent constant or 16-bit area to be divided (source)
n 16-bit equivalent constant or 16-bit area to specify number of data to be divided
D Starting 16-bit area for storing divided data (destination)
Operands
Index
Relay Timer/Counter Register Constant Index
Operand register
modifier
WX WY WR SV EV DT IX IY K H
S A A A A A A A A A A A
n A A A A A A A A A A A
A: Available
D N/A A A A A A N/A N/A N/A N/A A N/A: Not Available
Explanation of example
Divides the 16-bit data of data register DT100 into 4-bit units and the divided data is stored in the lower 4 bits
(bit positions 0 to 3) of data registers DT0 to DT3 when execution condition (trigger) R0 turns on.
Bit position 15 · · 12 11 · · 8 7 · · 4 3 · · 0
DT100 0 1 1 1 0 0 1 1 0 0 0 1 0 0 0 0
Bit position 15 · · 12 11 · · 8 7 · · 4 3 · · 0
DT0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
DT1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1
DT2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1
DT3 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1
3 - 188
FP0 High- level Instructions
Description
Divides the 16-bit data specified by S into 4-bit units and distributes the divided data into the lower 4 bits (bit
positions 0 to 3) of 16-bit areas starting from D.
n specifies the number of data divisions.(range of n: K0 to K4)
When K0 is specified for n, this instruction is not executed.
n
Source
Bit position 15 · · 12 11 · · 8 7 · · 4 3 · · 0
S Digit 4 Digit 3 Digit 2 Digit 1
Destination
Bit position 15 · · 12 11 · · 8 7 · · 4 3 · · 0
D Digit 1
D+1 Digit 2
D+2 Digit 3
D+3 Digit 4
Flag conditions
S Error flag (R9007): Turns on and stays on when:
- The area specified using the index modifier exceeds the limit.
- The number n is 5 or more.
- Transferring address specified by D to n data, and when area is exceeded.
S Error flag (R9008): Turns on for an instant when:
- The area specified using the index modifier exceeds the limit.
- The number n is 5 or more.
- Transferring address specified by D to n data, and when area is exceeded.
3 - 189
High - level Instructions FP0
Trigger 10 ST R 20
11 F 95 (ASC)
R20 M
10 ABC1230_DEF
F95 ASC, M ABC1230_DEF, DT 2
DT 2
S D
Operands
Index
Relay Timer/Counter Register Constant Index
Operand register
modifier
WX WY WR SV EV DT IX IY K H M
S N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A A N/A
A: Available
D N/A A A A A A A N/A N/A N/A N/A N/A N/A: Not Available
Explanation of example
Converts the character constants “ABC1230_DEF” to ASCII code when execution condition (trigger) R20
turns on. The ASCII code is stored in data registers DT7 to DT2.
Character constant
R20: on
SPACE
When the number of character constants specified by S is less than 12, the ASCII code H20 (SPACE) is
stored in the extra destination area.
Description
Converts the character constants specified by S to ASCII code. The converted ASCII code is stored in 6
words starting from the 16-bit area specified by D.
3 - 190
FP0 High- level Instructions
R20: on
DT2: H20 ( ) H41 (A)
[
]
]
]
]
]
]
]
]
]
]
]
11 spaces 6 spaces 5 spaces
R20 R20
F95 ASC, M A , DT 2 F95 ASC, M A , DT 2
R20: on R20: on
DT2: H20 ( ) H20 ( ) DT2: H20 ( ) H20 ( )
[
[
DT3: H20 ( ) H20 ( ) DT3: H20 ( ) H20 ( )
[
3 - 191
High - level Instructions FP0
Flag conditions
S Error flag (R9007): Turns on and stays on when the last area for ASCII code exceeds the limit
(6 words: six 16-bit areas).
S Error flag (R9008): Turns on for an instant when the last area for ASCII code exceeds the limit
(6 words: six 16-bit areas).
ASCII code
b7
b6 0 0 0 0 1 1 1 1
b5 0 0 1 1 0 0 1 1
b4 0 1 0 1 0 1 0 1
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
Least significant digit
0 1 1 1 7 BEL ETB ’ 7 G W g w
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 {
FF FS , < L \ l
1 1 0 0 C
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
3 - 192
FP0 High- level Instructions
Trigger 10 ST R 10
11 F 96 (SRC)
R10 DT 100
10 F96 SRC , DT100 , DT 0 , DT 20
DT 0
DT 20
S1 S2 S3
S1 16-bit equivalent constant or 16-bit area to store the searched value
S2 Starting 16-bit area of the block
S3 Ending 16-bit area of the block
Operands
Index
Relay Timer/Counter Register Constant Index
Operand register
modifier
WX WY WR SV EV DT IX IY K H
S1 A A A A A A A A A A A
S2 A A A A A A N/A N/A N/A N/A A
A: Available
S3 N/A A A A A A N/A N/A N/A N/A A N/A: Not Available
3 - 193
High - level Instructions FP0
Explanation of example
Searches for the value given in data register DT100 in the block of data register DT0 through DT20 when
execution condition (trigger) R10 turns on.
For example, to search the area of the value called H1234, “H1234” would be written to DT100.
Searched data Block of 16- bit areas
DT100: 1 2 3 4 DT0: 1 2 1 1 0 [S2]
[S1] DT1: 1 2 F F 1
DT2: 1 2 3 4 2
DT3: 7 F F F 3
Searching
DT19: 1 2 3 4 19
DT20: 1 2 3 4 20 [S3]
If DT2, DT19, and DT20 match the search data, the following occurs.
- If the number of registers matching the search data = 3
“K3” is stored in DT9037.
- If the position of the first matching data (the relative position number) = 2
“K2” is stored in DT9038.
Description
Searches for values matching S1 in the block of 16-bit areas specified by S2 (starting area) through S3
(ending area).
When the search operation is performed, the search results are stored as follows.
- The number of data items that match S1 is stored in special data register DT9037.
- The position of the first matching data item, counting from the starting 16-bit area S2, is stored in
special data register DT9038.
Starting area S2 and ending area S3 should:
- Be the same type of operand.
- Satisfy S2 ≦ S3.
Data is searched from S2 to S3.
Flag conditions
S Error flag (R9007): Turns on and stays on when:
- The area specified using the index modifier exceeds the limit.
- S2 > S3.
S Error flag (R9008): Turns on for an instant when:
- The area specified using the index modifier exceeds the limit.
- S2 > S3.
3 - 194
FP0 High- level Instructions
Program example
Boolean
Ladder Diagram
Address Instruction
10 ST R 0
Trigger
11 F100 (SHR)
DT 0
R0
10 F100 SHR , DT 0 , K 4 K 4
D n
Operands
Index
Relay Timer/Counter Register Constant Index
Operand register
modifier
WX WY WR SV EV DT IX IY K H
D N/A A A A A A A A N/A N/A A
A: Available
n A A A A A A A A A A A N/A: Not Available
Explanation of example
Shifts 4 bits in data register DT0 to the right when execution condition (trigger) R0 turns on.
The data in bit position 3 is transferred to special internal relay R9009 (carry flag).
3 - 195
High - level Instructions FP0
Description
Shifts n bits of the 16-bit data area specified by D to the right (to the lower bit position).
n
Bit position 15 · · 1211 · · 8 7 · · 4 3 · · 0
D
The data in the n th bit is transferred to R9009 (carry flag).
Flag conditions
S Error flag (R9007): Turns on and stays on when the area specified using the index modifier
exceeds the limit.
S Error flag (R9008): Turns on for an instant when the area specified using the index modifier
exceeds the limit.
S Carry flag (R9009): Turns on for an instant when the content of bit transferred to R9009 (n th bit)
is recognized as 1.
3 - 196
FP0 High- level Instructions
Program example
Boolean
Ladder Diagram
Address Instruction
10 ST R 0
Trigger
11 F101 (SHL)
DT 0
R0
10 F101 SHL , DT 0 , K4 K 4
D n
Operands
Index
Relay Timer/Counter Register Constant Index
Operand register
modifier
WX WY WR SV EV DT IX IY K H
D N/A A A A A A A A N/A N/A A
A: Available
n A A A A A A A A A A A N/A: Not Available
Explanation of example
Shifts 4 bits in data register DT0 to the left when execution condition (trigger) R0 turns on.
The data in bit position 12 is transferred to special internal relay R9009 (carry flag).
3 - 197
High - level Instructions FP0
Description
Shifts n bits of the 16-bit area specified by D to the left (to the higher bit position).
n
Bit position 15 · · 1211 · · 8 7 · · 4 3 · · 0
D
The data in the n th bit is
transferred to R9009
(carry flag). Bit position 15 · · 1211 · · 8 7 · · 4 3 · · 0
D 0 0 0 0
15 · · 1211 · · 8 7 · · 4 3 · · 0
n ———— ———— 0 0 0 0 0 0 0 0
Flag conditions
S Error flag (R9007): Turns on and stays on when the area specified using the index modifier
exceeds the limit.
S Error flag (R9008): Turns on for an instant when the area specified using the index modifier
exceeds the limit.
S Carry flag (R9009): Turns on for an instant when the content of bit transferred to R9009 (n th bit)
is recognized as 1.
3 - 198
FP0 High- level Instructions
Outline Shifts one hexadecimal digit (4 bits) of the specified 16-bit data to the
right.
Program example
Boolean
Ladder Diagram
Address Instruction
10 ST R 0
Trigger
11 F105 (BSR)
DT 0
R0
10 F105 BSR , DT 0
Operands
Index
Relay Timer/Counter Register Constant Index
Operand register
modifier
WX WY WR SV EV DT IX IY K H
A: Available
D N/A A A A A A A A N/A N/A A N/A: Not Available
Explanation of example
Shifts one hexadecimal digit (4 bits) in data register DT0 to the right when execution condition (trigger) R0
turns on.
The data in hexadecimal digit position 1 (bit positions 0 to 3) is shifted out and transferred to the lower digit
position (bit positions 0 to 3) of special data register DT9014.
Bit position 15 · · 1211 · · 8 7 · · 4 3 · · 0
Binary 1 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1
DT0
Hexadecimal 9 9 9 9 (H9999)
R0: on
3 - 199
High - level Instructions FP0
Description
Shifts one hexadecimal digit (4 bits) of the 16-bit area specified by D to the right (to the lower digit position).
Bit position 15 · · 1211 · · 8 7 · · 4 3 · · 0
D Hexadecimal Digit 4 Digit 3 Digit 2 Digit 1
Flag conditions
S Error flag (R9007): Turns on and stays on when the area specified using the index modifier
exceeds the limit.
S Error flag (R9008): Turns on for an instant when the area specified using the index modifier
exceeds the limit.
3 - 200
FP0 High- level Instructions
Outline Shifts one hexadecimal digit (4 bits) of the specified 16-bit data to the
left.
Program example
Boolean
Ladder Diagram
Address Instruction
10 ST R 0
Trigger
11 F106 (BSL)
DT 0
R0
10 F106 BSL, DT 0
Operands
Index
Relay Timer/Counter Register Constant Index
Operand register
modifier
WX WY WR SV EV DT IX IY K H
A: Available
D N/A A A A A A A A N/A N/A A N/A: Not Available
Explanation of example
Shifts one hexadecimal digit (4 bits) in data register DT0 to the left when execution condition (trigger) R0 turns
on.The data in hexadecimal digit position 4 (bit positions 12 to 15) is shifted out and transferred to the lower
digit position (bit positions 0 to 3) of special data register DT9014.
Bit position 15 · · 1211 · · 8 7 · · 4 3 · · 0
Binary 1 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0
DT0
Hexadecimal 8 1 0 0 (H8100)
R0: on
Bit position 15 · · 1211 · · 8 7 · · 4 3 · · 0
Binary 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0
DT0
Hexadecimal 1 0 0 0 (H1000)
3 - 201
High - level Instructions FP0
Description
Shifts one hexadecimal digit (4 bits) of the 16-bit area specified by D to the left (to the higher digit position).
Bit position 15 · · 1211 · · 8 7 · · 4 3 · · 0
D Hexadecimal Digit 4 Digit 3 Digit 2 Digit 1
Flag conditions
S Error flag (R9007): Turns on and stays on when the area specified using the index modifier
exceeds the limit.
S Error flag (R9008): Turns on for an instant when the area specified using the index modifier
exceeds the limit.
3 - 202
FP0 High- level Instructions
Outline Shifts one word (16 bits) of a specified 16-bit data range to the right.
Program example
Boolean
Ladder Diagram
Address Instruction
10 ST R 0
Trigger
11 F110 (WSHR)
DT 0
R0
10 F110 WSHR , DT 0 , DT 2 DT 2
D1 D2
Operands
Index
Relay Timer/Counter Register Constant Index
Operand register
modifier
WX WY WR SV EV DT IX IY K H
D1 N/A A A A A A N/A N/A N/A N/A A
A: Available
D2 N/A A A A A A N/A N/A N/A N/A A N/A: Not Available
Explanation of example
Shifts one word (16 bits) of the data range (3 words) from DT0 through DT2 to the right when execution
condition (trigger) R0 turns on.
Specified data range (3 words)
3 - 203
High - level Instructions FP0
Description
Shifts one word (16 bits) of the data range specified by D1 (starting) and D2 (ending) to the right (to the lower
word address).
Specified data range
D2 D1
D2 D1
0
Flag conditions
S Error flag (R9007): Turns on and stays on when:
- The area specified using the index modifier exceeds the limit.
- D1 > D2.
S Error flag (R9008): Turns on for an instant when:
- The area specified using the index modifier exceeds the limit.
- D1 > D2.
3 - 204
FP0 High- level Instructions
Outline Shifts one word (16 bits) of a specified 16-bit data range to the left.
Program example
Boolean
Ladder Diagram
Address Instruction
10 ST R 0
Trigger
11 F111 (WSHL)
DT 0
R0
10 F111 WSHL , DT 0 , DT 2 DT 2
D1 D2
Operands
Index
Relay Timer/Counter Register Constant Index
Operand register
modifier
WX WY WR SV EV DT IX IY K H
D1 N/A A A A A A N/A N/A N/A N/A A
A: Available
D2 N/A A A A A A N/A N/A N/A N/A A N/A: Not Available
Explanation of example
Shifts one word (16 bits) of the data range (3 words) from DT0 through DT2 to the left when execution
condition (trigger) R0 turns on.
Specified data range (3 words)
3 - 205
High - level Instructions FP0
Description
Shifts one word (16 bits) of the data range specified by D1 (starting) and D2 (ending) to the left (to the higher
word address).
Specified data range
D2 D1
The ending
word is shifted out.
D2 D1
0
Flag conditions
S Error flag (R9007): Turns on and stays on when:
- The area specified using the index modifier exceeds the limit.
- D1 > D2.
S Error flag (R9008): Turns on for an instant when:
- The area specified using the index modifier exceeds the limit.
- D1 > D2.
3 - 206
FP0 High- level Instructions
Outline Shifts one hexadecimal digit (4 bits) of a specified 16-bit data range to
the right.
Program example
Boolean
Ladder Diagram
Address Instruction
10 ST R 0
Trigger
11 F112 (WBSR)
DT 0
R0
10 F112 WBSR , DT 0 , DT 9 DT 9
D1 D2
Operands
Index
Relay Timer/Counter Register Constant Index
Operand register
modifier
WX WY WR SV EV DT IX IY K H
D1 N/A A A A A A N/A N/A N/A N/A A
A: Available
D2 N/A A A A A A N/A N/A N/A N/A A N/A: Not Available
Explanation of example
Shifts one hexadecimal digit (4 bits) of the data range (10 words) from DT0 through DT9 to the right when
execution condition (trigger) R0 turns on.
3 - 207
High - level Instructions FP0
Description
Shifts one hexadecimal digit (4 bits) of the data range specified by D1 (starting) and D2 (ending) to the right (to
the lower digit position).
Specified data range
D2 D1
15· ·1211 · · 8 7 · · 4 3 · · 0 15· · · · 0 15· ·1211 · · 8 7 · · 4 3 · · 0
Flag conditions
S Error flag (R9007): Turns on and stays on when:
- The area specified using the index modifier exceeds the limit.
- D1 > D2.
S Error flag (R9008): Turns on for an instant when:
- The area specified using the index modifier exceeds the limit.
- D1 > D2.
3 - 208
FP0 High- level Instructions
Outline Shifts one hexadecimal digit (4 bits) of a specified 16-bit data range to
the left.
Program example
Boolean
Ladder Diagram
Address Instruction
10 ST R 0
Trigger
11 F113 (WBSL)
DT 0
R0
10 F113 WBSL , DT 0 , DT 9 DT 9
D1 D2
Operands
Index
Relay Timer/Counter Register Constant Index
Operand register
modifier
WX WY WR SV EV DT IX IY K H
D1 N/A A A A A A N/A N/A N/A N/A A
A: Available
D2 N/A A A A A A N/A N/A N/A N/A A N/A: Not Available
Explanation of example
Shifts one hexadecimal digit (4 bits) of the data range (10 words) from DT0 through DT9 to the left when
execution condition (trigger) R0 turns on.
Specified data range (10 words = 40 digits)
DT9 DT0
15 · ·1211 · · 8 7 · · 4 3 · · 0 15 · · · · 0 15 · ·1211 · · 8 7 · · 4 3 · · 0
0 2 1 2 1 0 2 3 2
R0: on
The data “0” in the
higher hexadecimal
digit (bit positions 12
DT9 DT0
to 15) is shifted out. 15 · ·1211 · · 8 7 · · 4 3 · · 0 15 · · · · 0 15 · 1211 · · 8 7 · · 4 3 · · 0
2 1 2 1 0 2 3 2 0
3 - 209
High - level Instructions FP0
Description
Shifts one hexadecimal digit (4 bits) of the data range specified by D1 (starting) and D2 (ending) to the left (to
the higher digit position).
D2 D1
15· ·1211 · · 8 7 · · 4 3 · · 0 15· · · · 0 15· ·1211 · · 8 7 · · 4 3 · · 0
Flag conditions
S Error flag (R9007): Turns on and stays on when:
- The area specified using the index modifier exceeds the limit.
- D1 > D2.
S Error flag (R9008): Turns on for an instant when:
- The area specified using the index modifier exceeds the limit.
- D1 > D2.
3 - 210
FP0 High- level Instructions
Program example
Boolean
Ladder Diagram
Address Instruction
50 ST R 0
R0 UP/DOWN input F118 UDC
50 51 ST R 1
R1 Count input DT 10 52 ST R 2
S
51 53 F118 (UDC)
R2 Reset input DT 0 DT 10
D
52
DT 0
R900B R50
58 58 ST R 900B
59 OT R 50
Operands
Index
Relay Timer/Counter Register Constant Index
Operand register
modifier
WX WY WR SV EV DT IX IY K H
D1 A A A A A A N/A N/A A A N/A
A: Available
D2 N/A A A A A A N/A N/A N/A N/A N/A N/A: Not Available
Explanation of example
The program shows an example in which initial values are set, and when the target value is 0, R50 goes on.
This can be used, for example, in programs such as those that cause a display lamp to light when the work
being added or subtracted has reached a certain quantity.
When the trailing edge of rest input R2 is detected (on → off), data in data register DT10 is transferred to DT0.
One is subtracted from value of DT0 when the count input R1 turns on while R0 is in the off state. (DOWN
counter operation)
One is added to DT0 when the count input R1 turns off while the R0 is in the on state. (Up counter operation)
If DT0 = K0, special internal relay R900B (= flag) turns on and then internal relay R50 turns on.
3 - 211
High - level Instructions FP0
on
R2 off
on
R0 off
on
R1 off
on
R50 off
Value
of DT0
Time
Preset
Reset
Description
The counter is switched between an incremental count (addition) or decremental count (subtraction) by
turning the relay specified for up/down input on or off.
When the up/down input is on, the incremental counter (+1) is effective, and when it is off, the decremental
counter ( - 1) is effective. The elapsed value is stored in the area specified by the D.
The preset value in S is transferred to D when the trailing edge of the reset input is detected (on → off). Set
value range K-32768 to K32767 (H8000 to H7FFF)
When the count input is switched from off to on (the reset input is in “Off” state), the value specified for the D is
initialized, and the counting operation begins.
The elapsed value area of D is cleared when the reset input turns on.
The results of the counting operation can be determined by comparing the elapsed value of D with the
specified value, using the data comparison instruction.
The data comparison instruction should be executed immediately following execution of this instruction.
Flag conditions
S = flag (R900B): Turns on for an instant when the elapsed value area D is recognized as “0”.
S Carry flag (R9009): Turns on for an instant when the elapsed value area D value is “K - 32768 to
K - 1”.
Precautions during programming
If the elapsed value area has been specified as a hold type memory area, the elapsed value acts in
accordance with the contents being retained.
Be aware that, when an operation is begun, the set values are not automatically preset to the elapsed value
area. To preset these values, the reset input must be switched from the “on” to the “off” state.
When combining the F118 (UDC) instruction with an AND stack instruction or POP stack instruction, be
careful that the programming is correct.
For detailed information section 4.6
3 - 212
FP0 High- level Instructions
Count intput
Operation of
instruction
No count done Count done
When you use the F118 (UDC) instruction with one of the following instructions that changes the order of the
execution of instructions, be aware that the operation of the instructions will differ depending on the timing of
their execution and their count input.
- MC to MCE instructions
- JP to LBL instructions
- LOOP to LBL instructions
- CNDE instruction
- Step ladder instructions
- Subroutine instruction
For detailed information section 4.5
3 - 213
High - level Instructions FP0
Outline Shifts one bit of the 16-bit data range to the left or right. 18
Program example
Boolean
Ladder Diagram
Address Instruction
Left/right input 50 ST R 0
R0 (on: left, off: right) F119 LRSR 51 ST R 1
50
DT 0 52 ST R 2
R1 Data input D1
51 53 ST R 3
R2 DT 9 54 F119 (LRSR)
Shift input D2
52 DT 0
R3 DT 9
Reset input
53
D1 Starting 16-bit area whose one bit is shifted to the left or to the
right
D2 Ending 16-bit area whose one bit is shifted to the left or to the
right
Operands
Index
Relay Timer/Counter Register Constant Index
Operand register
modifier
WX WY WR SV EV DT IX IY K H
D1 N/A A A A A A N/A N/A N/A N/A N/A
A: Available
D2 N/A A A A A A N/A N/A N/A N/A N/A N/A: Not Available
3 - 214
FP0 High- level Instructions
Explanation of example
Left shift operation
DT9 DT0
Bit position 15 . . 12 11 . . 8 7 . . 4 3 . . 0 15 . . 12 11 . . 8 7 . . 4 3 . . 0
Data 0 0 0 1 0 0 0 1 0 0 0 1 0 0 0 1 1 0 0 0 1 0 0 0 1 0 0 0 1 1 0 0
R0: on
Shifted-out bit is transferred R2: off → on
to R9009 (carry flag).
R0: off
R2: off → on
Description
This shift register changes direction, either left (direction of MSB) or right (direction of LSB), in which a shift of
one bit is made, based on the on/off status of the relay specified by the left/right shift input.
The shift operation is made to the left when the left/right shift input is on, and to the right when off.
Specify D1 and D2 so they are in the same type data area and be sure to set the data area addresses so that
D1 ≦ D2.
When the shift input changes from off to on (the reset input is off), the contents of the area specified by D1 and
D2 are shifted one bit to the left or right.
When the data is shifted, 1 will be set in the empty bit left by the shift (the uppermost or lowermost bit) if the
data input is on, and 0 if the data input is off. Also, the bit extracted by the shift (the uppermost bit for a shift to
the left, and the lowermost bit for a shift to the right) will be set in the special internal relay R9009 (carry flag).
If the reset input is on, the contents of the specified area are cleared to 0.
3 - 215
High - level Instructions FP0
Flag conditions
S Error flag (R9007): Turns on and stays on when the area specified using the starting 16-bit area
(D1) is larger than the area specified by the ending 16-bit area (D2) (when D1
> D2).
S Error flag (R9008): Turns on for an instant when the area specified using the starting 16-bit area
(D1) is larger than the area specified by the ending 16-bit area (D2) (when D1
> D2).
S Carry flag (R9009): Turns on for an instant when the bit shifted-out is “1”.
Shift input
Operation of
instruction
No shift made Shift made
When you use the F119 (LRSR) instruction with one of the following instructions that changes the order of the
execution of instructions, be aware that the operation of the instructions will differ depending on the timing of
their execution and their shift input.
- MC to MCE instructions
- JP to LBL instructions
- LOOP to LBL instructions
- CNDE instruction
- Step ladder instructions
- Subroutine instruction
For detailed information section 4.5
3 - 216
FP0 High- level Instructions
Outline Rotates a specified number of bits in specified 16-bit data to the right.
Program example
Boolean
Ladder Diagram
Address Instruction
Trigger 10 ST R 0
11 F120 (ROR)
R0 DT 0
10 F120 ROR , DT 0 , K 4 K 4
D n
D 16-bit area
n 16-bit equivalent constant or 16-bit area to specify number of bits to be rotated
Operands
Index
Relay Timer/Counter Register Constant Index
Operand register
modifier
WX WY WR SV EV DT IX IY K H
D N/A A A A A A A A N/A N/A A
A: Available
n A A A A A A A A A A A N/A: Not Available
Explanation of example
Rotates 4 bits in data register DT0 to the right when execution condition (trigger) R0 turns on.
Bit position 15 · · 12 11 · · 8 7 · · 4 3 · · 0
DT0 0 0 0 1 0 0 1 0 0 0 1 1 0 1 0 0
R0: on
Bit position 15 · · 12 11 · · 8 7 · · 4 3 · · 0
DT0 0 1 0 0 0 0 0 1 0 0 1 0 0 0 1 1
3 - 217
High - level Instructions FP0
Description
Rotates n bits of the 16-bit data specified by D to the right.
Example: Rotates 1 bit to the right
Bit position 15 · · 1211 · · 8 7 · · 4 3 · · 0
D 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1
Flag conditions
S Error flag (R9007): Turns on and stays on when the area specified using the index modifier
exceeds the limit.
S Error flag (R9008): Turns on for an instant when the area specified using the index modifier
exceeds the limit.
S Carry flag (R9009): Turns on for an instant when the data in bit position n-1 is recognized as 1.
3 - 218
FP0 High- level Instructions
Outline Rotates a specified number of bits in specified 16-bit data to the left.
Program example
Boolean
Ladder Diagram
Address Instruction
Trigger 10 ST R 0
11 F121 (ROL)
R0 DT 0
10 F121 ROL , DT 0 , K 4 K 4
D n
D 16-bit area
n 16-bit equivalent constant or 16-bit area to specify number of bits to be rotated
Operands
Index
Relay Timer/Counter Register Constant Index
Operand register
modifier
WX WY WR SV EV DT IX IY K H
D N/A A A A A A A A N/A N/A A
A: Available
n A A A A A A A A A A A N/A: Not Available
Explanation of example
Rotates 4 bits in data register DT0 to the left when execution condition (trigger) R0 turns on.
Bit position 15 · · 12 11 · · 8 7 · · 4 3 · · 0
DT0 0 0 0 1 0 0 1 0 0 0 1 1 0 1 0 0
R0: on
Bit position 15 · · 12 11 · · 8 7 · · 4 3 · · 0
DT0 0 0 1 0 0 0 1 1 0 1 0 0 0 0 0 1
3 - 219
High - level Instructions FP0
Description
Rotates n bits of the 16-bit data specified by D to the left.
Example: Rotates 1 bit to the left
Bit position 15 · · 12 11 · · 8 7 · · 4 3 · · 0
D 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1
Bit position 15 · · 12 11 · · 8 7 · · 4 3 · · 0
D 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0
Flag conditions
S Error flag (R9007): Turns on and stays on when the area specified using the index modifier
exceeds the limit.
S Error flag (R9008): Turns on for an instant when the area specified using the index modifier
exceeds the limit.
S Carry flag (R9009): Turns on for an instant when the data in bit position 16-n is recognized as 1.
3 - 220
FP0 High- level Instructions
Outline Rotates a specified number of bits in the specified 16-bit data to the right
together with carry flag data.
Program example
Boolean
Ladder Diagram
Address Instruction
Trigger 10 ST R 0
11 F122 (RCR)
R0 DT 0
10 F122 RCR , DT 0 , K 4 K 4
D n
D 16-bit area
n 16-bit equivalent constant or 16-bit area to specify number of bits to be rotated
Operands
Index
Relay Timer/Counter Register Constant Index
Operand register
modifier
WX WY WR SV EV DT IX IY K H
D N/A A A A A A A A N/A N/A A
A: Available
n A A A A A A A A A A A N/A: Not Available
Explanation of example
Rotates 4 bits in data register DT0 together with carry flag data “1” to the right when execution condition
(trigger) R0 turns on.
Bit position 15 · · 12 11 · · 8 7 · · 4 3 · · 0
DT0 0 0 0 1 0 0 1 0 0 0 1 1 0 1 0 0
R0: on
n-1: 3 bits
Bit position 15 · · 12 11 · · 8 7 · · 4 3 · · 0
DT0 1 0 0 1 0 0 0 1 0 0 1 0 0 0 1 1
3 - 221
High - level Instructions FP0
Description
Rotates n bits of the 16-bit data specified by D, including carry flag data, to the right.
Example: Rotates 1 bit to the right
Bit position 15 · · 1211 · · 8 7 · · 4 3 · · 0
D 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1
When n bits with carry flag data are rotated to the right,
- The data in bit position n-1 (n th bit starting from bit position 0) is transferred to special internal relay
R9009 (carry flag).
- n bits starting from bit position 0 are shifted out to the right and then carry flag data and the n-1 bits
starting from bit position 0 are shifted into the higher bit positions of the 16-bit data specified by D.
For n, only the lower 8 bits in the 16 bits data are valid.
15 0
n ———— ———— 0 0 0 00 0 0 0
Flag conditions
S Error flag (R9007): Turns on and stays on when the area specified using the index modifier
exceeds the limit.
S Error flag (R9008): Turns on for an instant when the area specified using the index modifier
exceeds the limit.
S Carry flag (R9009): Turns on for an instant when the data in bit position n-1 is recognized as 1.
3 - 222
FP0 High- level Instructions
Outline Rotates a specified number of bits in the specified 16-bit data to the left
together with carry flag data.
Program example
Boolean
Ladder Diagram
Address Instruction
Trigger 10 ST R 0
11 F123 (RCL)
R0 DT 0
10 F123 RCL , DT 0 , K 4 K 4
D n
D 16-bit area
n 16-bit equivalent constant or 16-bit area to specify number of bits to be rotated
Operands
Index
Relay Timer/Counter Register Constant Index
Operand register
modifier
WX WY WR SV EV DT IX IY K H
D N/A A A A A A A A N/A N/A A
A: Available
n A A A A A A A A A A A N/A: Not Available
Explanation of example
Rotates 4 bits in data register DT0 together with carry flag data “1” to the left when execution condition
(trigger) R0 turns on.
Bit position 15 · · 12 11 · · 8 7 · · 4 3 · · 0
DT0 0 0 0 1 0 0 1 0 0 0 1 1 0 1 0 0
R0: on
Bit position 15 · · 12 11 · · 8 7 · · 4 3 · · 0
DT0 0 0 1 0 0 0 1 1 0 1 0 0 1 0 0 0
3 - 223
High - level Instructions FP0
Description
Rotates n bits of the 16-bit data specified by D, including carry flag data, to the left.
Example: Rotates 1 bit to the left
Bit position 15 · · 12 11 · · 8 7 · · 4 3 · · 0
D 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1
Bit position 15 · · 12 11 · · 8 7 · · 4 3 · · 0
D 1 0 1 0 1 0 1 0 1 0 1 0 1 0 10
When n bits with carry flag data are rotated to the left,
- The data in bit position 16-n (n th bit starting from bit position 15) is transferred to special internal relay
R9009 (carry flag).
- n bits starting from bit position 15 are shifted out to the left and then carry flag data and the n-1 bits
starting from bit position 15 are shifted into the lower bit positions of the 16-bit data specified by D.
For n, only the lower 8 bits in the 16 bits data are valid.
15 0
n ———— ———— 0 0 0 00 0 0 0
Flag conditions
S Error flag (R9007): Turns on and stays on when the area specified using the index modifier
exceeds the limit.
S Error flag (R9008): Turns on for an instant when the area specified using the index modifier
exceeds the limit.
S Carry flag (R9009): Turns on for an instant when the data in bit position 16-n is recognized as 1.
3 - 224
FP0 High- level Instructions
Program example
Boolean
Ladder Diagram
Address Instruction
Trigger 10 ST R 0
11 F130 (BTS)
R0 DT 0
10 F130 BTS , DT 0 , DT 2 DT 2
D n
D 16-bit area
n 16-bit equivalent constant or 16-bit area to specify bit position
Operands
Index
Relay Timer/Counter Register Constant Index
Operand register
modifier
WX WY WR SV EV DT IX IY K H
D N/A A A A A A A A N/A N/A A
A: Available
n A A A A A A A A A A A N/A: Not Available
Explanation of example
Turns on bit position specified by DT2 in data register DT0 when execution condition (trigger) R0 turns on.
When the DT2 = K7, as shown below.
[n] DT2: K7
Bit position 15 · · 12 11 · · 8 7 · · 4 3 · · 0
[D] DT0 0 1 0 0 0 0 1 1 0 0 1 0 0 0 0 1
R0: on
Bit position 15 · · 12 11 · · 8 7 · · 4 3 · · 0
[D] DT0 0 1 0 0 0 0 1 1 1 0 1 0 0 0 0 1
3 - 225
High - level Instructions FP0
Description
Turns on the bit of 16-bit data specified by D and n.
Bits other than the specified bit do not change.
n is decimal data specifying the bit position to be turned on. Range of n: K0 to K15
Bit position 15 · · 12 11 · · 8 7 · · 4 3 · · 0
n ———— ———— ————
Flag conditions
S Error flag (R9007): Turns on and stays on when the area specified using the index modifier
exceeds the limit.
S Error flag (R9008): Turns on for an instant when the area specified using the index modifier
exceeds the limit.
3 - 226
FP0 High- level Instructions
Program example
Boolean
Ladder Diagram
Address Instruction
Trigger 10 ST R 0
11 F131 (BTR)
R0 DT 0
10 F131 BTR , DT 0 , DT 2 DT 2
D n
D 16-bit area
n 16-bit equivalent constant or 16-bit area to specify bit position
Operands
Index
Relay Timer/Counter Register Constant Index
Operand register
modifier
WX WY WR SV EV DT IX IY K H
D N/A A A A A A A A N/A N/A A
A: Available
n A A A A A A A A A A A N/A: Not Available
Explanation of example
Turns off the bit specified by DT2 of data register DT0 when execution condition (trigger) R0 turns on.
When the DT2 = K7, as shown below.
[n] DT2: K7
Bit position 15
· · 12 11 · · 8 7 · · 4 3 · · 0
[D] DT0 1 1 0 1 1 1 0 0 1 0 1 1 1 0 1 0
R0: on
Bit position 15 · · 12 11 · · 8 7 · · 4 3 · · 0
[D] DT0 1 1 0· 1 1 1 0 0 0 0 1 1 1 0 1 0
3 - 227
High - level Instructions FP0
Description
Turns off the bit of 16-bit data specified by D and n.
Bits other than the specified bit do not change.
n is decimal data specifying the bit position to be turned off. Range of n: K0 to K15
Bit position 15 · · 12 11 · · 8 7 · · 4 3 · · 0
n ———— ———— ————
Flag conditions
S Error flag (R9007): Turns on and stays on when the area specified using the index modifier
exceeds the limit.
S Error flag (R9008): Turns on for an instant when the area specified using the index modifier
exceeds the limit.
3 - 228
FP0 High- level Instructions
Program example
Boolean
Ladder Diagram
Address Instruction
10 ST R 0
Trigger
11 F132 (BTI)
R0 DT 0
10 F132 BTI , DT 0 , DT 10 DT 10
D n
D 16-bit area
n 16-bit equivalent constant or 16-bit area to specify bit position
Operands
Index
Relay Timer/Counter Register Constant Index
Operand register
modifier
WX WY WR SV EV DT IX IY K H
D N/A A A A A A A A N/A N/A A
A: Available
n A A A A A A A A A A A N/A: Not Available
Explanation of example
Inverts the state of bit specified by DT10 in data register DT0 when execution condition (trigger) R0 turns on.
When the DT10 = K7, as shown below.
[n] DT10: K7
Bit position 15 · · 12 11 · · 8 7 · · 4 3 · · 0
[D] DT0 0 0 0 0 0 0 0 1 0 0 1 1 0 0 1 0
R0: on
Bit position 15 · · 12 11 · · 8 7 · · 4 3 · · 0
[D] DT0 0 0 0 0 0 0 0 1 1 0 1 1 0 0 1 0
Condition of bit position 7 is inverted [off (0) → on (1)] when R0 turns on.
(Bits other than the specified bit are not changed.)
3 - 229
High - level Instructions FP0
Description
Inverts [off (0) → on (1) or on (1) → off (1)] the state at bit position specified by n in the 16-bit area specified by
D.
Bits other than the specified bit are not inverted.
The n is decimal data specifying the bit position to be inverted. Range of n: K0 to K15
Bit position 15 · · 12 11 · · 8 7 · · 4 3 · · 0
n ———— ———— ———— 0 0 0 0
Flag conditions
S Error flag (R9007): Turns on and stays on when the area specified using the index modifier
exceeds the limit.
S Error flag (R9008): Turns on for an instant when the area specified using the index modifier
exceeds the limit.
3 - 230
FP0 High- level Instructions
5 Step Availability
F133 (BTT) 16-bit data bit test 5 FP0 C10, C14, C16,
C32, T32, SL1
Outline Checks the state [on (1) or off (0)] of the specified bit in 16-bit data.
Program example
Boolean
Ladder Diagram
Address Instruction
10 ST R 0
Trigger
11 F133 (BTT)
D n
DT 0
R0
10 F133 BTT , DT 0 , DT 2 DT 2
16 ST R 0
R0 R900B R10
16 17 AN R 900B
18 OT R 10
D 16-bit area
n 16-bit equivalent constant or 16-bit area to specify bit position
Operands
Index
Relay Timer/Counter Register Constant Index
Operand register
modifier
WX WY WR SV EV DT IX IY K H
D N/A A A A A A A A N/A N/A A
A: Available
n A A A A A A A A A A A N/A: Not Available
Explanation of example
Checks the state [on (1) or off (0)] of bit specified by DT2 in data register DT0 when execution condition
(trigger) R0 turns on. If bit specified by DT2 is in the off (0) state, internal relay R10 goes on.
When the DT2 = K7, as shown below.
[n] DT2:K7
Bit position 15 · · 12 11 · · 8 7 · · 4 3 · · 0
[D] DT0 0 1 0 0 0 0 1 1 0 0 1 0 0 0 0 1
3 - 231
High - level Instructions FP0
Description
Checks the state [on (1) or off (0)] of bit position specified by n in the 16-bit data specified by D. The judgment
result is output to special internal relay R900B (=flag).
The specified bit is checked by special internal relay R900B.
- When the specified bit is on (1), special internal relay R900B (= flag) turns off.
- When the specified bit is off (0), special internal relay R900B (= flag) turns on.
n is decimal data specifying the bit position to be checked. Range of n: K0 to K15
Bit position 15 · · 12 11 · · 8 7 · · 4 3 · · 0
n ———— ———— ———— 0 0 0 0
Precaution when the judgement flag R900B is used two or more times
The judgment flag R900B is updated each time an operation instruction or comparison instruction is
executed.
If the judgment flag is used two or more times,
- the program in which the judgment flag is used should be input immediately following the instruction
which executes the judgment.
- the flag should be output to output relays or internal relays for each separate instruction.
Flag conditions
S Error flag (R9007): Turns on and stays on when the area specified using the index modifier
exceeds the limit.
S Error flag (R9008): Turns on for an instant when the area specified using the index modifier
exceeds the limit.
S = flag (R900B): Turns on for an instant when the specified bit to be checked is in the off (0)
state.
3 - 232
FP0 High- level Instructions
5 Step Availability
F135 (BCU) Number of on bits in 16-bit data 5 FP0 C10, C14, C16,
C32, T32, SL1
Outline Counts the number of bits in the on (1) state in the specified 16-bit data.
Program example
Boolean
Ladder Diagram
Address Instruction
Trigger 10 ST R 0
11 F135 (BCU)
R0 DT 10
10 F135 BCU , DT10 , DT 20
DT 20
S D
Operands
Index
Relay Timer/Counter Register Constant Index
Operand register
modifier
WX WY WR SV EV DT IX IY K H
S A A A A A A A A A A A
A: Available
D N/A A A A A A A A N/A N/A A N/A: Not Available
Explanation of example
Counts the number of bits in the on (1) state in data register DT10 when execution condition (trigger) R0 turns
on. The number of on (1) bits is stored in data register DT20.
DT10
Bit position 15 · · 12 11 · · 8 7 · · 4 3 · · 0
Binary data 0 0 0 0 0 0 0 1 0 0 1 1 0 1 0 1
Description
Counts the number of bits in the on (1) state in the 16-bit data specified by S. The counted result (number of on
(1) bits) is stored in the 16-bit area specified by D.
The results are stored in decimal number.
Flag conditions
S Error flag (R9007): Turns on and stays on when the area specified using the index modifier
exceeds the limit.
S Error flag (R9008): Turns on for an instant when the area specified using the index modifier
exceeds the limit.
3 - 233
High - level Instructions FP0
5 Step Availability
F136 (DBCU) Number of on bits in 32-bit data 7 FP0 C10, C14, C16,
C32, T32, SL1
Outline Counts the number of bits in the on (1) state in specified 32-bit data.
Program example
Boolean
Ladder Diagram
Address Instruction
Trigger 10 ST R 0
11 F136 (DBCU)
R0 DT 10
10 F136 DBCU , DT10 , DT20
DT 20
S D
Operands
Index
Relay Timer/Counter Register Constant Index
Operand register
modifier
WX WY WR SV EV DT IX IY K H
S A A A A A A A N/A A A A
A: Available
D N/A A A A A A A N/A N/A N/A A N/A: Not Available
Explanation of example
Counts the number of bits in the on (1) state in data register DT11 and DT10 when execution condition
(trigger) R0 turns on. The number of on (1) bits is stored in data register DT20.
DT11 DT10
Bit position 15 · · 12 11 · · 8 7 · · 4 3 · · 0 15 · · 12 11 · · 8 7 · · 4 3 · · 0
Binary data 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
Description
Counts the number of bits in the on (1) state in the 32-bit data specified by S. The counted result (number of on
(1) bits) is stored in the 16-bit area specified by D.
The results are stored in decimal number.
Flag conditions
S Error flag (R9007): Turns on and stays on when the area specified using the index modifier
exceeds the limit.
S Error flag (R9008): Turns on for an instant when the area specified using the index modifier
exceeds the limit.
3 - 234
FP0 High- level Instructions
5 Step Availability
Outline Sets the 16 - bit on - delay timer for 0.01 s units (0.01 to 327.67 s)
Program example
Boolean
Ladder Diagram
Address Instruction
Trigger 10 ST R 0
11 F137 (STMR)
R0 R5 DT 10
10 F137 STMR , DT10 , DT20
DT 20
S D 16 OT R 5
Operands
Index
Relay Timer/Counter Register Constant Index
Operand register
modifier
WX WY WR SV EV DT IX IY K H
S A A A A A A A A A A N/A
A: Available
D N/A A A A A A N/A N/A N/A N/A N/A N/A: Not Available
Explanation of example
When the execution condition (trigger) has been fulfilled, the auxiliary timer is activated, and when the value
stored in DT10 x 0.01 seconds has elapsed, R5 goes on.
Description
This functions as a 0.01 - second unit on delay timer. When the execution condition (trigger) is on, subtraction
is carried out for the specified time, and when the elapsed value D reaches 0, relays which are being used are
turned on by the OT instruction which follows in the program.
When the execution condition (trigger) is off, the elapsed value area is cleared to 0, and relays being used are
turned off by the OT instruction.
When the time set for the special internal relay R900D has elapsed, the relay is turned on.
R900D can also be used as a timer contact. (The relay is off when the execution condition (trigger) is off, and
while subtraction is being carried out.)
R0
F137 STMR, DT10,DT20
R900D R5
3 - 235
High - level Instructions FP0
1 Sent to D.
R900D
F0 MV, DT30, DT40 DT20
K500
2 If the execution condition (trigger) stays on, every scan, the value in the elapsed value area D is
subtracted.
R0 R5 DT20
F137 STMR, DT10, DT20
K500
2 Subtraction
R900D 499
F0 MV, DT30, DT40 498
497
3 If the value in the elapsed value area D reaches 0, relay being used is turned on by the OT instruction
which comes next in the program. The special internal relay R900D also goes on at this point.
R0 R5 DT20
F137 STMR, DT10, DT20
0
R900D
F0 MV, DT30, DT40
3 Subtraction completed
3 - 236
FP0 High- level Instructions
R1
F137 STMR, DT30, DT40
Pair
R900D Y1
When timer (a), which is activated by R0 turns on, expires, Y0 goes on. When timer (b), which is activated by
R1 turns on, expires, Y1 goes on.
R900D Y0
R900D Y1
3 - 237
High - level Instructions FP0
5 Step Availability
F140 (STC) Carry flag (R9009) set 1 FP0 C10, C14, C16,
C32, T32, SL1
10 ST R 0
Trigger 11 F140 (STC)
R0
10 F140 STC
Description
Special internal relay R9009 (carry flag) goes on.
Flag condition
Carry flag (R9009): Turns on when this instruction is executed.
3 - 238
FP0 High- level Instructions
5 Step Availability
10 ST R 0
Trigger 11 F141 (CLC)
R0
10 F141 CLC
Description
Special internal relay R9009 (carry flag) goes off.
Flag condition
Carry flag (R9009): Turns off when this instruction is executed.
3 - 239
High - level Instructions FP0
5 Step Availability
Output update 20 ST R 20
R20 21 F143 (IORF)
20 F143 IORF , WY 0 , WY 0
WY 0
D1 D2 WY 0
Operands
Index
Relay Timer/Counter Register Constant Index
Operand register
modifier
WX WY WR SV EV DT IX IY K H
D1 A A N/A N/A N/A N/A N/A N/A N/A N/A A
A: Available
D2 A A N/A N/A N/A N/A N/A N/A N/A N/A A N/A: Not Available
Explanation of example
Updates external input relays WX0 (X0 to XF) immediately when execution condition (trigger) R10 turns on
and updates external output relays WY0 (Y0 to YF) immediately when execution condition (trigger) R20 turns
on.
Description
Updates the inputs and outputs specified by D1 and D2 immediately even in the program execution stage.
With the FP0, refreshing initiated by the F143 (IORF) instruction is done only for the control unit.
With input refreshing, WX0 should be specified for [D1] and [D2].
With output refreshing, WY0 should be specified for [D1] and [D2].
I/O refreshing is not possible with expansion units.
3 - 240
FP0 High- level Instructions
Program example
Boolean
Ladder Diagram
Address Instruction
Trigger 10 ST R 0
11 DF
R0
10 DF 12 F144 (TRNS)
1
DT 100
K 8
1 F144 TRNS, DT 100, K 8
S n
S Starting 16-bit area for storing data to be sent
n 16-bit equivalent constant or 16-bit area to specify number of bytes to be sent
- When the value is positive, an end code is added.
- When the value is negative, an end code is not added.
- When the value is H8000, the transmission mode of the RS232C port is
changed.
Operands
Index
Relay Timer/Counter Register Constant Index
Operand register
modifier
WX WY WR SV EV DT IX IY K H
S N/A N/A N/A N/A N/A A N/A N/A N/A N/A A
A: Available
n A A A A A A A A A A A N/A: Not Available
Description
Use this instruction for transmission and reception of command data when an external device (personal
computer, measuring instrument, bar code reader, etc.) is connected to the RS232C port.
Transmission page 3 - 243
The n bytes of the data stored in the data table with the starting area specified by S are transmitted from the
RS232C port to an external device by serial transmission.
A start code and end code can be automatically added before transmission.
There is no restriction on the number of bytes that can be transmitted. Transmission is possible within the
usage range of the data register.
3 - 241
High - level Instructions FP0
Note
When the power is turned on, the port use will revert to the
setting of system register 412.
Flag conditions
S Error flag (R9007): Turns on and stays on when,
- The area specified using the index modifier exceeds the limit.
- The number of bytes specified by n exceeds the source data area range.
S Error flag (R9008): Turns on for an instant when
- The area specified using the index modifier exceeds the limit.
- The number of bytes specified by n exceeds the source data area range.
3 - 242
FP0 High- level Instructions
[S+1] 2 1
[S+2] 4 3
[S+n] 2n 2n - 1
Write the transmission data to the transmission data storage area selected with S (from the second word on)
using an F0 (MV) or F95 (ASC) instruction.
- Do not include an end code in the transmission data as it will be added automatically.
- If the start code is set to “Yes” in system register 413, do not include a start code in the transmission
data as it will be added automatically.
- There is no restriction on the number of bytes [n] that can be transmitted. Following the initial area of
the data [S], transmission is possible up to the data range that can be used by the data register.
When the F144 (TRNS) instruction is executed, the number of data bytes not yet transmitted is stored in the
starting area of the data table.
Note
Take care that the transmission data table and reception buffer
areas (set in system registers 417 and 418) do not overlap.
3 - 243
High - level Instructions FP0
Program
Select the starting address of the transmission data table with S and the number of transmission data bytes
with n.
R0
F1 DMV, H44434241, DT101 Write the transmission
F1 DMV, H48474645, DT103 data to the data table
R1
DF 1
Operation
If the execution condition (trigger) for the F144 (TRNS) instruction is on when sending completed flag
(R9039) goes on, operation will proceed as follows:
1) n is preset in S (the number of bytes not yet transmitted). Furthermore, reception completed flag
(R9038) is turned off and the reception data number is cleared to zero.
2) The data in the data table is transmitted in order from the lower byte in S+1.
As each byte is transmitted, the value in S (the number of bytes not yet transmitted) decrements by 1.
During transmission, the sending completed flag (R9039) goes off.
If the start code STX is set to “Yes” in system register 413, the start code will be automatically added to the
beginning of the data.
The end code selected in system register 413 is automatically added to the end of the data.
DT101 DT102 DT103 DT104
Sending
data A B C D E F G H (CR)
Number of bytes not 8 7 6 5 4 3 2 1 0
yet transmitted (DT100)
on
R9039 off
Execution condition
on
(trigger) R1 off
F144 (TRNS)
execution During transmission (F144 (TRNS) instruction cannot be executed.)
3) When the specified quantity of data has been transmitted, the value in S (the number of bytes not yet
transmitted) will be zero and the sending completed flag (R9039) will go on.
Transmission without an end code
Specify the number of transmission bytes with a negative number.
For transmission and reception without an end code, set the end code to “None” in system register 413.
Example:
Program for transmitting eight bytes of data without an end
code
R0
DF 1
Set to K - 8.
3 - 244
FP0 High- level Instructions
2 4 3
Each time data is received, the amount of data received (number of bytes) is stored as a count in the leading
address of the reception buffer. The initial value is zero.
The data received is stored in order in the reception data storage area beginning from the lower byte of the
second word of the area.
Example:
Reception of the eight characters A, B, C, D, E, F, G, and H
(eight bytes of data) from an external device
The reception buffer is DT200 to DT204 in this example.
System register settings are as follows:
- System register 417: K200
- System register 418: K4
Each time data is received,
DT200 K8 the number of bytes received
is stored.
DT201 H42 H41
(B) (A)
3 - 245
High - level Instructions FP0
Program
When reception of data from an external device has been completed, the reception completed flag (R9038)
goes on and further reception of data is not allowed.
To receive more data, an F144 (TRNS) instruction must be executed to turn off the reception completed flag
(R9038) and clear the byte number to zero.
R0
F144 TRNS, DT100, K 0
Operation
When the reception completed flag (9038) is off and data is sent from an external device, operation will
proceed as follows. (After RUN, R9038 is off during the first scan.)
1) The data received is stored in order in the reception data storage area of reception buffer beginning
from the lower byte of the second word of the area.
Start and end codes will not be stored.
With each one byte received, the value in the leading address of the reception buffer is incremented by 1.
Reception operation
Reopening
start
Received data A B … T (CR) U V …
Number of bytes 0 1 2 … 20 0 1 2 …
received on
R9038 off
Execution condition on
off
(trigger) R0
Note
For repeated reception of data, refer to the following procedure.
1. Receive data
2. Reception completed (R9038: on, reception not allowed)
3. Process received data
4. Execute F144 (TRNS) instruction (R9038: off, reception)
5. Receive further data
3 - 246
FP0 High- level Instructions
5 Step Availability
Program example
Boolean
Ladder Diagram
Address Instruction
Trigger 10 ST R 0
11 DF
R0
10 (DF ) F147 PR , DT 0 , WY 0 12 OR R 9033
14 F147 (PR)
R9033
12 S D DT 0
Printout flag WY 0
S Starting 16-bit area for storing 12 bytes (6 words) of ASCII codes (source)
D Word external output relay used for output of ASCII codes (destination)
Operands
Index
Relay Timer/Counter Register Constant Index
Operand register
modifier
WX WY WR SV EV DT IX IY K H
S A A A A A A N/A N/A N/A N/A N/A
A: Available
D N/A A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A: Not Available
Explanation of example
The ASCII codes stored in data registers DT5 to DT0 are output through word external output relay WY0
when execution condition (trigger) R0 turns on.
Source: ASCII code for 12 character A, B, C, D, E, F, G, H, I and J
Data register DT5 DT4 DT3 DT2 DT1 DT0
ASCII HEX code 0A 0D 4A 49 48 47 46 45 44 43 42 41
ASCII character LF CR J I H G F E D C B A
3 - 247
High - level Instructions FP0
Description
Outputs the ASCII codes for 12 characters stored in the 6-word area specified by S through the word external
output relay WY specified by D.
15 0
S ! WY (DATA1 to DATA8, STROBE)
S+1
S+2
S+3
S+4
S+5
If the specified output is connected to a commercial printer, the characters corresponding to the output ASCII
code are printed.
Only bit positions 0 to 8 of WY are used in the actual printout.
YF YE YD YC YB YA Y9 Y8 Y7 Y6 Y5 Y4 Y3 Y2 Y1 Y0
WY0
ASCII code is output in order starting from the lower byte of the starting area.
Be sure to set the control code (LF and CR) for the printer as the final word of the data.
Three scans are required for 1 character constant output. Therefore, 37 scans are required until 12 character
constants are output. (See “Time chart” on the next page.)
Precautions during programming
Multiple F147 (PR) instructions cannot be executed at the same time. The program should be set up so that
the printout flag (R9033) is used during execution of F147 (PR) instruction to inhibit simultaneous execution.
The ASCII code conversion instruction F95 (ASC) can be used to convert character constants (M) to ASCII
codes.
Character constants (M) can be input only with programming tool software.
When this instruction is executed, of the WY area specified by D, zero <off> is set for Y_9 to Y_F.
Flag conditions
S Error flag (R9007): Turns on and stays on when:
- The ending area for storing ASCII codes exceeds the limit.
- The trigger of another F147 (PR) instruction turns on while one F147 (PR)
instruction is being executed.
S Error flag (R9008): Turns on for an instant when:
- The ending area for storing ASCII codes exceeds the limit.
- The trigger of another F147 (PR) instruction turns on while one F147 (PR)
instruction is being executed.
S Printout flag (R9033):Turns on and stays on while a F147 (PR) instruction is being executed.
3 - 248
FP0 High- level Instructions
Connection example
Printer
FP0 - C32T (centronics interface)
Y0 DATA1
Y1 DATA2
Y2 DATA3
Y3 DATA4
Y4 DATA5
Y5 DATA6
Y6 DATA7
Y7 DATA8
Y8 STROBE
:
COM GND
Data setting
Example: ASCII code for 10 character A, B, C, D, E, F, G, H, I and J
Data register DT5 DT4 DT3 DT2 DT1 DT0
ASCII HEX code 0A 0D 4A 49 48 47 46 45 44 43 42 41
ASCII character LF CR J I H G F E D C B A
Time chart
A B C D E CR LF
ASCII HEX code (Y0 to Y7) H41 H42 H43 H44 H45 H0D H0A
Signal of
output unit on
Strobe signal (Y8)
off
3 - 249
High - level Instructions FP0
Printer
FP0 - C16T/C32T (centronics interface)
Y0 DATA1
Y1 DATA2
Y2 DATA3
Y3 DATA4
Y4 DATA5
Y5 DATA6
Y6 DATA7
Y7 DATA8
STROBE
COM GND
Program example
R0
F147 PR, DT0, WY0
R9033
Y8 Y7
Strobe signal is output from Y7.
3 - 250
FP0 High- level Instructions
5 Step Availability
Program example
Boolean
Ladder Diagram
Address Instruction
Self - diagnostic error set 10 ST R 0
Trigger
11 F148 (ERR)
n
R0 K 100
10 F148 ERR , K 100 ⋮
20 ST R 1
n
Trigger
n Self-diagnostic error code number Range: 0 and 100 to 299
Operands
Index
Relay Timer/Counter Register Constant Index
Operand register
modifier
WX WY WR SV EV DT IX IY K H
A: Available
n N/A N/A N/A N/A N/A N/A N/A N/A A A N/A N/A: Not Available
Explanation of example
The self - diagnosis error 100 is set when the execution condition (trigger) R0 turns on. The ERROR/ALARM
LED on the controller lights, and operation stops.
(If a situation occurs in which you wish to set the self - diagnosis error 100, set up the program so that input R0
turns on.)
When the execution condition (trigger) R1 turns on, self - diagnostic errors of error codes 43 and higher are
cleared.
Description
Along with self - diagnostic error codes specified by n being stored in the special data register DT9000, the
self - diagnostic error flag (R9000) is turned on. Also, the ERROR/ALARM LED on the controller is turned on.
The specified value “n” is what determines whether operation stops or continues when the instruction is
executed.
“n” setting Operation when error
occurs
K100 to K199 Operation stops
K200 to K299 Operation continues
3 - 251
High - level Instructions FP0
If n is set to a value between K200 and K299, if several F148 (ERR) instructions are processed at one time,
codes are received in sequential order, starting with the lowest number.
If n is set to 0 and the F148 (ERR) instruction is executed, self - diagnostic errors with error codes of 43 and
higher are cleared.
- ERROR/ALARM LED: turned off
- R9000, R9005, R9006, R9007, R9008: Off
- DT9000, DT9017, DT9018: Cleared to 0
F148 (ERR) instructions which specify the same error code can be notated in duplicate in the program.
Flag conditions
S Error flag (R9007): Turns on and stays on when the value of n exceeds the limit of specified
range “K0, or K100 to K299.”
S Error flag (R9008): Turns on and stays on when the value of n exceeds the limit of specified
range “K0, or K100 to K299.”
3 - 252
FP0 High- level Instructions
5 Step Availability
Program example
Boolean
Ladder Diagram
Address Instruction
Trigger 10 ST R 0
11 F149 (MSG)
R0 M TEST PROGRAM
10 F149 MSG , M TEST PROGRAM
Operands
Index
Relay Timer/Counter Register Constant Index
Operand register
modifier
WX WY WR SV EV DT IX IY K H M
S N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A A N/A
A: Available
N/A: Not Available
Explanation of example
Displays the message “TEST PROGRAM” on the screen of the FP programmer II when execution condition
(trigger) R0 turns on.
Description
This instruction is used for displaying message specified by S on the screen of the FP programmer II.
The character constants (M) can be input only with programming tool software.
When the F149 (MSG) instruction is executed, the message flag (R9026) turns on and the message
specified by S is set in special data registers DT9030 to DT9035.
Once the message is set in the special data registers, the message cannot be changed even if the F149
(MSG) instruction is executed again. To clear the message in the special data registers, press
(- )
ACLR
OP
1 1 1 ENT SHIFT
SC
WRT using the FP programmer II.
3 - 253
High - level Instructions FP0
Outline Controls the software reset, disabling of the counter and stops pulse
outputs.
Program example
Boolean
Ladder Diagram
Address Instruction
Trigger 10 ST R 3
11 DF
R3 12 F0 (MV)
10 DF 1 H 1111
1 F0 MV , H 1111 , DT9052 DT 9052
Operands
Index
Relay Timer/Counter Register Constant Index
Operand register
modifier
WX WY WR SV EV DT IX IY K H
S A A A A A A A A A A A A: Available
Description
Controls the high - speed counter according to the control code specified at “S.”
This instruction is used when performing the following operations while using the high - speed counter.
S When performing a software reset.
S When disabling the count.
S When temporarily disabling the hard reset by the external inputs X2 and X5.
S When stopping the positioning and pulse outputs.
S When clearing the controls executed with the high - speed counter instructions F166, F167, F168, F169,
and F170.
S When setting the near home input during home return operations for decelerating the speed of
movement.
When a control code is programmed once, it is saved until the next time it is programmed.
3 - 254
FP0 High- level Instructions
Control code
H0 to HF entered by F0 (MV) instruction.
For more details on how to use the high - speed counter mode setting Chapter 5
Flag conditions
S Error flag (R9007): Turns on and stays on when:
- The area specified using the index modifier exceeds the limit.
- The value of S exceeds the limit of specified range.
S Error flag (R9008): Turns on for an instant when:
- The area specified using the index modifier exceeds the limit.
- The value of S exceeds the limit of specified range.
Example:
Perform software reset . . . . . . . . . . . . . . . . . . . . . . . H1(0001)
Count disable . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . H2(0010)
Stop pulse output . . . . . . . . . . . . . . . . . . . . . . . . . . . . H8(1000)
Turn off pulse output and reset elapsed value . H9(1001)
Enter the control code into the area DT9052/DT90052 of the corresponding channel.
3 - 255
High - level Instructions FP0
Programming example
Example 2: Enable the near home inputting during pulse output control and
decelerate movement.
X3
DF F0 MV, H4, DT9052
3 - 256
FP0 High- level Instructions
Program example
Boolean
Ladder Diagram
Address Instruction
Setting 10 ST R 0
Trigger
11 DF
12 F1 (DMV)
R0 K 3000
10 DF F1 DMV , K 3000 , DT9044
DT 9044
S Elapsed value
area of
high- speed : :
Reading counter : :
Trigger
20 ST R 10
21 DF
R10
22 F1 (DMV)
20 DF F1 DMV , DT9044 , DT 6
DT 9044
S 32-bit equivalent constant or lower 16-bit area of 32-bit data for storing a new
elapsed value of high-speed counter to be changed (source)
D Lower 16- bit area of 32- bit area (destination)
Operands
Index
Relay Timer/Counter Register Constant Index
Operand register
modifier
WX WY WR SV EV DT IX IY K H
S A A A A A A A N/A A A A
A: Available
D N/A A A A A A A N/A N/A N/A A N/A: Not Available
3 - 257
High - level Instructions FP0
3 - 258
FP0 High- level Instructions
Application examples
Example 1: Set the set value of the data register DT4 for the high - speed
counter at the input of R0.
R0
DF F1 DMV, DT4, DT9044
Down input
X0
R0
Value in DT4
Time
0
Setting set value
Example 2: Store the elapsed value of the high - speed counter into data
register DT100 at the input of R1.
R1
DF F1 DMV, DT9044, DT100
3 - 259
High - level Instructions FP0
Outline When the elapsed value of the specified channel (HSC0 to HSC3)
matches the target value, this instruction turns the specified output on.
Program example
Boolean
Ladder Diagram
Address Instruction
10 ST R 0
Trigger
11 DF
12 F166 (HC1S)
R0
10 F166 HC1S , K 0 , K10000 , Y0 K 0
DF
K 10000
n S D Y 0
The channel No. of the high- speed counter that corresponds to the matching
n
output (n: K0 to K3).
The high- speed counter target value data or the starting address of the area
S
that contains the data.
D The output coil that is turned on when the values match (Yn n: 0 to 7)
Operands
Index
Relay Timer/Counter Register Constant Index
Operand register
modifier
WX WY WR SV EV DT IX IY K H
n N/A N/A N/A N/A N/A N/A N/A N/A A A A
S A A A A A A A N/A A A A
A: Available
D N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A: Not Available
Explanation of example
R0
Completion (clear) of
F166 (HC1S) instruction control
R903A
Y0
The special internal relay varies within the range of R903A to R903D, depending on the channel being used.
For detailed information section 5.2
3 - 260
FP0 High- level Instructions
Description
Sets the numerical value specified by S as the target value for the high - speed counter. When the elapsed
value matches this target value, the specified output Yn turns on (executed as an interrupt process).
The control of the target value setting and target value match output is cleared when the target value is
matched.
Set the value of the 32 - bit specified by the target value S within the range given below.
K - 8388608 to K8388607 (H FF800000 to H 007FFFFF)
The value S is stored in the target value area (refer to section 5.2) at the time of execution of the instruction.
The range that can be specified by Yn is from Y0 to Y7.
Precautions during programming
After the execution condition (trigger) for the F166 (HC1S) instruction turns on and until the target value match
output turns on, the high - speed counter control flag for the corresponding channel (refer to section 5.2) is on.
When the high - speed counter control flag for the specified channel is on, other high - speed counter
instructions (F166 to F170) for the same channel cannot be executed.
Before the elapsed value matches the target value, the target value and target value match output settings
will not be cleared, even if a hard reset is performed (the elapsed value is cleared to 0).
For the output Y specified for the target value match output, there is no check whether the output is doubled
up with that of a OT instruction, KP instruction, or other such high - level instructions.
To turn off the target value match output turned on by this instruction, either execute a reset with the RST
instruction or F0 (MV) instruction, or use it together with the F167 (HC1R) instruction.
To execute this instruction, it is necessary to set the high - speed counter mode. For detailed information
section 5.3
Flag conditions
S Error flag (R9007): Turns on and stays on when:
- The area specified using the index modifier exceeds the limit.
- n is number except 0 to 3.
- The value of S exceeds the limit of specified range.
S Error flag (R9008): Turns on for an instant when:
- The area specified using the index modifier exceeds the limit.
- n is number except 0 to 3.
- The value of S exceeds the limit of specified range.
3 - 261
High - level Instructions FP0
Outline When the elapsed value of the specified channel (HSC0 to HSC3)
matches the target value, this instruction turns the specified output off.
Program example
Boolean
Ladder Diagram
Address Instruction
10 ST R 0
Trigger
11 DF
12 F167 (HC1R)
R0
10 DF F167 HC1R , K0 , K - 200 , Y0 K 0
K - 200
n S D Y 0
The channel No. of the high- speed counter that corresponds to the matching
n
output (n: K0 to K3).
The high- speed counter target value data or the starting address of the area
S
that contains the data.
D The output coil that is turned off when the values match (Yn n: 0 to 7)
Operands
Index
Relay Timer/Counter Register Constant Index
Operand register
modifier
WX WY WR SV EV DT IX IY K H
n N/A N/A N/A N/A N/A N/A N/A N/A A A A
S A A A A A A A N/A A A A
A: Available
D N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A: Not Available
Explanation of example
Elapsed value
0
Target value
- 200
R0
Completion (clear) of
F167 (HC1R) instruction control
R903A
Y0
The special internal relay varies within the range of R903A to R903D, depending on the channel being used.
For detailed information section 5.2
3 - 262
FP0 High- level Instructions
Description
Sets the numerical value specified by S as the target value for the high - speed counter. When the elapsed
value matches this target value, the specified output Yn turns off (executed as an interrupt process).
The control of the target value setting and target value match output is cleared when the target value is
matched.
Set the value of the 32 - bit specified by the target value S within the range given below.
K - 8388608 to K8388607 (H FF800000 to H 007FFFF7)
The value S is stored in the target value area (refer to section 5.2) at the time of execution of the instruction.
The range that can be specified by Yn is from Y0 to Y7.
Precautions during programming
After the execution condition (trigger) for the F167 (HC1R) instruction turns on and until the target value
match output turns off, the high - speed counter control flag for the corresponding channel (refer to section
5.2) is on.
When the high - speed counter control flag for the specified channel is on, other high - speed counter
instructions (F166 to F170) for the same channel cannot be executed.
Before the elapsed value matches the target value, the target value and target value match output settings
will not be cleared, even if a hard reset is performed (the elapsed value is cleared to 0).
For the output Y specified for the target value match output, there is no check whether the output is doubled
up with that of a OT instruction, KP instruction, or other such high - level instructions.
To turn on the target value match output turned off by this instruction, either execute a reset with the SET
instruction or F0 (MV) instruction, or use it together with the F166 (HC1S) instruction.
To execute this instruction, it is necessary to set the high - speed counter mode. For detailed information
section 5.3
Flag conditions
S Error flag (R9007): Turns on and stays on when:
- The area specified using the index modifier exceeds the limit.
- n is number except 0 to 3.
- The value of S exceeds the limit of specified range.
S Error flag (R9008): Turns on for an instant when:
- The area specified using the index modifier exceeds the limit.
- n is number except 0 to 3.
- The value of S exceeds the limit of specified range.
3 - 263
High - level Instructions FP0
Outline Outputs a pulse from the specified output (Y0 or Y1) according to the
specified parameter.
Program example
Boolean
Ladder Diagram
Address Instruction
Trigger 10 ST R 10
11 DF
R10 12 F168 (SPD1)
10 DF F168 SPD1 , DT100 , K 0
DT 100
S n K 0
S Starting address for the area that contains the data table.
n Output Yn that corresponds to the pulse output (n: K0 or K1).
Operands
Index
Relay Timer/Counter Register Constant Index
Operand register
modifier
WX WY WR SV EV DT IX IY K H
S N/A N/A N/A N/A N/A A N/A N/A N/A N/A A
A: Available
n N/A N/A N/A N/A N/A N/A N/A N/A A A N/A N/A: Not Available
Description
When the corresponding control flag is off and the execution condition (trigger) is in the on state, a pulse is
output from the specified output (Y0 or Y1).
The control code, initial speed, maximum speed, acceleration/deceleration time, and target value, are
specified by a user program with a data table as shown on the following page.
The frequency is switched by the acceleration/deceleration time specified for changing from the initial speed
to the maximum speed.
See below for the corresponding areas.
Channel Control Elapsed value Target value Directional
Near home Home input
no. flag area area output
DT9044, DT9045/ DT9046, DT9047/ DT9052/DT90052
ch0 R903A Y2 X0
DT90044, DT90045 DT90046, DT90047 <bit2>
DT9048, DT9049/ DT9050, DT9051/ DT9052/DT90052
ch1 R903B Y3 X1
DT90048, DT90049 DT90050, DT90051 <bit6>
Notes
• When this instruction is used, the setting for the channel
corresponding to system register 400 should be set to
“High - speed counter not used”. For detailed information
section 8.4
• By performing rewrite during RUN during pulse output, more
than the set number of pulses may be output.
3 - 264
FP0 High- level Instructions
Acceleration/
S+3 deceleration time t (ms) K30 to K32767 (ms)
S+4 Target value K-8388608 to K8388607 *3
S+5 (pulse number)
f
Fmax
Output pulse
number
Fmin
t
t t
Acceleration Deceleration
time time
3 - 265
High - level Instructions FP0
*2: When the pulse width is set to duty 50%, the maximum is 6kHz. When the pulse width is set
to fixed pulse width (approx. 80µs), the maximum is 9.5kHz.
*3: The (S + 4) to (S + 6) specification is not necessary when an home return is carried out.
For details on troubleshooting procedures when no pulse is output when F168(SPD1) instruction is executed
page 5 - 32
Flag conditions
S Error flag (R9007): Turns on and stays on when:
- The area specified using the index modifier exceeds the limit.
- n is number except 0 and 1.
- The value of S exceeds the limit of specified range.
- “S+1” is less than K40
- “S+1” > “S+2”
- The value of “S+5, S+4” exceeds the limit of specified range.
S Error flag (R9008): Turns on for an instant when:
- The area specified using the index modifier exceeds the limit.
- n is number except 0 and 1.
- The value of S exceeds the limit of specified range.
- “S+1” is less than K40
- “S+1” > “S+2”
- The value of “S+5, S+4” exceeds the limit of specified range.
3 - 266
FP0 High- level Instructions
Application example
R0
F0 MV, H 2, DT 0
F0 MV, K1000, DT 1
F0 MV, K7000, DT 2
F0 MV, K300, DT 3
F1 DMV, K100000, DT 4
F0 MV, K 0, DT 6
R1
F168 SPD1, DT 0, K 0
DT 0 2
DT 1 K 1000
DT 2 K 7000
DT 3 K 300
DT 4 K100000
DT 5
DT 6 0
7kHz
Number of
output pulse:
100,000
1kHz
300ms 300ms
3 - 267
High - level Instructions FP0
Outline Outputs the pulse of the specified parameter from the specified output
(Y0 or Y1).
Program example
Boolean
Ladder Diagram
Address Instruction
Trigger 10 ST R 10
11 F169 (PLS)
R10
10 F169 PLS , DT10 , K 0 DT 10
K 0
S n
S Starting address for the area that contains the data table.
n Output Yn that corresponds to the pulse output (n: K0 or K1).
Operands
Index
Relay Timer/Counter Register Constant Index
Operand register
modifier
WX WY WR SV EV DT IX IY K H
S N/A N/A N/A N/A N/A A N/A N/A N/A N/A A
A: Available
n N/A N/A N/A N/A N/A N/A N/A N/A A A N/A N/A: Not Available
Description
When the corresponding control flag is off and the execution condition (trigger) is in the on state, a pulse is
output from the specified channel. The pulse is output while the execution condition (trigger) is in the on state.
By specifying either incremental counting or decremental counting in the control code, this instruction can be
used as an instruction for JOG operations. For that situation, set the control code with combinations such as
H12 (incremental, directional output off) and H22 (decremental, directional output on).
The frequency and duty can be changed each scan. (This becomes effective with the next pulse output after
this instruction is executed.)
See below for the corresponding areas.
Channel no. Control flag Data register for elapsed value
ch0 R903A DT9044, DT9045/DT90044, DT90045
ch1 R903B DT9048, DT9049/DT90048, DT90049
When using the incremental counting mode, the pulse stops when the elapsed value exceeds H7FFFFF.
When using the decremental counting mode, the pulse stops when the elapsed value exceeds HFF800000.
Notes
• When this instruction is used, the setting for the channel
corresponding to system register 400 should be set to
“High - speed counter not used”. For detailed information
section 8.4
• By performing a rewrite during RUN while operating, the pulse
output will stop during rewriting.
3 - 268
FP0 High- level Instructions
Flag conditions
S Error flag (R9007): Turns on and stays on when:
- The area specified using the index modifier exceeds the limit.
- n is number except 0 and 1.
S Error flag (R9008): Turns on for an instant when:
- The area specified using the index modifier exceeds the limit.
- n is number except 0 and 1.
3 - 269
High - level Instructions FP0
Outline Outputs the PWM of the specified parameter from the specified output
(Y0 or Y1).
Program example
Boolean
Ladder Diagram
Address Instruction
Trigger 10 ST R 10
11 F170 (PWM)
R10
10 F170 PWM , DT20 , K 1 DT 20
K 1
S n
S Starting address for the area that contains the data table.
n Output Yn that corresponds to the PWM output (n: K0 or K1).
Operands
Index
Relay Timer/Counter Register Constant Index
Operand register
modifier
WX WY WR SV EV DT IX IY K H
S N/A N/A N/A N/A N/A A N/A N/A N/A N/A A
A: Available
n N/A N/A N/A N/A N/A N/A N/A N/A A A N/A N/A: Not Available
Description
When the corresponding control flag is off and execution condition (trigger) is in the on state, a PWM is output
from the specified channel. The PWM is output while the execution condition (trigger) is in the on state.
The frequency and duty are specified with the data table on the right made by a user program.
Since the output is delayed near the maximum and minimum levels, the set duty ratio will differ.
The duty can be changed each scan. The frequency settings is only effective at the start of the execution of
the instruction (becomes effective after the next pulse output).
See below for the corresponding areas.
Channel no. Control flag
ch0 R903A
ch1 R903B
Notes
• When this instruction is used, the setting for the channel
corresponding to system register 400 should be set to
“High - speed counter not used”. For detailed information
section 8.4
• By performing a rewrite during RUN while operating, the pulse
output will stop during rewriting.
3 - 270
FP0 High- level Instructions
3 - 271
High - level Instructions FP0
5 Step Availability
Outline Sets the 32 - bit on - delay timer for 0.01s units (0.01 to 21474836.47s)
Program example
Boolean
Ladder Diagram
Address Instruction
Trigger 10 ST R 0
11 F183 (DSTM)
R0 R5 DT 10
10 F183 DSTM , DT10 , DT 5
DT 5
S D 16 OT R 5
S 32-bit equivalent constant or lower 16-bit area of 32-bit data for timer set value
D 16-bit area for timer elapsed value
Operands
Index
Relay Timer/Counter Register Constant Index
Operand register
modifier
WX WY WR SV EV DT IX IY K H
S A A A A A A A N/A A A N/A
A: Available
D N/A A A A A A N/A N/A N/A N/A N/A N/A: Not Available
Explanation of example
When the execution condition (trigger) has been satisfied, the auxiliary timer is activated, and the time equal
to the values stored in data registers DT10 and DT11 x 0.01 seconds has elapsed, R5 goes on.
Description
This functions as a 32 - bit addition - type on delay timer set in 0.01 - second units.
When the execution condition (trigger) is on, the elapsed time is added, and when the elapsed value “D + 1, D”
(32 bits) exceeds the set value, the relays being used are turned on by the OT instruction which comes next in
the program.
When the execution condition (trigger) is off, the elapsed value area is cleared to 0, and relays being used are
turned off by the OT instruction.
When the time set for the special internal relay R900D has elapsed, the relay is turned on.
R900D can also be used as a timer contact.(R900D is off when the execution condition (trigger) is off and
while addition is being carried out.)
R0
F183 DSTM, DT10, DT5
R900D R5
3 - 272
FP0 High- level Instructions
1 Sent to “D + 1, D”
R900D
F0 MV, DT50, WR50 DT5, DT6
0
2 If the execution condition (trigger) stays on, the values in the elapsed value area “D + 1, D” are
added.
R0 R5 DT5, DT6
F183 DSTM, K500, DT5
K500
2 Addition
0
R900D
1
F0 MV, DT50, WR50
2
next page
3 - 273
High - level Instructions FP0
3 If the values in the elapsed value area “D +1, D” reach “S + 1, S”, relays being used are turned on
by the OT instruction which comes next in the program. The special internal relay R900D also
goes on at this point.
R0 R5 DT5
F183 DSTM, K500, DT5
K500
R900D
F0 MV, DT50, WR50
3 Addition completed
Elapsed value
“D+1, D”
Set value
“S+1, S”
R0 on
off
R5 on
(R900D) off
R1
F183 DSTM, WR10, DT10
Pair
R900D Y1
When timer a , which is activated by R0: on, expires, Y0 goes on. When timer b , which is activated by R1: on,
expires, Y1 goes on.
If written as indicated below, R900D will not function correctly.
R0
F183 DSTM, DT0, DT5
R1
F183 DSTM, DT20, DT10
R900D Y0
R900D Y1
3 - 274
FP0 High- level Instructions
Outline Copies floating point type data (32 bits) to the specified 32-bit area.
Program example
Boolean
Ladder Diagram
Address Instruction
Trigger 10 ST R 0
11 F309 (FMV)
R0
f 1.234
10 F309 FMV, f 1.234, DT10
DT 10
S D
S Floating point type data (32 bits) or lower 16-bit area of 32-bit data (source)
D Lower 16-bit area for 32-bit area (destination)
Operands
Index
Relay Timer/Counter Register Constant Integer
Operand register
device
WX WY WR SV EV DT IX IY K H f
S N/A N/A N/A N/A N/A N/A N/A N/A N/A A N/A
A: Available
D N/A A A A A A A N/A N/A N/A N/A N/A: Not Available
Explanation of example
The floating point type data “f 1.234” are copied to data registers DT11 and DT10 when trigger R0 turns on.
DT10:
(f1.234)
DT11:
3 - 275
High - level Instructions FP0
Description
The floating point type data (32 bits) specified by S is copied to the 32-bit area specified by D when the trigger
turns on.
Floating point type
data
Flag conditions
S Error flag (R9007): Turns on and stays on when the area specified using the index modifier
exceeds the limit.
S Error flag (R9008): Turns on for an instant when the area specified using the index modifier
exceeds the limit.
3 - 276
FP0 High- level Instructions
Outline Adds two real number data items and stores the result in the specified
area.
Program example
Boolean
Ladder Diagram
Address Instruction
Trigger 10 ST R 0
11 F310 (F+)
R0
DT 10
10 F310 F+, DT10, DT20, DT30
DT 20
DT 30
S1 S2 D
S1 Real number data (2 words) or lower 16-bit area of 32-bit data (for augend)
S2 Real number data (2 words) or lower 16-bit area of 32-bit data (for addend)
D Lower 16-bit area of 32-bit data (for result)
Operands
Index
Relay Timer/Counter Register Constant Integer
Operand register
device
WX WY WR SV EV DT IX IY K H f
S1 A A A A A A A A A A A
S2 A A A A A A A A A A A
A: Available
D N/A A A A A A A N/A N/A N/A A N/A: Not Available
Description
The real number data (2 words) specified by S1 and S2 are added together when the trigger turns on. The
added result is stored in D+1 and D.
[S1+1, S1] + [S2+1, S2] → [D+1, D]
Specifying the integer device with [S1] and [S2], the integer data is internally converted to real numbers
before operations continue.
R0
F310 F+, % DT 0, % DT 2, DT 4
3 - 277
High - level Instructions FP0
Specifying the integer device with [D], the real numbers are automatically converted into integer data.
R0
F310 F+, DT 0, DT 2, % DT 4
When the constant K is specified in S1 and S2, the operations are the same as when a integer device is
specified.
For detailed information about the processing of specifying the integer device section 1.3
Program example
The “f4.554” is stored to DT30 and DT31 when the R0 turns on.
R0
F310 F+, f1.414, f3.14, DT30
The “f135.795” is stored to DT30 and DT31 when the R0 turns on.
R0
F309 FMV, f12.345 DT10
F309 FMV, f123.45, DT20
F310 F+, DT10, DT20, DT30
3 - 278
FP0 High- level Instructions
Outline Subtracts real number data from the minuend and stores the result in
the specified area.
Program example
Boolean
Ladder Diagram
Address Instruction
Trigger 10 ST R 0
11 F311 (F-)
R0
DT 10
10 F311 F - , DT10, DT20, DT30
DT 20
DT 30
S1 S2 D
S1 Real number data (2 words) or lower 16-bit area of 32-bit data (for minuend)
S2 Real number data (2 words) or lower 16-bit area of 32-bit data (for subtrahend)
D Lower 16-bit area of 32-bit data (for result)
Operands
Index
Relay Timer/Counter Register Constant Integer
Operand register
device
WX WY WR SV EV DT IX IY K H f
S1 A A A A A A A A A A A
S2 A A A A A A A A A A A
A: Available
D N/A A A A A A A N/A N/A N/A A N/A: Not Available
Description
Subtracts the real number data (2 words) specified by S2 from the real number data (32-bit) specified by S1
when the trigger turns on. The subtracted result is stored in D+1 and D.
[S1+1, S1] - [S2+1, S2] → [D+1, D]
Specifying the integer device with [S1] and [S2], the integer data is internally converted to real numbers
before operations continue.
R0
F311 F - , % DT 0, % DT 2, DT 4
3 - 279
High - level Instructions FP0
Specifying the integer device with [D], the real numbers are automatically converted into integer data.
R0
F311 F - , DT 0, DT 2, % DT 4
When the constant K is specified in S1 and S2, the operations are the same as when a integer device is
specified.
For detailed information about the processing of specifying the integer device section 1.3
Program example
The “f0.445” is stored to DT30 and DT31 when the R0 turns on.
R0
F311 F - , f1, f0.555, DT30
The “f100.05” is stored to DT30 and DT31 when the R0 turns on.
R0
F309 FMV, f100.1, DT10
F309 FMV, f0.05, DT20
F311 F - , DT10, DT20, DT30
Flag conditions
S Error flag (R9007): Turns on and stays on when:
- The area specified using the index modifier exceeds the limit.
- If data other than real number data is specified in “S1+1 and S1” and “S2+1
and S2.”
- If result of processing is outside integer range when integer device is
specified in “D+1 and D”.
S Error flag (R9008): Turns on for an instant when:
- The area specified using the index modifier exceeds the limit.
- If data other than real number data is specified in “S1+1 and S1” and “S2+1
and S2.”
- If result of processing is outside integer range when integer device is
specified in “D+1 and D”.
S Carry flag (R9009): Turns on for an instant when the result is overflowed.
3 - 280
FP0 High- level Instructions
Outline Multiplies two real number data items and stores the result in the
specified 32-bit area.
Program example
Boolean
Ladder Diagram
Address Instruction
Trigger 10 ST R 0
11 F312 (F*)
R0
DT 10
10 F312 F*, DT10, DT20, DT30
DT 20
DT 30
S1 S2 D
S1 Real number data (2 words) or lower 16-bit area of 32-bit data (for
multiplicand)
S2 Real number data (2 words) or lower 16-bit area of 32-bit data (for multiplier)
D Lower 16-bit area of 32-bit data (for result)
Operands
Index
Relay Timer/Counter Register Constant Integer
Operand register
device
WX WY WR SV EV DT IX IY K H f
S1 A A A A A A A A A A A
S2 A A A A A A A A A A A
A: Available
D N/A A A A A A A N/A N/A N/A A N/A: Not Available
Description
Multiplies the real number data (2 words) specified by S1 and the one specified by S2 when the trigger turns
on.
The multiplied result is stored in D+1 and D (32-bit area).
[S1+1, S1] × [S2+1, S2] → [D+1, D]
Specifying the integer device with [S1] and [S2], the integer data is internally converted to real numbers
before operations continue.
R0
F312 F*, % DT 0, % DT 2, DT 4
3 - 281
High - level Instructions FP0
Specifying the integer device with [D], the real numbers are automatically converted into integer data.
R0
F312 F*, DT 0, DT 2, % DT 4
When the constant K is specified in S1 and S2, the operations are the same as when a integer device is
specified.
For detailed information about the processing of specifying the integer device section 1.3
Program example
The “f123.4000” is stored to DT30 and DT31 when the R0 turns on.
R0
F312 F*, f1.234, f100, DT30
Flag conditions
S Error flag (R9007): Turns on and stays on when:
- The area specified using the index modifier exceeds the limit.
- If data other than real number data is specified in “S1+1 and S1” and “S2+1
and S2.”
- If result of processing is outside integer range when integer device is
specified in “D+1 and D”.
S Error flag (R9008): Turns on for an instant when:
- The area specified using the index modifier exceeds the limit.
- If data other than real number data is specified in “S1+1 and S1” and “S2+1
and S2.”
- If result of processing is outside integer range when integer device is
specified in “D+1 and D”.
S Carry flag (R9009): Turns on for an instant when the result is overflowed.
3 - 282
FP0 High- level Instructions
Outline Divides real number data by the divisor and stores the divided result in
the specified 32-bit area.
Program example
Boolean
Ladder Diagram
Address Instruction
Trigger 10 ST R 0
11 F313 (F%)
R0
DT 10
10 F313 F%, DT10, DT20, DT30
DT 20
DT 30
S1 S2 D
S1 Real number data (2 words) or lower 16-bit area of 32-bit data (for dividend)
S2 Real number data (2 words) or lower 16-bit area of 32-bit data (for divisor)
D Lower 16-bit area of 32-bit data (for result)
Operands
Index
Relay Timer/Counter Register Constant Integer
Operand register
device
WX WY WR SV EV DT IX IY K H f
S1 A A A A A A A A A A A
S2 A A A A A A A A A A A
A: Available
D N/A A A A A A A N/A N/A N/A A N/A: Not Available
Description
The real number data (2 words) specified by S1 is divided by the real number data (2 words) specified by S2
when the trigger turns on. The result is stored in D+1 and D.
[S1+1, S1] ÷ [S2+1, S2] → [D+1, D]
Specifying the integer device with [S1] and [S2], the integer data is internally converted to real numbers
before operations continue.
R0
F313 F%, % DT 0, % DT 2, DT4
3 - 283
High - level Instructions FP0
Specifying the integer device with [D], the real numbers are automatically converted into integer data.
R0
F313 F%, DT 0, DT 2, % DT 4
When the constant K is specified in S1 and S2, the operations are the same as when a integer device is
specified.
For detailed information about the processing of specifying the integer device section 1.3
Program example
The “f5.432100” is stored to DT30 and DT31 when the R0 turns on.
R0
F313 F%, f54.321, f10, DT30
Flag conditions
S Error flag (R9007): Turns on and stays on when:
- The area specified using the index modifier exceeds the limit.
- If data other than real number data is specified in “S1+1 and S1” and “S2+1
and S2.”
- If result of processing is outside integer range when integer device is
specified in “D+1 and D”.
- The real number data for the divisor specified by S2 is “0.0”.
S Error flag (R9008): Turns on for an instant when:
- The area specified using the index modifier exceeds the limit.
- If data other than real number data is specified in “S1+1 and S1” and “S2+1
and S2.”
- If result of processing is outside integer range when integer device is
specified in “D+1 and D”.
- The real number data for the divisor specified by S2 is “0.0”.
S Carry flag (R9009): Turns on for an instant when the result is overflowed.
3 - 284
FP0 High- level Instructions
Program example
Boolean
Ladder Diagram
Address Instruction
Trigger 10 ST R 0
11 F314 (SIN)
R0
F314 SIN, DT10, DT20 DT 10
10
DT 20
S D
S Angle data (2 words) or lower 16-bit area of 32-bit data where angle data is
stored
D Lower 16-bit area of 32-bit data where calculated result is stored
Operands
Index
Relay Timer/Counter Register Constant Integer
Operand register
device
WX WY WR SV EV DT IX IY K H f
S A A A A A A A A A A A
A: Available
D N/A A A A A A A N/A N/A N/A A N/A: Not Available
Description
The SIN([S+1 and S]) of an angle data (units are radians) specified by S+1 and S is calculated and the result
stored in D+1 and D.
SIN ([S+1, S]) → [D+1, D]
Specifying the integer device with [S], the integer data is internally converted to real numbers before
operations continue.
R0
F314 SIN, % DT 0, DT 4
3 - 285
High - level Instructions FP0
Specifying the integer device with [D], the real numbers are automatically converted into integer data.
R0
F314 SIN, DT 0, % DT 4
When the constant K is specified in S, the operations are the same as when a integer device is specified.
For detailed information about the processing of specifying the integer device section 1.3
Program example
The “f0.4999999” is stored to DT20 and DT21 when the R0 turns on.
Radians of 30_
R0
F314 SIN, f0.5235987, DT20
Flag conditions
S Error flag (R9007): Turns on and stays on when:
- The area specified using the index modifier exceeds the limit.
- If data other than real number data is specified in “S+1 and S”.
- If result of processing is outside integer range when integer device is
specified in “D+1 and D”.
- Absolute value of “S+1 and S” is 52707176 or greater.
S Error flag (R9008): Turns on for an instant when:
- The area specified using the index modifier exceeds the limit.
- If data other than real number data is specified in “S+1 and S”.
- If result of processing is outside integer range when integer device is
specified in “D+1 and D”.
- Absolute value of “S+1 and S” is 52707176 or greater.
S Carry flag (R9009): Turns on for an instant when the result is overflowed.
S = flag (R900B): Turns on when result of processing is recognized as “0.”
3 - 286
FP0 High- level Instructions
Program example
Boolean
Ladder Diagram
Address Instruction
Trigger 10 ST R 0
11 F315 (COS)
R0
DT 10
10 F315 COS, DT10, DT20
DT 20
S D
S Angle data (2 words) or lower 16-bit area of 32-bit data where angle data is
stored
D Lower 16-bit area of 32-bit data where calculated result is stored
Operands
Index
Relay Timer/Counter Register Constant Integer
Operand register
device
WX WY WR SV EV DT IX IY K H f
S A A A A A A A A A A A
A: Available
D N/A A A A A A A N/A N/A N/A A N/A: Not Available
Description
The COS ([S+1 and S]) of an angle data (units are radians) specified by S+1 and S is calculated and the result
stored in D+1 and D.
COS ([S+1, S]) → [D+1, D]
Specifying the integer device with [S], the integer data is internally converted to real numbers before
operations continue.
R0
F315 COS, % DT 0, DT 4
3 - 287
High - level Instructions FP0
Specifying the integer device with [D], the real numbers are automatically converted into integer data.
R0
F315 COS, DT 0, % DT 4
When the constant K is specified in S, the operations are the same as when a integer device is specified.
For detailed information about the processing of specifying the integer device section 1.3
Program example
The “f0.7071068” is stored to DT20 and DT21 when the R0 turns on.
Radians of 45_
R0
F315 COS, f0.7853981, DT20
Flag conditions
S Error flag (R9007): Turns on and stays on when:
- The area specified using the index modifier exceeds the limit.
- If data other than real number data is specified in “S+1 and S”.
- If result of processing is outside integer range when integer device is
specified in “D+1 and D”.
- Absolute value of “S+1 and S” is 52707176 or greater.
S Error flag (R9008): Turns on for an instant when:
- The area specified using the index modifier exceeds the limit.
- If data other than real number data is specified in “S+1 and S”.
- If result of processing is outside integer range when integer device is
specified in “D+1 and D”.
- Absolute value of “S+1 and S” is 52707176 or greater.
S Carry flag (R9009): Turns on for an instant when the result is overflowed.
S = flag (R900B): Turns on when result of processing is recognized as “0.”
3 - 288
FP0 High- level Instructions
Program example
Boolean
Ladder Diagram
Address Instruction
Trigger 10 ST R 0
11 F316 (TAN)
R0
DT 10
10 F316 TAN, DT10, DT20
DT 20
S D
S Angle data (2 words) or lower 16-bit area of 32-bit data where angle data is
stored
D Lower 16-bit area of 32-bit data where calculated result is stored
Operands
Index
Relay Timer/Counter Register Constant Integer
Operand register
device
WX WY WR SV EV DT IX IY K H f
S A A A A A A A A A A A
A: Available
D N/A A A A A A A N/A N/A N/A A N/A: Not Available
Description
The TAN([S+1 and S]) of an angle data (units are radians) specified by S+1 and S is calculated and the result
stored in D+1 and D.
TAN ([S+1, S]) → [D+1, D]
Specifying the integer device with [S], the integer data is internally converted to real numbers before
operations continue.
R0
F316 TAN, % DT 0, DT 4
Specifying the integer device with [D], the real numbers are automatically converted into integer data.
R0
F316 TAN, DT 0, % DT 4
When the constant K is specified in S, the operations are the same as when a integer device is specified.
For detailed information about the processing of specifying the integer device section 1.3
3 - 289
High - level Instructions FP0
Program example
The “f1.732048” is stored to DT20 and DT21 when the R0 turns on.
Radians of 60_
R0
F316 TAN, f1.047197, DT20
Flag conditions
S Error flag (R9007): Turns on and stays on when:
- The area specified using the index modifier exceeds the limit.
- If data other than real number data is specified in “S+1 and S”.
- If result of processing is outside integer range when integer device is
specified in “D+1 and D”.
- Absolute value of “S+1 and S” is 52707176 or greater.
S Error flag (R9008): Turns on for an instant when:
- The area specified using the index modifier exceeds the limit.
- If data other than real number data is specified in “S+1 and S”.
- If result of processing is outside integer range when integer device is
specified in “D+1 and D”.
- Absolute value of “S+1 and S” is 52707176 or greater.
S Carry flag (R9009): Turns on for an instant when the result is overflowed.
S = flag (R900B): Turns on when result of processing is recognized as “0.”
3 - 290
FP0 High- level Instructions
Program example
Boolean
Ladder Diagram
Address Instruction
Trigger 10 ST R 0
11 F317 (ASIN)
R0
DT 10
10 F317 ASIN, DT10, DT20
DT 20
S D
S Angle data (2 words) or lower 16-bit area of 32-bit data where angle data is
stored
D Lower 16-bit area of 32-bit data where calculated result is stored
Operands
Index
Relay Timer/Counter Register Constant Integer
Operand register
device
WX WY WR SV EV DT IX IY K H f
S A A A A A A A A A A A
A: Available
D N/A A A A A A A N/A N/A N/A A N/A: Not Available
Description
SIN of the value specified in S+1 and S is calculated, and the result [an angle (radians)] is stored in D+1 and
D.
SIN - 1 ([S+1, S]) → [D+1, D]
Specifying the integer device with [S], the integer data is internally converted to real numbers before
operations continue.
R0
F317 ASIN, % DT 0, DT 4
Specifying the integer device with [D], the real numbers are automatically converted into integer data.
R0
F317 ASIN, DT 0, % DT 4
When the constant K is specified in S, the operations are the same as when a integer device is specified.
For detailed information about the processing of specifying the integer device section 1.3
3 - 291
High - level Instructions FP0
Program example
The “f0.5235986 (30_ radians)” is stored to DT20 and DT21 when the R0 turns on.
R0
F317 ASIN, f0.4999999, DT20
Flag conditions
S Error flag (R9007): Turns on and stays on when:
- The area specified using the index modifier exceeds the limit.
- If data other than real number data is specified in “S+1 and S”.
- “S+1 and S” is not within the range - 1.0 ≦ [S+1, S] ≦ 1.0
- If result of processing is outside integer range when integer device is
specified in “D+1 and D”.
S Error flag (R9008): Turns on for an instant when:
- The area specified using the index modifier exceeds the limit.
- If data other than real number data is specified in “S+1 and S”.
- “S+1 and S” is not within the range - 1.0 ≦ [S+1, S] ≦ 1.0
- If result of processing is outside integer range when integer device is
specified in “D+1 and D”.
S = flag (R900B): Turns on when result of processing is recognized as “0.”
S Carry flag (R9009): Turns on for an instant when the result is overflowed.
3 - 292
FP0 High- level Instructions
Program example
Boolean
Ladder Diagram
Address Instruction
Trigger 10 ST R 0
11 F318 (ACOS)
R0
DT 10
10 F318 ACOS, DT10, DT20
DT 20
S D
S Angle data (2 words) or lower 16-bit area of 32-bit data where angle data is
stored
D Lower 16-bit area of 32-bit data where calculated result is stored
Operands
Index
Relay Timer/Counter Register Constant Integer
Operand register
device
WX WY WR SV EV DT IX IY K H f
S A A A A A A A A A A A
A: Available
D N/A A A A A A A N/A N/A N/A A N/A: Not Available
Description
COS of the value specified in S+1 and S is calculated, and the result [an angle data (units and radians)] is
stored in D+1 and D.
COS - 1 ([S+1, S]) → [D+1, D]
Specifying the integer device with [S], the integer data is internally converted to real numbers before
operations continue.
R0
F318 ACOS, % DT 0, DT 4
Specifying the integer device with [D], the real numbers are automatically converted into integer data.
R0
F318 ACOS, DT 0, % DT 4
When the constant K is specified in S, the operations are the same as when a integer device is specified.
For detailed information about the processing of specifying the integer device section 1.3
3 - 293
High - level Instructions FP0
Program example
The “f0.7853980 (45_ radians)” is stored to DT20 and DT21 when the R0 turns on.
R0
F318 ACOS, f0.7071069, DT20
Flag conditions
S Error flag (R9007): Turns on and stays on when:
- The area specified using the index modifier exceeds the limit.
- If data other than real number data is specified in “S+1 and S”.
- “S+1 and S” is not within the range - 1.0 ≦ [S+1, S] ≦ 1.0
- If result of processing is outside integer range when integer device is
specified in “D+1 and D”.
S Error flag (R9008): Turns on for an instant when:
- The area specified using the index modifier exceeds the limit.
- If data other than real number data is specified in “S+1 and S”.
- “S+1 and S” is not within the range - 1.0 ≦ [S+1, S] ≦ 1.0
- If result of processing is outside integer range when integer device is
specified in “D+1 and D”.
S = flag (R900B): Turns on when result of processing is recognized as “0.”
S Carry flag (R9009): Turns on for an instant when the result is overflowed.
3 - 294
FP0 High- level Instructions
Program example
Boolean
Ladder Diagram
Address Instruction
Trigger 10 ST R 0
11 F319 (ATAN)
R0
F319 ATAN, DT10, DT20 DT 10
10
DT 20
S D
S Angle data (2 words) or lower 16-bit area of 32-bit data where angle data is
stored
D Lower 16-bit area of 32-bit data where calculated result is stored
Operands
Index
Relay Timer/Counter Register Constant Integer
Operand register
device
WX WY WR SV EV DT IX IY K H f
S A A A A A A A A A A A
A: Available
D N/A A A A A A A N/A N/A N/A A N/A: Not Available
Description
TAN - 1 (the arctangent) of the value specified in S+1 and S is calculated, and the result [an angle data (units
and radians)] is stored in D+1 and D.
TAN - 1 ([S+1, S]) → [D+1, D]
Specifying the integer device with [S], the integer data is internally converted to real numbers before
operations continue.
R0
F319 ATAN, % DT 0, DT 4
Specifying the integer device with [D], the real numbers are automatically converted into integer data.
R0
F319 ATAN, DT 0, % DT 4
When the constant K is specified in S, the operations are the same as when a integer device is specified.
For detailed information about the processing of specifying the integer device section 1.3
3 - 295
High - level Instructions FP0
Program example
The “f1.047197 (60_ radians)” is stored to DT20 and DT21 when the R0 turns on.
R0
F319 ATAN, f1.73205, DT20
Flag conditions
S Error flag (R9007): Turns on and stays on when:
- The area specified using the index modifier exceeds the limit.
- If data other than real number data is specified in “S+1 and S”.
- If result of processing is outside integer range when integer device is
specified in “D+1 and D”.
S Error flag (R9008): Turns on for an instant when:
- The area specified using the index modifier exceeds the limit.
- If data other than real number data is specified in “S+1 and S”.
- If result of processing is outside integer range when integer device is
specified in “D+1 and D”.
S = flag (R900B): Turns on when result of processing is recognized as “0.”
S Carry flag (R9009): Turns on for an instant when the result is overflowed.
3 - 296
FP0 High- level Instructions
Program example
Boolean
Ladder Diagram
Address Instruction
Trigger 10 ST R 0
11 F320 (LN)
R0
DT 10
10 F320 LN, DT10, DT20
DT 20
S D
S Real number data (2 words) or lower 16-bit area of 32-bit data where real
number data is stored
D Lower 16-bit area of 32-bit data where calculated result is stored
Operands
Index
Relay Timer/Counter Register Constant Integer
Operand register
device
WX WY WR SV EV DT IX IY K H f
S A A A A A A A A A A A
A: Available
D N/A A A A A A A N/A N/A N/A A N/A: Not Available
Description
The natural logarithm LN(S+1 and S) is calculated of the data specified in S+1 and S, and the result is stored
in D+1 and D.
LN ([S+1, S]) → [D+1, D]
Specifying the integer device with [S], the integer data is internally converted to real numbers before
operations continue.
R0
F320 LN, % DT 0, DT 4
Specifying the integer device with [D], the real numbers are automatically converted into integer data.
R0
F320 LN, DT 0, % DT 4
For detailed information about the processing of specifying the integer device section 1.3
3 - 297
High - level Instructions FP0
Program example
The “f1.6094379” is stored to DT20 and DT21 when the R0 turns on.
R0
F320 LN, K 5, DT20
The “f - 0.3160815” is stored to DT30 and DT31 when the R0 turns on.
R0
F320 LN, f0.729, DT30
Flag conditions
S Error flag (R9007): Turns on and stays on when:
- The area specified using the index modifier exceeds the limit.
- If data other than real number data is specified in “S+1 and S”.
- The “S+1 and S” is not greater than zero.
- If result of processing is outside integer range when integer device is
specified in “D+1 and D”.
S Error flag (R9008): Turns on for an instant when:
- The area specified using the index modifier exceeds the limit.
- If data other than real number data is specified in “S+1 and S”.
- The “S+1 and S” is not greater than zero.
- If result of processing is outside integer range when integer device is
specified in “D+1 and D”.
S = flag (R900B): Turns on when result of processing is recognized as “0.”
S Carry flag (R9009): Turns on for an instant when the result is overflowed.
3 - 298
FP0 High- level Instructions
Outline This instruction calculates the exponent of a floating point type real
number EXP( ).
Program example
Boolean
Ladder Diagram
Address Instruction
Trigger 10 ST R 0
11 F321 (EXP)
R0
DT 10
10 F321 EXP, DT10, DT20
DT 20
S D
S Real number data (2 words) or lower 16-bit area of 32-bit data where real
number data is stored
D Lower 16-bit area of 32-bit data where calculated result is stored
Operands
Index
Relay Timer/Counter Register Constant Integer
Operand register
device
WX WY WR SV EV DT IX IY K H f
S A A A A A A A A A A A
A: Available
D N/A A A A A A A N/A N/A N/A A N/A: Not Available
Description
The exponent EXP(S+1 and S) is calculated from the real number data specified in S+1 and S, and the result
is stored in D+1 and D.
EXP ([S+1, S]) → [D+1, D]
The calculation is performed with the exponent base (e) equal to 2.718282.
Specifying the integer device with [S], the integer data is internally converted to real numbers before
operations continue.
R0
F321 EXP, % DT 0, DT 4
Specifying the integer device with [D], the real numbers are automatically converted into integer data.
R0
F321 EXP, DT 0, % DT 4
For detailed information about the processing of specifying the integer device section 1.3
3 - 299
High - level Instructions FP0
Program example
The “f7.389056” is stored to DT20 and DT21 when the R0 turns on.
R0
F321 EXP, K 2, DT20
The “f221.406402” is stored to DT30 and DT31 when the R0 turns on.
R0
F321 EXP, f5.4, DT30
Flag conditions
S Error flag (R9007): Turns on and stays on when:
- The area specified using the index modifier exceeds the limit.
- If data other than real number data is specified in “S+1 and S”.
- If result of processing is outside integer range when integer device is
specified in “D+1 and D”.
S Error flag (R9008): Turns on for an instant when:
- The area specified using the index modifier exceeds the limit.
- If data other than real number data is specified in “S+1 and S”.
- If result of processing is outside integer range when integer device is
specified in “D+1 and D”.
S = flag (R900B): Turns on when result of processing is recognized as “0.”
S Carry flag (R9009): Turns on for an instant when the result is overflowed.
3 - 300
FP0 High- level Instructions
Outline This instruction calculates the logarithm of a floating point type real
number LOG( ).
Program example
Boolean
Ladder Diagram
Address Instruction
Trigger 10 ST R 0
11 F322 (LOG)
R0
DT 10
10 F322 LOG, DT10, DT20
DT 20
S D
S Real number data (2 words) or lower 16-bit area of 32-bit data where real
number data is stored
D Lower 16-bit area of 32-bit data where calculated result is stored
Operands
Index
Relay Timer/Counter Register Constant Integer
Operand register
device
WX WY WR SV EV DT IX IY K H f
S A A A A A A A A A A A
A: Available
D N/A A A A A A A N/A N/A N/A A N/A: Not Available
Description
The logarithm LOG(S+1 and S) is calculated of the data specified in S+1 and S, and the result is stored in D+1
and D.
LOG ([S+1, S]) → [D+1, D]
Specifying the integer device with [S], the integer data is internally converted to real numbers before
operations continue.
R0
F322 LOG, % DT 0, DT 4
Specifying the integer device with [D], the real numbers are automatically converted into integer data.
R0
F322 LOG, DT 0, % DT 4
When the constant K is specified in S, the operations are the same as when a integer device is specified.
For detailed information about the processing of specifying the integer device section 1.3
3 - 301
High - level Instructions FP0
Program example
The “f1.30103” is stored to DT20 and DT21 when the R0 turns on.
R0
F322 LOG, K20, DT20
The “f0.0108932” is stored to DT30 and DT31 when the R0 turns on.
R0
F322 LOG, f1.0254, DT30
Flag conditions
S Error flag (R9007): Turns on and stays on when:
- The area specified using the index modifier exceeds the limit.
- If data other than real number data is specified in “S+1 and S”.
- The “S+1 and S” is not greater than zero.
- If result of processing is outside integer range when integer device is
specified in “D+1 and D”.
S Error flag (R9008): Turns on for an instant when:
- The area specified using the index modifier exceeds the limit.
- If data other than real number data is specified in “S+1 and S”.
- The “S+1 and S” is not greater than zero.
- If result of processing is outside integer range when integer device is
specified in “D+1 and D”.
S = flag (R900B): Turns on when result of processing is recognized as “0.”
S Carry flag (R9009): Turns on for an instant when the result is overflowed.
3 - 302
FP0 High- level Instructions
Outline This instruction raises a floating point type real number to the specified
power.
Program example
Boolean
Ladder Diagram
Address Instruction
Trigger 10 ST R 0
11 F323 (PWR)
R0
DT 10
10 F323 PWR, DT10, DT20, DT30
DT 20
DT 30
S1 S2 D
S1 Real number data (2 words) or lower 16-bit area of 32-bit data (for
multiplicand)
S2 Real number data (2 words) or lower 16-bit area of 32-bit data (for multiplier)
D Lower 16-bit area of 32-bit data (for result)
Operands
Index
Relay Timer/Counter Register Constant Integer
Operand register
device
WX WY WR SV EV DT IX IY K H f
S1 A A A A A A A A A A A
S2 A A A A A A A A A A A
A: Available
D N/A A A A A A A N/A N/A N/A A N/A: Not Available
Description
The real number data specified by S1+1 and S1 is raised to the power specified by the real number data of
S2+1 and S2, and the result is stored in D+1 and D.
[S1+1, S] ^ [S2+1, S2] → [D+1, D]
Specifying the integer device with [S1] and [S2], the integer data is internally converted to real numbers
before operations continue.
R0
F323 PWR, % DT 0, % DT 2, DT 4
3 - 303
High - level Instructions FP0
Specifying the integer device with [D], the real numbers are automatically converted into integer data.
R0
F323 PWR, DT 0, DT 2, % DT4
When the constant K is specified in S1 and S2, the operations are the same as when a integer device is
specified.
For detailed information about the processing of specifying the integer device section 1.3
Program example
The “f625.0” is stored to DT20 and DT21 when the R0 turns on.
R0
F323 PWR, K 5, K 4, DT20
The “f30.51758” is stored to DT30 and DT31 when the R0 turns on.
R0
F323 PWR, f3.125, K 3, DT30
Flag conditions
S Error flag (R9007): Turns on and stays on when:
- The area specified using the index modifier exceeds the limit.
- If data other than real number data is specified in “S1+1 and S1” and “S2+1
and S2.”
- The power of negative number data is not an integer
- If result of processing is outside integer range when integer device is
specified in “D+1 and D”.
S Error flag (R9008): Turns on for an instant when:
- The area specified using the index modifier exceeds the limit.
- If data other than real number data is specified in “S1+1 and S1” and “S2+1
and S2.”
- The power of negative number data is not an integer
- If result of processing is outside integer range when integer device is
specified in “D+1 and D”.
S = flag (R900B): Turns on when result of processing is recognized as “0.”
S Carry flag (R9009): Turns on for an instant when the result is overflowed.
3 - 304
FP0 High- level Instructions
Outline Takes the square root of the specified real number data and stores result
in the specified area.
Program example
Boolean
Ladder Diagram
Address Instruction
Trigger 10 ST R 0
11 F324 (FSQR)
R0
DT 10
10 F324 FSQR, DT10, DT20
DT 20
S D
S Real number data (2 words) or lower 16-bit area of 32-bit area for storing data
to be calculated
D Lower 16-bit area of 32-bit area for storing the calculated result
Operands
Index
Relay Timer/Counter Register Constant Integer
Operand register
device
WX WY WR SV EV DT IX IY K H f
S A A A A A A A A A A A
A: Available
D N/A A A A A A A N/A N/A N/A A N/A: Not Available
Description
The square root of real number data specified by S is calculated and stored in the 32-bit area specified by D.
√[S1+1, S] → [D+1, D]
Specifying the integer device with [S], the integer data is internally converted to real numbers before
operations continue.
R0
F324 FSQR, % DT 0, DT 4
Specifying the integer device with [D], the real numbers are automatically converted into integer data.
R0
F324 FSQR, DT 0, % DT 4
When the constant K is specified in S, the operations are the same as when a integer device is specified.
For detailed information about the processing of specifying the integer device section 1.3
3 - 305
High - level Instructions FP0
Program example
The “f1.41421” is stored to DT20 and DT21 when the R0 turns on.
R0
F324 FSQR, K 2, DT20
Flag conditions
S Error flag (R9007): Turns on and stays on when:
- The area specified using the index modifier exceeds the limit.
- If data other than real number data is specified in “S+1 and S”.
- The “S+1 and S” is not greater than zero.
- If result of processing is outside integer range when integer device is
specified in “D+1 and D”.
S Error flag (R9008): Turns on for an instant when:
- The area specified using the index modifier exceeds the limit.
- If data other than real number data is specified in “S+1 and S”.
- The “S+1 and S” is not greater than zero.
- If result of processing is outside integer range when integer device is
specified in “D+1 and D”.
S = flag (R900B): Turns on when result of processing is recognized as “0.”
S Carry flag (R9009): Turns on for an instant when the result is overflowed.
3 - 306
FP0 High- level Instructions
Program example
Boolean
Ladder Diagram
Address Instruction
Trigger 10 ST R 0
11 F325 (FLT)
R0
DT 10
10 F325 FLT, DT10, DT20
DT 20
S D
S 16-bit integer data or 16-bit area for storing integer data (source)
D Lower 16-bit area of floating point type real number data (destination)
Operands
Index
Relay Timer/Counter Register Constant Integer
Operand register
device
WX WY WR SV EV DT IX IY K H f
S A A A A A A A A A N/A A
A: Available
D N/A A A A A A A N/A N/A N/A A N/A: Not Available
Description
Converts the 16-bit integer data with sign specified by S to real number data when the trigger turns on.
The converted data is stored in D.
16-bit integer 15 0
data with sign S:
15 0
Floating point
type real D: Lower word
number data Higher word
D+1:
3 - 307
High - level Instructions FP0
Flag conditions
S Error flag (R9007): Turns on and stays on when the area specified using the index modifier
exceeds the limit.
S Error flag (R9008): Turns on for an instant when the area specified using the index modifier
exceeds the limit.
S = flag (R900B): Turns on for an instant when the converted data is recognized as “0”.
3 - 308
FP0 High- level Instructions
Program example
Boolean
Ladder Diagram
Address Instruction
Trigger 10 ST R 0
11 F326 (DFLT)
R0
DT 10
10 F326 DFLT, DT10, DT20
DT 20
S D
S 32-bit integer data or lower 16-bit area of 32-bit data (source)
D Lower 16-bit area for 32-bit data floating point type real number (destination)
Operands
Index
Relay Timer/Counter Register Constant Integer
Operand register
device
WX WY WR SV EV DT IX IY K H f
S A A A A A A A A A N/A N/A
A: Available
D N/A A A A A A A N/A N/A N/A N/A N/A: Not Available
Description
Converts the 32-bit integer data with sign specified by S to real number data when the trigger turns on. The
converted data is stored in D+1 and D.
15 0
32-bit integer S: Lower word
data with sign S+1: Higher word
15 0
Floating point D: Lower word
type real
D+1: Higher word
number data
3 - 309
High - level Instructions FP0
Flag conditions
S Error flag (R9007): Turns on and stays on when the area specified using the index modifier
exceeds the limit.
S Error flag (R9008): Turns on for an instant when the area specified using the index modifier
exceeds the limit.
S = flag (R900B): Turns on for an instant when the converted data is recognized as “0”.
S Carry flag (R9009): Turns on for an instant when there are too many significant digits in mantissa
of converted real number data.
3 - 310
FP0 High- level Instructions
Outline Converts real number data to 16-bit integer data (the largest integer not
exceeding the floating point type data).
Program example
Boolean
Ladder Diagram
Address Instruction
Trigger 10 ST R 0
11 F327 (INT)
R0
DT 10
10 F327 INT, DT10, DT20
DT 20
S D
S Real number data (2 words) or lower 16-bit area of 32-bit data (source)
D 16-bit area for storing converted data (destination)
Operands
Index
Relay Timer/Counter Register Constant Integer
Operand register
device
WX WY WR SV EV DT IX IY K H f
S A A A A A A A N/A A A N/A
A: Available
D N/A A A A A A A N/A N/A N/A N/A N/A: Not Available
Explanation of example
When the real number data “1.234” is in DT10 and DT11, as shown below.
DT10:
(f1.234)
DT11:
DT20: (K1)
When the real number data “ - 1.234” is in DT10 and DT11, as shown below.
DT10:
(f - 1.234)
DT11:
DT20: (K - 2)
3 - 311
High - level Instructions FP0
Description
Converts real number data ( - 32767.99 to +32767.99) specified by S to the 16-bit integer data with sign (the
largest integer not exceeding the floating point type data) when the trigger turns on. The converted data is
stored in D.
15 0
Real number
data S: Lower word
15 0
16-bit integer
D:
data with sign
For detailed information about the processing of specifying the integer device section 1.3
Precaution during programming
This instruction F327 (INT) cannot be used in the interrupt program.
Flag conditions
S Error flag (R9007): Turns on and stays on when:
- The area specified using the index modifier exceeds the limit.
- If data other than real number data is specified in “S+1 and S”.
- The converted data “D” exceeds the range of 16-bit integer data.
S Error flag (R9008): Turns on for an instant when:
- The area specified using the index modifier exceeds the limit.
- If data other than real number data is specified in “S+1 and S”.
- The converted data “D” exceeds the range of 16-bit integer data.
S = flag (R900B): Turns on for an instant when the converted data is recognized as “0”.
3 - 312
FP0 High- level Instructions
Outline Converts real number data to 32-bit integer data (the largest integer not
exceeding the floating point type data).
Program example
Boolean
Ladder Diagram
Address Instruction
Trigger 10 ST R 0
11 F328 (DINT)
R0
DT 10
10 F328 DINT, DT10, DT20
DT 20
S D
S Real number data (2 words) or lower 16-bit area of 32-bit data (source)
D Lower 16-bit area of 32-bit data for storing converted data (destination)
Operands
Index
Relay Timer/Counter Register Constant Integer
Operand register
device
WX WY WR SV EV DT IX IY K H f
S A A A A A A A N/A A A N/A
A: Available
D N/A A A A A A A N/A N/A N/A N/A N/A: Not Available
Explanation of example
When the real number data “12345.67” is in DT10 and DT11, as shown below.
DT10:
(f12345.67)
DT11:
DT20:
(K12345)
DT21:
When the real number data “ - 12345.67” is in DT10 and DT11, as shown below.
DT10:
(f - 12345.67)
DT11:
DT20:
(K - 12346)
DT21:
3 - 313
High - level Instructions FP0
Description
Converts real number data ( - 2,147,483,000 to +2,147,483,000) specified by S+1 and S to the 32-bit integer
data with sign (the largest integer not exceeding the floating point type data) when the trigger turns on. The
converted data is stored in D+1 and D.
15 0
Real number
data S: Lower word
15 0
32-bit integer Lower word
D:
data with sign
D+1: Higher word
For detailed information about the processing of specifying the integer device section 1.3
Precaution during programming
This instruction F328 (DINT) cannot be used in the interrupt program.
Flag conditions
S Error flag (R9007): Turns on and stays on when:
- The area specified using the index modifier exceeds the limit.
- If data other than real number data is specified in “S+1 and S”.
- The converted data “D+1 and D” exceeds the range of 32-bit integer data.
S Error flag (R9008): Turns on for an instant when:
- The area specified using the index modifier exceeds the limit.
- If data other than real number data is specified in “S+1 and S”.
- The converted data “D+1 and D” exceeds the range of 32-bit integer data.
S = flag (R900B): Turns on for an instant when the converted data is recognized as “0”.
3 - 314
FP0 High- level Instructions
Outline Converts real number data to 16-bit integer data (rounding the first
decimal point down to integer).
Program example
Boolean
Ladder Diagram
Address Instruction
Trigger 10 ST R 0
11 F329 (FIX)
R0
DT 10
10 F329 FIX, DT10, DT20
DT 20
S D
S Real number data (2 words) or lower 16-bit area of 32-bit data (source)
D Lower 16-bit area for storing converted data (destination)
Operands
Index
Relay Timer/Counter Register Constant Integer
Operand register
device
WX WY WR SV EV DT IX IY K H f
S A A A A A A A N/A A A N/A
A: Available
D N/A A A A A A A N/A N/A N/A N/A N/A: Not Available
Explanation of example
When the real number data “1.234567” is in DT10 and DT11, as shown below.
DT10:
(f1.234567)
DT11:
DT20: (K1)
When the real number data “ - 1.234567” is in DT10 and DT11, as shown below.
DT10:
(f - 1.234567)
DT11:
DT20: (K - 1)
3 - 315
High - level Instructions FP0
Description
Converts real number data ( - 32767.99 to 32767.99) specified by S to the 16-bit integer data with sign
(rounding the first decimal point down to integer) when the trigger turns on. The converted data is stored in D.
15 0
Real number
data S: Lower word
15 0
16-bit integer
data with sign D:
For detailed information about the processing of specifying the integer device section 1.3
Precaution during programming
This instruction F329 (FIX) cannot be used in the interrupt program.
Flag conditions
S Error flag (R9007): Turns on and stays on when:
- The area specified using the index modifier exceeds the limit.
- If data other than real number data is specified in “S+1 and S”.
- The converted data “D+1 and D” exceeds the range of 16-bit integer data.
S Error flag (R9008): Turns on for an instant when:
- The area specified using the index modifier exceeds the limit.
- If data other than real number data is specified in “S+1 and S”.
- The converted data “D+1 and D” exceeds the range of 16-bit integer data.
S = flag (R900B): Turns on for an instant when the converted data is recognized as “0”.
3 - 316
FP0 High- level Instructions
Outline Converts real number data to 32-bit integer data (rounding the first
decimal point down to integer).
Program example
Boolean
Ladder Diagram
Address Instruction
Trigger 10 ST R 0
11 F330 (DFIX)
R0 DT 10
10 F330 DFIX, DT10, DT20 DT 20
S D
S Real number data (2 words) or lower 16-bit area of 32-bit data (source)
D Lower 16-bit area of 32-bit data for storing converted data (destination)
Operands
Index
Relay Timer/Counter Register Constant Integer
Operand register
device
WX WY WR SV EV DT IX IY K H f
S A A A A A A A N/A A A N/A
A: Available
D N/A A A A A A A N/A N/A N/A N/A N/A: Not Available
Explanation of example
When the real number data “123456.7” is in DT10 and DT11, as shown below.
DT10:
(f123456.7)
DT11:
DT20:
(K123456)
DT21:
When the real number data “ - 123456.7” is in DT10 and DT11, as shown below.
DT10:
(f - 123456.7)
DT11:
DT20:
(K - 123456)
DT21:
3 - 317
High - level Instructions FP0
Description
Converts real number data ( - 2,147,483,000 to 2,147,483,000) specified by S+1 and S to 32-bit integer data
with sign (rounding the first decimal point down to integer) when the trigger turns on. The converted data is
stored in D+1 and D.
15 0
Real number
data S: Lower word
15 0
32-bit integer Lower word
D:
data with sign
D+1: Higher word
For detailed information about the processing of specifying the integer device section 1.3
Precaution during programming
This instruction F330 (DFIX) cannot be used in the interrupt program.
Flag conditions
S Error flag (R9007): Turns on and stays on when:
- The area specified using the index modifier exceeds the limit.
- If data other than real number data is specified in “S+1 and S”.
- The converted data “D+1 and D” exceeds the range of 32-bit integer data.
S Error flag (R9008): Turns on for an instant when:
- The area specified using the index modifier exceeds the limit.
- If data other than real number data is specified in “S+1 and S”.
- The converted data “D+1 and D” exceeds the range of 32-bit integer data.
S = flag (R900B): Turns on for an instant when the converted data is recognized as “0”.
3 - 318
FP0 High- level Instructions
Outline Converts real number data to 16-bit integer data (rounding the first
decimal point off to integer).
Program example
Boolean
Ladder Diagram
Address Instruction
Trigger 10 ST R 0
11 F331 (ROFF)
R0 DT 10
10 F331 ROFF, DT10, DT20
DT 20
S D
S Real number data (2 words) or lower 16-bit area of 32-bit data (source)
D 16-bit area for storing converted data (destination)
Operands
Index
Relay Timer/Counter Register Constant Integer
Operand register
device
WX WY WR SV EV DT IX IY K H f
S A A A A A A A N/A A A N/A
A: Available
D N/A A A A A A A N/A N/A N/A N/A N/A: Not Available
Explanation of example
When the real number data “1234.567” is in DT10 and DT11, as shown below.
DT10:
(f1234.567)
DT11:
DT20: (K1235)
When the real number data “ - 1234.567” is in DT10 and DT11, as shown below.
DT10:
(f - 1234.567)
DT11:
DT20: (K - 1235)
3 - 319
High - level Instructions FP0
Description
Converts real number data ( - 32767.99 to +32767.99) specified by S+1 and S to 16-bit integer data with sign
(rounding the first decimal point off to integer) when the trigger turns on. The converted data is stored in D.
15 0
Real number
data S: Lower word
15 0
16-bit integer
data with sign D:
For detailed information about the processing of specifying the integer device section 1.3
Precaution during programming
This instruction F331 (ROFF) cannot be used in the interrupt program.
Flag conditions
S Error flag (R9007): Turns on and stays on when:
- The area specified using the index modifier exceeds the limit.
- If data other than real number data is specified in “S+1 and S”.
- The converted data “D” exceeds the range of 16-bit integer data.
S Error flag (R9008): Turns on for an instant when:
- The area specified using the index modifier exceeds the limit.
- If data other than real number data is specified in “S+1 and S”.
- The converted data “D” exceeds the range of 16-bit integer data.
S = flag (R900B): Turns on for an instant when the converted data is recognized as “0”.
3 - 320
FP0 High- level Instructions
Outline Converts real number data to 32-bit integer data (rounding the first
decimal point off to integer).
Program example
Boolean
Ladder Diagram
Address Instruction
Trigger 10 ST R 0
11 F332 (DROFF)
R0 DT 10
10 F332 DROFF, DT10, DT20
DT 20
S D
S Real number data (2 words) or lower 16-bit area of 32-bit data (source)
D Lower 16-bit area of 32-bit data for storing converted data (destination)
Operands
Index
Relay Timer/Counter Register Constant Integer
Operand register
device
WX WY WR SV EV DT IX IY K H f
S A A A A A A A N/A A A N/A
A: Available
D N/A A A A A A A N/A N/A N/A N/A N/A: Not Available
Explanation of example
When the real number data “45678.51” is in DT10 and DT11, as shown below.
DT10:
(f45678.51)
DT11:
DT20:
(K45679)
DT21:
When the real number data “ - 45678.51” is in DT10 and DT11, as shown below.
DT10:
(f - 45678.51)
DT11:
DT20:
(K - 45679)
DT21:
3 - 321
High - level Instructions FP0
Description
Converts real number data ( - 2,147,483,000 to +2,147,483,000) specified by S+1 and S to 32-bit integer data
with sign (rounding the first decimal point off to integer) when the trigger turns on. The converted data is
stored in D+1 and D.
15 0
Real number
data S: Lower word
15 0
32-bit integer Lower word
D:
data with sign
D+1: Higher word
For detailed information about the processing of specifying the integer device section 1.3
Precaution during programming
This instruction F332 (DROFF) cannot be used in the interrupt program.
Flag conditions
S Error flag (R9007): Turns on and stays on when:
- The area specified using the index modifier exceeds the limit.
- If data other than real number data is specified in “S+1 and S”.
- The converted data “D+1 and D” exceeds the range of 32-bit integer data.
S Error flag (R9008): Turns on for an instant when:
- The area specified using the index modifier exceeds the limit.
- If data other than real number data is specified in “S+1 and S”.
- The converted data “D+1 and D” exceeds the range of 32-bit integer data.
S = flag (R900B): Turns on for an instant when the converted data is recognized as “0”.
3 - 322
FP0 High- level Instructions
Outline This instruction rounds down the decimal part of real number data.
Program example
Boolean
Ladder Diagram
Address Instruction
Trigger 10 ST R 0
11 F333 (FINT)
R0 DT 10
10 F333 FINT, DT10, DT20
DT 20
S D
S Real number data (2 words) or lower 16-bit area of 32-bit data (source)
D Lower 16-bit area of 32-bit data for storing converted data (destination)
Operands
Index
Relay Timer/Counter Register Constant Integer
Operand register
device
WX WY WR SV EV DT IX IY K H f
S A A A A A A A N/A A A N/A
A: Available
D N/A A A A A A A N/A N/A N/A N/A N/A: Not Available
Explanation of example
When the real number data “1234.567” is in DT10 and DT11, as shown below.
DT10:
(f1234.567)
DT11:
DT20:
(f1234.000)
DT21:
When the real number data “ - 1234.567” is in DT10 and DT11, as shown below.
DT10:
(f - 1234.567)
DT11:
DT20:
(f - 1235.000)
DT21:
3 - 323
High - level Instructions FP0
Description
The decimal part of the real number data specified in S+1 and S is rounded down, and the result is stored in
D+1 and D.
15 0
Real number
data S: Lower word
15 0
Real number Lower word
D:
data
D+1: Higher word
Flag conditions
S Error flag (R9007): Turns on and stays on when:
- The area specified using the index modifier exceeds the limit.
- If data other than real number data is specified in “S+1 and S”.
S Error flag (R9008): Turns on for an instant when:
- The area specified using the index modifier exceeds the limit.
- If data other than real number data is specified in “S+1 and S”.
S = flag (R900B): Turns on when result of processing is recognized as “0.”
S Carry flag (R9009): Turns on for an instant when the result is overflowed.
3 - 324
FP0 High- level Instructions
Outline This instruction rounds off the decimal part of real number data.
Program example
Boolean
Ladder Diagram
Address Instruction
Trigger 10 ST R 0
11 F334 (FRINT)
R0 DT 10
10 F334 FRINT, DT10, DT20 DT 20
S D
S Real number data (2 words) or lower 16-bit area of 32-bit data (source)
D Lower 16-bit area of 32-bit data for storing converted data (destination)
Operands
Index
Relay Timer/Counter Register Constant Integer
Operand register
device
WX WY WR SV EV DT IX IY K H f
S A A A A A A A N/A A A N/A
A: Available
D N/A A A A A A A N/A N/A N/A N/A N/A: Not Available
Explanation of example
When the real number data “1234.567” is in DT10 and DT11, as shown below.
DT10:
(f1234.567)
DT11:
DT20:
(f1235.000)
DT21:
When the real number data “ - 1234.567” is in DT10 and DT11, as shown below.
DT10:
(f - 1234.567)
DT11:
DT20:
(f - 1235.000)
DT21:
3 - 325
High - level Instructions FP0
Description
The decimal part of the real number data stored in S+1 and S is rounded off, and the result is stored in D+1
and D.
15 0
Real number
data S: Lower word
15 0
Real number Lower word
D:
data
D+1: Higher word
Flag conditions
S Error flag (R9007): Turns on and stays on when:
- The area specified using the index modifier exceeds the limit.
- If data other than real number data is specified in “S+1 and S”.
S Error flag (R9008): Turns on for an instant when:
- The area specified using the index modifier exceeds the limit.
- If data other than real number data is specified in “S+1 and S”.
S = flag (R900B): Turns on when result of processing is recognized as “0.”
S Carry flag (R9009): Turns on for an instant when the result is overflowed.
3 - 326
FP0 High- level Instructions
S D
S Real number data (2 words) or lower 16-bit area of 32-bit data (source)
D Lower 16-bit area of 32-bit data for storing converted data (destination)
Operands
Index
Relay Timer/Counter Register Constant Integer
Operand register
device
WX WY WR SV EV DT IX IY K H f
S A A A A A A A A A A A
A: Available
D N/A A A A A A A N/A N/A N/A N/A N/A: Not Available
Explanation of example
When the real number data “ - 60000.00” is in DT10 and DT11, as shown below.
DT10:
(f - 60000.00)
DT11:
DT20:
(f60000.00)
DT21:
When the real number data “ - 30000.00” is in DT10 and DT11, as shown below.
DT10:
(f - 30000.00)
DT11:
DT20:
(f30000.00)
DT21:
3 - 327
High - level Instructions FP0
Description
The real number data stored in S+1 and S is changed sign bit, and the result is stored in D+1 and D.
15 0
Real number
data S: Lower word
15 0
Real number Lower word
D:
data
D+1: Higher word
Flag conditions
S Error flag (R9007): Turns on and stays on when:
- The area specified using the index modifier exceeds the limit.
- If data other than real number data is specified in “S+1 and S”.
S Error flag (R9008): Turns on for an instant when:
- The area specified using the index modifier exceeds the limit.
- If data other than real number data is specified in “S+1 and S”.
S Carry flag (R9009): Turns on for an instant when the result is overflowed.
3 - 328
FP0 High- level Instructions
S D
S Real number data (2 words) or lower 16-bit area of 32-bit data (source)
D Lower 16-bit area of 32-bit data for storing converted data (destination)
Operands
Index
Relay Timer/Counter Register Constant Integer
Operand register
device
WX WY WR SV EV DT IX IY K H f
S A A A A A A A A A A A
A: Available
D N/A A A A A A A N/A N/A N/A N/A N/A: Not Available
Explanation of example
When the real number data “1234.567” is in DT10 and DT11, as shown below.
DT10:
(f1234.567)
DT11:
DT20:
(f1234.567)
DT21:
When the real number data “ - 1234.567” is in DT10 and DT11, as shown below.
DT10:
(f - 1234.567)
DT11:
DT20:
(f1234.567)
DT21:
3 - 329
High - level Instructions FP0
Description
Takes the absolute value of real number data specified by S+1 and S when the trigger turns on. The result
(absolute value) is stored in D+1 and D.
15 0
Real number
data S: Lower word
15 0
Real number Lower word
D:
data
D+1: Higher word
Specifying the integer device with [S], the integer data is internally converted to real numbers before
operations continue.
When the constant K is specified in [S], the operations are the same as when a integer device is specified.
For detailed information about the processing of specifying the integer device section 1.3
Flag conditions
S Error flag (R9007): Turns on and stays on when:
- The area specified using the index modifier exceeds the limit.
- If data other than real number data is specified in “S+1 and S”
S Error flag (R9008): Turns on for an instant when:
- The area specified using the index modifier exceeds the limit.
- If data other than real number data is specified in “S+1 and S”
S = flag (R900B): Turns on when result of processing is recognized as “0.”
S Carry flag (R9009): Turns on for an instant when the result is overflowed.
3 - 330
FP0 High- level Instructions
Outline This instruction converts the units of an angle from degrees to radians.
Program example
Boolean
Ladder Diagram
Address Instruction
Trigger 10 ST R 0
11 F337 (RAD)
R0 DT 10
10 F337 RAD, DT10, DT20 DT 20
S D
S Angle data (degrees) (2 words) or lower 16-bit area of 32-bit data
D Lower 16-bit area of 32-bit data for storing converted data
Operands
Index
Relay Timer/Counter Register Constant Integer
Operand register
device
WX WY WR SV EV DT IX IY K H f
S A A A A A A A A A A A
A: Available
D N/A A A A A A A N/A N/A N/A N/A N/A: Not Available
Description
The data in degrees of an angle specified in S+1 and S is converted to radians (real number data) and the
result is stored in D+1 and D.
15 0
Angle data (degrees)
(Real number data) S: Lower word
15 0
Angle data (radians) Lower word
D:
(Real number data)
D+1: Higher word
Specifying the integer device with [S], the integer data is internally converted to real numbers before
operations continue.
When the constant K is specified in S, the operations are the same as when a integer device is specified.
For detailed information about the processing of specifying the integer device section 1.3
3 - 331
High - level Instructions FP0
Program example
The “f0.7853981” is stored to DT20 and DT21 when the R0 turns on.
R0
F337 RAD, f45, DT20
Flag conditions
S Error flag (R9007): Turns on and stays on when:
- The area specified using the index modifier exceeds the limit.
- If data other than real number data is specified in “S+1 and S”.
S Error flag (R9008): Turns on for an instant when:
- The area specified using the index modifier exceeds the limit.
- If data other than real number data is specified in “S+1 and S”.
S = flag (R900B): Turns on when result of processing is recognized as “0.”
S Carry flag (R9009): Turns on for an instant when the result is overflowed.
3 - 332
FP0 High- level Instructions
S D
S Angle data (radians) (2 words) or lower 16-bit area of 32-bit data
D Lower 16-bit area of 32-bit data for storing converted data
Operands
Index
Relay Timer/Counter Register Constant Integer
Operand register
device
WX WY WR SV EV DT IX IY K H f
S A A A A A A A A A A A
A: Available
D N/A A A A A A A N/A N/A N/A A N/A: Not Available
Description
The angle data in radians (real number data) specified in S+1 and S is converted to angle data in degrees and
the result is stored in D+1 and D.
15 0
Angle data (radians)
(Real number data) S: Lower word
15 0
Angle data (degrees) Lower word
D:
(Real number data)
D+1: Higher word
3 - 333
High - level Instructions FP0
Specifying the integer device with [S], the integer data is internally converted to real numbers before
operations continue.
R0
F338 DEG, % DT 0, DT 4
Specifying the integer device with [D], the real numbers are automatically converted into integer data.
R0
F338 DEG, DT 0, % DT 4
When the constant K is specified in S, the operations are the same as when a integer device is specified.
For detailed information about the processing of specifying the integer device section 1.3
Program example
The “f30.00000” is stored to DT20 and DT21 when the R0 turns on.
R0
F338 DEG, f0.5235987, DT20
Flag conditions
S Error flag (R9007): Turns on and stays on when:
- The area specified using the index modifier exceeds the limit.
- If data other than real number data is specified in “S+1 and S”.
- If result of processing is outside integer range when integer device specified
in “D+1 and D”.
S Error flag (R9008): Turns on for an instant when:
- The area specified using the index modifier exceeds the limit.
- If data other than real number data is specified in “S+1 and S”.
- If result of processing is outside integer range when integer device specified
in “D+1 and D”.
S = flag (R900B): Turns on when result of processing is recognized as “0.”
S Carry flag (R9009): Turns on for an instant when the result is overflowed.
3 - 334
FP0 High- level Instructions
Program example
Boolean
Ladder Diagram
Address Instruction
Trigger 10 ST R 0
11 F355 (PID)
R0 DT 10
10 F355 PID, DT 10
S
S Starting number of PID parameter area (30 words)
Operands
Index
Relay Timer/Counter Register Constant
Operand register
WX WY WR SV EV DT IX IY K H f
A: Available
S N/A N/A N/A N/A N/A A N/A N/A N/A N/A N/A: Not Available
Description
PID processing is performed to hold the measured value specified by S+2 at the set value S+1, and the result
is output to S+3.
Derivative type or proportional - derivative type can be selected for the PID processing mode.
Set the PID processing coefficients (proportional gain, integral time and derivative time) and the processing
mode and cycle in the parameter table. PID processing will be performed based on these settings.
3 - 335
High - level Instructions FP0
Flag conditions
S Error flag (R9007): Turns on and stays on when:
- The value set for the parameter is out of range.
- The area specified using the index modifier exceeds the limit.
S Error flag (R9008): Turns on for an instant when:
- The value set for the parameter is out of range.
- The parameter setting is outside allowed range.
Explanation of Parameters
1 Control mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . [S]
Select the type of PID processing and auto-tuning with the H constants.
Control mode Value of [S]
Auto- tuning Auto- tuning
when not executed when executed
Derivative type Reverse operation H0 H8000
Forward operation H1 H8001
Proportional - Reverse operation H2 H8002
delivative type
Forward operation H3 H8003
Auto-tuning
The optimum values for the Kp, Ti, and Td of the PID parameters can be measured by measuring the process
response. When auto tuning is executed, the estimated results are reflected in the parameter area after auto
tuning has been completed. (There may be cases in which auto tuning cannot be executed, depending on the
process. If this happens, processing returns to the original parameter operation.)
For precautions concerning execution of auto tuning, refer to the following page.
3 - 336
FP0 High- level Instructions
Input the current process control value with the A/D converter or other device. Adjust so that it falls within the
following range.
K0 to K10000
4 Output value (MV) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . [S+3]
The result of PID processing is stored. Use the D/A converter or other device to output it to the process.
K0 to K10000
5 Output lower limit value . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . [S+4]
3 - 337
High - level Instructions FP0
Set the cycle for executing PID processing. The set value × 0.01 will be the actual control period.
The setting range is K1 to K6000 (0.01 to 60.0 seconds, specify in increments of 0.01 seconds).
11 Auto-tuning progress . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . [S+10]
If auto - tuning is specified in the control mode, the degree to which auto - tuning has progressed
is indicated. The values for K1 to K5 are stored based on the progress from the default value of 0,
and the values return to the default values when auto - tuning has been completed.
12 PID processing work area . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . [S+11] to [S+29]
3 - 338
FP0 High- level Instructions
en : SP - PVn
ΔDn : (ηβ - 1) Dn- 1 + β (PVn- 1 - PVn)
η: 1/8 (fixed)
β: Td/(Ts + ηTd)
en :PVn - SP
ΔDn : (ηβ - 1) Dn- 1 + β (PVn - PVn- 1)
η: 1/8 (fixed)
β: Td/(Ts + ηTd)
en : SP - PVn
ΔDn : (η β - 1)Dn- 1 + β (PVn- 1 - PVn)
η: 1/8 (fixed)
β: Td/(Ts + ηTd)
en : PVn - SP
ΔDn : (ηβ - 1) Dn- 1 + β (PVn - PVn- 1)
η: 1/8 (fixed)
β: Td/(Ts + ηTd)
3 - 339
High - level Instructions FP0
Measurement
signal PV
e Kp=2
MV 2
Kp=1
1 1
Kp=.5
.5
0 t 0 t
2) Integral operation
Integral operation generates an output which is proportional to the integral time of the input.
Setting
signal SV + Offset e Integral
Output mi
- operation
Measurement
mi=1/Tiedt signal PV
e mi
In combination with proportional operation or proportional - derivative operation, integral operation removes
the offset produced by these methods.
Integral operation grows stronger as the integral time (Ti) is shortened.
3 - 340
FP0 High- level Instructions
3) Derivative operation
Derivative operation generates an output which is proportional to the derivative time of the input.
Setting
signal SV + Offset e Derivative
Output mD
- operation
Measurement
de signal PV
mD=TD S
dt
e mD
The advancing characteristic of derivative control alleviates the adverse effect which the delaying
characteristic of the process exerts on control.
Derivative control grows stronger as the derivative time (Td) is increased.
In the case of pure derivative operation, control can temporarily become ineffective if noise is input, and this
can have an adverse effect on the process being controlled. For this reason, incomplete differential operation
is executed.
e mD
4) PID operation
PID operation is a combination of proportional, integral, and derivative operation.
Setting +
signal SV Offset e Output MV
+ Integral +
Kp
- operation +
Derivative
Measurement signal PV
operation
If the parameters are set to the optimum values, PID control can quickly bring the amount of control to the
target value and maintain it there.
3 - 341
High - level Instructions FP0
3 - 342
Chapter 4
Precautions During Programming
next page
Precautions During Programming FP0
4- 2
FP0 Precautions During Programming
If there are any duplicated outputs, an error message (DUP USE) and the address will
be displayed.
Using NPST-GR software:
Excute the “TOTALLY CHECK A PROGRAM” on “CHECK A PROGRAM.”
If there are any duplicated outputs, an error message (DUPLICATED OUTPUT
ERROR) and the address will be displayed. If you execute “SEARCH AN ERROR,” the
error message will be displayed, and the first address number will be displayed.
The above shows the operation menu for the “NPST - GR” tool software.
The “FPWIN GR” tool software has a similar operation menu.
For information on operating the menus, please check the “Help” menu.
4- 3
Precautions During Programming FP0
4.1.2 When Output is Repeated with an OT, KP, SET, or RST Instruction
Example: Processing when SET, RST and OT instructions are used (X0 to
X2 are all on).
X0 R0
S
R0
This section of the program is
processed as if R0 were on.
X1 R0
R
X2 R0
Example: Output to the same output relay Y0 with OT, SET and RST
instructions.
X0 Y0
Y0: on
X1 Y0
S Y0: on
X2 Y0
R Y0: off
4- 4
FP0 Precautions During Programming
BCD is an acronym for binary - coded decimal, and means that each digit of a decimal
number is expressed as a binary number.
Example:
Expressing a decimal number in BCD:
Decimal number
Each digit is converted
to a binary number.
When inputting data from a digital switch to the PLC or outputting data to a 7 - segment
display (with a decoder), the data must be in BCD form. In this case, use a data
conversion instruction as shown in the examples at below.
BCD arithmetic instructions “F40 (B+) to F58 (DB - 1)” also exist which allow direct
operation on BCD data, however, it is normally most convenient to use BIN operation
instructions “F20 (+) to F38(D - 1)” as operation in the PLC takes place in binary.
4- 5
Precautions During Programming FP0
4- 6
FP0 Precautions During Programming
Like other registers, index registers have two points, IX and IY, for reading and writing
16-bit data.
Use an index register to indirectly specify a memory area number. (This is also called
index modification.)
Example:
Transferring the contents of data register DT100 to the number
specified by the contents of an index register.
R0
F0 MV, DT100, IXDT0
In this example, the number of the destination data register varies depending on the
contents of IX with DT0 acting as a base. For example, when IX contains K10 the
destination will be DT10, and when IX is K20, the destination will be DT20.
In this way, index registers allow the specification of multiple memory areas with a single
instruction, and thus index registers are very convenient when handling large amounts
of data.
Index registers can be used to modify other types of memory areas in addition to data
registers DT.
IXWX0, IXWY1, IXWR0, IXSV0, IXEV2, IXDT100
Constants can also be modified.
IXK10, IXH1001
An index register cannot modify another index register.
IXIX, IXIY
When using index modification with an instruction which handles 32-bit data, specify
with IX. In this case, IX and IY are handled together as 32-bit data.
Higher 16-bit area Lower 16-bit area
Contents of IY Contents of IX
4- 7
Precautions During Programming FP0
Example:
Writing the contents of word external input relay WX3 to a
sequence of data registers beginning from DT0.
R0
F0 MV, K0, IX 1
R1
DF F0 MV, WX3, IXDT0 2
F35 +1, IX 3
PLC
4- 8
FP0 Precautions During Programming
R0
DF F81 BIN, WX1, IX 1
7-segmenet
Timer elapsed
indicator
value display
PLC
Timer
number 1 Digital
setting switches
WX1
R1
DF F81 BIN, WX1, IX 1
4- 9
Precautions During Programming FP0
4 - 10
FP0 Precautions During Programming
Procedure:
1. Check the location of the error.
Check the address where the error occurred, which is stored in
DT9017 and DT9018, and make sure the high- level instruction for
that address is correct and appropriate.
2. Clear the error.
Use a programming tool to clear the error. (If the mode selector is set
to RUN, RUN will resume as soon as the error is cleared.)
In the “STATUS DISPLAY” menu of NPST - GR software, press the
Error clear “F3” key.
The above shows the menu for the “NPST - GR” tool software.
The “FPWIN GR” tool software has a similar menu.
For information on operating the menus, please check the “Help”
menu.
In FP Programmer II, press the following keys.
(- ) SHIFT (DELT)
ACLR 1 1 2 ENT
OP SC INST
4 - 11
Precautions During Programming FP0
Check if an extraordinarily large value or negative value was stored in the index register.
Example:
R0
F32 %, DT0, DT100, DT200
4 - 12
FP0 Precautions During Programming
on on
off Operation of off
Operation of
instruction instruction
Executed only one time
Executed every scan
The condition of the previous execution and the condition of the current execution are
compared, and the instruction is executed only if the previous condition was off and the
current condition is on. In any other case, the instruction is not executed.
4 - 13
Precautions During Programming FP0
Trigger
Operation
If you need to execute an instruction when the trigger (execution condition) is on prior
to switching to RUN mode, use R9014 (initial pulse off relay) in your program on the
following page. (R9014 is a special internal relay which is off during the first scan and
turns on at the second scan.)
4 - 14
FP0 Precautions During Programming
X0 Y0
DF
Add R9014
X0 R9014 Y0
DF
RUN
(Power on)
X0
Y0
Even if X0 was initially on, the input condition (X0) for the DF
instruction is off - to - on at the second scan, therefore derivative output
is obtained.
X0
CT 100
X1
Add R9014
X0 R9014
CT 100
X1
RUN
(Power on)
X0
CT100
counting
operation Even if X0 was initially on, the input condition (X0) for the counter
is off - to - on at the second scan, therefore the count is
incremented.
4 - 15
Precautions During Programming FP0
Instructions which leading edge detection compare the condition of the previous
execution and the condition of the current execution, and execute the instruction only
if the previous condition was off and the current condition is on. In any other case, the
instruction is not executed.
When a leading edge detection instruction is used with an instruction which changes
the order of instruction execution such as MC, MCE, JP or LBL, the operation of the
instruction may change as follows depending on input timing. Take care regarding this
point.
Example 1:
Using the DF instruction between MC and MCE instructions
X0
MC 0
X1 Y0
DF
MCE 0
Time chart 1
X0
X1
Y0
Previous
execution of DF The input condition (X1) for the DF instruction has
instruction not changed since the time of the previous
execution, thus derivative output is not obtained.
Time chart 2
X0
X1
Y0
Previous
execution of DF The input condition (X1) for the DF instruction has
instruction changed from off to on since the time of the previous
execution, thus derivative output is obtained.
4 - 16
FP0 Precautions During Programming
Example 2:
Using the CT instruction between JP and LBL instructions
R0
JP 1
X0
CT 100
X1
LBL 1
Time chart 1
R0
X0
Counting
operation
Final timing at
which the The count is not incremented, because the final
previous JP timing at which the previous JP instruction was not
instruction was executed has not been changed, and the execution
not executed condition X0 for the counter input has not changed.
Time chart 2
R0
X0
Counting
operation
Final timing at
which the The count is incremented, because the count input
previous JP changed from off to on after the final timing at which
instruction the previous JP instruction was not executed.
was not
executed
4 - 17
Precautions During Programming FP0
X2 X0 X2
Program example 2:
Program in which the example 2 is rewritten
ANS
X0 X1 TMX5, K30 Y0 X0 X1 TMX 5, K 30 Y0
X2 X0 X2
Program example 3:
Program in which the example 3 is rewritten
PSHS
X0 X1 Y0 X0 X1 Y0
X2 Y1 X0 X2 Y1
DF DF
X3 X0 X3
RDS
POPS
4 - 18
FP0 Precautions During Programming
4 - 19
Precautions During Programming FP0
Interrupt Restrictions
When using interrupt, high-speed counter, pulse output or PWM output functions, do
not perform a rewrite during RUN.
If a rewrite during RUN is executed, the following problems may occur. Exercise caution.
Interrupt programs will be disabled. Enable by executing an ICTL instruction once
again.
4 - 20
FP0 Precautions During Programming
Block a Block b
next page
4 - 21
Precautions During Programming FP0
4 - 22
FP0 Precautions During Programming
T5 Y0
4 - 23
Precautions During Programming FP0
T5 Y0
This method rewrites the value
in the set value area. The
program itself is not rewritten.
4 - 24
FP0 Precautions During Programming
Procedure:
1. Move the cursor to the position to be registered.
2. Press the “F6 (ENTRY)” key.
3. Press the “F6” key and enter the timer number.
4. Press the “Esc” key to register.
5. Move the cursor to the position to be rewritten.
6. Press the “F4” key.
7. Press the “F7” key and enter the number.
The above shows the menu for the “NPST - GR” tool software.
The “FPWIN GR” tool software has a similar menu.
For information on operating the menus, please check the Help menu.
4 - 25
Precautions During Programming FP0
2. Read SV0.
TM READ
0
T-SV
3. Clear SV0.
(HELP)
CLR
4 - 26
FP0 Precautions During Programming
Input/output update
Operation
Peripheral service
4 - 27
Precautions During Programming FP0
4 - 28
Chapter 5
High - speed Counter/Pulse Output/
PWM Output
next page
High - speed Counter/Pulse Output/ PWM Output FP0
5- 2
FP0 High - speed Counter/Pulse Output/ PWM Output
Roller Cutter
Motor Inverter
START
Encoder STOP signal
Cutter blade
control signal
Encoder output is FP0
input to the high-
speed counter
Pulse output
Y1 Motor
CW/CCW output driver
Y3
2
Stepping motor,
Servo motor
5- 3
High - speed Counter/Pulse Output/ PWM Output FP0
heating
increases.
When you decrease it...
heating
decreases.
Channel number
There are four channels for the built - in high- speed counter.
The channel number allocated for the high- speed counter will change depending on
the function being used.
Counting range
K - 8388608 to K8388607
(HFF8000 to H7FFFFF)
(Coded 24 - bit binary)
5- 4
FP0 High - speed Counter/Pulse Output/ PWM Output
5.2.1 Specifications
Note
Reset input X2 can be set to either CH0 or CH1. Reset input X5
can be set to either CH2 or CH3.
5- 5
High - speed Counter/Pulse Output/ PWM Output FP0
Note
The maximum 1-point output for instruction F168 (SPD1) is 9.5 kHz.
5- 6
FP0 High - speed Counter/Pulse Output/ PWM Output
Channel
The same channel cannot be used by more than one function.
Example of prohibited application:
You cannot share CH0 with the high- speed counter and pulse output functions.
5- 7
High - speed Counter/Pulse Output/ PWM Output FP0
Example 1:
While in the incremental input mode and using the two
channels CH0 and CH1, if CH0 is being used at 8 kHz, then
CH1 can be used up to 2 kHz.
Example 2:
While in the 2 - phase input mode and using the two channels
CH0 and CH2, if CH0 is being used at 1 kHz, then CH2 can be
used up to 1 kHz.
The maximum output frequency when using the pulse output function will differ
depending on the output contact number as shown in the table.
Example 1:
When using either only Y0 or only Y1, the maximum output
frequency is 10 kHz.
Example 2:
When using the two contacts Y0 and Y1, the maximum output
frequency is 5 kHz.
When using the high- speed counter function and pulse output function, specifications
will differ depending on the conditions of use.
Example:
When using one pulse output contact with a maximum output
frequency of 5 kHz, the maximum counting speed of the
high - speed counter being used simultaneously is 5 kHz with
the incremental mode and 1 kHz with the 2 - phase mode.
5- 8
FP0 High - speed Counter/Pulse Output/ PWM Output
5- 9
High - speed Counter/Pulse Output/ PWM Output FP0
Count 0 1 2 n-1 n
Count 0 1 2 3 4 3 2 1 2 3 4 3
Count 0 1 2 3 4 3 2 1 0
Increasing Decreasing
5 - 10
FP0 High - speed Counter/Pulse Output/ PWM Output
The inputting, as shown in the table on section 5.2.1, will differ depending on the
channel number being used.
The output turned on and off can be specified from Y0 to Y7 as desired with instructions
F166 and F167.
When using CH0 with incremental input and reset input
Count input
X0
Reset input
X2
* The output turned on and off when values match can be specified from Y0 to Y7 as
desired.
When using CH0 with 2 - phase input and reset input
A phase input
X0
B phase input
X1
Reset input
X2
* The output turned on and off when values match can be specified from Y0 to Y7 as
desired.
5 - 11
High - speed Counter/Pulse Output/ PWM Output FP0
Example:
Performing a software reset
X7
DF F0 MV, H 1 , DT9052 ⋅⋅⋅⋅⋅⋅⋅ 1
Example 1:
Set the initial value of K3000 in the high - speed counter
(example of changing the elapsed value).
X7
DF F1 DMV, K3000, DT9044
5 - 12
FP0 High - speed Counter/Pulse Output/ PWM Output
Example 2:
Reads the elapsed value of the high - speed counter and
copies it to DT100.
X7
DF F1 DMV, DT9044, DT100
Each time the ED instruction is executed, the elapsed value is automatically transferred
from the elapsed value area to the special data registers DT9044 and DT9045/
DT90044 and DT90045.
Target value match on instruction (F166)
XA
DF F166 HC1S, K0, K10000, Y7
If the elapsed value (DT9044 and DT9045/DT90044 and DT90045) for channel 0
matches K10000, output Y7 turns on.
XB
DF F166 HC1S, K2, K20000, Y6
If the elapsed value (DT9104 and DT9105/DT90104 and DT90105) for channel 2
matches K20000, output Y6 turns on.
Target value match off instruction (F167)
XC
DF F167 HC1R, K1, K30000, Y4
If the elapsed value (DT9048 and DT9049/DT90048 and DT90049) for channel 1
matches K30000, output Y4 turns off.
XD
DF F167 HC1R, K3, K40000, Y5
If the elapsed value (DT9108 and DT9109/DT90108 and DT90109) for channel 3
matches K40000, output Y5 turns off.
5 - 13
High - speed Counter/Pulse Output/ PWM Output FP0
Wiring examples
FP0
Input terminal
X0
Operation
start X5
Encoder COM
input
Encoder
Motor
Operation Y0 Operation/Stop
+
- COM
Speed
0 5,000
Number of pulse
Y0
5 - 14
FP0 High - speed Counter/Pulse Output/ PWM Output
R100
R100 R101
DF Positioning operations start
R101
F1 DMV, K 0, DT 9044
R101 Y0
S Start signal to inverter
R903A R100 T0 R102
DF/ Completion pulse
(0.5 seconds)
R102 TMX 0, K 5
5 - 15
High - speed Counter/Pulse Output/ PWM Output FP0
Wiring example
FP0
Input terminal
Encoder
input X0
Operation X5
start
COM
Encoder
Motor
Output terminal
Inverter
High - speed Y0 Run/Stop
switching Y1 Fast/Slow
+
- COM
Speed
0 4,500 5,000
Number of pulse
Y0
Y1
5 - 16
FP0 High - speed Counter/Pulse Output/ PWM Output
R100
R100 R101
DF Positioning operations start
R101
F1 DMV, K 0, DT 9044
R101 Y0
S Start signal to inverter
Y1
S High- speed signal to inverter
R100
F61 DCMP, K 4500, DT 9044
R102 Y1
DF R Deceleration
R103 TMX 0, K 5
5 - 17
High - speed Counter/Pulse Output/ PWM Output FP0
5 - 18
FP0 High - speed Counter/Pulse Output/ PWM Output
Home return
Until the home input (X0 or X1) is entered by executing instruction F168, the pulse is
continuously output.
To decelerate the movement when near the home, set the bit corresponding to DT9052/
DT90052 to off → on → off → with the near home input.
For detailed information F0 (MV), F168 (SPD1) and section 5.4.5
JOG operation
Pulses are output from the specified channel while the trigger for instruction F169 is in
the on state.
The directional output and output frequency are specified by instruction F169.
For detailed information F169 (PLS) and section 5.4.5
5 - 19
High - speed Counter/Pulse Output/ PWM Output FP0
Single pulse input driver (pulse input and directional switching input)
One output point is used as a pulse output and the other output is used as a directional
output.
The pulse output terminal, directional output terminal, and home input I/O allocation is
determined by the channel used. For detailed information section 5.2.1
Near home input is substituted by allocating the desired contact point and turning on
and off the specified bit of DT9052/DT90052.
For detailed information F0 (MV)
Up to two driver systems can be connected.
When using CH0
FP0
Home input
X0
*
X2
Near home
input Driver
Pulse output
Y0
Y2
Directional
switching output
* The near home input specifies the desired input, such as X2.
When using CH1
FP0
Home input
X1
*
X3
Near home
input Driver
Pulse output
Y1
Y3
Directional
switching output
* The near home input specifies the desired input, such as X3.
5 - 20
FP0 High - speed Counter/Pulse Output/ PWM Output
Double pulse input driver (CW pulse input and CCW pulse input)
Since a double pulse input is used, switching must be performed by an external relay.
One output contact is used as a pulse output for relay switching.
The pulse output terminal and home input I/O allocation is determined by the channel
used. For detailed information section 5.2.1
Set the control code for instruction F168 to “No directional output.”
For detailed information F168 (SPFD1)
** CCW
Y4 input
* X2 or other desired input can be specified for the near home input.
** Y4 or other desired output can be specified for the relay switching. At this time, the relay
must be switched earlier by the amount of its operation time.
CCW input
Y1
5 - 21
High - speed Counter/Pulse Output/ PWM Output FP0
Generates a pulse from output Y0 at an initial speed of 500 Hz, a maximum speed of
5000 Hz, an acceleration/deceleration time of 200 msec, and a movement amount of
10000 pulses.
5000 Hz
10000 pulses
500 Hz
0 Hz
At this time the high- speed counter elapsed value (DT9044 and DT9045/DT90044 and
DT90045) will be increasing.
Notes
• For trapezoidal control, set the initial speed to no more than
5000 Hz.
• For details on troubleshooting procedures when no pulse is
output when instruction F168 (SPD1) is executed, refer to page
5 - 32.
5 - 22
FP0 High - speed Counter/Pulse Output/ PWM Output
While X2 is in the on state, a pulse of 300 Hz with a duty ratio of 10% is output from Y0.
At this time, directional output (Y2) is off and the count of the elapsed value for the
high- speed counter CH0 (DT9044 and DT9045/DT90044 and DT90045) increases.
X6
F0 MV, H123, DT200
While X6 is in the on state, a pulse of 700 Hz with a duty ratio of 10% is output from Y1.
At this time, directional output (Y3) is off and the count of the elapsed value for the
high- speed counter CH1 (DT9048 and DT9049/DT90048 and DT90049) decreases.
5 - 23
High - speed Counter/Pulse Output/ PWM Output FP0
Example 1: Enable the near home input during home return operations and
begin deceleration.
X3
DF F0 MV, H 4 , DT9052 ..... 1
F0 MV, H 0 , DT9052
Example 1: Set the initial value of K3000 in the high - speed counter (example
of writing the elapsed value).
X7
DF F1 DMV, K3000, DT9044
Example 2: Reads the elapsed value of the high - speed counter to DT100.
X7
DF F1 DMV, DT9044, DT100
Each time the ED instruction is executed, the elapsed value is automatically transferred
from the elapsed value area to the special data registers DT9044 and DT9045/DT90044
and DT90045.
5 - 24
FP0 High - speed Counter/Pulse Output/ PWM Output
Wiring example
FP0
Input terminal
Home sensor X0
Positioning start X1
Positioning start X2
Overrun X7
COM a contact
+
See
note.
-
24 V DC
power supply
. Note
When the stepping motor input is a 5 V photo - coupler type,
connect a 2 KΩ 1/4 W resistor.
5 - 25
High - speed Counter/Pulse Output/ PWM Output FP0
R10 R11
DF Positioning operations start
R11
DT100 Control code: H102
F0 MV, H 102, DT 100
[refer to “instruction
F0 MV, K 500, DT 101 F168 (SPD1)”]
DT101 Initial speed: 500 Hz
F0 MV, K5000, DT 102
DT102 Maximum speed:
F0 MV, K 200, DT 103 5000 Hz
F1 DMV, K10000, DT 104 DT103 Acceleration/decelera-
tion time: 200 msec
F0 MV, K 0, DT 106 DT104 Movement amount:
DT105 10000 pls
F168 SPD1, DT 100, H 0
DT106 Pulse stop
R903A R10 T0 R12
DF/ Positioning completion pulse (1 sec)
R12 TMX 0, K10
5000 Hz
(- side) (+ side)
Motor 10000 pulses
10000
pulses
500 Hz
0 Hz
5 - 26
FP0 High - speed Counter/Pulse Output/ PWM Output
R20 R21
DF Positioning operations start
R21
DT100 Control code: H102
F0 MV, H 102, DT 100
[refer to “instruction
F0 MV, K1000, DT 101 F168 (SPD1)”]
DT101 Initial speed: 1000 Hz
F0 MV, K6000, DT 102
DT102 Maximum speed:
F0 MV, K 300, DT 103 6000 Hz
F1 DMV, K - 8000, DT 104 DT103 Acceleration/decelera-
tion time: 300 msec
F0 MV, K 0, DT 106 DT104 Movement amount:
DT105 - 8000 pls
F168 SPD1, DT 100, H 0
DT106 Pulse stop
R903A R20 T1 R22
DF/ Positioning completion pulse (1 sec)
R22 TMX 1, K10
6000 Hz
(- side) (+ side)
Motor 8000 pulses
8000
pulses
1000 Hz
0 Hz
5 - 27
High - speed Counter/Pulse Output/ PWM Output FP0
R30 R31
DF Positioning operations start
R31
DT100 Control code: H112
F0 MV, H 112, DT 100
[refer to “instruction
F0 MV, K 200, DT 101 F168 (SPD1)”]
DT101 Initial speed: 200 Hz
F0 MV, K4000, DT 102
DT102 Maximum speed:
F0 MV, K 250, DT 103 4000 Hz
F1 DMV, K22000, DT 104 DT103 Acceleration/decelera-
tion time: 250 msec
F0 MV, K 0, DT 106 DT104
Target value: 22000
DT105
F168 SPD1, DT 100, H 0
DT106 Pulse stop
R903A R30 T2 R32
DF/ Positioning completion pulse (1 sec)
R32 TMX 2, K10
(- side) (+ side)
Motor
4000 Hz
Regardless of the current value, its movement
is towards position “22,000.”
200 Hz
0 Hz
5 - 28
FP0 High - speed Counter/Pulse Output/ PWM Output
R40 R41
DF Home return operation start
R41
DT200 Control code: H123
F0 MV, H 123, DT 200
[refer to “instruction
F0 MV, K 100, DT 201 F168 (SPD1)”]
DT201 Initial speed: 100 Hz
F0 MV, K2000, DT 202
DT202 Maximum speed:
F0 MV, K 150, DT 203 2000 Hz
F168 SPD1, DT 200, H 0
DT203 Acceleration/decelera-
tion time: 150 msec
R903A R40 T3 R42
DF/ Home return completion pulse
R42 TMX 3, K10
X4
DF F0 MV, H 4, DT9052 Near home deceleration start
F0 MV, H 0, DT9052
Near home
sensor Home sensor
(- side) (+ side) X3: on X4: on X0: on
Motor
2000 Hz
100 Hz
0 Hz
X0 X4
Home Near 150 msec 150 msec
sensor home
sensor
5 - 29
High - speed Counter/Pulse Output/ PWM Output FP0
R50 R51
DF Home return operation start
R51
DT200 Control code: H122
F0 MV, H 122, DT 200
[refer to “instruction
F0 MV, K 120, DT 201 F168 (SPD1)”]
DT201 Initial speed: 120 Hz
F0 MV, K2500, DT 202
DT202 Maximum speed:
F0 MV, K 100, DT 203 2500 Hz
F168 SPD1, DT 200, H 0 DT203 Acceleration/decelera-
tion time: 100 msec
R903A R50 T4 R52
DF/ Home return completion pulse
R52 TMX 4, K10
X4
DF F0 MV, H 4, DT9052 Near home deceleration start
F0 MV, H 0, DT9052
Near home
sensor Home sensor
(- side) (+ side) X3: on X4: on X0: on
Motor
2500 Hz
120 Hz
0 Hz
X4 X0
Near Home 100 msec 100 msec
home sensor
sensor
5 - 30
FP0 High - speed Counter/Pulse Output/ PWM Output
(- side) (+ side) on
X5
off
Motor
300 Hz
Y0(Pulse)
0 Hz
(- side) (+ side) on
X6
off
Motor
300 Hz
Y0(Pulse)
0 Hz
5 - 31
High - speed Counter/Pulse Output/ PWM Output FP0
No
[F168 SPD1, j, Kj]
Yes Remedy
Yes Special internal
Remedy relay R903A or R903B problem
problem is already on. Not set to K0 or K1.
No No
Control clear
Remedy Yes flag for special data regis- First word
problem ter DT9052/DT90052 of data table is not set Yes Remedy
is on. to incremental (0), absolute problem
(1), or home
No return (2).
No
Remedy Yes HSC CH0 or CH1
is set to system
problem register 400.
Second word of
No data table is set to 40 ≦ No Remedy
initial speed ≦ problem
maximum
Elapsed value speed.
Modify Yes tried to output pulse in
elapsed forward direction at Yes
value. H7FFFFF.
No
Fifth word of data
table is set to HFF8000
No Remedy
≦ target value ≦ problem
Modify Elapsed value
Yes H7FFFFF.
tried to output pulse in
elapsed reverse direction at
value. HFF8000. Yes
No
Please contact your dealer.
No Home input is
already used by
Yes Remedy
interrupt or HSC. problem
No
Please contact your dealer.
Set to absolute Yes
mode
No
Please contact your dealer.
5 - 32
FP0 High - speed Counter/Pulse Output/ PWM Output
While X6 is in the on state, a pulse with a period of 840 msec and duty ratio of 50% is
output from Y0.
X7
F0 MV, H6, DT100
While X7 is in the on state, a pulse with a period of 1.6 sec and duty ratio of 30% is output
from Y1.
5 - 33
High - speed Counter/Pulse Output/ PWM Output FP0
5 - 34
Chapter 6
General - use Serial Communications
6- 2
FP0 General - use Serial Communications
Using the RS232C port, data and commands can be sent to and received from an
external device such as a bar code reader. This is done by executing the F144 (TRNS)
instruction.
Transmission and reception are not enabled in the default settings, so system register
412 must be changed to a general- use port (K2).
The transmission speed (baud rate) and transmission format are set using system
register 413 and 414.
Any desired data register can be prepared as the transmission table, and the data
stored in that table transmitted.
Start and terminal codes are automatically added to the data being transmitted, and the
data is sent. (For details, see “F144 (TRNS)” instruction.)
The data register to be used as the transmission table is specified using the F144
(TRNS) instruction.
Data transmission is executed using the F144 (TRNS) instruction.
There is no restriction on the number of bytes that can be transmitted. Any number of
bytes may be sent, as long as it does not exceed the range that can be used by the data
register.
Transmission
Transmitteddata
storage area
External device
(PC, etc.)
6- 3
General - use Serial Communications FP0
Reception buffer
Reception
Received data
storage area
External device
(bar code reader, etc.)
6- 4
FP0 General - use Serial Communications
Setting the Usage Purpose of the RS232C Port (System Register 412)
Specify “General - use port” (this is K2 for the FP Programmer II). This is the setting
which enables serial communication.
Set these items to match the external device connected to the RS232C port, and if
changing the transmission format, enter settings for the pertinent individual items.
With the FP Programmer II, the various items should be selected in bit units, as shown
below, and settings entered using H constants.
15 6 5 4 3 2 1 0
next page
6- 5
General - use Serial Communications FP0
Note
If no terminal codes are specified for either transmission or
reception, the reception completed flag will not go on. In this
case, watch the number of bytes received to determine whether
the reception has been completed.
0 0 0 1 0 0 1 1
H1 H3
b
Change H3 (default value) to H13.
6- 6
FP0 General - use Serial Communications
Example: Setting 19,200 bit/s for both the tool port and RS232C port
' Write H100.
6- 7
General - use Serial Communications FP0
F144 (TRNS) on
Duplex transmission dis-
instruction abled while F144 (TRNS) in-
execution off struction is being executed
on
R9039
Transmission
completed flag off
Transmitted data 1 2 3 CR
Stored
Reception A A A A E E E
buffer B B B B F B
C C C C G
Half - duplex transmission should be used for general- use serial communication.
Reception is disabled when the reception completed flag (R9038) is on.
Be aware that the reception completed flag (R9038) changes even while a scan is in
progress. (Example: If the reception completed flag is used multiple times as an input
condition, there is a possibility of different statuses existing within the same scan.)
When the F144 (TRNS) instruction is executed, the error flag (R9037), reception
completed flag (R9038) and transmission completed flag (R9039) go off.
Duplex transmission is disabled while the F144 (TRNS) instruction is being executed.
Check the transmission completed flag (R9039) to determine whether duplex
transmission is possible.
6- 8
FP0 General - use Serial Communications
When the F144 (TRNS) instruction is executed, the number of bytes received is cleared,
and the address (write pointer) returns to the initial address in the reception buffer.
Reception stops if the error flag (R9037) goes on. To resume reception, execute the
F144 (TRNS) instruction. This turns off the error flag, and transmits both actual and
empty data.
6.3.2 If “Yes” has been Set for the Start and Terminal Codes
(Start Code: STX, Terminal Code: ETX)
Stored
Reception A A A A D D D D G G H H
buffer B B B B E E E E E E E
C C C C C C C C C C
Number of recep- <1> <2> <3> <0> <1> <2> <2> <0> <1> <0> <1> <1>
tion bytes Number of Number of bytes Number of
Write pointer
bytes received received is cleared bytes received
is cleared when when F144 (TRNS) is cleared when
start code is instruction is exe- start code is
received. cuted. received.
The data is stored in the reception buffer in sequential order, but at the point at which
the start code is received, the number of bytes received is cleared, and the address
(write pointer) is returned to the initial address in the reception buffer.
When the F144 (TRNS) instruction is executed, the number of bytes received is cleared,
and the address (write pointer) is returned to the initial address in the reception buffer.
If there are two start codes, data following the later start code is overwritten and stored
in the reception buffer.
Reception is disabled while the reception completed flag (R9038) is on.
The reception completed flag (R9038) is turned off by the F144 (TRNS) instruction.
Because of this, if the F144 (TRNS) instruction is executed at the same time that the
terminal code is received, the reception completed flag will not be detected.
6- 9
General - use Serial Communications FP0
Transmission Transmission
on
R9039
Transmission
completed flag
off
on Duplex transmission
disabled while F144
F144 (TRNS) in- (TRNS) instruction is
struction execution off being executed
Send buffer a a a a c c c c c
b b b b d d d d d
e e e e e
Number of bytes not yet sent <2> <1> <0> <0> <3> <2> <1> <0> <0>
Transmission point
Start codes (STX) and terminal codes (ETX) are automatically added to the data being
transmitted, and the data is transmitted to an external device. (For information on start
and terminal code settings, see section 6.2.)
Executing the F144 (TRNS) instruction turns off the transmission completed flag
(R9039).
Duplex transmission is disabled while the F144 (TRNS) instruction is being executed.
Check the transmission completed flag (R9039) to determine whether duplex
transmission is possible.
6 - 10
Chapter 7
Programming for FP0 Analog I/O Unit
7- 2
FP0 Programming for FP0 Analog I/O Unit
Analog input
Program example
Digital values which have been converted in the analog I/O unit are stored in any desired
data register.
R9010
F0 MV , WX2 , DT0
If “0 to 20 mA DC input” has been specified for the input range in the above program,
the values of K0 to 4000 are stored in DT0.
Configuration diagram
Analog
CPU I/O unit
7- 3
Programming for FP0 Analog I/O Unit FP0
Analog output
Program example
Digital values which have been stored in any desired data register are transferred to the
analog output area.
R9010
F0 MV , DT10 , WY2
If “0 to 20 mA DC output” has been specified for the output range in the above program,
writing data of range of K0 to 4000 to DT10 causes 0 to 20 mA DC to be output from
the analog I/O unit.
Configuration diagram
Analog
CPU I/O unit
7- 4
Chapter 8
Appendix
8- 2
FP0 Appendix
next page
8- 3
Appendix FP0
8- 4
FP0 Appendix
next page
8- 5
Appendix FP0
Notes
1) Hold or non - hold type can be set using the system registers.
2) The proportion of timer points to counter points can be
changed using a system register 5.
3) Precision of calender timer:
At 0_C/32_F, less than 139 second error per month.
At 25_C/77_F, less than 72 seconds error per month.
At 55_C/131_F, less than 169 seconds error per month.
This accuracy is considered to be the worst fluctuation
coefficient value based on fluctuations in the normal voltage of
5V and the battery backup voltage of 3V. Also, F157 and F158
(time/date addition and subtraction instructions) cannot be
used.
4) When using the RS232C port for communication, we
recommend using resend processing. The driver IC for the
RS232C is in full conformance with EIA/TIA - 232E and CCITT
V.28 standards.
5) The combinations 1 phase × 2 channels and 2 phases × 1
channel are also possible for the high - speed counter.
6) For details and limitations on the high speed counter, pulse
output, and PWM output function, see sections 5.3 to 5.5.
7) The max. counting speed (10kHz) is the counting speed with a
rated input voltage of 24V DC and an ambient temperature of
25°C. The counting speed (frequency) will decrease depending
on the voltage and temperature.
8) If both reset inputs X0 and X1 are reset, X2 will be the reset
input of X1. In the same way, for X3 and X4, X5 acts as the
reset input of X4.
9) With a CPU of Ver. 1.2 or a subsequent version, the frequency
will be 0.15Hz to 1kHz.
10) The maximum is 9.5kHz when the positioning control
instruction (F168) is executed.
11) Precautions when using the battery backup function
Secondary (chargeable) battery is used as backup battery in
the FP0 T32C control unit. The battery is not charged before
the unit is shipped, so please make sure that the built - in
backup battery have been charged before using the unit. For
detailed information, refer to “FP0 Hardware manual.”
8- 6
FP0 Appendix
8- 7
Appendix FP0
Decimal
1, 2, 3 . . . . . 12
Hexadecimal
0, 1, 2, 3 . . . 9 A,B . . . F
X 0, X 1 ..................... X F
X 10, X 11 . . . . . . . . . . . . . . . . . . . . . X 1F
X 20, X 21 . . . . . . . . . . . . . . . . . . . . . X 2F
to to to
X 70, X 71 . . . . . . . . . . . . . . . . . . . . . X 7F
8- 8
FP0 Appendix
next page
8- 9
Appendix FP0
Notes
1) There are two unit types, the hold type that saves the
conditions that exist just before turning the power off or
changing from the RUN mode to PROG. mode, and the
non - hold type that resets them. These areas can be specified
as hold type or non - hold type by setting system register.
For the FP0 T32, the selection of hold type and non - hold type
can be changed by the setting of system register. For details
about the setting of system registers, refer to section 8.4. For
the FP0 C10/C14/C16/C32/SL1, that area is fixed and allotted
the numbers as shown below.
2) The points for the timer and counter can be changed by the
setting of system register 5. The number given in the table are
the numbers when system register 5 is at its default setting.
For detailed about the system registers section 8.4
8 - 10
FP0 Appendix
8 - 11
Appendix FP0
Using FP programmer II
Procedure:
1. Set the mode of the FP0 control unit to PROG.
2. Press the keys on the FP programmer II, as shown below.
(- )
ACLR 5 0 ENT
OP
4. To change the set value, press the <CLR (clear)> key and
write the new value as indicated in the system register
table.
8 - 12
FP0 Appendix
Setting example
To increase the number of timers to 120, change the value of system register 5 to K120.
MIN (0): All counter
0
For FP0 T32, set the system registers 5 and 6 to the same value. This sets the timer to
a non-hold type and counter to a hold type.
By setting system register 5 to “0”, the whole area becomes the counter. Also, by setting
it to the value “144”, the whole area becomes the timer.
8 - 13
Appendix FP0
Hold types and non - hold type settings (System registers 6 to 8 and 14)
With the FP0 C10/C14/C16/C32/SL1, the areas held in the event of a power supply
interruption are fixed at the areas shown in the table below, and the settings for system
registers 6 to 8 and 14, will be invalid.
C10/C14/C16
Timer Non-hold type: All points
Counter Non-hold type: From the set value to C139
Hold type: 4 points (elapsed values) C140 to C143
Internal relay Non-hold type: 976 points (R0 to R60F)
61 words (WR0 to WR60)
Hold type: 32 points (R610 to R62F)
2 words (WR61 to WR62)
Data register
g Non-hold type: 1652 words (DT0 to DT1651)
Hold type: 8 words (DT1652 to DT1659)
C32/SL1
Timer Non-hold type: All points
Counter Non-hold type: From the set value to C127
Hold type: 16 points (elapsed values) C128 to C143
Internal relay Non-hold type: 880 points (R0 to R54F)
55 words (WR0 to WR54)
Hold type: 128 points (R550 to R62F)
8 words (WR55 to WR62)
Data register
g Non-hold type: 6112 words (DT0 to DT6111)
Hold type: 32 words (DT6112 to DT6143)
With the FP0 T32, set each relay and register to a hold type or non-hold type.
For normal situations, set the system registers 5 and 6 to the same value. This sets the
timer to a non-hold type and counter to a hold type.
By setting this value to “0”, the whole area becomes hold type. Also, by setting it to the
value 1 higher than the last number, the whole area becomes non-hold type.
Default value
Type FP0 T32
Area
Timer All non- hold type
Counter All hold type
Internal Non - hold Non- hold type: 10 words (WR0 to WR9)
relay type
Hold type Hold type: 53 words (WR10 to WR62)
Data register All hold type
8 - 14
FP0 Appendix
C10, C14, C16, C32, T32 and SL1 in the table respectively indicate 10-point, 14-point,
16-point, 32-point type and S - LINK type FP0 control units.
Item Address Name Default Description
value
Allocation 0 Sequence program area The set values are fixed and cannot be
of user capacity changed.
memory The stored values vary depending on the
type.
K3: 3K words (FP0 C10, C14, C16)
K5: 5K words (FP0 C32, SL1)
K10: 10K words (FP0 T32)
1 to 3 Not used
Hold/ 5 Timer and counter division K100 K0 to K144
Non- hold (setting of starting counter
number)
6 to 8 Not used With the FP0 C10/C14/C16/C32/SL1, values
(Available type: C10, C14, set with the programming tool become invalid.
C16, C32, SL1)
6 Hold type area starting K100 K0 to K144 Set the system regis-
number setting for timer and ters 5 and 6 to the
counter same value.
(Available type: T32)
7 Hold type area starting K10 K0 to K63
number setting for internal
relays (in word units)
(Available type: T32)
8 Hold type area starting K0 K0 to K16384
number setting for data
registers
(Available type: T32)
9 to 13 Not used
14 Not used With the FP0 C10/C14/C16/C32/SL1, values
(Available type: C10, C14, set with the programming tool become invalid.
C16, C32, SL1)
Hold or non - hold setting K1 K0: Hold
for step ladder process
K1: Non- hold
(Available type: T32)
15 Not used
Action on 20 Disable or enable setting for K0 K0: Disable (will be syntax error)
error duplicated output K1: Enable (will not be syntax error)
21, 22 Not used
23 Operation setting when an K0 K0: Stop
I/O verification error occurs K1: Continuation
24, 25 Not used
26 Operation setting when an K0 K0: Stop
operation error occurs K1: Continuation
27 Operation settings when K1 K0: Stop
communication error occurs K1: Continuation
in the remote I/O (S - LINK)
system
8 - 15
Appendix FP0
8 - 16
FP0 Appendix
Notes
• If the operation mode is set to 2 - phase, individual, or direction
differentiation, the setting for CH1 is invalid.
• If reset input settings overlap, the setting of CH1 takes
precedence.
• If system register 400 to 403 have been set simultaneously for
the same input relay, the following precedence order is
effective: [High - speed counter] ' [Pulse catch] ' [Interrupt
input].
• If the NPST - GR software is used, Ver. 4.0 or a subsequent
version is required for the settings of system register 400 to
403.
8 - 17
Appendix FP0
Notes
• If the operation mode is set to 2 - phase, individual, or direction
differentiation, the setting for CH1 is invalid.
• If reset input settings overlap, the setting of CH1 takes
precedence.
• If system register 400 to 403 have been set simultaneously for
the same input relay, the following precedence order is
effective: [High - speed counter] ' [Pulse catch] ' [Interrupt
input].
• If the NPST - GR software is used, Ver. 4.0 or a subsequent
version is required for the settings of system register 400 to
403.
8.4 Table of System Registers
8 - 18
FP0 Appendix
Notes
• If the operation mode is set to 2 - phase, individual, or direction
differentiation, the setting for CH3 is invalid.
• If reset input settings overlap, the setting of CH3 takes
precedence.
• If system register 400 to 403 have been set simultaneously for
the same input relay, the following precedence order is
effective: [High - speed counter] ' [Pulse catch] ' [Interrupt
input].
• If the NPST - GR software is used, Ver. 4.0 or a subsequent
version is required for the settings of system register 400 to
403.
8 - 19
Appendix FP0
Notes
• If the operation mode is set to 2 - phase, individual, or direction
differentiation, the setting for CH3 is invalid.
• If reset input settings overlap, the setting of CH3 takes
precedence.
• If system register 400 to 403 have been set simultaneously for
the same input relay, the following precedence order is
effective: [High - speed counter] ' [Pulse catch] ' [Interrupt
input].
• If the NPST - GR software is used, Ver. 4.0 or a subsequent
version is required for the settings of system register 400 to
403.
8 - 20
FP0 Appendix
H1 H8
Input H18
With the FP0, settings X6 and X7 are invalid.
403 Interrupt input settings H0 Using programming tool software
X5 X4 X3 X2 X1 X0 Specify the input con-
tacts used as inter-
rupt inputs in the up-
per byte.
(0: Standard input/1: Interrupt input)
Using FP programmer II
When setting inputs X0, X1, X2, and X3 as
interrupts, and X0 and X1 are set as interrupt
inputs when going from on to off.
Specify Specify
edge interrupt
15 0
403: 000011 001111
X5 X4 X3 X2 X1 X0 X5 X4 X3 X2 X1 X0
H0 H3 H0 HF
Input H30F
404 to 407 Unused With the FP0, values set with the program-
ming tool become invalid.
next page
8 - 21
Appendix FP0
Notes
• With the NPST - GR software, “0” or “1” is set for each bit on
the screen in the setting for system register 403.
• If system register 400 to 403 are set simultaneously for the
same input relay, the following precedence order is effective:
[High - speed counter] ' [Pulse catch] ' [Interrupt input].
When the high - speed counter is being used in the incremental
input mode, even if input X0 is specified as an interrupt input
and as pulse catch input, those settings are invalid, and input
X0 functions as counter input for the high - speed counter.
No. 400: H1 a This setting will be valid.
No. 402: H1
No. 403: H1
8 - 22
FP0 Appendix
S Modem communication: 15 6 0
Disabled
S Data length (character bits):
8 bits
Modem communication
0: Disabled
1: Enabled
Data length
(character bits)
0: 8 bits
1: 7 bits
When connecting a modem, set the unit
number to 1 with system resister 410.
414 Baud rate Setting by H0 0: 9600 bit/s
setting for programming 1: 19200 bit/s
tool port tool software
Tool port/ 414 Baud rate Setting by H1
RS232C setting for FP program- H 0 0
port set- tool port and mer II
ting RS232C port
RS232C port
Tool port
H0: 19200 bit/s
H0: 9600 bit/s
H1: 9600 bit/s
H1: 19200 bit/s
H2: 4800 bit/s
If anything other
H3: 2400 bit/s
than H0 or H1 is set
for the tool port H4: 1200 bit/s
baud rate, the baud H5: 600 bit/s
rate will be 9600
bit/s. H6: 300 bit/s
Note
NPST - GR software Ver. 4 or later must be used to set system
register 414.
8 - 23
Appendix FP0
Note
NPST - GR software Ver. 4 or later must be used to set system
register 414.
8 - 24
FP0 Appendix
8 - 25
Appendix FP0
8 - 26
FP0 Appendix
Note
Used by the system.
8 - 27
Appendix FP0
Note
Used by the system.
8 - 28
FP0 Appendix
8 - 29
Appendix FP0
Notes
S ERR1 and ERR3 occur even if the power supply
on the S - LINK side is interrupted, but are can-
celed when the power supply is turned on again.
S ERR4 is held. To cancel it, repair the disconnected
wire in the S - LINK system, or whatever is causing
the problem, and then either turn the power to the
FP0 on again, press the SET switch to reset it, or
turn the power supply on again on the S - LINK unit
side.
8 - 30
FP0 Appendix
DT9021
15 8 7 6 5 4 3 2 1 0
DT9021
Multiple errors
(0: Single, 1: Multiple)
Error address 0 to 127
(0 to H7F)
(Initial address if there are multiple errors)
DT90022 DT9022 Scan time (current The current scan time is stored here. Scan time is
value) calculated using the formula:
(* Note) Scan time (ms) = stored data (decimal) × 0.1
K50 indicates 5ms.
Note
Scan time display is only possible in RUN mode, and shows the
operation cycle time. The maximum and minimum values are
cleared when each the mode is switched between RUN mode and
PROG. mode.
8 - 31
Appendix FP0
23 19 16 (INT No.)
0: interrupt disabled (masked)
1: interrupt enabled (unmasked)
DT90026 DT9026 Not used
DT90027 DT9027 Periodical interrupt The value set by ICTL instruction is stored.
(* Note 2) (* Note 2) interval (INT 24) - K0: periodical interrupt is not used
- K1 to K3000: 10ms to 30s
DT90028 DT9028 Not used
DT90029 DT9029 Not used
DT90030 DT9030 Message 0 The contents of the specified message are stored
(* Note 2) (* Note 2) in these special
p data registers
g when F149 (MSG)
( )
i t ti is
instruction i executed.
t d
DT90031 DT9031 Message 1
(* Note 2) (* Note 2)
DT90032 DT9032 Message 2
(* Note 2) (* Note 2)
DT90033 DT9033 Message 3
(* Note 2) (* Note 2)
DT90034 DT9034 Message 4
(* Note 2) (* Note 2)
DT90035 DT9035 Message 5
(* Note 2) (* Note 2)
DT90036 DT9036 Not used
DT90037 DT9037 Work 1 for F96 (SRC) The number of data that match the searched data
instruction is stored here when F96 (SRC) instruction is
executed.
Notes
8 - 32
FP0 Appendix
8 - 33
Appendix FP0
Software reset
0: Yes / 1: No
Count
0: Enable / 1: Disable
Hardware reset
0: Enable / 1: Disable
High- speed counter clear
0: Continue / 1: Clear
Software is not reset: H0 (0000)
Perform software reset: H1 (0001)
Disable count: H2 (0010)
Disable hardware reset: H4 (0100)
Stop pulse output (clear instruction): H8 (1000)
Perform software reset and stop pulse output: H9 (1001)
bit 15 12 11 8 7 4 3 0
DT9052/
DT90052
8 - 34
FP0 Appendix
8 - 35
Appendix FP0
Note
After discharging the battery (including when the power is turned
on for the first time), the values of DT90053 to DT90058 change at
random. Once the time and date have been set, these values will
function normally.
8 - 36
FP0 Appendix
8 - 37
Appendix FP0
8 - 38
FP0 Appendix
When the “ERROR/ALARM LED” on the control unit is flashing, a self - diagnostic error
or syntax check error has occurred. Confirm the contents of the error and take the
appropriate steps.
Procedure:
1. Use the programming tool to call up the error code.
Using NPST-GR software:
By executing the “STATUS DISPLAY”, the error code and content of
error are displayed.
Using FP programmer II:
With the syntax check error, the error code and message is displayed
by simply connecting the unit.
With the self - diagnostic error, press the following keys.
(- ) READ
ACLR 1 1 0 ENT
OP
This is an error detected by the total check function when there is a syntax error or
incorrect setting written in the program. When the mode selector of controller is switched
to the RUN mode, the total check function automatically activates and eliminates the
possibility of incorrect operation from syntax errors in the program.
When a syntax check error is detected
ERROR/ALARM LED begins flashing.
Operation will not begin even after switching to the RUN mode.
Remote operation cannot be used to change to RUN mode.
Clearing a syntax check error
By changing to the PROG. mode, the error will clear and the ERROR/ALARM LED will
turn off.
8 - 39
Appendix FP0
This error occurs when the controller’s self - diagnostic function detects the occurrence
of an abnormality in the system. The self - diagnostic function monitors the memory
abnormal detection, I/O abnormal detection, and other devices.
When a self - diagnostic error occurs
The controller’s ERROR/ALARM LED begins flashing.
The operation of the controller might stop depending on the content of error and the
system resister setting.
The error codes will be stored in the special data resister DT9000 or DT90000.
In the case of operation error, the error address will be stored in the DT9017 and
DT9018/DT90017 and DT90018.
Clearing the self - diagnostic error
Using NPST-GR software:
At the “STATUS DISPLAY”, press the <F3> (error clear) key. Error codes 43 and higher
can be cleared.
Using FP programmer II
Press the keys as shown below. Error codes 43 and higher can be cleared.
(- ) SHIFT
ACLR 1 1 2 ENT WRT
OP SC
Errors can also be cleared by turning off and on the power while in the PROG. mode.
However, the contents of operation memory, not stored with the hold type data, will also
be cleared.
The error can also be cleared depending on the self-diagnostic error set instruction F148
(ERR).
Steps to take for self - diagnostic error
The steps to be taken will differ depending on the error contents. For more details, use
the error code obtained above and consult the table of self-diagnostic error codes.
For detailed information about the self - diagnostic error of the S - LINK control unit
FP0 S - LINK Unit Hardware Manual
8 - 40
FP0 Appendix
8 - 41
Appendix FP0
8 - 42
FP0 Appendix
I/O ad- S - LINK address I/O ad- S - LINK address I/O ad- S - LINK address I/O ad- S - LINK address
dress dress dress dress
input Deci- Hexa- input Deci- Hexa- input Deci- Hexa- input Deci- Hexa-
(X) mal decimal (X) mal decimal (X) mal decimal (X) mal decimal
X80 0 0 X90 16 10 X100 32 20 X110 48 30
X81 1 1 X91 17 11 X101 33 21 X111 49 31
X82 2 2 X92 18 12 X102 34 22 X112 50 32
X83 3 3 X93 19 13 X103 35 23 X113 51 33
X84 4 4 X94 20 14 X104 36 24 X114 52 34
X85 5 5 X95 21 15 X105 37 25 X115 53 35
X86 6 6 X96 22 16 X106 38 26 X116 54 36
X87 7 7 X97 23 17 X107 39 27 X117 55 37
X88 8 8 X98 24 18 X108 40 28 X118 56 38
X89 9 9 X99 25 19 X109 41 29 X119 57 39
X8A 10 A X9A 26 1A X10A 42 2A X11A 58 3A
X8B 11 B X9B 27 1B X10B 43 2B X11B 59 3B
X8C 12 C X9C 28 1C X10C 44 2C X11C 60 3C
X8D 13 D X9D 29 1D X10D 45 2D X11D 61 3D
X8E 14 E X9E 30 1E X10E 46 2E X11E 62 3E
X8F 15 F X9F 31 1F X10F 47 2F X11F 63 3F
I/O ad- S - LINK address I/O ad- S - LINK address I/O ad- S - LINK address I/O ad- S - LINK address
dress dress dress dress
input Deci- Hexa- input Deci- Hexa- input Deci- Hexa- input Deci- Hexa-
(Y) mal decimal (Y) mal decimal (Y) mal decimal (Y) mal decimal
Y80 64 40 Y90 80 50 Y100 96 60 Y110 112 70
Y81 65 41 Y91 81 51 Y101 97 61 Y111 113 71
Y82 66 42 Y92 82 52 Y102 98 62 Y112 114 72
Y83 67 43 Y93 83 53 Y103 99 63 Y113 115 73
Y84 68 44 Y94 84 54 Y104 100 64 Y114 116 74
Y85 69 45 Y95 85 55 Y105 101 65 Y115 117 75
Y86 70 46 Y96 86 56 Y106 102 66 Y116 118 76
Y87 71 47 Y97 87 57 Y107 103 67 Y117 119 77
Y88 72 48 Y98 88 58 Y108 104 68 Y118 120 78
Y89 73 49 Y99 89 59 Y109 105 69 Y119 121 79
Y8A 74 4A Y9A 90 5A Y10A 106 6A Y11A 122 7A
Y8B 75 4B Y9B 91 5B Y10B 107 6B Y11B 123 7B
Y8C 76 4C Y9C 92 5C Y10C 108 6C Y11C 124 7C
Y8D 77 4D Y9D 93 5D Y10D 109 6D Y11D 125 7D
Y8E 78 4E Y9E 94 5E Y10E 110 6E Y11E 126 7E
Y8F 79 4F Y9F 95 5F Y10F 111 6F Y11F 127 7F
8 - 43
Appendix FP0
⋮ ⋮ ⋮ ⋮
63 003F 00000000 00111111 0000 0000 0110 0011
⋮ ⋮ ⋮ ⋮
255 00FF 00000000 11111111 0000 0010 0101 0101
⋮ ⋮ ⋮ ⋮
9999 270F 00100111 00001111 1001 1001 1001 1001
8 - 44
FP0 Appendix
b7
b6 0 0 0 0 1 1 1 1
b5 0 0 1 1 0 0 1 1
b4 0 1 0 1 0 1 0 1
SPA
0 0 0 0 0 NUL DEL 0 @ P ‘ p
CE
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
digit
0 1 1 1 7 BEL ETB ’ 7 G W g w
ast signi
1 0 0 0 8 BS CAN ( 8 H X h x
Leas
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
8 - 45
Appendix FP0
8 - 46
FP0 Index
Index
A Decimal constants (K), 1 - 21
Duplicated output, 4 - 3
ASCII codes, 8 - 45
Duplicated output error, 8 - 41
B E
Basic function instructions, 2 - 4
Elapsed value area for timer/counter
Basic instructions, 2 - 3, 2 - 7 (EV), 1 - 18
Baud rate, 6 - 7, 8 - 23, 8 - 24 Error codes, 8 - 39
BCD, 8 - 44 Execution condition, 3 - 4
BCD arithmetic instructions, 3 - 7 External input relays (X), 1 - 6
BCD data, 4 - 5 External output relays (Y), 1 - 6
BIN arithmetic instructions, 3 - 6
Binary, 8 - 44 F
Bit manipulation instructions, 3 - 10
Forced input and output, 4 - 27
C
G
Carry flag, 8 - 26
General - use serial communications, 6 - 3
Character constants (M), 1 - 23
Clock pulse relay, 8 - 27
Communication format setting, 8 - 23, H
8 - 24
Hexadecimal constants (H), 1 - 22
Constants, 1 - 21, 8 - 9
Hexadecimal, 8 - 44
Control instructions, 2 - 5
High- level instruction number, 3 - 3
Counter (C), 1 - 10
High- level instructions, 3 - 3, 3 - 11
High- speed counter function, 5 - 3, 5 - 9
D High- speed counter function specifica-
tions, 5 - 5
Data compare instructions, 2 - 6
Hold types, 8 - 11
Data comparison instructions, 3 - 7
Hold types and non - hold type settings,
Data conversion instructions, 3 - 8 8 - 14
Data reception, 6 - 4
Data register (DT), 1 - 13
I
Data rotate instructions, 3 - 9
Data shift instructions, 3 - 9 I/O allocation, 8 - 7
I- 1
Index FP0
O
T
Operand, 3 - 3
Terminal codes (EXT), 6 - 6
Operation errors, 4 - 10
Timer (T), 1 - 10
Overflow, 1 - 27
Tool port setting, 8 - 11, 8 - 23
Trigger, 3 - 4
P
Performance specifications, 8 - 3 U
Pulse catch input function settings, 8 - 21
Underflow, 1 - 27
Pulse output function, 5 - 3, 5 - 18
Pulse output function specifications, 5 - 6
PWM output function, 5 - 4, 5 - 33
PWM output specifications, 5 - 6
R
Reception buffer, 6 - 7
Relays, 1 - 3, 8 - 9
Rewrite function during RUN, 4 - 19
RS232C port setting, 8 - 11, 8 - 23 to
8 - 25
RS232C transmission format, 6 - 5
I- 2
FP0 Record of changes
Record of changes
Manual No. Date Description of Changes
ACG - M0091- 1 JUL.1997 First edition
ACG - M0091- 2 JUN.1998 2nd edition
ACG - M0091- 3 OCT.1999 3rd edition
ARCT1F309E/ NOV.1999 4th edition
ACG - M309E S Additional high- level instructions
“F12 (ICRD) Data read from EEPROM”
“P13 (PICWT) Data write to EEPROM”
“F144 (TRNS) Serial data communication control for RS232C port”
“F355 (PID) PID processing”
S Additional chapters and section
“Chapter 7 General - use Serial Communications”
“Chapter 8 Programming for FP0 Analog I/O Unit”
“Section 9.9 ASCII Codes”
ARCT1F309E - 1/ JUN.2000 5th edition
ACG - M309E - 1 S Additional high- level instructions
“Floating point type real number operation instructions”
[“F309 (FMV) to F338 (DEG)”]
R- 1
Record of changes FP0
R- 2