Mitsubishi MELSEC-Q/L Programming Manual page 545

Table of Contents

Advertisement

Function
(1) Calculates the SIN (sine) value of value (angle) designated by
designated at
, and the operation result in the devices designated at
D
(2) The value designated at
(3) The sign for the operation result stored in
value.
(4) The operation results stored in
(5) Operation results are rounded off from the fifth decimal place.
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.
Error
code
The data specified in
4100
The data specified in
The points of the device specified in
4101
corresponding device.
Program Example
(1) The program example below calculates the SIN of 3-digit BCD data designated by X20 to X2B, and outputs a 1-digit
BCD part to the integer part from Y50 to Y53, and a 4-digit BCD fraction part from Y40 to Y4F.
Y60 is turned ON if the results of the operation are negative. (If a value has been set at X20 to X2F that is greater than
360, it will be adjusted to be in the range from 0 to 360.)
[Ladder Mode]
[List Mode]
Step
Instruction
D
SIN
S
Sign
is a BCD value which can be between 0 and 360 degrees (in units of degrees).
S
will be "0" if the result is a positive value, and "1" if the result is a negative
D
+1 and
+2 are BCD values between -1.000 and 1.000.
D
D
Error details
is not a BCD value.
S
is not within the range from 0 to 360.
S
exceed those of the
D
Processes so that the input
angle is within 360° (
Executes SIN operation (
Outputs the integer part of the operation
result to a display device (
Outputs the decimal fraction part of the
operation result to a display device (
Outputs the sign of the operation result
by ON or OFF (
Device
, and stores the sign of the operation result in the device
S
+1 and
D
D
+ 1
D
+ 2
Integer part
Decimal fraction part
.
Q00J/
Q00/
QnH
Q01
––
––
––
)
1
)
2
)
3
4
)
5
BSIN, BSINP
+2.
D
QnPH QnPRH
QnU
––
––
)
1
2
3
4
4
6
LCPU
7
8
543

Advertisement

Table of Contents
loading

Table of Contents