E L C P r o g r a m m i n g M a n u a l
F o r m o r e i n f o r m a t i o n v i s i t :
w w w. e a t o n . c o m
M N 0 5 0 0 3 0 0 3 E
3 - 3 2 8
API Mnemonic
Operands
Function
144
GPWM
S
1
, S
2
, D
General PWM Output
Bit Devices
Word devices
Program Steps
Type
OP
X Y M S K
H KnX
KnY
KnM KnS T
C
D
E
F
S
1
*
S
2
*
D
*
*
*
GPWM: 7 steps
ELC ELCB
ELCM
PB PC/PA/PH
PV
PB PH/PA
32
16
P
32
16
P
32
16
P
32
16
P
32 16
P
Operands:
S
1
: Pulse output width
S
2
: Pulse output cycle (occupies 3 addresses)
D
: Pulse output address
Description:
1.
S
1
is specified as the pulse output width as t: 0~32,767ms.
2.
S
2
is specified as the pulse output cycle as T:1~32,767ms,
S
1
≦
S
2
.
3.
S
2
+1 and
S
2
+2 are for internal system use. They should not be used in the program. If the
data in these addresses is modified in any way, unexpected operation of the GPWM
instruction could occur. The address for the pulse output (
D)
must be: Y, M or S.
4.
When the GPWM instruction is executed, pulses will be sent to the Pulse output address (
D)
based on the pulse output width
S
1
and pulse output cycle
S
2
.
5. When
S
1
≦
0, no pulses will be generated. When
S
1
≧
S
2
, the pulse output address will be
always ON.
6.
S
1
and
S
2
can be modified when executing GPWM instruction.
Program Example:
When D0=K1000, D2=K2000 and X0= ON, the following pulses will be sent out Y20. When X0=
OFF, the Y20 output will also be OFF.
X0
GPWM
D0
D2
Y20
t
T
t=1000ms
T=2000ms
Output Y20
Points to note:
1.
This instruction counts by scan cycle so the maximum offset will be an ELC program scan
cycle. The value of
S
1
,
S
2
and (
S
2
-
S
1
) should be larger than one ELC program scan cycle.
Otherwise, an error will be generated.
2.
If using this instruction in a subroutine or interrupt, the GPWM output may not be accurate.
Summary of Contents for ELC-PB
Page 1: ......
Page 5: ...For more information visit www eaton com MN05003003E iv...
Page 29: ...ELC Programming Manual For more information visit www eaton com MN05003003E 1 24 MEMO...
Page 502: ...3 Instruction Set MN05003003E For more information visit www eaton com 3 333...
Page 601: ...ELC Programming Manual For more information visit www eaton com MN05003003E 3 432...
Page 625: ...ELC Programming Manual For more information visit www eaton com MN05003003E 3 456...