Ladder Diagram is a graphical programming language used to develop software for programmable logic controllers (PLCs). It is one of the languages that the IEC 61131 Standard specifies for use with PLCs. A program in Ladder Diagram notation is a circuit diagram that emulates circuits of relay logic hardware. The underlying program uses Boolean expressions that translate readily to switches and relays.
The ladder import feature of Simulink® PLC Coder™ allows you to import Ladder Diagram created with Rockwell Automation® IDEs such as RSLogix™ 5000 and Studio 5000 into the Simulink environment as a model. The ladder modelling feature of Simulink PLC Coder allows you to create Ladder Diagrams in the Simulink environment as a model.
After importing or creating the Ladder Diagram models, you can do the following from Simulink.
You can edit the imported Ladder Diagram model from within
Simulink by using the plcladderlib
library.
You can simulate the Ladder Diagram after importing the Ladder diagram into Simulink
You can generate C code from the imported Ladder Diagram and integrate the code into your existing C language-based simulation environments.
You can generate Ladder Diagram code from the imported Ladder Diagram and integrate the code into your Rockwell Automation IDE.
You cannot generate Structured Text code from the Ladder Diagram blocks. The Ladder feature supports only ladder code generation.
You can generate PLC testbench code for the imported Ladder Diagram and verify the code in your Rockwell Automation IDE.
Simulink PLC Coder | Generate structured text and ladder diagram code from Simulink models, Stateflow charts, and MATLAB functions |
plcimportladder | Import ladder diagram into a Simulink subsystem |
plcgeneraterunnertb | Generate L5X test bench code for specified AOI Runner block and AOI name |
plcgeneratecode | Generate Structured Text or Ladder Diagram (L5X) for the atomic subsystem |
plcladderlib | Open the Simulink PLC Coder Ladder Library |
plcladderoption | Get or set parameter values associated with Ladder Diagram models |
plcloadtypes | Load the data types for Simulink PLC Coder ladder models |
plccleartypes | Clear the data types associated with the Simulink PLC Coder ladder models from the workspace |
plcladderinstructions | Lists ladder instructions identified by Simulink PLC Coder |
Supported Features in Ladder Diagram
Ladder features and elements that are supported by Simulink PLC Coder.
Import L5X Ladder Files into Simulink
Importing ladder files into Simulink.
Modeling and Simulation of Ladder Diagrams in Simulink
Create Ladder Diagrams in Simulink and perform simulation.
Generating Ladder Diagram Code from Simulink
Generate Ladder Diagram code (L5X) from Simulink.
Generating C Code from Simulink Ladder
Generate C code from a Simulink Ladder Diagram Model.
Verify Generated Ladder Diagram Code
Verify generated code against the original Simulink model in your IDE using a generated test bench.
Create Custom Instruction in PLC Ladder Diagram Models
Create user-defined instruction in PLC Ladder Diagram models.