C# Класс S7.Net.Conversion

Показать файл Открыть проект

Открытые методы

Метод Описание
BinStringToByte ( this txt ) : byte?

Converts a binary string to a byte. Can return null.

BinStringToInt32 ( this txt ) : int

Converts a binary string to Int32 value

ConvertToDouble ( this input ) : double

Converts from DWord (DBD) to double

ConvertToInt ( this input ) : Int32

Converts from UInt32 value to Int32 value; it's used to retrieve negative values from DBDs

ConvertToShort ( this input ) : short

Converts from ushort value to short value; it's used to retrieve negative values from words

ConvertToUInt ( this input ) : UInt32

Converts from Int32 value to UInt32 value; it's used to pass negative values to DBDs

ConvertToUshort ( this input ) : ushort

Converts from short value to ushort value; it's used to pass negative values to DWs

SelectBit ( this data, int bitPosition ) : bool

Helper to get a bit value given a byte and the bit index. Example: DB1.DBX0.5 -> var bytes = ReadBytes(DB1.DBW0); bool bit = bytes[0].SelectBit(5);

ValToBinString ( this value ) : string

Converts the value to a binary string

Описание методов

BinStringToByte() публичный статический Метод

Converts a binary string to a byte. Can return null.
public static BinStringToByte ( this txt ) : byte?
txt this
Результат byte?

BinStringToInt32() публичный статический Метод

Converts a binary string to Int32 value
public static BinStringToInt32 ( this txt ) : int
txt this
Результат int

ConvertToDouble() публичный статический Метод

Converts from DWord (DBD) to double
public static ConvertToDouble ( this input ) : double
input this
Результат double

ConvertToInt() публичный статический Метод

Converts from UInt32 value to Int32 value; it's used to retrieve negative values from DBDs
public static ConvertToInt ( this input ) : Int32
input this
Результат System.Int32

ConvertToShort() публичный статический Метод

Converts from ushort value to short value; it's used to retrieve negative values from words
public static ConvertToShort ( this input ) : short
input this
Результат short

ConvertToUInt() публичный статический Метод

Converts from Int32 value to UInt32 value; it's used to pass negative values to DBDs
public static ConvertToUInt ( this input ) : UInt32
input this
Результат System.UInt32

ConvertToUshort() публичный статический Метод

Converts from short value to ushort value; it's used to pass negative values to DWs
public static ConvertToUshort ( this input ) : ushort
input this
Результат ushort

SelectBit() публичный статический Метод

Helper to get a bit value given a byte and the bit index. Example: DB1.DBX0.5 -> var bytes = ReadBytes(DB1.DBW0); bool bit = bytes[0].SelectBit(5);
public static SelectBit ( this data, int bitPosition ) : bool
data this
bitPosition int
Результат bool

ValToBinString() публичный статический Метод

Converts the value to a binary string
public static ValToBinString ( this value ) : string
value this
Результат string