Thanks for your replying.
Yes, I have read the lesson6, Actually, I known I can follow such way to reach my target. But that's is my concern actually.
In this way, we need new an instance with all field are empty firstly on NodeManager, then we need parse the fields nodes(e.g. HighLimit, LowLimit) of the object instance "LimitConditionForTemperature" I defined on UaModeler, then get the default value of these nodes and set their default value to the empty instance. At the last, call the "LinkModelToNode" to bind the model to the node. That's is exactly below method did, It looks like redundant.
My question is want to find a straightforward way to allow us don't need to do such fussy things. Since we already defined the object instance on UaModeler, Is there a straightforward way to get the “OffNormalAlarmModel” with the default value we set on UaModeler directly ?
Code: Select all
private void SetAlarmCondition(BlockConfiguration block)
NodeId alarmId = new NodeId(block.Name + "." + yourorganisation.BA.BrowseNames.StateCondition, InstanceNamespaceIndex);
// Create off normal alarm data object
OffNormalAlarmModel alarm = new OffNormalAlarmModel();
alarm.NodeId = alarmId;
alarm.EventType = ObjectTypeIds.OffNormalAlarmType;
alarm.SourceNode = new NodeId(block.Name, InstanceNamespaceIndex);
alarm.SourceName = block.Name;
alarm.Severity = (ushort)EventSeverity.Low;
alarm.ConditionName = "StateCondition";
alarm.ConditionClassId = ObjectTypeIds.ProcessConditionClassType;
alarm.ConditionClassName = BrowseNames.ProcessConditionClassType;
alarm.Retain = false;
alarm.EnabledState.Value = ConditionStateNames.Enabled;
alarm.EnabledState.Id = true;
alarm.AckedState.Value = ConditionStateNames.Acknowledged;
alarm.AckedState.Id = true;
alarm.ActiveState.Value = ConditionStateNames.Inactive;
alarm.ActiveState.Id = false;
alarm.SuppressedOrShelved = false;
// Link alarm data object to nodes in address space
LinkModelToNode(alarmId, alarm, null, null, 500);