• 大小: 656KB
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2021-06-02
  • 语言: Java
  • 标签: opc  utgard  java  openSCADA  

资源简介

utgard的源码 utgard 所需的全部jar包 java 连接opc

资源截图

代码片段和文件信息

package com.freud.dcom.utgard.cases;

import static com.freud.opc.utgard.baseConfiguration.CONFIG_CLSID;
import static com.freud.opc.utgard.baseConfiguration.CONFIG_DOMAIN;
import static com.freud.opc.utgard.baseConfiguration.CONFIG_HOST;
import static com.freud.opc.utgard.baseConfiguration.CONFIG_PASSWORD;
import static com.freud.opc.utgard.baseConfiguration.CONFIG_USERNAME;
import static com.freud.opc.utgard.baseConfiguration.getEntryValue;

import org.jinterop.dcom.common.JIException;
import org.jinterop.dcom.common.JISystem;
import org.jinterop.dcom.core.IJIComobject;
import org.jinterop.dcom.core.JIClsid;
import org.jinterop.dcom.core.JIComServer;
import org.jinterop.dcom.core.JISession;
import org.openscada.opc.dcom.da.OPCSERVERSTATUS;
import org.openscada.opc.dcom.da.impl.OPCServer;

import com.freud.opc.utgard.baseConfiguration;

/**
 * 获取Server的Status信息 中文
 * 
 * @author Freud
 * 
 */
public class DCOMTest1 {

public static void main(String[] args) throws Exception {

JISystem.setAutoRegisteration(true);

JISession _session = JISession.createSession(
baseConfiguration.CONFIG_DOMAIN baseConfiguration.CONFIG_USERNAME
baseConfiguration.CONFIG_PASSWORD);

final JIComServer comServer = new JIComServer(
JIClsid.valueOf(baseConfiguration.CONFIG_CLSID)
baseConfiguration.CONFIG_HOST _session);

final IJIComobject serverobject = comServer.createInstance();

OPCServer server = new OPCServer(serverobject);

dumpServerStatus(server);

}

public static void dumpServerStatus(final OPCServer server)
throws JIException {

final OPCSERVERSTATUS status = server.getStatus();

System.out.println(“===== SERVER STATUS ======“);
System.out.println(“State: “ + status.getServerState().toString());
System.out.println(“Vendor: “ + status.getVendorInfo());
System.out.println(String.format(“Version: %d.%d.%d“
status.getMajorVersion() status.getMinorVersion()
status.getBuildNumber()));
System.out.println(“Groups: “ + status.getGroupCount());
System.out.println(“Bandwidth: “ + status.getBandWidth());
System.out.println(String.format(“Start Time: %tc“ status
.getStartTime().asCalendar()));
System.out.println(String.format(“Current Time: %tc“ status
.getCurrentTime().asCalendar()));
System.out.println(String.format(“Last Update Time: %tc“ status
.getLastUpdateTime().asCalendar()));
System.out.println(“===== SERVER STATUS ======“);
}
}

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2018-03-21 09:14  OPC_Client_Utgard\
     文件        1226  2018-03-21 09:14  OPC_Client_Utgard\.classpath
     文件         546  2017-06-15 16:32  OPC_Client_Utgard\.project
     目录           0  2018-03-21 09:14  OPC_Client_Utgard\.settings\
     文件         243  2018-03-21 09:14  OPC_Client_Utgard\.settings\org.eclipse.jdt.core.prefs
     目录           0  2018-03-21 08:23  OPC_Client_Utgard\lib\
     文件       58208  2017-06-15 16:32  OPC_Client_Utgard\lib\org.openscada.opc.dcom_1.1.0.v20130529.jar
     文件       53137  2017-06-15 16:32  OPC_Client_Utgard\lib\org.openscada.opc.lib_1.1.0.v20130529.jar
     文件          96  2018-05-25 08:36  OPC_Client_Utgard\output.log
     文件         999  2018-03-22 11:26  OPC_Client_Utgard\pom.xml
     目录           0  2018-03-21 08:23  OPC_Client_Utgard\src\
     目录           0  2018-03-21 08:23  OPC_Client_Utgard\src\main\
     目录           0  2018-03-21 08:23  OPC_Client_Utgard\src\main\java\
     目录           0  2018-03-21 13:07  OPC_Client_Utgard\src\main\java\com\
     目录           0  2018-03-21 08:23  OPC_Client_Utgard\src\main\java\com\freud\
     目录           0  2018-03-21 08:23  OPC_Client_Utgard\src\main\java\com\freud\dcom\
     目录           0  2018-03-21 08:23  OPC_Client_Utgard\src\main\java\com\freud\dcom\utgard\
     目录           0  2018-03-21 08:23  OPC_Client_Utgard\src\main\java\com\freud\dcom\utgard\cases\
     文件        2453  2018-03-21 14:43  OPC_Client_Utgard\src\main\java\com\freud\dcom\utgard\cases\DCOMTest1.java
     文件        4036  2018-03-21 15:12  OPC_Client_Utgard\src\main\java\com\freud\dcom\utgard\cases\DCOMTest2.java
     文件        2436  2017-06-15 16:32  OPC_Client_Utgard\src\main\java\com\freud\dcom\utgard\cases\DCOMTest3.java
     文件        7259  2017-06-15 16:32  OPC_Client_Utgard\src\main\java\com\freud\dcom\utgard\cases\DCOMTest4.java
     文件        3961  2017-06-15 16:32  OPC_Client_Utgard\src\main\java\com\freud\dcom\utgard\cases\DCOMTest5.java
     文件        2099  2017-06-15 16:32  OPC_Client_Utgard\src\main\java\com\freud\dcom\utgard\cases\DCOMTest6.java
     文件        6570  2017-06-15 16:32  OPC_Client_Utgard\src\main\java\com\freud\dcom\utgard\cases\DCOMTest7.java
     文件        2073  2017-06-15 16:32  OPC_Client_Utgard\src\main\java\com\freud\dcom\utgard\cases\DumpDataCallback.java
     目录           0  2018-03-21 08:23  OPC_Client_Utgard\src\main\java\com\freud\opc\
     目录           0  2018-03-21 08:23  OPC_Client_Utgard\src\main\java\com\freud\opc\utgard\
     文件        2027  2018-05-25 08:55  OPC_Client_Utgard\src\main\java\com\freud\opc\utgard\baseConfiguration.java
     目录           0  2018-03-23 15:32  OPC_Client_Utgard\src\main\java\com\freud\opc\utgard\cases\
     文件        1570  2018-05-25 10:08  OPC_Client_Utgard\src\main\java\com\freud\opc\utgard\cases\OPCTest1.java
............此处省略482个文件信息

评论

共有 条评论