public byte[] ReadCoilStatus(byte slaveAddress, string startAddress, ushort nuMBErOfPoints) { var frame = ReadCoilStatusMessage(slaveAddress, startAddress, nuMBErOfPoints); SerialAdaper.WriteLine(frame); Thread.Sleep(DELAY); var buffReceiver = SerialAdaper.ReadLine(); var tempStrg = buffReceiver.Substring(1, buffReceiver.Length - 2); var messageReceived = Conversion.HexToBytes(tempStrg); if (buffReceiver.Length == 10) { ModbusExcetion(messageReceived); } var data = new byte[messageReceived[2]]; Array.Copy(messageReceived, 3, data, 0, data.Length); return(Bit.ToByteArray(Bit.ToArray(data))); }