private void StartForm_FormClosing(object sender, FormClosingEventArgs e) { DateSave.Instance().SaveDoc(); IOManage.OUTPUT("三色灯红").SetOutBit(false); IOManage.OUTPUT("三色灯黄").SetOutBit(false); IOManage.OUTPUT("三色灯绿").SetOutBit(false); }
public bool OutPut_More_Run(List <string> str, bool sta)//多个输出 { foreach (var keys in str) { IOManage.OUTPUT(keys).SetOutBit(sta); } return(true); }
public bool OutPut_One_Run(string str, string sta)//一个输出 { if (sta.ToLower() == "true") { IOManage.OUTPUT(str).SetOutBit(true); } else { IOManage.OUTPUT(str).SetOutBit(false); } return(true); }
private void dataGridViewOutput_CellContentClick(object sender, DataGridViewCellEventArgs e) { int CIndex = e.ColumnIndex; if (CIndex == 3 && e.RowIndex != -1) { string strName = dataGridViewOutput.Rows[e.RowIndex].Cells[0].Value.ToString(); IOManage.OUTPUT(strName).SetOutBit(true); } else if (CIndex == 4 && e.RowIndex != -1) { string strName = dataGridViewOutput.Rows[e.RowIndex].Cells[0].Value.ToString(); IOManage.OUTPUT(strName).SetOutBit(false); } }
private void StopClick() { //ComeOut.parse = false; isRunFinish = false; count = 0; IOManage.OUTPUT("焊接机允许入料").SetOutBit(false); TableManage.TableDriver("运动平台").Stop(TableAxisName.X); TableManage.TableDriver("运动平台").Stop(TableAxisName.Y); TableManage.TableDriver("运动平台").Stop(TableAxisName.Z); // RunClass.Instance().Stop = true; RunClass.Instance().RunClass_IsFinish = false; RunClass.Instance().StartRun = false; DateSave.Instance().Production.IsStop = true; MainControls.taskInfo.iTaskStep = (int)MainControl.flowCharNew.接进料流程; MainControl.Weld_Sta = "空闲中"; }
public bool Z_Baffle_In(string IsCheck)//Z轴挡板缩回 { int stime = 6000; bool runOK = false; IOManage.OUTPUT("Z轴挡板伸出").SetOutBit(false); IOManage.OUTPUT("Z轴挡板缩回").SetOutBit(true); DateTime starttime = DateTime.Now; while (true) { DateTime endtime = DateTime.Now; TimeSpan spantime = endtime - starttime; if (IOManage.INPUT("Z轴挡板伸出").Off&& IOManage.INPUT("Z轴挡板缩回").On) { runOK = true; break; } if (spantime.TotalMilliseconds > stime) { runOK = false; break; } if (DateSave.Instance().Production.IsStop == true) { runOK = true; break; } if (DateSave.Instance().Production.EStop == true) { runOK = true; break; } if (IsCheck == "不检测") { runOK = true; break; } } return(runOK); }
public bool BTooling_PlateStop_Up(string IsCheck)//工装板阻挡上升 { int stime = 6000; bool runOK = false; IOManage.OUTPUT("工装板阻挡气缸上升").SetOutBit(true); IOManage.OUTPUT("工装板阻挡气缸下降").SetOutBit(false); DateTime starttime = DateTime.Now; while (true) { DateTime endtime = DateTime.Now; TimeSpan spantime = endtime - starttime; if (IOManage.INPUT("工装板阻挡气缸上升").On&& IOManage.INPUT("工装板阻挡气缸下降").Off) { runOK = true; break; } if (spantime.TotalMilliseconds > stime) { runOK = false; break; } if (DateSave.Instance().Production.IsStop == true) { runOK = true; break; } if (DateSave.Instance().Production.EStop == true) { runOK = true; break; } if (IsCheck == "不检测") { runOK = true; break; } } return(runOK); }
public bool Copper_Mouth_Down(string IsCheck)//铜嘴下降 { int stime = 6000; bool runOK = false; IOManage.OUTPUT("铜嘴压板气缸上升").SetOutBit(false); IOManage.OUTPUT("铜嘴压板气缸下降").SetOutBit(true); DateTime starttime = DateTime.Now; while (true) { DateTime endtime = DateTime.Now; TimeSpan spantime = endtime - starttime; if (IOManage.INPUT("铜嘴压板气缸上升").Off&& IOManage.INPUT("铜嘴压板气缸下降").On) { runOK = true; break; } if (spantime.TotalMilliseconds > stime) { runOK = false; break; } if (DateSave.Instance().Production.IsStop == true) { runOK = true; break; } if (DateSave.Instance().Production.EStop == true) { runOK = true; break; } if (IsCheck == "不检测") { runOK = true; break; } } return(runOK); }
public bool Y_Axis_befor_Clinder_down(string IsCheck) // Y轴前模组顶升下 { bool runOK = false; int stime = 6000; IOManage.OUTPUT("Y轴前模组顶升气缸上升").SetOutBit(false); IOManage.OUTPUT("Y轴前模组顶升气缸下降").SetOutBit(true); DateTime starttime = DateTime.Now; while (true) { DateTime endtime = DateTime.Now; TimeSpan spantime = endtime - starttime; if (IOManage.INPUT("Y轴前模组顶升气缸上升").Off&& IOManage.INPUT("Y轴前模组顶升气缸下降").On) { runOK = true; break; } if (spantime.TotalMilliseconds > stime) { runOK = false; break; } if (DateSave.Instance().Production.IsStop == true) { runOK = true; break; } if (DateSave.Instance().Production.EStop == true) { runOK = true; break; } if (IsCheck == "不检测") { runOK = true; break; } } return(runOK); }
// X轴右模组定位缩回, public bool X_Axis_right_Clinder_Location_in(string IsCheck) // X轴右模组定位缩回, { int stime = 6000; bool runOK = false; IOManage.OUTPUT("X轴右定位气缸伸出").SetOutBit(false); IOManage.OUTPUT("X轴右定位气缸缩回").SetOutBit(true); DateTime starttime = DateTime.Now; while (true) { DateTime endtime = DateTime.Now; TimeSpan spantime = endtime - starttime; if (IOManage.INPUT("X轴右定位气缸伸出").Off&& IOManage.INPUT("X轴右定位气缸缩回").On) { runOK = true; break; } if (spantime.TotalMilliseconds > stime) { runOK = false; break; } if (DateSave.Instance().Production.IsStop == true) { runOK = true; break; } if (DateSave.Instance().Production.EStop == true) { runOK = true; break; } if (IsCheck == "不检测") { runOK = true; break; } } return(runOK); }
public bool OutPut_Two_Run(string Work_str, bool Work_sta, string Home_str, bool Home_sta, string Work_Str, bool Work_Senson, string Home_Str, bool Home_Senson, int stime) //2个输出 { IOManage.OUTPUT(Work_str).SetOutBit(Work_sta); IOManage.OUTPUT(Home_str).SetOutBit(Home_sta); bool sta = false; bool sta1 = false; DateTime starttime = DateTime.Now; while (true) { DateTime endtime = DateTime.Now; TimeSpan spantime = endtime - starttime; if (Work_Senson == true) { if (IOManage.INPUT(Work_Str).On) { sta = true; } } else { if (IOManage.INPUT(Work_Str).Off) { sta = true; } } if (Home_Senson == true) { if (IOManage.INPUT(Home_Str).On) { sta1 = true; } } else { if (IOManage.INPUT(Home_Str).Off) { sta1 = true; } } if (sta1 == true && sta == true) { break; } if (spantime.TotalMilliseconds > stime) { sta = false; break; } if (DateSave.Instance().Production.IsStop == true) { sta = true; break; } if (DateSave.Instance().Production.EStop == true) { sta = true; break; } } return(sta); }
private void timer1_Tick(object sender, EventArgs e) { if (MainControl.Weld_Sta != "") { lb_LeftStation.Text = MainControl.Weld_Sta; } //if (DateSave.Instance().Production.Door_Enable == true) //{ // DoorShow.Text = "门屏蔽"; //} //else //{ // DoorShow.Text = "门未屏蔽"; //} //if () //{ // WeldSta = true; //} if (IOManage.INPUT("锁光出光").On) { 锁光.Text = "可出光"; 锁光.BackColor = Color.Green; IOManage.OUTPUT("外部锁光").SetOutBit(true); } else { 锁光.Text = "已锁光"; 锁光.BackColor = Color.Red; IOManage.OUTPUT("外部锁光").SetOutBit(false); } if (DateSave.Instance().Production.StationMaterial == true) { btn_LeftPosWelding.Text = "工位有料"; } else { btn_LeftPosWelding.Text = "工位无料"; } if ((mes.Instance().DataReceivedstrSN != "" && LeftSnshow.Text == "") || (LeftSnshow.Text != mes.Instance().DataReceivedstrSN)) { LeftSnshow.Text = mes.Instance().DataReceivedstrSN; } try { if ((DateSave.Instance().Production.WeldDate.Average() != 0 && lb_LeftMarkPower.Text == "") || (lb_LeftMarkPower.Text != DateSave.Instance().Production.WeldDate.Average().ToString())) { lb_LeftMarkPower.Text = Math.Round(DateSave.Instance().Production.WeldDate.Average(), 1).ToString(); } } catch { } if ((DateSave.Instance().Production.OK_date != 0 && lb_LeftYield.Text == "") || (lb_LeftYield.Text != DateSave.Instance().Production.OK_date.ToString())) { lb_LeftYield.Text = DateSave.Instance().Production.OK_date.ToString(); } if ((DateSave.Instance().Production.Weld_Speed != 0 && lb_LeftMarkSpeed.Text == "") || (lb_LeftMarkSpeed.Text != DateSave.Instance().Production.Weld_Speed.ToString())) { lb_LeftMarkSpeed.Text = DateSave.Instance().Production.Weld_Speed.ToString(); } if (lb_LeftPos.Text != DateSave.Instance().Production.TheCurrentpoint.ToString()) { lb_LeftPos.Text = DateSave.Instance().Production.TheCurrentpoint.ToString(); } if ((DateSave.Instance().Production.CTtime != "" && lb_LeftCT.Text == "") || (lb_LeftCT.Text != DateSave.Instance().Production.CTtime)) { lb_LeftCT.Text = DateSave.Instance().Production.CTtime; } if (DateSave.Instance().Production.ModelNo != "" && 当前机种号.Text == "NUM" || 当前机种号.Text != DateSave.Instance().Production.ModelNo) { 当前机种号_.Text = DateSave.Instance().Production.ModelNo; 当前机种号.Text = DateSave.Instance().Production.ModelNo; } if (Socket_server.Instance().recvDate != "") { lb_RightMarkSpeed.Text = Socket_server.Instance().recvDate; } if ((DateSave.Instance().Production.Current_TIME != 0 && 清理铜嘴次数.Text == "") || (清理铜嘴次数.Text != DateSave.Instance().Production.Current_TIME.ToString())) { 清理铜嘴次数.Text = DateSave.Instance().Production.Current_TIME.ToString(); } if (DateSave.Instance().Production.Clear_TIME == DateSave.Instance().Production.Current_TIME) { MainControl.BIZZ("请清理铜嘴", "请清理铜嘴"); DateSave.Instance().Production.Current_TIME++; } if (frist == 0 && LoginForm.landingFinish == true) { frist++; asc.AddControl(panel2); } if (frist == 1) { this.Top = 0; this.Left = 0; frist++; delay(1000); int Width = Screen.PrimaryScreen.WorkingArea.Width; int Height = Screen.PrimaryScreen.WorkingArea.Height; int wih = MainModule.FormMain.Width; int aq1e = panel2.Width; int aqe = panel2.Height; panel2.SetBounds(asc.oldCtrl[0].Top, asc.oldCtrl[0].Left, Width, aqe); Thread.Sleep(100); if (asc.oldCtrl.Count > 0) { asc.controlAutoSize(panel2); } } double sd = 0.0; TableManage.TableDriver("运动平台")._GetAdc(1, out sd); if (startHoming || MainModule.FormMain.bAuto) { } else if (IOManage.INPUT("手轮X").On || IOManage.INPUT("手轮Y").On || IOManage.INPUT("手轮Z").On || IOManage.INPUT("手轮U").On) { if (IOManage.INPUT("手轮X").On&& setOk == false) { if (IOManage.INPUT("手轮1").On) { setOk = true; TableManage.TableDriver("运动平台").StartManualPulser(1, 1); } else if (IOManage.INPUT("手轮10").On) { setOk = true; TableManage.TableDriver("运动平台").StartManualPulser(1, 10); } else if (IOManage.INPUT("手轮100").On) { setOk = true; TableManage.TableDriver("运动平台").StartManualPulser(1, 50); } } if (IOManage.INPUT("手轮Y").On&& setOk == false) { if (IOManage.INPUT("手轮1").On) { setOk = true; TableManage.TableDriver("运动平台").StartManualPulser(2, 1); } else if (IOManage.INPUT("手轮10").On) { setOk = true; TableManage.TableDriver("运动平台").StartManualPulser(2, 10); } else if (IOManage.INPUT("手轮100").On) { setOk = true; TableManage.TableDriver("运动平台").StartManualPulser(2, 50); } } if (IOManage.INPUT("手轮Z").On&& setOk == false) { if (IOManage.INPUT("手轮1").On) { setOk = true; TableManage.TableDriver("运动平台").StartManualPulser(3, 1); } else if (IOManage.INPUT("手轮10").On) { setOk = true; TableManage.TableDriver("运动平台").StartManualPulser(3, 10); } else if (IOManage.INPUT("手轮100").On) { setOk = true; TableManage.TableDriver("运动平台").StartManualPulser(3, 50); } } if (IOManage.INPUT("手轮U").On&& setOk == false) { if (IOManage.INPUT("手轮1").On) { setOk = true; TableManage.TableDriver("运动平台").StartManualPulser(4, 1); } else if (IOManage.INPUT("手轮10").On) { setOk = true; TableManage.TableDriver("运动平台").StartManualPulser(4, 10); } else if (IOManage.INPUT("手轮100").On) { setOk = true; TableManage.TableDriver("运动平台").StartManualPulser(4, 50); } } } else if (IOManage.INPUT("手轮X").Off&& IOManage.INPUT("手轮Y").Off&& IOManage.INPUT("手轮Z").Off&& setOk == true) { setOk = false; TableManage.TableDriver("运动平台").StopManualPulser(0); TableManage.TableDriver("运动平台").StopManualPulser(1); TableManage.TableDriver("运动平台").StopManualPulser(2); TableManage.TableDriver("运动平台").StopManualPulser(3); TableManage.TableDriver("运动平台").StopManualPulser(4); TableManage.TableDriver("运动平台").StopManualPulser(5); TableManage.TableDriver("运动平台").StopManualPulser(6); TableManage.TableDriver("运动平台").StopManualPulser(7); } if (MainModule.FormMain.Parse == false && RunClass.Instance().parse == true) { RunClass.Instance().parse = false; RunClass.Instance().GoOnRun = true; } // if (IOManage.INPUT("文档状态").On) //{ // RunClass.Instance(). WeldFinishSta = "StartWeld"; //} // if (IOManage.INPUT("文档状态").Off) // { // RunClass.Instance().WeldFinishSta = "WeldFinish"; // } //if (StartHome==true) //{ // MainModule.FormMain.bHomeReady = false; // StartHome = false; // MainModule.FormMain.bHomeReady = false; // StartHome = false; HomeDoneZ = false; // TableManage.TableDriver("运动平台").Home(TableAxisName.Z); //} //if (TableManage.TableDriver("运动平台").HomeDone(TableAxisName.Z) && HomeDoneZ == false) //{ // HomeDoneZ = true; // HomeDoneXY = false; //} //if (HomeDoneXY == false) //{ // HomeDoneXY = true; // TableManage.TableDriver("运动平台").Home(TableAxisName.X); // TableManage.TableDriver("运动平台").Home(TableAxisName.Y); //} //if (TableManage.TableDriver("运动平台").HomeDone(TableAxisName.X) && TableManage.TableDriver("运动平台").HomeDone(TableAxisName.Y)&& HomeDoneXY == false) //{ // HomeDoneXY = true; // MainModule.FormMain.bHomeReady = true; //} //string en = ""; //string sendd = ""; //sendd = Weld_Log.Instance().Dequeue(en); //if (sendd != "") //{ // Weld_Log.Instance().WriteLog(LOG_LEVEL.LEVEL_3, sendd, LOG_TYPE.INFO); //} //else //{ // // Thread.Sleep(200); //} if (MainModule.FormMain.bEstop == true) { DateSave.Instance().Production.EStop = true; } //else //{ // DateSave.Instance().Production.EStop = false; //} }