How to input a signal to a Simulink Function within a Stateflow Chart?

1 visualización (últimos 30 días)
Adel Muhandes
Adel Muhandes el 4 de Dic. de 2017
Editada: Nick Choi el 6 de Dic. de 2017
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.

Respuestas (1)

Nick Choi
Nick Choi el 6 de Dic. de 2017
Editada: Nick Choi el 6 de Dic. de 2017
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.

Categorías

Más información sobre Simulink Functions en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by