I tried to install a simulation for NXT using Simulink. When I open TestMotorOSEK.mdl, or anyone other *.mdl file in samples directory, and click nxtbuild('TestMotor_app', 'build') then I get an error:
### Model failed to compile with strict bus check on
### Turning strict bus check off
??? Error in S-function 'TestMotorOSEK/ExpFcnCalls Scheduler': S-Function 'sfun_expfcncallsscheduler' does not exist.
Error executing callback 'ClickFcn'
Error using ==> rtwbuild at 190
Model has compile errors.
I use:
-Windows 7 x64
-Matlab R2009b
-ECRobot
-firmware 1.05 (tried with 1.28 and 1.29 too)
-Cygwin 2.738
-Fantom driver
. . .
Can anyone help me, please?
ECRobot doesn't ship with the 64-bit mex files for the blocks, so Simulink errors out when you try to run or build a model. You have three options:
Option 1) If you have a supported C compiler installed on your 64-bit system, you can create the mex files yourself(http://www.mathworks.com/support/compilers/R2009b/win64.html ):
* In MATLAB, Go the to "ecrobotNXT\environment" folder
* Execute the following MATLAB code
files = dir('*.c');
for i=1:numel(files)
mex(files(i).name);
disp(files(i).name);
end
* You should now be able to run & build the ECRobot models
Option 2) Install 32-bit MATLAB on your 64-bit system, and then ECRobot should work with it. See the following link:
http://www.mathworks.com/support/solutions/en/data/1-579TVF/index.html?solution=1-579TVF
Make sure that you install 32-bit MATLAB in a folder that doesn’t have have any spaces in the path, i.e., don’t install in the default “c:\Program Files (x86)\”.
3) If you have a supported C compiler installed on your 64-bit system, you may also want to take a look at the Villanova University LEGO Real Time Target (VU-LRT):
http://www.mathworks.com/matlabcentral/fileexchange/29857
http://www.mathworks.com/academia/lego-mindstorms-nxt-software/legomindstorms-vulrt.html
VU-LRT also comes with the source code for the S-functions, so you can create the 64-bit mex files for all the blocks (see the included README.pdf).
Best,
Gautam
Thank you so much!
Best regards,
Nikolaj