Special Hardware Requirements: CPU with DC Outputs
Note! Starting with STEP 7-Micro/WIN Version 3.2, a Position Control Wizard (PWM/PTO option) was added.
As a result, the new wizard now provides an easier method of programming this task than is shown here.
As a result, the new wizard now provides an easier method of programming this task than is shown here.
The S7-200 CPU makes it possible to send square-wave signals to outputs Q0.0 and Q0.1. The cycle time and pulse width can be set independently of each other. The pulse width corresponds to the length of time in which the output signal is 'high' during a cycle.
This is an example of pulse width modulation (PWM). A signal is output at Q0.0. The pulse width of that signal increases by 0.5 s every cycle. The cycle time consists of constant 5-second intervals. The start value for the pulse width is 0.5 s. Once the set maximum value of the pulse width (4.5 s) is attained, the pulse width is decreased by 0.5 s until it reaches 0. This procedure is repeated each cycle.
This is an example of pulse width modulation (PWM). A signal is output at Q0.0. The pulse width of that signal increases by 0.5 s every cycle. The cycle time consists of constant 5-second intervals. The start value for the pulse width is 0.5 s. Once the set maximum value of the pulse width (4.5 s) is attained, the pulse width is decreased by 0.5 s until it reaches 0. This procedure is repeated each cycle.

In this example, output Q0.0 must be connected to input I0.0 so that the program can monitor the PWM
Program Flowchart :

Download Project Example :
















