Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
刘韬
/
SO1007_XLC_Store
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit dd1c87f4
由
刘韬
编写于
2021-12-31 17:14:40 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
1
1 个父辈
254093c8
隐藏空白字符变更
内嵌
并排
正在显示
6 个修改的文件
包含
41 行增加
和
15 行删除
DeviceLibrary/DeviceLibrary/ServerCommunication.cs
DeviceLibrary/theMachine/AxisBean.cs
DeviceLibrary/theMachine/BoxTransport.cs
DeviceLibrary/theMachine/MainMachine _IN.cs
DeviceLibrary/theMachine/MainMachine.cs
DeviceLibrary/theMachine/MoveStep.cs
DeviceLibrary/DeviceLibrary/ServerCommunication.cs
查看文件 @
dd1c87f
...
@@ -241,7 +241,10 @@ namespace DeviceLibrary
...
@@ -241,7 +241,10 @@ namespace DeviceLibrary
}
}
if
(
resultOperation
.
op
.
Equals
(
1
))
if
(
resultOperation
.
op
.
Equals
(
1
))
{
{
ReviceInStoreProcess
(
resultOperation
.
data
[
"barcode"
],
resultOperation
);
var
barcode
=
""
;
if
(
resultOperation
.
data
.
ContainsKey
(
barcode
))
barcode
=
resultOperation
.
data
[
"barcode"
];
ReviceInStoreProcess
(
barcode
,
resultOperation
);
}
}
else
if
(
resultOperation
.
op
.
Equals
(
2
))
else
if
(
resultOperation
.
op
.
Equals
(
2
))
{
{
...
@@ -284,7 +287,7 @@ namespace DeviceLibrary
...
@@ -284,7 +287,7 @@ namespace DeviceLibrary
//出入库没有找到服务器发送的库位,需要打印日志方便查询原因
//出入库没有找到服务器发送的库位,需要打印日志方便查询原因
//SetWarnMsg(ResourceControl.InStoreNoPosition, message, posId);
//SetWarnMsg(ResourceControl.InStoreNoPosition, message, posId);
WarnMsg
=
"入库未找到库位:二维码【"
+
message
+
"】库位【"
+
posId
+
"】 "
;
WarnMsg
=
"入库未找到库位:二维码【"
+
message
+
"】库位【"
+
posId
+
"】 "
;
LogUtil
.
info
(
"收到服务器入库命令:入库未找到库位:二维码【"
+
message
+
"】库位【"
+
posId
+
"】"
);
LogUtil
.
info
(
"收到服务器入库命令:入库未找到库位:二维码【"
+
message
+
"】库位【"
+
posId
+
"】"
);
return
;
return
;
}
}
//TODO:判断BOX是否处于可以入库状态,如果调试或急停中,需要返回给服务器;
//TODO:判断BOX是否处于可以入库状态,如果调试或急停中,需要返回给服务器;
...
@@ -301,6 +304,12 @@ namespace DeviceLibrary
...
@@ -301,6 +304,12 @@ namespace DeviceLibrary
SendStoreState
(
""
,
StoreStatus
.
InStoreError
);
SendStoreState
(
""
,
StoreStatus
.
InStoreError
);
}
}
}
}
else
if
(
RobotManage
.
mainMachine
.
InMoveInfo
.
MoveStep
==
MoveStep
.
InWaitServerCallback
)
{
SendStoreState
(
""
,
StoreStatus
.
InStoreError
);
RobotManage
.
mainMachine
.
InMoveInfo
.
NewMove
(
MoveStep
.
Wait
);
LogUtil
.
info
(
"服务器没有正确返回库位."
);
}
}
}
...
...
DeviceLibrary/theMachine/AxisBean.cs
查看文件 @
dd1c87f
...
@@ -23,6 +23,7 @@ namespace DeviceLibrary
...
@@ -23,6 +23,7 @@ namespace DeviceLibrary
/// </summary>
/// </summary>
public
event
Func
<
int
,
int
,(
bool
,
string
)>
interference
;
public
event
Func
<
int
,
int
,(
bool
,
string
)>
interference
;
public
string
AxisName
;
public
string
AxisName
;
public
bool
ForceSafeCheck
=
false
;
public
AxisBean
(
ConfigMoveAxis
axisConfig
,
string
deviceName
)
public
AxisBean
(
ConfigMoveAxis
axisConfig
,
string
deviceName
)
{
{
this
.
Config
=
axisConfig
;
this
.
Config
=
axisConfig
;
...
@@ -112,6 +113,14 @@ namespace DeviceLibrary
...
@@ -112,6 +113,14 @@ namespace DeviceLibrary
if
(
IsInPosition
(
targetPosition
))
if
(
IsInPosition
(
targetPosition
))
return
;
return
;
if
(
ForceSafeCheck
&&
!
IsSafe
(
targetPosition
,
out
string
msg
))
{
Msg
.
add
(
msg
,
MsgLevel
.
alarm
);
RobotManage
.
UserPause
(
msg
);
return
;
}
if
(
MoveInfo
==
null
)
if
(
MoveInfo
==
null
)
{
{
AbsMove
(
targetPosition
,
targetSpeed
);
AbsMove
(
targetPosition
,
targetSpeed
);
...
...
DeviceLibrary/theMachine/BoxTransport.cs
查看文件 @
dd1c87f
...
@@ -65,6 +65,8 @@ namespace DeviceLibrary
...
@@ -65,6 +65,8 @@ namespace DeviceLibrary
MoveInfo
.
NewMove
(
MoveStep
.
StoreTS01
);
MoveInfo
.
NewMove
(
MoveStep
.
StoreTS01
);
MoveInfo
.
log
(
$
"{storeMoveType}:开始运输周转箱,从:{from.posid},到:{to.posid}"
);
MoveInfo
.
log
(
$
"{storeMoveType}:开始运输周转箱,从:{from.posid},到:{to.posid}"
);
}
}
MoveInfo
.
MoveParam
.
WareCode
=
WareCode
;
MoveInfo
.
MoveParam
.
PosID
=
$
"{From.posid}=>{To.posid}"
;
ErrMsgTxt
=
""
;
ErrMsgTxt
=
""
;
return
true
;
return
true
;
//thread = new Thread(new ThreadStart(Run));
//thread = new Thread(new ThreadStart(Run));
...
...
DeviceLibrary/theMachine/MainMachine _IN.cs
查看文件 @
dd1c87f
...
@@ -139,7 +139,7 @@ namespace DeviceLibrary
...
@@ -139,7 +139,7 @@ namespace DeviceLibrary
InMoveInfo
.
MoveParam
.
codeInfos
=
x
;
InMoveInfo
.
MoveParam
.
codeInfos
=
x
;
var
cc
=
x
.
Select
((
a
)
=>
a
.
CodeStr
);
var
cc
=
x
.
Select
((
a
)
=>
a
.
CodeStr
);
ServerCM
.
SendInStoreRequest
(
cc
.
ToArray
());
ServerCM
.
SendInStoreRequest
(
cc
.
ToArray
());
}
}
}
}
else
if
(
InMoveInfo
.
IsTimeOut
(
10
))
else
if
(
InMoveInfo
.
IsTimeOut
(
10
))
{
{
...
@@ -177,7 +177,7 @@ namespace DeviceLibrary
...
@@ -177,7 +177,7 @@ namespace DeviceLibrary
}
}
break
;
break
;
case
MoveStep
.
In07
:
case
MoveStep
.
In07
:
if
(
IOValue
(
IO_Type
.
InOverHead_Check
).
Equals
(
IO_VALUE
.
LOW
))
{
if
(
RobotManage
.
StoreType
==
StoreType
.
TypeA
&&
IOValue
(
IO_Type
.
InOverHead_Check
).
Equals
(
IO_VALUE
.
LOW
))
{
LineIn
.
LineStop
(
"work"
);
LineIn
.
LineStop
(
"work"
);
InMoveInfo
.
log
(
$
"X18检测到物料超高,停止滚筒"
);
InMoveInfo
.
log
(
$
"X18检测到物料超高,停止滚筒"
);
InMoveInfo
.
NextMoveStep
(
MoveStep
.
InOverHead
);
InMoveInfo
.
NextMoveStep
(
MoveStep
.
InOverHead
);
...
...
DeviceLibrary/theMachine/MainMachine.cs
查看文件 @
dd1c87f
...
@@ -97,6 +97,7 @@ namespace DeviceLibrary
...
@@ -97,6 +97,7 @@ namespace DeviceLibrary
#
region
初始化伺服轴
#
region
初始化伺服轴
XAxis
=
new
AxisBean
(
Config
.
XAxis
,
Name
);
XAxis
=
new
AxisBean
(
Config
.
XAxis
,
Name
);
XAxis
.
interference
+=
XAxis_interference
;
XAxis
.
interference
+=
XAxis_interference
;
XAxis
.
ForceSafeCheck
=
true
;
YAxis
=
new
AxisBean
(
Config
.
YAxis
,
Name
);
YAxis
=
new
AxisBean
(
Config
.
YAxis
,
Name
);
YAxis
.
interference
+=
YAxis_interference
;
YAxis
.
interference
+=
YAxis_interference
;
ZAxis
=
new
AxisBean
(
Config
.
ZAxis
,
Name
);
ZAxis
=
new
AxisBean
(
Config
.
ZAxis
,
Name
);
...
@@ -296,23 +297,27 @@ namespace DeviceLibrary
...
@@ -296,23 +297,27 @@ namespace DeviceLibrary
return
;
return
;
}
}
ResetMoveInfo
.
NextMoveStep
(
MoveStep
.
H03_HomeReset
);
ResetMoveInfo
.
NextMoveStep
(
MoveStep
.
H03_HomeReset
);
ResetMoveInfo
.
log
(
"
开始回原,行走机构,回原
"
);
ResetMoveInfo
.
log
(
"
正在回原,料叉P1待机点
"
);
XAxis
.
HomeMove
(
ResetMoveInfo
,
forceHome
);
ZAxis
.
AbsMove
(
ResetMoveInfo
,
Config
.
Zaxis_P1
,
Config
.
Zaxis_P1_speed
);
ResetMoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitTime
(
500
));
ResetMoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitTime
(
500
));
break
;
break
;
case
MoveStep
.
H03_HomeReset
:
case
MoveStep
.
H03_HomeReset
:
ResetMoveInfo
.
NextMoveStep
(
MoveStep
.
H04_HomeReset
);
ResetMoveInfo
.
NextMoveStep
(
MoveStep
.
H04_HomeReset
);
YAxis
.
HomeMove
(
ResetMoveInfo
,
forceHome
);
ResetMoveInfo
.
log
(
"开始回原,行走机构,回原"
);
ResetMoveInfo
.
log
(
"正在回原 ,升降轴,回原"
);
XAxis
.
HomeMove
(
ResetMoveInfo
,
forceHome
);
ResetMoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitTime
(
1000
));
ResetMoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitTime
(
1000
));
break
;
break
;
case
MoveStep
.
H04_HomeReset
:
case
MoveStep
.
H04_HomeReset
:
ResetMoveInfo
.
NextMoveStep
(
MoveStep
.
H05_HomeReset
);
ResetMoveInfo
.
NextMoveStep
(
MoveStep
.
H05_HomeReset
);
ResetMoveInfo
.
log
(
"正在回原,料叉P1待机点"
);
YAxis
.
HomeMove
(
ResetMoveInfo
,
forceHome
);
XAxis
.
AbsMove
(
ResetMoveInfo
,
Config
.
Zaxis_P1
,
Config
.
Zaxis_P1_speed
);
ResetMoveInfo
.
log
(
"正在回原 ,升降轴,回原"
);
break
;
break
;
case
MoveStep
.
H05_HomeReset
:
case
MoveStep
.
H05_HomeReset
:
ResetMoveInfo
.
NextMoveStep
(
MoveStep
.
H06_HomeReset
);
ResetMoveInfo
.
NextMoveStep
(
MoveStep
.
H06_HomeReset
);
ResetMoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitTime
(
500
));
break
;
case
MoveStep
.
H06_HomeReset
:
ResetMoveInfo
.
NextMoveStep
(
MoveStep
.
H07_HomeReset
);
ResetMoveInfo
.
log
(
"正在回原,行走机构,升降轴,到P1待机点,入口顶升下降,出口顶升上升"
);
ResetMoveInfo
.
log
(
"正在回原,行走机构,升降轴,到P1待机点,入口顶升下降,出口顶升上升"
);
YAxis
.
AbsMove
(
ResetMoveInfo
,
Config
.
Yaxis_P1
,
Config
.
Yaxis_P1_speed
);
YAxis
.
AbsMove
(
ResetMoveInfo
,
Config
.
Yaxis_P1
,
Config
.
Yaxis_P1_speed
);
XAxis
.
AbsMove
(
ResetMoveInfo
,
Config
.
Xaxis_P1
,
Config
.
Xaxis_P1_speed
);
XAxis
.
AbsMove
(
ResetMoveInfo
,
Config
.
Xaxis_P1
,
Config
.
Xaxis_P1_speed
);
...
@@ -322,10 +327,10 @@ namespace DeviceLibrary
...
@@ -322,10 +327,10 @@ namespace DeviceLibrary
CylinderMove
(
InMoveInfo
,
IO_Type
.
OutStop_Down
,
IO_Type
.
OutStop_Up
,
IO_VALUE
.
HIGH
);
CylinderMove
(
InMoveInfo
,
IO_Type
.
OutStop_Down
,
IO_Type
.
OutStop_Up
,
IO_VALUE
.
HIGH
);
CylinderMove
(
InMoveInfo
,
IO_Type
.
OutExitStop_Down
,
IO_Type
.
OutExitStop_Up
,
IO_VALUE
.
HIGH
);
CylinderMove
(
InMoveInfo
,
IO_Type
.
OutExitStop_Down
,
IO_Type
.
OutExitStop_Up
,
IO_VALUE
.
HIGH
);
break
;
break
;
case
MoveStep
.
H0
6
_HomeReset
:
case
MoveStep
.
H0
7
_HomeReset
:
if
(
IOValue
(
IO_Type
.
ForkMaterial_Check
).
Equals
(
IO_VALUE
.
HIGH
))
if
(
IOValue
(
IO_Type
.
ForkMaterial_Check
).
Equals
(
IO_VALUE
.
HIGH
))
{
{
ResetMoveInfo
.
NextMoveStep
(
MoveStep
.
H0
7
_HomeReset
);
ResetMoveInfo
.
NextMoveStep
(
MoveStep
.
H0
8
_HomeReset
);
ResetMoveInfo
.
log
(
"进出轴X09上有周转箱"
);
ResetMoveInfo
.
log
(
"进出轴X09上有周转箱"
);
}
}
...
@@ -341,15 +346,15 @@ namespace DeviceLibrary
...
@@ -341,15 +346,15 @@ namespace DeviceLibrary
ResetMoveInfo
.
log
(
"进出轴上没有周转箱"
);
ResetMoveInfo
.
log
(
"进出轴上没有周转箱"
);
}
}
break
;
break
;
case
MoveStep
.
H0
7
_HomeReset
:
case
MoveStep
.
H0
8
_HomeReset
:
if
(
OutMoveInfo
.
MoveStep
==
MoveStep
.
Wait
&&
IsOutLiftEmpty
)
{
if
(
OutMoveInfo
.
MoveStep
==
MoveStep
.
Wait
&&
IsOutLiftEmpty
)
{
ResetMoveInfo
.
NextMoveStep
(
MoveStep
.
H0
8
_HomeReset
);
ResetMoveInfo
.
NextMoveStep
(
MoveStep
.
H0
9
_HomeReset
);
boxTransport
.
Start
(
null
,
new
BoxStorePosition
(
Config
,
StoreSide
.
B
),
StoreMoveType
.
ReturnHome
,
"ReturnHome"
);
boxTransport
.
Start
(
null
,
new
BoxStorePosition
(
Config
,
StoreSide
.
B
),
StoreMoveType
.
ReturnHome
,
"ReturnHome"
);
ResetMoveInfo
.
log
(
"进出轴上有周转箱,开始送到出口"
);
ResetMoveInfo
.
log
(
"进出轴上有周转箱,开始送到出口"
);
ResetMoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitTime
(
100
));
ResetMoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitTime
(
100
));
}
}
break
;
break
;
case
MoveStep
.
H0
8
_HomeReset
:
case
MoveStep
.
H0
9
_HomeReset
:
boxTransport
.
Process
();
boxTransport
.
Process
();
if
(
boxTransport
.
IsComplateOrFree
)
if
(
boxTransport
.
IsComplateOrFree
)
{
{
...
...
DeviceLibrary/theMachine/MoveStep.cs
查看文件 @
dd1c87f
...
@@ -20,6 +20,7 @@ namespace DeviceLibrary
...
@@ -20,6 +20,7 @@ namespace DeviceLibrary
H06_HomeReset
,
H06_HomeReset
,
H07_HomeReset
,
H07_HomeReset
,
H08_HomeReset
,
H08_HomeReset
,
H09_HomeReset
,
HEND_HomeReset
,
HEND_HomeReset
,
InPre01
,
InPre01
,
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论