I need use a blf file for CAN simulink modelling. I couldnt read the blf.

3 visualizaciones (últimos 30 días)
zozan tatar
zozan tatar el 28 de Oct. de 2023
Editada: Suman el 23 de Jul. de 2024
Hi;
I am using R2021b academic use for Matlab. I wrote the codes that in below. I got error "Can't create a std::string from this data.". How can I fix it?
load canData.mat
canMsgTimetable = blfread("example.blf");
canMsgTimetable = canMsgTimetable{1};
startTime = seconds(canMsgTimetable.Time(1))
stopTime = seconds(canMsgTimetable.Time(end))
Ts = 0.01;
startTime = round(startTime, 2);
stopTime = round(stopTime, 2);
canFDMsgs = canFDMessageReplayBlockStruct(canFDMsgTimetable);
save DriveReplayFD.mat canFDMsgs
whos
  2 comentarios
升 毕
升 毕 el 6 de Feb. de 2024
Maybe your filename or filepath contain the characters which are not included in ASCII.
I have met this problem when there are some chinese words in my filepath.
João Guilherme Calderan
João Guilherme Calderan el 29 de Abr. de 2024
Any update on this topic? I've been facing the same issue using the blfread() function. I've tried to rename the file, probably it is not related to that.

Iniciar sesión para comentar.

Respuestas (1)

Suman
Suman el 23 de Jul. de 2024
Editada: Suman el 23 de Jul. de 2024
Hi zozan,
This error occurs when you have special or non-ascii characters in your filename or filepath. Please rename the file name and path to only contain asciiString characters.

Categorías

Más información sobre Naming Conventions en Help Center y File Exchange.

Productos


Versión

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by