
Introduction
Programming
This
essential
this
In
Listed
also.
manual,
below
preparing
for
are
Manual
"CP-717"
other
documents
the
refers
provides
software
Control
to
relevanttothe
descriptions
the
for
Machine
Pack
the
on
Controller
CP-717,
which
CP-9200SH.
programming
CP-9200SH.
of
is
one
Please
refer
language
peripheral
the
to
these
which
is
devices.
materials
Relevant
Document
Documents
No.
SIE-C873-16.4
SIE-C877-17.4
SIE-C877-17.5
TOE-C877-17.7
CHE-C879-40
KAE-C879-40
SIE-879-40.1
SIE-879-40.2
System
FDS
Control
Control
Control
Pack
Pack
Pack
CP-9200SH
CP-9200SH
Machine
Machine
Controller
Controller
Installation
CP-717
CP-717
CP-717
Brochure
Catalog
CP-9200SH
CP-9200SH
NameofDocument
Manual
Operation
Operation
Instructions
Manual
Manual
User's
Servo
(Vol.l)
(Vol.2)
Manual
Controller
User’s
Manual
1

3.2
Types
Data
There
real
are
number
Address
Refer
to
device
type
the
for
data
five
type,
data
Control
details.
types;
and
may
Pack
the
the
address
be
used
CP-9200SH
bit
type,
only
type.
for
Table
the
These
pointer
User’s
3.2
integer
are
designation.
Manual
Data
3.
REGISTER
double-length
the
type,
according
used
(SIE-C879-40.1)
Types
MANAGEMENT
integer
the
to
purpose.
the
for
METHOD
type,
the
corresponding
Type
B
W
L
F
Type
Data
Bit
Integer
Double¬
length
integer
Real
number
Numerical
OFF
ON,
-32768
(8000H)
-2147483648
+32767
to
(7FFFH)
(80000000H)
±(1.175E
38),0
+
-38
Range
2147483647
to+
(7FFFFFFFH)
3.402E
to
for
for
usedinthe
are
that
instruction
a
in
begin
relay
numerical
Used
Used
(
)
operations.
Ordinarily
groups
entry
used
that
instruction
Used
(
)
for
usedinthe
are
numerical
operations.
Ordinarily
groups
entry
used
that
instruction
Used
May
with
instruction
that
that
instruction
a
in
begin
numerical
for
only
real
a
cannot
it
instruction
integer
type
Remarks
circuits.
operations.
logic
of
case
used
begin
seriesofinstruction
with
(||—
used
begin
seriesofinstruction
with
(||—
seriesofinstruction
a
in
integer
an
with
).
can
It
Q—
number
real
a
).
operations.
logic
of
case
in
series
a
integer
an
with
).
can
It
({—
real
number
a
).
operations.
used
).
(|}—
be
groups
entry
in
series
a
entry
type
Please
used
that
keep
in
begin
instruction
a
be
number
Values
also
groups
type
Values
instruction
of
also
groups
type
begins
that
mind
in
series
of
with
(}—
in
type
be
entry
in
type
be
entry
an
).
Address
A
Register
[M
W001
[MW00101]
[MW00102]
[MW00103]
32767
0
to
Designation
FEDCBA9876543210
00]
and
Data
r
Types
Used
[MB001006]
r
[MB00103A]
only
for
pointer
[ML00100]
“I
[MF00100]
[ML00102]
[MF00102]
designation.
3-3

