7-284
7.12 Special Function Instructions
7.12.25 SIN operation on data in BCD format
BSIN
O
peration Error
In any of the following cases, an operation error occurs, the error flag (SM0) is turned ON, and
the corresponding error code is stored to SD0.
• The value specified for
is not a BCD value.
(Error code: 4100)
• The value specified for
is not in the range of 0 to 360 degrees.
(Error code: 4100)
• The device specified for
exceeds the corresponding device range. (For Universal
model QCPU only)
(Error code: 4101)
Program Example
In the following program, the sine function is evaluated on the data specified as BCD 3 digits in
X20 to X2B, and the integer part of the result is output in BCD 1 digit to the devices form Y50 to
Y53, and the decimal fraction is output in BCD 4 digits to the devices form Y40 to Y4F.
Y60 is turned ON if the operation result is negative. (If a value has been set for X20 to X2F that is
greater than 360, it will be adjusted to be in the range from 0 to 360 degrees.)
[Structured ladder]
s
s
d
Ad
justs
the
i
nput
ang
l
e
d
ata
to
b
e
i
n
the
range
of
0
to
360
d
egrees
. ( )
E
va
l
uates
the
s
i
ne
funct
i
on
. ( )
O
utputs
the
i
nteger
part
of
the
operat
i
on
resu
l
t
to
the
di
sp
l
a
y. ( )
O
utputs
the
d
ec
i
ma
l
fract
i
on
of
the
operat
i
on
resu
l
t
to
the
di
sp
l
a
y. ( )
O
utputs
the
s
i
gn
of
the
operat
i
on
resu
l
t
by
turn
i
ng
the
co
il
ON
or
OFF. ( )
1
2
3
4
5
Summary of Contents for MELSEC Q Series
Page 1: ...Structured Programming Manual Mitsubishi Programmable Controller QCPU Common Instructions ...
Page 2: ......
Page 14: ...A 12 MEMO ...
Page 340: ...6 178 MEMO MTR ...
Page 708: ...7 368 MEMO ...
Page 776: ...8 68 MEMO ...
Page 796: ...9 20 MEMO ...
Page 804: ...App 8 MEMO ...
Page 812: ...Index 8 MEMO ...
Page 815: ......