How to use a workspace variable to modify a popup mask parameter?
3 ビュー (過去 30 日間)
古いコメントを表示
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?
0 件のコメント
採用された回答
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 件のコメント
その他の回答 (0 件)
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!