Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
孙克
/
RC1250-AssemblyLine
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit 8a4f38b7
由
LN
编写于
2020-03-06 18:52:51 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
日志修改
1 个父辈
9d01925c
显示空白字符变更
内嵌
并排
正在显示
14 个修改的文件
包含
100 行增加
和
46 行删除
source/AssemblyLineClient/App.config
source/AssemblyLineClient/FrmDischargeLine.cs
source/AssemblyLineClient/FrmFeedingEquip.cs
source/AssemblyLineClient/记录.txt
source/Common/Setting_Init.cs
source/Common/util/LogUtil.cs
source/DeviceLibrary/assemblyLine/DischargeLine.cs
source/DeviceLibrary/assemblyLine/DischargeLine_Partial.cs
source/DeviceLibrary/assemblyLine/EquipBase.cs
source/DeviceLibrary/assemblyLine/FeedingEquip_InStore.cs
source/DeviceLibrary/assemblyLine/ProvidingEquip_Partial.cs
source/DeviceLibrary/assemblymanager/SServerManager.cs
source/DeviceLibrary/assemblymanager/TrayManager.cs
source/DeviceLibrary/deviceLibrary/halcon/CodeManager.cs
source/AssemblyLineClient/App.config
查看文件 @
8a4f38b
...
@@ -56,6 +56,7 @@
...
@@ -56,6 +56,7 @@
<
add
key
=
"DefaultTrayNum"
value
=
"0"
/>
<
add
key
=
"DefaultTrayNum"
value
=
"0"
/>
<
add
key
=
"NeedScanCode"
value
=
"1"
/>
<
add
key
=
"NeedScanCode"
value
=
"1"
/>
<
add
key
=
"Agv_Log_Open"
value
=
"0"
/>
<
add
key
=
"Agv_Log_Open"
value
=
"0"
/>
<
add
key
=
"MaxTrayNum"
value
=
"30"
/>
</
appSettings
>
</
appSettings
>
<!-- <
log4net
> -->
<!-- <
log4net
> -->
<!-- <
appender
name
=
"RollingLogFileAppender"
type
=
"log4net.Appender.RollingFileAppender"
> -->
<!-- <
appender
name
=
"RollingLogFileAppender"
type
=
"log4net.Appender.RollingFileAppender"
> -->
...
...
source/AssemblyLineClient/FrmDischargeLine.cs
查看文件 @
8a4f38b
...
@@ -397,7 +397,7 @@ namespace OnlineStore.AssemblyLine
...
@@ -397,7 +397,7 @@ namespace OnlineStore.AssemblyLine
private
void
btnScan_Click
(
object
sender
,
EventArgs
e
)
private
void
btnScan_Click
(
object
sender
,
EventArgs
e
)
{
{
List
<
string
>
camers
=
equipBean
.
Config
.
GetCameraList
();
List
<
string
>
camers
=
equipBean
.
Config
.
GetCameraList
();
List
<
string
>
LastCodeList
=
CodeManager
.
CameraScan
(
camers
);
List
<
string
>
LastCodeList
=
CodeManager
.
CameraScan
(
camers
,
equipBean
.
Name
);
string
cameraStr
=
""
;
string
cameraStr
=
""
;
foreach
(
string
ca
in
camers
)
foreach
(
string
ca
in
camers
)
{
{
...
...
source/AssemblyLineClient/FrmFeedingEquip.cs
查看文件 @
8a4f38b
...
@@ -553,7 +553,7 @@ namespace OnlineStore.AssemblyLine
...
@@ -553,7 +553,7 @@ namespace OnlineStore.AssemblyLine
private
void
btnScan_Click
(
object
sender
,
EventArgs
e
)
private
void
btnScan_Click
(
object
sender
,
EventArgs
e
)
{
{
List
<
string
>
camers
=
equipBean
.
Config
.
GetCameraList
();
List
<
string
>
camers
=
equipBean
.
Config
.
GetCameraList
();
List
<
string
>
LastCodeList
=
CodeManager
.
CameraScan
(
camers
);
List
<
string
>
LastCodeList
=
CodeManager
.
CameraScan
(
camers
,
equipBean
.
Name
);
string
cameraStr
=
""
;
string
cameraStr
=
""
;
foreach
(
string
ca
in
camers
)
foreach
(
string
ca
in
camers
)
{
{
...
...
source/AssemblyLineClient/记录.txt
查看文件 @
8a4f38b
...
@@ -263,7 +263,8 @@ PRO,0,移栽上下轴流水线取放料详细位置P2,UpDownP2DetialList,0X0=800
...
@@ -263,7 +263,8 @@ PRO,0,移栽上下轴流水线取放料详细位置P2,UpDownP2DetialList,0X0=800
问题:入料1 9:36,料架送走以后又发needLeave B20,B26
问题:入料1 9:36,料架送走以后又发needLeave B20,B26
托盘号增加一致性判断,不一致时打印日志并显示文字。
托盘卡时,等待StopChecck2的报警不显示红灯
...
...
source/Common/Setting_Init.cs
查看文件 @
8a4f38b
...
@@ -84,5 +84,7 @@ namespace OnlineStore.Common
...
@@ -84,5 +84,7 @@ namespace OnlineStore.Common
public
static
string
NeedScanCode
=
"NeedScanCode"
;
public
static
string
NeedScanCode
=
"NeedScanCode"
;
public
static
string
CodeCount
=
"CodeCount"
;
public
static
string
CodeCount
=
"CodeCount"
;
public
static
string
DefaultTrayNum
=
"DefaultTrayNum"
;
public
static
string
DefaultTrayNum
=
"DefaultTrayNum"
;
public
static
string
MaxTrayNum
=
"MaxTrayNum"
;
}
}
}
}
source/Common/util/LogUtil.cs
查看文件 @
8a4f38b
...
@@ -61,12 +61,12 @@ namespace OnlineStore.Common
...
@@ -61,12 +61,12 @@ namespace OnlineStore.Common
{
{
rfidLog
.
Debug
(
msg
);
rfidLog
.
Debug
(
msg
);
}
}
public
static
void
error
(
string
errorMsg
,
int
type
)
public
static
void
error
(
string
errorMsg
,
int
type
,
int
seconds
=
10
)
{
{
if
(
lastErrorLogTime
.
ContainsKey
(
type
))
if
(
lastErrorLogTime
.
ContainsKey
(
type
))
{
{
TimeSpan
span
=
DateTime
.
Now
-
lastErrorLogTime
[
type
];
TimeSpan
span
=
DateTime
.
Now
-
lastErrorLogTime
[
type
];
if
(
span
.
TotalSeconds
>
10
)
if
(
span
.
TotalSeconds
>
seconds
)
{
{
lastErrorLogTime
.
Remove
(
type
);
lastErrorLogTime
.
Remove
(
type
);
lastErrorLogTime
.
Add
(
type
,
DateTime
.
Now
);
lastErrorLogTime
.
Add
(
type
,
DateTime
.
Now
);
...
...
source/DeviceLibrary/assemblyLine/DischargeLine.cs
查看文件 @
8a4f38b
...
@@ -473,10 +473,10 @@ namespace OnlineStore.DeviceLibrary
...
@@ -473,10 +473,10 @@ namespace OnlineStore.DeviceLibrary
{
{
LogUtil
.
info
(
hengyiName
+
"扫码工位:200ms后开始扫码,IsInScanCode="
+
IsInScanCode
);
LogUtil
.
info
(
hengyiName
+
"扫码工位:200ms后开始扫码,IsInScanCode="
+
IsInScanCode
);
Thread
.
Sleep
(
200
);
Thread
.
Sleep
(
200
);
List
<
string
>
LastCodeList
=
CodeManager
.
CameraScan
(
Config
.
GetCameraList
());
List
<
string
>
LastCodeList
=
CodeManager
.
CameraScan
(
Config
.
GetCameraList
()
,
Name
);
if
(
LastCodeList
.
Count
<=
0
)
if
(
LastCodeList
.
Count
<=
0
)
{
{
LastCodeList
=
CodeManager
.
CameraScan
(
Config
.
GetCameraList
());
LastCodeList
=
CodeManager
.
CameraScan
(
Config
.
GetCameraList
()
,
Name
);
}
}
LastCode
=
SServerManager
.
ProcessCodeList
(
LastCodeList
);
LastCode
=
SServerManager
.
ProcessCodeList
(
LastCodeList
);
// Thread.Sleep(5000);
// Thread.Sleep(5000);
...
...
source/DeviceLibrary/assemblyLine/DischargeLine_Partial.cs
查看文件 @
8a4f38b
...
@@ -89,10 +89,10 @@ namespace OnlineStore.DeviceLibrary
...
@@ -89,10 +89,10 @@ namespace OnlineStore.DeviceLibrary
Task
<
List
<
string
>>
scanTask
=
Task
.
Factory
.
StartNew
(
delegate
Task
<
List
<
string
>>
scanTask
=
Task
.
Factory
.
StartNew
(
delegate
{
{
List
<
string
>
LastCodeList
=
CodeManager
.
CameraScan
(
Config
.
GetCameraList
());
List
<
string
>
LastCodeList
=
CodeManager
.
CameraScan
(
Config
.
GetCameraList
()
,
Name
);
if
(
LastCodeList
.
Count
<=
0
)
if
(
LastCodeList
.
Count
<=
0
)
{
{
LastCodeList
=
CodeManager
.
CameraScan
(
Config
.
GetCameraList
());
LastCodeList
=
CodeManager
.
CameraScan
(
Config
.
GetCameraList
()
,
Name
);
}
}
LastCode
=
SServerManager
.
ProcessCodeList
(
LastCodeList
);
LastCode
=
SServerManager
.
ProcessCodeList
(
LastCodeList
);
return
LastCodeList
;
return
LastCodeList
;
...
...
source/DeviceLibrary/assemblyLine/EquipBase.cs
查看文件 @
8a4f38b
...
@@ -314,11 +314,16 @@ namespace OnlineStore.DeviceLibrary
...
@@ -314,11 +314,16 @@ namespace OnlineStore.DeviceLibrary
preTrayNum
=
currTrayNum
;
preTrayNum
=
currTrayNum
;
currTrayNum
=
RFIDManager
.
GetTrayNum
(
DeviceID
,
true
);
currTrayNum
=
RFIDManager
.
GetTrayNum
(
DeviceID
,
true
);
LogInfo
(
" ["
+
trayCount
+
"] IP ["
+
RFIDManager
.
GetRFIP
(
DeviceID
)
+
"] ["
+
preTrayNum
+
"] 当前托盘 ["
+
currTrayNum
+
"]"
);
LogInfo
(
" ["
+
trayCount
+
"] IP ["
+
RFIDManager
.
GetRFIP
(
DeviceID
)
+
"] ["
+
preTrayNum
+
"] 当前托盘 ["
+
currTrayNum
+
"]"
);
if
(
preTrayNum
.
Equals
(
currTrayNum
)
&&
currTrayNum
>
0
)
if
(
preTrayNum
.
Equals
(
currTrayNum
)
&&
currTrayNum
>
0
)
{
{
TrayManager
.
TrayErrorMsg
=
DateTime
.
Now
.
ToLongTimeString
()+
" "
+
Name
+
"托盘号出现错乱:上一个托盘["
+
preTrayNum
+
"] 当前托盘 ["
+
currTrayNum
+
"],连续两个托盘号一样"
;
TrayManager
.
TrayErrorMsg
=
DateTime
.
Now
.
ToLongTimeString
()
+
" "
+
Name
+
"托盘号出现错乱:上一个托盘["
+
preTrayNum
+
"] 当前托盘 ["
+
currTrayNum
+
"],连续两个托盘号一样"
;
LogUtil
.
error
(
Name
+
"托盘号错乱:上一个托盘["
+
preTrayNum
+
"] 当前托盘 ["
+
currTrayNum
+
"],连续两个托盘号一样"
);
LogUtil
.
error
(
Name
+
"托盘号错乱:上一个托盘["
+
preTrayNum
+
"] 当前托盘 ["
+
currTrayNum
+
"],连续两个托盘号一样"
);
}
}
else
if
(
TrayManager
.
CheckIsRightNum
(
currTrayNum
,
preTrayNum
))
{
TrayManager
.
TrayErrorMsg
=
DateTime
.
Now
.
ToLongTimeString
()
+
" "
+
Name
+
"托盘号出现错乱:上一个托盘["
+
preTrayNum
+
"] 当前托盘 ["
+
currTrayNum
+
"],托盘号不连续"
;
LogUtil
.
error
(
Name
+
"托盘号错乱:上一个托盘["
+
preTrayNum
+
"] 当前托盘 ["
+
currTrayNum
+
"],托盘号不连续"
);
}
return
true
;
return
true
;
}
}
...
@@ -430,15 +435,25 @@ namespace OnlineStore.DeviceLibrary
...
@@ -430,15 +435,25 @@ namespace OnlineStore.DeviceLibrary
//}
//}
//else
//else
//{
//{
TimeSpan
rwSpan
=
DateTime
.
Now
-
preRWTime
;
TimeSpan
rwSpan
=
DateTime
.
Now
-
preRWTime
;
//一分钟还未检测到
//一分钟还未检测到
if
(
span
.
TotalSeconds
>
LineManager
.
Config
.
IOSingle_TimerOut
&&
NoAlarm
())
if
(
span
.
TotalSeconds
>
LineManager
.
Config
.
IOSingle_TimerOut
&&
NoAlarm
())
{
{
if
(
IsLowAlarm
(
moveInfo
))
{
ConfigIO
io
=
baseConfig
.
getWaitIO
(
wait
.
IoType
);
ConfigIO
io
=
baseConfig
.
getWaitIO
(
wait
.
IoType
);
WarnMsg
=
Name
+
"等待"
+
NotOkMsg
+
" 超时"
;
WarnMsg
=
"提示"
+
moveInfo
.
Name
+
"["
+
moveInfo
.
MoveType
+
"]["
+
moveInfo
.
MoveStep
+
"] 等待"
+
NotOkMsg
+
" 超时"
;
LogUtil
.
error
(
MoveInfo
.
Name
+
WarnMsg
,
DeviceID
+
13
,
30
);
}
else
{
ConfigIO
io
=
baseConfig
.
getWaitIO
(
wait
.
IoType
);
WarnMsg
=
moveInfo
.
Name
+
"["
+
moveInfo
.
MoveType
+
"]["
+
moveInfo
.
MoveStep
+
"] 等待"
+
NotOkMsg
+
" 超时"
;
Alarm
(
LineAlarmType
.
IoSingleTimeOut
);
Alarm
(
LineAlarmType
.
IoSingleTimeOut
);
LogUtil
.
error
(
MoveInfo
.
Name
+
WarnMsg
,
DeviceID
+
13
);
LogUtil
.
error
(
MoveInfo
.
Name
+
WarnMsg
,
DeviceID
+
13
);
}
}
}
else
if
(
rwSpan
.
TotalSeconds
>
5
&&
span
.
TotalSeconds
>
6
&&
span
.
TotalSeconds
<
LineManager
.
Config
.
IOSingle_TimerOut
*
2
)
else
if
(
rwSpan
.
TotalSeconds
>
5
&&
span
.
TotalSeconds
>
6
&&
span
.
TotalSeconds
<
LineManager
.
Config
.
IOSingle_TimerOut
*
2
)
{
{
preRWTime
=
DateTime
.
Now
;
preRWTime
=
DateTime
.
Now
;
...
@@ -461,7 +476,6 @@ namespace OnlineStore.DeviceLibrary
...
@@ -461,7 +476,6 @@ namespace OnlineStore.DeviceLibrary
isOk
=
false
;
isOk
=
false
;
break
;
break
;
}
}
// }
}
}
else
if
(
wait
.
WaitType
.
Equals
(
WaitEnum
.
W003_Time
))
else
if
(
wait
.
WaitType
.
Equals
(
WaitEnum
.
W003_Time
))
{
{
...
@@ -505,16 +519,35 @@ namespace OnlineStore.DeviceLibrary
...
@@ -505,16 +519,35 @@ namespace OnlineStore.DeviceLibrary
{
{
WarnMsg
=
moveInfo
.
Name
+
"["
+
moveInfo
.
MoveType
+
"]["
+
moveInfo
.
MoveStep
+
"]等待"
+
NotOkMsg
WarnMsg
=
moveInfo
.
Name
+
"["
+
moveInfo
.
MoveType
+
"]["
+
moveInfo
.
MoveStep
+
"]等待"
+
NotOkMsg
+
"超时["
+
Math
.
Round
(
span
.
TotalSeconds
,
1
)
+
"]秒"
;
+
"超时["
+
Math
.
Round
(
span
.
TotalSeconds
,
1
)
+
"]秒"
;
if
(
IsLowAlarm
(
moveInfo
)
&&
span
.
TotalSeconds
<
moveInfo
.
TimeOutSeconds
*
3
)
{
LogUtil
.
error
(
WarnMsg
,
DeviceID
+
15
,
30
);
}
else
{
LogUtil
.
error
(
WarnMsg
,
DeviceID
+
15
);
LogUtil
.
error
(
WarnMsg
,
DeviceID
+
15
);
Alarm
(
LineAlarmType
.
IoSingleTimeOut
);
Alarm
(
LineAlarmType
.
IoSingleTimeOut
);
}
}
}
}
}
catch
(
Exception
ex
)
catch
(
Exception
ex
)
{
{
LogUtil
.
error
(
moveInfo
.
Name
+
" ["
+
moveInfo
.
MoveStep
+
"] CheckWait 出错:"
,
ex
);
LogUtil
.
error
(
moveInfo
.
Name
+
" ["
+
moveInfo
.
MoveStep
+
"] CheckWait 出错:"
,
ex
);
}
}
}
}
private
bool
IsLowAlarm
(
LineMoveInfo
moveInfo
)
{
//托盘卡的信号不报警,只提示
// [_进仓_14-SMove] [CheckFixture] [MO_17_Stop2Check] 等待[X462 - 进仓14阻挡2托盘检测 - StopCylinder_Check2 = LOW] 超时[181.7]秒
if
(
moveInfo
.
MoveType
.
Equals
(
LineMoveType
.
CheckFixture
)
&&
(
moveInfo
.
MoveStep
.
Equals
(
LineMoveStep
.
MIO_00_Stop1Down
)
||
moveInfo
.
MoveStep
.
Equals
(
LineMoveStep
.
MIO_01_FixtureCheck
)
||
moveInfo
.
MoveStep
.
Equals
(
LineMoveStep
.
MO_17_Stop2Check
)))
{
return
true
;
}
return
false
;
}
protected
virtual
bool
CheckWaitResult
(
LineMoveInfo
moveInfo
,
WaitResultInfo
wait
)
protected
virtual
bool
CheckWaitResult
(
LineMoveInfo
moveInfo
,
WaitResultInfo
wait
)
{
{
return
false
;
return
false
;
...
@@ -541,15 +574,29 @@ namespace OnlineStore.DeviceLibrary
...
@@ -541,15 +574,29 @@ namespace OnlineStore.DeviceLibrary
protected
void
OutLog
(
string
msg
)
protected
void
OutLog
(
string
msg
)
{
{
string
posId
=
MoveInfo
.
MoveParam
!=
null
?
MoveInfo
.
MoveParam
.
PosId
:
""
;
string
posId
=
MoveInfo
.
MoveParam
!=
null
?
MoveInfo
.
MoveParam
.
PosId
:
""
;
if
(
baseConfig
.
DType
.
Equals
(
DeviceType
.
ProvidingEquip
))
{
if
(
String
.
IsNullOrEmpty
(
posId
))
{
LogUtil
.
debug
(
Name
+
" "
+
msg
);
}
else
{
LogUtil
.
debug
(
Name
+
" "
+
"["
+
posId
+
"] "
+
msg
);
}
}
else
{
if
(
String
.
IsNullOrEmpty
(
posId
))
if
(
String
.
IsNullOrEmpty
(
posId
))
{
{
LogUtil
.
info
(
Name
+
" "
+
msg
);
LogUtil
.
info
(
Name
+
" "
+
msg
);
}
}
else
else
{
{
LogUtil
.
info
(
Name
+
" "
+
"["
+
posId
+
"] "
+
msg
);
LogUtil
.
info
(
Name
+
" "
+
"["
+
posId
+
"] "
+
msg
);
}
}
}
}
}
protected
void
SInLog
(
string
msg
)
protected
void
SInLog
(
string
msg
)
{
{
string
posId
=
SecondMoveInfo
.
MoveParam
!=
null
?
SecondMoveInfo
.
MoveParam
.
PosId
:
""
;
string
posId
=
SecondMoveInfo
.
MoveParam
!=
null
?
SecondMoveInfo
.
MoveParam
.
PosId
:
""
;
...
...
source/DeviceLibrary/assemblyLine/FeedingEquip_InStore.cs
查看文件 @
8a4f38b
...
@@ -199,7 +199,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -199,7 +199,7 @@ namespace OnlineStore.DeviceLibrary
{
{
TimeSpan
span
=
DateTime
.
Now
-
SecondMoveInfo
.
LastSetpTime
;
TimeSpan
span
=
DateTime
.
Now
-
SecondMoveInfo
.
LastSetpTime
;
SecondMoveInfo
.
NextMoveStep
(
LineMoveStep
.
MIO_01_FixtureCheck
);
SecondMoveInfo
.
NextMoveStep
(
LineMoveStep
.
MIO_01_FixtureCheck
);
LogUtil
.
info
(
Name
+
"托盘阻挡:"
+
SecondMoveInfo
.
SLog
+
"阻挡气缸上升,下降耗时("
+
FormUtil
.
GetSpanStr
(
span
)+
"),等待SW_TrayCheck=1)"
);
LogUtil
.
debug
(
Name
+
"托盘阻挡:"
+
SecondMoveInfo
.
SLog
+
"阻挡气缸上升,下降耗时("
+
FormUtil
.
GetSpanStr
(
span
)+
"),等待SW_TrayCheck=1)"
);
IOMove
(
IO_Type
.
SW_StopDown
,
IO_VALUE
.
LOW
);
IOMove
(
IO_Type
.
SW_StopDown
,
IO_VALUE
.
LOW
);
SecondMoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitIO
(
IO_Type
.
SW_TrayCheck
,
IO_VALUE
.
HIGH
));
SecondMoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitIO
(
IO_Type
.
SW_TrayCheck
,
IO_VALUE
.
HIGH
));
}
}
...
@@ -260,7 +260,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -260,7 +260,7 @@ namespace OnlineStore.DeviceLibrary
{
{
SecondMoveInfo
.
NextMoveStep
(
LineMoveStep
.
MO_15_WaitCanGo
);
SecondMoveInfo
.
NextMoveStep
(
LineMoveStep
.
MO_15_WaitCanGo
);
TrayInfo
tray
=
TrayManager
.
GetTrayInfo
(
currTrayNum
);
TrayInfo
tray
=
TrayManager
.
GetTrayInfo
(
currTrayNum
);
LogInfo
(
SecondMoveInfo
.
MoveNum
+
"***************上个托盘号【"
+
preTrayNum
+
"】,当前 【"
+
tray
.
ToStr
()
+
"】没有出入料任务,放盘通过~"
);
CheckLog
(
SecondMoveInfo
.
MoveNum
+
"***************上个托盘号【"
+
preTrayNum
+
"】,当前 【"
+
tray
.
ToStr
()
+
"】没有出入料任务,放盘通过~"
);
//CheckLog("托盘放行 " + SecondMoveInfo.SLog + " ,移栽2,需要判断是否可以放盘通过,最多等待10000)");
//CheckLog("托盘放行 " + SecondMoveInfo.SLog + " ,移栽2,需要判断是否可以放盘通过,最多等待10000)");
CheckLog
(
"托盘放行 "
+
SecondMoveInfo
.
SLog
+
" ,等待 NextStopCheck=0"
);
CheckLog
(
"托盘放行 "
+
SecondMoveInfo
.
SLog
+
" ,等待 NextStopCheck=0"
);
// SecondMoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.NextStopCheck, IO_VALUE.LOW));
// SecondMoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.NextStopCheck, IO_VALUE.LOW));
...
@@ -650,19 +650,19 @@ namespace OnlineStore.DeviceLibrary
...
@@ -650,19 +650,19 @@ namespace OnlineStore.DeviceLibrary
int
chaz
=
Math
.
Abs
(
currP
-
Config
.
BatchAxisP3
);
int
chaz
=
Math
.
Abs
(
currP
-
Config
.
BatchAxisP3
);
if
(
chaz
<
BatchAxis
.
Config
.
CanErrorCountMax
)
if
(
chaz
<
BatchAxis
.
Config
.
CanErrorCountMax
)
{
{
InLog
(
"料盘移栽"
+
MoveInfo
.
SLog
+
":记录
高度尺寸
高度【"
+
LastHeight
+
"】宽度【"
+
LastWidth
+
"】,已经没有料盘,且已达到P3:"
+
Config
.
BatchAxisP3
+
",提升轴开始回下降待机点P2"
);
InLog
(
"料盘移栽"
+
MoveInfo
.
SLog
+
":记录 高度【"
+
LastHeight
+
"】宽度【"
+
LastWidth
+
"】,已经没有料盘,且已达到P3:"
+
Config
.
BatchAxisP3
+
",提升轴开始回下降待机点P2"
);
MoveInfo
.
ShelfNoTray
=
true
;
MoveInfo
.
ShelfNoTray
=
true
;
BatchAxis
.
AbsMove
(
null
,
Config
.
BatchAxisP2
,
Config
.
BatchAxis_P2Speed
);
BatchAxis
.
AbsMove
(
null
,
Config
.
BatchAxisP2
,
Config
.
BatchAxis_P2Speed
);
}
}
else
else
{
{
InLog
(
"料盘移栽"
+
MoveInfo
.
SLog
+
":记录
高度尺寸
高度【"
+
LastHeight
+
"】宽度【"
+
LastWidth
+
"】,此时未检测到料盘,上料轴位置【"
+
currP
+
"】不在P3:"
+
Config
.
BatchAxisP3
+
""
);
InLog
(
"料盘移栽"
+
MoveInfo
.
SLog
+
":记录 高度【"
+
LastHeight
+
"】宽度【"
+
LastWidth
+
"】,此时未检测到料盘,上料轴位置【"
+
currP
+
"】不在P3:"
+
Config
.
BatchAxisP3
+
""
);
}
}
}
}
else
else
{
{
InLog
(
"料盘移栽"
+
MoveInfo
.
SLog
+
":记录
高度尺寸
高度【"
+
LastHeight
+
"】宽度【"
+
LastWidth
+
"】"
);
InLog
(
"料盘移栽"
+
MoveInfo
.
SLog
+
":记录 高度【"
+
LastHeight
+
"】宽度【"
+
LastWidth
+
"】"
);
}
}
}
}
else
if
(
MoveInfo
.
MoveStep
.
Equals
(
LineMoveStep
.
FI_18_SaveSize
))
else
if
(
MoveInfo
.
MoveStep
.
Equals
(
LineMoveStep
.
FI_18_SaveSize
))
...
@@ -690,7 +690,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -690,7 +690,7 @@ namespace OnlineStore.DeviceLibrary
//TODO 此处需要等待空托盘
//TODO 此处需要等待空托盘
if
(
MoveInfo
.
ShelfNoTray
.
Equals
(
false
)
&&
isScan
)
if
(
MoveInfo
.
ShelfNoTray
.
Equals
(
false
)
&&
isScan
)
{
{
InLog
(
"料盘移栽"
+
MoveInfo
.
SLog
+
":等待空托盘到达 "
+
log
+
",
同时为下一盘料
预扫码"
);
InLog
(
"料盘移栽"
+
MoveInfo
.
SLog
+
":等待空托盘到达 "
+
log
+
",预扫码"
);
//还有料盘,直接扫码
//还有料盘,直接扫码
NextCodeList
=
new
List
<
string
>();
NextCodeList
=
new
List
<
string
>();
try
try
...
@@ -698,10 +698,10 @@ namespace OnlineStore.DeviceLibrary
...
@@ -698,10 +698,10 @@ namespace OnlineStore.DeviceLibrary
Task
<
List
<
string
>>
scanTask
=
Task
.
Factory
.
StartNew
(
delegate
Task
<
List
<
string
>>
scanTask
=
Task
.
Factory
.
StartNew
(
delegate
{
{
NextCodeList
=
CodeManager
.
CameraScan
(
Config
.
GetCameraList
());
NextCodeList
=
CodeManager
.
CameraScan
(
Config
.
GetCameraList
()
,
Name
);
if
(
NextCodeList
.
Count
<=
0
)
if
(
NextCodeList
.
Count
<=
0
)
{
{
NextCodeList
=
CodeManager
.
CameraScan
(
Config
.
GetCameraList
());
NextCodeList
=
CodeManager
.
CameraScan
(
Config
.
GetCameraList
()
,
Name
);
}
}
return
NextCodeList
;
return
NextCodeList
;
});
});
...
@@ -911,7 +911,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -911,7 +911,7 @@ namespace OnlineStore.DeviceLibrary
if
(
NextCodeList
.
Count
>
0
)
if
(
NextCodeList
.
Count
>
0
)
{
{
InLog
(
"料盘移栽"
+
MoveInfo
.
SLog
+
":开始扫码:使用预扫码
NextCodeList中的条码
"
);
InLog
(
"料盘移栽"
+
MoveInfo
.
SLog
+
":开始扫码:使用预扫码"
);
MoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitTime
(
300
));
MoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitTime
(
300
));
LastCodeList
=
new
List
<
string
>(
NextCodeList
);
LastCodeList
=
new
List
<
string
>(
NextCodeList
);
NextCodeList
=
new
List
<
string
>();
NextCodeList
=
new
List
<
string
>();
...
@@ -927,10 +927,10 @@ namespace OnlineStore.DeviceLibrary
...
@@ -927,10 +927,10 @@ namespace OnlineStore.DeviceLibrary
Task
<
List
<
string
>>
scanTask
=
Task
.
Factory
.
StartNew
(
delegate
Task
<
List
<
string
>>
scanTask
=
Task
.
Factory
.
StartNew
(
delegate
{
{
LastCodeList
=
CodeManager
.
CameraScan
(
Config
.
GetCameraList
());
LastCodeList
=
CodeManager
.
CameraScan
(
Config
.
GetCameraList
()
,
Name
);
if
(
LastCodeList
.
Count
<=
0
)
if
(
LastCodeList
.
Count
<=
0
)
{
{
LastCodeList
=
CodeManager
.
CameraScan
(
Config
.
GetCameraList
());
LastCodeList
=
CodeManager
.
CameraScan
(
Config
.
GetCameraList
()
,
Name
);
}
}
return
LastCodeList
;
return
LastCodeList
;
});
});
...
...
source/DeviceLibrary/assemblyLine/ProvidingEquip_Partial.cs
查看文件 @
8a4f38b
...
@@ -241,7 +241,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -241,7 +241,7 @@ namespace OnlineStore.DeviceLibrary
{
{
TimeSpan
span
=
DateTime
.
Now
-
SecondMoveInfo
.
LastSetpTime
;
TimeSpan
span
=
DateTime
.
Now
-
SecondMoveInfo
.
LastSetpTime
;
SecondMoveInfo
.
NextMoveStep
(
LineMoveStep
.
MIO_01_FixtureCheck
);
SecondMoveInfo
.
NextMoveStep
(
LineMoveStep
.
MIO_01_FixtureCheck
);
LogUtil
.
info
(
Name
+
"托盘阻挡"
+
SecondMoveInfo
.
SLog
+
" 阻挡气缸上升,下降耗时("
+
FormUtil
.
GetSpanStr
(
span
)+
"),等待 阻挡2托盘检测=1)"
);
LogUtil
.
debug
(
Name
+
"托盘阻挡"
+
SecondMoveInfo
.
SLog
+
" 阻挡气缸上升,下降耗时("
+
FormUtil
.
GetSpanStr
(
span
)+
"),等待 阻挡2托盘检测=1)"
);
IOMove
(
IO_Type
.
StopCylinder_Down1
,
IO_VALUE
.
LOW
);
IOMove
(
IO_Type
.
StopCylinder_Down1
,
IO_VALUE
.
LOW
);
SecondMoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitIO
(
IO_Type
.
StopCylinder_Check2
,
IO_VALUE
.
HIGH
));
SecondMoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitIO
(
IO_Type
.
StopCylinder_Check2
,
IO_VALUE
.
HIGH
));
}
}
...
@@ -382,7 +382,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -382,7 +382,7 @@ namespace OnlineStore.DeviceLibrary
lineStatus
=
LineStatus
.
OutStoreExecute
;
lineStatus
=
LineStatus
.
OutStoreExecute
;
MoveInfo
.
MoveParam
=
param
;
MoveInfo
.
MoveParam
=
param
;
MoveInfo
.
NewMove
(
LineMoveType
.
OutStore
);
MoveInfo
.
NewMove
(
LineMoveType
.
OutStore
);
LogInfo
(
"出料【"
+
posId
+
"】处理(移栽):PO_00_CylinderAfter, 前后气缸后退"
);
LogInfo
(
"
开始
出料【"
+
posId
+
"】处理(移栽):PO_00_CylinderAfter, 前后气缸后退"
);
MoveInfo
.
NextMoveStep
(
LineMoveStep
.
PO_00_CylinderAfter
);
MoveInfo
.
NextMoveStep
(
LineMoveStep
.
PO_00_CylinderAfter
);
MoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitTime
(
1000
));
MoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitTime
(
1000
));
CylinderMove
(
MoveInfo
,
IO_Type
.
BeforeAfterCylinder_Before
,
IO_Type
.
BeforeAfterCylinder_After
);
CylinderMove
(
MoveInfo
,
IO_Type
.
BeforeAfterCylinder_Before
,
IO_Type
.
BeforeAfterCylinder_After
);
...
@@ -413,7 +413,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -413,7 +413,7 @@ namespace OnlineStore.DeviceLibrary
if
(
MoveInfo
.
MoveStep
.
Equals
(
LineMoveStep
.
PO_00_CylinderAfter
))
if
(
MoveInfo
.
MoveStep
.
Equals
(
LineMoveStep
.
PO_00_CylinderAfter
))
{
{
MoveInfo
.
NextMoveStep
(
LineMoveStep
.
PO_01_CylinderDown
);
MoveInfo
.
NextMoveStep
(
LineMoveStep
.
PO_01_CylinderDown
);
LogInfo
(
" "
+
MoveInfo
.
SLog
+
" : 上下气缸下降"
);
OutLog
(
" "
+
MoveInfo
.
SLog
+
" : 上下气缸下降"
);
MoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitTime
(
1000
));
MoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitTime
(
1000
));
UpdownDownP2Move
(
MoveInfo
.
MoveParam
.
PlateH
,
MoveInfo
.
MoveParam
.
PlateW
);
UpdownDownP2Move
(
MoveInfo
.
MoveParam
.
PlateH
,
MoveInfo
.
MoveParam
.
PlateW
);
}
}
...
@@ -431,12 +431,11 @@ namespace OnlineStore.DeviceLibrary
...
@@ -431,12 +431,11 @@ namespace OnlineStore.DeviceLibrary
CylinderMove
(
MoveInfo
,
IO_Type
.
ClampCylinder_Tighten
,
IO_Type
.
ClampCylinder_Slack
);
CylinderMove
(
MoveInfo
,
IO_Type
.
ClampCylinder_Tighten
,
IO_Type
.
ClampCylinder_Slack
);
if
(
MoveInfo
.
MoveParam
.
InStoreNg
)
if
(
MoveInfo
.
MoveParam
.
InStoreNg
)
{
{
OutLog
(
"出料 "
+
MoveInfo
.
SLog
+
" : 夹料气缸夹紧,入料NG料,不更新料盘位置"
);
LogInfo
(
"出料 【"
+
posId
+
"】"
+
MoveInfo
.
SLog
+
" : 夹料气缸夹紧,入料NG料,不更新料盘位置"
);
}
}
else
else
{
{
OutLog
(
"出料
"
+
MoveInfo
.
SLog
+
" : 夹料气缸夹紧,更新料盘位置【"
+
MoveInfo
.
MoveParam
.
WareCode
+
"】【INBELT】【"
+
lineId
+
"】"
);
LogInfo
(
"出料 【"
+
posId
+
"】
"
+
MoveInfo
.
SLog
+
" : 夹料气缸夹紧,更新料盘位置【"
+
MoveInfo
.
MoveParam
.
WareCode
+
"】【INBELT】【"
+
lineId
+
"】"
);
//更新料盘位置
//更新料盘位置
SServerManager
.
UpdateTrayLoc
(
Name
,
MoveInfo
.
MoveParam
.
WareCode
,
LocStatus
.
INBELT
,
lineId
.
ToString
());
SServerManager
.
UpdateTrayLoc
(
Name
,
MoveInfo
.
MoveParam
.
WareCode
,
LocStatus
.
INBELT
,
lineId
.
ToString
());
}
}
...
@@ -508,7 +507,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -508,7 +507,7 @@ namespace OnlineStore.DeviceLibrary
}
}
else
if
(
MoveInfo
.
MoveStep
.
Equals
(
LineMoveStep
.
PO_10_CylinderAfter
))
else
if
(
MoveInfo
.
MoveStep
.
Equals
(
LineMoveStep
.
PO_10_CylinderAfter
))
{
{
LogInfo
(
"出料【"
+
posId
+
"】处理完成!"
);
OutLog
(
"出料【"
+
posId
+
"】处理完成!"
);
MoveEndS
();
MoveEndS
();
}
}
}
}
...
...
source/DeviceLibrary/assemblymanager/SServerManager.cs
查看文件 @
8a4f38b
...
@@ -83,7 +83,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -83,7 +83,7 @@ namespace OnlineStore.DeviceLibrary
LogUtil
.
info
(
deviceName
+
"托盘【"
+
trayNum
+
"】 条码【 "
+
codeStr
+
"】料串【"
+
rfid
+
"】,获取入库库位:"
);
LogUtil
.
info
(
deviceName
+
"托盘【"
+
trayNum
+
"】 条码【 "
+
codeStr
+
"】料串【"
+
rfid
+
"】,获取入库库位:"
);
string
resultStr
=
HttpHelper
.
Post
(
server
,
""
);
string
resultStr
=
HttpHelper
.
Post
(
server
,
""
);
LogUtil
.
info
(
"CodeReceived 【"
+
server
+
"】【"
+
resultStr
+
"】"
);
LogUtil
.
info
(
deviceName
+
"CodeReceived 【"
+
server
+
"】【"
+
resultStr
+
"】"
);
//{"result":"0","msg":"","pos":"11#AC1_18_4_28","barcode":"R506072019102200414","cid":"line-ac-11"}
//{"result":"0","msg":"","pos":"11#AC1_18_4_28","barcode":"R506072019102200414","cid":"line-ac-11"}
LineOperation
serverResult
=
JsonHelper
.
DeserializeJsonToObject
<
LineOperation
>(
resultStr
);
LineOperation
serverResult
=
JsonHelper
.
DeserializeJsonToObject
<
LineOperation
>(
resultStr
);
if
(
serverResult
==
null
)
if
(
serverResult
==
null
)
...
@@ -120,9 +120,9 @@ namespace OnlineStore.DeviceLibrary
...
@@ -120,9 +120,9 @@ namespace OnlineStore.DeviceLibrary
{
{
//LineManager.Line.SetWarnMsg("入库库位重复: " + param.ToStr() + " ,入库失败!");
//LineManager.Line.SetWarnMsg("入库库位重复: " + param.ToStr() + " ,入库失败!");
//moveEquip.SetWarnMsg("入库库位重复: " + param.ToStr() + "");
//moveEquip.SetWarnMsg("入库库位重复: " + param.ToStr() + "");
return
msg
=
(
"收到服务器入库命令 "
+
"入库库位重复: "
+
param
.
ToStr
()
+
" ,入库失败!"
);
return
msg
=
deviceName
+
(
"收到服务器入库命令 "
+
"入库库位重复: "
+
param
.
ToStr
()
+
" ,入库失败!"
);
}
}
LogUtil
.
info
(
"收到入库命令: "
+
param
.
ToStr
()
+
" ,更新盘空满信息,托盘号【"
+
trayNum
+
"】,有料,"
+
ReelType
.
InStore
+
""
);
LogUtil
.
info
(
deviceName
+
"收到入库命令: "
+
param
.
ToStr
()
+
" ,更新盘空满信息,托盘号【"
+
trayNum
+
"】,有料,"
+
ReelType
.
InStore
+
""
);
TrayManager
.
UpdateTrayInfo
(
trayNum
,
true
,
ReelType
.
InStore
,
new
InOutParam
(
trayNum
,
wareNum
,
posId
,
plateH
,
plateW
,
false
));
TrayManager
.
UpdateTrayInfo
(
trayNum
,
true
,
ReelType
.
InStore
,
new
InOutParam
(
trayNum
,
wareNum
,
posId
,
plateH
,
plateW
,
false
));
...
...
source/DeviceLibrary/assemblymanager/TrayManager.cs
查看文件 @
8a4f38b
...
@@ -139,8 +139,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -139,8 +139,7 @@ namespace OnlineStore.DeviceLibrary
}
}
return
false
;
return
false
;
}
}
internal
static
bool
CheckIsRightNum
(
int
trayNum
,
int
preTrayNum
,
bool
isCanUpdateMax
=
true
)
internal
static
bool
RightTrayCode
(
int
trayNum
,
int
preTrayNum
,
bool
isCanUpdateMax
)
{
{
return
true
;
return
true
;
int
defNext
=
preTrayNum
+
1
;
int
defNext
=
preTrayNum
+
1
;
...
@@ -159,6 +158,11 @@ namespace OnlineStore.DeviceLibrary
...
@@ -159,6 +158,11 @@ namespace OnlineStore.DeviceLibrary
}
}
return
false
;
return
false
;
}
}
internal
static
bool
RightTrayCode
(
int
trayNum
,
int
preTrayNum
,
bool
isCanUpdateMax
=
true
)
{
return
true
;
return
CheckIsRightNum
(
trayNum
,
preTrayNum
,
isCanUpdateMax
);
}
internal
static
void
UpdateTrayNumError
(
int
errorStoreID
,
string
errorMsg
)
internal
static
void
UpdateTrayNumError
(
int
errorStoreID
,
string
errorMsg
)
{
{
...
...
source/DeviceLibrary/deviceLibrary/halcon/CodeManager.cs
查看文件 @
8a4f38b
...
@@ -163,7 +163,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -163,7 +163,7 @@ namespace OnlineStore.DeviceLibrary
}
}
private
static
int
codeCount
=
ConfigAppSettings
.
GetIntValue
(
Setting_Init
.
CodeCount
);
private
static
int
codeCount
=
ConfigAppSettings
.
GetIntValue
(
Setting_Init
.
CodeCount
);
[
HandleProcessCorruptedStateExceptions
]
[
HandleProcessCorruptedStateExceptions
]
public
static
List
<
string
>
CameraScan
(
List
<
string
>
cameraList
=
null
)
public
static
List
<
string
>
CameraScan
(
List
<
string
>
cameraList
,
string
deviceName
)
{
{
if
(
codeCount
<
1
)
if
(
codeCount
<
1
)
{
{
...
@@ -183,17 +183,17 @@ namespace OnlineStore.DeviceLibrary
...
@@ -183,17 +183,17 @@ namespace OnlineStore.DeviceLibrary
{
{
continue
;
continue
;
}
}
LogUtil
.
info
(
" 相机
【"
+
cameraName
+
"】开始打开相机获取图片"
);
LogUtil
.
info
(
deviceName
+
"
【"
+
cameraName
+
"】开始打开相机获取图片"
);
using
(
Bitmap
bitmap
=
GetCamerImage
(
cameraName
))
using
(
Bitmap
bitmap
=
GetCamerImage
(
cameraName
))
{
{
if
(
bitmap
==
null
)
if
(
bitmap
==
null
)
{
{
LogUtil
.
error
(
" 相机
【"
+
cameraName
+
"】获取图片失败,关闭相机"
);
LogUtil
.
error
(
deviceName
+
"
【"
+
cameraName
+
"】获取图片失败,关闭相机"
);
CloseCamera
();
CloseCamera
();
continue
;
continue
;
}
}
LogUtil
.
info
(
"相机
【"
+
cameraName
+
"】获取图片完成,开始转换图片,并扫码"
);
LogUtil
.
info
(
deviceName
+
"
【"
+
cameraName
+
"】获取图片完成,开始转换图片,并扫码"
);
System
.
Threading
.
Thread
.
Sleep
(
1
);
System
.
Threading
.
Thread
.
Sleep
(
1
);
//转换托盘大概100-150ms,不打印日志
//转换托盘大概100-150ms,不打印日志
HalconDotNet
.
HObject
ho_Image
=
HDCodeHelper
.
Bitmap2HObjectBpp24
(
bitmap
);
HalconDotNet
.
HObject
ho_Image
=
HDCodeHelper
.
Bitmap2HObjectBpp24
(
bitmap
);
...
@@ -220,7 +220,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -220,7 +220,7 @@ namespace OnlineStore.DeviceLibrary
// LogUtil.debug(" 相机【" + cameraName + "】【" + codeType + "】扫码完成:" + r);
// LogUtil.debug(" 相机【" + cameraName + "】【" + codeType + "】扫码完成:" + r);
}
}
LogUtil
.
info
(
"相机
【"
+
cameraName
+
"】扫码完成:"
+
r
);
LogUtil
.
info
(
deviceName
+
"
【"
+
cameraName
+
"】扫码完成:"
+
r
);
ho_Image
.
Dispose
();
ho_Image
.
Dispose
();
bitmap
.
Dispose
();
bitmap
.
Dispose
();
}
}
...
@@ -228,12 +228,12 @@ namespace OnlineStore.DeviceLibrary
...
@@ -228,12 +228,12 @@ namespace OnlineStore.DeviceLibrary
}
}
catch
(
AccessViolationException
e
)
catch
(
AccessViolationException
e
)
{
{
LogUtil
.
error
(
"
扫码出现AccessViolationException异常:"
+
e
.
ToString
());
LogUtil
.
error
(
deviceName
+
"
扫码出现AccessViolationException异常:"
+
e
.
ToString
());
GC
.
Collect
();
GC
.
Collect
();
}
}
catch
(
Exception
ex
)
catch
(
Exception
ex
)
{
{
LogUtil
.
error
(
"
扫码出错:"
,
ex
);
LogUtil
.
error
(
deviceName
+
"
扫码出错:"
,
ex
);
}
}
return
codeList
;
return
codeList
;
}
}
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论