Home > Back-end >  Java with Utgard links KepServer. Ask for help.
Java with Utgard links KepServer. Ask for help.

Time:09-25

//the connection information
Final ConnectionInformation ci=new ConnectionInformation ();

Ci. SetHost (" 127.0.0.1 ");//computer IP
Ci. SetDomain (" ");//domain, empty
Ci. SetUser (" OPCUser ");//the user name, when configuring DCOM configuration
Ci. SetPassword (" 123456 ");//password
//using KEPServer configuration
Ci. SetClsid (" 7 bc0cc8e - 482 - c - 47 ca - ABDC fe7f9c6e729 0 ");//KEPServer registry ID, can see in the "component" service
Final String itemId="U.U.U";//the name of the item according to the actual, there is no actual PLC, with the simulator: simulator
//final String itemId="channel 1. The device 1. Mark 1";

//create a new server, start the service
Final Server Server=new Server (ci, Executors. NewSingleThreadScheduledExecutor ());
Try {
//connect to server, connect to the service
Server. The connect ();
}
The catch (Exception e) {... }

Estimation is KepServer configuration is not correct, or where the user name is not set correctly, for help and assist remote QQ,
After the success, thanks to a red envelope, WeChat: QQ: 13883921935 23789640. Thank you.
  • Related