Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
孙克
/
RC1250-AssemblyLine
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit ad5b7d80
由
LN
编写于
2020-08-31 14:06:53 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
扫码改回task方式
1 个父辈
96b0eb0d
隐藏空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
39 行增加
和
37 行删除
dll/CodeLibrary.dll
source/DeviceLibrary/assemblyLine/DischargeLine.cs
source/DeviceLibrary/assemblyLine/FeedingEquip_InStore.cs
source/DeviceLibrary/assemblyLine/OutTrayLineBean.cs
dll/CodeLibrary.dll
查看文件 @
ad5b7d8
此文件类型无法预览
source/DeviceLibrary/assemblyLine/DischargeLine.cs
查看文件 @
ad5b7d8
...
@@ -184,7 +184,10 @@ namespace OnlineStore.DeviceLibrary
...
@@ -184,7 +184,10 @@ namespace OnlineStore.DeviceLibrary
if
(
IOValue
(
IO_Type
.
Location_Check3
).
Equals
(
IO_VALUE
.
HIGH
))
if
(
IOValue
(
IO_Type
.
Location_Check3
).
Equals
(
IO_VALUE
.
HIGH
))
{
{
LogUtil
.
info
(
Name
+
"启动时长皮带线定位信号亮,触发一次扫码"
);
LogUtil
.
info
(
Name
+
"启动时长皮带线定位信号亮,触发一次扫码"
);
NewTypeScan
(
true
);
Task
.
Factory
.
StartNew
(
delegate
{
NewTypeScan
(
true
);
},
TaskCreationOptions
.
LongRunning
);
}
}
else
else
{
{
...
@@ -518,8 +521,8 @@ namespace OnlineStore.DeviceLibrary
...
@@ -518,8 +521,8 @@ namespace OnlineStore.DeviceLibrary
IsInScanCode
=
true
;
IsInScanCode
=
true
;
LastScanTime
=
DateTime
.
Now
;
LastScanTime
=
DateTime
.
Now
;
string
LastCode
=
""
;
string
LastCode
=
""
;
Task
.
Factory
.
StartNew
(
delegate
//
Task.Factory.StartNew(delegate
{
//
{
if
(
isfirst
)
if
(
isfirst
)
{
{
StationInfo_NG
=
new
StationTrayInfo
(
IO_VALUE
.
HIGH
);
StationInfo_NG
=
new
StationTrayInfo
(
IO_VALUE
.
HIGH
);
...
@@ -575,7 +578,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -575,7 +578,7 @@ namespace OnlineStore.DeviceLibrary
LogUtil
.
info
(
hengyiName
+
" 扫码工位 : 扫码结束 ,"
+
StationInfo_Scan
.
ToStr
+
" IsInScanCode = "
+
IsInScanCode
);
LogUtil
.
info
(
hengyiName
+
" 扫码工位 : 扫码结束 ,"
+
StationInfo_Scan
.
ToStr
+
" IsInScanCode = "
+
IsInScanCode
);
}
}
}
}
},
TaskCreationOptions
.
LongRunning
);
//
}, TaskCreationOptions.LongRunning);
}
}
private
void
UpdateScanInfo
(
IO_VALUE
value
,
string
code
)
private
void
UpdateScanInfo
(
IO_VALUE
value
,
string
code
)
...
...
source/DeviceLibrary/assemblyLine/FeedingEquip_InStore.cs
查看文件 @
ad5b7d8
...
@@ -758,23 +758,24 @@ namespace OnlineStore.DeviceLibrary
...
@@ -758,23 +758,24 @@ namespace OnlineStore.DeviceLibrary
}
}
else
if
(
MoveInfo
.
MoveStep
.
Equals
(
LineMoveStep
.
FI_13_ScanCode
))
else
if
(
MoveInfo
.
MoveStep
.
Equals
(
LineMoveStep
.
FI_13_ScanCode
))
{
{
//
if (ScanCodeTask == null || ScanCodeTask.IsCompleted)
if
(
ScanCodeTask
==
null
||
ScanCodeTask
.
IsCompleted
)
//
{
{
MoveInfo
.
NextMoveStep
(
LineMoveStep
.
FI_14_CylinderTake
);
MoveInfo
.
NextMoveStep
(
LineMoveStep
.
FI_14_CylinderTake
);
InLog
(
"料盘移栽"
+
MoveInfo
.
SLog
+
":上料横移取料端"
);
InLog
(
"料盘移栽"
+
MoveInfo
.
SLog
+
":上料横移取料端"
);
CylinderMove
(
MoveInfo
,
IO_Type
.
SL_MoveCylinder_Give
,
IO_Type
.
SL_MoveCylinder_Take
);
CylinderMove
(
MoveInfo
,
IO_Type
.
SL_MoveCylinder_Give
,
IO_Type
.
SL_MoveCylinder_Take
);
ClearTimeoutAlarm
(
"扫码执行结束超时"
);
ClearTimeoutAlarm
(
"扫码执行结束超时"
);
//
}
}
//
else if (MoveInfo.IsTimeOut(60))
else
if
(
MoveInfo
.
IsTimeOut
(
60
))
//
{
{
//
WarnMsg = MoveInfo.Name + "[" + MoveInfo.MoveStep + "] 扫码执行结束超时 [" + Math.Round(MoveInfo.StepSpan().TotalSeconds, 1) + "]秒";
WarnMsg
=
MoveInfo
.
Name
+
"["
+
MoveInfo
.
MoveStep
+
"] 扫码执行结束超时 ["
+
Math
.
Round
(
MoveInfo
.
StepSpan
().
TotalSeconds
,
1
)
+
"]秒"
;
//
LogUtil.error(WarnMsg, DeviceID * 1000 + 30);
LogUtil
.
error
(
WarnMsg
,
DeviceID
*
1000
+
30
);
//
Alarm(LineAlarmType.IoSingleTimeOut);
Alarm
(
LineAlarmType
.
IoSingleTimeOut
);
//
}
}
}
}
else
if
(
MoveInfo
.
MoveStep
.
Equals
(
LineMoveStep
.
FI_14_CylinderTake
))
else
if
(
MoveInfo
.
MoveStep
.
Equals
(
LineMoveStep
.
FI_14_CylinderTake
))
{
{
MoveInfo
.
NextMoveStep
(
LineMoveStep
.
FI_15_UpdownAxisToP3
);
MoveInfo
.
NextMoveStep
(
LineMoveStep
.
FI_15_UpdownAxisToP3
);
MoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitTime
(
500
));
InLog
(
"料盘移栽"
+
MoveInfo
.
SLog
+
":升降轴到P3"
);
InLog
(
"料盘移栽"
+
MoveInfo
.
SLog
+
":升降轴到P3"
);
UpdownAxis
.
AbsMove
(
MoveInfo
,
Config
.
UpDownAxisP3
,
Config
.
UpdownAxis_P3Speed
);
UpdownAxis
.
AbsMove
(
MoveInfo
,
Config
.
UpDownAxisP3
,
Config
.
UpdownAxis_P3Speed
);
}
}
...
@@ -1278,17 +1279,17 @@ namespace OnlineStore.DeviceLibrary
...
@@ -1278,17 +1279,17 @@ namespace OnlineStore.DeviceLibrary
CylinderMove
(
MoveInfo
,
IO_Type
.
SL_MoveCylinder_Down
,
IO_Type
.
SL_MoveCylinder_Up
);
CylinderMove
(
MoveInfo
,
IO_Type
.
SL_MoveCylinder_Down
,
IO_Type
.
SL_MoveCylinder_Up
);
}
}
}
}
//
private Task ScanCodeTask = null;
private
Task
ScanCodeTask
=
null
;
private
void
FI_13_ScanCode
()
private
void
FI_13_ScanCode
()
{
{
if
(
CylinderIsOk
(
IO_Type
.
SL_MoveCylinder_Take
,
IO_Type
.
SL_MoveCylinder_Give
))
if
(
CylinderIsOk
(
IO_Type
.
SL_MoveCylinder_Take
,
IO_Type
.
SL_MoveCylinder_Give
))
{
{
MoveInfo
.
NextMoveStep
(
LineMoveStep
.
FI_13_ScanCode
);
MoveInfo
.
NextMoveStep
(
LineMoveStep
.
FI_13_ScanCode
);
bool
isScan
=
ConfigAppSettings
.
GetIntValue
(
Setting_Init
.
NeedScanCode
).
Equals
(
1
);
bool
isScan
=
ConfigAppSettings
.
GetIntValue
(
Setting_Init
.
NeedScanCode
).
Equals
(
1
);
LastCodeList
=
new
List
<
string
>();
LastCodeList
=
new
List
<
string
>();
//
ScanCodeTask = null;
ScanCodeTask
=
null
;
if
(
NextCodeList
.
Count
>
0
)
if
(
NextCodeList
.
Count
>
0
)
{
{
InLog
(
"料盘移栽"
+
MoveInfo
.
SLog
+
":开始扫码:使用预扫码"
);
InLog
(
"料盘移栽"
+
MoveInfo
.
SLog
+
":开始扫码:使用预扫码"
);
...
@@ -1304,28 +1305,28 @@ namespace OnlineStore.DeviceLibrary
...
@@ -1304,28 +1305,28 @@ namespace OnlineStore.DeviceLibrary
InLog
(
"料盘移栽"
+
MoveInfo
.
SLog
+
":开始扫码"
);
InLog
(
"料盘移栽"
+
MoveInfo
.
SLog
+
":开始扫码"
);
MoveInfo
.
OneWaitCanEndStep
=
true
;
MoveInfo
.
OneWaitCanEndStep
=
true
;
MoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitFeedScanCode
());
MoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitFeedScanCode
());
MoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitTime
(
20
000
));
MoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitTime
(
7
000
));
try
try
{
{
//ScanCodeTask = Task.Factory.StartNew(delegate
ScanCodeTask
=
Task
.
Factory
.
StartNew
(
delegate
//{
LastCodeList
=
CodeManager
.
CameraScan
(
Config
.
GetCameraList
(),
Name
);
bool
hasRightCode
=
CodeManager
.
HasRightCode
(
LastCodeList
.
ToArray
());
if
(!
hasRightCode
)
{
{
LastCodeList
=
CodeManager
.
CameraScan
(
Config
.
GetCameraList
(),
Name
,
false
,
3000
);
LastCodeList
=
CodeManager
.
CameraScan
(
Config
.
GetCameraList
(),
Name
);
}
bool
hasRightCode
=
CodeManager
.
HasRightCode
(
LastCodeList
.
ToArray
());
//return LastCodeList;
if
(!
hasRightCode
)
//});
{
LastCodeList
=
CodeManager
.
CameraScan
(
Config
.
GetCameraList
(),
Name
,
false
,
3000
);
}
return
LastCodeList
;
});
}
}
catch
(
Exception
ex
)
catch
(
Exception
ex
)
{
{
LogUtil
.
error
(
"FI_13_ScanCode扫码出错:"
,
ex
);
LogUtil
.
error
(
"FI_13_ScanCode扫码出错:"
,
ex
);
}
}
finally
//
finally
{
//
{
MoveInfo
.
EndStepWait
();
//
MoveInfo.EndStepWait();
}
//
}
}
}
else
else
{
{
...
...
source/DeviceLibrary/assemblyLine/OutTrayLineBean.cs
查看文件 @
ad5b7d8
...
@@ -520,16 +520,14 @@ namespace OnlineStore.DeviceLibrary
...
@@ -520,16 +520,14 @@ namespace OnlineStore.DeviceLibrary
}
}
LastEndTime
=
DateTime
.
Now
;
LastEndTime
=
DateTime
.
Now
;
IOManager
.
IOMove
(
MoveDO
,
IO_VALUE
.
LOW
,
subType
);
IOManager
.
IOMove
(
MoveDO
,
IO_VALUE
.
LOW
,
subType
);
if
(!
isRestart
)
{
Task
.
Factory
.
StartNew
(
delegate
{
turnEnd
?.
Invoke
(
result
.
Equals
(
""
));
});
}
InTurn
=
false
;
InTurn
=
false
;
WaitCheckDI_High
=
false
;
WaitCheckDI_High
=
false
;
CheckDIHigh
=
false
;
CheckDIHigh
=
false
;
if
(!
isRestart
)
{
turnEnd
?.
Invoke
(
result
.
Equals
(
""
));
}
return
result
;
return
result
;
}
}
}
}
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论