title: Modbus TCP Slave. Data transmit
body: <p>I develop c# windows form ModbusTCP Slave application which provides data from dataGridView. 
  I create method which reading data from dataGridView and start listen. 
  I need that I can refresh data in current listening. </p>
  
  <p>My method: </p>
  
  <pre><code>void Button1Click(object sender, EventArgs e)
      {
           IPAddress address = IPAddress.Parse(tbIP.Text);
           int port = Convert.ToInt32(tbPort.Text);
           slaveTcpListener = new TcpListener(address, port);
           slave = ModbusTcpSlave.CreateTcp(1, slaveTcpListener);
           DataStore data = new DataStore();
             for (int i=0; i&lt;dgV.Rows.Count-1; i++)
              { 
              slave.DataStore.InputRegisters[Convert.ToInt32(dgV[0,i].Value)] = (ushort)Convert.ToUInt16(dgV[1,i].Value);
              } 
  
             slave.Listen();} 
  </code></pre>
  
  <p>I need refresh data in DataGridView. How I can it? 
  So, if I change data in table and click button again then I get an error.
  Thank you for your help </p>