Why do I get the error message "Undefined function or variable" when importing ARXML?

9 次查看(过去 30 天)
For releases from R2016a to R2018a, when using "createComponentAsModel" with the "DataDictionary" option, I get the following error:
Undefined function or variable
I am using the following code to import the ARXML:
importerObj = arxml.importer('myARXMLfile.arxml');
createComponentAsModel(importerObj, '/ComponentTypes/myComponent', 'CreateInternalBehavior', true, 'DataDictionary', 'myDictionary.sldd');

采纳的回答

MathWorks Support Team
The error that you are seeing is due to a bug, which originated in R2016a. This issue makes bus-type parameter values not imported correctly when using SLDD.
The bug has been fixed in R2018b, so upgrading your release would fix the issue.
As a workaround if upgrading is not possible, you can do "createComponentAsModel" without saving the data to the Data Dictionary, and then perform the operation again, this time using the "DataDictionary" property:
importerObj = arxml.importer('myARXMLfile.arxml');
createComponentAsModel(importerObj, '/ComponentTypes/myComponent', 'CreateInternalBehavior', true);
bdclose
createComponentAsModel(importerObj, '/ComponentTypes/myComponent', 'CreateInternalBehavior', true, 'DataDictionary', 'myDictionary.sldd');

更多回答(0 个)

产品


版本

R2018a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by