Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
刘韬
/
SO815-AutoInOutStore
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
图表
网络
创建新的问题
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit d03fe7e8
由
几米阳光
编写于
2018-12-11 20:13:13 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
1
1 个父辈
7daf9d25
全部展开
隐藏空白字符变更
内嵌
并排
正在显示
5 个修改的文件
包含
152 行增加
和
154 行删除
source/DeviceLibrary/acSingleStore/AC_SA_BoxBean.cs
source/DeviceLibrary/acSingleStore/AC_SA_BoxBean_Partial.cs
source/DeviceLibrary/acSingleStore/AutomaticBaiting.cs
source/DeviceLibrary/acSingleStore/AutomaticBaiting_Partial.cs
source/DeviceLibrary/store/StoreMoveStep.cs
source/DeviceLibrary/acSingleStore/AC_SA_BoxBean.cs
查看文件 @
d03fe7e
...
@@ -234,7 +234,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -234,7 +234,7 @@ namespace OnlineStore.DeviceLibrary
LogUtil
.
info
(
LOGGER
,
StoreName
+
"到待机状态,进出轴到P1,压紧轴先相对走-2000"
);
LogUtil
.
info
(
LOGGER
,
StoreName
+
"到待机状态,进出轴到P1,压紧轴先相对走-2000"
);
ACAxisMove
(
Config
.
InOut_Axis
,
Config
.
InOutAxis_P1_Position
,
Config
.
InOutAxis_P1_Speed
);
ACAxisMove
(
Config
.
InOut_Axis
,
Config
.
InOutAxis_P1_Position
,
Config
.
InOutAxis_P1_Speed
);
ComBeforeHomeMove
();
ComBeforeHomeMove
();
ResetCloseDoor
();
ResetCloseDoor
();
}
}
public
override
void
Reset
()
public
override
void
Reset
()
{
{
...
@@ -369,7 +369,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -369,7 +369,7 @@ namespace OnlineStore.DeviceLibrary
ACAxisMove
(
Config
.
Middle_Axis
,
Config
.
MiddleAxis_P1_Position
,
Config
.
MiddleAxis_P1_Speed
);
ACAxisMove
(
Config
.
Middle_Axis
,
Config
.
MiddleAxis_P1_Position
,
Config
.
MiddleAxis_P1_Speed
);
ACAxisMove
(
Config
.
UpDown_Axis
,
Config
.
UpDownAxis_Door_P7
,
Config
.
UpDownAxis_P7_Speed
);
ACAxisMove
(
Config
.
UpDown_Axis
,
Config
.
UpDownAxis_Door_P7
,
Config
.
UpDownAxis_P7_Speed
);
ComMoveToPosition
(
Config
.
CompressAxis_P1_Position
);
ComMoveToPosition
(
Config
.
CompressAxis_P1_Position
);
ResetCloseDoor
();
CloseDoorAndWait
();
break
;
break
;
case
StoreMoveStep
.
BOX_H_MiddleAxisToP1
:
case
StoreMoveStep
.
BOX_H_MiddleAxisToP1
:
LogUtil
.
info
(
LOGGER
,
StoreName
+
"复位完成"
);
LogUtil
.
info
(
LOGGER
,
StoreName
+
"复位完成"
);
...
@@ -397,6 +397,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -397,6 +397,7 @@ namespace OnlineStore.DeviceLibrary
ACAxisMove
(
Config
.
Middle_Axis
,
Config
.
MiddleAxis_P1_Position
,
Config
.
MiddleAxis_P1_Speed
);
ACAxisMove
(
Config
.
Middle_Axis
,
Config
.
MiddleAxis_P1_Position
,
Config
.
MiddleAxis_P1_Speed
);
ACAxisMove
(
Config
.
UpDown_Axis
,
Config
.
UpDownAxis_Door_P7
,
Config
.
UpDownAxis_P7_Speed
);
ACAxisMove
(
Config
.
UpDown_Axis
,
Config
.
UpDownAxis_Door_P7
,
Config
.
UpDownAxis_P7_Speed
);
ComMoveToPosition
(
Config
.
CompressAxis_P1_Position
);
ComMoveToPosition
(
Config
.
CompressAxis_P1_Position
);
CloseDoorAndWait
();
break
;
break
;
case
StoreMoveStep
.
BOX_M_H_TOP1_OtherAxisToP1
:
case
StoreMoveStep
.
BOX_M_H_TOP1_OtherAxisToP1
:
LogUtil
.
info
(
LOGGER
,
StoreName
+
"到待机状态完成"
);
LogUtil
.
info
(
LOGGER
,
StoreName
+
"到待机状态完成"
);
...
@@ -537,7 +538,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -537,7 +538,7 @@ namespace OnlineStore.DeviceLibrary
ACAxisMove
(
Config
.
Middle_Axis
,
Config
.
MiddleAxis_P1_Position
,
Config
.
MiddleAxis_P1_Speed
);
ACAxisMove
(
Config
.
Middle_Axis
,
Config
.
MiddleAxis_P1_Position
,
Config
.
MiddleAxis_P1_Speed
);
ACAxisMove
(
Config
.
UpDown_Axis
,
Config
.
UpDownAxis_Door_P7
,
Config
.
UpDownAxis_P7_Speed
);
ACAxisMove
(
Config
.
UpDown_Axis
,
Config
.
UpDownAxis_Door_P7
,
Config
.
UpDownAxis_P7_Speed
);
ComMoveToPosition
(
Config
.
CompressAxis_P1_Position
);
ComMoveToPosition
(
Config
.
CompressAxis_P1_Position
);
ResetCloseDoor
();
CloseDoorAndWait
();
break
;
break
;
case
StoreMoveStep
.
BOX_H_MiddleAxisToP1
:
case
StoreMoveStep
.
BOX_H_MiddleAxisToP1
:
LogUtil
.
info
(
LOGGER
,
StoreName
+
"回原点完成"
);
LogUtil
.
info
(
LOGGER
,
StoreName
+
"回原点完成"
);
...
...
source/DeviceLibrary/acSingleStore/AC_SA_BoxBean_Partial.cs
查看文件 @
d03fe7e
此文件的差异被折叠,
点击展开。
source/DeviceLibrary/acSingleStore/AutomaticBaiting.cs
查看文件 @
d03fe7e
...
@@ -213,16 +213,8 @@ namespace OnlineStore.DeviceLibrary
...
@@ -213,16 +213,8 @@ namespace OnlineStore.DeviceLibrary
{
{
AutoBaitingStatus
=
StoreRunStatus
.
Busy
;
AutoBaitingStatus
=
StoreRunStatus
.
Busy
;
StoreMove
.
NewMove
(
StoreMoveType
.
InStore
);
StoreMove
.
NewMove
(
StoreMoveType
.
InStore
);
StoreMove
.
NextMoveStep
(
StoreMoveStep
.
AUTO_I00_MoveToUp
);
StoreMove
.
NextMoveStep
(
StoreMoveStep
.
AUTO_I01_Wait
);
if
(
KND
.
IOValue
(
IO_Type
.
TrayCheck_LoadMaterial
).
Equals
(
IO_VALUE
.
HIGH
))
LogUtil
.
info
(
Name
+
"启动入料"
);
{
LogUtil
.
error
(
Name
+
" 启动入料 ,已检测到料盘,轴不需要上升"
);
}
else
{
LogUtil
.
error
(
Name
+
" 启动入料 ,轴上升到检测到料盘"
);
ACAxisSpeedMove
(
StoreManager
.
Config
.
Batch_Axis
,
StoreManager
.
Config
.
Batch_Axis
.
TargetSpeed
);
}
return
true
;
return
true
;
}
}
else
else
...
@@ -243,34 +235,47 @@ namespace OnlineStore.DeviceLibrary
...
@@ -243,34 +235,47 @@ namespace OnlineStore.DeviceLibrary
{
{
return
;
return
;
}
}
if
(
StoreMove
.
MoveStep
.
Equals
(
StoreMoveStep
.
AUTO_I01_Wait
))
if
(
StoreMove
.
MoveStep
.
Equals
(
StoreMoveStep
.
AUTO_I00_MoveToUp
))
{
StoreMove
.
NextMoveStep
(
StoreMoveStep
.
AUTO_I02_MoveToUp
);
if
(
KND
.
IOValue
(
IO_Type
.
TrayCheck_LoadMaterial
).
Equals
(
IO_VALUE
.
HIGH
))
{
LogUtil
.
info
(
Name
+
" 入料 ,已检测到料盘,轴不需要上升"
);
}
else
{
LogUtil
.
info
(
Name
+
" 入料 ,轴上升到检测到料盘"
);
ACAxisSpeedMove
(
StoreManager
.
Config
.
Batch_Axis
,
StoreManager
.
Config
.
Batch_Axis
.
TargetSpeed
);
}
}
else
if
(
StoreMove
.
MoveStep
.
Equals
(
StoreMoveStep
.
AUTO_I02_MoveToUp
))
{
{
IsNeedScanCode
();
IsNeedScanCode
();
}
}
else
if
(
StoreMove
.
MoveStep
.
Equals
(
StoreMoveStep
.
AUTO_I0
1
_ScanCode
))
else
if
(
StoreMove
.
MoveStep
.
Equals
(
StoreMoveStep
.
AUTO_I0
3
_ScanCode
))
{
{
StoreMove
.
NextMoveStep
(
StoreMoveStep
.
AUTO_I0
2
_SuckingDisc_Down
);
StoreMove
.
NextMoveStep
(
StoreMoveStep
.
AUTO_I0
4
_SuckingDisc_Down
);
LogUtil
.
info
(
Name
+
"入料:
检测到料盘,
吸盘开始下降"
);
LogUtil
.
info
(
Name
+
"入料:
扫码结束,二维码【"
+
LastCode
+
"】
吸盘开始下降"
);
CylinderMove
(
IO_Type
.
SuckingDisc_Down
,
IO_Type
.
SuckingDisc_Up
,
true
);
CylinderMove
(
IO_Type
.
SuckingDisc_Down
,
IO_Type
.
SuckingDisc_Up
,
true
);
}
}
else
if
(
StoreMove
.
MoveStep
.
Equals
(
StoreMoveStep
.
AUTO_I0
2
_SuckingDisc_Down
))
else
if
(
StoreMove
.
MoveStep
.
Equals
(
StoreMoveStep
.
AUTO_I0
4
_SuckingDisc_Down
))
{
{
SuckingDiscWork
();
SuckingDiscWork
();
}
}
else
if
(
StoreMove
.
MoveStep
.
Equals
(
StoreMoveStep
.
AUTO_I0
3
_SuckingDisc_Work
))
else
if
(
StoreMove
.
MoveStep
.
Equals
(
StoreMoveStep
.
AUTO_I0
5
_SuckingDisc_Work
))
{
{
if
(
KND
.
IOValue
(
IO_Type
.
SuckingDisc_Air
).
Equals
(
IO_VALUE
.
HIGH
))
if
(
KND
.
IOValue
(
IO_Type
.
SuckingDisc_Air
).
Equals
(
IO_VALUE
.
HIGH
))
{
{
StoreMove
.
NextMoveStep
(
StoreMoveStep
.
AUTO_I0
4
_SuckingDisc_Up
);
StoreMove
.
NextMoveStep
(
StoreMoveStep
.
AUTO_I0
6
_SuckingDisc_Up
);
LogUtil
.
info
(
Name
+
"入料: 吸盘上升,等待宽度到达"
+
StoreManager
.
Config
.
Default_TrayWidth
);
LogUtil
.
info
(
Name
+
"入料: 吸盘上升,等待宽度到达"
+
StoreManager
.
Config
.
Default_TrayWidth
);
CylinderMove
(
IO_Type
.
SuckingDisc_Up
,
IO_Type
.
SuckingDisc_Down
,
true
);
CylinderMove
(
IO_Type
.
SuckingDisc_Up
,
IO_Type
.
SuckingDisc_Down
,
true
);
if
(
StoreManager
.
Config
.
Default_TrayWidth
.
Equals
(
7
))
if
(
StoreManager
.
Config
.
Default_TrayWidth
.
Equals
(
7
))
{
{
StoreMove
.
WaitList
.
Add
(
WaitResultInfo
.
WaitIO
(
IO_Type
.
WidthCheck1
,
IO_VALUE
.
HIGH
));
StoreMove
.
WaitList
.
Add
(
WaitResultInfo
.
WaitIO
(
IO_Type
.
WidthCheck1
,
IO_VALUE
.
HIGH
));
StoreMove
.
WaitList
.
Add
(
WaitResultInfo
.
WaitIO
(
IO_Type
.
WidthCheck2
,
IO_VALUE
.
LOW
));
StoreMove
.
WaitList
.
Add
(
WaitResultInfo
.
WaitIO
(
IO_Type
.
WidthCheck2
,
IO_VALUE
.
LOW
));
}
else
if
(
StoreManager
.
Config
.
Default_TrayWidth
.
Equals
(
13
))
}
{
else
if
(
StoreManager
.
Config
.
Default_TrayWidth
.
Equals
(
13
))
{
StoreMove
.
WaitList
.
Add
(
WaitResultInfo
.
WaitIO
(
IO_Type
.
WidthCheck1
,
IO_VALUE
.
HIGH
));
StoreMove
.
WaitList
.
Add
(
WaitResultInfo
.
WaitIO
(
IO_Type
.
WidthCheck1
,
IO_VALUE
.
HIGH
));
StoreMove
.
WaitList
.
Add
(
WaitResultInfo
.
WaitIO
(
IO_Type
.
WidthCheck2
,
IO_VALUE
.
HIGH
));
StoreMove
.
WaitList
.
Add
(
WaitResultInfo
.
WaitIO
(
IO_Type
.
WidthCheck2
,
IO_VALUE
.
HIGH
));
}
}
...
@@ -285,13 +290,14 @@ namespace OnlineStore.DeviceLibrary
...
@@ -285,13 +290,14 @@ namespace OnlineStore.DeviceLibrary
WarnMsg
=
"吸盘已经尝试三次,仍然吸不到物料!"
;
WarnMsg
=
"吸盘已经尝试三次,仍然吸不到物料!"
;
StoreManager
.
Store
.
Alarm
(
StoreAlarmType
.
BatchAlarm
,
"吸盘吸料失败"
,
WarnMsg
,
StoreMoveType
.
InStore
);
StoreManager
.
Store
.
Alarm
(
StoreAlarmType
.
BatchAlarm
,
"吸盘吸料失败"
,
WarnMsg
,
StoreMoveType
.
InStore
);
}
}
}
else
if
(
StoreMove
.
MoveStep
.
Equals
(
StoreMoveStep
.
AUTO_I04_SuckingDisc_Up
))
}
else
if
(
StoreMove
.
MoveStep
.
Equals
(
StoreMoveStep
.
AUTO_I06_SuckingDisc_Up
))
{
{
StoreMove
.
NextMoveStep
(
StoreMoveStep
.
AUTO_I0
5
_BatchAxisUp
);
StoreMove
.
NextMoveStep
(
StoreMoveStep
.
AUTO_I0
7
_BatchAxisUp
);
LogUtil
.
info
(
Name
+
"入料: 批量上下料轴上升"
);
LogUtil
.
info
(
Name
+
"入料: 批量上下料轴上升"
);
ACAxisSpeedMove
(
StoreManager
.
Config
.
Batch_Axis
,
StoreManager
.
Config
.
Batch_Axis
.
TargetSpeed
);
ACAxisSpeedMove
(
StoreManager
.
Config
.
Batch_Axis
,
StoreManager
.
Config
.
Batch_Axis
.
TargetSpeed
);
}
}
else
if
(
StoreMove
.
MoveStep
.
Equals
(
StoreMoveStep
.
AUTO_I0
5
_BatchAxisUp
))
else
if
(
StoreMove
.
MoveStep
.
Equals
(
StoreMoveStep
.
AUTO_I0
7
_BatchAxisUp
))
{
{
if
(
StoreManager
.
Store
.
CanStarInOut
())
if
(
StoreManager
.
Store
.
CanStarInOut
())
{
{
...
@@ -304,26 +310,25 @@ namespace OnlineStore.DeviceLibrary
...
@@ -304,26 +310,25 @@ namespace OnlineStore.DeviceLibrary
}
}
else
else
{
{
StoreMove
.
NextMoveStep
(
StoreMoveStep
.
AUTO_I0
6
_GetPosId
);
StoreMove
.
NextMoveStep
(
StoreMoveStep
.
AUTO_I0
8
_GetPosId
);
//计算高度
//计算高度
EndMovePosition
=
ACServerManager
.
GetActualtPosition
(
StoreManager
.
Config
.
Batch_Axis
.
DeviceName
,
StoreManager
.
Config
.
Batch_Axis
.
GetAxisValue
());
EndMovePosition
=
ACServerManager
.
GetActualtPosition
(
StoreManager
.
Config
.
Batch_Axis
.
DeviceName
,
StoreManager
.
Config
.
Batch_Axis
.
GetAxisValue
());
LastHeight
=
Math
.
Abs
(
EndMovePosition
-
StartMovePosition
)
/
AxisChangeValue
;
LastHeight
=
Math
.
Abs
(
EndMovePosition
-
StartMovePosition
)
/
AxisChangeValue
;
LogUtil
.
info
(
Name
+
"入料: 计算高度:上升前位置【"
+
StartMovePosition
+
"】实时位置【"
+
EndMovePosition
+
"】,计算后高度【"
+
LastHeight
+
"】"
);
LogUtil
.
info
(
Name
+
"入料: 计算高度:上升前位置【"
+
StartMovePosition
+
"】实时位置【"
+
EndMovePosition
+
"】,计算后高度【"
+
LastHeight
+
"】"
);
LastSize
=
StoreManager
.
Config
.
Default_TrayWidth
;
LastSize
=
StoreManager
.
Config
.
Default_TrayWidth
;
LogUtil
.
info
(
Name
+
"入料: 从服务器获取入库PosId,尺寸:【"
+
LastSize
+
"*"
+
LastHeight
+
"】二维码【"
+
LastCode
+
"】"
);
LogUtil
.
info
(
Name
+
"入料: 从服务器获取入库PosId,尺寸:【"
+
LastSize
+
"*"
+
LastHeight
+
"】二维码【"
+
LastCode
+
"】"
);
GetInStorePosId
(
ProcessMsg
());
GetInStorePosId
(
ProcessMsg
());
StoreMove
.
WaitList
.
Add
(
WaitResultInfo
.
WaitTime
(
2000
));
StoreMove
.
WaitList
.
Add
(
WaitResultInfo
.
WaitTime
(
2000
));
StoreMove
.
OneWaitCanEndStep
=
true
;
}
}
}
}
}
}
else
if
(
StoreMove
.
MoveStep
.
Equals
(
StoreMoveStep
.
AUTO_I0
6
_GetPosId
))
else
if
(
StoreMove
.
MoveStep
.
Equals
(
StoreMoveStep
.
AUTO_I0
8
_GetPosId
))
{
{
//判断是否开始入库
//判断是否开始入库
if
(
StoreManager
.
Store
.
StoreMove
.
MoveType
.
Equals
(
StoreMoveType
.
InStore
)
||
(!
LastPosId
.
Equals
(
""
)))
if
(
StoreManager
.
Store
.
StoreMove
.
MoveType
.
Equals
(
StoreMoveType
.
InStore
)
||
(!
LastPosId
.
Equals
(
""
)))
{
{
StoreMove
.
NextMoveStep
(
StoreMoveStep
.
AUTO_I0
7
_WaitTrayLeave
);
StoreMove
.
NextMoveStep
(
StoreMoveStep
.
AUTO_I0
9
_WaitTrayLeave
);
LogUtil
.
info
(
Name
+
"入料: 开始入料【"
+
LastPosId
+
"】,等待料盘拿走"
);
LogUtil
.
info
(
Name
+
"入料: 开始入料【"
+
LastPosId
+
"】,等待料盘拿走"
);
StoreMove
.
WaitList
.
Add
(
WaitResultInfo
.
WaitIO
(
IO_Type
.
SuckingDisc_Air
,
IO_VALUE
.
LOW
));
StoreMove
.
WaitList
.
Add
(
WaitResultInfo
.
WaitIO
(
IO_Type
.
SuckingDisc_Air
,
IO_VALUE
.
LOW
));
}
}
...
@@ -335,7 +340,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -335,7 +340,7 @@ namespace OnlineStore.DeviceLibrary
StoreManager
.
Store
.
StartInStoreMove
(
new
InOutStoreParam
(
""
,
posId
),
true
,
false
);
StoreManager
.
Store
.
StartInStoreMove
(
new
InOutStoreParam
(
""
,
posId
),
true
,
false
);
}
}
}
}
else
if
(
StoreMove
.
MoveStep
.
Equals
(
StoreMoveStep
.
AUTO_I0
7
_WaitTrayLeave
))
else
if
(
StoreMove
.
MoveStep
.
Equals
(
StoreMoveStep
.
AUTO_I0
9
_WaitTrayLeave
))
{
{
if
(
StoreManager
.
Store
.
StoreMove
.
MoveStep
>=
StoreMoveStep
.
SI_07_DeviceBackFromDoor
)
if
(
StoreManager
.
Store
.
StoreMove
.
MoveStep
>=
StoreMoveStep
.
SI_07_DeviceBackFromDoor
)
{
{
...
@@ -348,7 +353,14 @@ namespace OnlineStore.DeviceLibrary
...
@@ -348,7 +353,14 @@ namespace OnlineStore.DeviceLibrary
{
{
IsNeedScanCode
();
IsNeedScanCode
();
}
}
}
}
else
if
(
StoreMove
.
MoveStep
.
Equals
(
StoreMoveStep
.
AUTO_I11_BatchAxisHome
))
{
//TODO
LogUtil
.
info
(
Name
+
"入料:已经没有料盘,批量上料结束"
);
StoreMove
.
EndMove
();
AutoBaitingStatus
=
StoreRunStatus
.
Runing
;
}
else
else
{
{
LogUtil
.
error
(
Name
+
"未找到步骤:"
+
StoreMove
.
MoveType
);
LogUtil
.
error
(
Name
+
"未找到步骤:"
+
StoreMove
.
MoveType
);
...
@@ -357,7 +369,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -357,7 +369,7 @@ namespace OnlineStore.DeviceLibrary
private
static
void
SuckingDiscWork
()
private
static
void
SuckingDiscWork
()
{
{
KND
.
IOMove
(
IO_Type
.
SuckingDisc_Work
,
IO_VALUE
.
LOW
);
KND
.
IOMove
(
IO_Type
.
SuckingDisc_Work
,
IO_VALUE
.
LOW
);
StoreMove
.
NextMoveStep
(
StoreMoveStep
.
AUTO_I0
3
_SuckingDisc_Work
);
StoreMove
.
NextMoveStep
(
StoreMoveStep
.
AUTO_I0
5
_SuckingDisc_Work
);
SuckingDisc_WorkCount
++;
SuckingDisc_WorkCount
++;
LogUtil
.
info
(
Name
+
"入料: 吸盘开始第"
+
SuckingDisc_WorkCount
+
"次工作"
);
LogUtil
.
info
(
Name
+
"入料: 吸盘开始第"
+
SuckingDisc_WorkCount
+
"次工作"
);
KND
.
IOMove
(
IO_Type
.
SuckingDisc_Work
,
IO_VALUE
.
HIGH
);
KND
.
IOMove
(
IO_Type
.
SuckingDisc_Work
,
IO_VALUE
.
HIGH
);
...
@@ -375,19 +387,19 @@ namespace OnlineStore.DeviceLibrary
...
@@ -375,19 +387,19 @@ namespace OnlineStore.DeviceLibrary
// if (ACServerManager.GetLimitPositiveSingle(StoreManager.Config.Batch_Axis).Equals(0))
// if (ACServerManager.GetLimitPositiveSingle(StoreManager.Config.Batch_Axis).Equals(0))
if
(
KND
.
IOValue
(
IO_Type
.
TrayCheck_LoadMaterial
).
Equals
(
IO_VALUE
.
HIGH
))
if
(
KND
.
IOValue
(
IO_Type
.
TrayCheck_LoadMaterial
).
Equals
(
IO_VALUE
.
HIGH
))
{
{
StoreMove
.
NextMoveStep
(
StoreMoveStep
.
AUTO_I01_ScanCode
);
StoreMove
.
NextMoveStep
(
StoreMoveStep
.
AUTO_I03_ScanCode
);
LogUtil
.
info
(
Name
+
"入料: 开始扫码 "
);
LogUtil
.
info
(
Name
+
"入料: 开始扫码,最多等待两秒钟 "
);
StoreMove
.
OneWaitCanEndStep
=
true
;
StoreMove
.
WaitList
.
Add
(
WaitResultInfo
.
WaitCodeOK
());
StoreMove
.
WaitList
.
Add
(
WaitResultInfo
.
WaitCodeOK
());
StoreMove
.
WaitList
.
Add
(
WaitResultInfo
.
WaitTime
(
2000
));
StoreMove
.
WaitList
.
Add
(
WaitResultInfo
.
WaitTime
(
2000
));
GetCameraCode
();
GetCameraCode
();
StoreMove
.
OneWaitCanEndStep
=
true
;
}
}
else
else
{
{
//TODO
StoreMove
.
NextMoveStep
(
StoreMoveStep
.
AUTO_I11_BatchAxisHome
);
LogUtil
.
info
(
Name
+
"入料:已经没有料盘,
入料结束
"
);
LogUtil
.
info
(
Name
+
"入料:已经没有料盘,
批量上下轴回原点
"
);
StoreMove
.
EndMove
()
;
StoreMove
.
TimeOutSeconds
=
120
;
A
utoBaitingStatus
=
StoreRunStatus
.
Runing
;
A
CAxisHomeMove
(
StoreManager
.
Config
.
Batch_Axis
);
}
}
}
}
...
...
source/DeviceLibrary/acSingleStore/AutomaticBaiting_Partial.cs
查看文件 @
d03fe7e
...
@@ -72,87 +72,88 @@ namespace OnlineStore.DeviceLibrary
...
@@ -72,87 +72,88 @@ namespace OnlineStore.DeviceLibrary
StoreMove
.
EndStepWait
();
StoreMove
.
EndStepWait
();
return
;
return
;
}
}
try
{
try
//当等待超过一分钟时,需要打印提示
TimeSpan
span
=
DateTime
.
Now
-
StoreMove
.
LastSetpTime
;
string
NotOkMsg
=
""
;
bool
isOk
=
!
StoreMove
.
OneWaitCanEndStep
;
foreach
(
WaitResultInfo
wait
in
list
)
{
{
if
(
wait
.
IsEnd
)
//当等待超过一分钟时,需要打印提示
{
TimeSpan
span
=
DateTime
.
Now
-
StoreMove
.
LastSetpTime
;
continue
;
string
NotOkMsg
=
""
;
}
bool
isOk
=
!
StoreMove
.
OneWaitCanEndStep
;
NotOkMsg
=
wait
.
ToStr
();
foreach
(
WaitResultInfo
wait
in
list
)
if
(
wait
.
WaitType
==
(
int
)
Wait_Type
.
AxisMove_1
)
{
{
wait
.
IsEnd
=
AxisMoveISEnd
(
wait
);
if
(
wait
.
IsEnd
)
}
{
else
if
(
wait
.
WaitType
==
(
int
)
Wait_Type
.
IOMove_2
)
continue
;
{
}
wait
.
IsEnd
=
KND
.
IOValue
(
wait
.
IoType
).
Equals
(
wait
.
IoValue
);
NotOkMsg
=
wait
.
ToStr
();
int
timeOutMs
=
StoreManager
.
Config
.
IOSingle_TimerOut
;
if
(
wait
.
WaitType
==
(
int
)
Wait_Type
.
AxisMove_1
)
{
wait
.
IsEnd
=
AxisMoveISEnd
(
wait
);
}
else
if
(
wait
.
WaitType
==
(
int
)
Wait_Type
.
IOMove_2
)
{
wait
.
IsEnd
=
KND
.
IOValue
(
wait
.
IoType
).
Equals
(
wait
.
IoValue
);
int
timeOutMs
=
StoreManager
.
Config
.
IOSingle_TimerOut
;
if
((!
wait
.
IsEnd
)
&&
span
.
TotalMilliseconds
>
timeOutMs
)
if
((!
wait
.
IsEnd
)
&&
span
.
TotalMilliseconds
>
timeOutMs
)
{
ConfigIO
io
=
StoreManager
.
Config
.
getWaitIO
(
wait
.
IoType
);
WarnMsg
=
Name
+
" 等待信号"
+
io
.
DisplayStr
+
"="
+
wait
.
IoValue
+
"超时!"
;
StoreManager
.
Store
.
Alarm
(
StoreAlarmType
.
BatchIoTimeOut
,
io
.
ElectricalDefinition
,
WarnMsg
,
StoreMove
.
MoveType
);
LogUtil
.
error
(
WarnMsg
);
isOk
=
false
;
break
;
}
}
else
if
(
wait
.
WaitType
==
(
int
)
Wait_Type
.
Time_3
)
{
{
ConfigIO
io
=
StoreManager
.
Config
.
getWaitIO
(
wait
.
IoType
);
wait
.
IsEnd
=
(
span
.
TotalMilliseconds
>=
wait
.
TimeMSeconds
);
WarnMsg
=
Name
+
" 等待信号"
+
io
.
DisplayStr
+
"="
+
wait
.
IoValue
+
"超时!"
;
StoreManager
.
Store
.
Alarm
(
StoreAlarmType
.
BatchIoTimeOut
,
io
.
ElectricalDefinition
,
WarnMsg
,
StoreMove
.
MoveType
);
LogUtil
.
error
(
WarnMsg
);
isOk
=
false
;
break
;
}
}
}
else
if
(
wait
.
WaitType
==
(
int
)
Wait_Type
.
ShuoKe_5
)
else
if
(
wait
.
WaitType
==
(
int
)
Wait_Type
.
Time_3
)
{
wait
.
IsEnd
=
(
span
.
TotalMilliseconds
>=
wait
.
TimeMSeconds
);
}
else
if
(
wait
.
WaitType
==
(
int
)
Wait_Type
.
ShuoKe_5
)
{
}
else
if
(
wait
.
WaitType
==
(
int
)
Wait_Type
.
AxisHomeSingle_6
)
{
IO_VALUE
value
=
(
IO_VALUE
)
ACServerManager
.
GetHomeSingle
(
wait
.
AxisInfo
.
DeviceName
,
wait
.
AxisInfo
.
GetAxisValue
());
wait
.
IsEnd
=
wait
.
IoValue
.
Equals
(
value
);
}
//else if (wait.WaitType == (int)Wait_Type.WaitHeight_7)
//{
//}
//else if (wait.WaitType == (int)Wait_Type.AxisLimitNegativeSingle_8)
//{
// IO_VALUE value = (IO_VALUE)ACServerManager.GetLimitNegativeSingle(wait.AxisInfo);
// wait.IsEnd = wait.IoValue.Equals(value);
//}
//else if (wait.WaitType == (int)Wait_Type.AxisLimitPositiveSingle_9)
//{
// IO_VALUE value = (IO_VALUE)ACServerManager.GetLimitPositiveSingle(wait.AxisInfo);
// wait.IsEnd = wait.IoValue.Equals(value);
//}
else
if
(
wait
.
WaitType
==
(
int
)
Wait_Type
.
BatchAxisMove_10
)
{
wait
.
IsEnd
=
BatchAxisIsEnd
(
wait
);
}
else
if
(
wait
.
WaitType
==
(
int
)
Wait_Type
.
ScanCode_11
)
{
wait
.
IsEnd
=
!
String
.
IsNullOrEmpty
(
LastCode
);
}
if
(
wait
.
IsEnd
)
{
if
(
StoreMove
.
OneWaitCanEndStep
)
{
{
isOk
=
true
;
break
;
}
}
}
else
if
(
wait
.
WaitType
==
(
int
)
Wait_Type
.
AxisHomeSingle_6
)
else
{
if
(!
StoreMove
.
OneWaitCanEndStep
)
{
{
isOk
=
false
;
IO_VALUE
value
=
(
IO_VALUE
)
ACServerManager
.
GetHomeSingle
(
wait
.
AxisInfo
.
DeviceName
,
wait
.
AxisInfo
.
GetAxisValue
());
break
;
wait
.
IsEnd
=
wait
.
IoValue
.
Equals
(
value
);
}
//else if (wait.WaitType == (int)Wait_Type.WaitHeight_7)
//{
//}
//else if (wait.WaitType == (int)Wait_Type.AxisLimitNegativeSingle_8)
//{
// IO_VALUE value = (IO_VALUE)ACServerManager.GetLimitNegativeSingle(wait.AxisInfo);
// wait.IsEnd = wait.IoValue.Equals(value);
//}
//else if (wait.WaitType == (int)Wait_Type.AxisLimitPositiveSingle_9)
//{
// IO_VALUE value = (IO_VALUE)ACServerManager.GetLimitPositiveSingle(wait.AxisInfo);
// wait.IsEnd = wait.IoValue.Equals(value);
//}
else
if
(
wait
.
WaitType
==
(
int
)
Wait_Type
.
BatchAxisMove_10
)
{
wait
.
IsEnd
=
BatchAxisIsEnd
(
wait
);
}
else
if
(
wait
.
WaitType
==
(
int
)
Wait_Type
.
ScanCode_11
)
{
wait
.
IsEnd
=
(
LastCode
.
Equals
(
""
).
Equals
(
false
));
}
if
(
wait
.
IsEnd
)
{
if
(
StoreMove
.
OneWaitCanEndStep
)
{
isOk
=
true
;
break
;
}
}
else
{
if
(!
StoreMove
.
OneWaitCanEndStep
)
{
isOk
=
false
;
break
;
}
}
}
}
}
}
if
(
isOk
)
if
(
isOk
)
{
{
StoreMove
.
EndStepWait
();
StoreMove
.
EndStepWait
();
...
@@ -161,7 +162,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -161,7 +162,7 @@ namespace OnlineStore.DeviceLibrary
{
{
WarnMsg
=
Name
+
"【"
+
StoreMove
.
MoveType
+
"】【"
+
StoreMove
.
MoveStep
+
"】等待超时 ["
+
NotOkMsg
WarnMsg
=
Name
+
"【"
+
StoreMove
.
MoveType
+
"】【"
+
StoreMove
.
MoveStep
+
"】等待超时 ["
+
NotOkMsg
+
"]已等待["
+
Math
.
Round
(
span
.
TotalSeconds
,
1
)
+
"]秒"
;
+
"]已等待["
+
Math
.
Round
(
span
.
TotalSeconds
,
1
)
+
"]秒"
;
LogUtil
.
error
(
WarnMsg
);
LogUtil
.
error
(
WarnMsg
);
StoreManager
.
Store
.
Alarm
(
StoreAlarmType
.
BatchIoTimeOut
,
""
,
WarnMsg
,
StoreMove
.
MoveType
);
StoreManager
.
Store
.
Alarm
(
StoreAlarmType
.
BatchIoTimeOut
,
""
,
WarnMsg
,
StoreMove
.
MoveType
);
}
}
}
}
...
@@ -291,12 +292,11 @@ namespace OnlineStore.DeviceLibrary
...
@@ -291,12 +292,11 @@ namespace OnlineStore.DeviceLibrary
if
(
LastCode
.
Equals
(
""
))
if
(
LastCode
.
Equals
(
""
))
{
{
LastCode
=
"NoCode"
;
LastCode
=
"NoCode"
;
LogUtil
.
info
(
Name
+
"
未扫到二维码,默认为
NoCode"
);
LogUtil
.
info
(
Name
+
"
模拟二维码:
NoCode"
);
}
}
if
(
LastCode
.
Equals
(
""
))
if
(
LastCode
.
Equals
(
""
))
{
{
LogUtil
.
error
(
"未扫到二维码,请拿走料盘"
);
LogUtil
.
error
(
"未扫到二维码,需要将料盘送出"
);
WarnMsg
=
"未扫到二维码,请拿走料盘"
;
}
}
else
else
{
{
...
@@ -353,7 +353,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -353,7 +353,7 @@ namespace OnlineStore.DeviceLibrary
if
(
StoreManager
.
Store
.
IsDebug
)
if
(
StoreManager
.
Store
.
IsDebug
)
{
{
string
posId
=
"1#AC1_1_1_4"
;
string
posId
=
"1#AC1_1_1_4"
;
LogUtil
.
info
(
Name
+
"调试模式,
不需要连接服务器,直接
模拟库位号【"
+
posId
+
"】"
);
LogUtil
.
info
(
Name
+
"调试模式,模拟库位号【"
+
posId
+
"】"
);
string
plateH
=
"8"
;
string
plateH
=
"8"
;
string
plateW
=
"7"
;
string
plateW
=
"7"
;
if
(
StoreManager
.
Store
.
CanStarInOut
())
if
(
StoreManager
.
Store
.
CanStarInOut
())
...
...
source/DeviceLibrary/store/StoreMoveStep.cs
查看文件 @
d03fe7e
...
@@ -407,73 +407,58 @@ namespace OnlineStore.DeviceLibrary
...
@@ -407,73 +407,58 @@ namespace OnlineStore.DeviceLibrary
#
endregion
#
endregion
#
region
自动上下料上料功能
#
region
自动上下料上料功能
/// <summary>
/// 开始自动上料
/// </summary>
AUTO_I01_Wait
=
1201
,
/// <summary>
/// <summary>
/// 先上升到料盘检测1(上料机构)信号亮
/// 先上升到料盘检测1(上料机构)信号亮
/// </summary>
/// </summary>
AUTO_I0
0_MoveToUp
=
1200
,
AUTO_I0
2_MoveToUp
=
1202
,
/// <summary>
/// <summary>
/// 扫码
/// 扫码
/// </summary>
/// </summary>
AUTO_I0
1_ScanCode
=
1201
,
AUTO_I0
3_ScanCode
=
1203
,
/// <summary>
/// <summary>
/// 吸盘下降
/// 吸盘下降
/// </summary>
/// </summary>
AUTO_I0
2_SuckingDisc_Down
=
1202
,
AUTO_I0
4_SuckingDisc_Down
=
1204
,
/// <summary>
/// <summary>
/// 吸盘吸料盘
/// 吸盘吸料盘
/// </summary>
/// </summary>
AUTO_I0
3_SuckingDisc_Work
=
1203
,
AUTO_I0
5_SuckingDisc_Work
=
1205
,
/// <summary>
/// <summary>
/// 吸盘上升 ,
/// 吸盘上升 ,
/// </summary>
/// </summary>
AUTO_I0
4_SuckingDisc_Up
=
1204
,
AUTO_I0
6_SuckingDisc_Up
=
1206
,
/// <summary>
/// <summary>
/// 批量上下料料轴上升
/// 批量上下料料轴上升
/// </summary>
/// </summary>
AUTO_I0
5_BatchAxisUp
=
1205
,
AUTO_I0
7_BatchAxisUp
=
1207
,
/// <summary>
/// <summary>
/// 从服务器获取PosID
/// 从服务器获取PosID
/// </summary>
/// </summary>
AUTO_I0
6_GetPosId
=
1206
,
AUTO_I0
8_GetPosId
=
1208
,
/// <summary>
/// <summary>
/// 等待料盘被叉子拿走
/// 等待料盘被叉子拿走
/// </summary>
/// </summary>
AUTO_I0
7_WaitTrayLeave
=
1207
,
AUTO_I0
9_WaitTrayLeave
=
1209
,
/// <summary>
/// <summary>
/// 未扫到码:等待操作人员拿走料盘
/// 未扫到码:等待操作人员拿走料盘
/// </summary>
/// </summary>
AUTO_I10_WaitTrayGo
=
1210
,
AUTO_I10_WaitTrayGo
=
1210
,
///// <summary>
/// <summary>
/////未扫到码: 把料盘放到叉子上
/// 批量上下轴开始回原点
///// </summary>
/// </summary>
//AUTO_I11_PutTrayToInout,
AUTO_I11_BatchAxisHome
=
1211
,
///// <summary>
///// 未扫到码:叉子进入门槛
///// </summary>
//AUTO_I12_InoutToDoor,
///// <summary>
///// 未扫到码:把料盘放到门口
///// </summary>
//AUTO_I13_PutTrayToDoor,
///// <summary>
///// 未扫到码:等待拿走料盘
///// </summary>
//AUTO_I14_WaitTakeTray,
///// <summary>
///// 未扫到码:料盘已手动拿走,需要等一秒钟后关闭仓门
///// </summary>
//AUTO_I15_TrayLeaveWaitTime,
///// <summary>
///// 未扫到码:关闭仓门
///// </summary>
//AUTO_I16_CloseDoor,
#
endregion
#
endregion
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论