Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Epsilon » Creating a Simulink Model From Epsylon(Matlab Session connection error while trying to recreate the example of "Creating a Simulink Model From Epsylon")
Creating a Simulink Model From Epsylon [message #1797868] Wed, 07 November 2018 16:47 Go to next message
math bisky is currently offline math biskyFriend
Messages: 3
Registered: November 2018
Junior Member
Hello Everyone,

I am fairly new to the Epsilon project and thus may ask a few stupid questions...
I therefore want to apologize in advance!

I want to assert the feasibility of creating a Simulink from Epsilon, following the example given in the following link:
https://www.eclipse.org/epsilon/doc/articles/simulink/
As well as for setting the EOL preferences paths towards Matlab's path (java engine and bin/win64...):
https://www.eclipse.org/epsilon/doc/articles/simulink-stateflow/

I am using Matlab/Simulink R2017a
I downloaded Eclipse from the link: https://www.eclipse.org/epsilon/download/, and as advised on page updated the various plugins...


The "EOL" script I am using is the same as the one given in the example ( enclosed below)

The error message I have is :

Internal error: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0[Native Method]
at sun.reflect.NativeMethodAccessorImpl.invoke[Unknown Source]
at sun.reflect.DelegatingMethodAccessorImpl.invoke[Unknown Source]
at java.lang.reflect.Method.invoke[Unknown Source]
at org.eclipse.epsilon.emc.simulink.engine.MatlabEngine.<init>[MatlabEngine.java:49]
at org.eclipse.epsilon.emc.simulink.engine.MatlabEnginePool.getMatlabEngine[MatlabEnginePool.java:79]
at org.eclipse.epsilon.emc.simulink.model.SimulinkModel.loadModel[SimulinkModel.java:104]
at org.eclipse.epsilon.eol.models.CachedModel.load[CachedModel.java:253]
at org.eclipse.epsilon.emc.simulink.model.SimulinkModel.load[SimulinkModel.java:346]
at org.eclipse.epsilon.eol.dt.launching.EclipseContextManager.loadModels[EclipseContextManager.java:179]
at org.eclipse.epsilon.eol.dt.launching.EclipseContextManager.setup[EclipseContextManager.java:89]
at org.eclipse.epsilon.eol.dt.launching.EpsilonLaunchConfigurationDelegate.launch[EpsilonLaunchConfigurationDelegate.java:84]
at org.eclipse.epsilon.eol.dt.launching.EpsilonLaunchConfigurationDelegate.launch[EpsilonLaunchConfigurationDelegate.java:68]
at org.eclipse.debug.internal.core.LaunchConfiguration.launch[LaunchConfiguration.java:859]
at org.eclipse.debug.internal.core.LaunchConfiguration.launch[LaunchConfiguration.java:717]
at org.eclipse.debug.internal.ui.DebugUIPlugin.buildAndLaunch[DebugUIPlugin.java:1039]
at org.eclipse.debug.internal.ui.DebugUIPlugin$8.run[DebugUIPlugin.java:1256]
at org.eclipse.core.internal.jobs.Worker.run[Worker.java:60]
Caused by: com.mathworks.engine.EngineException: Unable to connect to MATLAB session "MATLAB_11084".
at com.mathworks.engine.MatlabEngine.connectMatlab[MatlabEngine.java:263]
at com.mathworks.engine.MatlabEngine.connectMatlab[MatlabEngine.java:242]
... 18 more
Hello Worlds
Type 'simulink/Sources/Sine Wave' not found
at (C:\...\ECLIPSE\eclipse\workspace\Epsilon_testing\test01.eol@7:20-7:48)
at (C:\...\ECLIPSE\eclipse\workspace\Epsilon_testing\test01.eol@7:15-7:48)
at (C:\...\ECLIPSE\eclipse\workspace\Epsilon_testing\test01.eol@7:0-7:49)
at (C:\...\ECLIPSE\eclipse\workspace\Epsilon_testing\test01.eol@4:0-31:23)
at (C:\...\ECLIPSE\eclipse\workspace\Epsilon_testing\test01.eol@4:0-31:23)


Also running matlab /simulink scripts from python or java is fine...


Does anyone have any idea as to how to fix that?
I am stuck here...

Thanks in advance,

Math



  • Attachment: test01.eol
    (Size: 0.85KB, Downloaded 98 times)
Re: Creating a Simulink Model From Epsylon [message #1797923 is a reply to message #1797868] Thu, 08 November 2018 15:24 Go to previous messageGo to next message
Athanasios Zolotas is currently offline Athanasios ZolotasFriend
Messages: 52
Registered: November 2016
Location: York
Member
Hi Math,

Welcome to the Epsilon's world. Yes, you're able to create Simulink/Stateflow models from Epsilon.

Regarding the error you get, do you run this on Windows? In Windows, on top of adding the 2 paths to plugin preferences you also need to make sure that you have added Matlab engine to the PATH in the environment variables. You should have something like the following:

http://i65.tinypic.com/2nhq169.png

If you have already done this or you're on Mac OS/Linux we need to investigate further. Please let us know if the above fixes the problem.

Regards,
Thanos


[Updated on: Thu, 08 November 2018 17:29]

Report message to a moderator

Re: Creating a Simulink Model From Epsylon [message #1797982 is a reply to message #1797923] Fri, 09 November 2018 14:08 Go to previous messageGo to next message
math bisky is currently offline math biskyFriend
Messages: 3
Registered: November 2018
Junior Member
Hello Thanos

thank you for your reply,

Indeed I am working on Windows OS.

I already added the following paths in the "PATH" environnement variable:

- C:\Program Files\MATLAB\R2017a\bin
- C:\Program Files\MATLAB\R2017a\bin\win64

I am afraid it is a bit more complicated than just that:

The following line is extracted from the error message :
Caused by: com.mathworks.engine.EngineException: Unable to connect to MATLAB session "MATLAB_10688".

The way I understand the error message is that the eol script get that there is a matlab engine running But cannot connect itself to it. But I could be wrong!!
Also I tried to set the matlab engine as a shared engine using the command matlab.engine.shareEngine in the current matlab console, only one session being opened on the computer).


I switched Kasperky off also!

Re: Creating a Simulink Model From Epsylon [message #1797984 is a reply to message #1797982] Fri, 09 November 2018 14:22 Go to previous messageGo to next message
Athanasios Zolotas is currently offline Athanasios ZolotasFriend
Messages: 52
Registered: November 2016
Location: York
Member
Hi Math,

As you said the error you receive has to do with Epsilon not being able to connect to the running engine. One of the reasons could be not having the appropriate variables set in the PATH. However, I remember I faced this problem once in the past and the only solution that worked for me was to re-install MATLAB. This should be the last solution, so before suggesting that I would like to see if there's possibly anything else wrong in your configuration.

- Could you please sent us a screenshot of your run configuration?
- Have you tried creating a new blank simulink project (.slx file) and then point to this file in the run configuration (remember to check the "Read on load" option)?

Regards,
Thanos

[Updated on: Fri, 09 November 2018 14:23]

Report message to a moderator

Re: Creating a Simulink Model From Epsylon [message #1798316 is a reply to message #1797984] Thu, 15 November 2018 09:44 Go to previous messageGo to next message
math bisky is currently offline math biskyFriend
Messages: 3
Registered: November 2018
Junior Member
Hello Thanos,

I am not sure of what you mean by "run configuration",

however I enclosed a picture debug02-epsilon.png, in which you can see that I do not read the slx file on load.

I also tried with an the empty slx file named and place accordingly to specified details in the "Configure Simulink Model" .

Regards,
Math

Re: Creating a Simulink Model From Epsylon [message #1798319 is a reply to message #1798316] Thu, 15 November 2018 10:06 Go to previous message
Athanasios Zolotas is currently offline Athanasios ZolotasFriend
Messages: 52
Registered: November 2016
Location: York
Member
Hi Math,

The attached screenshot is the run configuration I was looking for. Thanks.

Although your program should be able to execute with the run configuration you attach, I will ask you to try the following one:

http://i63.tinypic.com/2lsk58l.png

As I said your current configuration is not wrong but if the one attached makes your script run it will help is us identify the possible reason because your current one is not working.

Also, just to confirm, could you please in our Eclipse go to Help --> About --> Installation Details and provide us with the version number for the Epsilon Simulink Integration plugin (e.g., 1.5.0)

Regards,
Thanos
Previous Topic:run haetae
Next Topic:Run Etl
Goto Forum:
  


Current Time: Fri Apr 26 00:08:42 GMT 2024

Powered by FUDForum. Page generated in 0.03465 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top