Вы находитесь на странице: 1из 6

1/27/2020 How do I link Simplorer to Simulink - MATLAB Answers - MATLAB Central

MATLAB Answers

How do I link Simplorer to Simulink

Follow
75 views (last 30 days)

Tarun on 26 Oct 2014


Answered: Saeed H. Ebrahimi on 23 Apr 2018 •
Vote
0

I am trying to link my simplorer motor circuit with my simulink controller. As mentioned in Simplorer help, when I introduce a s-function
block with name "AnsoftSFunction", I should get a simplorer link assignment block like this:

https://www.mathworks.com/matlabcentral/answers/160102-how-do-i-link-simplorer-to-simulink 1/6
1/27/2020 How do I link Simplorer to Simulink - MATLAB Answers - MATLAB Central

But nothing actually happens. When I click on the edit button of the block, I get this message

https://www.mathworks.com/matlabcentral/answers/160102-how-do-i-link-simplorer-to-simulink 2/6
1/27/2020 How do I link Simplorer to Simulink - MATLAB Answers - MATLAB Central

I have tried finding this AnsoftSFunction.tlc file but I couldn't find it anywhere. Please help.
 0 Comments

Sign in to comment.

Sign in to answer this question.

 Answers (4)

Georg Schmidt on 4 Mar 2016



Vote

https://www.mathworks.com/matlabcentral/answers/160102-how-do-i-link-simplorer-to-simulink 3/6
1/27/2020 How do I link Simplorer to Simulink - MATLAB Answers - MATLAB Central
3

• Link

I had the same issue and solved it that way:


1. You need administrator rights!! Make sure!!

2. You need a compiler running in Matlab. Check with mex –setup. If you don't have one already, install it.

3. Set the Matlab path in Simplorer: Tools –> Options -> General Options - > MiscellaneousOptions -> MATLAB Optimization set the
MATLAB path.

4. Set the Ansys Path in MATLAB: In Environment -> Set Path -> Add C:\Program Files\AnsysEM\AnsysEM16.2\Win64\cpl\matlab\r2014

5. In Matlab create your model with an s-function called “AnsoftSFunction” , now you get that dialog from the manual.

6. In the link assignment area add as many Inputs and Outputs you need (the little button with the yellow flash). Select One SIMULINK
IN and one SIMPLORER OUT then press link.

7. Press OK and and s-function with as many inputs and outputs you selected will be created. Build your Simulink model and save as
*.mdl

8. Now go to Simplorer and create Simulink Subcircuit: Simplorer Circuit -> Subcircuit -> Add Simulink Component… Select Read link
information from the file. Connect to the simulink model you just created. Little button with three dots. Wait until all inputs and outputs
are loaded. Select the Pin option for all inputs and outputs then press OK.9. Design your Simplorer circuit and save it. Then switch
back to Simulink. In Simlink double click the s-function block. Select link information from file. Select the simplorer file you just
created. Then press OK

Now both models are connected. There are a couple of more things you need to take care of, like simulation times and solvers. But you will
figure that out yourself.
 2 Comments

Charles on 25 Jul 2016



Hello Georg, Thank you for your help,
When I followed your steps, I have this error in Matlab at step #5: "Error: A MATLAB string constant is not terminated properly.
Error: A MATLAB string constant is not terminated properly." I get the dialog box but then, even if I enter the I/O for the cosimulation, I get
the same error followed by the error window below, when I press OK:

Any idea how to correct this? 'BLDC_1ph_2014_rel2sdigmes/CHOPP-4Q SimPower' is the place where I insert the S-function in Simulink.
Thanks

Kevin Bachovchin on 26 Feb 2018



@Georg, Thanks for your helpful step-by-step solution. Could you please clarify what you mean by taking care of the simulation times and
solvers? Should the time step and solver be set to be the same in both Simplorer and Simulink, or do you mean something different?
I am able to successfully link Simplorer and Simulink and run from either Simplorer or Simulink without getting any errors. However, the
value being read in Simplorer from Simulink is coming out as all zeros. I'm thinking this might be happening due to a problem with the time
step synchronization.
Sign in to comment.

https://www.mathworks.com/matlabcentral/answers/160102-how-do-i-link-simplorer-to-simulink 4/6
1/27/2020 How do I link Simplorer to Simulink - MATLAB Answers - MATLAB Central

Ganesh Gaonkar  on 28 Oct 2014



Vote
0

• Link

From the Simplorer documentation available in the web , it is clear that they provide a custom target (.tlc) file that can be used to generate
the required DLL file from the model which is necessary to interface it with Simulink. This DLL file can then be used with the Simplorer
application. So check if you have enabled SIM2SIM link and all other pre requisites mentioned in the above mentioned document. Also try
to test all the steps in the section 'Running The Advisor/Simplorer Demo' in the above document. If none of these help, may be it's better to
contact Ansys Simplorer support team.
 0 Comments

Sign in to comment.

Vahid Asadzadeh on 11 Sep 2015



Vote
0

• Link

Hi, I have the same problem. Please help me to solve this issue
Many regards
 0 Comments

Sign in to comment.

Saeed H. Ebrahimi on 23 Apr 2018



Vote
0

https://www.mathworks.com/matlabcentral/answers/160102-how-do-i-link-simplorer-to-simulink 5/6
1/27/2020 How do I link Simplorer to Simulink - MATLAB Answers - MATLAB Central
• Link

Thanks, I did this with Ansys Electromagnetics Suite 19 and Matlab r2017b and it worked. Cheers.
 0 Comments

Sign in to comment.

Sign in to answer this question.

See Also
MATLAB Answers

Simulink External Mode not working on Texas Instruments C2000 Launchpad F28377S

6 Answers

Linking Simplorer with Matlab/Simulink R2015b and Higher?

2 Answers

Hi, I am trying to use S-function block in Simulink to co-simulate with Simplorer (Ansys tool). As I proceed with adding a simpl...

1 Answer

Entire Website

Offload work from your computer by running simulations on a remote cluster

Blogs

File I/O C S-function Example

File Exchange

Getting started with MATLAB

Videos

Tags
simplorer ansys maxwell cosimulation

Products
Simulink

mathworks.com
© 1994-2020 The MathWorks, Inc. MATLAB and Simulink are registered trademarks of The MathWorks, Inc. See mathworks.com/trademarks for a list of additional
trademarks. Other product or brand names may be trademarks or registered trademarks of their respective holders.

https://www.mathworks.com/matlabcentral/answers/160102-how-do-i-link-simplorer-to-simulink 6/6

Вам также может понравиться