507
TAN, TANP
1
2
3
4
4
6
7
8
7.12
Special function
instructions
7.12.5
T
AN, T
A
NP
Operat
i
on
E
rror
(1) In any of the following cases, an operation error occurs, the error flag (SM0) turns ON, and an error code is stored into
SD0.
*2:
There are CPU modules that will not result in an operation error if -0 is specified.
For details, refer to Page 88, Section 3.2.4.
Program
E
xamp
l
e
(1) The following program performs a TAN operation on the angle data set by the 4 BCD digits from X20 to X2F, and stores
the results as 32-bit floating decimal point type real numbers at D0 and D1.
[Ladder Mode]
[List Mode]
[Operations involved when X20 to X2F designate a value of 135]
Error
code
Error details
Q00J/
Q00/
Q01
QnH
QnPH QnPRH
QnU
LCPU
4100
The specified device value is not within the following range:
0, 2
-126
| Specified device value | < 2
128
The specified device value is -0.
*2
––
––
4140
The specified device value is -0, unnormalized number, nonnumeric,
and ±
.
––
––
––
––
4141
The operation result exceeds the following range (when an overflow
occurs):
2
128
| Operation result |
––
––
––
––
I
nputs
an
ang
l
e
used
for
T
A
N
operat
i
on
(
)
.
Con
v
erts
the
i
nput
ang
l
e
i
nto
a
32
-
b
i
t
f
l
oat
i
ng
-
po
i
nt
rea
l
number
(
)
.
Con
v
erts
the
con
v
erted
ang
l
e
i
nto
a
rad
i
an
v
a
l
ue
(
)
.
E
xecutes
T
A
N
operat
i
on
us
i
ng
the
con
v
erted
rad
i
an
v
a
l
ue
(
)
.
1
2
3
4
Step
I
nstruct
i
on
De
vi
ce
Con
v
ersion to radian
32-bit floating-point
real number
D21
D20
RAD
TAN operation
32-bit floating-point
real number
D11
D10
TAN
32-bit floating-point
real number
D1
D0
X2F
BCD
v
alue
0
D30
1 3 5
X20
Con
v
ersion to BIN
BIN
b15
b0
BCD
v
alue
Con
v
ersion to floating-point
FLT
135
1 3 5
2 . 3 5 6 1 9 4
1 . 0 0 0 0 0 0