Real-Time Measurement and Control

cancel
Showing results for 
Search instead for 
Did you mean: 

Error with Simulation Toolkit

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 !

0 Kudos
Message 1 of 8
(4,287 Views)

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/ 

0 Kudos
Message 2 of 8
(4,275 Views)

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!

0 Kudos
Message 3 of 8
(4,269 Views)

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/

0 Kudos
Message 4 of 8
(4,254 Views)

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 !

 

0 Kudos
Message 5 of 8
(4,239 Views)

Hi namsvmore,

 

Did you make sure to use nidll.tlc in the Simulation parameter? 

0 Kudos
Message 6 of 8
(4,218 Views)

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!

0 Kudos
Message 7 of 8
(4,203 Views)

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. 

0 Kudos
Message 8 of 8
(4,180 Views)