BCOS

BCOS, BCOSP

 

BCOS instruction computes the cosine 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

BCOS

BCOSP

S

o

o

o

o

o

-

-

-

-

o

o

o

o

3

o

-

-

D

o

-

o

o

o

-

-

-

-

o

o

o

o

 

When enabled, the BCOS instruction computes the cosine 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 -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 320 to the D80.

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

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