3 . I n s t r u c t i o n S e t
M N 0 5 0 0 3 0 0 3 E F o r m o r e i n f o r m a t i o n v i s i t :
w w w. e a t o n . c o m
3 - 3 1 7
API Mnemonic
Operands
Function
131
D COS P
S, D
Floating Point Cosine Operation
Bit Devices
Word devices
Program Steps
Type
OP
X Y M S K H KnX KnY KnM KnS T
C
D
E
F
S
*
*
*
D
*
DCOS, DCOSP: 9 steps
ELC ELCB
ELCM
PB PC/PA/PH
PV
PB PH/PA
32
16
P
32
16
P
32
16
P
32 16
P
32
16
P
Operands:
S
: Specified RAD value (0
°≦
S
<
360
°
)
D
: Result of the COS operation
Description:
1.
Source designated by
S
can be radians or an angle based on flag M1018.
2.
When M1018= OFF, is set to radian mode. RAD=angle
×π
/180.
3.
When M1018= ON, is set to angle mode. Angle range: 0
°≦
angle
<
360
°
.
4.
The COS value of an angle specified by
S
is calculated and the result is stored in the register
specified by
D
.
S: Radian
R: Result
Following shows the relation between radian and result:
S
-2
3
2
-2
2
3
2
2
2
-
1
-1
0
-
R
5.
If result of D is 0, the Zero flag M1020=ON.
Program Example 1:
When M1018= OFF, it is in radian mode.
When X0= ON, calculate the COS value of the angle
specified in (D1, D0) and store the result in (D11, D10). The value in (D1, D0) and the result stored
in (D11, D10) are all in binary floating point format.
M1002
RST
M1018
X0
DCOS
D0
D10
D1
D0
D11
D10
COS value
binary floating point
binary floating point
RAD value(degree x /180)
π
Summary of Contents for ELC-PB
Page 1: ......
Page 5: ...For more information visit www eaton com MN05003003E iv...
Page 29: ...ELC Programming Manual For more information visit www eaton com MN05003003E 1 24 MEMO...
Page 502: ...3 Instruction Set MN05003003E For more information visit www eaton com 3 333...
Page 601: ...ELC Programming Manual For more information visit www eaton com MN05003003E 3 432...
Page 625: ...ELC Programming Manual For more information visit www eaton com MN05003003E 3 456...