Exemplo n.º 1
0
        public List <byte> FuncWriteSingleRegister(UInt16 registerAddress, UInt16 value)
        {
            List <byte>   bytes;
            List <UInt16> data     = new List <UInt16>();
            List <byte>   response = new List <byte>();

            memoryMap.SetHoldingRegister(registerAddress, value);
            data.Add(registerAddress);
            data.Add(value);
            bytes = Utility.ConvertListUInt16ToListByteBigEndian(data).ToList <byte>();
            response.Add(0x06);
            response.AddRange(bytes);
            return(response);
        }