Main Content

Simulink.dictionary.archdata.PhysicalElement

Physical element of a physical interface

Since R2023b

    Description

    A PhysicalElement object represents a physical element in a physical interface.

    Creation

    Create a PhysicalElement object using the addElement function.

    element = addElement(PhysicalInterfaceObj, 'PhysicalElement')

    Properties

    expand all

    Physical element name, specified as a character vector or string scalar.

    Data Types: char | string

    Physical domain of physical element, specified as a character vector or string scalar.

    Data Types: char | string

    Description of physical element, specified as a character vector or a string scalar.

    Data Types: char | string

    Physical interface object containing the physical element, specified as a Simulink.dictionary.archdata.PhysicalInterface object.

    Object Functions

    moveToDictionaryMove architectural data of Simulink data dictionary to another data dictionary
    moveToDesignDataMove interfaces, data types, and constants in Architectural Data section of Simulink data dictionary to design data
    showView architectural data of Simulink data dictionary in Architectural Data Editor
    destroyDelete data element and remove from data interface

    Examples

    collapse all

    To configure physical elements of a physical interface, use the addElement, getElement, and removeElement functions.

    In this example, the dictionary MyInterfaces.sldd contains one physical interface.

    archDataObj = Simulink.dictionary.archdata.open("MyInterfaces.sldd")
    archDataObj = 
    
      ArchitecturalData with properties:
    
        DictionaryFileName: 'MyInterfaces.sldd'
                Interfaces: [1×1 Simulink.dictionary.archdata.PhysicalInterface]
                 DataTypes: [0×0 Simulink.dictionary.archdata.DataType]
                 Constants: [0×0 Simulink.dictionary.archdata.Constant]

    Get the physical interface object using the getInterface function. The physical interface object contains two physical element objects.

    physInterfaceObj = getInterface(archDataObj,"PhysicalInterface1")
    physInterfaceObj = 
    
      PhysicalInterface with properties:
    
               Name: 'PhysicalInterface1'
        Description: ''
           Elements: [1×2 Simulink.dictionary.archdata.PhysicalElement]
              Owner: [1×1 Simulink.dictionary.ArchitecturalData]

    To create a physical element object and add it to the physical interface, use the addElement function.

    physElemObj3 = addElement(physInterfaceObj,"physElem3")
    physElemObj3 = 
    
      PhysicalElement with properties:
    
               Name: 'physElem3'
               Type: ''
        Description: ''
              Owner: [1×1 Simulink.dictionary.archdata.PhysicalInterface]

    To access an existing physical element, use the getElement function.

    physElemObj2 = getElement(physInterfaceObj,"physElem2")
    physElemObj2 = 
    
      PhysicalElement with properties:
    
               Name: 'physElem2'
               Type: ''
        Description: ''
              Owner: [1×1 Simulink.dictionary.archdata.PhysicalInterface]

    To remove a physical element from a physical interface, use the removeElement function.

    removeElement(physInterfaceObj,"physElem1")

    The physical interface object now contains only two physical elements, physElem2 and physElem3

    physInterfaceObj.Elements(1)
    ans = 
    
      PhysicalElement with properties:
    
               Name: 'physElem2'
               Type: ''
        Description: ''
              Owner: [1×1 Simulink.dictionary.archdata.PhysicalInterface]
    physInterfaceObj.Elements(2)
    ans = 
    
      PhysicalElement with properties:
    
               Name: 'physElem3'
               Type: ''
        Description: ''
              Owner: [1×1 Simulink.dictionary.archdata.PhysicalInterface]

    Version History

    Introduced in R2023b