Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
张东亮
/
NS200
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
图表
网络
创建新的问题
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit 95a3c3ce
由
刘韬
编写于
2024-06-25 14:35:16 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
修改标签打印逻辑, 增加标签失败重试
1 个父辈
2d1f28dd
显示空白字符变更
内嵌
并排
正在显示
8 个修改的文件
包含
86 行增加
和
49 行删除
DeviceLibrary/AutoScanAndLabel/MainMachine _BtnProcess.cs
DeviceLibrary/AutoScanAndLabel/MainMachine _IOMonitor.cs
DeviceLibrary/AutoScanAndLabel/MainMachine _LabelProcess.cs
DeviceLibrary/AutoScanAndLabel/MainMachine _LeftProcess.cs
DeviceLibrary/AutoScanAndLabel/MainMachine _MiddleProcess.cs
DeviceLibrary/AutoScanAndLabel/MainMachine.cs
DeviceLibrary/AutoScanAndLabel/MoveStep.cs
dll/IDHIKCamera.dll
DeviceLibrary/AutoScanAndLabel/MainMachine _BtnProcess.cs
查看文件 @
95a3c3c
...
@@ -33,7 +33,7 @@ namespace DeviceLibrary
...
@@ -33,7 +33,7 @@ namespace DeviceLibrary
}
}
}
}
if
((
LeftMoveInfo
.
IsStep
(
MoveStep
.
Wait
)
||
LeftMoveInfo
.
IsStep
(
MoveStep
.
REND
))
if
((
LeftMoveInfo
.
IsStep
(
MoveStep
.
Wait
)
||
LeftMoveInfo
.
IsStep
(
MoveStep
.
LEND
)
||
LeftMoveInfo
.
IsStep
(
MoveStep
.
L10_WaitReelPut
))
&&
IOValue
(
IO_Type
.
Left_BTN
).
Equals
(
IO_VALUE
.
HIGH
))
&&
IOValue
(
IO_Type
.
Left_BTN
).
Equals
(
IO_VALUE
.
HIGH
))
{
{
if
(
IOValue
(
IO_Type
.
LeftEnd_Check
).
Equals
(
IO_VALUE
.
HIGH
))
if
(
IOValue
(
IO_Type
.
LeftEnd_Check
).
Equals
(
IO_VALUE
.
HIGH
))
...
...
DeviceLibrary/AutoScanAndLabel/MainMachine _IOMonitor.cs
查看文件 @
95a3c3c
...
@@ -26,7 +26,7 @@ namespace DeviceLibrary
...
@@ -26,7 +26,7 @@ namespace DeviceLibrary
}
}
}
}
if
((
LeftMoveInfo
.
IsStep
(
MoveStep
.
Wait
)
||
LeftMoveInfo
.
IsStep
(
MoveStep
.
R
END
)))
if
((
LeftMoveInfo
.
IsStep
(
MoveStep
.
Wait
)
||
LeftMoveInfo
.
IsStep
(
MoveStep
.
L
END
)))
{
{
//&& && IOValue(IO_Type.DischargeAGV_Receiving).Equals(IO_VALUE.LOW)
//&& && IOValue(IO_Type.DischargeAGV_Receiving).Equals(IO_VALUE.LOW)
if
(
IOValue
(
IO_Type
.
LeftEnd_Check
).
Equals
(
IO_VALUE
.
LOW
)&&
IOValue
(
IO_Type
.
DischargeAGV_Feeding
).
Equals
(
IO_VALUE
.
LOW
))
if
(
IOValue
(
IO_Type
.
LeftEnd_Check
).
Equals
(
IO_VALUE
.
LOW
)&&
IOValue
(
IO_Type
.
DischargeAGV_Feeding
).
Equals
(
IO_VALUE
.
LOW
))
...
...
DeviceLibrary/AutoScanAndLabel/MainMachine _LabelProcess.cs
查看文件 @
95a3c3c
...
@@ -11,12 +11,21 @@ using System.Threading.Tasks;
...
@@ -11,12 +11,21 @@ using System.Threading.Tasks;
using
System.Threading
;
using
System.Threading
;
using
System.Timers
;
using
System.Timers
;
using
System.IO
;
using
System.IO
;
using
OnlineStore.Common.util
;
namespace
DeviceLibrary
namespace
DeviceLibrary
{
{
partial
class
MainMachine
partial
class
MainMachine
{
{
Point
Label_p3
;
Point
Label_p3
;
LabelParam
CurrentPrintInfo
=
null
;
enum
LabelFailReason
{
PrintFailure
,
SuckerFailure
}
LabelFailReason
labelFailReason
=
LabelFailReason
.
PrintFailure
;
void
LabelProcess
()
void
LabelProcess
()
{
{
if
(
CheckWait
(
LabelMoveInfo
))
if
(
CheckWait
(
LabelMoveInfo
))
...
@@ -37,10 +46,36 @@ namespace DeviceLibrary
...
@@ -37,10 +46,36 @@ namespace DeviceLibrary
LabelMoveInfo
.
log
(
"Label_YR转到取标点"
);
LabelMoveInfo
.
log
(
"Label_YR转到取标点"
);
break
;
break
;
case
MoveStep
.
Lbl02_1
:
case
MoveStep
.
Lbl02_1
:
LabelMoveInfo
.
NextMoveStep
(
MoveStep
.
Lbl_WaitPrint
);
LabelMoveInfo
.
NextMoveStep
(
MoveStep
.
Lbl_WaitPrint
Info
);
Label_X_Axis
.
AbsMove
(
LabelMoveInfo
,
Config
.
Label_X_P2
,
Config
.
Label_X_P2_speed
);
Label_X_Axis
.
AbsMove
(
LabelMoveInfo
,
Config
.
Label_X_P2
,
Config
.
Label_X_P2_speed
);
LabelMoveInfo
.
log
(
"Label_X转到取标点,等待标签打印完毕"
);
LabelMoveInfo
.
log
(
"Label_X转到取标点,等待标签打印完毕"
);
break
;
break
;
case
MoveStep
.
Lbl_WaitPrintInfo
:
LabelMoveInfo
.
log
(
"等待打印标签信息"
);
break
;
case
MoveStep
.
Lbl_PrintLabel
:
if
(
CurrentPrintInfo
==
null
)
{
LabelMoveInfo
.
log
(
"等待接收打印标签信息"
);
return
;
}
var
kv
=
CurrentPrintInfo
.
Keyword
.
Select
(
k
=>
$
"{k.Key}={k.Value}"
).
ToArray
();
LabelMoveInfo
.
log
(
"调用 PrintLabel 打印标签 StartPrintLabel ,["
+
string
.
Join
(
", "
,
kv
)
+
"] 开始"
);
string
labelName
=
ConfigHelper
.
Config
.
Get
(
Setting_Init
.
LabelName
);
if
(
RobotManage
.
printerHelper
.
Print
(
labelName
,
CurrentPrintInfo
.
Keyword
,
out
string
msg
))
{
LabelMoveInfo
.
NextMoveStep
(
MoveStep
.
Lbl_WaitPrint
);
LabelMoveInfo
.
log
(
"PrintLabel 打印标签 StartPrintLabel 结束 "
+
msg
);
UnifiedDataHandler
.
RecordPrintNg
(
false
,
true
,
out
string
[]
strarrys
);
//数据保存到共享文件夹
DataUploadUtil
.
LabelUpload
(
CurrentPrintInfo
.
Keyword
);
}
else
{
LabelMoveInfo
.
log
(
"PrintLabel 失败 "
+
msg
);
LabelMoveInfo
.
NextMoveStep
(
MoveStep
.
Lbl_PrintFail
);
labelFailReason
=
LabelFailReason
.
PrintFailure
;
}
break
;
case
MoveStep
.
Lbl_WaitPrint
:
case
MoveStep
.
Lbl_WaitPrint
:
string
version
=
ConfigHelper
.
Config
.
Get
(
"Hardwareversion"
,
"V2"
);
string
version
=
ConfigHelper
.
Config
.
Get
(
"Hardwareversion"
,
"V2"
);
bool
detectLabel
=
false
;
bool
detectLabel
=
false
;
...
@@ -59,22 +94,43 @@ namespace DeviceLibrary
...
@@ -59,22 +94,43 @@ namespace DeviceLibrary
if
(
detectLabel
)
if
(
detectLabel
)
{
{
LabelMoveInfo
.
errlog
(
"标签打印完成"
);
LabelMoveInfo
.
NextMoveStep
(
MoveStep
.
Lbl_Printted
);
LabelMoveInfo
.
NextMoveStep
(
MoveStep
.
Lbl_Printted
);
Thread
.
Sleep
(
500
);
LabelMoveInfo
.
errlog
(
"标签打印完成"
);
}
else
if
(
LabelMoveInfo
.
IsTimeOut
(
15
))
{
LabelMoveInfo
.
NextMoveStep
(
MoveStep
.
Lbl_PrintFail
);
labelFailReason
=
LabelFailReason
.
PrintFailure
;
LabelMoveInfo
.
errlog
(
"标签打印超时"
);
}
}
//else if (LabelMoveInfo.IsTimeOut(15))
//{
// Msg.add("标签打印超时,请检查,取走标签后复位", MsgLevel.warning);
// LabelMoveInfo.errlog("标签打印超时");
// RobotManage.UserPause();
//}
else
else
{
{
Msg
.
add
(
"等待标签打印"
,
MsgLevel
.
info
);
//
Msg.add("等待标签打印", MsgLevel.info);
LabelMoveInfo
.
log
(
"等待标签打印"
);
LabelMoveInfo
.
log
(
"等待标签打印"
);
}
}
break
;
break
;
case
MoveStep
.
Lbl_PrintFail
:
if
(
labelFailReason
==
LabelFailReason
.
SuckerFailure
)
Msg
.
add
(
"标签打印失败,请检查打印机状态,关门后将自动重试"
,
MsgLevel
.
alarm
);
else
if
(
labelFailReason
==
LabelFailReason
.
SuckerFailure
)
Msg
.
add
(
"标签吸取失败,请标签,关门后将自动重试"
,
MsgLevel
.
alarm
);
if
(
IOValue
(
IO_Type
.
LeftBackDoor_Check
).
Equals
(
IO_VALUE
.
LOW
)
||
IOValue
(
IO_Type
.
RightBackDoor_Check
).
Equals
(
IO_VALUE
.
LOW
))
{
LabelMoveInfo
.
NextMoveStep
(
MoveStep
.
Lbl_PrintFail_02
);
LabelMoveInfo
.
log
(
"维护门已打开"
);
}
break
;
case
MoveStep
.
Lbl_PrintFail_02
:
if
(
labelFailReason
==
LabelFailReason
.
SuckerFailure
)
Msg
.
add
(
"标签打印失败,请检查打印机状态,关门后将自动重试"
,
MsgLevel
.
alarm
);
else
if
(
labelFailReason
==
LabelFailReason
.
SuckerFailure
)
Msg
.
add
(
"标签吸取失败,请标签,关门后将自动重试"
,
MsgLevel
.
alarm
);
if
(
IOValue
(
IO_Type
.
LeftBackDoor_Check
).
Equals
(
IO_VALUE
.
HIGH
)
&&
IOValue
(
IO_Type
.
RightBackDoor_Check
).
Equals
(
IO_VALUE
.
LOW
))
{
LabelMoveInfo
.
NextMoveStep
(
MoveStep
.
Lbl_PrintLabel
);
LabelMoveInfo
.
log
(
"维护门已关闭"
);
}
break
;
case
MoveStep
.
Lbl_Printted
:
case
MoveStep
.
Lbl_Printted
:
LabelMoveInfo
.
NextMoveStep
(
MoveStep
.
Lbl03
);
LabelMoveInfo
.
NextMoveStep
(
MoveStep
.
Lbl03
);
IOMove
(
IO_Type
.
LabelCylinder_Work
,
IO_VALUE
.
HIGH
);
IOMove
(
IO_Type
.
LabelCylinder_Work
,
IO_VALUE
.
HIGH
);
...
@@ -108,26 +164,20 @@ namespace DeviceLibrary
...
@@ -108,26 +164,20 @@ namespace DeviceLibrary
if
(
IsLabelLeave
)
if
(
IsLabelLeave
)
{
{
LabelMoveInfo
.
NextMoveStep
(
MoveStep
.
Lbl
06
);
LabelMoveInfo
.
NextMoveStep
(
MoveStep
.
Lbl
10
);
LabelMoveInfo
.
log
(
"标签已经被取走"
);
LabelMoveInfo
.
log
(
"标签已经被取走"
);
}
}
else
else
{
{
LabelMoveInfo
.
NextMoveStep
(
MoveStep
.
Lbl_PrintFail
);
labelFailReason
=
LabelFailReason
.
SuckerFailure
;
LabelMoveInfo
.
log
(
"取标失败"
);
Msg
.
add
(
crc
.
GetString
(
"Res0122.62c858d3"
,
"标签取起失败!"
),
MsgLevel
.
alarm
);
Msg
.
add
(
crc
.
GetString
(
"Res0122.62c858d3"
,
"标签取起失败!"
),
MsgLevel
.
alarm
);
}
}
break
;
break
;
case
MoveStep
.
Lbl06
:
//if (LeftMoveInfo.MoveStep == MoveStep.L20_WaitLabel)
//{
LabelMoveInfo
.
NextMoveStep
(
MoveStep
.
Lbl10
);
//}
//else if (LabelMoveInfo.IsTimeOut(60))
//{
// LabelMoveInfo.log("等待左侧料串可贴标.");
//}
break
;
case
MoveStep
.
Lbl10
:
case
MoveStep
.
Lbl10
:
if
(!
Label_Y_Axis
.
IsSafe
(
Config
.
Label_Y_P3
,
out
string
msg
))
if
(!
Label_Y_Axis
.
IsSafe
(
Config
.
Label_Y_P3
,
out
msg
))
{
{
Msg
.
add
(
msg
,
MsgLevel
.
warning
);
Msg
.
add
(
msg
,
MsgLevel
.
warning
);
return
;
return
;
...
...
DeviceLibrary/AutoScanAndLabel/MainMachine _LeftProcess.cs
查看文件 @
95a3c3c
...
@@ -143,7 +143,7 @@ namespace DeviceLibrary
...
@@ -143,7 +143,7 @@ namespace DeviceLibrary
LeftMoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitTime
(
3000
));
LeftMoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitTime
(
3000
));
break
;
break
;
case
MoveStep
.
L55
:
case
MoveStep
.
L55
:
LeftMoveInfo
.
NextMoveStep
(
MoveStep
.
R
END
);
LeftMoveInfo
.
NextMoveStep
(
MoveStep
.
L
END
);
IOMove
(
IO_Type
.
LeftMoto_Reverse
,
IO_VALUE
.
HIGH
,
false
,
500
);
IOMove
(
IO_Type
.
LeftMoto_Reverse
,
IO_VALUE
.
HIGH
,
false
,
500
);
LeftMoveInfo
.
log
(
$
"电滚停止"
);
LeftMoveInfo
.
log
(
$
"电滚停止"
);
break
;
break
;
...
...
DeviceLibrary/AutoScanAndLabel/MainMachine _MiddleProcess.cs
查看文件 @
95a3c3c
...
@@ -121,35 +121,17 @@ namespace DeviceLibrary
...
@@ -121,35 +121,17 @@ namespace DeviceLibrary
}
}
else
if
(
LeftMoveInfo
.
MoveStep
==
MoveStep
.
L10_WaitReelPut
)
else
if
(
LeftMoveInfo
.
MoveStep
==
MoveStep
.
L10_WaitReelPut
)
{
{
if
(
clampTool
.
IsClamp
())
if
(
true
||
clampTool
.
IsClamp
())
{
{
//MiddleMoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.LeftArm_Check, IO_VALUE.HIGH));
if
(!
LabelMoveInfo
.
IsStep
(
MoveStep
.
Lbl_WaitPrintInfo
))
{
//调用标签打印
var
kv
=
MiddleMoveInfo
.
MoveParam
.
Keyword
.
Select
(
k
=>
$
"{k.Key}={k.Value}"
).
ToArray
();
LogUtil
.
info
(
"调用 PrintLabel 打印标签 StartPrintLabel ,["
+
string
.
Join
(
", "
,
kv
)
+
"] 开始"
);
string
labelName
=
ConfigHelper
.
Config
.
Get
(
Setting_Init
.
LabelName
);
MiddleMoveInfo
.
CanWhileCount
--;
if
(
RobotManage
.
printerHelper
.
Print
(
labelName
,
MiddleMoveInfo
.
MoveParam
.
Keyword
,
out
msg
))
{
MiddleMoveInfo
.
NextMoveStep
(
MoveStep
.
M08
);
UnifiedDataHandler
.
RecordPrintNg
(
false
,
true
,
out
string
[]
strarrys
);
//数据保存到共享文件夹
DataUploadUtil
.
LabelUpload
(
MiddleMoveInfo
.
MoveParam
.
Keyword
);
MiddleMoveInfo
.
log
(
"等待贴标流程空闲"
);
return
;
}
}
else
if
(
MiddleMoveInfo
.
CanWhileCount
<=
0
)
CurrentPrintInfo
=
MiddleMoveInfo
.
MoveParam
.
clone
();
{
LabelMoveInfo
.
NextMoveStep
(
MoveStep
.
Lbl_PrintLabel
);
RobotManage
.
UserPause
(
"打印失败超过五次,机器暂停,请检查打印机;"
);
Msg
.
add
(
msg
,
MsgLevel
.
warning
);
}
else
{
Msg
.
add
(
msg
,
MsgLevel
.
warning
);
}
Take_Middle_Axis
.
AbsMove
(
MiddleMoveInfo
,
Config
.
Take_Middle_P3
,
Config
.
Take_Middle_P3_speed
);
Take_Middle_Axis
.
AbsMove
(
MiddleMoveInfo
,
Config
.
Take_Middle_P3
,
Config
.
Take_Middle_P3_speed
);
MiddleMoveInfo
.
log
(
"左侧允许放料,旋转轴P3"
);
MiddleMoveInfo
.
log
(
"左侧允许放料,旋转轴P3"
);
LogUtil
.
info
(
"PrintLabel 打印标签 StartPrintLabel 结束 "
+
msg
);
}
}
else
else
{
{
...
...
DeviceLibrary/AutoScanAndLabel/MainMachine.cs
查看文件 @
95a3c3c
...
@@ -211,6 +211,7 @@ namespace DeviceLibrary
...
@@ -211,6 +211,7 @@ namespace DeviceLibrary
{
{
IsAlarm
=
true
;
IsAlarm
=
true
;
}
}
if
(
mstart
&&
!
UserPause
)
Msg
.
clear
();
Msg
.
clear
();
}
}
}
}
...
...
DeviceLibrary/AutoScanAndLabel/MoveStep.cs
查看文件 @
95a3c3c
...
@@ -100,10 +100,14 @@ namespace DeviceLibrary
...
@@ -100,10 +100,14 @@ namespace DeviceLibrary
Lbl_StartPrint
,
Lbl_StartPrint
,
Lbl_WaitPrint
,
Lbl_WaitPrint
,
Lbl_PrintFail
,
Lbl_PrintFail_02
,
Lbl_Printted
,
Lbl_Printted
,
Lbl01
,
Lbl01
,
Lbl02
,
Lbl02
,
Lbl02_1
,
Lbl02_1
,
Lbl_WaitPrintInfo
,
Lbl_PrintLabel
,
Lbl03
,
Lbl03
,
Lbl04
,
Lbl04
,
Lbl05
,
Lbl05
,
...
...
dll/IDHIKCamera.dll
查看文件 @
95a3c3c
此文件类型无法预览
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论