Is there any way to connect a dashboard block with a constant block by command ?
조회 수: 2 (최근 30일)
이전 댓글 표시
I want to connect a rotary switch block with a constant block by Matlab command. Is there any command to do that ?
댓글 수: 1
Arun Joe Joseph
2019년 9월 18일
Hi Abhijit,
Did you figure out the answer to this question, yet? If so, could you please share it? I would like to know the solution too.
I have asked a similar question, here:
답변 (2개)
Jesús Zambrano
2020년 1월 16일
Hi Abhijit,
You can find the step to connect dashboards block in the link below fomr the documentation:
In there you will see that you need to work with a Simulink.HMI.ParamSourceInfo object. Here I copy the specific workflow:
Connect and Configure the Slider Block
Use a Simulink.HMI.ParamSourceInfo object and the set_param function to connect the Slider block to the Gain parameter of the Mu block. To connect a parameter, the Simulink.HMI.ParamSourceInfo needs to specify the block path for the block that corresponds to the parameter and the name of the parameter.
slider_param = Simulink.HMI.ParamSourceInfo;
slider_param.BlockPath = Simulink.BlockPath('vdp/Mu');
slider_param.ParamName = 'Gain';
set_param('vdp/Slider',"Binding",slider_param)
Configure the scale for the slider for a range of 1 to 10 with a tick mark spacing of 1.
slider_limits = [1 1 10];
set_param('vdp/Slider',"Limits",slider_limits)
To remove the connection, do:
set_param('vdp/Slider',"Binding",[])
Hope it can help you.
댓글 수: 0
Nicolas Delachaume
2020년 5월 26일
Hello,
Have you got a solution for R2018a release because the above command line leeds to the error :
MWDashboardBlock block (mask) does not have a parameter named 'Binding'
Thanks
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Dashboard에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!