Example #1
0
        private void readButton_Click(object sender, EventArgs e)
        {
            string node     = nodeToRead.Text;
            string nodeType = clientTCP.GetDataType(node).ToString();
            string myValue  = "";

            switch (nodeType)
            {
            case "System.Double":
                myValue = clientTCP.Read <double>(node).Value.ToString();
                break;

            case "System.Float":
                myValue = clientTCP.Read <float>(node).Value.ToString();
                break;

            case "System.Int32":
                myValue = clientTCP.Read <Int32>(node).Value.ToString();
                break;
            }

            valueOfRead.Text = myValue.ToString();
        }
Example #2
0
        public void ReadNodeTest()
        {
            var val = _client.Read <string>("Server.ServerStatus.BuildInfo.ManufacturerName");

            Expect(val).ToBe("OPC Foundation");
        }
Example #3
0
File: UaTest.cs Project: zzlc/h-opc
        public void ReadNodeTest()
        {
            var val = _client.Read <string>("Server.ServerStatus.BuildInfo.ManufacturerName");

            Assert.AreEqual("OPC Foundation", val.Value);
        }