What Is Simulink PLC Coder?
Simulink PLC Coder™ generates hardware-independent IEC 61131-3 Structured Text and Ladder Diagrams from Simulink® models, Stateflow® charts, and MATLAB® functions. Simulink PLC Coder generates Structured Text in a variety of file formats widely used by third-party integrated development environments (IDEs), including:
- 3S-Smart Software Solutions CODESYS
- B&R Automation Studio™
- Beckhoff® TwinCAT®
- KW-Software MULTIPROG®
- Omron Sysmac Studio
- Phoenix Contact® PC WORX™
- Rexroth IndraWorks
- Rockwell Automation® RSLogix™ 5000 and Studio 5000
- Siemens SIMATIC STEP 7 and TIA Portal
- IDEs that use generic ASCII files
- PLCopen XML
Simulink PLC Coder generates Ladder Diagrams in a variety of file formats used by third-party IDEs, including:
- 3S-Smart Software Solutions CODESYS
- Rockwell Automation RSLogix 5000 and Studio 5000
- PLCopen XML
As a result, you can compile and deploy your application to numerous programmable logic controller (PLC) and programmable automation controller (PAC) devices.
Simulink PLC Coder generates test benches that help you verify the Structured Text and Ladder Diagrams using PLC and PAC IDEs and simulation tools. It also provides code generation reports with static code metrics and bidirectional traceability between model and code. Support for industry standards is available through IEC Certification Kit (for IEC 61508 and IEC 61511).
Simulink PLC Coder creates a code generation report for examining the generated code for your Simulink model. The report includes a code interface description, traceability report, and display of generated source files and code. Bidirectional links between the model and the generated code make it easy to navigate between every line of code and its corresponding Simulink model element. The report also contains static code metrics that list information such as lines of code, global variables, global constants, and function block information.
Published: 14 Aug 2011
Simulink PLC Coder generates IEC 61131 structured text and ladder diagrams from Simulink models. The structured text and ladder diagram can then be compiled and deployed using an IDE to your programmable logic controller and programmable automation controller devices.
Simulink PLC Coder supports most Simulink blocks, including ones for ladder diagrams, all Stateflow constructs, and most of the MATLAB subset. Starting with a closed-loop model of a controller and plant, you can first simulate the model to see the behavior. And then generate structured text targeted for a variety of third-party IDEs with a click of a button.
Built-in optimizations reduce memory size and improve execution speed. Note the conciseness and clarity of the code with clear comments that aid code readability and allow you to trace back to the model. You can package the simulation results into a test bench, along with the algorithm code, to verify that the behavior of the structured text matches that of the simulation.
Here's a test bench and algorithm code in the third-party IDE. As you run the test, the output from the IDE is compared to the simulation results generated from Simulink. If the difference between the two results is smaller than the default tolerance, the variable will remain True, indicating that the test passed. The structured text is now ready for hardware in the loop testing and deployment on your hardware.
For more information, such as a listing of supported IDEs, return to the product page, or choose a link below.