/// <summary> /// 格口状态查询 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> public void SelectState() { string errText = string.Empty; try { for (short prot = 1; prot < 19; prot++) { string val = PlcFactory.Instance().ReadPlcDbValue("满袋" + prot.ToString() + "%", ref errText); //1 锁定 0 解锁 if (val == "-1") { createdata.UpdateErrProtSts(prot.ToString(), "", "1"); createdata.clearCount(prot.ToString()); } else if (val == "0") { createdata.UpdateErrProtSts(prot.ToString(), "", "0"); } } } catch (Exception ex) { Log.WriteLog2("袋子满了 ex" + ex.Message); } }