0

Good day,

The issue is related to getting the data that specify the characteristics of components in SIMULINK.

I have the solar module block in SIMULINK.

When I double click on it, many parameters are displayed.

These parameters can be changed by the user. For example, Voc, Isc, Vm and Im.

There are thousands of PV modules in SIMULINK library. I want to collect some data for around 100 PV modules for the purpose of doing some statistics about PV modules.

I want to create, for example, an Excel sheet that contains all parameters displayed in the PV module including Pm, Vm, Im, Voc, Isc, IL, Rs…etc.

These are highlighted in the following image:

PV module

I know that I can do it easily by clicking on the PV module and filling the Excel file manually but this will take a long time as I have to see around 100 PV modules and do the filling manually which is boring and may be subjected also to errors in filling the data.

Is there an easier way to get these data?

Can I get in some way these data (surrounded by squares in the above figure) saved in the workspace or in any place in MATLAB so that I just have to copy and paste the data from each PV module to the Excel file so that I can avoid the manual writing of these values in Excel.

Regards

1 Answers1

0

you can do this using a matlab script with the get_param command.

What you should do is:

  • Find within the Simulink model all the blocks of the PV block type

For instance this would give you the constant blocks in the currently opened Simulink model:

% Find all the constants within the model
ConstList = find_system(bdroot,'SearchDepth',1,'BlockType','Constant');

Be aware that the SearchDepth parameter tells you how deep these block can be in the subsystems, modify this according to the location of your blocks.

-Go by each element of the list and get the values of the paramenters:

% Get the number of blocks
l = length(ConstList);
% Loop to get the parameter
for i = 1:l
   Value(i) = get_param(ConstList(i),'Value');
end

In your case you have more than one parameter, so you'll have to create a table not a single array.

Once you have the values in a matlab variable it is easy to export them to excel.

Rakis
  • 1
  • OK. Thanks. Actually, when I execute the find_system command, it gives me: 0×1 empty cell array. Thanks for your help. – user1178884 May 13 '20 at 14:51