Reputation: 455
I am following this MathWorks File Exchange Link. I am having problem while running the myarduino_blink.slx
demo.
My MATLAB version is R2015a, and I am using an Arduino Uno. I ran the file setup_custom_target_arduino.m
after changing the relevant directory listing and the arduino version in the m file, and I got the output of Arduino on COM 3, which was correct.
After this, I checked the Simulink Library Browser and I had the Custom C/C++ Target Arduino Library will all its modules. Now when I simulate the model, I get the following error:
Error in S-function 'myarduino_blink/Digital Output':
S-Function 'sfunar_digitalOutput' does not exist
Kindly help me out, what could I have done wrong?
Update 1
Ok, I solved the "does not exist" problem. Apparently, no MEX compiler was installed. So I installed the Windows SDK, then re-ran the m file and now I am able to generate the .mex64 files. Now I run into another problem, when I build the simulink model, it gives this error:
Build procedure for model: 'myarduino_blink' aborted due to an error
How to solve this?
Upvotes: 0
Views: 1080
Reputation: 10772
setup_custom_target_arduino.m
calls build_all_sfunctions.m
which should compile all of the S-Functions in the blocks
directory. It looks as if that hasn't occurred for some reason. Check in the blocks
directory that each of the S-Functions has a .c
, .tlc
(both of which come with the package) and a .mex64
(which is the compiled version of the .c
generated by build_all_sfunctions.m
) file.
If they are not there then the setup hasn't executed correctly, and you'll need to compile all of the S-Functions. If they are there then you most likely have some sort of path issue (although since you say you can see the library in the library browser this seems unlikely).
Upvotes: 1