C# Class S7.Net.Conversion

Afficher le fichier Open project: killnine/s7netplus

Méthodes publiques

Méthode Description
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

Method Details

BinStringToByte() public static méthode

Converts a binary string to a byte. Can return null.
public static BinStringToByte ( this txt ) : byte?
txt this
Résultat byte?

BinStringToInt32() public static méthode

Converts a binary string to Int32 value
public static BinStringToInt32 ( this txt ) : int
txt this
Résultat int

ConvertToDouble() public static méthode

Converts from DWord (DBD) to double
public static ConvertToDouble ( this input ) : double
input this
Résultat double

ConvertToInt() public static méthode

Converts from UInt32 value to Int32 value; it's used to retrieve negative values from DBDs
public static ConvertToInt ( this input ) : Int32
input this
Résultat System.Int32

ConvertToShort() public static méthode

Converts from ushort value to short value; it's used to retrieve negative values from words
public static ConvertToShort ( this input ) : short
input this
Résultat short

ConvertToUInt() public static méthode

Converts from Int32 value to UInt32 value; it's used to pass negative values to DBDs
public static ConvertToUInt ( this input ) : UInt32
input this
Résultat System.UInt32

ConvertToUshort() public static méthode

Converts from short value to ushort value; it's used to pass negative values to DWs
public static ConvertToUshort ( this input ) : ushort
input this
Résultat ushort

SelectBit() public static méthode

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
Résultat bool

ValToBinString() public static méthode

Converts the value to a binary string
public static ValToBinString ( this value ) : string
value this
Résultat string