Simulink, Arduino,

2 Ansichten (letzte 30 Tage)
Daniel Potts
Daniel Potts am 1 Okt. 2016
Kommentiert: Walter Roberson am 18 Okt. 2016
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 Kommentar
Swarooph
Swarooph am 4 Okt. 2016
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.

Melden Sie sich an, um zu kommentieren.

Antworten (2)

Anusha Sridharan
Anusha Sridharan am 6 Okt. 2016
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 Kommentare
Walter Roberson
Walter Roberson am 16 Okt. 2016
Longhai ZHAO
Longhai ZHAO am 17 Okt. 2016
Thanks a lot.

Melden Sie sich an, um zu kommentieren.


Walter Roberson
Walter Roberson am 6 Okt. 2016
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 Kommentare
Longhai ZHAO
Longhai ZHAO am 18 Okt. 2016
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 am 18 Okt. 2016
Unfortunately I do not have an Arduino so I cannot completely install the Support Package or trigger a Deploy to Hardware.

Melden Sie sich an, um zu kommentieren.

Produkte

Community Treasure Hunt

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

Start Hunting!

Translated by