cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Did you get called away in the middle of writing a post? Don't worry you can find your unfinished post later in the Drafts section of your profile page. X

How to integrate Simulink with Integrity Modeler

jgrabowski
1-Newbie

How to integrate Simulink with Integrity Modeler

Hello !

I'm searching for a method how to integrate Simulink with Integrity Modeler. I'm working with Simulink synchronizer, but there is always a mistake:

''An error occurred whilst interfacing with Simulink.

'  0×0 empty char array' is not a valid model name because it is not a valid MATLAB function name.  ''

Can someone help me and show a simple example how to integrate Simulink with Integrity Modeler?. ( tutorials e.t.c)

Regards

John

11 REPLIES 11

Hello,

Have you reviewed the Help topic "Integration for MATLAB Simulink"?

There's lots of information on setup and how to use the integration.

I would also check the Modeler Release Notes (Support for Third Party Products) and confirm you are using a supported version of Simulink.

If there is still a specific issue, you should log a call with PTC Support.

regards,

Patrick

There is an example Simulink model provided in the Examples repository called "Speed Controller". Recommend you use the model provided with Modeler 8.3 M020 (also called 8.3b). You will need Visual Studio and obviously Simulink installed to run. View the Readme inside the model for more information and refer to the Help.

Hopefully this will help you get started.

regards,

Patrick

Hello !

Unfortunately i was not able to solve the problem. In this post i will try to present it by screens.

1. First we have the speed controller block diagram.

1 speed controler.PNG

2. In the second step i have opened speedometer

In this ibd  tools-->simulink synchronizer-->synchronize.

2 speed controler.png

3.  In the 3. step will be given the mapping name  and the synchronization direction from integrity modeler to simulink.

speed controler 3.PNG

4. Mappings

speed controler 4.PNG

5. At this point there is the first problem. Integrity modeler does not recognize the integrity and simulink data type. I don't know why.

speed controler 5.PNG

6. Unfortunately always appears this error. I can only create  empty mdl ord slx file.

speed controler 6.PNG

I would be very grateful if you could provide me with some answers for my abovementioned problems.

I'm looking to forward to hearing with you.

Regards

John

jklostermann
5-Regular Member
(To:jgrabowski)

I do see exactly the same behavior.

And it does not matter if I want to sync Simulink Blocks into Modeler or vice versa. Following exactly the guidelines in the Modeler help.

I use Modeler 8.3.18 (with Patches 8.3a and 8.3b) and Matlab/Simulink 9.1.0.441655 (R2016b).

According to the Modeler Release notes (found as rtf file via the Modeler Help) Modeler 8.3 is tested with 2016a and supports 2006b or later.

-> Therefore this should not be the problem.

To try the SpeedControler example I am missing the VisualStudio installation. Therefore it is unfortunately not available to me.

Any help to get the Modeler-Simulink sync running would be most welcome.

jklostermann
5-Regular Member
(To:jklostermann)

Here another way to reproduce the described error (using my setting from above):

In Modeler:

  • Create a new model with Simulink and SysML profiles
  • Create a new package
  • in this package create a SysML block "Test"
  • create an ibd for that SysML block

Now in Simulink:

  • Create a new Simulink model, e.g. select Feedback Controller Model from the provided templates
  • Save it as FeedbackController.slx and Close it.

Back in Modeler:

  • right-click in the empty space on the empty ibd in the diagram pane > Tools > Simulink Synchronizer > Synchronize...
  • Then within the Sync Tool:
    • Create a new mapping:
      • give it a name,
      • leave the preselected "Simulink SysML Internal Block Diagram Mapping",
      • choose the just created FeedbackController.slx in the Simulink model selection
      • set "Simulink > Integrity Modeler"
      • click "Next"
    • approve the auto-settings of the object type mapping by clicking "Next"
    • approve the (empty) data type mapping by clicking "Next"

After a moment of processing the above mentioned error occurs:

An error occurred whilst interfacing with Simulink.

'  0×0 empty char array' is not a valid model name because it is not a valid MATLAB function name.

The same result, if you choose on the first page of the tool to create a fresh Simulink model by using the create button.

I hope this helps to reproduce the error and find the mistake.

If wanted I can also provide the files that came up with this procedure.

Help is still highly appreciated.

Jan

hi Jan,

 

Unfortunately in our recent testing we discovered some changes introduced into Simulink 2016b and 2017a that stop our integration working correctly. So we recommend using 2016a if possible for now. Sincere apoloiges we haven't realised this and informed you earlier. We will be looking at fixing these isses and supporting the newer versions of Simulink in a future release.

 

regards,

Patrick

Hi Patrick,

thanks a lot for letting me know!

It is always helpful to know that it does not make sense to try further. Saves time and thought...

Looking forward to the fix in the future (hopefully: next) release.

 

But there is something left: I do have Matlab/Simulink 2015b available as well (parallel install) and exported the model to be saved for that version. Unfortunately that alone does not help, as I did not find a way to tell the Simulink-Synchonizer which version of Matlab to use when he starts the tool. He apparently takes the Windows default (Matlab 2016b), which I do not want to move to the old version (to avoid messing up with my other activities). Simply changing the standard applications allocated in Windows to the file name extensions .m, .slx, .sltx, .sldd, .mdl to the installation of the old Matlab 2015b did not help, anyway.

 

Is there a way to tell the synchronizer the path to the Matlab-Version to use? Maybe through a tweek of the vbs-files that the simulink profile invokes (to avoid the need of an update of "MathematicalHelper.dll" (which contains the Starter/Wrapper-Code of the Synchronizer, if I get it right), or the MathematicalModelSynchronizer.exe itself?

 

All the best

Jan

jklostermann
5-Regular Member
(To:jklostermann)

The trick to tell the Simulink synchronizer which Matlab version to use is simple, if you know the mechanics 😉

This is what I learned from support: The synchronizer uses the Matlab automation server registration to start Matlab. Therefore the Matlab version you want to use needs to be the registered Matlab automation server. By default this is the last Matlab version you installed. It remains registered until you manually change the registry or install a new version of Matlab.

To manually change the registration you need administrator privileges, as the windows registry needs to be changed. Then you have 2 ways: as administrator from the Windows command line or the Matlab command line.

Windows CLI: call the matlab version want to register with the parameter -regserver: C:\<matlabpath>\bin\matlab.exe -regserver

Matlab CLI (matlab started as administrator): regmatlabserver

The full story of changing the Matlab automation server registration you find at: https://de.mathworks.com/help/matlab/matlab_external/register-matlab-as-automation-server.html

 

After doing this for my Matlab 2015b installation it stopped using my Matlab 2016b installation and I came past the described error and I was able to synchronize!

Integrity Modeler 8.5 has recently been released and now supports Simulink 2017a.

 

regards,

Patrick

Hi,

 

In Modeler 8.4 we will supply step-by-step instructions for running a simulation with the Speed Controller example model.

 

regards,

Patrick

Hello,

 

You can now use the integration with Phoneix Integration ModelCenter to integrate with Simulink.

You can find details in the Help, and also some demos on our YouTube channel:

 

https://www.youtube.com/watch?v=mm0bdIFyHWk

https://www.youtube.com/watch?v=FuvLIIkiRnU

 

regards,

Patrick

Top Tags