Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
孙克
/
RC1250-ACPackingStore
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit 150c5755
由
LN
编写于
2020-01-03 17:01:33 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
出库逻辑修改
1 个父辈
b76e97b6
隐藏空白字符变更
内嵌
并排
正在显示
7 个修改的文件
包含
275 行增加
和
148 行删除
source/Common/bean/Bean.cs
source/Common/util/FormUtil.cs
source/Common/util/HumitureController.cs
source/DeviceLibrary/ACPackingStore/AC_BOX_Bean.cs
source/DeviceLibrary/ACPackingStore/AC_BOX_Bean_Partial.cs
source/DeviceLibrary/store/InOutParam.cs
source/DeviceLibrary/store/StoreStep.cs
source/Common/bean/Bean.cs
查看文件 @
150c575
...
@@ -199,6 +199,30 @@ namespace OnlineStore.Common
...
@@ -199,6 +199,30 @@ namespace OnlineStore.Common
/// <summary>
/// <summary>
/// 温度报警值
/// 温度报警值
/// </summary>
/// </summary>
public
static
string
maxTemperature
=
"temp"
;
public
static
string
maxTemperature
=
"temp"
;
/// <summary>
/// urgentReel: true 表示紧急料,需要出到料串上
/// </summary>
public
static
string
urgentReel
=
"urgentReel"
;
/// <summary>
/// cutReel: true 表示分盘料,需要出到料串上
/// </summary>
public
static
string
cutReel
=
"cutReel"
;
/// <summary>
/// smallReel: true 小料(7x8),放置到小料架上
/// </summary>
public
static
string
smallReel
=
"smallReel"
;
/// <summary>
/// rfid: 分配的料架RFID
/// </summary>
public
static
string
rfid
=
"rfid"
;
/// <summary>
/// rfidLoc: 料架的架位,值为 - 1时,可以自由分配皮带线, 小料时,架位为1 - 46优先走1 / 2号皮带线,47 - 92优先走3 / 4号皮带线,
/// 70,71,72时只能分配到3 / 4号皮带线; 大料时,架位1 - 6优先走1 / 2号皮带线, 7 - 12优先走3 / 4号皮带线
/// </summary>
public
static
string
rfidLoc
=
"rfidLoc"
;
public
static
string
barcode
=
"barcode"
;
}
}
}
}
source/Common/util/FormUtil.cs
查看文件 @
150c575
...
@@ -91,5 +91,36 @@ namespace OnlineStore.Common
...
@@ -91,5 +91,36 @@ namespace OnlineStore.Common
}
}
return
span
.
Hours
.
ToString
().
PadLeft
(
2
,
'0'
)
+
":"
+
span
.
Minutes
.
ToString
().
PadLeft
(
2
,
'0'
)
+
":"
+
seconds
;
return
span
.
Hours
.
ToString
().
PadLeft
(
2
,
'0'
)
+
":"
+
span
.
Minutes
.
ToString
().
PadLeft
(
2
,
'0'
)
+
":"
+
seconds
;
}
}
public
static
bool
GetBoolData
(
Dictionary
<
string
,
string
>
data
,
string
key
,
bool
defaultValue
=
false
)
{
if
(
data
.
ContainsKey
(
key
))
{
try
{
return
Convert
.
ToBoolean
(
data
[
key
]);
}
catch
(
Exception
ex
)
{
}
}
return
defaultValue
;
}
public
static
int
GetIntData
(
Dictionary
<
string
,
string
>
data
,
string
key
,
int
defaultValue
=
0
)
{
if
(
data
.
ContainsKey
(
key
))
{
try
{
return
Convert
.
ToInt32
(
data
[
key
]);
}
catch
(
Exception
ex
)
{
}
}
return
defaultValue
;
}
}
}
}
}
source/Common/util/HumitureController.cs
查看文件 @
150c575
...
@@ -43,6 +43,7 @@ namespace OnlineStore.Common
...
@@ -43,6 +43,7 @@ namespace OnlineStore.Common
{
{
if
(
sb
.
openPort
())
if
(
sb
.
openPort
())
{
{
serialBeanMap
.
Add
(
port
,
sb
);
return
true
;
return
true
;
}
}
else
else
...
...
source/DeviceLibrary/ACPackingStore/AC_BOX_Bean.cs
查看文件 @
150c575
...
@@ -26,7 +26,13 @@ namespace OnlineStore.DeviceLibrary
...
@@ -26,7 +26,13 @@ namespace OnlineStore.DeviceLibrary
public
string
lastPosId
=
""
;
public
string
lastPosId
=
""
;
public
StoreStatus
lastPosIdStatus
=
StoreStatus
.
StoreOnline
;
public
StoreStatus
lastPosIdStatus
=
StoreStatus
.
StoreOnline
;
public
List
<
ConfigMoveAxis
>
moveAxisList
=
new
List
<
ConfigMoveAxis
>();
public
List
<
ConfigMoveAxis
>
moveAxisList
=
new
List
<
ConfigMoveAxis
>();
/// <summary>
/// 所有料仓库位列表
/// </summary>
public
List
<
string
>
PositionNumList
=
new
List
<
string
>();
public
List
<
string
>
PositionNumList
=
new
List
<
string
>();
/// <summary>
/// 所有料架库位列表
/// </summary>
public
List
<
string
>
ShelfPosList
=
new
List
<
string
>();
public
List
<
string
>
ShelfPosList
=
new
List
<
string
>();
/// <summary>
/// <summary>
/// 料架未放料盘的位置列表
/// 料架未放料盘的位置列表
...
@@ -55,8 +61,8 @@ namespace OnlineStore.DeviceLibrary
...
@@ -55,8 +61,8 @@ namespace OnlineStore.DeviceLibrary
//添加调试
//添加调试
IsDebug
=
config
.
IsInDebug
.
Equals
(
1
);
IsDebug
=
config
.
IsInDebug
.
Equals
(
1
);
Name
=
(
"料仓BOX_"
+
config
.
DeviceID
+
" "
).
ToUpper
();
Name
=
(
"料仓BOX_"
+
config
.
DeviceID
+
" "
).
ToUpper
();
this
.
DeviceID
=
config
.
DeviceID
;
this
.
DeviceID
=
config
.
DeviceID
;
;
this
.
Config
=
config
;
this
.
Config
=
config
;
DoorBean
=
new
EnteryDoorBean
(
DeviceID
);
DoorBean
=
new
EnteryDoorBean
(
DeviceID
);
//温湿度
//温湿度
humBean
=
new
HumitureBean
(
config
.
Humiture_Port
,
Name
);
humBean
=
new
HumitureBean
(
config
.
Humiture_Port
,
Name
);
...
@@ -884,15 +890,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -884,15 +890,7 @@ namespace OnlineStore.DeviceLibrary
{
{
boxStatus
.
msg
=
CodeMsg
;
boxStatus
.
msg
=
CodeMsg
;
lineOperation
.
msg
=
CodeMsg
;
lineOperation
.
msg
=
CodeMsg
;
}
}
//if (CodeMsg.Equals(""))
//{
// if (storeRunStatus.Equals(StoreRunStatus.Runing) && IOValue(IO_Type.TrayCheck_Fixture).Equals(IO_VALUE.HIGH))
// {
// boxStatus.msg = "叉子料盘检测有料,请检查";
// lineOperation.msg = "叉子料盘检测有料,请检查";
// }
//}
CodeMsg
=
""
;
CodeMsg
=
""
;
//WarnMsg = "";
//WarnMsg = "";
//状态
//状态
...
@@ -976,22 +974,34 @@ namespace OnlineStore.DeviceLibrary
...
@@ -976,22 +974,34 @@ namespace OnlineStore.DeviceLibrary
}
}
}
}
private
void
ReviceOutStoreProcess
(
Operation
resultOperation
)
private
void
ReviceOutStoreProcess
(
Operation
resultOperation
)
{
{
DateTime
time
=
DateTime
.
Now
;
DateTime
time
=
DateTime
.
Now
;
Dictionary
<
string
,
string
>
data
=
resultOperation
.
data
;
Dictionary
<
string
,
string
>
data
=
resultOperation
.
data
;
if
(
data
!=
null
&&
data
.
ContainsKey
(
ParamDefine
.
posId
)
if
(
data
!=
null
&&
data
.
ContainsKey
(
ParamDefine
.
posId
)
&&
data
.
ContainsKey
(
ParamDefine
.
plateH
)
&&
data
.
ContainsKey
(
ParamDefine
.
plateW
))
&&
data
.
ContainsKey
(
ParamDefine
.
plateH
)
&&
data
.
ContainsKey
(
ParamDefine
.
plateW
))
{
{
string
posIdStr
=
data
[
ParamDefine
.
posId
];
string
plateWStr
=
data
[
ParamDefine
.
plateW
];
string
plateHStr
=
data
[
ParamDefine
.
plateH
];
LogUtil
.
info
(
"收到服务器出库消息:poaIs="
+
posIdStr
+
",platew="
+
plateWStr
+
",plateh="
+
plateHStr
);
char
splitChar
=
'|'
;
char
splitChar
=
'|'
;
string
[]
posIdArray
=
posIdStr
.
Split
(
splitChar
);
string
[]
posIdArray
=
data
[
ParamDefine
.
posId
].
Split
(
splitChar
);
string
[]
plateWArray
=
plateWStr
.
Split
(
splitChar
);
string
[]
plateWArray
=
data
[
ParamDefine
.
plateW
].
Split
(
splitChar
);
string
[]
plateHArray
=
plateHStr
.
Split
(
splitChar
);
string
[]
plateHArray
=
data
[
ParamDefine
.
plateH
].
Split
(
splitChar
);
bool
urgentReel
=
FormUtil
.
GetBoolData
(
data
,
ParamDefine
.
urgentReel
);
bool
cutReel
=
FormUtil
.
GetBoolData
(
data
,
ParamDefine
.
cutReel
);
bool
smallReel
=
FormUtil
.
GetBoolData
(
data
,
ParamDefine
.
smallReel
);
string
rfid
=
data
.
ContainsKey
(
ParamDefine
.
rfid
)
?
data
[
ParamDefine
.
rfid
]
:
""
;
int
rfidLoc
=
FormUtil
.
GetIntData
(
data
,
ParamDefine
.
rfidLoc
);
string
barcode
=
data
.
ContainsKey
(
ParamDefine
.
barcode
)
?
data
[
ParamDefine
.
barcode
]
:
""
;
//urgentReel: true 表示紧急料,需要出到料串上
//cutReel: true 表示分盘料,需要出到料串上
//smallReel: true 小料(7x8),放置到小料架上
//rfid: 分配的料架RFID
//rfidLoc: 料架的架位,值为 - 1时,可以自由分配皮带线, 小料时,架位为1 - 46优先走1 / 2号皮带线,47 - 92优先走3 / 4号皮带线, 70,71,72时只能分配到3 / 4号皮带线; 大料时,架位1 - 6优先走1 / 2号皮带线, 7 - 12优先走3 / 4号皮带线
string
dataStr
=
JsonHelper
.
SerializeObject
(
data
);
LogUtil
.
info
(
"收到服务器出库消息:【"
+
dataStr
+
"】"
);
int
index
=
-
1
;
int
index
=
-
1
;
foreach
(
string
posId
in
posIdArray
)
foreach
(
string
posId
in
posIdArray
)
{
{
...
@@ -999,52 +1009,55 @@ namespace OnlineStore.DeviceLibrary
...
@@ -999,52 +1009,55 @@ namespace OnlineStore.DeviceLibrary
string
plateW
=
plateWArray
[
index
];
string
plateW
=
plateWArray
[
index
];
string
plateH
=
plateHArray
[
index
];
string
plateH
=
plateHArray
[
index
];
string
[]
posArray
=
posId
.
Split
(
'#'
);
string
[]
posArray
=
posId
.
Split
(
'#'
);
if
(
posArray
.
Length
!=
2
)
//if (posArray.Length != 2)
{
//{
WarnMsg
=
Name
+
"出库格式错误:库位号【"
+
posId
+
"】"
;
// WarnMsg = Name + "出库格式错误:库位号【" + posId + "】";
LogUtil
.
error
(
Name
+
"收到服务器出库命令:库位号【"
+
posId
+
"】格式错误"
);
// LogUtil.error(Name + "收到服务器出库命令:库位号【" + posId + "】格式错误");
continue
;
// continue;
}
//}
int
storeId
=
int
.
Parse
(
posArray
[
0
]);
InOutParam
inoutParam
=
new
InOutParam
(
barcode
,
posId
,
""
,
plateW
,
plateH
,
urgentReel
,
cutReel
,
smallReel
,
rfid
,
rfidLoc
);
//根据发送的posId获取位置列表
//根据发送的posId获取位置列表
ACBoxPosition
position
=
CSVPositionReader
<
ACBoxPosition
>.
GetPositon
(
posId
);
ACBoxPosition
position
=
CSVPositionReader
<
ACBoxPosition
>.
GetPositon
(
posId
);
if
(
position
==
null
)
if
(
position
==
null
)
{
{
//出入库没有找到服务器发送的库位,需要打印日志方便查询原因
//出入库没有找到服务器发送的库位,需要打印日志方便查询原因
WarnMsg
=
Name
+
"
出库未找库位:【"
+
posId
+
"】"
;
WarnMsg
=
Name
+
"
未找到库位:【"
+
inoutParam
.
ToStr
()
+
"】"
;
LogUtil
.
error
(
Name
+
"收到服务器出库命令:未找到【"
+
posId
+
"】的库位信息"
);
LogUtil
.
error
(
WarnMsg
);
continue
;
continue
;
}
}
else
try
{
{
InOutParam
inoutParam
=
new
InOutParam
(
""
,
posId
,
plateW
,
plateH
,
""
);
//判断是否接收过此库位的出库信息
if
(
MoveInfo
.
MoveType
.
Equals
(
StoreMoveType
.
OutStore
)
&&
MoveInfo
.
MoveParam
.
PosID
.
Equals
(
posId
))
try
{
{
//判断是否接收过此库位的出库信息
LogUtil
.
error
(
Name
+
" 出库命令【"
+
inoutParam
.
ToStr
()
+
"】重复,正在【"
+
posId
+
"】出库中"
);
if
(
MoveInfo
.
MoveType
.
Equals
(
StoreMoveType
.
OutStore
)
&&
MoveInfo
.
MoveParam
.
PosID
.
Equals
(
posId
))
continue
;
{
LogInfo
(
" 收到出库【"
+
inoutParam
.
ToStr
()
+
"】重复,当前已在【"
+
posId
+
"】出库中"
);
continue
;
}
else
{
//判断排队列表中是否已存在
List
<
InOutParam
>
reviceList
=
new
List
<
InOutParam
>(
waitOutStoreList
);
reviceList
=
(
from
m
in
reviceList
where
m
.
PosID
.
Equals
(
posId
)
select
m
).
ToList
<
InOutParam
>();
if
(
reviceList
.
Count
>
0
)
{
LogInfo
(
" 收到出库【"
+
inoutParam
.
ToStr
()
+
"】重复,排队列表中已存在【"
+
reviceList
[
0
].
ToStr
()
+
"】"
);
continue
;
}
}
}
}
catch
(
Exception
ex
)
//判断排队列表中是否已存在
List
<
InOutParam
>
reviceList
=
new
List
<
InOutParam
>(
waitOutStoreList
);
reviceList
=
(
from
m
in
reviceList
where
m
.
PosID
.
Equals
(
posId
)
select
m
).
ToList
<
InOutParam
>();
if
(
reviceList
.
Count
>
0
)
{
{
LogUtil
.
error
(
"验证出库【"
+
inoutParam
.
ToStr
()
+
"】是否重复出错:"
+
ex
.
ToString
());
LogUtil
.
error
(
Name
+
" 出库命令【"
+
inoutParam
.
ToStr
()
+
"】重复,排队列表中已存在【"
+
reviceList
[
0
].
ToStr
()
+
"】"
);
continue
;
}
}
string
shelfPosID
=
""
;
}
catch
(
Exception
ex
)
{
LogUtil
.
error
(
Name
+
"验证出库【"
+
inoutParam
.
ToStr
()
+
"】是否重复出错:"
+
ex
.
ToString
());
}
string
shelfPosID
=
""
;
if
(
inoutParam
.
rfidLoc
>
0
&&
ShelfPosList
.
Count
>=
inoutParam
.
rfidLoc
)
{
shelfPosID
=
ShelfPosList
[
inoutParam
.
rfidLoc
-
1
];
inoutParam
.
NeedEnterShelf
=
false
;
inoutParam
.
NeedOutShelf
=
false
;
inoutParam
.
ShelfPosID
=
shelfPosID
;
}
else
{
bool
hasShelf
=
EmprtShelfList
.
TryDequeue
(
out
shelfPosID
);
bool
hasShelf
=
EmprtShelfList
.
TryDequeue
(
out
shelfPosID
);
if
(
hasShelf
)
if
(
hasShelf
)
{
{
...
@@ -1056,15 +1069,16 @@ namespace OnlineStore.DeviceLibrary
...
@@ -1056,15 +1069,16 @@ namespace OnlineStore.DeviceLibrary
{
{
inoutParam
.
NeedEnterShelf
=
true
;
inoutParam
.
NeedEnterShelf
=
true
;
inoutParam
.
NeedOutShelf
=
false
;
inoutParam
.
NeedOutShelf
=
false
;
Log
Util
.
error
(
Name
+
"执行出库【"
+
inoutParam
.
ToStr
()
+
"】,么
有空料架,需要使用新料架"
);
Log
Info
(
Name
+
"执行出库【"
+
inoutParam
.
ToStr
()
+
"】,没
有空料架,需要使用新料架"
);
}
}
StartExecuctOut
(
inoutParam
);
}
}
StartExecuctOut
(
inoutParam
);
}
}
TimeSpan
span
=
DateTime
.
Now
-
time
;
TimeSpan
span
=
DateTime
.
Now
-
time
;
if
(
span
.
TotalMilliseconds
>
10
)
if
(
span
.
TotalMilliseconds
>
10
)
{
{
Log
Util
.
info
(
Name
+
"执行Timer
Process 共处理了【"
+
span
.
TotalMilliseconds
+
"】毫秒"
);
Log
Info
(
Name
+
"执行 ReviceOutStore
Process 共处理了【"
+
span
.
TotalMilliseconds
+
"】毫秒"
);
}
}
}
}
}
}
...
...
source/DeviceLibrary/ACPackingStore/AC_BOX_Bean_Partial.cs
查看文件 @
150c575
...
@@ -79,13 +79,13 @@ namespace OnlineStore.DeviceLibrary
...
@@ -79,13 +79,13 @@ namespace OnlineStore.DeviceLibrary
{
{
}
}
else
if
(
wait
.
WaitType
.
Equals
(
WaitEnum
.
W008_Compress
))
else
if
(
wait
.
WaitType
.
Equals
(
WaitEnum
.
W008_Compress
))
{
{
//等待信号亮或者走到绝对位置才停止
//等待信号亮或者走到绝对位置才停止
if
(
IOValue
(
TargetIoType
).
Equals
(
TargetIoValue
))
if
(
IOValue
(
TargetIoType
).
Equals
(
TargetIoValue
))
{
{
LogUtil
.
info
(
"CheckWait 检测到"
+
TargetIoType
+
"="
+
TargetIoValue
+
",停止压紧轴运行"
);
LogUtil
.
info
(
"CheckWait 检测到"
+
TargetIoType
+
"="
+
TargetIoValue
+
",停止压紧轴运行"
);
wait
.
IsEnd
=
true
;
wait
.
IsEnd
=
true
;
ComAxisStopCheck
();
ComAxisStopCheck
();
}
}
else
else
{
{
...
@@ -93,7 +93,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -93,7 +93,7 @@ namespace OnlineStore.DeviceLibrary
if
(
moveOk
)
if
(
moveOk
)
{
{
//TODO 判断是否达到高度,如果未达到,继续上升
//TODO 判断是否达到高度,如果未达到,继续上升
wait
.
IsEnd
=
true
;
wait
.
IsEnd
=
true
;
ComAxisStopCheck
();
ComAxisStopCheck
();
}
}
}
}
...
@@ -104,8 +104,34 @@ namespace OnlineStore.DeviceLibrary
...
@@ -104,8 +104,34 @@ namespace OnlineStore.DeviceLibrary
}
}
else
if
(
wait
.
WaitType
.
Equals
(
WaitEnum
.
W010_AgvStatus
))
else
if
(
wait
.
WaitType
.
Equals
(
WaitEnum
.
W010_AgvStatus
))
{
{
int
agvA
=
(
int
)
AgvClient
.
GetAction
(
Config
.
AgvNodeName
);
int
agvA
=
(
int
)
AgvClient
.
GetAction
(
Config
.
AgvNodeName
);
wait
.
IsEnd
=
agvA
.
Equals
(
wait
.
TargetPosition
);
wait
.
IsEnd
=
agvA
.
Equals
(
wait
.
TargetPosition
);
if
(!
wait
.
IsEnd
&&
span
.
TotalSeconds
>
10
)
{
//如果是等待AGV到达,等待有料架信号也算结束
if
(
wait
.
TargetPosition
.
Equals
((
int
)
Asa
.
Actions
.
Arrive
)&&
MoveInfo
.
MoveStep
.
Equals
(
StoreMoveStep
.
BI_01_ReadyShelf
))
{
if
(
IOValue
(
IO_Type
.
LineTake_Check
).
Equals
(
IO_VALUE
.
HIGH
))
{
LogInfo
(
"BI_01_ReadyShelf 等待小车到达Arrive,检测到 LineTake_Check 信号,结束等待"
);
wait
.
IsEnd
=
true
;
}
else
if
(
IOValue
(
IO_Type
.
LineIn_Check
).
Equals
(
IO_VALUE
.
HIGH
))
{
LogInfo
(
"BI_01_ReadyShelf 等待小车到达Arrive,检测到 LineIn_Check 信号,结束等待"
);
wait
.
IsEnd
=
true
;
}
}
else
if
(
wait
.
TargetPosition
.
Equals
((
int
)
Asa
.
Actions
.
FinishOut
))
{
if
(
IOValue
(
IO_Type
.
LineTake_Check
).
Equals
(
IO_VALUE
.
LOW
)
&&
IOValue
(
IO_Type
.
LineIn_Check
).
Equals
(
IO_VALUE
.
LOW
))
{
LogInfo
(
"等待小车离开FinishOut,检测到 LineTake_Check和LineIn_Check都没有信号,结束等待"
);
wait
.
IsEnd
=
true
;
}
}
}
}
}
if
(
wait
.
IsEnd
)
if
(
wait
.
IsEnd
)
{
{
...
@@ -138,8 +164,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -138,8 +164,7 @@ namespace OnlineStore.DeviceLibrary
}
}
private
static
DateTime
lastComRHomeTime
=
DateTime
.
Now
;
private
static
DateTime
lastComRHomeTime
=
DateTime
.
Now
;
private
void
InOutBackToP1
(
int
InOut_P1
)
private
void
InOutBackToP1
(
int
InOut_P1
)
{
{
//判断是否在P1,如果是,不需要运行
//判断是否在P1,如果是,不需要运行
if
(
ACServerManager
.
isInPosition
(
Config
.
InOut_Axis
,
InOut_P1
))
if
(
ACServerManager
.
isInPosition
(
Config
.
InOut_Axis
,
InOut_P1
))
{
{
...
@@ -241,7 +266,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -241,7 +266,7 @@ namespace OnlineStore.DeviceLibrary
MoveInfo
.
NewMove
(
StoreMoveType
.
InStore
,
new
InOutParam
());
MoveInfo
.
NewMove
(
StoreMoveType
.
InStore
,
new
InOutParam
());
MoveInfo
.
MoveParam
.
MoveP
=
new
LineMoveP
(
Config
);
MoveInfo
.
MoveParam
.
MoveP
=
new
LineMoveP
(
Config
);
MoveInfo
.
ShelfPositionList
=
new
List
<
string
>(
ShelfPosList
);
MoveInfo
.
ShelfPositionList
=
new
List
<
string
>(
ShelfPosList
);
MoveInfo
.
NextMoveStep
(
StoreMoveStep
.
BI_0
5
_DoorClose
);
MoveInfo
.
NextMoveStep
(
StoreMoveStep
.
BI_0
6
_DoorClose
);
LogInfo
(
" 空闲中,检测到入料口有料架,启动料架入库 "
+
MoveInfo
.
SLog
+
""
);
LogInfo
(
" 空闲中,检测到入料口有料架,启动料架入库 "
+
MoveInfo
.
SLog
+
""
);
}
}
else
else
...
@@ -304,7 +329,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -304,7 +329,7 @@ namespace OnlineStore.DeviceLibrary
#
region
料架取料盘扫码获取
POSID
#
region
料架取料盘扫码获取
POSID
if
(
MoveInfo
.
MoveStep
.
Equals
(
StoreMoveStep
.
BI_
08
_StartGetTray
))
if
(
MoveInfo
.
MoveStep
.
Equals
(
StoreMoveStep
.
BI_
10
_StartGetTray
))
{
{
if
(
MoveInfo
.
NextShelfPos
())
if
(
MoveInfo
.
NextShelfPos
())
{
{
...
@@ -344,7 +369,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -344,7 +369,7 @@ namespace OnlineStore.DeviceLibrary
else
if
(
MoveInfo
.
MoveStep
.
Equals
(
StoreMoveStep
.
BI_14_UpdownToP102
))
else
if
(
MoveInfo
.
MoveStep
.
Equals
(
StoreMoveStep
.
BI_14_UpdownToP102
))
{
{
MoveInfo
.
NextMoveStep
(
StoreMoveStep
.
BI_15_StartCompress
);
MoveInfo
.
NextMoveStep
(
StoreMoveStep
.
BI_15_StartCompress
);
InOutStoreLog
(
"料架取料 "
+
MoveInfo
.
SLog
+
":压紧轴开始缓慢压紧到P4
"
);
InOutStoreLog
(
"料架取料 "
+
MoveInfo
.
SLog
+
":压紧轴开始缓慢压紧到P4
:"
+
Config
.
CompAxis_P4_Position
);
MoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitComAxis
(
Config
.
Comp_Axis
,
Config
.
CompAxis_P4_Position
,
Config
.
CompAxis_P4_Speed
));
MoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitComAxis
(
Config
.
Comp_Axis
,
Config
.
CompAxis_P4_Position
,
Config
.
CompAxis_P4_Speed
));
Config
.
Comp_Axis
.
TargetPosition
=
Config
.
CompAxis_P4_Position
;
Config
.
Comp_Axis
.
TargetPosition
=
Config
.
CompAxis_P4_Position
;
ACServerManager
.
AbsMove
(
Config
.
Comp_Axis
.
DeviceName
,
Config
.
Comp_Axis
.
GetAxisValue
(),
Config
.
CompAxis_P4_Position
,
Config
.
CompAxis_P4_Speed
);
ACServerManager
.
AbsMove
(
Config
.
Comp_Axis
.
DeviceName
,
Config
.
Comp_Axis
.
GetAxisValue
(),
Config
.
CompAxis_P4_Position
,
Config
.
CompAxis_P4_Speed
);
...
@@ -533,7 +558,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -533,7 +558,7 @@ namespace OnlineStore.DeviceLibrary
}
}
else
else
{
{
MoveInfo
.
NextMoveStep
(
StoreMoveStep
.
BI_
08
_StartGetTray
);
MoveInfo
.
NextMoveStep
(
StoreMoveStep
.
BI_
10
_StartGetTray
);
InOutStoreLog
(
"料架入库 "
+
MoveInfo
.
SLog
+
":上一盘入库结束, 耗时【"
+
FormUtil
.
GetSpanStr
(
span
)
+
"】判断是否有下个料盘,扫码入库"
);
InOutStoreLog
(
"料架入库 "
+
MoveInfo
.
SLog
+
":上一盘入库结束, 耗时【"
+
FormUtil
.
GetSpanStr
(
span
)
+
"】判断是否有下个料盘,扫码入库"
);
}
}
}
}
...
@@ -583,13 +608,13 @@ namespace OnlineStore.DeviceLibrary
...
@@ -583,13 +608,13 @@ namespace OnlineStore.DeviceLibrary
else
if
(
MoveInfo
.
MoveStep
.
Equals
(
StoreMoveStep
.
BI_77_NGLineRun
))
else
if
(
MoveInfo
.
MoveStep
.
Equals
(
StoreMoveStep
.
BI_77_NGLineRun
))
{
{
IOMove
(
IO_Type
.
NGLine_Run
,
IO_VALUE
.
LOW
);
IOMove
(
IO_Type
.
NGLine_Run
,
IO_VALUE
.
LOW
);
MoveInfo
.
NextMoveStep
(
StoreMoveStep
.
BI_
08
_StartGetTray
);
MoveInfo
.
NextMoveStep
(
StoreMoveStep
.
BI_
10
_StartGetTray
);
InOutStoreLog
(
"料架入库 "
+
MoveInfo
.
SLog
+
":停止NG线体转动,开始循环逐个取料盘,扫码入库"
);
InOutStoreLog
(
"料架入库 "
+
MoveInfo
.
SLog
+
":停止NG线体转动,开始循环逐个取料盘,扫码入库"
);
}
}
#
endregion
#
endregion
//料架进入逻辑
//料架进入逻辑
else
if
(
MoveInfo
.
MoveStep
<
StoreMoveStep
.
BI_
08
_StartGetTray
)
else
if
(
MoveInfo
.
MoveStep
<
StoreMoveStep
.
BI_
10
_StartGetTray
)
{
{
ShelfEnterProcess
();
ShelfEnterProcess
();
}
}
...
@@ -655,7 +680,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -655,7 +680,7 @@ namespace OnlineStore.DeviceLibrary
//发送扫码内容到服务器进行入库操作
//发送扫码内容到服务器进行入库操作
Operation
operation
=
getLineBoxStatus
();
Operation
operation
=
getLineBoxStatus
();
operation
.
op
=
1
;
operation
.
op
=
1
;
operation
.
data
=
new
Dictionary
<
string
,
string
>()
{
{
"code"
,
message
},
{
"boxId"
,
DeviceID
.
ToString
()
}
};
operation
.
data
=
new
Dictionary
<
string
,
string
>()
{
{
"code"
,
message
},
{
"boxId"
,
1
.
ToString
()
}
};
string
server
=
ConfigAppSettings
.
GetValue
(
Setting_Init
.
http_server
);
string
server
=
ConfigAppSettings
.
GetValue
(
Setting_Init
.
http_server
);
Operation
resultOperation
=
HttpHelper
.
Post
(
StoreManager
.
GetPostApi
(
server
),
operation
,
false
);
Operation
resultOperation
=
HttpHelper
.
Post
(
StoreManager
.
GetPostApi
(
server
),
operation
,
false
);
if
(
resultOperation
==
null
)
if
(
resultOperation
==
null
)
...
@@ -729,7 +754,14 @@ namespace OnlineStore.DeviceLibrary
...
@@ -729,7 +754,14 @@ namespace OnlineStore.DeviceLibrary
#
endregion
#
endregion
#
region
料架进出料仓处理:出入库模块共用
#
region
料架进出料仓处理:出入库模块共用
private
void
BI_04_WaitTakeSingle
(
string
moveName
)
{
MoveInfo
.
NextMoveStep
(
StoreMoveStep
.
BI_04_WaitTakeSingle
);
InOutStoreLog
(
moveName
+
MoveInfo
.
SLog
+
" 线体正转,等待LineIn_Check=Low, 信号LineTake_Check=High"
);
LineRun
();
MoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitIO
(
IO_Type
.
LineIn_Check
,
IO_VALUE
.
LOW
));
MoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitIO
(
IO_Type
.
LineTake_Check
,
IO_VALUE
.
HIGH
));
}
private
void
ShelfEnterProcess
()
private
void
ShelfEnterProcess
()
{
{
string
moveName
=
"料架入库"
;
string
moveName
=
"料架入库"
;
...
@@ -741,25 +773,37 @@ namespace OnlineStore.DeviceLibrary
...
@@ -741,25 +773,37 @@ namespace OnlineStore.DeviceLibrary
}
}
if
(
MoveInfo
.
MoveStep
.
Equals
(
StoreMoveStep
.
BI_01_ReadyShelf
))
if
(
MoveInfo
.
MoveStep
.
Equals
(
StoreMoveStep
.
BI_01_ReadyShelf
))
{
{
// MoveInfo.ShelfPositionList = new List<string>(ShelfPosList);
if
(
IOValue
(
IO_Type
.
LineIn_Check
).
Equals
(
IO_VALUE
.
HIGH
))
InOutStoreLog
(
moveName
+
MoveInfo
.
SLog
+
"调用AgvClient.MayEnter,小车已到达,打开入料口移门"
);
{
MoveInfo
.
NextMoveStep
(
StoreMoveStep
.
BI_02_DoorOpen
);
BI_04_WaitTakeSingle
(
moveName
);
}
DoorBean
.
StartOpen
(
MoveInfo
);
else
if
(
IOValue
(
IO_Type
.
LineTake_Check
).
Equals
(
IO_VALUE
.
HIGH
))
{
BI_04_WaitTakeSingle
(
moveName
);
}
else
{
// MoveInfo.ShelfPositionList = new List<string>(ShelfPosList);
InOutStoreLog
(
moveName
+
MoveInfo
.
SLog
+
"调用AgvClient.MayEnter,小车已到达,打开入料口移门"
);
MoveInfo
.
NextMoveStep
(
StoreMoveStep
.
BI_02_DoorOpen
);
DoorBean
.
StartOpen
(
MoveInfo
);
}
}
}
else
if
(
MoveInfo
.
MoveStep
.
Equals
(
StoreMoveStep
.
BI_02_DoorOpen
))
else
if
(
MoveInfo
.
MoveStep
.
Equals
(
StoreMoveStep
.
BI_02_DoorOpen
))
{
{
MoveInfo
.
NextMoveStep
(
StoreMoveStep
.
BI_03_LineRun
);
MoveInfo
.
NextMoveStep
(
StoreMoveStep
.
BI_03_LineRun
);
InOutStoreLog
(
moveName
+
MoveInfo
.
SLog
+
"调用AgvClient.MayEnter,线体正转,等待
取料位检测到
信号"
);
InOutStoreLog
(
moveName
+
MoveInfo
.
SLog
+
"调用AgvClient.MayEnter,线体正转,等待
LineIn_Check
信号"
);
AgvClient
.
MayEnter
(
Config
.
AgvNodeName
);
AgvClient
.
MayEnter
(
Config
.
AgvNodeName
);
LineRun
();
LineRun
();
MoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitIO
(
IO_Type
.
LineIn_Check
,
IO_VALUE
.
HIGH
));
MoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitIO
(
IO_Type
.
LineIn_Check
,
IO_VALUE
.
LOW
));
MoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitIO
(
IO_Type
.
LineTake_Check
,
IO_VALUE
.
HIGH
));
}
}
else
if
(
MoveInfo
.
MoveStep
.
Equals
(
StoreMoveStep
.
BI_03_LineRun
))
else
if
(
MoveInfo
.
MoveStep
.
Equals
(
StoreMoveStep
.
BI_03_LineRun
))
{
{
MoveInfo
.
NextMoveStep
(
StoreMoveStep
.
BI_04_LineStop
);
BI_04_WaitTakeSingle
(
moveName
);
}
else
if
(
MoveInfo
.
MoveStep
.
Equals
(
StoreMoveStep
.
BI_04_WaitTakeSingle
))
{
MoveInfo
.
NextMoveStep
(
StoreMoveStep
.
BI_05_LineStop
);
InOutStoreLog
(
moveName
+
MoveInfo
.
SLog
+
"调用AgvClient.FinishEnter,取料位检测到信号,停止线体正转"
);
InOutStoreLog
(
moveName
+
MoveInfo
.
SLog
+
"调用AgvClient.FinishEnter,取料位检测到信号,停止线体正转"
);
LineStop
();
LineStop
();
AgvClient
.
FinishEnter
(
Config
.
AgvNodeName
);
AgvClient
.
FinishEnter
(
Config
.
AgvNodeName
);
...
@@ -787,9 +831,9 @@ namespace OnlineStore.DeviceLibrary
...
@@ -787,9 +831,9 @@ namespace OnlineStore.DeviceLibrary
}
}
}
}
else
if
(
MoveInfo
.
MoveStep
.
Equals
(
StoreMoveStep
.
BI_0
4
_LineStop
))
else
if
(
MoveInfo
.
MoveStep
.
Equals
(
StoreMoveStep
.
BI_0
5
_LineStop
))
{
{
MoveInfo
.
NextMoveStep
(
StoreMoveStep
.
BI_0
5
_DoorClose
);
MoveInfo
.
NextMoveStep
(
StoreMoveStep
.
BI_0
6
_DoorClose
);
InOutStoreLog
(
moveName
+
MoveInfo
.
SLog
+
"入料口移门关闭"
);
InOutStoreLog
(
moveName
+
MoveInfo
.
SLog
+
"入料口移门关闭"
);
// CylinderMove(MoveInfo, IO_Type.EntranceDoor_Open, IO_Type.EntranceDoor_Close);
// CylinderMove(MoveInfo, IO_Type.EntranceDoor_Open, IO_Type.EntranceDoor_Close);
DoorBean
.
StartClose
(
MoveInfo
);
DoorBean
.
StartClose
(
MoveInfo
);
...
@@ -801,29 +845,29 @@ namespace OnlineStore.DeviceLibrary
...
@@ -801,29 +845,29 @@ namespace OnlineStore.DeviceLibrary
ACAxisMove
(
Config
.
UpDown_Axis
,
MoveInfo
.
MoveParam
.
MoveP
.
UpDown_P5
,
Config
.
UpDownAxis_P5_Speed
);
ACAxisMove
(
Config
.
UpDown_Axis
,
MoveInfo
.
MoveParam
.
MoveP
.
UpDown_P5
,
Config
.
UpDownAxis_P5_Speed
);
}
}
}
}
else
if
(
MoveInfo
.
MoveStep
.
Equals
(
StoreMoveStep
.
BI_0
5
_DoorClose
))
else
if
(
MoveInfo
.
MoveStep
.
Equals
(
StoreMoveStep
.
BI_0
6
_DoorClose
))
{
{
MoveInfo
.
NextMoveStep
(
StoreMoveStep
.
BI_0
6
_LineRun
);
MoveInfo
.
NextMoveStep
(
StoreMoveStep
.
BI_0
7
_LineRun
);
InOutStoreLog
(
moveName
+
MoveInfo
.
SLog
+
"继续转动1500"
);
InOutStoreLog
(
moveName
+
MoveInfo
.
SLog
+
"继续转动1500"
);
LineRun
();
LineRun
();
MoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitTime
(
1500
));
MoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitTime
(
1500
));
}
}
else
if
(
MoveInfo
.
MoveStep
.
Equals
(
StoreMoveStep
.
BI_0
6
_LineRun
))
else
if
(
MoveInfo
.
MoveStep
.
Equals
(
StoreMoveStep
.
BI_0
7
_LineRun
))
{
{
LineStop
();
LineStop
();
MoveInfo
.
NextMoveStep
(
StoreMoveStep
.
BI_0
7
_LocationUp
);
MoveInfo
.
NextMoveStep
(
StoreMoveStep
.
BI_0
8
_LocationUp
);
InOutStoreLog
(
moveName
+
MoveInfo
.
SLog
+
"线体停止转动,定位装置上升"
);
InOutStoreLog
(
moveName
+
MoveInfo
.
SLog
+
"线体停止转动,定位装置上升"
);
// CylinderMove(MoveInfo, IO_Type.LocationCylinder_Down, IO_Type.LocationCylinder_Up);
// CylinderMove(MoveInfo, IO_Type.LocationCylinder_Down, IO_Type.LocationCylinder_Up);
if
(!
instoreShelf
)
if
(!
instoreShelf
)
{
{
InOutStoreLog
(
"出库 "
+
MoveInfo
.
SLog
+
":叉子进入库位中, 进出轴至P3(库位取放料点) "
);
InOutStoreLog
(
"出库 "
+
MoveInfo
.
SLog
+
":叉子进入库位中, 进出轴至P3(库位取放料点) "
);
ACAxisMove
(
Config
.
InOut_Axis
,
MoveInfo
.
MoveParam
.
MoveP
.
InOut_P3
,
Config
.
InOutAxis_P3_Speed
);
ACAxisMove
(
Config
.
InOut_Axis
,
MoveInfo
.
MoveParam
.
MoveP
.
InOut_P3
,
Config
.
InOutAxis_P3_Speed
);
}
}
}
}
else
if
(
MoveInfo
.
MoveStep
.
Equals
(
StoreMoveStep
.
BI_0
7
_LocationUp
))
else
if
(
MoveInfo
.
MoveStep
.
Equals
(
StoreMoveStep
.
BI_0
8
_LocationUp
))
{
{
MoveInfo
.
NextMoveStep
(
StoreMoveStep
.
BI_0
8_StartGetTray
);
MoveInfo
.
NextMoveStep
(
StoreMoveStep
.
BI_0
9_TopCylinderUp
);
InOutStoreLog
(
moveName
+
MoveInfo
.
SLog
+
"顶升装置上升"
);
InOutStoreLog
(
moveName
+
MoveInfo
.
SLog
+
"顶升装置上升"
);
CylinderMove
(
MoveInfo
,
IO_Type
.
TopCylinder_Down
,
IO_Type
.
TopCylinder_Up
);
CylinderMove
(
MoveInfo
,
IO_Type
.
TopCylinder_Down
,
IO_Type
.
TopCylinder_Up
);
...
@@ -834,11 +878,11 @@ namespace OnlineStore.DeviceLibrary
...
@@ -834,11 +878,11 @@ namespace OnlineStore.DeviceLibrary
ACAxisMove
(
Config
.
UpDown_Axis
,
MoveInfo
.
MoveParam
.
MoveP
.
UpDown_P6
,
Config
.
UpDownAxis_P6_Speed
);
ACAxisMove
(
Config
.
UpDown_Axis
,
MoveInfo
.
MoveParam
.
MoveP
.
UpDown_P6
,
Config
.
UpDownAxis_P6_Speed
);
}
}
}
}
else
if
(
MoveInfo
.
MoveStep
.
Equals
(
StoreMoveStep
.
BI_0
8_StartGetTray
))
else
if
(
MoveInfo
.
MoveStep
.
Equals
(
StoreMoveStep
.
BI_0
9_TopCylinderUp
))
{
{
if
(
instoreShelf
)
if
(
instoreShelf
)
{
{
MoveInfo
.
NextMoveStep
(
StoreMoveStep
.
BI_
08
_StartGetTray
);
MoveInfo
.
NextMoveStep
(
StoreMoveStep
.
BI_
10
_StartGetTray
);
InOutStoreLog
(
moveName
+
MoveInfo
.
SLog
+
"开始循环从第一个空位逐个取料盘,扫码入库"
);
InOutStoreLog
(
moveName
+
MoveInfo
.
SLog
+
"开始循环从第一个空位逐个取料盘,扫码入库"
);
}
}
else
else
...
@@ -852,7 +896,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -852,7 +896,7 @@ namespace OnlineStore.DeviceLibrary
lastPosId
=
posId
;
lastPosId
=
posId
;
lastPosIdStatus
=
StoreStatus
.
OutStoreBoxEnd
;
lastPosIdStatus
=
StoreStatus
.
OutStoreBoxEnd
;
storeStatus
=
StoreStatus
.
OutStoreBoxEnd
;
storeStatus
=
StoreStatus
.
OutStoreBoxEnd
;
}
}
}
}
}
}
...
@@ -883,7 +927,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -883,7 +927,7 @@ namespace OnlineStore.DeviceLibrary
{
{
MoveInfo
.
NextMoveStep
(
StoreMoveStep
.
BS_02_LocatinCylinder_Down
);
MoveInfo
.
NextMoveStep
(
StoreMoveStep
.
BS_02_LocatinCylinder_Down
);
InOutStoreLog
(
moveName
+
MoveInfo
.
SLog
+
" :定位气缸下降"
);
InOutStoreLog
(
moveName
+
MoveInfo
.
SLog
+
" :定位气缸下降"
);
// CylinderMove(MoveInfo, IO_Type.LocationCylinder_Up, IO_Type.LocationCylinder_Down);
// CylinderMove(MoveInfo, IO_Type.LocationCylinder_Up, IO_Type.LocationCylinder_Down);
}
}
else
if
(
MoveInfo
.
MoveStep
.
Equals
(
StoreMoveStep
.
BS_02_LocatinCylinder_Down
))
else
if
(
MoveInfo
.
MoveStep
.
Equals
(
StoreMoveStep
.
BS_02_LocatinCylinder_Down
))
{
{
...
@@ -936,8 +980,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -936,8 +980,7 @@ namespace OnlineStore.DeviceLibrary
InOutStoreLog
(
moveName
+
MoveInfo
.
SLog
+
":停止转动,料架入料结束"
);
InOutStoreLog
(
moveName
+
MoveInfo
.
SLog
+
":停止转动,料架入料结束"
);
LineStop
();
LineStop
();
}
}
}
}
#
endregion
#
endregion
...
@@ -995,6 +1038,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -995,6 +1038,7 @@ namespace OnlineStore.DeviceLibrary
private
void
StartExecuctOut
(
InOutParam
param
)
private
void
StartExecuctOut
(
InOutParam
param
)
{
{
bool
result
=
StartOutStoreMove
(
param
);
bool
result
=
StartOutStoreMove
(
param
);
if
(!
result
)
if
(!
result
)
{
{
...
@@ -1014,29 +1058,26 @@ namespace OnlineStore.DeviceLibrary
...
@@ -1014,29 +1058,26 @@ namespace OnlineStore.DeviceLibrary
(!
storeRunStatus
.
Equals
(
StoreRunStatus
.
Runing
))
(!
storeRunStatus
.
Equals
(
StoreRunStatus
.
Runing
))
||
(!
MoveInfo
.
MoveType
.
Equals
(
StoreMoveType
.
None
)))
||
(!
MoveInfo
.
MoveType
.
Equals
(
StoreMoveType
.
None
)))
{
{
LogUtil
.
error
(
Name
+
" 启动出库
出错,忙碌或报警中 ,storeStatus="
+
storeRunStatus
+
",MoveType="
+
MoveInfo
.
MoveType
+
",isInSuddenDown="
+
isInSuddenDown
+
",isNoAirCheck
"
+
isNoAirCheck
);
LogUtil
.
error
(
Name
+
" 启动出库
【"
+
param
.
ToStr
()
+
"】失败,忙碌或报警中 ,storeStatus:"
+
storeRunStatus
+
",MoveType:"
+
MoveInfo
.
MoveType
+
",isInSuddenDown:"
+
isInSuddenDown
+
",isNoAirCheck:
"
+
isNoAirCheck
);
return
false
;
return
false
;
}
}
if
(!
StoreManager
.
LoadInoutParam
(
param
,
false
,
this
))
if
(!
StoreManager
.
LoadInoutParam
(
param
,
false
,
this
))
{
{
LogUtil
.
error
(
Name
+
" 启动出库【"
+
p
osId
+
"】出错,找不到库位信息"
);
LogUtil
.
error
(
Name
+
" 启动出库【"
+
p
aram
.
ToStr
()
+
"】出错,找不到库位信息"
);
return
false
;
return
false
;
}
}
//if (IOValue(IO_Type.TrayCheck_Fixture).Equals(IO_VALUE.HIGH))
//{
// LogUtil.error(Name + " 启动出库【" + posId + "】出错,叉子料盘检测有料");
// return false;
//}
storeStatus
=
StoreStatus
.
OutStoreExecute
;
storeStatus
=
StoreStatus
.
OutStoreExecute
;
storeRunStatus
=
StoreRunStatus
.
Busy
;
storeRunStatus
=
StoreRunStatus
.
Busy
;
MoveInfo
.
NewMove
(
StoreMoveType
.
OutStore
,
param
);
MoveInfo
.
NewMove
(
StoreMoveType
.
OutStore
,
param
);
LogInfo
(
"启动出库【"
+
p
osId
+
"】 NeedEnterShelf【"
+
MoveInfo
.
MoveParam
.
NeedEnterShelf
+
"】NeedOutShelf【"
+
MoveInfo
.
MoveParam
.
NeedOutShelf
+
"】
"
);
LogInfo
(
"启动出库【"
+
p
aram
.
ToStr
()
+
"】
"
);
//当前无料架,或料架位置为空
//当前无料架,或料架位置为空
if
((
IOValue
(
IO_Type
.
LineTake_Check
).
Equals
(
IO_VALUE
.
LOW
)
&&
MoveInfo
.
MoveParam
.
NeedEnterShelf
)
||
MoveInfo
.
MoveParam
.
ShelfPosID
.
Equals
(
""
))
if
((
IOValue
(
IO_Type
.
LineTake_Check
).
Equals
(
IO_VALUE
.
LOW
)
&&
MoveInfo
.
MoveParam
.
NeedEnterShelf
)
||
MoveInfo
.
MoveParam
.
ShelfPosID
.
Equals
(
""
))
{
{
MoveInfo
.
NextMoveStep
(
StoreMoveStep
.
BI_01_ReadyShelf
);
MoveInfo
.
NextMoveStep
(
StoreMoveStep
.
BI_01_ReadyShelf
);
InOutStoreLog
(
"出库 "
+
MoveInfo
.
SLog
+
":ReadyShelf:通知agv调度准备带料架的小车,等待小车到达,进出轴到P1"
);
InOutStoreLog
(
"出库 "
+
MoveInfo
.
SLog
+
":ReadyShelf:通知agv调度准备带料架的小车,等待小车到达
或检测到料架信号
,进出轴到P1"
);
InOutBackToP1
(
MoveInfo
.
MoveParam
.
MoveP
.
InOut_P1
);
InOutBackToP1
(
MoveInfo
.
MoveParam
.
MoveP
.
InOut_P1
);
//需要先叫小车到达
//需要先叫小车到达
AgvClient
.
ReadyShelf
(
Config
.
AgvNodeName
);
AgvClient
.
ReadyShelf
(
Config
.
AgvNodeName
);
...
@@ -1107,14 +1148,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -1107,14 +1148,7 @@ namespace OnlineStore.DeviceLibrary
}
}
else
if
(
MoveInfo
.
MoveStep
==
StoreMoveStep
.
SO_06_BagDeviceBack
)
else
if
(
MoveInfo
.
MoveStep
==
StoreMoveStep
.
SO_06_BagDeviceBack
)
{
{
//if (IOValue(IO_Type.TrayCheck_Fixture).Equals(IO_VALUE.LOW))
//{
// string posId = MoveInfo.MoveParam != null ? MoveInfo.MoveParam.PosID : "";
// CodeMsg = "出库[" + posId + "]叉子从库位退出后,未检测到料盘有料";
// LogUtil.error(CodeMsg);
//}
MoveInfo
.
NextMoveStep
(
StoreMoveStep
.
SO_08_ToShelfPosition
);
MoveInfo
.
NextMoveStep
(
StoreMoveStep
.
SO_08_ToShelfPosition
);
InOutStoreLog
(
"出库 "
+
MoveInfo
.
SLog
+
":走到料架位置,旋转轴至P101,升降轴至P102, "
);
InOutStoreLog
(
"出库 "
+
MoveInfo
.
SLog
+
":走到料架位置,旋转轴至P101,升降轴至P102, "
);
ACAxisMove
(
Config
.
UpDown_Axis
,
moveP
.
UpDown_HP102
,
Config
.
UpDownAxis_P102_Speed
);
ACAxisMove
(
Config
.
UpDown_Axis
,
moveP
.
UpDown_HP102
,
Config
.
UpDownAxis_P102_Speed
);
...
...
source/DeviceLibrary/store/InOutParam.cs
查看文件 @
150c575
...
@@ -20,39 +20,34 @@ namespace OnlineStore.DeviceLibrary
...
@@ -20,39 +20,34 @@ namespace OnlineStore.DeviceLibrary
{
{
this
.
WareCode
=
""
;
this
.
WareCode
=
""
;
MoveP
=
null
;
MoveP
=
null
;
}
}
/// <summary>
public
InOutParam
(
string
wareNo
,
string
posId
,
string
ShelfPosID
,
string
platew
=
""
,
string
plateh
=
""
,
bool
urgentReel
=
false
,
bool
cutReel
=
false
,
bool
smallReel
=
false
,
string
rfid
=
""
,
int
rfidLoc
=
0
)
/// 新建一个对象
/// </summary>
/// <param name="wareNo">物品二维码</param>
/// <param name="position">仓位号</param>
public
InOutParam
(
string
wareNo
,
string
posId
,
string
ShelfPosID
)
{
this
.
ShelfPosID
=
ShelfPosID
;
WareCode
=
wareNo
;
PosID
=
posId
;
MoveP
=
null
;
IsSolderPaste
=
false
;
}
public
InOutParam
(
string
wareNo
,
string
posId
,
string
plateH
,
string
plateW
,
string
ShelfPosID
)
{
{
this
.
ShelfPosID
=
ShelfPosID
;
this
.
ShelfPosID
=
ShelfPosID
;
WareCode
=
wareNo
;
WareCode
=
wareNo
;
PosID
=
posId
;
PosID
=
posId
;
MoveP
=
null
;
MoveP
=
null
;
this
.
PlateW
=
plateW
;
this
.
PlateW
=
platew
;
this
.
PlateH
=
plateH
;
this
.
PlateH
=
plateh
;
IsSolderPaste
=
false
;
this
.
urgentReel
=
urgentReel
;
this
.
cutReel
=
cutReel
;
this
.
smallReel
=
smallReel
;
this
.
rfid
=
rfid
;
this
.
rfidLoc
=
rfidLoc
;
}
}
public
InOutParam
(
string
wareNo
,
string
posId
,
string
ShelfPosID
,
LineMoveP
linePosition
)
public
InOutParam
(
string
wareNo
,
string
posId
,
string
ShelfPosID
,
LineMoveP
linePosition
)
{
{
WareCode
=
wareNo
;
WareCode
=
wareNo
;
this
.
ShelfPosID
=
ShelfPosID
;
this
.
ShelfPosID
=
ShelfPosID
;
PosID
=
posId
;
PosID
=
posId
;
MoveP
=
linePosition
;
MoveP
=
linePosition
;
IsSolderPaste
=
false
;
NeedEnterShelf
=
false
;
NeedEnterShelf
=
false
;
NeedOutShelf
=
false
;
NeedOutShelf
=
false
;
this
.
urgentReel
=
false
;
this
.
cutReel
=
false
;
this
.
smallReel
=
false
;
this
.
rfid
=
""
;
this
.
rfidLoc
=
0
;
}
}
/// <summary>
/// <summary>
/// 物品二维码信息
/// 物品二维码信息
...
@@ -75,10 +70,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -75,10 +70,7 @@ namespace OnlineStore.DeviceLibrary
/// 料盘宽度
/// 料盘宽度
/// </summary>
/// </summary>
public
string
PlateW
{
get
;
set
;
}
public
string
PlateW
{
get
;
set
;
}
/// <summary>
/// 是否是放入锡膏(在线料仓才需要此字段)
/// </summary>
public
bool
IsSolderPaste
{
get
;
set
;
}
/// <summary>
/// <summary>
/// 出入库时需要进入新料架
/// 出入库时需要进入新料架
...
@@ -88,6 +80,31 @@ namespace OnlineStore.DeviceLibrary
...
@@ -88,6 +80,31 @@ namespace OnlineStore.DeviceLibrary
/// 出入库结束后需要将料架送出
/// 出入库结束后需要将料架送出
/// </summary>
/// </summary>
public
bool
NeedOutShelf
=
true
;
public
bool
NeedOutShelf
=
true
;
/// <summary>
/// urgentReel: true 表示紧急料,需要出到料串上
/// </summary>
public
bool
urgentReel
{
get
;
set
;
}
/// <summary>
/// cutReel: true 表示分盘料,需要出到料串上
/// </summary>
public
bool
cutReel
{
get
;
set
;
}
/// <summary>
/// smallReel: true 小料(7x8),放置到小料架上
/// </summary>
public
bool
smallReel
{
get
;
set
;
}
/// <summary>
/// rfid: 分配的料架RFID
/// </summary>
public
string
rfid
{
get
;
set
;
}
/// <summary>
/// rfidLoc: 料架的架位,值为 - 1时,可以自由分配皮带线,
/// 小料时,架位为1 - 46优先走1 / 2号皮带线,47 - 92优先走3 / 4号皮带线,
/// 70,71,72时只能分配到3 / 4号皮带线;
/// 大料时,架位1 - 6优先走1 / 2号皮带线, 7 - 12优先走3/ 4号皮带线
/// </summary>
public
int
rfidLoc
{
get
;
set
;
}
/// <summary>
/// <summary>
/// 根据PosId获取对应的料仓ID,若PosId=="",返回-1
/// 根据PosId获取对应的料仓ID,若PosId=="",返回-1
...
@@ -114,7 +131,9 @@ namespace OnlineStore.DeviceLibrary
...
@@ -114,7 +131,9 @@ namespace OnlineStore.DeviceLibrary
}
}
public
string
ToStr
()
public
string
ToStr
()
{
{
return
" ShelfPosID=["
+
ShelfPosID
+
"],WareCode=【"
+
WareCode
+
"】,PosID=【"
+
PosID
+
"】,PlateW=【"
+
PlateW
+
"】,PlateH=【"
+
PlateH
+
"】"
;
return
" ShelfPosID=["
+
ShelfPosID
+
"],WareCode ["
+
WareCode
+
"],PosID ["
+
PosID
+
"],PlateW ["
+
PlateW
+
"],PlateH ["
+
PlateH
+
"]"
+
"NeedEnterShelf【"
+
NeedEnterShelf
+
"】NeedOutShelf【"
+
NeedOutShelf
+
"】"
+
"urgentReel ["
+
urgentReel
+
"],cutReel ["
+
cutReel
+
"],smallReel ["
+
smallReel
+
"],rfid ["
+
rfid
+
"],rfidLoc ["
+
rfidLoc
+
"]"
;
}
}
internal
void
UpdateShelfPosId
(
string
pId
)
internal
void
UpdateShelfPosId
(
string
pId
)
...
...
source/DeviceLibrary/store/StoreStep.cs
查看文件 @
150c575
...
@@ -170,36 +170,40 @@ namespace OnlineStore.DeviceLibrary
...
@@ -170,36 +170,40 @@ namespace OnlineStore.DeviceLibrary
BI_02_DoorOpen
=
1002
,
BI_02_DoorOpen
=
1002
,
/// <summary>
/// <summary>
/// 料架入库:线体正转
/// 料架入库:线体正转
,等待入料口检测到信号
/// </summary>
/// </summary>
BI_03_LineRun
=
1003
,
BI_03_LineRun
=
1003
,
/// <summary>
/// <summary>
/// 等待取料位检测到信号
/// </summary>
BI_04_WaitTakeSingle
=
1004
,
/// <summary>
/// 料架入库:取料位检测到信号,停止线体正转
/// 料架入库:取料位检测到信号,停止线体正转
/// </summary>
/// </summary>
BI_0
4_LineStop
=
1004
,
BI_0
5_LineStop
=
1005
,
/// <summary>
/// <summary>
/// 料架入库:入料口移门关闭,等待1000
/// 料架入库:入料口移门关闭,等待1000
/// </summary>
/// </summary>
BI_0
5_DoorClose
=
1005
,
BI_0
6_DoorClose
=
1006
,
/// <summary>
/// <summary>
/// 线体再正转1秒
/// 线体再正转1秒
/// </summary>
/// </summary>
BI_0
6_LineRun
=
1006
,
BI_0
7_LineRun
=
1007
,
/// <summary>
/// <summary>
/// 料架入库:定位装置上升
/// 料架入库:定位装置上升
/// </summary>
/// </summary>
BI_0
7_LocationUp
=
1007
,
BI_0
8_LocationUp
=
1008
,
/// <summary>
/// <summary>
/// 料架入库:顶升装置上升
/// 料架入库:顶升装置上升
/// </summary>
/// </summary>
BI_0
8_TopCylinderUp
=
1008
,
BI_0
9_TopCylinderUp
=
1009
,
#
endregion
#
endregion
#
region
出库步骤
2000
开始
#
region
出库步骤
2000
开始
/// <summary>
/// <summary>
///料仓出库,,定位气缸下降
///料仓出库,,定位气缸下降
/// </summary>
/// </summary>
...
@@ -273,7 +277,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -273,7 +277,7 @@ namespace OnlineStore.DeviceLibrary
/// <summary>
/// <summary>
/// 料架入库:开始循环从第一个空位逐个取料盘,扫码入库
/// 料架入库:开始循环从第一个空位逐个取料盘,扫码入库
/// </summary>
/// </summary>
BI_
08_StartGetTray
=
20008
,
BI_
10_StartGetTray
=
3010
,
/// <summary>
/// <summary>
/// 料架取料:叉子后退到待机点P1
/// 料架取料:叉子后退到待机点P1
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论