【AUTOSAR】 AUTOSAR整体开发流程(六)---- ISOLAR与Simuink

ISOLARSimuink交互

8.1 AutoSar的几种开发流程

 

 

 

 

8.2 Simulink ISOLAR

Simulink生成SWC arxml

SWC arxml放到ISOLAR文件夹

 

F5即可显示

 

8.3 ISOLARSimulink 

1、Matlab的几个命令

1importer

Call the constructor arxml.importer to create an importer object that represents the software component information in the specified XML file or files. For example, the following call specifies a main software component file, mr_component.arxml, and related dependent files containing data type, implementation, and interface information that completes the software component description.

obj = arxml.importer({'mr_component.arxml','mr_datatype.arxml',...

              'mr_implementation.arxml','mr_interface.arxml'})

If you enter the arxml.importer constructor call without a terminating semicolon (;), the importer lists the AUTOSAR content of the specified XML file or files. The information includes paths to software components in the AUTOSAR package structure, which you use in the next step. In this example, the path to software component ASWC is /pkg/swc/ASWC.

obj =

The file "H:\wrk\mr_component.arxml" contains:

  1 Application-Software-Component-Type:

    '/pkg/swc/ASWC'

  0 Sensor-Actuator-Software-Component-Type.

  0 CalPrm-Component-Type.

  0 Client-Server-Interface.

>>

2createComponentAsModel

If CreateInternalBehavior is set to true, the importer creates a function-call-based model. The importer adds function-call subsystem or function blocks and signal lines and maps them to corresponding runnables and IRVs imported from the AUTOSAR software component.

The following call directs the importer to import a multi-runnable AUTOSAR software component and map it into a new function-call-based model:

obj = arxml.importer('mySWC.arxml')

createComponentAsModel(obj,'/pkg/swc/ASWC','CreateInternalBehavior',true)

3)其它命令

createCalibrationComponentObjects

Create Simulink calibration objects from AUTOSAR calibration component

createComponentAsModel

Create AUTOSAR atomic software component as Simulink model

getApplicationComponentNames

Get list of application software component names

getCalibrationComponentNames

Get calibration component names

getClientServerInterfaceNames

Get list of client-server interfaces

getComponentNames

Get application and sensor/actuator software component names

getDependencies

Get list of XML dependency files

getFile

Return software component XML file name

getSensorActuatorComponentNames

Get list of sensor/actuator software component names

setDependencies

Set XML file dependencies

setFile

Set software component XML file name

updateModel

Update AUTOSAR model with arxml changes

updateReferences

Update model with arxml definitions of AUTOSAR reference elements

2、ISOLAR 搭建DEMO

1)结构树

 

                 

2)示意图

 

3)文件列表

                          

4AutoSar版本需保持一致

 

 

4)执行代码

第一步:obj  = arxml.importer({'ApplicationSwComponentTypeTest.arxml','ISOLAR_PlatformTypes.arxml','InterfaceTest.arxml'})

 

第二部:createComponentAsModel(obj,'/ApplicationSwComponentTypeTest/ApplicationSwComponentTest','CreateInternalBehavior',true)

 

8.4 Simulink 配置生成AutoSar 代码

1、Configuration 相关配置   

 

 

2、搭建Model

 

3、进行AUTOSAR配置(类似于ISOLAR-A操作)

 

                    

4、AUTOSAR配置与SWC进行Mapping

 

                

5、Mapping之后的模型

 

6、生成代码和描述文件

 

7、注意事项

1)Simulink Function中的形参要与CS端口里面的配置同名

 

2)Simulink Function中的Function Name要与Runnable里面的symbol同名

 

3)通过对xml配置,可以生成独立的Arxml文件和独立的Arxml文件

 

4)在模型里面需要定义端口数据类型,否则默认全部为Double

 

8.5 Simulink 配置与ISOLAR对应关系

 

                 

 

1)Interface

 

 

 

2)Port

 

 

 

3)Runnable

 

 

4)IRV

 

 

  • 0
    点赞
  • 14
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

大道生

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值