private void button4_Click(object sender, EventArgs e) { Dictionary <int, int> senDictionary = new Dictionary <int, int>(); senDictionary.Add(ingboxcode.Value, ingqty.Value); NixielightSDK.SendByMODBUS(senDictionary); }
public void SendNull() { Dictionary <int, int> senDictionary = new Dictionary <int, int>(); for (int i = 1; i <= 84; i++) { //senDictionary.Add(i, ingqty.Value); senDictionary.Add(i, 0); } NixielightSDK.SendByMODBUS(senDictionary); }
/// <summary> /// 接收按钮信号 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void serialPortDao_Received(object sender, PortDataReciveEventArgs e) { if (Tags != null && Tags.Keys.Contains(Convert.ToInt32(e.Data[0]))) { lock (o) { Tags[Convert.ToInt32(e.Data[0])].Qty = 0; } Dictionary <int, int> sendcontext = new Dictionary <int, int>(); sendcontext.Add(Convert.ToInt32(e.Data[0]), 0); NixielightSDK.SendByMODBUS(sendcontext); } }
private void SendTaskPutNiLight(object o) { try { Dictionary <int, int> senDictionary = new Dictionary <int, int>(); senDictionary = opert.GetTaskOutNum(o); NixielightSDK.SendByMODBUS(senDictionary); } catch (Exception) { } }
public bool SendPD() { try { Dictionary <int, int> senDictionary = new Dictionary <int, int>(); LineBoxProcessList lineboxprocesslist = LineBoxProcessList.GetList("盘点"); OperateOpcAndSoft operateOpcAndSoft = new OperateOpcAndSoft(); Dictionary <int, int> putoutnums = operateOpcAndSoft.GetPutOutNum(); for (int i = 0; i < lineboxprocesslist.Count; i++) { if (putoutnums.ContainsKey(Convert.ToInt32(lineboxprocesslist[i].LINEBOXCODE))) { lineboxprocesslist[i].OUTQTY = putoutnums[Convert.ToInt32(lineboxprocesslist[i].LINEBOXCODE)]; lineboxprocesslist[i].NONQTY = (lineboxprocesslist[i].NONQTY - lineboxprocesslist[i].OUTQTY); } //if (i == 9 || i == 11 || i == 21 || i == 23 || i == 33 || i == 36 || i == 45 || i == 47 || i == 57 || i == 59 || i == 69 || i == 71 || i == 81 || i == 83) //将双仓的数量与前一个单仓相加 if (AppUtil.Put2LineBox.Contains(lineboxprocesslist[i].LINEBOXCODE)) { lineboxprocesslist[i - 1].NONQTY = lineboxprocesslist[i - 1].NONQTY + lineboxprocesslist[i].NONQTY; } } for (int i = 0; i < lineboxprocesslist.Count; i++) { senDictionary.Add(Convert.ToInt32(lineboxprocesslist[i].LINEBOXCODE), lineboxprocesslist[i].NONQTY); } NixielightSDK.SendByMODBUS(senDictionary); return(true); } catch (Exception ex) { return(false); } }
private void buttonX1_Click(object sender, EventArgs e) { //for (int j = 111;j < 1000; j=j + 111) //{ // Dictionary<int, int> senDictionary = new Dictionary<int, int>(); // for (int i = 1; i <= 84; i++) // { // //senDictionary.Add(i, ingqty.Value); // senDictionary.Add(i, j); // } // SendByMODBUS(senDictionary); //} Dictionary <int, int> senDictionary = new Dictionary <int, int>(); for (int i = 1; i <= 84; i++) { //senDictionary.Add(i, ingqty.Value); senDictionary.Add(i, 888); } NixielightSDK.SendByMODBUS(senDictionary); }