Hello,
I have read one old post in 2017-04-20 similar to my problem but I still get the error below. I have run the matlab script "test.m" and get this error.
Invoke Error, Dispatch Exception:
Source: OpenDSSengine.Text
Description: Access violation at address 00000000A1D8AE52 in module 'OPENDS~1.DLL'. Read of address 0000000000000E20
Error in test (line 25)
DSSText.Command = 'Compile "Master.dss"';
I am using the OpenDSS Version 8.1.4.1 (64-bit build) and Matlab 2014b right now. I have attached all the file in the zip file below.
Could you help me figure out what is the problem? and How can i solve it ?
When you import OpenDSS, it can change your current working directory, so the file won't be found.
I'd agree that's a weird error message but it's easy to fix on the user's side. Either cd to the folder before compiling the file or provide the full path in the compile command. E.g., either of these should fix it:
EDIT: I was going to check the Pascal code to try to find the issue, but unfortunately it doesn't happen with the Free Pascal build in dss_capi/dss_python. Instead, the errors 242 and 243 happen as expected in ExecHelper.pas.
Traceback (most recent call last):
File "c:\temp\test_compile_redirect.py", line 6, in <module>dss.DSS.Text.Command=r'compile "c:\temp\file does not exist"'
File "C:\Python36\lib\site-packages\dss\_cffi_api_util.py", line 52, in __setattr__object.__setattr__(self,key,value)
File "C:\Python36\lib\site-packages\dss\dss_capi.py", line 4206, in CommandCheckForError()
File "C:\Python36\lib\site-packages\dss\dss_capi.py", line 35, in CheckForErrorraiseDssException(error_num,get_string(lib.Error_Get_Description()))dss.dss_capi.DssException: (242, 'Redirect File: "C:\\temp\\file does not exist.dss" Not Found.')
Last edit: Paulo Meira 2018-07-19
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi, Roger,
Since I installed Delphi Starter recently, I looked into it a bit further. It only happens in v8.
The access violation occurs when the error message is produced, happens down in Procedure TScriptEdit.PublishMessage(Msg : String); -- there, ControlPanel is null (which I think is expected in the COM DLL?)
If doesn't happen with FPC mainly because it doesn't use ScriptEd or any forms anywhere.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
It has been solved and uploaded into the repository. The problem with VCL forms in delphi is that they don't support multithreading, for this reasons in version 8 (EXE) we are publishing everything in the results window of the frontal panel. The procedure PublishMessage was created to send a message (Synch) from an actor the the host to let him know something or just to publish information.
In the recent fix, I've modified the code so if OpenDSS is a DLL (COM/DLL) the message window will appear since the host is out of OpenDSS. This should work.
Best regards
Davis
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hello,
I have read one old post in 2017-04-20 similar to my problem but I still get the error below. I have run the matlab script "test.m" and get this error.
Invoke Error, Dispatch Exception:
Source: OpenDSSengine.Text
Description: Access violation at address 00000000A1D8AE52 in module 'OPENDS~1.DLL'. Read of address 0000000000000E20
Error in test (line 25)
DSSText.Command = 'Compile "Master.dss"';
I am using the OpenDSS Version 8.1.4.1 (64-bit build) and Matlab 2014b right now. I have attached all the file in the zip file below.
Could you help me figure out what is the problem? and How can i solve it ?
Last edit: Paddysomnang 2018-07-18
Hi,
This line is actually enough to reproduce the issue:
When you import OpenDSS, it can change your current working directory, so the file won't be found.
I'd agree that's a weird error message but it's easy to fix on the user's side. Either
cd
to the folder before compiling the file or provide the full path in the compile command. E.g., either of these should fix it:or
EDIT: I was going to check the Pascal code to try to find the issue, but unfortunately it doesn't happen with the Free Pascal build in dss_capi/dss_python. Instead, the errors 242 and 243 happen as expected in
ExecHelper.pas
.Last edit: Paulo Meira 2018-07-19
Interesting. It should just give a file not found message -- 242 or 243. Maybe it is raising an exception that is not handled properly.
Hi, Roger,
Since I installed Delphi Starter recently, I looked into it a bit further. It only happens in v8.
The access violation occurs when the error message is produced, happens down in
Procedure TScriptEdit.PublishMessage(Msg : String);
-- there,ControlPanel
is null (which I think is expected in the COM DLL?)If doesn't happen with FPC mainly because it doesn't use
ScriptEd
or any forms anywhere.Oh. That's probably something to do with the parallel processing. There's not a control panel automatically instantiated.
Looks like a job for Davis!!
Hello
It has been solved and uploaded into the repository. The problem with VCL forms in delphi is that they don't support multithreading, for this reasons in version 8 (EXE) we are publishing everything in the results window of the frontal panel. The procedure PublishMessage was created to send a message (Synch) from an actor the the host to let him know something or just to publish information.
In the recent fix, I've modified the code so if OpenDSS is a DLL (COM/DLL) the message window will appear since the host is out of OpenDSS. This should work.
Best regards
Davis
Hi Davis,
I got the same error, and what I tried to do is to control OpenDSS from Matlab:
Could you tell me how to debug it?
Update: when I updated the OpenDSS to v.8.2.0.1, there is no error.
Thanks.
Last edit: Yan Chen 2018-10-02
Hi,
Update your local installation files to the current one. Download the files from:
https://sourceforge.net/p/electricdss/code/HEAD/tree/trunk/Version8/Distrib/x64/
That should solve everything
Best regards
Davis