Mitsubishi MELSEC-Q/L Programming Manual page 521

Table of Contents

Advertisement

Program Example
(1) The following program seeks the inverse tangent of the 64-bit floating decimal point real number at D0 to D3, and outputs
the angle to the 4 BCD digits at Y40 to Y4F.
[Ladder Mode]
[List Mode]
Step
Instruction
[Operations involved when D0 to D3 value is 1]
D3 D2
D1
D0
TAN operation
1
1
64-bit floating-point
real number
3
D23 D22
D21
D20
45
64-bit floating-point
real number
7.12.13 RAD, RADP
Conversion from floating-point angle to radian
(Single precision)
7.12.13
RAD, RADP
RAD
RADP
: Angle to be converted to radian units or head number of the devices where the angle is stored (real number)
S
: Head number of the devices where the value converted in radian units will be stored (real number)
D
Setting
Internal Devices
Data
Bit
Word
––
S
––
D
*1:
Applicable for the Universal model QCPU, LCPU.
Calculates an angle (radian value) by TAN
operation (
Converts the radian value into
an angle (
Converts the angle in 64-bit floating-point
real number into an integer (
Outputs the integer-converted angle
to a display device (
Device
D13 D12
D11
D10
1
0.785398
ATAND
64-bit floating-point
real number
Conversion to angle
2
DEGD
Conversion
D30
BCD operation
b15
b0
4
to BIN
45
INTD
BIN value
BCD
Command
Command
J
R, ZR
Bit
––
––
).
1
).
2
).
3
).
4
Y4F
Y40
0 0 4 5
BCD value
Ver.
High
Basic
performance
• Basic model QCPU: The serial number (first five digits) is
"04122" or later.
RAD
RADP
\
U
\G
Word
RAD, RADP
1
Process
LCPU
Redundant Universal
S
D
S
D
Constants
Zn
Other
E
*1
*1
––
1
2
3
4
4
6
7
8
––
––
519

Advertisement

Table of Contents
loading

Table of Contents