Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
刘韬
/
SO20031_TinStorage
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit ec715035
由
刘韬
编写于
2025-03-13 10:02:49 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
1
1 个父辈
b0ebb49a
隐藏空白字符变更
内嵌
并排
正在显示
6 个修改的文件
包含
46 行增加
和
28 行删除
DeviceLibrary/theMachine/MainMachine_Labeling.cs
DeviceLibrary/theMachine/MainMachine_RFIDSelftest.cs
DeviceLibrary/theMachine/MainMachine_Store.cs
DeviceLibrary/theMachine/MoveStep.cs
DeviceLibrary/theMachine/RobotManage.cs
TheMachine/IOControls.cs
DeviceLibrary/theMachine/MainMachine_Labeling.cs
查看文件 @
ec71503
...
@@ -145,7 +145,7 @@ namespace DeviceLibrary
...
@@ -145,7 +145,7 @@ namespace DeviceLibrary
{
{
LabelingMoveInfo
.
log
(
"在线程中检测到打印完成"
);
LabelingMoveInfo
.
log
(
"在线程中检测到打印完成"
);
Task
.
Delay
(
2000
).
Wait
();
Task
.
Delay
(
2000
).
Wait
();
CylinderMove
(
null
,
IO_Type
.
Label_Dock_Back
,
IO_Type
.
Label_Dock_Front
,
IO_VALUE
.
LOW
);
//
CylinderMove(null, IO_Type.Label_Dock_Back, IO_Type.Label_Dock_Front, IO_VALUE.LOW);
IOMove
(
IO_Type
.
Label_TakeBlow
,
IO_VALUE
.
HIGH
,
false
,
1000
);
IOMove
(
IO_Type
.
Label_TakeBlow
,
IO_VALUE
.
HIGH
,
false
,
1000
);
break
;
break
;
}
}
...
@@ -261,30 +261,37 @@ namespace DeviceLibrary
...
@@ -261,30 +261,37 @@ namespace DeviceLibrary
break
;
break
;
case
MoveStep
.
Labeling12
:
case
MoveStep
.
Labeling12
:
LabelingMoveInfo
.
NextMoveStep
(
MoveStep
.
Labeling13
);
LabelingMoveInfo
.
NextMoveStep
(
MoveStep
.
Labeling13
);
CylinderMove
(
LabelingMoveInfo
,
IO_Type
.
Label_Dock_Back
,
IO_Type
.
Label_Dock_Front
,
IO_VALUE
.
LOW
);
if
(
Setting_Init
.
Module_No
.
Val
==
Module_SO
.
SO20031
)
LabelingMoveInfo
.
log
(
"开始贴标流程"
);
{
CylinderMove
(
LabelingMoveInfo
,
IO_Type
.
Label_Dock_Back
,
IO_Type
.
Label_Dock_Front
,
IO_VALUE
.
LOW
);
LabelingMoveInfo
.
log
(
"开始贴标流程"
);
}
break
;
break
;
case
MoveStep
.
Labeling13
:
case
MoveStep
.
Labeling13
:
if
(
CameraPointTest
.
TestHasLabelOnDock
(
true
))
if
(
CameraPointTest
.
TestHasLabelOnDock
(
true
))
{
{
LabelingMoveInfo
.
NextMoveStep
(
MoveStep
.
Labeling14
);
LabelingMoveInfo
.
NextMoveStep
(
MoveStep
.
Labeling14
);
CylinderMove
(
LabelingMoveInfo
,
IO_Type
.
Label_Dock_
Down
,
IO_Type
.
Label_Dock_Up
,
IO_VALUE
.
HIGH
);
CylinderMove
(
LabelingMoveInfo
,
IO_Type
.
Label_Dock_
Back
,
IO_Type
.
Label_Dock_Front
,
IO_VALUE
.
LOW
);
LabelingMoveInfo
.
log
(
"接标台
上升
"
);
LabelingMoveInfo
.
log
(
"接标台
后退
"
);
}
}
else
if
(
LabelingMoveInfo
.
IsTimeOut
(
2
))
{
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
.
Labeling13_1
);
CylinderMove
(
LabelingMoveInfo
,
IO_Type
.
Label_Dock_Down
,
IO_Type
.
Label_Dock_Up
,
IO_VALUE
.
LOW
);
CylinderMove
(
LabelingMoveInfo
,
IO_Type
.
Label_Dock_Back
,
IO_Type
.
Label_Dock_Front
,
IO_VALUE
.
HIGH
);
CylinderMove
(
LabelingMoveInfo
,
IO_Type
.
Labeling_Left
,
IO_Type
.
Labeling_Right
,
IO_VALUE
.
HIGH
);
//LabelingMoveInfo.WaitList.Add(WaitResultInfo.WaitTime(3000));
//LabelingMoveInfo.MoveParam.IsNg = true;
//Setting_Init.Runtime_Posid = "NG";
//LabelingMoveInfo.MoveParam.NgMsg = crc.GetString("Res0173.8a024375","没有检测到打印出的标签");
RobotManage
.
UserPause
(
crc
.
GetString
(
"Res0173.8a024375"
,
"没有检测到打印出的标签"
));
RobotManage
.
UserPause
(
crc
.
GetString
(
"Res0173.8a024375"
,
"没有检测到打印出的标签"
));
}
}
break
;
break
;
case
MoveStep
.
Labeling13_1
:
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_Back
,
IO_Type
.
Label_Dock_Front
,
IO_VALUE
.
HIGH
);
CylinderMove
(
LabelingMoveInfo
,
IO_Type
.
Labeling_Left
,
IO_Type
.
Labeling_Right
,
IO_VALUE
.
HIGH
);
break
;
case
MoveStep
.
Labeling14
:
case
MoveStep
.
Labeling14
:
LabelingMoveInfo
.
NextMoveStep
(
MoveStep
.
Labeling14_1
);
CylinderMove
(
LabelingMoveInfo
,
IO_Type
.
Label_Dock_Down
,
IO_Type
.
Label_Dock_Up
,
IO_VALUE
.
HIGH
);
LabelingMoveInfo
.
log
(
"接标台上升"
);
break
;
case
MoveStep
.
Labeling14_1
:
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
)
if
(
Setting_Init
.
Module_No
.
Val
==
Module_SO
.
SO20031
)
...
...
DeviceLibrary/theMachine/MainMachine_RFIDSelftest.cs
查看文件 @
ec71503
...
@@ -149,7 +149,7 @@ namespace DeviceLibrary
...
@@ -149,7 +149,7 @@ namespace DeviceLibrary
}
}
}
}
if
(!
issame
)
{
if
(!
issame
)
{
if
(
RobotManage
.
RFID2
.
ReadEPC
(
16
,
out
data
))
if
(
RobotManage
.
RFID2
!=
null
&&
RobotManage
.
RFID2
.
ReadEPC
(
16
,
out
data
))
{
{
if
(
data
[
0
]
!=
0xFF
)
if
(
data
[
0
]
!=
0xFF
)
{
{
...
...
DeviceLibrary/theMachine/MainMachine_Store.cs
查看文件 @
ec71503
...
@@ -246,7 +246,7 @@ namespace DeviceLibrary
...
@@ -246,7 +246,7 @@ namespace DeviceLibrary
StoreMoveInfo
.
MoveParam
.
RFID
=
StoreMoveInfo
.
MoveParam
.
RFID
.
Substring
(
0
,
16
);
StoreMoveInfo
.
MoveParam
.
RFID
=
StoreMoveInfo
.
MoveParam
.
RFID
.
Substring
(
0
,
16
);
bool
writeok
=
false
;
bool
writeok
=
false
;
var
r
=
RobotManage
.
RFID
.
ReOpen
();
var
r
=
RobotManage
.
RFID
.
ReOpen
();
var
r1
=
RobotManage
.
RFID2
.
ReOpen
();
var
r1
=
RobotManage
.
RFID2
?
.
ReOpen
();
StoreMoveInfo
.
log
(
"连接rfid:"
+
r
+
"rfid2:"
+
r1
);
StoreMoveInfo
.
log
(
"连接rfid:"
+
r
+
"rfid2:"
+
r1
);
for
(
int
i
=
0
;
i
<
15
;
i
++)
for
(
int
i
=
0
;
i
<
15
;
i
++)
{
{
...
@@ -274,7 +274,7 @@ namespace DeviceLibrary
...
@@ -274,7 +274,7 @@ namespace DeviceLibrary
}
}
}
}
}
}
if
(!
writeok
)
{
if
(!
writeok
&&
RobotManage
.
RFID2
!=
null
)
{
RobotManage
.
RFID2
.
WriteByte
(
550
,
new
byte
[]
{
0x40
,
0x00
});
RobotManage
.
RFID2
.
WriteByte
(
550
,
new
byte
[]
{
0x40
,
0x00
});
Thread
.
Sleep
(
300
);
Thread
.
Sleep
(
300
);
RobotManage
.
RFID2
.
WriteEPC
(
Encoding
.
ASCII
.
GetBytes
(
epc
));
RobotManage
.
RFID2
.
WriteEPC
(
Encoding
.
ASCII
.
GetBytes
(
epc
));
...
@@ -503,7 +503,7 @@ namespace DeviceLibrary
...
@@ -503,7 +503,7 @@ namespace DeviceLibrary
}
}
}
}
}
}
if
(!
issame
)
if
(!
issame
&&
RobotManage
.
RFID2
!=
null
)
{
{
if
(
RobotManage
.
RFID2
.
ReadEPC
(
16
,
out
data
))
if
(
RobotManage
.
RFID2
.
ReadEPC
(
16
,
out
data
))
{
{
...
...
DeviceLibrary/theMachine/MoveStep.cs
查看文件 @
ec71503
...
@@ -126,7 +126,9 @@ namespace DeviceLibrary
...
@@ -126,7 +126,9 @@ namespace DeviceLibrary
Labeling11
,
Labeling11
,
Labeling12
,
Labeling12
,
Labeling13
,
Labeling13
,
Labeling13_1
,
Labeling14
,
Labeling14
,
Labeling14_1
,
Labeling15
,
Labeling15
,
Labeling16
,
Labeling16
,
Labeling50
,
Labeling50
,
...
...
DeviceLibrary/theMachine/RobotManage.cs
查看文件 @
ec71503
...
@@ -183,14 +183,22 @@ namespace DeviceLibrary
...
@@ -183,14 +183,22 @@ namespace DeviceLibrary
LogUtil
.
info
(
"RFID连接成功,IP:"
+
Setting_Init
.
Device_RFID_IP
);
LogUtil
.
info
(
"RFID连接成功,IP:"
+
Setting_Init
.
Device_RFID_IP
);
RFID2
.
IP
=
Setting_Init
.
Device_RFID_IP2
;
RFID2
.
IP
=
Setting_Init
.
Device_RFID_IP2
;
RFID2
.
Open
(
Setting_Init
.
Device_RFID_IP2
);
if
(
string
.
IsNullOrWhiteSpace
(
RFID2
.
IP
))
if
(!
RFID2
.
IsConn
)
{
{
IsLoadOk
=
false
;
LogUtil
.
info
(
"RFID2未配置"
)
;
msg
+=
crc
.
GetString
(
"Res0142"
,
"RFID2连接失败,IP:"
)
+
$
"{Setting_Init.Device_RFID_IP2}\n"
;
RFID2
=
null
;
}
}
else
else
LogUtil
.
info
(
"RFID2连接成功,IP:"
+
Setting_Init
.
Device_RFID_IP2
);
{
RFID2
.
Open
(
Setting_Init
.
Device_RFID_IP2
);
if
(!
RFID2
.
IsConn
)
{
IsLoadOk
=
false
;
msg
+=
crc
.
GetString
(
"Res0142"
,
"RFID2连接失败,IP:"
)
+
$
"{Setting_Init.Device_RFID_IP2}\n"
;
}
else
LogUtil
.
info
(
"RFID2连接成功,IP:"
+
Setting_Init
.
Device_RFID_IP2
);
}
//RFID.AntennaPower = 4;
//RFID.AntennaPower = 4;
IOManager
.
IOMove
(
IO_Type
.
Camera_Led
,
IO_VALUE
.
HIGH
);
IOManager
.
IOMove
(
IO_Type
.
Camera_Led
,
IO_VALUE
.
HIGH
);
...
...
TheMachine/IOControls.cs
查看文件 @
ec71503
...
@@ -157,7 +157,7 @@ namespace TheMachine
...
@@ -157,7 +157,7 @@ namespace TheMachine
private
void
button9_Click
(
object
sender
,
EventArgs
e
)
private
void
button9_Click
(
object
sender
,
EventArgs
e
)
{
{
var
r
=
RobotManage
.
RFID
.
ReOpen
();
var
r
=
RobotManage
.
RFID
.
ReOpen
();
RobotManage
.
RFID2
.
ReOpen
();
RobotManage
.
RFID2
?
.
ReOpen
();
LogUtil
.
info
(
"RFID.ReOpen:"
+
r
);
LogUtil
.
info
(
"RFID.ReOpen:"
+
r
);
for
(
int
i
=
0
;
i
<
6
;
i
++)
{
for
(
int
i
=
0
;
i
<
6
;
i
++)
{
Thread
.
Sleep
(
200
);
Thread
.
Sleep
(
200
);
...
@@ -168,7 +168,7 @@ namespace TheMachine
...
@@ -168,7 +168,7 @@ namespace TheMachine
return
;
return
;
}
}
}
}
if
(
RobotManage
.
RFID2
.
ReadEPC
(
16
,
out
data
))
if
(
RobotManage
.
RFID2
!=
null
&&
RobotManage
.
RFID2
.
ReadEPC
(
16
,
out
data
))
{
{
if
(
data
[
0
]
!=
0xFF
)
if
(
data
[
0
]
!=
0xFF
)
{
{
...
@@ -185,14 +185,15 @@ namespace TheMachine
...
@@ -185,14 +185,15 @@ namespace TheMachine
var
epc
=
InputBox
(
"Write EPC, maximum 16 words."
,
"Please enter EPC data, maximum 16 words."
,
""
);
var
epc
=
InputBox
(
"Write EPC, maximum 16 words."
,
"Please enter EPC data, maximum 16 words."
,
""
);
var
r
=
RobotManage
.
RFID
.
ReOpen
();
var
r
=
RobotManage
.
RFID
.
ReOpen
();
RobotManage
.
RFID2
.
ReOpen
();
RobotManage
.
RFID2
?
.
ReOpen
();
LogUtil
.
info
(
"RFID.ReOpen:"
+
r
+
",epc="
+
epc
);
LogUtil
.
info
(
"RFID.ReOpen:"
+
r
+
",epc="
+
epc
);
epc
=
epc
.
PadRight
(
16
);
epc
=
epc
.
PadRight
(
16
);
RobotManage
.
RFID
.
WriteByte
(
550
,
new
byte
[]
{
0x40
,
0x00
});
RobotManage
.
RFID
.
WriteByte
(
550
,
new
byte
[]
{
0x40
,
0x00
});
Thread
.
Sleep
(
300
);
Thread
.
Sleep
(
300
);
var
result
=
RobotManage
.
RFID
.
WriteEPC
(
Encoding
.
ASCII
.
GetBytes
(
epc
));
var
result
=
RobotManage
.
RFID
.
WriteEPC
(
Encoding
.
ASCII
.
GetBytes
(
epc
));
result
=
RobotManage
.
RFID2
.
WriteEPC
(
Encoding
.
ASCII
.
GetBytes
(
epc
));
if
(
result
)
var
result2
=
RobotManage
.
RFID2
?.
WriteEPC
(
Encoding
.
ASCII
.
GetBytes
(
epc
));
if
(
result
||
result2
.
GetValueOrDefault
())
{
{
MessageBox
.
Show
(
crc
.
GetString
(
"Res0144"
,
"写入成功"
));
MessageBox
.
Show
(
crc
.
GetString
(
"Res0144"
,
"写入成功"
));
return
;
return
;
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论