从simulink模型创建DLL以与Visual Basic一起使用 [英] Creating a DLL from a simulink model for use with Visual Basic

查看:418
本文介绍了从simulink模型创建DLL以与Visual Basic一起使用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是matlab/simulink的新用户,我正在Windows下的独立应用程序中工作,在该应用程序中,将使用Visual Basic创建一个接口,其中将包含一个simulink模型.

我试图用matlab/simulink创建一个DLL以便与Visual Basic一起使用,这确实令人困惑.我不知道是否要使用实时工作室,C编译器或COM对象才能在VB中使用simulink模型并与之交互.

如果您能帮助我,我将不胜感激.在此先感谢您阅读我的文章并为我提供帮助.

I am a new user in matlab/simulink, and I''m working on a stand-alone application under Windows, where an interface will be created with Visual Basic and which will include a simulink model.

I''m trying to create a DLL with matlab/simulink in order to use it with Visual Basic, it''s really confusing. I don''t know whether to use a real time workshop or the C compiler or a COM object in order to use a simulink model in VB and interract with it.

I''ll be grateful if you can help me with this. Thanks in advance for reading my post and helping me.

推荐答案

如果您使用的是VB6而不是VB.NET,则COM对象可能是最简单的途径.您将IDL定义为ole自动化对象,而不仅仅是Dispinterface.自动化接口对象支持早期绑定,这使得在VB6中使用它相当容易.
如果您使用的是VB.Net,则通过^ ]提供的方法仅需要相对简单的参数(也可以处理诸如结构之类的复杂参数,但学习曲线还多一些.
The COM object is likely to be the easiest route if you are talking VB6 instead of VB.NET, provided you define the IDL as a ole automation object and not just a dispinterface. An automation interface object supports early binding, which makes it reasonably easy to work with in VB6.

If it''s VB.Net you are using, then a C style DLL with exports would be fairly easy to use via PInvoke[^] provided the metods needed required only relatively simple parameters (complex parameters like structures can also be handled, but there is a bit more learning curve.


感谢您的帮助,但有谁知道该如何做吗?为了在VB中使用simulink模型中的simulink模型创建com对象?
Thanks for help but did any one know how to create com object from a simulink model under matlab in order to use it in VB?


这篇关于从simulink模型创建DLL以与Visual Basic一起使用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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