Can't set data type to string in a Stateflow chart

Hello, I am working on a Stateflow project and I want to use a string datatype on a variable. I saw that the chart had to have its action language to C but even with this I can't set the datatype of my variable to string.

11 件のコメント

Jonas
Jonas 2021 年 4 月 22 日
What do you mean with you can't set the data type to string? You cannot find 'string' in the list of data types, or does it give an error?
Olivier NEYRET
Olivier NEYRET 2021 年 4 月 22 日
I just can't find string in the data type list
Jonas
Jonas 2021 年 4 月 23 日
Do you have the Simulink Coder license?
Olivier NEYRET
Olivier NEYRET 2021 年 4 月 23 日
I have actually Simulink and Stateflow licenses only but i think I can get it, is it mandatory to have it?
Jonas
Jonas 2021 年 4 月 23 日
On this documentation link, it says at the bottom of the page: "If you have Simulink Coder™ installed, you can use string data for simulation and code generation." This seems to suggest that if you do not have the Simulink Coder license installed, you cannot use string data for simulation and code generation. I find this statement a bit weird, because where else would you be able to use string data outside of simulation and code generation? That's what we do with Simulink, right...?
I have the Simulink Coder license and I can find the 'string' data type when creating a chart with C as the action language.
Before you go out procuring a Simulink Coder license, I would suggest to get confirmation from your sales representative or from a Service ticket.
Olivier NEYRET
Olivier NEYRET 2021 年 4 月 23 日
Thanks, i'll see with them and go get one then, thank you for your help Jonas.
Olivier NEYRET
Olivier NEYRET 2021 年 4 月 27 日
Hi again Jonas, I checked and I have the Simulink coder license, I retried with a new model to see if I have the possibility to use "String" data type as in your pictuer but I can't, do you have any other ideas?
Jonas
Jonas 2021 年 4 月 27 日
編集済み: Jonas 2021 年 4 月 27 日
In your 'Configuration Parameters', in the section 'Code Generation', what is your 'System target file'? Is it 'grt.tlc'?
Olivier NEYRET
Olivier NEYRET 2021 年 4 月 27 日
Yes it is
Jonas
Jonas 2021 年 4 月 27 日
I do not know how Simulink determines to show the 'string' option in the list or not. I would suggest creating a Service Ticket for this.
Ntiana Sakioti
Ntiana Sakioti 2021 年 7 月 1 日
What version are you using?

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

回答 (1 件)

Ntiana Sakioti
Ntiana Sakioti 2021 年 7 月 1 日

0 投票

Hi Olivier,
If I understand correctly you are trying to create a "string" variable in a Stateflow chart in R2016b. Please note that Stateflow did not support string datatypes until R2018bd. If you are able to I would suggest updating to a newer release in order to utilize this functionality.

カテゴリ

ヘルプ センター および File ExchangeSimulink Functions についてさらに検索

製品

リリース

R2016b

質問済み:

2021 年 4 月 22 日

回答済み:

2021 年 7 月 1 日

Community Treasure Hunt

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

Start Hunting!

Translated by