0

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?

1
  • Please add more information. Commented May 24, 2015 at 14:21

1 Answer 1

1

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).

Sign up to request clarification or add additional context in comments.

2 Comments

Thanks, solved a part of the problem, now I ran into another one, mentioned in the update to the question.
You're going to have to give us more than that very generic, and next to useless error message. Are you sure there isn't a second part to the message giving more specific information?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.