5 Categories and Use of Basic Application Instructions API 128 Operands: S 1 : Base S 2 : Exponent D : Operation result Explanations: 1. Perform power operation on binary floating value S 1 and S 2 and save the result in D . 2. Example of power operation: POW [ S 1 +1, S 1 ]^[ S 2 +1, S 2 ] = D When S 1 S2 = D, D = ? Assume S 1 = 5, S 2 = 3, D = 5 3 =125 3. F refers to floating point input. Be sure to add a decimal point when using it. 4. Only 32-bit instructions DPOW and DPOWP are applicable. 5. Only a positive number is valid for S 1 and both positive and negative values are valid for S 2. Register D has to be 32-bit format.
Operation is conducted in floating point value, so the value in S 1 and S 2 needs to be converted into floating value before power operation 6. If the value in S 1 or S 2 is invalid, operation error flag will be ON and error code “0E19” will be recorded. 7. Flags: b) If the absolute value of the result is less than min. floating point value, borrow flag will be ON. a) If the absolute value of the result exceeds the max floating point value, carry flag will be ON. c) If the conversion result is 0, zero flag will be ON. Program Example: 1. When M0 = ON, convert (D1, D0) and (D3, D2) to binary floating value and save the result in register (D11, D10) 2.
When M1 = ON, perform power operation with (D11, D10) as base and (D13, D12) as exponent. The value is and (D13, D12) individually. saved in register (D21, D20) in binary floating format. 3. When M2 = ON, convert the value in (D21, D20) into decimal floating point value and save the result in (D31, D30). (At this time, D31 indicates powers of 10 for D30). DVP-PM Application Manual 5-107 Mnemonic Operands Function Controllers 20PM 10PM D POW P Floating Point Power Operation Type OP Bit Devices Word Devices Program Steps X Y M S F H Kn X KnY KnM KnS T C D V Z D S 1 * * S 2 * * D * OX O100 Zero flag M1808 M1968 Borrow flag M1809 M1969 Carry flag M1810 M1970 Operation error M1793 M1953