PWR

PWR. PWRP, EPWR. EPWRP

 

PWR instruction multiplies a base number(S1) by an exponent(S2) and save the result in the Destination (assigned device address).

(It supports only in XP and PLCS CPU series.)

 

S1

Base number

S2

Exponent

D

Destination

 

Instruction

Device address

No. of Steps

Flag

M

X

Y

K

L

F

T

C

S

Z

D

@D

Int.

 

Error

Zero

Carry

PWR(P)

S1

o

o

o

o

o

o

o

o

-

o

o

o

o

4

o

-

-

S2

o

o

o

o

o

o

o

o

-

o

o

o

o

D

o

-

o

o

o

-

o

o

-

o

o

o

-

 

PWR/PWRP

Function

  • S1 is being multiplied by itself S2 times and save the result in the Destination.

 

Example)

If X00 is ON, D0(12) is being multiplied by itself D10(4)times (12 to the power of fourth) and save the result(20736) in D30

 

 

EPWR/EPWRP

Function

  • S1(Float value) is being multiplied by itself S2 times and save the result in the Destination.

 

Example)

If X00 is ON, D0(3.1) is being multiplied by itself D10(3)times (3.1 cubed) and save the result(29.791) in D30