Skip to main content

Duty Cycle Control

Instruction Parameters

Supported PLC Series

XPnA/1RXPnBXPnEXPnFCP3A/B/P/U
CP4A~D/U
CPnECPnFBPPLC-S

Supported Data Registers

MXYKLFTCSZRQD@DConstant
n1---
n2---
D--------------

Supported Flags

FlagBitSupport
ErrorF11.0
ZeroF11.1-
CarryF11.2-

Number of Steps

Steps
4

Operands

OperandDescription
n1The first operand.
Entries are WORD data registers or constants.
This is the number of scans that the user clock is ON.

The value range is 1 ~ 32,767.
n2The second operand.
Entries are WORD data registers or constants.
This is the number of scans that the user clock is OFF.

The value range is 1 ~ 32,767.
DThe third operand.
Entries are only BOOL data registers.
This is the address of the user clock.

The data register range is F10.0 ~ F10.7.

Notice

Error Flag (F11.0) Notice

The error flag, F11.0, will be ON for one scan when the address of the data register assigned by @D exceeds the range of the data register, D. The range of the data register, D, is dependent on the CPU type.

Instruction Behavior

The DUTY instruction behaves as follows:

  • Once energized, the assigned user clock turns ON and OFF continuously.
    • This is true even if the execution condition is OFF.
  • Only positive numbers can be assigned to n1 and n2.
    • The error flag, F11.0, will be ON if either value is negative.
  • Only the BOOL data registers, F10.0 ~ F10.7, can be assigned to the data register, D.
  • If the value assigned to either n1 or n2 changes while the execution condition is ON, the change is immediately applied to the user clock assigned to the data register, D.

Examples