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

1 vue (au cours des 30 derniers jours)
Evelyn
Evelyn le 30 Août 2023
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?

Réponse acceptée

Ayush
Ayush le 6 Sep 2023
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

Plus de réponses (0)

Tags

Produits


Version

R2023a

Community Treasure Hunt

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

Start Hunting!

Translated by