Simulink Truth Table Action Language Whitespace

8 ビュー (過去 30 日間)
Paul Rancuret
Paul Rancuret 2023 年 3 月 4 日
コメント済み: Paul Rancuret 2024 年 12 月 5 日
Simulink Truth Table Action Language Whitespace:
I've found that the action language for truth tables in Simulink do not support space characters before and after the equals sign. This was discovered in R2020b.
For example, the statement below will not compile:
x = true;
The statement below will compile:
x=true;
The error message that occurs when using the first statement does not indicate the problem is with whitespace. Instead, it implies that I used an '=' when I meant '==' or vice-versa, which wasn't the problem.
This was very difficult for me to track down the problem. I think a future update should either support spaces in the action language, or update the error handler so it mentions white space as a potential cause of the compile error in the error message. I also wanted to post this in case someone else runs into the same problem; perhaps they can search and find this.
More details when this was encountered:
  • Truth Table used within Stateflow Chart with Matlab action language
  • Data object 'x' existed in Chart context with 'boolean' data type and 'local' context
  • Conditions handled similarly (boolean data objects local to chart). Whitespace was used in conditional statements in the Truth Table with no error.
  • Truth Table code interface set to generate 'inlined' within Chart code.
  2 件のコメント
Roman
Roman 2024 年 12 月 5 日
Hi Paul, I followed your steps and cannot reproduce this in 20b, see the attached picture. What am I missing?
Paul Rancuret
Paul Rancuret 2024 年 12 月 5 日
Roman,
Actually I had opened a ticket about this back in March 2023 with the following reference in the emails:
ref:_00Di0Ha1u._5003q1aB2lM:ref
Unfortunately I was unable to replicate the behavior I was seeing in a share-able model, so I never was able to figure out exactly what was happening. It might have been some different problem with the particular model we were using. I had recommended that we close the ticket back then, and I haven't run into the problem anymore. I think at the time I mentioned it might make sense to remove this post, but I wasn't sure how to do so. Sorry for the confusion.

サインインしてコメントする。

回答 (1 件)

Teresa Hubscher-Younger
Teresa Hubscher-Younger 2024 年 12 月 2 日
Thanks! I will report this to documentation, so that they can cover what you discovered there.
  1 件のコメント
Paul Rancuret
Paul Rancuret 2024 年 12 月 5 日
Teresa,
Actually I had opened a ticket about this back in March 2023 with the following reference in the emails:
ref:_00Di0Ha1u._5003q1aB2lM:ref
Unfortunately I was unable to replicate the behavior I was seeing in a share-able model, so I never was able to figure out exactly what was happening. It might have been some different problem with the particular model we were using. I had recommended that we close the ticket back then, and I haven't run into the problem anymore. I think at the time I mentioned it might make sense to remove this post, but I wasn't sure how to do so. Sorry for the confusion.

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeSimulink Functions についてさらに検索

製品


リリース

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by