Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is there a way to retrieve the engineering unit from the tags? #58

Open
bajcmartinez opened this issue Sep 1, 2017 · 1 comment
Open

Comments

@bajcmartinez
Copy link
Contributor

For example in the case of a temperature sensor, I can get the value, but how can I get the if that value is being measured on Farenheit, Kelvong, etc?

Thanks!

@bajcmartinez
Copy link
Contributor Author

For DA I could create the following method:

///


/// Gets the engineering unit of an OPC tag
///

/// Tag to get enginneering unit of
/// String
public String GetEngineeringUnit(string tag)
{
var item = new OpcDa.Item { ItemName = tag };
OpcDa.ItemProperty result;
try
{
var propertyCollection = _server.GetProperties(new[] { item }, new[] { OpcDa.Property.ENGINEERINGUINTS }, false)[0];
result = propertyCollection[0];
}
catch (NullReferenceException)
{
throw new OpcException("Could not find node because server not connected.");
}
return result.Value.ToString();
}

which returns what I need, but I can't find the same property for UA, do you know how to retrieve it?

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant