Reference to unknown symbol 'Init' under state Charge in 'Standby' error in stateflow is coming even though it is defined correctly and there is no typing error.

1 次查看(过去 30 天)
I am trying to make model of BMS in simulink. In State Machine of BMS following error is showing in one of the state,"Reference to unknown symbol 'Init' under state Charge in 'Standby' ". But syntax is correct and also there is no typing error. I tried to make a new identicle state to replace the old one, the error just moved to next state and after correcting from second state it returned to previous state. I am attaching copy of stateflow diagram and all other connected files. Please help regarding this error.

回答(1 个)

Yash
Yash 2023-8-30
Hi Vedant,
I have found two errors in your files.
1. Error:Invalid setting in 'Chart' for parameter 'maxCellV': This is because the variable 'maxCellV' is not defined in the 'data.mat' file. You can resolve this by defining 'maxCellV' in the base workspace.
2. Error: Reference to unknown symbol 'Init' under state Charge in 'Standby1': This error has occurred because you have not defined and assigned the 'Init' variable properly. Follow these steps to resolve it:
  • Replace "ChargeState=Charge.Init" with "ChargeState=Init" in the 'Standby1' state
  • In the Symbols Pane, right click the "ChargeState" variable and then click inspect. In the Type field, select "Enum: <class name>". Replace <class name> with "Charge".
  • Delete 'Init' variable from the symbols pane if it gets created automatically.
For more information, visit this page: Assign Enumerated Values in a Chart

类别

Help CenterFile Exchange 中查找有关 Complex Logic 的更多信息

产品


版本

R2023a

Community Treasure Hunt

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

Start Hunting!

Translated by