当前位置:网站首页>Modeling specifications: environment settings

Modeling specifications: environment settings

2022-06-27 01:01:00 chhttty

This article describes MAAB The meaning of modeling specification , At the same time, study the environment setting specification .

1 Modeling specifications

Mathworks The company puts forward the following suggestions for the automotive industry MAAB Modeling specifications , By following the modeling specification , It can improve the readability of the model 、 Improve code generation quality . The model engineer should follow the modeling specification in the development process .

The modeling specification is divided into many chapters , Include naming conventions 、 Architecture specification 、 The module specification 、Stateflow Specification etc. . Be careful , Bloggers will not analyze it item by item in their subsequent articles MAAB Modeling specifications , But to study the more important part , And talk about how to realize it in practical application and why to do so in combination with work experience .

This article first describes the simplest environment construction specification .

2 Environment settings

2.1 Matlab edition

In the project development team , Make sure everyone uses the same version of Matlab.Matlab The software itself is updated twice a year , There are slight differences between different versions . for example , For the same model ,2015b Version and 2020a The code generated by version will be slightly different . Two people do the same code generation process , But the result is different , This is very risky . So the unified version bears the brunt .

stay Matlab in , Enter the following command to view the version and toolbox information :

>> ver

The following results will appear after entering :
 Insert picture description here

2.2 Built in compiler

The team needs to be in Matlab Install the same compiler in , be used for Simulink Of S-Function Or call an external C Function compilation .

stay Matlab in , Enter the following instructions to view compiler information :

>> mex -setup

The following results will appear after entering :
 Insert picture description here
As you can see, the installed compiler is MinGW64.

2.3 The model configuration

in addition , Project team members must use the same model configuration , To ensure that the same simulation results or the same code can be generated on different people's computers .

Click on Simulink Interface pinion , You can open the following configuration window . The same configuration means that every option here should be the same .
 Insert picture description here
In order to achieve each installation Matlab All computers have the same configuration when modeling , There are two ways to do this .

2.3.1 Refer to the configuration in the data dictionary

A data dictionary can be created in the same directory of the model sldd file , In addition to the data , It can also store model configuration information .
 Insert picture description here
Associate data dictionary through model , You can use the configuration file . here , If you open the pinion in the model again , You will be prompted that the configuration has referenced the data dictionary .
 Insert picture description here
The advantage of this method lies in its fast loading speed , The disadvantage is that the configuration items cannot be found directly , But it is easy to tamper . therefore , If the team technology is stable , This method can be considered when the configuration item is not modified very much .

2.3.2 Import configuration when opening model

Many companies manage all configuration items in one table , Then when you open a model, configure the model through a script . The method is as follows :

1) First, you need to develop a form template Config.xlsx, The configuration properties and values are recorded ;

 Insert picture description here
2) If you want the model to import the configuration after startup , Can be in Callback Of PostLoadFcn Edit import script in ;
 Insert picture description here
Through this program , You can directly overwrite the configuration in the table after the model is opened .

3) If you want the model to start without importing the configuration ( Maybe just looking at the model , Don't want to wait for the import time ), Instead, engineers manually import before simulation , You can double-click the subsystem ;

 Insert picture description here
In this way , As long as the Config.xlsx Form for version management , Then everyone gets the latest table import configuration , You can achieve the same configuration for everyone . Even if the configuration is temporarily modified for other authentication , The next time you open a model, you can import it according to the standard configuration in the template .

The specific script implementation process can refer to other bloggers' articles .

3 summary

Setting up the environment is the first step in the modeling specification , On this basis, the division of labor can be carried out to build models .

>> Return to the general directory of personal blog

原网站

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