Update LinqPad samples

This commit is contained in:
Peter Butzhammer
2024-07-30 12:19:52 +02:00
parent af2df01617
commit 61e04c7f63
3 changed files with 10 additions and 8 deletions

View File

@@ -20,10 +20,12 @@ using var plc = new Sharp7Plc(ip, rackNumber, cpuMpiAddress);
// Initialize connection
await plc.InitializeConnection();
// wait for connection to be established
await plc.ConnectionState
.FirstAsync(c => c == Sharp7.Rx.Enums.ConnectionState.Connected)
.ToTask();
// // Alternative: Trigger connection and wait for ConnectionState == Connected
// plc.TriggerConnection();
// // wait for connection to be established
//await plc.ConnectionState
// .FirstAsync(c => c == Sharp7.Rx.Enums.ConnectionState.Connected)
// .ToTask();
"Connection established".Dump();