C# Class S7.Net.Types.Struct

Contains the method to convert a C# struct to S7 data types
Mostra file Open project: killnine/s7netplus Class Usage Examples

Public Methods

Method Description
FromBytes ( Type structType, byte bytes ) : object

Creates a struct of a specified type by an array of bytes.

GetStructSize ( Type structType ) : int

Gets the size of the struct in bytes.

ToBytes ( object structValue ) : byte[]

Creates a byte array depending on the struct type.

Method Details

FromBytes() public static method

Creates a struct of a specified type by an array of bytes.
public static FromBytes ( Type structType, byte bytes ) : object
structType System.Type The struct type
bytes byte The array of bytes
return object

GetStructSize() public static method

Gets the size of the struct in bytes.
public static GetStructSize ( Type structType ) : int
structType System.Type the type of the struct
return int

ToBytes() public static method

Creates a byte array depending on the struct type.
public static ToBytes ( object structValue ) : byte[]
structValue object The struct object
return byte[]