543
BSIN, BSINP
1
2
3
4
4
6
7
8
7.12
Special function
instructions
7.12.2
9
BSIN, BSINP
F
unct
i
on
(1) Calculates the SIN (sine) value of value (angle) designated by , and stores the sign of the operation result in the device
designated at , and the operation result in the devices designated at +1 and +2.
(2) The value designated at is a BCD value which can be between 0 and 360 degrees (in units of degrees).
(3) The sign for the operation result stored in will be "0" if the result is a positive value, and "1" if the result is a negative
value.
(4) The operation results stored in +1 and +2 are BCD values between -1.000 and 1.000.
(5) Operation results are rounded off from the fifth decimal place.
Operat
i
on
E
rror
(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.
Program
E
xamp
l
e
(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]
Error
code
Error details
Q00J/
Q00/
Q01
QnH
QnPH QnPRH
QnU
LCPU
4100
The data specified in is not a BCD value.
The data specified in is not within the range from 0 to 360.
––
4101
The points of the device specified in exceed those of the
corresponding device.
––
––
––
––
S
D
D
D
+ 2
D
S
Integer part
Decimal fraction part
.
D
Sign
SIN
+ 1
D
S
D
D
D
S
S
D
Processes so that the input
angle is
w
ithin 360° ( )
Executes SIN operation ( )
Outputs the integer part of the operation
result to a display de
v
ice ( )
Outputs the decimal fraction part of the
operation result to a display de
v
ice ( )
Outputs the sign of the operation result
by ON or OFF ( )
1
2
3
4
5
Step
I
nstruct
i
on
De
vi
ce