BATAN
BATAN, BATANP
BATAN instruction computes the arc 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 | ||
BATAN BATANP | S | o | o | o | o | o | - | - | - | - | o | o | o | o | 3 | o | - | - |
D | o | - | o | o | o | - | - | - | - | o | o | o | o |
When enabled, the BATAN instruction computes the arc tangent of the BCD value and saves the result in Destination.
S sets to 0 when its value is positive number(+). D sets to 1 when its value is negative number(-).
S+1 (Integer part) and S+2 (Decimal point) are the BCD value and their range is from 0 to 9999.9999.
D is the BCD value and its range is 0 - 90° and 270 - 360°
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 1 to D100, H4321 to D101 and H1234 to D102.
The BATAN calculates the arc tangent of -4321.1234 (D100, D101 and D102) and saves the result in the D200 (in BCD).