コード例 #1
0
        /// <summary>
        /// Get the status of the server.
        /// </summary>
        private void GetStatus()
        {
            try
            {
                OpcServerStatus status = m_server.GetServerStatus();

                VendorInfoTB.Text      = status.VendorInfo;
                ProductVersionTB.Text  = status.ProductVersion;
                ServerStateTB.Text     = OpcClientSdk.OpcConvert.ToString(status.ServerState);
                StatusInfoTB.Text      = status.StatusInfo;
                StartTimeTB.Text       = OpcClientSdk.OpcConvert.ToString(status.StartTime);
                CurrentTimeTB.Text     = OpcClientSdk.OpcConvert.ToString(status.CurrentTime);
                MaxReturnValuesTB.Text = OpcClientSdk.OpcConvert.ToString(status.MaxReturnValues);
            }
            catch (Exception e)
            {
                VendorInfoTB.Text      = null;
                ProductVersionTB.Text  = null;
                ServerStateTB.Text     = null;
                StatusInfoTB.Text      = e.Message;
                StartTimeTB.Text       = null;
                CurrentTimeTB.Text     = null;
                MaxReturnValuesTB.Text = null;
            }
        }
        /// <summary>
        /// Get the status of the server.
        /// </summary>
        private void GetStatus()
        {
            try
            {
                OpcServerStatus status = mServer_.GetServerStatus();

                vendorInfoTb_.Text      = status.VendorInfo;
                productVersionTb_.Text  = status.ProductVersion;
                serverStateTb_.Text     = Technosoftware.DaAeHdaClient.OpcConvert.ToString(status.ServerState);
                statusInfoTb_.Text      = status.StatusInfo;
                startTimeTb_.Text       = Technosoftware.DaAeHdaClient.OpcConvert.ToString(status.StartTime);
                currentTimeTb_.Text     = Technosoftware.DaAeHdaClient.OpcConvert.ToString(status.CurrentTime);
                maxReturnValuesTb_.Text = Technosoftware.DaAeHdaClient.OpcConvert.ToString(status.MaxReturnValues);
            }
            catch (Exception e)
            {
                vendorInfoTb_.Text      = null;
                productVersionTb_.Text  = null;
                serverStateTb_.Text     = null;
                statusInfoTb_.Text      = e.Message;
                startTimeTb_.Text       = null;
                currentTimeTb_.Text     = null;
                maxReturnValuesTb_.Text = null;
            }
        }