280
4
4 Instructions4.8.5 Timing
DUTY: Timing pulse generation
◆
Overview
The DUTY instruction considers the period required to complete a specied number of operations as one
cycle and generates timed signals.
DUTY
S1 S2 D
Timing pulse
generation
Applicable model:
H3U
S1
ON cycle
count
Number of scan (operation) cycles mapping the ON
state (n1 ≥ 0)
16-bit instruction (7
steps)
DUTY: Continuous
execution
S2
OFF cycle
count
Number of scan (operation) cycles mapping the OFF
state (n2 ≥ 0)
D Output
Destination address (M8335–M8339) to which a
timer outputs data
◆
Operands
Operand
Bit Element Word Element
System·User System·User Bit Designation Indexed Address Constant
Real
Number
S1 X Y M T C S SM D R T C SD KnX KnY KnM KnS KnSM
V,Z
Modication K H E
S2 X Y M T C S SM D R T C SD KnX KnY KnM KnS KnSM
V,Z
Modication K H E
D X Y M T C S SM D R T C SD KnX KnY KnM KnS KnSM
V,Z
Modication K H E
Note: The elements in gray background are supported.
◆
Function
1. Timers output the ON (after n1 scan cycles) and OFF (after n2 scan cycles) states.
2. The destination address that stores timer outputs is M8335–M8339. The scan cycle counting result is
stored in D8335–D8339.
3. The value in D8335–D8339 is reset when it is equal to (n1 + n2) or the input ow switches from OFF to
ON again.
The switch-off input ow cannot be stopped during execution.
4. When n1 = 0 and n2 ≥ 0, the value in [D] is xed to OFF; when n1 > 0 and n2 = 0, the value in [D] is xed
to ON.
●
An operation error occurs in the following conditions. The error ag M8067 is set to ON to identify this
error and the error code is stored in D8067.
1. Error 6706 is returned when n1 and n2 are out of range.
2. Error 6705 is returned when the destination address [D] is beyond the range M8335–M8339.
3. Error 6711 is returned when multiple DUTY instructions use the same timer output destination address.
◆
Application
The following square wave results in a duty cycle of 1:1 when the M8335 output cycle is equal to 200 scan
cycles.