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

조회 수: 3 (최근 30일)
zozan tatar
zozan tatar 2023년 10월 28일
편집: Suman 2024년 7월 23일
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
升 毕
升 毕 2024년 2월 6일
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 2024년 4월 29일
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.

댓글을 달려면 로그인하십시오.

답변 (1개)

Suman
Suman 2024년 7월 23일
편집: Suman 2024년 7월 23일
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.

카테고리

Help CenterFile Exchange에서 Naming Conventions에 대해 자세히 알아보기

제품


릴리스

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by