Omron SYSMAC CP Series Instruction & Reference Manual page 376

Cpu unit
Hide thumbs Also See for SYSMAC CP Series:
Table of Contents

Advertisement

2 Instructions
Operand Specifications
Word addresses
Area
CIO
WR
HR
P
---
---
---
F, D
OK
OK
OK
Flags
Name
Label
Error Flag
P_ER
Function
PWM(891) outputs the frequency specified in F at the duty factor specified in D from the port specified
in P. PWM(891) can be executed during duty-factor PWM output to change the duty factor without stop-
ping PWM output. Any attempts to change the frequency will be ignored.
PWM output is started each time PWM(891) is executed. It is thus normally sufficient to use the differ-
entiated version (@PWM(891)) of the instruction or an execution condition that is turned ON only for
one scan.
The PWM output will continue either until INI(880) is executed to stop it (C = 0003 hex: stop PWM out-
put) or until the CPU Unit is switched to PROGRAM mode.
Note PWM instruction can be used only with transistor output type of CP1E N/NA-type CPU Unit.
In case of transistor output type of CP1E E-type CPU Unit or relay output type, NOP processing is applied.
Sample program
When CIO 0.00 turns ON in the following programming example, PWM(891) starts PWM output from
PWM output 0 at 200 Hz with a duty factor of 50%. When CIO 0.01 turns ON, the duty factor is changed
to 25%.
0.00
0.01
2-340
Indirect DM addresses
AR
T
C
DM
---
---
---
---
OK
OK
OK
OK
• ON if the specified range for P, F, or D is exceeded.
• ON if PWM are being output using ORG(889) for the specified port.
• ON if PWM(891) is executed in an interrupt task when an instruction controlling PWM output is being executed in a
cyclic task.
• OFF in all other cases.
@PWM
#1000
PWM output 0
#07D0
Frequency: 200.0 Hz
&500
Duty factor: 50%
@PWM
#1000
PWM output 0
#07D0
Frequency: 200.0 Hz
&250
Duty factor: 25%
Constants
@DM
*DM
---
---
OK
OK
OK
Operation
Duty factor: 50%
CIO 0.00 ON
CIO 0.01 ON
CP1E CPU Unit Instructions Reference Manual(W483)
CF
Pulse bits
TR bits
---
---
---
Duty factor: 25%

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents