title: How to use NModbus and C# with PLC to to turn outputs on and off
body: <p>Hi all I'm using the NModbus library, and was previously running on VS2012 and then VS2010, but tried running it on VS2008 and it seems to be running better.</p>
  
  <p>Here is my output when I run the code in the dos prompt</p>
  
  <pre><code>Modbus.IO.ModbusSerialTransport Write -     TX: 1,16,7,208,0,3,6,0,1,0,5,0,15,149,152
  Modbus.IO.ModbusRTUTransport ReadResponse - RX: 1,16,7,208,0,3,128,133
  </code></pre>
  
  <p>Now I do get a flickering on my PLC unit for the RX and TX when I run this script, but I do not see my outputs on my PLC going high. Here is the associated piece of code from the library</p>
  
  <pre><code>{
          using (SerialPort port = new SerialPort("COM1"))
          {
              // configure serial port
              port.BaudRate = 38400;
              port.DataBits = 8;
              port.Parity = Parity.Odd;
              port.StopBits = StopBits.One;
              port.Open();
  
              // create modbus master
              IModbusSerialMaster master = ModbusSerialMaster.CreateRtu(port);
  
              byte slaveId = 1;
              ushort startAddress = 2000;
              //ushort[] registers = new ushort[] { 1, 2, 3 };
              ushort[] registers = new ushort[] { 01, 05, 15 };
              // write three registers
              master.WriteMultipleRegisters(slaveId, startAddress, registers);
          }
      }
  </code></pre>
  
  <p>Can someone help me in understanding the TX and RX, and also perhaps help to point me in the direction to pinpoint where I can look to find how to set outputs high from the C# script?</p>