4.
BASIC
INSTRUCTIONS
Off-delay
[Format]
Timer
[Description]
Instruction:
Set
value
4
Set
value
Count
With
immediately
when
The
timer
becomes
counting
value
A
the
With
Therefore,
structure
(1)
When
Off-delay
Count
:
value:
off-delay
the
precedingBregister
"Count
operation
ON
is
started
equal
off-delay
pay
statement.
used
MB000000
IFON
I
MB000100
i
IEND
unit
of
value’]-
constant,
subscript
integer
any
register
value
=
is
the
in
from
the
to
timer
attention
IF
in
Timer
measurement=0.01
with
timer
Set
stopped
middle
actual
structure
Instruction:
integer
any
(0
655.35sec
to
register
type
subscript
instruction,
value".
when
counting.
of
beginning
the
counted
instruction,
using
when
statement
{
5.00
is
MW00011
type
(except
OFF.
the
time
the
the
of
unit
seconds
register,
O.Olsec
:
in
(except
for
for
the
timeiscounted
The
status
status
of
When
(0.00s).
is
100
X
is
time
counted
off-delay
Timer
/
T}
measurement=0.01
#
(
or
unit)
#
and
-I
any
and
)
V
integer
C
registers),
registers)
C
while
of
the
register
B
immediately
the
register
the
B
storedinthe
when
instruction
count
the
instructionisexecuted.
in
(D
MB000101
O
seconds
type
any
the
(
register
integer
status
becomes
precedingBregister
again,
OFF
turns
register.
IF,
WHILE,
and
-l
with
type
of
OFF
FOR
>
the
the
I
)
(2)
(3)
the
In
executed,
When
b
WHILE
b
ON
MB000100
INC
WEND
In
the
scan
X
When
MB000000
FOR
MB000100
FEND
used
o
I
:
i
the
used
i
above
time
in
ooioo
<
1
above
timer0is
time
in
example,
is
not
WHILE
example,
set
value,
FOR
structure
1=00000
when
counted.
structune
{
5.00
since
also
so
to
[
5.00
MB000000
The
statement.
is
timer
Timer
MW00011
instruction
executed
timeiscounted
statement
00099
by
100
_
00001
Timer
MW00011
T]
OFF,
operation
©
MB000101
}
sequence
times.
Thus,
faster
0
MB000101
the
instructionoftimer0is
remains
stopped.
=>l
Instruction
O
0
than
O
is
executed
the
time
real
time.
sequence
100
counted
is
Instruction
sequence
times
for
not
(I)
(0ÿ1
100
0
In
time
example,
timer
set
the
above
the
scan
X
is
©
value,
since
also
so
instruction
executed
time
is
counted
100
sequence
times.
Thus,
faster
©
than
is
executed
the
timeiscounted
real
time.
100
times
(05=1
for
100
4-27

Instruction
OR
[Format]
V
integer
Any
Any
integer
Any
double-length
double-length
Any
Subscript
Constant
type
type
register
register
register
integer
integer
with
type
type
subscript
register
register
with
subscript
4.
OR
XOR
BASIC
INSTRUCTIONS
Instruction
Instruction
[Description]
[Operation
of
[Example(s)]
Instruction
XOR
[Format]
The
and
1-bit
A
0
0
1
1
Register]
the
A
x
The
h
©
instruction
OR
designated
the
Truth
B
0 0
1
0
1
Table
C
1
1
1
F
O
logical
MW00100
(H1234)
Any
Any
Any
Any
sum
integer
integer
double-length
double-length
Subscript
Constant
O
of
V
type
register
outputs
register
the
for
I
o
MW00100
HOOFF
(HOOFF)
register
register
type
integer
integer
the
to
Logical
J.
o
logical
register.
the
A
Sum
stored
:
O
indeterminate
:
*
(Stored
and
a
constant
=»
with
subscript
register
type
register
type
sum
(OR
X
or
not
MW00101
(OR)
of
AVB
:
not
:
stored
is
stored
(H12FF)
with
immediately
the
C)
=
stored
depending
in
subscript
the
on
MW00101.
precedingAregister
case.)
[Description]
[Operation
[Example(s)]
XOR
The
precedingAregister
1-bit
Truth
B.
A
0 0
0
1
0
1
1
1
Register]
the
of
F
A
x
O
exclusive
The
MW00100
b
(H5555)
instruction
Table
for
C.
0
1
1
0
B
I
O
O
logical
®
HOOFF
(HOOFF)
outputs
and
the
J
O
sum
the
the
designated
Exclusive
:
O
:
*
(Stored
of
MW00100
register
Sum
not
:
X
logical
exclusive
Logical
stored
indeterminate
stored
not
or
and
constant
a
MW00101
(H55AA)
sum
the
to
:
(XOR
stored
depending
is
(XOR)
register.
A
A©B
stored
on
=
the
in
immediately
the
of
C)
case.)
MW00101.
4-35

4.
BASIC
INSTRUCTIONS
Real
Number
[Format]
[Description]
[Operation
of
Type
Entry
|h
Any
Any
Any
Any
subscript
Any
Any
Subscript
Constant
The
real
number
entry
instruction
number
designated
real
to
a
Register]
the
A
O
Instruction
integer
integer
double-length
double-length
real
number
real
number
register
number
operation.
type
registers.
type
for
a
real
number
F
B
x
o
type
type
type
can
number
type
I
o o
||-
(
)
register
register
integer
integer
register
type
type
entry
instruction
The
series
be
programmed
When
type
data
upon
O
J
with
subscript
register
type
type
register
operations
of
using
integer
an
entry
execution.
:
stored
:
indeterminate
*
(Stored
or
Real
Number
|
register
with
subscript
enters
data
integer,
double-length
or
instruction,
X
not
not
:
stored
stored
Type
with
into
the
beginning
double-length
the
data
depending
Entry
Instruction
register
F
a
with
integer
automatically
is
the
on
and
real
number
integer,
type
case.)
(|h)
starts
and
register
converted
a
|
real
type
real
is
[Example(s)]
The
content
Ih
DF00200
integer
The
DW00100
Ih
The
double-length
DL00100
Ih
DWOOOOO
Ih
(00001)
DL00001
Ih
(1234567)
DF00004
Ih
(-23E+00)
NOTE
The
of
data
type
integer
following
DF00200
DW00100
in
type
data
form
of
entered
are
are
DL00100
in
usage
the
in
convertedtoreal
convertedtoreal
are
DF00010
(1.0E
DF00012
=>
(1.234567E
DF00014
==»
(-2.5E+00)
is
allowed.
not
register.
F
number
+
number
00)
+06)
type
data
type
and
data
then
and
stored
then
in
stored
in
the
the
register.
F
F
register.
12345
h
DF00200
4-37

4.
BASIC
INSTRUCTIONS
Extended
[Format]
[Description]
[Operation
Addition
Instruction
‘
++
The
extended
error
addition
Integer
Double-length
integer
Register]
the
of
A
X
(
)
++
Any
integer
Any
integer
Any
double-length
double-length
Any
Subscript
Constant
will
F
O
register
addition
not
occur
instructionisidenticaltothe
type
type
B
o
register
type
register
type
integer
integer
instruction
even
Decimai
[
L
Hexadecimal
Decimal
T
Hexadecimal
L
I
o
the
if
numbers
numbers
J.
o
subscript
with
register
type
register
type
performs
operation
numbers
numbers
stored
:
O
indeterminate
:
*
(Stored
or
with
addition
results
addition
0-*l—
:
:
0000
-ÿ
0
:
00000000
:
80000000—
—
not
:
X
stored
not
Extended
|
subscript
an
in
instruction
32767
0001",7FFF
-*•
1—2147483647
Addition
of
integer
overflow.
-32768—
—
00000001—
—
FFFFFFFF
in
stored
depending
Instruction
be
Cannot
*
number
with
entry
type
Otherwise,
function.
*ÿ
—
-*•
used
type
real
a
instruction
values.
-1
—
8000—
-2147483648—
7FFFFFFF
00000000
—
case.)
the
on
in
a
operation
number
(|P).
operation
An
extended
the
0
FFFF
(
real
type
—
-1
)]
++
begins
0000
-»
0
[Example
(s)]
used
This
in
the
instruction
addition
is
of
1-MW00100++
(32767)
NOTE
the
In
case
subtraction
However,
operation
instruction
operation
the
Remainder
ML00400XML00402+ML00404-rML00406
h
MOD
double-length
of
instructions
whenanaddition
(where
and
a
will
correction
a
in
integer
division
be
type
00001
(+,
multiplication
a
64-bit
a
operation
b
where
cases
values.
integer
--)
++,
-,
or
subtraction
instruction
operation.
(y)
c
is
it
desirable
MW00101
(-32768)
type
values,
32-bit
be
will
instruction
=
a
instructionisused
(-r)
the
is
aXb
+
d
d
that
operation
an
operation.
(X)
is
immediately
c
ML00408
ML00404
operation
a
in
immediately
the
subsequent
y
c
errors
using
remainder
do
addition
instruction),
occur
not
and
correction
preceding
4-41

|
BSRCH
Instructionÿ
4.9.8
BSRCH
Instruction
[Format]
[Description]
[Operation
BSRCH
The
in
head
Before
search
correct.
In
If
of
the
[Head
search
the
Any
integer
Any
integer
subscript
with
Any
double-length
register
type
Any
double-length
register
type
subscript
with
real
Any
register
Any
real
register
BSRCH
specified
the
register
the
range
addition,
matched
no
Register]
A
F
o
o
number
of'
range]
register
type
register
type
type
number
type
number
with
subscript
instruction
number
execution
be
the
data
B.
O
ihte
ger
integer
search
sorted
result
is
I
o
Any
W=
Any
with
Constant
uses
range.
matched
of
the
of
in
will
found,
J
o
[Range
ascending
number]
word
type
type
binary
The
register
register
search
integer
integer
subscript
a
data)
BSRCH
instruction,
order.
notbecorrect
"-1"
is
stored.
stored
O
indeterminate
:
*
(Stored
D=
search
results
are
If
there
if
X
not
or
’
Any
Any
with
Any
type
Any
type
Any
register
Any
register
Constant
method
stored
this
not
stored
[Search
data]
type
integer
type
integer
subscript
double-length
register
double-length
register
with
number
real
real
number
subscript
with
to
(offset
in
the
necessary
is
it
is
not
are
two
stored
depending
register
register
integer
integer
subscript
type
type
search
for
R=
the
numberofthe
specified
register.
that
the
done,
more
or
result
identical
the
on
[Search
integer
"Any
for
(except
registers)
Any
integer
with
subscript
C
#
and
registers)
specified
search
the
data
will
case.)
result)
type
and
#
type
in
not
data.
regist
C
regist
(except
data
range
the
be
f
[Example(s)]
matching
Data
resultisstored
the
BSRCH
MW00100
MW00101
MW00102
MW00199
01234
with
register
in
MW00100
98765
34567
01234
00000
searched
are
DW00000.
W=100
for
D=01234
DW00000
Offset
in
DW00000
registers
in
R=DW00000
number
DW00000.
MW00100
00002
MWOOIOO
of
—00102
t
MW00102
MW00199,
to
stored
is
00100
r
MWOOIOO
and
4-70