/// <summary> /// 运行模式 /// </summary> /// <returns></returns> public string SendRunModel() { md.SlaveId = "01"; md.Address = RunModelAddr; md.Flag = false; byte[] a = new byte[2]; a[0] = 0; a[1] = byte.Parse(this.cmbRunModel.SelectedValue.ToString()); Send(md.CreateModbusSendData(a)); if (!md.Flag) { return("运行模式写入失败"); } ini.WriteIni("Config", "RunModel", a[1].ToString()); return("运行模式写入成功"); }