Add S-R flip flop to an if action subsystem, connected to a SwitchCase block.

조회 수: 6 (최근 30일)
Telmo
Telmo 2023년 2월 2일
답변: Suman Sahu 2023년 4월 7일
Hi,
I need to add flip flops and switch blocks to an "If action subsystem" block I'm working on but I'm constantly getting an error i can't fix, is it possible to add S-R Flip Flops to a "If action subsystem" connected to a SwitchCase block in Simulink?
The steps I followed are, Create SwitchCase block -> For case <x>, open "if action subsystem" -> Create Flip-flops to see if certain conditions from external inputs to the "if action subsystem" are met inside.
When trying to update the blocks for this model, i get the following error message:
Input data dependency violation due to function-call or action subsystems. See Subsystem Examples in the Simulink library for valid and invalid examples of function-call and action subsystems.
Component: Simulink | Category: Model error
Input ports (1) of 'If Action Subsystem10/S-R Flip-Flop/Logic' are involved in the loop.
This error repeats for every Flip-flop or switch block in the model.
Does the checking of the external inputs need to be done outside of the "If action subsystem" or is it possible to do it inside? It does look like it is "illegal" to check the values in the condition block.
Thanks in advance
  댓글 수: 2
Fangjun Jiang
Fangjun Jiang 2023년 2월 2일
It's easier if you could attach an example model.
Sai
Sai 2023년 2월 20일
Hi Telmo,
Can you please elaborate the sentence "Create Flip-flops to see if certain conditions from external inputs to the 'if action subsystem' are met inside." or attach any example model so that I could try from my end?

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

답변 (1개)

Suman Sahu
Suman Sahu 2023년 4월 7일
Hello Telmo,
The error message you are receiving suggests that there are input data dependency violations with the if action subsystem which could happen possibly due to following reasons:
  1. The flip flops use boolean data as inputs and outputs. So, make sure the data types are consistent.
  2. The input/output signals are not present at each time step when its time for execution. Note that all blocks in If Action Subsystem block must execute at the same rate as the driving if/switch case block.[link to the documentation]. So, make sure that input and output signals to the If Action Subsystem are generated at each time step.
Also, if you could provide an example model to reproduce the issue that you are facing.
Hope it helps.

카테고리

Help CenterFile Exchange에서 Schedule Model Components에 대해 자세히 알아보기

태그

제품


릴리스

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by