Unit issue when importing external mf4 or dat file with Playback block in simulink

Dear community,
I'm using "Playback" block in simulink to import data from Inca recording (mf4 or dat formats), so I can use as input to test my function. the block is working and I see the data is imported correctly however, when I try to run the simulation, I've got the following error caused by the unit format of one of the variuables:
Error:Invalid unit expression '-'. Caused by: Encountered error while parsing unit expression '-' at position 1.
This unit "-" represents a varible that does not have any physical meaning, such as bit status, counter, etc. but the values are integer.
I've tryed to edit units on port converter; data type converter and bit converter but nothing seems to be able to make simulink hapy about that.
Is there a way to manully set the unit(not convert) when importing the signal, or force simulink to ignore completely the units?
Many thanks,
Olavo

 Accepted Answer

Hi Olavo,
Unfortunately, the unit "-" is not supported by Simulink. One of the channels in the MDF file uses that unit and this leads to the error.
If you create a variable in the Base Workspace with only the data, the Units are not imported and everything works as expected. You can for example run the following command and then select the "data" variable from the Workspace within the "Playback" block:
data = mdfRead("MyFile.mf4");
An enhancement request has been submitted to support this workflow even if unsupported units are used in the MDF file.
Best regards,
Fredrik

More Answers (0)

Products

Release

R2023b

Asked:

on 10 Dec 2024

Answered:

on 11 Dec 2024

Community Treasure Hunt

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

Start Hunting!