Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
孙克
/
RC1250-ACPackingStore
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit 4f5363ed
由
张东亮
编写于
2023-06-28 09:21:59 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
1
1 个父辈
4b88f2d0
显示空白字符变更
内嵌
并排
正在显示
5 个修改的文件
包含
51 行增加
和
7 行删除
source/Common/util/AcSerialBean.cs
source/DeviceLibrary/PackingStore/AC_BOX_Bean_InStore.cs
source/DeviceLibrary/PackingStore/AC_BOX_Bean_OutStore.cs
source/DeviceLibrary/device/PanasonicServo/ACServerManager_Partial.cs
source/DeviceLibrary/store/KTK_Store.cs
source/Common/util/AcSerialBean.cs
查看文件 @
4f5363e
...
@@ -281,7 +281,7 @@ namespace OnlineStore.Common
...
@@ -281,7 +281,7 @@ namespace OnlineStore.Common
if
(
_serialPort
.
IsOpen
)
if
(
_serialPort
.
IsOpen
)
{
{
if
(
Monitor
.
TryEnter
(
lockObj
,
1
0
))
if
(
Monitor
.
TryEnter
(
lockObj
,
30
0
))
{
{
//Monitor.Enter(lockObj);
//Monitor.Enter(lockObj);
try
try
...
...
source/DeviceLibrary/PackingStore/AC_BOX_Bean_InStore.cs
查看文件 @
4f5363e
...
@@ -261,6 +261,12 @@ namespace OnlineStore.DeviceLibrary
...
@@ -261,6 +261,12 @@ namespace OnlineStore.DeviceLibrary
}
}
else
else
{
{
if
(
currPosition
==
0
)
{
InOutStoreLog
(
"料架取料,检测到Compress_Check,盘高【"
+
LastHeight
+
"】,当前位置为0,无需再向下压紧"
);
}
else
{
ComTargetPosition
=
currPosition
;
ComTargetPosition
=
currPosition
;
int
targetP
=
currPosition
+
Config
.
CompAxis_Down_Position
;
int
targetP
=
currPosition
+
Config
.
CompAxis_Down_Position
;
LastHeight
=
Config
.
GetComP2PlateH
(
targetP
);
LastHeight
=
Config
.
GetComP2PlateH
(
targetP
);
...
@@ -268,10 +274,13 @@ namespace OnlineStore.DeviceLibrary
...
@@ -268,10 +274,13 @@ namespace OnlineStore.DeviceLibrary
MoveInfo
.
MoveParam
.
MoveP
.
ComPress_P3
=
targetP
+
Config
.
CompAxis_P3_P2_Value
;
MoveInfo
.
MoveParam
.
MoveP
.
ComPress_P3
=
targetP
+
Config
.
CompAxis_P3_P2_Value
;
InOutStoreLog
(
"料架取料,检测到Compress_Check,盘高【"
+
LastHeight
+
"】,向下压紧 ["
+
Config
.
CompAxis_Down_Position
+
"] 目标 ["
+
targetP
+
InOutStoreLog
(
"料架取料,检测到Compress_Check,盘高【"
+
LastHeight
+
"】,向下压紧 ["
+
Config
.
CompAxis_Down_Position
+
"] 目标 ["
+
targetP
+
"]记录ComP2["
+
targetP
+
"]ComP3["
+
MoveInfo
.
MoveParam
.
MoveP
.
ComPress_P3
+
"]"
);
"]记录ComP2["
+
targetP
+
"]ComP3["
+
MoveInfo
.
MoveParam
.
MoveP
.
ComPress_P3
+
"]"
);
ACServerManager
.
SuddenStop
(
Config
.
Comp_Axis
);
ACAxisMove
(
Config
.
Comp_Axis
,
targetP
,
Config
.
CompAxis_P1_Speed
);
ACAxisMove
(
Config
.
Comp_Axis
,
targetP
,
Config
.
CompAxis_P1_Speed
);
}
}
}
}
}
else
if
(
MoveInfo
.
MoveStep
.
Equals
(
StoreMoveStep
.
BI_16_ComDownMove
))
else
if
(
MoveInfo
.
MoveStep
.
Equals
(
StoreMoveStep
.
BI_16_ComDownMove
))
{
{
MoveInfo
.
NextMoveStep
(
StoreMoveStep
.
BI_17_InoutBack
);
MoveInfo
.
NextMoveStep
(
StoreMoveStep
.
BI_17_InoutBack
);
...
...
source/DeviceLibrary/PackingStore/AC_BOX_Bean_OutStore.cs
查看文件 @
4f5363e
...
@@ -247,6 +247,12 @@ namespace OnlineStore.DeviceLibrary
...
@@ -247,6 +247,12 @@ namespace OnlineStore.DeviceLibrary
}
}
else
else
{
{
if
(
currPosition
==
0
)
{
InOutStoreLog
(
"料架取料,检测到Compress_Check,盘高【"
+
LastHeight
+
"】,当前位置为0,无需再向下压紧"
);
}
else
{
ComTargetPosition
=
currPosition
;
ComTargetPosition
=
currPosition
;
int
targetP
=
currPosition
+
Config
.
CompAxis_Down_Position
;
int
targetP
=
currPosition
+
Config
.
CompAxis_Down_Position
;
LastHeight
=
Config
.
GetComP2PlateH
(
targetP
);
LastHeight
=
Config
.
GetComP2PlateH
(
targetP
);
...
@@ -255,10 +261,12 @@ namespace OnlineStore.DeviceLibrary
...
@@ -255,10 +261,12 @@ namespace OnlineStore.DeviceLibrary
MoveInfo
.
MoveParam
.
MoveP
.
ComPress_P3
=
Config
.
GetComP3
(
position
.
BagHigh
).
MaxComP
;
MoveInfo
.
MoveParam
.
MoveP
.
ComPress_P3
=
Config
.
GetComP3
(
position
.
BagHigh
).
MaxComP
;
InOutStoreLog
(
"料架取料,检测到Compress_Check,盘高【"
+
LastHeight
+
"】,向下压紧 ["
+
Config
.
CompAxis_Down_Position
+
"] 目标 ["
+
targetP
+
InOutStoreLog
(
"料架取料,检测到Compress_Check,盘高【"
+
LastHeight
+
"】,向下压紧 ["
+
Config
.
CompAxis_Down_Position
+
"] 目标 ["
+
targetP
+
"]记录ComP2["
+
targetP
+
"]"
);
"]记录ComP2["
+
targetP
+
"]"
);
ACServerManager
.
SuddenStop
(
Config
.
Comp_Axis
);
ACAxisMove
(
Config
.
Comp_Axis
,
targetP
,
Config
.
CompAxis_P1_Speed
);
ACAxisMove
(
Config
.
Comp_Axis
,
targetP
,
Config
.
CompAxis_P1_Speed
);
}
}
}
}
}
else
if
(
MoveInfo
.
MoveStep
.
Equals
(
StoreMoveStep
.
SO_PreCheck_07_ComDownMove
))
else
if
(
MoveInfo
.
MoveStep
.
Equals
(
StoreMoveStep
.
SO_PreCheck_07_ComDownMove
))
...
@@ -522,12 +530,21 @@ namespace OnlineStore.DeviceLibrary
...
@@ -522,12 +530,21 @@ namespace OnlineStore.DeviceLibrary
}
}
else
else
{
{
if
(
currPosition
==
0
)
{
InOutStoreLog
(
"出库,当前位置为0,无需再向下压紧"
);
}
else
{
int
targetP
=
currPosition
+
Config
.
CompAxis_Down_Position
;
int
targetP
=
currPosition
+
Config
.
CompAxis_Down_Position
;
InOutStoreLog
(
"出库 "
+
MoveInfo
.
SLog
+
": 再向下压紧 ["
+
Config
.
CompAxis_Down_Position
+
"] 目标 ["
+
targetP
+
"] "
);
InOutStoreLog
(
"出库 "
+
MoveInfo
.
SLog
+
": 再向下压紧 ["
+
Config
.
CompAxis_Down_Position
+
"] 目标 ["
+
targetP
+
"] "
);
ACServerManager
.
SuddenStop
(
Config
.
Comp_Axis
);
ACAxisMove
(
Config
.
Comp_Axis
,
targetP
,
Config
.
CompAxis_P1_Speed
);
ACAxisMove
(
Config
.
Comp_Axis
,
targetP
,
Config
.
CompAxis_P1_Speed
);
}
}
}
}
}
else
if
(
MoveInfo
.
MoveStep
==
StoreMoveStep
.
SO_07_ComDownMove
)
else
if
(
MoveInfo
.
MoveStep
==
StoreMoveStep
.
SO_07_ComDownMove
)
{
{
MoveInfo
.
NextMoveStep
(
StoreMoveStep
.
SO_08_InoutBack
);
MoveInfo
.
NextMoveStep
(
StoreMoveStep
.
SO_08_InoutBack
);
...
...
source/DeviceLibrary/device/PanasonicServo/ACServerManager_Partial.cs
查看文件 @
4f5363e
...
@@ -151,14 +151,23 @@ namespace OnlineStore.DeviceLibrary
...
@@ -151,14 +151,23 @@ namespace OnlineStore.DeviceLibrary
}
}
else
else
{
{
int
ret
=
bean
.
SendCommand
(
data
,
ref
returnData
,
outTime
,
reviceLength
);
int
tryTimes
=
5
;
while
(
tryTimes
>
0
)
{
int
ret
=
bean
.
SendCommand
(
data
,
ref
returnData
,
outTime
,
reviceLength
);
if
(!
ret
.
Equals
(
reviceLength
))
if
(!
ret
.
Equals
(
reviceLength
))
{
{
LogUtil
.
error
(
"串口"
+
portName
+
" 写入数据:"
+
strSend
+
",预计返回字节数【"
+
reviceLength
+
"】实际返回【"
+
ret
+
"】"
);
tryTimes
--;
LogUtil
.
error
(
"串口"
+
portName
+
" 写入数据:"
+
strSend
+
",预计返回字节数【"
+
reviceLength
+
"】实际返回【"
+
ret
+
"】"
);
}
else
{
break
;
}
}
System
.
Threading
.
Thread
.
Sleep
(
2
);
System
.
Threading
.
Thread
.
Sleep
(
2
);
}
}
}
}
}
catch
(
Exception
ex
)
catch
(
Exception
ex
)
{
{
LogUtil
.
info
(
ex
.
ToString
());
LogUtil
.
info
(
ex
.
ToString
());
...
@@ -206,17 +215,24 @@ namespace OnlineStore.DeviceLibrary
...
@@ -206,17 +215,24 @@ namespace OnlineStore.DeviceLibrary
}
}
else
else
{
{
int
tryTimes
=
5
;
while
(
tryTimes
>
0
)
{
int
ret
=
bean
.
SendCommand
(
data
,
ref
returnData
,
outTime
,
reviceLength
);
int
ret
=
bean
.
SendCommand
(
data
,
ref
returnData
,
outTime
,
reviceLength
);
if
(!
ret
.
Equals
(
reviceLength
))
if
(!
ret
.
Equals
(
reviceLength
))
{
{
tryTimes
--;
LogUtil
.
error
(
"串口"
+
portName
+
" 写入数据:"
+
strSend
+
",预计返回字节数【"
+
reviceLength
+
"】实际返回【"
+
ret
+
"】"
);
LogUtil
.
error
(
"串口"
+
portName
+
" 写入数据:"
+
strSend
+
",预计返回字节数【"
+
reviceLength
+
"】实际返回【"
+
ret
+
"】"
);
}
else
}
else
{
{
result
=
true
;
result
=
true
;
break
;
}
}
System
.
Threading
.
Thread
.
Sleep
(
2
);
System
.
Threading
.
Thread
.
Sleep
(
2
);
}
}
}
}
}
catch
(
Exception
ex
)
catch
(
Exception
ex
)
{
{
LogUtil
.
info
(
ex
.
ToString
());
LogUtil
.
info
(
ex
.
ToString
());
...
...
source/DeviceLibrary/store/KTK_Store.cs
查看文件 @
4f5363e
using
log4net
;
using
ConfigHelper
;
using
log4net
;
using
OnlineStore.Common
;
using
OnlineStore.Common
;
using
OnlineStore.LoadCSVLibrary
;
using
OnlineStore.LoadCSVLibrary
;
using
System
;
using
System
;
...
@@ -277,6 +278,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -277,6 +278,7 @@ namespace OnlineStore.DeviceLibrary
"],误差过大,重新开始运动,剩余["
+
MoveInfo
.
CanWhileCount
+
"]次"
);
"],误差过大,重新开始运动,剩余["
+
MoveInfo
.
CanWhileCount
+
"]次"
);
ACServerManager
.
AbsMove
(
moveAxis
.
DeviceName
,
moveAxis
.
GetAxisValue
(),
targetPosition
,
targetSpeed
);
ACServerManager
.
AbsMove
(
moveAxis
.
DeviceName
,
moveAxis
.
GetAxisValue
(),
targetPosition
,
targetSpeed
);
MoveInfo
.
CanWhileCount
--;
MoveInfo
.
CanWhileCount
--;
Thread
.
Sleep
(
100
);
}
}
else
else
{
{
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论