当前位置:网站首页>Amesim2016 and matlab2017b joint simulation environment construction

Amesim2016 and matlab2017b joint simulation environment construction

2022-07-07 22:30:00 Eva215665

Refer to the following blog :JaySur 's blog post

1 compiler

If you want to carry on Amesim And Matlab Co simulation , It is necessary to determine the compiler as the joint medium of the two (Compiler). Want to be with Matlab Conduct joint simulation , Best use Microsoft Visual C++ The compiler for both .

1.1 Inquire about AMESim16 Supported by VS edition

open AMESim16 Help document , Search for visual studio, The following figure is obtained . It can be seen that ,Windows 64 Supported by the system ,AMESim16 Supported compilers include Microsoft Visual Studio 2010-2013, Professional edition or Standard Edition . Choose here Microsoft Visual Studio 2013.
 Insert picture description here

1.2 Inquire about MATLAB Supported compiler versions

Inquire about MATLAB Supported by VS edition :MATLAB What each version can support VS Compiler can pass This address The query .
You can find ,Matlab 2018b Start , No more right VS2013 And the following compilers . therefore , If you want to Amesim16 And MATLAB Co simulation , be MATLAB It's best not to exceed 2018a, Select the MATLAB The version is MATLAB 2017b.

1.3 Installation sequence

The software to be installed is :

  • Microsoft Visual Studio 2013 pro
  • matlab 2017b
  • Amesim16

The recommended installation sequence is VS2013->matlab2017->Amesim2016. Because of the installation Amesim when , It finds that Visual Studio compiler , It will bring Visual Studio Copy some files under the installation directory to Amesim Installation directory .
Besides , There may also be a problem : The original machine has been installed matlab2018b, At first, I installed it without care vs2013 and amesim, It turned out matlab2018 I won't support it vs2017, So it was unloaded matlab2018 After loading matlab2017, however amesim Can't find matlab The startup path of , Show

windos No files found ’C:\Program Files\MATLAB2018\bin\win32\matlab.exe’

This is obviously because the value of the system environment variable has not been modified , Lead to windows System not found matlab2017 The startup path of . therefore , Recommended installation sequence vs2013->matlab2017->amesim

On this machine ,

  • VS2013 The installation path of is C:\Program Files (x86)\Microsoft Visual Studio 12.0
  • Amesim16 The installation path is :C:\Program Files\Simcenter\v1600\

Friendship tips : There may be an unsuccessful installation , Which leads to multiple uninstallations and installations ,Amesim stay windows10 Installation under system , Unable to get 【 Control panel 】->【 Uninstall program 】 uninstall , You need to use your own uninstall tool . The location of the built-in unloading tool is %your path%\Amesim, Take this machine as an example , The uninstall tool is located at C:\Program Files\Simcenter\v1600\Amesim, It's a windows Batch file , full name :AMEUninstall.bat.
Running this file will uninstall Amesim16, But there are some problems of incomplete file deletion , You need to manually delete the entire Simcenter Folder .
 Insert picture description here

2 install VS2013

There is only one problem to pay attention to here ,vs2013 Be sure to install the English version , Chinese version of vs2013 It can lead to Amesim There is garbled code when compiling the model .
If you have installed vs2013 English version , Please ignore the following .
If your machine is equipped with vs2013 Chinese version , You can install an English language pack , And then vs2013 Of 【 Tools 】->【 Environmental Science 】->【 Zone setup 】->English Medium change , Detailed as follows .

  • vs2013 English language pack : Download link Extraction code :gwto , After downloading , double-click .exe Files installed , All the way next that will do .
  • open vs2013, Click on 【 Tools 】->【 Environmental Science 】( Forget to cut the Chinese version of the picture , Replace with the switched English interface )
     Insert picture description here
  • Click on 【 Zone setup 】->【English】
     Insert picture description here
  • close vs2013 After and restart , Language switching succeeded !

3 install Amesim2016

Amesim Refer to the following two links for the installation of : Reference link 1, Reference link 2

Amesim2016 After decompressing , The file structure is as follows , The path of this structure is E:\AMESIM2016\ENsImaLR16\Siemens.Simcenter.Amesim.16.0-SSQ. among ,_SolidSQUAD_ It contains the required documents ,Siemens.Simcenter.Amesim.16.0.iso Is to install the image .
 Insert picture description here

step 1

take E:\AMESIM2016\ENsImaLR16\Siemens.Simcenter.Amesim.16.0-SSQ\_SolidSQUAD_\Win64\_SolidSQUAD_ Under the position LMS_RLM_Server Copy the folder to the specified location , Copy it here to C Under the root directory .
 Insert picture description here
Right mouse click server_install.bat choice 【 Run as administrator 】, Installation services .
 Insert picture description here

step 2

After the service is installed , Double click to open the CD image file in the installation package Siemens.Simcenter.Amesim.16.0.iso
 Insert picture description here

step 3

Right click administrator to run setup_win.bat file
 Insert picture description here

step 4

Choose to install the product Simcenter Amesim, stand-alone 【next】
 Insert picture description here

step 5

All the way 【next】
 Insert picture description here
 Insert picture description here

step 6

【User name】 and 【Organization】 Feel free to fill in , But it must be in English .
activation code by 【DIGJW72BDR29WJ20HVQ60C721】, Files available in the installation package readme_windows.txt View in , The location of the file is E:\AMESIM2016\ENsImaLR16\Siemens.Simcenter.Amesim.16.0-SSQ\_SolidSQUAD_\Win64
After filling in, stand alone 【next】, And all the way 【next】
 Insert picture description here
 Insert picture description here

