3. Instruction

Set

API

Mnemonic

 

Operands

Function

 

 

 

Controllers

 

144

GPWM

 

 

 

 

General PWM output

 

ES2/EX2 SS2 SA2 SX2

 

 

 

 

 

SE

 

Type

Bit Devices

 

Word devices

 

 

 

Program Steps

 

OP

 

X

Y

M

S

K H KnX KnY KnM KnS T C

D

E

F

GPWM: 7 steps

 

S1

 

 

 

 

 

 

 

*

 

 

 

 

S2

 

 

*

*

*

 

 

*

 

 

 

 

D

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

PULSE

 

16-bit

 

32-bit

 

 

ES2/EX2

SS2

SA2

SX2

ES2/EX2

SS2

SA2

SX2

ES2/EX2

SS2

SA2

SX2

 

 

 

SE

 

 

 

SE

 

 

 

SE

 

Operands:

 

 

 

 

 

 

 

 

 

 

S1: Width of output pulse S2: Pulse output cycle (occupies 3 devices)

D: Pulse output device

Explanations:

1.When GPWM instruction executes, pulse output will be executes on device specified by D according to pulse output width S1 and pulse output cycle S2.

2.S1: pulse output width. Range: t = 0~32,767ms.

3.S2: pulse output cycle. Range: T = 1~32,767ms, S1 S2.

4.S2 +1 and S2 +2 are system-defined parameters, please don’t use them.

5.D: pulse output device: Y, M and S.

6.When S1 0, no pulse output will be performed. When S1 S2, the pulse output device remains ON.

7.S1 and S2 can be modified when GPWM instruction is being executed

Program Example:

Assume D0 = K1000, D2 = K2000. When X0 = ON, Y20 will output pulses as the following diagram. When X0 = OFF, Y20 output will be OFF.

 

X0

t

T

 

 

GPWM D0

D2

Y20

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

t=1000ms

Output Y20

T=2000ms

Points to note:

1.The instruction operates by the scan cycle; therefore the maximum error will be one PLC scan cycle. S1, S2 and (S2 - S1) should be bigger than PLC scan cycle, otherwise malfunction will occur during GPWM outputs.

2.Please note that placing this instruction in a subroutine will cause inaccurate GPWM outputs

3 - 3 2 7

Page 443
Image 443
Delta DVP-ES2/EX2/SS2/SA2/SX2/SE manual General PWM output