using Aitex.Core.Common; using Aitex.Core.RT.DataCenter; using Aitex.Core.RT.Device; using Aitex.Core.RT.Device.Unit; using Aitex.Core.RT.Event; using Aitex.Core.RT.Log; using Aitex.Core.RT.OperationCenter; using Aitex.Core.RT.SCCore; using Aitex.Core.Util; using MECF.Framework.Common.Communications; using MECF.Framework.Common.Equipment; using MECF.Framework.Common.SubstrateTrackings; using MECF.Framework.RT.EquipmentLibrary.HardwareUnits.LoadPorts.LoadPortBase; using MECF.Framework.RT.EquipmentLibrary.HardwareUnits.Robot; using MECF.Framework.RT.EquipmentLibrary.HardwareUnits.Robots.RobotBase; using System; using System.Collections.Generic; using System.Text; using System.Threading; using EventType = Aitex.Core.RT.Event.EventType; namespace MECF.Framework.RT.EquipmentLibrary.HardwareUnits.Robots.YaskawaRobots { public class YaskawaSR100RobotHhCcmc : YaskawaSR100Robot { public YaskawaSR100RobotHhCcmc(string module, string name, string scRoot, IoSensor[] dis, IoTrigger[] dos) : base(module, name, scRoot, dis, dos) { } protected override bool fStartPickWafer(object[] param) { IsOnReadyPosition = false; RobotArmEnum arm = (RobotArmEnum)param[0]; ModuleName module = (ModuleName)Enum.Parse(typeof(ModuleName), param[1].ToString()); if (!ModuleHelper.IsLoadPort(module)) { return base.fStartPickWafer(param); } else { var lp = DEVICE.GetDevice(module.ToString()); if(!SC.GetValue($"CarrierInfo.Carrier{lp.InfoPadCarrierIndex}.EnableComplexPickAction")) { return base.fStartPickWafer(param); } if (lp != null) lp.NoteTransferStart(); } try { BladeTarget = module; Blade1Target = module; Blade2Target = module; int slot = (int)param[2] + 1; float x = 0, y = 0, z = 0, w = 0; if (param.Length > 3) { x = (float)param[3]; y = (float)param[4]; z = (float)param[5]; w = (float)param[6]; } string TrsSt = GetStationsName(module, true); if (string.IsNullOrEmpty(TrsSt)) { EV.PostAlarmLog("Robot", "Invalid Paramter."); return false; } int intXvalue = Convert.ToInt32(x * 1000); int intYvalue = Convert.ToInt32(y * 1000); int intZvalue = Convert.ToInt32(z * 1000); int intWvalue = Convert.ToInt32(w * 1000); string strpara = $"G,{TrsSt},{slot:D2},A,{(arm == RobotArmEnum.Both ? "F" : ((int)arm + 1).ToString())},G4"; if (x != 0 || y != 0 || z != 0) { string strxoffset = intXvalue >= 0 ? $"{intXvalue:D8}" : $"{intXvalue:D7}"; string stryoffset = intYvalue >= 0 ? $"{intYvalue:D8}" : $"{intYvalue:D7}"; string strzoffset = intZvalue >= 0 ? $"{intZvalue:D8}" : $"{intZvalue:D7}"; string strwoffset = intWvalue >= 0 ? $"{intWvalue:D8}" : $"{intWvalue:D7}"; strpara += $",{strxoffset},{stryoffset},{strzoffset},{strwoffset}"; } if (w != 0) { strpara += $",{intWvalue:D8}"; } lock (_locker) { double exlength1 = SC.GetValue($"Robot.{Name}.Extend1Distance"); double exlength2 = SC.GetValue($"Robot.{Name}.Extend2Distance"); double outlength1 = SC.GetValue($"Robot.{Name}.Out1Distance"); double outlength2 = SC.GetValue($"Robot.{Name}.Out2Distance"); double lowOffset = SC.GetValue($"Robot.{Name}.LowOffset"); double upOffset = SC.GetValue($"Robot.{Name}.UpOffset"); double upOffset1 = SC.GetValue($"Robot.{Name}.UpOffset1"); double downOffset = SC.GetValue($"Robot.{Name}.DownOffset"); if (lowOffset > 5000 || upOffset > 3000 || upOffset1 > 3000 || downOffset > 6000) { EV.PostAlarmLog("Robot", "Z轴位置超限"); return false; } string arms = arm == RobotArmEnum.Both ? "F" : ((int)arm + 1).ToString(); _lstHandlers.AddLast(new SR100RobotMotionHandler(this, "MTRS", $"G,{TrsSt},{slot:D2},A,{arms},G1")); _lstHandlers.AddLast(new SR100RobotMotionHandler(this, "MREL", $"Y,{arms},H,{exlength1}")); _lstHandlers.AddLast(new SR100RobotMotionHandler(this, "MREL", $"Z,{arms},H,{lowOffset}")); _lstHandlers.AddLast(new SR100RobotMotionHandler(this, "CSOL", $"{arms},1,0")); _lstHandlers.AddLast(new SR100RobotMotionHandler(this, "MREL", $"Z,{arms},H,{upOffset1}")); _lstHandlers.AddLast(new SR100RobotMotionHandler(this, "CSOL", $"{arms},1,0")); _lstHandlers.AddLast(new SR100RobotMotionHandler(this, "MREL", $"Y,{arms},H,-{outlength1}")); _lstHandlers.AddLast(new SR100RobotMotionHandler(this, "CSOL", $"{arms},0,0")); _lstHandlers.AddLast(new SR100RobotMotionHandler(this, "MREL", $"Z,{arms},H,-{downOffset}")); _lstHandlers.AddLast(new SR100RobotMotionHandler(this, "MREL", $"Y,{arms},H,{exlength2}")); _lstHandlers.AddLast(new SR100RobotMotionHandler(this, "MREL", $"Z,{arms},H,{lowOffset}")); _lstHandlers.AddLast(new SR100RobotMotionHandler(this, "CSOL", $"{arms},1,0")); _lstHandlers.AddLast(new SR100RobotMotionHandler(this, "MREL", $"Z,{arms},H,{upOffset}")); _lstHandlers.AddLast(new SR100RobotMotionHandler(this, "CSOL", $"{arms},1,0")); _lstHandlers.AddLast(new SR100RobotMotionHandler(this, "MREL", $"Y,{arms},H,-{outlength2}")); } return true; } catch (Exception ex) { LOG.Write(ex); return false; } } } }