Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
孙克
/
RC1250-AssemblyLine
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit 0ddfd175
由
LN
编写于
2019-12-17 08:48:53 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
io模块增加重连。皮带线修改
1 个父辈
8ad7ddd9
隐藏空白字符变更
内嵌
并排
正在显示
16 个修改的文件
包含
806 行增加
和
314 行删除
source/AssemblyLineClient/FrmDischargeLine.Designer.cs
source/AssemblyLineClient/FrmDischargeLine.cs
source/AssemblyLineClient/记录.txt
source/DeviceLibrary/DeviceLibrary.csproj
source/DeviceLibrary/LineConfig/Config_DischargeLine_1.csv
source/DeviceLibrary/LineConfig/Config_DischargeLine_2.csv
source/DeviceLibrary/assemblyLine/DischargeLine.cs
source/DeviceLibrary/assemblyLine/DischargeLine_Partial.cs
source/DeviceLibrary/assemblyLine/EquipBase.cs
source/DeviceLibrary/assemblyLine/LineBean.cs
source/DeviceLibrary/assemblyLine/OutTrayLineBean.cs
source/DeviceLibrary/assemblyLine/ProvidingEquip_Partial.cs
source/DeviceLibrary/deviceLibrary/IO/AIOBOX/AIOBOXManager.cs
source/DeviceLibrary/model/LineMoveInfo.cs
source/DeviceLibrary/model/StoreStep.cs
source/LoadCVSLibrary/storeConfig/config/IO_Type.cs
source/AssemblyLineClient/FrmDischargeLine.Designer.cs
查看文件 @
0ddfd17
...
...
@@ -46,10 +46,11 @@
this
.
btnStart
=
new
System
.
Windows
.
Forms
.
Button
();
this
.
btnStop
=
new
System
.
Windows
.
Forms
.
Button
();
this
.
btnReset
=
new
System
.
Windows
.
Forms
.
Button
();
this
.
btn
OutStore
=
new
System
.
Windows
.
Forms
.
Button
();
this
.
btn
Line1Test
=
new
System
.
Windows
.
Forms
.
Button
();
this
.
tabControl1
=
new
System
.
Windows
.
Forms
.
TabControl
();
this
.
tabPage1
=
new
System
.
Windows
.
Forms
.
TabPage
();
this
.
groupBox2
=
new
System
.
Windows
.
Forms
.
GroupBox
();
this
.
btnLine2Test
=
new
System
.
Windows
.
Forms
.
Button
();
this
.
lblLineInfo
=
new
System
.
Windows
.
Forms
.
Label
();
this
.
btnStrart
=
new
System
.
Windows
.
Forms
.
Button
();
this
.
btnlineStop
=
new
System
.
Windows
.
Forms
.
Button
();
...
...
@@ -59,8 +60,8 @@
this
.
lblTrayNum
=
new
System
.
Windows
.
Forms
.
Label
();
this
.
lblInstoreList
=
new
System
.
Windows
.
Forms
.
Label
();
this
.
panel1
=
new
System
.
Windows
.
Forms
.
Panel
();
this
.
lblName
=
new
System
.
Windows
.
Forms
.
Label
();
this
.
btnScan
=
new
System
.
Windows
.
Forms
.
Button
();
this
.
lblName
=
new
System
.
Windows
.
Forms
.
Label
();
this
.
groupBox1
.
SuspendLayout
();
this
.
groupBox4
.
SuspendLayout
();
this
.
groupBox3
.
SuspendLayout
();
...
...
@@ -371,7 +372,7 @@
//
this
.
chbDebug
.
AutoSize
=
true
;
this
.
chbDebug
.
Font
=
new
System
.
Drawing
.
Font
(
"微软雅黑"
,
10.5F
,
System
.
Drawing
.
FontStyle
.
Regular
,
System
.
Drawing
.
GraphicsUnit
.
Point
,
((
byte
)(
134
)));
this
.
chbDebug
.
Location
=
new
System
.
Drawing
.
Point
(
764
,
20
);
this
.
chbDebug
.
Location
=
new
System
.
Drawing
.
Point
(
660
,
19
);
this
.
chbDebug
.
Name
=
"chbDebug"
;
this
.
chbDebug
.
Size
=
new
System
.
Drawing
.
Size
(
84
,
24
);
this
.
chbDebug
.
TabIndex
=
247
;
...
...
@@ -399,7 +400,7 @@
this
.
lblStoreStatus
.
Font
=
new
System
.
Drawing
.
Font
(
"微软雅黑"
,
10.5F
,
System
.
Drawing
.
FontStyle
.
Regular
,
System
.
Drawing
.
GraphicsUnit
.
Point
,
((
byte
)(
134
)));
this
.
lblStoreStatus
.
ForeColor
=
System
.
Drawing
.
Color
.
Green
;
this
.
lblStoreStatus
.
ImageAlign
=
System
.
Drawing
.
ContentAlignment
.
MiddleRight
;
this
.
lblStoreStatus
.
Location
=
new
System
.
Drawing
.
Point
(
869
,
22
);
this
.
lblStoreStatus
.
Location
=
new
System
.
Drawing
.
Point
(
761
,
21
);
this
.
lblStoreStatus
.
Name
=
"lblStoreStatus"
;
this
.
lblStoreStatus
.
Size
=
new
System
.
Drawing
.
Size
(
65
,
20
);
this
.
lblStoreStatus
.
TabIndex
=
245
;
...
...
@@ -411,7 +412,7 @@
this
.
btnStart
.
BackColor
=
System
.
Drawing
.
Color
.
White
;
this
.
btnStart
.
FlatStyle
=
System
.
Windows
.
Forms
.
FlatStyle
.
Flat
;
this
.
btnStart
.
Font
=
new
System
.
Drawing
.
Font
(
"微软雅黑"
,
10.5F
,
System
.
Drawing
.
FontStyle
.
Regular
,
System
.
Drawing
.
GraphicsUnit
.
Point
,
((
byte
)(
134
)));
this
.
btnStart
.
Location
=
new
System
.
Drawing
.
Point
(
190
,
1
2
);
this
.
btnStart
.
Location
=
new
System
.
Drawing
.
Point
(
190
,
1
1
);
this
.
btnStart
.
Name
=
"btnStart"
;
this
.
btnStart
.
Size
=
new
System
.
Drawing
.
Size
(
110
,
40
);
this
.
btnStart
.
TabIndex
=
86
;
...
...
@@ -424,7 +425,7 @@
this
.
btnStop
.
BackColor
=
System
.
Drawing
.
Color
.
White
;
this
.
btnStop
.
FlatStyle
=
System
.
Windows
.
Forms
.
FlatStyle
.
Flat
;
this
.
btnStop
.
Font
=
new
System
.
Drawing
.
Font
(
"微软雅黑"
,
10.5F
,
System
.
Drawing
.
FontStyle
.
Regular
,
System
.
Drawing
.
GraphicsUnit
.
Point
,
((
byte
)(
134
)));
this
.
btnStop
.
Location
=
new
System
.
Drawing
.
Point
(
30
5
,
12
);
this
.
btnStop
.
Location
=
new
System
.
Drawing
.
Point
(
30
4
,
11
);
this
.
btnStop
.
Name
=
"btnStop"
;
this
.
btnStop
.
Size
=
new
System
.
Drawing
.
Size
(
110
,
40
);
this
.
btnStop
.
TabIndex
=
87
;
...
...
@@ -438,7 +439,7 @@
this
.
btnReset
.
Enabled
=
false
;
this
.
btnReset
.
FlatStyle
=
System
.
Windows
.
Forms
.
FlatStyle
.
Flat
;
this
.
btnReset
.
Font
=
new
System
.
Drawing
.
Font
(
"微软雅黑"
,
10.5F
,
System
.
Drawing
.
FontStyle
.
Regular
,
System
.
Drawing
.
GraphicsUnit
.
Point
,
((
byte
)(
134
)));
this
.
btnReset
.
Location
=
new
System
.
Drawing
.
Point
(
4
20
,
12
);
this
.
btnReset
.
Location
=
new
System
.
Drawing
.
Point
(
4
18
,
11
);
this
.
btnReset
.
Name
=
"btnReset"
;
this
.
btnReset
.
Size
=
new
System
.
Drawing
.
Size
(
110
,
40
);
this
.
btnReset
.
TabIndex
=
95
;
...
...
@@ -446,19 +447,18 @@
this
.
btnReset
.
UseVisualStyleBackColor
=
false
;
this
.
btnReset
.
Click
+=
new
System
.
EventHandler
(
this
.
btnReset_Click
);
//
// btn
OutStore
// btn
Line1Test
//
this
.
btnOutStore
.
BackColor
=
System
.
Drawing
.
Color
.
White
;
this
.
btnOutStore
.
FlatStyle
=
System
.
Windows
.
Forms
.
FlatStyle
.
Flat
;
this
.
btnOutStore
.
Font
=
new
System
.
Drawing
.
Font
(
"微软雅黑"
,
9F
,
System
.
Drawing
.
FontStyle
.
Regular
,
System
.
Drawing
.
GraphicsUnit
.
Point
,
((
byte
)(
134
)));
this
.
btnOutStore
.
Location
=
new
System
.
Drawing
.
Point
(
648
,
11
);
this
.
btnOutStore
.
Name
=
"btnOutStore"
;
this
.
btnOutStore
.
Size
=
new
System
.
Drawing
.
Size
(
110
,
40
);
this
.
btnOutStore
.
TabIndex
=
101
;
this
.
btnOutStore
.
Text
=
"出料测试"
;
this
.
btnOutStore
.
UseVisualStyleBackColor
=
false
;
this
.
btnOutStore
.
Visible
=
false
;
this
.
btnOutStore
.
Click
+=
new
System
.
EventHandler
(
this
.
btnOutStore_Click
);
this
.
btnLine1Test
.
BackColor
=
System
.
Drawing
.
Color
.
White
;
this
.
btnLine1Test
.
FlatStyle
=
System
.
Windows
.
Forms
.
FlatStyle
.
Flat
;
this
.
btnLine1Test
.
Font
=
new
System
.
Drawing
.
Font
(
"微软雅黑"
,
9F
,
System
.
Drawing
.
FontStyle
.
Regular
,
System
.
Drawing
.
GraphicsUnit
.
Point
,
((
byte
)(
134
)));
this
.
btnLine1Test
.
Location
=
new
System
.
Drawing
.
Point
(
549
,
19
);
this
.
btnLine1Test
.
Name
=
"btnLine1Test"
;
this
.
btnLine1Test
.
Size
=
new
System
.
Drawing
.
Size
(
110
,
40
);
this
.
btnLine1Test
.
TabIndex
=
101
;
this
.
btnLine1Test
.
Text
=
"皮带线1测试"
;
this
.
btnLine1Test
.
UseVisualStyleBackColor
=
false
;
this
.
btnLine1Test
.
Click
+=
new
System
.
EventHandler
(
this
.
btnOutStore_Click
);
//
// tabControl1
//
...
...
@@ -492,10 +492,12 @@
//
this
.
groupBox2
.
Anchor
=
((
System
.
Windows
.
Forms
.
AnchorStyles
)(((
System
.
Windows
.
Forms
.
AnchorStyles
.
Bottom
|
System
.
Windows
.
Forms
.
AnchorStyles
.
Left
)
|
System
.
Windows
.
Forms
.
AnchorStyles
.
Right
)));
this
.
groupBox2
.
Controls
.
Add
(
this
.
btnLine2Test
);
this
.
groupBox2
.
Controls
.
Add
(
this
.
lblLineInfo
);
this
.
groupBox2
.
Controls
.
Add
(
this
.
btnStrart
);
this
.
groupBox2
.
Controls
.
Add
(
this
.
btnlineStop
);
this
.
groupBox2
.
Controls
.
Add
(
this
.
cmbLineType
);
this
.
groupBox2
.
Controls
.
Add
(
this
.
btnLine1Test
);
this
.
groupBox2
.
Location
=
new
System
.
Drawing
.
Point
(
497
,
449
);
this
.
groupBox2
.
Name
=
"groupBox2"
;
this
.
groupBox2
.
Size
=
new
System
.
Drawing
.
Size
(
793
,
72
);
...
...
@@ -503,12 +505,25 @@
this
.
groupBox2
.
TabStop
=
false
;
this
.
groupBox2
.
Text
=
"皮带转动测试"
;
//
// btnLine2Test
//
this
.
btnLine2Test
.
BackColor
=
System
.
Drawing
.
Color
.
White
;
this
.
btnLine2Test
.
FlatStyle
=
System
.
Windows
.
Forms
.
FlatStyle
.
Flat
;
this
.
btnLine2Test
.
Font
=
new
System
.
Drawing
.
Font
(
"微软雅黑"
,
9F
,
System
.
Drawing
.
FontStyle
.
Regular
,
System
.
Drawing
.
GraphicsUnit
.
Point
,
((
byte
)(
134
)));
this
.
btnLine2Test
.
Location
=
new
System
.
Drawing
.
Point
(
663
,
19
);
this
.
btnLine2Test
.
Name
=
"btnLine2Test"
;
this
.
btnLine2Test
.
Size
=
new
System
.
Drawing
.
Size
(
110
,
40
);
this
.
btnLine2Test
.
TabIndex
=
250
;
this
.
btnLine2Test
.
Text
=
"皮带线2测试"
;
this
.
btnLine2Test
.
UseVisualStyleBackColor
=
false
;
this
.
btnLine2Test
.
Click
+=
new
System
.
EventHandler
(
this
.
btnLine2Test_Click
);
//
// lblLineInfo
//
this
.
lblLineInfo
.
AutoSize
=
true
;
this
.
lblLineInfo
.
Font
=
new
System
.
Drawing
.
Font
(
"微软雅黑"
,
9F
,
System
.
Drawing
.
FontStyle
.
Regular
,
System
.
Drawing
.
GraphicsUnit
.
Point
,
((
byte
)(
134
)));
this
.
lblLineInfo
.
ImageAlign
=
System
.
Drawing
.
ContentAlignment
.
MiddleRight
;
this
.
lblLineInfo
.
Location
=
new
System
.
Drawing
.
Point
(
30
,
31
);
this
.
lblLineInfo
.
Location
=
new
System
.
Drawing
.
Point
(
8
,
31
);
this
.
lblLineInfo
.
Name
=
"lblLineInfo"
;
this
.
lblLineInfo
.
Size
=
new
System
.
Drawing
.
Size
(
68
,
17
);
this
.
lblLineInfo
.
TabIndex
=
280
;
...
...
@@ -519,7 +534,7 @@
this
.
btnStrart
.
BackColor
=
System
.
Drawing
.
Color
.
White
;
this
.
btnStrart
.
FlatStyle
=
System
.
Windows
.
Forms
.
FlatStyle
.
Flat
;
this
.
btnStrart
.
Font
=
new
System
.
Drawing
.
Font
(
"微软雅黑"
,
9F
,
System
.
Drawing
.
FontStyle
.
Regular
,
System
.
Drawing
.
GraphicsUnit
.
Point
,
((
byte
)(
134
)));
this
.
btnStrart
.
Location
=
new
System
.
Drawing
.
Point
(
296
,
22
);
this
.
btnStrart
.
Location
=
new
System
.
Drawing
.
Point
(
332
,
22
);
this
.
btnStrart
.
Name
=
"btnStrart"
;
this
.
btnStrart
.
Size
=
new
System
.
Drawing
.
Size
(
100
,
34
);
this
.
btnStrart
.
TabIndex
=
267
;
...
...
@@ -532,7 +547,7 @@
this
.
btnlineStop
.
BackColor
=
System
.
Drawing
.
Color
.
White
;
this
.
btnlineStop
.
FlatStyle
=
System
.
Windows
.
Forms
.
FlatStyle
.
Flat
;
this
.
btnlineStop
.
Font
=
new
System
.
Drawing
.
Font
(
"微软雅黑"
,
9F
,
System
.
Drawing
.
FontStyle
.
Regular
,
System
.
Drawing
.
GraphicsUnit
.
Point
,
((
byte
)(
134
)));
this
.
btnlineStop
.
Location
=
new
System
.
Drawing
.
Point
(
4
11
,
22
);
this
.
btnlineStop
.
Location
=
new
System
.
Drawing
.
Point
(
4
43
,
22
);
this
.
btnlineStop
.
Name
=
"btnlineStop"
;
this
.
btnlineStop
.
Size
=
new
System
.
Drawing
.
Size
(
100
,
34
);
this
.
btnlineStop
.
TabIndex
=
266
;
...
...
@@ -546,12 +561,14 @@
this
.
cmbLineType
.
Font
=
new
System
.
Drawing
.
Font
(
"微软雅黑"
,
10.5F
,
System
.
Drawing
.
FontStyle
.
Regular
,
System
.
Drawing
.
GraphicsUnit
.
Point
,
((
byte
)(
134
)));
this
.
cmbLineType
.
FormattingEnabled
=
true
;
this
.
cmbLineType
.
Items
.
AddRange
(
new
object
[]
{
"皮带线1运转测试"
,
"皮带线2运转测试"
,
"皮带线3运转测试"
});
this
.
cmbLineType
.
Location
=
new
System
.
Drawing
.
Point
(
113
,
25
);
"皮带线1运转-入口定位测试"
,
"皮带线2运转-入口定位测试"
,
"皮带线3运转测试"
,
"皮带线1运转-出口定位测试"
,
"皮带线2运转-出口定位测试"
});
this
.
cmbLineType
.
Location
=
new
System
.
Drawing
.
Point
(
91
,
25
);
this
.
cmbLineType
.
Name
=
"cmbLineType"
;
this
.
cmbLineType
.
Size
=
new
System
.
Drawing
.
Size
(
168
,
28
);
this
.
cmbLineType
.
Size
=
new
System
.
Drawing
.
Size
(
231
,
28
);
this
.
cmbLineType
.
TabIndex
=
0
;
//
// groupBox6
...
...
@@ -612,7 +629,6 @@
this
.
panel1
.
Controls
.
Add
(
this
.
lblName
);
this
.
panel1
.
Controls
.
Add
(
this
.
chbDebug
);
this
.
panel1
.
Controls
.
Add
(
this
.
lblStoreStatus
);
this
.
panel1
.
Controls
.
Add
(
this
.
btnOutStore
);
this
.
panel1
.
Controls
.
Add
(
this
.
btnStart
);
this
.
panel1
.
Controls
.
Add
(
this
.
btnStop
);
this
.
panel1
.
Controls
.
Add
(
this
.
btnReset
);
...
...
@@ -621,23 +637,12 @@
this
.
panel1
.
Size
=
new
System
.
Drawing
.
Size
(
1303
,
56
);
this
.
panel1
.
TabIndex
=
258
;
//
// lblName
//
this
.
lblName
.
BackColor
=
System
.
Drawing
.
Color
.
DodgerBlue
;
this
.
lblName
.
Font
=
new
System
.
Drawing
.
Font
(
"微软雅黑"
,
12F
,
System
.
Drawing
.
FontStyle
.
Regular
,
System
.
Drawing
.
GraphicsUnit
.
Point
,
((
byte
)(
134
)));
this
.
lblName
.
ForeColor
=
System
.
Drawing
.
Color
.
Black
;
this
.
lblName
.
Location
=
new
System
.
Drawing
.
Point
(
5
,
12
);
this
.
lblName
.
Name
=
"lblName"
;
this
.
lblName
.
Size
=
new
System
.
Drawing
.
Size
(
180
,
40
);
this
.
lblName
.
TabIndex
=
248
;
this
.
lblName
.
TextAlign
=
System
.
Drawing
.
ContentAlignment
.
MiddleCenter
;
//
// btnScan
//
this
.
btnScan
.
BackColor
=
System
.
Drawing
.
Color
.
White
;
this
.
btnScan
.
FlatStyle
=
System
.
Windows
.
Forms
.
FlatStyle
.
Flat
;
this
.
btnScan
.
Font
=
new
System
.
Drawing
.
Font
(
"微软雅黑"
,
9F
,
System
.
Drawing
.
FontStyle
.
Regular
,
System
.
Drawing
.
GraphicsUnit
.
Point
,
((
byte
)(
134
)));
this
.
btnScan
.
Location
=
new
System
.
Drawing
.
Point
(
53
4
,
11
);
this
.
btnScan
.
Location
=
new
System
.
Drawing
.
Point
(
53
2
,
11
);
this
.
btnScan
.
Name
=
"btnScan"
;
this
.
btnScan
.
Size
=
new
System
.
Drawing
.
Size
(
110
,
40
);
this
.
btnScan
.
TabIndex
=
249
;
...
...
@@ -645,6 +650,17 @@
this
.
btnScan
.
UseVisualStyleBackColor
=
false
;
this
.
btnScan
.
Click
+=
new
System
.
EventHandler
(
this
.
btnScan_Click
);
//
// lblName
//
this
.
lblName
.
BackColor
=
System
.
Drawing
.
Color
.
DodgerBlue
;
this
.
lblName
.
Font
=
new
System
.
Drawing
.
Font
(
"微软雅黑"
,
12F
,
System
.
Drawing
.
FontStyle
.
Regular
,
System
.
Drawing
.
GraphicsUnit
.
Point
,
((
byte
)(
134
)));
this
.
lblName
.
ForeColor
=
System
.
Drawing
.
Color
.
Black
;
this
.
lblName
.
Location
=
new
System
.
Drawing
.
Point
(
5
,
11
);
this
.
lblName
.
Name
=
"lblName"
;
this
.
lblName
.
Size
=
new
System
.
Drawing
.
Size
(
180
,
40
);
this
.
lblName
.
TabIndex
=
248
;
this
.
lblName
.
TextAlign
=
System
.
Drawing
.
ContentAlignment
.
MiddleCenter
;
//
// FrmDischargeLine
//
this
.
AutoScaleDimensions
=
new
System
.
Drawing
.
SizeF
(
7F
,
17F
);
...
...
@@ -693,7 +709,7 @@
private
System
.
Windows
.
Forms
.
Button
btnStart
;
private
System
.
Windows
.
Forms
.
Button
btnStop
;
private
System
.
Windows
.
Forms
.
Button
btnReset
;
private
System
.
Windows
.
Forms
.
Button
btn
OutStore
;
private
System
.
Windows
.
Forms
.
Button
btn
Line1Test
;
private
System
.
Windows
.
Forms
.
CheckBox
chbDebug
;
private
System
.
Windows
.
Forms
.
Button
btnStop1Up
;
private
System
.
Windows
.
Forms
.
TabControl
tabControl1
;
...
...
@@ -723,6 +739,7 @@
private
System
.
Windows
.
Forms
.
ComboBox
cmbLineType
;
private
System
.
Windows
.
Forms
.
Label
lblLineInfo
;
private
System
.
Windows
.
Forms
.
Button
btnScan
;
private
System
.
Windows
.
Forms
.
Button
btnLine2Test
;
}
}
source/AssemblyLineClient/FrmDischargeLine.cs
查看文件 @
0ddfd17
...
...
@@ -22,17 +22,18 @@ namespace OnlineStore.AssemblyLine
{
internal
partial
class
FrmDischargeLine
:
FrmEquipBase
{
private
bool
IsLoad
=
false
;
private
DischargeLine
equipBean
;
private
bool
IsLoad
=
false
;
private
DischargeLine
equipBean
;
internal
FrmDischargeLine
(
DischargeLine
moveEquip
)
{
equipBase
=
moveEquip
;
dlineRun
=
new
LineTurnBean
(
equipBase
.
DeviceID
);
this
.
equipBean
=
moveEquip
;
Control
.
CheckForIllegalCrossThreadCalls
=
false
;
InitializeComponent
();
LoadIOList
();
}
private
void
LoadIOList
()
{
int
roleindex
=
0
;
...
...
@@ -65,7 +66,7 @@ namespace OnlineStore.AssemblyLine
cmbWriteIO
.
DisplayMember
=
"DisplayStr"
;
}
private
LineTurnBean
dlineRun
=
null
;
private
void
timer1_Tick
(
object
sender
,
EventArgs
e
)
{
try
...
...
@@ -74,13 +75,13 @@ namespace OnlineStore.AssemblyLine
{
return
;
}
if
(
this
.
Visible
)
if
(
this
.
Visible
)
{
ReadIOList
();
//lblTrayNum.Text = "托盘编码:" + TrayManager.GetTrayNum(equipBean.DeviceID);
}
cmbLineType
.
Enabled
=
!
equipBean
.
LineRuning
;
if
(
equipBean
.
LineRuning
)
cmbLineType
.
Enabled
=
!
dlineRun
.
InTurn
;
if
(
dlineRun
.
InTurn
)
{
lblLineInfo
.
Text
=
"线体运转中"
;
lblLineInfo
.
ForeColor
=
Color
.
Green
;
...
...
@@ -107,8 +108,8 @@ namespace OnlineStore.AssemblyLine
}
}
lblMoveInfo
.
Text
=
equipBean
.
GetMoveStr
();
// string canOut = LineManager.Line.CanOutStore(equipBean.DeviceID) ? "可出库":"不可出库" ;
lblStoreStatus
.
Text
=
KTK_Store
.
GetRunStr
(
equipBean
.
lineStatus
,
equipBean
.
runStatus
)
;
// string canOut = LineManager.Line.CanOutStore(equipBean.DeviceID) ? "可出库":"不可出库" ;
lblStoreStatus
.
Text
=
KTK_Store
.
GetRunStr
(
equipBean
.
lineStatus
,
equipBean
.
runStatus
);
lblThisSta
.
Text
=
equipBean
.
WarnMsg
;
//string text = "";
//List<InOutParam> ps = new List<InOutParam>(equipBean.waitOutStoreList);
...
...
@@ -124,9 +125,10 @@ namespace OnlineStore.AssemblyLine
//{
// lblInstoreList.Text = text;
//}
}
catch
(
Exception
ex
)
}
catch
(
Exception
ex
)
{
LogUtil
.
error
(
equipBean
.
Name
+
"界面定时器出错:"
+
ex
.
ToString
());
LogUtil
.
error
(
equipBean
.
Name
+
"界面定时器出错:"
+
ex
.
ToString
());
}
}
...
...
@@ -202,7 +204,7 @@ namespace OnlineStore.AssemblyLine
}
}
}
private
void
FrmStoreIOStatus_Load
(
object
sender
,
EventArgs
e
)
{
chbDebug
.
Checked
=
equipBean
.
IsDebug
;
...
...
@@ -226,20 +228,20 @@ namespace OnlineStore.AssemblyLine
ConfigIO
io
=
(
ConfigIO
)
cmbWriteIO
.
Items
[
e
.
Index
];
e
.
Graphics
.
DrawString
(
io
.
DisplayStr
,
e
.
Font
,
new
SolidBrush
(
e
.
ForeColor
),
e
.
Bounds
.
X
,
e
.
Bounds
.
Y
+
3
);
}
}
}
private
void
btnReadIO_Click
(
object
sender
,
EventArgs
e
)
{
ReadIOList
();
}
}
internal
override
void
FormStatus
(
bool
isStart
)
{
btnStart
.
Enabled
=
!
isStart
;
btnStop
.
Enabled
=
true
;
btnReset
.
Enabled
=
isStart
;
//btnInStore.Enabled = isStart;
btn
OutStore
.
Enabled
=
isStart
;
}
btn
Line1Test
.
Enabled
=
isStart
;
}
private
void
FrmIOStatus_Shown
(
object
sender
,
EventArgs
e
)
{
timer1
.
Start
();
...
...
@@ -248,16 +250,16 @@ namespace OnlineStore.AssemblyLine
private
void
btnStart_Click
(
object
sender
,
EventArgs
e
)
{
StartDebug
();
}
}
private
void
btnStop_Click
(
object
sender
,
EventArgs
e
)
{
StopRun
();
}
}
private
void
btnReset_Click
(
object
sender
,
EventArgs
e
)
{
Reset
();
}
private
void
chbDebug_CheckedChanged
(
object
sender
,
EventArgs
e
)
{
if
(!
IsLoad
)
...
...
@@ -273,10 +275,10 @@ namespace OnlineStore.AssemblyLine
if
(
result
.
Equals
(
DialogResult
.
Yes
))
{
equipBean
.
IsDebug
=
true
;
equipBean
.
Config
.
IsDebug
=
1
;
equipBean
.
Config
.
IsDebug
=
1
;
LineManager
.
SaveDischargeLineConfig
(
equipBean
.
Config
);
equipBean
.
ChangeDebug
(
true
);
LogUtil
.
info
(
equipBean
.
Name
+
"用户切换到调试状态 "
);
LogUtil
.
info
(
equipBean
.
Name
+
"用户切换到调试状态 "
);
}
}
}
...
...
@@ -298,22 +300,15 @@ namespace OnlineStore.AssemblyLine
}
private
void
btnOutStore_Click
(
object
sender
,
EventArgs
e
)
{
if
(
equipBean
.
runStatus
.
Equals
(
LineRunStatus
.
Runing
))
{
equipBean
.
StartOutStoreMove
(
new
InOutParam
(
));
}
else
{
bool
result
=
equipBean
.
TrayLine1
.
StartOut
(
new
InOutParam
(
0
,
"CodeTest"
,
"1#AC1_1_1"
,
8
,
7
));
if
(!
result
)
{
MessageBox
.
Show
(
"
未启动或不在空闲中,无法入库测试!
"
);
MessageBox
.
Show
(
"
皮带线1出库测试失败
"
);
}
}
}
private
void
btnCloseAll_Click
(
object
sender
,
EventArgs
e
)
{
{
foreach
(
Control
con
in
groupBox5
.
Controls
)
{
if
(
con
is
Button
)
...
...
@@ -321,63 +316,73 @@ namespace OnlineStore.AssemblyLine
con
.
BackColor
=
BackColor
=
Color
.
White
;
}
}
foreach
(
ConfigIO
io
in
equipBase
.
baseConfig
.
DOList
.
Values
)
foreach
(
ConfigIO
io
in
equipBase
.
baseConfig
.
DOList
.
Values
)
{
IOManager
.
instance
.
WriteSingleDO
(
io
.
IO_IP
,
io
.
SlaveID
,
io
.
GetIOAddr
(),
IO_VALUE
.
LOW
);
}
}
private
void
btnStop1Up_Click
(
object
sender
,
EventArgs
e
)
{
BtnMove
(
btnStop1Up
,
"定位气缸上升"
,
"定位气缸下降"
,
IO_Type
.
SeparateDevice_Down
,
IO_Type
.
SeparateDevice_Up
);
BtnMove
(
btnStop1Up
,
"定位气缸上升"
,
"定位气缸下降"
,
IO_Type
.
SeparateDevice_Down
,
IO_Type
.
SeparateDevice_Up
);
}
private
void
btnRun1_Click
(
object
sender
,
EventArgs
e
)
{
{
BtnMove
(
btnRun1
,
"皮带线1运转"
,
"皮带线1停止"
,
IO_Type
.
DLine_Run1
);
}
private
void
btnRun2_Click
(
object
sender
,
EventArgs
e
)
{
BtnMove
(
btnRun2
,
"皮带线2运转"
,
"皮带线2停止"
,
IO_Type
.
DLine_Run2
);
BtnMove
(
btnRun2
,
"皮带线2运转"
,
"皮带线2停止"
,
IO_Type
.
DLine_Run2
);
}
private
void
btnRun3_Click
(
object
sender
,
EventArgs
e
)
{
BtnMove
(
btnRun3
,
"皮带线3运转"
,
"皮带线3停止"
,
IO_Type
.
DLine_Run3
);
BtnMove
(
btnRun3
,
"皮带线3运转"
,
"皮带线3停止"
,
IO_Type
.
DLine_Run3
);
}
private
void
btnSRun_Click
(
object
sender
,
EventArgs
e
)
{
{
BtnMove
(
btnSRun
,
"分盘装置电机1驱动"
,
"分盘装置电机1停止"
,
IO_Type
.
SeparateDevice_Run
);
}
private
void
btnStrart_Click
(
object
sender
,
EventArgs
e
)
{
if
(
equipBean
.
LineRuning
)
if
(
dlineRun
.
InTurn
)
{
MessageBox
.
Show
(
"线体已在运转中,请先点击停止"
);
return
;
}
int
index
=
cmbLineType
.
SelectedIndex
;
string
moveIo
=
IO_Type
.
DLine_Run1
;
string
waitIo
=
IO_Type
.
Location
_Check1
;
string
waitIo
=
IO_Type
.
ExitTray
_Check1
;
if
(
index
.
Equals
(
1
))
{
moveIo
=
IO_Type
.
DLine_Run2
;
waitIo
=
IO_Type
.
Location_Check2
;
waitIo
=
IO_Type
.
Entry
Location_Check2
;
}
else
if
(
index
.
Equals
(
2
))
{
{
moveIo
=
IO_Type
.
DLine_Run3
;
waitIo
=
IO_Type
.
Location_Check3
;
}
equipBean
.
StartLineRun
(
moveIo
,
waitIo
);
else
if
(
index
.
Equals
(
3
))
{
moveIo
=
IO_Type
.
DLine_Run1
;
waitIo
=
IO_Type
.
ExitLocation_Check1
;
}
else
if
(
index
.
Equals
(
4
))
{
moveIo
=
IO_Type
.
DLine_Run2
;
waitIo
=
IO_Type
.
ExitLocation_Check2
;
}
dlineRun
.
StartLineRun
(
moveIo
,
waitIo
);
cmbLineType
.
Enabled
=
false
;
}
private
void
btnlineStop_Click
(
object
sender
,
EventArgs
e
)
{
equipBea
n
.
StopLineRun
();
dlineRu
n
.
StopLineRun
();
}
private
void
btnScan_Click
(
object
sender
,
EventArgs
e
)
...
...
@@ -396,6 +401,16 @@ namespace OnlineStore.AssemblyLine
LogUtil
.
info
(
equipBean
.
Name
+
"扫码测试结果:"
+
msg
);
MessageBox
.
Show
(
equipBean
.
Name
+
"扫码测试结果:"
+
msg
);
}
private
void
btnLine2Test_Click
(
object
sender
,
EventArgs
e
)
{
bool
result
=
equipBean
.
TrayLine2
.
StartOut
(
new
InOutParam
(
0
,
"CodeTest"
,
"2#AC2_2_2"
,
8
,
7
));
if
(!
result
)
{
MessageBox
.
Show
(
"皮带线2出库测试失败"
);
}
}
}
}
...
...
source/AssemblyLineClient/记录.txt
查看文件 @
0ddfd17
...
...
@@ -47,5 +47,23 @@ D2(上料模块出口)
上料模块回原点之前链条先转
20191216
处理皮带线1和2的入口检测信号改为出口定位信号
出库皮带线处理
入口是否有料需要记录
皮带线转动五次后,料盘将会离开,则不需要转动了
最后一盘料的位置
=0,>5=0
需要放料:皮带线出口处必须无料,
转到到入口定位到位
放下料盘=1
转动到出库定位到位(转动一点)
判断出口处是否有料(转一工位=2),有料,等待皮带线3入口无料,且停止时转动到出口定位到位
无料,直接转动一个工位
判断出口处是否有料(转一工位=3),有料,等待皮带线3入口无料,且停止时转动到出口定位到位
无料,结束
\ No newline at end of file
source/DeviceLibrary/DeviceLibrary.csproj
查看文件 @
0ddfd17
...
...
@@ -67,6 +67,7 @@
<ItemGroup>
<Compile Include="agvClient\AgvClient.cs" />
<Compile Include="assemblyLine\FeedingEquip_OutStore.cs" />
<Compile Include="assemblyLine\OutTrayLineBean.cs" />
<Compile Include="assemblymanager\ALineManager.cs" />
<Compile Include="assemblyLine\DischargeLine.cs" />
<Compile Include="assemblyLine\DischargeLine_Partial.cs" />
...
...
source/DeviceLibrary/LineConfig/Config_DischargeLine_1.csv
查看文件 @
0ddfd17
...
...
@@ -4,16 +4,16 @@ PRO,0,扫码的相机名称(多个用#分隔),CameraNameList,Name1#Name1,,,,,
,,,,,,,,,
DI,0,出料皮带线体1急停,DLine_SuddenStop,0,PRO_AOI_IP_2,0,出料皮带线体1急停,X021,X021
DI,0,出料皮带线体1复位,DLine_Reset,1,PRO_AOI_IP_2,0,出料皮带线体1复位,X022,X022
DI,0,皮带线1
定位检测,Location_Check1,2,PRO_AOI_IP_2,0,皮带线1
定位检测,X023,X023
DI,0,皮带线1
入口料盘检测,EntryPosition_Check1,3,PRO_AOI_IP_2,0,皮带线1入口料盘
检测,X024,X024
DI,0,皮带线1出口料盘检测,Exit
Position
_Check1,4,PRO_AOI_IP_2,0,皮带线1出口料盘检测,X025,X025
DI,0,皮带线2
定位检测,Location_Check2,5,PRO_AOI_IP_2,0,皮带线2
定位检测,X026,X026
DI,0,皮带线2
入口料盘检测,EntryPosition_Check2,6,PRO_AOI_IP_2,0,皮带线2入口料盘
检测,X027,X027
DI,0,皮带线2出口料盘检测,Exit
Position
_Check2,7,PRO_AOI_IP_2,0,皮带线2出口料盘检测,X028,X028
DI,0,皮带线1
入口定位检测,EntryLocation_Check1,2,PRO_AOI_IP_2,0,皮带线1入口
定位检测,X023,X023
DI,0,皮带线1
出口定位检测,ExitLocation_Check1,3,PRO_AOI_IP_2,0,皮带线1出口定位
检测,X024,X024
DI,0,皮带线1出口料盘检测,Exit
Tray
_Check1,4,PRO_AOI_IP_2,0,皮带线1出口料盘检测,X025,X025
DI,0,皮带线2
入口定位检测,EntryLocation_Check2,5,PRO_AOI_IP_2,0,皮带线2入口
定位检测,X026,X026
DI,0,皮带线2
出口定位检测,ExitLocation_Check2,6,PRO_AOI_IP_2,0,皮带线2出口定位
检测,X027,X027
DI,0,皮带线2出口料盘检测,Exit
Tray
_Check2,7,PRO_AOI_IP_2,0,皮带线2出口料盘检测,X028,X028
DI,0,皮带线3定位检测,Location_Check3,8,PRO_AOI_IP_2,0,皮带线3定位检测,X029,X029
DI,0,皮带线3入口料盘检测,Entry
Position
_Check3,9,PRO_AOI_IP_2,0,皮带线3入口料盘检测,X030,X030
DI,0,皮带线3中间位置料盘检测,Middle
Position
_Check3,10,PRO_AOI_IP_2,0,皮带线3中间位置料盘检测,X031,X031
DI,0,皮带线3出口料盘检测,Exit
Position
_Check3,11,PRO_AOI_IP_2,0,皮带线3出口料盘检测,X032,X032
DI,0,皮带线3入口料盘检测,Entry
Tray
_Check3,9,PRO_AOI_IP_2,0,皮带线3入口料盘检测,X030,X030
DI,0,皮带线3中间位置料盘检测,Middle
Tray
_Check3,10,PRO_AOI_IP_2,0,皮带线3中间位置料盘检测,X031,X031
DI,0,皮带线3出口料盘检测,Exit
Tray
_Check3,11,PRO_AOI_IP_2,0,皮带线3出口料盘检测,X032,X032
DI,0,分盘装置1定位气缸上升端,SeparateDevice_Up,12,PRO_AOI_IP_2,0,分盘装置1定位气缸上升端,X033,X033
DI,0,分盘装置1定位气缸下降端,SeparateDevice_Down,13,PRO_AOI_IP_2,0,分盘装置1定位气缸下降端,X034,X034
DI,0,分盘装置1料盘检测,SeparateDevice_Check,14,PRO_AOI_IP_2,0,分盘装置1料盘检测,X035,X035
...
...
source/DeviceLibrary/LineConfig/Config_DischargeLine_2.csv
查看文件 @
0ddfd17
...
...
@@ -4,16 +4,16 @@ PRO,0,扫码的相机名称(多个用#分隔),CameraNameList,Name1#Name1,,,,,
,,,,,,,,,
DI,0,出料皮带线体2急停,DLine_SuddenStop,0,PRO_AOI_IP_3,0,出料皮带线体2急停,X041,X041
DI,0,出料皮带线体2复位,DLine_Reset,1,PRO_AOI_IP_3,0,出料皮带线体2复位,X042,X042
DI,0,皮带线4
定位检测,Location_Check1,2,PRO_AOI_IP_3,0,皮带线4
定位检测,X043,X043
DI,0,皮带线4
入口料盘检测,EntryPosition_Check1,3,PRO_AOI_IP_3,0,皮带线4入口料盘
检测,X044,X044
DI,0,皮带线4出口料盘检测,Exit
Position
_Check1,4,PRO_AOI_IP_3,0,皮带线4出口料盘检测,X045,X045
DI,0,皮带线5定位检测,Location_Check2,5,PRO_AOI_IP_3,0,皮带线5定位检测,X046,X046
DI,0,皮带线5入口
料盘检测,EntryPosition_Check2,6,PRO_AOI_IP_3,0,皮带线5入口料盘
检测,X047,X047
DI,0,皮带线5出口
料盘检测,ExitPosition_Check2,7,PRO_AOI_IP_3,0,皮带线5出口料盘
检测,X048,X048
DI,0,皮带线4
入口定位检测,EntryLocation_Check1,2,PRO_AOI_IP_3,0,皮带线4入口
定位检测,X043,X043
DI,0,皮带线4
出口定位检测,ExitLocation_Check1,3,PRO_AOI_IP_3,0,皮带线4出口定位
检测,X044,X044
DI,0,皮带线4出口料盘检测,Exit
Tray
_Check1,4,PRO_AOI_IP_3,0,皮带线4出口料盘检测,X045,X045
DI,0,皮带线5定位检测,
Entry
Location_Check2,5,PRO_AOI_IP_3,0,皮带线5定位检测,X046,X046
DI,0,皮带线5入口
定位检测,ExitLocation_Check2,6,PRO_AOI_IP_3,0,皮带线5入口定位
检测,X047,X047
DI,0,皮带线5出口
定位检测,ExitTray_Check2,7,PRO_AOI_IP_3,0,皮带线5出口定位
检测,X048,X048
DI,0,皮带线6定位检测,Location_Check3,8,PRO_AOI_IP_3,0,皮带线6定位检测,X049,X049
DI,0,皮带线6入口料盘检测,Entry
Position
_Check3,9,PRO_AOI_IP_3,0,皮带线6入口料盘检测,X050,X050
DI,0,皮带线6中间位置料盘检测,Middle
Position
_Check3,10,PRO_AOI_IP_3,0,皮带线6中间位置料盘检测,X051,X051
DI,0,皮带线6出口料盘检测,Exit
Position
_Check3,11,PRO_AOI_IP_3,0,皮带线6出口料盘检测,X052,X052
DI,0,皮带线6入口料盘检测,Entry
Tray
_Check3,9,PRO_AOI_IP_3,0,皮带线6入口料盘检测,X050,X050
DI,0,皮带线6中间位置料盘检测,Middle
Tray
_Check3,10,PRO_AOI_IP_3,0,皮带线6中间位置料盘检测,X051,X051
DI,0,皮带线6出口料盘检测,Exit
Tray
_Check3,11,PRO_AOI_IP_3,0,皮带线6出口料盘检测,X052,X052
DI,0,分盘装置2定位气缸上升端,SeparateDevice_Up,12,PRO_AOI_IP_3,0,分盘装置2定位气缸上升端,X053,X053
DI,0,分盘装置2定位气缸下降端,SeparateDevice_Down,13,PRO_AOI_IP_3,0,分盘装置2定位气缸下降端,X054,X054
DI,0,分盘装置1料盘检测,SeparateDevice_Check,14,PRO_AOI_IP_3,0,分盘装置1料盘检测,X055,X055
...
...
source/DeviceLibrary/assemblyLine/DischargeLine.cs
查看文件 @
0ddfd17
...
...
@@ -17,7 +17,11 @@ namespace OnlineStore.DeviceLibrary
{
public
DischargeLine_Config
Config
;
public
OutTrayLineBean
TrayLine1
=
null
;
public
OutTrayLineBean
TrayLine2
=
null
;
internal
LineTurnBean
Line3Turn
=
null
;
//皮带线3最后一盘料的位置
public
int
Line3LastTrayP
=
0
;
public
DischargeLine
(
string
cid
,
DischargeLine_Config
config
)
{
baseConfig
=
config
;
...
...
@@ -30,6 +34,10 @@ namespace OnlineStore.DeviceLibrary
UseAxis
=
false
;
MoveInfo
=
new
LineMoveInfo
(
DeviceID
,
"出料皮带线-"
+
DeviceID
+
"-MoveInfo"
);
SecondMoveInfo
=
new
LineMoveInfo
(
DeviceID
,
"出料皮带线-"
+
DeviceID
+
"-SecondMoveInfo"
);
int
id
=
DeviceID
%
100
;
TrayLine1
=
new
OutTrayLineBean
(
"皮带线-"
+
(
id
-
1
)
*
3
+
1
,
IO_Type
.
EntryLocation_Check1
,
IO_Type
.
ExitLocation_Check1
,
IO_Type
.
ExitTray_Check1
,
IO_Type
.
DLine_Run1
,
IO_Type
.
EntryTray_Check3
,
this
);
TrayLine2
=
new
OutTrayLineBean
(
"皮带线-"
+
(
id
-
1
)
*
3
+
2
,
IO_Type
.
EntryLocation_Check2
,
IO_Type
.
ExitLocation_Check2
,
IO_Type
.
ExitTray_Check2
,
IO_Type
.
DLine_Run2
,
IO_Type
.
MiddleTray_Check3
,
this
);
Line3Turn
=
new
LineTurnBean
(
DeviceID
);
}
/// <summary>
...
...
@@ -49,7 +57,6 @@ namespace OnlineStore.DeviceLibrary
runStatus
=
LineRunStatus
.
HomeMoving
;
LogInfo
(
"开始原点返回: (重置灯状态,关闭所有皮带线,定位气缸下降 )开始"
);
MoveInfo
.
NewMove
(
LineMoveType
.
ReturnHome
);
StopLineRun
();
StartReset
();
if
(
isDebug
)
{
...
...
@@ -129,7 +136,11 @@ namespace OnlineStore.DeviceLibrary
runStatus
=
LineRunStatus
.
Busy
;
MoveInfo
.
EndMove
();
SecondMoveInfo
.
EndMove
();
StopLineRun
();
TrayLine1
.
StopRun
();
TrayLine2
.
StopRun
();
Line3Turn
.
StopLineRun
();
LogInfo
(
"停止运动:(定位气缸下降,皮带线停转 )开始 "
);
CylinderMove
(
null
,
IO_Type
.
SeparateDevice_Up
,
IO_Type
.
SeparateDevice_Down
);
...
...
@@ -193,50 +204,66 @@ namespace OnlineStore.DeviceLibrary
}
BusyMoveProcess
();
//判断流水线打开了才可以运行
if
(
TrayLine1
.
MoveInfo
.
MoveType
.
Equals
(
LineMoveType
.
OutStore
))
{
TrayLine1
.
OutStoreProcess
();
}
if
(
TrayLine2
.
MoveInfo
.
MoveType
.
Equals
(
LineMoveType
.
OutStore
))
{
TrayLine2
.
OutStoreProcess
();
}
//判断流水线打开了才可以运行
if
(
runStatus
.
Equals
(
LineRunStatus
.
Runing
)
&&
NoAlarm
())
{
//判断皮带线3出口是否有料
if
(
IOValue
(
IO_Type
.
ExitPosition_Check3
).
Equals
(
IO_VALUE
.
HIGH
))
{
//开始扫码然后送出料盘
//1.扫码,
//2.从服务器获取尺寸
//3.顶升或下降定位气缸
//皮带线3转动,分料皮带转动,
//等待料盘到达工位。
}
//皮带线3出口无料
else
if
(
IOValue
(
IO_Type
.
ExitPosition_Check3
).
Equals
(
IO_VALUE
.
LOW
)
&&
LineRuning
.
Equals
(
false
))
{
//判断是否需要入库
if
(
IOValue
(
IO_Type
.
ExitPosition_Check3
).
Equals
(
IO_VALUE
.
LOW
)
&&
LineRuning
.
Equals
(
false
))
if
(
MoveInfo
.
MoveType
.
Equals
(
LineMoveType
.
None
))
{
//皮带线3出口有料,分盘定位装置无料
if
(
IOValue
(
IO_Type
.
ExitTray_Check3
).
Equals
(
IO_VALUE
.
HIGH
)
&&
IOValue
(
IO_Type
.
SeparateDevice_Check
).
Equals
(
IO_VALUE
.
LOW
))
{
//
皮带3入口或者中间有料盘,出口无料盘,转动皮带三
if
((
IOValue
(
IO_Type
.
ExitPosition_Check3
).
Equals
(
IO_VALUE
.
HIGH
)
||
IOValue
(
IO_Type
.
MiddlePosition_Check3
).
Equals
(
IO_VALUE
.
HIGH
)))
{
StartLineRun
(
IO_Type
.
DLine_Run3
,
IO_Type
.
Location_Check3
);
}
}
//
开始扫码然后送出料盘
//1.扫码,
//2.从服务器获取尺寸
//3.顶升或下降定位气缸
//皮带线3转动,分料皮带转动,
//等待料盘到达工位。
StartOutStoreMove
(
new
InOutParam
());
}
}
else
if
(
IOValue
(
IO_Type
.
EntryPosition_Check3
).
Equals
(
IO_VALUE
.
LOW
)
&&
LineRuning
.
Equals
(
false
)
&&
MoveInfo
.
MoveType
.
Equals
(
LineMoveType
.
None
))
//判断皮带线3出口无料,皮带线无操作
if
(
MoveInfo
.
MoveType
.
Equals
(
LineMoveType
.
None
)
&&
TrayLine1
.
Line3CanRun
&&
TrayLine2
.
Line3CanRun
&&
IOValue
(
IO_Type
.
ExitTray_Check3
).
Equals
(
IO_VALUE
.
LOW
)
&&
Line3LastTrayP
<
11
)
{
if
((
IOValue
(
IO_Type
.
ExitPosition_Check1
).
Equals
(
IO_VALUE
.
HIGH
)
||
IOValue
(
IO_Type
.
ExitPosition_Check1
).
Equals
(
IO_VALUE
.
HIGH
)))
{
StartLineRun
(
IO_Type
.
DLine_Run1
,
IO_Type
.
Location_Check1
);
}
//判断皮带三还有料盘,需要转动一个工位
LogInfo
(
"皮带线3空闲,且流水线还有料盘,转动一个工位"
);
Line3Turn
.
StartLineRun
(
IO_Type
.
DLine_Run3
,
IO_Type
.
Location_Check3
);
}
else
if
(
IOValue
(
IO_Type
.
MiddlePosition_Check3
).
Equals
(
IO_VALUE
.
LOW
)
&&
LineRuning
.
Equals
(
false
)
&&
SecondMoveInfo
.
MoveType
.
Equals
(
LineMoveType
.
None
))
//皮带线3出口无料
if
(
TrayLine1
.
MoveInfo
.
MoveType
.
Equals
(
LineMoveType
.
None
)
&&
Line3Turn
.
InTurn
.
Equals
(
false
)
&&
TrayLine1
.
LastTrayPosition
>
0
&&
TrayLine1
.
LastTrayPosition
<
5
&&
IOValue
(
IO_Type
.
EntryTray_Check3
).
Equals
(
IO_VALUE
.
LOW
))
{
if
((
IOValue
(
IO_Type
.
ExitPosition_Check2
).
Equals
(
IO_VALUE
.
HIGH
)
||
IOValue
(
IO_Type
.
ExitPosition_Check2
).
Equals
(
IO_VALUE
.
HIGH
)))
{
StartLineRun
(
IO_Type
.
DLine_Run2
,
IO_Type
.
Location_Check2
);
}
TrayLine1
.
LineStartTurn
();
}
//皮带1皮带2先转动,到达位置后,皮带3再转动
//皮带线3出口无料
if
(
TrayLine2
.
MoveInfo
.
MoveType
.
Equals
(
LineMoveType
.
None
)
&&
Line3Turn
.
InTurn
.
Equals
(
false
)
&&
TrayLine2
.
LastTrayPosition
>
0
&&
TrayLine2
.
LastTrayPosition
<
5
&&
IOValue
(
IO_Type
.
MiddleTray_Check3
).
Equals
(
IO_VALUE
.
LOW
))
{
TrayLine2
.
LineStartTurn
();
}
}
IOTimeOutProcess
();
...
...
source/DeviceLibrary/assemblyLine/DischargeLine_Partial.cs
查看文件 @
0ddfd17
...
...
@@ -11,8 +11,19 @@ namespace OnlineStore.DeviceLibrary
{
partial
class
DischargeLine
{
protected
override
bool
CheckWaitResult
(
LineMoveInfo
moveInfo
,
WaitResultInfo
wait
)
{
if
(
wait
.
WaitType
.
Equals
(
WaitEnum
.
W301_DLineScanCode
))
{
if
(
LastCodeList
.
Count
>
0
)
{
return
true
;
}
}
return
false
;
}
#
region
是否可移栽料盘
internal
bool
CanStartOut
(
int
lineNum
)
{
...
...
@@ -22,26 +33,27 @@ namespace OnlineStore.DeviceLibrary
}
if
(
lineNum
.
Equals
(
1
))
{
if
(
LineRuning
.
Equals
(
true
)
&&
LastMoveDO
.
Equals
(
IO_Type
.
DLine_Run1
))
{
return
false
;
}
if
(
MoveInfo
.
MoveType
.
Equals
(
LineMoveType
.
None
)&&
IOValue
(
IO_Type
.
EntryPosition_Check1
).
Equals
(
IO_VALUE
.
LOW
))
{
MoveInfo
.
NewMove
(
LineMoveType
.
OutStore
);
return
true
;
}
}
else
if
(
lineNum
.
Equals
(
2
))
//if (LineRuning.Equals(true) && LastMoveDO.Equals(IO_Type.DLine_Run1))
//{
// return false;
//}
//if (MoveInfo.MoveType.Equals(LineMoveType.None)&& IOValue(IO_Type.ent).Equals(IO_VALUE.LOW))
//{
// MoveInfo.NewMove(LineMoveType.OutStore);
// return true;
//}
}
else
if
(
lineNum
.
Equals
(
2
))
{
if
(
LineRuning
.
Equals
(
true
)
&&
LastMoveDO
.
Equals
(
IO_Type
.
DLine_Run2
))
{
return
false
;
}
if
(
SecondMoveInfo
.
MoveType
.
Equals
(
LineMoveType
.
None
)
&&
IOValue
(
IO_Type
.
EntryPosition
_Check2
).
Equals
(
IO_VALUE
.
LOW
))
{
SecondMoveInfo
.
NewMove
(
LineMoveType
.
OutStore
);
return
true
;
}
//
if (LineRuning.Equals(true) && LastMoveDO.Equals(IO_Type.DLine_Run2))
//
{
//
return false;
//
}
//if (SecondMoveInfo.MoveType.Equals(LineMoveType.None) && IOValue(IO_Type.EntryTray
_Check2).Equals(IO_VALUE.LOW))
//
{
//
SecondMoveInfo.NewMove(LineMoveType.OutStore);
//
return true;
//
}
}
return
false
;
...
...
@@ -51,33 +63,29 @@ namespace OnlineStore.DeviceLibrary
#
region
料盘移栽处理
public
override
bool
StartOutStoreMove
(
InOutParam
param
)
{
string
posId
=
param
!=
null
?
param
.
PosId
:
""
;
//调试模式移栽装置不需要有操作
if
(
IsDebug
)
{
LogInfo
(
"需要出料【"
+
posId
+
"】处于调试模式,暂时不再进行出出料操作"
);
return
false
;
}
{
if
(
runStatus
.
Equals
(
LineRunStatus
.
Runing
))
{
runStatus
=
LineRunStatus
.
Busy
;
lineStatus
=
LineStatus
.
OutStoreExecute
;
MoveInfo
.
MoveParam
=
param
;
MoveInfo
.
NewMove
(
LineMoveType
.
OutStore
);
LogInfo
(
"
出料【"
+
posId
+
"】处理(移栽):(PO_01_UpDownCylinderDown,上下气缸1下降)
"
);
MoveInfo
.
NextMoveStep
(
LineMoveStep
.
PO_01_UpDownCylinderDown
);
LogInfo
(
"
检测到皮带线3出口有料,等待1000后扫码
"
);
MoveInfo
.
NextMoveStep
(
LineMoveStep
.
DO_01_WaitTime
);
MoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitTime
(
1000
));
CylinderMove
(
MoveInfo
,
IO_Type
.
UpDownCylinder_Up
,
IO_Type
.
UpDownCylinder_Down
);
LastCodeList
=
new
List
<
string
>();
LastHeight
=
0
;
LastWidth
=
0
;
return
true
;
}
else
{
LogUtil
.
error
(
Name
+
" 启动出料
【"
+
posId
+
"】
失败,当前 storeStatus="
+
runStatus
);
LogUtil
.
error
(
Name
+
" 启动出料失败,当前 storeStatus="
+
runStatus
);
return
false
;
}
}
private
List
<
string
>
LastCodeList
=
new
List
<
string
>();
private
int
LastHeight
=
0
;
private
int
LastWidth
=
0
;
protected
override
void
OutStoreProcess
()
{
if
(
MoveInfo
.
IsInWait
)
...
...
@@ -92,108 +100,91 @@ namespace OnlineStore.DeviceLibrary
{
return
;
}
string
posId
=
MoveInfo
.
MoveParam
!=
null
?
MoveInfo
.
MoveParam
.
PosId
:
""
;
if
(
MoveInfo
.
MoveStep
.
Equals
(
LineMoveStep
.
DL_R_LineCheck
))
{
}
else
if
(
MoveInfo
.
MoveStep
.
Equals
(
LineMoveStep
.
DL_R_LineCheck
))
if
(
MoveInfo
.
MoveStep
.
Equals
(
LineMoveStep
.
DO_01_WaitTime
))
{
LogInfo
(
"出料【"
+
posId
+
"】处理完成!"
);
runStatus
=
LineRunStatus
.
Runing
;
lineStatus
=
LineStatus
.
StoreOnline
;
MoveInfo
.
EndMove
();
}
}
#
endregion
public
bool
LineRuning
=
false
;
private
string
LastMoveDO
=
""
;
private
string
LastCheckDI
=
""
;
public
void
StopLineRun
()
{
if
(
LineRuning
)
{
LineRuning
=
false
;
}
}
public
void
StartLineRun
(
string
moveDO
,
string
checkDI
,
int
timeOutMS
=
30000
)
{
LineRuning
=
true
;
Task
.
Factory
.
StartNew
(
delegate
{
LineRunAndWait
(
moveDO
,
checkDI
,
timeOutMS
);
});
}
private
string
LineRunAndWait
(
string
moveDO
,
string
checkDI
,
int
timeOutMS
=
30000
)
{
LastMoveDO
=
moveDO
;
LastCheckDI
=
checkDI
;
LogInfo
(
"开始转动:"
+
moveDO
);
IOMove
(
moveDO
,
IO_VALUE
.
HIGH
);
LineRuning
=
true
;
DateTime
startTime
=
DateTime
.
Now
;
string
result
=
""
;
bool
isStop
=
false
;
//先等待信号灭一次,然后再亮时停止
while
(
true
)
{
Thread
.
Sleep
(
20
);
TimeSpan
span
=
DateTime
.
Now
-
startTime
;
if
(!
LineRuning
)
{
isStop
=
true
;
result
=
"停止运动"
;
}
else
if
(
span
.
TotalMilliseconds
>
timeOutMS
)
MoveInfo
.
NextMoveStep
(
LineMoveStep
.
DO_02_ScanCode
);
LogInfo
(
"检测到皮带线3出口有料,开始扫码"
);
MoveInfo
.
OneWaitCanEndStep
=
true
;
MoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitDLineScanCode
());
MoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitTime
(
6000
));
try
{
isStop
=
true
;
result
=
"转动超时"
;
}
//判断Buzy及位置是否结束
else
if
(
IOValue
(
checkDI
).
Equals
(
IO_VALUE
.
LOW
))
{
isStop
=
true
;
Task
<
List
<
string
>>
scanTask
=
Task
.
Factory
.
StartNew
(
delegate
{
LastCodeList
=
CodeManager
.
CameraScan
(
Config
.
GetCameraList
());
if
(
LastCodeList
.
Count
<=
0
)
{
LastCodeList
=
CodeManager
.
CameraScan
(
Config
.
GetCameraList
());
}
return
LastCodeList
;
});
}
if
(
isStop
)
catch
(
Exception
ex
)
{
LogInfo
(
"验证"
+
checkDI
+
"=Low结束:"
+
result
);
break
;
LogUtil
.
error
(
"FI_13_ScanCode扫码出错:"
+
ex
.
ToString
());
}
}
result
=
""
;
isStop
=
false
;
while
(
true
)
else
if
(
MoveInfo
.
MoveStep
.
Equals
(
LineMoveStep
.
DO_02_ScanCode
))
{
Thread
.
Sleep
(
20
);
TimeSpan
span
=
DateTime
.
Now
-
startTime
;
if
(!
LineRuning
)
{
isStop
=
true
;
result
=
"停止运动"
;
}
else
if
(
span
.
TotalMilliseconds
>
timeOutMS
)
MoveInfo
.
NextMoveStep
(
LineMoveStep
.
DO_03_GetTraySize
);
LogInfo
(
"检测到皮带线3出口有料,根据二维码从服务器获取料盘尺寸"
);
//TODO
LastWidth
=
7
;
LastHeight
=
8
;
}
else
if
(
MoveInfo
.
MoveStep
.
Equals
(
LineMoveStep
.
DO_03_GetTraySize
))
{
MoveInfo
.
NextMoveStep
(
LineMoveStep
.
DO_04_SeparateDeviceMove
);
if
(
LastWidth
.
Equals
(
7
))
{
isStop
=
true
;
result
=
"转动超时"
;
LogInfo
(
"检测到皮带线3出口有料,料盘尺寸【"
+
LastWidth
+
"X"
+
LastHeight
+
"】上升分盘定位气缸"
)
;
CylinderMove
(
MoveInfo
,
IO_Type
.
SeparateDevice_Down
,
IO_Type
.
SeparateDevice_Up
)
;
}
//判断Buzy及位置是否结束
else
if
(
IOValue
(
checkDI
).
Equals
(
IO_VALUE
.
HIGH
))
else
{
isStop
=
true
;
LogInfo
(
"检测到皮带线3出口有料,料盘尺寸【"
+
LastWidth
+
"X"
+
LastHeight
+
"】下降分盘定位气缸"
);
CylinderMove
(
MoveInfo
,
IO_Type
.
SeparateDevice_Up
,
IO_Type
.
SeparateDevice_Down
);
}
if
(
isStop
)
}
else
if
(
MoveInfo
.
MoveStep
.
Equals
(
LineMoveStep
.
DO_04_SeparateDeviceMove
))
{
if
(
TrayLine2
.
Line3CanRun
&&
TrayLine1
.
Line3CanRun
)
{
LogInfo
(
"停止运动:"
+
result
+
" "
+
moveDO
);
IOMove
(
moveDO
,
IO_VALUE
.
LOW
);
LineRuning
=
false
;
return
result
;
MoveInfo
.
NextMoveStep
(
LineMoveStep
.
DO_05_LineRun
);
LogInfo
(
"检测到皮带线3出口有料,转动皮带线,同时转动分盘装置"
);
IOMove
(
IO_Type
.
SeparateDevice_Run
,
IO_VALUE
.
HIGH
);
Line3Turn
.
StartLineRun
(
IO_Type
.
DLine_Run3
,
IO_Type
.
Location_Check3
);
MoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitTime
(
3000
));
MoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitIO
(
IO_Type
.
Location_Check3
,
IO_VALUE
.
HIGH
));
}
}
else
if
(
MoveInfo
.
MoveStep
.
Equals
(
LineMoveStep
.
DO_05_LineRun
))
{
MoveInfo
.
NextMoveStep
(
LineMoveStep
.
DO_06_Wait_SeparateDevice_Check
);
Line3LastTrayP
++;
LogInfo
(
"检测到皮带线3出口有料,等待料盘到达分盘装置位置"
);
MoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitTime
(
3000
));
MoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitIO
(
IO_Type
.
Location_Check3
,
IO_VALUE
.
HIGH
));
}
else
if
(
MoveInfo
.
MoveStep
.
Equals
(
LineMoveStep
.
DO_06_Wait_SeparateDevice_Check
))
{
MoveInfo
.
NextMoveStep
(
LineMoveStep
.
DO_06_Wait_SeparateDevice_Check
);
LogInfo
(
"检测到皮带线3出口有料,继续转动500"
);
IOMove
(
IO_Type
.
SeparateDevice_Run
,
IO_VALUE
.
HIGH
);
MoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitTime
(
500
));
}
else
if
(
MoveInfo
.
MoveStep
.
Equals
(
LineMoveStep
.
DO_07_CRun
))
{
runStatus
=
LineRunStatus
.
Runing
;
MoveInfo
.
EndMove
();
IOMove
(
IO_Type
.
SeparateDevice_Run
,
IO_VALUE
.
LOW
);
LogInfo
(
"检测到皮带线3出口有料,送料结束,停止皮带线"
);
}
}
#
endregion
}
}
source/DeviceLibrary/assemblyLine/EquipBase.cs
查看文件 @
0ddfd17
...
...
@@ -89,14 +89,10 @@ namespace OnlineStore.DeviceLibrary
break
;
case
LineMoveType
.
ReturnHome
:
ResetProcess
();
break
;
break
;
case
LineMoveType
.
Reset
:
ResetProcess
();
break
;
//case StoreMoveType.StopMove:
// StopMoveProcess();
// break;
break
;
default
:
break
;
}
if
(
MoveInfo
.
MoveType
==
LineMoveType
.
InStore
||
this
.
SecondMoveInfo
.
MoveType
==
LineMoveType
.
InStore
)
...
...
@@ -311,7 +307,7 @@ namespace OnlineStore.DeviceLibrary
protected
DateTime
preRWTime
=
DateTime
.
Now
;
protected
void
CheckWait
(
LineMoveInfo
moveInfo
)
internal
void
CheckWait
(
LineMoveInfo
moveInfo
)
{
List
<
WaitResultInfo
>
list
=
moveInfo
.
WaitList
;
if
(
list
.
Count
<=
0
)
...
...
@@ -522,7 +518,7 @@ namespace OnlineStore.DeviceLibrary
LogUtil
.
info
(
Name
+
" "
+
"["
+
posId
+
"] "
+
msg
);
}
}
public
string
GetMoveStr
()
public
string
GetMoveStr
()
{
string
msg
=
""
;
int
tLength
=
15
;
...
...
source/DeviceLibrary/assemblyLine/LineBean.cs
查看文件 @
0ddfd17
...
...
@@ -36,8 +36,7 @@ namespace OnlineStore.DeviceLibrary
public
Dictionary
<
int
,
FeedingEquip
>
FeedingEquipMap
{
get
;
set
;
}
public
Dictionary
<
int
,
ProvidingEquip
>
ProvidingEquipMap
{
get
;
set
;
}
public
Dictionary
<
int
,
DischargeLine
>
DisLineMap
{
get
;
set
;
}
public
Dictionary
<
int
,
DischargeLine
>
DisLineMap
{
get
;
set
;
}
public
Dictionary
<
int
,
EquipBase
>
AllEquipMap
{
get
;
set
;
}
/// <summary>
...
...
@@ -123,26 +122,26 @@ namespace OnlineStore.DeviceLibrary
cioList
=
new
List
<
string
>(
ioList
);
string
ids
=
ConfigAppSettings
.
GetValue
(
Setting_Init
.
DebugDeviceId
);
//
rfidList = new List<string>(DeviceConfig.ProRFIpMap.Values);
rfidList
=
new
List
<
string
>();
rfidList
=
new
List
<
string
>(
DeviceConfig
.
ProRFIpMap
.
Values
);
//
rfidList = new List<string>();
if
(
IsDebug
)
{
//rfidList = new List<string>() {
// "192.168.210.116","192.168.210.120","192.168.210.121"
//};
rfidList
=
new
List
<
string
>()
{
RFIDManager
.
GetRFIP
(
103
),
RFIDManager
.
GetRFIP
(
11
),
RFIDManager
.
GetRFIP
(
12
),
//
rfidList = new List<string>() {
//
RFIDManager.GetRFIP(103),
//
RFIDManager.GetRFIP(11),
//
RFIDManager.GetRFIP(12),
};
//
};
try
{
cioList
=
new
List
<
string
>();
string
[]
testDeviceIdList
=
ids
.
Split
(
','
);
foreach
(
string
str
in
testDeviceIdList
)
{
{
int
id
=
Convert
.
ToInt32
(
str
);
if
(
FeedingEquipMap
.
ContainsKey
(
id
))
{
...
...
@@ -163,7 +162,8 @@ namespace OnlineStore.DeviceLibrary
{
MoveEquip
equip
=
MoveEquipMap
[
id
];
cioList
.
AddRange
(
equip
.
Config
.
IOIPList
);
}
else
if
(
id
.
Equals
(
0
))
}
else
if
(
id
.
Equals
(
0
))
{
cioList
=
new
List
<
string
>();
cioList
.
AddRange
(
ioList
);
...
...
@@ -171,7 +171,7 @@ namespace OnlineStore.DeviceLibrary
"192.168.101.22"
,
"192.168.101.23"
};
foreach
(
string
s
in
removeList
)
foreach
(
string
s
in
removeList
)
{
if
(
cioList
.
Contains
(
s
))
{
...
...
source/DeviceLibrary/assemblyLine/OutTrayLineBean.cs
0 → 100644
查看文件 @
0ddfd17
using
OnlineStore.Common
;
using
OnlineStore.LoadCSVLibrary
;
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Text
;
using
System.Threading
;
using
System.Threading.Tasks
;
namespace
OnlineStore.DeviceLibrary
{
/// <summary>
/// 出料皮带线
/// </summary>
public
class
OutTrayLineBean
{
private
DischargeLine
equipBean
=
null
;
private
string
Line3_TrayCheck
=
""
;
//入口定位信号
private
string
EntryLocation_Check
=
""
;
//出口定位信号
private
string
ExitLocation_Check
=
""
;
//出口料盘检测信号
private
string
ExitTray_Check
=
""
;
//出口料盘检测信号
private
string
LineRun_Do
=
""
;
//最后一盘料的位置,>5时可置为0,0表示当前皮带线无料盘
public
int
LastTrayPosition
=
0
;
private
string
Name
=
""
;
private
LineTurnBean
lineRun
=
null
;
internal
LineMoveInfo
MoveInfo
=
null
;
internal
bool
Line3CanRun
=
false
;
public
OutTrayLineBean
(
string
name
,
string
entryLocationS
,
string
exitLocationS
,
string
exittrayS
,
string
lineRundo
,
string
line3checkDi
,
DischargeLine
equipBean
)
{
lineRun
=
new
LineTurnBean
(
equipBean
.
DeviceID
);
this
.
equipBean
=
equipBean
;
this
.
Name
=
name
;
MoveInfo
=
new
LineMoveInfo
(
1001
,
name
);
this
.
EntryLocation_Check
=
entryLocationS
;
this
.
ExitLocation_Check
=
exitLocationS
;
this
.
ExitTray_Check
=
exittrayS
;
this
.
LineRun_Do
=
lineRundo
;
this
.
Line3_TrayCheck
=
line3checkDi
;
}
public
void
StopRun
()
{
MoveInfo
.
EndMove
();
lineRun
.
StopLineRun
();
Line3CanRun
=
true
;
}
#
region
出库处理
private
string
posId
=
""
;
public
bool
StartOut
(
InOutParam
moveParam
)
{
if
(
MoveInfo
.
MoveType
.
Equals
(
LineMoveType
.
None
))
{
MoveInfo
.
MoveParam
=
moveParam
;
MoveInfo
.
NewMove
(
LineMoveType
.
OutStore
);
posId
=
MoveInfo
.
MoveParam
!=
null
?
MoveInfo
.
MoveParam
.
PosId
:
""
;
MoveInfo
.
NextMoveStep
(
LineMoveStep
.
DLO_01_WaitEntryNoTray
);
LogUtil
.
info
(
Name
+
"开始出料【"
+
moveParam
.
PosId
+
"】处理:"
+
MoveInfo
.
SLog
+
"等待入口无料盘"
);
MoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitTime
(
1000
));
return
true
;
}
else
{
LogUtil
.
error
(
Name
+
" 启动出料【"
+
moveParam
.
PosId
+
"】 失败"
);
return
false
;
}
}
internal
void
OutStoreProcess
()
{
if
(
MoveInfo
.
IsInWait
)
{
equipBean
.
CheckWait
(
MoveInfo
);
}
if
(
MoveInfo
.
IsInWait
)
{
return
;
}
if
(
MoveInfo
.
MoveStep
.
Equals
(
LineMoveStep
.
DLO_01_WaitEntryNoTray
))
{
MoveInfo
.
NextMoveStep
(
LineMoveStep
.
DLO_02_WaitExitNoTray
);
LogUtil
.
info
(
Name
+
"出料【"
+
posId
+
"】:"
+
MoveInfo
.
SLog
+
"等待出口无料盘"
);
MoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitTime
(
1000
));
}
else
if
(
MoveInfo
.
MoveStep
.
Equals
(
LineMoveStep
.
DLO_02_WaitExitNoTray
))
{
MoveInfo
.
NextMoveStep
(
LineMoveStep
.
DLO_03_LineRun
);
LogUtil
.
info
(
Name
+
"出料【"
+
posId
+
"】:"
+
MoveInfo
.
SLog
+
"入口出口都没有料盘,转动皮带线到入口定位亮"
);
MoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitTime
(
1000
));
lineRun
.
StartLineRun
(
LineRun_Do
,
EntryLocation_Check
);
}
else
if
(
MoveInfo
.
MoveStep
.
Equals
(
LineMoveStep
.
DLO_03_LineRun
))
{
if
(
lineRun
.
InTurn
.
Equals
(
false
))
{
LastTrayPosition
++;
MoveInfo
.
NextMoveStep
(
LineMoveStep
.
DLO_04_CanReviceTray
);
LogUtil
.
info
(
Name
+
"出料【"
+
posId
+
"】:"
+
MoveInfo
.
SLog
+
"可以放入料盘,------------等待移栽放下料盘--------"
);
if
(
equipBean
.
IsDebug
)
{
MoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitTime
(
1000
));
}
}
}
else
if
(
MoveInfo
.
MoveStep
.
Equals
(
LineMoveStep
.
DLO_04_CanReviceTray
))
{
if
(
equipBean
.
IsDebug
)
{
MoveInfo
.
NextMoveStep
(
LineMoveStep
.
DLO_05_TrayIsOk
);
LogUtil
.
info
(
Name
+
"出料【"
+
posId
+
"】:"
+
MoveInfo
.
SLog
+
"移栽放下料盘后更新为已放料盘"
);
MoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitTime
(
1000
));
}
}
else
if
(
MoveInfo
.
MoveStep
.
Equals
(
LineMoveStep
.
DLO_05_TrayIsOk
))
{
MoveInfo
.
NextMoveStep
(
LineMoveStep
.
DLO_06_LineRun_OutLocation_Check
);
LogUtil
.
info
(
Name
+
"出料【"
+
posId
+
"】:"
+
MoveInfo
.
SLog
+
"------------料盘已放下--------皮带线转动到出口定位信号亮"
);
LastTrayPosition
=
1
;
lineRun
.
StartLineRun
(
LineRun_Do
,
ExitLocation_Check
);
}
else
if
(
MoveInfo
.
MoveStep
.
Equals
(
LineMoveStep
.
DLO_06_LineRun_OutLocation_Check
))
{
if
(
lineRun
.
InTurn
.
Equals
(
false
))
{
DLO_07_LineRun
();
}
}
else
if
(
MoveInfo
.
MoveStep
.
Equals
(
LineMoveStep
.
DLO_07_LineRun
))
{
if
(
lineRun
.
InTurn
.
Equals
(
false
))
{
Line3CanRun
=
true
;
LastTrayPosition
++;
if
(
equipBean
.
IOValue
(
ExitTray_Check
).
Equals
(
IO_VALUE
.
HIGH
))
{
if
(
LastTrayPosition
>
5
)
{
MoveInfo
.
NextMoveStep
(
LineMoveStep
.
DLO_08_ExitNoTray
);
LogUtil
.
info
(
Name
+
"出料【"
+
posId
+
"】:"
+
MoveInfo
.
SLog
+
"最后一盘料位置【"
+
LastTrayPosition
+
"】,请检查"
+
ExitTray_Check
+
"信号是否正确"
);
}
else
{
DLO_07_LineRun
();
}
}
else
{
MoveInfo
.
NextMoveStep
(
LineMoveStep
.
DLO_08_ExitNoTray
);
}
}
}
else
if
(
MoveInfo
.
MoveStep
.
Equals
(
LineMoveStep
.
DLO_08_ExitNoTray
))
{
MoveInfo
.
EndMove
();
LogUtil
.
info
(
Name
+
"出料【"
+
posId
+
"】:出口无料盘,出库结束"
);
}
}
private
void
DLO_07_LineRun
()
{
if
(
equipBean
.
IOValue
(
ExitTray_Check
).
Equals
(
IO_VALUE
.
HIGH
))
{
//皮带线不转,并且入口无信号
if
(
equipBean
.
Line3Turn
.
InTurn
.
Equals
(
false
)
&&
equipBean
.
IOValue
(
Line3_TrayCheck
).
Equals
(
IO_VALUE
.
LOW
))
{
Line3CanRun
=
false
;
if
(
Line3_TrayCheck
.
Equals
(
IO_Type
.
EntryTray_Check3
))
{
equipBean
.
Line3LastTrayP
=
1
;
}
}
else
{
return
;
}
}
MoveInfo
.
NextMoveStep
(
LineMoveStep
.
DLO_07_LineRun
);
LogUtil
.
info
(
Name
+
"出料【"
+
posId
+
"】:"
+
MoveInfo
.
SLog
+
"最后一盘料位置【"
+
LastTrayPosition
+
"】,出口有料盘,继续转动一个工位"
);
lineRun
.
StartLineRun
(
LineRun_Do
,
ExitLocation_Check
);
}
public
void
LineStartTurn
()
{
LogUtil
.
info
(
Name
+
"转动一个工位"
);
lineRun
.
StartLineRun
(
LineRun_Do
,
ExitLocation_Check
);
LastTrayPosition
++;
}
#
endregion
}
public
class
LineTurnBean
{
public
bool
InTurn
=
false
;
private
string
LastMoveDO
=
""
;
private
string
LastCheckDI
=
""
;
private
int
subType
=
0
;
public
LineTurnBean
(
int
subType
)
{
this
.
subType
=
subType
;
}
public
void
StopLineRun
()
{
if
(
InTurn
)
{
InTurn
=
false
;
}
}
public
void
StartLineRun
(
string
moveDO
,
string
checkDI
,
int
timeOutMS
=
30000
)
{
InTurn
=
true
;
Task
.
Factory
.
StartNew
(
delegate
{
LineRunAndWait
(
moveDO
,
checkDI
,
timeOutMS
);
});
}
private
string
LineRunAndWait
(
string
moveDO
,
string
checkDI
,
int
timeOutMS
=
30000
)
{
LastMoveDO
=
moveDO
;
LastCheckDI
=
checkDI
;
LogUtil
.
info
(
"开始转动:"
+
moveDO
);
IOManager
.
IOMove
(
moveDO
,
IO_VALUE
.
HIGH
,
subType
);
InTurn
=
true
;
DateTime
startTime
=
DateTime
.
Now
;
string
result
=
""
;
bool
isStop
=
false
;
//先等待信号灭一次,然后再亮时停止
while
(
true
)
{
Thread
.
Sleep
(
20
);
TimeSpan
span
=
DateTime
.
Now
-
startTime
;
if
(!
InTurn
)
{
isStop
=
true
;
result
=
"停止运动"
;
}
else
if
(
span
.
TotalMilliseconds
>
timeOutMS
)
{
isStop
=
true
;
result
=
"转动超时"
;
}
//判断Buzy及位置是否结束
else
if
(
IOManager
.
IOValue
(
checkDI
,
subType
).
Equals
(
IO_VALUE
.
LOW
))
{
isStop
=
true
;
}
if
(
isStop
)
{
LogUtil
.
info
(
"验证"
+
checkDI
+
"=Low结束:"
+
result
);
break
;
}
}
result
=
""
;
isStop
=
false
;
while
(
true
)
{
Thread
.
Sleep
(
20
);
TimeSpan
span
=
DateTime
.
Now
-
startTime
;
if
(!
InTurn
)
{
isStop
=
true
;
result
=
"停止运动"
;
}
else
if
(
span
.
TotalMilliseconds
>
timeOutMS
)
{
isStop
=
true
;
result
=
"转动超时"
;
}
//判断Buzy及位置是否结束
else
if
(
IOManager
.
IOValue
(
checkDI
,
subType
).
Equals
(
IO_VALUE
.
HIGH
))
{
isStop
=
true
;
}
if
(
isStop
)
{
LogUtil
.
info
(
"停止运动:"
+
result
+
" "
+
moveDO
);
IOManager
.
IOMove
(
moveDO
,
IO_VALUE
.
LOW
,
subType
);
InTurn
=
false
;
return
result
;
}
}
}
}
}
source/DeviceLibrary/assemblyLine/ProvidingEquip_Partial.cs
查看文件 @
0ddfd17
...
...
@@ -299,7 +299,7 @@ namespace OnlineStore.DeviceLibrary
if
(
MoveInfo
.
MoveStep
.
Equals
(
LineMoveStep
.
PO_01_UpDownCylinderDown
))
{
MoveInfo
.
NextMoveStep
(
LineMoveStep
.
PO_02_UpDownCylinderDownWait
);
OutLog
(
"出库 "
+
MoveInfo
.
SLog
+
" : 上下气缸1下降后等待0.3秒再夹紧"
);
OutLog
(
"出库 "
+
MoveInfo
.
SLog
+
" : 上下气缸1下降后等待0.3秒再夹紧"
);
MoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitTime
(
300
));
}
//只有当BOX可以进行出出料时,移栽物品,防止卡住
...
...
@@ -312,9 +312,27 @@ namespace OnlineStore.DeviceLibrary
else
if
(
MoveInfo
.
MoveStep
.
Equals
(
LineMoveStep
.
PO_03_ClampCylinderSlack
))
{
MoveInfo
.
NextMoveStep
(
LineMoveStep
.
PO_04_UpDownCylinderUp
);
OutLog
(
"出库 "
+
MoveInfo
.
SLog
+
" : 上下气缸上升
)
"
);
OutLog
(
"出库 "
+
MoveInfo
.
SLog
+
" : 上下气缸上升
,同时出库皮带线开始出库准备
"
);
// CylinderMove(MoveInfo, IO_Type.UpDownCylinder_Down, IO_Type.UpDownCylinder_Up);
UpdownUpMove
();
int
id
=
DeviceID
%
100
;
if
(
id
.
Equals
(
1
))
{
LineManager
.
Line
.
DisLineMap
[
301
].
TrayLine1
.
StartOut
(
MoveInfo
.
MoveParam
);
}
else
if
(
id
.
Equals
(
2
))
{
LineManager
.
Line
.
DisLineMap
[
301
].
TrayLine2
.
StartOut
(
MoveInfo
.
MoveParam
);
}
else
if
(
id
.
Equals
(
3
))
{
LineManager
.
Line
.
DisLineMap
[
302
].
TrayLine1
.
StartOut
(
MoveInfo
.
MoveParam
);
}
else
if
(
id
.
Equals
(
4
))
{
LineManager
.
Line
.
DisLineMap
[
302
].
TrayLine2
.
StartOut
(
MoveInfo
.
MoveParam
);
}
}
else
if
(
MoveInfo
.
MoveStep
.
Equals
(
LineMoveStep
.
PO_04_UpDownCylinderUp
))
{
...
...
source/DeviceLibrary/deviceLibrary/IO/AIOBOX/AIOBOXManager.cs
查看文件 @
0ddfd17
...
...
@@ -68,6 +68,24 @@ namespace OnlineStore.DeviceLibrary
lastTime
=
DateTime
.
Now
;
try
{
//判断是否还在连接
foreach
(
AIOBOX
box
in
AIOMap
.
Values
)
{
if
(!
box
.
IsConn
)
{
if
(
IoIPLIst
.
Contains
(
box
.
IP
).
Equals
(
false
))
{
LogUtil
.
info
(
"IO模块【"
+
box
.
IP
+
"】已断开,加入集合等待重连"
);
IoIPLIst
.
Add
(
box
.
IP
);
}
}
}
}
catch
(
Exception
ex
)
{
LogUtil
.
error
(
"AOI 判断是否需要重连 出错"
+
ex
.
ToString
());
}
try
{
List
<
string
>
list
=
new
List
<
string
>(
IoIPLIst
);
if
(
list
.
Count
>
0
)
{
...
...
@@ -559,8 +577,13 @@ namespace OnlineStore.DeviceLibrary
{
if
(
AIOMap
.
ContainsKey
(
ip
))
{
return
true
;
}
return
false
;
if
(
AIOMap
[
ip
].
IsConn
)
{
return
true
;
}
return
false
;
}
return
false
;
}
}
}
source/DeviceLibrary/model/LineMoveInfo.cs
查看文件 @
0ddfd17
...
...
@@ -318,12 +318,19 @@ namespace OnlineStore.DeviceLibrary
WaitResultInfo
wait
=
new
WaitResultInfo
();
wait
.
WaitType
=
WaitEnum
.
W102_FeedScanCode
;
return
wait
;
}
public
static
WaitResultInfo
WaitFeedNoMove
()
}
public
static
WaitResultInfo
WaitFeedNoMove
()
{
WaitResultInfo
wait
=
new
WaitResultInfo
();
wait
.
WaitType
=
WaitEnum
.
W103_FeedNoMove
;
return
wait
;
}
public
static
WaitResultInfo
WaitDLineScanCode
()
{
WaitResultInfo
wait
=
new
WaitResultInfo
();
wait
.
WaitType
=
WaitEnum
.
W301_DLineScanCode
;
return
wait
;
}
public
string
ToStr
()
{
if
(
WaitType
.
Equals
(
WaitEnum
.
W001_AxisMove
))
...
...
@@ -389,6 +396,10 @@ namespace OnlineStore.DeviceLibrary
{
return
"出料流水线可接收料盘"
;
}
else
if
(
WaitType
.
Equals
(
WaitEnum
.
W301_DLineScanCode
))
{
return
"出料皮带线扫码"
;
}
else
{
return
"Wait位置类型:WaitType=【"
+
WaitType
+
"】"
;
...
...
@@ -508,6 +519,10 @@ namespace OnlineStore.DeviceLibrary
/// 等待出料流水线可以接收料盘
/// </summary>
internal
static
int
W202_DLineCanOut
=
202
;
/// <summary>
///等待出料皮带线扫码结束
/// </summary>
internal
static
int
W301_DLineScanCode
=
301
;
}
public
enum
LineMoveType
{
...
...
source/DeviceLibrary/model/StoreStep.cs
查看文件 @
0ddfd17
...
...
@@ -933,6 +933,9 @@ namespace OnlineStore.DeviceLibrary
/// 前后气缸后退,等待4000
/// </summary>
PO_10_BeforeAfterCylinderAfter
=
20010
,
#
endregion
...
...
@@ -944,15 +947,82 @@ namespace OnlineStore.DeviceLibrary
/// <summary>
/// 转动皮带开始运行
/// </summary>
DL_R_StartRun
=
30002
,
DL_R_StartRun
=
30002
,
/// <summary>
/// 皮带线检测处理
/// </summary>
DL_R_LineCheck
=
30100
,
#
region
皮带线
3
送出料盘处理
/// <summary>
/// 出料皮带线开始扫码送出料盘,等待1000后扫码
/// </summary>
DO_01_WaitTime
=
30201
,
/// <summary>
/// 出料皮带线开始扫码送出料盘,开始扫码,等待扫码结果,最多等待6000
/// </summary>
DO_02_ScanCode
=
30202
,
/// <summary>
/// 出料皮带线开始扫码送出料盘,根据二维码从服务器获取料盘尺寸
/// </summary>
DO_03_GetTraySize
=
30203
,
/// <summary>
/// 出料皮带线开始扫码送出料盘,上升或下降分盘定位气缸
/// </summary>
DO_04_SeparateDeviceMove
=
30204
,
/// <summary>
/// 出料皮带线开始扫码送出料盘,转动皮带线,同时转动分盘装置
/// </summary>
DO_05_LineRun
=
30205
,
/// <summary>
/// 出料皮带线开始扫码送出料盘,等待料盘到达分盘装置位置
/// </summary>
DO_06_Wait_SeparateDevice_Check
=
30206
,
/// <summary>
/// 出料皮带线开始扫码送出料盘,到达后再转动500
/// </summary>
DO_07_CRun
=
30207
,
#
endregion
#
region
皮带线
12
接收料盘并转动处理
/// <summary>
/// 皮带线12处理料盘:需要放入料盘,等待入口无料盘
/// </summary>
DLO_01_WaitEntryNoTray
=
30301
,
/// <summary>
/// 皮带线12处理料盘:需要放入料盘,等待出口无料盘
/// </summary>
DLO_02_WaitExitNoTray
,
/// <summary>
/// 皮带线12处理料盘:入口出口都没有料盘,转动皮带线到入口定位亮
/// </summary>
DLO_03_LineRun
,
/// <summary>
/// 皮带线12处理料盘:可以放入料盘,等待移栽放下料盘
/// </summary>
DLO_04_CanReviceTray
,
/// <summary>
/// 皮带线12处理料盘:移栽放下料盘后更新为已放料盘
/// </summary>
DLO_05_TrayIsOk
,
/// <summary>
/// 皮带线12处理料盘:皮带线转动到出口定位信号亮
/// </summary>
DLO_06_LineRun_OutLocation_Check
,
/// <summary>
/// 皮带线12处理料盘:出库有料盘,继续转动一个工位,
/// </summary>
DLO_07_LineRun
,
/// <summary>
/// 皮带线12处理料盘:出口无料盘,结束,
/// </summary>
DLO_08_ExitNoTray
#
endregion
#
endregion
}
public
enum
LineAlarmType
...
...
source/LoadCVSLibrary/storeConfig/config/IO_Type.cs
查看文件 @
0ddfd17
...
...
@@ -269,48 +269,50 @@ namespace OnlineStore.LoadCSVLibrary
/// DI 出料皮带线体1复位 DLine_Reset X022
/// </summary>
public
static
string
DLine_Reset
=
"DLine_Reset"
;
/// <summary>
/// DI
,0,皮带线1定位检测,Location_Check1,2,PRO_AOI_IP_2,0,皮带线1定位检测,X023,
X023
/// DI
0 皮带线1入口定位检测 EntryLocation_Check1 2 PRO_AOI_IP_2 0 皮带线1入口定位检测 X023
X023
/// </summary>
public
static
string
Location_Check1
=
"
Location_Check1"
;
public
static
string
EntryLocation_Check1
=
"Entry
Location_Check1"
;
/// <summary>
/// DI
,0,皮带线1入口料盘检测, EntryPosition_Check1,3, PRO_AOI_IP_2,0, 皮带线1入口料盘检测, X024,
X024
/// DI
0 皮带线1出口定位检测 ExitLocation_Check1 3 PRO_AOI_IP_2 0 皮带线1出口定位检测 X024
X024
/// </summary>
public
static
string
E
ntryPosition_Check1
=
"EntryPosi
tion_Check1"
;
public
static
string
E
xitLocation_Check1
=
"ExitLoca
tion_Check1"
;
/// <summary>
/// DI
,0, 皮带线1出口料盘检测,ExitPosition_Check1,4,PRO_AOI_IP_2,0,皮带线1出口料盘检测,X025,
X025
/// DI
0 皮带线1出口料盘检测 ExitTray_Check1 4 PRO_AOI_IP_2 0 皮带线1出口料盘检测 X025
X025
/// </summary>
public
static
string
ExitPosition_Check1
=
"ExitPosition_Check1"
;
public
static
string
ExitTray_Check1
=
"ExitTray_Check1"
;
/// <summary>
/// DI,0,皮带线2
定位检测, Location_Check2,5, PRO_AOI_IP_2,0, 皮带线2定位检测, X026,
X026
/// DI,0,皮带线2
入口定位检测 EntryLocation_Check2 5 PRO_AOI_IP_2 0 皮带线2入口定位检测 X026
X026
/// </summary>
public
static
string
Location_Check2
=
"
Location_Check2"
;
public
static
string
EntryLocation_Check2
=
"Entry
Location_Check2"
;
/// <summary>
/// DI 皮带线2
入口料盘检测,EntryPosition_Check2,6,PRO_AOI_IP_2,0,皮带线2入口料盘检测,X027,
X027
/// DI 皮带线2
出口定位检测 ExitLocation_Check2 6 PRO_AOI_IP_2 0 皮带线2出口定位检测 X027
X027
/// </summary>
public
static
string
EntryPosition_Check2
=
" EntryPosi
tion_Check2"
;
public
static
string
ExitLocation_Check2
=
" ExitLoca
tion_Check2"
;
/// <summary>
/// DI 皮带线2出口料盘检测
, ExitPosition_Check2,7, PRO_AOI_IP_2,0, 皮带线2出口料盘检测, X028,
X028
/// DI 皮带线2出口料盘检测
ExitTray_Check2 7 PRO_AOI_IP_2 0 皮带线2出口料盘检测 X028
X028
/// </summary>
public
static
string
Exit
Position_Check2
=
"ExitPosition
_Check2"
;
public
static
string
Exit
Tray_Check2
=
"ExitTray
_Check2"
;
/// <summary>
/// DI 皮带线3定位检测,Location_Check3,8,PRO_AOI_IP_2,0,皮带线3定位检测,X029,X029
/// </summary>
public
static
string
Location_Check3
=
"Location_Check3"
;
/// <summary>
/// DI 皮带线3入口料盘检测, Entry
Position
_Check3,9, PRO_AOI_IP_2,0, 皮带线3入口料盘检测, X030, X030
/// DI 皮带线3入口料盘检测, Entry
Tray
_Check3,9, PRO_AOI_IP_2,0, 皮带线3入口料盘检测, X030, X030
/// </summary>
public
static
string
Entry
Position_Check3
=
" EntryPosition
_Check3"
;
public
static
string
Entry
Tray_Check3
=
" EntryTray
_Check3"
;
/// <summary>
/// DI 皮带线3中间位置料盘检测,Middle
Position
_Check3,10,PRO_AOI_IP_2,0,皮带线3中间位置料盘检测,X031,X031
/// DI 皮带线3中间位置料盘检测,Middle
Tray
_Check3,10,PRO_AOI_IP_2,0,皮带线3中间位置料盘检测,X031,X031
/// </summary>
public
static
string
Middle
Position_Check3
=
"MiddlePosition
_Check3"
;
public
static
string
Middle
Tray_Check3
=
"MiddleTray
_Check3"
;
/// <summary>
/// DI 皮带线3出口料盘检测, Exit
Position
_Check3,11, PRO_AOI_IP_2,0, 皮带线3出口料盘检测, X032, X032
/// DI 皮带线3出口料盘检测, Exit
Tray
_Check3,11, PRO_AOI_IP_2,0, 皮带线3出口料盘检测, X032, X032
/// </summary>
public
static
string
Exit
Position_Check3
=
"ExitPosition
_Check3"
;
public
static
string
Exit
Tray_Check3
=
"ExitTray
_Check3"
;
/// <summary>
/// DI 分盘装置1定位气缸上升端,SeparateDevice_Up,12,PRO_AOI_IP_2,0,分盘装置1定位气缸上升端,X033,X033
/// </summary>
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论