Summary
I am working on a simple proof of concept for a visualization in Blazor.
I have a created a demo server representing an equipment that exposes a folder with two instances of a "MeasurementType". The types are generated using the ModelCompiler. "Output" is of type "AnalogUnitRangeType"
Address space:
+ Root
+ Objects
+ Equipment
+ Supply
+ Pressure of MeasurementType
+ Humidity of MeasurementType
MeasurementType:
+ Measurement
+ Output of AnalogUnitRangeType (double)
+ EURange
+ EngineeringUnits
I am using Blazor to create the UI and the Opc Foundation Nuget package to browse the server to dynamically generate a user interface. In this case that will be two components representing "Pressure" and "Humidity"
Question:
When browsing a server and finding known self-defined types like MeasurementType. What is the easiest way to access the child nodes?
I am browsing all nodes and checking if they are measurementTypes like this:
if (node.TypeDefinitionId.Identifier.ToString() ==
ObjectTypeIds.MeasurementType.Identifier.ToString())
When I find the types I keep browsing the references and matching on displayName to find the variables I need. Since I know the type there is probably an easier way.
As an example, I was hoping that it might be possible to do something similar to this?
if(node is MeasurementState)
{
var measurementNode = node as MeasurementState;
}
I have looked through the samples, but must admit I find it a bit overwhelmimg. If you have any good resources that explains the opcfoundation sdk that would also be highly appreciated.