From 11a40cc5e395c0be954ab8bb022795deb94f5db8 Mon Sep 17 00:00:00 2001 From: Himmelt Date: Fri, 18 Aug 2023 16:37:50 +0800 Subject: [PATCH] update summary --- S7.Net/Conversion.cs | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/S7.Net/Conversion.cs b/S7.Net/Conversion.cs index 4bca543..98f8fd3 100644 --- a/S7.Net/Conversion.cs +++ b/S7.Net/Conversion.cs @@ -138,11 +138,18 @@ namespace S7.Net /// /// Helper to get a bit value given a byte and the bit index. - /// Example: DB1.DBX0.5 -> var bytes = ReadBytes(DB1.DBW0); bool bit = bytes[0].SelectBit(5); + ///
+ /// + /// Get the bit at DB1.DBX0.5: + /// + /// byte data = ReadByte("DB1.DBB0"); + /// bool bit = data.SelectBit(5); + /// + /// ///
- /// byte data get from - /// bit index - /// bool value will get + /// The byte data to get from. + /// The zero-based index of the bit to get. + /// The Boolean value will get. public static bool SelectBit(this byte data, int index) { int mask = 1 << index; @@ -153,7 +160,14 @@ namespace S7.Net /// /// Helper to set a bit value to the given byte at the bit index. - /// Example: byte data = (byte)0x00; data.SetBit(4, true);// data -> 0x10 + ///
+ /// + /// Set the bit at index 4: + /// + /// byte data = 0; + /// data.SetBit(4, true); + /// + /// ///
/// The data to be modified. /// The zero-based index of the bit to set.