mirror of
https://github.com/evopro-ag/Sharp7Reactive.git
synced 2026-02-04 07:42:53 +00:00
Adapt example in Readme
This commit is contained in:
@@ -24,13 +24,8 @@ using (var disposables = new CompositeDisposable())
|
|||||||
var plc = new Sharp7Plc("10.30.3.10", 0, 2);
|
var plc = new Sharp7Plc("10.30.3.10", 0, 2);
|
||||||
disposables.Add(plc);
|
disposables.Add(plc);
|
||||||
|
|
||||||
// initialize the plc
|
// initialize and connect to the plc
|
||||||
await plc.InitializeAsync();
|
await plc.InitializeConnection();
|
||||||
|
|
||||||
//wait for the plc to get connected
|
|
||||||
await plc.ConnectionState
|
|
||||||
.FirstAsync(c => c == Sharp7.Rx.Enums.ConnectionState.Connected)
|
|
||||||
.ToTask();
|
|
||||||
|
|
||||||
await plc.SetValue<bool>("DB2.DBX0.4", true); // set a bit
|
await plc.SetValue<bool>("DB2.DBX0.4", true); // set a bit
|
||||||
var bit = await plc.GetValue<int>("DB2.int4"); // get a bit
|
var bit = await plc.GetValue<int>("DB2.int4"); // get a bit
|
||||||
|
|||||||
Reference in New Issue
Block a user