Omron CJ - REFERENCE MANUAL 02-2010 Reference Manual page 799

Table of Contents

Advertisement

Operand Specifications
Word addresses
Area
CIO
WR
HR
P
---
---
---
F, D
OK
OK
OK
Flags
Name
Label
Error Flag
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
stopping 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
differentiated 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
output) or until the CPU Unit is switched to PROGRAM mode.
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
CS/CJ/NSJ Series Instructions Reference Manual (W474)
AR
T
C
DM
EM
---
---
---
---
---
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
#0000
PWM output 0
&2000
Frequency: 200.0 Hz
&50
Duty factor: 50%
@PWM
#0000
PWM output 0
#07D0
Frequency: 200.0 Hz
#0019
Duty factor: 25%
Indirect DM/EM
addresses
Con-
stants
@DM
*DM
DR
@EM
*EM
---
---
---
OK
OK
OK
OK
Operation
Duty factor: 50%
CIO 0.00 ON
3. Instructions
Registers
Flags
Pulse
bits
Indirect
IR
TK
CF
using IR
---
---
---
---
OK
Duty factor: 25%
CIO 0.01 ON
TR
bits
---
---
3
763

Advertisement

Table of Contents
loading

Table of Contents