mapInport
R2026bMap Simulink inport to AUTOSAR port
Description
mapInport(
maps the Simulink® inport slMap,slPortName,arPortName,arDataElementName,arDataAccessMode)slPortName to the AUTOSAR
data element arDataElementName at AUTOSAR
receiver port arPortName. The AUTOSAR data
access mode for the receiver port is set to
arDataAccessMode.
Examples
Set AUTOSAR mapping information for a model
inport in the example model
autosar_swc_expfcns. The model
has an inport named RPort_DE1. This
example changes the AUTOSAR data access mode for
RPort_DE1 from
ImplicitReceive to
ExplicitReceive.
hModel = "autosar_swc_expfcns"; openExample(hModel); slMap = autosar.api.getSimulinkMapping(hModel); mapInport(slMap,"RPort_DE1","RPort","DE1","ExplicitReceive"); [arPortName,arDataElementName,arDataAccessMode] = getInport(slMap,"RPort_DE1")
arPortName =
'RPort'
arDataElementName =
'DE1'
arDataAccessMode =
'ExplicitReceive'Map bus element port elements to
IsUpdated and
ErrorStatus data access modes.
For bus element ports, the port name of the bus also
identifies the mapped AUTOSAR port, and the
arDataElement argument specifies
both the bus element port and the mapped AUTOSAR port
element. The mapInport function
requires the SlPortName data element
that the QoS bus element port is associated with.
Open example model
mMultitasking_4rates and add a
status element port for
RPort1.OneS by using the
add_block function and specifying
PortName and
Element as
RPort1 and
OneS_status
respectively.
hModel = "mMultitasking_4rates"; openExample(hModel); add_block("mMultitasking_4rates/In Bus Element", ... "mMultitasking_4rates/In Bus Element_status", ... MakeNameUnique="on", ... Position=[-10 35 0 45], ... PortName="RPort1", ... Element="OneS_status");

Retrieve the Simulink to AUTOSAR mapping information in the model.
slMap = autosar.api.getSimulinkMapping(hModel);
[arPortName, arDataElementName, arDataAccessMode] = getInport(slMap,"In Bus Element")arPortName =
'RPort1'
arDataElementName =
'OneS'
arDataAccessMode =
'ImplicitReceive'Retrieve the mapping information for the status bus
element port. Then set the data access mode to
ErrorStatus. When you use the
mapInport function to set the
data access bad for QoS ports you must specify the
arDataElementName of the bus
element port for which you are tracking the
ErrorStatus or
IsUpdated, in this case
arDataElementName is
"OneS".
mapInport(slMap,"In Bus Element_status",arPortName,arDataElementName,"ErrorStatus");

Input Arguments
Simulink to AUTOSAR mapping information for a
model, previously returned by
.
slMap =
autosar.api.getSimulinkMapping(model)
is a handle, character vector, or string scalar
representing the model name.model
Example: slMap
Name of the model inport or bus element port for which to set AUTOSAR mapping information.
Example: "In Bus
Element"
Name of the AUTOSAR port to which to map the specified Simulink inport.
Example: "RPort"
Name of the AUTOSAR data element to which to map the specified Simulink inport.
Example: "DataElement"
Value of the AUTOSAR data access mode to which to map the specified Simulink inport or bus element port. Model inports and bus element ports can be mapped to these data access modes.
ImplicitReceive— Receive data implicitly. The AUTOSAR Runtime Environment (RTE) provides a copy of the data to the runnable before it starts execution.ExplicitReceive— Receive data explicitly by reference. The runnable calls an RTE API function to read data during execution.QueuedExplicitReceive— Receive queued data explicitly. Multiple sent values are buffered in a first-in-first-out (FIFO) queue and received in order.ErrorStatus— Receive the error status for an associated data element.ModeReceive— Receive mode switch notifications from a mode switch interface.IsUpdated— Receive theIsUpdatedstatus that indicates whether an associated data element has been updated since the last time it was read.EndToEndRead— Receive data with end-to-end (E2E) protection. The generated code includes E2E transformation calls that validate data integrity.ExplicitReceiveByVal— Receive data explicitly by value. The runnable calls an RTE API function that returns data by value instead of by reference.
When you map a bus element port to
IsUpdated or
ErrorStatus, set
arDataElementName to the data
element whose status you want to track, not the name
of the QoS port element itself. For example, if you
add a QoS bus element port
RPort.DE1_IsUpdated to track
the IsUpdated status of data
element RPort.DE1, specify
"DE1" as the
arDataElementName. The
slPortName is the name of the
In Bus Element block for the QoS
port
element.
mapInport(slMap,"In Bus Element_IsUpdated","RPort","DE1","IsUpdated");
Example: "ExplicitReceive"
Version History
Introduced in R2013bModels configured for the AUTSOAR Adaptive platform are no longer supported.
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Seleccione un país/idioma
Seleccione un país/idioma para obtener contenido traducido, si está disponible, y ver eventos y ofertas de productos y servicios locales. Según su ubicación geográfica, recomendamos que seleccione: .
También puede seleccionar uno de estos países/idiomas:
Cómo obtener el mejor rendimiento
Seleccione China (en idioma chino o inglés) para obtener el mejor rendimiento. Los sitios web de otros países no están optimizados para ser accedidos desde su ubicación geográfica.
América
- América Latina (Español)
- Canada (English)
- United States (English)
Europa
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)