From 4aade10dc80de643772be95e5f706860c9b60089 Mon Sep 17 00:00:00 2001 From: FalcoGoodbody Date: Tue, 15 Sep 2020 09:26:31 +0200 Subject: [PATCH] Updated Home (markdown) --- Home.md | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/Home.md b/Home.md index 3df27bc..9a8a7b8 100644 --- a/Home.md +++ b/Home.md @@ -301,8 +301,8 @@ public void Plc.ReadMultibleVars(List dataItems); Example: this method reads several variables from a data block +define the data items first ```csharp -// define the data items first private static DataItem varBit = new DataItem() { DataType = DataType.DataBlock, @@ -368,19 +368,23 @@ private static DataItem varDateTime = new DataItem() StartByteAdr = 138, Value = new object() }; - -// define a list where the DataItems will be stored in +``` +Then define a list where the DataItems will be stored in +```csharp private static List dataItemsRead = new List(); - -// add the DataItems to the list +``` +add the data items to the list +```csharp dataItemsRead.Add(varBit); dataItemsRead.Add(varByteArray); dataItemsRead.Add(varInt); dataItemsRead.Add(varReal); dataItemsRead.Add(varString); dataItemsRead.Add(varDateTime); +``` -// open the connection to the plc +open the connection to the plc and read the items at once +```csharp myPLC.Open(); // read the list of variables