Instruction Parameters
Supported PLC Series
| PLC-AES | PLC-FB | PLC-ES |
|---|---|---|
| ✓ | ✓ | ✓ |
Supported Data Registers
| M | X | Y | K | L | F | T | C | S | Z | R | Q | D | @D | Constant | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| S1 | ✓ | – | ✓ | ✓ | ✓ | – | – | – | – | – | – | – | ✓ | ✓ | ✓ |
| S2 | ✓ | – | ✓ | ✓ | ✓ | – | – | – | – | – | – | – | ✓ | ✓ | ✓ |
| D1 | ✓ | – | ✓ | ✓ | ✓ | – | – | – | – | – | – | – | ✓ | ✓ | – |
| D2 | ✓ | – | ✓ | ✓ | ✓ | – | – | – | – | – | – | ✓ | – | – | – |
Supported Flags
| Flag | Bit | Support |
|---|---|---|
| Error | F11.0 | ✓ |
| Zero | F11.1 | – |
| Carry | F11.2 | – |
Number of Steps
| Steps |
|---|
| 5 |
Operands
| Operand | Description |
|---|---|
| S1 | The first operand. Entries are WORD data registers or constants. This is where the amount of pulse time, in milliseconds (ms), ON is stored. The value range is 1 ~ 65,535 (216-1). This value must not exceed S2. |
| S2 | The second operand. Entries are WORD data registers or constants. This is the frequency of the pulse to be output is stored. The value range is 1 ~ 65,535 (216-1). |
| D1 | The third operand. Entries are LWORD data registers. This is where the internal time is stored. DO NOT EDIT THESE SETS OF REGISTERS. |
| D2 | The fourth operand. Entries are BOOL data registers. This is where pulses are output. |
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. F11.0 turns ON when the value of S1 and S2 equal 0. F11.0 turns ON when the value of S1 is greater than S2.
Instruction Behavior
The Pulse-Width modulation (PWM) instruction needs to meet certain criteria before using:
- Do NOT manipulate the value stored in D1, D1+1, D1+2, and D1+3.
- This is where timer values are stored by the PLC.
- The value range of S1 and S2 is as following:
- 1ms ≤ S1
- S2 ≤ 65,535ms
- S1 and S2 must be a WORD.
- Range: 1 ~ 65,535 (216-1)
- S1 ≤ S2
- The value of S1 CANNOT exceed the value of S2.
- If S1 = S2, D2 is always ON.
- The operation of PWM may be influenced by the scan time since the instruction uses a deviation of the internal timer.
Ladder Diagram Examples
PWM Example

The Pulse-Width modulation (PWM) instruction outputs pulses set by S2 for a set amount of time, S1, to the output module or data register, D2.

When the contact, M3.0, is ON (1), the PWM operation is outputting 1,000 pulses every 100ms. When the PWM operation is ON (1), the output device, M3.5, receives the pulses. When M3.5 receives pulses, the coil, Y2.0, is energized.
The coil, Y2.0, is energized with 1,000 pulses every 100ms.

Memory Monitor

Binary result of the result value, D5, before the PWM operation.

Binary result of the result value, D5, after the PWM operation.
