mirror of
https://github.com/S7NetPlus/s7netplus.git
synced 2025-12-18 09:26:48 +08:00
Updated Home (markdown)
2
Home.md
2
Home.md
@@ -200,6 +200,7 @@ ushort result = (ushort)plc.Read("DB1.DBW0");
|
||||
## Read a struct / Write a struct
|
||||
|
||||
This method reads all the bytes from a specified DB needed to fill a struct in C#, and returns the struct that contains the values.
|
||||
It is recommended to use when you want to read many variables in a single data block in some continuous memory range.
|
||||
```csharp
|
||||
public object ReadStruct(Type structType, int db, int startByteAdr = 0)
|
||||
|
||||
@@ -243,6 +244,7 @@ testStruct myTestStruct = (testStruct) plc.ReadStruct(typeof(testStruct), 1, 0);
|
||||
## Read a class / Write a class
|
||||
|
||||
This method reads all the bytes from a specified DB needed to fill a class in C#. The class is passed as reference and values are assigned by using reflection.
|
||||
It is recommended to use when you want to read many variables in a single data block in some continuous memory range.
|
||||
```csharp
|
||||
public void ReadClass(object sourceClass, int db, int startByteAdr = 0)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user