Simulink, Arduino,

3 ビュー (過去 30 日間)
Daniel Potts
Daniel Potts 2016 年 10 月 1 日
コメント済み: Walter Roberson 2016 年 10 月 18 日
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 件のコメント
Walter Roberson
Walter Roberson 2016 年 10 月 16 日
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