Download MicroSmart Manual

Transcript
20: PULSE INSTRUCTIONS
PWM1 (Pulse Width Modulation 1)
PWM
1
S1
D1
***** *****
When input is on, the PWM1 instruction generates a pulse output. The output
pulse frequency is selected from 6.81, 27.26, or 217.86 Hz, and the output
pulse width ratio is determined by source operand S1.
PWM1 sends out output pulses from output Q0.
PWM1 can be programmed to generate a predetermined number of output
pulses. When pulse counting disabled, PWM1 generates output pulses while the
start input for the PWM1 instruction remains on.
PWM2 (Pulse Width Modulation 2)
PWM
2
S1
D1
***** *****
When input is on, the PWM2 instruction generates a pulse output. The output
pulse frequency is selected from 6.81, 27.26, or 217.86 Hz, and the output
pulse width ratio is determined by source operand S1.
PWM2 sends out output pulses from output Q1.
PWM2 generates output pulses while the start input for the PWM2 instruction
remains on. PWM2 cannot be programmed to generate a predetermined number
of output pulses.
Note: The PWM1 and PWM2 instructions can be used only once in a user program. When PWM1 or PWM2 is not used,
unused output Q0 or Q1 can be used for another pulse instruction or ordinary output.
Applicable CPU Modules
FC4A-C10R2/C
FC4A-C16R2/C
FC4A-C24R2/C
FC4A-D20K3/S3
FC4A-D20RK1/RS1 & FC4A-D40K3/S3
—
—
—
X
X
Valid Operands
Operand
Function
C
D
Constant
Repeat
S1 (Source 1)
Control register
— — — — — —
I
Q
M
X
—
—
D1 (Destination 1)
Status relay
— —
— — — —
—
—
X
R
T
Source operand S1 (control register) uses 8 data registers starting with the operand designated as S1. Data registers D0
through D1292 and D2000 through D7992 can be designated as S1. For details, see below.
Destination operand D1 (status relay) uses 3 internal relays starting with the operand designated as D1. Internal relays M0
through M1270 can be designated as D1. The least significant digit of the internal relay number designated as D1 must be
0. Special internal relays cannot be designated as D1. For details, see page 6-2.
Source Operand S1 (Control Register)
Store appropriate values to data registers starting with the operand designated by S1 before executing the PWM instruction
as required, and make sure that the values are within the valid range. Operands S1+5 through S1+7 are for read only.
Operand
Function
S1+0
Output pulse frequency
S1+1
Pulse width ratio
S1+2
Pulse counting
S1+3
S1+4
S1+5
S1+6
S1+7
Preset value (high word)
Preset value (low word)
Current value (high word)
Current value (low word)
Error status
Description
0: 6.81 Hz
1: 27.26 Hz
2: 217.86 Hz
1 to 100
(1% to 100% of the period determined by output pulse frequency S1+0)
0: Disable pulse counting
1: Enable pulse counting (PWM1 only)
R/W
1 to 100,000,000 (05F5 E100h) (PWM1 only)
R/W
1 to 100,000,000 (05F5 E100h) (PWM1 only)
R
0 to 5
R
« MICROSMART USER’S MANUAL »
R/W
R/W
R/W
20-7