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

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

@ -914,6 +914,14 @@ namespace Rs.MotionPlat.Entitys
public class TestFixtureManager
{
TestFixture[] testFixtures=new TestFixture[6];
public void ClearDataAll()
{
foreach (var tf in testFixtures)
{
tf.ClearData();
}
}
private TestFixtureManager()
{
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)
{
logInfo = GetClassName() + "选择了OK";
@ -194,12 +194,13 @@ namespace Rs.MotionPlat.Flow
//lastFixtureIndex = TestFixtureManager.Instance.GetEnableFixtureList().Select(f => f.Index).Min() - 1;
//lastFixtureIndex = checkFixtureList[0] - 1;
TestFixtureManager.Instance.GetTestFixture(1).ClearData();
TestFixtureManager.Instance.GetTestFixture(2).ClearData();
TestFixtureManager.Instance.GetTestFixture(3).ClearData();
TestFixtureManager.Instance.GetTestFixture(4).ClearData();
TestFixtureManager.Instance.GetTestFixture(5).ClearData();
TestFixtureManager.Instance.GetTestFixture(6).ClearData();
//TestFixtureManager.Instance.GetTestFixture(1).ClearData();
//TestFixtureManager.Instance.GetTestFixture(2).ClearData();
//TestFixtureManager.Instance.GetTestFixture(3).ClearData();
//TestFixtureManager.Instance.GetTestFixture(4).ClearData();
//TestFixtureManager.Instance.GetTestFixture(5).ClearData();
//TestFixtureManager.Instance.GetTestFixture(6).ClearData();
TestFixtureManager.Instance.ClearDataAll();
GlobalTray.NgTray.ChangeStatus(ESlotStatus.NotHave);
GlobalTray.RetestTray.ChangeStatus(ESlotStatus.NotHave);
GlobalTray.OkTary.ChangeStatus(ESlotStatus.NotHave);
@ -210,28 +211,7 @@ namespace Rs.MotionPlat.Flow
}
else
{
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.ClampAfterReleaseAll();
flowStep = EDischargeFlowStep.;
}
@ -240,35 +220,7 @@ namespace Rs.MotionPlat.Flow
{
logInfo = GetClassName() + "选择了Cancel";
MessageQueue.Instance.Insert(logInfo);
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);
StockManager.ClampAfterReleaseAll();
flowStep = EDischargeFlowStep.;
}
}

@ -277,7 +277,15 @@ namespace Rs.MotionPlat.Flow
vProductResult.Parse(msg);
if ((vProductResult != null && vProductResult.Result == EOneGrabSixteenResult.Ok) || GlobalVar.RunSpace)
{
flowStep = EGrrFlowStep.;
if(vProductResult.SN.Length==GlobalVar.BarcodeLength)
{
flowStep = EGrrFlowStep.;
}
else
{
alarmEntity = AlarmCollection.Get(AlarmConstID.);
Msgbox.ShowDialog(alarmEntity, EButtonType.Retry);
}
}
else if (vProductResult != null && vProductResult.Result == EOneGrabSixteenResult.LocationOkScanBarcodeFail)
{

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

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

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

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

@ -12,6 +12,22 @@ namespace Rs.MotionPlat.Flow.NormalFlow
static Stock2Flow stock2 = new Stock2Flow();
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>
@ -98,13 +114,13 @@ namespace Rs.MotionPlat.Flow.NormalFlow
switch (stockIndex)
{
case 1:
stock1.LooseTray();
stock1.ReleaseTray();
break;
case 2:
stock2.LooseTray();
stock2.ReleaseTray();
break;
case 3:
stock3.LooseTray();
stock3.ReleaseTray();
break;
default:
break;
@ -116,13 +132,13 @@ namespace Rs.MotionPlat.Flow.NormalFlow
switch (stockIndex)
{
case 1:
stock1.HoldTray();
stock1.ClampTray();
break;
case 2:
stock2.HoldTray();
stock2.ClampTray();
break;
case 3:
stock3.HoldTray();
stock3.ClampTray();
break;
default:
break;

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

Loading…
Cancel
Save