-
Notifications
You must be signed in to change notification settings - Fork 0
/
Main.cs
46 lines (36 loc) · 1.2 KB
/
Main.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Data.SqlClient;
using System.Threading;
using Unitronics.ComDriver.Messages.DataRequest;
namespace Unitronics.ComDriver
{
class Main
{
public static void main()
{
//Haussteuerung
{
Channel ch = new Ethernet("192.168.47.12", 20257, EthProtocol.TCP);
PLC plc = PLCFactory.GetPLC(ch, 0);
Console.WriteLine(plc.PlcName);
plc.SetExecuter(OperandsExecuterType.ExecuterPartialBinaryMix);
Console.WriteLine(plc.Version + "\t");
Console.WriteLine(plc.RTC + "\tPLC Timer \n" + System.DateTime.Now + "\tUTC Time");
plc_Kompressor plcKompressor = new plc_Kompressor(ch);
ReadWriteRequest[] rw = plcKompressor.init();
int j = 0;
while (j<30)
{
plcKompressor.readData();
Thread.Sleep(1000);
j++;
}
}
}
}
}