Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
孙克
/
RC1250-AssemblyLine
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit 2b76268b
由
LN
编写于
2020-03-09 11:51:02 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
流水线启动停止优化
1 个父辈
d55e71af
隐藏空白字符变更
内嵌
并排
正在显示
5 个修改的文件
包含
61 行增加
和
18 行删除
source/AssemblyLineClient/FrmIOMsg.Designer.cs
source/AssemblyLineClient/FrmIOMsg.cs
source/AssemblyLineClient/记录.txt
source/DeviceLibrary/assemblyLine/LineBean.cs
source/DeviceLibrary/deviceLibrary/RFID/RFIDAutoReader.cs
source/AssemblyLineClient/FrmIOMsg.Designer.cs
查看文件 @
2b76268
...
@@ -47,7 +47,7 @@
...
@@ -47,7 +47,7 @@
//
//
this
.
lblConInfo
.
AutoSize
=
true
;
this
.
lblConInfo
.
AutoSize
=
true
;
this
.
lblConInfo
.
Font
=
new
System
.
Drawing
.
Font
(
"微软雅黑"
,
9F
,
System
.
Drawing
.
FontStyle
.
Regular
,
System
.
Drawing
.
GraphicsUnit
.
Point
,
((
byte
)(
134
)));
this
.
lblConInfo
.
Font
=
new
System
.
Drawing
.
Font
(
"微软雅黑"
,
9F
,
System
.
Drawing
.
FontStyle
.
Regular
,
System
.
Drawing
.
GraphicsUnit
.
Point
,
((
byte
)(
134
)));
this
.
lblConInfo
.
Location
=
new
System
.
Drawing
.
Point
(
63
,
62
);
this
.
lblConInfo
.
Location
=
new
System
.
Drawing
.
Point
(
35
,
62
);
this
.
lblConInfo
.
Name
=
"lblConInfo"
;
this
.
lblConInfo
.
Name
=
"lblConInfo"
;
this
.
lblConInfo
.
Size
=
new
System
.
Drawing
.
Size
(
70
,
17
);
this
.
lblConInfo
.
Size
=
new
System
.
Drawing
.
Size
(
70
,
17
);
this
.
lblConInfo
.
TabIndex
=
0
;
this
.
lblConInfo
.
TabIndex
=
0
;
...
@@ -57,7 +57,7 @@
...
@@ -57,7 +57,7 @@
//
//
this
.
lblRFID
.
AutoSize
=
true
;
this
.
lblRFID
.
AutoSize
=
true
;
this
.
lblRFID
.
Font
=
new
System
.
Drawing
.
Font
(
"微软雅黑"
,
9F
,
System
.
Drawing
.
FontStyle
.
Regular
,
System
.
Drawing
.
GraphicsUnit
.
Point
,
((
byte
)(
134
)));
this
.
lblRFID
.
Font
=
new
System
.
Drawing
.
Font
(
"微软雅黑"
,
9F
,
System
.
Drawing
.
FontStyle
.
Regular
,
System
.
Drawing
.
GraphicsUnit
.
Point
,
((
byte
)(
134
)));
this
.
lblRFID
.
Location
=
new
System
.
Drawing
.
Point
(
321
,
62
);
this
.
lblRFID
.
Location
=
new
System
.
Drawing
.
Point
(
282
,
62
);
this
.
lblRFID
.
Name
=
"lblRFID"
;
this
.
lblRFID
.
Name
=
"lblRFID"
;
this
.
lblRFID
.
Size
=
new
System
.
Drawing
.
Size
(
71
,
17
);
this
.
lblRFID
.
Size
=
new
System
.
Drawing
.
Size
(
71
,
17
);
this
.
lblRFID
.
TabIndex
=
1
;
this
.
lblRFID
.
TabIndex
=
1
;
...
...
source/AssemblyLineClient/FrmIOMsg.cs
查看文件 @
2b76268
using
OnlineStore.DeviceLibrary
;
using
Asa.RFID
;
using
OnlineStore.DeviceLibrary
;
using
OnlineStore.LoadCSVLibrary
;
using
OnlineStore.LoadCSVLibrary
;
using
System
;
using
System
;
using
System.Collections.Generic
;
using
System.Collections.Generic
;
...
@@ -46,8 +47,13 @@ namespace OnlineStore.AssemblyLine
...
@@ -46,8 +47,13 @@ namespace OnlineStore.AssemblyLine
List
<
string
>
rfidList
=
new
List
<
string
>(
DeviceConfig
.
ProRFIpMap
.
Values
);
List
<
string
>
rfidList
=
new
List
<
string
>(
DeviceConfig
.
ProRFIpMap
.
Values
);
foreach
(
string
ip
in
rfidList
)
foreach
(
string
ip
in
rfidList
)
{
{
string
con
=
RFIDManager
.
ReadRFID
(
ip
)
.
NumStr
()
;
string
errorCode
=
"?"
;
msg
+=
(
"RFID["
+
ip
+
"]:"
).
PadLeft
(
26
,
' '
)
+
con
+
"\n"
;
if
(
RFIDAutoReader
.
rfidErrorMap
.
ContainsKey
(
ip
))
{
errorCode
=
""
+
RFIDAutoReader
.
rfidErrorMap
[
ip
];
}
// string con = RFIDManager.ReadRFID(ip) .NumStr() ;
msg
+=
(
"RFID["
+
ip
+
"]:"
).
PadLeft
(
26
,
' '
)
+
"ErrorCode="
+
errorCode
+
"\n"
;
}
}
lblRFID
.
Text
+=
msg
;
lblRFID
.
Text
+=
msg
;
...
...
source/AssemblyLineClient/记录.txt
查看文件 @
2b76268
...
@@ -277,7 +277,8 @@ PRO,0,移栽上下轴流水线取放料详细位置P2,UpDownP2DetialList,0X0=800
...
@@ -277,7 +277,8 @@ PRO,0,移栽上下轴流水线取放料详细位置P2,UpDownP2DetialList,0X0=800
上料机构优化。
上料机构优化。
托盘优化:阻挡下降后,可能等不到check1灭。
托盘优化:阻挡下降后,可能等不到check1灭。
20200309
流水线启动时先转动链条5秒,停止时最后停止流水线,防止托盘停留在rfid读卡器上方。
...
...
source/DeviceLibrary/assemblyLine/LineBean.cs
查看文件 @
2b76268
...
@@ -253,27 +253,42 @@ namespace OnlineStore.DeviceLibrary
...
@@ -253,27 +253,42 @@ namespace OnlineStore.DeviceLibrary
}
}
else
else
{
{
// ledProcessTimer.Enabled = false;
// ledProcessTimer.Enabled = false;
IoCheckTimer
.
Enabled
=
false
;
IoCheckTimer
.
Enabled
=
false
;
mainTimer
.
Enabled
=
false
;
mainTimer
.
Enabled
=
false
;
ledProcessTimer
.
Enabled
=
true
;
ledProcessTimer
.
Enabled
=
true
;
lineStatus
=
LineStatus
.
ResetMove
;
lineStatus
=
LineStatus
.
ResetMove
;
runStatus
=
LineRunStatus
.
HomeMoving
;
runStatus
=
LineRunStatus
.
HomeMoving
;
StartTime
=
DateTime
.
Now
;
StartTime
=
DateTime
.
Now
;
LogUtil
.
info
(
Name
+
"开始启动,启动时间:"
+
StartTime
.
ToString
());
LogUtil
.
info
(
Name
+
"开始启动,启动时间:"
+
StartTime
.
ToString
()
+
"先转动链条"
);
WriteDrivetMotorRun
(
IO_VALUE
.
HIGH
);
RFIDManager
.
Open
();
Thread
.
Sleep
(
5
);
Thread
.
Sleep
(
5
);
// AgvClient.SetCancelState(false);
LineServer
.
StartServer
(
ConfigAppSettings
.
GetIntValue
(
Setting_Init
.
TCPServerPort
));
LineServer
.
StartServer
(
ConfigAppSettings
.
GetIntValue
(
Setting_Init
.
TCPServerPort
));
RHomeOp
();
RHomeOp
();
foreach
(
EquipBase
moveEquip
in
this
.
AllEquipMap
.
Values
)
foreach
(
EquipBase
moveEquip
in
this
.
AllEquipMap
.
Values
)
{
{
//如果已经转动5秒,先停止链条
TimeSpan
span
=
DateTime
.
Now
-
StartTime
;
if
(
span
.
TotalSeconds
>
5
)
{
LogUtil
.
info
(
Name
+
"链条转动超过5秒,先停止链条转动"
);
WriteDrivetMotorRun
(
IO_VALUE
.
LOW
);
}
if
(
runStatus
.
Equals
(
LineRunStatus
.
Wait
))
{
LogUtil
.
error
(
Name
+
"启动过程中发现 runStatus=Wait,中断启动"
);
return
false
;
}
EquipStartRun
(
moveEquip
);
EquipStartRun
(
moveEquip
);
}
}
if
(
runStatus
.
Equals
(
LineRunStatus
.
Wait
))
{
return
false
;
}
RFIDManager
.
Open
();
// WriteDrivetMotorRun(IO_VALUE.LOW);
IoCheckTimer
.
Enabled
=
true
;
IoCheckTimer
.
Enabled
=
true
;
mainTimer
.
Enabled
=
true
;
mainTimer
.
Enabled
=
true
;
return
true
;
return
true
;
...
@@ -314,7 +329,6 @@ namespace OnlineStore.DeviceLibrary
...
@@ -314,7 +329,6 @@ namespace OnlineStore.DeviceLibrary
}
}
TrayManager
.
ErrorDeviceId
=
-
1
;
TrayManager
.
ErrorDeviceId
=
-
1
;
WriteDrivetMotorRun
(
IO_VALUE
.
LOW
);
//横移轨道下降
//横移轨道下降
SideWayStop
();
SideWayStop
();
...
@@ -360,14 +374,21 @@ namespace OnlineStore.DeviceLibrary
...
@@ -360,14 +374,21 @@ namespace OnlineStore.DeviceLibrary
lineStatus
=
LineStatus
.
ResetMove
;
lineStatus
=
LineStatus
.
ResetMove
;
runStatus
=
LineRunStatus
.
Reset
;
runStatus
=
LineRunStatus
.
Reset
;
WriteDrivetMotorRun
(
IO_VALUE
.
LOW
);
//重置通用处理
//重置通用处理
RHomeOp
();
RHomeOp
();
foreach
(
EquipBase
equip
in
AllEquipMap
.
Values
)
foreach
(
EquipBase
equip
in
AllEquipMap
.
Values
)
{
{
if
(
runStatus
.
Equals
(
LineRunStatus
.
Wait
))
{
LogUtil
.
error
(
Name
+
"复位过程中发现 runStatus=Wait,中断启动"
);
return
false
;
}
EquipReset
(
equip
,
isNeedAllReset
);
EquipReset
(
equip
,
isNeedAllReset
);
}
}
if
(
runStatus
.
Equals
(
LineRunStatus
.
Wait
))
{
return
false
;
}
IoCheckTimer
.
Enabled
=
true
;
IoCheckTimer
.
Enabled
=
true
;
mainTimer
.
Enabled
=
true
;
mainTimer
.
Enabled
=
true
;
return
true
;
return
true
;
...
@@ -401,13 +422,13 @@ namespace OnlineStore.DeviceLibrary
...
@@ -401,13 +422,13 @@ namespace OnlineStore.DeviceLibrary
IoCheckTimer
.
Enabled
=
false
;
IoCheckTimer
.
Enabled
=
false
;
mainTimer
.
Enabled
=
false
;
mainTimer
.
Enabled
=
false
;
AgvClient
.
SetCancelState
(
true
);
AgvClient
.
SetCancelState
(
true
);
WriteDrivetMotorRun
(
IO_VALUE
.
LOW
);
//停止运行时,把阻挡气缸上升
//停止运行时,把阻挡气缸上升
StopMove
();
StopMove
();
runStatus
=
LineRunStatus
.
Wait
;
runStatus
=
LineRunStatus
.
Wait
;
ledProcessTimer
.
Enabled
=
false
;
ledProcessTimer
.
Enabled
=
false
;
CloseLed
();
CloseLed
();
WriteDrivetMotorRun
(
IO_VALUE
.
LOW
);
LineServer
.
StopServer
();
LineServer
.
StopServer
();
RFIDManager
.
Close
();
RFIDManager
.
Close
();
...
...
source/DeviceLibrary/deviceLibrary/RFID/RFIDAutoReader.cs
查看文件 @
2b76268
using
log4net
;
using
log4net
;
using
OnlineStore.Common
;
using
System
;
using
System
;
using
System.Collections.Generic
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Linq
;
...
@@ -14,26 +15,40 @@ namespace Asa.RFID
...
@@ -14,26 +15,40 @@ namespace Asa.RFID
private
static
Dictionary
<
string
,
RFIDAuto
>
rfidMap
=
new
Dictionary
<
string
,
RFIDAuto
>();
private
static
Dictionary
<
string
,
RFIDAuto
>
rfidMap
=
new
Dictionary
<
string
,
RFIDAuto
>();
public
static
Dictionary
<
string
,
int
>
rfidErrorMap
=
new
Dictionary
<
string
,
int
>();
/// <summary>
/// <summary>
/// 打开所有
/// 打开所有
/// </summary>
/// </summary>
/// <param name="ipArr"></param>
/// <param name="ipArr"></param>
/// <param name="OnReceive"></param>
/// <param name="OnReceive"></param>
/// <param name="ip"></param>
/// <param name="ip"></param>
public
static
void
Open
(
Received_Event
OnReceive
,
params
string
[]
ipArr
)
public
static
void
Open
(
Received_Event
OnReceive
,
params
string
[]
ipArr
)
{
{
foreach
(
var
ip
in
ipArr
)
rfidErrorMap
=
new
Dictionary
<
string
,
int
>();
foreach
(
var
ip
in
ipArr
)
{
{
int
code
=
0
;
if
(
rfidMap
.
ContainsKey
(
ip
))
if
(
rfidMap
.
ContainsKey
(
ip
))
{
{
rfidMap
[
ip
].
StartAutoScan
(
OnReceive
);
code
=
rfidMap
[
ip
].
StartAutoScan
(
OnReceive
);
}
}
else
else
{
{
RFIDAuto
rfid
=
new
RFIDAuto
(
ip
);
RFIDAuto
rfid
=
new
RFIDAuto
(
ip
);
rfid
.
StartAutoScan
(
OnReceive
);
code
=
rfid
.
StartAutoScan
(
OnReceive
);
rfidMap
.
Add
(
ip
,
rfid
);
rfidMap
.
Add
(
ip
,
rfid
);
}
}
if
(
rfidErrorMap
.
ContainsKey
(
ip
))
{
rfidErrorMap
.
Remove
(
ip
);
}
rfidErrorMap
.
Add
(
ip
,
code
);
if
(
code
.
Equals
(
0
).
Equals
(
false
))
{
LogUtil
.
error
(
"连接RFID【"
+
ip
+
"】ErrorCode="
+
code
);
}
}
}
}
}
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论