Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
李娜
/
SO664-AssemblyLine
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit e9a16f1e
由
LN
编写于
2023-08-24 21:51:19 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
hy动作优化
1 个父辈
43e6854f
显示空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
122 行增加
和
33 行删除
source/DeviceLibrary/assemblyLine/HY/HY_C1Line.cs
source/DeviceLibrary/assemblyLine/HY/HY_C1Line.cs
查看文件 @
e9a16f1
...
...
@@ -219,8 +219,8 @@ namespace OnlineStore.DeviceLibrary
private
void
CheckFixture
()
{
if
(
Monitor
.
TryEnter
(
lockObj
,
TrayManager
.
mTimeOut
))
{
//
if (Monitor.TryEnter(lockObj, TrayManager.mTimeOut))
//
{
try
{
if
(
MoveInfo
.
MoveType
.
Equals
(
LineMoveType
.
None
).
Equals
(
false
))
...
...
@@ -234,28 +234,7 @@ namespace OnlineStore.DeviceLibrary
{
if
(
CheckStopWatch
(
trayCheckWait
,
TrayWaitTime
,
true
))
{
//托盘在工位阻挡处
MoveInfo
.
NewMove
(
LineMoveType
.
Fixture
);
runStatus
=
LineRunStatus
.
Busy
;
MoveInfo
.
NextMoveStep
(
LineMoveStep
.
HY03_FrontStopUp
);
if
(
DeviceID
.
Equals
(
219
)
||
DeviceID
.
Equals
(
203
))
{
LogInfo
(
"托盘检测,"
+
MoveInfo
.
SLog
+
" 检测到托盘 ,阻挡上升"
);
}
else
{
CheckLog
(
"托盘检测,"
+
MoveInfo
.
SLog
+
" 检测到托盘 ,阻挡上升"
);
}
if
(
Config
.
DOList
.
ContainsKey
(
IO_Type
.
HY_FrontStopDown
))
{
IOMove
(
IO_Type
.
HY_FrontStopDown
,
IO_VALUE
.
LOW
);
//MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.HY_FrontStopDown, IO_VALUE.LOW));
}
IOMove
(
IO_Type
.
HY_StopDown
,
IO_VALUE
.
LOW
);
IOMove
(
IO_Type
.
HY_OL_StopDown
,
IO_VALUE
.
LOW
);
MoveInfo
.
OneWaitCanEndStep
=
true
;
MoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitIO
(
IO_Type
.
HY_TrayCheck
,
IO_VALUE
.
HIGH
));
MoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitTime
(
20000
));
TrayStart_HY03_FrontStopUp
();
}
}
else
...
...
@@ -273,6 +252,43 @@ namespace OnlineStore.DeviceLibrary
{
if
(
CheckStopWatch
(
frontTrayCheckWait
,
TrayWaitTime
,
false
)
&&
check2IsOk
)
{
TrayStart_HY02_FrontStopDown
();
}
}
else
if
(
Config
.
IsOutLineOut
&&
IOValue
(
IO_Type
.
HY_OL_Tray_Check
).
Equals
(
IO_VALUE
.
HIGH
))
{
HY71_OL_Wait
();
}
}
}
}
catch
(
Exception
ex
)
{
LogUtil
.
error
(
Name
+
" CheckFixture "
+
" 出错:"
+
ex
.
ToString
());
}
// finally
// {
// Monitor.Exit(lockObj);
// }
//}
//else
//{
// LogUtil.error(Name + " CheckFixture " + "失败,未得到锁");
//}
}
private
void
TrayStart_HY02_FrontStopDown
()
{
string
mName
=
" TrayStart_HY02_FrontStopDown "
;
if
(
Monitor
.
TryEnter
(
lockObj
,
TrayManager
.
mTimeOut
))
{
try
{
if
(
MoveInfo
.
MoveType
.
Equals
(
LineMoveType
.
None
).
Equals
(
false
))
{
LogUtil
.
error
(
Name
+
mName
+
" 不在空闲中,直接返回 "
);
return
;
}
StopDownCount
=
0
;
preTrayIsC1Line
=
true
;
//托盘在前阻挡处
...
...
@@ -298,30 +314,84 @@ namespace OnlineStore.DeviceLibrary
MoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitTime
(
10000
));
IOMove
(
IO_Type
.
HY_OL_StopDown
,
IO_VALUE
.
LOW
);
}
catch
(
Exception
ex
)
{
LogUtil
.
error
(
Name
+
mName
+
" 出错:"
+
ex
.
ToString
());
}
else
if
(
Config
.
IsOutLineOut
&&
IOValue
(
IO_Type
.
HY_OL_Tray_Check
).
Equals
(
IO_VALUE
.
HIGH
))
finally
{
HY71_OL_Wait
(
);
Monitor
.
Exit
(
lockObj
);
}
}
else
{
LogUtil
.
error
(
Name
+
mName
+
"失败,未得到锁"
);
}
}
private
void
TrayStart_HY03_FrontStopUp
()
{
string
logName
=
" TrayStart_HY03_FrontStopUp "
;
if
(
Monitor
.
TryEnter
(
lockObj
,
TrayManager
.
mTimeOut
))
{
try
{
if
(
MoveInfo
.
MoveType
.
Equals
(
LineMoveType
.
None
).
Equals
(
false
))
{
LogUtil
.
error
(
Name
+
logName
+
" 不在空闲中,直接返回 "
);
return
;
}
//托盘在工位阻挡处
MoveInfo
.
NewMove
(
LineMoveType
.
Fixture
);
runStatus
=
LineRunStatus
.
Busy
;
MoveInfo
.
NextMoveStep
(
LineMoveStep
.
HY03_FrontStopUp
);
if
(
DeviceID
.
Equals
(
219
)
||
DeviceID
.
Equals
(
203
))
{
LogInfo
(
"托盘检测,"
+
MoveInfo
.
SLog
+
" 检测到托盘 ,阻挡上升"
);
}
else
{
CheckLog
(
"托盘检测,"
+
MoveInfo
.
SLog
+
" 检测到托盘 ,阻挡上升"
);
}
if
(
Config
.
DOList
.
ContainsKey
(
IO_Type
.
HY_FrontStopDown
))
{
IOMove
(
IO_Type
.
HY_FrontStopDown
,
IO_VALUE
.
LOW
);
//MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.HY_FrontStopDown, IO_VALUE.LOW));
}
IOMove
(
IO_Type
.
HY_StopDown
,
IO_VALUE
.
LOW
);
IOMove
(
IO_Type
.
HY_OL_StopDown
,
IO_VALUE
.
LOW
);
MoveInfo
.
OneWaitCanEndStep
=
true
;
MoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitIO
(
IO_Type
.
HY_TrayCheck
,
IO_VALUE
.
HIGH
));
MoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitTime
(
20000
));
}
catch
(
Exception
ex
)
{
LogUtil
.
error
(
Name
+
" CheckFixture "
+
" 出错:"
+
ex
.
ToString
());
LogUtil
.
error
(
Name
+
logName
+
" 出错:"
+
ex
.
ToString
());
}
finally
{
Monitor
.
Exit
(
lockObj
);
}
}
else
{
LogUtil
.
error
(
Name
+
" CheckFixture "
+
"失败,未得到锁"
);
LogUtil
.
error
(
Name
+
logName
+
"失败,未得到锁"
);
}
}
private
void
HY71_OL_Wait
()
{
if
(
Monitor
.
TryEnter
(
lockObj
,
TrayManager
.
mTimeOut
))
{
try
{
if
(
MoveInfo
.
MoveType
.
Equals
(
LineMoveType
.
None
).
Equals
(
false
))
{
LogUtil
.
error
(
Name
+
" HY71_OL_Wait "
+
" 不在空闲中,直接返回 "
);
return
;
}
bool
check2IsOk
=
CheckStopWatch
(
trayCheckLowWait
,
TrayWaitTime
,
false
)
||
String
.
IsNullOrEmpty
(
RFIDIP
);
if
(
CheckStopWatch
(
olcheckWatch
,
TrayWaitTime
,
false
)
&&
check2IsOk
)
{
...
...
@@ -338,6 +408,21 @@ namespace OnlineStore.DeviceLibrary
MoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitIO
(
IO_Type
.
HY_OL_Tray_Check
,
IO_VALUE
.
HIGH
));
}
}
catch
(
Exception
ex
)
{
LogUtil
.
error
(
Name
+
" HY71_OL_Wait "
+
" 出错:"
+
ex
.
ToString
());
}
finally
{
Monitor
.
Exit
(
lockObj
);
}
}
else
{
LogUtil
.
error
(
Name
+
" HY71_OL_Wait "
+
"失败,未得到锁"
);
}
}
internal
void
HY03_FrontStopUp
(
int
timeout
=
20000
,
bool
frontStopUp
=
true
)
{
frontTrayCheckWait
.
Stop
();
...
...
@@ -1417,16 +1502,16 @@ namespace OnlineStore.DeviceLibrary
{
if
(
DeviceID
.
Equals
(
208
))
{
if
(
Monitor
.
TryEnter
(
lockObj
,
TrayManager
.
mTimeOut
))
{
try
{
if
(
runStatus
<=
LineRunStatus
.
Wait
)
{
return
true
;
}
else
if
(
MoveInfo
.
MoveType
.
Equals
(
LineMoveType
.
None
))
{
if
(
Monitor
.
TryEnter
(
lockObj
,
TrayManager
.
mTimeOut
))
{
try
{
if
(
runStatus
>
LineRunStatus
.
Wait
&&
MoveInfo
.
MoveType
.
Equals
(
LineMoveType
.
None
))
{
LogUtil
.
debug
(
"进仓05托盘离开,"
+
Name
+
"开始等待托盘检测信号 HY03_FrontStopUp"
);
...
...
@@ -1434,7 +1519,6 @@ namespace OnlineStore.DeviceLibrary
return
true
;
}
}
}
catch
(
Exception
ex
)
{
LogUtil
.
error
(
Name
+
" Move5Stop2Down "
+
" 出错:"
+
ex
.
ToString
());
...
...
@@ -1450,6 +1534,7 @@ namespace OnlineStore.DeviceLibrary
return
false
;
}
}
}
else
{
return
true
;
...
...
@@ -1458,6 +1543,10 @@ namespace OnlineStore.DeviceLibrary
}
internal
bool
HYOut51_WaitFree
()
{
if
(!
CanStartMove
())
{
return
false
;
}
if
(
Monitor
.
TryEnter
(
lockObj
,
TrayManager
.
mTimeOut
))
{
try
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论