Mitsubishi MELSEC-Q/L Programming Manual page 503

Table of Contents

Advertisement

Program Example
(1) The following program conducts a SIN operation on the angles stored in the four BCD digits from X20 to X2F and stores
the results at D0 and D1 as 32-bit floating decimal point type real numbers.
[Ladder Mode]
[List Mode]
Step
Instruction
[Operations involved when X20 to X2F designate a value of 150]
Conversion to BIN
X2F
X20
0
1 5 0
BCD value
BIN
D21
D20
Conversion to radian
1 5 0
32-bit floating-point
real number
7.12.2
SIND, SINDP
SIN operation on floating-point data (Double precision)
7.12.2
SIND, SINDP
SIND
SINDP
: Angle data of which the SIN (sine) value is obtained or head number of the devices where the angle data is stored (real number)
S
: Head number of the devices where the operation result will be stored (real number)
D
Setting
Internal Devices
Data
Bit
––
S
––
D
Function
(1) The SIN (sine) value of the angle specified by
Inputs an angle used for SIN
operation (
Converts the input angle into
a 32-bit floating-point real
number (
Converts the converted angle
into a radian value (
Executes SIN operation
using the converted radian value (
Device
D30
b15
b0
150
BIN value
Conversion to floating-point
FLT
D11
D10
2 . 6 1 7 9 9 4
RAD
32-bit floating-point
real number
Command
Command
R, ZR
Word
Bit
is calculated and its result is stored into the device specified by
S
S
+3
S
+2
S
+1
S
SIN (
64-bit floating-point
real number
).
1
).
2
).
3
).
4
D1
SIN operation
0 . 5 0 0 0 0 0
SIN
32-bit floating-point
real number
High
Basic
performance
SIND
SINDP
J
\
U
\G
Word
––
––
D
+3
D
+2
D
+1
)
64-bit floating-point
real number
SIND, SINDP
D0
Process
Redundant
Universal
LCPU
S
D
S
D
Constants
Zn
Other
E
––
D
1
2
3
4
4
6
7
8
––
––
.
D
501

Advertisement

Table of Contents
loading

Table of Contents