Updated Home (markdown)

FalcoGoodbody
2020-09-15 09:26:31 +02:00
parent 75966122b1
commit 4aade10dc8

16
Home.md

@@ -301,8 +301,8 @@ public void Plc.ReadMultibleVars(List<DataItem> 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<DataItem> dataItemsRead = new List<DataItem>();
// 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