Use Vars(Enums) from Workspace in SimEvent EntityGenerator

4 ビュー (過去 30 日間)
Simon
Simon 2023 年 9 月 12 日
コメント済み: Simon 2023 年 9 月 12 日
Hello,
I've defined some Enums in Matlab and want to assign its Values to an Entity in a SimEvents Entity Generator.
(Assigning them during Generation).
I wanted to assign "entity.ID = Workpieces.ID"
I'm getting the error "Data type of parameter 'Workpieces' is not supported in event actions.".
Assigning "entity.ID = TestID" where TestID is a simple workspace variable works.
Workpieces.ID and TestID have the same DataType.
Does anybody have an idea why the assignment above is not allowed?
Thanks!

回答 (1 件)

Laurent Royer
Laurent Royer 2023 年 9 月 12 日
Hi Simon,
Did you create the Workpieces enum with a class m-file?
How did you configure the entity type of your Entity Generator block?
If you select Entity type = "Bus object", and you define this bus object to have an ID element with data type "Enum: Workpieces", the command "entity.ID = Workpieces.ID" should work.
  1 件のコメント
Simon
Simon 2023 年 9 月 12 日
Hey Laurent,
thanks for the answer.
Yes I did create the enum with a class m-file.
I was working with a Structured Entity type so far.
I'll try out the BusObject later on to see if it works.

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

カテゴリ

Help Center および File ExchangeDiscrete-Event Simulation についてさらに検索

製品


リリース

R2023a

Community Treasure Hunt

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

Start Hunting!

Translated by