mirror of
https://github.com/S7NetPlus/s7netplus.git
synced 2025-12-17 17:06:50 +08:00
Updated Home (markdown)
6
Home.md
6
Home.md
@@ -199,6 +199,9 @@ ushort result = (ushort)plc.Read("DB1.DBW0");
|
||||
|
||||
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.
|
||||
|
||||
The "read struct" and "write struct" methods do not support strings.
|
||||
|
||||
```csharp
|
||||
public object ReadStruct(Type structType, int db, int startByteAdr = 0)
|
||||
|
||||
@@ -243,6 +246,9 @@ testStruct myTestStruct = (testStruct) plc.ReadStruct(typeof(testStruct), 1, 0);
|
||||
|
||||
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.
|
||||
|
||||
The "read class" and "write class" methods do not support strings.
|
||||
|
||||
```csharp
|
||||
public void ReadClass(object sourceClass, int db, int startByteAdr = 0)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user