Delta Electronics VFD-E manual Quotient Remainder, Inc

Models: VFD-E

1 363
Download 363 pages 22.75 Kb
Page 338
Image 338

Appendix D How to Use PLC Function

API

Mnemonic

 

Operands

 

 

 

 

Function

23

DIV

P

 

S1, S2, D

 

 

 

 

Division

Type

Bit Devices

 

 

Word devices

 

 

Program Steps

OP

X

Y

M

K

H

KnX

KnY

KnM

T

C

D DIV, DIVP: 7 steps

 

S1

 

 

 

*

*

*

*

*

*

*

*

S2

 

 

 

*

*

*

*

*

*

*

*

D

 

 

 

 

 

 

*

*

*

*

*

Operands:

 

 

 

 

 

 

 

 

 

 

S1: Dividend

S2: Divisor

D: Quotient and remainder

 

 

 

Explanations:

1.In 16-bit instruction, D occupies 2 consecutive devices.

2.This instruction divides S1 and S2 in BIN format and stores the result in D. Be careful with the positive/negative signs of S1, S2 and D when doing 16-bit and 32-bit operations.

16-bit instruction:

Quotient Remainder

+1

/ =

Program Example:

When X0 = On, D0 will be divided by D10 and the quotient will be stored in D20 and remainder in D21. On/Off of the highest bit indicates the positive/negative status of the result value.

X0

DIV D0 D10 D20

DIV D0 D10 K4Y0

API

24

 

Mnemonic

 

Operands

Function

 

 

 

 

 

 

 

INC

 

P

D

Increment

 

 

 

 

 

 

Type

Bit Devices

 

 

Word devices

 

 

Program Steps

OP

X

Y

M

K

H

KnX

KnY

KnM

T

C

D INC, INCP: 3 steps

 

D

 

 

 

 

 

 

*

*

*

*

*

Revision June 2008, 04EE, SW--PW V1.11/CTL V2.11

D-55

Page 338
Image 338
Delta Electronics VFD-E manual Quotient Remainder, Inc