Chapter 6 Applied Instructions Example When X0.0 is ON, the FATAN instruction finds the arctangent of the floating-point number in (D1, D0) and stores it in (D11, D10). The FDEG instruction converts the arctangent value in (D11, D10) is converted into degrees, and stores the conversion result in (D21, D20). The DINT instruction converts the degree in (D21, D20) into the integer, and stores the conversion result in (D31, D30). The BCD instruction converts the integer in (D31, D30) into the binary-coded decimal value, and stores the conversion result in Y0.15–Y0.0.
R45 D21~D20 R1 D0 R0.785398 D11~D10 FATAN FDEG 6_ Floating-point number Floating-point number Floating-point number BCD DINT D31~D30 0 0 5 4 Y1.15~Y1.0 45 Binary value Binary-coded decimal value Additional remarks If the value in S exceeds the range of values that can be represented by floating-point numbers, the instruction is not executed, SM0 is ON, and the error code in SR0 is 16#2013. 6-469