Embedded Code Generation
Industrial controls code generation converts models to embedded code much faster and easier than hand coding, enabling developers of industrial controls to increase productivity 200-300%, achieve high-integrity system certification, and have a printing press immediately work as designed in the production environment.
MathWorks offers innovative solutions that span the full development cycle of industrial system design, embedded code generation, code verification, and IEC 61508 and IEC 61511 certification to keep up with the rapid pace of embedded technology needed for developing today’s industrial equipment.
MATLAB, Simulink and Stateflow are well suited for developing industrial controls for motors, power generation, robotics, and process automation systems. Using executable specifications instead of static diagrams accelerates design, clearly expresses the algorithm’s intended behavior, and enables early verification and validation. Key design features supported include mechatronics component development using Simscape™ models and software component development using Model blocks.
Simulink PLC Coder™ generates IEC 61131-3 structured text that can be used for any distributed control system (DCS) and programmable logic control (PLC) system supporting the IEC standard. Additional optimizations are offered to target structured text to a variety of programming environments provided by leading industrial automation vendors. Generated structured text is suitable for rapid prototyping and application deployment on the PLC system.
Embedded Coder® generates embedded code from design models. The code can be used for system on-target rapid prototyping or embedded code deployment. With on-target rapid prototyping, you prototype algorithms on the existing (or emulated) production processors, saving hardware cost while improving execution fidelity. With embedded code generation, ANSI/ISO C or C++ is generated by default for any device. In addition, code is easily optimized for specific microcontrollers using flexible APIs. Integrating hand-written code during simulation or code generation is supported using the legacy code tool, preserving your software investment and enabling incremental adoption of code generation technology.
Processor-in-the-loop (PIL) and hardware-in-the-loop (HIL) testing form the cornerstone of industrial controls verification by automating test and comparison of software and system execution with the reference model behavior. Creating a PIL test environment is supported using Embedded Coder or direct connection to your processor boards. Simulink Real-Time™ enables hardware-in-the-loop testing on any PC by generating and executing real-time code from Simulink plant models. Bidirectional linking of model and code allows you to trace each line to every block and state in the model, aiding debugging and verification. Optional support for commonly used IDEs and processors is available using Embedded Coder. Finally, Polyspace® code verifiers let you examine generated or hand-written code for possible run-time errors and MISRA C-2004 code compliance.
Creating a PIL Environment (Example)
IEC 61508 is the primary safety standard for industrial controls. TÜV SÜD has certified Embedded Coder and Polyspace code verifiers, including MISRA C-2004 code analyzer, to IEC 61508. TÜV SÜD has also certified Simulink PLC Coder to IEC 61508 and its process automation industry adaptation IEC 61511. The TÜV SÜD certificates and certification reports are available in IEC Certification Kit. TÜV SÜD certifications are based on application-specific verification and validation workflows that are also provided in the IEC Certification Kit.
"Virtually 100% of the C code for the AC 800PEC controller is generated automatically. With this approach, what you simulate is what you execute. The generated code is error-free and precisely describes the algorithm defined with Simulink"Read the story