COS(P)
Operation Error
(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.
• The value of the specified device is
(For the Basic model QCPU, High Performance model QCPU, Process CPU, Redundant
CPU)
*2: There are CPU modules that will not result in an operation error if
• The result exceeds the following range (Operation results in an overflow)
(For the Universal model QCPU, LCPU)
128
2
• The value of the specified device is
(For the Universal model QCPU, LCPU)
Program Example
(1) The following program performs a COS operation on the angle data designated by the 4
BCD digits from X20 to X2F, and stores results as 32-bit floating decimal point type real
numbers at D0 and D1.
[Ladder Mode]
[List Mode]
Step
[Operations involved when X20 to X2F designate a value of 60]
X2F
0
0 6 0
BCD value
D21
32-bit floating-point
real number
7-254
| Operation result |
Instruction
Device
D30
Conversion to BIN
X20
b15
b0
60
BIN
BIN value
Conversion to floating-point
D20
Conversion to radian
6 0
RAD
32-bit floating-point
real number
*2
0.
0 is specified. For details, refer to 3.2.4.
0, unnormalized number, nonnumeric, and ±
Inputs an angle used for COS
operation (
).
1
Converts the input angle into
a 32-bit floating-point real
number (
).
2
Converts the converted angle into
a radian value (
).
3
Executes COS operation
using the converted radian value (
FLT
D11
D10
COS operation
1 . 0 4 7 1 9 8
COS
(Error code: 4100)
(Error code: 4141)
.
(Error code: 4140)
).
4
D1
D0
0 . 5 0 0 0 0 0
32-bit floating-point
real number