C# Class S7.Net.Types.Struct

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

Méthodes publiques

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

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

GetStructSize() public static méthode

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

ToBytes() public static méthode

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