Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
孙克
/
RC1250-AssemblyLine
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit 48ff972a
由
LN
编写于
2019-12-08 20:57:01 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
入库调试
1 个父辈
19012230
全部展开
隐藏空白字符变更
内嵌
并排
正在显示
16 个修改的文件
包含
158 行增加
和
94 行删除
source/AssemblyLineClient/App.config
source/AssemblyLineClient/FrmIOMsg.Designer.cs
source/AssemblyLineClient/FrmIOMsg.cs
source/AssemblyLineClient/FrmLineStore.Designer.cs
source/AssemblyLineClient/FrmLineStore.cs
source/DeviceLibrary/LineConfig/Config_Line.csv
source/DeviceLibrary/assemblyLine/EquipBase.cs
source/DeviceLibrary/assemblyLine/FeedingEquip.cs
source/DeviceLibrary/assemblyLine/FeedingEquip_InStore.cs
source/DeviceLibrary/assemblyLine/FeedingEquip_OutStore.cs
source/DeviceLibrary/assemblyLine/LineBean.cs
source/DeviceLibrary/assemblyLine/LineBean_Partial.cs
source/DeviceLibrary/assemblyLine/MoveEquip_Partial.cs
source/DeviceLibrary/assemblyLine/ProvidingEquip_Partial.cs
source/DeviceLibrary/assemblymanager/TrayManager.cs
source/DeviceLibrary/deviceLibrary/IO/AIOBOX/AIOBOXManager.cs
source/AssemblyLineClient/App.config
查看文件 @
48ff972
...
...
@@ -40,7 +40,7 @@
<!--
AGV
调度服务器地址-->
<
add
key
=
"AgvServerIp"
value
=
"192.168.103.22"
/>
<!--
IO
配置-->
<
add
key
=
"DIMS"
value
=
"
12
0"
/>
<
add
key
=
"DIMS"
value
=
"
6
0"
/>
<
add
key
=
"DOMS"
value
=
"300"
/>
<
add
key
=
"LineRunTest"
value
=
"1"
/>
<!--
ABB
机器人服务器-->
...
...
@@ -49,7 +49,7 @@
<
add
key
=
"OpenRFIDWrite"
value
=
"1"
/>
<
add
key
=
"DefaultPWD"
value
=
"123456"
/>
<!--当前调试的设备
ID
,分号分割-->
<
add
key
=
"DebugDeviceId"
value
=
"10
4
"
/>
<
add
key
=
"DebugDeviceId"
value
=
"10
3
"
/>
<
add
key
=
"NeedScanCode"
value
=
"1"
/>
</
appSettings
>
<
log4net
>
...
...
source/AssemblyLineClient/FrmIOMsg.Designer.cs
查看文件 @
48ff972
...
...
@@ -40,7 +40,7 @@
//
// timer1
//
this
.
timer1
.
Interval
=
3
000
;
this
.
timer1
.
Interval
=
10
000
;
this
.
timer1
.
Tick
+=
new
System
.
EventHandler
(
this
.
timer1_Tick
);
//
// lblConInfo
...
...
source/AssemblyLineClient/FrmIOMsg.cs
查看文件 @
48ff972
...
...
@@ -40,8 +40,8 @@ namespace OnlineStore.AssemblyLine
lblRFID
.
Text
=
"RFID信息:\r\n"
;
msg
=
""
;
List
<
string
>
rfidList
=
new
List
<
string
>(
DeviceConfig
.
ProRFIpMap
.
Values
);
foreach
(
string
ip
in
t
List
)
List
<
string
>
rfidList
=
new
List
<
string
>(
LineManager
.
Line
.
rfidList
);
foreach
(
string
ip
in
rfid
List
)
{
string
con
=
TrayManager
.
ReadRFID
(
ip
)
.
ToStr
()
;
msg
+=
(
"RFID["
+
ip
+
"]:"
).
PadLeft
(
26
,
' '
)
+
con
+
"\n"
;
...
...
source/AssemblyLineClient/FrmLineStore.Designer.cs
查看文件 @
48ff972
此文件的差异被折叠,
点击展开。
source/AssemblyLineClient/FrmLineStore.cs
查看文件 @
48ff972
...
...
@@ -255,7 +255,7 @@ namespace OnlineStore.AssemblyLine
lineBean
.
StopRun
();
}
IOManager
.
instance
.
CloseAllDO
();
//
IOManager.instance.CloseAllDO();
IOManager
.
instance
.
CloseAllConnection
();
//AIManager.CloseConnect();
ACServerManager
.
CloseAllPort
();
...
...
@@ -730,5 +730,17 @@ namespace OnlineStore.AssemblyLine
}
LogUtil
.
info
(
"-------------------结束打印托盘信息"
);
}
private
void
btnClearTray_Click
(
object
sender
,
EventArgs
e
)
{
List
<
TrayInfo
>
tray
=
TrayManager
.
getTrayList
();
LogUtil
.
info
(
"-------------------点击:清空托盘。清空前打印托盘信息:"
);
foreach
(
TrayInfo
t
in
tray
)
{
LogUtil
.
info
(
t
.
ToStr
());
}
TrayManager
.
ClearTrayInfo
();
LogUtil
.
info
(
"-------------------点击:清空托盘。托盘内容已清空"
);
}
}
}
source/DeviceLibrary/LineConfig/Config_Line.csv
查看文件 @
48ff972
...
...
@@ -55,10 +55,10 @@ PRO,0,出料移栽1-托盘-RFID-IP,PRO_RFIP_201,192.168.210.119,,,,,
PRO,0,出料移栽2-托盘-RFID-IP,PRO_RFIP_202,192.168.210.122,,,,,
PRO,0,出料移栽3-托盘-RFID-IP,PRO_RFIP_203,192.168.210.127,,,,,
PRO,0,出料移栽4-托盘-RFID-IP,PRO_RFIP_204,192.168.210.130,,,,,
PRO
,0,入料流水线1-托盘-RFID-IP,PRO_RFIP_101,192.168.210.101,,,,,
,0,入料流水线1-托盘-RFID-IP,PRO_RFIP_101,192.168.210.101,,,,,
PRO,0,入料流水线2-托盘-RFID-IP,PRO_RFIP_102,192.168.210.110,,,,,
PRO,0,入料流水线3-托盘-RFID-IP,PRO_RFIP_103,192.168.210.116,,,,,
PRO
,0,入料流水线4-托盘-RFID-IP,PRO_RFIP_104,192.168.210.117,,,,,
,0,入料流水线4-托盘-RFID-IP,PRO_RFIP_104,192.168.210.117,,,,,
PRO,0,入料流水线1-上料模块-RFID-IP,PRO_RFIP_101-1,192.168.210.102,,,,,
PRO,0,入料流水线2-上料模块-RFID-IP,PRO_RFIP_102-1,192.168.210.109,,,,,
PRO,0,入料流水线3-上料模块-RFID-IP,PRO_RFIP_103-1,192.168.210.115,,,,,
...
...
source/DeviceLibrary/assemblyLine/EquipBase.cs
查看文件 @
48ff972
...
...
@@ -29,7 +29,7 @@ namespace OnlineStore.DeviceLibrary
/// <summary>
/// 当前正在通过的托盘号
/// </summary>
protected
int
currTrayNum
=
0
;
internal
int
currTrayNum
=
0
;
/// <summary>
/// 升降轴
/// </summary>
...
...
source/DeviceLibrary/assemblyLine/FeedingEquip.cs
查看文件 @
48ff972
...
...
@@ -348,7 +348,7 @@ namespace OnlineStore.DeviceLibrary
StartOutStoreP
();
}
}
if
(
SecondMoveInfo
.
MoveType
.
Equals
(
LineMoveType
.
None
)
&&
alarmType
.
Equals
(
LineAlarmType
.
None
))
if
(
SecondMoveInfo
.
MoveType
.
Equals
(
LineMoveType
.
None
)
&&
(
isInSuddenDown
.
Equals
(
false
)&&
isNoAirCheck
.
Equals
(
false
)
))
{
StartCheckFixture
();
}
...
...
@@ -481,21 +481,21 @@ namespace OnlineStore.DeviceLibrary
IsInProcess
=
true
;
if
(
IOValue
(
TargetIoType
).
Equals
(
TargetIoValue
))
{
if
(!
isOk
)
{
isOk
=
true
;
lastOkTime
=
DateTime
.
Now
;
}
else
{
TimeSpan
span
=
DateTime
.
Now
-
lastOkTime
;
if
(
span
.
TotalMilliseconds
>
2
00
)
//
if (!isOk)
//
{
//
isOk = true;
//
lastOkTime = DateTime.Now;
//
}
//
else
//
{
//
TimeSpan span = DateTime.Now - lastOkTime;
//if (span.TotalMilliseconds > 1
00)
{
LogUtil
.
info
(
Name
+
"上料轴,检测到 "
+
TargetIoType
+
"="
+
TargetIoValue
+
",可以停止运动"
);
BatchAxis
.
SuddenStop
();
BatchAxisStopCheck
();
}
}
//
}
}
else
...
...
source/DeviceLibrary/assemblyLine/FeedingEquip_InStore.cs
查看文件 @
48ff972
...
...
@@ -47,15 +47,17 @@ namespace OnlineStore.DeviceLibrary
{
return
;
}
if
(
Config
.
SidesWayNum
>
0
)
{
int
num
=
TrayManager
.
GetTrayNum
(
DeviceID
);
bool
isTestNeed
=
(
LineManager
.
Line
.
runStatus
<=
LineRunStatus
.
Wait
);
bool
isNeedTray
=
(
num
>
0
)
&&
(
LineManager
.
Line
.
SwNoProcess
(
Config
.
SidesWayNum
));
bool
isNeedTray
=
(
LineManager
.
Line
.
SwNoProcess
(
Config
.
SidesWayNum
));
if
(
IOValue
(
IO_Type
.
SW_TrayCheck
).
Equals
(
IO_VALUE
.
HIGH
)
&&
(
isTestNeed
||
isNeedTray
))
{
int
num
=
TrayManager
.
GetTrayNum
(
DeviceID
);
//判断是否是需要的托盘
if
(
CurrTrayIsNeed
(
true
))
if
(
CurrTrayIsNeed
(
num
,
true
))
{
SecondMoveInfo
.
NewMove
(
LineMoveType
.
CheckFixture
,
CheckParam
);
TrayManager
.
UpdateSWState
(
Config
.
SidesWayNum
,
2
);
...
...
@@ -64,38 +66,41 @@ namespace OnlineStore.DeviceLibrary
CylinderMove
(
SecondMoveInfo
,
IO_Type
.
SW_TopCylinder_Down
,
IO_Type
.
SW_TopCylinder_Up
);
}
else
{
preTrayNum
=
num
;
{
preTrayNum
=
currTrayNum
;
currTrayNum
=
num
;
TrayManager
.
UpdateSWState
(
Config
.
SidesWayNum
,
1
);
}
}
else
if
(
Config
.
SidesWayNum
.
Equals
(
2
)
&&
IOValue
(
IO_Type
.
SW_StopCheck
).
Equals
(
IO_VALUE
.
HIGH
)
&&
(
isTestNeed
||
isNeedTray
))
{
//判断是否是需要的托盘
if
(
CurrTrayIsNeed
(
true
))
{
//
//
判断是否是需要的托盘
//if (CurrTrayIsNeed(num,
true))
//
{
SecondMoveInfo
.
NewMove
(
LineMoveType
.
CheckFixture
,
CheckParam
);
TrayManager
.
UpdateSWState
(
Config
.
SidesWayNum
,
2
);
CheckLog
(
"检测到SW_StopCheck:"
+
SecondMoveInfo
.
SLog
+
"阻挡气缸下降 ,最多等待1秒"
);
SecondMoveInfo
.
NextMoveStep
(
LineMoveStep
.
MIO_01_StopCylinder1Down
);
IOMove
(
IO_Type
.
SW_StopDown
,
IO_VALUE
.
HIGH
);
SecondMoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitIO
(
IO_Type
.
SW_StopDown
,
IO_VALUE
.
HIGH
));
SecondMoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitTime
(
1500
));
}
else
{
preTrayNum
=
num
;
TrayManager
.
UpdateSWState
(
Config
.
SidesWayNum
,
1
);
}
SecondMoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitTime
(
1000
));
//}
//else
//{
// preTrayNum = currTrayNum;
// currTrayNum = num;
// TrayManager.UpdateSWState(Config.SidesWayNum, 1);
//}
}
}
else
{
if
(
IOValue
(
IO_Type
.
FL_TrayCheck
).
Equals
(
IO_VALUE
.
HIGH
)
||
IOValue
(
IO_Type
.
FL_StopCheck
).
Equals
(
IO_VALUE
.
HIGH
))
{
int
num
=
TrayManager
.
GetTrayNum
(
DeviceID
);
//
int num = TrayManager.GetTrayNum(DeviceID);
//托盘在两个阻挡内
if
(
num
>
0
&&
IOValue
(
IO_Type
.
FL_TrayCheck
).
Equals
(
IO_VALUE
.
HIGH
))
if
(
IOValue
(
IO_Type
.
FL_TrayCheck
).
Equals
(
IO_VALUE
.
HIGH
))
{
SecondMoveInfo
.
NewMove
(
LineMoveType
.
CheckFixture
);
CheckLog
(
"检测到FL_TrayCheck:"
+
SecondMoveInfo
.
SLog
+
" FL阻挡1上升)"
);
...
...
@@ -111,7 +116,7 @@ namespace OnlineStore.DeviceLibrary
CheckLog
(
" 检测到FL_StopCheck:"
+
SecondMoveInfo
.
SLog
+
" FL阻挡1下降 ,最多等待1秒)"
);
IOMove
(
IO_Type
.
FL_StopCylinder_Down1
,
IO_VALUE
.
HIGH
);
SecondMoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitIO
(
IO_Type
.
FL_StopCylinder_Down1
,
IO_VALUE
.
HIGH
));
SecondMoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitTime
(
1
5
00
));
SecondMoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitTime
(
1
0
00
));
}
}
}
...
...
@@ -170,7 +175,7 @@ namespace OnlineStore.DeviceLibrary
currTrayNum
=
TrayManager
.
GetTrayNum
(
DeviceID
);
//出料中,需要拦盘
if
(
CurrTrayIsNeed
(
true
))
if
(
CurrTrayIsNeed
(
currTrayNum
,
true
))
{
SecondMoveInfo
.
MoveParam
=
CheckParam
;
SecondMoveInfo
.
NextMoveStep
(
LineMoveStep
.
MIO_06_TopCylinderUp
);
...
...
@@ -397,7 +402,9 @@ namespace OnlineStore.DeviceLibrary
{
//定位工位有料架,等待1秒后再次检测
MoveInfo
.
NextMoveStep
(
LineMoveStep
.
FI_04_WaitTime
);
InLog
(
"定位工位检测到料架: "
+
MoveInfo
.
SLog
+
" 等待1秒再次检测"
);
InLog
(
"定位工位检测到料架: "
+
MoveInfo
.
SLog
+
",进料阻挡上升,缓冲阻挡上升, 等待1秒再次检测"
);
IOMove
(
IO_Type
.
SL_Entry_StopDown
,
IO_VALUE
.
LOW
);
IOMove
(
IO_Type
.
SL_Buffer_StopDown
,
IO_VALUE
.
LOW
);
MoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitTime
(
1000
));
}
...
...
@@ -609,7 +616,7 @@ namespace OnlineStore.DeviceLibrary
{
InLog
(
"料盘移栽"
+
MoveInfo
.
SLog
+
":记录高度尺寸 高度【"
+
LastHeight
+
"】宽度【"
+
LastWidth
+
"】,已经没有料盘,提升轴开始回下降待机点P2"
);
MoveInfo
.
ShelfNoTray
=
true
;
BatchAxis
.
AbsMove
(
MoveInfo
,
Config
.
BatchAxisP2
,
Config
.
BatchAxis_P2Speed
);
BatchAxis
.
AbsMove
(
null
,
Config
.
BatchAxisP2
,
Config
.
BatchAxis_P2Speed
);
}
else
{
...
...
@@ -837,7 +844,7 @@ namespace OnlineStore.DeviceLibrary
StartMovePosition
=
BatchAxis
.
GetAclPosition
();
MoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitBatchAxis
(
Config
.
Batch_Axis
,
Config
.
BatchAxisP3
,
Config
.
BatchAxis_P3Speed
));
Config
.
Batch_Axis
.
TargetPosition
=
Config
.
BatchAxisP3
;
BatchAxis
.
AbsMove
(
MoveInfo
,
Config
.
BatchAxisP3
,
Config
.
BatchAxis_P3Speed
);
BatchAxis
.
AbsMove
(
null
,
Config
.
BatchAxisP3
,
Config
.
BatchAxis_P3Speed
);
//开始检测信号
BatchAxisStartCheck
();
}
...
...
@@ -895,12 +902,8 @@ namespace OnlineStore.DeviceLibrary
}
#
endregion
/// <summary>
/// 是否需要拦截当前托盘进行处理
/// </summary>
/// <returns></returns>
internal
bool
CurrTrayIsNeed
(
bool
NeedSaveParam
)
internal
bool
CurrTrayIsNeed
(
int
trayNum
,
bool
NeedSaveParam
)
{
try
{
...
...
@@ -908,8 +911,10 @@ namespace OnlineStore.DeviceLibrary
{
return
false
;
}
int
trayNum
=
TrayManager
.
GetTrayNum
(
Config
.
Id
);
if
(
trayNum
<=
0
)
{
return
false
;
}
TrayInfo
info
=
TrayManager
.
GetTrayInfo
(
trayNum
);
InOutParam
param
=
new
InOutParam
(
trayNum
,
info
.
WareCode
,
info
.
PosId
,
info
.
PlateH
,
info
.
PlateW
);
...
...
@@ -917,7 +922,7 @@ namespace OnlineStore.DeviceLibrary
if
(
Config
.
IsCanOut
.
Equals
(
1
))
{
//此托盘是紧急出料盘,需要通过料架出库
bool
debugNeed
=
IsDebug
&&
runStatus
>=
LineRunStatus
.
Runing
;
bool
debugNeed
=
IsDebug
&&
runStatus
>=
LineRunStatus
.
Runing
&&
info
.
IsFull
&&
info
.
InOrOutStore
.
Equals
(
2
)
;
if
(
info
.
PosId
.
Equals
(
""
))
{
param
=
new
InOutParam
(
trayNum
,
"紧急出料测试"
,
"1#AC1_3_2"
,
12
,
7
);
...
...
@@ -964,11 +969,16 @@ namespace OnlineStore.DeviceLibrary
}
}
}
if
(
NeedSaveParam
)
{
LogInfo
(
" 托盘【"
+
info
.
ToStr
()
+
"】不需要出入库"
);
}
}
catch
(
Exception
ex
)
{
LogUtil
.
error
(
Name
+
"CurrTrayIsNeed出错:"
+
ex
.
StackTrace
);
}
return
false
;
}
...
...
source/DeviceLibrary/assemblyLine/FeedingEquip_OutStore.cs
查看文件 @
48ff972
...
...
@@ -82,8 +82,10 @@ namespace OnlineStore.DeviceLibrary
{
//定位工位有料架,等待1秒后再次检测
MoveInfo
.
NextMoveStep
(
LineMoveStep
.
FO_04_WaitTime
);
OutLog
(
"准备出库料架 "
+
MoveInfo
.
SLog
+
"定位工位检测到料架:进料阻挡上升, 等待1秒再次检测"
);
IOMove
(
IO_Type
.
SL_Buffer_StopDown
,
IO_VALUE
.
LOW
);
OutLog
(
"准备出库料架 "
+
MoveInfo
.
SLog
+
"定位工位检测到料架: 等待1秒再次检测"
);
IOMove
(
IO_Type
.
SL_Entry_StopDown
,
IO_VALUE
.
LOW
);
MoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitTime
(
1000
));
}
private
void
LineOutStoreProcess
()
...
...
@@ -163,7 +165,7 @@ namespace OnlineStore.DeviceLibrary
//定位工位有料架,直接开始入料
MoveInfo
.
NextMoveStep
(
LineMoveStep
.
FO_05_LocationCylinder_Up
);
OutLog
(
"定位工位检测到料架: "
+
MoveInfo
.
SLog
+
" 缓冲阻挡下降, 定位气缸上升"
);
IOMove
(
IO_Type
.
SL_Buffer_StopDown
,
IO_VALUE
.
LOW
);
//缓冲阻挡下降
IOMove
(
IO_Type
.
SL_Buffer_StopDown
,
IO_VALUE
.
LOW
);
//缓冲阻挡下降
CylinderMove
(
MoveInfo
,
IO_Type
.
SL_LocationCylinder_Down
,
IO_Type
.
SW4_LocationCylinder_Up
);
}
else
...
...
@@ -228,7 +230,7 @@ namespace OnlineStore.DeviceLibrary
MoveInfo
.
CanWhileCount
=
0
;
MoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitBatchAxis
(
Config
.
Batch_Axis
,
tp
,
Config
.
BatchAxis_P3Speed
));
Config
.
Batch_Axis
.
TargetPosition
=
tp
;
BatchAxis
.
AbsMove
(
MoveInfo
,
tp
,
Config
.
BatchAxis_P3Speed
);
BatchAxis
.
AbsMove
(
null
,
tp
,
Config
.
BatchAxis_P3Speed
);
//开始检测信号
BatchAxisStartCheck
(
IO_Type
.
SL_AxisLocationCheck
,
IO_VALUE
.
LOW
);
}
...
...
source/DeviceLibrary/assemblyLine/LineBean.cs
查看文件 @
48ff972
...
...
@@ -47,6 +47,7 @@ namespace OnlineStore.DeviceLibrary
#
region
初始化
public
List
<
string
>
cioList
=
new
List
<
string
>(
);
public
List
<
string
>
rfidList
=
new
List
<
string
>();
private
bool
canStart
=
false
;
public
LineBean
(
Line_Config
lineConfig
,
Dictionary
<
int
,
MoveEquip_Config
>
configList
,
Dictionary
<
int
,
FeedingEquip_Config
>
feedMap
,
...
...
@@ -120,8 +121,13 @@ namespace OnlineStore.DeviceLibrary
cioList
=
new
List
<
string
>(
ioList
);
string
ids
=
ConfigAppSettings
.
GetValue
(
Setting_Init
.
DebugDeviceId
);
rfidList
=
new
List
<
string
>(
DeviceConfig
.
ProRFIpMap
.
Values
);
if
(
IsDebug
)
{
rfidList
=
new
List
<
string
>()
{
"192.168.210.116"
,
"192.168.210.120"
,
"192.168.210.121"
};
try
{
cioList
=
new
List
<
string
>();
...
...
@@ -177,11 +183,11 @@ namespace OnlineStore.DeviceLibrary
{
IOManager
.
instance
.
ConnectionIOList
(
cioList
);
Thread
.
Sleep
(
5
);
//
if (!IsDebug)
if
(!
IsDebug
)
{
Task
.
Factory
.
StartNew
(
delegate
{
string
[]
rfidArray
=
new
List
<
string
>(
DeviceConfig
.
ProRFIpMap
.
Values
)
.
ToArray
();
string
[]
rfidArray
=
rfidList
.
ToArray
();
//连接rfip
TrayManager
.
RfidReader
.
Open
(
rfidArray
);
});
...
...
@@ -267,6 +273,12 @@ namespace OnlineStore.DeviceLibrary
}
else
{
ledProcessTimer
.
Enabled
=
false
;
IoCheckTimer
.
Enabled
=
false
;
mainTimer
.
Enabled
=
false
;
lineStatus
=
LineStatus
.
ResetMove
;
runStatus
=
LineRunStatus
.
HomeMoving
;
StartTime
=
DateTime
.
Now
;
LogUtil
.
info
(
Name
+
"开始启动,启动时间:"
+
StartTime
.
ToString
());
//连接AGV调度
...
...
@@ -274,9 +286,6 @@ namespace OnlineStore.DeviceLibrary
{
AgvClient
.
Init
();
}
lineStatus
=
LineStatus
.
ResetMove
;
runStatus
=
LineRunStatus
.
HomeMoving
;
StartTime
=
DateTime
.
Now
;
LineServer
.
StartServer
(
ConfigAppSettings
.
GetIntValue
(
Setting_Init
.
TCPServerPort
));
RHomeOp
();
...
...
@@ -306,6 +315,7 @@ namespace OnlineStore.DeviceLibrary
}
private
void
RHomeOp
()
{
TrayManager
.
SidesWayStateMap
=
new
System
.
Collections
.
Concurrent
.
ConcurrentDictionary
<
int
,
int
>()
;
alarmType
=
LineAlarmType
.
None
;
mainTimer
.
Enabled
=
false
;
...
...
@@ -912,6 +922,7 @@ namespace OnlineStore.DeviceLibrary
//所有原点重置完成
runStatus
=
LineRunStatus
.
Runing
;
lineStatus
=
LineStatus
.
StoreOnline
;
MoveInfo
.
EndMove
();
LogUtil
.
info
(
Name
+
"所有设备重置完成,打开流水线,开始运转!"
);
}
}
...
...
@@ -921,13 +932,13 @@ namespace OnlineStore.DeviceLibrary
public
string
GetMoveStr
()
{
string
msg
=
""
;
// int tLength = 20;
//msg += "preTrayNum:".PadRight(tLength, ' ') + pre
TrayNum + "\n";
//msg += "currTrayNum:".PadRight(tLength, ' ') + curr
TrayNum + "\n";
// int tLength = 20;
msg
+=
"Sw41TrayNum: "
+
Sw41
TrayNum
+
"\n"
;
msg
+=
"Sw23TrayNum:"
+
Sw23
TrayNum
+
"\n"
;
msg
+=
"runStatus: "
+
runStatus
+
"\n"
;
msg
+=
"lineStatus: "
+
lineStatus
+
"\n"
;
msg
+=
"MoveType: "
+
MoveInfo
.
MoveType
+
"\n"
;
msg
+=
"lineStatus:
"
+
lineStatus
+
"\n"
;
msg
+=
"MoveType:
"
+
MoveInfo
.
MoveType
+
"\n"
;
msg
+=
"MoveStep: "
+
MoveInfo
.
SLog
+
"\n"
;
msg
+=
"SW41_Move: "
+
SW41_MoveInfo
.
MoveType
+
" "
+
SW41_MoveInfo
.
MoveStep
+
"\n"
;
msg
+=
"SW23_Move: "
+
SW23_MoveInfo
.
MoveType
+
" "
+
SW23_MoveInfo
.
MoveStep
+
"\n"
;
...
...
source/DeviceLibrary/assemblyLine/LineBean_Partial.cs
查看文件 @
48ff972
此文件的差异被折叠,
点击展开。
source/DeviceLibrary/assemblyLine/MoveEquip_Partial.cs
查看文件 @
48ff972
...
...
@@ -473,7 +473,7 @@ namespace OnlineStore.DeviceLibrary
bool
isNeed
=
false
;
//此处先对托盘号进行验证
preTrayNum
=
currTrayNum
;
currTrayNum
=
TrayManager
.
GetTrayNum
(
DeviceID
);
currTrayNum
=
TrayManager
.
GetTrayNum
(
DeviceID
,
true
);
bool
isFull
=
TrayManager
.
TrayIsFull
(
currTrayNum
);
if
(
TrayManager
.
RightTrayCode
(
currTrayNum
,
preTrayNum
,
false
))
{
...
...
source/DeviceLibrary/assemblyLine/ProvidingEquip_Partial.cs
查看文件 @
48ff972
...
...
@@ -31,11 +31,11 @@ namespace OnlineStore.DeviceLibrary
private
void
StartCheckFixture
()
{
int
num
=
TrayManager
.
GetTrayNum
(
DeviceID
);
//int num = TrayManager.GetTrayNum(DeviceID);
if
(
IOValue
(
IO_Type
.
StopCylinder_Check2
).
Equals
(
IO_VALUE
.
HIGH
))
{
//托盘在两个阻挡内
if
(
num
>
0
&&
LineManager
.
Line
.
SwNoProcess
(
Config
.
SidesWayNum
))
if
(
LineManager
.
Line
.
SwNoProcess
(
Config
.
SidesWayNum
))
{
TrayManager
.
UpdateSWState
(
Config
.
SidesWayNum
,
2
);
SecondMoveInfo
.
NewMove
(
LineMoveType
.
CheckFixture
);
...
...
@@ -104,7 +104,7 @@ namespace OnlineStore.DeviceLibrary
{
//此处先对托盘号进行验证
preTrayNum
=
currTrayNum
;
currTrayNum
=
TrayManager
.
GetTrayNum
(
DeviceID
);
currTrayNum
=
TrayManager
.
GetTrayNum
(
DeviceID
,
true
);
if
(
TrayManager
.
RightTrayCode
(
currTrayNum
,
preTrayNum
,
false
))
{
if
(
TrayManager
.
ErrorDeviceId
.
Equals
(
DeviceID
))
...
...
source/DeviceLibrary/assemblymanager/TrayManager.cs
查看文件 @
48ff972
...
...
@@ -173,25 +173,44 @@ namespace OnlineStore.DeviceLibrary
TrayErrorMsg
=
errorMsg
;
ErrorDeviceId
=
errorStoreID
;
}
public
static
void
ClearTrayInfo
()
{
TrayInfoMap
=
new
ConcurrentDictionary
<
int
,
TrayInfo
>();
}
/// <summary>
/// 获取托盘编码
/// </summary>
public
static
int
GetTrayNum
(
int
subType
)
public
static
int
GetTrayNum
(
int
subType
,
bool
isClear
=
false
)
{
return
9
;
if
(
subType
.
Equals
(
104
))
{
return
LineManager
.
Line
.
Sw23TrayNum
;
}
else
if
(
subType
.
Equals
(
101
))
{
return
LineManager
.
Line
.
Sw41TrayNum
;
}
string
ip
=
GetRFIP
(
subType
);
//获取盘号
RFIDData
data
=
ReadRFID
(
ip
);
if
(
data
!=
null
)
{
if
(
data
.
RFType
.
Equals
(
"E"
))
if
(
data
.
RFType
.
Equals
(
(
byte
)
'E'
))
{
return
data
.
Num
;
}
else
{
LogUtil
.
error
(
"读取托盘RFID["
+
subType
+
"]["
+
ip
+
"]的数据出错:"
+
data
.
ToStr
());
}
return
0
;
//else
//{
// LogUtil.error("读取托盘RFID[" + subType + "][" + ip + "]的数据出错:" + data.ToStr());
//}
}
if
(
isClear
)
{
RfidReader
.
Clear
(
ip
);
}
return
0
;
}
...
...
@@ -206,21 +225,24 @@ namespace OnlineStore.DeviceLibrary
{
try
{
//获取盘号
byte
[]
data
=
RfidReader
.
Read
(
ip
);
if
(
data
!=
null
&&
data
.
Length
>=
2
)
if
(
String
.
IsNullOrEmpty
(
ip
).
Equals
(
false
)&&
LineManager
.
Line
.
rfidList
.
Contains
(
ip
))
{
RFIDData
d
=
new
RFIDData
(
data
);
return
d
;
//获取盘号
byte
[]
data
=
RfidReader
.
Read
(
ip
);
if
(
data
!=
null
&&
data
.
Length
>=
2
)
{
RFIDData
d
=
new
RFIDData
(
data
);
return
d
;
}
}
}
catch
(
Exception
ex
)
{
//LogUtil.error("ReadRFID["+ip+"]出错:" + ex.ToString());
}
return
new
RFIDData
(-
1
,
'X'
);
return
new
RFIDData
(-
1
,
-
1
);
}
p
ublic
static
string
GetRFIP
(
int
subType
,
int
rtType
=
0
)
p
rivate
static
string
GetRFIP
(
int
subType
,
int
rtType
=
0
)
{
string
ip
=
""
;
string
rtName
=
DeviceConfig
.
RFIP_Str
+
"_"
+
subType
.
ToString
().
PadLeft
(
3
,
'0'
);
...
...
@@ -238,25 +260,30 @@ namespace OnlineStore.DeviceLibrary
#
region
横移状态缓存
internal
static
ConcurrentDictionary
<
int
,
int
>
SidesWayStateMap
=
new
ConcurrentDictionary
<
int
,
int
>();
internal
static
bool
CanMoveSidesWay
(
int
swNum
)
internal
static
int
GetSwStatus
(
int
swNum
)
{
int
status
=
0
;
if
(
SidesWayStateMap
.
ContainsKey
(
swNum
))
{
status
=
SidesWayStateMap
[
swNum
];
if
(
SidesWayStateMap
[
swNum
].
Equals
(
1
))
return
SidesWayStateMap
[
swNum
];
}
return
0
;
}
internal
static
bool
CanMoveSidesWay
(
int
swNum
)
{
int
status
=
GetSwStatus
(
swNum
);
if
(
status
.
Equals
(
1
))
{
return
true
;
}
else
if
(
swNum
.
Equals
(
1
)
||
swNum
.
Equals
(
3
))
{
if
(
SidesWayStateMap
[
swNum
]
.
Equals
(
0
))
if
(
status
.
Equals
(
0
))
{
return
true
;
}
}
}
//若此横移对应的设备未启动,直接可处理
foreach
(
FeedingEquip
equip
in
LineManager
.
Line
.
FeedingEquipMap
.
Values
)
{
...
...
@@ -307,6 +334,8 @@ namespace OnlineStore.DeviceLibrary
SidesWayStateMap
.
TryAdd
(
swNum
,
value
);
}
}
#
endregion
}
...
...
@@ -314,15 +343,15 @@ namespace OnlineStore.DeviceLibrary
public
class
RFIDData
{
/// <summary>
/// RFID类型,区分是料架还是托盘,托盘
=E
/// RFID类型,区分是料架还是托盘,托盘
E=69,A=65
/// </summary>
public
char
RFType
=
'E'
;
public
int
RFType
=
0
;
/// <summary>
/// 托盘编号,从1-32
/// </summary>
public
int
Num
=
0
;
public
RFIDData
(
int
num
,
char
t
=
'E'
)
public
RFIDData
(
int
num
,
int
t
)
{
this
.
RFType
=
t
;
this
.
Num
=
num
;
...
...
@@ -332,8 +361,8 @@ namespace OnlineStore.DeviceLibrary
{
try
{
RFType
=
(
char
)
data
[
0
];
Num
=
Convert
.
ToInt32
(
data
[
1
]);
RFType
=
data
[
1
];
Num
=
Convert
.
ToInt32
(
data
[
2
]);
}
catch
(
Exception
ex
)
{
...
...
source/DeviceLibrary/deviceLibrary/IO/AIOBOX/AIOBOXManager.cs
查看文件 @
48ff972
...
...
@@ -140,7 +140,7 @@ namespace OnlineStore.DeviceLibrary
aioBox
.
SetOutput
(
Asa
.
IOModule
.
Box_Type
.
DO
,
DOLength
);
//DI主动上传
aioBox
.
AutoReadInput
(
true
,
DIMS
);
aioBox
.
AutoReadOutput
(
tru
e
,
DOMS
);
aioBox
.
AutoReadOutput
(
fals
e
,
DOMS
);
aioBox
.
DI_Changed_Event
+=
AioBox_DI_Changed_Event
;
;
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论