Stateflow variable is not exported as XML

4 views (last 30 days)
Woongsik
Woongsik on 9 Aug 2023
Answered: Ayush on 29 Aug 2023
Stateflow variables are not exported to XML. What would be the possible solutions?
(All of stateflow variables are not generated to XML.)
Attached is the example of variable properly propagated to XML.

Answers (2)

Rohit Kulkarni
Rohit Kulkarni on 23 Aug 2023
Edited: Rohit Kulkarni on 23 Aug 2023
Hi,
In my understanding you are trying to export the stateflow variables to XML format, Please use the following command:
save_system('mymodel','exportfile.xml','ExportToXML',true)
Refer to this documentation for details: Save Simulink model - MATLAB save_system - MathWorks India
Thanks

Ayush
Ayush on 29 Aug 2023
I understand that you are facing the issue where Stateflow variables are not exported to XML, there are a few possible solutions you can try:
  1. Check variable scoping: Ensure that the Stateflow variables you want to export are properly scoped. Stateflow variables have different scopes, such as local, input, output, and data store memory.
  2. Enable variable export: Verify that the option to export Stateflow variables is enabled. By default, Stateflow variables are exported to XML, but it's possible that this setting has been changed.
  3. Check variable usage: Ensure that the Stateflow variables you want to export are used within the Stateflow chart.
  4. Verify XML export options: Double-check the XML export options to ensure that variables are included in the exported XML file. When exporting XML, there are various options available, such as including states, transitions, events, and variables. Make sure the appropriate options are selected to include variables in the exported XML.
  5. Use the following command to save model as XML file:
save_system('mymodel','exportfile.xml','ExportToXML',true)
You may refer to following link to read further on how to save model as XML file:
Thanks,
Ayush Jaiswal

Tags

Community Treasure Hunt

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

Start Hunting!