JEasyOpc network connection failed

496 Views Asked by At

I started writing an OPC interface in java using JEasyOpc which should read values from a machine and write them to a database. Everytime I'm trying to connect to remote server over lan/dcom I get a connection to server failed. But to a cloned server created with "dOPC Cloner" on localhost everything works fine.

Strange is that with other tools like OPC Scout or similar the connection to the server works as expected.

My code:

    JEasyOpcExample test = new JEasyOpcExample();

    try {
      JOpc.coInitialize();
    }
    catch (CoInitializeException e1) {
      e1.printStackTrace();
    }


    String opcAddress = ini.get("OPCAddress");
    String opcName = ini.get("OPCName");
    String opcClass = ini.get("OPCClass");

    JEasyOpc jopc = new JEasyOpc(opcAddress, opcName, "alpine");


    OpcItem item1 = new OpcItem("Random.ArrayOfReal8", true, "");
    OpcGroup group = new OpcGroup("group1", true, 500, 0.0f);

    group.addItem(item1);
    jopc.addGroup(group);
0

There are 0 best solutions below