123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157 |
- 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<LoadPortBaseDevice>(module.ToString());
- if(!SC.GetValue<bool>($"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<double>($"Robot.{Name}.Extend1Distance");
- double exlength2 = SC.GetValue<double>($"Robot.{Name}.Extend2Distance");
- double outlength1 = SC.GetValue<double>($"Robot.{Name}.Out1Distance");
- double outlength2 = SC.GetValue<double>($"Robot.{Name}.Out2Distance");
- double lowOffset = SC.GetValue<double>($"Robot.{Name}.LowOffset");
- double upOffset = SC.GetValue<double>($"Robot.{Name}.UpOffset");
- double upOffset1 = SC.GetValue<double>($"Robot.{Name}.UpOffset1");
- double downOffset = SC.GetValue<double>($"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;
- }
- }
- }
- }
|