how simscape code generation differs from simulink -凯发k8网页登录

main content

how simscape code generation differs from simulink

in general, using the code generated from simscape™ models is similar to using code generated from regular simulink® models. however, there are certain differences.

simscape and simulink code generated separately

simulink coder™ software generates code from the simscape blocks separately from the simulink blocks in your model. the generated simscape code does not pass through model.rtw or the target language compiler. all the code generated from a single model resides in the same directory, however.

compiler and processor architecture requirements

to generate and execute simscape code, you must have a compiler and a processor that support:

  • 64-bit precision floating-point arithmetic defined by ieee® standard for floating-point arithmetic (ieee 754)

  • 32-bit integer size

for details on supported compiler versions, see

precompiled libraries provided for selected compilers

simscape software and its add-on products provide static runtime libraries precompiled for compilers supported by simulink coder software. for details, see

for all other compilers, the static runtime libraries needed by code generated from simscape models are compiled once per model during the code generation build process.

simscape code reuse not supported

reusable subsystems in simulink reuse code that is generated once from the subsystem. you cannot generate reusable code from subsystems containing simscape blocks.

tunable parameters not supported

a tunable parameter is a simulink run-time parameter that you can change while the simulation is running. simscape blocks do not support tunable parameters in either simulations or generated code. however, simscape run-time parameters, which are parameters you can modify at run time, but not during simulation, are available. for more information, see .

simscape run-time parameter inlining override of global exceptions

if you choose to enable parameter inlining for code generated from a simscape model, the software inlines all its run-time parameters. if you choose to make some of the global simscape block parameters exceptions to inlining, the exceptions are ignored. you can change global tunable parameters only by regenerating code from the model.

网站地图