Menu

Invoke Error, Dispatch Exception, Access violation at address 00000000A1D8AE52 in module 'OPENDS~1.DLL'. Read of address 0000000000000E20

2018-07-18
2018-10-03
  • Paddysomnang

    Paddysomnang - 2018-07-18

    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
  • Paulo Meira

    Paulo Meira - 2018-07-19

    Hi,
    This line is actually enough to reproduce the issue:

    DSSObj.Text.Command = 'Compile "this file doesnt exist"'
    

    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:

    cd 'C:\path\to\LV'
    DSSObj.Text.Command = 'Compile "Master.dss"';
    

    or

    DSSObj.Text.Command = 'Compile "C:\path\to\LV\Master.dss"';
    

    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 Command
        CheckForError()
      File "C:\Python36\lib\site-packages\dss\dss_capi.py", line 35, in CheckForError
        raise DssException(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
  • Roger Dugan

    Roger Dugan - 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.

     
    • Paulo Meira

      Paulo Meira - 2018-07-19

      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.

       
  • Roger Dugan

    Roger Dugan - 2018-07-19

    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!!

     
  • Davis Montenegro

    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

     
    • Yan Chen

      Yan Chen - 2018-10-01

      Hi Davis,

      I got the same error, and what I tried to do is to control OpenDSS from Matlab:

      [DSSStartOK, DSSObj, DSSText] = DSSStartup;
      DSSText.command='Compile (E:\YanChen\OpenDSS\Example\Matlab_Test\IEEE123Master.dss)';
      Invoke Error, Dispatch Exception:
      Source: OpenDSSengine.Text
      Description: Access violation at address 00000000D24BAE52 in module 'OPENDS~1.DLL'. Read of address
      0000000000000E20

      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

Log in to post a comment.