| Products & Services | Solutions | Academia | Support | User Community | Company |
| Download Product Updates | | | Get Pricing | | | Trial Software |
| Documentation → Real-Time Windows Target |
| Contents | Index |
| Learn more about Real-Time Windows Target |
Real-Time Windows Target
The Frequency Output block generates a pulse-width-modulated square wave that alternates between low (0) and high (1) with a specified frequency and duty cycle. The frequency is specified in Hertz. The duty cycle is specified as a decimal fraction between 0 and 1 inclusive. This fraction specifies the amount of time that the output signal value is high (1). For example, a duty cycle of .7 specifies that the output is high 70% of the time, and low 30% of the time.
After you have added a Frequency Output block to your model, double-click the Frequency Output block to open the Block Parameters: Frequency Output dialog box. The default appearance of the dialog box is:

Specify parameter values as needed, then click OK or Apply. If you specify a non-default value for Output signal frequency source or Output signal duty source, the appearance of the dialog box changes as shown below. The parameters are:
Enter the same value you entered in the Fixed step size box from the Configuration Parameters dialog box, or an integer multiple of that value.
A vector that selects the output channels you are using on this board. The vector can be any valid MATLAB vector form.
The source that specifies the frequency to output. The frequency is specified in Hertz. The Output signal frequency source can be either of the following:
The frequency is specified by an input signal. An input port appears on the block to accept the signal. A Frequency initial value and a Frequency final value may be needed.
The frequency is specified by a tunable parameter named Frequency. If you specify internal, Frequency replaces Frequency initial value, and Frequency final value is disabled:

This tunable parameter appears when Output signal frequency source is internal. Specify the desired frequency in Hertz.
This parameter appears when Output signal frequency source is external. Optionally specify a frequency in Hertz. The specified frequency takes effect when you connect to the target, and persists until simulation starts, at which time the value of the frequency signal takes effect. You can use this parameter to specify initial conditions and give them time to stabilize. If no value appears, connecting to the target has no effect on the frequency.
This parameter appears when Output signal frequency source is external. Optionally specify a frequency in Hertz. The specified frequency takes effect when simulation completes and persists indefinitely. Disconnecting from the target does not affect the frequency. You can use this parameter to put a connected device into a safe or neutral state after simulation. If no value appears, the frequency in effect at the end of simulation persists afterwards.
The source that specifies the duty cycle. The specification is a decimal fraction between 0 and 1 inclusive that determines the amount of time that the output signal value is high (1). For example, a duty cycle of .7 specifies that the output is high 70% of the time, and low 30% of the time. Two duty cycle values have special significance:
The output signal is continuously low (0) regardless of any frequency specification currently in effect.
The output signal is continuously high (1) regardless of any frequency specification currently in effect.
The Output signal duty source can be either of the following:
This tunable parameter appears when Output signal duty source is internal. Specify the desired duty cycle as a decimal fraction between 0 and 1. Specifying 0 or 1 overrides the currently specified frequency and enforces a continuously low or high output signal for the duration of the specification.
This parameter appears when Output signal duty source is external. Optionally specify a duty cycle. The specified duty cycle takes effect when you connect to the target, and persists until simulation starts. If no value appears, connecting to the target has no effect on the duty cycle. You can specify any duty cycle. Often the Duty initial value is 0 or 1, enforcing a continuously low or high initial output signal. Specifying 0 or 1 overrides any Frequency initial value.
This parameter appears when Output signal duty source is external. Optionally specify a duty cycle. The specified duty cycle takes effect when simulation completes and persists indefinitely. Disconnecting from the target does not change the duty cycle. If no value appears, the duty cycle in effect at the end of simulation persists indefinitely afterwards. You can specify any duty cycle. Often the Duty final value is 0 or 1, enforcing a continuously low or high initial output signal. Specifying 0 or 1 overrides any Frequency final value.
![]() | Encoder Input | Other Input | ![]() |

Learn more about Simulink through this collection of videos, articles, technical literature and the Getting Started with Simulink Guide.
| © 1984-2009- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |