Extended instructions
9.8 Pulse
S7-1200 Programmable controller
System Manual, V4.2, 09/2016, A5E02486680-AK
497
In the hardware outputs section, select the output channel from the dropdown menu.
Depending on the configuration, there may be one or two outputs to select. If you do assign
an output channel to a pulse generator, the output channel cannot be used by another pulse
generator, HSC, or the process image register.
Note
Pulse generator outputs cannot be used by other instructions in the user program
When you configure the outputs of the CPU or signal board as pulse generators (for use with
the PWM, PTO, or motion control instructions), the corresponding outputs addresses are
removed from the Q memory and cannot be used for other p
urposes in your program. If your
program writes a value to an output used as a pulse generator, the CPU does not write that
value to the physical output.
The PWM has two bytes of Q memory designated for "Pulse duration". While the PWM is
running, you can modify the value in the assigned Q memory and change the Pulse duration.
In the I/O Address section, enter the Q word address where you want to store the Pulse
duration value.
The default addresses for the PWM Pulse duration values are as follows:
● PWM1: QW1000
● PWM2: QW1002
● PWM3: QW1004
● PWM4: QW1006
For the PWM, the value at this location controls the duration of the pulse and is initialized to
the "Initial pulse duration:" value (assigned above) each time the CPU transitions from STOP
to RUN mode. You change this Q-word value during runtime to cause a change in the pulse
duration. The range of this value is dependent on the Pulse duration format configured under
Parameter assignment.
You can also allocate an additional four bytes of Q memory for the "Cycle time" of the PWM
signal. Refer to "Operation of the pulse outputs" (Page 492) for a diagram of the PWM
signal. When you select the "Allow runtime modification of the cycle time" check box, the first
two bytes hold the Pulse duration value and the last four bytes hold the Cycle time value.
While the PWM is running, you can modify the value of the double word at the end of the Q
memory that is allocated to that PWM. This changes the Cycle time of the PWM signal. For
example, you enable this option so that the CPU allocates six bytes for PWM1, and you
decide to use QB1008 to QB1013. Once you download the program and start the PWM, you
can modify the Pulse duration using QW1008 and the Cycle time using QD1010.
Each time the CPU transitions from STOP to RUN mode, the CPU initializes the Cycle time
value in Q memory to the "Cycle time" value assigned above in the "Parameter assignment"
section. The units and range of values for the Cycle time value in Q memory are the same as
the configuration in the "Parameter assignment" section.