Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
孙克
/
RC30-AutoInOutStore
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit ba7860dd
由
gujlg
编写于
2019-05-22 16:02:23 +0800
浏览文件
选项
浏览文件
标签
下载
差异文件
Merge branch 'AutoInOutStore' of
https://gitee.com/ln0816/RC30-AutoInOutStore
into AutoInOutStore
2 个父辈
7e98e23f
5d47e39a
隐藏空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
41 行增加
和
20 行删除
source/DeviceLibrary/DeviceLibrary/IO/AIOBOX/BLL.cs
source/DeviceLibrary/acSingleStore/AC_SA_BoxBean_Partial.cs
source/DeviceLibrary/acSingleStore/AutomaticBaiting_Partial.cs
source/DeviceLibrary/store/AC_Store.cs
source/DeviceLibrary/DeviceLibrary/IO/AIOBOX/BLL.cs
查看文件 @
ba7860d
...
@@ -47,9 +47,9 @@ namespace Asa.IOModule
...
@@ -47,9 +47,9 @@ namespace Asa.IOModule
private
Thread
tLogOut
;
//日志输出
private
Thread
tLogOut
;
//日志输出
private
Thread
tReconn
;
//断开重连
private
Thread
tReconn
;
//断开重连
private
const
int
SEND_SLEEP
=
30
;
//发送命令间隔
private
const
int
SEND_SLEEP
=
15
;
//发送命令间隔
private
const
int
NET_SLEEP
=
30
;
//接收网络间隔
private
const
int
NET_SLEEP
=
15
;
//接收网络间隔
private
const
int
TRIG_SLEEP
=
3
0
;
//触发事件间隔
private
const
int
TRIG_SLEEP
=
2
0
;
//触发事件间隔
/// <summary>
/// <summary>
/// 自动读取DI委托
/// 自动读取DI委托
...
...
source/DeviceLibrary/acSingleStore/AC_SA_BoxBean_Partial.cs
查看文件 @
ba7860d
...
@@ -165,7 +165,16 @@ namespace OnlineStore.DeviceLibrary
...
@@ -165,7 +165,16 @@ namespace OnlineStore.DeviceLibrary
{
{
timeOutMs
=
650000
;
timeOutMs
=
650000
;
}
}
if
(!
wait
.
IsEnd
&&
span
.
TotalSeconds
>
2
&&
wait
.
IoType
.
Equals
(
IO_Type
.
SuckingDisc_Air
))
{
string
ioType
=
IO_Type
.
SuckingDisc_Work
;
IO_VALUE
doValue
=
IOManager
.
DOValue
(
ioType
);
if
(!
doValue
.
Equals
(
wait
.
IoValue
))
{
LogUtil
.
error
(
"等待["
+
NotOkMsg
+
"],重写DO("
+
ioType
+
"="
+
wait
.
IoValue
+
")"
);
IOManager
.
IOMove
(
ioType
,
wait
.
IoValue
);
}
}
if
((!
wait
.
IsEnd
)
&&
span
.
TotalMilliseconds
>
timeOutMs
)
if
((!
wait
.
IsEnd
)
&&
span
.
TotalMilliseconds
>
timeOutMs
)
{
{
ConfigIO
io
=
Config
.
getWaitIO
(
wait
.
IoType
);
ConfigIO
io
=
Config
.
getWaitIO
(
wait
.
IoType
);
...
@@ -193,7 +202,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -193,7 +202,7 @@ namespace OnlineStore.DeviceLibrary
{
{
if
(!
wait
.
IsEnd
)
if
(!
wait
.
IsEnd
)
{
{
wait
.
IsEnd
=
AutomaticBaiting
.
BatchAxisIsEnd
(
wait
);
wait
.
IsEnd
=
AutomaticBaiting
.
BatchAxisIsEnd
(
wait
,
span
);
}
}
if
(!
wait
.
IsEnd
)
if
(!
wait
.
IsEnd
)
{
{
...
...
source/DeviceLibrary/acSingleStore/AutomaticBaiting_Partial.cs
查看文件 @
ba7860d
...
@@ -107,22 +107,34 @@ namespace OnlineStore.DeviceLibrary
...
@@ -107,22 +107,34 @@ namespace OnlineStore.DeviceLibrary
// ConfigIO io = StoreManager.Config.getWaitIO(wait.IoType);
// ConfigIO io = StoreManager.Config.getWaitIO(wait.IoType);
// WarnMsg = "[" + StoreMove.MoveStep + "] 等待[" + io.ElectricalDefinition + "_" + io.Explain + "=" + wait.IoValue + "]超时";
// WarnMsg = "[" + StoreMove.MoveStep + "] 等待[" + io.ElectricalDefinition + "_" + io.Explain + "=" + wait.IoValue + "]超时";
// StoreManager.Store.Alarm(StoreAlarmType.BatchIoTimeOut, io.ElectricalDefinition, WarnMsg, StoreMove.MoveType);
// StoreManager.Store.Alarm(StoreAlarmType.BatchIoTimeOut, io.ElectricalDefinition, WarnMsg, StoreMove.MoveType);
// LogUtil.error(WarnMsg,101);
// LogUtil.error(WarnMsg,
101);
// isOk = false;
// isOk = false;
// break;
// break;
//}
//}
//如果是气缸动作,若Do未输出,重新写一遍
//如果是气缸动作,若Do未输出,重新写一遍
if
(!
wait
.
IsEnd
&&
span
.
TotalSeconds
>
1
&&
(
wait
.
IoType
.
Equals
(
IO_Type
.
SuckingDisc_Down
)
||
wait
.
IoType
.
Equals
(
IO_Type
.
SuckingDisc_Up
))
)
if
(!
wait
.
IsEnd
&&
span
.
TotalSeconds
>
2
)
{
{
IO_VALUE
doValue
=
IOManager
.
DOValue
(
wait
.
IoType
);
if
(
wait
.
IoType
.
Equals
(
IO_Type
.
SuckingDisc_Down
)
||
wait
.
IoType
.
Equals
(
IO_Type
.
SuckingDisc_Up
))
if
(!
doValue
.
Equals
(
wait
.
IoValue
))
{
{
LogUtil
.
error
(
"等待["
+
NotOkMsg
+
"],重写DO("
+
wait
.
IoType
+
"="
+
wait
.
IoValue
+
")"
);
IO_VALUE
doValue
=
IOManager
.
DOValue
(
wait
.
IoType
);
IOManager
.
IOMove
(
wait
.
IoType
,
wait
.
IoValue
);
if
(!
doValue
.
Equals
(
wait
.
IoValue
))
string
ioType
=
wait
.
IoType
.
Equals
(
IO_Type
.
SuckingDisc_Down
)
?
IO_Type
.
SuckingDisc_Up
:
IO_Type
.
SuckingDisc_Down
;
{
IO_VALUE
ioValue
=
wait
.
IoValue
.
Equals
(
IO_VALUE
.
LOW
)
?
IO_VALUE
.
HIGH
:
IO_VALUE
.
LOW
;
LogUtil
.
error
(
"等待["
+
NotOkMsg
+
"],重写DO("
+
wait
.
IoType
+
"="
+
wait
.
IoValue
+
")"
);
LogUtil
.
error
(
"等待["
+
wait
.
ToStr
()
+
"],重写气缸DO("
+
ioType
+
"="
+
ioValue
+
")"
);
IOManager
.
IOMove
(
wait
.
IoType
,
wait
.
IoValue
);
IOManager
.
IOMove
(
ioType
,
ioValue
);
string
ioType
=
wait
.
IoType
.
Equals
(
IO_Type
.
SuckingDisc_Down
)
?
IO_Type
.
SuckingDisc_Up
:
IO_Type
.
SuckingDisc_Down
;
IO_VALUE
ioValue
=
wait
.
IoValue
.
Equals
(
IO_VALUE
.
LOW
)
?
IO_VALUE
.
HIGH
:
IO_VALUE
.
LOW
;
LogUtil
.
error
(
"等待["
+
wait
.
ToStr
()
+
"],重写气缸DO("
+
ioType
+
"="
+
ioValue
+
")"
);
IOManager
.
IOMove
(
ioType
,
ioValue
);
}
}
else
if
(
wait
.
IoType
.
Equals
(
IO_Type
.
SuckingDisc_Air
))
{
string
ioType
=
IO_Type
.
SuckingDisc_Work
;
IO_VALUE
doValue
=
IOManager
.
DOValue
(
ioType
);
if
(!
doValue
.
Equals
(
wait
.
IoValue
))
{
LogUtil
.
error
(
"等待["
+
NotOkMsg
+
"],重写DO("
+
ioType
+
"="
+
wait
.
IoValue
+
")"
);
IOManager
.
IOMove
(
ioType
,
wait
.
IoValue
);
}
}
}
}
}
}
}
...
@@ -141,7 +153,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -141,7 +153,7 @@ namespace OnlineStore.DeviceLibrary
else
if
(
wait
.
WaitType
==
(
int
)
Wait_Type
.
BatchAxisMove_10
)
else
if
(
wait
.
WaitType
==
(
int
)
Wait_Type
.
BatchAxisMove_10
)
{
{
wait
.
IsEnd
=
BatchAxisIsEnd
(
wait
);
wait
.
IsEnd
=
BatchAxisIsEnd
(
wait
,
span
);
if
(
wait
.
IsEnd
)
if
(
wait
.
IsEnd
)
{
{
BatchAxisController
.
StopCheck
();
BatchAxisController
.
StopCheck
();
...
@@ -247,7 +259,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -247,7 +259,7 @@ namespace OnlineStore.DeviceLibrary
/// </summary>
/// </summary>
/// <param name="wait"></param>
/// <param name="wait"></param>
/// <returns></returns>
/// <returns></returns>
public
static
bool
BatchAxisIsEnd
(
WaitResultInfo
wait
)
public
static
bool
BatchAxisIsEnd
(
WaitResultInfo
wait
,
TimeSpan
startSpan
)
{
{
bool
result
=
false
;
bool
result
=
false
;
if
(
IOManager
.
IOValue
(
wait
.
IoType
).
Equals
(
IO_VALUE
.
HIGH
))
if
(
IOManager
.
IOValue
(
wait
.
IoType
).
Equals
(
IO_VALUE
.
HIGH
))
...
@@ -265,7 +277,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -265,7 +277,7 @@ namespace OnlineStore.DeviceLibrary
LogUtil
.
debug
(
wait
.
ToStr
()
+
" 停止运动"
);
LogUtil
.
debug
(
wait
.
ToStr
()
+
" 停止运动"
);
ACServerManager
.
SuddenStop
(
wait
.
AxisInfo
);
ACServerManager
.
SuddenStop
(
wait
.
AxisInfo
);
}
}
else
else
if
(
startSpan
.
TotalSeconds
>
2
)
{
{
TimeSpan
span
=
DateTime
.
Now
-
AxisResetMoveTime
;
TimeSpan
span
=
DateTime
.
Now
-
AxisResetMoveTime
;
if
((
AutoBaitingStatus
.
Equals
(
StoreRunStatus
.
Busy
)||
AutoBaitingStatus
.
Equals
(
StoreRunStatus
.
Reset
))
&&
span
.
TotalSeconds
>
10
)
if
((
AutoBaitingStatus
.
Equals
(
StoreRunStatus
.
Busy
)||
AutoBaitingStatus
.
Equals
(
StoreRunStatus
.
Reset
))
&&
span
.
TotalSeconds
>
10
)
...
@@ -278,7 +290,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -278,7 +290,7 @@ namespace OnlineStore.DeviceLibrary
{
//判断是否需要重新运动
{
//判断是否需要重新运动
StoreMove
.
CanWhileCount
--;
StoreMove
.
CanWhileCount
--;
LogUtil
.
error
(
wait
.
ToStr
()
+
" 未收到信号且停止运动,重新匀速"
+
StoreManager
.
Config
.
BatchAxis_SlowSpeed
+
"运动,剩余["
+
StoreMove
.
CanWhileCount
+
"]次"
);
LogUtil
.
error
(
wait
.
ToStr
()
+
" 未收到信号且停止运动,重新匀速"
+
StoreManager
.
Config
.
BatchAxis_SlowSpeed
+
"运动,剩余["
+
StoreMove
.
CanWhileCount
+
"]次"
);
ACServerManager
.
SuddenStop
(
wait
.
AxisInfo
);
ACServerManager
.
SuddenStop
(
wait
.
AxisInfo
.
DeviceName
,
wait
.
AxisInfo
.
GetAxisValue
()
);
Thread
.
Sleep
(
2000
);
Thread
.
Sleep
(
2000
);
ACServerManager
.
SpeedMove
(
wait
.
AxisInfo
.
DeviceName
,
wait
.
AxisInfo
.
GetAxisValue
(),
StoreManager
.
Config
.
BatchAxis_SlowSpeed
);
ACServerManager
.
SpeedMove
(
wait
.
AxisInfo
.
DeviceName
,
wait
.
AxisInfo
.
GetAxisValue
(),
StoreManager
.
Config
.
BatchAxis_SlowSpeed
);
}
}
...
...
source/DeviceLibrary/store/AC_Store.cs
查看文件 @
ba7860d
...
@@ -375,7 +375,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -375,7 +375,7 @@ namespace OnlineStore.DeviceLibrary
{
{
LogUtil
.
error
(
LOGGER
,
moveAxis
.
DisplayStr
+
"目标位置["
+
targetPosition
+
"]当前位置["
+
outCount
+
LogUtil
.
error
(
LOGGER
,
moveAxis
.
DisplayStr
+
"目标位置["
+
targetPosition
+
"]当前位置["
+
outCount
+
"],误差过大,重新开始运动,剩余["
+
StoreMove
.
CanWhileCount
+
"]次"
);
"],误差过大,重新开始运动,剩余["
+
StoreMove
.
CanWhileCount
+
"]次"
);
ACServerManager
.
SuddenStop
(
moveAxis
);
ACServerManager
.
SuddenStop
(
moveAxis
.
DeviceName
,
moveAxis
.
GetAxisValue
()
);
Thread
.
Sleep
(
2000
);
Thread
.
Sleep
(
2000
);
ACServerManager
.
AbsMove
(
moveAxis
.
DeviceName
,
moveAxis
.
GetAxisValue
(),
targetPosition
,
targetSpeed
);
ACServerManager
.
AbsMove
(
moveAxis
.
DeviceName
,
moveAxis
.
GetAxisValue
(),
targetPosition
,
targetSpeed
);
StoreMove
.
CanWhileCount
--;
StoreMove
.
CanWhileCount
--;
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论