C# Class S7.Net.Types.Class

Contains the methods to convert a C# class to S7 data types
Mostra file Open project: killnine/s7netplus

Public Methods

Method Description
FromBytes ( object sourceClass, Type classType, byte bytes ) : void

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

GetClassSize ( Type classType ) : int

Gets the size of the struct in bytes.

ToBytes ( object sourceClass ) : 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 ( object sourceClass, Type classType, byte bytes ) : void
sourceClass object
classType System.Type The struct type
bytes byte The array of bytes
return void

GetClassSize() public static method

Gets the size of the struct in bytes.
public static GetClassSize ( Type classType ) : int
classType System.Type the type of the class
return int

ToBytes() public static method

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