主要内容

show

在接口编辑器中显示数据元素

自 R2022b 起

    在 R2023b 中,引入了数据字典的“架构数据”部分。当管理接口、数据类型、常量和软件寻址方法时,请考虑改用 Simulink.dictionary.ArchitecturalData 编程接口。有关详细信息,请参阅Programmatically Manage AUTOSAR Architectural Data

    说明

    show(dataElementObj)架构数据编辑器中显示 DataElement 对象。

    示例

    示例

    全部折叠

    此示例说明如何在接口编辑器中查看数据元素。

    通过打开现有接口字典创建一个 Simulink.interface.Dictionary 对象。

    interfaceDictObj = Simulink.interface.dictionary.open('myInterfaceDict.sldd')
    interfaceDictObj = 
      Dictionary with properties:
    
        DictionaryFileName: 'myInterfaceDict.sldd'
                Interfaces: [1×1 Simulink.interface.dictionary.DataInterface]
                 DataTypes: [0×0 Simulink.interface.dictionary.DataType]

    使用 getElement 函数访问一个数据元素。

    dataElem1 = getElement(interfaceObj,'element1')
    dataElem1 = 
    
      DataElement with properties:
    
               Name: 'element1'
               Type: [1×1 Simulink.interface.dictionary.ValueType]
        Description: ''
         Dimensions: '1'
              Owner: [1×1 Simulink.interface.dictionary.DataInterface]

    使用 show 函数在接口编辑器中显示该数据元素。

    show(dataElem1)

    Interface Editor window displaying data element object elementObj

    输入参数

    全部折叠

    要在接口编辑器中显示的数据元素,指定为 Simulink.interface.dictionary.DataElement 对象。

    版本历史记录

    在 R2022b 中推出

    全部折叠