Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
李娜
/
AutoCountMachine
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit 1ae60358
由
LN
编写于
2020-05-28 15:13:23 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
增加agv对接
1 个父辈
9ace62a8
隐藏空白字符变更
内嵌
并排
正在显示
5 个修改的文件
包含
131 行增加
和
171 行删除
RC1266-AutoCountMachine/source/DeviceLibrary/agvClient/AgvClient.cs
RC1266-AutoCountMachine/source/DeviceLibrary/bean/BatchMoveBean_Partial.cs
RC1266-AutoCountMachine/source/DeviceLibrary/bean/OutputEquip_Shelf.cs
RC1266-AutoCountMachine/source/DeviceLibrary/bean/X_RAY_Equip_Partial.cs
RC1266-AutoCountMachine/source/DeviceLibrary/manager/SServerManager.cs
RC1266-AutoCountMachine/source/DeviceLibrary/agvClient/AgvClient.cs
查看文件 @
1ae6035
...
@@ -35,7 +35,6 @@ namespace OnlineStore.DeviceLibrary
...
@@ -35,7 +35,6 @@ namespace OnlineStore.DeviceLibrary
actionMap
=
new
Dictionary
<
string
,
Asa
.
ClientAction
>();
actionMap
=
new
Dictionary
<
string
,
Asa
.
ClientAction
>();
LogUtil
.
info
(
" 开始 agvClient.Connect"
);
LogUtil
.
info
(
" 开始 agvClient.Connect"
);
//}
agvClient
.
Connect
();
agvClient
.
Connect
();
foreach
(
string
str
in
NodeList
)
foreach
(
string
str
in
NodeList
)
{
{
...
@@ -81,49 +80,44 @@ namespace OnlineStore.DeviceLibrary
...
@@ -81,49 +80,44 @@ namespace OnlineStore.DeviceLibrary
agvClient
.
SetStatus
(
id
,
mark
,
shelfId
,
action
,
level
);
agvClient
.
SetStatus
(
id
,
mark
,
shelfId
,
action
,
level
);
UpdateAction
(
id
,
action
);
UpdateAction
(
id
,
action
);
}
}
private
static
void
AgvClient_CloseDoor
(
string
id
,
string
rfid
)
{
LogUtil
.
info
(
"收到 AgvClient_CloseDoor ["
+
id
+
"] ["
+
rfid
+
"] "
);
}
private
static
void
AgvClient_Ready
(
string
id
,
string
rfid
)
private
static
void
AgvClient_Ready
(
string
id
,
string
rfid
)
{
{
UpdateAction
(
id
,
ClientAction
.
Ready
);
try
LogUtil
.
info
(
"收到 AgvClient_Ready ["
+
id
+
"] ["
+
rfid
+
"] "
);
if
(
RobotManager
.
robot
.
inputEquip
.
Config
.
LeftAgvName
.
Equals
(
id
))
{
RobotManager
.
robot
.
inputEquip
.
LeftBatchMove
.
AgvReady
(
id
,
rfid
);
}
else
if
(
RobotManager
.
robot
.
inputEquip
.
Config
.
RightAgvName
.
Equals
(
id
))
{
RobotManager
.
robot
.
inputEquip
.
LeftBatchMove
.
AgvReady
(
id
,
rfid
);
}
else
if
(
RobotManager
.
robot
.
outputEquip
.
Config
.
AgvInName
.
Equals
(
id
)||
RobotManager
.
robot
.
outputEquip
.
Config
.
AgvOutName
.
Equals
(
id
))
{
{
RobotManager
.
robot
.
outputEquip
.
AgvReady
(
id
,
rfid
);
UpdateAction
(
id
,
ClientAction
.
Ready
);
LogUtil
.
info
(
"收到 AgvClient_Ready ["
+
id
+
"] ["
+
rfid
+
"] "
);
if
(
RobotManager
.
robot
.
inputEquip
.
Config
.
LeftAgvName
.
Equals
(
id
))
{
RobotManager
.
robot
.
inputEquip
.
LeftBatchMove
.
AgvReady
(
id
,
rfid
);
}
else
if
(
RobotManager
.
robot
.
inputEquip
.
Config
.
RightAgvName
.
Equals
(
id
))
{
RobotManager
.
robot
.
inputEquip
.
LeftBatchMove
.
AgvReady
(
id
,
rfid
);
}
else
if
(
RobotManager
.
robot
.
outputEquip
.
Config
.
AgvInName
.
Equals
(
id
)
||
RobotManager
.
robot
.
outputEquip
.
Config
.
AgvOutName
.
Equals
(
id
))
{
RobotManager
.
robot
.
outputEquip
.
AgvReady
(
id
,
rfid
);
}
else
{
LogUtil
.
error
(
"收到 AgvClient_Arrive ["
+
id
+
"] ["
+
rfid
+
"] 未找到对应的设备 ,暂不处理"
);
}
}
}
else
catch
(
Exception
ex
)
{
{
LogUtil
.
error
(
"
收到 AgvClient_Arrive ["
+
id
+
"] ["
+
rfid
+
"] 未找到对应的设备 ,暂不处理"
);
LogUtil
.
error
(
"
AgvClient_Ready ["
+
id
+
"] ["
+
rfid
+
"] 处理出错:"
+
ex
.
ToString
()
);
}
}
}
}
private
static
void
AgvClient_CloseDoor
(
string
id
,
string
rfid
)
{
LogUtil
.
info
(
"收到 AgvClient_CloseDoor ["
+
id
+
"] ["
+
rfid
+
"] 暂无需处理 "
);
}
private
static
void
AgvClient_Arrive
(
string
id
,
string
rfid
)
private
static
void
AgvClient_Arrive
(
string
id
,
string
rfid
)
{
{
UpdateAction
(
id
,
ClientAction
.
Arrive
);
// UpdateAction(id, ClientAction.Arrive);
// RFIDData data = new RFIDData(content);
LogUtil
.
info
(
"收到 AgvClient_Arrive ["
+
id
+
"] ["
+
rfid
+
"]暂无需处理 "
);
LogUtil
.
info
(
"收到 AgvClient_Arrive ["
+
id
+
"] ["
+
rfid
+
"] "
);
if
(
RobotManager
.
robot
.
inputEquip
.
Config
.
LeftAgvName
.
Equals
(
id
))
{
RobotManager
.
robot
.
inputEquip
.
LeftBatchMove
.
AgvArrive
(
id
,
rfid
);
}
else
if
(
RobotManager
.
robot
.
inputEquip
.
Config
.
RightAgvName
.
Equals
(
id
))
{
RobotManager
.
robot
.
inputEquip
.
RightBatchMove
.
AgvArrive
(
id
,
rfid
);
}
else
{
LogUtil
.
error
(
"收到 AgvClient_Arrive ["
+
id
+
"] ["
+
rfid
+
"] 未找到对应的设备 ,暂不处理"
);
}
}
}
internal
static
bool
ISConnected
()
internal
static
bool
ISConnected
()
...
...
RC1266-AutoCountMachine/source/DeviceLibrary/bean/BatchMoveBean_Partial.cs
查看文件 @
1ae6035
...
@@ -186,7 +186,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -186,7 +186,7 @@ namespace OnlineStore.DeviceLibrary
MoveInfo
.
NextMoveStep
(
StepEnum
.
IB12_BatchAxisToP3
);
MoveInfo
.
NextMoveStep
(
StepEnum
.
IB12_BatchAxisToP3
);
WorkLog
(
"料串入料 :料盘已拿走,批量轴到P3,测盘高 "
);
WorkLog
(
"料串入料 :料盘已拿走,批量轴到P3,测盘高 "
);
MoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitTime
(
1000
));
MoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitTime
(
1000
));
BatchAxisToP3
(
false
);
BatchAxisToP3
(
);
}
}
else
if
(
MoveInfo
.
IsStep
(
StepEnum
.
IB12_BatchAxisToP3
))
else
if
(
MoveInfo
.
IsStep
(
StepEnum
.
IB12_BatchAxisToP3
))
{
{
...
@@ -360,7 +360,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -360,7 +360,7 @@ namespace OnlineStore.DeviceLibrary
MoveInfo
.
NextMoveStep
(
StepEnum
.
IB07_AxisUpMove
);
MoveInfo
.
NextMoveStep
(
StepEnum
.
IB07_AxisUpMove
);
WorkLog
(
"料串入料 :CheckHasTray:上料轴开始慢速上升到P3点,等待检测到料盘"
);
WorkLog
(
"料串入料 :CheckHasTray:上料轴开始慢速上升到P3点,等待检测到料盘"
);
MoveInfo
.
ShelfNoTray
=
false
;
MoveInfo
.
ShelfNoTray
=
false
;
BatchAxisToP3
(
false
);
BatchAxisToP3
(
);
return
;
return
;
}
}
}
}
...
@@ -377,23 +377,11 @@ namespace OnlineStore.DeviceLibrary
...
@@ -377,23 +377,11 @@ namespace OnlineStore.DeviceLibrary
BatchAxis
.
SuddenStop
(
true
);
BatchAxis
.
SuddenStop
(
true
);
BatchAxis
.
AbsMove
(
MoveInfo
,
BatchAxisP1
,
Robot
.
Config
.
BatchAxis_P1Speed
);
BatchAxis
.
AbsMove
(
MoveInfo
,
BatchAxisP1
,
Robot
.
Config
.
BatchAxis_P1Speed
);
}
}
private
void
BatchAxisToP3
(
bool
isFirstMove
=
true
)
private
void
BatchAxisToP3
(
)
{
{
int
targetP3
=
BatchAxisP3
;
int
targetP3
=
BatchAxisP3
;
int
targetSpeed
=
Robot
.
Config
.
BatchAxis_P3Speed
;
int
targetSpeed
=
Robot
.
Config
.
BatchAxis_P3Speed
;
//if (!isFirstMove)
//{
// int currPosition = BatchAxis.GetAclPosition();
// if (currPosition != -1)
// {
// targetP3 = currPosition + Robot.Config.Height_ChangeValue * 80;
// if (targetP3 > BatchAxisP3)
// {
// targetP3 = BatchAxisP3;
// }
// LogUtil.info(Name + " BatchAxisToP3 目标P3: " + targetP3 + "(" + currPosition + ")");
// }
//}
MoveInfo
.
TimeOutSeconds
=
200
;
MoveInfo
.
TimeOutSeconds
=
200
;
MoveInfo
.
CanWhileCount
=
0
;
MoveInfo
.
CanWhileCount
=
0
;
// 需要增加定时器,获取验证信号并停止伺服
// 需要增加定时器,获取验证信号并停止伺服
...
@@ -464,16 +452,27 @@ namespace OnlineStore.DeviceLibrary
...
@@ -464,16 +452,27 @@ namespace OnlineStore.DeviceLibrary
#
region
AGV
处理
#
region
AGV
处理
private
bool
ProcessShelfOut
=
false
;
private
bool
ProcessShelfOut
=
false
;
private
bool
ProcessShelfEnter
=
false
;
private
bool
ProcessShelfEnter
=
false
;
internal
void
ShelfEnterProcess
()
internal
void
AgvReady
(
string
nodeId
,
string
rfid
)
{
if
(
string
.
IsNullOrEmpty
(
rfid
))
{
ShelfOutProcess
(
nodeId
,
rfid
);
}
else
{
ShelfEnterProcess
(
nodeId
,
rfid
);
}
}
internal
void
ShelfEnterProcess
(
string
nodeId
,
string
rfid
)
{
{
Task
.
Factory
.
StartNew
(
delegate
Task
.
Factory
.
StartNew
(
delegate
{
{
string
logName
=
Name
+
"料串 [AGV->"
+
AgvName
+
"] "
;
string
logName
=
Name
+
"料串
"
+
rfid
+
"
[AGV->"
+
AgvName
+
"] "
;
try
try
{
{
if
(
Robot
.
IOValue
(
IO_LineIn_Check
).
Equals
(
IO_VALUE
.
LOW
)
&&
Robot
.
IOValue
(
IO_LineEnd_Check
).
Equals
(
IO_VALUE
.
LOW
))
if
(
Robot
.
IOValue
(
IO_LineIn_Check
).
Equals
(
IO_VALUE
.
LOW
)
&&
Robot
.
IOValue
(
IO_LineEnd_Check
).
Equals
(
IO_VALUE
.
LOW
))
{
{
LogUtil
.
info
(
logName
+
" 开始"
);
LogUtil
.
info
(
logName
+
" 开始
转动线体
"
);
ProcessShelfEnter
=
true
;
ProcessShelfEnter
=
true
;
LineRun
();
LineRun
();
...
@@ -517,6 +516,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -517,6 +516,7 @@ namespace OnlineStore.DeviceLibrary
else
else
{
{
//入口有料串,暂不处理
//入口有料串,暂不处理
LogUtil
.
error
(
logName
+
",入口已有料架,暂不处理"
);
}
}
}
}
catch
(
TimeoutException
te
)
catch
(
TimeoutException
te
)
...
@@ -529,39 +529,19 @@ namespace OnlineStore.DeviceLibrary
...
@@ -529,39 +529,19 @@ namespace OnlineStore.DeviceLibrary
}
}
finally
finally
{
{
LineStop
();
ProcessShelfEnter
=
false
;
ProcessShelfEnter
=
false
;
}
}
});
});
}
}
internal
void
AgvReady
(
string
nodeId
,
string
rfid
)
{
internal
void
ShelfOutProcess
(
string
nodeId
,
string
rfid
)
string
logN
=
Name
+
"收到 AgvReady 事件 ["
+
nodeId
+
"] ["
+
rfid
+
"] "
;
if
(
string
.
IsNullOrEmpty
(
rfid
))
{
ShelfOutProcess
();
}
else
{
ShelfEnterProcess
();
}
}
internal
void
AgvArrive
(
string
id
,
string
rfid
)
{
string
logN
=
Name
+
"收到 AgvArrive 事件 ["
+
id
+
"] ["
+
rfid
+
"] "
;
}
internal
void
ShelfOutProcess
()
{
{
//AGV已到达,将料串送入AGV中
//AGV已到达,将料串送入AGV中
Task
.
Factory
.
StartNew
(
delegate
Task
.
Factory
.
StartNew
(
delegate
{
{
string
logName
=
Name
+
"["
+
AgvName
+
"->AGV ] "
;
string
logName
=
Name
+
"
料串"
+
rfid
+
"
["
+
AgvName
+
"->AGV ] "
;
try
try
{
{
LogUtil
.
info
(
logName
+
"开始,先设置状态为None"
);
AgvClient
.
SetStatus
(
AgvName
,
CurrShelfId
,
ClientAction
.
None
,
ClientLevel
.
High
,
true
);
AgvClient
.
SetStatus
(
AgvName
,
CurrShelfId
,
ClientAction
.
None
,
ClientLevel
.
High
,
true
);
if
(
Robot
.
IOValue
(
IO_LineIn_Check
).
Equals
(
IO_VALUE
.
HIGH
)
||
Robot
.
IOValue
(
IO_LineEnd_Check
).
Equals
(
IO_VALUE
.
HIGH
))
if
(
Robot
.
IOValue
(
IO_LineIn_Check
).
Equals
(
IO_VALUE
.
HIGH
)
||
Robot
.
IOValue
(
IO_LineEnd_Check
).
Equals
(
IO_VALUE
.
HIGH
))
{
{
...
@@ -586,11 +566,11 @@ namespace OnlineStore.DeviceLibrary
...
@@ -586,11 +566,11 @@ namespace OnlineStore.DeviceLibrary
AgvClient
.
SetStatus
(
AgvName
,
""
,
ClientAction
.
None
,
ClientLevel
.
High
,
true
);
AgvClient
.
SetStatus
(
AgvName
,
""
,
ClientAction
.
None
,
ClientLevel
.
High
,
true
);
});
});
ProcessShelfOut
=
false
;
ProcessShelfOut
=
false
;
LogUtil
.
info
(
logName
+
"
,停止转动,清空料串["
+
CurrShelfId
+
"], 结束
"
);
LogUtil
.
info
(
logName
+
"
结束,停止转动,清空料串["
+
CurrShelfId
+
"]
"
);
}
}
else
else
{
{
LogUtil
.
info
(
logName
+
"
开始,未检测到料串信号,
不处理"
);
LogUtil
.
info
(
logName
+
"
未检测到料架,暂
不处理"
);
}
}
}
}
catch
(
TimeoutException
te
)
catch
(
TimeoutException
te
)
...
@@ -608,10 +588,9 @@ namespace OnlineStore.DeviceLibrary
...
@@ -608,10 +588,9 @@ namespace OnlineStore.DeviceLibrary
}
}
});
});
}
}
#
endregion
#
endregion
protected
void
WorkLog
(
string
msg
)
protected
void
WorkLog
(
string
msg
)
{
{
LogUtil
.
info
(
Name
+
" ["
+
MoveInfo
.
MoveStep
+
"]"
+
msg
);
LogUtil
.
info
(
Name
+
" ["
+
MoveInfo
.
MoveStep
+
"]"
+
msg
);
...
...
RC1266-AutoCountMachine/source/DeviceLibrary/bean/OutputEquip_Shelf.cs
查看文件 @
1ae6035
...
@@ -387,149 +387,142 @@ namespace OnlineStore.DeviceLibrary
...
@@ -387,149 +387,142 @@ namespace OnlineStore.DeviceLibrary
internal
void
AgvReady
(
string
id
,
string
rfid
)
internal
void
AgvReady
(
string
id
,
string
rfid
)
{
{
string
logN
=
Name
+
" AgvClient_Ready ["
+
id
+
"] ["
+
rfid
+
"] "
;
if
(
id
.
Equals
(
Config
.
AgvInName
))
if
(
id
.
Equals
(
Config
.
AgvInName
))
{
{
if
(
IOValue
(
IO_Type
.
O_ELine_InCheck
).
Equals
(
IO_VALUE
.
HIGH
))
ShelfEnterProcess
(
id
,
rfid
);
{
LogUtil
.
info
(
logN
+
" ,空料串入口有料串,暂不处理"
);
}
ShelfEnterProcess
();
}
}
else
if
(
id
.
Equals
(
Config
.
AgvOutName
))
else
if
(
id
.
Equals
(
Config
.
AgvOutName
))
{
{
if
(
IOValue
(
IO_Type
.
O_WLine_OutCheck
).
Equals
(
IO_VALUE
.
LOW
))
ShelfOutProcess
(
id
,
rfid
);
{
LogUtil
.
info
(
logN
+
" ,出口无料串,暂不处理"
);
}
ShelfOutProcess
();
}
}
}
}
private
bool
ProcessShelfEnter
=
false
;
private
bool
ProcessShelfEnter
=
false
;
private
bool
ProcessShelfOut
=
false
;
private
bool
ProcessShelfOut
=
false
;
internal
void
Shelf
OutProcess
(
)
internal
void
Shelf
EnterProcess
(
string
id
,
string
rfid
)
{
{
//AGV已到达,将料串送入AGV中
string
logName
=
Name
+
"料串"
+
rfid
+
" [AGV ->"
+
Config
.
AgvInName
+
" ] "
;
Task
.
Factory
.
StartNew
(
delegate
Task
.
Factory
.
StartNew
(
delegate
{
{
string
logName
=
Name
+
"料串 ["
+
Config
.
AgvOutName
+
"->AGV ] "
;
try
try
{
{
AgvClient
.
SetStatus
(
Config
.
AgvOutName
,
""
,
ClientAction
.
None
,
ClientLevel
.
High
,
true
);
if
(
IOValue
(
IO_Type
.
O_ELine_InCheck
).
Equals
(
IO_VALUE
.
LOW
))
if
(
IOValue
(
IO_Type
.
O_WLine_OutCheck
).
Equals
(
IO_VALUE
.
HIGH
))
{
{
LogUtil
.
info
(
logName
+
" 出口阻挡下降,转动线体"
);
ProcessShelfEnter
=
true
;
ProcessShelfOut
=
true
;
LogUtil
.
info
(
logName
+
" 阻挡上升,转动链条"
);
//出口阻挡下降,出口线体转动
//AgvClient.SetStatus(Config.AgvInName,"",ClientAction.MayEnter,ClientLevel.High);
IOMove
(
IO_Type
.
O_WLine_OutStop
,
IO_VALUE
.
HIGH
);
IOMove
(
IO_Type
.
O_WLine_Run
,
IO_VALUE
.
HIGH
);
//转动线体
IOMove
(
IO_Type
.
O_ELine_InStop
,
IO_VALUE
.
LOW
);
IOMove
(
IO_Type
.
O_ELine_Run
,
IO_VALUE
.
HIGH
);
//等待进料检测信号
bool
result
=
WaitIo
(
IO_Type
.
O_ELine_InCheck
,
IO_VALUE
.
HIGH
,
60000
);
bool
result
=
WaitIo
(
IO_Type
.
O_WLine_OutCheck
,
IO_VALUE
.
LOW
,
60000
);
if
(!
result
)
if
(!
result
)
{
{
LogUtil
.
info
(
logName
+
"
等待 O_WLine_OutCheck=LOW超时,等待8000后停止转动
"
);
LogUtil
.
info
(
logName
+
"
等待 O_ELine_InCheck=High 超时, 等待 5000 后停止 O_ELine_Run
"
);
}
}
else
else
{
{
LogUtil
.
info
(
logName
+
" 已收到 O_WLine_OutCheck=LOW ,等待8000后停止转动 "
);
LogUtil
.
info
(
logName
+
"已收到 O_ELine_InCheck=High , 等待 5000 后停止 O_ELine_Run"
);
}
}
Thread
.
Sleep
(
8000
);
//停止转动 ,阻挡上升
IOMove
(
IO_Type
.
O_WLine_OutStop
,
IO_VALUE
.
LOW
);
//此处判断是否需要停止接料线体
//等待500毫秒后停止转动
IOMove
(
IO_Type
.
O_WLine_Run
,
IO_VALUE
.
LOW
);
Thread
.
Sleep
(
5000
);
AgvClient
.
SetStatus
(
Config
.
AgvOutName
,
""
,
ClientAction
.
FinishLeave
,
ClientLevel
.
High
,
true
);
IOMove
(
IO_Type
.
O_ELine_Run
,
IO_VALUE
.
LOW
);
//料串可离开
AgvClient
.
SetStatus
(
Config
.
AgvInName
,
""
,
ClientAction
.
FinishEnter
,
ClientLevel
.
High
,
true
);
Task
.
Factory
.
StartNew
(
delegate
Task
.
Factory
.
StartNew
(
delegate
{
{
Thread
.
Sleep
(
1
000
);
Thread
.
Sleep
(
5
000
);
AgvClient
.
SetStatus
(
Config
.
Agv
Out
Name
,
""
,
ClientAction
.
None
,
ClientLevel
.
High
,
true
);
AgvClient
.
SetStatus
(
Config
.
Agv
In
Name
,
""
,
ClientAction
.
None
,
ClientLevel
.
High
,
true
);
});
});
ProcessShelf
Out
=
false
;
ProcessShelf
Enter
=
false
;
LogUtil
.
info
(
logName
+
"
,停止转动
结束"
);
LogUtil
.
info
(
logName
+
"
结束"
);
}
}
else
else
{
{
LogUtil
.
info
(
logName
+
"
未检测到出口料串,
不处理"
);
LogUtil
.
info
(
logName
+
"
入口有料架,暂
不处理"
);
}
}
}
}
catch
(
TimeoutException
te
)
catch
(
TimeoutException
te
)
{
{
LogUtil
.
error
(
logName
+
" 超时:"
+
te
);
LogUtil
.
error
(
logName
+
"
超时:"
+
te
);
}
}
catch
(
Exception
ex
)
catch
(
Exception
ex
)
{
{
LogUtil
.
error
(
logName
+
" 出错:"
,
ex
);
LogUtil
.
error
(
logName
+
"
出错:"
,
ex
);
}
}
finally
finally
{
{
IOMove
(
IO_Type
.
O_
WLine_OutStop
,
IO_VALUE
.
LOW
);
IOMove
(
IO_Type
.
O_
ELine_Run
,
IO_VALUE
.
LOW
);
ProcessShelf
Out
=
false
;
ProcessShelf
Enter
=
false
;
}
}
});
});
}
}
internal
void
ShelfEnterProcess
()
{
internal
void
ShelfOutProcess
(
string
id
,
string
rfid
)
{
string
logName
=
Name
+
"料串 "
+
rfid
+
"["
+
Config
.
AgvOutName
+
"->AGV ] "
;
Task
.
Factory
.
StartNew
(
delegate
Task
.
Factory
.
StartNew
(
delegate
{
{
string
logName
=
Name
+
"料串 [AGV ->"
+
Config
.
AgvInName
+
" ] "
;
try
try
{
{
if
(
IOValue
(
IO_Type
.
O_ELine_InCheck
).
Equals
(
IO_VALUE
.
LOW
))
AgvClient
.
SetStatus
(
Config
.
AgvOutName
,
""
,
ClientAction
.
None
,
ClientLevel
.
High
,
true
);
if
(
IOValue
(
IO_Type
.
O_WLine_OutCheck
).
Equals
(
IO_VALUE
.
HIGH
))
{
{
LogUtil
.
info
(
logName
+
" 阻挡上升,转动链条"
);
LogUtil
.
info
(
logName
+
" 出口阻挡下降,转动线体"
);
//AgvClient.SetStatus(Config.AgvInName,"",ClientAction.MayEnter,ClientLevel.High);
ProcessShelfOut
=
true
;
ProcessShelfEnter
=
true
;
//出口阻挡下降,出口线体转动
IOMove
(
IO_Type
.
O_WLine_OutStop
,
IO_VALUE
.
HIGH
);
IOMove
(
IO_Type
.
O_WLine_Run
,
IO_VALUE
.
HIGH
);
//转动线体
IOMove
(
IO_Type
.
O_ELine_InStop
,
IO_VALUE
.
LOW
);
IOMove
(
IO_Type
.
O_ELine_Run
,
IO_VALUE
.
HIGH
);
//等待进料检测信号
bool
result
=
WaitIo
(
IO_Type
.
O_ELine_InCheck
,
IO_VALUE
.
HIGH
,
60000
);
bool
result
=
WaitIo
(
IO_Type
.
O_WLine_OutCheck
,
IO_VALUE
.
LOW
,
60000
);
if
(!
result
)
if
(!
result
)
{
{
LogUtil
.
info
(
logName
+
"
等待 O_ELine_InCheck=High 超时, 等待 5000 后停止 O_ELine_Run
"
);
LogUtil
.
info
(
logName
+
"
等待 O_WLine_OutCheck=LOW超时,等待8000后停止转动
"
);
}
}
else
else
{
{
LogUtil
.
info
(
logName
+
"已收到 O_ELine_InCheck=High , 等待 5000 后停止 O_ELine_Run"
);
LogUtil
.
info
(
logName
+
" 已收到 O_WLine_OutCheck=LOW ,等待8000后停止转动 "
);
}
}
Thread
.
Sleep
(
8000
);
//等待500毫秒后停止转动
//停止转动 ,阻挡上升
Thread
.
Sleep
(
5000
);
IOMove
(
IO_Type
.
O_WLine_OutStop
,
IO_VALUE
.
LOW
);
IOMove
(
IO_Type
.
O_ELine_Run
,
IO_VALUE
.
LOW
);
//料串可离开
//此处判断是否需要停止接料线体
AgvClient
.
SetStatus
(
Config
.
AgvInName
,
""
,
ClientAction
.
FinishEnter
,
ClientLevel
.
High
,
true
);
IOMove
(
IO_Type
.
O_WLine_Run
,
IO_VALUE
.
LOW
);
AgvClient
.
SetStatus
(
Config
.
AgvOutName
,
""
,
ClientAction
.
FinishLeave
,
ClientLevel
.
High
,
true
);
Task
.
Factory
.
StartNew
(
delegate
Task
.
Factory
.
StartNew
(
delegate
{
{
Thread
.
Sleep
(
1
000
);
Thread
.
Sleep
(
5
000
);
AgvClient
.
SetStatus
(
Config
.
Agv
In
Name
,
""
,
ClientAction
.
None
,
ClientLevel
.
High
,
true
);
AgvClient
.
SetStatus
(
Config
.
Agv
Out
Name
,
""
,
ClientAction
.
None
,
ClientLevel
.
High
,
true
);
});
});
ProcessShelfEnter
=
false
;
ProcessShelfOut
=
false
;
LogUtil
.
info
(
logName
+
" 结束"
);
LogUtil
.
info
(
logName
+
"结束,停止转动 "
);
}
else
{
LogUtil
.
info
(
logName
+
" 未检测到出口料串,暂不处理"
);
}
}
}
}
catch
(
TimeoutException
te
)
catch
(
TimeoutException
te
)
{
{
LogUtil
.
error
(
logName
+
"
超时:"
+
te
);
LogUtil
.
error
(
logName
+
" 超时:"
+
te
);
}
}
catch
(
Exception
ex
)
catch
(
Exception
ex
)
{
{
LogUtil
.
error
(
logName
+
"
出错:"
,
ex
);
LogUtil
.
error
(
logName
+
" 出错:"
,
ex
);
}
}
finally
finally
{
{
IOMove
(
IO_Type
.
O_
ELine_Run
,
IO_VALUE
.
LOW
);
IOMove
(
IO_Type
.
O_
WLine_OutStop
,
IO_VALUE
.
LOW
);
ProcessShelf
Enter
=
false
;
ProcessShelf
Out
=
false
;
}
}
});
});
}
}
...
...
RC1266-AutoCountMachine/source/DeviceLibrary/bean/X_RAY_Equip_Partial.cs
查看文件 @
1ae6035
...
@@ -162,11 +162,12 @@ namespace OnlineStore.DeviceLibrary
...
@@ -162,11 +162,12 @@ namespace OnlineStore.DeviceLibrary
MoveInfo
.
MoveParam
.
WareCount
=
99999
;
MoveInfo
.
MoveParam
.
WareCount
=
99999
;
Work_ReelInfo
.
WareCount
=
99999
;
Work_ReelInfo
.
WareCount
=
99999
;
}
}
WorkLog
(
"料盘处理:点料结束,关闭X关机互锁信号"
);
WorkLog
(
"料盘处理:点料结束,关闭X关机互锁信号
,上传点料结果
"
);
IOMove
(
IO_Type
.
X_Lock_On
,
IO_VALUE
.
LOW
);
IOMove
(
IO_Type
.
X_Lock_On
,
IO_VALUE
.
LOW
);
MoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitTime
(
1000
));
MoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitTime
(
1000
));
Task
.
Factory
.
StartNew
(
delegate
{
Task
.
Factory
.
StartNew
(
delegate
{
SServerManager
.
Return_Material
(
Name
,
MoveInfo
.
MoveParam
.
WareCode
,
Work_ReelInfo
.
WareCount
);
string
msg
=
SServerManager
.
Return_Material
(
Name
,
MoveInfo
.
MoveParam
.
WareCode
,
Work_ReelInfo
.
WareCount
);
LogUtil
.
error
(
Name
+
"上传【"
+
MoveInfo
.
MoveParam
.
OutStr
()+
"】点料结果失败:"
+
msg
);
});
});
}
}
#
endregion
#
endregion
...
...
RC1266-AutoCountMachine/source/DeviceLibrary/manager/SServerManager.cs
查看文件 @
1ae6035
...
@@ -109,14 +109,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -109,14 +109,7 @@ namespace OnlineStore.DeviceLibrary
}
}
DateTime
startTime
=
DateTime
.
Now
;
DateTime
startTime
=
DateTime
.
Now
;
string
resultStr
=
HttpHelper
.
Post
(
server
,
""
);
string
resultStr
=
HttpHelper
.
Post
(
server
,
""
);
LogUtil
.
info
(
"Return_Material "
+
FormUtil
.
GetSpanStr
(
DateTime
.
Now
-
startTime
)
+
" 【"
+
server
+
"】【"
+
resultStr
+
"】"
);
LogUtil
.
info
(
"Return_Material "
+
FormUtil
.
GetSpanStr
(
DateTime
.
Now
-
startTime
)
+
" 【"
+
server
+
"】【"
+
resultStr
+
"】"
);
// ServerData serverResult = JsonHelper.DeserializeJsonToObject<ServerData>(resultStr);
if
(!
msg
.
Equals
(
""
))
{
LogUtil
.
error
(
msg
);
}
}
}
catch
(
Exception
ex
)
catch
(
Exception
ex
)
{
{
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论