04-20-2010 11:58 AM
hi ,
I have Simulink model using Realtime Windows Target ( Matlab) to creat host and target in the same computer.
I use Labview to creat HMI for it and I use Simulation interface toolkit ( 5.0 ) to communicate with simulink model.
My problem is : Control in Labview acts correctly but Indicator does not act. Indicator didnt get value from Simulink model.
I try some solutions for example : turn off Block Reduction and Signal Store Reuse , add more Gain block in model .
However ,it is not successful.
Please help me. Thanks a lot !
04-21-2010 10:13 AM
Hi namsvmore,
Have you tried to use the sinewave example from the NI Example Finder (Help»Find Examples...»Toolkits and Modules»Simulation Interface, or C:\Program Files\National Instruments\LabVIEW 8.6\examples\Simulation Interface).
Are you following all of the steps here to create your UI? http://zone.ni.com/reference/en-XX/help/371504E-01/lvsithowto/sit_h_creating_a_host_vi/
04-21-2010 12:41 PM
Thanks for your reply,
I followed these step. The signal can be loaded by indicator in labview.
However it only runs when I choose normal mode in Simulink.
In my case , I used Simulink model in Realtime window target with external mode, and it didnt run.
Please run my attach file for more detail about it
Thanks so much!
04-22-2010 05:15 PM
Hi namsvmore,
I need to double check, but I don't think that will work. I think you have to build the .mdl into a .DLL file and then you can use SIT to interface with the model.
Check here for more information: http://zone.ni.com/reference/en-XX/help/371504E-01/lvsithowto/sit_h_convert_model_to_dll/
04-25-2010 04:48 AM
Hi Smootastic ,
As I know , when I build .mdl to .dll file and use SIT to interface with model , It runs the without .mdl file.
I dont think It can run external mode when I use .dll file.
In my case , I want to change parameter in mdl file to using for Realtime windows target.
Do you have any solution for this problem ?
Thanks a lot !
04-26-2010 05:16 PM
Hi namsvmore,
Did you make sure to use nidll.tlc in the Simulation parameter?
04-26-2010 10:51 PM
Hi Smootastic ,
Base on my experience , there are two ways to comunitcate with simulink model use Labview Simulation Interface.
The first way : build mdl file use nidll.tlc in the Simulation parameter, creat dll file and add the dll file into Labview Simulation Interface ( SIT manager ) and runs Simulation without runs mdl file in Simulink
The second way : adds directly mdl file into Labview Simulation Interface ( SIT manager ) ands run labview and mdl file in simulink at the same time.
In my case , I used Realtime Windows Target ( Matlab) to creat host and target in the same computer. I have to build mdl file using rtwin.tlc in the Simulation parameter to connect my Simulink model to real-time application.
My purpose is using Labview to creat interface and tranfer data between Labview and mdl file .
The realtime application is the task of Realtime Windows Target ( not relate to labview )
It can be described by following :
Labview <-> data <-> mdl file
mdl file <-> data <-> target ( created by Realtime Windows Target )
there are 2 independent loops .
For these reasons , I used the first way: use mdl file ( not dll file )
and my problem is I got error when tranfering data from mdl file to labview.
Thanks so much!
04-28-2010 10:51 AM
Hi namsvmore,
Like I said, I'm pretty sure that the only way you can get this to work is either by using the Normal mode or compiling the DLL using nidll.tlc. I will double-check and see if this is any different.