Simulink 模型的部署 [英] Deployment of Simulink Models

查看:31
本文介绍了Simulink 模型的部署的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在尝试了解如何部署 Simulink 模型.也有可能,也有问题.

I have been trying to find out how to deploy a Simulink model. There are possibilities and problems as well.

  • 如果我使用 Simulink Coder,如何在我的计算机上找到生成的代码?它作为文件或文件包保存在何处?
  • 我们可以将 Simulink 部署为 .NET 程序集吗?如果可以,我在哪里可以找到有关它的详细文档.
  • 还有其他方法可以独立使用我的 Simulink 模型吗?
  • If I use Simulink Coder how can I find the generated code on my computer? Where is it saved as a file or package of files?
  • Can we deploy Simulink as .NET Assembly? If we can, where can I find a detailed documentation about it.
  • Is there any other way to use my Simulink model standalone?

感谢您的努力.

推荐答案

  1. 默认情况下,所有代码都放置在当前目录中名为 ModelName_CodeTarget 的文件夹中,其中 ModelName 是您的模型的名称,CodeTarget 是您生成的特定类型的代码.(如果此文件夹不存在,则会在构建过程中创建.)

  1. By default all the code gets placed into a folder, in the current directory, called ModelName_CodeTarget, where ModelName is the name of your model and CodeTarget is the particular type of code you are generating. (This folder is created during the build process if it doesn't already exist.)

没有自动生成 .Net 程序集的机制.Simulink Coder 生成 C 代码;你用它做什么取决于你(就像用手写代码一样).请注意,该过程是完全可定制的,因此您可以创建自己的构建过程,以自动将 C 代码包装到程序集中(但这样做将是一种非常高级的操作).

There is no mechanism for automatically generating a .Net assembly. Simulink Coder generates C code; what you do with it is then up to you (just as it would be with hand written code). Note that the process is fully customizable, so you could create your own build process to autmatically wrap the C code into an assembly (but it would be a very advanced maneuvre to do this).

有几个 Simulink Coder 目标"可以生成独立的可执行文件.例如,GRT(通用实时)目标生成一个简单的 .exe 文件;RSIM 目标(快速模拟目标)生成一个 exe,您可以在其中指定不同的 .mat 文件,这些文件可用于为不同的模拟运行指定不同的模型参数,并将不同运行的结果存储到不同的输出 .mat 文件中.

There are a couple of Simulink Coder "targets" that generate standalone executable files. For instance, the GRT (Generic Real-Time) target generates a simple .exe file; the RSIM target (the Rapid Simulation Target) generates an exe where you can specify different .mat files that can be used to specify different model parameters for different simulation runs, and have the results of the different runs stored to different output .mat files.

通过查看 Simulink Coder 文档的前几章可以回答大多数这些问题.值得您花一些时间查看它以了解代码生成过程的工作原理.

Most of these questions are answered by looking at the early chapters of the Simulink Coder documentation. It would be worth you taking some time to look at it to get a feel for how the code generation process works.

这篇关于Simulink 模型的部署的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