U
SER
’
S
M
ANUAL
16-1
16: P
ULSE
, A/D C
ONVERSION
I
NSTRUCTIONS
Introduction
The PULS (pulse output) instruction is used to generate pulse outputs of 9.574 Hz through 13,020.8 Hz which can be used
to control pulse motors for simple position control applications. The output pulse ratio is fixed at 50%.
The PWM (pulse width modulation) instruction is used to generate pulse outputs of a 51.2, 25.6, 3.2, or 1.6 msec period
with a variable pulse width ratio between 0% and 100%, which can be used for illumination control.
The PULS and PWM instructions can be used on transistor output type
MICRO
3
base units only.
The A/D (analog/digital conversion) instruction is used to convert an analog value from the A/D converter unit to a digital
value and stores the result to a data register.
91 PULS (Pulse Output)
Key Operation
Valid Operands (Standard Processing)
In the high-speed processing mode, data registers for this instruction are limited to D0 through D31.
While the
MICRO
3
is running, the MODE selection cannot be changed. To change the output pulse frequency during oper-
ation, use a data register as source operand S1, and change the value of the data register. See page 3-16.
When a data register is designated as S1, make sure that the value of the data register does not exceed 249. If the value of
the data register designated as S1 exceeds 249 during operation, a user program execution error will occur, then error indi-
cator ERR1 on the MICRO
3
base unit is lit and special internal relay M304 is also turned on. Correct the program and
transfer the corrected program to the base unit.
When a data register is designated as source operand S1, the data is read as the user program is scanned. When changing
the value of the data register designated as S1, change the value slowly in comparison to the output frequency.
When output Q0 is monitored on the program loader while the PULS instruction is executed, Q0 remains on, and the out-
put indicator also remains on. When input to the PULS instruction is turned off while the pulse output is on, the output is
turned off after a complete pulse is generated.
Output Frequency
Select MODE1 through MODE4 to determine the base frequency. (Do not choose MODE5 and MODE6.)
The output frequency is determined by the following equation:
Operand Function I Q M T C R D Constant Repeat
S1 (Source 1) Pulse width coefficient ——————0-99 0-249 —
MODE Base Frequency Output Frequency Range (Coefficient 249 through 0)
MODE1 4882.81 Hz 9.574 through 406.901 Hz
MODE2 9765.63 Hz 19.148 through 813.802 Hz
MODE3 78,125 Hz 153.186 through 6510.42 Hz
MODE4 156,250 Hz 306.373 through 13020.8 Hz
When input is on, output Q0 generates a pulse output. The output pulse frequency is deter-
mined by the MODE selection and source operand S1 according to the equation below.
When input is off, output Q0 remains off.
Note: Either the PULS or PWM instruction can be used only once in a user program.
PULS
MODE1
S1
****
ADV
1
BPS
1 S1
PULS (*MODE1)
(Q0)
Enter operand S1 using the LOD/10 key for a decimal con-
stant, or designate a data register.
Select MODE1 through MODE4 using the REP key.
Do not choose MODE5 and MODE6.
To exit, press the key.
9
JMP/E
Output Frequency
Base Frequency (MODE)
(Pulse Width Coefficient S1 + 6) 2×
----------------------------------------------------------------------------------------
Hz[]=
Pulse Width Coefficient S1
Base Frequency (MODE)
Output Frequency 2×
------------------------------------------------------------- 6–=
Period
1
Frequency
-------------------------=