フィルターのクリア

Simulink - how do I find the number of inputs to a block per second?

2 ビュー (過去 30 日間)
Abbey Stock
Abbey Stock 2021 年 2 月 11 日
回答済み: Hari 2024 年 4 月 24 日
Hi,
I am using system generator and I am trying to use a time division multiplexer block, but i am getting the error Output period = Input Period / Number of Inputs, is not an integer multiple of the system period. How do I calculate the Input period and number of inputs to know what I should set my system period as?
Thanks

回答 (1 件)

Hari
Hari 2024 年 4 月 24 日
Hi Abbey Stock,
I understand that you are working with a time division multiplexer block in System Generator and encountering an error related to the output period not being an integer multiple of the system period. Further, you want to calculate the input period and the number of inputs to correctly set your system period.
The error message suggests that the output period of your multiplexer (which is the input period divided by the number of inputs) needs to align with the system's clock period. This means your system period must evenly divide the output period.
To resolve your issue and calculate the necessary parameters:
  • Calculating Input Period: The input period is determined by the rate at which data enters the multiplexer block. If you're unsure, look at the configuration of the block feeding into the multiplexer or use the "get_param" function to programmatically extract the sample time of the block.
inputPeriod = get_param('yourModel/yourBlock', 'SampleTime');
  • Determining Number of Inputs: This can be a bit more straightforward; the number of inputs is typically a configurable parameter of the multiplexer block itself or can be inferred from the model setup.
  • Setting System Period: Once you have the input period and the number of inputs, calculate the desired output period "(OutputPeriod = InputPeriod / NumberOfInputs)" and adjust your system period so that it is an integer divisor of the output period.
  • Trial and Error: In some cases, you might need to experiment with different system periods to find one that satisfies the condition. Start with the calculated output period and try divisors of this period as your system period.
References for further exploration:
Hope this helps!

カテゴリ

Help Center および File ExchangeSources についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by