Main Content

PLC Code Generation Basics

Generate structured text

The basic steps for code generation are:

  • Create a model or open an existing model.

  • Configure the model for code generation by selecting the solver.

  • Configure PLC Coder code generation options.

The PLC Coder configuration parameters provide several options for the code generation.

Apps

Simulink PLC CoderGenerate structured text and ladder diagram code from Simulink models, Stateflow charts, and MATLAB functions

Functions

plccoderdemosProduct examples
plccoderprefManage user preferences
plcgeneratecodeGenerate structured text or ladder diagram (L5X) for the atomic subsystem
plcopenconfigsetOpen Configuration Parameters dialog box for subsystem

Topics

Getting Started

Code Generation Files and Folders

Advanced Code Generation Topics

Code Generation Control

Code Generation for Simulink Models

Code Generation for Stateflow charts

Code Generation for MATLAB Function Block