public override bool WriteOrder(int Address, int Value) { try { return(clsPLC.WriteOrder(Address, Value)); } catch (Exception ex) { ProcException(ex); throw ex; } }
void dtAddress_ColumnChanged(object sender, DataColumnChangeEventArgs e) { string col_name = e.Column.ColumnName; int value = 0; if (col_name == "Value") { value = int.Parse(e.Row[col_name].ToString()); } else if (col_name == "Value(HEX)") { value = Convert.ToInt32(e.Row[col_name].ToString(), 16); } else { return; } clsPLC.WriteOrder(e.Row["Address"].ToString(), value); }