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

2 visualizaciones (últimos 30 días)
Abbey Stock
Abbey Stock el 11 de Feb. de 2021
Respondida: Hari el 24 de Abr. de 2024
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

Respuestas (1)

Hari
Hari el 24 de Abr. de 2024
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!

Productos

Community Treasure Hunt

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

Start Hunting!

Translated by