Exemple #1
0
 private void buttonReadCoils_Click(object sender, EventArgs e)
 {
     byte[] theCoilResult;
     try
     {
         theCoilResult          = myModbusMaster.ReadCoils(clientAddress, (ushort)((coilAddressRead[0] << 8) + coilAddressRead[1]), (ushort)numericUpDownCoilCount.Value);
         textBoxReadResult.Text = HexEncoding.ToString(theCoilResult, 0, theCoilResult.Length);
     }
     catch (Exception ex)
     {
         writeErrorMessage(ex.Message);
     }
 }