/// <summary>
/// Used to receive notifications when the value attribute is read or written.
/// </summary>
public ServiceResult OnWriteTagValue(
ISystemContext context,
NodeState node,
ref object value)
{
UnderlyingSystem system = context.SystemHandle as UnderlyingSystem;
if (system == null)
{
return(StatusCodes.BadCommunicationError);
}
UnderlyingSystemBlock block = system.FindBlock(m_blockId);
if (block == null)
{
return(StatusCodes.BadNodeIdUnknown);
}
uint error = block.WriteTagValue(node.SymbolicName, value);
if (error != 0)
{
// the simulator uses UA status codes so there is no need for a mapping table.
return(error);
}
return(ServiceResult.Good);
}