01-24-2006 02:08 AM
Hello,
I'm using the Simulation Interface Toolkit 3.0 because I want to control a Simulink model in LabVIEW 7.1. For instance, I want to generate a sine wave using a constant block. In this manner I can provide to my Simulink model every kind of signal without changes in it.
To perform this task Simulink needs an input value at each integration step.
I would to know if this task is achievable and if someone could tell me something about the communication between LabVIEW and Simulink.
Thank you for your help!:smileywink:
01-24-2006
07:08 PM
- last edited on
09-10-2025
10:30 AM
by
Content Cleaner
01-25-2006 07:13 AM
Hi AlessioD,
thanks for your help, now I'm going to describe my task:
I need to drive a Simulink vehicle model from LabVIEW. I want to change model parameters (and this is very simple with SIT!) but also provide input signals to my model (for example the steering wheel angle, the driver reference speed, ecc...). In this way I don't need to generate the time histories inside the model but outside in LabVIEW. Therefore I should transmit this input data from Labview to Simulink every integration step. How can I perform this task? Is there another way to feed inputs of a Simulink model?
Now I'm running a model as .mdl but I think that as soon as possible I will run it as DLL. In fact the next step of my work is to run the vehicle model in real-time on a target PC (Desktop) by means of LabVIEW RT module.
Now my target is to work only on my PC in no real-time conditions. How can I run my model as DLL on my PC?
01-25-2006
11:04 AM
- last edited on
09-10-2025
10:32 AM
by
Content Cleaner
ok,
Here you will find a nice tutorial on creating a DLL from a simulink model and running it in LabVIEW.
As for passing data into the model from LabVIEW, I will try to come up with an example that shows how to do it.
AlessioD
02-16-2006 06:36 AM
02-16-2006 07:38 AM
Hi Magic,
I believe the best way to clarify your doubts about those 2 products is that you call us so that we can better explain what features are available and what solution would best fit your expectations.
Make sure you contact NI Italy at
02 41309277 (Milan),
06 520871 (Rome)
or by submitting a request via email through
providing all the details necessary for our sales representative to get back to you as quick as possible.
Thanks,
AlessioD
03-13-2006
06:36 AM
- last edited on
09-10-2025
10:33 AM
by
Content Cleaner
Hi Alessio,
Maybe you have the solution to my problem:
I have a Simulink model that works with a LabVIEW VI using the Simulation Interface Toolkit and the SIT server.
In order to use this model and this VI without Simulink, I created a dll (nidll) of my Simulink model like shown in the following manual:
https://www.ni.com/docs/en-US/bundle/370420b/resource/370420b.pdf
By doing so, LabVIEW automatically created 6 VIs that should work with my model DLL.
My questions are:
- Can I use the VI that I previously made for my Simulink model with the model dll ?
- If yes, How ?
- If no, How can I use my model dll and these new VIs?
Thanks in advance.
03-13-2006
07:17 AM
- last edited on
09-10-2025
10:34 AM
by
Content Cleaner
Hi,
when you have compiled your model into a DLL, the straightforward option is to deploy the DLL onto a Realtime Target and use it through the VIs that got created.
Also, you have the option of using your Windows machine as a Target for the DLL.
HERE you will find the necessary instructions for running the DLL on Windows without the need for Simulink to be installed or running.
Regards,
AlessioD
03-13-2006 08:30 AM
Thanks a lot Alessio !
I choose to use Windows as a target for the dll so I checked out the document you showed me and I'm happy to say that it finally works!
That's a big relief!
However, when I run the "model_main.vi" (created with dll), the computer's processor works at 100% and that causes trouble when I want to run my own VI.
So, Alessio, if you have another trick in your sleeve that could solve my problem, my work will be kinda done.
Thanks.
03-14-2006
12:53 AM
- last edited on
09-10-2025
10:34 AM
by
Content Cleaner
Hey,
I am glad it works. Unfortunately, the 100% CPU usage is an expected behaviour, and it is due to the SIT Server running on Windows. The Server was actually meant to be run on RT at low priority and the OS there let it sleep. When it comes to windows, the server is not sleeping even if it is running at low priority. What I would expect is to see a 100% CPU usage that is not hogging the machine. If it is indeed hogging the CPU, I suggest you get in touch with our Technical Support (www.ni.com/ask) to see if they have any other solution to this issue.
Regards,
AlessioD