Unsupported data conversion when importing Excel file into Signal Editor

6 次查看(过去 30 天)
Hi,
I have created a test harness of a subsystem I intend on testing. I have created a test sequence using Excel and I am trying to import the file into the Signal Editor. However I am getting the following error (See ImportError.jpg).
This is the first harness I have created, and I opened the Signal Editor within it. When I have used the Signal Editor in the past and imported Excel test sequences it was from within a seperate .slx file and not from within a test harness. Not sure if this is an issue or not?
When the harness was created the main model compiled with the following data types (See ModelDataTypes.jpg).
I have created the matching data types in the Excel file, but admittedly this is the first time I am using a bus hirarchy for one of the input signals (See ExcelDataTypes.jpg). Note: I have removed the actual names of the signals, and have identifed the column which is the bus signal.
When I check the Inport Block Parameters of the inputs within the test harness and check the Signal Attributes I observe the following;
  • ufix2 data type from compiled model is changed to fixdt('ufix2') in the test harness (See ufix2.jpg)
  • ufix3 data type from compiled model is changed to fixdt('ufix3') in the test harness
  • boolean from the compiled model is the same in the test harness (See boolean.jpg)
  • The boolean data type uses different port dimensions, however the only one that is different is the one which has the signal coming from a bus hirarchy, so I assume this is ok? (See boolean_Dimensions.jpg)
I am unsure if my problem could be due to the fixdt('ufix2') data types within the harness, and I have not tried to change them to match the data types from the compiled model and the Excel file.
Also, I have further uncertainty in relation to the port dimensions. Should these be changed in the harness to (-1 for inherited), or should they remain as they currently are?
Any help and/or advice as to what to try will be greatly appreciated.
Regards,
Dan

采纳的回答

Dan81
Dan81 2024-5-30
The Signal Editor does not accept ufix3 data types and it will also not accept Type: ufix2 as a numeric value. Using ufix2 in this way only accepts bit values and the Signal Editor will import when numerical values are written in their corresponding bit pattern.
The data types the test harness had modified from the model were ufix2 to fixdt(‘ufix2’) and ufix3 to fixdt(‘ufix3’), while it kept the Boolean types the same. Fixed-point or floating-point data types are Simulink.NumericType objects.
Based on that information I changed the formatting of the Type: ufix2 data type in the Excel file to fixdt: ufix2 (See Attached. I have purposely remove signal names). I was able to enter the Excel test sequence as numerical data which allowed me to finally import the spreadsheet into the Signal Editor.

更多回答(1 个)

Pat Canny
Pat Canny 2024-5-29
I recommend contacting MathWorks Technical Support. This question requires more information.
  1 个评论
Dan81
Dan81 2024-5-30
Hi Pat,
Thanks for your reply.
I have managed to resolve my problem.
The Signal Editor does not accept ufix3 data types and it will also not accept Type: ufix2 as a numeric value. Using ufix2 in this way only accepts bit values and the Signal Editor will import when numerical values are written in their corresponding bit pattern.
The data types the test harness had modified from the model were ufix2 to fixdt(‘ufix2’) and ufix3 to fixdt(‘ufix3’), while it kept the Boolean types the same. After checking the MathWorks website I read that Fixed-point or floating-point data types are Simulink.NumericType objects.
I changed the formatting of the Type: ufix2 data type in the Excel file to fixdt: ufix2 (See Attached. I have purposely remove signal names). I was able to enter the Excel test sequence as numerical data which allowed me to finally import the spreadsheet into the Signal Editor.
I was then able to export a .mat file and successfully map the inputs on the test harness.
A painful learning curve, however I am happy it is now working as expected.
Regards,
Dan

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Inputs 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by