首次上传

This commit is contained in:
hanqiangqiang
2026-06-15 10:56:30 +08:00
commit b0213b94d6
4160 changed files with 736101 additions and 0 deletions
@@ -0,0 +1,148 @@
using System.Collections.Generic;
namespace MECF.Framework.RT.EquipmentLibrary.HardwareUnits.Robots.SiasunPhoenixB.Errors
{
public class SiasunPhoenixBErrorDictionary
{
private Dictionary<string, string> _errorCodeDictionary;
public Dictionary<string, string> errorCodeDictionary
{
get { return _errorCodeDictionary; }
private set { _errorCodeDictionary = value; }
}
public SiasunPhoenixBErrorDictionary()
{
errorCodeDictionary = new Dictionary<string, string>()
{
//{"193","错误信息:控制柜急停未 解除产生原因:控制柜急停按钮为旋起 故障排除:将控制柜按钮顺时针旋转至旋起"},
//{"194","错误信息:示教盒急停未 解除产生原因:示教盒急停按钮未旋起 故障排除:将示教盒急停按钮顺时针旋转至旋起" },
//{"635","错误信息:系统发生碰撞 产生原因:示教盒急停按钮未旋起 故障排除:将示教盒急停按钮顺时针旋转至旋起"},
//{"707","错误信息:旋转信号不允许 产生原因:1、传输腔传感器未遮盖 2、用户IO故障 故障排除:1、检查传输腔传感器。 2、确认传感器信号是否正常返回" },
//{"708","错误信息:伸缩信号不允许 产生原因:1、阀门未打开(传输腔通往其他腔室) 2、用户IO故障 故障排除:1、检查传输腔传感器 2、确认传感器信号是否正常返回"},
//{"709","错误信息:请发送RESET启动 产生原因:产生报警后停止运行,系统为停止状态 故障排除: 发送RESET启动" },
//{"710","错误信息:请切换成执行模式 产生原因:当前为示教模式,无法接收串口指令 故障排除:使用示教盒切换成执行模式,或者重启机械手"},
//{"2200","错误信息:输出端口NO.不存在 产生原因:1、配置的输出端口号超出指定范围2、输出端口未配置(系统内部错误) 故障排除:1、系统下电,按照指定范围重新配置输出端口号 2、修改内部程序" },
//{"3100","错误信息:关节N位置超界 产生原因:关节值超软限位 故障排除:1、确认零位是否正常(两手臂重合为R轴零点位置)2、发送RQ POS ABS ARM A ALL查看当前关节值 3、发送SVON、RESET,继续运行 4、使用示教盒时,按“取消”键,检查关节值范围"},
//{"3120","错误信息:示教盒急停未 解除产生原因:示教盒急停按钮未旋起 故障排除:将示教盒急停按钮顺时针旋转至旋起" },
//{"5100","错误信息:GOTO工位号超范围 产生原因:GOTO指令工位号超出指定范围 故障排除:检查工位号范围A手为1-20"},
//{"5112","错误信息:RQ STN工位号超范围 产生原因:RQ STN指令工位号超出指定范围 故障排除:检查工位号范围A手为1-20" },
//{"5117","错误信息:RQ命令不支持的参数 产生原因:RQ指令某字段输入错误 故障排除:检查RQ指令格式"},
//{"5132","错误信息:STORE STN指令工位号大于20 产生原因:STORE STN指令工位号超出指定范围 故障排除:检查工位号范围A手为1-20" },
//{"5133","错误信息:STORE STN命令手臂参数错误 产生原因:机械手无法识别用户所发的手臂指令 故障排除:检查是否有拼写错误,ARM A"},
//{"5135","错误信息:STORE指令输入不完整 产生原因:STORE 指令字段名字错误 故障排除:检查STORE指令格式" },
//{"5136","错误信息:指令拼写错误(无法识别的命令) 产生原因:发出的指令拼写错误 故障排除:HOME指令未指定R、T、Z、ALL字段"},
//{"5137","错误信息:HOME参数未指定 产生原因:HOME指令未指定参数 故障排除:HOME指令未指定R、T、Z、ALL字段" },
//{"5138","错误信息:GOTO指令R轴参数未指定 产生原因:1、GOTO指令R字段后未指定具体参数 2、GOTO指令R字段后面指定了错误的参数 故障排除:检查GOTO指令格式;GOTO指令R字段后参数为RE或EX"},
//{"5139","错误信息:GOTO指令Z轴参数未指定 产生原因:1、GOTO指令Z字段后未指定具体参数 2、GOTO指令Z字段后面指定了错误的参数 故障排除:检查GOTO指令格式;Z字段后参数为DOWN或UP" },
//{"5140","错误信息:ARM参数错误 产生原因:GOTO指令/MOVE指令/PICK指令/PLACE指令中ARM字段后未指定具体手臂 故障排除:ARM字段后要指定参数;A代表A手臂,B代表B手臂"},
//{"5141","错误信息:GOTO指令未指定参数 产生原因:GOTO指令中字段名字错误 故障排除:检查GOTO指令格式" },
//{"5143","错误信息:MOVE指令未指定模式或轴 产生原因:1、MOVE指令中未指定具体轴 2、MOVE指令中未指定运动模式 故障排除:1、MOVE指令具体轴字段为R、T、Z 2、MOVE指令运动模式为ABS(绝对值)或REL(相对值)"},
//{"5144","错误信息:MOVE 指令中字段名字错 产生原因:MOVE指令中字段名字错误 故障排除:检查MOVE指令格式"},
//{"5149","错误信息:指令执行未结束 产生原因:机械手正在执行动作指令时,上位机重复发送动作指令 故障排除:机械手执行动作指令完成后,上位机才能再次发送动作指令"},
//{"5150","错误信息:GOTO指令未指定工位号 产生原因:GOTO指令未指定具体的工位号 故障排除:确定GOTO指令指定具体工位号"},
//{"5153","错误信息:ABS未指定数值 产生原因:MOVE指令中的ABS字段后没有指定数值 故障排除:确定MOVE指令中ABS字段后输入正确数值"},
//{"5154","错误信息:REL未指定数值 产生原因:MOVE指令中的REL字段后没有指定数值 故障排除:确定MOVE指令中REL字段后输入正确数值"},
//{"5155","错误信息:REL未指定数值 产生原因:UMOVE指令中的REL字段后没有指定数值 故障排除:确定MOVE指令中REL字段后输入正确数值"},
//{"5156","错误信息:没有指定主程序 产生原因:RESET指令后,当前系统没有配置主作业 故障排除:确定当前系统登记主作业"},
//{"5157","错误信息:当前没有打开作业 产生原因:RESET指令后,当前系统没有打开主作业 故障排除:确定当前系统打开主作业"},
//{"5158","错误信息:当前作业不是主作业 产生原因:RESET指令后,当前系统运行的作业不是主作业 故障排除:确定当前系统运行主作业"},
//{"5159","错误信息:臂电源上电失败(手臂电源未打开) 产生原因:在发RESET时,系统不是上电状态 故障排除:用指令SVON或者示教盒给机械手上电"},
{ "901", "Main power EMO" },
{ "902", "Teach pendant EMO" },
{ "962", "Driver RDY sensor disconnect" },
{ "3001", "Robot collision" },
{ "7300", "Rotation sensor forbidden" },
{ "7301", "Extend sensor forbidden" },
{ "2200", "Output port Number not exist" },
{ "3120", "Joint N speed out of range" },
{ "3100", "Joint N position out of range" },
{ "100", "Robot power on fail" },
{ "7307", "GOTO station out of range" },
{ "7308", "Sensor type not support" },
{ "7312", "PICK station out of range" },
{ "7313", "PLACE station out of range" },
{ "7314", "XFER station out of range" },
{ "7315", "REMOVE not support IO type" },
{ "7316", "RQ INTLCK parameter invalid" },
{ "7319", "RQ STN station out of range" },
{ "7320", "wafre(WAF_SEN) parameter not set" },
{ "7321", "wafex(RETRACT_PIN) parameter not set" },
{ "7322", "svlv(SBIT_SVLV_SEN) parameter not set" },
{ "7323", "ens(EX_ENABLE) parameter not set" },
{ "7324", "RQ parameter invalid" },
{ "7325", "SET INTLOCK WAF_SEN parameter invalid" },
{ "7326", "SET INTLOCK RZ parameter invalid" },
{ "7327", "SET INTLOCK parameter invalid" },
{ "7328", "SET IO ECHO parameter invalid" },
{ "7329", "SET IO STATE not support" },
{ "7330", "SET IO parameter invalid" },
{ "7331", "SET STN station out of range" },
{ "7332", "Robot read parameter fail" },
{ "7333", "WAF_SEN parameter invalid" },
{ "7334", "SET sensor type not support" },
{ "7335", "SET parameter invalid" },
{ "7336", "STORE IO parameter invalid" },
{ "7337", "STORE LOAD parameter invalid" },
{ "7338", "STORE STN station out of range" },
{ "7339", "STORE STN parameter invalid" },
{ "7340", "STORE sensor type not support" },
{ "7341", "STORE parameter invalid" },
{ "7342", "Command invalid" },
{ "7343", "HOME parameter not set" },
{ "7344", "GOTO R axis parameter not set" },
{ "7345", "GOTO Z axis parameter not set" },
{ "7346", "ARM parameter invalid" },
{ "7347", "GOTO parameter not set" },
{ "7349", "MOVE parameter not set" },
{ "7350", "MOVE parameter invalid" },
{ "7351", "PICK parameter not set" },
{ "7352", "PLACE parameter not set" },
{ "7353", "REMOVE parameter not set" },
{ "7354", "Command excute not finished" },
{ "7355", "GOTO station parameter not set" },
{ "7356", "PICK station parameter not set" },
{ "7357", "PLACE station parameter not set" },
{ "7358", "ABS parameter not set" },
{ "7359", "REL parameter not set" },
{ "7360", "Robot not set main thread" },
{ "7361", "Robot not open main thread" },
{ "7362", "Current thread not main thread" },
{ "7363", "ex_ena(EX_ENABLE_SEN) parameter not set" },
{ "7364", "stable(STABLE_ SIGNAL) parameter not set" },
{ "7365", "MOVE parameter invalid" },
{ "7366", "System not on" },
{ "7367", "extend(EX_SIGNAL) parameter not set" },
{ "7368", "retract(RE_ SIGNAL) parameter not set" },
{ "7371", "Wafer not present before place" },
{ "7372", "Wafer present before pick" },
{ "7373", "Wafer present after place" },
{ "7374", "Wafer not present after pick" },
{ "7375", "Servo not on" },
{ "7376", "Exist not number parameter" },
{ "7385", "Driver stop abnormal" },
{ "7387", "Driver ID1 alarm" },
{ "7388", "Driver ID2 alarm" },
{ "7389", "Driver ID3 alarm" },
{ "7391", "AWC station out of range" },
{ "7392", "AWC out of range alarm" },
{ "7393", "AWC sensor set fail" },
{ "7398", "AWC calculate fail" },
{ "7399", "AWC trig number error" },
{ "7401", "Wafer maybe present on blade" },
{ "7402", "Wafer maybe not present on blade" },
{ "7403", "Load status in ON, not correct" },
{ "7404", "Load status in OFF, not correct" },
{ "7405", "Slot not exist" },
{ "7495", "ID1 encoder error" },
{ "7496", "ID2 encoder error" },
{ "7497", "ID3 encoder error" },
};
}
}
}
@@ -0,0 +1,100 @@
using Aitex.Core.RT.Log;
using MECF.Framework.Common.Communications;
namespace MECF.Framework.RT.EquipmentLibrary.HardwareUnits.Robots.SiasunPhoenixB
{
public class RobotSiasunPhoenixBMessage : AsciiMessage
{
public string Data { get; set; }
public string ErrorText { get; set; }
}
public class RobotSiasunPhoenixBTCPConnection : TCPPortConnectionBase
{
private bool _isAckMode = false;//should read from config file
public RobotSiasunPhoenixBTCPConnection(string address, string endof)
: base(address, endof, true)
{
}
public override bool SendMessage(string message)
{
return base.SendMessage(message);
}
protected override void ActiveHandlerProceedMessage(MessageBase msg)
{
lock (_lockerActiveHandler)
{
if (_activeHandler != null)
{
if (msg.IsFormatError || !((RobotSiasunPhoenixBHandler)_activeHandler).HasResponse || (_activeHandler.HandleMessage(msg, out bool transactionComplete) && transactionComplete))
{
_activeHandler = null;
}
}
}
}
protected override MessageBase ParseResponse(string rawText)
{
LOG.Info($"TM Robot Response Write {rawText}");
RobotSiasunPhoenixBMessage msg = new RobotSiasunPhoenixBMessage();
msg.RawMessage = rawText;
if (rawText.Length <= 0)
{
LOG.Error($"empty response,");
msg.IsFormatError = true;
return msg;
}
rawText = rawText.Replace("\r", "").Replace("\n", "");
if (rawText.Contains("_ERR"))
{
//EV.PostAlarmLog("TM", $"TM Robot Response error {rawText}");
msg.IsError = true;
var rewTextArray = rawText.Split(' ');
msg.IsComplete = true;
try
{
msg.Data = rewTextArray[1];
}
catch (System.Exception)
{
LOG.Error($"RobotSiasunPhoenixB返回_ERR数据时解析失败 {rawText}");
msg.Data = rawText;
}
}
else if (rawText.Contains("_BG_RDY"))
{
if (!_isAckMode)
{
LOG.Error($"response format check failed, BG_RDY is not valid in Mode 1");
msg.IsFormatError = true;
return msg;
}
msg.Data = rawText;
msg.IsResponse = true;
msg.IsAck = true;
msg.IsComplete = true;
}
else if (rawText.Contains("_RDY"))
{
msg.Data = rawText.Replace("_RDY", "");
msg.IsResponse = true;
msg.IsAck = true;
msg.IsComplete = true;
}
else
{
msg.Data = rawText;
msg.IsResponse = true;
}
return msg;
}
}
}
@@ -0,0 +1,891 @@
using Aitex.Sorter.Common;
using MECF.Framework.Common.CommonData;
using MECF.Framework.Common.Communications;
using MECF.Framework.Common.Equipment;
using System;
namespace MECF.Framework.RT.EquipmentLibrary.HardwareUnits.Robots.SiasunPhoenixB
{
public abstract class RobotSiasunPhoenixBHandler : HandlerBase
{
public RobotSiasunPhoenixB Device { get; }
public bool HasResponse { get; set; } = true;
protected string _command;
protected string _parameter;
protected string _target;
protected RobotArmEnum _blade;
protected string _requestResponse = "";
protected RobotSiasunPhoenixBHandler(RobotSiasunPhoenixB device, string command, string parameter = null)
: base(BuildMessage(command, parameter))
{
Device = device;
_command = command;
_parameter = parameter;
Name = command;
}
private static string BuildMessage(string command, string parameter)
{
string msg = parameter == null ? $"{command}" : $"{command} {parameter}";
if (msg.Contains("GOTO N 5 ") || msg.Contains("PLACE 5 ") || msg.Contains("PICK 5 "))
{
msg = msg.Replace("SLOT 3 ", "SLOT 1 ");
msg = msg.Replace("SLOT 2 ", "SLOT 1 ");
}
else if (msg.Contains("GOTO N 4 ") || msg.Contains("PLACE 4 ") || msg.Contains("PICK 4 "))
{
msg = msg.Replace("SLOT 3 ", "SLOT 1 ");
msg = msg.Replace("SLOT 2 ", "SLOT 1 ");
}
return msg + "\r";
}
public override bool HandleMessage(MessageBase msg, out bool transactionComplete)
{
RobotSiasunPhoenixBMessage response = msg as RobotSiasunPhoenixBMessage;
ResponseMessage = msg;
if (response.IsError)
{
Device.NoteError(response.Data);
}
if (response.IsComplete)
{
SetState(EnumHandlerState.Completed);
transactionComplete = true;
return true;
}
if (response.IsResponse)
{
_requestResponse = response.Data;
}
transactionComplete = false;
return false;
}
}
public class RobotSiasunPhoenixBRawCommandHandler : RobotSiasunPhoenixBHandler
{
public RobotSiasunPhoenixBRawCommandHandler(RobotSiasunPhoenixB device, string command, string parameter = null)
: base(device, command, parameter)
{
}
public override bool HandleMessage(MessageBase msg, out bool handled)
{
if (base.HandleMessage(msg, out handled))
{
var result = msg as RobotSiasunPhoenixBMessage;
var rawMsg = _requestResponse != null ? _requestResponse + "$" + result.RawMessage : result.RawMessage;
Device.NoteRawCommandInfo(_command, rawMsg);
}
return true;
}
}
public class RobotSiasunPhoenixBGotoHandler : RobotSiasunPhoenixBHandler
{
//GOTO N station [R (EX|RE)] [Z (UP|DN)] [SLOT num] [[ARM] arm]
public RobotSiasunPhoenixBGotoHandler(RobotSiasunPhoenixB device, ModuleName module, int slot, RobotArmEnum blade,
bool isRetract = true, bool isZaxisDown = true, int timeout = 60)
: base(device, "GOTO", $"N {device.GetStationByModule(module,slot)} R {(isRetract ? "RE" : "EX")}" +
$" Z {(isZaxisDown ? "DN" : "UP")} SLOT {slot} ARM {(blade == RobotArmEnum.Blade1 ? "A" : "B")}")
{
AckTimeout = TimeSpan.FromSeconds(timeout);
CompleteTimeout = TimeSpan.FromSeconds(timeout);
_target = (blade == RobotArmEnum.Blade2 ? "ArmB" : "ArmA") + "." + module;
_blade = blade;
device.MoveInfo = new RobotMoveInfo()
{
Action = isRetract ? RobotAction.Moving : RobotAction.Picking,
ArmTarget = blade == RobotArmEnum.Blade1 ? RobotArm.ArmA : RobotArm.ArmB,
BladeTarget = _target,
};
}
public override bool HandleMessage(MessageBase msg, out bool handled)
{
var result = msg as RobotSiasunPhoenixBMessage;
if (result.IsError)
{
Device.NoteError(result.Data);
}
else
{
Device.NoteError(null);
}
ResponseMessage = msg;
handled = true;
Device.NoteActionCompleted();
return true;
}
}
public class RobotSiasunPhoenixBPickHandler : RobotSiasunPhoenixBHandler
{
//PICK station [SLOT slot] [[ARM] arm][ENRT|STRT NR][RO x TO x]
public RobotSiasunPhoenixBPickHandler(RobotSiasunPhoenixB device, string module, int slot, RobotArmEnum blade,
int ro = 0, int to = 0, int timeout = 60, bool isDisableInterlock = false)
: base(device, "PICK", $"{device.GetStationByModule(module, slot)} SLOT {slot}" +
$" ARM {(blade == RobotArmEnum.Blade1 ? "A" : "B")}{(ro == 0 ? "" : $" RO {ro}")}{(to == 0 ? "" : $" TO {to}")}{(isDisableInterlock ? " INTLCK DIS" : "")}")
{
AckTimeout = TimeSpan.FromSeconds(timeout);
CompleteTimeout = TimeSpan.FromSeconds(timeout);
var moduleArr = module.Split('.');
_target = (blade == RobotArmEnum.Blade2 ? "ArmB" : "ArmA") + "." + moduleArr[0];
_blade = blade;
device.MoveInfo = new RobotMoveInfo()
{
Action = RobotAction.Picking,
ArmTarget = blade == RobotArmEnum.Blade2 ? RobotArm.ArmB : RobotArm.ArmA, //blade == RobotArmEnum.Blade1 ? RobotArm.ArmA : RobotArm.ArmB,
BladeTarget = _target,
};
}
public override bool HandleMessage(MessageBase msg, out bool handled)
{
var result = msg as RobotSiasunPhoenixBMessage;
if (result.IsError)
{
Device.NoteError(result.Data);
}
else
{
Device.NoteError(null);
Device.MoveInfo = new RobotMoveInfo()
{
Action = RobotAction.Moving,
ArmTarget = _blade == RobotArmEnum.Blade1 ? RobotArm.ArmA : RobotArm.ArmB,
BladeTarget = _target,
};
}
ResponseMessage = msg;
handled = true;
Device.NoteActionCompleted();
return true;
}
}
public class RobotSiasunPhoenixBPickExtendHandler : RobotSiasunPhoenixBHandler
{
//PICK station [SLOT slot] [[ARM] arm][ENRT|STRT NR][RO x TO x]
public RobotSiasunPhoenixBPickExtendHandler(RobotSiasunPhoenixB device, ModuleName module, int slot, RobotArmEnum blade,
int ro = 0, int to = 0, int timeout = 60, bool isDisableInterlock = false)
: base(device, "PICK", $"{device.GetStationByModule(module, slot)} SLOT {slot}" +
$" ARM {(blade == RobotArmEnum.Blade1 ? "A" : "B")} ENRT NR {(ro == 0 ? "" : $" RO {ro}")}{(to == 0 ? "" : $" TO {to}")}{(isDisableInterlock ? " INTLCK DIS" : "")}")
{
AckTimeout = TimeSpan.FromSeconds(timeout);
CompleteTimeout = TimeSpan.FromSeconds(timeout);
_target = (blade == RobotArmEnum.Blade2 ? "ArmB" : "ArmA") + "." + module;
_blade = blade;
device.MoveInfo = new RobotMoveInfo()
{
Action = RobotAction.Picking,
ArmTarget = blade == RobotArmEnum.Blade2 ? RobotArm.ArmB : RobotArm.ArmA, //blade == RobotArmEnum.Blade1 ? RobotArm.ArmA : RobotArm.ArmB,
BladeTarget = _target,
};
}
public override bool HandleMessage(MessageBase msg, out bool handled)
{
var result = msg as RobotSiasunPhoenixBMessage;
if (result.IsError)
{
Device.NoteError(result.Data);
}
else
{
Device.NoteError(null);
}
ResponseMessage = msg;
handled = true;
Device.NoteActionCompleted();
return true;
}
}
public class RobotSiasunPhoenixBPickRetractHandler : RobotSiasunPhoenixBHandler
{
//PICK station [SLOT slot] [[ARM] arm][ENRT|STRT NR][RO x TO x]
public RobotSiasunPhoenixBPickRetractHandler(RobotSiasunPhoenixB device, ModuleName module, int slot, RobotArmEnum blade, int ro = 0, int to = 0, int timeout = 60, bool isDisableInterlock = false)
: base(device, "PICK", $"{device.GetStationByModule(module, slot)} SLOT {slot} ARM {(blade == RobotArmEnum.Blade1 ? "A" : "B")} STRT NR {(ro == 0 ? "" : $" RO {ro}")}{(to == 0 ? "" : $" TO {to}")}{(isDisableInterlock ? " INTLCK DIS" : "")}")
{
AckTimeout = TimeSpan.FromSeconds(timeout);
CompleteTimeout = TimeSpan.FromSeconds(timeout);
_target = (blade == RobotArmEnum.Blade2 ? "ArmB" : "ArmA") + "." + module;
_blade = blade;
device.MoveInfo = new RobotMoveInfo()
{
Action = RobotAction.Moving,
ArmTarget = blade == RobotArmEnum.Blade1 ? RobotArm.ArmA : RobotArm.ArmB,
BladeTarget = _target,
};
}
public override bool HandleMessage(MessageBase msg, out bool handled)
{
var result = msg as RobotSiasunPhoenixBMessage;
if (result.IsError)
{
Device.NoteError(result.Data);
}
else
{
Device.NoteError(null);
}
ResponseMessage = msg;
handled = true;
Device.NoteActionCompleted();
return true;
}
}
public class RobotSiasunPhoenixBPlaceHandler : RobotSiasunPhoenixBHandler
{
public RobotSiasunPhoenixBPlaceHandler(RobotSiasunPhoenixB device, string module, int slot, RobotArmEnum blade,
int ro = 0, int to = 0, int timeout = 60, bool isDisableInterlock = false)
: base(device, "PLACE", $"{device.GetStationByModule(module, slot)} SLOT {slot}" +
$" ARM {(blade == RobotArmEnum.Blade1 ? "A" : "B")}{(ro == 0 ? "" : $" RO {ro}")}{(to == 0 ? "" : $" TO {to}")}{(isDisableInterlock ? " INTLCK DIS" : "")}")
{
AckTimeout = TimeSpan.FromSeconds(timeout);
CompleteTimeout = TimeSpan.FromSeconds(timeout);
var moduleArr = module.Split('.');
_target = (blade == RobotArmEnum.Blade2 ? "ArmB" : "ArmA") + "." + moduleArr[0];
_blade = blade;
device.MoveInfo = new RobotMoveInfo()
{
Action = RobotAction.Placing,
ArmTarget = blade == RobotArmEnum.Blade2 ? RobotArm.ArmB : RobotArm.ArmA,//RobotArmEnum.Blade1 ? RobotArm.ArmA : RobotArm.ArmB,
BladeTarget = _target,
};
}
public override bool HandleMessage(MessageBase msg, out bool handled)
{
var result = msg as RobotSiasunPhoenixBMessage;
if (result.IsError)
{
Device.NoteError(result.Data);
Device.NoteActionCompleted();
}
else
{
Device.NoteError(null);
Device.MoveInfo = new RobotMoveInfo()
{
Action = RobotAction.Moving,
ArmTarget = _blade == RobotArmEnum.Blade1 ? RobotArm.ArmA : RobotArm.ArmB,
BladeTarget = _target,
};
Device.NoteActionCompleted();
}
ResponseMessage = msg;
handled = true;
return true;
}
}
public class RobotSiasunPhoenixBPlaceExtendHandler : RobotSiasunPhoenixBHandler
{
public RobotSiasunPhoenixBPlaceExtendHandler(RobotSiasunPhoenixB device, ModuleName module, int slot, RobotArmEnum blade, int ro = 0, int to = 0, int timeout = 60, bool isDisableInterlock = false)
: base(device, "PLACE", $"{device.GetStationByModule(module, slot)} SLOT {slot} ARM {(blade == RobotArmEnum.Blade1 ? "A" : "B")} ENRT NR {(ro == 0 ? "" : $" RO {ro}")}{(to == 0 ? "" : $" TO {to}")}{(isDisableInterlock ? " INTLCK DIS" : "")}")
{
AckTimeout = TimeSpan.FromSeconds(timeout);
CompleteTimeout = TimeSpan.FromSeconds(timeout);
_target = (blade == RobotArmEnum.Blade2 ? "ArmB" : "ArmA") + "." + module;
_blade = blade;
device.MoveInfo = new RobotMoveInfo()
{
Action = RobotAction.Placing,
ArmTarget = blade == RobotArmEnum.Blade1 ? RobotArm.ArmA : RobotArm.ArmB,
BladeTarget = _target,
};
}
public override bool HandleMessage(MessageBase msg, out bool handled)
{
var result = msg as RobotSiasunPhoenixBMessage;
if (result.IsError)
{
Device.NoteError(result.Data);
}
else
{
Device.NoteError(null);
}
ResponseMessage = msg;
handled = true;
Device.NoteActionCompleted();
return true;
}
}
public class RobotSiasunPhoenixBPlaceRetractHandler : RobotSiasunPhoenixBHandler
{
public RobotSiasunPhoenixBPlaceRetractHandler(RobotSiasunPhoenixB device, ModuleName module, int slot, RobotArmEnum blade, int ro = 0, int to = 0, int timeout = 60, bool isDisableInterlock = false)
: base(device, "PLACE", $"{device.GetStationByModule(module, slot)} SLOT {slot} ARM {(blade == RobotArmEnum.Blade1 ? "A" : "B")} STRT NR {(ro == 0 ? "" : $" RO {ro}")}{(to == 0 ? "" : $" TO {to}")}{(isDisableInterlock ? " INTLCK DIS" : "")}")
{
AckTimeout = TimeSpan.FromSeconds(timeout);
CompleteTimeout = TimeSpan.FromSeconds(timeout);
_target = (blade == RobotArmEnum.Blade2 ? "ArmB" : "ArmA") + "." + module;
_blade = blade;
device.MoveInfo = new RobotMoveInfo()
{
Action = RobotAction.Moving,
ArmTarget = blade == RobotArmEnum.Blade1 ? RobotArm.ArmA : RobotArm.ArmB,
BladeTarget = _target,
};
}
public override bool HandleMessage(MessageBase msg, out bool handled)
{
var result = msg as RobotSiasunPhoenixBMessage;
if (result.IsError)
{
Device.NoteError(result.Data);
}
else
{
Device.NoteError(null);
}
ResponseMessage = msg;
handled = true;
Device.NoteActionCompleted();
return true;
}
}
public class RobotSiasunPhoenixBTransferHandler : RobotSiasunPhoenixBHandler
{
//XFER [[ARM]arm] station-a station-b
public RobotSiasunPhoenixBTransferHandler(RobotSiasunPhoenixB device, int fromStation, int toStation, RobotArmEnum blade, int timeout)
: base(device, "XFER", $"ARM {(blade == RobotArmEnum.Blade1 ? "A" : "B")} {fromStation} {toStation}")
{
AckTimeout = TimeSpan.FromSeconds(timeout);
CompleteTimeout = TimeSpan.FromSeconds(timeout);
}
public override bool HandleMessage(MessageBase msg, out bool handled)
{
var result = msg as RobotSiasunPhoenixBMessage;
if (result.IsError)
{
Device.NoteError(result.Data);
}
else
{
Device.NoteError(null);
}
ResponseMessage = msg;
handled = true;
Device.NoteActionCompleted();
return true;
}
}
public class RobotSiasunPhoenixBRetractHandler : RobotSiasunPhoenixBHandler
{
public RobotSiasunPhoenixBRetractHandler(RobotSiasunPhoenixB device, int timeout)
: base(device, "RETRACT")
{
AckTimeout = TimeSpan.FromSeconds(timeout);
CompleteTimeout = TimeSpan.FromSeconds(timeout);
}
public override bool HandleMessage(MessageBase msg, out bool handled)
{
var result = msg as RobotSiasunPhoenixBMessage;
if (result.IsError)
{
Device.NoteError(result.Data);
}
else
{
Device.NoteError(null);
}
ResponseMessage = msg;
handled = true;
Device.NoteActionCompleted();
return true;
}
}
public class RobotSiasunPhoenixBResetHandler : RobotSiasunPhoenixBHandler
{
//RESET
public RobotSiasunPhoenixBResetHandler(RobotSiasunPhoenixB device)
: base(device, "RESET")
{
HasResponse = false;
}
//no return message
public override bool HandleMessage(MessageBase msg, out bool handled)
{
handled = true;
return true;
}
}
public class RobotSiasunPhoenixBHaltHandler : RobotSiasunPhoenixBHandler
{
public RobotSiasunPhoenixBHaltHandler(RobotSiasunPhoenixB device)
: base(device, "HALT")
{
}
public override bool HandleMessage(MessageBase msg, out bool handled)
{
var result = msg as RobotSiasunPhoenixBMessage;
if (result.IsError)
{
Device.NoteError(result.Data);
}
else
{
Device.NoteError(null);
}
ResponseMessage = msg;
handled = true;
return true;
}
}
public class RobotSiasunPhoenixBHELLOtHandler : RobotSiasunPhoenixBHandler
{
public RobotSiasunPhoenixBHELLOtHandler(RobotSiasunPhoenixB device)
: base(device, "HLLO")
{
}
public override bool HandleMessage(MessageBase msg, out bool handled)
{
var result = msg as RobotSiasunPhoenixBMessage;
if (result.IsError)
{
Device.NoteError(result.Data);
}
else
{
Device.NoteError(null);
}
ResponseMessage = msg;
handled = true;
return true;
}
}
public class RobotSiasunPhoenixBSetCommunicationEchoHandler : RobotSiasunPhoenixBHandler
{
public RobotSiasunPhoenixBSetCommunicationEchoHandler(RobotSiasunPhoenixB device, bool isEchoOn)
: base(device, "SET IO ECHO", isEchoOn ? "Y" : "N")
{
}
public override bool HandleMessage(MessageBase msg, out bool handled)
{
if (base.HandleMessage(msg, out handled))
{
Device.NoteSetCommEchoCompleted(true);
}
return true;
}
}
public class RobotSiasunPhoenixBSetLoadHandler : RobotSiasunPhoenixBHandler
{
public RobotSiasunPhoenixBSetLoadHandler(RobotSiasunPhoenixB device, RobotArmEnum blade, bool isWaferPresent)
: base(device, "SET LOAD", $"{(blade == RobotArmEnum.Blade1 ? "A" : "B")} {(isWaferPresent ? "ON" : "OFF")}")
{
}
public override bool HandleMessage(MessageBase msg, out bool handled)
{
if (base.HandleMessage(msg, out handled))
{
Device.NoteSetParametersComplete();
}
return true;
}
}
public class RobotSiasunPhoenixBSevoOnOffHandler : RobotSiasunPhoenixBHandler
{
public RobotSiasunPhoenixBSevoOnOffHandler(RobotSiasunPhoenixB device, bool isOn)
: base(device, isOn ? "SVON" : "SVOFF")
{
}
public override bool HandleMessage(MessageBase msg, out bool handled)
{
var result = msg as RobotSiasunPhoenixBMessage;
if (result.IsError)
{
Device.NoteError(result.Data);
}
else
{
Device.NoteError(null);
Device.NoteSevoOnOff(_command == "SVON");
}
ResponseMessage = msg;
handled = true;
return true;
}
}
public class RobotSiasunPhoenixBHomeAxisHandler : RobotSiasunPhoenixBHandler
{
public RobotSiasunPhoenixBHomeAxisHandler(RobotSiasunPhoenixB device, int timeout)
: base(device, "HOME", "ALL")
{
AckTimeout = TimeSpan.FromSeconds(timeout);
CompleteTimeout = TimeSpan.FromSeconds(timeout);
device.MoveInfo = new RobotMoveInfo()
{
Action = RobotAction.Moving,
ArmTarget = RobotArm.Both,
BladeTarget = "ArmA.System",
};
}
public override bool HandleMessage(MessageBase msg, out bool handled)
{
var result = msg as RobotSiasunPhoenixBMessage;
if (result.IsError)
{
Device.NoteError(result.Data);
}
else
{
Device.NoteError(null);
Device.NoteAxisHomed();
}
ResponseMessage = msg;
handled = true;
return true;
}
}
public class RobotSiasunPhoenixBCheckLoadHandler : RobotSiasunPhoenixBHandler
{
//CHECK LOAD station [[ARM] arm]
//_RDY
public RobotSiasunPhoenixBCheckLoadHandler(RobotSiasunPhoenixB device, int station, RobotArmEnum blade, int timeout)
: base(device, "CHECK LOAD", $"{station} {(blade == RobotArmEnum.Blade1 ? "A" : "B")}")
{
AckTimeout = TimeSpan.FromSeconds(timeout);
CompleteTimeout = TimeSpan.FromSeconds(timeout);
}
public override bool HandleMessage(MessageBase msg, out bool handled)
{
RobotSiasunPhoenixBMessage response = msg as RobotSiasunPhoenixBMessage;
ResponseMessage = msg;
handled = false;
if (response.IsError)
{
Device.NoteError(response.Data);
}
if (response.IsResponse)
{
_requestResponse = response.Data;
}
if (response.IsComplete)
{
SetState(EnumHandlerState.Completed);
handled = true;
Device.NoteReadDataComplete();
return true;
}
return true;
}
}
public class RobotSiasunPhoenixBQueryWaferPresentHandler : RobotSiasunPhoenixBHandler
{
public RobotSiasunPhoenixBQueryWaferPresentHandler(RobotSiasunPhoenixB device, RobotArmEnum blade)
: base(device, "RQ LOAD", blade == RobotArmEnum.Blade1 ? "A" : "B")
{
}
public override bool HandleMessage(MessageBase msg, out bool handled)
{
RobotSiasunPhoenixBMessage response = msg as RobotSiasunPhoenixBMessage;
ResponseMessage = msg;
handled = false;
if (response.IsError)
{
Device.NoteError(response.Data);
}
if (response.IsResponse)
{
_requestResponse = response.Data;
}
if (_requestResponse != null && _requestResponse.Contains(" B"))
{
Device.NoteWafeOnOff("B", _requestResponse.ToUpper().Contains("ON"), _requestResponse.ToUpper().Contains("UNKNOW"));
}
else if (_requestResponse != null && _requestResponse.Contains(" A"))
{
Device.NoteWafeOnOff("A", _requestResponse.ToUpper().Contains("ON"), _requestResponse.ToUpper().Contains("UNKNOW"));
}
if (response.IsComplete)
{
SetState(EnumHandlerState.Completed);
handled = true;
Device.NoteReadDataComplete();
return true;
}
return true;
}
}
public class RobotSiasunPhoenixBRequestWaferCentDataHandler : RobotSiasunPhoenixBHandler
{
public RobotSiasunPhoenixBRequestWaferCentDataHandler(RobotSiasunPhoenixB device)
: base(device, "RQ WAF_CEN DATA")
{
}
public override bool HandleMessage(MessageBase msg, out bool handled)
{
RobotSiasunPhoenixBMessage response = msg as RobotSiasunPhoenixBMessage;
ResponseMessage = msg;
handled = false;
if (response.IsError)
{
Device.NoteError(response.Data);
}
if (response.IsResponse)
{
_requestResponse = response.Data;
}
//WAF_CEN RT value1x value1y value4x value4y LFT value2x value2y value3x value3y offset_r offset_t
Device.NoteWafeCenData(_requestResponse);
if (response.IsComplete)
{
SetState(EnumHandlerState.Completed);
handled = true;
Device.NoteReadDataComplete();
return true;
}
return true;
}
}
public class RobotSiasunPhoenixBSetWaferCentModeHandler : RobotSiasunPhoenixBHandler
{
//SET WAF_CEN MODE SINGLE_SENS|RL_SENS
public RobotSiasunPhoenixBSetWaferCentModeHandler(RobotSiasunPhoenixB device, bool isSingleSensorMode)
: base(device, "SET WAF_CEN MODE", isSingleSensorMode ? "SINGLE_SENS" : "RL_SENS")
{
}
public override bool HandleMessage(MessageBase msg, out bool handled)
{
if (base.HandleMessage(msg, out handled))
{
Device.NoteSetParametersComplete();
}
return true;
}
}
public class RobotSiasunPhoenixBSetWaferCentEnableHandler : RobotSiasunPhoenixBHandler
{
//SET STN station [[ARM]arm] WAF_CEN ENABLE Y|N
public RobotSiasunPhoenixBSetWaferCentEnableHandler(RobotSiasunPhoenixB device, int station, RobotArmEnum blade, bool isEnable)
: base(device, "SET STN", $"{station} ARM {(blade == RobotArmEnum.Blade1 ? "A" : "B")} WAF_CEN ENABLE {(isEnable ? "Y" : "N")}")
{
}
public override bool HandleMessage(MessageBase msg, out bool handled)
{
if (base.HandleMessage(msg, out handled))
{
Device.NoteSetParametersComplete();
}
return true;
}
}
public class RobotSiasunPhoenixBSetWaferCentWaferSizeHandler : RobotSiasunPhoenixBHandler
{
//SET STN station [[ARM]arm] WAF_CEN WAF_SIZE value
//SET STN 1 ARM A WAF_CEN WAF_SIZE 300000
public RobotSiasunPhoenixBSetWaferCentWaferSizeHandler(RobotSiasunPhoenixB device, int station, RobotArmEnum blade, int waferSize)
: base(device, "SET STN", $"{station} ARM {(blade == RobotArmEnum.Blade1 ? "A" : "B")} WAF_CEN WAF_SIZE {waferSize}")
{
}
public override bool HandleMessage(MessageBase msg, out bool handled)
{
if (base.HandleMessage(msg, out handled))
{
Device.NoteSetParametersComplete();
}
return true;
}
}
public class RobotSiasunPhoenixBSetWaferCentAutoNotchHandler : RobotSiasunPhoenixBHandler
{
//SET STN station [[ARM]arm] WAF_CEN AUTO_NOTCH Y|N
//SET STN 1 ARM A WAF_CEN WAF_SIZE 300000
public RobotSiasunPhoenixBSetWaferCentAutoNotchHandler(RobotSiasunPhoenixB device, int station, RobotArmEnum blade, bool isAutoNotch)
: base(device, "SET STN", $"{station} ARM {(blade == RobotArmEnum.Blade1 ? "A" : "B")} WAF_CEN AUTO_NOTCH {(isAutoNotch ? "Y" : "N")}")
{
}
public override bool HandleMessage(MessageBase msg, out bool handled)
{
if (base.HandleMessage(msg, out handled))
{
Device.NoteSetParametersComplete();
}
return true;
}
}
#region Aligner
public class RobotSiasunPhoenixBTransferAndAlignHandler : RobotSiasunPhoenixBHandler
{
//XFER [[ARM] arm] station [SLOT num] station [SLOT num] ALGN
public RobotSiasunPhoenixBTransferAndAlignHandler(RobotSiasunPhoenixB device, int fromStation, int formSlot, int toStation, int toSlot, Hand blade)
: base(device, "XFER", $"ARM {(blade == Hand.Blade1 ? "A" : "B")} {fromStation} SLOT {formSlot} {toStation} SLOT {toSlot} ALGN")
{
}
}
public class RobotSiasunPhoenixBAlignAndPickHandler : RobotSiasunPhoenixBHandler
{
//PICK station [SLOT num] [[ARM] arm][ENRT|STRT NR][RO x TO x][ALGN][PALGN]
//align and then pick it
public RobotSiasunPhoenixBAlignAndPickHandler(RobotSiasunPhoenixB device, int alignerStation, int alignerSlot, Hand blade, int ro = 0, int to = 0)
: base(device, "PICK", $" {alignerStation} SLOT {alignerSlot} ARM {(blade == Hand.Blade1 ? "A" : "B")}{(ro == 0 ? "" : $" RO {ro}")}{(to == 0 ? "" : $" TO {to}")} ALGN")
{
}
}
public class RobotSiasunPhoenixBPlaceAndAlignHandler : RobotSiasunPhoenixBHandler
{
//PLACEstation [SLOT num] [[ARM] arm][ENRT|STRT NR][RO x TO x][ALGN]
//place to aligner and align
public RobotSiasunPhoenixBPlaceAndAlignHandler(RobotSiasunPhoenixB device, int alignerStation, int alignerSlot, Hand blade, int ro = 0, int to = 0)
: base(device, "PLACE", $" {alignerStation} SLOT {alignerSlot} ARM {(blade == Hand.Blade1 ? "A" : "B")}{(ro == 0 ? "" : $" RO {ro}")}{(to == 0 ? "" : $" TO {to}")} ALGN")
{
}
}
//两个aligner怎么区分
public class RobotSiasunPhoenixBRequestAlignerOffsetHandler : RobotSiasunPhoenixBHandler
{
//RQ ALGN 00 OFFSETS
//RO 0.000 TO 0.000
//_RDY
public RobotSiasunPhoenixBRequestAlignerOffsetHandler(RobotSiasunPhoenixB device)
: base(device, "RQ ALGN 00 OFFSETS")
{
}
}
//两个aligner怎么区分
public class RobotSiasunPhoenixBRequestAlignerWaferPresentHandler : RobotSiasunPhoenixBHandler
{
//RQ ALIGNER RQWPRS
//WFR PRS YES/NO
//_RDY
public RobotSiasunPhoenixBRequestAlignerWaferPresentHandler(RobotSiasunPhoenixB device)
: base(device, "RQ ALIGNER RQWPRS")
{
}
}
//默认选用哪个index对应的angle?
public class RobotSiasunPhoenixBSetAlignerAlignAngleHandler : RobotSiasunPhoenixBHandler
{
//SET ALIGNER 1 POSTPOS %i POS %i
//_RDY
//eg. SET ALIGNER 1 POSTPOS 1 POS 27.1
public RobotSiasunPhoenixBSetAlignerAlignAngleHandler(RobotSiasunPhoenixB device, int alignerID, int index, int angle)
: base(device, "SET ALIGNER", $"{alignerID} POSTPOS {index} POS {angle}")
{
}
public override bool HandleMessage(MessageBase msg, out bool handled)
{
if (base.HandleMessage(msg, out handled))
{
Device.NoteSetParametersComplete();
}
return true;
}
}
#endregion
}