How to input a signal to a Simulink Function within a Stateflow Chart?
1 回表示 (過去 30 日間)
古いコメントを表示
I am doing a simple bidirectional converter, and I would like to use a Stateflow chart to choose between different modes of operation (Buck or Boost). In the Chart, I defined a Simulink Function to control the duty cycle. After choosing the right mode based on input and output voltages. I would like to input the reference voltage and the feedback output voltage from the converter and get the duty cycle as output. I am getting the following error "'Simple_buck_boost_convertor_system/Chart/Motoring.Boost.Boost_Mood/Controller' has sample time '0'. Only constant (inf) or inherited (-1) sample times are allowed in 'function call' subsystem 'Simple_buck_boost_convertor_system/ChartMotoringg.Boost.Boost_Mood'."
PS: This is the first time I use Stateflow and logic charts.
0 件のコメント
回答 (1 件)
Nick Choi
2017 年 12 月 6 日
編集済み: Nick Choi
2017 年 12 月 6 日
Based off of the error message, it seems as though the function call block is set to have a sample time of zero. Since the inputs to the function are signals from Simulink and have a sample time, the function call block's sample time should be set to 'inf' or the block should inherit its sample time from the inputs. Otherwise, it cannot run/simulate properly.
You can go to 'Display' > 'Sample Time' > 'All' to see which sample times are used throughout the model.
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Simulink Functions についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!