没有合适的资源?快使用搜索试试~ 我知道了~
首页使用Simulink配置AUTOSAR Client-Server通信
资源详情
资源评论
资源推荐
•
•
•
•
•
•
•
•
•
Configure AUTOSAR Client-Server Communication
In Simulink , you can model AUTOSAR client-server communication for simulation and code
generation. For information about the Simulink blocks you use and the high-level workflow, see Client-
Server Interface.
To model AUTOSAR servers and clients, you can do either or both of the following:
Import AUTOSAR servers and clients from arxml code into a model.
Configure AUTOSAR servers and clients from Simulink blocks.
This topic provides examples of AUTOSAR server and client configuration that start from Simulink
blocks.
Configure AUTOSAR Server
Configure AUTOSAR Client
Configure AUTOSAR Client-Server Error Handling
Concurrency Constraints for AUTOSAR Server Runnables
Configure and Map AUTOSAR Server and Client Programmatically
Configure AUTOSAR Server
This example shows how to configure a Simulink Function block as an AUTOSAR server. The example
uses these files in the folder matlabroot/help/toolbox/ecoder/examples/autosar (open):
mControllerWithInterface_server.slx
ExampleApplicationErrorType.m
If you copy the files to a working folder, collocate the MATLAB file with the model file.
Open a model in which you want to create and configure an AUTOSAR server, or open the example
model mControllerWithInterface_server.slx.
1.
Add a Simulink Function block to the model. In the Simulink Library Browser, the Simulink Function
block is in User-Defined Functions.
The example model provides two Simulink Function blocks, doOverride and readData.
2.
®
®
第1页 共22页
•
•
•
Configure the Simulink Function block to implement a server function. Configure a function
prototype and implement the server function algorithm.
In the example model, the contents of the Simulink Function block named readData implement a
server function named readData.
The contents include:
Trigger block readData, representing a trigger port for the server function. In the Trigger block
properties, Trigger type is set to Function call. Also, the option Treat as Simulink function is
selected.
Argument Inport block Op and Argument Outport blocks Data, ERR, and NegCode, corresponding
to the function prototype [Data,ERR,NegCode]=readData(Op).
Note
When configuring server function arguments, you must specify signal data type, port
dimensions, and signal type on the Signal Attributes tab of the inport and outport
blocks. The AUTOSAR configuration fails validation if signal attributes are absent for
server function arguments.
Blocks implementing the readData function algorithm. In this example, a few simple blocks
provide Data, ERR, and NegCode output values with minimal manipulation. A Constant block
represents the value of an application error defined for the server function. The value of Op
3.
第2页 共22页
passed by the caller is ignored. In a real-world application, the algorithm could perform a more
complex manipulation, for example, selecting an execution path based on the passed value of
Op, producing output data required by the application, and checking for error conditions.
When the server function is working in Simulink, set up the Simulink Function block in a model
configured for AUTOSAR. For example, configure the current model for AUTOSAR or copy the block
into an AUTOSAR model.
The example model is an AUTOSAR model, into which the Simulink Function block readData has
been copied. In place of a meaningful Op input value for the readData function, Simulink data
transfer line CurVal provides an input value that is used in the function algorithm.
4.
第3页 共22页
•
•
•
•
The required elements to configure an AUTOSAR server, in the general order they are created, are:
AUTOSAR client-server (C-S) interface
One or more AUTOSAR operations for which the C-S interface handles client requests
AUTOSAR server port to receive client requests for a server operation
For each server operation, an AUTOSAR server runnable to execute client requests
Open AUTOSAR Dictionary. To view AUTOSAR C-S interfaces in the model, go to the C-S Interfaces
view. The example model already contains client-server interfaces.
If a C-S interface does not yet exist in your model, create one.
In the C-S interfaces view, click the Add button . This action opens the Add Interfaces dialog
box.
a.
In the dialog box, name the new C-S Interface, and specify the number of operations you intend
to associate with the interface. Leave other parameters at their defaults. Click Add. The new
interface appears in the C-S interfaces view.
b.
5.
第4页 共22页
Under C-S Interfaces, create one or more AUTOSAR server operations for which the C-S interface
handles client requests. Each operation corresponds to a Simulink server function in the model.
Expand C-S Interfaces and expand the individual C-S interface to which you want to add a server
operation. (In the example model, expand CsIf1.) To view operations for the interface, select
Operations. The example model already contains AUTOSAR server operations named doOverride
and readData.
If a server operation does not yet exist in your model, create one. (If your C-S interface contains a
placeholder operation named Operation1, you can safely delete it.)
In the operations view, click the Add button . This action opens the Add Operation dialog
box.
a.
In the dialog box, enter the Operation Name. Specify the name of the corresponding Simulink
server function.
b.
If the corresponding Simulink server function has arguments, select the function in the Simulink
Function list. This action causes AUTOSAR operation arguments to be automatically created
based on the Simulink server function arguments. Click OK. The operation and its arguments
appear in the operations view.
c.
6.
第5页 共22页
剩余21页未读,继续阅读
Doveal呢
- 粉丝: 79
- 资源: 8
上传资源 快速赚钱
- 我的内容管理 收起
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
会员权益专享
最新资源
- ExcelVBA中的Range和Cells用法说明.pdf
- 基于单片机的电梯控制模型设计.doc
- 主成分分析和因子分析.pptx
- 共享笔记服务系统论文.doc
- 基于数据治理体系的数据中台实践分享.pptx
- 变压器的铭牌和额定值.pptx
- 计算机网络课程设计报告--用winsock设计Ping应用程序.doc
- 高电压技术课件:第03章 液体和固体介质的电气特性.pdf
- Oracle商务智能精华介绍.pptx
- 基于单片机的输液滴速控制系统设计文档.doc
- dw考试题 5套.pdf
- 学生档案管理系统详细设计说明书.doc
- 操作系统PPT课件.pptx
- 智慧路边停车管理系统方案.pptx
- 【企业内控系列】企业内部控制之人力资源管理控制(17页).doc
- 温度传感器分类与特点.pptx
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
评论2