Page 1 of 1

error while opening Master Block or compiling model

Posted: Thu Apr 19, 2007 11:50 pm
by arci
I downloaded your dspic library for simulink/matlab, but it generates error msg sometimes,"error:evaluating "OpenFcn" callback of masterblock .......named 'LDPICTYPE' ". My simulink file contains only dspic master block and when double click this block, error occured.


arci

Posted: Fri Apr 20, 2007 12:39 am
by LubinKerhuel
Hi Arci,

You are not using the last version of the toolbox.

I noticed this problem and the new version would give a more comprehensive error message :

Error evaluating 'OpenFcn' callback of Master block (mask) 'Master'. Error using ==> <a href="error:C:\prog\Matlab2\RTWdsPIC\blocks\dsPIC_ConfigRTWOption.m,24,1">dsPIC_ConfigRTWOption at 24</a>
The *System Target File must be defined to dsPIC Real Time workshop (Simulation ==> Configuration Parameters ==> Real Time workshop.


When you get this message ( or the one you obtain with the older toolbox described in the previous post)

You MUST go to the
Simulation menu, then
Configuration Parameters, and go to the
Real Time Workshop menu and Set the
System Target File to dsPIC (It must be in the list)


Please, have a look on the first part of the "Sinus PWM" animation where I build a small diagram for dsPIC from scratch : http://www.kerhuel.eu/RTWdsPIC/examples/SinusPWM.html

Lubin

Re: error while opening Master Block or compiling model

Posted: Mon Feb 18, 2008 4:35 pm
by barryforever
I receive the same error when i try compiling using mplab c30 using the mplab matlab tool
This is what i get

Code: Select all

Opening Matlab session and model 'C:\Documents and Settings\Barry\My Documents\MATLAB\idid\deport.mdl'
Please wait...

Warning: Error evaluating 'LoadFcn' callback of
Master block (mask) 'Master'. Error using ==>
dsPIC_ConfigRTWOption at 34
The *System Target File must be defined to dsPIC
Real Time workshop (Simulation ==> Configuration
Parameters ==> Real Time workshop.
> In <a href="error:C:\Program Files\Microchip\MPLAB IDE\Tools\Matlab\MplabOpenModel.m,14,1">MplabOpenModel at 14</a>
Warning: In instantiating linked block
'deport/Master' : Invalid setting in Master block
(mask) 'Master' for parameter 'MCLR'.
> In <a href="error:C:\Program Files\Microchip\MPLAB IDE\Tools\Matlab\MplabOpenModel.m,14,1">MplabOpenModel at 14</a>

I use MATLAB R2007b and MPLAB 8 and your toolbox 18.02.08

Re: error while opening Master Block or compiling model

Posted: Mon Feb 18, 2008 8:15 pm
by LubinKerhuel
The blockset is not compatible yet with the MPLAB plugging that open and "import" the C code generated into MPLAB.

I recommend compiling the mdl schematic into a .hex file from simulink. You can import C code using the "custom C function block" (only on the registered version of the blockset).

If you want to import the C code generated into a MPLAB project, use the procedure described here.