Skip to content

Commit 810d656

Browse files
committed
create a proper fix
1 parent df0e8df commit 810d656

1 file changed

Lines changed: 9 additions & 3 deletions

File tree

Stack/Opc.Ua.Types/State/BaseVariableState.cs

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1541,11 +1541,17 @@ protected override ServiceResult ReadValueAttribute(
15411541
return StatusCodes.BadUserAccessDenied;
15421542
}
15431543

1544-
// update the timestamp on each read to reflect current time.
1545-
m_timestamp = DateTime.UtcNow;
1544+
// ensure a value timestamp exists.
1545+
if (m_timestamp == DateTime.MinValue)
1546+
{
1547+
sourceTimestamp = DateTime.UtcNow;
1548+
}
1549+
else
1550+
{
1551+
sourceTimestamp = m_timestamp;
1552+
}
15461553

15471554
value = m_value;
1548-
sourceTimestamp = m_timestamp;
15491555
StatusCode statusCode = m_statusCode;
15501556

15511557
ServiceResult result = null;

0 commit comments

Comments
 (0)