Main Content

Ladder Diagram Integration

Import, simulate, and validate your existing ladder diagrams. Model, simulate, and generate code using the provided Ladder Diagram blocks and functions

Ladder Diagram is a graphical programming language that you use 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.

With Simulink® PLC Coder™, you can use ladder import to import ladder diagrams created with Rockwell Automation® IDEs, such as RSLogix™ 5000 and Studio 5000 into the Simulink environment as a model. You can create ladder diagrams in the Simulink environment as a model.

After importing or creating the ladder diagram models, you can:

  • Edit the imported Ladder Diagram model from within Simulink by using the plcladderlib library.

  • After importing the ladder diagram code into Simulink, simulate it.

  • Generate C code from the imported ladder diagram and integrate the code into your existing C language-based simulation environments.

  • 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.

  • Generate PLC testbench code for the imported ladder diagram and verify the code in your Rockwell Automation IDE.

Apps

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

Functions

expand all

plcimportladderImport ladder diagram into a Simulink subsystem
plcgeneratecodeGenerate structured text or ladder diagram (L5X) for the atomic subsystem
plcladderinstructionsLists ladder instructions identified by Simulink PLC Coder (Since R2020a)
plcladderlibOpen the Simulink PLC Coder Ladder Library (Since R2019a)
plcgeneraterunnertbGenerate L5X test bench code for specified AOI Runner block and AOI name (Since R2019a)
plcladderoptionGet or set parameter values associated with Ladder Diagram models (Since R2019a)
plcloadtypesLoad the data types for Simulink PLC Coder ladder models (Since R2019a)
plccleartypesClear the data types associated with the Simulink PLC Coder ladder models from the workspace (Since R2019a)

Blocks

expand all

ONSOne Shot (Since R2019a)
OSROne Shot Rising (Since R2019a)
OSFOne Shot Falling (Since R2019a)
XICExamine If Closed (Since R2019a)
XIOExamine If Open (Since R2019a)
OTEOutput Energize (Since R2019a)
OTLOutput Latch (Since R2019a)
OTUOutput Unlatch (Since R2019a)
TONTimer On Delay (Since R2019a)
TOFTimer Off Delay (Since R2019a)
RTORetentive Timer On (Since R2019a)
CTUCount Up (Since R2019a)
CTDCount Down (Since R2019a)
RESReset (Since R2019a)
JMPJump (Since R2019a)
LBLLabel (Since R2019a)
TNDTemporary End (Since R2019a)
AFIAlways False (Since R2019a)
NOPNo Operation (Since R2019a)
MCRMaster Control Reset (Since R2019a)
ADDAdd inputs (Since R2019a)
SUBSubtract inputs (Since R2019a)
MULMultiply inputs (Since R2019a)
DIVDivide one input by another (Since R2019a)
CPTEvaluate expression (Since R2019a)
ANDBitwise AND (Since R2019a)
ORBitwise OR (Since R2019a)
NOTBitwise NOT (Since R2019a)
NEQNot Equal To (Since R2019a)
EQUEqual To (Since R2019a)
LEQLess Than or Equal To (Since R2019a)
GEQGreater Than or Equal To (Since R2019a)
LESLess Than (Since R2019a)
GRTGreater than (Since R2019a)
MOVMove (Since R2019a)
CLRClear (Since R2019a)
COPCopy File (Since R2019a)
FLLFile Fill (Since R2019a)
AOI RunnerAOI Runner (Since R2019a)
PLC Controller SuitePLC Controller (Since R2019a)
PLC ControllerPLC Controller (Since R2019a)
TaskTask (Since R2019a)
Ladder Diagram ProgramLadder Diagram Program (Since R2019a)
Ladder Diagram SubroutineLadder Diagram Subroutine (Since R2019a)
Ladder Diagram Function Block (AOI)Ladder Diagram Function Block (AOI) (Since R2019a)
Variable ReadVariable Read (Since R2019a)
Variable WriteVariable Write (Since R2019a)
Power Rail StartPower Rail Start (Since R2019a)
Power Rail TerminalPower Rail Terminal (Since R2019a)
Rung TerminalRung Terminal (Since R2019a)
JunctionJunction (Since R2019a)
Custom InstructionCreate custom ladder logic instruction (Since R2020a)

Topics