Dear BCVTB Team
I suffer difficulty that BCVTB cannot connect with MATLAB. It showed the error, "establishbsdsocket.mexw64".
Here is my computer environment.
1. OS: Windows 7 Home Premium / Windows 8.1 -- 64bit (I tried both OSs)
2. EnergyPlus: ver. 7.2
3. BCVTB: ver. 1.4.0 (old version of BCVTV did not work properly, too.)
4. MATLAB: ver. 2014a
5. MEX compiler: Windows 7.1 SDK (C/C++)
6. Java: JRE 7 and JRE 8 (both versions were installed)
BCVTB could run the example of "ePlus72-schedule" well. However, the example of "ePlus72Simulink-simple failed to run.. This is error messege.
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
<Error from BCVTB>
ptolemy.kernel.util.IllegalActionException: SocketTimeoutException while reading from client in .system.Simulink:
Accept timed out.
Try to increase the value of the parameter 'socketTimeout'.
It could be that the client "C:/Program Files/MATLAB/R2014a/bin/matlab.exe" is not executing properly. From the command line, try running:
C:/Program Files/MATLAB/R2014a/bin/matlab.exe "-nosplash -nojvm -logfile matlab.log -r simulateAndExit"
You should see something like:
Simulation model has time step 60
Error: Failed to obtain socket file descriptor. sockfd=-1.
The error message is expected because Ptolemy is not present.
Also, make sure that the directory that contains
"bcvtb.dll" (on Windows), "libbcvtb.so" (on Linux) or
"libbcvtb.dylib" (on Mac OS X) is on yourPATH, LD_LIBRARY_PATH or DYLD_LIBRARY_PATH for Windows,
Linux and Mac OS X respectively.
That directory contains the shared library used by the simulator.
Client subprocess exit value (should be 0): 0
in .system.Simulink
Because:
Accept timed out
at lbnl.actor.lib.Simulator._readFromServer(Simulator.java:475)
at lbnl.actor.lib.Simulator.initialize(Simulator.java:781)
at ptolemy.actor.Director.initialize(Director.java:943)
at ptolemy.actor.Director.initialize(Director.java:912)
at ptolemy.actor.sched.StaticSchedulingDirector.initialize(StaticSchedulingDirector.java:155)
at ptolemy.domains.sdf.kernel.SDFDirector.initialize(SDFDirector.java:534)
at ptolemy.actor.CompositeActor.initialize(CompositeActor.java:902)
at ptolemy.actor.Manager.initialize(Manager.java:669)
at ptolemy.actor.Manager.execute(Manager.java:340)
at ptolemy.actor.Manager.run(Manager.java:1202)
at ptolemy.actor.Manager$PtolemyRunThread.run(Manager.java:1760)
Caused by: java.net.SocketTimeoutException: Accept timed out
at java.net.DualStackPlainSocketImpl.waitForNewConnection(Native Method)
at java.net.DualStackPlainSocketImpl.socketAccept(Unknown Source)
at java.net.AbstractPlainSocketImpl.accept(Unknown Source)
at java.net.PlainSocketImpl.accept(Unknown Source)
at java.net.ServerSocket.implAccept(Unknown Source)
at java.net.ServerSocket.accept(Unknown Source)
at lbnl.actor.lib.net.Server.read(Server.java:225)
at lbnl.actor.lib.Simulator._readFromServer(Simulator.java:382)
... 10 more
Caused by: java.net.SocketTimeoutException: Accept timed out
at java.net.DualStackPlainSocketImpl.waitForNewConnection(Native Method)
at java.net.DualStackPlainSocketImpl.socketAccept(Unknown Source)
at java.net.AbstractPlainSocketImpl.accept(Unknown Source)
at java.net.PlainSocketImpl.accept(Unknown Source)
at java.net.ServerSocket.implAccept(Unknown Source)
at java.net.ServerSocket.accept(Unknown Source)
at lbnl.actor.lib.net.Server.read(Server.java:225)
at lbnl.actor.lib.Simulator._readFromServer(Simulator.java:382)
at lbnl.actor.lib.Simulator.initialize(Simulator.java:781)
at ptolemy.actor.Director.initialize(Director.java:943)
at ptolemy.actor.Director.initialize(Director.java:912)
at ptolemy.actor.sched.StaticSchedulingDirector.initialize(StaticSchedulingDirector.java:155)
at ptolemy.domains.sdf.kernel.SDFDirector.initialize(SDFDirector.java:534)
at ptolemy.actor.CompositeActor.initialize(CompositeActor.java:902)
at ptolemy.actor.Manager.initialize(Manager.java:669)
at ptolemy.actor.Manager.execute(Manager.java:340)
at ptolemy.actor.Manager.run(Manager.java:1202)
at ptolemy.actor.Manager$PtolemyRunThread.run(Manager.java:1760)
<Error from MATLAT>
Error occurred: simulateAndExit (line 2)
Error while obtaining sizes from MEX S-function 'establishBSDSocket' in 'controller/socketIO/establishSocket/establishBSDSocket'.
Cause:
Error occurred: simulateAndExit (line 2)
Invalid MEX-file 'C:\BCVTB\lib\matlab\establishBSDSocket.mexw64': can't find this module.
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Could you check why this error was occurred? Another thing is that BCVTB runs well with MATLAB 2014a on Windows 7 Professional version (64bit and JRE 7). I don't know why this error is occurred on Windows 7 Home Premium and 8.1.
I am looking forward to hearing from you soon.
Best Regards
Yoon