BTAN

BTAN, BTANP

 

BTAN instruction computes the tangent 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

BTAN

BTANP

S

o

o

o

o

o

-

-

-

-

o

o

o

o

3

o

-

-

D

o

-

o

o

o

-

-

-

-

o

o

o

o

 

When enabled, the BTAN instruction computes the tangent of the 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 -52.2900 to 27.2900.

  • 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 320 to the D80.

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

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