EasyManua.ls Logo

Siemens SIMATIC S7-1200

Siemens SIMATIC S7-1200
1614 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
Extended instructions
9.8 Pulse
S7-1200 Programmable controller
System Manual, V4.2, 09/2016, A5E02486680-AK
487
9.8
Pulse
9.8.1
CTRL_PWM (Pulse width modulation)
Table 9- 185 CTRL_PWM (Pulse Width Modulation) instruction
LAD / FBD
SCL
Description
"CTRL_PWM_DB"(
PWM:=_uint_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.
1
When you insert the instruction, STEP 7 displays the "Call Options" dialog for creating the associated DB.
2
In the SCL example, "CTRL_PWM_DB" is the name of the instance DB.
Table 9- 186 Data types for the parameters
Parameter and type
Data type
Description
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 pa-
rameter. (Default value: 0)
ENABLE IN Bool 1=start pulse generator
0 = stop pulse generator
BUSY OUT Bool Function busy (Default value: 0)
STATUS
OUT
Word
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.
Because the CPU processes the request when the CTRL_PWM instruction is executed,
parameter BUSY will always report FALSE. If an error is detected, then ENO is set to
FALSE, and parameter STATUS contains a condition code.
The pulse width will be set to the initial value configured in device configuration when the
CPU first enters RUN mode. You write values to the Q-word location specified in device
configuration ("Output addresses" / "Start address:") as needed to change the pulse width.
You use an instruction such as a move, convert, math, or PID box to write the desired pulse
width to the appropriate Q word. You must use the valid range for the Q-word value (percent,
thousandths, ten-thousandths, or S7 analog format).

Table of Contents

Other manuals for Siemens SIMATIC S7-1200

Related product manuals