title: modbus rtu slave not responding to request and C-ERR light coming on slave
body: <p>Situation I have a oriental motors LSD-KD Stepper motor driver, I'm connecting Through a
  PC -> USB -> RS232 -> RS485 -> Driver. The Driver uses RS485 Modbus RTU, and is sent with transmision speed of 38400, databits of 8, stopbits of 1, parity of even, and slave number of 2. </p>
  
  <p>Im sending trying to send out 0x02,0x06,0x02,0x4b,0x00,0x50,0xf8,0x6b which should right a register. and im not getting any response, and the C-DAT/C-ERR goes red.</p>
  
  <p>I have this bit of Javascript code </p>
  
  <pre><code>var crc = require('crc');
  var SerialPort = require("serialport").SerialPort
  var serialPort = new SerialPort("/dev/cu.usbserial", {
    baudrate: 38400,
    databits: 8,
    stopbits: 1,
    parity: 'even'
  });
  
  var buff = new Buffer([0x02,0x06,0x02,0x4b,0x00,0x50,0xf8,0x6b]);
  
  console.assert(crc.crc16modbus(buff) == 0);
  
  serialPort.open(function () {
  
     serialPort.on('data', function(data) {
        console.log("recieving:", data);
      });
  
    setInterval(function() {
      console.log("writing", buff)
     serialPort.write(buff);
    },1000);
  
  });
  </code></pre>
  
  <p>When running the code I see:</p>
  
  <pre><code>writing &lt;Buffer 02 06 02 4b 00 50 f8 6b&gt;
  recieving: &lt;Buffer 02&gt;
  recieving: &lt;Buffer 06&gt;
  recieving: &lt;Buffer 02&gt;
  recieving: &lt;Buffer 4b&gt;
  recieving: &lt;Buffer 00&gt;
  recieving: &lt;Buffer 50&gt;
  recieving: &lt;Buffer f8&gt;
  recieving: &lt;Buffer 6b&gt;
  </code></pre>
  
  <p>which is excepted as the RS485 has an echo. but im not receiving any thing back from the slave.</p>
  
  <p>EDIT:
  more on the configuration.
  on the RS232 &lt;-> RS485 convertor its set to 'T.ON R.ON' and 'DCE' it is this device. <a href="http://www.aten.com/products/Data-Communication/Industry-Controls/RS-232RS-485-Interface-Converter~IC485S.html#.VJI-LqZU-34" rel="nofollow">a device page</a>.</p>
  
  <p>on the driver it is set as so:</p>
  
  <p>SW1 is set to 2, SW1 corresponds to slave number</p>
  
  <p>SW2 is set to 2, SW2 with a value of two indicates a transmission rate of 38400</p>
  
  <p>SW3 is set to '1: off, 2: on, 3: off, 4: on'</p>
  
  <pre><code> No.1: Set the address number, this causes the slave address to be 16 values higher
   No.2: Set the protocol, this sets it to use the ModBus Protocol
   No.3: Not used 
   No.4: Set the termination resistor (120 Ω)
  </code></pre>
  
  <p>Output port of RS232 &lt;-> RS485 convertor is connected to driver.
  the output port is also connect to the input port of the converter. hence the echo.</p>