Welcome to our new forum
All users of the legacy CODESYS Forums, please create a new account at account.codesys.com. But make sure to use the same E-Mail address as in the old Forum. Then your posts will be matched. Close

Some example Python script for calling PLCHandler SDK (PLCHandler.dll)?

hhz
2022-01-20
2023-05-24
  • hhz - 2022-01-20

    Hi Forum,

    I want to connect and make some communication with PLC runtime (v3 and v2) by Python without via CoDeSys v3.5.x. As you known, there is a SDK package with the name of "PLCHandel.dll". I am no familiar with this SDK. So may be same example scripting will make big help to me. For example: start to establish communication between Python and PLC runtime, read FW version, check working state of PLC etc.

    Thx for any suggestion!

     

    Last edit: hhz 2022-01-20
  • mondinmr

    mondinmr - 2022-01-22

    It would appear that PlcHadle.dll can only be used by having the SDK. However, it would be very interesting to be able to use it even without it, as it would open the way to unthinkable levels of integration.
    Today I go around it with shared memory. In this way we interface a big framework that we developed in Qt through a gateway in shm, however being able to use the PlcHandle would simplify our life a lot.

     
    • hhz - 2022-03-02

      Thank for info.

      Anyway, I have try to load the PlcHandlerDll.dll by ironPython (v2.7.11):

      import clr
      clr.AddReference("PLCHandlerDll")
      

      I got an error:
      SystemError: The module was expected to contain an assembly manifest. (Exception from HRESULT: 0x80131018)

      As I understand, in this case the dll file was found, but it can not be loaded because some of manifest/s failed.

      In my PC VC_regist_2015 was installed.

      From Docu. and Error message, U cannot determine what was still required.

      Someone also meets this problem? Or any suggestion for that?

       
  • kevp - 2023-05-24

    I am trying to load PLCHandlerDll.dll using clr and got the exact same error. Did you find any solution?

    Thanks.

     

Log in to post a comment.