public void UaGetDataType() { var type = _client.GetDataType("Data.Dynamic.Scalar.Int32Value"); Assert.AreEqual(typeof(int), type); type = _client.GetDataType("Data.Dynamic.Scalar.Int16Value"); Assert.AreEqual(typeof(short), type); }
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(); }