From fa59a6731d263f4d9ea748d58cc35f761d1dc404 Mon Sep 17 00:00:00 2001 From: Peter Butzhammer Date: Fri, 26 Apr 2024 15:21:06 +0200 Subject: [PATCH] Adapt example in Readme --- README.md | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index e1da309..dba0a3e 100644 --- a/README.md +++ b/README.md @@ -24,13 +24,8 @@ using (var disposables = new CompositeDisposable()) var plc = new Sharp7Plc("10.30.3.10", 0, 2); disposables.Add(plc); - // initialize the plc - await plc.InitializeAsync(); - - //wait for the plc to get connected - await plc.ConnectionState - .FirstAsync(c => c == Sharp7.Rx.Enums.ConnectionState.Connected) - .ToTask(); + // initialize and connect to the plc + await plc.InitializeConnection(); await plc.SetValue("DB2.DBX0.4", true); // set a bit var bit = await plc.GetValue("DB2.int4"); // get a bit