How to use a workspace variable to modify a popup mask parameter?

조회 수: 3 (최근 30일)
Evelyn
Evelyn 2023년 8월 30일
답변: Ayush 2023년 9월 6일
I'm using the C2000 blockset for some power conversion applications. I have a simulink model that uses the C2000 ePWM block, and I would like to be able to change some of the popup parameters using the value of a workspace variable to support different hardware configurations. For example, I would like to change the "useModule" parameter using a workspace variable. How can I go about this?

채택된 답변

Ayush
Ayush 2023년 9월 6일
Hi Evelyn,
I understand that you want to change the mask parameters of the C2000 ePWM block using a workspace variable.
It can be by importing the model into MATLAB script and setting the mask parameter by using the set_param function with a pre-defined workspace variable. You can refer to the below documentation to know more about the “set_param” function:
Here is a code snippet for the same:
% load the model in the script
load_system('test');
% defining workspace variable
hardware_config='ePWM8'
% setting the parameter 'useModule' to the defined workspace variable
set_param('test/ePWM','useModule',hardware_config)
% getting the list all the mask parameters
%get_param('test/ePWM','DialogParameters')
Hope it helps,
Regards,
Ayush Misra

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Event Functions에 대해 자세히 알아보기

태그

제품


릴리스

R2023a

Community Treasure Hunt

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

Start Hunting!

Translated by