private void LogicLoad(int Slot_ID, int Slot_Index) { Common.Reports.LogFile.DebugLog(MethodBase.GetCurrentMethod(), "In Function"); try { if (!StaticRes.Global.Hardware_Connection) { loadcomplete(true); return; } if (!StaticRes.Global.Need_Homing) { #region ***(L000)*** Rotary move to point position if (StaticRes.Global.Process_Code.Loading == "L000" && StaticRes.Global.Transaction_Continue) { Common.Reports.LogFile.DebugLog(MethodBase.GetCurrentMethod(), "In L000"); IO_Control.Green_Tower_Light_Setting(); step("L000 - Rotary move to Slot-" + Slot_ID.ToString() + ",Position:" + StaticRes.Global.Slot_Position[Slot_ID - 1].ToString() + "");//" + StaticRes.Global.Slot_Position[Slot_ID - 1].ToString + " try { Common.Reports.LogFile.DebugLog(MethodBase.GetCurrentMethod(), "L000, Start Move to slot"); Motion_Control.Rotary_MoveTo_Slot_ABSMode(Slot_ID); Common.Reports.LogFile.DebugLog(MethodBase.GetCurrentMethod(), "L000, move complete, current position:" + Motion_Control.Got_Rotary_Position().ToString()); Common.Reports.LogFile.Log("load move to slot successful ,current position:" + Motion_Control.Got_Rotary_Position().ToString() + ""); Motion_Control.Motion_Speed_Checking(); StaticRes.Global.Process_Code.Loading = "L100"; } catch (Exception ex) { Common.Reports.LogFile.DebugLog(MethodBase.GetCurrentMethod(), "L000, Catch Exception:" + ex.ToString()); Error_Throw(StaticRes.Global.Error_List.Motion_failed, "L000"); return; } } #endregion //2020 07 19 by Dwyane for Slot Barcode Validation #region ***(L100)*** Slot Barcode Validation if (StaticRes.Global.Process_Code.Loading == "L100" && StaticRes.Global.Transaction_Continue) { Common.Reports.LogFile.DebugLog(MethodBase.GetCurrentMethod(), "In L100"); step("L100 - Scan Slot-" + Slot_ID.ToString() + " Barcode ,Position:" + StaticRes.Global.Slot_Position[Slot_ID - 1].ToString() + ""); try { Common.Reports.LogFile.DebugLog(MethodBase.GetCurrentMethod(), "L100, slot index:" + Slot_Index); string comPort = string.Empty; switch (Slot_Index) { case 1: comPort = StaticRes.Global.System_Setting.SlotScanner_Index1Port; break; case 2: comPort = StaticRes.Global.System_Setting.SlotScanner_Index2Port; break; case 3: comPort = StaticRes.Global.System_Setting.SlotScanner_Index3Port; break; case 4: comPort = StaticRes.Global.System_Setting.SlotScanner_Index4Port; break; } Common.Reports.LogFile.DebugLog(MethodBase.GetCurrentMethod(), "L100, start init & open com port"); //初始化, 并打开com port InitAndOpen(comPort); //转盘来回摆动5次 for (int i = 0; i < 5; i++) { //一旦扫到barcode, 就立马跳出循环并关闭com口 if (receivedSlotID != "") { Common.Reports.LogFile.DebugLog(MethodBase.GetCurrentMethod(), "L100, received scanner msg, break"); CloseSlotScanner(); break; } Motion_Control.Rotary_Move(10000); Motion_Control.Motion_Speed_Checking(); System.Threading.Thread.Sleep(300); Motion_Control.Rotary_Move(-10000); Motion_Control.Motion_Speed_Checking(); System.Threading.Thread.Sleep(300); Common.Reports.LogFile.DebugLog(MethodBase.GetCurrentMethod(), "L100, move come and back, time" + i.ToString()); } if (receivedSlotID == "") { //来回5次都没扫到报警. Common.Reports.LogFile.DebugLog(MethodBase.GetCurrentMethod(), "L100, 5 times moving come and back still can not read slot barcode, start alarming"); Error_Throw(StaticRes.Global.Error_List.SlotBarcode_Read_Fail, "L000"); return; } else { if (receivedSlotID == Slot_ID.ToString()) { //进入下一步 StaticRes.Global.Process_Code.Loading = "L200"; receivedSlotID = ""; } else { //扫到的位置不是目标位置则报错. Common.Reports.LogFile.DebugLog(MethodBase.GetCurrentMethod(), "L100, received wrong place received slot id:" + "receivedSlotID" + ", tartget slot id:" + Slot_ID); Error_Throw(StaticRes.Global.Error_List.MissingPlace, "L000"); return; } } } catch (Exception ex) { Common.Reports.LogFile.DebugLog(MethodBase.GetCurrentMethod(), "L100, Catch Exception:" + ex.ToString()); Error_Throw(StaticRes.Global.Error_List.Motion_failed, "L000"); return; } } #endregion #region ***(L200)*** Check slot index and move to related process if (StaticRes.Global.Process_Code.Loading == "L200" && StaticRes.Global.Transaction_Continue) { switch (Slot_Index) { case 1: StaticRes.Global.Process_Code.Loading = "L300"; break; case 2: StaticRes.Global.Process_Code.Loading = "L700"; break; case 3: StaticRes.Global.Process_Code.Loading = "L1100"; break; case 4: StaticRes.Global.Process_Code.Loading = "L1500"; break; } } #endregion #region Index 1 #region ***(L300)*** Open Gate A and check X109 if (StaticRes.Global.Process_Code.Loading == "L300" && StaticRes.Global.Transaction_Continue) { step("L300 - Open Gate A and check X109"); if (IO_Control.X109_Gate_A_Open_and_Check()) { StaticRes.Global.Process_Code.Loading = "L400"; loadcomplete(false); return; } else { Error_Throw(StaticRes.Global.Error_List.Gate_A_not_opened, "L300"); return; } } #endregion #region ***(L400)*** Check loading door close sensor X102 if (StaticRes.Global.Process_Code.Loading == "L400" && StaticRes.Global.Transaction_Continue) { step("L400 - Close loading door and check X102"); if (Hardware.IO_LIST.Input.X102_Loading_Door_Closed()) { StaticRes.Global.Process_Code.Loading = "L500"; } else { Error_Throw(StaticRes.Global.Error_List.Loading_door_not_closed, "L400"); return; } } #endregion #region ***(L500)*** Check syringe A present sensor X104 if (StaticRes.Global.Process_Code.Loading == "L500" && StaticRes.Global.Transaction_Continue) { step("L500 - Check syringe A present sensor X104"); if (Hardware.IO_LIST.Input.X104_Syringe_A_Present()) { StaticRes.Global.Process_Code.Loading = "L600"; } else { Error_Throw(StaticRes.Global.Error_List.Syringe_A_not_present, "L500"); return; } } #endregion #region ***(L600)*** Close gate A and check X108 if (StaticRes.Global.Process_Code.Loading == "L600" && StaticRes.Global.Transaction_Continue) { step("L600 - Close Gate A and check X108"); if (IO_Control.X108_Gate_A_Close_and_Check()) { StaticRes.Global.Process_Code.Loading = "L1900"; } else { Error_Throw(StaticRes.Global.Error_List.Gate_A_not_closed, "L600"); return; } } #endregion #endregion #region Index 2 #region ***(L700)*** Open Gate B and check X111 if (StaticRes.Global.Process_Code.Loading == "L700" && StaticRes.Global.Transaction_Continue) { step("L700 - Open Gate B and check X111"); if (IO_Control.X111_Gate_B_Open_and_Check()) { StaticRes.Global.Process_Code.Loading = "L800"; loadcomplete(false); return; } else { Error_Throw(StaticRes.Global.Error_List.Gate_B_not_opened, "L700"); return; } } #endregion #region ***(L800)*** Check loading door close sensor X102 if (StaticRes.Global.Process_Code.Loading == "L800" && StaticRes.Global.Transaction_Continue) { step("L800 - Close loading door and check X102"); if (Hardware.IO_LIST.Input.X102_Loading_Door_Closed()) { StaticRes.Global.Process_Code.Loading = "L900"; } else { Error_Throw(StaticRes.Global.Error_List.Loading_door_not_closed, "L800"); return; } } #endregion #region ***(L900)*** Check syringe B present sensor X105 if (StaticRes.Global.Process_Code.Loading == "L900" && StaticRes.Global.Transaction_Continue) { step("L900 - Check syringe B present sensor X105"); if (Hardware.IO_LIST.Input.X105_Syringe_B_Present()) { StaticRes.Global.Process_Code.Loading = "L1000"; } else { Error_Throw(StaticRes.Global.Error_List.Syringe_B_not_present, "L900"); return; } } #endregion #region ***(L1000)*** Close gate B and check X110 if (StaticRes.Global.Process_Code.Loading == "L1000" && StaticRes.Global.Transaction_Continue) { step("L1000 - Close gate B and check X110 sensor"); if (IO_Control.X110_Gate_B_Close_and_Check()) { StaticRes.Global.Process_Code.Loading = "L1900"; } else { Error_Throw(StaticRes.Global.Error_List.Gate_B_not_closed, "L1000"); return; } } #endregion #endregion #region Index 3 #region ***(L1100)*** Open Gate C and check X113 if (StaticRes.Global.Process_Code.Loading == "L1100" && StaticRes.Global.Transaction_Continue) { step("L1100 - Open Gate C and check X113"); if (IO_Control.X113_Gate_C_Open_and_Check()) { StaticRes.Global.Process_Code.Loading = "L1200"; loadcomplete(false); return; } else { Error_Throw(StaticRes.Global.Error_List.Gate_C_not_opened, "L1100"); return; } } #endregion #region ***(L1200)*** Check loading door close sensor X102 if (StaticRes.Global.Process_Code.Loading == "L1200" && StaticRes.Global.Transaction_Continue) { step("L1200 - Check loading door close sensor X102"); if (Hardware.IO_LIST.Input.X102_Loading_Door_Closed()) { StaticRes.Global.Process_Code.Loading = "L1300"; } else { Error_Throw(StaticRes.Global.Error_List.Loading_door_not_closed, "L1200"); return; } } #endregion #region ***(L1300)*** Check syringe C present sensor X106 if (StaticRes.Global.Process_Code.Loading == "L1300" && StaticRes.Global.Transaction_Continue) { step("L1300 - Check syringe C present sensor X106"); if (Hardware.IO_LIST.Input.X106_Syringe_C_Present()) { StaticRes.Global.Process_Code.Loading = "L1400"; } else { Error_Throw(StaticRes.Global.Error_List.Syringe_C_not_present, "L1300"); return; } } #endregion #region ***(L1400)*** Close gate C and check X112 if (StaticRes.Global.Process_Code.Loading == "L1400" && StaticRes.Global.Transaction_Continue) { step("L1400 - Close gate C and check X112 sensor"); if (IO_Control.X112_Gate_C_Close_and_Check()) { StaticRes.Global.Process_Code.Loading = "L1900"; } else { Error_Throw(StaticRes.Global.Error_List.Gate_C_not_closed, "L1400"); return; } } #endregion #endregion #region Index 4 #region ***(L1500)*** Open Gate D and check X115 if (StaticRes.Global.Process_Code.Loading == "L1500" && StaticRes.Global.Transaction_Continue) { step("L1500 - Open Gate D and check X115"); if (IO_Control.X115_Gate_D_Open_and_Check()) { StaticRes.Global.Process_Code.Loading = "L1600"; loadcomplete(false); return; } else { Error_Throw(StaticRes.Global.Error_List.Gate_D_not_opened, "L1500"); return; } } #endregion #region ***(L1600)*** Check loading door close sensor X102 if (StaticRes.Global.Process_Code.Loading == "L1600" && StaticRes.Global.Transaction_Continue) { step("L1600 - Check loading door close sensor X102"); if (Hardware.IO_LIST.Input.X102_Loading_Door_Closed()) { StaticRes.Global.Process_Code.Loading = "L1700"; } else { Error_Throw(StaticRes.Global.Error_List.Loading_door_not_closed, "L1600"); return; } } #endregion #region ***(L1700)*** Check syringe D present sensor X107 if (StaticRes.Global.Process_Code.Loading == "L1700" && StaticRes.Global.Transaction_Continue) { step("L1700 - Check syringe D present sensor X107"); if (Hardware.IO_LIST.Input.X107_Syringe_D_Present()) { StaticRes.Global.Process_Code.Loading = "L1800"; } else { Error_Throw(StaticRes.Global.Error_List.Syringe_C_not_present, "L1700"); return; } } #endregion #region ***(L1800)*** Close gate D and check X114 if (StaticRes.Global.Process_Code.Loading == "L1800" && StaticRes.Global.Transaction_Continue) { step("L1800 - Close gate D and check X114 sensor"); if (IO_Control.X114_Gate_D_Close_and_Check()) { StaticRes.Global.Process_Code.Loading = "L1900"; } else { Error_Throw(StaticRes.Global.Error_List.Gate_D_not_closed, "L1800"); return; } } #endregion #endregion #region ***(L1900)*** Loading completed , rotary continue moving if (StaticRes.Global.Process_Code.Loading == "L1900" && StaticRes.Global.Transaction_Continue) { step("L1900 - Loading completed"); try { IO_Control.Yellow_Tower_Light_Setting(); StaticRes.Global.Process_Code.Loading = "L000"; StaticRes.Global.IsOnProgress = false; loadcomplete(true); return; } catch (Exception ee) { Error_Throw(StaticRes.Global.Error_List.Motion_failed, "L1900"); return; } } #endregion return; } else { Error_Throw(StaticRes.Global.Error_List.Please_homing_first, "L000"); return; } } catch (Exception ee) { Common.Reports.LogFile.Log("Loading Error -- " + ee.Message + ",L000 , user:"******"From Load Exception"); return; } }
private void LogicUnload(int Slot_ID, int Slot_Index) { Common.Reports.LogFile.DebugLog(MethodBase.GetCurrentMethod(), "In Function"); try { if (!StaticRes.Global.Hardware_Connection) { unloadcomplete(true); return; } if (!StaticRes.Global.Need_Homing) { #region ***(U000)*** Move to pointed position if (StaticRes.Global.Process_Code.Unloading == "U000" && StaticRes.Global.Transaction_Continue) { Common.Reports.LogFile.DebugLog(MethodBase.GetCurrentMethod(), "In U000"); IO_Control.Green_Tower_Light_Setting(); step("U000 - Rotary move to Slot-" + Slot_ID.ToString() + ",Position:" + StaticRes.Global.Slot_Position[Slot_ID - 1].ToString() + ""); try { //Motion_Control.Motion_Speed_Checking(); //if (StaticRes.Global.Need_Homing) //{ // Error_Throw(StaticRes.Global.Error_List.Please_homing_first, "U000"); // return; //} Common.Reports.LogFile.DebugLog(MethodBase.GetCurrentMethod(), "U000, Start move to slot"); Motion_Control.Rotary_MoveTo_Slot(Slot_ID); Common.Reports.LogFile.DebugLog(MethodBase.GetCurrentMethod(), "U000, move complete, current position: " + Motion_Control.Got_Rotary_Position().ToString()); Common.Reports.LogFile.Log("Unload move to slot successful ,current position:" + Motion_Control.Got_Rotary_Position().ToString() + ""); Motion_Control.Motion_Speed_Checking(); StaticRes.Global.Process_Code.Unloading = "U050"; } catch (Exception ex) { Common.Reports.LogFile.DebugLog(MethodBase.GetCurrentMethod(), "U000, Catch Exception:" + ex.ToString()); Error_Throw(StaticRes.Global.Error_List.Motion_failed, "U000"); return; } } #endregion //2020 07 19 by Dwyane for Slot Barcode Validation #region ***(U050)*** Slot Barcode Validation if (StaticRes.Global.Process_Code.Unloading == "U050" && StaticRes.Global.Transaction_Continue) { Common.Reports.LogFile.DebugLog(MethodBase.GetCurrentMethod(), "In U050"); step("U050 - Scan Slot-" + Slot_ID.ToString() + " Barcode ,Position:" + StaticRes.Global.Slot_Position[Slot_ID - 1].ToString() + ""); try { Common.Reports.LogFile.DebugLog(MethodBase.GetCurrentMethod(), "U050, slot index:" + Slot_Index); string comPort = string.Empty; switch (Slot_Index) { case 1: comPort = StaticRes.Global.System_Setting.SlotScanner_Index1Port; break; case 2: comPort = StaticRes.Global.System_Setting.SlotScanner_Index2Port; break; case 3: comPort = StaticRes.Global.System_Setting.SlotScanner_Index3Port; break; case 4: comPort = StaticRes.Global.System_Setting.SlotScanner_Index4Port; break; } Common.Reports.LogFile.DebugLog(MethodBase.GetCurrentMethod(), "U050, start init & open com port:"); //初始化, 并打开com port InitAndOpen(comPort); //转盘来回摆动5次 for (int i = 0; i < 5; i++) { //一旦扫到barcode, 就立马跳出循环并关闭com口 if (receivedSlotID != "") { Common.Reports.LogFile.DebugLog(MethodBase.GetCurrentMethod(), "U050, received scanner msg, break"); CloseSlotScanner(); break; } Motion_Control.Rotary_Move(10000); Motion_Control.Motion_Speed_Checking(); System.Threading.Thread.Sleep(300); Motion_Control.Rotary_Move(-10000); Motion_Control.Motion_Speed_Checking(); System.Threading.Thread.Sleep(300); Common.Reports.LogFile.DebugLog(MethodBase.GetCurrentMethod(), "U050, move come and back, time" + i.ToString()); } if (receivedSlotID == "") { //来回5次都没扫到报警. Common.Reports.LogFile.DebugLog(MethodBase.GetCurrentMethod(), "U050, 5 times moving come and back still can not read slot barcode, start alarming"); Error_Throw(StaticRes.Global.Error_List.SlotBarcode_Read_Fail, "U000"); return; } else { if (receivedSlotID == Slot_ID.ToString()) { //进入下一步 StaticRes.Global.Process_Code.Unloading = "U100"; receivedSlotID = ""; } else { //扫到的位置不是目标位置则报错. Common.Reports.LogFile.DebugLog(MethodBase.GetCurrentMethod(), "U050, received wrong place received slot id:" + "receivedSlotID" + ", tartget slot id:" + Slot_ID); Error_Throw(StaticRes.Global.Error_List.MissingPlace, "U000"); return; } } } catch (Exception ex) { Common.Reports.LogFile.DebugLog(MethodBase.GetCurrentMethod(), "U050, Catch Exception:" + ex.ToString()); Error_Throw(StaticRes.Global.Error_List.Motion_failed, "U000"); return; } } #endregion #region ***(U100)*** Check slot index and move to related process if (StaticRes.Global.Process_Code.Unloading == "U100" && StaticRes.Global.Transaction_Continue) { switch (Slot_Index) { case 1: StaticRes.Global.Process_Code.Unloading = "U200"; break; case 2: StaticRes.Global.Process_Code.Unloading = "U900"; break; case 3: StaticRes.Global.Process_Code.Unloading = "U1600"; break; case 4: StaticRes.Global.Process_Code.Unloading = "U2300"; break; } } #endregion #region Index 1 #region ***(U200)*** Open Gate A and check X109 if (StaticRes.Global.Process_Code.Unloading == "U200" && StaticRes.Global.Transaction_Continue) { Common.Reports.LogFile.DebugLog(MethodBase.GetCurrentMethod(), "In U200"); step("U200 - Open Gate A and check X109"); if (IO_Control.X109_Gate_A_Open_and_Check()) { StaticRes.Global.Process_Code.Unloading = "U300"; } else { Common.Reports.LogFile.DebugLog(MethodBase.GetCurrentMethod(), "U200, Gate A not open"); Error_Throw(StaticRes.Global.Error_List.Gate_A_not_opened, "U200"); return; } } #endregion #region ***(U300)*** Ejector A Up and check X208 if (StaticRes.Global.Process_Code.Unloading == "U300" && StaticRes.Global.Transaction_Continue) { Common.Reports.LogFile.DebugLog(MethodBase.GetCurrentMethod(), "In U300"); step("U030 - Ejector A Up and check X208"); if (IO_Control.X208_Ejector_A_Up_and_Check()) { StaticRes.Global.Process_Code.Unloading = "U600"; unloadcomplete(false); return; } else { Common.Reports.LogFile.DebugLog(MethodBase.GetCurrentMethod(), "U300, Ejector A not up"); Error_Throw(StaticRes.Global.Error_List.Ejector_A_not_up, "U300"); return; } } #endregion #region ***(U600)*** Ejector A down and check X209 if (StaticRes.Global.Process_Code.Unloading == "U600" && StaticRes.Global.Transaction_Continue) { step("U600 - Ejector A down and check X209"); if (IO_Control.X209_Ejector_A_Down_and_Check()) { StaticRes.Global.Process_Code.Unloading = "U700"; } else { Error_Throw(StaticRes.Global.Error_List.Ejector_A_not_down, "U600"); return; } } #endregion #region ***(U700)*** Check syringe a present sensor X104 if (StaticRes.Global.Process_Code.Unloading == "U700" && StaticRes.Global.Transaction_Continue) { step("U700 - Check syringe A present sensor X104"); if (!Hardware.IO_LIST.Input.X104_Syringe_A_Present()) { StaticRes.Global.Process_Code.Unloading = "U800"; } else { Error_Throw(StaticRes.Global.Error_List.Syringe_A_present, "U700"); return; } } #endregion #region ***(U800)*** Close gate A and check X108 if (StaticRes.Global.Process_Code.Unloading == "U800" && StaticRes.Global.Transaction_Continue) { step("U800 - Close Gate A and check X108"); if (IO_Control.X108_Gate_A_Close_and_Check()) { StaticRes.Global.Process_Code.Unloading = "U3000"; } else { Error_Throw(StaticRes.Global.Error_List.Gate_A_not_closed, "U800"); return; } } #endregion #endregion #region Index 2 #region ***(U900)*** Open Gate B and check X111 if (StaticRes.Global.Process_Code.Unloading == "U900" && StaticRes.Global.Transaction_Continue) { step("U900 - Open Gate B and check X111"); if (IO_Control.X111_Gate_B_Open_and_Check()) { StaticRes.Global.Process_Code.Unloading = "U1000"; } else { Error_Throw(StaticRes.Global.Error_List.Gate_B_not_opened, "U900"); return; } } #endregion #region ***(U1000)*** Ejector B Up and check X210 if (StaticRes.Global.Process_Code.Unloading == "U1000" && StaticRes.Global.Transaction_Continue) { step("U1000 - Ejector B Up and check X210"); if (IO_Control.X210_Ejector_B_Up_and_Check()) { StaticRes.Global.Process_Code.Unloading = "U1300"; unloadcomplete(false); return; } else { Error_Throw(StaticRes.Global.Error_List.Ejector_B_not_up, "U1000"); return; } } #endregion #region ***(U1300)*** Ejector B down and check X211 if (StaticRes.Global.Process_Code.Unloading == "U1300" && StaticRes.Global.Transaction_Continue) { step("U1300 - Ejector B down and check X211"); if (IO_Control.X211_Ejector_B_Down_and_Check()) { StaticRes.Global.Process_Code.Unloading = "U1400"; } else { Error_Throw(StaticRes.Global.Error_List.Ejector_B_not_down, "U1300"); return; } } #endregion #region ***(U1400)*** Check syringe B present sensor if (StaticRes.Global.Process_Code.Unloading == "U1400" && StaticRes.Global.Transaction_Continue) { step("U1400 - Check syringe B present sensor X105"); if (!Hardware.IO_LIST.Input.X105_Syringe_B_Present()) { StaticRes.Global.Process_Code.Unloading = "U1500"; } else { Error_Throw(StaticRes.Global.Error_List.Syringe_B_present, "U1400"); return; } } #endregion #region ***(U1500)*** Close gate B and check X110 if (StaticRes.Global.Process_Code.Unloading == "U1500" && StaticRes.Global.Transaction_Continue) { step("U1500 - Close Gate B and check X110"); if (IO_Control.X110_Gate_B_Close_and_Check()) { StaticRes.Global.Process_Code.Unloading = "U3000"; } else { Error_Throw(StaticRes.Global.Error_List.Gate_B_not_closed, "U1500"); return; } } #endregion #endregion #region Index 3 #region ***(U1600)*** Open Gate C and check X113 if (StaticRes.Global.Process_Code.Unloading == "U1600" && StaticRes.Global.Transaction_Continue) { step("U1600 - Open Gate C and check X113"); if (IO_Control.X113_Gate_C_Open_and_Check()) { StaticRes.Global.Process_Code.Unloading = "U1700"; } else { Error_Throw(StaticRes.Global.Error_List.Gate_C_not_opened, "U1600"); return; } } #endregion #region ***(U1700)*** Ejector C Up and check X212 if (StaticRes.Global.Process_Code.Unloading == "U1700" && StaticRes.Global.Transaction_Continue) { step("U1700 - Ejector C Up and check X212"); if (IO_Control.X212_Ejector_C_Up_and_Check()) { StaticRes.Global.Process_Code.Unloading = "U2000"; unloadcomplete(false); return; } else { Error_Throw(StaticRes.Global.Error_List.Ejector_C_not_up, "U1700"); return; } } #endregion #region ***(U2000)*** Ejector C down and check X213 if (StaticRes.Global.Process_Code.Unloading == "U2000" && StaticRes.Global.Transaction_Continue) { step("U2000 - Ejector C down and check X213"); if (IO_Control.X213_Ejector_C_Down_and_Check()) { StaticRes.Global.Process_Code.Unloading = "U2100"; } else { Error_Throw(StaticRes.Global.Error_List.Ejector_C_not_down, "U2000"); return; } } #endregion #region ***(U2100)*** Check syringe C present sensor if (StaticRes.Global.Process_Code.Unloading == "U2100" && StaticRes.Global.Transaction_Continue) { step("U2100 - Check syringe C present sensor X106"); if (!Hardware.IO_LIST.Input.X106_Syringe_C_Present()) { StaticRes.Global.Process_Code.Unloading = "U2200"; } else { Error_Throw(StaticRes.Global.Error_List.Syringe_C_present, "U2100"); return; } } #endregion #region ***(U2200)*** Close gate C and check X112 if (StaticRes.Global.Process_Code.Unloading == "U2200" && StaticRes.Global.Transaction_Continue) { step("U2200 - Close Gate C and check X112"); if (IO_Control.X112_Gate_C_Close_and_Check()) { StaticRes.Global.Process_Code.Unloading = "U3000"; } else { Error_Throw(StaticRes.Global.Error_List.Gate_C_not_closed, "U2200"); return; } } #endregion #endregion #region Index 4 #region ***(U2300)*** Open Gate D and check X115 if (StaticRes.Global.Process_Code.Unloading == "U2300" && StaticRes.Global.Transaction_Continue) { step("U2300 - Open Gate D and check X115"); if (IO_Control.X115_Gate_D_Open_and_Check()) { StaticRes.Global.Process_Code.Unloading = "U2400"; } else { Error_Throw(StaticRes.Global.Error_List.Gate_D_not_opened, "U2300"); return; } } #endregion #region ***(U2400)*** Ejector D Up and check X214 if (StaticRes.Global.Process_Code.Unloading == "U2400" && StaticRes.Global.Transaction_Continue) { step("U2400 - Ejector D Up and check X214"); if (IO_Control.X214_Ejector_D_Up_and_Check()) { StaticRes.Global.Process_Code.Unloading = "U2700"; unloadcomplete(false); return; } else { Error_Throw(StaticRes.Global.Error_List.Ejector_D_not_up, "U2400"); return; } } #endregion #region ***(U2700)*** Ejector D down and check X215 if (StaticRes.Global.Process_Code.Unloading == "U2700" && StaticRes.Global.Transaction_Continue) { step("U2700 - Ejector D down and check X215"); if (IO_Control.X215_Ejector_D_Down_and_Check()) { StaticRes.Global.Process_Code.Unloading = "U2800"; } else { Error_Throw(StaticRes.Global.Error_List.Ejector_D_not_down, "U2700"); return; } } #endregion #region ***(U2800)*** Check syringe D present sensor if (StaticRes.Global.Process_Code.Unloading == "U2800" && StaticRes.Global.Transaction_Continue) { step("U2800 - Check syringe D present sensor X107"); if (!Hardware.IO_LIST.Input.X107_Syringe_D_Present()) { StaticRes.Global.Process_Code.Unloading = "U2900"; } else { Error_Throw(StaticRes.Global.Error_List.Syringe_D_present, "U2800"); return; } } #endregion #region ***(U2900)*** Close gate D and check X114 if (StaticRes.Global.Process_Code.Unloading == "U2900" && StaticRes.Global.Transaction_Continue) { step("U2900 - Close gate D and check X114"); if (IO_Control.X114_Gate_D_Close_and_Check()) { StaticRes.Global.Process_Code.Unloading = "U3000"; } else { Error_Throw(StaticRes.Global.Error_List.Gate_D_not_closed, "U2900"); return; } } #endregion #endregion #region ***(U3000)*** Check loading door close sensor X102 if (StaticRes.Global.Process_Code.Unloading == "U3000" && StaticRes.Global.Transaction_Continue) { step("U3000 - Check loading door close sensor X102"); if (Hardware.IO_LIST.Input.X102_Loading_Door_Closed()) { StaticRes.Global.Process_Code.Unloading = "U3100"; } else { Error_Throw(StaticRes.Global.Error_List.Loading_door_not_closed, "U3000"); return; } } #endregion #region ***(U3100)*** Unloading complete if (StaticRes.Global.Process_Code.Unloading == "U3100" && StaticRes.Global.Transaction_Continue) { step("U3100 - unload complete"); IO_Control.Yellow_Tower_Light_Setting(); StaticRes.Global.Process_Code.Unloading = "U000"; StaticRes.Global.IsOnProgress = false; unloadcomplete(true); return; } #endregion } else { Error_Throw(StaticRes.Global.Error_List.Please_homing_first, "U000"); return; } } catch (Exception ee) { Common.Reports.LogFile.Log("Unload Error -- " + ee.Message + ",U000 , user:"******"From Unload Exception"); return; } }