private ServiceResult OnReadDiagnosticsArray(
ISystemContext context,
NodeState node,
ref object value)
{
lock (Lock)
{
if (!m_diagnosticsEnabled)
{
return StatusCodes.BadOutOfService;
}
if (DateTime.UtcNow < m_lastDiagnosticsScanTime.AddSeconds(1))
{
return ServiceResult.Good;
}
DoScan(true);
// pull the value out of the node which was updated by the scan operation.
BaseVariableState variable = node as BaseVariableState;
if (variable != null)
{
value = variable.Value;
}
return ServiceResult.Good;
}
}