C# Class S7.Net.Types.Int

Contains the conversion methods to convert Int from S7 plc to C#.
显示文件 Open project: killnine/s7netplus Class Usage Examples

Public Methods

Method Description
CWord ( int value ) : Int16

Converts a C# int value to a C# short value, to be used as word.

FromByteArray ( byte bytes ) : Int16

Converts a S7 Int (2 bytes) to short (Int16)

FromBytes ( byte LoVal, byte HiVal ) : Int16

Converts a S7 Int (2 bytes) to short (Int16)

ToArray ( byte bytes ) : System.Int16[]

Converts an array of S7 Int to an array of short (Int16)

ToByteArray ( Int16 value ) : byte[]

Converts a short (Int16) to a S7 Int byte array (2 bytes)

Method Details

CWord() public static method

Converts a C# int value to a C# short value, to be used as word.
public static CWord ( int value ) : Int16
value int
return System.Int16

FromByteArray() public static method

Converts a S7 Int (2 bytes) to short (Int16)
public static FromByteArray ( byte bytes ) : Int16
bytes byte
return System.Int16

FromBytes() public static method

Converts a S7 Int (2 bytes) to short (Int16)
public static FromBytes ( byte LoVal, byte HiVal ) : Int16
LoVal byte
HiVal byte
return System.Int16

ToArray() public static method

Converts an array of S7 Int to an array of short (Int16)
public static ToArray ( byte bytes ) : System.Int16[]
bytes byte
return System.Int16[]

ToByteArray() public static method

Converts a short (Int16) to a S7 Int byte array (2 bytes)
public static ToByteArray ( Int16 value ) : byte[]
value System.Int16
return byte[]