Main Content

Model Architecture and Design

Design models intended for Simulink® PLC Coder™ code generation

When developing Simulink models for generating structured text or ladder logic code, consider:

  • Blocks and libraries for which code generation is supported. For a list of Simulink blocks supported for PLC code generation, see Simulink Block List (PLC Code Generation).

  • Setting up a model for fixed point data type code generation.

  • Setting up a multirate model for code generation.

  • Setting up a MATLAB Function for code generation.

  • Existing limitations when using Simulink PLC Coder to generate either structured text or ladder logic code.

Topics

Structured Text Code Generation Guidelines and Limitations

Prepare Model for Structured Text Generation

Guidelines for setting up model and subsystem block parameters for Simulink PLC Coder structured text code generation.

Fixed Point Simulink PLC Coder Structured Text Code Generation

Configure model parameters and subsystem block parameters containing a fixed point data type for Simulink PLC Coder code generation.

Generating Simulink PLC Coder Structured Text Code For Multirate Models

Guidelines for setting up model and subsystem block configuration parameters for a multirate model Simulink PLC Coder code generation.

MATLAB Function Block Simulink PLC Coder Structured Text Code Generation

Describes support for, and limitations on, use of MATLAB Function block in Simulink PLC Coder code generation.

Structured Text Code Generation Limitations

Limitations that apply to structured text code generation.

Considerations for Nonintrinsic Math Functions

Range considerations for nonintrinsic math functions.

Structured Text Code Generation Support for Simulink Data Dictionary

Improve traceability between your model and generated code, code reusability, and data sharing by using Simulink data dictionary.

IDE Limitations

IDEs which support enum data type.

Distributed Code Generation Limitations

Overview of code generation limitations for distributed systems.

Run Simulink PLC Coder Model Advisor Checks

Overview of the Simulink PLC Coder checks in Simulink Model Advisor, how to run various checks, and fix warnings associated with the checks.

Create Custom Target-Based Keyword List

Create a custom keyword list and generate code to meet target IDE requirements by using the customized keyword list.

Model configuration checks overview

To prepare your model for compatibility with PLC code generation, use the checks in this folder.

Ladder Logic Code Generation Guidelines and Limitations

Ladder Logic Code Generation Limitations

Limitations that apply to ladder logic code generation.

Motion Instruction Simulation and Code Generation

Simulation and Code Generation of Motion Instructions

Create model for simulation and code generation of motion instructions in the Rockwell Automation® RSLogix™ 5000 IDE.

Featured Examples