C# 클래스 S7.Net.Conversion

파일 보기 프로젝트 열기: killnine/s7netplus

공개 메소드들

메소드 설명
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