You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am using h-opc under DA only.
It's working fine, but calling GetDataType(tag) always returns Int16, regardless of the Data Type defined at server side.
Am I doing something wrong? Please advise.
Regards
The text was updated successfully, but these errors were encountered:
public System.Type GetDataType(string tag)
{
var item = new OpcDa.Item { ItemName = tag };
OpcDa.ItemProperty result;
try
{
var propertyCollection = _server.GetProperties(new[] { item }, new[] { new OpcDa.PropertyID(1) }, true)[0];
result = propertyCollection[0];
}
catch (NullReferenceException)
{
throw new OpcException("Could not find node because server not connected.");
}
return (System.Type)result.Value;
}
The last parameter in _server.GetProperties is changed to "true". This perform the read of the value of property.
The second change is to return the value of the property. The original implementation returns the type of the property (the cannonical data type), this property is an Int16 value. This value determines the data type.
I am using h-opc under DA only.
It's working fine, but calling GetDataType(tag) always returns Int16, regardless of the Data Type defined at server side.
Am I doing something wrong? Please advise.
Regards
The text was updated successfully, but these errors were encountered: