1、修改料仓夹爪松开和夹紧时的函数名称

2、单拍扫码定位时增加二维码长度的限制
Eight
lhiven 6 months ago
parent 321f5d4e33
commit 03f886c447

@ -914,6 +914,14 @@ namespace Rs.MotionPlat.Entitys
public class TestFixtureManager public class TestFixtureManager
{ {
TestFixture[] testFixtures=new TestFixture[6]; TestFixture[] testFixtures=new TestFixture[6];
public void ClearDataAll()
{
foreach (var tf in testFixtures)
{
tf.ClearData();
}
}
private TestFixtureManager() private TestFixtureManager()
{ {
for (int i = 1; i <= 6; i++) for (int i = 1; i <= 6; i++)

@ -185,7 +185,7 @@ namespace Rs.MotionPlat.Flow
} }
} }
button = Msgbox.ShowTipDialog(EButtonType.Ok | EButtonType.Cancel, "Are you sure clean data ?\r\n clean click OK\r\n no clean click Cancel"); button = Msgbox.ShowTipDialog(EButtonType.Ok | EButtonType.Cancel, "Are you sure you want to clear the data ?\r\n clear click OK\r\n not clear click Cancel");
if (button == EButtonType.Ok) if (button == EButtonType.Ok)
{ {
logInfo = GetClassName() + "选择了OK"; logInfo = GetClassName() + "选择了OK";
@ -194,12 +194,13 @@ namespace Rs.MotionPlat.Flow
//lastFixtureIndex = TestFixtureManager.Instance.GetEnableFixtureList().Select(f => f.Index).Min() - 1; //lastFixtureIndex = TestFixtureManager.Instance.GetEnableFixtureList().Select(f => f.Index).Min() - 1;
//lastFixtureIndex = checkFixtureList[0] - 1; //lastFixtureIndex = checkFixtureList[0] - 1;
TestFixtureManager.Instance.GetTestFixture(1).ClearData(); //TestFixtureManager.Instance.GetTestFixture(1).ClearData();
TestFixtureManager.Instance.GetTestFixture(2).ClearData(); //TestFixtureManager.Instance.GetTestFixture(2).ClearData();
TestFixtureManager.Instance.GetTestFixture(3).ClearData(); //TestFixtureManager.Instance.GetTestFixture(3).ClearData();
TestFixtureManager.Instance.GetTestFixture(4).ClearData(); //TestFixtureManager.Instance.GetTestFixture(4).ClearData();
TestFixtureManager.Instance.GetTestFixture(5).ClearData(); //TestFixtureManager.Instance.GetTestFixture(5).ClearData();
TestFixtureManager.Instance.GetTestFixture(6).ClearData(); //TestFixtureManager.Instance.GetTestFixture(6).ClearData();
TestFixtureManager.Instance.ClearDataAll();
GlobalTray.NgTray.ChangeStatus(ESlotStatus.NotHave); GlobalTray.NgTray.ChangeStatus(ESlotStatus.NotHave);
GlobalTray.RetestTray.ChangeStatus(ESlotStatus.NotHave); GlobalTray.RetestTray.ChangeStatus(ESlotStatus.NotHave);
GlobalTray.OkTary.ChangeStatus(ESlotStatus.NotHave); GlobalTray.OkTary.ChangeStatus(ESlotStatus.NotHave);
@ -210,28 +211,7 @@ namespace Rs.MotionPlat.Flow
} }
else else
{ {
var t1 = Task.Run(() => { StockManager.ClampAfterReleaseAll();
StockManager.CloseTray(1);
});
var t2 = Task.Run(() => {
StockManager.CloseTray(2);
});
var t3 = Task.Run(() => {
StockManager.CloseTray(3);
});
Task.WaitAll(new[] { t1,t2,t3});
var t4 = Task.Run(() => {
StockManager.OpenTray(1);
});
var t5 = Task.Run(() => {
StockManager.OpenTray(2);
});
var t6 = Task.Run(() => {
StockManager.OpenTray(3);
});
Task.WaitAll(new[] { t4,t5,t6});
flowStep = EDischargeFlowStep.; flowStep = EDischargeFlowStep.;
} }
@ -240,35 +220,7 @@ namespace Rs.MotionPlat.Flow
{ {
logInfo = GetClassName() + "选择了Cancel"; logInfo = GetClassName() + "选择了Cancel";
MessageQueue.Instance.Insert(logInfo); MessageQueue.Instance.Insert(logInfo);
StockManager.ClampAfterReleaseAll();
var t1 = Task.Run(() => {
StockManager.CloseTray(1);
});
var t2 = Task.Run(() => {
StockManager.CloseTray(2);
});
var t3 = Task.Run(() => {
StockManager.CloseTray(3);
});
Task.WaitAll(new[] { t1, t2, t3 });
var t4 = Task.Run(() => {
StockManager.OpenTray(1);
});
var t5 = Task.Run(() => {
StockManager.OpenTray(2);
});
var t6 = Task.Run(() => {
StockManager.OpenTray(3);
});
Task.WaitAll(new[] { t4, t5, t6 });
//StockManager.CloseTray(1);
//StockManager.CloseTray(2);
//StockManager.CloseTray(3);
//StockManager.OpenTray(1);
//StockManager.OpenTray(2);
//StockManager.OpenTray(3);
flowStep = EDischargeFlowStep.; flowStep = EDischargeFlowStep.;
} }
} }

