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