Omron CPM1 - PROGRAMING MANUAL 02-2001 Programming Manual page 513

Hide thumbs Also See for CPM1 - PROGRAMING MANUAL 02-2001:
Table of Contents

Advertisement

Pulse Output Instructions
Limitations
Description
Flags
This instruction is available in the CPM2A/CPM2C only.
P must be 000 or 010, F must be BCD between 0001 and 9999, and D must be
BCD between 0001 and 0100.
PWM(––) is used to output pulses with the specified duty ratio from the specified
output bit. The pulse output continues until PWM(––) is executed again with a
different duty ratio, INI(61) is executed with C=003, or the PC is switched to
PROGRAM mode.
In general, PWM(––) should be executed just once to start the pulse output; use
the differentiated variation (@PWM(––)) or an input condition that is ON for just
one cycle.
Variable duty-ratio pulses can be output simultaneously and independently from
two output bits.
When variable duty-ratio pulses are being output from an output bit and
PWM(––) is executed for that bit again with a different duty ratio, pulses will con-
tinue being output with the new duty ratio. The frequency cannot be changed.
PWM(––) cannot be executed for an output bit if pulses are already being output
from that bit by SPED(64) or ACC(––). An error will occur and SR 25503 will be
turned ON if PWM(––) is executed under these circumstances.
Note Refer to 2-5 Pulse Output Functions for more details.
Port Specifier (P)
The port specifier indicates the output bit where the pulses will be output.
P
000 Variable duty-ratio pulse output 0 (output 01000)
010 Variable duty-ratio pulse output 1 (output 01001)
Frequency (F)
The 4-digit BCD value of F sets the pulse frequency in units of 0.1 Hz. The fre-
quency can be set between 0001 and 9999 (0.1 to 999.9 Hz).
Duty Ratio (D)
The 4-digit BCD value of D specifies the duty ratio of the pulse output, i.e., the
percentage of time that the output is ON. The duty ratio can be set between 0001
and 0100 (1% to 100%). The duty ratio is 75% in the following diagram.
t
on
+ D (1% to 100%)
T
ER:
A data area boundary is exceeded.
Indirectly addressed DM word is non-existent. (Content of *DM word is
not BCD, or the DM area boundary has been exceeded.)
P is not 000 or 010, F is not BCD between 0001 and 9999, or D is not
BCD between 0001 and 0100. (The frequency setting in F is read only
when starting the pulse output.)
ACC(––) is executed for a bit from which pulses are already being out-
put by ACC(––) or SPED(64).
PWM(––) is executed in an interrupt subroutine while a pulse I/O or
high-speed
SPED(64), PULS(65), ACC(––), PWM(––), or SYNC(––)) is being
executed in the main program.
Pulse output location(s)
t
on
T
counter
instruction
(INI(61),
Section
7-27
PRV(62),
CTBL(63),
495

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents