Using Sm Locations To Configure And Control The Pto/Pwm Operation - Siemens Simatic S7 Series System Manual

Hide thumbs Also See for Simatic S7 Series:
Table of Contents

Advertisement

Program instructions
7.7 Pulse output
7.7.4

Using SM locations to configure and control the PTO/PWM operation

The PLS instruction reads the data stored in the specified SM memory locations and
programs the PTO/PWM generator accordingly. SMB67 controls PTO0 or PWM0, SMB77
controls PTO1 or PWM1, and SMB567 controls PTO2 or PWM2. The "SM locations for the
PTO/PWM control registers" table (the first table below) describes the registers used to
control the PTO/PWM operation. You can use the "PTO/PWM control byte reference" table
(the second table below) as a quick reference to determine the value to place in the
PTO/PWM control register to invoke the desired operation.
You can change the characteristics of a PTO or PWM waveform by modifying the locations
in the SM area (including the control byte) and then executing the PLS instruction. You can
disable the generation of a PTO or PWM waveform at any time by writing 0 to the PTO/PWM
enable bit of the control byte (SM67.7, SM77.7, or SM567.7) and then executing the PLS
instruction. The output point immediately reverts back to process image register control.
If you disable the PTO or PWM operation while the operation is producing a pulse, that pulse
internally completes its full cycle time duration. However, the pulse is not present at the
output point because, at that time, the process image register regains control of the output.
Because the pulse must be completed internally, it is important to note that setting the
enable bit and executing the PLS instruction before the pulse completes results in a non-fatal
error and an ignored instruction. Before executing the PLS instruction again, be sure to have
a time delay equal to the maximum cycle time of the last active pulse.
The PTO Idle bit in the status byte (SM66.7, SM76.7, or SM566.4) is provided to indicate the
completion of the programmed pulse train. In addition, an interrupt routine can be invoked
upon the completion of a pulse train. (Refer to the descriptions of the Interrupt instructions
(Page 282).) If you are using the single segment operation, the interrupt routine is invoked
upon the completion of each PTO. For example, if a second PTO is loaded into the pipeline,
the PTO function invokes the interrupt routine upon the completion of the first PTO, and
again upon the completion of the second PTO that was loaded into the pipeline. When using
the multiple segment operation, the PTO function invokes the interrupt routine upon
completion of the profile table.
The following conditions set the bits of the status byte (SMB66, SMB76, and SMB566):
● If an "Add Error" occurs in the pulse generator that results in an invalid frequency value,
the PTO function terminates and the Delta Calculation Error bit (SM66.4, SM76.4, or
SM566.4) is set to 1. The output reverts to image register control. To correct this issue,
try adjusting the PTO profile parameters.
● Manually disabling a PTO profile in progress sets the PTO Profile Disabled bit (SM66.5,
SM76.5, or SM566.5) to 1.
● The PTO/PWM overflow/underflow bit (SM66.6, SM76.6, or SM566.6) is set to 1 if either
of these situations occur:
– An attempt is made to load the pipeline while it is full; this is an overflow condition.
– A PTO profile segment is too short to allow the CPU to calculate the next segment,
● You must clear the PTO/PWM overflow/underflow bit manually after it is set to detect
subsequent overflows. The transition to RUN mode initializes this bit to 0.
252
and an empty pipeline is transferred; this is an underflow condition, and the output
reverts to image register control.
System Manual, 09/2015, A5E03822230-AC
S7-200 SMART

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Simatic s7-200 smart series

Table of Contents