Features

Generate C Code from a PLECS Model:

The PLECS Coder generates generic ANSI-C code from a PLECS Blockset or PLECS Standalone model. The code can be compiled to execute on the simulation host or a separate target, such as an embedded control platform or a real-time digital simulator. The model to be translated into code may be a physical system or control logic.

The PLECS Coder generates generic ANSI-C code from a PLECS Blockset or PLECS Standalone model. The code can be compiled to execute on the simulation host or a separate target, such as an embedded control platform or a real-time digital simulator. The model to be translated into code may be a physical system or control logic.

A typical application is hardware-in-the-loop (HIL) simulation, where real control hardware is connected to a virtual plant model simulated on a real-time simulator. This approach allows easy verification and validation of the control hardware and software without an expensive power stage.

Alternatively, the generated code can be compiled and executed on the host to reduce the simulation time of complex models.

Support of Simulink Coder

If you generate code for a Simulink model the PLECS Coder works hand in hand with the Simulink Coder® (formerly Real-Time Workshop). When the build process is started, PLECS automatically generates code for the circuit block and inserts it in the appropriate locations. In this mode, PLECS can generate code for two different targets: the Rapid Simulation target (or RSim target) and the Real-Time target. By default, PLECS automatically selects the correct target depending on the target settings of Simulink Coder.

Support

The platform of Hardware-in-the-Loop

The generated code can be applied to an instant platform compatible with Simulink, such as Opal-RT, dSPACE, and etc.

TI C2000 Target

The PLECS Texas Instruments (TI) C2000 Target Support Package supports code generation and External Mode operation for the TI 2806x, TI 2837x, and TI 28004x microprocessor (MCU) families. The TI C2000 Target component library includes blocks to model and program the MCU peripherals for sensing and actuation. Embedded control logic can be implemented using standard PLECS library components.