フィルターのクリア

about test point during code generation

38 ビュー (過去 30 日間)
wenchao zhang
wenchao zhang 2024 年 7 月 10 日 11:36
コメント済み: wenchao zhang 2024 年 7 月 10 日 13:02
hello, what's the purpose of test point in code generation, an how it realized. i'm not clear about this.

採用された回答

Fangjun Jiang
Fangjun Jiang 2024 年 7 月 10 日 12:11
If it is a test point, code generation makes sure to allocate dedicated memory and generate variable for it so you can observe this signal. If it is not a test point, there might be a varialbe (e.g. TempVar) for this but this TempVar might be re-used later in the code so you won't be able to observe the value of this variable reliably. In aother case, if there are two consective Gain blocks (times 5 and then times 10), the code might be optimized as times 50. If the signal in between these two Gain blocks is a test point, then you will be able to observe the signal after times 5.
  3 件のコメント
Fangjun Jiang
Fangjun Jiang 2024 年 7 月 10 日 12:33
編集済み: Fangjun Jiang 2024 年 7 月 10 日 12:35
If it is a time varying signal, Yes. If it is a "parameter", meaning the value never changes during a run, then INCA has better way to observer that single value.
"test point" forces to generate code for the point. You might want to use signal logging for measurement.
Check the user guide for INCA too.
wenchao zhang
wenchao zhang 2024 年 7 月 10 日 13:02
yes, the parameter i want measure will change with the time.

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

その他の回答 (1 件)

Himanshu
Himanshu 2024 年 7 月 10 日 11:55
編集済み: Himanshu 2024 年 7 月 10 日 12:08
Hi,
I see that you want to understand the purpose of test points in code generation.
A test point is a signal in Simulink that is guaranteed to be observable when using a Floating Scope block in a model. Simulink allows you to designate any signal in a model as a test point.
Designating a signal as a test point exempts the signal from model optimizations, such as signal storage reuse and block reduction. These optimizations can render signals inaccessible and unobservable during simulation. Signals designated as test points will not have algebraic loops minimized, even if the "Minimize algebraic loop occurrences" option is selected.
Test points are primarily intended for use when generating code from a model with Simulink Coder. Marking a signal as a test point ensures that it remains observable and is not affected by model optimizations that can obscure its behavior.
Please refer to the documentation below to learn more about configuring signals as test points and the appearance of test points in the generated code.
How Generated Code Stores Internal Signal, State, and Parameter Data - Appearance of Test Points in the Generated Code: https://www.mathworks.com/help/rtw/ug/how-generated-code-stores-internal-signal-state-and-parameter-data.html#f1043283
I hope this helps.

カテゴリ

Help Center および File ExchangeTest Model Components についてさらに検索

製品


リリース

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by