Program instructions
7.7 Pulse output
S7-200 SMART
290
System Manual, V2.3, 07/2017, A5E03822230-AF
Pulse width time and cycle time and reactions in the PWM function
Pulse width time / cycle time
Reaction
Pulse width time >= Cycle time value The duty cycle is 100%: the output is turned on continuously.
Pulse width time = 0
The duty cycle is 0%: the output is turned off continuously.
Cycle time < 2 time units
The cycle time defaults to two time units.
Changing the characteristics of a PWM waveform
You can only use synchronous updates to change the characteristics of a PWM waveform.
With a synchronous update, the change in the waveform characteristics occurs on a cycle
boundary, providing a smooth transition.
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.
Your program can enable the pulse generator again with no time delay as long as the
following is true: the pulse mode (PTO or PWM) being enabled is the same mode that was
disabled. An error may occur if your program first disables a PTO and then enables a PWM
on the same output channel or if your program first disables a PWM and then enables a
PTO.
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 322).) 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.