Resolving Pan Conflicts

A naming conflict occurs because there is a Matlab function (pan.m) and an OpenECU model library (pan.mdl) with the same name. Either the Matlab function or the OpenECU model may be shadowed by the other, depending on the order of directories in your Matlab search path. This may cause any of the following errors:

??? Error using ==> putdowntext at xyz pan.
??? Error while evaluating uitoggletool ClickedCallback

??? Simulation of model 'pan' is not allowed because it is a block diagram library.

Warning: The file containing block diagram 'pan' is shadowed by a file of
the same name higher on the MATLAB path. This can cause unexpected
behaviour.

To verify which file is shadowed, you can use the following command at the MATLAB command prompt:

>> which('pan', '-ALL')
C:\openecu\model\pan.mdl
C:\MATLAB\toolbox\matlab\graph2d\pan.m        % Shadowed

Changing the Path Manually

The conflict can be resolved by changing the MATLAB path order. Steps:

  1. Click File->Set Path…

  2. In the Set Path window, select the path containing openecumodel

  3. Click Move to Top for OpenECU model, or Move to Bottom for MATLAB figure.

Note

Change the path before opening the model or creating a figure to avoid errors or warnings.

../_images/resolving_pan_conflicts_img1.png ../_images/resolving_pan_conflicts_img2.png

Changing the Path Automatically (OpenECU v2.4.0 and Newer)

OpenECU v2.4.0 contains a MATLAB script that can adjust the path for you. Here is an example:

oe_adjust_model_path('begin');    % moves the \openecu\model directory to the top of the MATLAB search path
open('model');
rtwbuild('model');
oe_adjust_model_path('end');      % moves the \openecu\model directory to the bottom of the MATLAB search path