5 Applied Instructions and Basic Usage
DVP-20PM Application Manual
5-108
API
Applicable model
20PM
128
D
D
POW
P
P
Power of a floating-point value
Bit device Word device
X Y M S F H KnX KnY KnM KnS T C D V Z
S
1
*
*
S
2
*
*
D
*
Note: Please refer to specifications for more information about device
ranges.
Only the 32-bit instructions DPOW and DPOWP are valid.
F represents a floating-point value. There is a decimal point in a
floating-point value.
16-bit instruction
- - - -
32-bit instruction (9 steps)
DPOW
Continuity
instruction
DPOWP
Pulse
instruction
Flags
Ox O100
M1808 M1968 Zero flag
M1809 M1969 Borrow flag
M1810 M1970 Carry flag
M1793 M1953 Operation error flag
Please refer to the additional remark below.
Explanation
S
1
: Device in which a base is stored; S
2
: Device in which a power is stored; D:
Device in which the operation result is stored
The binary floating-point value in S
1
is raised to the power of the value in S
2
,
and the operation result is stored in D.
D=POW[S
1
+1, S
1
]
[S2+1, S2]
The value in S
1
can only be a positive value, whereas the value in S
2
can be a
positive value or a negative value. D must be a 32-bit register, and the values
in S
1
and S
2
must be floating-point values.
If the values in S
1
and S
2
are invalid, an operation error will occur, the
instruciton will not be executed, an operation error flag will be ON, and the
error code H0E19 will appear.
If the absolute value of an operation result is greater than the maximum
floating-point value available, a carry flag will be ON.
If the absolute value of an operation reuslt is less than the minimum
floating-point value available, a borrow flag will be ON.
If an operation result is 0, a zero flag will be ON.
Example
When M0 is ON, the values in (D1, D0) and (D3, D2) are converted into binary
floating-point values, and the conversion results are stored in (D11, D10) and
(D13, D12) respectively.
When M1 is ON, the binary floating-point value in (D11, D10) is raised to the
power of the binary floating-point value in (D13, D12), and the operation result
is stored in (D21, D20).
When M2 is ON, the binary floating-point value in (D21, D20) is converted into
a decimal floating-point value, and the conversion result is stored in (D31,
D30). (The value in D31 is the value in D30 to the power of 10.)
M0
M1
D10 D12
M2
DEBCD D20 D30
D2 D12
D20
Additional
remark
Please refer to section 5.3 for more information about performing operations
on floating-point values.