Class DeviceFormatters.ScaledInt16
A decimal stored as a signed 16-bit register scaled by 10^decimals, as many Modbus devices do.
public abstract class DeviceFormatters.ScaledInt16 : IDeviceBinaryFieldFormatter<decimal>
- Inheritance
-
DeviceFormatters.ScaledInt16
- Implements
- Inherited Members
- Extension Methods
Constructors
ScaledInt16(int)
A decimal stored as a signed 16-bit register scaled by 10^decimals, as many Modbus devices do.
protected ScaledInt16(int decimals)
Parameters
decimalsint
Properties
Size
Gets how many bytes the field takes.
public int Size { get; }
Property Value
Methods
Read(ReadOnlySpan<byte>, bool)
Reads the value from exactly Size bytes.
public decimal Read(ReadOnlySpan<byte> source, bool bigEndian)
Parameters
sourceReadOnlySpan<byte>bigEndianbool
Returns
Write(decimal, Span<byte>, bool)
Writes the value into exactly Size bytes.
public void Write(decimal value, Span<byte> destination, bool bigEndian)