Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
孙克
/
RC1250-AssemblyLine
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit 4c471de1
由
LN
编写于
2020-03-10 12:55:00 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
皮带线3优化
1 个父辈
915db7af
隐藏空白字符变更
内嵌
并排
正在显示
5 个修改的文件
包含
113 行增加
和
123 行删除
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/LineBean_Partial.cs
source/DeviceLibrary/assemblyLine/DischargeLine.cs
查看文件 @
4c471de
...
...
@@ -276,15 +276,8 @@ namespace OnlineStore.DeviceLibrary
else
{
//皮带线3出口有料,分盘定位装置无料
if
(
Line3TurnIsStop
()
&&
IOValue
(
IO_Type
.
ExitTray_Check3
).
Equals
(
IO_VALUE
.
HIGH
)
&&
IOValue
(
IO_Type
.
SeparateDevice_Check
).
Equals
(
IO_VALUE
.
LOW
))
if
(
Line3TurnIsStop
()
&&
IOValue
(
IO_Type
.
SeparateDevice_Check
).
Equals
(
IO_VALUE
.
LOW
)
&&
StationInfo_NG
.
TrayValue
.
Equals
(
IO_VALUE
.
HIGH
))
{
//开始扫码然后送出料盘
//1.扫码,
//2.从服务器获取尺寸
//3.顶升或下降定位气缸
//皮带线3转动,分料皮带转动,
//等待料盘到达工位。
StartOutStoreMove
(
new
InOutParam
());
}
}
...
...
@@ -376,16 +369,14 @@ namespace OnlineStore.DeviceLibrary
TrayLine2
.
Line3CanRun
&&
ngNoTray
&&
Line3HasTray
()
&&
(
IsNewType
.
Equals
(
false
)
||
IsInScanCode
.
Equals
(
false
))
&&
(
IsInScanCode
.
Equals
(
false
))
)
{
//判断皮带三还有料盘,需要转动一个工位
UpdateLastP
();
LogUtil
.
debug
(
hengyiName
+
"空闲,且流水线还有料盘,转动一个工位"
);
Line3Turn
.
StartLineRun
(
IO_Type
.
DLine_Run3
,
IO_Type
.
Location_Check3
,
Line3EndProcess
);
}
}
}
private
void
UpdateLastP
()
{
...
...
@@ -447,39 +438,44 @@ namespace OnlineStore.DeviceLibrary
private
void
NewTypeScan
(
bool
isfirst
=
false
)
{
if
(
IsNewType
)
//
if (IsNewType)
{
IsInScanCode
=
true
;
LastCode
=
""
;
//LastCodeList = new List<string>();
if
(
isfirst
)
{
StationInfo_NG
=
new
StationTrayInfo
(
IO_VALUE
.
HIGH
);
}
else
{
StationInfo_NG
=
new
StationTrayInfo
(
StationInfo_Scan
.
TrayValue
,
StationInfo_Scan
.
CodeStr
);
}
if
(
IOValue
(
IO_Type
.
ExitTray_Check3
).
Equals
(
IO_VALUE
.
LOW
))
{
StationInfo_Scan
=
new
StationTrayInfo
(
IO_VALUE
.
LOW
);
IsInScanCode
=
false
;
}
else
string
LastCode
=
""
;
//LastCodeList = new List<string
Task
.
Factory
.
StartNew
(
delegate
{
Task
.
Factory
.
StartNew
(
delegate
if
(
isfirst
)
{
StationInfo_NG
=
new
StationTrayInfo
(
IO_VALUE
.
HIGH
);
}
else
{
StationInfo_NG
=
new
StationTrayInfo
(
StationInfo_Scan
.
TrayValue
,
StationInfo_Scan
.
CodeStr
);
}
Thread
.
Sleep
(
300
);
if
(
IOValue
(
IO_Type
.
ExitTray_Check3
).
Equals
(
IO_VALUE
.
LOW
))
{
StationInfo_Scan
=
new
StationTrayInfo
(
IO_VALUE
.
LOW
);
if
(
DeviceID
.
Equals
(
301
))
{
StationInfo_NG
=
new
StationTrayInfo
(
StationInfo_Scan
.
TrayValue
,
StationInfo_Scan
.
CodeStr
);
}
IsInScanCode
=
false
;
}
else
{
try
{
LogUtil
.
info
(
hengyiName
+
"扫码工位:200ms后开始扫码,IsInScanCode="
+
IsInScanCode
);
Thread
.
Sleep
(
200
);
List
<
string
>
LastCodeList
=
CodeManager
.
CameraScan
(
Config
.
GetCameraList
(),
Name
);
LogUtil
.
info
(
hengyiName
+
"扫码工位:开始扫码,IsInScanCode="
+
IsInScanCode
);
List
<
string
>
LastCodeList
=
CodeManager
.
CameraScan
(
Config
.
GetCameraList
(),
Name
);
if
(
LastCodeList
.
Count
<=
0
)
{
LastCodeList
=
CodeManager
.
CameraScan
(
Config
.
GetCameraList
(),
Name
);
LastCodeList
=
CodeManager
.
CameraScan
(
Config
.
GetCameraList
(),
Name
);
}
LastCode
=
SServerManager
.
ProcessCodeList
(
LastCodeList
);
// Thread.Sleep(5000);
// Thread.Sleep(5000);
}
catch
(
Exception
ex
)
{
...
...
@@ -488,13 +484,17 @@ namespace OnlineStore.DeviceLibrary
finally
{
StationInfo_Scan
=
new
StationTrayInfo
(
IO_VALUE
.
HIGH
,
LastCode
);
if
(
DeviceID
.
Equals
(
301
))
{
StationInfo_NG
=
new
StationTrayInfo
(
StationInfo_Scan
.
TrayValue
,
StationInfo_Scan
.
CodeStr
);
}
IsInScanCode
=
false
;
LogUtil
.
info
(
hengyiName
+
" 扫码工位 : 扫码结束 ,"
+
StationInfo_Scan
.
ToStr
+
" IsInScanCode = "
+
IsInScanCode
);
}
});
}
}
});
}
}
protected
override
void
IOTimeOutProcess
()
...
...
@@ -546,7 +546,7 @@ namespace OnlineStore.DeviceLibrary
}
else
{
msg
+=
"Move:"
+
MoveInfo
.
MoveType
+
" "
+
MoveInfo
.
MoveStep
+
" "
+
LastWidth
+
"="
+
LastCode
+
"\n"
;
msg
+=
"Move:"
+
MoveInfo
.
MoveType
+
" "
+
MoveInfo
.
MoveStep
+
" "
+
LastWidth
+
"="
+
StationInfo_Move
.
CodeStr
+
"\n"
;
}
msg
+=
"扫码工位:"
+
StationInfo_Scan
.
ToStr
+
"\n"
;
msg
+=
"NG 工位:"
+
StationInfo_NG
.
ToStr
+
"\n"
;
...
...
source/DeviceLibrary/assemblyLine/DischargeLine_Partial.cs
查看文件 @
4c471de
...
...
@@ -12,18 +12,18 @@ namespace OnlineStore.DeviceLibrary
partial
class
DischargeLine
{
// private List<string> LastCodeList = new List<string>();
private
string
LastCode
=
""
;
//
private string LastCode = "";
private
int
LastWidth
=
0
;
private
int
scanCodeCount
=
0
;
//
private int scanCodeCount = 0;
protected
override
bool
CheckWaitResult
(
LineMoveInfo
moveInfo
,
WaitResultInfo
wait
)
{
if
(
wait
.
WaitType
.
Equals
(
WaitEnum
.
W301_DLineScanCode
))
{
if
(
String
.
IsNullOrEmpty
(
LastCode
).
Equals
(
false
))
{
return
true
;
}
//
if (String.IsNullOrEmpty(LastCode).Equals(false))
//
{
//
return true;
//
}
}
return
false
;
}
...
...
@@ -54,17 +54,18 @@ namespace OnlineStore.DeviceLibrary
{
if
(
runStatus
.
Equals
(
LineRunStatus
.
Runing
))
{
StationInfo_Move
=
new
StationTrayInfo
(
StationInfo_NG
.
TrayValue
,
StationInfo_NG
.
CodeStr
);
runStatus
=
LineRunStatus
.
Busy
;
MoveInfo
.
MoveParam
=
param
;
MoveInfo
.
NewMove
(
LineMoveType
.
OutStore
);
LogUtil
.
info
(
hengyiName
+
"出口有料,NG气缸后退,等待100
0后扫码
"
);
MoveInfo
.
NextMoveStep
(
LineMoveStep
.
DO_0
1_WaitTim
e
);
MoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitTime
(
100
0
));
LogUtil
.
info
(
hengyiName
+
"出口有料,NG气缸后退,等待100
后获取盘尺寸
"
);
MoveInfo
.
NextMoveStep
(
LineMoveStep
.
DO_0
2_ScanCod
e
);
MoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitTime
(
100
));
ScanNgBack
(
MoveInfo
);
//LastCodeList = new List<string>();
LastCode
=
""
;
// LastCode = StationInfo_Move.CodeStr
;
LastWidth
=
0
;
scanCodeCount
=
0
;
//
scanCodeCount = 0;
return
true
;
}
else
...
...
@@ -73,42 +74,42 @@ namespace OnlineStore.DeviceLibrary
return
false
;
}
}
private
void
ScanCode
()
{
MoveInfo
.
NextMoveStep
(
LineMoveStep
.
DO_02_ScanCode
);
List
<
string
>
cameraList
=
Config
.
GetCameraList
();
if
(
cameraList
.
Count
>
0
)
{
scanCodeCount
++;
LogUtil
.
info
(
hengyiName
+
"出口有料,开始第【"
+
scanCodeCount
+
"】次扫码,皮带线停止转动"
);
MoveInfo
.
OneWaitCanEndStep
=
true
;
MoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitDLineScanCode
());
MoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitTime
(
6000
));
try
{
Task
<
List
<
string
>>
scanTask
=
Task
.
Factory
.
StartNew
(
delegate
{
//
private void ScanCode()
//
{
//
MoveInfo.NextMoveStep(LineMoveStep.DO_02_ScanCode);
//
List<string> cameraList = Config.GetCameraList();
//
if (cameraList.Count > 0)
//
{
//
scanCodeCount++;
//
LogUtil.info(hengyiName + "出口有料,开始第【" + scanCodeCount + "】次扫码,皮带线停止转动");
//
MoveInfo.OneWaitCanEndStep = true;
//
MoveInfo.WaitList.Add(WaitResultInfo.WaitDLineScanCode());
//
MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(6000));
//
try
//
{
//
Task<List<string>> scanTask = Task.Factory.StartNew(delegate
//
{
List
<
string
>
LastCodeList
=
CodeManager
.
CameraScan
(
Config
.
GetCameraList
(),
Name
);
if
(
LastCodeList
.
Count
<=
0
)
{
LastCodeList
=
CodeManager
.
CameraScan
(
Config
.
GetCameraList
(),
Name
);
}
LastCode
=
SServerManager
.
ProcessCodeList
(
LastCodeList
);
return
LastCodeList
;
});
}
catch
(
Exception
ex
)
{
LogUtil
.
error
(
"FI_13_ScanCode扫码出错:"
,
ex
);
}
}
else
{
LogUtil
.
info
(
hengyiName
+
"出口有料,未取到相机名称,不扫码,等待1000后继续"
);
MoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitTime
(
6000
));
}
}
//
List<string> LastCodeList = CodeManager.CameraScan(Config.GetCameraList(),Name);
//
if (LastCodeList.Count <= 0)
//
{
//
LastCodeList = CodeManager.CameraScan(Config.GetCameraList(),Name);
//
}
//
LastCode = SServerManager.ProcessCodeList(LastCodeList);
//
return LastCodeList;
//
});
//
}
//
catch (Exception ex)
//
{
//
LogUtil.error("FI_13_ScanCode扫码出错:", ex);
//
}
//
}
//
else
//
{
//
LogUtil.info(hengyiName + "出口有料,未取到相机名称,不扫码,等待1000后继续");
//
MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(6000));
//
}
//
}
private
void
WaitSeparateCheck
()
{
...
...
@@ -126,7 +127,7 @@ namespace OnlineStore.DeviceLibrary
&&
Line3TurnIsStop
()
&&
Line3Turn
.
CanStart
()
&&
ScanNgIsBack
()
&&
(
IsNewType
.
Equals
(
false
)
||
IsInScanCode
.
Equals
(
false
))
&&
(
IsInScanCode
.
Equals
(
false
))
)
{
return
true
;
...
...
@@ -149,32 +150,22 @@ namespace OnlineStore.DeviceLibrary
}
#
region
原有方式的横移料盘处理
if
(
MoveInfo
.
MoveStep
.
Equals
(
LineMoveStep
.
DO_01_WaitTime
))
{
ScanCode
();
}
//
if (MoveInfo.MoveStep.Equals(LineMoveStep.DO_01_WaitTime))
//
{
//
ScanCode();
//
}
else
if
(
MoveInfo
.
MoveStep
.
Equals
(
LineMoveStep
.
DO_02_ScanCode
))
{
MoveInfo
.
NextMoveStep
(
LineMoveStep
.
DO_03_GetTraySize
);
MoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitTime
(
3000
));
//如果未扫到条码,重新扫码3次
//if (scanCodeCount < 3 && LastCode.Equals("") && Config.GetCameraList().Count > 0)
//{
// ScanCode();
//}
//else
//{
MoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitTime
(
3000
));
LastWidth
=
0
;
int
robotIndex
=
1
;
if
(
DeviceID
.
Equals
(
301
))
{
robotIndex
=
2
;
}
string
result
=
SServerManager
.
GetTraySize
(
Name
,
robotIndex
,
LastCode
,
out
LastWidth
);
LogUtil
.
info
(
hengyiName
+
"出口有料,二维码["
+
LastCode
+
"] 获取料盘尺寸【"
+
LastWidth
+
"】【"
+
result
+
"】"
);
//}
// MoveInfo.EndMove();
string
result
=
SServerManager
.
GetTraySize
(
Name
,
robotIndex
,
StationInfo_Move
.
CodeStr
,
out
LastWidth
);
LogUtil
.
info
(
hengyiName
+
"出口有料,二维码["
+
StationInfo_Move
.
CodeStr
+
"] 获取料盘尺寸【"
+
LastWidth
+
"】【"
+
result
+
"】"
);
}
else
if
(
MoveInfo
.
MoveStep
.
Equals
(
LineMoveStep
.
DO_03_GetTraySize
))
{
...
...
source/DeviceLibrary/assemblyLine/EquipBase.cs
查看文件 @
4c471de
...
...
@@ -72,7 +72,10 @@ namespace OnlineStore.DeviceLibrary
StopMove
();
}
}
public
virtual
void
CheckAlarmProcess
(
LineMoveInfo
moveInfo
,
LineAlarmType
alarmType
)
{
}
public
bool
MoveStop
=
false
;
/// <summary>
/// 运动处理
...
...
@@ -88,22 +91,6 @@ namespace OnlineStore.DeviceLibrary
{
CheckFixtureProcess
();
}
//switch (MoveInfo.MoveType)
//{
// case LineMoveType.InStore:
// InStoreProcess();
// break;
// case LineMoveType.OutStore:
// OutStoreProcess();
// break;
// case LineMoveType.ReturnHome:
// ResetProcess();
// break;
// case LineMoveType.Reset:
// ResetProcess();
// break;
// default: break;
//}
if
(
MoveInfo
.
MoveType
.
Equals
(
LineMoveType
.
InStore
)
||
this
.
SecondMoveInfo
.
MoveType
.
Equals
(
LineMoveType
.
InStore
))
{
InStoreProcess
();
...
...
@@ -422,6 +409,7 @@ namespace OnlineStore.DeviceLibrary
WarnMsg
=
Name
+
msg
;
Alarm
(
LineAlarmType
.
AxisMoveError
);
CheckAlarmProcess
(
moveInfo
,
LineAlarmType
.
AxisMoveError
);
LogUtil
.
error
(
WarnMsg
,
DeviceID
+
18
);
break
;
}
...
...
@@ -454,12 +442,13 @@ namespace OnlineStore.DeviceLibrary
ConfigIO
io
=
baseConfig
.
getWaitIO
(
wait
.
IoType
);
WarnMsg
=
moveInfo
.
Name
+
"["
+
moveInfo
.
MoveType
+
"]["
+
moveInfo
.
MoveStep
+
"] 等待"
+
NotOkMsg
+
" 超时"
;
Alarm
(
LineAlarmType
.
IoSingleTimeOut
);
CheckAlarmProcess
(
moveInfo
,
LineAlarmType
.
IoSingleTimeOut
);
LogUtil
.
error
(
MoveInfo
.
Name
+
WarnMsg
,
DeviceID
+
13
);
}
else
if
(
rwSpan
.
TotalSeconds
>
5
&&
span
.
TotalSeconds
>
6
&&
span
.
TotalSeconds
<
LineManager
.
Config
.
IOSingle_TimerOut
*
2
)
{
preRWTime
=
DateTime
.
Now
;
string
msg
=
moveInfo
.
Name
+
" ["
+
moveInfo
.
MoveType
+
"]["
+
moveInfo
.
MoveStep
+
"] "
+
NotOkMsg
+
"已等待 "
+
Math
.
Abs
(
span
.
TotalSeconds
)
+
"秒,重写DO:"
;
string
msg
=
moveInfo
.
Name
+
" ["
+
moveInfo
.
MoveType
+
"]["
+
moveInfo
.
MoveStep
+
"] "
+
NotOkMsg
+
"已等待 "
+
Math
.
Round
(
span
.
TotalSeconds
,
1
)
+
"秒,重写DO:"
;
bool
isLog
=
false
;
foreach
(
WaitResultInfo
ww
in
list
)
{
...
...
@@ -536,6 +525,7 @@ namespace OnlineStore.DeviceLibrary
}
LogUtil
.
error
(
WarnMsg
,
DeviceID
+
15
,
second
);
Alarm
(
LineAlarmType
.
IoSingleTimeOut
);
CheckAlarmProcess
(
moveInfo
,
LineAlarmType
.
IoSingleTimeOut
);
}
}
catch
(
Exception
ex
)
...
...
source/DeviceLibrary/assemblyLine/FeedingEquip_InStore.cs
查看文件 @
4c471de
...
...
@@ -45,7 +45,15 @@ namespace OnlineStore.DeviceLibrary
}
return
false
;
}
public
override
void
CheckAlarmProcess
(
LineMoveInfo
moveInfo
,
LineAlarmType
alarmType
)
{
if
(
moveInfo
.
MoveType
.
Equals
(
LineMoveStep
.
FI_18_WaitNoLocationCheck
)&&
alarmType
.
Equals
(
LineAlarmType
.
IoSingleTimeOut
))
{
string
code
=
CodeManager
.
ProcessCode
(
LastCodeList
);
LogUtil
.
error
(
moveInfo
.
Name
+
" ["
+
moveInfo
.
MoveType
+
"]["
+
moveInfo
.
MoveStep
+
"]等待SL_AxisLocationCheck=LOW超时,清空当前料盘条码:"
+
code
);
LastCodeList
=
new
List
<
string
>();
}
}
public
event
TrayProcessEnd
TrayPEndEvent
;
#
region
托盘检测
private
InOutParam
CheckParam
=
new
InOutParam
();
...
...
@@ -676,7 +684,7 @@ namespace OnlineStore.DeviceLibrary
}
#
endregion
#
region
检测到托盘,扫码,取料并放入托盘
#
region
检测到托盘,扫码,取料并放入托盘
else
if
(
MoveInfo
.
MoveStep
.
Equals
(
LineMoveStep
.
FI_10_AxisUpMove
))
{
CheckHasTray
();
...
...
@@ -1127,7 +1135,8 @@ namespace OnlineStore.DeviceLibrary
}
}
if
(
LastHeight
<=
8
)
{
LastHeight
=
8
;
}
string
msg
=
Name
+
" 计算盘高:上升前 ["
+
StartMovePosition
+
"]实时[ "
+
EndMovePosition
+
"]差值["
+
(
EndMovePosition
-
StartMovePosition
)
+
"]系数["
+
AxisChangeValue
+
"] 计算后"
+
buchongStr
+
"["
+
height
+
"]"
+
",归类为【"
+
LastHeight
+
"mm】"
;
string
code
=
CodeManager
.
ProcessCode
(
LastCodeList
);
string
msg
=
Name
+
" 计算盘高:上升前 ["
+
StartMovePosition
+
"]实时[ "
+
EndMovePosition
+
"]差值["
+
(
EndMovePosition
-
StartMovePosition
)
+
"]系数["
+
AxisChangeValue
+
"] 计算后"
+
buchongStr
+
"["
+
height
+
"]"
+
",归类为【"
+
LastHeight
+
"mm】条码【"
+
code
+
"】"
;
LogUtil
.
info
(
msg
);
return
LastHeight
;
}
...
...
source/DeviceLibrary/assemblyLine/LineBean_Partial.cs
查看文件 @
4c471de
...
...
@@ -113,7 +113,7 @@ namespace OnlineStore.DeviceLibrary
else
if
(
rwSpan
.
TotalSeconds
>
5
&&
span
.
TotalSeconds
>
6
&&
span
.
TotalSeconds
<
LineManager
.
Config
.
IOSingle_TimerOut
*
2
)
{
preRWTime
=
DateTime
.
Now
;
string
msg
=
checkWaitInfo
.
Name
+
" "
+
NotOkMsg
+
"已等待 "
+
Math
.
Abs
(
span
.
TotalSeconds
)
+
"秒,重写DO:"
;
string
msg
=
checkWaitInfo
.
Name
+
" "
+
NotOkMsg
+
"已等待 "
+
Math
.
Round
(
span
.
TotalSeconds
,
1
)
+
"秒,重写DO:"
;
bool
isLog
=
false
;
foreach
(
WaitResultInfo
ww
in
list
)
{
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论