LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Connecting Simulink Circuit to LABview Controller

Solved!
Go to solution

I'm trying to use my LABview VI to control switches in a Simulink model. I'm not sure how to accomplish this task, but right now I'm trying to establish a connection between the two. 
I have LABview 2015 and MATLAB 2011.
After Googling how to connect a Simulink model to LABVIEW, I found the following methods:

1. Using the Model Interface Tool (MIT)

2. Using the Controls and Simulation Toolkit to convert a Simulation Model into LABVIEW

 

1. I downloaded MIT and Veristrand and followed the steps in this link: http://zone.ni.com/reference/en-XX/help/374160A-01/vsmithelp/mit_convert_model_to_dll/
But I'm not sure where to go from there.  Most tutorials I found were using the SIT

 

2. The Simulink components aren't recognized in LABVIEW and are just empty boxes. 

 

Question: What's the best way to connect the Simulink model with LABview? 

Download All
0 Kudos
Message 1 of 4
(5,129 Views)
Solution
Accepted by topic author oreo22

Hello,

 

This seems closely related to this one.

 

Both methods can be used but both require a few considerations.

 

For the Model interface Toolkit you need to mind what functions you use. Please take a look at this.

 


"In the Simulink software, you can convert models that use only a fixed step-size ordinary differential equation (ODE) solver into compiled models. Additionally, you must turn off data logging in the Simulink application software."

 Please refer to the following as well.

 

http://zone.ni.com/reference/en-XX/help/374160B-01/vsmithelp/mit_model_from_mdl/

 

http://zone.ni.com/reference/en-XX/help/374160B-01/vsmithelp/mit_model_support/

(same I linked above)

 

http://zone.ni.com/reference/linksen-XX/help/374160B-01/vsmithelp/mit_models_mdl/

 

http://zone.ni.com/reference/en-XX/help/374160B-01/vsmithelp/mit_convert_model_to_dll/

(this is the one you linked yourself, just want to bring that the model needs to be a dll to work with the Model Interface Toolkit)

 

http://forums.ni.com/t5/LabVIEW/importing-matlab-model-file-to-labview/td-p/883625

(the post mentions the "SIT" which is not the Model Interface Toolkit)

 

The last one brings something about the Control Design & Simulation method: the model needs to be an mdl file in order for the Simulation Model Converter to work.

 

http://www.ni.com/white-paper/11281/en/

 

(this link is from LabVIEW 2012, but it is still valid on later versions)

https://zone.ni.com/reference/en-XX/help/371894G-01/lvsim/sim_simtrans/

 

Hope it helps.

 

MATLAB® and Simulink® are registered trademarks of The MathWorks, Inc.

 

Regards,

Camilo V.
National Instruments
Message 2 of 4
(5,092 Views)

Yes, the posts are related. Thanks so much for the help and links!

 

Out of curiosity,  I switched to the MIT method because when I tried to import .mdl into the Simulation Model Converter, I get the result in the image.

SimPowerSystems aren't on the unsupported Simulink blocks  list, so am I doing something wrong or are they unsupported? 

 

 

0 Kudos
Message 3 of 4
(5,071 Views)

Glad the information helps.

 

About the error, I cannot be sure without knowing what the model uses, but there are some partially supported and some totally unsupported blocks from Simulink®. My first though was that maybe some of those are the cause of the Simulation Model Converter to fail. Please find more details information here.

 

Regards,

 

Camilo V.
National Instruments
0 Kudos
Message 4 of 4
(5,062 Views)