Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
孙克
/
ACSingleStore
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit 5838f53a
由
LN
编写于
2020-09-01 11:37:21 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
出库等待时间是0时,必须等待料盘拿走才结束出库
1 个父辈
57508026
隐藏空白字符变更
内嵌
并排
正在显示
5 个修改的文件
包含
103 行增加
和
55 行删除
source/DeviceLibrary/IO/AIOBOX/AIOAIManager.cs
source/DeviceLibrary/IO/AIOBOX/AIOBOXManager.cs
source/DeviceLibrary/acSingleStore/AC_SA_BoxBean.cs
source/DeviceLibrary/acSingleStore/AC_SA_BoxBean_Partial.cs
source/DeviceLibrary/store/StoreStep.cs
source/DeviceLibrary/IO/AIOBOX/AIOAIManager.cs
查看文件 @
5838f53
...
@@ -135,19 +135,23 @@ namespace OnlineStore.DeviceLibrary
...
@@ -135,19 +135,23 @@ namespace OnlineStore.DeviceLibrary
public
override
double
GetAIValue
(
string
ioiP
,
int
index
)
public
override
double
GetAIValue
(
string
ioiP
,
int
index
)
{
{
if
(
AIValList
!=
null
&&
index
>=
0
&&
AIValList
.
Count
>
index
)
for
(
int
i
=
1
;
i
<=
3
;
i
++
)
{
{
return
AIValList
[
index
];
try
{
if
(
AIValList
!=
null
&&
index
>=
0
&&
AIValList
.
Count
>
index
)
{
return
AIValList
[
index
];
}
}
catch
(
Exception
ex
)
{
LogUtil
.
error
(
"GetAIValue第【"
+
i
+
"】次获取 "
+
ioiP
+
"_"
+
index
+
"出错:"
+
ex
.
ToString
());
}
Thread
.
Sleep
(
1
);
}
}
return
0
;
return
0
;
}
}
//public override double ConvertAI(double aiValue, double defaultValue)
//{
// double xishu = (double)ConfigAppSettings.GetNumValue(Setting_Init.AI_ConvertPosition);
// double result = Math.Round((aiValue - defaultValue) / xishu, 2);
// return result;
//}
}
}
}
}
source/DeviceLibrary/IO/AIOBOX/AIOBOXManager.cs
查看文件 @
5838f53
...
@@ -430,30 +430,31 @@ namespace OnlineStore.DeviceLibrary
...
@@ -430,30 +430,31 @@ namespace OnlineStore.DeviceLibrary
public
override
IO_VALUE
GetDOValue
(
string
ioIP
,
byte
slaveId
,
ushort
StartAddress
)
public
override
IO_VALUE
GetDOValue
(
string
ioIP
,
byte
slaveId
,
ushort
StartAddress
)
{
{
IO_VALUE
value
=
IO_VALUE
.
LOW
;
IO_VALUE
value
=
IO_VALUE
.
LOW
;
try
for
(
int
i
=
1
;
i
<=
3
;
i
++)
{
{
AIOBOX
aioBox
=
getAIO
(
ioIP
);
try
if
(
aioBox
!=
null
)
{
{
Box_Sta
sta
=
Box_Sta
.
Off
;
AIOBOX
aioBox
=
getAIO
(
ioIP
);
// Box_Addr addr = GetAddr(StartAddress);
if
(
aioBox
!=
null
)
// int index = (int)StartAddress - (int)StoreManager.Config.GetDILength(ioIP);
if
(
DOValueMap
.
ContainsKey
(
ioIP
)
&&
DOValueMap
[
ioIP
].
Count
>
StartAddress
)
{
sta
=
DOValueMap
[
ioIP
][
StartAddress
];
}
else
{
sta
=
aioBox
.
ReadDO
(
StartAddress
);
}
if
(
sta
.
Equals
(
Box_Sta
.
On
))
{
{
value
=
IO_VALUE
.
HIGH
;
Box_Sta
sta
=
Box_Sta
.
Off
;
if
(
DOValueMap
.
ContainsKey
(
ioIP
)
&&
DOValueMap
[
ioIP
].
Count
>
StartAddress
)
{
sta
=
DOValueMap
[
ioIP
][
StartAddress
];
}
else
{
sta
=
aioBox
.
ReadDO
(
StartAddress
);
}
if
(
sta
.
Equals
(
Box_Sta
.
On
))
{
value
=
IO_VALUE
.
HIGH
;
}
break
;
}
}
}
}
}
catch
(
Exception
ex
)
catch
(
Exception
ex
)
{
{
LogUtil
.
error
(
"GetDOValue ["
+
ioIP
+
"] ["
+
StartAddress
+
"] ["
+
i
+
"] 出错:"
+
ex
.
ToString
());
LogUtil
.
error
(
"GetDOValue ["
+
ioIP
+
"] ["
+
StartAddress
+
"] 出错:"
+
ex
.
ToString
());
}
}
}
return
value
;
return
value
;
}
}
...
@@ -483,6 +484,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -483,6 +484,7 @@ namespace OnlineStore.DeviceLibrary
{
{
value
=
IO_VALUE
.
HIGH
;
value
=
IO_VALUE
.
HIGH
;
}
}
break
;
}
}
}
}
catch
(
Exception
ex
)
catch
(
Exception
ex
)
...
...
source/DeviceLibrary/acSingleStore/AC_SA_BoxBean.cs
查看文件 @
5838f53
...
@@ -48,6 +48,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -48,6 +48,7 @@ namespace OnlineStore.DeviceLibrary
//public ScanSocket scanSocket = new ScanSocket();
//public ScanSocket scanSocket = new ScanSocket();
private
System
.
Timers
.
Timer
serverConnectTimer
=
new
System
.
Timers
.
Timer
();
private
System
.
Timers
.
Timer
serverConnectTimer
=
new
System
.
Timers
.
Timer
();
private
System
.
Timers
.
Timer
IoCheckTimer
=
new
System
.
Timers
.
Timer
();
private
System
.
Timers
.
Timer
IoCheckTimer
=
new
System
.
Timers
.
Timer
();
private
int
OutStoreWaitSeconds
=
ConfigAppSettings
.
GetIntValue
(
Setting_Init
.
OutStoreWaitSeconds
);
public
AC_SA_BoxBean
(
AC_SA_Config
config
)
public
AC_SA_BoxBean
(
AC_SA_Config
config
)
{
{
// int value= CalHeight(37);
// int value= CalHeight(37);
...
@@ -113,6 +114,8 @@ namespace OnlineStore.DeviceLibrary
...
@@ -113,6 +114,8 @@ namespace OnlineStore.DeviceLibrary
IOManager
.
IOMove
(
IO_Type
.
Alarm_HddLed
,
IO_VALUE
.
LOW
);
IOManager
.
IOMove
(
IO_Type
.
Alarm_HddLed
,
IO_VALUE
.
LOW
);
IOManager
.
IOMove
(
IO_Type
.
AutoRun_HddLed
,
IO_VALUE
.
LOW
);
IOManager
.
IOMove
(
IO_Type
.
AutoRun_HddLed
,
IO_VALUE
.
LOW
);
IOManager
.
IOMove
(
IO_Type
.
RunSign_HddLed
,
IO_VALUE
.
LOW
);
IOManager
.
IOMove
(
IO_Type
.
RunSign_HddLed
,
IO_VALUE
.
LOW
);
LogUtil
.
info
(
StoreName
+
" 初始化完成,OutStoreWaitSeconds="
+
OutStoreWaitSeconds
);
}
}
private
void
IoCheckTimer_Elapsed
(
object
sender
,
System
.
Timers
.
ElapsedEventArgs
e
)
private
void
IoCheckTimer_Elapsed
(
object
sender
,
System
.
Timers
.
ElapsedEventArgs
e
)
...
...
source/DeviceLibrary/acSingleStore/AC_SA_BoxBean_Partial.cs
查看文件 @
5838f53
...
@@ -187,6 +187,18 @@ namespace OnlineStore.DeviceLibrary
...
@@ -187,6 +187,18 @@ namespace OnlineStore.DeviceLibrary
else
if
(
wait
.
WaitType
==
7
)
else
if
(
wait
.
WaitType
==
7
)
{
{
wait
.
IsEnd
=
(
wait
.
HeightValue
.
Equals
(
GetHeight
()));
wait
.
IsEnd
=
(
wait
.
HeightValue
.
Equals
(
GetHeight
()));
if
(
wait
.
IsEnd
&&
(
StoreMove
.
MoveStep
==
StoreMoveStep
.
SO_15_WaitTake
)
&&
wait
.
HeightValue
.
Equals
(
0
))
{
if
(
IOManager
.
IOValue
(
IO_Type
.
TrayCheck_Door
).
Equals
(
IO_VALUE
.
LOW
))
{
LogUtil
.
info
(
StoreMove
.
MoveStep
+
" 等待height="
+
wait
.
HeightValue
+
"完成,且当前TrayCheck_Door=LOW"
);
}
else
{
LogUtil
.
info
(
StoreMove
.
MoveStep
+
" 等待height="
+
wait
.
HeightValue
+
"完成,但当前TrayCheck_Door=High,继续等待门口无料盘信号"
);
wait
.
IsEnd
=
false
;
}
}
if
(
wait
.
IsEnd
)
if
(
wait
.
IsEnd
)
{
{
LogUtil
.
debug
(
"等待height="
+
wait
.
HeightValue
+
"完成"
);
LogUtil
.
debug
(
"等待height="
+
wait
.
HeightValue
+
"完成"
);
...
@@ -570,7 +582,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -570,7 +582,7 @@ namespace OnlineStore.DeviceLibrary
StoreMove
.
NextMoveStep
(
StoreMoveStep
.
SO_03_ToBagPosition
);
StoreMove
.
NextMoveStep
(
StoreMoveStep
.
SO_03_ToBagPosition
);
OutStoreLog
(
"出库:SO_03 走到库位,压紧轴至P3(压紧前点) ,旋转轴至P2(库位点),升降轴至P5(库位出库前点)"
);
OutStoreLog
(
"出库:SO_03 走到库位,压紧轴至P3(压紧前点) ,旋转轴至P2(库位点),升降轴至P5(库位出库前点)"
);
ComMoveToPosition
(
moveP
.
ComPress_P3
,
Config
.
CompAxis_P3_Speed
);
ComMoveToPosition
(
moveP
.
ComPress_P3
,
Config
.
CompAxis_P3_Speed
);
ACAxisMove
(
Config
.
Middle_Axis
,
StoreMove
.
MoveParam
.
MoveP
.
Middle_P2
,
Config
.
MiddleAxis_P2_Speed
);
ACAxisMove
(
Config
.
Middle_Axis
,
StoreMove
.
MoveParam
.
MoveP
.
Middle_P2
,
Config
.
MiddleAxis_P2_Speed
);
ACAxisMove
(
Config
.
UpDown_Axis
,
StoreMove
.
MoveParam
.
MoveP
.
UpDown_P5
,
Config
.
UpDownAxis_P5_Speed
);
ACAxisMove
(
Config
.
UpDown_Axis
,
StoreMove
.
MoveParam
.
MoveP
.
UpDown_P5
,
Config
.
UpDownAxis_P5_Speed
);
}
}
...
@@ -607,15 +619,15 @@ namespace OnlineStore.DeviceLibrary
...
@@ -607,15 +619,15 @@ namespace OnlineStore.DeviceLibrary
{
{
StoreMove
.
NextMoveStep
(
StoreMoveStep
.
SO_07_CheckTray
);
StoreMove
.
NextMoveStep
(
StoreMoveStep
.
SO_07_CheckTray
);
OutStoreLog
(
"出库:SO_07 等待TrayCheck_Fixture=High "
);
OutStoreLog
(
"出库:SO_07 等待TrayCheck_Fixture=High "
);
StoreMove
.
WaitList
.
Add
(
WaitResultInfo
.
WaitIO
(
IO_Type
.
TrayCheck_Fixture
,
IO_VALUE
.
HIGH
));
StoreMove
.
WaitList
.
Add
(
WaitResultInfo
.
WaitIO
(
IO_Type
.
TrayCheck_Fixture
,
IO_VALUE
.
HIGH
));
}
}
else
else
{
{
StoreMove
.
NextMoveStep
(
StoreMoveStep
.
SO_08_ToDoorPosition
);
StoreMove
.
NextMoveStep
(
StoreMoveStep
.
SO_08_ToDoorPosition
);
OutStoreLog
(
"出库:SO_08 走到料门口,旋转轴至P1(待机点)升降轴至P2(进料口出料前点),打开舱门 "
);
OutStoreLog
(
"出库:SO_08 走到料门口,旋转轴至P1(待机点)升降轴至P2(进料口出料前点),打开舱门 "
);
ACAxisMove
(
Config
.
UpDown_Axis
,
moveP
.
UpDown_P2
,
Config
.
UpDownAxis_P2_Speed
);
ACAxisMove
(
Config
.
UpDown_Axis
,
moveP
.
UpDown_P2
,
Config
.
UpDownAxis_P2_Speed
);
ACAxisMove
(
Config
.
Middle_Axis
,
moveP
.
Middle_P1
,
Config
.
MiddleAxis_P1_Speed
);
ACAxisMove
(
Config
.
Middle_Axis
,
moveP
.
Middle_P1
,
Config
.
MiddleAxis_P1_Speed
);
}
}
}
}
else
if
(
StoreMove
.
MoveStep
==
StoreMoveStep
.
SO_07_CheckTray
)
else
if
(
StoreMove
.
MoveStep
==
StoreMoveStep
.
SO_07_CheckTray
)
{
{
...
@@ -662,7 +674,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -662,7 +674,7 @@ namespace OnlineStore.DeviceLibrary
StoreMove
.
NextMoveStep
(
StoreMoveStep
.
SO_11_DevicePutWare
);
StoreMove
.
NextMoveStep
(
StoreMoveStep
.
SO_11_DevicePutWare
);
NeedCheckSafetyLight
=
0
;
NeedCheckSafetyLight
=
0
;
ComMoveToPosition
(
moveP
.
ComPress_P1
,
Config
.
CompAxis_P1_Speed
);
ComMoveToPosition
(
moveP
.
ComPress_P1
,
Config
.
CompAxis_P1_Speed
);
ACAxisMove
(
Config
.
UpDown_Axis
,
moveP
.
UpDown_P8
,
Config
.
UpDownAxis_P8_Speed
);
ACAxisMove
(
Config
.
UpDown_Axis
,
moveP
.
UpDown_P8
,
Config
.
UpDownAxis_P8_Speed
);
}
}
else
if
(
StoreMove
.
MoveStep
==
StoreMoveStep
.
SO_11_DevicePutWare
)
else
if
(
StoreMove
.
MoveStep
==
StoreMoveStep
.
SO_11_DevicePutWare
)
...
@@ -691,37 +703,50 @@ namespace OnlineStore.DeviceLibrary
...
@@ -691,37 +703,50 @@ namespace OnlineStore.DeviceLibrary
}
}
else
if
(
StoreMove
.
MoveStep
==
StoreMoveStep
.
SO_14_GoBack
)
else
if
(
StoreMove
.
MoveStep
==
StoreMoveStep
.
SO_14_GoBack
)
{
{
int
OutStoreWaitSeconds
=
ConfigAppSettings
.
GetIntValue
(
Setting_Init
.
OutStoreWaitSeconds
);
if
(
OutStoreWaitSeconds
<=
0
)
{
OutStoreWaitSeconds
=
600
;
}
int
ms
=
OutStoreWaitSeconds
*
1000
;
StoreMove
.
NextMoveStep
(
StoreMoveStep
.
SO_15_WaitTake
);
StoreMove
.
NextMoveStep
(
StoreMoveStep
.
SO_15_WaitTake
);
if
(!
IsInOutStoreAuto
)
if
(!
IsInOutStoreAuto
)
{
{
OutStoreLog
(
"出库:SO_14_WaitTake 等待拿走物品,最多等待"
+
OutStoreWaitSeconds
+
"秒"
);
if
(
OutStoreWaitSeconds
>
0
)
StoreMove
.
WaitList
.
Add
(
WaitResultInfo
.
WaitTime
(
ms
));
{
//StoreMove.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.TrayCheck_Door, IO_VALUE.LOW));
int
ms
=
OutStoreWaitSeconds
*
1000
;
StoreMove
.
WaitList
.
Add
(
WaitResultInfo
.
WaitHeight
(
0
));
OutStoreLog
(
"出库:SO_15_WaitTake 等待拿走物品,最多等待"
+
OutStoreWaitSeconds
+
"秒"
);
StoreMove
.
WaitList
.
Add
(
WaitResultInfo
.
WaitTime
(
ms
));
StoreMove
.
WaitList
.
Add
(
WaitResultInfo
.
WaitHeight
(
0
));
StoreMove
.
OneWaitCanEndStep
=
true
;
}
else
{
OutStoreLog
(
"出库:SO_15_WaitTake 等待拿走物品 "
);
StoreMove
.
WaitList
.
Add
(
WaitResultInfo
.
WaitIO
(
IO_Type
.
TrayCheck_Door
,
IO_VALUE
.
LOW
));
StoreMove
.
WaitList
.
Add
(
WaitResultInfo
.
WaitHeight
(
0
));
}
}
}
else
else
{
{
OutStoreLog
(
"出库:SO_1
4_WaitTake 放置物品,最多等待"
+
"3秒
"
);
OutStoreLog
(
"出库:SO_1
5_WaitTake 自动出入库中,等待3秒后继续
"
);
StoreMove
.
WaitList
.
Add
(
WaitResultInfo
.
WaitTime
(
3000
));
StoreMove
.
WaitList
.
Add
(
WaitResultInfo
.
WaitTime
(
3000
));
}
}
StoreMove
.
OneWaitCanEndStep
=
true
;
}
}
else
if
(
StoreMove
.
MoveStep
==
StoreMoveStep
.
SO_15_WaitTake
)
else
if
(
StoreMove
.
MoveStep
==
StoreMoveStep
.
SO_15_WaitTake
)
{
{
TimeSpan
span
=
DateTime
.
Now
-
startOutStoreTime
;
//如果配置是0,再次验证是否拿走物品
string
posId
=
StoreMove
.
MoveParam
!=
null
?
StoreMove
.
MoveParam
.
PositionNum
:
""
;
if
(
OutStoreWaitSeconds
<=
0
)
{
storeStatus
=
StoreStatus
.
StoreOnline
;
StoreMove
.
NextMoveStep
(
StoreMoveStep
.
SO_16_CheckIsTake
);
LogUtil
.
info
(
LOGGER
,
StoreName
+
" 【"
+
posId
+
"】出库结束["
+
FormUtil
.
GetSpanStr
(
span
)
+
"]"
,
storeMoveColor
);
OutStoreLog
(
"出库:SO_16_CheckIsTake 再次等待物品是否已拿走 "
);
StoreMove
.
EndMove
();
StoreMove
.
WaitList
.
Add
(
WaitResultInfo
.
WaitTime
(
200
));
storeRunStatus
=
StoreRunStatus
.
Runing
;
StoreMove
.
WaitList
.
Add
(
WaitResultInfo
.
WaitIO
(
IO_Type
.
TrayCheck_Door
,
IO_VALUE
.
LOW
));
//InOutEndProcess(StoreMoveType.OutStore);
StoreMove
.
WaitList
.
Add
(
WaitResultInfo
.
WaitHeight
(
0
));
}
else
{
OutStoreEnd
();
}
}
else
if
(
StoreMove
.
MoveStep
==
StoreMoveStep
.
SO_16_CheckIsTake
)
{
OutStoreEnd
();
}
}
else
else
{
{
...
@@ -729,11 +754,20 @@ namespace OnlineStore.DeviceLibrary
...
@@ -729,11 +754,20 @@ namespace OnlineStore.DeviceLibrary
}
}
}
}
private
void
OutStoreEnd
()
{
TimeSpan
span
=
DateTime
.
Now
-
startOutStoreTime
;
string
posId
=
StoreMove
.
MoveParam
!=
null
?
StoreMove
.
MoveParam
.
PositionNum
:
""
;
storeStatus
=
StoreStatus
.
StoreOnline
;
LogUtil
.
info
(
LOGGER
,
StoreName
+
" 【"
+
posId
+
"】出库结束["
+
FormUtil
.
GetSpanStr
(
span
)
+
"]"
,
storeMoveColor
);
StoreMove
.
EndMove
();
storeRunStatus
=
StoreRunStatus
.
Runing
;
//InOutEndProcess(StoreMoveType.OutStore);
}
private
void
SO_14_GoBack
()
private
void
SO_14_GoBack
()
{
{
StoreMove
.
NextMoveStep
(
StoreMoveStep
.
SO_14_GoBack
);
StoreMove
.
NextMoveStep
(
StoreMoveStep
.
SO_14_GoBack
);
OutStoreLog
(
"出库:SO_1
3
升降轴返回,轴2至P1(待机点) ,关闭舱门,更改状态为出库完成"
);
OutStoreLog
(
"出库:SO_1
4
升降轴返回,轴2至P1(待机点) ,关闭舱门,更改状态为出库完成"
);
ACAxisMove
(
Config
.
UpDown_Axis
,
StoreMove
.
MoveParam
.
MoveP
.
UpDown_P1
,
Config
.
UpDownAxis_P1_Speed
);
ACAxisMove
(
Config
.
UpDown_Axis
,
StoreMove
.
MoveParam
.
MoveP
.
UpDown_P1
,
Config
.
UpDownAxis_P1_Speed
);
CloseDoorAndWait
();
CloseDoorAndWait
();
...
...
source/DeviceLibrary/store/StoreStep.cs
查看文件 @
5838f53
...
@@ -253,6 +253,11 @@ namespace OnlineStore.DeviceLibrary
...
@@ -253,6 +253,11 @@ namespace OnlineStore.DeviceLibrary
/// </summary>
/// </summary>
SO_15_WaitTake
=
115
,
SO_15_WaitTake
=
115
,
/// <summary>
/// 料仓出库。。。等待200毫秒再次验证料盘是否拿走
/// </summary>
SO_16_CheckIsTake
=
116
,
#
endregion
#
endregion
#
region
料仓内部入库步骤
#
region
料仓内部入库步骤
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论