주요 콘텐츠

이 번역 페이지는 최신 내용을 담고 있지 않습니다. 최신 내용을 영문으로 보려면 여기를 클릭하십시오.

Simulink.dictionary.ArchitecturalData

Simulink 데이터 사전의 아키텍처 데이터를 프로그래밍 방식으로 편집

R2023b 이후

    설명

    Simulink.dictionary.ArchitecturalData 객체는 Simulink® 데이터 사전의 아키텍처 데이터 섹션을 나타냅니다. Architectural Data 객체를 사용하면 Simulink 모델과 다양한 아키텍처 모델에서 공유되는 포트 인터페이스, 데이터형, 시스템 전체에서 사용되는 상수 그리고 이들의 플랫폼 속성에 대한 정의에 프로그래밍 방식으로 액세스할 수 있습니다. 또한 아키텍처 데이터 편집기를 사용하여 아키텍처 데이터를 관리할 수 있습니다.

    생성

    Simulink.dictionary.archdata.create 함수를 사용하여 새로운 데이터 사전을 만들 수 있습니다. 이 함수는 Simulink.dictionary.ArchitecturalData 객체를 반환합니다.

    dictName = "MyInterfaces.sldd";
    archDataObj = Simulink.dictionary.archdata.create(dictName);

    이미 데이터 사전을 만든 경우에는 Simulink.dictionary.archdata.open 함수를 사용하여 Architectural Data 객체를 만들 수 있습니다.

    dictName = "MyInterfaces.sldd";
    archDataObj = Simulink.dictionary.archdata.open(dictName);

    속성

    모두 확장

    데이터 사전의 파일 이름으로, 문자형 벡터 또는 string형 스칼라로 지정됩니다. 이름은 .sldd 확장자를 포함해야 하며 유효한 MATLAB® 식별자여야 합니다.

    데이터 사전의 아키텍처 데이터 섹션에 정의된 인터페이스로, Description, Elements, Name, Owner 속성을 갖는 Simulink.dictionary.archdata.DataInterface 객체, Simulink.dictionary.archdata.ServiceInterface 객체, Simulink.dictionary.archdata.PhysicalInterface 객체로 구성된 배열로 지정됩니다.

    데이터 사전의 아키텍처 데이터 섹션에 정의된 데이터형으로, NameOwner 속성을 갖는 Simulink.dictionary.archdata.DataType 객체로 구성된 배열로 지정됩니다.

    정의된 상수로, Value, Description, DataType, Name, Owner 속성을 갖는 Simulink.dictionary.archdata.Constant 객체로 구성된 배열로 지정됩니다.

    객체 함수

    addAliasTypeAdd Simulink alias type to Architectural Data section of Simulink data dictionary
    addConstantAdd constant to Architectural Data section of Simulink data dictionary
    addDataInterfaceAdd data interface to Architectural Data section of Simulink data dictionary
    addEnumTypeAdd enumerated type to Architectural Data section of Simulink data dictionary
    addNumericTypeAdd Simulink numeric type to Architectural Data section of Simulink data dictionary
    addPhysicalInterfaceAdd physical interface to Architectural Data section of Simulink data dictionary
    addPlatformMappingAdd AUTOSAR Classic mapping to Architectural Data section of Simulink data dictionary
    addReferenceAdd data dictionary reference to Architectural Data section of Simulink data dictionary
    addServiceInterfaceAdd service interface to Architectural Data section of Simulink data dictionary
    addStructTypeAdd structure type to Architectural Data section of Simulink data dictionary
    addValueTypeAdd value type to Architectural Data section of Simulink data dictionary
    closeClose any open connections to Simulink data dictionary
    discardChangesDiscard changes to Simulink data dictionary
    findEntryByNameGet object by name in Architectural Data section of Simulink data dictionary
    getConstantGet Simulink.dictionary.archdata.Constant object in Architectural Data section of Simulink data dictionary
    getConstantNamesGet constant names in Architectural Data section of Simulink data dictionary
    getDataTypeGet data type in Architectural Data section of Simulink data dictionary
    getDataTypeNamesGet names of data types in Architectural Data section of Simulink data dictionary
    getInterfaceGet interface object for interface in Architectural Data section of Simulink data dictionary
    getInterfaceNamesGet interface names in Architectural Data section of Simulink data dictionary
    getPlatformMappingGet platform mapping object for platform of Simulink data dictionary
    getReferencesGet full paths of Simulink data dictionaries referenced by another Simulink data dictionary
    importFromBaseWorkspaceImport Simulink object definitions from base workspace to Architectural Data section of Simulink data dictionary
    importFromFileImport Simulink object definitions from file to Architectural Data section of data dictionary
    isDirtyCheck for unsaved changes in Simulink data dictionary
    moveToDesignDataMove interfaces, data types, and constants in Architectural Data section of Simulink data dictionary to design data
    moveToDictionaryMove architectural data of Simulink data dictionary to another data dictionary
    removeConstantRemove constant from Architectural Data section of Simulink data dictionary
    removeDataTypeRemove data type from Architectural Data section of Simulink data dictionary
    removeInterfaceRemove interface from Architectural Data section of Simulink data dictionary
    removeReferenceRemove Simulink data dictionary reference of another Simulink data dictionary
    removePlatformMappingRemove platform mapping of Architectural Data section of data dictionary
    saveSave changes to Architectural Data section of Simulink data dictionary
    showView architectural data of Simulink data dictionary in Architectural Data Editor
    showChangesView changes to architectural data of Simulink data dictionary in Comparison Tool

    예제

    모두 축소

    Simulink 데이터 사전을 만들고 이에 연결된 Architectural Data 객체를 반환합니다.

    dictName = "MyArchitecturalData.sldd";
    archDataObj = Simulink.dictionary.archdata.create(dictName);

    유형별 함수를 사용하여 별칭 유형과 열거형을 데이터 사전에 추가합니다.

    myAliasType1Obj = addAliasType(archDataObj,"aliasType",BaseType="single");
    myAliasType1Obj.Name = "myAliasType1";
    myAliasType1Obj.BaseType = "fixdt(1,32,16)";
    myAliasType2Obj = addAliasType(archDataObj,"myAliasType2");
    myAliasType2Obj.BaseType = myAliasType1Obj;
    
    myEnumType1Obj = addEnumType(archDataObj,"myColor");
    addEnumeral(myEnumType1Obj,"RED",'0',"Red Sunset");
    addEnumeral(myEnumType1Obj,"BLUE",'1',"Blue Skies");
    myEnumType1Obj.DefaultValue = "BLUE";
    myEnumType1Obj.Description = "I am a Simulink Enumeration";
    myEnumType1Obj.StorageType = 'int16'; 

    생성된 별칭 유형의 기본 유형을 생성된 열거형 데이터형 myColor로 설정할 수 있습니다.

    myAliasType3Obj = addAliasType(archDataObj,"myAliasType3");
    myAliasType3Obj.BaseType = myEnumType1Obj;
     

    addNumericType 함수를 사용하여 숫자형을 데이터 사전에 추가합니다.

    myNumericType1Obj = addNumericType(archDataObj,"myNumericType1");
    myNumericType1Obj.DataTypeMode = "Single";

    addValueType을 사용하여 값 유형을 데이터 사전에 추가합니다. 또한 값 유형의 데이터형을 기존 데이터형 또는 생성된 열거형 데이터형으로 설정할 수 있습니다.

    myValueType1Obj = addValueType(archDataObj,"myValueType1");
    myValueType1Obj.DataType = "int32";
    myValueType1Obj.Dimensions = '[2 3]';
    myValueType1Obj.Description = "I am a Simulink ValueType";

    addStructType 함수를 사용하여 구조체형을 데이터 사전에 추가합니다.

    myStructType1Obj = addStructType(archDataObj,"myStructType1");
    structElement1 = myStructType1Obj.addElement("Element1");
    structElement1.Type.DataType = "single";
    structElement1.Type.Dimensions = "3";
    structElement2 = addElement(myStructType1Obj,"Element2");
    structElement3 = addElement(myStructType1Obj,"Element3");

    데이터형 객체를 사용하거나 데이터형의 이름(string형 스칼라 또는 문자형 벡터로 지정됨)을 사용하여 구조체 요소의 데이터형을 설정할 수 있습니다.

    structElement2.Type = myValueType1Obj;
    % or
    structElement3.Type = "ValueType: myValueType1";

    addConstant 함수를 사용하여 상수를 추가할 수 있습니다.

    myConstantObj = addConstant(archDataObj, "myConst", Value=4);

    Simulink.dictionary.archdata.DataInterface 객체의 함수를 사용하여 통신 인터페이스와 해당 데이터 요소를 추가할 수 있습니다.

    dataInterface1Obj = addDataInterface(archDataObj,"DataInterface");
     
    dataElm1 = addElement(dataInterface1Obj,"DE1");
    dataElm1.Type = myValueType1Obj;
     
    dataElm2 = addElement(dataInterface1Obj,"DE2");
    dataElm2.Type = myStructType1Obj;
    dataElm2.Dimensions = "4";
    dataElm2.Description = "I am a data element with datatype = array of struct type";
     
    dataElm3 = addElement(dataInterface1Obj,"DE3");
    dataElm3.Type.DataType = "single";
    dataElm3.Type.Dimensions = "10";
    dataElm3.Type.Minimum = "-5";

    지원되는 제품의 플랫폼 매핑을 데이터 사전의 아키텍처 데이터 섹션에 추가할 수 있습니다. 예를 들어 다음 프로그래밍 단계는 addPlatformMapping 함수를 사용하여 AUTOSAR Classic 매핑을 추가합니다.

    platformMapping = addPlatformMapping(archDataObj,"AUTOSARClassic");

    getPlatformProperties (AUTOSAR Blockset) 함수와 setPlatformProperty (AUTOSAR Blockset) 함수를 사용하여 AUTOSAR 통신 인터페이스와 패키지 속성을 가져오고 설정합니다.

    setPlatformProperty(platformMapping, dataInterface1Obj,...
        "Package","/Interface2","InterfaceKind","NvDataInterface");
    [pNames, pValues] = getPlatformProperties(platformMapping,dataInterface1Obj);

    이제 데이터 사전의 내용을 ARXML 코드로 생성할 수 있습니다.

    exportedFolder = exportDictionary(platformMapping);
    Exporting dictionary, please wait...
    Exported dictionary ARXML files are located in: C:\work\MyArchitecturalData.

    AUTOSAR Classic 플랫폼 관련 요소, 소프트웨어 주소 지정 방식, 보정 속성을 관리합니다. 이러한 요소에는 Simulink에 대한 매핑이 없습니다.

    arProps = autosar.api.getAUTOSARProperties(dictName);
    addPackageableElement(arProps,"SwAddrMethod", ... 
        "/SwAddressMethods","VAR1","SectionType","Var");
    setPlatformProperty(platformMapping,dataElm1, ...
        SwAddrMethod="VAR1",SwCalibrationAccess="ReadWrite",... 
         DisplayFormat="%.3f");

    버전 내역

    R2023b에 개발됨