BSIN

 

BSIN, BSINP

 

BSIN instruction computes the sine of source (BCD) and saves the result in the Destination.

(It supports only in XP and PLC-S CPU series)

 

S

BCD Source

D

Destination in BCD

 

Instruction

Device address

No. of Steps

Flag

M

X

Y

K

L

F

T

C

S

Z

D

@D

Int.

 

Error

Zero

Carry

BSIN

BSINP

S

o

o

o

o

o

-

-

-

-

o

o

o

o

3

o

-

-

D

o

-

o

o

o

-

-

-

-

o

o

o

o

 

When enabled, the BSIN instruction computes the sine of BCD value and saves the result in Destination.

 

 

  • The range of Source : 0~360(degree unit)

  • D sets to 0 when its value is positive number(+). D sets to 1 when its value is negative number(-).

  • D+1 and D+2 are BCD value and their range is from -1.0000 to 1.0000.

  • The fraction (decimal point) is rounded off the numbers to five decimal places. Therefore, the 4 decimal place has tolerance of 1.

 

Example)

If M00 is ON, the MOV instruction copies degree value 123 to the D80.

The BCD instruction converts 123 to BCD value and saves its value to D90.

The BSIN instruction computes the sine of BCD value (D90) and saves its result to D100 (sign), D101 (integer part) and D102 (decimal point).