AH500 Programming Manual API 1516 Symbol: S 1 : Device in which the base is stored Double word S 2 : Device in which the power is stored Double word D : Device in which the operation result is stored Double word Explanation: 1. The single-precision floating-point number in S 1 is raised to the power of the value in S 2 , and the operation result is stored in D . 2. D =POW[ S 1 +1, S 1 ] [ S2 +1, S2 ] 3. The value in S 1 only can be a positive value, whereas the value in S 2 can be a positive value or a negative value. The register specified by D should be a 32-bit register, and the values in S 1 and S 2 should be floating-point numbers. 4. S 1 S2 = D 5.
Suppose the values in S 1 and S 2 are 5 and 3 respectively. D=5 3 =125. 6. If the absolute value of the operation result is large than the value which can be represented by the maximum floating-point number, SM602 is ON. 7. If the absolute value of the operation result is less than the value which can be represented by the minimum floating-point number, SM601 is ON. 8. If the absolute value of the conversion result is large than the value which can be represented by the maximum floating-point number, the value in D is 16#7F7FFFFF. 9.
If the absolute value of the conversion result is less than the value which can be represented by the minimum floating-point number, the value in D is 16#7F7FFFFF. 10. If the operation result stored in D is 0, SM600 is ON. Example: 1. When X0.0 is ON, the values in (D1, D0) and (D3, D2) are converted into the floating-point numbers, and the conversion results are stored in (D11, D10) and (D13, D12) respectively. 2. When X0.1 is ON, the floating-point number in (D11, D10) is raised to the power of the floating-point number in (D13, D12), and the operation result is stored in (D21, D20). 3.
When X0.2 is ON, the binary floating-point number in (D21, D20) is converted into the binary-coded decimal floating-point number, and the conversion result is stored in (D31, D30). 6-346 Instruction code Operand Function FPOW P S , S , D 1 2 A power of the floating-point number Device X Y M S T C HC D L SM SR E PR K 16# “$” DF S 1 S 2 D Pulse instruction 16-bit instruction (7-9 steps) 32-bit instruction AH500 AH500 -