public void CreateWriteMultipleCoilsRequestMaxSize()
        {
            WriteMultipleCoilsRequest request = new WriteMultipleCoilsRequest(1, 2,
                                                                              MessageUtility.CreateDefaultCollection <DiscreteCollection, bool>(true,
                                                                                                                                                Modbus.MaximumDiscreteRequestResponseSize));

            Assert.AreEqual(Modbus.MaximumDiscreteRequestResponseSize, request.Data.Count);
        }
        public void CreateWriteMultipleRegistersRequestMaxSize()
        {
            WriteMultipleRegistersRequest request = new WriteMultipleRegistersRequest(1, 2, MessageUtility.CreateDefaultCollection <RegisterCollection, ushort>(3, Modbus.MaximumRegisterRequestResponseSize));

            Assert.AreEqual(Modbus.MaximumRegisterRequestResponseSize, request.NumberOfPoints);
        }
 public void CreateWriteMultipleRegistersRequestTooMuchData()
 {
     new WriteMultipleRegistersRequest(1, 2, MessageUtility.CreateDefaultCollection <RegisterCollection, ushort>(3, Modbus.MaximumRegisterRequestResponseSize + 1));
 }
 public void CreateWriteMultipleCoilsRequestTooMuchData()
 {
     new WriteMultipleCoilsRequest(1, 2, MessageUtility.CreateDefaultCollection <DiscreteCollection, bool>(true, Modbus.MaximumDiscreteRequestResponseSize + 1));
 }
示例#5
0
 public void CreateWriteMultipleCoilsRequestTooMuchData()
 {
     Assert.Throws <ArgumentOutOfRangeException>(() =>
                                                 new WriteMultipleCoilsRequest(1, 2, MessageUtility.CreateDefaultCollection <DiscreteCollection, bool>(true, Modbus.MaximumDiscreteRequestResponseSize + 1)));
 }
示例#6
0
 public void CreateWriteMultipleRegistersRequestTooMuchData()
 {
     Assert.Throws <ArgumentOutOfRangeException>(() =>
                                                 new WriteMultipleRegistersRequest(1, 2,
                                                                                   MessageUtility.CreateDefaultCollection <RegisterCollection, short>(3,
                                                                                                                                                      Modbus.MaximumRegisterRequestResponseSize + 1)));
 }