Extended instructions
9.8 Pulse
S7-1200 Programmable controller
496 System Manual, V4.2, 09/2016, A5E02486680-AK
● Initial pulse duration (only applies to PWM): Assign the pulse duration of the first pulse.
You can change this value at runtime using the Q word address configured in I/O
addresses. Range is based upon the Pulse duration format.
● Allow runtime modification of the cycle time (only applies to PWM): Selecting this option
allows your program to modify the cycle time of the PWM signal while the program is
running. Refer to the "I/O addresses" section below for further information.
Note
When setting the pulse duration of a PWM signal, b
e sure to consider the switching delay of
the output channel as specified in Appendix A. The actual pulse duration measured at the
output may be greater than the selected pulse duration. The increase of the pulse duration is
more pronounced for small pulse
duration and higher frequencies. Be sure to verify that the
pulse duration measured at the output matches your requirements.
Determining the Pulse duration value
"Pulse duration" is derived by multiplying the "Initial pulse duration" by the "Cycle time".
When you select a "Time base", "Pulse duration format", "Cycle time", and "Initial pulse
duration", you must keep in mind that the overall "Pulse duration" cannot be a fractional
value. If your resulting "Pulse duration" is a fractional value, you should adjust your "Initial
pulse duration" or change your "Time base" to generate an integer value.
Here are two examples:
● Example 1: If you select the following values:
– Time base = Milliseconds (ms)
– Pulse duration format = Hundredths (0 to 100)
– Cycle time = 3 ms
– Initial pulse duration = 75
The resulting "Pulse duration" = .75 x 3 ms = 2.25 ms
This "Pulse duration" value is fractional and causes an error when you operate the
CTRL_PWM instruction. The "Pulse duration" value must be an integer value.
● Example 2: If you select the following values:
– Time base = Microseconds (µs)
– Pulse duration format = Hundredths (0 to 100)
– Cycle time = 3000 µs
– Initial pulse duration = 75
The resulting "Pulse duration" = .75 x 3000 µs = 2250 µs
This "Pulse duration" value is an integer value, and the CTRL_PWM instruction functions
properly with this value.