Pwm Initialization; Changing The Pulse Width For Pwm Outputs - Siemens SIMATIC S7-200 System Manual

Hide thumbs Also See for SIMATIC S7-200:
Table of Contents

Advertisement

PWM Initialization

To initialize the PWM for Q0.0, follow these steps:
1.
Use the first scan memory bit (SM0.1) to initialize the output to 0, and call the
subroutine that you need in order to perform the initialization operations. When
you use the subroutine call, subsequent scans do not make the call to the
subroutine. This reduces scan time execution and provides a more structured
program.
2.
In the initialization subroutine, load SMB67 with a value of 16#D3 for PWM
using microsecond increments (or 16#DB for PWM using millisecond
increments). These values set the control byte to enable the PTO/PWM
function, select PWM operation, select either microsecond or millisecond
increments, and set the update pulse width and cycle time values.
3.
Load SMW68 (word size value) with the desired cycle time.
4.
Load SMW70 (word size value) with the desired pulse width.
5.
Execute the PLS instruction so that the S7-200 programs the PTO/PWM
generator.
6.
Load SMB67 with a value of 16#D2 for microsecond increments (or 16#DA for
millisecond increments). This preloads a new control byte value for
subsequent pulse width changes.
7.
Exit the subroutine.

Changing the Pulse Width for PWM Outputs

To change the pulse width for PWM outputs in a subroutine, follow these steps. (It
is assumed that SMB67 was preloaded with a value of 16#D2 or 16#DA.)
1.
Call a subroutine to load SMW70 (word size value) with the desired pulse
width.
2.
Execute the PLS instruction to cause the S7-200 to program the PTO/PWM
generator.
3.
Exit the subroutine.
S7-200 Programmable Controller System Manual
A5E00066097-02
SIMATIC Instructions
9-59

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents