S-Function cannot find a file (.exe) but it is clearly in the Matlab path
Hello,
I am working with a third party software (CarSim 2021) that is using a controller provided by a supplier as a black box. I have added Directory1 and its sub-folders to the Matlab path. The error message is (some names modified):
Error reported by S-function ‘Sfun_GenericSM_blahblah’ in ‘Directory1/Directory2/Directory3/Controller/ESP Controller Interface/ESP8’:
===> !!! Error GetLastError(2): File anExecutable.exe does not exist !!!
I can navigate to the .exe file and run it in my working directory within Directory1. I copied "anExecutable.exe" in additional locations within the Directory1 and Directory2 to address any potential path issue. I do see Sfun_GenericSM_blahblah.mexw64 in the path (as mentioned in https://www.mathworks.com/matlabcentral/answers/735042-s-function-does-not-exist-but-is-clearly-in-the-matlab-path).
I know this model ran on a different machine in the past; but, not sure about the Matlab version. I used both Matlab 2017b and 2023b. I get the same error.
I do not have access to the source code and the block SFunction parameters does not explicitly refer to the .exe file when I open the block parameters dialouge box.
Is there a way to point the model to the file (.exe) that it cannot find?
Thanks for the help!Hello,
I am working with a third party software (CarSim 2021) that is using a controller provided by a supplier as a black box. I have added Directory1 and its sub-folders to the Matlab path. The error message is (some names modified):
Error reported by S-function ‘Sfun_GenericSM_blahblah’ in ‘Directory1/Directory2/Directory3/Controller/ESP Controller Interface/ESP8’:
===> !!! Error GetLastError(2): File anExecutable.exe does not exist !!!
I can navigate to the .exe file and run it in my working directory within Directory1. I copied "anExecutable.exe" in additional locations within the Directory1 and Directory2 to address any potential path issue. I do see Sfun_GenericSM_blahblah.mexw64 in the path (as mentioned in https://www.mathworks.com/matlabcentral/answers/735042-s-function-does-not-exist-but-is-clearly-in-the-matlab-path).
I know this model ran on a different machine in the past; but, not sure about the Matlab version. I used both Matlab 2017b and 2023b. I get the same error.
I do not have access to the source code and the block SFunction parameters does not explicitly refer to the .exe file when I open the block parameters dialouge box.
Is there a way to point the model to the file (.exe) that it cannot find?
Thanks for the help! Hello,
I am working with a third party software (CarSim 2021) that is using a controller provided by a supplier as a black box. I have added Directory1 and its sub-folders to the Matlab path. The error message is (some names modified):
Error reported by S-function ‘Sfun_GenericSM_blahblah’ in ‘Directory1/Directory2/Directory3/Controller/ESP Controller Interface/ESP8’:
===> !!! Error GetLastError(2): File anExecutable.exe does not exist !!!
I can navigate to the .exe file and run it in my working directory within Directory1. I copied "anExecutable.exe" in additional locations within the Directory1 and Directory2 to address any potential path issue. I do see Sfun_GenericSM_blahblah.mexw64 in the path (as mentioned in https://www.mathworks.com/matlabcentral/answers/735042-s-function-does-not-exist-but-is-clearly-in-the-matlab-path).
I know this model ran on a different machine in the past; but, not sure about the Matlab version. I used both Matlab 2017b and 2023b. I get the same error.
I do not have access to the source code and the block SFunction parameters does not explicitly refer to the .exe file when I open the block parameters dialouge box.
Is there a way to point the model to the file (.exe) that it cannot find?
Thanks for the help! sfunction, finding external file, path problem MATLAB Answers — New Questions