Sample time mismatch between IF block and Action Port in Action Subsystem.

Hello everyone,
I wanted to encrypt the subsystems of a model, to do that I added the unit delay(to break algebric loop) and tried to convert to model reference. But am receiving this error - 'Sample time [0, 1] of '.../If Action Subsystem/Action Port' does not match the discrete sample time of the If block '.../If' controlling its execution.' I am getting this error after adding the unit delay block, the IF block is present in one of the subsystems. Is there any other way to encrypt or is there any way I can solve this sample time issue.
Please explain in simple terms as I am relatively new to simulink.
Thanks in advance,
DV

댓글 수: 4

Could you share the model so that I can take a closer look at the model configuration?
Dhrupad
Dhrupad 2024년 9월 24일
편집: Dhrupad 2024년 9월 24일
The aim is to encrypt the subsystems in the drive train subsystem. But am not able to break the loops or convert it to model reference or generate a s function to encrypt the subsystems. @Malay Agarwal
Can you pls help
The model seems to be missing some files and variables requires to run it. Could you add those files, variables?
HI,
Initially, try to change to fixed step and select one Sample Time.

댓글을 달려면 로그인하십시오.

 채택된 답변

Jaimin
Jaimin 2024년 12월 24일
The error you are experiencing is due to a discrepancy in sample times between the If block and the Action Port within the If Action Subsystem. This usually occurs when the If block has a discrete sample time, but the Action Subsystem anticipates a different sample time.
Steps to Resolve the Sample Time Issue
Check Sample Times:
  • Open the “If block and check its sample time settings.
  • Ensure that the sample time of the If block matches the sample time of the Action Subsystem.
Adjust Sample Times:
  • Set the sample time of the “Action Subsystem to match the If block's sample time.
  • Alternatively, you can set both to inherit the sample time by using -1 (which means they will inherit the sample time from the parent system).
Use Rate Transition Blocks:
  • If you need to manage different sample times, consider using a Rate Transition block to handle the transition between different sample rates.
Model Reference Conversion:
  • When converting to a model reference, ensure that all blocks within the subsystem have compatible sample times and that any algebraic loops are properly broken.
For more information kindly refer following MathWorks documentation.
I hope this will be helpful.

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Programmatic Model Editing에 대해 자세히 알아보기

제품

질문:

2024년 9월 23일

댓글:

2025년 3월 11일

Community Treasure Hunt

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

Start Hunting!

Translated by