Click or drag to resize

DeltaValue Structure

A data value.
Inheritance Hierarchy
SystemObject
  SystemValueType
    Demo3D.PLC.CommsDeltaValue

Namespace: Demo3D.PLC.Comms
Assembly: PLC (in PLC.dll) Version: 19.00.00
Syntax
C#
public readonly struct DeltaValue

The DeltaValue type exposes the following members.

Properties
 NameDescription
Public propertyIsNull True if the value is null.
Public propertyTypeCode Type code.
Top
Methods
 NameDescription
Public methodStatic memberAffectedArea Returns the affected area from a DeltaValue created using Create(BufferSegment, MemoryAddress, AddressArea).
Public methodStatic memberCreateContextProvider Creates a new IDataContextProvider for demarshalling DeltaValues.
Public methodEquals Determines whether the specified value equals the current value.
(Overrides ValueTypeEquals(Object))
Public methodGetDataType Returns the type of the value (or null if the value is null).
Public methodGetHashCode Returns a hash code for the current value.
(Overrides ValueTypeGetHashCode)
Public methodGetTime Returns the time of the event that produced the value.
Public methodGetValue Returns the actual .Net value.
Public methodGetValueStruct Returns the actual .Net value.
Public methodPeekValue Returns the actual .Net value if it's immediately available, otherwise the base .Net value for a delta.
Public methodPropagateUpdate Determines whether an update from this value to the specified value should be allowed to propagate.
Public methodSetTime Returns a new DeltaValue with the specified time set.
Top
Fields
 NameDescription
Public fieldStatic memberNull The null value.
Top
Remarks

This class wraps up a data value that we pass upstream/downstream. In the simplest case it's just a wrapper around an int or a bool.

The real use of this class is to wrap up deltas, where the information passed is not just the value of the tag but also a description of which parts of the data have changed. A simple example is Memory which passes the memory buffer for a byte[] tag, but also includes information about which part of the tag memory area actually changed.

Data deltas for structures (which property or properties within the structure) or for arrays (which elements in the array) are handled with special classes that derive from DeltaValue. These classes need to be aware of the threading model and to ensure that events (such as PropertyChanged or CollectionChanged don't get raised in the server thread, but get delayed and raised at the appropriate time in the user/model thread.

See Also