Main Content

GetState

Get AUTOSAR mapping information for万博1manbetxblock state

Description

example

arValue= getState(slMap,SlstateOwnerBlock)returns the type of AUTOSAR variable mapped to the Simulink®block state associated with state owner blockSlstateOwnerBlock。AUTOSAR variable types includeArTypedPerInstanceMemoryStaticMemory

arValue= getState(slMap,SlstateOwnerBlock,Slstate)返回映射到simulink状态的autosar变量的类型万博1manbetxSlstateassociated with state owner blockSlstateOwnerBlock。Specify a nonemptySlstateargument only for blocks with multiple states.

arValue= getState(slMap,SlstateOwnerBlock,Slstate,Arproperty)returns the value of propertyArpropertyfor the AUTOSAR variable to which the Simulink block state is mapped.

Examples

collapse all

Get AUTOSAR mapping and property information for the Simulink block state for Unit Delay blockXin example modelautosar_swc_counter。国家所有者块有一个州。

hModel ='autosar_swc_counter'; addpath(fullfile(matlabroot,'/示例/autosarblockset/main')); open_system(hModel); slMap = autosar.api.getSimulinkMapping(hModel); mapState(slMap,'autosar_swc_counter/X','','ArTypedPerInstanceMemory',。。。'SwCalibrationAccess','ReadWrite') arMappedTo = getState(slMap,'autosar_swc_counter/X') arValue = getState(slMap,'autosar_swc_counter/X','','SwCalibrationAccess')
arMappedTo = 'ArTypedPerInstanceMemory' arValue = 'ReadWrite'

Input Arguments

collapse all

Simulink to AUTOSAR mapping information for a model, previously returned byslMap= autosar.api.getSimulinkMapping(model)modelis a handle, character vector, or string scalar representing the model name.

Example:slMap

Handle or path to Simulink state owner block to return AUTOSAR mapping information for.

Example:'autosar_swc_counter/X'

Name of Simulink state associated with state owner blockSlstateOwnerBlock。Specify a nonempty state name only for blocks with multiple states. IfSlstateis empty, the function returns mapping information for the first state in the block.

Example:''

Name of AUTOSAR variable property. Valid property names includeShortName,SwAddrMethod,SwCalibrationAccess, andDisplayFormat。ForStaticMemory, you can also specify C type qualifier propertiesIsVolatile或者Qualifier(AUTOSAR additional native type qualifier). For property descriptions, seemapState

Example:'SwCalibrationAccess'

Output Arguments

collapse all

Variable that returns either the type of the mapped AUTOSAR variable or the value of a variable property.

Example:arValue

Version History

Introduced in R2018b