mirror of
https://github.com/S7NetPlus/s7netplus.git
synced 2025-12-17 17:06:50 +08:00
Updated Home (markdown)
14
Home.md
14
Home.md
@@ -196,10 +196,12 @@ public ErrorCode WriteStruct(object structValue, int db, int startByteAdr = 0)
|
|||||||
• structType: Type of the struct to be read, for example: typeOf(MyStruct))
|
• structType: Type of the struct to be read, for example: typeOf(MyStruct))
|
||||||
• db: index of the DB to read
|
• db: index of the DB to read
|
||||||
• startByteAdr: specified the first address of the byte to read (the default is zero).
|
• startByteAdr: specified the first address of the byte to read (the default is zero).
|
||||||
|
|
||||||
Example:
|
Example:
|
||||||
You define a DataBlock in the plc like:
|
Define a DataBlock in the plc like:
|
||||||

|

|
||||||
Then you add a struct into your .Net application that is similiar to the DB in the plc:
|
|
||||||
|
Then add a struct into your .Net application that is similiar to the DB in the plc:
|
||||||
public struct testStruct
|
public struct testStruct
|
||||||
{
|
{
|
||||||
public bool varBool0;
|
public bool varBool0;
|
||||||
@@ -238,9 +240,11 @@ public ErrorCode WriteClass(object classValue, int db, int startByteAdr = 0)
|
|||||||
• db: index of the DB to read
|
• db: index of the DB to read
|
||||||
• startByteAdr: specified the first address of the byte to read (the default is zero).
|
• startByteAdr: specified the first address of the byte to read (the default is zero).
|
||||||
Example:
|
Example:
|
||||||
You define a DataBlock in the plc like:
|
Define a DataBlock in the plc like:
|
||||||
|
|
||||||

|

|
||||||
Then you add a struct into your .Net application that is similiar to the DB in the plc:
|
|
||||||
|
Then add a struct into your .Net application that is similiar to the DB in the plc:
|
||||||
public class TestClass
|
public class TestClass
|
||||||
{
|
{
|
||||||
public bool varBool0 { get; set;}
|
public bool varBool0 { get; set;}
|
||||||
|
|||||||
Reference in New Issue
Block a user