Commit 6f641e7d 刘韬

适配 新款 SO21637

1 个父辈 3c7363df
...@@ -70,10 +70,15 @@ namespace OnlineStore.Common ...@@ -70,10 +70,15 @@ namespace OnlineStore.Common
[MyConfigComment("是否启用库位屏蔽")] [MyConfigComment("是否启用库位屏蔽")]
public static MyConfig<bool> Device_DisableStorePosition = false; public static MyConfig<bool> Device_DisableStorePosition = false;
[MyConfigComment("是否屏蔽RFID")]
public static MyConfig<bool> Device_Disable_RFID_Check = false;
[MyConfigComment("超声波传感器液位距离")] [MyConfigComment("超声波传感器液位距离")]
public static MyConfig<int> Device_Liquid_level_distance = 180; public static MyConfig<int> Device_Liquid_level_distance = 180;
[MyConfigComment("取料检测位置,取料低点p3-偏移量")]
public static MyConfig<int> Device_TinDetect_Offset = 205000;
[MyConfigComment("打印机IP地址")] [MyConfigComment("打印机IP地址")]
public static MyConfig<string> Printer_IP = "192.168.4.21"; public static MyConfig<string> Printer_IP = "192.168.4.21";
[MyConfigComment("打印机标签模版")] [MyConfigComment("打印机标签模版")]
...@@ -112,5 +117,15 @@ namespace OnlineStore.Common ...@@ -112,5 +117,15 @@ namespace OnlineStore.Common
public static MyConfig<int> CameraScan_QRCodeCount = 3; public static MyConfig<int> CameraScan_QRCodeCount = 3;
[MyConfigComment("二维码扫码超时毫秒")] [MyConfigComment("二维码扫码超时毫秒")]
public static MyConfig<int> CameraScan_CodeTimeOut = 3000; public static MyConfig<int> CameraScan_CodeTimeOut = 3000;
[MyConfigComment("设备型号")]
public static MyConfig<Module_SO> Module_No = Module_SO.SO20031;
}
public enum Module_SO {
SO20031,
SO21637
} }
} }
...@@ -56,7 +56,10 @@ namespace DeviceLibrary ...@@ -56,7 +56,10 @@ namespace DeviceLibrary
// Monitor.Exit(serverConnectTimer); // Monitor.Exit(serverConnectTimer);
// } // }
// return; // return;
//} //}\
if (!server.ToLower().StartsWith("http"))
return;
try try
{ {
if (!RobotManage.isRunning) if (!RobotManage.isRunning)
......
...@@ -144,11 +144,11 @@ namespace DeviceLibrary ...@@ -144,11 +144,11 @@ namespace DeviceLibrary
MoveInfo.NextMoveStep(MoveStep.StoreTS05); MoveInfo.NextMoveStep(MoveStep.StoreTS05);
if (From.posid != MainMachine.LabelP) if (From.posid != MainMachine.LabelP)
{ {
var zp2 = From.Z_Axis_P3 - 205000; var zp2 = From.Z_Axis_P3 - Setting_Init.Device_TinDetect_Offset;
if (zp2 < 0) if (zp2 < 0)
zp2 = 0; zp2 = 0;
Z_Axis.AbsMove(MoveInfo, zp2, Config.Z_Axis_P1_speed); Z_Axis.AbsMove(MoveInfo, zp2, Config.Z_Axis_P1_speed);
MoveInfo.log($"{storeMoveType}:Z轴到达取料前点,{From.Z_Axis_P2}"); MoveInfo.log($"{storeMoveType}:Z轴到达取料检测点,{From.Z_Axis_P3}-{Setting_Init.Device_TinDetect_Offset}={zp2}");
} }
RobotManage.mainMachine.CylinderMove(MoveInfo, IO_Type.Taking_Release, IO_Type.Taking_Clamp, IO_VALUE.LOW); RobotManage.mainMachine.CylinderMove(MoveInfo, IO_Type.Taking_Release, IO_Type.Taking_Clamp, IO_VALUE.LOW);
MoveInfo.log($"{storeMoveType}:松开夹爪"); MoveInfo.log($"{storeMoveType}:松开夹爪");
...@@ -248,7 +248,7 @@ namespace DeviceLibrary ...@@ -248,7 +248,7 @@ namespace DeviceLibrary
} }
else if (To.posid != MainMachine.LabelP) else if (To.posid != MainMachine.LabelP)
{ {
var zp2 = To.Z_Axis_P3 - 205000; var zp2 = To.Z_Axis_P3 - Setting_Init.Device_TinDetect_Offset;
if (zp2 < 0) if (zp2 < 0)
zp2 = 0; zp2 = 0;
Z_Axis.AbsMove(MoveInfo, zp2, Config.Z_Axis_P1_speed); Z_Axis.AbsMove(MoveInfo, zp2, Config.Z_Axis_P1_speed);
......
...@@ -3,6 +3,7 @@ using Newtonsoft.Json; ...@@ -3,6 +3,7 @@ using Newtonsoft.Json;
using OnlineStore.Common; using OnlineStore.Common;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Diagnostics;
using System.Drawing; using System.Drawing;
using System.Drawing.Imaging; using System.Drawing.Imaging;
using System.IO; using System.IO;
...@@ -189,6 +190,7 @@ namespace DeviceLibrary ...@@ -189,6 +190,7 @@ namespace DeviceLibrary
var v = cl.Average(cc => cc.V); var v = cl.Average(cc => cc.V);
var has = s > CameraData[Name].S && h > 60 && h < 200; var has = s > CameraData[Name].S && h > 60 && h < 200;
Debug.WriteLine($"TestStorePoint: tp:{tp},haslist:{haslist.Count}, h:{h}, s:{s}, v:{v}");
haslist.Add(has ? 1 : 0); haslist.Add(has ? 1 : 0);
} }
} }
......
...@@ -50,11 +50,11 @@ namespace DeviceLibrary ...@@ -50,11 +50,11 @@ namespace DeviceLibrary
switch (AIOTMoveInfo.MoveStep) switch (AIOTMoveInfo.MoveStep)
{ {
case MoveStep.Wait: case MoveStep.Wait:
if (IsInStoreReady) //if (IsInStoreReady)
{ //{
AIOTMoveInfo.NextMoveStep(MoveStep.StoreIn01); // AIOTMoveInfo.NextMoveStep(MoveStep.StoreIn01);
AIOTMoveInfo.log($"入库料盘已准备好"); // AIOTMoveInfo.log($"入库料盘已准备好");
} //}
break; break;
case MoveStep.StoreIn01: case MoveStep.StoreIn01:
AIOTMoveInfo.NextMoveStep(MoveStep.StoreIn02); AIOTMoveInfo.NextMoveStep(MoveStep.StoreIn02);
......
...@@ -123,7 +123,7 @@ namespace DeviceLibrary ...@@ -123,7 +123,7 @@ namespace DeviceLibrary
LabelingMoveInfo.log($"获取库位失败,送到NG口:{LabelingMoveInfo.MoveParam.NgMsg}"); LabelingMoveInfo.log($"获取库位失败,送到NG口:{LabelingMoveInfo.MoveParam.NgMsg}");
return; return;
} }
if (LabelingMoveInfo.MoveParam.usedCount >= 1) if (LabelingMoveInfo.MoveParam.usedCount >= 1 && Setting_Init.Module_No.Val != Module_SO.SO21637)
{ {
LabelingMoveInfo.NextMoveStep(MoveStep.Labeling57); LabelingMoveInfo.NextMoveStep(MoveStep.Labeling57);
Setting_Init.Runtime_Step = Runtime_StepE.LabelPasteFinish; Setting_Init.Runtime_Step = Runtime_StepE.LabelPasteFinish;
...@@ -242,10 +242,10 @@ namespace DeviceLibrary ...@@ -242,10 +242,10 @@ namespace DeviceLibrary
LabelingMoveInfo.NextMoveStep(MoveStep.Labeling12); LabelingMoveInfo.NextMoveStep(MoveStep.Labeling12);
LabelingMoveInfo.WaitList.Add(WaitResultInfo.WaitTime(2000)); LabelingMoveInfo.WaitList.Add(WaitResultInfo.WaitTime(2000));
LabelingMoveInfo.log("打印成功,等待标签被取走"); LabelingMoveInfo.log("打印成功,等待标签被取走");
Task.Run(() => { //Task.Run(() => {
Task.Delay(2000).Wait(); // Task.Delay(2000).Wait();
IOMove(IO_Type.Label_TakeBlow, IO_VALUE.HIGH, false, 1000); // IOMove(IO_Type.Label_TakeBlow, IO_VALUE.HIGH, false, 1000);
}); //});
} }
else else
...@@ -271,7 +271,7 @@ namespace DeviceLibrary ...@@ -271,7 +271,7 @@ namespace DeviceLibrary
CylinderMove(LabelingMoveInfo, IO_Type.Label_Dock_Down, IO_Type.Label_Dock_Up, IO_VALUE.HIGH); CylinderMove(LabelingMoveInfo, IO_Type.Label_Dock_Down, IO_Type.Label_Dock_Up, IO_VALUE.HIGH);
LabelingMoveInfo.log("接标台上升"); LabelingMoveInfo.log("接标台上升");
} }
else { else if(LabelingMoveInfo.IsTimeOut(2)) {
Msg.add(crc.GetString("Res0173.8a024375","没有检测到打印出的标签"), MsgLevel.alarm, ErrInfo.LabelInPaste); Msg.add(crc.GetString("Res0173.8a024375","没有检测到打印出的标签"), MsgLevel.alarm, ErrInfo.LabelInPaste);
LabelingMoveInfo.NextMoveStep(MoveStep.Labeling10); LabelingMoveInfo.NextMoveStep(MoveStep.Labeling10);
CylinderMove(LabelingMoveInfo, IO_Type.Label_Dock_Down, IO_Type.Label_Dock_Up, IO_VALUE.LOW); CylinderMove(LabelingMoveInfo, IO_Type.Label_Dock_Down, IO_Type.Label_Dock_Up, IO_VALUE.LOW);
...@@ -287,6 +287,7 @@ namespace DeviceLibrary ...@@ -287,6 +287,7 @@ namespace DeviceLibrary
case MoveStep.Labeling14: case MoveStep.Labeling14:
LabelingMoveInfo.NextMoveStep(MoveStep.Labeling15); LabelingMoveInfo.NextMoveStep(MoveStep.Labeling15);
IOMove(IO_Type.Label_Vacuum, IO_VALUE.HIGH); IOMove(IO_Type.Label_Vacuum, IO_VALUE.HIGH);
if (Setting_Init.Module_No.Val==Module_SO.SO20031)
IOMove(IO_Type.Label_PasteBlow, IO_VALUE.HIGH); IOMove(IO_Type.Label_PasteBlow, IO_VALUE.HIGH);
CylinderMove(LabelingMoveInfo, IO_Type.Labeling_Down, IO_Type.Labeling_Up, IO_VALUE.LOW); CylinderMove(LabelingMoveInfo, IO_Type.Labeling_Down, IO_Type.Labeling_Up, IO_VALUE.LOW);
...@@ -306,6 +307,12 @@ namespace DeviceLibrary ...@@ -306,6 +307,12 @@ namespace DeviceLibrary
case MoveStep.Labeling50: case MoveStep.Labeling50:
LabelingMoveInfo.NextMoveStep(MoveStep.Labeling51); LabelingMoveInfo.NextMoveStep(MoveStep.Labeling51);
CylinderMove(LabelingMoveInfo, IO_Type.Labeling_Left, IO_Type.Labeling_Right, IO_VALUE.LOW); CylinderMove(LabelingMoveInfo, IO_Type.Labeling_Left, IO_Type.Labeling_Right, IO_VALUE.LOW);
if (Setting_Init.Module_No.Val == Module_SO.SO21637)
{
CylinderMove(LabelingMoveInfo, IO_Type.Label_Dock_Back, IO_Type.Label_Dock_Front, IO_VALUE.HIGH);
CylinderMove(LabelingMoveInfo, IO_Type.Label_Dock_Down, IO_Type.Label_Dock_Up, IO_VALUE.LOW);
LabelingMoveInfo.log("SO21637接标台前移动");
}
//LabelingMoveInfo.WaitList.Add(WaitResultInfo.WaitTime(1000)); //LabelingMoveInfo.WaitList.Add(WaitResultInfo.WaitTime(1000));
break; break;
case MoveStep.Labeling51: case MoveStep.Labeling51:
...@@ -325,12 +332,21 @@ namespace DeviceLibrary ...@@ -325,12 +332,21 @@ namespace DeviceLibrary
RobotManage.UserPause(crc.GetString("Res0167.8453b300","取标失败")); RobotManage.UserPause(crc.GetString("Res0167.8453b300","取标失败"));
return; return;
} }
if (Setting_Init.Module_No.Val == Module_SO.SO21637)
{
LabelingMoveInfo.NextMoveStep(MoveStep.Labeling54_SO21637);
CylinderMove(LabelingMoveInfo, IO_Type.Labeling_Down, IO_Type.Labeling_Up, IO_VALUE.LOW);
//IOMove(IO_Type.Label_PasteBlow, IO_VALUE.HIGH);
LabelingMoveInfo.log("SO21637,贴标流程");
}
else
{
LabelingMoveInfo.NextMoveStep(MoveStep.Labeling52); LabelingMoveInfo.NextMoveStep(MoveStep.Labeling52);
CylinderMove(null, IO_Type.Labeling_Down, IO_Type.Labeling_Up, IO_VALUE.LOW); CylinderMove(null, IO_Type.Labeling_Down, IO_Type.Labeling_Up, IO_VALUE.LOW);
//IOMove(IO_Type.Label_PasteBlow, IO_VALUE.HIGH); LabelingMoveInfo.log("SO20031,贴标流程");
//Setting_Init.Runtime_Step = Runtime_StepE.LabelGot; }
Setting_Init.Runtime_Step = Runtime_StepE.LabelPaste; Setting_Init.Runtime_Step = Runtime_StepE.LabelPaste;
//LabelingMoveInfo.WaitList.Add(WaitResultInfo.WaitTime(1000));
break; break;
case MoveStep.Labeling52: case MoveStep.Labeling52:
LabelingMoveInfo.NextMoveStep(MoveStep.Labeling52_2); LabelingMoveInfo.NextMoveStep(MoveStep.Labeling52_2);
...@@ -363,6 +379,20 @@ namespace DeviceLibrary ...@@ -363,6 +379,20 @@ namespace DeviceLibrary
RotateEquip.TurnDouble(); RotateEquip.TurnDouble();
} }
break; break;
case MoveStep.Labeling54_SO21637:
LabelingMoveInfo.NextMoveStep(MoveStep.Labeling54_SO21637_2);
IOMove(IO_Type.Label_PasteBlow, IO_VALUE.HIGH);
LabelingMoveInfo.WaitList.Add(WaitResultInfo.WaitTime(1000));
LabelingMoveInfo.log("SO21637,贴标流程2");
break;
case MoveStep.Labeling54_SO21637_2:
LabelingMoveInfo.NextMoveStep(MoveStep.Labeling56);
IOMove(IO_Type.Label_Vacuum, IO_VALUE.LOW);
IOMove(IO_Type.Label_PasteBlow, IO_VALUE.LOW);
CylinderMove(LabelingMoveInfo, IO_Type.Labeling_Down, IO_Type.Labeling_Up, IO_VALUE.HIGH);
//RotateEquip.TurnDegree(90);
LabelingMoveInfo.log("SO21637,贴标流程3");
break;
case MoveStep.Labeling55: case MoveStep.Labeling55:
if (RotateEquip.TurnWork.IsCompleted) if (RotateEquip.TurnWork.IsCompleted)
{ {
...@@ -373,7 +403,7 @@ namespace DeviceLibrary ...@@ -373,7 +403,7 @@ namespace DeviceLibrary
} }
break; break;
case MoveStep.Labeling56: case MoveStep.Labeling56:
if (RotateEquip.TurnWork.IsCompleted) if (RotateEquip.TurnWork==null || RotateEquip.TurnWork.IsCompleted)
{ {
LabelingMoveInfo.NextMoveStep(MoveStep.Labeling57); LabelingMoveInfo.NextMoveStep(MoveStep.Labeling57);
if (LabelingTestMode) if (LabelingTestMode)
...@@ -391,6 +421,8 @@ namespace DeviceLibrary ...@@ -391,6 +421,8 @@ namespace DeviceLibrary
if (RotateEquip.WaitStatus(null)) if (RotateEquip.WaitStatus(null))
{ {
LabelingMoveInfo.NextMoveStep(MoveStep.Labeling58); LabelingMoveInfo.NextMoveStep(MoveStep.Labeling58);
RobotManage.mainMachine.CylinderMove(LabelingMoveInfo, IO_Type.Tin_Dock_Rotate_Release, IO_Type.Tin_Dock_Rotate_Clamp, IO_VALUE.LOW);
LabelingMoveInfo.log("夹抓释放");
} }
break; break;
case MoveStep.Labeling58: case MoveStep.Labeling58:
...@@ -399,7 +431,7 @@ namespace DeviceLibrary ...@@ -399,7 +431,7 @@ namespace DeviceLibrary
CylinderMove(null, IO_Type.Labeling_Left, IO_Type.Labeling_Right, IO_VALUE.HIGH); CylinderMove(null, IO_Type.Labeling_Left, IO_Type.Labeling_Right, IO_VALUE.HIGH);
CylinderMove(LabelingMoveInfo, IO_Type.Tin_Dock_Left, IO_Type.Tin_Dock_Right, IO_VALUE.LOW); CylinderMove(LabelingMoveInfo, IO_Type.Tin_Dock_Left, IO_Type.Tin_Dock_Right, IO_VALUE.LOW);
//CylinderMove(LabelingMoveInfo, IO_Type.Label_Dock_Back, IO_Type.Label_Dock_Front, IO_VALUE.LOW); //CylinderMove(LabelingMoveInfo, IO_Type.Label_Dock_Back, IO_Type.Label_Dock_Front, IO_VALUE.LOW);
//LabelingMoveInfo.log("锡膏横移到左侧"); LabelingMoveInfo.log("锡膏横移到左侧");
break; break;
case MoveStep.Labeling59: case MoveStep.Labeling59:
LabelingMoveInfo.NextMoveStep(MoveStep.Wait); LabelingMoveInfo.NextMoveStep(MoveStep.Wait);
......
...@@ -240,7 +240,7 @@ namespace DeviceLibrary ...@@ -240,7 +240,7 @@ namespace DeviceLibrary
if (!boxTransport.IsComplateOrFree) if (!boxTransport.IsComplateOrFree)
break; break;
Setting_Init.Runtime_Step = Runtime_StepE.None; Setting_Init.Runtime_Step = Runtime_StepE.None;
if (StoreMoveInfo.MoveParam.usedCount == 0) if (StoreMoveInfo.MoveParam.usedCount == 0 && !Setting_Init.Device_Disable_RFID_Check)
{ {
if (StoreMoveInfo.MoveParam.RFID.Length > 16) if (StoreMoveInfo.MoveParam.RFID.Length > 16)
StoreMoveInfo.MoveParam.RFID = StoreMoveInfo.MoveParam.RFID.Substring(0, 16); StoreMoveInfo.MoveParam.RFID = StoreMoveInfo.MoveParam.RFID.Substring(0, 16);
...@@ -482,6 +482,8 @@ namespace DeviceLibrary ...@@ -482,6 +482,8 @@ namespace DeviceLibrary
//ServerCM.SendStoreState(StoreMoveInfo.MoveParam.PosID, StoreStatus.OutStoreBoxEnd); //ServerCM.SendStoreState(StoreMoveInfo.MoveParam.PosID, StoreStatus.OutStoreBoxEnd);
bool issame = false; bool issame = false;
string ds = ""; string ds = "";
if (!Setting_Init.Device_Disable_RFID_Check)
{
for (int i = 0; i < 15; i++) for (int i = 0; i < 15; i++)
{ {
if (RobotManage.RFID.ReadEPC(16, out byte[] data)) if (RobotManage.RFID.ReadEPC(16, out byte[] data))
...@@ -523,7 +525,11 @@ namespace DeviceLibrary ...@@ -523,7 +525,11 @@ namespace DeviceLibrary
} }
Thread.Sleep(200); Thread.Sleep(200);
} }
}
else
{
issame = true;
}
if (!issame) if (!issame)
{ {
StoreMoveInfo.log("读取到的RFID与物料信息不符 读取到 RFID:" + ds); StoreMoveInfo.log("读取到的RFID与物料信息不符 读取到 RFID:" + ds);
......
...@@ -135,6 +135,8 @@ namespace DeviceLibrary ...@@ -135,6 +135,8 @@ namespace DeviceLibrary
Labeling52_2, Labeling52_2,
Labeling53, Labeling53,
Labeling54, Labeling54,
Labeling54_SO21637,
Labeling54_SO21637_2,
Labeling55, Labeling55,
Labeling56, Labeling56,
Labeling57, Labeling57,
......
...@@ -19,6 +19,7 @@ Global ...@@ -19,6 +19,7 @@ Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU Release|Any CPU = Release|Any CPU
Description = 锡膏料仓 SO1202/SO20031 SO1540/SO21637
EndGlobalSection EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution GlobalSection(ProjectConfigurationPlatforms) = postSolution
{064BEBF5-8FAA-4EA2-A5F3-A06E6E7D9251}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {064BEBF5-8FAA-4EA2-A5F3-A06E6E7D9251}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
......
...@@ -53,8 +53,15 @@ namespace TheMachine ...@@ -53,8 +53,15 @@ namespace TheMachine
{ {
FillBoxPos(); FillBoxPos();
timer1.Enabled = true; timer1.Enabled = true;
crc.LanguageChangeEvent += Crc_LanguageChangeEvent;
return; return;
} }
private void Crc_LanguageChangeEvent(object sender, EventArgs e)
{
FillBoxPos();
}
private void Store_InOutEndProcessEvent(string arg1, StoreMoveType arg2, bool arg3) private void Store_InOutEndProcessEvent(string arg1, StoreMoveType arg2, bool arg3)
{ {
//LogUtil.info($"出入库完成状态:{arg2},库位:{arg1}"); //LogUtil.info($"出入库完成状态:{arg2},库位:{arg1}");
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!