Main Content

Simulink.dictionary.archdata.PhysicalInterface

Physical interface

Since R2023b

    Description

    A PhysicalInterface object represents the structure of a physical interface.

    Creation

    Create a PhysicalInterface object using the addPhysicalInterface function.

    PhysInterfaceObj = addPhysicalInterface(archDataObj,"PhysInterface");
    

    Properties

    expand all

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

    Data Types: char | string

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

    Data Types: char | string

    Physical elements in the physical interface, specified as an array of Simulink.dictionary.archdata.PhysicalElement objects.

    Architectural data object containing the physical interface, specified as a Simulink.dictionary.ArchitecturalData object.

    Object Functions

    addElementAdd physical element to physical interface
    getElementGet physical element from physical interface
    removeElementRemove element from physical interface
    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