step 7

The installation position is optional , I usually install by default , Do not change the installation position
 Insert picture description here

Step 8

Click on 【install】
 Insert picture description here ## Step 9
A prompt will pop up , If there is no... In the computer JAVA runtime environment, Need to install . Because I have... On my computer java Environmental Science , So direct 【OK】
 Insert picture description here

Step 10

Waiting for the installation ...
 Insert picture description here

Step 11

Click on 【next】
 Insert picture description here

Step 12

Installation tips are shown in the figure , It can be found that 【Microsoft Visual C++】, You can make subsequent settings , Realization MATLAB Co simulation , Click on 【next】, And all the way 【next】
 Insert picture description here
 Insert picture description here

Step 13

In the license configuration interface , Select license configuration interface , choice 【Specify [email protected]】, Input 【[email protected]

Step 14

choice 【No, I will restart my computer later】, Click on 【Finish】
 Insert picture description here

Step 15

Create system variables , Variable name 【AME】, Variable value is Aesim The installation path , This machine is C:\Simcenter\v1600\Amesim
Create system variables [email protected]

Step 16

start-up Amesim when , Run as administrator first C Under the root directory rlm.exe.
By the way, explain 【server_remove.bat】【server_install.bat】 Two documents , They are removal and installation RLM server Of windows Batch file , If you need to delete RLM server, Then run 【server_remove.bat】.
 Insert picture description here
Run the following , Don't close this .
 Insert picture description here
Restart Amesim
 Insert picture description here

4 install matlab2017b And configure the simulation environment

matlab2017 The download and installation of is extremely simple , See link , No more details here .

4.1 Environment variable configuration

When setting the simulation environment , Pay attention to the following environment variables , These environment variables , Some are added automatically when installing the software , Some need to be added manually , So check your list of environment variables .
 Insert picture description here

4.2 MATLAB Compiler settings

Start by opening Matlab 2017b, Enter... In the command window : mex -setup
 Insert picture description here
choice mex setup C++, as follows
 Insert picture description here

5 Possible problems

5.1 Amesim “Failed to connect to the license server”, What do I do ?

 Insert picture description here
The problem is the license ,Amessim 2016 Your license needs to run RLM.exe. Solution reference :
Reference resources 1, Reference resources 2, Reference resources 3, Reference resources 4
function C Under the packing directory rlm.exe To start a serve, If you are prompted
Web server starting on port 5053
(rlm) Port 5053 in use, waiting…
(rlm) Port 5053 in use, waiting…
(rlm) Port 5053 in use, waiting…
take [email protected] The value of this environment variable is changed to [email protected], or [email protected],[email protected] This is changed to [email protected]
If it still exists Port 5052 in use, waiting… The situation of , Check whether the task manager has other rlm process , Please close .
meanwhile , take C:\LMS_RLM_Server Next LMS.lic One sentence in the document is changed to HOST localhost ANY 5052
 Insert picture description here
 Insert picture description here

5.2 Amesim LMS License Error What do I do ?

 Insert picture description here
The problem is not started LMS Server caused , please C:\LMS_RLM_Server Under the table of contents rlm.exe This file .

5.3 Amesim What if the code is garbled when compiling the model ?

If you encounter amesim There is garbled code when compiling the model , Modify system not unicode The software language is English , At the same time guarantee vs2013 Install for English .

5.4 Amesim It won't start MATLAB, What do I do ?

Here's the picture , stay Amesim Click on the Tools->Matlab after , Appear below
 Insert picture description here
This problem is due to the incorrect setting in the system environment variable matlab route , Lead to amesim( That's the system ) Can't find matlab Start position . Because I first installed matlab2018b, As the configuration of the joint simulation environment requires , After uninstallation, it is installed matlab2017b, But the value of the system environment variable has not been changed , Lead to amesim2016 I only know the original address . The solution is 4.1 Subsection , Pay attention to setting environment variables .

6 verification

Now let's verify whether the Simulink environment can run .

  • open 【AMESim 16->Help->Help】 in , Enter 【simulink】, open 【Hybrid_bus_steps_simulink】 routine :
     Insert picture description here
     Insert picture description here - Click on 【Amesim 16-Tools-MATLAB】, It will turn on automatically 【MATLAB 2017b】, And automatically add 【AMESIM】 The relevant path to 【MATLAB PATH】 in , Then it will open automatically 【Hybrid_bus_steps_simulink.mdl】.( Be careful , The 【.mdl】 Must be 【matlab 2016b】 And above versions can be opened .)
     Insert picture description here
  • 【MATLAB】 Open the interface
     Insert picture description here
  • Back to 【Amesim 16】, Click on 【SIMULATION】, It will compile the model
     Insert picture description here
  • After compiling , In this model directory, it will generate 【.mexw64】 Wait for the documents , This is a necessary document for the joint module
     Insert picture description here - stay 【Amesim 16】 After compiling , Back to 【Simulink】 in , Click on 【Run】 that will do ( Here, the simulation time is changed from 【inf】 Change it to 【30s】 了 , If it is the original routine 【inf】, It will not stop .
     Insert picture description here
    ----------------------------------------------------- The end , And the flower !------------------------------------------------------
    --------------------------------------------------- If you have any questions, please leave a message for discussion --------------------------------------------------
原网站

版权声明
本文为[Eva215665]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/02/202202130605187787.html