/// <summary>
        /// 无用户名密码登陆,前提服务器登陆不需要用户名密码
        /// </summary>
        /// <param name="opcServerURL"></param>
        /// <returns></returns>
        public bool ConnectOpcServerWithNoPwd(string opcServerURL)
        {
            bool conStatus = false;

            opcUaClient.UserIdentity = new UserIdentity();
            Task t1 = opcUaClient.ConnectServer(opcServerURL);

            Task.WaitAll(t1);
            if (t1.Status == TaskStatus.RanToCompletion)
            {
                conStatus = true;
            }
            else
            {
                conStatus = false;
            }

            return(conStatus);
        }
예제 #2
0
 private void Form1_Load(object sender, EventArgs e)
 {
     opcUaClient = new OpcUaHelper.OpcUaClient();
     opcUaClient.ConnectServer("http://117.48.203.204:62547/DataAccessServer");
 }
예제 #3
0
 private void Form1_Load(object sender, EventArgs e)
 {
     opcUaClient = new OpcUaHelper.OpcUaClient();
     // opcUaClient.ConnectServer("http://117.48.203.204:62547/DataAccessServer");
     opcUaClient.ConnectServer("opc.tcp://127.0.0.1:34561/DataTransferServer");
 }