public void ResponseBytesToReadCoilsNoData() { var transport = new ModbusRtuTransport(StreamResource, Factory, NullModbusLogger.Instance); byte[] frameStart = { 0x11, 0x01, 0x00, 0x00, 0x00 }; Assert.Equal(1, transport.ResponseBytesToRead(frameStart)); }
public void ResponseBytesToReadInvalidFunctionCode() { var transport = new ModbusRtuTransport(StreamResource, Factory, NullModbusLogger.Instance); byte[] frame = { 0x11, 0x16, 0x00, 0x01, 0x00, 0x02, 0x04 }; Assert.Throws <NotImplementedException>(() => transport.ResponseBytesToRead(frame)); }
public void ResponseBytesToReadSlaveException() { var transport = new ModbusRtuTransport(StreamResource, Factory, NullModbusLogger.Instance); byte[] frameStart = { 0x01, Modbus.ExceptionOffset + 1, 0x01 }; Assert.Equal(1, transport.ResponseBytesToRead(frameStart)); }
public void ResponseBytesToReadDiagnostics() { var transport = new ModbusRtuTransport(StreamResource, Factory, NullModbusLogger.Instance); byte[] frameStart = { 0x01, 0x08, 0x00, 0x00 }; Assert.Equal(4, transport.ResponseBytesToRead(frameStart)); }
public void ResponseBytesToReadWriteCoilsResponse() { var transport = new ModbusRtuTransport(StreamResource, Factory, NullModbusLogger.Instance); byte[] frameStart = { 0x11, 0x0F, 0x00, 0x13, 0x00, 0x0A, 0, 0 }; Assert.Equal(4, transport.ResponseBytesToRead(frameStart)); }
public void ResponseBytesToReadCoils() { var transport = new ModbusRtuTransport(StreamResource, Factory, NullModbusLogger.Instance); byte[] frameStart = { 0x11, 0x01, 0x05, 0xCD, 0x6B, 0xB2, 0x0E, 0x1B }; Assert.Equal(6, transport.ResponseBytesToRead(frameStart)); }
public void ResponseBytesToReadCoilsNoData() { byte[] frameStart = { 0x11, 0x01, 0x00, 0x00, 0x00 }; Assert.Equal(1, ModbusRtuTransport.ResponseBytesToRead(frameStart)); }
public void ResponseBytesToReadCoils() { byte[] frameStart = { 0x11, 0x01, 0x05, 0xCD, 0x6B, 0xB2, 0x0E, 0x1B }; Assert.Equal(6, ModbusRtuTransport.ResponseBytesToRead(frameStart)); }
public void ResponseBytesToReadInvalidFunctionCode() { byte[] frame = { 0x11, 0x16, 0x00, 0x01, 0x00, 0x02, 0x04 }; ModbusRtuTransport.ResponseBytesToRead <ReadCoilsInputsResponse>(frame, null); Assert.Fail(); }
public void ResponseBytesToReadSlaveException() { byte[] frameStart = { 0x01, Modbus.ExceptionOffset + 1, 0x01 }; Assert.AreEqual(1, ModbusRtuTransport.ResponseBytesToRead <ReadCoilsInputsResponse>(frameStart, null)); }
public void ResponseBytesToReadDiagnostics() { byte[] frameStart = { 0x01, 0x08, 0x00, 0x00 }; Assert.AreEqual(4, ModbusRtuTransport.ResponseBytesToRead <DiagnosticsRequestResponse>(frameStart, null)); }
public void ResponseBytesToReadSlaveException() { byte[] frameStart = { 0x01, Modbus.ExceptionOffset + 1, 0x01 }; Assert.Equal(1, ModbusRtuTransport.ResponseBytesToRead(frameStart)); }
public void ResponseBytesToReadCoils() { byte[] frameStart = { 0x11, 0x01, 0x05, 0xCD, 0x6B, 0xB2, 0x0E, 0x1B }; Assert.AreEqual(6, ModbusRtuTransport.ResponseBytesToRead <ReadCoilsInputsResponse>(frameStart, null)); }
public void ResponseBytesToReadInvalidFunctionCode() { byte[] frame = { 0x11, 0x16, 0x00, 0x01, 0x00, 0x02, 0x04 }; ModbusRtuTransport.ResponseBytesToRead(frame); Assert.Fail(); }
public void ResponseBytesToReadWriteCoilsResponse() { byte[] frameStart = { 0x11, 0x0F, 0x00, 0x13, 0x00, 0x0A, 0, 0 }; Assert.Equal(4, ModbusRtuTransport.ResponseBytesToRead(frameStart)); }
public void ResponseBytesToReadDiagnostics() { byte[] frameStart = { 0x01, 0x08, 0x00, 0x00 }; Assert.Equal(4, ModbusRtuTransport.ResponseBytesToRead(frameStart)); }
public void ResponseBytesToReadCoilsNoData() { byte[] frameStart = { 0x11, 0x01, 0x00, 0x00, 0x00 }; Assert.AreEqual(1, ModbusRtuTransport.ResponseBytesToRead <ReadCoilsInputsResponse>(frameStart, null)); }
public void ResponseBytesToReadInvalidFunctionCode() { byte[] frame = { 0x11, 0x16, 0x00, 0x01, 0x00, 0x02, 0x04 }; Assert.Throws <NotImplementedException>(() => ModbusRtuTransport.ResponseBytesToRead(frame)); }
public void ResponseBytesToReadWriteCoilsResponse() { byte[] frameStart = { 0x11, 0x0F, 0x00, 0x13, 0x00, 0x0A, 0, 0 }; Assert.AreEqual(4, ModbusRtuTransport.ResponseBytesToRead <ReadCoilsInputsResponse>(frameStart, null)); }