Simulink Signals Data Types

1 回表示 (過去 30 日間)
Luca Ferro
Luca Ferro 2023 年 1 月 4 日
コメント済み: Luca Ferro 2023 年 1 月 6 日
I have a script which creates simulink bus creators and their relative input/oupt blocks programmatically from a simulink data dictionary.
In some cases it is needed to have the same signal as an input in different buses and i have not found a solution to reference the data dictionary signal multiple times across the project.
I would like to have diffent signal block names for the same signals, but only one reference entry in the data dictionary.
I was wondering if there is an explicit casting type for signals as the one for buses that would do the trick:
Pretty much allong the lines of: Signal: <signal name>

採用された回答

Fangjun Jiang
Fangjun Jiang 2023 年 1 月 4 日
The best approach is to Create Duplicate Inport Blocks.
To do it by script, I think you only need to set the duplicated port number.
"In2" and "In3" are block name, not signal name.
You can set the data type for the signal as long as the data type is defined. The data type could be those built-in, such as single, int8, etc. or defined in your data dictionary. Take a look at all the possible options in the "Output data type" dropdown list.
  7 件のコメント
Fangjun Jiang
Fangjun Jiang 2023 年 1 月 5 日
The error must have been caused by the "multiple" references. The "resolution" can only be done at only one place, the true source of that signal. All other places are destinations, not soure. They inherit the signal data type.
Luca Ferro
Luca Ferro 2023 年 1 月 6 日
For know i will workaround this issue by creating multiple clones of the same signal with a different naming convention in the data dictionary and reference them singularly. It is not as clean but it does the job pretty conveniently. If i somehow progress on the matter with the other method i will let you know here.

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

その他の回答 (0 件)

カテゴリ

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

製品


リリース

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by