PXI

cancel
Showing results for 
Search instead for 
Did you mean: 

SIT: Matlab's inlined parameters: Simulation Environment & Remote Target

Solved!
Go to solution

Hi all,

 

When I inline parameters in a Simulink model,and when I run it into the SIT's Simulation Environment, it's like if they wouldn't have been inlined. Every block of the model appears.

 

And when I try to run it on a remote target (PXI RT Controller), the blocks which don't interrest me are present, while the constants I put in the workspace have disapear.

 

Any suggestion,  please? 😛

 

Thanks,

 

Hugues

0 Kudos
Message 1 of 14
(3,924 Views)

Hi Hugues,

 

 Could you provide your code or a screentshot of the simulink model so I can get a better idea of whatyou are asking.  Please tell me exactly what in that code is not working correectly.  Thanks you.

Chris Bakker
SET Americas
CEO

0 Kudos
Message 2 of 14
(3,908 Views)

Hello Chris (!),

 

Bellow is the model. The schematic is horrible because of conversions 'losts' between R2009a and R2008b. However, it's working well...

 

model.png 

 

I also have a parameter initialisation  script which look like this...

 

parameters.png 

 

What is not working?

 

Look at my SIT mappings when I use the Simulation Environment:

simulationenvironment.PNG 

 

Then compare with when I select the real time target (with the proper compiled dll). 

 

realtimetargetmappings.PNG 

 

My car speed port disappeared!

 

0 Kudos
Message 3 of 14
(3,902 Views)

Hi uG,

 

What version of SIT are you using?  This process is simplified in the newer version of SIT which has the SIT connection manager.  In anycase, it looks as if the model being compled in the .dll is completely different than the one being run in simulation.  Not only have some of your I/O nodes disappeared.  Other ones that are not in the screenshot have cropped up.   What do you mean that your .dll is properly compiled?

Chris Bakker
SET Americas
CEO

0 Kudos
Message 4 of 14
(3,892 Views)

Hello again Chris,

 

I'm using 5.0.1, is there a newer release? I do use the SIT connection manager.

 

I had previously problems with the compiling process. However I fixed them. And, now, the dll pass the dll checker test.

 

Thanks 

0 Kudos
Message 5 of 14
(3,890 Views)

Hi uG, take a look at this link.  It explains how to fix invalid mappings and make inline parameters work when simulink is being uncooperative.  Pay particularly close attention to the part that discusses attaching test points to IO nodes that you want to use as inline.

 

http://zone.ni.com/reference/en-XX/help/371504C-01/lvsimtkconcepts/sit_c_creating_mappings/

 

 

Chris Bakker
SET Americas
CEO

0 Kudos
Message 6 of 14
(3,861 Views)

Hello Chris,

I tried disabling Signal Storage Reuse, Block Reduction Optimization and Inlined Parameters. I also tried checking the Test point checkbox. No luck. The document you were reffereing to was reffering to the Simulink documentation about linked and masked subsystems. Do you know exacltly which "document" should I read? :-S I'm using some Simscape / SimPowerSystems blocks that use some type of mask.

Thanks, once again.

0 Kudos
Message 7 of 14
(3,858 Views)
The documetn is the Simulink Documentation on those topics.  I do not know exactly what page or book they are talking about.  I would just search the Mathworks site.
Chris Bakker
SET Americas
CEO

0 Kudos
Message 8 of 14
(3,839 Views)

The screenshot you gave is of mapping a indicator.  When you map an indicator you map it to signals of the model.  If you want to map to a parameter you should use a control (either place a new one, or right-click the indicator and choose Change to Control).  Inlining parameter does not affect signals, which is why you are not seeing a difference based on this option.  Inlining paramters does affect the parameters you see when mapping a control.  Instead of seeing the hierarchy of blocks and parameters, you will just see the tunable variables.  That is if you have a gain block with a gain of "a+b".  If you don't have your parameters inlined you can change the gain value of the block.  If you inline the parameters and make a and b tunable, then you can set the variables a and b.

 

Carl L

National Instruments

0 Kudos
Message 9 of 14
(3,820 Views)

Hi Carl,

Thank you for the awesome explanation. I now understand the inline parameter option.

Sadly, it doesn't solve my problem: I wanted to map some variables (vehicle speed, voltage, current, ...) with indicators, and... they don't appear in the compilled dll's hierarchy. I tried disabeling some optimisation options Chris recommanded me, without any success. Any suggestion?

0 Kudos
Message 10 of 14
(3,818 Views)