Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
孙克
/
RC1250-AssemblyLine
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit cece86de
由
LN
编写于
2019-11-07 14:50:44 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
1
1 个父辈
6bb3f77f
显示空白字符变更
内嵌
并排
正在显示
17 个修改的文件
包含
557 行增加
和
333 行删除
RC1250-AssemblyLine.sln
source/AssemblyLineClient/FrmBase.cs
source/AssemblyLineClient/FrmLineStore.Designer.cs
source/AssemblyLineClient/FrmLineStore.cs
source/DeviceLibrary/assemblyLine/DischargeLine.cs
source/DeviceLibrary/assemblyLine/DischargeLine_Partial.cs
source/DeviceLibrary/assemblyLine/EquipBase.cs
source/DeviceLibrary/assemblyLine/FeedingEquip_Partial.cs
source/DeviceLibrary/assemblyLine/LineBean.cs
source/DeviceLibrary/assemblyLine/LineBean_Partial.cs
source/DeviceLibrary/assemblyLine/MoveEquip.cs
source/DeviceLibrary/assemblyLine/MoveEquip_Partial.cs
source/DeviceLibrary/assemblyLine/ProvidingEquip.cs
source/DeviceLibrary/assemblyLine/ProvidingEquip_Partial.cs
source/DeviceLibrary/assemblymanager/TrayManager.cs
source/DeviceLibrary/model/StoreStep.cs
source/DeviceLibrary/model/TrayInfo.cs
RC1250-AssemblyLine.sln
查看文件 @
cece86d
...
...
@@ -3,8 +3,6 @@ Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.27130.2024
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ACServoDriveTest", "source\ACServoDriveTest\ACServoDriveTest.csproj", "{7FA84E1E-BCDE-49F6-BE42-0BC397AF65B8}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Common", "source\Common\Common.csproj", "{43CDD09E-FCF3-4960-A01D-3BBFE9933122}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DeviceLibrary", "source\DeviceLibrary\DeviceLibrary.csproj", "{513BC1C9-800D-43A6-9499-3700BAEC3554}"
...
...
@@ -25,10 +23,6 @@ Global
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{7FA84E1E-BCDE-49F6-BE42-0BC397AF65B8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{7FA84E1E-BCDE-49F6-BE42-0BC397AF65B8}.Debug|Any CPU.Build.0 = Debug|Any CPU
{7FA84E1E-BCDE-49F6-BE42-0BC397AF65B8}.Release|Any CPU.ActiveCfg = Release|Any CPU
{7FA84E1E-BCDE-49F6-BE42-0BC397AF65B8}.Release|Any CPU.Build.0 = Release|Any CPU
{43CDD09E-FCF3-4960-A01D-3BBFE9933122}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{43CDD09E-FCF3-4960-A01D-3BBFE9933122}.Debug|Any CPU.Build.0 = Debug|Any CPU
{43CDD09E-FCF3-4960-A01D-3BBFE9933122}.Release|Any CPU.ActiveCfg = Release|Any CPU
...
...
source/AssemblyLineClient/FrmBase.cs
查看文件 @
cece86d
...
...
@@ -13,7 +13,7 @@ namespace OnlineStore.AssemblyLine
{
internal
partial
class
FrmBase
:
Form
{
internal
static
string
GetVersion
()
internal
static
string
GetVersion
(
bool
IsShow
=
false
)
{
string
str
=
""
;
string
version
=
""
;
...
...
@@ -38,7 +38,10 @@ namespace OnlineStore.AssemblyLine
str
=
version
;
LogUtil
.
error
(
"解析版本号【"
+
str
+
"】出错:"
+
ex
.
ToString
());
}
LogUtil
.
info
(
"版本号["
+
version
+
"]["
+
str
+
"]["
+
GetCodeNum
()+
"]"
);
if
(
IsShow
)
{
LogUtil
.
info
(
"版本号["
+
version
+
"]["
+
str
+
"]["
+
GetCodeNum
()
+
"]"
);
}
return
str
;
}
internal
static
string
GetCodeNum
(
string
codeName
=
"RC1250-AssemblyLine"
)
...
...
source/AssemblyLineClient/FrmLineStore.Designer.cs
查看文件 @
cece86d
...
...
@@ -66,6 +66,8 @@
this
.
扫码测试
ToolStripMenuItem
=
new
System
.
Windows
.
Forms
.
ToolStripMenuItem
();
this
.
toolStripSeparator6
=
new
System
.
Windows
.
Forms
.
ToolStripSeparator
();
this
.
二维码学习
ToolStripMenuItem
=
new
System
.
Windows
.
Forms
.
ToolStripMenuItem
();
this
.
toolStripSeparator7
=
new
System
.
Windows
.
Forms
.
ToolStripSeparator
();
this
.
托盘初始化
ToolStripMenuItem
=
new
System
.
Windows
.
Forms
.
ToolStripMenuItem
();
this
.
帮助
ToolStripMenuItem
=
new
System
.
Windows
.
Forms
.
ToolStripMenuItem
();
this
.
版本号
ToolStripMenuItem
=
new
System
.
Windows
.
Forms
.
ToolStripMenuItem
();
this
.
notifyIcon1
=
new
System
.
Windows
.
Forms
.
NotifyIcon
(
this
.
components
);
...
...
@@ -74,8 +76,6 @@
this
.
toolStripMenuItem1
=
new
System
.
Windows
.
Forms
.
ToolStripMenuItem
();
this
.
timer1
=
new
System
.
Windows
.
Forms
.
Timer
(
this
.
components
);
this
.
listView1
=
new
System
.
Windows
.
Forms
.
ListView
();
this
.
toolStripSeparator7
=
new
System
.
Windows
.
Forms
.
ToolStripSeparator
();
this
.
托盘初始化
ToolStripMenuItem
=
new
System
.
Windows
.
Forms
.
ToolStripMenuItem
();
this
.
tabControl1
.
SuspendLayout
();
this
.
tabPage1
.
SuspendLayout
();
this
.
groupBox1
.
SuspendLayout
();
...
...
@@ -318,9 +318,9 @@
|
System
.
Windows
.
Forms
.
AnchorStyles
.
Right
)));
this
.
lblWarnMsg
.
Font
=
new
System
.
Drawing
.
Font
(
"微软雅黑"
,
10.5F
,
System
.
Drawing
.
FontStyle
.
Regular
,
System
.
Drawing
.
GraphicsUnit
.
Point
,
((
byte
)(
134
)));
this
.
lblWarnMsg
.
ForeColor
=
System
.
Drawing
.
Color
.
Red
;
this
.
lblWarnMsg
.
Location
=
new
System
.
Drawing
.
Point
(
261
,
4
);
this
.
lblWarnMsg
.
Location
=
new
System
.
Drawing
.
Point
(
307
,
4
);
this
.
lblWarnMsg
.
Name
=
"lblWarnMsg"
;
this
.
lblWarnMsg
.
Size
=
new
System
.
Drawing
.
Size
(
14
91
,
69
);
this
.
lblWarnMsg
.
Size
=
new
System
.
Drawing
.
Size
(
14
45
,
69
);
this
.
lblWarnMsg
.
TabIndex
=
96
;
this
.
lblWarnMsg
.
TextAlign
=
System
.
Drawing
.
ContentAlignment
.
MiddleCenter
;
//
...
...
@@ -358,61 +358,61 @@
// toolStripSeparator1
//
this
.
toolStripSeparator1
.
Name
=
"toolStripSeparator1"
;
this
.
toolStripSeparator1
.
Size
=
new
System
.
Drawing
.
Size
(
1
77
,
6
);
this
.
toolStripSeparator1
.
Size
=
new
System
.
Drawing
.
Size
(
1
41
,
6
);
//
// 启动AToolStripMenuItem
//
this
.
启动
AToolStripMenuItem
.
Name
=
"启动AToolStripMenuItem"
;
this
.
启动
AToolStripMenuItem
.
Size
=
new
System
.
Drawing
.
Size
(
1
80
,
26
);
this
.
启动
AToolStripMenuItem
.
Size
=
new
System
.
Drawing
.
Size
(
1
44
,
26
);
this
.
启动
AToolStripMenuItem
.
Text
=
"启动 "
;
this
.
启动
AToolStripMenuItem
.
Click
+=
new
System
.
EventHandler
(
this
.
启动所有料仓
AToolStripMenuItem_Click
);
//
// toolStripSeparator4
//
this
.
toolStripSeparator4
.
Name
=
"toolStripSeparator4"
;
this
.
toolStripSeparator4
.
Size
=
new
System
.
Drawing
.
Size
(
1
77
,
6
);
this
.
toolStripSeparator4
.
Size
=
new
System
.
Drawing
.
Size
(
1
41
,
6
);
//
// 复位RToolStripMenuItem
//
this
.
复位
RToolStripMenuItem
.
Name
=
"复位RToolStripMenuItem"
;
this
.
复位
RToolStripMenuItem
.
Size
=
new
System
.
Drawing
.
Size
(
1
80
,
26
);
this
.
复位
RToolStripMenuItem
.
Size
=
new
System
.
Drawing
.
Size
(
1
44
,
26
);
this
.
复位
RToolStripMenuItem
.
Text
=
"复位"
;
this
.
复位
RToolStripMenuItem
.
Click
+=
new
System
.
EventHandler
(
this
.
复位
RToolStripMenuItem_Click
);
//
// toolStripSeparator3
//
this
.
toolStripSeparator3
.
Name
=
"toolStripSeparator3"
;
this
.
toolStripSeparator3
.
Size
=
new
System
.
Drawing
.
Size
(
1
77
,
6
);
this
.
toolStripSeparator3
.
Size
=
new
System
.
Drawing
.
Size
(
1
41
,
6
);
//
// 停止TToolStripMenuItem
//
this
.
停止
TToolStripMenuItem
.
Name
=
"停止TToolStripMenuItem"
;
this
.
停止
TToolStripMenuItem
.
Size
=
new
System
.
Drawing
.
Size
(
1
80
,
26
);
this
.
停止
TToolStripMenuItem
.
Size
=
new
System
.
Drawing
.
Size
(
1
44
,
26
);
this
.
停止
TToolStripMenuItem
.
Text
=
"停止"
;
this
.
停止
TToolStripMenuItem
.
Click
+=
new
System
.
EventHandler
(
this
.
停止所有料仓
TToolStripMenuItem_Click
);
//
// toolStripSeparator5
//
this
.
toolStripSeparator5
.
Name
=
"toolStripSeparator5"
;
this
.
toolStripSeparator5
.
Size
=
new
System
.
Drawing
.
Size
(
1
77
,
6
);
this
.
toolStripSeparator5
.
Size
=
new
System
.
Drawing
.
Size
(
1
41
,
6
);
//
// 入库模式ToolStripMenuItem
//
this
.
入库模式
ToolStripMenuItem
.
Name
=
"入库模式ToolStripMenuItem"
;
this
.
入库模式
ToolStripMenuItem
.
Size
=
new
System
.
Drawing
.
Size
(
1
80
,
26
);
this
.
入库模式
ToolStripMenuItem
.
Size
=
new
System
.
Drawing
.
Size
(
1
44
,
26
);
this
.
入库模式
ToolStripMenuItem
.
Text
=
"入库模式"
;
this
.
入库模式
ToolStripMenuItem
.
Visible
=
false
;
//
// toolStripSeparator2
//
this
.
toolStripSeparator2
.
Name
=
"toolStripSeparator2"
;
this
.
toolStripSeparator2
.
Size
=
new
System
.
Drawing
.
Size
(
1
77
,
6
);
this
.
toolStripSeparator2
.
Size
=
new
System
.
Drawing
.
Size
(
1
41
,
6
);
this
.
toolStripSeparator2
.
Visible
=
false
;
//
// 退出ToolStripMenuItem
//
this
.
退出
ToolStripMenuItem
.
Name
=
"退出ToolStripMenuItem"
;
this
.
退出
ToolStripMenuItem
.
Size
=
new
System
.
Drawing
.
Size
(
1
80
,
26
);
this
.
退出
ToolStripMenuItem
.
Size
=
new
System
.
Drawing
.
Size
(
1
44
,
26
);
this
.
退出
ToolStripMenuItem
.
Text
=
"退出"
;
this
.
退出
ToolStripMenuItem
.
Click
+=
new
System
.
EventHandler
(
this
.
退出
ToolStripMenuItem_Click_1
);
//
...
...
@@ -431,22 +431,34 @@
// 扫码测试ToolStripMenuItem
//
this
.
扫码测试
ToolStripMenuItem
.
Name
=
"扫码测试ToolStripMenuItem"
;
this
.
扫码测试
ToolStripMenuItem
.
Size
=
new
System
.
Drawing
.
Size
(
1
8
0
,
26
);
this
.
扫码测试
ToolStripMenuItem
.
Size
=
new
System
.
Drawing
.
Size
(
1
6
0
,
26
);
this
.
扫码测试
ToolStripMenuItem
.
Text
=
"扫码测试"
;
this
.
扫码测试
ToolStripMenuItem
.
Click
+=
new
System
.
EventHandler
(
this
.
扫码测试
ToolStripMenuItem_Click
);
//
// toolStripSeparator6
//
this
.
toolStripSeparator6
.
Name
=
"toolStripSeparator6"
;
this
.
toolStripSeparator6
.
Size
=
new
System
.
Drawing
.
Size
(
1
7
7
,
6
);
this
.
toolStripSeparator6
.
Size
=
new
System
.
Drawing
.
Size
(
1
5
7
,
6
);
//
// 二维码学习ToolStripMenuItem
//
this
.
二维码学习
ToolStripMenuItem
.
Name
=
"二维码学习ToolStripMenuItem"
;
this
.
二维码学习
ToolStripMenuItem
.
Size
=
new
System
.
Drawing
.
Size
(
1
8
0
,
26
);
this
.
二维码学习
ToolStripMenuItem
.
Size
=
new
System
.
Drawing
.
Size
(
1
6
0
,
26
);
this
.
二维码学习
ToolStripMenuItem
.
Text
=
"二维码学习"
;
this
.
二维码学习
ToolStripMenuItem
.
Click
+=
new
System
.
EventHandler
(
this
.
二维码学习
ToolStripMenuItem_Click
);
//
// toolStripSeparator7
//
this
.
toolStripSeparator7
.
Name
=
"toolStripSeparator7"
;
this
.
toolStripSeparator7
.
Size
=
new
System
.
Drawing
.
Size
(
157
,
6
);
//
// 托盘初始化ToolStripMenuItem
//
this
.
托盘初始化
ToolStripMenuItem
.
Name
=
"托盘初始化ToolStripMenuItem"
;
this
.
托盘初始化
ToolStripMenuItem
.
Size
=
new
System
.
Drawing
.
Size
(
160
,
26
);
this
.
托盘初始化
ToolStripMenuItem
.
Text
=
"托盘编码"
;
this
.
托盘初始化
ToolStripMenuItem
.
Click
+=
new
System
.
EventHandler
(
this
.
托盘初始化
ToolStripMenuItem_Click
);
//
// 帮助ToolStripMenuItem
//
this
.
帮助
ToolStripMenuItem
.
DropDownItems
.
AddRange
(
new
System
.
Windows
.
Forms
.
ToolStripItem
[]
{
...
...
@@ -515,18 +527,6 @@
this
.
listView1
.
View
=
System
.
Windows
.
Forms
.
View
.
Details
;
this
.
listView1
.
SelectedIndexChanged
+=
new
System
.
EventHandler
(
this
.
listView1_SelectedIndexChanged
);
//
// toolStripSeparator7
//
this
.
toolStripSeparator7
.
Name
=
"toolStripSeparator7"
;
this
.
toolStripSeparator7
.
Size
=
new
System
.
Drawing
.
Size
(
177
,
6
);
//
// 托盘初始化ToolStripMenuItem
//
this
.
托盘初始化
ToolStripMenuItem
.
Name
=
"托盘初始化ToolStripMenuItem"
;
this
.
托盘初始化
ToolStripMenuItem
.
Size
=
new
System
.
Drawing
.
Size
(
180
,
26
);
this
.
托盘初始化
ToolStripMenuItem
.
Text
=
"托盘编码"
;
this
.
托盘初始化
ToolStripMenuItem
.
Click
+=
new
System
.
EventHandler
(
this
.
托盘初始化
ToolStripMenuItem_Click
);
//
// FrmLineStore
//
this
.
AutoScaleDimensions
=
new
System
.
Drawing
.
SizeF
(
6F
,
12F
);
...
...
source/AssemblyLineClient/FrmLineStore.cs
查看文件 @
cece86d
...
...
@@ -100,8 +100,8 @@ namespace OnlineStore.AssemblyLine
}
private
void
FrmMain_Load
(
object
sender
,
EventArgs
e
)
{
FrmBase
.
GetVersion
(
);
if
(!
LineManager
.
Init
())
FrmBase
.
GetVersion
(
true
);
if
(!
LineManager
.
Init
())
{
LogUtil
.
error
(
"加载配置失败,直接退出程序"
);
Application
.
Exit
();
...
...
source/DeviceLibrary/assemblyLine/DischargeLine.cs
查看文件 @
cece86d
...
...
@@ -38,7 +38,7 @@ namespace OnlineStore.DeviceLibrary
public
override
bool
StartRun
(
bool
isDebug
=
false
)
{
preTrayNum
=
0
;
curr
Move
TrayNum
=
0
;
currTrayNum
=
0
;
mainTimer
.
Enabled
=
false
;
MoveInfo
.
EndMove
();
SecondMoveInfo
.
EndMove
();
...
...
@@ -252,12 +252,13 @@ namespace OnlineStore.DeviceLibrary
public
override
bool
StartInStoreMove
(
InOutParam
param
)
{
return
false
;
}
protected
override
void
InStoreProcess
()
{
}
protected
override
void
CheckFixtureProcess
()
{
}
}
}
source/DeviceLibrary/assemblyLine/DischargeLine_Partial.cs
查看文件 @
cece86d
...
...
@@ -11,31 +11,8 @@ namespace OnlineStore.DeviceLibrary
{
partial
class
DischargeLine
{
#
region
托盘检测
private
void
StartCheckFixture
()
{
#
region
是否可移栽料盘
}
private
bool
CheckIsNeedOutStore
()
{
return
false
;
}
protected
override
void
CheckFixtureProcess
()
{
if
(!
LineManager
.
Line
.
LineCanRun
())
{
return
;
}
if
(
SecondMoveInfo
.
IsInWait
)
{
CheckWait
(
SecondMoveInfo
);
}
if
(
SecondMoveInfo
.
IsInWait
)
{
return
;
}
}
internal
bool
CanStartOut
(
int
lineNum
)
{
...
...
@@ -118,9 +95,7 @@ namespace OnlineStore.DeviceLibrary
string
posId
=
MoveInfo
.
MoveParam
!=
null
?
MoveInfo
.
MoveParam
.
PosId
:
""
;
if
(
MoveInfo
.
MoveStep
.
Equals
(
LineMoveStep
.
DL_R_LineCheck
))
{
}
else
if
(
MoveInfo
.
MoveStep
.
Equals
(
LineMoveStep
.
DL_R_LineCheck
))
{
LogInfo
(
"出料【"
+
posId
+
"】处理完成!"
);
...
...
source/DeviceLibrary/assemblyLine/EquipBase.cs
查看文件 @
cece86d
...
...
@@ -13,12 +13,12 @@ namespace OnlineStore.DeviceLibrary
{
private
bool
IsIntSlvBlock
=
false
;
public
bool
IsDebug
=
false
;
public
AxisAlarmInfo
AxisAlarm
=
new
AxisAlarmInfo
();
internal
AxisAlarmInfo
AxisAlarm
=
new
AxisAlarmInfo
();
public
bool
UseAxis
=
false
;
public
List
<
InOutParam
>
waitOutStoreList
=
new
List
<
InOutParam
>();
public
List
<
InOutParam
>
waitInStoreList
=
new
List
<
InOutParam
>();
public
object
waitInListLock
=
""
;
public
object
waitOutListLock
=
""
;
internal
object
waitInListLock
=
""
;
internal
object
waitOutListLock
=
""
;
/// <summary>
///移栽装置后面分为两条移动线
/// </summary>
...
...
@@ -26,11 +26,11 @@ namespace OnlineStore.DeviceLibrary
/// <summary>
/// 上一个盘号
/// </summary>
public
int
preTrayNum
=
0
;
internal
int
preTrayNum
=
0
;
/// <summary>
/// 当前正在通过的托盘号
/// </summary>
protected
int
curr
Move
TrayNum
=
0
;
protected
int
currTrayNum
=
0
;
protected
abstract
void
ReturnHomeProcess
();
protected
virtual
void
StopMoveProcess
()
...
...
source/DeviceLibrary/assemblyLine/FeedingEquip_Partial.cs
查看文件 @
cece86d
...
...
@@ -129,33 +129,34 @@ namespace OnlineStore.DeviceLibrary
else
if
(
SecondMoveInfo
.
MoveStep
.
Equals
(
LineMoveStep
.
MIO_04_Wait
))
{
//此处先对托盘号进行验证
currMoveTrayNum
=
TrayManager
.
GetTrayNum
(
DeviceID
)
;
bool
isFull
=
TrayManager
.
IsFixTureFull
(
currMoveTrayNum
);
if
(
TrayManager
.
RightTrayCode
(
curr
Move
TrayNum
,
preTrayNum
,
false
))
preTrayNum
=
currTrayNum
;
currTrayNum
=
TrayManager
.
GetTrayNum
(
DeviceID
);
if
(
TrayManager
.
RightTrayCode
(
currTrayNum
,
preTrayNum
,
false
))
{
if
(
TrayManager
.
ErrorStoreId
.
Equals
(
DeviceID
))
{
TrayManager
.
UpdateTrayNumError
(-
1
,
""
);
}
//出料中,需要拦盘
if
(
NeedCurrTray
())
if
(
NeedCurrTray
(
true
))
{
//preTrayNum = currMoveTrayNum;
SecondMoveInfo
.
MoveParam
=
new
InOutParam
(
currMoveTrayNum
);
//
SecondMoveInfo.MoveParam = new InOutParam(currMoveTrayNum);
SecondMoveInfo
.
NextMoveStep
(
LineMoveStep
.
MIO_05_WaitTime
);
SecondMoveInfo
.
EndStepWait
();
return
;
}
else
{
LogInfo
(
SecondMoveInfo
.
MoveNum
+
"***************上个托盘号【"
+
preTrayNum
+
"】,当前"
+
(
isFull
?
"有料托盘"
:
"空托盘"
)
+
"【"
+
currMoveTrayNum
+
"】没有出入料任务,放盘通过~"
);
bool
isFull
=
TrayManager
.
TrayIsFull
(
currTrayNum
);
LogInfo
(
SecondMoveInfo
.
MoveNum
+
"***************上个托盘号【"
+
preTrayNum
+
"】,当前"
+
(
isFull
?
"有料托盘"
:
"空托盘"
)
+
"【"
+
currTrayNum
+
"】没有出入料任务,放盘通过~"
);
CheckLog
(
"托盘放行 SecondStoreMove:(MO_14_WaitCanGo ,移栽2,需要判断是否可以放盘通过,最多等待10000)"
);
SecondMoveInfo
.
NextMoveStep
(
LineMoveStep
.
MO_15_WaitCanGo
);
}
}
else
{
string
msg
=
Name
+
" 托盘顺序错乱,上个托盘号【"
+
preTrayNum
+
"】当前托盘号 【"
+
curr
Move
TrayNum
+
"】最大盘号【"
+
TrayManager
.
MaxTrayNum
+
"】"
;
string
msg
=
Name
+
" 托盘顺序错乱,上个托盘号【"
+
preTrayNum
+
"】当前托盘号 【"
+
currTrayNum
+
"】最大盘号【"
+
TrayManager
.
MaxTrayNum
+
"】"
;
TrayManager
.
UpdateTrayNumError
(
DeviceID
,
msg
);
LogUtil
.
error
(
msg
);
return
;
...
...
@@ -178,27 +179,26 @@ namespace OnlineStore.DeviceLibrary
}
else
if
(
SecondMoveInfo
.
MoveStep
.
Equals
(
LineMoveStep
.
MIO_07_LocationCylinderUp
))
{
CheckLog
(
"托盘检测(流水线阻挡)*************** 托盘号【"
+
curr
Move
TrayNum
+
"】"
);
CheckLog
(
"托盘检测(流水线阻挡)*************** 托盘号【"
+
currTrayNum
+
"】"
);
//判断盘是空盘,空盘并且编号正确才需要放料盘过去
if
(
MoveInfo
.
MoveType
.
Equals
(
LineMoveType
.
InStore
))
{
SecondMoveInfo
.
MoveParam
=
new
InOutParam
(
currMoveTrayNum
);
LogInfo
(
SecondMoveInfo
.
MoveNum
+
"*************** 托盘号【"
+
currMoveTrayNum
+
"】 ,需要入料,移栽料盘"
);
LogInfo
(
SecondMoveInfo
.
MoveNum
+
"*************** 托盘号【"
+
currTrayNum
+
"】 ,需要入料,移栽料盘"
);
SecondMoveInfo
.
NextMoveStep
(
LineMoveStep
.
MO_11_CodeRember
);
SecondMoveInfo
.
EndStepWait
();
}
else
if
(
MoveInfo
.
MoveType
.
Equals
(
LineMoveType
.
OutStore
))
{
//TODO
SecondMoveInfo
.
MoveParam
=
new
InOutParam
(
currMoveTrayNum
);
LogInfo
(
SecondMoveInfo
.
MoveNum
+
"*************** 托盘号【"
+
currMoveTrayNum
+
"】 ,需要出库,开始出库处理"
);
SecondMoveInfo
.
NextMoveStep
(
LineMoveStep
.
MO_11_CodeRember
);
SecondMoveInfo
.
EndStepWait
();
LogInfo
(
SecondMoveInfo
.
MoveNum
+
"*************** 托盘号【"
+
currTrayNum
+
"】 ,需要出库,开始出库处理,升降伺服到P1点"
);
SecondMoveInfo
.
NextMoveStep
(
LineMoveStep
.
MO_201_UpDownToP1
);
InStoreLog
(
" MO_201_UpDownToP1 紧急出料移栽:升降伺服到P1点"
);
ACAxisMove
(
Config
.
UpDown_Axis
,
Config
.
UpDownAxisP1
,
Config
.
UpdownAxis_P1Speed
);
}
else
{
CheckLog
(
"托盘检测 SecondStoreMove:(MO_13_LoactionCylinder_Down ,托盘号【"
+
curr
Move
TrayNum
+
"】,直接放盘通过,定位气缸下降)"
);
CheckLog
(
"托盘检测 SecondStoreMove:(MO_13_LoactionCylinder_Down ,托盘号【"
+
currTrayNum
+
"】,直接放盘通过,定位气缸下降)"
);
SecondMoveInfo
.
NextMoveStep
(
LineMoveStep
.
MO_13_LoactionCylinder_Down
);
CylinderMove
(
SecondMoveInfo
,
IO_Type
.
SW_LocationCylinder_Up
,
IO_Type
.
SW_LocationCylinder_Down
);
}
...
...
@@ -217,18 +217,18 @@ namespace OnlineStore.DeviceLibrary
{
//更新托盘条码信息
string
code
=
CodeManager
.
ProcessCode
(
LastCodeList
);
TrayManager
.
UpdateTrayCode
(
curr
Move
TrayNum
,
code
);
TrayManager
.
UpdateTrayCode
(
currTrayNum
,
code
);
//从服务器获取库位号
string
result
=
StoreServerManager
.
CodeReceived
(
Name
,
curr
Move
TrayNum
,
LastCodeList
,
LastHeight
,
LastWidth
);
string
result
=
StoreServerManager
.
CodeReceived
(
Name
,
currTrayNum
,
LastCodeList
,
LastHeight
,
LastWidth
);
if
(!
result
.
Equals
(
""
))
{
LogUtil
.
error
(
result
);
}
InStoreLog
(
" SecondStoreMove=MO_1
2
_LoactionCylinder_Down 上料横移机构上升,托盘开始放行,定位气缸下降"
);
InStoreLog
(
" SecondStoreMove=MO_1
3
_LoactionCylinder_Down 上料横移机构上升,托盘开始放行,定位气缸下降"
);
SecondMoveInfo
.
NextMoveStep
(
LineMoveStep
.
MO_13_LoactionCylinder_Down
);
CylinderMove
(
SecondMoveInfo
,
IO_Type
.
SW_LocationCylinder_Up
,
IO_Type
.
SW_LocationCylinder_Down
);
}
else
if
(
SecondMoveInfo
.
MoveStep
.
Equals
(
LineMoveStep
.
MO_13_LoactionCylinder_Down
))
{
CheckLog
(
"托盘检测 SecondStoreMove:(MO_1
3_TopCylinder_Down ,托盘号【"
+
currMove
TrayNum
+
"】,直接放盘通过,顶升气缸下降)"
);
CheckLog
(
"托盘检测 SecondStoreMove:(MO_1
4_TopCylinder_Down ,托盘号【"
+
curr
TrayNum
+
"】,直接放盘通过,顶升气缸下降)"
);
SecondMoveInfo
.
NextMoveStep
(
LineMoveStep
.
MO_14_TopCylinder_Down
);
if
(
Config
.
SidesWayNum
>
0
)
{
...
...
@@ -245,7 +245,7 @@ namespace OnlineStore.DeviceLibrary
{
//更新横移托盘已处理完成
TrayManager
.
UpdateSWState
(
Config
.
SidesWayNum
,
1
);
preTrayNum
=
curr
Move
TrayNum
;
preTrayNum
=
currTrayNum
;
CheckLog
(
"托盘放行 SecondStoreMove:(托盘放行结束) "
);
SecondMoveInfo
.
EndMove
();
}
...
...
@@ -279,95 +279,99 @@ namespace OnlineStore.DeviceLibrary
}
else
if
(
SecondMoveInfo
.
MoveStep
.
Equals
(
LineMoveStep
.
MO_18_StopCylinder_Back
))
{
preTrayNum
=
curr
Move
TrayNum
;
preTrayNum
=
currTrayNum
;
CheckLog
(
"托盘放行 SecondStoreMove:(托盘放行结束) "
);
// IOMove(IO_Type.StopCylinder_Down1, IO_VALUE.HIGH);
SecondMoveInfo
.
EndMove
();
}
#
endregion
#
region
紧急出料,先移载料盘
else
if
(
SecondMoveInfo
.
MoveStep
.
Equals
(
LineMoveStep
.
MO_201_UpDownToP1
)&&
MoveInfo
.
MoveStep
>=(
LineMoveStep
.
FO_07_LocationCylinder_Up
))
{
SecondMoveInfo
.
NextMoveStep
(
LineMoveStep
.
MO_202_MoveCylinder_Give
);
InStoreLog
(
" MO_202_MoveCylinder_Give 紧急出料移栽:上料横移机构到放料端"
);
CylinderMove
(
SecondMoveInfo
,
IO_Type
.
SL_MoveCylinder_Take
,
IO_Type
.
SL_MoveCylinder_Give
);
}
else
if
(
SecondMoveInfo
.
MoveStep
.
Equals
(
LineMoveStep
.
MO_202_MoveCylinder_Give
))
{
SecondMoveInfo
.
NextMoveStep
(
LineMoveStep
.
MO_203_MoveCylinder_Down
);
InStoreLog
(
" MO_203_MoveCylinder_Down 紧急出料移栽:上料横移机构下降"
);
CylinderMove
(
SecondMoveInfo
,
IO_Type
.
SL_MoveCylinder_Up
,
IO_Type
.
SL_MoveCylinder_Down
);
}
else
if
(
SecondMoveInfo
.
MoveStep
.
Equals
(
LineMoveStep
.
MO_203_MoveCylinder_Down
))
{
SecondMoveInfo
.
NextMoveStep
(
LineMoveStep
.
MO_204_UpdownAxisToP2
);
int
targetP
=
Config
.
GetUpdownPositionP2
(
SecondMoveInfo
.
MoveParam
.
PlateH
);
InStoreLog
(
" MO_204_UpdownAxisToP2 紧急出料移栽:升降伺服下降到指定位置"
+
targetP
);
ACAxisMove
(
Config
.
UpDown_Axis
,
targetP
,
Config
.
UpdownAxis_P2Speed
);
}
else
if
(
SecondMoveInfo
.
MoveStep
.
Equals
(
LineMoveStep
.
MO_204_UpdownAxisToP2
))
{
SecondMoveInfo
.
NextMoveStep
(
LineMoveStep
.
MO_205_MoveCylinder_Tighten
);
InStoreLog
(
" MO_205_MoveCylinder_Tighten 紧急出料移栽:上料气缸夹紧"
);
CylinderMove
(
SecondMoveInfo
,
IO_Type
.
SL_MoveCylinder_Slack
,
IO_Type
.
SL_MoveCylinder_Tighten
);
}
else
if
(
SecondMoveInfo
.
MoveStep
.
Equals
(
LineMoveStep
.
MO_205_MoveCylinder_Tighten
))
{
SecondMoveInfo
.
NextMoveStep
(
LineMoveStep
.
MO_206_UpdownAxisToP1
);
InStoreLog
(
" MO_206_UpdownAxisToP1 紧急出料移栽:升降伺服到P1"
);
ACAxisMove
(
Config
.
UpDown_Axis
,
Config
.
UpDownAxisP1
,
Config
.
UpdownAxis_P1Speed
);
}
else
if
(
SecondMoveInfo
.
MoveStep
.
Equals
(
LineMoveStep
.
MO_206_UpdownAxisToP1
))
{
SecondMoveInfo
.
NextMoveStep
(
LineMoveStep
.
MO_207_MoveCylinder_Up
);
InStoreLog
(
" MO_207_MoveCylinder_Up 紧急出料移栽:上料横移机构上升,更新【"
+
currTrayNum
+
"】为空托盘"
);
CylinderMove
(
SecondMoveInfo
,
IO_Type
.
SL_MoveCylinder_Down
,
IO_Type
.
SL_MoveCylinder_Up
);
//更新此托盘为空托盘
TrayManager
.
UpdateTrayInfo
(
currTrayNum
,
false
);
}
else
if
(
SecondMoveInfo
.
MoveStep
.
Equals
(
LineMoveStep
.
MO_207_MoveCylinder_Up
))
{
SecondMoveInfo
.
NextMoveStep
(
LineMoveStep
.
MO_208_MoveCylinder_Take
);
InStoreLog
(
" MO_208_MoveCylinder_Take 紧急出料移栽:上料横移机构到取料端"
);
CylinderMove
(
SecondMoveInfo
,
IO_Type
.
SL_MoveCylinder_Give
,
IO_Type
.
SL_MoveCylinder_Take
);
}
else
if
(
SecondMoveInfo
.
MoveStep
.
Equals
(
LineMoveStep
.
MO_208_MoveCylinder_Take
))
{
InStoreLog
(
" SecondStoreMove=MO_13_LoactionCylinder_Down 托盘开始放行,定位气缸下降"
);
SecondMoveInfo
.
NextMoveStep
(
LineMoveStep
.
MO_13_LoactionCylinder_Down
);
CylinderMove
(
SecondMoveInfo
,
IO_Type
.
SW_LocationCylinder_Up
,
IO_Type
.
SW_LocationCylinder_Down
);
}
#
endregion
}
#
endregion
#
region
入料流程
////SL1定位工位检测有信号,阻挡气缸不能下降。
//SL1定位工位检测无信号,阻挡气缸下降,然后料架到工位
//待机位:上料横移机构后退端,上升端,放松端
//移栽伺服原点在上方,只有移栽到流水线时才需要用到,其他时候都在上方待机点
//提升伺服原点在上方,需要配置待机点P1=500?,下降点P5=10000?,回原点负方向
//
//提升伺服先上升到待机点,SL1升降盘定位气缸1后退,定位气缸下降,料架才能进入上料工位
//料架进入上料工位后,定位气缸先上升
//提升伺服下降到P2
////升降盘定位气缸前进
//提升伺服缓慢上升,绝对位置=P1,若上升到P1么有X105,那么没有料盘
// 检测到X105信号,提升伺服停止
// 上料横移机构下降,
// 上料横移机构取料
// 上料横移机构下降
// 上料横移机构夹紧
// 上料横移机构上升
// 提升伺服开始缓慢上升到位
// 计算高度,宽度并记录
// 上料横移机构到放料端
//等待拦截到托盘,并顶升上升,定位上升
// 上料横移机构下降
// 移栽伺服下降到对应盘高位置
//上料气缸放松
// 移栽伺服上升,
// 上料横移机构上升
/// <summary>
/// 判断是否有料架,若有开始入料
/// </summary>
/// <returns></returns>
private
bool
StartInStoreP
()
{
////定位工位有料架
//if (IOValue(IO_Type.SL_Location_Check).Equals(IO_VALUE.HIGH)){
// return true;
//}
////阻挡工位有料架
//else if (IOValue(IO_Type.SL_Stop_Check).Equals(IO_VALUE.HIGH))
//{
// MoveInfo.NextMoveStep(LineMoveStep.FI_03_LineStart);
// IOMove(IO_Type.Line_Run, IO_VALUE.LOW);
// IOMove(IO_Type.SL_Entry_Check, IO_VALUE.LOW);
// MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.SL_Stop_Check, IO_VALUE.LOW));
// InStoreLog(" 检测到SL_Stop_Check=1, FI_03_InLineStart 开始:进料线体运转,进料阻挡上升,等待SL_Stop_Check=0");
// IOMove(IO_Type.Line_Run, IO_VALUE.HIGH);
// return true;
//}
////入料口有料架
//else if (IOValue(IO_Type.SL_Entry_Check).Equals(IO_VALUE.HIGH))
//{
// MoveInfo.NewMove(LineMoveType.InStore);
// MoveInfo.NextMoveStep(LineMoveStep.FI_06_LineRunCheck);
// IOMove(IO_Type.SL_Entry_Check, IO_VALUE.HIGH);
// IOMove(IO_Type.Line_Run, IO_VALUE.HIGH);
// MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.SL_Entry_Check, IO_VALUE.LOW));
// InStoreLog("检测到SL_Entry_Check信号,进料线体运转,进料阻挡下降,等待SL_Entry_Check=0");
// return true;
//}
//若定位工位,阻挡工位,入料口有一个有料架,需要进行处理
if
(
IOValue
(
IO_Type
.
SL_Location_Check
).
Equals
(
IO_VALUE
.
HIGH
)
||
IOValue
(
IO_Type
.
SL_Stop_Check
).
Equals
(
IO_VALUE
.
HIGH
)
||
IOValue
(
IO_Type
.
SL_Entry_Check
).
Equals
(
IO_VALUE
.
HIGH
))
{
MoveInfo
.
NextMoveStep
(
LineMoveStep
.
FI_01_TrayLocation_After
);
TrayLCylinderAfter
(
MoveInfo
);
InStoreLog
(
"检测到料架, FI_01_TrayLocation_After :升降盘定位气缸下降"
);
StartInStoreMove
(
null
);
}
return
false
;
}
public
override
bool
StartInStoreMove
(
InOutParam
param
)
{
return
false
;
runStatus
=
LineRunStatus
.
Busy
;
lineStatus
=
LineStatus
.
InStoreExecute
;
MoveInfo
.
NewMove
(
LineMoveType
.
InStore
);
MoveInfo
.
MoveParam
=
new
InOutParam
();
MoveInfo
.
NextMoveStep
(
LineMoveStep
.
FI_01_TrayLocation_After
);
TrayLCylinderAfter
(
MoveInfo
);
InStoreLog
(
"检测到料架, FI_01_TrayLocation_After :升降盘定位气缸下降"
);
return
true
;
}
private
void
Line
Run
Process
()
private
void
Line
InStore
Process
()
{
IOMove
(
IO_Type
.
Line_Run
,
IO_VALUE
.
LOW
);
...
...
@@ -416,6 +420,8 @@ namespace OnlineStore.DeviceLibrary
}
if
(
MoveInfo
.
IsInWait
)
{
return
;
}
if
(
MoveInfo
.
MoveStep
.
Equals
(
LineMoveStep
.
Wait
))
{
MoveInfo
.
NextMoveStep
(
LineMoveStep
.
FI_01_TrayLocation_After
);
...
...
@@ -430,11 +436,11 @@ namespace OnlineStore.DeviceLibrary
}
else
if
(
MoveInfo
.
MoveStep
.
Equals
(
LineMoveStep
.
FI_02_LocationCylinder_Down
))
{
LineRun
Process
();
LineInStore
Process
();
}
else
if
(
MoveInfo
.
MoveStep
.
Equals
(
LineMoveStep
.
FI_03_LineStart
))
{
LineRun
Process
();
LineInStore
Process
();
}
//else if (MoveInfo.MoveStep.Equals(LineMoveStep.FI_04_LineRunCheck))
//{
...
...
@@ -573,7 +579,7 @@ namespace OnlineStore.DeviceLibrary
InStoreLog
(
" FI_22_MoveCylinder_Up 料盘移栽:上料横移机构上升,记录托盘尺寸, 开始放行,"
);
CylinderMove
(
MoveInfo
,
IO_Type
.
SL_MoveCylinder_Down
,
IO_Type
.
SL_MoveCylinder_Up
);
TrayManager
.
UpdateTrayInfo
(
currMove
TrayNum
,
true
,
1
,
""
,
""
,
LastHeight
,
LastWidth
);
TrayManager
.
UpdateTrayInfo
(
curr
TrayNum
,
true
,
1
,
""
,
""
,
LastHeight
,
LastWidth
);
LastCodeList
=
new
List
<
string
>();
InStoreLog
(
" SecondStoreMove=MO_12_MoveOk 开始扫码"
);
SecondMoveInfo
.
NextMoveStep
(
LineMoveStep
.
MO_12_MoveOk
);
...
...
@@ -674,9 +680,6 @@ namespace OnlineStore.DeviceLibrary
runStatus
=
LineRunStatus
.
Runing
;
LogUtil
.
info
(
"空料架已送出,入料结束"
);
}
return
;
}
}
private
void
BatchAxisToP3
()
{
...
...
@@ -732,17 +735,28 @@ namespace OnlineStore.DeviceLibrary
/// 是否需要拦截当前托盘进行处理
/// </summary>
/// <returns></returns>
internal
bool
NeedCurrTray
()
internal
bool
NeedCurrTray
(
bool
checkAndMove
=
false
)
{
int
num
=
TrayManager
.
GetTrayNum
(
Config
.
Id
);
bool
isFull
=
TrayManager
.
IsFixTureFull
(
num
);
int
trayNum
=
TrayManager
.
GetTrayNum
(
Config
.
Id
);
bool
isFull
=
TrayManager
.
TrayIsFull
(
trayNum
);
TrayInfo
info
=
TrayManager
.
GetTrayInfo
(
trayNum
);
InOutParam
param
=
new
InOutParam
(
trayNum
,
info
.
WareCode
,
info
.
PosId
,
info
.
PlateH
,
info
.
PlateW
);
//是出料的模块
if
(
Config
.
IsCanOut
.
Equals
(
1
))
{
if
((
IOValue
(
IO_Type
.
SW_ReelCheck
).
Equals
(
IO_VALUE
.
HIGH
)
||
IOValue
(
IO_Type
.
FL_ReelCheck
).
Equals
(
IO_VALUE
.
HIGH
)))
//此托盘是紧急出料盘,需要通过料架出库
if
((
IOValue
(
IO_Type
.
SW_ReelCheck
).
Equals
(
IO_VALUE
.
HIGH
)
||
IOValue
(
IO_Type
.
FL_ReelCheck
).
Equals
(
IO_VALUE
.
HIGH
))&&
info
.
EmergencyOut
)
{
if
(
isFull
&&
runStatus
.
Equals
(
LineRunStatus
.
Runing
)
&&
MoveInfo
.
MoveType
.
Equals
(
LineMoveType
.
OutStore
))
{
lastOutParam
=
param
;
if
(
checkAndMove
)
{
SecondMoveInfo
.
MoveParam
=
param
;
}
// return true;
//TODO 开始出库
StartOutStoreMove
(
param
);
}
}
}
...
...
@@ -753,31 +767,229 @@ namespace OnlineStore.DeviceLibrary
//入料执行中, 且需要空托盘
if
(
MoveInfo
.
MoveStep
>=
LineMoveStep
.
FI_11_MoveCylinder_Take
&&
MoveInfo
.
MoveStep
<=
LineMoveStep
.
FI_17_WaitTray
)
{
LogUtil
.
info
(
Name
+
"拦截到空托盘【"
+
num
+
"】,入料执行中,需要空托盘"
);
return
true
;
if
(
checkAndMove
)
{
SecondMoveInfo
.
MoveParam
=
param
;
}
LogUtil
.
info
(
Name
+
"拦截到空托盘【"
+
trayNum
+
"】,入料执行中,需要空托盘"
);
return
true
;
}
}
return
false
;
}
/// <summary>
/// 判断当前托盘是否需出库
/// </summary>
/// <returns></returns>
private
bool
TrayIsNeedOutStore
()
{
return
false
;
}
#
region
出料流程
#
region
出料流程
private
InOutParam
lastOutParam
=
null
;
public
override
bool
StartOutStoreMove
(
InOutParam
param
)
{
runStatus
=
LineRunStatus
.
Busy
;
lineStatus
=
LineStatus
.
OutStoreExecute
;
MoveInfo
.
NewMove
(
LineMoveType
.
OutStore
);
MoveInfo
.
MoveParam
=
new
InOutParam
();
MoveInfo
.
NextMoveStep
(
LineMoveStep
.
FO_01_TrayLocation_After
);
TrayLCylinderAfter
(
MoveInfo
);
InStoreLog
(
"检测到料架, FO_01_TrayLocation_After :升降盘定位气缸后退"
);
return
true
;
}
private
void
LineOutStoreProcess
()
{
IOMove
(
IO_Type
.
Line_Run
,
IO_VALUE
.
LOW
);
//判断是哪个工位有料架
if
(
IOValue
(
IO_Type
.
SL_Location_Check
).
Equals
(
IO_VALUE
.
HIGH
))
{
//定位工位有料架,直接开始入料
MoveInfo
.
NextMoveStep
(
LineMoveStep
.
FO_07_LocationCylinder_Up
);
InStoreLog
(
" FO_07_LocationCylinder_Up 定位工位检测到料架:缓冲阻挡上升, 定位气缸上升"
);
IOMove
(
IO_Type
.
SL_Buffer_StopDown
,
IO_VALUE
.
LOW
);
//缓冲阻挡下降
CylinderMove
(
MoveInfo
,
IO_Type
.
SL_LocationCylinder_Down
,
IO_Type
.
SW4_LocationCylinder_Up
);
}
//阻挡工位有料架,流水线转动一个工位
else
if
(
IOValue
(
IO_Type
.
SL_Stop_Check
).
Equals
(
IO_VALUE
.
HIGH
))
{
MoveInfo
.
NextMoveStep
(
LineMoveStep
.
FO_03_LineStart
);
IOMove
(
IO_Type
.
SL_Entry_StopDown
,
IO_VALUE
.
LOW
);
//进料阻挡上升
IOMove
(
IO_Type
.
SL_Buffer_StopDown
,
IO_VALUE
.
HIGH
);
//缓冲阻挡下降
IOMove
(
IO_Type
.
Line_Run
,
IO_VALUE
.
HIGH
);
//等待指定时间
MoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitTime
(
2000
));
InStoreLog
(
" FO_03_InLineStart 出料检测:阻挡工位有料架,进料阻挡上升,缓冲阻挡下降,流水线转动2000"
);
}
else
if
(
IOValue
(
IO_Type
.
SL_Entry_Check
).
Equals
(
IO_VALUE
.
HIGH
))
{
MoveInfo
.
NextMoveStep
(
LineMoveStep
.
FO_03_LineStart
);
IOMove
(
IO_Type
.
SL_Entry_StopDown
,
IO_VALUE
.
HIGH
);
//进料阻挡下降
IOMove
(
IO_Type
.
SL_Buffer_StopDown
,
IO_VALUE
.
LOW
);
//缓冲阻挡上升
IOMove
(
IO_Type
.
Line_Run
,
IO_VALUE
.
HIGH
);
//等待指定时间
MoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitTime
(
2000
));
InStoreLog
(
" FO_03_InLineStart 出料检测:入料工位有料架,进料阻挡下降,缓冲阻挡上升,流水线转动2000"
);
}
else
{
MoveInfo
.
EndMove
();
runStatus
=
LineRunStatus
.
Runing
;
LogUtil
.
info
(
" 未检测到料架,出料结束"
);
}
}
protected
override
void
OutStoreProcess
()
{
if
(
MoveInfo
.
IsInWait
)
{
CheckWait
(
MoveInfo
);
}
if
(
MoveInfo
.
IsInWait
)
{
return
;
}
if
(
MoveInfo
.
MoveStep
.
Equals
(
LineMoveStep
.
Wait
))
{
MoveInfo
.
NextMoveStep
(
LineMoveStep
.
FO_01_TrayLocation_After
);
TrayLCylinderAfter
(
MoveInfo
);
InStoreLog
(
"检测到料架, FO_01_TrayLocation_After :升降盘定位气缸后退"
);
}
else
if
(
MoveInfo
.
MoveStep
.
Equals
(
LineMoveStep
.
FO_01_TrayLocation_After
))
{
MoveInfo
.
NextMoveStep
(
LineMoveStep
.
FO_02_LocationCylinder_Down
);
CylinderMove
(
MoveInfo
,
IO_Type
.
SL_LocationCylinder_Up
,
IO_Type
.
SL_LocationCylinder_Down
);
InStoreLog
(
" FO_02_LocationCylinder_Down 开始:定位气缸下降"
);
}
else
if
(
MoveInfo
.
MoveStep
.
Equals
(
LineMoveStep
.
FO_02_LocationCylinder_Down
))
{
LineOutStoreProcess
();
}
else
if
(
MoveInfo
.
MoveStep
.
Equals
(
LineMoveStep
.
FO_03_LineStart
))
{
LineOutStoreProcess
();
}
else
if
(
MoveInfo
.
MoveStep
.
Equals
(
LineMoveStep
.
FO_07_LocationCylinder_Up
))
{
MoveInfo
.
NextMoveStep
(
LineMoveStep
.
FO_08_BatchAxisToP2
);
InStoreLog
(
" FO_08_BatchAxisToP2 开始:提升轴下降到位P2"
);
IOMove
(
IO_Type
.
Line_Run
,
IO_VALUE
.
LOW
);
ACAxisMove
(
Config
.
Batch_Axis
,
Config
.
BatchAxisP2
,
Config
.
BatchAxis_P2Speed
);
}
else
if
(
MoveInfo
.
MoveStep
.
Equals
(
LineMoveStep
.
FO_08_BatchAxisToP2
))
{
MoveInfo
.
NextMoveStep
(
LineMoveStep
.
FO_09_TrayLocation_Before
);
InStoreLog
(
" FO_09_TrayLocation_Before 开始:升降盘定位气缸前进"
);
TrayLCylinderBefore
(
MoveInfo
);
}
else
if
(
MoveInfo
.
MoveStep
.
Equals
(
LineMoveStep
.
FO_09_TrayLocation_Before
))
{
MoveInfo
.
NextMoveStep
(
LineMoveStep
.
FO_10_AxisUpMove
);
InStoreLog
(
" FO_10_AxisUpMove 开始:上料轴开始慢速上升到P3点"
);
ACAxisMove
(
Config
.
Batch_Axis
,
Config
.
BatchAxisP3
,
Config
.
BatchAxis_TargetSpeed
);
}
else
if
(
MoveInfo
.
MoveStep
.
Equals
(
LineMoveStep
.
FO_10_AxisUpMove
))
{
MoveInfo
.
NextMoveStep
(
LineMoveStep
.
FO_11_AxisDownMove
);
InStoreLog
(
" FO_31_BatchAxisToP2 料盘移栽:提升伺服下降指定的高度"
);
int
targetPosition
=
Config
.
BatchAxisP3
+
lastOutParam
.
PlateH
*
Config
.
Height_ChangeValue
;
ACAxisMove
(
Config
.
Batch_Axis
,
targetPosition
,
Config
.
BatchAxis_TargetSpeed
);
}
else
if
(
MoveInfo
.
MoveStep
.
Equals
(
LineMoveStep
.
FO_11_AxisDownMove
))
{
MoveInfo
.
NextMoveStep
(
LineMoveStep
.
FO_12_MoveCylinder_Down
);
InStoreLog
(
" FO_12_MoveCylinder_Down 料盘移栽:出料横移机构下降"
);
CylinderMove
(
MoveInfo
,
IO_Type
.
SL_MoveCylinder_Up
,
IO_Type
.
SL_MoveCylinder_Down
);
}
else
if
(
MoveInfo
.
MoveStep
.
Equals
(
LineMoveStep
.
FO_12_MoveCylinder_Down
))
{
MoveInfo
.
NextMoveStep
(
LineMoveStep
.
FO_13_MoveCylinder_Slack
);
InStoreLog
(
" FO_13_MoveCylinder_Slack 料盘移栽:出料横移机构放松"
);
CylinderMove
(
MoveInfo
,
IO_Type
.
SL_MoveCylinder_Tighten
,
IO_Type
.
SL_MoveCylinder_Slack
);
}
else
if
(
MoveInfo
.
MoveStep
.
Equals
(
LineMoveStep
.
FO_13_MoveCylinder_Slack
))
{
MoveInfo
.
NextMoveStep
(
LineMoveStep
.
FO_14_MoveCylinder_Up
);
InStoreLog
(
" FO_14_MoveCylinder_Up 料盘移栽:上料横移机构上升"
);
CylinderMove
(
MoveInfo
,
IO_Type
.
SL_MoveCylinder_Down
,
IO_Type
.
SL_MoveCylinder_Up
);
}
else
if
(
MoveInfo
.
MoveStep
.
Equals
(
LineMoveStep
.
FO_14_MoveCylinder_Up
))
{
MoveInfo
.
NextMoveStep
(
LineMoveStep
.
FO_31_BatchAxisToP2
);
InStoreLog
(
" FO_31_BatchAxisToP2 出料完成:未检测到料盘,提升伺服到P2点"
);
ACAxisMove
(
Config
.
Batch_Axis
,
Config
.
BatchAxisP2
,
Config
.
BatchAxis_P2Speed
);
}
else
if
(
MoveInfo
.
MoveStep
.
Equals
(
LineMoveStep
.
FO_31_BatchAxisToP2
))
{
MoveInfo
.
NextMoveStep
(
LineMoveStep
.
FO_32_TrayLocationCylinder_After
);
InStoreLog
(
" FO_32_TrayLocationCylinder_After 出料完成: 升降盘定位气缸后退"
);
TrayLCylinderAfter
(
MoveInfo
);
}
else
if
(
MoveInfo
.
MoveStep
.
Equals
(
LineMoveStep
.
FO_32_TrayLocationCylinder_After
))
{
MoveInfo
.
NextMoveStep
(
LineMoveStep
.
FO_33_BatchAxisToP1
);
InStoreLog
(
" FO_33_BatchAxisToP1 出料完成:提升伺服到P1点"
);
ACAxisMove
(
Config
.
Batch_Axis
,
Config
.
BatchAxisP1
,
Config
.
BatchAxis_P1Speed
);
}
else
if
(
MoveInfo
.
MoveStep
.
Equals
(
LineMoveStep
.
FO_33_BatchAxisToP1
))
{
MoveInfo
.
NextMoveStep
(
LineMoveStep
.
FO_35_OutTopCylinder_Up
);
InStoreLog
(
" FO_34_LocationCylinder_Down 出料完成,出口顶升气缸上升,出料缓冲阻挡上升"
);
CylinderMove
(
MoveInfo
,
IO_Type
.
SL_OutTopCylinder_Down
,
IO_Type
.
SL_OutTopCylinder_Up
);
IOMove
(
IO_Type
.
SL_Out_StopDown
,
IO_VALUE
.
LOW
);
}
else
if
(
MoveInfo
.
MoveStep
.
Equals
(
LineMoveStep
.
FO_34_OutCheck
))
{
}
else
if
(
MoveInfo
.
MoveStep
.
Equals
(
LineMoveStep
.
FO_35_OutTopCylinder_Up
))
{
//TODO
MoveInfo
.
NextMoveStep
(
LineMoveStep
.
FO_36_SideWayLineRun
);
InStoreLog
(
" FO_36_SideWayLineRun 出料完成, 线体横移电机运转,等待料架到达出口"
);
IOMove
(
IO_Type
.
SL_LocationSideWay_Run
,
IO_VALUE
.
HIGH
);
IOMove
(
IO_Type
.
SL_OutSideWay_Run
,
IO_VALUE
.
HIGH
);
MoveInfo
.
OneWaitCanEndStep
=
true
;
MoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitTime
(
1000
));
MoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitIO
(
IO_Type
.
SL_Out_Check
,
IO_VALUE
.
HIGH
));
}
else
if
(
MoveInfo
.
MoveStep
.
Equals
(
LineMoveStep
.
FO_36_SideWayLineRun
))
{
MoveInfo
.
NextMoveStep
(
LineMoveStep
.
FO_37_LineStop
);
InStoreLog
(
" FO_37_LineStop 出料完成, 料架到达出口,线体横移电机停止 "
);
IOMove
(
IO_Type
.
SL_LocationSideWay_Run
,
IO_VALUE
.
LOW
);
IOMove
(
IO_Type
.
SL_OutSideWay_Run
,
IO_VALUE
.
LOW
);
MoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitTime
(
300
));
}
else
if
(
MoveInfo
.
MoveStep
.
Equals
(
LineMoveStep
.
FO_37_LineStop
))
{
MoveInfo
.
NextMoveStep
(
LineMoveStep
.
FO_38_TopCylinderDown
);
InStoreLog
(
" FO_38_TopCylinderDown 出料完成, 料架到达出口,出口顶升下降,定位气缸下降, "
);
CylinderMove
(
MoveInfo
,
IO_Type
.
SL_OutTopCylinder_Up
,
IO_Type
.
SL_OutTopCylinder_Down
);
CylinderMove
(
MoveInfo
,
IO_Type
.
SL_LocationCylinder_Up
,
IO_Type
.
SL_LocationCylinder_Down
);
MoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitTime
(
300
));
}
else
if
(
MoveInfo
.
MoveStep
.
Equals
(
LineMoveStep
.
FO_38_TopCylinderDown
))
{
MoveInfo
.
NextMoveStep
(
LineMoveStep
.
FO_39_OutLineRun
);
InStoreLog
(
" FO_39_OutLineRun 出料完成, 出口线体运转,料架到达出口处, 通知AGV取空料架, "
);
}
else
if
(
MoveInfo
.
MoveStep
.
Equals
(
LineMoveStep
.
FO_40_OutLineRun
))
{
MoveInfo
.
NextMoveStep
(
LineMoveStep
.
FO_40_OutLineRun
);
InStoreLog
(
" FO_40_OutLineRun 出料完成, AGV到达,继续转动出口线体,送走出料料架, "
);
}
else
if
(
MoveInfo
.
MoveStep
.
Equals
(
LineMoveStep
.
FO_40_OutLineRun
))
{
MoveInfo
.
NextMoveStep
(
LineMoveStep
.
FO_41_OutLineRun
);
InStoreLog
(
" FO_41_OutLineRun 出料完成, 上料完成, 料架送出, "
);
}
else
if
(
MoveInfo
.
MoveStep
.
Equals
(
LineMoveStep
.
FO_41_OutLineRun
))
{
MoveInfo
.
EndMove
();
runStatus
=
LineRunStatus
.
Runing
;
lastOutParam
=
null
;
LogUtil
.
info
(
"空料架已送出,出料结束"
);
}
}
#
endregion
}
...
...
source/DeviceLibrary/assemblyLine/LineBean.cs
查看文件 @
cece86d
...
...
@@ -361,7 +361,7 @@ namespace OnlineStore.DeviceLibrary
{
return
true
;
}
if
(
TrayManager
.
IsHasFull
())
if
(
TrayManager
.
IsHasFull
Tray
())
{
return
true
;
}
...
...
@@ -600,23 +600,6 @@ namespace OnlineStore.DeviceLibrary
// FeederProcess();
//如果驱动电机正转过程中,驱动电机INV1状态 驱动电机INV2状态 有信号,需要报警
//if (IOValue(IO_Type.DriveMotor_Run).Equals(IO_VALUE.HIGH))
//{
// if (IOValue(IO_Type.DriveMotor_INV1).Equals(IO_VALUE.LOW))
// {
// WarnMsg = "驱动电机INV1状态异常";
// LogUtil.error("驱动电机正转过程中,DriveMotor_INV1 信号LOW,需要报警", 300);
// //Alarm(LineAlarmType.SuddenStop, "1", WarnMsg, LineMoveType.None);
// }
// else if (IOValue(IO_Type.DriveMotor_INV2).Equals(IO_VALUE.LOW))
// {
// WarnMsg = "驱动电机INV2状态异常";
// LogUtil.error("驱动电机正转过程中,DriveMotor_INV2 信号LOW,需要报警", 301);
// // Alarm(LineAlarmType.SuddenStop, "1", WarnMsg, LineMoveType.None);
// }
//}
}
}
catch
(
Exception
ex
)
...
...
@@ -625,21 +608,6 @@ namespace OnlineStore.DeviceLibrary
}
Thread
.
Sleep
(
1
);
}
//public string GetINVMsg()
//{
// if (IOValue(IO_Type.DriveMotor_Run).Equals(IO_VALUE.HIGH))
// {
// if (IOValue(IO_Type.DriveMotor_INV1).Equals(IO_VALUE.LOW))
// {
// return " 驱动电机INV1状态异常";
// }
// else if (IOValue(IO_Type.DriveMotor_INV2).Equals(IO_VALUE.LOW))
// {
// return " 驱动电机INV2状态异常";
// }
// }
// return "";
//}
/// <summary>
/// 定时处理,监听信号,监听IO
/// </summary>
...
...
source/DeviceLibrary/assemblyLine/LineBean_Partial.cs
查看文件 @
cece86d
...
...
@@ -949,86 +949,6 @@ namespace OnlineStore.DeviceLibrary
}
#
endregion
#
region
高度传感器处理
public
int
GetWidth
()
{
////根据料盘检测信号
//if (IOValue(IO_Type.InStore_TrayCheck2).Equals(IO_VALUE.HIGH))
//{
// return 13;
//}
return
7
;
}
public
int
GetHeight
()
{
if
(
GetWidth
().
Equals
(
13
))
{
return
Get13Height
();
}
return
Get7Height
();
}
private
int
Get7Height
()
{
int
result
=
0
;
//if (IOValue(IO_Type.InStore_TrayCheck1).Equals(IO_VALUE.LOW))
//{
// return result;
//}
//int ai1 = AIManager.GetAIValue(Config.AIDI1_Addr);
//int ai2 = AIManager.GetAIValue(Config.AIDI2_Addr);
//double ai1Value = AIManager.ConvertAI(ai1, Config.AIDI1_DefaultPosition);
//double ai2Value = AIManager.ConvertAI(ai2, Config.AIDI2_DefaultPosition);
//result = CalHeight(ai1Value, ai2Value);
return
result
;
}
private
int
Get13Height
()
{
int
result
=
0
;
//if (IOValue(IO_Type.InStore_TrayCheck2).Equals(IO_VALUE.LOW))
//{
// return result;
//}
//double ai1Value = AIManager.ConvertAI(AIManager.GetAIValue(Config.AIDI3_Addr), Config.AIDI3_DefaultPosition);
//double ai2Value = AIManager.ConvertAI(AIManager.GetAIValue(Config.AIDI4_Addr), Config.AIDI4_DefaultPosition);
//result = CalHeight(ai1Value, ai2Value);
return
result
;
}
private
int
CalHeight
(
double
ai1Value
,
double
ai2Value
)
{
int
result
=
0
;
double
Value
=
Math
.
Round
((
ai1Value
+
ai2Value
)
/
2
,
1
);
if
(
Value
>
10
)
{
int
mo
=
(
int
)
Value
%
4
;
if
(!
mo
.
Equals
(
0
))
{
result
=
((
int
)(
Value
+
2
)
/
4
)
*
4
;
}
else
{
result
=
(
int
)
Value
;
}
}
else
if
(
Value
>=
4
)
{
if
(
ai1Value
>=
9
||
ai2Value
>=
9
)
{
result
=
12
;
}
else
{
result
=
8
;
}
}
return
result
;
}
#
endregion
#
region
料仓出入库逻辑处理
...
...
source/DeviceLibrary/assemblyLine/MoveEquip.cs
查看文件 @
cece86d
...
...
@@ -48,7 +48,7 @@ namespace OnlineStore.DeviceLibrary
public
override
bool
StartRun
(
bool
isDebug
=
false
)
{
preTrayNum
=
0
;
curr
Move
TrayNum
=
0
;
currTrayNum
=
0
;
mainTimer
.
Enabled
=
false
;
MoveInfo
.
EndMove
();
SecondMoveInfo
.
EndMove
();
...
...
@@ -65,7 +65,7 @@ namespace OnlineStore.DeviceLibrary
public
override
void
StopRun
()
{
preTrayNum
=
0
;
curr
Move
TrayNum
=
0
;
currTrayNum
=
0
;
if
(
mainTimer
!=
null
)
{
mainTimer
.
Enabled
=
false
;
...
...
@@ -185,7 +185,7 @@ namespace OnlineStore.DeviceLibrary
alarmType
=
LineAlarmType
.
None
;
//重置时清理盘号,从头开始判断
preTrayNum
=
0
;
curr
Move
TrayNum
=
0
;
currTrayNum
=
0
;
LogInfo
(
"开始重置:清空托盘号,(上下气缸回原点,阻挡1气缸上升 )开始;"
);
runStatus
=
LineRunStatus
.
Reset
;
SecondMoveInfo
.
EndMove
();
...
...
source/DeviceLibrary/assemblyLine/MoveEquip_Partial.cs
查看文件 @
cece86d
...
...
@@ -323,7 +323,7 @@ namespace OnlineStore.DeviceLibrary
//判断是否是自己排队列表中的入库信息
foreach
(
InOutParam
cc
in
waitInStoreList
)
{
if
(
cc
.
TrayNumber
.
Equals
(
curr
Move
TrayNum
)
&&
(!
cc
.
WareCode
.
Equals
(
""
)))
if
(
cc
.
TrayNumber
.
Equals
(
currTrayNum
)
&&
(!
cc
.
WareCode
.
Equals
(
""
)))
{
return
true
;
}
...
...
@@ -340,13 +340,13 @@ namespace OnlineStore.DeviceLibrary
/// <returns></returns>
private
bool
CheckIsNeedOutStore
()
{
bool
isFull
=
TrayManager
.
IsFixTureFull
(
currMove
TrayNum
);
bool
isFull
=
TrayManager
.
TrayIsFull
(
curr
TrayNum
);
if
(
MoveInfo
.
MoveType
.
Equals
(
LineMoveType
.
OutStore
)
&&
(
MoveInfo
.
MoveStep
>=
LineMoveStep
.
MO_56_BeforeAfterCylinderAfter
)
&&
(!
MoveInfo
.
MoveStep
.
Equals
(
LineMoveStep
.
MO_60_UpDownCylinderUp
)))
{
if
(
isFull
.
Equals
(
false
))
{
LogInfo
(
" 托盘号【"
+
preTrayNum
+
"】,当前托盘号【(isFull="
+
isFull
+
"):"
+
curr
Move
TrayNum
+
"】需要出库,不顶升直接让移栽放盘~"
);
LogInfo
(
" 托盘号【"
+
preTrayNum
+
"】,当前托盘号【(isFull="
+
isFull
+
"):"
+
currTrayNum
+
"】需要出库,不顶升直接让移栽放盘~"
);
return
true
;
}
//去掉直接丢料盘处理
...
...
@@ -364,8 +364,8 @@ namespace OnlineStore.DeviceLibrary
/// <returns></returns>
private
bool
CheckIsNeedInStore
()
{
bool
isfull
=
TrayManager
.
IsFixTureFull
(
currMove
TrayNum
);
LogInfo
(
"***************入库*****验证入库编号,托盘号【"
+
curr
Move
TrayNum
+
"】,isfull【"
+
isfull
+
"】"
);
bool
isfull
=
TrayManager
.
TrayIsFull
(
curr
TrayNum
);
LogInfo
(
"***************入库*****验证入库编号,托盘号【"
+
currTrayNum
+
"】,isfull【"
+
isfull
+
"】"
);
//FixtureCodeInfo code = GetBox().currInOutFixture;
if
(!
isfull
)
{
...
...
@@ -382,11 +382,11 @@ namespace OnlineStore.DeviceLibrary
for
(
int
i
=
0
;
i
<
waitInStoreList
.
Count
;
i
++)
{
InOutParam
cc
=
waitInStoreList
[
i
];
if
(
cc
.
TrayNumber
.
Equals
(
curr
Move
TrayNum
)
&&
(!
cc
.
WareCode
.
Equals
(
""
)))
if
(
cc
.
TrayNumber
.
Equals
(
currTrayNum
)
&&
(!
cc
.
WareCode
.
Equals
(
""
)))
{
reIndex
=
i
;
currCode
=
cc
;
LogInfo
(
"*******托盘"
+
curr
Move
TrayNum
+
"需要入库【"
+
currCode
.
ToStr
()
+
"】 ,开始入库移栽"
);
LogInfo
(
"*******托盘"
+
currTrayNum
+
"需要入库【"
+
currCode
.
ToStr
()
+
"】 ,开始入库移栽"
);
SecondMoveInfo
.
MoveParam
=
new
InOutParam
(
cc
.
TrayNumber
,
cc
.
WareCode
,
cc
.
PosId
,
cc
.
PlateH
,
cc
.
PlateW
);
break
;
}
...
...
@@ -396,7 +396,7 @@ namespace OnlineStore.DeviceLibrary
waitInStoreList
.
RemoveAt
(
reIndex
);
if
(!
LineServer
.
BoxCanInStore
(
DeviceID
))
{
LogUtil
.
info
(
Name
+
"*******托盘"
+
curr
Move
TrayNum
+
"需要入库【"
+
currCode
.
ToStr
()
+
"】,BoxCanInStore验证失败,先移栽再等待料仓可入库,开始入库移栽"
);
LogUtil
.
info
(
Name
+
"*******托盘"
+
currTrayNum
+
"需要入库【"
+
currCode
.
ToStr
()
+
"】,BoxCanInStore验证失败,先移栽再等待料仓可入库,开始入库移栽"
);
return
true
;
}
else
...
...
@@ -490,15 +490,16 @@ namespace OnlineStore.DeviceLibrary
//判断是否需要顶升
bool
isNeed
=
false
;
//此处先对托盘号进行验证
currMoveTrayNum
=
TrayManager
.
GetTrayNum
(
DeviceID
);
bool
isFull
=
TrayManager
.
IsFixTureFull
(
currMoveTrayNum
);
if
(
TrayManager
.
RightTrayCode
(
currMoveTrayNum
,
preTrayNum
,
false
))
preTrayNum
=
currTrayNum
;
currTrayNum
=
TrayManager
.
GetTrayNum
(
DeviceID
);
bool
isFull
=
TrayManager
.
TrayIsFull
(
currTrayNum
);
if
(
TrayManager
.
RightTrayCode
(
currTrayNum
,
preTrayNum
,
false
))
{
//出库中,需要拦盘
if
(
CheckIsNeedOutStore
())
{
//preTrayNum = currMoveTrayNum;
SecondMoveInfo
.
MoveParam
=
new
InOutParam
(
curr
Move
TrayNum
);
SecondMoveInfo
.
MoveParam
=
new
InOutParam
(
currTrayNum
);
SecondMoveInfo
.
NextMoveStep
(
LineMoveStep
.
MO_11_CodeRember
);
SecondMoveInfo
.
EndStepWait
();
return
;
...
...
@@ -510,7 +511,7 @@ namespace OnlineStore.DeviceLibrary
}
else
{
string
msg
=
Name
+
" 托盘顺序错乱,上个托盘号【"
+
preTrayNum
+
"】当前托盘号 【"
+
curr
Move
TrayNum
+
"】最大盘号【"
+
TrayManager
.
MaxTrayNum
+
"】"
;
string
msg
=
Name
+
" 托盘顺序错乱,上个托盘号【"
+
preTrayNum
+
"】当前托盘号 【"
+
currTrayNum
+
"】最大盘号【"
+
TrayManager
.
MaxTrayNum
+
"】"
;
TrayManager
.
UpdateTrayNumError
(
DeviceID
,
msg
);
LogUtil
.
error
(
msg
);
return
;
...
...
@@ -523,7 +524,7 @@ namespace OnlineStore.DeviceLibrary
}
else
{
LogInfo
(
SecondMoveInfo
.
MoveNum
+
"***************上个托盘号【"
+
preTrayNum
+
"】,当前"
+
(
isFull
?
"有料托盘"
:
"空托盘"
)
+
"【"
+
curr
Move
TrayNum
+
"】没有出入库任务,放盘通过~"
);
LogInfo
(
SecondMoveInfo
.
MoveNum
+
"***************上个托盘号【"
+
preTrayNum
+
"】,当前"
+
(
isFull
?
"有料托盘"
:
"空托盘"
)
+
"【"
+
currTrayNum
+
"】没有出入库任务,放盘通过~"
);
// preTrayNum = currMoveTrayNum;
if
(
TrayManager
.
ErrorStoreId
.
Equals
(
DeviceID
))
{
...
...
@@ -552,7 +553,7 @@ namespace OnlineStore.DeviceLibrary
}
else
if
(
SecondMoveInfo
.
MoveStep
.
Equals
(
LineMoveStep
.
MIO_06_TopCylinderUp
))
{
CheckLog
(
"托盘检测(流水线阻挡)*************** 托盘号【"
+
curr
Move
TrayNum
+
"】"
);
CheckLog
(
"托盘检测(流水线阻挡)*************** 托盘号【"
+
currTrayNum
+
"】"
);
//托盘号正确
//preTrayNum = num;
...
...
@@ -560,9 +561,9 @@ namespace OnlineStore.DeviceLibrary
//判断盘是空盘,空盘并且编号正确才需要放料盘过去
if
(
CheckIsNeedOutStore
())
{
SecondMoveInfo
.
MoveParam
=
new
InOutParam
(
curr
Move
TrayNum
);
SecondMoveInfo
.
MoveParam
=
new
InOutParam
(
currTrayNum
);
isNeedMove
=
true
;
LogInfo
(
SecondMoveInfo
.
MoveNum
+
"*************** 托盘号【"
+
curr
Move
TrayNum
+
"】可以放出库托盘,正在出库中,移栽料盘"
);
LogInfo
(
SecondMoveInfo
.
MoveNum
+
"*************** 托盘号【"
+
currTrayNum
+
"】可以放出库托盘,正在出库中,移栽料盘"
);
SecondMoveInfo
.
NextMoveStep
(
LineMoveStep
.
MO_11_CodeRember
);
SecondMoveInfo
.
EndStepWait
();
}
...
...
@@ -570,13 +571,13 @@ namespace OnlineStore.DeviceLibrary
{
if
(
CheckIsNeedInStore
())
{
LogInfo
(
SecondMoveInfo
.
MoveNum
+
"*************** 托盘号【"
+
curr
Move
TrayNum
+
"】不是空盘,有对应的入库任务,等待移栽"
);
LogInfo
(
SecondMoveInfo
.
MoveNum
+
"*************** 托盘号【"
+
currTrayNum
+
"】不是空盘,有对应的入库任务,等待移栽"
);
SecondMoveInfo
.
NextMoveStep
(
LineMoveStep
.
MIO_08_WaitInStore
);
isNeedMove
=
true
;
}
else
{
LogInfo
(
SecondMoveInfo
.
MoveNum
+
"*************** 托盘号【"
+
curr
Move
TrayNum
+
"】不是空盘, 放盘通过"
);
LogInfo
(
SecondMoveInfo
.
MoveNum
+
"*************** 托盘号【"
+
currTrayNum
+
"】不是空盘, 放盘通过"
);
}
}
if
(!
isNeedMove
)
...
...
@@ -586,7 +587,7 @@ namespace OnlineStore.DeviceLibrary
{
TrayManager
.
UpdateTrayNumError
(-
1
,
""
);
}
CheckLog
(
"托盘检测 SecondMove:(MO_13_TopCylinder_Down ,托盘号【"
+
curr
Move
TrayNum
+
"】,直接放盘通过,顶升气缸下降)"
);
CheckLog
(
"托盘检测 SecondMove:(MO_13_TopCylinder_Down ,托盘号【"
+
currTrayNum
+
"】,直接放盘通过,顶升气缸下降)"
);
SecondMoveInfo
.
NextMoveStep
(
LineMoveStep
.
MO_14_TopCylinder_Down
);
CylinderMove
(
SecondMoveInfo
,
IO_Type
.
TopCylinder_UP
,
IO_Type
.
TopCylinder_Down
);
}
...
...
@@ -637,7 +638,7 @@ namespace OnlineStore.DeviceLibrary
}
else
if
(
SecondMoveInfo
.
MoveStep
.
Equals
(
LineMoveStep
.
MO_18_StopCylinder_Back
))
{
preTrayNum
=
curr
Move
TrayNum
;
preTrayNum
=
currTrayNum
;
CheckLog
(
"托盘放行 SecondMove:(托盘放行结束) "
);
// IOMove(IO_Type.StopCylinder_Down1, IO_VALUE.HIGH);
SecondMoveInfo
.
EndMove
();
...
...
source/DeviceLibrary/assemblyLine/ProvidingEquip.cs
查看文件 @
cece86d
...
...
@@ -47,7 +47,7 @@ namespace OnlineStore.DeviceLibrary
public
override
bool
StartRun
(
bool
isDebug
=
false
)
{
preTrayNum
=
0
;
curr
Move
TrayNum
=
0
;
currTrayNum
=
0
;
mainTimer
.
Enabled
=
false
;
MoveInfo
.
EndMove
();
SecondMoveInfo
.
EndMove
();
...
...
@@ -128,7 +128,7 @@ namespace OnlineStore.DeviceLibrary
WarnMsg
=
""
;
alarmType
=
LineAlarmType
.
None
;
preTrayNum
=
0
;
curr
Move
TrayNum
=
0
;
currTrayNum
=
0
;
LogInfo
(
"开始重置:清理盘号,(上下气上升,阻挡气缸上升 )开始 "
);
runStatus
=
LineRunStatus
.
Reset
;
MoveInfo
.
EndMove
();
...
...
source/DeviceLibrary/assemblyLine/ProvidingEquip_Partial.cs
查看文件 @
cece86d
...
...
@@ -103,9 +103,9 @@ namespace OnlineStore.DeviceLibrary
else
if
(
SecondMoveInfo
.
MoveStep
.
Equals
(
LineMoveStep
.
MIO_04_Wait
))
{
//此处先对托盘号进行验证
currMoveTrayNum
=
TrayManager
.
GetTrayNum
(
DeviceID
)
;
bool
isFull
=
TrayManager
.
IsFixTureFull
(
currMoveTrayNum
);
if
(
TrayManager
.
RightTrayCode
(
curr
Move
TrayNum
,
preTrayNum
,
false
))
preTrayNum
=
currTrayNum
;
currTrayNum
=
TrayManager
.
GetTrayNum
(
DeviceID
);
if
(
TrayManager
.
RightTrayCode
(
currTrayNum
,
preTrayNum
,
false
))
{
if
(
TrayManager
.
ErrorStoreId
.
Equals
(
DeviceID
))
{
...
...
@@ -114,8 +114,8 @@ namespace OnlineStore.DeviceLibrary
//出料中,需要拦盘
if
(
CheckIsNeedOutStore
())
{
TrayInfo
trayInfo
=
TrayManager
.
GetTrayInfo
(
curr
Move
TrayNum
);
InOutParam
param
=
new
InOutParam
(
curr
Move
TrayNum
,
trayInfo
.
WareCode
,
trayInfo
.
PosId
,
trayInfo
.
PlateH
,
trayInfo
.
PlateW
);
TrayInfo
trayInfo
=
TrayManager
.
GetTrayInfo
(
currTrayNum
);
InOutParam
param
=
new
InOutParam
(
currTrayNum
,
trayInfo
.
WareCode
,
trayInfo
.
PosId
,
trayInfo
.
PlateH
,
trayInfo
.
PlateW
);
CheckLog
(
"托盘检测(流水线阻挡)是需要出库"
+
param
.
ToStr
()
+
":(MIO_05_WaitTime 等待1秒后顶升上升 )"
);
SecondMoveInfo
.
MoveParam
=
param
;
SecondMoveInfo
.
NextMoveStep
(
LineMoveStep
.
MIO_05_WaitTime
);
...
...
@@ -126,15 +126,15 @@ namespace OnlineStore.DeviceLibrary
}
else
{
LogInfo
(
SecondMoveInfo
.
MoveNum
+
"***************上个托盘号【"
+
preTrayNum
+
"】,当前"
+
(
isFull
?
"有料托盘"
:
"空托盘"
)
+
"【"
+
currMoveTrayNum
+
"】没有出入料任务,放盘通过~"
);
bool
isFull
=
TrayManager
.
TrayIsFull
(
currTrayNum
);
LogInfo
(
SecondMoveInfo
.
MoveNum
+
"***************上个托盘号【"
+
preTrayNum
+
"】,当前"
+
(
isFull
?
"有料托盘"
:
"空托盘"
)
+
"【"
+
currTrayNum
+
"】没有出入料任务,放盘通过~"
);
CheckLog
(
"托盘放行 SecondMove:(MO_14_WaitCanGo ,移栽2,需要判断是否可以放盘通过,最多等待10000)"
);
SecondMoveInfo
.
NextMoveStep
(
LineMoveStep
.
MO_15_WaitCanGo
);
}
}
else
{
string
msg
=
Name
+
" 托盘顺序错乱,上个托盘号【"
+
preTrayNum
+
"】当前托盘号 【"
+
curr
Move
TrayNum
+
"】最大盘号【"
+
TrayManager
.
MaxTrayNum
+
"】"
;
string
msg
=
Name
+
" 托盘顺序错乱,上个托盘号【"
+
preTrayNum
+
"】当前托盘号 【"
+
currTrayNum
+
"】最大盘号【"
+
TrayManager
.
MaxTrayNum
+
"】"
;
TrayManager
.
UpdateTrayNumError
(
DeviceID
,
msg
);
LogUtil
.
error
(
msg
);
return
;
...
...
@@ -152,8 +152,8 @@ namespace OnlineStore.DeviceLibrary
}
else
if
(
SecondMoveInfo
.
MoveStep
.
Equals
(
LineMoveStep
.
MIO_06_TopCylinderUp
))
{
SecondMoveInfo
.
MoveParam
=
new
InOutParam
(
curr
Move
TrayNum
);
LogInfo
(
SecondMoveInfo
.
MoveNum
+
" 托盘号【"
+
curr
Move
TrayNum
+
"】等待移栽料盘"
);
SecondMoveInfo
.
MoveParam
=
new
InOutParam
(
currTrayNum
);
LogInfo
(
SecondMoveInfo
.
MoveNum
+
" 托盘号【"
+
currTrayNum
+
"】等待移栽料盘"
);
SecondMoveInfo
.
NextMoveStep
(
LineMoveStep
.
MO_11_CodeRember
);
SecondMoveInfo
.
EndStepWait
();
}
...
...
@@ -198,7 +198,7 @@ namespace OnlineStore.DeviceLibrary
}
else
if
(
SecondMoveInfo
.
MoveStep
.
Equals
(
LineMoveStep
.
MO_18_StopCylinder_Back
))
{
preTrayNum
=
curr
Move
TrayNum
;
preTrayNum
=
currTrayNum
;
CheckLog
(
"托盘放行 SecondMove:(托盘放行结束) "
);
// IOMove(IO_Type.StopCylinder_Down1, IO_VALUE.HIGH);
SecondMoveInfo
.
EndMove
();
...
...
source/DeviceLibrary/assemblymanager/TrayManager.cs
查看文件 @
cece86d
...
...
@@ -57,7 +57,7 @@ namespace OnlineStore.DeviceLibrary
/// </summary>
/// <param name="trayNum">盘号1-6</param>
/// <returns>盘上是否有料盘</returns>
internal
static
bool
IsFixTure
Full
(
int
trayNum
)
internal
static
bool
TrayIs
Full
(
int
trayNum
)
{
lock
(
fixtureMapLock
)
{
...
...
@@ -129,7 +129,7 @@ namespace OnlineStore.DeviceLibrary
/// <summary>
/// 是否还有有料仓的盘
/// </summary>
internal
static
bool
IsHasFull
()
internal
static
bool
IsHasFull
Tray
()
{
foreach
(
int
key
in
fixtureCodeFullMap
.
Keys
)
{
...
...
source/DeviceLibrary/model/StoreStep.cs
查看文件 @
cece86d
...
...
@@ -379,7 +379,45 @@ namespace OnlineStore.DeviceLibrary
MO_60_UpDownCylinderUp
=
3160
,
#
region
入料模块,紧急出料移栽处理
/// <summary>
/// 紧急出料移栽:升降伺服到P1点
/// </summary>
MO_201_UpDownToP1
=
3201
,
/// <summary>
/// 紧急出料移栽:上料横移机构到放料端
/// /// </summary>
MO_202_MoveCylinder_Give
=
3202
,
/// <summary>
/// 紧急出料移栽:上料横移机构下降
/// /// </summary>
MO_203_MoveCylinder_Down
=
3203
,
/// <summary>
/// 紧急出料移栽:升降伺服下降到指定位置
/// /// </summary>
MO_204_UpdownAxisToP2
=
3204
,
/// <summary>
/// 紧急出料移栽:上料气缸夹紧
/// /// </summary>
MO_205_MoveCylinder_Tighten
=
3205
,
/// <summary>
/// 紧急出料移栽:升降伺服到P1
/// /// </summary>
MO_206_UpdownAxisToP1
=
3206
,
/// <summary>
/// 紧急出料移栽:上料横移机构上升
/// /// </summary>
MO_207_MoveCylinder_Up
=
3207
,
/// <summary>
/// 紧急出料移栽:上料横移机构到取料端
/// /// </summary>
MO_208_MoveCylinder_Take
=
3208
,
/// <summary>
/// 紧急出料移栽:等待料架准备好
/// /// </summary>
MO_209_Wait
=
3209
,
#
endregion
#
endregion
...
...
@@ -387,7 +425,7 @@ namespace OnlineStore.DeviceLibrary
#
region
横移轨道处理
5000
开始
SW00_Wait
=
5000
,
SW00_Wait
=
5000
,
/// <summary>
/// 定位气缸下降
/// </summary>
...
...
@@ -664,10 +702,122 @@ namespace OnlineStore.DeviceLibrary
#
region
入料装置出料处理,
12000
开始
/// <summary>
/// 出料流程:升降盘定位气缸后退
/// </summary>
FO_01_TrayLocation_After
=
12001
,
/// <summary>
/// 出料流程:定位气缸下降
/// </summary>
FO_02_LocationCylinder_Down
=
12002
,
/// <summary>
/// 入口流水线转动,等待出料检测信号消失
/// </summary>
FO_03_LineStart
=
12003
,
/// <summary>
/// 入口流水线转动,等待阻挡气缸信号到位
/// </summary>
FO_04_LineRunCheck
=
12004
,
/// <summary>
/// 入口流水线转动,等待出料阻挡信号消失
/// </summary>
FO_05_LineStart
=
12005
,
/// <summary>
/// 入口流水线转动,等待定位工位检测到位
/// </summary>
FO_06_LineRunCheck
=
12006
,
/// <summary>
///出料检测: 工位检测信号,定位气缸上升
/// </summary>
FO_07_LocationCylinder_Up
=
12007
,
/// <summary>
/// 出料检测:提升轴下降到位P2
/// </summary>
FO_08_BatchAxisToP2
=
12008
,
/// <summary>
/// 出料检测:升降盘定位气缸前进
/// </summary>
FO_09_TrayLocation_Before
=
12009
,
/// <summary>
/// 出料检测:上料轴开始慢速上升到P3点
/// </summary>
FO_10_AxisUpMove
=
12010
,
/// <summary>
/// 料盘移栽:上料轴下降指定的高度
/// </summary>
FO_11_AxisDownMove
=
12011
,
/// <summary>
/// 料盘移栽:出料横移机构下降
/// </summary>
FO_12_MoveCylinder_Down
=
12012
,
/// <summary>
/// 料盘移栽:出料横移机构放松
/// </summary>
FO_13_MoveCylinder_Slack
=
12013
,
/// <summary>
/// 料盘移栽:出料横移机构上升
/// </summary>
FO_14_MoveCylinder_Up
=
12014
,
/// <summary>
/// 出料完成,料盘已放入料架,提升伺服到P2点
/// </summary>
FO_31_BatchAxisToP2
=
12031
,
/// <summary>
/// 出料完成,升降盘定位气缸后退
/// </summary>
FO_32_TrayLocationCylinder_After
=
12032
,
/// <summary>
/// 出料完成,提升伺服到P1点
/// </summary>
FO_33_BatchAxisToP1
=
12033
,
/// <summary>
/// 出料完成,判断出料线体是否有料架
/// </summary>
FO_34_OutCheck
=
12034
,
/// <summary>
/// 出料完成,出口顶升气缸上升
/// </summary>
FO_35_OutTopCylinder_Up
=
12035
,
/// <summary>
///出料完成, 线体横移电机运转,等待料架到达出口
/// </summary>
FO_36_SideWayLineRun
=
12036
,
/// <summary>
///出料完成, 料架到达出口,线体横移电机停止
/// </summary>
FO_37_LineStop
=
12037
,
/// <summary>
///出料完成, 料架到达出口,出口顶升下降,定位气缸下降,
/// </summary>
FO_38_TopCylinderDown
=
12038
,
/// <summary>
///出料完成, 出口线体运转,料架到达出口处, 通知AGV取空料架
/// </summary>
FO_39_OutLineRun
=
12039
,
/// <summary>
///出料完成, AGV到达,继续转动出口线体,送走出料料架,
/// </summary>
FO_40_OutLineRun
=
12040
,
/// <summary>
///
///
出料完成, 料架送出,
/// </summary>
FO_
01_OutLineStart
=
12000
,
FO_
41_OutLineRun
=
12041
,
#
endregion
#
region
出料装置移栽出料,
20000
开始
...
...
source/DeviceLibrary/model/TrayInfo.cs
查看文件 @
cece86d
...
...
@@ -58,7 +58,7 @@ namespace OnlineStore.DeviceLibrary
/// </summary>
public
int
PlateW
{
get
;
set
;
}
public
bool
EmergencyOut
=
false
;
}
/// <summary>
/// 托盘上的物料的类型
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论