5 Categories and Use of Basic Application Instructions API 117 Operands: S : Source device (radian) D : Conversion result (degree) Explanations: 1. Use the following formula to convert radian to degree: Degree = Radian Ч (180/ π ) 2. F refers to floating point input. Be sure to add a decimal point when using it. 3. Only 32-bit instructions DDEG and DDEGP are applicable. 5. Flags: d) If the absolute value of the result exceeds the max. floating point value, carry flag will be ON. e) If the absolute value of the result is less than min. floating point value, borrow flag will be ON. a) If the conversion result is 0, zero flag will be ON Program Example:
When X0 = ON, convert the radian of the binary floating point in (D1, D0) to degree and save the binary floating point result in (D11, D10). X0 Radian value binary floating point binary floating point Degree value (radian x 180/ ) π Points to note: For floating point operations, see “5.3 Numeric Values for Data Processing”. DVP-PM Operation Instruction 5-98 Mnemonic Operands Function Controllers 20PM 10PM D DEG P Radian Æ Degree Type OP Bit Devices Word Devices Program Steps X Y M S F H KnX KnY KnM KnS T C D V Z D S * * D * OX O100 Zero flag M1808 M1968 Borrow flag M1809 M1969 Carry flag M1810 M1970 DDEG D0 D10 D 1 D 0 D 11 D 10