public PlcMemoryWriteCommand(IPlcAddressSpace addressSpace, int address, PlcWriteStream stream)
            : base(addressSpace, PlcControlChar.ENQ, address)
        {
            if (stream == null)
                throw new ArgumentNullException("stream", "Argument can't be null.");

            _stream = stream;
        }
        public PlcMemoryReadCommand(IPlcAddressSpace addressSpace, int address, int length)
            : base(addressSpace, PlcControlChar.ENQ, address)
        {
            if (!AddressSpace.CheckAddress(Address, length))
                throw new ArgumentOutOfRangeException("length", "Argument is out of range.");

            Length = length;
        }
Esempio n. 3
0
        public PlcMemoryCommand(IPlcAddressSpace addressSpace, PlcControlChar controlChar, int address)
            : base(controlChar)
        {
            if (addressSpace == null)
                throw new ArgumentNullException("addressSpace", "Argument wasn't initialized.");

            if (!addressSpace.CheckAddress(address))
                throw new ArgumentOutOfRangeException("address", "Argument is out of range.");

            AddressSpace = addressSpace;
            Address = address;
        }