Extended instructions
8.6 Pulse
S7-1200 Programmable controller
364 System Manual, 03/2014, A5E02486680-AG
Note
In the DB, you must manually type in the data type to access each of the three structures;
there is no dropdown list selection.
Type in the data types exactly as shown below:
DNN
DIS
CTRL_PWM (Pulse width modulation) instruction
Table 8- 146 CTRL_PWM (Pulse Width Modulation) instruction
PWM:=_word_in_,
enable:=_bool_in_,
busy=>_bool_out_,
status=>_word_out_);
Provides a fixed cycle time output with a variable duty
cycle. The PWM output runs continuously after being
started at the specified frequency (cycle time). The
pulse width is varied as required to affect the desired
control.
STEP 7 automatically creates the DB when you insert the instruction.
2
In the SCL example, "CTRL_PWM_DB" is the name of the instance DB.
Table 8- 147 Data types for the parameters
PWM IN HW_PWM
(Word)
PWM identifier: Names of enabled pulse generators will become tags in
the "constant" tag table, and will be available for use as the PWM
parameter. (Default value: 0)
ENABLE IN Bool 1=start pulse generator
Function busy (Default value: 0)
Execution condition code (Default value: 0)
The CTRL_PWM instruction stores the parameter information in the DB. The data block
parameters are not separately changed by the user, but are controlled by the CTRL_PWM
instruction.
Specify the enabled pulse generator to use, by using its tag name for the PWM parameter.
When the EN input is TRUE, the PWM_CTRL instruction starts or stops the identified PWM
based on the value at the ENABLE input. Pulse width is specified by the value in the
associated Q word output address.