private bool GetOneOutputStatus(byte value, byte pos) { bool status = false; if (ByteLib.GetBit(value, pos) == 1) { status = true; } return(status); }
private string GetStatusString(byte value, byte pos) { byte bitValue = ByteLib.GetBit(value, pos); if (bitValue == 1) { return("Hi"); } return("Low"); }
/// <summary> /// update one bit of the output /// </summary> /// <param name="value"></param> /// <param name="pos"></param> private void UpdateOneBit(byte value, byte pos) { try { currentOutputStatus = ByteLib.SetBit(currentOutputStatus, pos, value); SetOutputStatus(currentOutputStatus); byte addr = GetAddress(true); CommObj.Send(new byte[] { addr, 9, currentOutputStatus }, 0); } catch { } }