Menu

Remote OPCDA connection problem

Help
2021-09-15
2022-10-21
  • Riccardo Di Franco

    I have huge problem with OPCDA and OpenOPC. I should (must) read a set of tags from a remote server, I have no access to the machine in any way. I only know the IP and the OPC server name.

    Testing OpenOPC locally with this code all work fine. Otherwise, changing the hostname with the remote one nothing work with 0x800706BA error.

    import OpenOPC
    import time

    try:
    opc = OpenOPC.client()

    opc.servers()
    
    #change localhost to remote
    opc.connect('Matrikon.OPC.Simulation.1', 'localhost')
    
    srvList = opc.list()
    
    print(srvList)
    
    tags = opc.read(opc.list('Simulation Items.Random.Int*'), group='myTest')
    
    for name, value, quality, tagTime in opc.read(opc.list('Simulation Items.Random.Int*'), group='myTest'):
    print(name, value, quality, tagTime)
    
    for tag in tags:
        print(tag)
    
    except Exception as e:
        print('OPC failed')
        print(str(e))
        pass
    finally:
        print('END')
    

    Anyone have any ideas on this?

    Not having access to the server (set with anonymous logon), I have done DCOM configurations as much as possible.

    Does anyone know a procedure for a possible solution?

    Thanks!

     
  • OPC Anywhere

    OPC Anywhere - 2022-10-21

    0x800706BA means The RPC server is unavailable. Typically, that means you need do some DCOM configuration in remote box. To avoid this kind of headache, you can take a look at WebSocket4OPC, which brings back OPC data without any DCOM configuration. It supports Python and other popular languages to return OPC data in JSON format.

     

Log in to post a comment.

MongoDB Logo MongoDB