Simulink, Arduino,

2 次查看(过去 30 天)
Daniel Potts
Daniel Potts 2016-10-1
I'm testing a Pulse Generator and Digital Output with the Arduino Uno/ simulink library. After clicking, "deploy to hardware," Under Code Generation, I get the error:
'D:\Program' is not recognized as an internal or external command, operable program or batch file.
### Build procedure for model: 'untitled' aborted due to an error. Error(s) encountered while building "untitled": ### Failed to generate all binary outputs.
  1 个评论
Swarooph
Swarooph 2016-10-4
What's your current folder? You can retrieve this using the command pwd. You need write permissions in the current directory for you to be able to deploy the model. I am suspecting you are in a 'Program Files' folder or some other system folder.. Try doing this from the Desktop or My Documents folder.

请先登录,再进行评论。

回答(2 个)

Anusha Sridharan
Anusha Sridharan 2016-10-6
This looks like it could be due to the way your environment variables might be set up. From your error message, it look like the path is being incorrectly read as 'D:\Program' instead of 'D:\Program Files\...'
You could try replacing the 'Program Files' part of the path with 'Progra~1' or 'Progra~1' if for Program Files (x86) such that the folder is looked up correctly. You could also restore your PATH and other environment variables to their initial values by entering the following in the MATLAB Command Window:
>> restoredefaultpath
>> rehash toolbox
>> save path
However, note that this would reset all of your environment variables to the default values and you would have to manually re-add the path to any custom/third-party toolboxes.
  3 个评论
Longhai ZHAO
Longhai ZHAO 2016-10-17
Thanks a lot.

请先登录,再进行评论。


Walter Roberson
Walter Roberson 2016-10-6
Some of the older Simulink releases were not able to handle spaces or non-ASCII characters in directory names or file names. Sometimes the problem was in third-party tools.
The easiest way to handle this is to create a new (series of) directories from the top of a drive filesystem, with no spaces or non-ASCII characters in the names, and to copy the models into there, and to build there.
Sometimes, though, you also ended up needing to install the tools themselves into safe directory names.
I think the last couple of releases have caught the majority of the problems. It would, however, not surprise me if some of the toolkits for something like Xilinx are not completely safe.
The problem has to do with the tools blindly substituting in full filenames (with directories) into scripts without putting double-quotes (") around the names. For example
mkdir %DESTINATION%
would fail if %DESTINATION% had a space in it; a safe tool would have used
mkdir "%DESTINATION%"
  2 个评论
Longhai ZHAO
Longhai ZHAO 2016-10-18
Thank you very much for your answer in "https://cn.mathworks.com/matlabcentral/answers/305340#comment_398984"
I have replaced 'Program Files' part of the path with 'Progra~1', but the same error comes again. Would you please help me to handle this problem? Thank you very much.
Walter Roberson
Walter Roberson 2016-10-18
Unfortunately I do not have an Arduino so I cannot completely install the Support Package or trigger a Deploy to Hardware.

请先登录,再进行评论。

产品

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by