Пример #1
0
        public Item <float>[] Readfloats(DeviceAddress deviceAddress, ushort length)
        {
            var datas  = readRegister(deviceAddress, 2 * length);
            var bdatas = UnsafeNetConvert.BytesToFloats(datas, 0, length, deviceAddress.ByteOrder);

            return(NetConvert.ToItems(bdatas, 0, length));
        }
Пример #2
0
        public Item <bool>[] ReadBools(DeviceAddress deviceAddress, ushort length)
        {
            var datas  = readBool(deviceAddress, length);
            var bdatas = NetConvert.BytesToBools(datas, length);

            return(NetConvert.ToItems(bdatas, 0, length));
        }
Пример #3
0
        public Item <ushort>[] ReadUShorts(DeviceAddress deviceAddress, ushort length)
        {
            var datas   = readyBytes(deviceAddress, 2 * length);
            var ushorts = UnsafeNetConvert.BytesToUShorts(datas, 0, length, deviceAddress.ByteOrder);

            return(NetConvert.ToItems(ushorts, 0, length));
        }
Пример #4
0
        public Item <int>[] ReadInts(DeviceAddress deviceAddress, ushort length)
        {
            var datas = readyBytes(deviceAddress, 4 * length);
            var ints  = UnsafeNetConvert.BytesToInts(datas, 0, length, deviceAddress.ByteOrder);

            return(NetConvert.ToItems(ints, 0, length));
        }
Пример #5
0
        public Item <bool>[] ReadBools(DeviceAddress deviceAddress, ushort length)
        {
            var datas = readyBytes(deviceAddress, (int)Math.Ceiling((double)(deviceAddress.BitAddress + length) / 8));
            var bools = NetConvert.BytesToBools(datas, deviceAddress.BitAddress, length);

            return(NetConvert.ToItems(bools, 0, length));
        }
Пример #6
0
        public Item <byte>[] ReadBytes(DeviceAddress deviceAddress, ushort length)
        {
            var datas = readyBytes(deviceAddress, length);

            return(NetConvert.ToItems(datas, 0, length));
        }