@ -276,9 +276,17 @@ namespace Rs.MotionPlat.Flow
{ {
vProductResult.Parse(msg); vProductResult.Parse(msg);
if ((vProductResult != null && vProductResult.Result == EOneGrabSixteenResult.Ok) || GlobalVar.RunSpace) if ((vProductResult != null && vProductResult.Result == EOneGrabSixteenResult.Ok) || GlobalVar.RunSpace)
{
if(vProductResult.SN.Length==GlobalVar.BarcodeLength)
{ {
flowStep = EGrrFlowStep.; flowStep = EGrrFlowStep.;
} }
else
{
alarmEntity = AlarmCollection.Get(AlarmConstID.);
Msgbox.ShowDialog(alarmEntity, EButtonType.Retry);
}
}
else if (vProductResult != null && vProductResult.Result == EOneGrabSixteenResult.LocationOkScanBarcodeFail) else if (vProductResult != null && vProductResult.Result == EOneGrabSixteenResult.LocationOkScanBarcodeFail)
{ {
GrrScanFailFrm scanFail = new GrrScanFailFrm((act, qrcode) => { GrrScanFailFrm scanFail = new GrrScanFailFrm((act, qrcode) => {

@ -92,7 +92,7 @@ namespace Rs.MotionPlat.Flow.NormalFlow
//料盘准备就绪 //料盘准备就绪
Status = EStockStatus.Ready; Status = EStockStatus.Ready;
//夹紧料盘 //夹紧料盘
HoldTray(); ClampTray();
GlobalTray.OkTary.ChangeStatus(Controls.ESlotStatus.NotHave); GlobalTray.OkTary.ChangeStatus(Controls.ESlotStatus.NotHave);
MessageQueue.Instance.Insert("Ok料盘准备就绪"); MessageQueue.Instance.Insert("Ok料盘准备就绪");
return; return;

@ -79,7 +79,7 @@ namespace Rs.MotionPlat.Flow.NormalFlow
Status = EStockStatus.Ready; Status = EStockStatus.Ready;
MessageQueue.Instance.Insert("ready"); MessageQueue.Instance.Insert("ready");
//夹紧料盘 //夹紧料盘
HoldTray(); ClampTray();
GlobalTray.InputTray.ChangeStatus(Controls.ESlotStatus.Have); GlobalTray.InputTray.ChangeStatus(Controls.ESlotStatus.Have);
return; return;
} }
@ -96,7 +96,7 @@ namespace Rs.MotionPlat.Flow.NormalFlow
{ {
logInfo = GetClassName() + $"当前层:{GetCurrentLayer()}检测到料盘"; logInfo = GetClassName() + $"当前层:{GetCurrentLayer()}检测到料盘";
MessageQueue.Instance.Insert(logInfo); MessageQueue.Instance.Insert(logInfo);
HoldTray(); ClampTray();
GlobalTray.InputTray.ChangeStatus(Controls.ESlotStatus.Have); GlobalTray.InputTray.ChangeStatus(Controls.ESlotStatus.Have);
Status = EStockStatus.Ready; Status = EStockStatus.Ready;
MessageQueue.Instance.Insert("ready"); MessageQueue.Instance.Insert("ready");

@ -83,8 +83,8 @@ namespace Rs.MotionPlat.Flow.NormalFlow
{ {
if (HasTray()) if (HasTray())
{ {
HoldTray(); ClampTray();
LooseTray(); ReleaseTray();
Status = EStockStatus.Ready; Status = EStockStatus.Ready;
MessageQueue.Instance.Insert("ready"); MessageQueue.Instance.Insert("ready");
return; return;

@ -152,7 +152,7 @@ namespace Rs.MotionPlat.Flow.NormalFlow
{ {
outStockStep = EOutStockFlowStep.; outStockStep = EOutStockFlowStep.;
} }
else if (stopwatch.ElapsedMilliseconds > 5000) else if (stopwatch.ElapsedMilliseconds > 20000)
{ {
Msg.ShowError(AlarmCollection.Get(AlarmConstID.).Transform(StockIndex).CN); Msg.ShowError(AlarmCollection.Get(AlarmConstID.).Transform(StockIndex).CN);
outStockStep = EOutStockFlowStep.; outStockStep = EOutStockFlowStep.;
@ -169,7 +169,7 @@ namespace Rs.MotionPlat.Flow.NormalFlow
FlashLight(); FlashLight();
outStockFinished = true; outStockFinished = true;
} }
else if (stopwatch.ElapsedMilliseconds > 5000) else if (stopwatch.ElapsedMilliseconds > 30000)
{ {
Msg.ShowError(AlarmCollection.Get(AlarmConstID.).Transform(StockIndex).CN); Msg.ShowError(AlarmCollection.Get(AlarmConstID.).Transform(StockIndex).CN);
outStockStep = EOutStockFlowStep.; outStockStep = EOutStockFlowStep.;
@ -209,7 +209,7 @@ namespace Rs.MotionPlat.Flow.NormalFlow
{ {
inStockStep = EInStockFlowStep.; inStockStep = EInStockFlowStep.;
} }
else if (stopwatch.ElapsedMilliseconds > 5000) else if (stopwatch.ElapsedMilliseconds > 20000)
{ {
Msgbox.ShowTipDialog(EButtonType.Retry, "抽屉锁原位异常,请处理后点击重试","error",true); Msgbox.ShowTipDialog(EButtonType.Retry, "抽屉锁原位异常,请处理后点击重试","error",true);
} }
@ -258,7 +258,7 @@ namespace Rs.MotionPlat.Flow.NormalFlow
inStockFinished = true; inStockFinished = true;
} }
} }
else if (stopwatch.ElapsedMilliseconds > 5000) else if (stopwatch.ElapsedMilliseconds > 30000)
{ {
Msg.ShowError(AlarmCollection.Get(AlarmConstID.).Transform(StockIndex).CN); Msg.ShowError(AlarmCollection.Get(AlarmConstID.).Transform(StockIndex).CN);
inStockStep = EInStockFlowStep.; inStockStep = EInStockFlowStep.;
@ -293,7 +293,7 @@ namespace Rs.MotionPlat.Flow.NormalFlow
} }
if(Ops.IsOn($"料仓夹磁气缸{StockIndex}动位")) if(Ops.IsOn($"料仓夹磁气缸{StockIndex}动位"))
{ {
LooseTray(); ReleaseTray();
} }
CurrentLayer--; CurrentLayer--;
targetPosition.StockZ = GetStockZPosByLayer(CurrentLayer); targetPosition.StockZ = GetStockZPosByLayer(CurrentLayer);
@ -313,7 +313,7 @@ namespace Rs.MotionPlat.Flow.NormalFlow
MessageQueue.Instance.Insert(logInfo); MessageQueue.Instance.Insert(logInfo);
if (HasTray()) if (HasTray())
{ {
HoldTray(); ClampTray();
Thread.Sleep(GlobalVar.StepMotorMoveDelayTime); Thread.Sleep(GlobalVar.StepMotorMoveDelayTime);
} }
break; break;
@ -334,7 +334,7 @@ namespace Rs.MotionPlat.Flow.NormalFlow
return; return;
} }
//下降之前松开料盘 //下降之前松开料盘
LooseTray(); ReleaseTray();
CurrentLayer++; CurrentLayer++;
targetPosition.StockZ = GetStockZPosByLayer(CurrentLayer); targetPosition.StockZ = GetStockZPosByLayer(CurrentLayer);
errCode = AxisControl.GetAxis($"StockZ{StockIndex}").MovePos(targetPosition.StockZ, GlobalVar.WholeSpeed); errCode = AxisControl.GetAxis($"StockZ{StockIndex}").MovePos(targetPosition.StockZ, GlobalVar.WholeSpeed);
@ -348,7 +348,7 @@ namespace Rs.MotionPlat.Flow.NormalFlow
Thread.Sleep(GlobalVar.StepMotorMoveDelayTime); Thread.Sleep(GlobalVar.StepMotorMoveDelayTime);
break; break;
} }
else if (stopwatch.ElapsedMilliseconds > 5000) else if (stopwatch.ElapsedMilliseconds > 30000)
{ {
//运动异常报警 //运动异常报警
errCode = AxisControl.GetAxis($"StockZ{StockIndex}").MovePos(targetPosition.StockZ, GlobalVar.WholeSpeed); errCode = AxisControl.GetAxis($"StockZ{StockIndex}").MovePos(targetPosition.StockZ, GlobalVar.WholeSpeed);
@ -360,7 +360,7 @@ namespace Rs.MotionPlat.Flow.NormalFlow
/// <summary> /// <summary>
/// 松开料盘 /// 松开料盘
/// </summary> /// </summary>
public void LooseTray() public void ReleaseTray()
{ {
StockModule.ClampTrayCylinder(EIoOperate.Open, StockIndex,GetClassName()); StockModule.ClampTrayCylinder(EIoOperate.Open, StockIndex,GetClassName());
stopwatch.Restart(); stopwatch.Restart();
@ -371,7 +371,7 @@ namespace Rs.MotionPlat.Flow.NormalFlow
Thread.Sleep(1000); Thread.Sleep(1000);
break; break;
} }
else if(stopwatch.ElapsedMilliseconds>5000) else if(stopwatch.ElapsedMilliseconds>30000)
{ {
AlarmEntity alarmEntity = AlarmCollection.Get($"料仓{StockIndex}夹磁气缸原位异常"); AlarmEntity alarmEntity = AlarmCollection.Get($"料仓{StockIndex}夹磁气缸原位异常");
if(alarmEntity != null ) if(alarmEntity != null )
@ -392,7 +392,7 @@ namespace Rs.MotionPlat.Flow.NormalFlow
/// <summary> /// <summary>
/// 抓紧料盘 /// 抓紧料盘
/// </summary> /// </summary>
public void HoldTray() public void ClampTray()
{ {
StockModule.ClampTrayCylinder(EIoOperate.Close, StockIndex, GetClassName()); StockModule.ClampTrayCylinder(EIoOperate.Close, StockIndex, GetClassName());
stopwatch.Restart(); stopwatch.Restart();
@ -405,7 +405,7 @@ namespace Rs.MotionPlat.Flow.NormalFlow
Thread.Sleep(1000); Thread.Sleep(1000);
return; return;
} }
else if (stopwatch.ElapsedMilliseconds > 5000) else if (stopwatch.ElapsedMilliseconds > 30000)
{ {
AlarmEntity alarmEntity = AlarmCollection.Get($"料仓{StockIndex}夹磁气缸动位异常"); AlarmEntity alarmEntity = AlarmCollection.Get($"料仓{StockIndex}夹磁气缸动位异常");
if(alarmEntity != null ) if(alarmEntity != null )

@ -12,6 +12,22 @@ namespace Rs.MotionPlat.Flow.NormalFlow
static Stock2Flow stock2 = new Stock2Flow(); static Stock2Flow stock2 = new Stock2Flow();
static Stock3Flow stock3 = new Stock3Flow(); static Stock3Flow stock3 = new Stock3Flow();
/// <summary>
/// 夹紧后打开料盘夹,在第一次启动时使用
/// </summary>
public static void ClampAfterReleaseAll()
{
Task[] tasks = new Task[3];
tasks[0] = Task.Run(() => { stock1.ClampTray(); });
tasks[1] = Task.Run(() => { stock2.ClampTray(); });
tasks[2] = Task.Run(() => { stock3.ClampTray(); });
Task.WaitAll(tasks);
tasks[0] = Task.Run(() => { stock1.ReleaseTray(); });
tasks[1] = Task.Run(() => { stock2.ReleaseTray(); });
tasks[2] = Task.Run(() => { stock3.ReleaseTray(); });
Task.WaitAll(tasks);
}
/// <summary> /// <summary>
/// 出仓 /// 出仓
/// </summary> /// </summary>
@ -98,13 +114,13 @@ namespace Rs.MotionPlat.Flow.NormalFlow
switch (stockIndex) switch (stockIndex)
{ {
case 1: case 1:
stock1.LooseTray(); stock1.ReleaseTray();
break; break;
case 2: case 2:
stock2.LooseTray(); stock2.ReleaseTray();
break; break;
case 3: case 3:
stock3.LooseTray(); stock3.ReleaseTray();
break; break;
default: default:
break; break;
@ -116,13 +132,13 @@ namespace Rs.MotionPlat.Flow.NormalFlow
switch (stockIndex) switch (stockIndex)
{ {
case 1: case 1:
stock1.HoldTray(); stock1.ClampTray();
break; break;
case 2: case 2:
stock2.HoldTray(); stock2.ClampTray();
break; break;
case 3: case 3:
stock3.HoldTray(); stock3.ClampTray();
break; break;
default: default:
break; break;

@ -105,7 +105,7 @@ namespace Rs.MotionPlat
{ {
this.HeadText= title; this.HeadText= title;
} }
this.lblContent.Text= cnContent; ReloadLanguage();
//遍历 //遍历
string[] buttons = Enum.GetNames(typeof(EButtonType)); string[] buttons = Enum.GetNames(typeof(EButtonType));
foreach (string button in buttons.Reverse()) foreach (string button in buttons.Reverse())
@ -232,6 +232,10 @@ namespace Rs.MotionPlat
public void ReloadLanguage() public void ReloadLanguage()
{ {
if(string.IsNullOrEmpty(enContent))
{
enContent = cnContent;
}
string lang = Properties.Settings.Default.DefaultLanguage; string lang = Properties.Settings.Default.DefaultLanguage;
if (lang == "zh-CN") if (lang == "zh-CN")
{ {

@ -31,6 +31,6 @@ using System.Runtime.InteropServices;
// //
//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值 //可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值
//通过使用 "*",如下所示: //通过使用 "*",如下所示:
[assembly: AssemblyVersion("20.25.14.1")] [assembly: AssemblyVersion("20.25.14.3")]
//[assembly: AssemblyVersion("1.0.0.0")] //[assembly: AssemblyVersion("1.0.0.0")]
//[assembly: AssemblyFileVersion("1.0.0.0")] //[assembly: AssemblyFileVersion("1.0.0.0")]

Loading…
Cancel
Save