For Simulink® semantics not supported by Simulink PLC Coder™, see Structured Text Code Generation Limitations.
View Supported Blocks Library
To view a Simulink library of blocks that the Simulink
PLC Coder software supports, type
the Command Window. The coder can generate Structured Text code for
subsystems that contain these blocks. The library window is
This library contains two sublibraries, Simulink and Stateflow®. Each sublibrary contains the blocks that you can include in a Simulink PLC Coder model.
Supported Simulink Blocks
The coder supports the following Simulink blocks.
Additional Math & Discrete/Additional Discrete
Transfer Fcn Direct Form II Time Varying
Unit Delay Enabled External IC (Obsolete)
Unit Delay Enabled Resettable (Obsolete)
Unit Delay Enabled Resettable External IC (Obsolete)
Unit Delay External IC (Obsolete)
Unit Delay Resettable (Obsolete)
Unit Delay Resettable External IC (Obsolete)
Unit Delay With Preview Enabled (Obsolete)
Unit Delay With Preview Enabled Resettable (Obsolete)
Unit Delay With Preview Enabled Resettable External RV (Obsolete)
Unit Delay With Preview Resettable (Obsolete)
Discrete PID Controller (2 DOF)
FIR Interpolation (DSP System Toolbox)
Repeating Sequence Interpolated
MATLAB Function (MATLAB Function Block)
Supported Stateflow Blocks
The coder supports the following Stateflow blocks.
State Transition Table (Stateflow)
Truth Table (Stateflow)
Blocks with Restricted Support
Simulink Block Support Exceptions
PLC Coder software supports the
plclib blocks with the following
exceptions. Also, see Structured Text Code Generation Limitations for a list of limitations
of the software.
If you get unsupported fixed-point type messages during code
generation, update the block parameter. Open the block
parameter dialog box. Navigate to the Signal
Attributes and Parameter
Attributes tabs. Check that the
Output data type and
Parameter data type parameters
Inherit: Inherit via internal
rule. Set these parameters to either
Inherit: Same as input or a
desired non-fixed-point data type, such as
If you receive a message about consistency between the original subsystem and the S-function generated from the subsystem build, and the model contains a Stateflow chart that contains one or more Simulink functions, use the following procedure to address the issue:
Open the model and double-click the Stateflow chart that causes the issue.
The chart Stateflow Editor dialog box is displayed.
Right-click in this dialog box.
In the context-sensitive menu, select Properties.
The Chart dialog box is displayed.
In the Chart dialog box, navigate to the States When Enabling parameter and select
Click Apply and OK and save the model.
To generate PLC code for a model that uses a Data Store
Memory block, first define a
Simulink.Signal object in the base
workspace. Then, in the Signal
Attributes tab of the block parameters,
set the data store name to resolve to that
For more information, see Data Stores with Data Store Memory Blocks.
PLC Coder software does not support the Simulink
Simulink PLC Coder has limited support for lookup table blocks. The coder does not support:
Number of dimensions greater than 2
Cubic spline interpolation method
Begin index search using a previous index mode
Cubic spline extrapolation method
The Simulink PLC Coder software does not support the Simulink Lookup Table Dynamic block. For your convenience, the plclib/Simulink/Lookup Tables library contains an implementation of a dynamic table lookup block using the Prelookup and Interpolation Using Prelookup blocks.
您点击的链接对应于以下 MATLAB 命令：
请在 MATLAB 命令行窗口中直接输入以执行命令。Web 浏览器不支持 MATLAB 命令。
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
- América Latina (Español)
- Canada (English)
- United States (English)
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- United Kingdom (English)