MATLAB: Do I receive an error when I use the multimeter block with a signal from a linear transformer when using the Power Systems Blockset

blockseterrorlinearmultimeterpowerSimscape Electricalsystemtransformer

Why do I receive an error when I use the Multimeter block with a signal from a Linear Transformer when using the Power Systems Blockset 2.2 (R12.1)?
When I select a certain signal in the multimeter dialogue, I receive the following error message:
Error evaluating 'InitFcn' of voltage Measurement block (mask)
....error using ==> set_param
Elements parameter in Selector block... must be greater than 1 and less than the input width
How can I avoid this error?

Best Answer

This problem is solved in Power System Blockset 2.3 (R13).
If you are using an earlier version of the Blockset, this is a bug with the Multimeter block and the Linear Transformer block. The problem occurs only under some particular situation. If you open the model and if you point the mouse to the multimeter block, Simulink will show you the parameters of the block. You should read certain values for the "sel" and "L" parameters
This setting is correct. The two values are used to set an internal Selector block inside the multimeter. The paramater "sel" is the selected signals and "L" is the total number of available signals. Now start the simulation then, after the error message, point again the mouse to the multimeter block. The parameters are now different.
The L parameter is not correct, it was not properly updated by Power System Blockset.
As a workaround for Power System Blockset 2.2 (R12), you can modify a line in the code of the MATLABROOT/toolbox/powersys/powersys/private/psbsort.m function:
lines 583 to 588 of psbsort are:
% Internal measurement popup.

switch mesurerequest{i};
case {'Magnetization current','All voltages and currents'}
mI{end+1} = ['Imag: ', nomdebloc];
Tmp0406{end+1,1}=size(psb.rlc,1);
end
there is one missing line. it must be :
% Internal measurement popup.
switch mesurerequest{i};
case {'Magnetization current','All voltages and currents'}
YiMultimeter{size(YiMultimeter,1)+1,1}=['I_b',num2str(size(psb.rlc,1)),';'];
mI{end+1} = ['Imag: ', nomdebloc];
Tmp0406{end+1,1}=size(psb.rlc,1);
end