What is "The left-hand side of a . operator must be a valid scope identifier" error for? And how to solve this?

조회 수: 14 (최근 30일)
Hi,
I am trying to perform SIL testing and while executing the test cases, I get the following error:
"Error: File: C:\Program Files\MATLAB\R2018b\rtw\c\tlc\mw\capi.tlc Line: 1200 Column: 53
The left-hand side of a . operator must be a valid scope identifier"
Initially, I developed test cases for MIL environment which I could execute without any error. Now, I changed the harness for SIL testing and trying to execute the same test cases but, getting above-mentioned error.
I am testing the SW by creating the test harness, test cases were developed using unittest in MATLAB and were executed by the test manager.
Can anyone please help me with that?
Thank you,
Parin

채택된 답변

Parin Shah
Parin Shah 2021년 8월 10일
There were auto-code gen files (from previous build of the same SWC) in my MATLAB working project directory. I made some changes to my test harness and when I was doing SIL testing, MATLAB was referring to files from previous build rather than creating auto-code gen files from scratch. After deleting those previous files, I could resolve this error.
  댓글 수: 1
Parin Shah
Parin Shah 2021년 8월 10일
I hope MathWorks come up with the solution for this kind of issues in their new release because whenever I change my harness, I need to delete those auto-code gen files manually and then build the model for SIL.

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

추가 답변 (2개)

Walter Roberson
Walter Roberson 2021년 8월 6일
Notice the message about dot indexing not supported.
The most common reason for that message is that some operation returned [] when you expected it to return a struct or an object.
However it can also occur if a variable that was a struct or object was overwritten with a numeric object. It can also occur if the variable previously existed as a numeric object and the code that you expected to overwrite it with a struct or object does not do so.
  댓글 수: 9
Walter Roberson
Walter Roberson 2021년 8월 7일
I found the file. Line 1200 is
%foreach dwkIdx = Block[blkIdx].ChartData.NumChartData
and that would fail if Block[blkIdx].ChartData is empty.
I do not see anything in the code that sets the ChartData field, so I do not know at the moment where that is coming from.
Parin Shah
Parin Shah 2021년 8월 8일
Thank you so much for your time! I will try to contact Mathworks and see if they know anything about this. I will keep this thread updated.

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


Dean DeBastiani
Dean DeBastiani 2024년 1월 5일
I noticed this in R2019b as well, and was able to resolve it by disabling the link to some of my library blocks, and then breaking said links. I was able to rebuild and not get the issue mentioned above.

카테고리

Help CenterFile Exchange에서 Test Model Components에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by