Siemens Simatic S7-200 System Manual page 226

Programmable controller
Hide thumbs Also See for Simatic S7-200:
Table of Contents

Advertisement

Instruction Set
Changing the Pulse Width
PWM is a continuous function. Changing the pulse width causes the PWM function to be
disabled momentarily while the update is made. This is done asynchronously to the PWM
cycle, and could cause undesirable jitter in the controlled device. If synchronous updates to
the pulse width are required, the pulse output is fed back to one of the interrupt input points
(I0.0 to I0.4). By enabling the rising edge interrupt of that input when the pulse width needs to
be changed, you can synchronize the PWM cycle. See Figure 10-19 for an example.
The pulse width is actually changed in the interrupt routine and the interrupt event is
detached or disabled in the interrupt routine. This prevents interrupts from occurring except
when the pulse width is to be changed.
Invoking the PTO/PWM Operation
Each PTO/PWM generator has a control byte (8 bits); a cycle time value and a pulse width
value which are unsigned, 16-bit values; and a pulse count value which is an unsigned,
32-bit value. These values are all stored in designated areas of special memory bit memory.
Once these special memory bit memory locations have been set up to give the desired
operation, the operation is invoked by executing the Pulse instruction (PLS). This instruction
causes the S7-200 to read the special memory bit locations and program the PTO/PWM
generator accordingly.
PTO Pipeline
In addition to the control information, there are two status bits used with the PTO function that
either indicate that the specified number of pulses were generated, or that a pipeline overflow
condition has occurred.
The PTO function allows two pulse output specifications to be either chained together or to
be piped one after the other. By doing this, continuity between subsequent output pulse
trains can be supported. You load the pipeline by setting up the first PTO specification and
then executing the PLS instruction. Immediately after executing the PLS instruction, you can
set up the second specification, and execute another PLS instruction.
If a third specification is made before the first PTO function is completed (before the number
of output pulses of the first specification are generated), the PTO pipeline overflow bit
(SM66.6 or SM76.6) is set to one. This bit is set to zero on entry into RUN mode. It must be
set to zero by the program after an overflow is detected, if subsequent overflows are to be
detected.
The SM locations for pulse outputs 0 and 1 are shown in Table 10-10.
Note
Default values for all control bits, cycle time, pulse width, and pulse count values are zero.
10-38
S7-200 Programmable Controller System Manual
C79000-G7076-C230-02

Advertisement

Table of Contents
loading

Table of Contents