Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
孙克
/
RC1250-AssemblyLine
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit 3547a0c6
由
LN
编写于
2019-10-08 10:07:39 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
1
1 个父辈
179c6ed8
全部展开
显示空白字符变更
内嵌
并排
正在显示
6 个修改的文件
包含
105 行增加
和
84 行删除
source/DeviceLibrary/assemblyLine/LineBean.cs
source/DeviceLibrary/assemblyLine/LineBean_Partial.cs
source/DeviceLibrary/assemblyLine/MoveEquip.cs
source/DeviceLibrary/assemblyLine/MoveEquip_Partial.cs
source/DeviceLibrary/deviceLibrary/halcon/CodeManager.cs
source/DeviceLibrary/server/LineServer.cs
source/DeviceLibrary/assemblyLine/LineBean.cs
查看文件 @
3547a0c
...
@@ -377,6 +377,10 @@ namespace OnlineStore.DeviceLibrary
...
@@ -377,6 +377,10 @@ namespace OnlineStore.DeviceLibrary
{
{
return
true
;
return
true
;
}
}
if
(
MoveInfo
.
MoveType
.
Equals
(
LineMoveType
.
None
).
Equals
(
false
))
{
return
true
;
}
if
(
SW12_MoveInfo
.
MoveType
.
Equals
(
LineMoveType
.
None
).
Equals
(
false
))
if
(
SW12_MoveInfo
.
MoveType
.
Equals
(
LineMoveType
.
None
).
Equals
(
false
))
{
{
return
true
;
return
true
;
...
...
source/DeviceLibrary/assemblyLine/LineBean_Partial.cs
查看文件 @
3547a0c
...
@@ -44,14 +44,11 @@ namespace OnlineStore.DeviceLibrary
...
@@ -44,14 +44,11 @@ namespace OnlineStore.DeviceLibrary
{
{
isInprocess
=
true
;
isInprocess
=
true
;
lastProTime
=
DateTime
.
Now
;
lastProTime
=
DateTime
.
Now
;
if
(!
isCanProcessLine
())
{
return
;
}
//出入料口条件: 各料仓无报警( 伺服), 各移栽装置处 于原位待机, 检测夹具IO,驱动电机运转
//出入料口条件: 各料仓无报警( 伺服), 各移栽装置处 于原位待机, 检测夹具IO,驱动电机运转
if
(
IOValue
(
IO_Type
.
DriveMotor_Run
).
Equals
(
IO_VALUE
.
LOW
))
if
(
!
isCanProcessLine
()
||
IOValue
(
IO_Type
.
DriveMotor_Run
).
Equals
(
IO_VALUE
.
LOW
))
{
{
isWaitOutGo
=
false
;
isWaitOutGo
=
false
;
isInprocess
=
false
;
return
;
return
;
}
}
...
@@ -274,6 +271,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -274,6 +271,7 @@ namespace OnlineStore.DeviceLibrary
if
(!
wait
.
IsEnd
)
if
(!
wait
.
IsEnd
)
{
{
List
<
WriteIOInfo
>
wLists
=
checkWaitInfo
.
WriteIoList
;
TimeSpan
rwSpan
=
DateTime
.
Now
-
preRWTime
;
TimeSpan
rwSpan
=
DateTime
.
Now
-
preRWTime
;
if
(
span
.
TotalMilliseconds
>
LineManager
.
Config
.
IOSingle_TimerOut
)
if
(
span
.
TotalMilliseconds
>
LineManager
.
Config
.
IOSingle_TimerOut
)
{
{
...
@@ -281,20 +279,19 @@ namespace OnlineStore.DeviceLibrary
...
@@ -281,20 +279,19 @@ namespace OnlineStore.DeviceLibrary
WarnMsg
=
Name
+
" 等待"
+
NotOkMsg
+
"超时"
;
WarnMsg
=
Name
+
" 等待"
+
NotOkMsg
+
"超时"
;
Alarm
(
LineAlarmType
.
IoSingleTimeOut
,
io
.
ElectricalDefinition
,
WarnMsg
,
checkWaitInfo
.
MoveType
);
Alarm
(
LineAlarmType
.
IoSingleTimeOut
,
io
.
ElectricalDefinition
,
WarnMsg
,
checkWaitInfo
.
MoveType
);
LogUtil
.
error
(
checkWaitInfo
.
Name
+
":"
+
wait
.
IoType
+
"等待"
+
NotOkMsg
+
"超时"
,
14
);
LogUtil
.
error
(
checkWaitInfo
.
Name
+
":"
+
checkWaitInfo
.
MoveStep
+
"等待"
+
NotOkMsg
+
"超时"
,
14
);
isOk
=
false
;
isOk
=
false
;
break
;
break
;
}
}
else
if
(
rwSpan
.
TotalSeconds
>
3
&&
span
.
TotalSeconds
>
3
&&
(
checkWaitInfo
.
WriteIoList
!=
null
)
&&
checkWaitInfo
.
WriteIoList
.
Count
>
0
)
else
if
(
rwSpan
.
TotalSeconds
>
3
&&
span
.
TotalSeconds
>
3
&&
(
wLists
!=
null
)
&&
wLists
.
Count
>
0
)
{
{
List
<
WriteIOInfo
>
wLists
=
new
List
<
WriteIOInfo
>(
checkWaitInfo
.
WriteIoList
);
preRWTime
=
DateTime
.
Now
;
preRWTime
=
DateTime
.
Now
;
string
msg
=
checkWaitInfo
.
Name
+
"
"
+
NotOkMsg
+
" 已等待"
+
Math
.
Abs
(
span
.
TotalSeconds
)
+
"秒,重写DO:"
;
string
msg
=
checkWaitInfo
.
Name
+
"
["
+
checkWaitInfo
.
MoveStep
+
"]"
+
" 已等待 "
+
NotOkMsg
+
Math
.
Abs
(
span
.
TotalSeconds
)
+
"秒,重写DO:"
;
foreach
(
WriteIOInfo
ww
in
wLists
)
foreach
(
WriteIOInfo
ww
in
wLists
)
{
{
IOMove
(
ww
.
IoType
,
ww
.
IoValue
);
IOMove
(
ww
.
IoType
,
ww
.
IoValue
);
msg
+=
"["
+
ww
.
IoType
+
"
+
"
+
ww
.
IoValue
+
"],"
;
msg
+=
"["
+
ww
.
IoType
+
"
=
"
+
ww
.
IoValue
+
"],"
;
}
}
LogUtil
.
error
(
msg
);
LogUtil
.
error
(
msg
);
}
}
...
@@ -339,7 +336,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -339,7 +336,7 @@ namespace OnlineStore.DeviceLibrary
}
}
catch
(
Exception
ex
)
catch
(
Exception
ex
)
{
{
LogUtil
.
error
(
checkWaitInfo
.
Name
+
" ["
+
checkWaitInfo
.
MoveStep
+
"] CheckWait 出错:"
+
ex
.
ToString
()
);
LogUtil
.
error
(
checkWaitInfo
.
Name
+
" ["
+
checkWaitInfo
.
MoveStep
+
"] CheckWait 出错:"
+
ex
.
StackTrace
);
}
}
}
}
...
@@ -419,7 +416,6 @@ namespace OnlineStore.DeviceLibrary
...
@@ -419,7 +416,6 @@ namespace OnlineStore.DeviceLibrary
MoveInfo
.
NewMove
(
LineMoveType
.
InStore
);
MoveInfo
.
NewMove
(
LineMoveType
.
InStore
);
MoveInfo
.
NextMoveStep
(
LineMoveStep
.
LI_00_Wait100
);
MoveInfo
.
NextMoveStep
(
LineMoveStep
.
LI_00_Wait100
);
MoveInfo
.
MoveParam
=
param
;
MoveInfo
.
MoveParam
=
param
;
preTrayNum
=
param
.
TrayNumber
;
//等待料仓验证成功,最多等待10秒,若验证不成功,直接失败
//等待料仓验证成功,最多等待10秒,若验证不成功,直接失败
MoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitTime
(
10000
));
MoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitTime
(
10000
));
...
@@ -460,6 +456,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -460,6 +456,7 @@ namespace OnlineStore.DeviceLibrary
}
}
else
else
{
{
preTrayNum
=
MoveInfo
.
MoveParam
.
TrayNumber
;
lock
(
moveEquip
.
waitInListLock
)
lock
(
moveEquip
.
waitInListLock
)
{
{
//如果当前正在出入库中,需要记录下来,等待空闲时执行
//如果当前正在出入库中,需要记录下来,等待空闲时执行
...
@@ -612,8 +609,20 @@ namespace OnlineStore.DeviceLibrary
...
@@ -612,8 +609,20 @@ namespace OnlineStore.DeviceLibrary
private
bool
SideWay12IsWait
=
false
;
private
bool
SideWay12IsWait
=
false
;
private
DateTime
SideWay34Ntime
=
DateTime
.
Now
;
private
DateTime
SideWay34Ntime
=
DateTime
.
Now
;
private
bool
SideWay34IsWait
=
false
;
private
bool
SideWay34IsWait
=
false
;
private
bool
sdIsInprocess
=
false
;
private
DateTime
sdlastProTime
=
DateTime
.
Now
;
private
void
SideWayTimerProcess
()
private
void
SideWayTimerProcess
()
{
{
TimeSpan
span
=
DateTime
.
Now
-
sdlastProTime
;
if
(
sdIsInprocess
&&
span
.
TotalSeconds
<
5
)
{
return
;
}
try
{
sdIsInprocess
=
true
;
sdlastProTime
=
DateTime
.
Now
;
//流水线转动中,并且在忙碌或出入库处理中,需要处理移栽
//流水线转动中,并且在忙碌或出入库处理中,需要处理移栽
if
(
IOValue
(
IO_Type
.
DriveMotor_Run
).
Equals
(
IO_VALUE
.
HIGH
)
&&
runStatus
>=
LineRunStatus
.
Runing
)
if
(
IOValue
(
IO_Type
.
DriveMotor_Run
).
Equals
(
IO_VALUE
.
HIGH
)
&&
runStatus
>=
LineRunStatus
.
Runing
)
{
{
...
@@ -702,6 +711,12 @@ namespace OnlineStore.DeviceLibrary
...
@@ -702,6 +711,12 @@ namespace OnlineStore.DeviceLibrary
SideWay12IsWait
=
false
;
SideWay12IsWait
=
false
;
}
}
}
}
catch
(
Exception
ex
)
{
LogUtil
.
error
(
"SideWayTimerProcess 出错:"
+
ex
.
StackTrace
);
}
sdIsInprocess
=
false
;
}
private
void
SideWay12BusyProcess
()
private
void
SideWay12BusyProcess
()
{
{
...
@@ -812,7 +827,8 @@ namespace OnlineStore.DeviceLibrary
...
@@ -812,7 +827,8 @@ namespace OnlineStore.DeviceLibrary
else
if
(
SW34_MoveInfo
.
MoveStep
.
Equals
(
LineMoveStep
.
SW02_WaitFixtureCheck
))
else
if
(
SW34_MoveInfo
.
MoveStep
.
Equals
(
LineMoveStep
.
SW02_WaitFixtureCheck
))
{
{
SW34_MoveInfo
.
NextMoveStep
(
LineMoveStep
.
SW03_TopCylinderUp
);
SW34_MoveInfo
.
NextMoveStep
(
LineMoveStep
.
SW03_TopCylinderUp
);
SWLog
(
"横移轨道34:顶升气缸上升 ,横移3阻挡上升 "
);
SWLog
(
"横移轨道34:顶升气缸上升 ,横移3阻挡上升,至少等待1000 "
);
SW34_MoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitTime
(
1000
));
IOMove
(
IO_Type
.
SidesWay3_StopCylinderDown
,
IO_VALUE
.
LOW
);
IOMove
(
IO_Type
.
SidesWay3_StopCylinderDown
,
IO_VALUE
.
LOW
);
SideWay34TopCylinderMove
(
IO_VALUE
.
LOW
,
IO_VALUE
.
HIGH
,
SW34_MoveInfo
);
SideWay34TopCylinderMove
(
IO_VALUE
.
LOW
,
IO_VALUE
.
HIGH
,
SW34_MoveInfo
);
}
}
...
...
source/DeviceLibrary/assemblyLine/MoveEquip.cs
查看文件 @
3547a0c
此文件的差异被折叠,
点击展开。
source/DeviceLibrary/assemblyLine/MoveEquip_Partial.cs
查看文件 @
3547a0c
...
@@ -90,9 +90,9 @@ namespace OnlineStore.DeviceLibrary
...
@@ -90,9 +90,9 @@ namespace OnlineStore.DeviceLibrary
ConfigIO
io
=
Config
.
getWaitIO
(
wait
.
IoType
);
ConfigIO
io
=
Config
.
getWaitIO
(
wait
.
IoType
);
WarnMsg
=
Name
+
"等待"
+
NotOkMsg
+
" 超时"
;
WarnMsg
=
Name
+
"等待"
+
NotOkMsg
+
" 超时"
;
Alarm
(
LineAlarmType
.
IoSingleTimeOut
,
io
.
ElectricalDefinition
,
WarnMsg
,
MoveInfo
.
MoveType
);
Alarm
(
LineAlarmType
.
IoSingleTimeOut
,
io
.
ElectricalDefinition
,
WarnMsg
,
MoveInfo
.
MoveType
);
LogUtil
.
error
(
MoveInfo
.
Name
+
WarnMsg
,
13
);
LogUtil
.
error
(
MoveInfo
.
Name
+
WarnMsg
,
13
);
}
}
else
if
(
rwSpan
.
TotalSeconds
>
3
&&
span
.
TotalSeconds
>
3
)
else
if
(
rwSpan
.
TotalSeconds
>
3
&&
span
.
TotalSeconds
>
3
)
{
{
preRWTime
=
DateTime
.
Now
;
preRWTime
=
DateTime
.
Now
;
string
msg
=
moveInfo
.
Name
+
" "
+
NotOkMsg
+
"已等待 "
+
Math
.
Abs
(
span
.
TotalSeconds
)
+
"秒,重写DO:"
;
string
msg
=
moveInfo
.
Name
+
" "
+
NotOkMsg
+
"已等待 "
+
Math
.
Abs
(
span
.
TotalSeconds
)
+
"秒,重写DO:"
;
...
@@ -120,7 +120,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -120,7 +120,7 @@ namespace OnlineStore.DeviceLibrary
{
{
wait
.
IsEnd
=
(
span
.
TotalMilliseconds
>=
wait
.
TimeMSeconds
);
wait
.
IsEnd
=
(
span
.
TotalMilliseconds
>=
wait
.
TimeMSeconds
);
}
}
else
if
(
wait
.
WaitType
.
Equals
(
8
))
else
if
(
wait
.
WaitType
.
Equals
(
8
))
{
{
string
posId
=
moveInfo
.
MoveParam
.
PosId
;
string
posId
=
moveInfo
.
MoveParam
.
PosId
;
int
id
=
moveInfo
.
MoveParam
.
GetStoreId
();
int
id
=
moveInfo
.
MoveParam
.
GetStoreId
();
...
@@ -130,9 +130,10 @@ namespace OnlineStore.DeviceLibrary
...
@@ -130,9 +130,10 @@ namespace OnlineStore.DeviceLibrary
{
{
int
storeId
=
moveInfo
.
MoveParam
.
GetStoreId
();
int
storeId
=
moveInfo
.
MoveParam
.
GetStoreId
();
wait
.
IsEnd
=
LineServer
.
BoxCanReviceTray
(
storeId
);
wait
.
IsEnd
=
LineServer
.
BoxCanReviceTray
(
storeId
);
}
else
if
(
wait
.
WaitType
.
Equals
(
10
))
}
else
if
(
wait
.
WaitType
.
Equals
(
10
))
{
{
//
wait.IsEnd = LineManager.Line.SideWay34HasTray().Equals(false);
wait
.
IsEnd
=
LineManager
.
Line
.
SideWay34HasTray
().
Equals
(
false
);
}
}
if
(
wait
.
IsEnd
&&
moveInfo
.
OneWaitCanEndStep
)
if
(
wait
.
IsEnd
&&
moveInfo
.
OneWaitCanEndStep
)
{
{
...
@@ -153,7 +154,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -153,7 +154,7 @@ 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
)
+
"]秒"
;
LogUtil
.
error
(
WarnMsg
,
18
);
LogUtil
.
error
(
WarnMsg
,
18
);
Alarm
(
LineAlarmType
.
IoSingleTimeOut
,
""
,
WarnMsg
,
moveInfo
.
MoveType
);
Alarm
(
LineAlarmType
.
IoSingleTimeOut
,
""
,
WarnMsg
,
moveInfo
.
MoveType
);
}
}
...
@@ -540,7 +541,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -540,7 +541,7 @@ namespace OnlineStore.DeviceLibrary
{
{
reIndex
=
i
;
reIndex
=
i
;
currCode
=
cc
;
currCode
=
cc
;
LogInfo
(
"*******
********入库*****需要入库,托盘号【"
+
currMoveTrayNum
+
"】,是排队列表中的入库信息【"
+
currCode
.
ToStr
()
+
"】 ,
入库移栽"
);
LogInfo
(
"*******
托盘"
+
currMoveTrayNum
+
"需要入库【"
+
currCode
.
ToStr
()
+
"】 ,开始
入库移栽"
);
SecondMoveInfo
.
MoveParam
=
new
InOutParam
(
cc
.
TrayNumber
,
cc
.
WareCode
,
cc
.
PosId
,
cc
.
PlateH
,
cc
.
PlateW
);
SecondMoveInfo
.
MoveParam
=
new
InOutParam
(
cc
.
TrayNumber
,
cc
.
WareCode
,
cc
.
PosId
,
cc
.
PlateH
,
cc
.
PlateW
);
break
;
break
;
}
}
...
@@ -550,8 +551,8 @@ namespace OnlineStore.DeviceLibrary
...
@@ -550,8 +551,8 @@ namespace OnlineStore.DeviceLibrary
waitInStoreList
.
RemoveAt
(
reIndex
);
waitInStoreList
.
RemoveAt
(
reIndex
);
if
(!
LineServer
.
BoxCanInStore
(
DeviceID
))
if
(!
LineServer
.
BoxCanInStore
(
DeviceID
))
{
{
LogUtil
.
info
(
Name
+
"*******
********需要入库 【"
+
currCode
.
ToStr
()
+
"】 ,料仓未上线或出库中,入库失败
"
);
LogUtil
.
info
(
Name
+
"*******
托盘"
+
currMoveTrayNum
+
"需要入库【"
+
currCode
.
ToStr
()
+
"】,BoxCanInStore验证失败,先移栽再等待料仓可入库,开始入库移栽
"
);
return
fals
e
;
return
tru
e
;
}
}
else
else
{
{
...
@@ -578,7 +579,8 @@ namespace OnlineStore.DeviceLibrary
...
@@ -578,7 +579,8 @@ namespace OnlineStore.DeviceLibrary
CheckLog
(
"托盘检测(流水线阻挡)SecondStoreMove:(MIO_03_StopCylinder2Down 阻挡气缸1-1上升)"
);
CheckLog
(
"托盘检测(流水线阻挡)SecondStoreMove:(MIO_03_StopCylinder2Down 阻挡气缸1-1上升)"
);
SecondMoveInfo
.
NextMoveStep
(
LineMoveStep
.
MIO_03_StopCylinder2Down
);
SecondMoveInfo
.
NextMoveStep
(
LineMoveStep
.
MIO_03_StopCylinder2Down
);
IOMove
(
IO_Type
.
StopCylinder_Down1
,
IO_VALUE
.
LOW
);
IOMove
(
IO_Type
.
StopCylinder_Down1
,
IO_VALUE
.
LOW
);
SecondMoveInfo
.
EndStepWait
();
SecondMoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitIO
(
IO_Type
.
StopCylinder_Down1
,
IO_VALUE
.
LOW
));
// SecondMoveInfo.EndStepWait();
}
}
else
else
{
{
...
@@ -590,10 +592,11 @@ namespace OnlineStore.DeviceLibrary
...
@@ -590,10 +592,11 @@ namespace OnlineStore.DeviceLibrary
//托盘在第一个阻挡处
//托盘在第一个阻挡处
SecondMoveInfo
.
NewMove
(
LineMoveType
.
CheckFixture
);
SecondMoveInfo
.
NewMove
(
LineMoveType
.
CheckFixture
);
SecondMoveInfo
.
NextMoveStep
(
LineMoveStep
.
MIO_01_StopCylinder1Down
);
SecondMoveInfo
.
NextMoveStep
(
LineMoveStep
.
MIO_01_StopCylinder1Down
);
CheckLog
(
" 托盘检测:料盘检测 SecondStoreMove(MIO_01_StopCylinder1Down阻挡气缸1-1下降
,等待夹具检测4=1
,最多等待1秒)"
);
CheckLog
(
" 托盘检测:料盘检测 SecondStoreMove(MIO_01_StopCylinder1Down阻挡气缸1-1下降 ,最多等待1秒)"
);
IOMove
(
IO_Type
.
StopCylinder_Down1
,
IO_VALUE
.
HIGH
);
IOMove
(
IO_Type
.
StopCylinder_Down1
,
IO_VALUE
.
HIGH
);
SecondMoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitIO
(
IO_Type
.
Fixture_Check_4
,
IO_VALUE
.
HIGH
));
SecondMoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitIO
(
IO_Type
.
StopCylinder_Down1
,
IO_VALUE
.
HIGH
));
SecondMoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitTime
(
1000
));
// SecondMoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.Fixture_Check_4, IO_VALUE.HIGH));
SecondMoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitTime
(
1500
));
}
}
}
}
private
void
CheckFixtureProcess
()
private
void
CheckFixtureProcess
()
...
@@ -617,6 +620,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -617,6 +620,7 @@ namespace OnlineStore.DeviceLibrary
CheckLog
(
"托盘检测(流水线阻挡)SecondStoreMove:(MIO_02_FixtureCheck 阻挡气缸1-1上升,等待夹具检测4=1)"
);
CheckLog
(
"托盘检测(流水线阻挡)SecondStoreMove:(MIO_02_FixtureCheck 阻挡气缸1-1上升,等待夹具检测4=1)"
);
SecondMoveInfo
.
NextMoveStep
(
LineMoveStep
.
MIO_03_StopCylinder2Down
);
SecondMoveInfo
.
NextMoveStep
(
LineMoveStep
.
MIO_03_StopCylinder2Down
);
IOMove
(
IO_Type
.
StopCylinder_Down1
,
IO_VALUE
.
LOW
);
IOMove
(
IO_Type
.
StopCylinder_Down1
,
IO_VALUE
.
LOW
);
SecondMoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitIO
(
IO_Type
.
StopCylinder_Down1
,
IO_VALUE
.
LOW
));
SecondMoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitIO
(
IO_Type
.
Fixture_Check_4
,
IO_VALUE
.
HIGH
));
SecondMoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitIO
(
IO_Type
.
Fixture_Check_4
,
IO_VALUE
.
HIGH
));
}
}
else
if
(
SecondMoveInfo
.
MoveStep
.
Equals
(
LineMoveStep
.
MIO_02_FixtureCheck
))
else
if
(
SecondMoveInfo
.
MoveStep
.
Equals
(
LineMoveStep
.
MIO_02_FixtureCheck
))
...
@@ -624,7 +628,8 @@ namespace OnlineStore.DeviceLibrary
...
@@ -624,7 +628,8 @@ namespace OnlineStore.DeviceLibrary
CheckLog
(
"托盘检测(流水线阻挡)SecondStoreMove:(MIO_03_StopCylinder2Down 阻挡气缸1-1上升)"
);
CheckLog
(
"托盘检测(流水线阻挡)SecondStoreMove:(MIO_03_StopCylinder2Down 阻挡气缸1-1上升)"
);
SecondMoveInfo
.
NextMoveStep
(
LineMoveStep
.
MIO_03_StopCylinder2Down
);
SecondMoveInfo
.
NextMoveStep
(
LineMoveStep
.
MIO_03_StopCylinder2Down
);
IOMove
(
IO_Type
.
StopCylinder_Down1
,
IO_VALUE
.
LOW
);
IOMove
(
IO_Type
.
StopCylinder_Down1
,
IO_VALUE
.
LOW
);
SecondMoveInfo
.
EndStepWait
();
SecondMoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitIO
(
IO_Type
.
StopCylinder_Down1
,
IO_VALUE
.
LOW
));
// SecondMoveInfo.EndStepWait();
}
}
else
if
(
SecondMoveInfo
.
MoveStep
.
Equals
(
LineMoveStep
.
MIO_03_StopCylinder2Down
))
else
if
(
SecondMoveInfo
.
MoveStep
.
Equals
(
LineMoveStep
.
MIO_03_StopCylinder2Down
))
{
{
...
@@ -681,12 +686,12 @@ namespace OnlineStore.DeviceLibrary
...
@@ -681,12 +686,12 @@ namespace OnlineStore.DeviceLibrary
}
}
CheckLog
(
"托盘放行 SecondStoreMove:(MO_07_WaitCanGo ,移栽2,需要判断是否可以放盘通过,最多等待10000)"
);
CheckLog
(
"托盘放行 SecondStoreMove:(MO_07_WaitCanGo ,移栽2,需要判断是否可以放盘通过,最多等待10000)"
);
SecondMoveInfo
.
NextMoveStep
(
LineMoveStep
.
MO_07_WaitCanGo
);
SecondMoveInfo
.
NextMoveStep
(
LineMoveStep
.
MO_07_WaitCanGo
);
//
if (DeviceID.Equals(2))
if
(
DeviceID
.
Equals
(
2
))
//
{
{
//
SecondMoveInfo.WaitList.Add(WaitResultInfo.WaitTime(10000));
SecondMoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitTime
(
10000
));
//
SecondMoveInfo.WaitList.Add(WaitResultInfo.WaitSideWay());
SecondMoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitSideWay
());
//
SecondMoveInfo.OneWaitCanEndStep = true;
SecondMoveInfo
.
OneWaitCanEndStep
=
true
;
//
}
}
}
}
}
}
catch
(
Exception
ex
)
catch
(
Exception
ex
)
...
@@ -761,12 +766,12 @@ namespace OnlineStore.DeviceLibrary
...
@@ -761,12 +766,12 @@ namespace OnlineStore.DeviceLibrary
{
{
CheckLog
(
"托盘放行 SecondStoreMove:(MO_07_WaitCanGo ,移栽2,需要判断是否可以放盘通过,最多等待10000)"
);
CheckLog
(
"托盘放行 SecondStoreMove:(MO_07_WaitCanGo ,移栽2,需要判断是否可以放盘通过,最多等待10000)"
);
SecondMoveInfo
.
NextMoveStep
(
LineMoveStep
.
MO_07_WaitCanGo
);
SecondMoveInfo
.
NextMoveStep
(
LineMoveStep
.
MO_07_WaitCanGo
);
//
if (DeviceID.Equals(2))
if
(
DeviceID
.
Equals
(
2
))
//
{
{
//
SecondMoveInfo.WaitList.Add(WaitResultInfo.WaitTime(10000));
SecondMoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitTime
(
10000
));
//
SecondMoveInfo.WaitList.Add(WaitResultInfo.WaitSideWay());
SecondMoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitSideWay
());
//
SecondMoveInfo.OneWaitCanEndStep = true;
SecondMoveInfo
.
OneWaitCanEndStep
=
true
;
//
}
}
}
}
else
if
(
SecondMoveInfo
.
MoveStep
.
Equals
(
LineMoveStep
.
MO_07_WaitCanGo
))
else
if
(
SecondMoveInfo
.
MoveStep
.
Equals
(
LineMoveStep
.
MO_07_WaitCanGo
))
...
@@ -774,7 +779,8 @@ namespace OnlineStore.DeviceLibrary
...
@@ -774,7 +779,8 @@ namespace OnlineStore.DeviceLibrary
CheckLog
(
"托盘放行 SecondStoreMove:(MO_10_StopCylinder2_Down ,阻挡气缸1-2下降)"
);
CheckLog
(
"托盘放行 SecondStoreMove:(MO_10_StopCylinder2_Down ,阻挡气缸1-2下降)"
);
SecondMoveInfo
.
NextMoveStep
(
LineMoveStep
.
MO_10_StopCylinder2_Down
);
SecondMoveInfo
.
NextMoveStep
(
LineMoveStep
.
MO_10_StopCylinder2_Down
);
IOMove
(
IO_Type
.
StopCylinder_Down2
,
IO_VALUE
.
HIGH
);
IOMove
(
IO_Type
.
StopCylinder_Down2
,
IO_VALUE
.
HIGH
);
SecondMoveInfo
.
EndStepWait
();
SecondMoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitIO
(
IO_Type
.
StopCylinder_Down2
,
IO_VALUE
.
HIGH
));
// SecondMoveInfo.EndStepWait();
}
}
else
if
(
SecondMoveInfo
.
MoveStep
.
Equals
(
LineMoveStep
.
MO_10_StopCylinder2_Down
))
else
if
(
SecondMoveInfo
.
MoveStep
.
Equals
(
LineMoveStep
.
MO_10_StopCylinder2_Down
))
{
{
...
@@ -787,6 +793,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -787,6 +793,7 @@ namespace OnlineStore.DeviceLibrary
SecondMoveInfo
.
NextMoveStep
(
LineMoveStep
.
MO_12_StopCylinder_Back
);
SecondMoveInfo
.
NextMoveStep
(
LineMoveStep
.
MO_12_StopCylinder_Back
);
CheckLog
(
"托盘放行 SecondStoreMove:(MO_12_StopCylinder_Back , 阻挡气缸1-2上升 )"
);
CheckLog
(
"托盘放行 SecondStoreMove:(MO_12_StopCylinder_Back , 阻挡气缸1-2上升 )"
);
IOMove
(
IO_Type
.
StopCylinder_Down2
,
IO_VALUE
.
LOW
);
IOMove
(
IO_Type
.
StopCylinder_Down2
,
IO_VALUE
.
LOW
);
SecondMoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitIO
(
IO_Type
.
StopCylinder_Down2
,
IO_VALUE
.
LOW
));
SecondMoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitTime
(
200
));
SecondMoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitTime
(
200
));
}
}
else
if
(
SecondMoveInfo
.
MoveStep
.
Equals
(
LineMoveStep
.
MO_12_StopCylinder_Back
))
else
if
(
SecondMoveInfo
.
MoveStep
.
Equals
(
LineMoveStep
.
MO_12_StopCylinder_Back
))
...
@@ -845,7 +852,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -845,7 +852,7 @@ namespace OnlineStore.DeviceLibrary
public
void
LogInfo
(
string
logInfo
)
public
void
LogInfo
(
string
logInfo
)
{
{
LogUtil
.
info
(
Name
+
logInfo
);
LogUtil
.
info
(
Name
+
logInfo
);
}
}
}
}
}
}
source/DeviceLibrary/deviceLibrary/halcon/CodeManager.cs
查看文件 @
3547a0c
...
@@ -88,17 +88,13 @@ namespace OnlineStore.DeviceLibrary
...
@@ -88,17 +88,13 @@ namespace OnlineStore.DeviceLibrary
{
{
if
(
balserNameList
.
Contains
(
cameraName
))
if
(
balserNameList
.
Contains
(
cameraName
))
{
{
bool
result
=
BaslerCamera
.
Instance
.
IsOpen
;
bool
result
=
BaslerCamera
.
Instance
.
Open
(
cameraName
);
if
(!
result
)
// LogUtil.info("打开相机:" + cameraName + "(" + result + ")");
{
result
=
BaslerCamera
.
Instance
.
Open
(
cameraName
);
LogUtil
.
info
(
"打开相机:"
+
cameraName
+
"("
+
result
+
")"
);
}
if
(
result
)
if
(
result
)
{
{
BaslerCamera
.
Instance
.
GrabOne
();
BaslerCamera
.
Instance
.
GrabOne
();
bitm
=
BaslerCamera
.
Instance
.
Image
;
bitm
=
BaslerCamera
.
Instance
.
Image
;
//
BaslerCamera.Instance.Close();
BaslerCamera
.
Instance
.
Close
();
}
}
else
else
{
{
...
@@ -107,17 +103,13 @@ namespace OnlineStore.DeviceLibrary
...
@@ -107,17 +103,13 @@ namespace OnlineStore.DeviceLibrary
}
}
else
if
(
hikNameList
.
Contains
(
cameraName
))
else
if
(
hikNameList
.
Contains
(
cameraName
))
{
{
bool
result
=
HIKCamera
.
Instance
.
IsOpen
;
bool
result
=
HIKCamera
.
Instance
.
Open
(
cameraName
);
if
(!
result
)
// LogUtil.info("打开相机:" + cameraName + "(" + result + ")");
{
result
=
HIKCamera
.
Instance
.
Open
(
cameraName
);
LogUtil
.
info
(
"打开相机:"
+
cameraName
+
"("
+
result
+
")"
);
}
if
(
result
)
if
(
result
)
{
{
HIKCamera
.
Instance
.
GrabOne
();
HIKCamera
.
Instance
.
GrabOne
();
bitm
=
HIKCamera
.
Instance
.
Image
;
bitm
=
HIKCamera
.
Instance
.
Image
;
//
HIKCamera.Instance.Close();
HIKCamera
.
Instance
.
Close
();
}
}
else
else
{
{
...
...
source/DeviceLibrary/server/LineServer.cs
查看文件 @
3547a0c
...
@@ -38,7 +38,8 @@ namespace OnlineStore.DeviceLibrary
...
@@ -38,7 +38,8 @@ namespace OnlineStore.DeviceLibrary
{
{
return
true
;
return
true
;
}
}
}
return
false
;
}
return
false
;
}
}
/// <summary>
/// <summary>
/// 移栽装置拦截托盘时, 判断是否可以入库,入库执行可以入库,出库过程中不能入库
/// 移栽装置拦截托盘时, 判断是否可以入库,入库执行可以入库,出库过程中不能入库
...
@@ -74,13 +75,13 @@ namespace OnlineStore.DeviceLibrary
...
@@ -74,13 +75,13 @@ namespace OnlineStore.DeviceLibrary
/// <summary>
/// <summary>
/// 判断库位是否验证成功
/// 判断库位是否验证成功
/// </summary>
/// </summary>
public
static
bool
RightInPosId
(
int
id
,
string
posId
)
public
static
bool
RightInPosId
(
int
id
,
string
posId
)
{
{
BoxInfo
box
=
GetBoxInfo
(
id
);
BoxInfo
box
=
GetBoxInfo
(
id
);
if
(
box
!=
null
)
if
(
box
!=
null
)
{
{
TimeSpan
span
=
DateTime
.
Now
-
box
.
LastMsgTime
;
TimeSpan
span
=
DateTime
.
Now
-
box
.
LastMsgTime
;
if
(
span
.
TotalSeconds
<
ClientKeepSecond
)
if
(
span
.
TotalSeconds
<
ClientKeepSecond
)
{
{
if
(
box
.
WaitInStoreList
!=
null
&&
box
.
WaitInStoreList
.
Contains
(
posId
))
if
(
box
.
WaitInStoreList
!=
null
&&
box
.
WaitInStoreList
.
Contains
(
posId
))
{
{
...
@@ -90,22 +91,20 @@ namespace OnlineStore.DeviceLibrary
...
@@ -90,22 +91,20 @@ namespace OnlineStore.DeviceLibrary
}
}
return
false
;
return
false
;
}
}
/// <summary>
public
static
bool
IsInStorePro
(
int
id
)
/// 移栽装置送盘到料仓门口时,需要判断是否可以将盘送入
/// </summary>
/// <param name="id"></param>
/// <returns></returns>
public
static
bool
BoxCanReviceTray
(
int
id
)
{
{
BoxInfo
box
=
GetBoxInfo
(
id
);
BoxInfo
box
=
GetBoxInfo
(
id
);
if
(
box
!=
null
)
{
TimeSpan
span
=
DateTime
.
Now
-
box
.
LastMsgTime
;
TimeSpan
span
=
DateTime
.
Now
-
box
.
LastMsgTime
;
if
(
span
.
TotalSeconds
<
ClientKeepSecond
&&
box
.
HasTray
.
Equals
(
0
)&&
box
.
SAlarmType
.
Equals
(
LineAlarmType
.
None
)
)
if
(
box
!=
null
&&
span
.
TotalSeconds
<
ClientKeepSecond
)
{
{
LineStatus
status
=
(
LineStatus
)
box
.
SStatus
;
LineRunStatus
runs
=
(
LineRunStatus
)
box
.
SRunStatus
;
LineRunStatus
runs
=
(
LineRunStatus
)
box
.
SRunStatus
;
if
(
runs
.
Equals
(
LineRunStatus
.
Runing
))
if
(
runs
.
Equals
(
LineRunStatus
.
Busy
))
{
if
(
status
.
Equals
(
LineStatus
.
InStoreEnd
)
||
status
.
Equals
(
LineStatus
.
InStoreExecute
))
{
{
return
true
;
return
true
;
}
}
...
@@ -113,20 +112,22 @@ namespace OnlineStore.DeviceLibrary
...
@@ -113,20 +112,22 @@ namespace OnlineStore.DeviceLibrary
}
}
return
false
;
return
false
;
}
}
public
static
bool
IsInStorePro
(
int
id
)
/// <summary>
/// 移栽装置送盘到料仓门口时,需要判断是否可以将盘送入
/// </summary>
/// <param name="id"></param>
/// <returns></returns>
public
static
bool
BoxCanReviceTray
(
int
id
)
{
{
BoxInfo
box
=
GetBoxInfo
(
id
);
BoxInfo
box
=
GetBoxInfo
(
id
);
if
(
box
!=
null
)
{
TimeSpan
span
=
DateTime
.
Now
-
box
.
LastMsgTime
;
TimeSpan
span
=
DateTime
.
Now
-
box
.
LastMsgTime
;
if
(
span
.
TotalSeconds
<
ClientKeepSecond
&&
box
.
HasTray
.
Equals
(
0
)
&&
box
.
SAlarmType
.
Equals
(
LineAlarmType
.
None
))
if
(
box
!=
null
&&
span
.
TotalSeconds
<
ClientKeepSecond
)
{
{
LineStatus
status
=
(
LineStatus
)
box
.
SStatus
;
LineRunStatus
runs
=
(
LineRunStatus
)
box
.
SRunStatus
;
LineRunStatus
runs
=
(
LineRunStatus
)
box
.
SRunStatus
;
if
(
runs
.
Equals
(
LineRunStatus
.
Busy
))
if
(
runs
.
Equals
(
LineRunStatus
.
Runing
))
{
if
(
status
.
Equals
(
LineStatus
.
InStoreEnd
)
||
status
.
Equals
(
LineStatus
.
InStoreExecute
))
{
{
return
true
;
return
true
;
}
}
...
@@ -192,11 +193,11 @@ namespace OnlineStore.DeviceLibrary
...
@@ -192,11 +193,11 @@ namespace OnlineStore.DeviceLibrary
LogUtil
.
error
(
LOGGER
,
"关闭 监听出错:"
+
ex
.
ToString
());
LogUtil
.
error
(
LOGGER
,
"关闭 监听出错:"
+
ex
.
ToString
());
}
}
}
}
public
static
bool
UpdateBoxDebug
(
int
id
,
int
isDebug
)
public
static
bool
UpdateBoxDebug
(
int
id
,
int
isDebug
)
{
{
if
(
ClientMap
.
ContainsKey
(
id
))
if
(
ClientMap
.
ContainsKey
(
id
))
{
{
Dictionary
<
string
,
object
>
paramList
=
new
Dictionary
<
string
,
object
>();
Dictionary
<
string
,
object
>
paramList
=
new
Dictionary
<
string
,
object
>();
paramList
.
Add
(
S_Cmd
,
cmd_updateDebug
);
paramList
.
Add
(
S_Cmd
,
cmd_updateDebug
);
int
canOutStore
=
LineManager
.
Line
.
CanOutStore
(
id
)
?
1
:
0
;
int
canOutStore
=
LineManager
.
Line
.
CanOutStore
(
id
)
?
1
:
0
;
paramList
.
Add
(
S_CanOutStore
,
canOutStore
);
paramList
.
Add
(
S_CanOutStore
,
canOutStore
);
...
@@ -228,7 +229,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -228,7 +229,7 @@ namespace OnlineStore.DeviceLibrary
bool
result
=
SendStrToClient
(
client
,
msg
);
bool
result
=
SendStrToClient
(
client
,
msg
);
if
(!
result
)
if
(!
result
)
{
{
LogUtil
.
error
(
"StartInStore【"
+
id
+
"】【"
+
msg
+
"】失败"
);
LogUtil
.
error
(
"StartInStore【"
+
id
+
"】【"
+
msg
+
"】失败"
);
}
}
}
}
return
false
;
return
false
;
...
@@ -276,7 +277,8 @@ namespace OnlineStore.DeviceLibrary
...
@@ -276,7 +277,8 @@ namespace OnlineStore.DeviceLibrary
// LogUtil.info("CheckInStorePos【" + id + "】【" + msg + "】发送成功");
// LogUtil.info("CheckInStorePos【" + id + "】【" + msg + "】发送成功");
}
}
}
}
}
catch
(
Exception
ex
)
}
catch
(
Exception
ex
)
{
{
LogUtil
.
error
(
"CheckInStorePos【"
+
id
+
"】【"
+
param
.
ToStr
()
+
"】失败"
);
LogUtil
.
error
(
"CheckInStorePos【"
+
id
+
"】【"
+
param
.
ToStr
()
+
"】失败"
);
}
}
...
@@ -306,7 +308,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -306,7 +308,7 @@ namespace OnlineStore.DeviceLibrary
return
result
+
"\r"
;
return
result
+
"\r"
;
}
}
private
static
object
MapLock
=
""
;
private
static
object
MapLock
=
""
;
private
static
void
SaveBoxClient
(
int
id
,
BoxInfo
box
,
Client
client
)
private
static
void
SaveBoxClient
(
int
id
,
BoxInfo
box
,
Client
client
)
{
{
lock
(
MapLock
)
lock
(
MapLock
)
{
{
...
@@ -336,7 +338,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -336,7 +338,7 @@ namespace OnlineStore.DeviceLibrary
}
}
catch
(
Exception
ex
)
catch
(
Exception
ex
)
{
{
LogUtil
.
error
(
"处理料仓消息【"
+
msg
+
"】出错:"
+
ex
.
ToString
());
LogUtil
.
error
(
"处理料仓消息【"
+
msg
+
"】出错:"
+
ex
.
ToString
());
}
}
}
}
...
@@ -349,14 +351,14 @@ namespace OnlineStore.DeviceLibrary
...
@@ -349,14 +351,14 @@ namespace OnlineStore.DeviceLibrary
LogUtil
.
debug
(
"收到【"
+
add
+
"】的消息【"
+
msg
+
"】"
);
LogUtil
.
debug
(
"收到【"
+
add
+
"】的消息【"
+
msg
+
"】"
);
StoreSendBean
storeSMsg
=
JsonHelper
.
DeserializeJsonToObject
<
StoreSendBean
>(
msg
);
StoreSendBean
storeSMsg
=
JsonHelper
.
DeserializeJsonToObject
<
StoreSendBean
>(
msg
);
if
(
storeSMsg
==
null
)
if
(
storeSMsg
==
null
)
{
{
LogUtil
.
error
(
"收到【"
+
add
+
"】的消息【"
+
msg
+
"】,解析失败"
);
LogUtil
.
error
(
"收到【"
+
add
+
"】的消息【"
+
msg
+
"】,解析失败"
);
}
}
else
else
{
{
int
id
=
storeSMsg
.
StoreId
;
int
id
=
storeSMsg
.
StoreId
;
BoxInfo
box
=
new
BoxInfo
(
storeSMsg
.
StoreId
,
storeSMsg
.
Cid
,
storeSMsg
.
Seq
,
storeSMsg
.
SStatus
,
storeSMsg
.
SRunStatus
,
storeSMsg
.
DoorHasTray
,
storeSMsg
.
AlarmType
,
storeSMsg
.
WaitInStoreList
);
BoxInfo
box
=
new
BoxInfo
(
storeSMsg
.
StoreId
,
storeSMsg
.
Cid
,
storeSMsg
.
Seq
,
storeSMsg
.
SStatus
,
storeSMsg
.
SRunStatus
,
storeSMsg
.
DoorHasTray
,
storeSMsg
.
AlarmType
,
storeSMsg
.
WaitInStoreList
);
SaveBoxClient
(
id
,
box
,
client
);
SaveBoxClient
(
id
,
box
,
client
);
string
cmd
=
storeSMsg
.
Cmd
;
string
cmd
=
storeSMsg
.
Cmd
;
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论