Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
孙克
/
ACSquareStore
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit 09f0b0cf
由
LN
编写于
2020-03-26 19:10:30 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
界面修改:DO列表无内容。点动选择速度无效果。
出入库时:托架必须在后退端 出入库时:增加料架信号检测验证(可勾选) 回原点时:前后轴和升降轴不能同时运动。先回升降轴,再回前后轴
1 个父辈
60c16229
隐藏空白字符变更
内嵌
并排
正在显示
13 个修改的文件
包含
324 行增加
和
947 行删除
source/ACSquareStore/App.config
source/ACSquareStore/FrmIOStatus.Designer.cs
source/ACSquareStore/FrmIOStatus.cs
source/ACSquareStore/FrmStoreBox.Designer.cs
source/ACSquareStore/FrmStoreBox.cs
source/ACSquareStore/记录.txt
source/Common/Setting_Init.cs
source/DeviceLibrary/PanasonicServo/ACServerManager.cs
source/DeviceLibrary/acSquareStore/Square_BoxBean.cs
source/DeviceLibrary/acSquareStore/Square_BoxBean_Partial.cs
source/DeviceLibrary/acSquareStore/StoreManager.cs
source/DeviceLibrary/lineConnect/LineConnect.cs
source/DeviceLibrary/store/StoreStep.cs
source/ACSquareStore/App.config
查看文件 @
09f0b0c
...
...
@@ -30,7 +30,8 @@
<!--温控器类型,
0
=壁挂王字壳温湿度变送器,
1
=妙昕温湿度记录仪-->
<
add
key
=
"HumitureControllerType"
value
=
"0"
/>
<
add
key
=
"UseAIOBOX"
value
=
"1"
/>
<!--是否启用物料检测信号-->
<
add
key
=
"UseTrayCheck"
value
=
"0"
/>
<!--是否调试状态-->
<
add
key
=
"IsInDebug"
value
=
"1"
/>
</
appSettings
>
...
...
source/ACSquareStore/FrmIOStatus.Designer.cs
查看文件 @
09f0b0c
...
...
@@ -406,14 +406,13 @@
// cmbWriteIO
//
this
.
cmbWriteIO
.
DisplayMember
=
"ProName"
;
this
.
cmbWriteIO
.
DrawMode
=
System
.
Windows
.
Forms
.
DrawMode
.
OwnerDrawVariable
;
this
.
cmbWriteIO
.
DropDownStyle
=
System
.
Windows
.
Forms
.
ComboBoxStyle
.
DropDownList
;
this
.
cmbWriteIO
.
Font
=
new
System
.
Drawing
.
Font
(
"微软雅黑"
,
9F
,
System
.
Drawing
.
FontStyle
.
Regular
,
System
.
Drawing
.
GraphicsUnit
.
Point
,
((
byte
)(
134
)));
this
.
cmbWriteIO
.
FormattingEnabled
=
true
;
this
.
cmbWriteIO
.
ItemHeight
=
22
;
this
.
cmbWriteIO
.
ItemHeight
=
17
;
this
.
cmbWriteIO
.
Location
=
new
System
.
Drawing
.
Point
(
17
,
25
);
this
.
cmbWriteIO
.
Name
=
"cmbWriteIO"
;
this
.
cmbWriteIO
.
Size
=
new
System
.
Drawing
.
Size
(
358
,
2
8
);
this
.
cmbWriteIO
.
Size
=
new
System
.
Drawing
.
Size
(
358
,
2
5
);
this
.
cmbWriteIO
.
TabIndex
=
234
;
this
.
cmbWriteIO
.
ValueMember
=
"ProName"
;
this
.
cmbWriteIO
.
SelectedIndexChanged
+=
new
System
.
EventHandler
(
this
.
cmbWriteIO_SelectedIndexChanged_1
);
...
...
source/ACSquareStore/FrmIOStatus.cs
查看文件 @
09f0b0c
...
...
@@ -68,7 +68,7 @@ namespace OnlineStore.ACSquareStore
DOControlList
.
Add
(
ioValue
.
ProName
,
control
);
}
this
.
SuspendLayout
();
//此处为不闪屏,一定要有的!
cmbWriteIO
.
DataSource
=
new
List
<
ConfigIO
>(
boxBean
.
Config
.
StoreDOList
.
Values
);
cmbWriteIO
.
ValueMember
=
"ProName"
;
cmbWriteIO
.
DisplayMember
=
"DisplayStr"
;
...
...
source/ACSquareStore/FrmStoreBox.Designer.cs
查看文件 @
09f0b0c
...
...
@@ -170,6 +170,7 @@
this
.
button4
=
new
System
.
Windows
.
Forms
.
Button
();
this
.
btnClearL
=
new
System
.
Windows
.
Forms
.
Button
();
this
.
btnLogDebug
=
new
System
.
Windows
.
Forms
.
Button
();
this
.
chbUseTrayCheck
=
new
System
.
Windows
.
Forms
.
CheckBox
();
this
.
groupAxis
.
SuspendLayout
();
this
.
groupBox1
.
SuspendLayout
();
this
.
groupInout
.
SuspendLayout
();
...
...
@@ -1624,7 +1625,7 @@
this
.
chbDebug
.
Anchor
=
((
System
.
Windows
.
Forms
.
AnchorStyles
)((
System
.
Windows
.
Forms
.
AnchorStyles
.
Top
|
System
.
Windows
.
Forms
.
AnchorStyles
.
Right
)));
this
.
chbDebug
.
AutoSize
=
true
;
this
.
chbDebug
.
Font
=
new
System
.
Drawing
.
Font
(
"微软雅黑"
,
10.5F
,
System
.
Drawing
.
FontStyle
.
Regular
,
System
.
Drawing
.
GraphicsUnit
.
Point
,
((
byte
)(
134
)));
this
.
chbDebug
.
Location
=
new
System
.
Drawing
.
Point
(
8
08
,
12
);
this
.
chbDebug
.
Location
=
new
System
.
Drawing
.
Point
(
8
45
,
12
);
this
.
chbDebug
.
Name
=
"chbDebug"
;
this
.
chbDebug
.
Size
=
new
System
.
Drawing
.
Size
(
84
,
24
);
this
.
chbDebug
.
TabIndex
=
271
;
...
...
@@ -1863,6 +1864,7 @@
//
// tabPage4
//
this
.
tabPage4
.
Controls
.
Add
(
this
.
chbUseTrayCheck
);
this
.
tabPage4
.
Controls
.
Add
(
this
.
btnStoreExit
);
this
.
tabPage4
.
Controls
.
Add
(
this
.
chbDebug
);
this
.
tabPage4
.
Controls
.
Add
(
this
.
btnStoreHome
);
...
...
@@ -2074,6 +2076,19 @@
this
.
btnLogDebug
.
UseVisualStyleBackColor
=
true
;
this
.
btnLogDebug
.
Click
+=
new
System
.
EventHandler
(
this
.
开启
DEBUGToolStripMenuItem_Click
);
//
// chbUseTrayCheck
//
this
.
chbUseTrayCheck
.
Anchor
=
((
System
.
Windows
.
Forms
.
AnchorStyles
)((
System
.
Windows
.
Forms
.
AnchorStyles
.
Top
|
System
.
Windows
.
Forms
.
AnchorStyles
.
Right
)));
this
.
chbUseTrayCheck
.
AutoSize
=
true
;
this
.
chbUseTrayCheck
.
Font
=
new
System
.
Drawing
.
Font
(
"微软雅黑"
,
10.5F
,
System
.
Drawing
.
FontStyle
.
Regular
,
System
.
Drawing
.
GraphicsUnit
.
Point
,
((
byte
)(
134
)));
this
.
chbUseTrayCheck
.
Location
=
new
System
.
Drawing
.
Point
(
699
,
12
);
this
.
chbUseTrayCheck
.
Name
=
"chbUseTrayCheck"
;
this
.
chbUseTrayCheck
.
Size
=
new
System
.
Drawing
.
Size
(
112
,
24
);
this
.
chbUseTrayCheck
.
TabIndex
=
272
;
this
.
chbUseTrayCheck
.
Text
=
"启用物料检测"
;
this
.
chbUseTrayCheck
.
UseVisualStyleBackColor
=
true
;
this
.
chbUseTrayCheck
.
CheckedChanged
+=
new
System
.
EventHandler
(
this
.
chbUseTrayCheck_CheckedChanged
);
//
// FrmStoreBox
//
this
.
AutoScaleDimensions
=
new
System
.
Drawing
.
SizeF
(
96F
,
96F
);
...
...
@@ -2265,6 +2280,7 @@
private
System
.
Windows
.
Forms
.
Button
btnOpenRDoor
;
private
System
.
Windows
.
Forms
.
Button
btnOpenLDoor
;
private
System
.
Windows
.
Forms
.
ComboBox
cmbHumpPort
;
private
System
.
Windows
.
Forms
.
CheckBox
chbUseTrayCheck
;
}
}
source/ACSquareStore/FrmStoreBox.cs
查看文件 @
09f0b0c
...
...
@@ -60,6 +60,7 @@ namespace OnlineStore.ACSquareStore
{
cmbHumpPort
.
SelectedIndex
=
0
;
}
chbUseTrayCheck
.
Checked
=
StoreManager
.
UseShelfCheck
;
// txtTempPort.Text = store.Config.Humiture_Port;
LoadOk
=
true
;
...
...
@@ -1188,8 +1189,8 @@ namespace OnlineStore.ACSquareStore
{
DebugStatus
(
false
);
}
}
}
private
void
chbDebug_CheckedChanged
(
object
sender
,
EventArgs
e
)
{
if
(!
LoadOk
)
...
...
@@ -1223,7 +1224,7 @@ namespace OnlineStore.ACSquareStore
}
}
}
}
}
private
void
btnUpdown_Click
(
object
sender
,
EventArgs
e
)
{
string
PortName
=
store
.
Config
.
UpDown_Axis
.
DeviceName
;
...
...
@@ -1289,5 +1290,20 @@ namespace OnlineStore.ACSquareStore
BtnMove
(
btnOpenRDoor
,
"右侧门锁-打开"
,
"右侧门锁-关闭"
,
IO_Type
.
RightDoor_Close
);
}
private
void
chbUseTrayCheck_CheckedChanged
(
object
sender
,
EventArgs
e
)
{
if
(!
LoadOk
)
{
return
;
}
if
(
chbUseTrayCheck
.
Checked
.
Equals
(
StoreManager
.
UseShelfCheck
))
{
return
;
}
StoreManager
.
UseShelfCheck
=
chbUseTrayCheck
.
Checked
;
ConfigAppSettings
.
SaveValue
(
Setting_Init
.
UseTrayCheck
,
chbUseTrayCheck
.
Checked
?
1
:
0
);
LogUtil
.
info
(
"点击:启用物料检测 = "
+
chbUseTrayCheck
.
Checked
);
}
}
}
source/ACSquareStore/记录.txt
查看文件 @
09f0b0c
...
...
@@ -31,9 +31,9 @@
新建分支ACSquareStore,做为方仓项目。
方仓三个轴:
伺服X轴 1 前原点后正限
伺服Z轴
2 下原点上正限
伺服Y轴 3 中间原点前正限后负限
伺服X轴
-前后轴
1 前原点后正限
伺服Z轴
-升降轴
2 下原点上正限
伺服Y轴
-进出轴
3 中间原点前正限后负限
三个温湿度:
温湿度1 单接com2
温湿度2 单接com3
...
...
@@ -41,3 +41,17 @@
20200320
轴名称修改:X轴-前后轴,Y轴-进出轴。
需需修改?
回原点时:前后轴和升降轴不能同时运动。先回升降轴,再回前后轴
出入库时:托架必须在后退端
出入库时:增加料架信号检测验证(可勾选)
界面修改:DO列表无内容。点动选择速度无效果。
需要增加电池?伺服回好原点之后不需要每次回原点。
20200325修改:
界面修改:DO列表无内容。点动选择速度无效果。
出入库时:托架必须在后退端
出入库时:增加料架信号检测验证(可勾选)
回原点时:前后轴和升降轴不能同时运动。先回升降轴,再回前后轴
source/Common/Setting_Init.cs
查看文件 @
09f0b0c
...
...
@@ -89,7 +89,10 @@ namespace OnlineStore.Common
public
static
string
Tool_P6_Offset
=
"Tool_P6_Offset"
;
public
static
string
Tool_TargetSpeed
=
"Tool_TargetSpeed"
;
public
static
string
Tool_TargetPosition
=
"Tool_TargetPosition"
;
public
static
string
Tool_TargetPosition
=
"Tool_TargetPosition"
;
public
static
string
UseTrayCheck
=
"UseTrayCheck"
;
}
}
source/DeviceLibrary/PanasonicServo/ACServerManager.cs
查看文件 @
09f0b0c
...
...
@@ -8,18 +8,18 @@ using System.Text;
using
System.Threading
;
namespace
OnlineStore.DeviceLibrary
{
{
/// <summary>
/// 外部调用的接口放在此文件中
/// </summary>
public
partial
class
ACServerManager
{
public
static
bool
IsShowMsg
=
false
;
public
static
bool
IsShowMsg
=
false
;
private
static
int
SleepMSendons
=
20
;
private
static
int
ReviceOutTimeMS
=
100
;
private
static
Dictionary
<
string
,
Dictionary
<
string
,
int
>>
ComAddrValue
=
new
Dictionary
<
string
,
Dictionary
<
string
,
int
>>();
private
static
string
mapObj
=
""
;
private
static
Dictionary
<
string
,
Dictionary
<
string
,
int
>>
ComAddrValue
=
new
Dictionary
<
string
,
Dictionary
<
string
,
int
>>();
private
static
string
mapObj
=
""
;
private
static
int
GetAddrValue
(
string
portName
,
int
slvAddr
,
string
addr
)
{
int
value
=
-
1
;
...
...
@@ -137,8 +137,8 @@ namespace OnlineStore.DeviceLibrary
ColsePort
(
key
);
}
}
/// <summary>
/// 是否成功打开伺服
/// </summary>
...
...
@@ -146,15 +146,15 @@ namespace OnlineStore.DeviceLibrary
{
if
(!
serialBeanMap
.
ContainsKey
(
portName
))
{
return
false
;
return
false
;
}
PreReadCoilAddr
=
ACCMDManager
.
ServerOn_Addr
;
byte
[]
dataArray
=
ACCMDManager
.
GetWriteData
(
slvAddr
,
ACCMDManager
.
CMD_ReadCoil
,
PreReadCoilAddr
,
"0000"
,
1
);
//SendData(portName,dataArray);
byte
[]
reviceData
=
SendCommand
(
portName
,
dataArray
,
ReviceOutTimeMS
,
6
);
int
result
=
GetCoilData
(
portName
,
reviceData
,
PreReadCoilAddr
);
int
result
=
GetCoilData
(
portName
,
reviceData
,
PreReadCoilAddr
);
//TODO
return
result
>=
1
;
return
result
>=
1
;
}
/// <summary>
/// 是否原点返回完成
...
...
@@ -162,23 +162,25 @@ namespace OnlineStore.DeviceLibrary
public
static
bool
IsHomeMoveEnd
(
string
portName
,
int
slvAddr
)
{
int
status
=
GetHomeEndStatus
(
portName
,
slvAddr
);
if
(
status
>=
1
)
bool
isOk
=
ACServerManager
.
GetBusyStatus
(
portName
,
slvAddr
).
Equals
(
0
);
if
(
status
>=
1
&&
isOk
)
{
return
true
;
}
return
false
;
}
return
false
;
}
public
static
void
InitSlvAddr
(
string
portName
,
int
slvAddr
)
{
InitSlvAddr
(
portName
,
slvAddr
,
100
,
30
,
30
);
InitSlvAddr
(
portName
,
slvAddr
,
100
,
30
,
30
);
//InitSlvAddr(portName, slvAddr, 100, 30, 30, 100, 50, 30);
}
//把数字转换为四位的字符串
public
static
string
SpeedToStr
(
int
speed
,
int
length
)
public
static
string
SpeedToStr
(
int
speed
,
int
length
)
{
string
str
=
String
.
Format
(
"{0:X}"
,
speed
);
return
str
.
PadLeft
(
length
,
'0'
);
}
public
static
void
InitSlvAddr
(
string
portName
,
int
slvAddr
,
int
targetSpeed
,
int
addSpeed
,
int
delSpeed
)
public
static
void
InitSlvAddr
(
string
portName
,
int
slvAddr
,
int
targetSpeed
,
int
addSpeed
,
int
delSpeed
)
//public static void InitSlvAddr(string portName, int slvAddr,int targetSpeed,int addSpeed,int delSpeed,int homeHighSpeed,int homeLowSpeed,int homeAddSpeed)
{
LogUtil
.
info
(
"开始初始化伺服【"
+
portName
+
"】【"
+
slvAddr
+
"】"
);
...
...
@@ -187,10 +189,10 @@ namespace OnlineStore.DeviceLibrary
string
slvAddrStr
=
string
.
Format
(
strFromat
,
slvAddr
);
//block0=原点返回,正方向
string
str0
=
slvAddrStr
+
"104800 000408 00000420 00000000 ffff"
;
SendStrAndSleep
(
portName
,
str0
,
sleep
);
SendStrAndSleep
(
portName
,
str0
,
sleep
);
//block1=原点返回,反方向
string
str1
=
slvAddrStr
+
"104804 000408 04000420 00000000 ffff"
;
SendStrAndSleep
(
portName
,
str1
,
sleep
);
SendStrAndSleep
(
portName
,
str1
,
sleep
);
//block2=绝对位置运动
string
str2
=
slvAddrStr
+
"104808 000408 10000211EC78FFFF ffff"
;
SendStrAndSleep
(
portName
,
str2
,
sleep
);
...
...
@@ -233,7 +235,7 @@ namespace OnlineStore.DeviceLibrary
public
static
void
UpdateEEPROM
(
string
portName
,
int
slvAddr
)
{
string
addr
=
ACCMDManager
.
EEPROM_Param_Addr
;
string
data
=
"6173"
;
string
data
=
"6173"
;
int
length
=
2
;
byte
[]
dataArray
=
ACCMDManager
.
GetWriteData
(
slvAddr
,
ACCMDManager
.
CMD_WriteRegisters
,
addr
,
data
,
length
);
SendData
(
portName
,
dataArray
,
5
);
...
...
@@ -259,13 +261,13 @@ namespace OnlineStore.DeviceLibrary
SendData
(
portName
,
dataArray
);
}
public
static
void
RelMove
(
string
portName
,
int
slvAddr
,
int
position
,
int
targetSpeed
)
{
public
static
void
RelMove
(
string
portName
,
int
slvAddr
,
int
position
,
int
targetSpeed
)
{
//先更新速度
string
slvAddrStr
=
string
.
Format
(
strFromat
,
slvAddr
);
string
slvAddrStr
=
string
.
Format
(
strFromat
,
slvAddr
);
string
v1
=
slvAddrStr
+
"064601 "
+
SpeedToStr
(
targetSpeed
,
4
)
+
" ffff"
;
SendStrAndSleep
(
portName
,
v1
,
SleepMSendons
);
SendStrAndSleep
(
portName
,
v1
,
SleepMSendons
);
RelMove
(
portName
,
slvAddr
,
position
);
}
public
static
void
RelMove
(
string
portName
,
int
slvAddr
,
int
position
)
...
...
@@ -307,8 +309,8 @@ namespace OnlineStore.DeviceLibrary
}
data
=
ACCMDManager
.
buildCheckData
(
data
,
data
.
Length
-
2
);
SendData
(
portName
,
data
);
System
.
Threading
.
Thread
.
Sleep
(
SleepMSendons
);
UpdateBlock
(
portName
,
slvAddr
,
ACCMDManager
.
Block_RelMove
);
System
.
Threading
.
Thread
.
Sleep
(
SleepMSendons
);
UpdateBlock
(
portName
,
slvAddr
,
ACCMDManager
.
Block_RelMove
);
OpenAndCloseSTB
(
portName
,
slvAddr
);
}
...
...
@@ -323,8 +325,8 @@ namespace OnlineStore.DeviceLibrary
int
isHomeEnd
=
GetHomeEndStatus
(
portName
,
slvAddr
);
if
(
isHomeEnd
.
Equals
(
1
))
{
int
value
=
2000
;
LogUtil
.
info
(
"轴【"
+
portName
+
"_"
+
slvAddr
+
"】原点返回时发现原点已亮且回过原点,需要先相对走"
+
value
);
int
value
=
2000
;
LogUtil
.
info
(
"轴【"
+
portName
+
"_"
+
slvAddr
+
"】原点返回时发现原点已亮且回过原点,需要先相对走"
+
value
);
RelMove
(
portName
,
slvAddr
,
value
);
bool
isStop
=
false
;
for
(
int
i
=
0
;
i
<=
10
;
i
++)
...
...
@@ -345,10 +347,10 @@ namespace OnlineStore.DeviceLibrary
}
else
{
int
volSpeed
=
Math
.
Abs
(
speed
/
5
);
int
volSpeed
=
Math
.
Abs
(
speed
/
5
);
int
time
=
1500
;
LogUtil
.
info
(
"轴【"
+
portName
+
"_"
+
slvAddr
+
"】原点返回时发现原点已亮但未回过原点,先匀速向上走"
+
time
+
",速度["
+
volSpeed
+
"]"
);
LogUtil
.
info
(
"轴【"
+
portName
+
"_"
+
slvAddr
+
"】原点返回时发现原点已亮但未回过原点,先匀速向上走"
+
time
+
",速度["
+
volSpeed
+
"]"
);
//需要匀速向上走
ACServerManager
.
SpeedMove
(
portName
,
slvAddr
,
volSpeed
);
Thread
.
Sleep
(
time
);
...
...
@@ -357,7 +359,7 @@ namespace OnlineStore.DeviceLibrary
Thread
.
Sleep
(
100
);
}
}
}
catch
(
Exception
ex
)
}
catch
(
Exception
ex
)
{
LogUtil
.
error
(
"轴【"
+
portName
+
"_"
+
slvAddr
+
"】原点返回前验证是否在原点出错:"
+
ex
.
StackTrace
);
}
...
...
@@ -368,8 +370,9 @@ namespace OnlineStore.DeviceLibrary
}
public
static
void
SetSpeed
(
string
portName
,
int
slvAddr
,
int
speed
)
{
speed
=
Math
.
Abs
(
speed
);
int
preSpeed
=
GetAddrValue
(
portName
,
slvAddr
,
ACCMDManager
.
Speed_Addr
);
if
((
preSpeed
.
Equals
(-
1
))
||
(!
preSpeed
.
Equals
(
Math
.
Abs
(
speed
)
)))
if
((
preSpeed
.
Equals
(-
1
))
||
(!
preSpeed
.
Equals
(
speed
)))
{
string
v1
=
slvAddr
+
"064601 "
+
ACServerManager
.
SpeedToStr
(
speed
,
4
)
+
" ffff"
;
LogUtil
.
debug
(
"轴【"
+
portName
+
"_"
+
slvAddr
+
"】更新速度为【"
+
speed
+
"】,发送数据【"
+
v1
+
"】"
);
...
...
@@ -386,20 +389,20 @@ namespace OnlineStore.DeviceLibrary
LogUtil
.
error
(
"轴【"
+
portName
+
"_"
+
slvAddr
+
"】更新速度为【"
+
speed
+
"】,发送数据【"
+
v1
+
"】,第【"
+
i
+
"】次失败"
);
Thread
.
Sleep
(
SleepMSendons
);
}
}
UpdateAddrValue
(
portName
,
slvAddr
,
ACCMDManager
.
Speed_Addr
,
Math
.
Abs
(
speed
)
);
}
UpdateAddrValue
(
portName
,
slvAddr
,
ACCMDManager
.
Speed_Addr
,
speed
);
Thread
.
Sleep
(
SleepMSendons
);
}
}
public
static
void
SpeedMove
(
string
portName
,
int
slvAddr
,
int
speed
)
{
SetSpeed
(
portName
,
slvAddr
,
speed
);
SetSpeed
(
portName
,
slvAddr
,
speed
);
if
(
speed
>
0
)
{
{
UpdateBlock
(
portName
,
slvAddr
,
ACCMDManager
.
Block_VolMove0
);
}
else
{
{
UpdateBlock
(
portName
,
slvAddr
,
ACCMDManager
.
Block_VolMove1
);
}
//Thread.Sleep(SleepMSendons);
...
...
@@ -425,13 +428,13 @@ namespace OnlineStore.DeviceLibrary
//先更新速度
string
slvAddrStr
=
string
.
Format
(
strFromat
,
slvAddr
);
int
preSpeed
=
GetAddrValue
(
portName
,
slvAddr
,
ACCMDManager
.
Speed_Addr
);
int
preSpeed
=
GetAddrValue
(
portName
,
slvAddr
,
ACCMDManager
.
Speed_Addr
);
if
((
preSpeed
.
Equals
(-
1
))
||
(!
preSpeed
.
Equals
(
targetSpeed
)))
{
//速度 V1 =100
string
v1
=
slvAddrStr
+
"064601 "
+
SpeedToStr
(
targetSpeed
,
4
)
+
" ffff"
;
SendStrAndSleep
(
portName
,
v1
,
SleepMSendons
);
UpdateAddrValue
(
portName
,
slvAddr
,
ACCMDManager
.
Speed_Addr
,
targetSpeed
);
UpdateAddrValue
(
portName
,
slvAddr
,
ACCMDManager
.
Speed_Addr
,
targetSpeed
);
}
//绝对运动
AbsMove
(
portName
,
slvAddr
,
targetPosition
);
...
...
@@ -484,3 +487,4 @@ namespace OnlineStore.DeviceLibrary
}
}
}
source/DeviceLibrary/acSquareStore/Square_BoxBean.cs
查看文件 @
09f0b0c
...
...
@@ -209,7 +209,7 @@ namespace OnlineStore.DeviceLibrary
storeRunStatus
=
StoreRunStatus
.
HomeMoving
;
StoreMove
.
NewMove
(
StoreMoveType
.
ReturnHome
);
StoreMove
.
NextMoveStep
(
StoreMoveStep
.
BOX_H
_InOutBack
);
StoreMove
.
NextMoveStep
(
StoreMoveStep
.
SH_12
_InOutBack
);
ACAxisHomeMove
(
Config
.
InOut_Axis
);
LogUtil
.
info
(
LOGGER
,
StoreName
+
"开始原点返回,先把进出轴回原点"
);
...
...
@@ -217,14 +217,11 @@ namespace OnlineStore.DeviceLibrary
}
public
void
MoveToP1
()
{
//
压紧轴回原点,
叉子回到P1,关闭门前后轴和升降轴回到P1
//叉子回到P1,关闭门前后轴和升降轴回到P1
StoreMove
.
NewMove
(
StoreMoveType
.
StoreReset
);
StoreMove
.
NextMoveStep
(
StoreMoveStep
.
BOX_M_H_TOP1_InOutToP1
);
LogUtil
.
info
(
LOGGER
,
StoreName
+
"到待机状态,进出轴到P1,判断叉子没有料盘"
);
ACAxisMove
(
Config
.
InOut_Axis
,
Config
.
InOutAxis_P1_Position
,
Config
.
InOutAxis_P1_Speed
);
//ComBeforeHomeMove();
//判断叉子没有料盘
//StoreMove.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.TrayCheck_Fixture, IO_VALUE.LOW));
StoreMove
.
NextMoveStep
(
StoreMoveStep
.
SP1_01_InOutToP1
);
LogUtil
.
info
(
LOGGER
,
StoreName
+
"到待机状态,进出轴到P1"
);
ACAxisMove
(
Config
.
InOut_Axis
,
Config
.
InOutAxis_P1_Position
,
Config
.
InOutAxis_P1_Speed
);
}
public
override
void
Reset
(
bool
isNeedClearAuto
=
true
)
...
...
@@ -274,7 +271,7 @@ namespace OnlineStore.DeviceLibrary
LeftShlefMove
.
Stop
();
RightShelfMove
.
Stop
();
StoreMove
.
NextMoveStep
(
StoreMoveStep
.
BOX_H
_InOutBack
);
StoreMove
.
NextMoveStep
(
StoreMoveStep
.
SH_12
_InOutBack
);
LogUtil
.
info
(
LOGGER
,
StoreName
+
"复位中,进出轴开始原点返回"
);
ACAxisHomeMove
(
Config
.
InOut_Axis
);
StoreMove
.
WaitList
.
Add
(
WaitResultInfo
.
WaitTime
(
2000
));
...
...
@@ -299,26 +296,26 @@ namespace OnlineStore.DeviceLibrary
}
switch
(
StoreMove
.
MoveStep
)
{
case
StoreMoveStep
.
BOX_H
_LocationCylinderBack
:
case
StoreMoveStep
.
SH_10
_LocationCylinderBack
:
InoutStartReset
();
break
;
case
StoreMoveStep
.
BOX_H
_InOutMove
:
StoreMove
.
NextMoveStep
(
StoreMoveStep
.
BOX_H
_InOutBack
);
case
StoreMoveStep
.
SH_11
_InOutMove
:
StoreMove
.
NextMoveStep
(
StoreMoveStep
.
SH_12
_InOutBack
);
ACAxisHomeMove
(
Config
.
InOut_Axis
);
LogUtil
.
info
(
LOGGER
,
StoreName
+
logName
+
" 进出轴开始原点返回"
);
LogUtil
.
info
(
LOGGER
,
StoreName
+
logName
+
" 进出轴开始原点返回"
);
StoreMove
.
WaitList
.
Add
(
WaitResultInfo
.
WaitTime
(
2000
));
break
;
case
StoreMoveStep
.
BOX_H
_InOutBack
:
case
StoreMoveStep
.
SH_12
_InOutBack
:
Thread
.
Sleep
(
200
);
StoreMove
.
NextMoveStep
(
StoreMoveStep
.
BOX_H
_InOutToP1
);
StoreMove
.
NextMoveStep
(
StoreMoveStep
.
SH_13
_InOutToP1
);
LogUtil
.
info
(
LOGGER
,
StoreName
+
logName
+
" 进出轴到待机点P1,关闭左右两侧门"
);
//进出轴原点返回完成,将进出轴的位置设置=0
AxisCountClear
(
Config
.
InOut_Axis
);
ACAxisMove
(
Config
.
InOut_Axis
,
Config
.
InOutAxis_P1_Position
,
Config
.
InOutAxis_P1_Speed
);
CloseDoor
(
1
,
StoreMove
);
CloseDoor
(
2
,
StoreMove
);
CloseDoor
(
1
,
StoreMove
);
CloseDoor
(
2
,
StoreMove
);
break
;
case
StoreMoveStep
.
BOX_H
_InOutToP1
:
case
StoreMoveStep
.
SH_13
_InOutToP1
:
//如果此时轴三还在报警,需要提示错误并等待
if
(
ACServerManager
.
GetAlarmStatus
(
Config
.
InOut_Axis
.
DeviceName
,
Config
.
InOut_Axis
.
GetAxisValue
())
>
0
)
{
...
...
@@ -326,23 +323,28 @@ namespace OnlineStore.DeviceLibrary
}
//复位和回原点要等轴3进出轴ORG亮了以后才能返回其他轴
LogUtil
.
info
(
LOGGER
,
StoreName
+
logName
+
"
压紧轴,
前后轴,升降轴开始 原点返回 ,左右托盘前进"
);
StoreMove
.
NextMoveStep
(
StoreMoveStep
.
BOX_H_OtherAxis
Back
);
LogUtil
.
info
(
LOGGER
,
StoreName
+
logName
+
" 前后轴,升降轴开始 原点返回 ,左右托盘前进"
);
StoreMove
.
NextMoveStep
(
StoreMoveStep
.
SH_14_Updown
Back
);
StoreMove
.
TimeOutSeconds
=
100
;
ACAxisHomeMove
(
Config
.
Middle_Axis
);
ACAxisHomeMove
(
Config
.
UpDown_Axis
);
ShelfForward
(
1
);
ShelfForward
(
2
);
break
;
case
StoreMoveStep
.
BOX_H_OtherAxisBack
:
case
StoreMoveStep
.
SH_14_UpdownBack
:
StoreMove
.
NextMoveStep
(
StoreMoveStep
.
SH_15_MiddleBack
);
StoreMove
.
TimeOutSeconds
=
100
;
ACAxisHomeMove
(
Config
.
Middle_Axis
);
break
;
case
StoreMoveStep
.
SH_15_MiddleBack
:
StoreMove
.
NextMoveStep
(
StoreMoveStep
.
BOX_H_Middle
AxisToP1
);
LogUtil
.
info
(
LOGGER
,
StoreName
+
logName
+
" 前后轴运动到P1,升降轴走到P1,
压紧轴到P1!
"
);
StoreMove
.
NextMoveStep
(
StoreMoveStep
.
SH_16_Other
AxisToP1
);
LogUtil
.
info
(
LOGGER
,
StoreName
+
logName
+
" 前后轴运动到P1,升降轴走到P1,
托架前进到位
"
);
ACAxisMove
(
Config
.
Middle_Axis
,
Config
.
MiddleAxis_P1_Position
,
Config
.
MiddleAxis_P1_Speed
);
ACAxisMove
(
Config
.
UpDown_Axis
,
Config
.
UpDownAxis_DoorO_P1
,
Config
.
UpDownAxis_P1_Speed
);
ACAxisMove
(
Config
.
UpDown_Axis
,
Config
.
UpDownAxis_DoorO_P1
,
Config
.
UpDownAxis_P1_Speed
);
ShelfForward
(
1
,
StoreMove
);
ShelfForward
(
2
,
StoreMove
);
break
;
case
StoreMoveStep
.
BOX_H_Middle
AxisToP1
:
case
StoreMoveStep
.
SH_16_Other
AxisToP1
:
LogUtil
.
info
(
LOGGER
,
StoreName
+
"复位完成"
);
storeRunStatus
=
StoreRunStatus
.
Runing
;
StoreMove
.
EndMove
();
...
...
@@ -353,21 +355,26 @@ namespace OnlineStore.DeviceLibrary
}
break
;
case
StoreMoveStep
.
BOX_M_H_TOP
1_InOutToP1
:
StoreMove
.
NextMoveStep
(
StoreMoveStep
.
BOX_M_H_TOP1_CompressHome
);
LogUtil
.
info
(
LOGGER
,
StoreName
+
"到待机状态,
压紧轴回原点,关闭左右两侧门
"
);
case
StoreMoveStep
.
SP1_0
1_InOutToP1
:
StoreMove
.
NextMoveStep
(
StoreMoveStep
.
SP1_02_CloseDoor
);
LogUtil
.
info
(
LOGGER
,
StoreName
+
"到待机状态,
关闭左右两侧门,托架前进
"
);
CloseDoor
(
1
,
StoreMove
);
CloseDoor
(
2
,
StoreMove
);
break
;
case
StoreMoveStep
.
BOX_M_H_TOP1_CompressHome
:
StoreMove
.
NextMoveStep
(
StoreMoveStep
.
BOX_M_H_TOP1_OtherAxisToP1
);
LogUtil
.
info
(
LOGGER
,
StoreName
+
"到待机状态:前后轴运动到P1,升降轴走到P1,压紧轴到P1,左右托架前进"
);
ACAxisMove
(
Config
.
Middle_Axis
,
Config
.
MiddleAxis_P1_Position
,
Config
.
MiddleAxis_P1_Speed
);
case
StoreMoveStep
.
SP1_02_CloseDoor
:
StoreMove
.
NextMoveStep
(
StoreMoveStep
.
SP1_03_OtherAxisToP1
);
LogUtil
.
info
(
LOGGER
,
StoreName
+
"到待机状态:升降轴走到P1,前后轴到P1"
);
ACAxisMove
(
Config
.
UpDown_Axis
,
Config
.
UpDownAxis_DoorO_P1
,
Config
.
UpDownAxis_P1_Speed
);
ShelfForward
(
1
);
ShelfForward
(
2
);
ACAxisMove
(
Config
.
Middle_Axis
,
Config
.
MiddleAxis_P1_Position
,
Config
.
MiddleAxis_P1_Speed
);
break
;
case
StoreMoveStep
.
BOX_M_H_TOP1_OtherAxisToP1
:
case
StoreMoveStep
.
SP1_03_OtherAxisToP1
:
StoreMove
.
NextMoveStep
(
StoreMoveStep
.
SP1_04_ShelfForward
);
LogUtil
.
info
(
LOGGER
,
StoreName
+
"到待机状态:托架前进"
);
ShelfForward
(
1
,
StoreMove
);
ShelfForward
(
2
,
StoreMove
);
break
;
case
StoreMoveStep
.
SP1_04_ShelfForward
:
LogUtil
.
info
(
LOGGER
,
StoreName
+
"到待机状态完成"
);
StoreMove
.
EndMove
();
storeStatus
=
StoreStatus
.
StoreOnline
;
...
...
@@ -376,6 +383,7 @@ namespace OnlineStore.DeviceLibrary
{
WarnMsg
=
""
;
}
break
;
default
:
break
;
...
...
@@ -1441,8 +1449,8 @@ namespace OnlineStore.DeviceLibrary
{
if
(
storeRunStatus
.
Equals
(
StoreRunStatus
.
Runing
)
&&
IOManager
.
IOValue
(
IO_Type
.
TrayCheck_Fixture
).
Equals
(
IO_VALUE
.
HIGH
))
{
boxStatus
.
msg
=
"
叉子料盘
检测有料,请检查"
;
lineOperation
.
msg
=
"
叉子料盘
检测有料,请检查"
;
boxStatus
.
msg
=
"
货叉物料
检测有料,请检查"
;
lineOperation
.
msg
=
"
货叉物料
检测有料,请检查"
;
}
}
CodeMsg
=
""
;
...
...
source/DeviceLibrary/acSquareStore/Square_BoxBean_Partial.cs
查看文件 @
09f0b0c
...
...
@@ -176,7 +176,7 @@ namespace OnlineStore.DeviceLibrary
{
wait
.
IsEnd
=
IOManager
.
IOValue
(
wait
.
IoType
).
Equals
(
wait
.
IoValue
);
int
timeOutMs
=
Config
.
IOSingle_TimerOut
;
if
(
StoreMove
.
MoveStep
.
Equals
(
StoreMoveStep
.
SO_1
4
_WaitTake
))
if
(
StoreMove
.
MoveStep
.
Equals
(
StoreMoveStep
.
SO_1
5
_WaitTake
))
{
timeOutMs
=
650000
;
}
...
...
@@ -188,12 +188,7 @@ namespace OnlineStore.DeviceLibrary
LogUtil
.
error
(
LOGGER
,
StoreName
+
wait
.
IoType
+
"等待信号("
+
io
.
DisplayStr
+
"="
+
wait
.
IoValue
+
") 超时"
,
14
);
isOk
=
false
;
break
;
}
//else if ((!wait.IsEnd) && StoreMove.MoveStep.Equals(StoreMoveStep.SO_14_WaitTake) && LineConnect.CanReSend())
//{
// //判断是否需要重发入库结束命令
// SendOutStoreEnd(StoreMove);
//}
}
TimeSpan
rwSpan
=
DateTime
.
Now
-
preRWTime
;
if
(!
wait
.
IsEnd
&&
rwSpan
.
TotalSeconds
>
5
&&
span
.
TotalSeconds
>
6
)
...
...
@@ -263,7 +258,7 @@ namespace OnlineStore.DeviceLibrary
/// <summary>
/// 开始入库移动移动
/// </summary>
public
void
StartInStoreMove
(
InOutParam
param
,
bool
isNeedCheckIO
)
public
override
void
StartInStoreMove
(
InOutParam
param
)
{
startInStoreTime
=
DateTime
.
Now
;
string
posId
=
param
!=
null
?
param
.
PosInfo
.
PosId
:
""
;
...
...
@@ -276,13 +271,13 @@ namespace OnlineStore.DeviceLibrary
}
if
(
IOManager
.
IOValue
(
IO_Type
.
TrayCheck_Fixture
).
Equals
(
IO_VALUE
.
HIGH
))
{
LogUtil
.
error
(
LOGGER
,
StoreName
+
" 启动入库【"
+
posId
+
"】出错,
叉子料盘
检测有料"
);
LogUtil
.
error
(
LOGGER
,
StoreName
+
" 启动入库【"
+
posId
+
"】出错,
货叉物料
检测有料"
);
return
;
}
string
doorMsg
=
DoorIsClose
();
if
(!
String
.
IsNullOrEmpty
(
doorMsg
))
{
LogUtil
.
error
(
LOGGER
,
StoreName
+
" 启动入库【"
+
posId
+
"】出错, "
+
doorMsg
);
LogUtil
.
error
(
LOGGER
,
StoreName
+
" 启动入库【"
+
posId
+
"】出错, "
+
doorMsg
);
return
;
}
...
...
@@ -290,9 +285,9 @@ namespace OnlineStore.DeviceLibrary
storeRunStatus
=
StoreRunStatus
.
Busy
;
storeStatus
=
StoreStatus
.
InStoreExecute
;
StoreMove
.
NewMove
(
StoreMoveType
.
InStore
,
param
);
if
(
isNeedCheckIO
)
{
//料盘检测
if
(
StoreManager
.
UseShelfCheck
)
{
//料盘检测
InStoreLog
(
" 入库:SI_00 检测料盘信号"
);
StoreMove
.
NextMoveStep
(
StoreMoveStep
.
SI_00_TrayCheck
);
if
(
param
.
PosInfo
.
ShelfType
.
Equals
(
1
))
...
...
@@ -302,7 +297,7 @@ namespace OnlineStore.DeviceLibrary
else
{
StoreMove
.
WaitList
.
Add
(
WaitResultInfo
.
WaitIO
(
IO_Type
.
RightShelf_Check
,
IO_VALUE
.
HIGH
));
}
}
}
else
{
...
...
@@ -314,14 +309,6 @@ namespace OnlineStore.DeviceLibrary
LogUtil
.
error
(
LOGGER
,
StoreName
+
" 启动【"
+
posId
+
"】入库出错,当前状态,storeStatus="
+
storeRunStatus
);
}
}
/// <summary>
/// 开始入库移动移动
/// </summary>
public
override
void
StartInStoreMove
(
InOutParam
param
)
{
StartInStoreMove
(
param
,
false
);
}
private
void
SI_02_Move
()
{
InStoreLog
(
"入库:SI_02_ 进出轴(叉子)动作至P1,关闭门锁="
+
StoreMove
.
MoveParam
.
PosInfo
.
ShelfType
);
...
...
@@ -348,17 +335,15 @@ namespace OnlineStore.DeviceLibrary
else
if
(
StoreMove
.
MoveStep
==
StoreMoveStep
.
SI_02_InOutAxisHome
)
{
InStoreLog
(
"入库:SI_03
所有轴回到待机点,轴2、轴1 动作到P1,,轴4动作至P3
,托架后退"
);
InStoreLog
(
"入库:SI_03
升降轴,前进轴 动作到P1
,托架后退"
);
StoreMove
.
NextMoveStep
(
StoreMoveStep
.
SI_03_ReturnHome
);
ACAxisMove
(
Config
.
UpDown_Axis
,
moveP
.
UpDown_P1
,
Config
.
UpDownAxis_P1_Speed
);
ACAxisMove
(
Config
.
Middle_Axis
,
moveP
.
Middle_P1
,
Config
.
MiddleAxis_P1_Speed
);
ShelfBack
(
StoreMove
.
MoveParam
.
PosInfo
.
ShelfType
);
ShelfBack
(
StoreMove
.
MoveParam
.
PosInfo
.
ShelfType
,
StoreMove
);
}
else
if
(
StoreMove
.
MoveStep
==
StoreMoveStep
.
SI_03_ReturnHome
)
{
//判断仓门是否打开
InStoreLog
(
"入库:SI_05 叉子进入入料口,进出轴至P2(进料口取料点) "
);
StoreMove
.
NextMoveStep
(
StoreMoveStep
.
SI_05_DeviceToDoor
);
ACAxisMove
(
Config
.
InOut_Axis
,
StoreMove
.
MoveParam
.
MoveP
.
InOut_P2
,
Config
.
InOutAxis_P2_Speed
);
...
...
@@ -367,28 +352,46 @@ namespace OnlineStore.DeviceLibrary
{
//NeedCheckSafetyLight = 0;
InStoreLog
(
"入库:SI_06 拿物品, 升降轴至P7(进料口取料缓冲点) "
);
StoreMove
.
NextMoveStep
(
StoreMoveStep
.
SI_06_
DoorWarToDevice
);
StoreMove
.
NextMoveStep
(
StoreMoveStep
.
SI_06_
UpdownAxisUp
);
ACAxisMove
(
Config
.
UpDown_Axis
,
moveP
.
UpDown_P7
,
Config
.
UpDownAxis_P7_Speed
);
}
else
if
(
StoreMove
.
MoveStep
==
StoreMoveStep
.
SI_06_
DoorWarToDevice
)
else
if
(
StoreMove
.
MoveStep
==
StoreMoveStep
.
SI_06_
UpdownAxisUp
)
{
InStoreLog
(
"入库:SI_07 叉子 从入料口抽出,进出轴至P1(待机点) "
);
StoreMove
.
NextMoveStep
(
StoreMoveStep
.
SI_07_
DeviceBackFromDoor
);
StoreMove
.
NextMoveStep
(
StoreMoveStep
.
SI_07_
InoutBack
);
InOutBackToP1
(
moveP
.
InOut_P1
);
}
else
if
(
StoreMove
.
MoveStep
==
StoreMoveStep
.
SI_07_DeviceBackFromDoor
)
{
}
else
if
(
StoreMove
.
MoveStep
==
StoreMoveStep
.
SI_07_InoutBack
)
{
InStoreLog
(
"入库:SI_08 判断是否拿到物料"
);
StoreMove
.
NextMoveStep
(
StoreMoveStep
.
SI_08_WaitShelfDI
);
if
(
StoreManager
.
UseShelfCheck
)
{
if
(
StoreMove
.
MoveParam
.
PosInfo
.
ShelfType
.
Equals
(
1
))
{
StoreMove
.
WaitList
.
Add
(
WaitResultInfo
.
WaitIO
(
IO_Type
.
LeftShelf_Check
,
IO_VALUE
.
LOW
));
}
else
{
StoreMove
.
WaitList
.
Add
(
WaitResultInfo
.
WaitIO
(
IO_Type
.
RightShelf_Check
,
IO_VALUE
.
LOW
));
}
StoreMove
.
WaitList
.
Add
(
WaitResultInfo
.
WaitIO
(
IO_Type
.
TrayCheck_Fixture
,
IO_VALUE
.
HIGH
));
}
}
//判断是否拿到料
else
if
(
StoreMove
.
MoveStep
==
StoreMoveStep
.
SI_08_WaitShelfDI
)
{
InStoreLog
(
"入库:SI_09 移动到库位点,前后轴至P2(库位点),升降轴至P3(库位入库前点) "
);
StoreMove
.
NextMoveStep
(
StoreMoveStep
.
SI_09_MoveToBag
);
ACAxisMove
(
Config
.
Middle_Axis
,
moveP
.
Middle_P2
,
Config
.
MiddleAxis_P2_Speed
);
ACAxisMove
(
Config
.
UpDown_Axis
,
moveP
.
UpDown_P3
,
Config
.
UpDownAxis_P3_Speed
);
}
ACAxisMove
(
Config
.
UpDown_Axis
,
moveP
.
UpDown_P3
,
Config
.
UpDownAxis_P3_Speed
);
}
else
if
(
StoreMove
.
MoveStep
==
StoreMoveStep
.
SI_09_MoveToBag
)
{
{
InStoreLog
(
"入库:SI_11 叉子进入库位中,进出轴至P4(库位取放料点) "
);
StoreMove
.
NextMoveStep
(
StoreMoveStep
.
SI_11_DeviceToBag
);
ACAxisMove
(
Config
.
InOut_Axis
,
moveP
.
InOut_P4
,
Config
.
InOutAxis_P4_Speed
);
}
ACAxisMove
(
Config
.
InOut_Axis
,
moveP
.
InOut_P4
,
Config
.
InOutAxis_P4_Speed
);
}
else
if
(
StoreMove
.
MoveStep
==
StoreMoveStep
.
SI_11_DeviceToBag
)
{
InStoreLog
(
"入库:SI_12 放下物品,升降轴至P4(库位入料缓冲点), "
);
...
...
@@ -413,13 +416,22 @@ namespace OnlineStore.DeviceLibrary
}
else
if
(
StoreMove
.
MoveStep
==
StoreMoveStep
.
SI_13_DeviceBackFromBag
)
{
InStoreLog
(
"入库:SI_14 返回待机点,轴2/轴1 动作至P1(待机点)) ,托架前进"
);
StoreMove
.
NextMoveStep
(
StoreMoveStep
.
SI_14_GoBack
);
InStoreLog
(
"入库:SI_14 检查叉子物料检测信号=low"
);
StoreMove
.
NextMoveStep
(
StoreMoveStep
.
SI_14_CheckTrayIsGo
);
if
(
StoreManager
.
UseShelfCheck
)
{
StoreMove
.
WaitList
.
Add
(
WaitResultInfo
.
WaitIO
(
IO_Type
.
TrayCheck_Fixture
,
IO_VALUE
.
LOW
));
}
}
else
if
(
StoreMove
.
MoveStep
==
StoreMoveStep
.
SI_14_CheckTrayIsGo
)
{
InStoreLog
(
"入库:SI_15 升降轴,前后轴返回待机点 ,托架前进"
);
StoreMove
.
NextMoveStep
(
StoreMoveStep
.
SI_15_GoBack
);
ACAxisMove
(
Config
.
Middle_Axis
,
moveP
.
Middle_P1
,
Config
.
MiddleAxis_P1_Speed
);
ACAxisMove
(
Config
.
UpDown_Axis
,
moveP
.
UpDown_P1
,
Config
.
UpDownAxis_P1_Speed
);
ShelfForward
(
StoreMove
.
MoveParam
.
PosInfo
.
ShelfType
);
}
else
if
(
StoreMove
.
MoveStep
==
StoreMoveStep
.
SI_1
4
_GoBack
)
else
if
(
StoreMove
.
MoveStep
==
StoreMoveStep
.
SI_1
5
_GoBack
)
{
TimeSpan
span
=
DateTime
.
Now
-
startInStoreTime
;
string
posId
=
StoreMove
.
MoveParam
!=
null
?
StoreMove
.
MoveParam
.
PosInfo
.
PosId
:
""
;
...
...
@@ -456,7 +468,7 @@ namespace OnlineStore.DeviceLibrary
}
if
(
IOManager
.
IOValue
(
IO_Type
.
TrayCheck_Fixture
).
Equals
(
IO_VALUE
.
HIGH
))
{
LogUtil
.
error
(
LOGGER
,
StoreName
+
" 启动出库【"
+
posId
+
"】出错,
叉子料盘
检测有料"
);
LogUtil
.
error
(
LOGGER
,
StoreName
+
" 启动出库【"
+
posId
+
"】出错,
货叉物料
检测有料"
);
return
false
;
}
string
doorMsg
=
DoorIsClose
();
...
...
@@ -525,10 +537,19 @@ namespace OnlineStore.DeviceLibrary
lastPosId
=
posId
;
lastPosIdStatus
=
StoreStatus
.
OutStoreBoxEnd
;
storeStatus
=
StoreStatus
.
OutStoreBoxEnd
;
}
else
if
(
StoreMove
.
MoveStep
==
StoreMoveStep
.
SO_06_BagDeviceBack
)
{
StoreMove
.
NextMoveStep
(
StoreMoveStep
.
SO_07_CheckHasTray
);
OutStoreLog
(
"出库:SO_07 判断是否拿到料"
);
if
(
StoreManager
.
UseShelfCheck
)
{
StoreMove
.
WaitList
.
Add
(
WaitResultInfo
.
WaitIO
(
IO_Type
.
TrayCheck_Fixture
,
IO_VALUE
.
HIGH
));
}
}
else
if
(
StoreMove
.
MoveStep
==
StoreMoveStep
.
SO_07_CheckHasTray
)
{
if
(
IOManager
.
IOValue
(
IO_Type
.
TrayCheck_Fixture
).
Equals
(
IO_VALUE
.
LOW
))
{
string
posId
=
StoreMove
.
MoveParam
!=
null
?
StoreMove
.
MoveParam
.
PosInfo
.
PosId
:
""
;
...
...
@@ -540,7 +561,7 @@ namespace OnlineStore.DeviceLibrary
OutStoreLog
(
"出库:SO_08 走到料门口,前后轴至P1(待机点)升降轴至P2(进料口出料前点), 托架后退 "
);
ACAxisMove
(
Config
.
UpDown_Axis
,
moveP
.
UpDown_P2
,
Config
.
UpDownAxis_P2_Speed
);
ACAxisMove
(
Config
.
Middle_Axis
,
moveP
.
Middle_P1
,
Config
.
MiddleAxis_P1_Speed
);
ShelfBack
(
StoreMove
.
MoveParam
.
PosInfo
.
ShelfType
);
ShelfBack
(
StoreMove
.
MoveParam
.
PosInfo
.
ShelfType
,
StoreMove
);
}
else
if
(
StoreMove
.
MoveStep
==
StoreMoveStep
.
SO_08_ToDoorPosition
)
...
...
@@ -576,39 +597,31 @@ namespace OnlineStore.DeviceLibrary
}
else
if
(
StoreMove
.
MoveStep
==
StoreMoveStep
.
SO_12_DeviceOutFromDoor
)
{
StoreMove
.
NextMoveStep
(
StoreMoveStep
.
SO_13_GoBack
);
OutStoreLog
(
"出库:SO_13 升降轴返回,轴2至P1(待机点) ,托架前进,打开门锁"
);
StoreMove
.
NextMoveStep
(
StoreMoveStep
.
SO_13_CheckShelfDI
);
OutStoreLog
(
"出库:SO_13 判断物料信号是否正确 "
);
if
(
StoreManager
.
UseShelfCheck
)
{
if
(
StoreMove
.
MoveParam
.
PosInfo
.
ShelfType
.
Equals
(
1
))
{
StoreMove
.
WaitList
.
Add
(
WaitResultInfo
.
WaitIO
(
IO_Type
.
LeftShelf_Check
,
IO_VALUE
.
HIGH
));
}
else
{
StoreMove
.
WaitList
.
Add
(
WaitResultInfo
.
WaitIO
(
IO_Type
.
RightShelf_Check
,
IO_VALUE
.
HIGH
));
}
StoreMove
.
WaitList
.
Add
(
WaitResultInfo
.
WaitIO
(
IO_Type
.
TrayCheck_Fixture
,
IO_VALUE
.
LOW
));
}
}
else
if
(
StoreMove
.
MoveStep
==
StoreMoveStep
.
SO_13_CheckShelfDI
)
{
StoreMove
.
NextMoveStep
(
StoreMoveStep
.
SO_14_GoBack
);
OutStoreLog
(
"出库:SO_14 升降轴到P1(待机点) ,托架前进,打开门锁"
);
ACAxisMove
(
Config
.
UpDown_Axis
,
moveP
.
UpDown_P1
,
Config
.
UpDownAxis_P1_Speed
);
OpenDoor
(
StoreMove
.
MoveParam
.
PosInfo
.
ShelfType
);
ShelfForward
(
StoreMove
.
MoveParam
.
PosInfo
.
ShelfType
);
//发送消息给流水线
//SendOutStoreEnd(StoreMove);
}
else
if
(
StoreMove
.
MoveStep
==
StoreMoveStep
.
SO_13_GoBack
)
{
// int OutStoreWaitSeconds = ConfigAppSettings.GetIntValue(Setting_Init.OutStoreWaitSeconds);
// if (OutStoreWaitSeconds <= 0)
// {
// OutStoreWaitSeconds = 600;
// }
// int ms = OutStoreWaitSeconds * 1000;
// StoreMove.NextMoveStep(StoreMoveStep.SO_14_WaitTake);
// OutStoreLog("出库:SO_14_WaitTake 等待拿走物品,最多等待" + OutStoreWaitSeconds + "秒");
// StoreMove.WaitList.Add(WaitResultInfo.WaitTime(ms));
// if (StoreMove.MoveParam.PosInfo.ShelfType.Equals(1))
// {
// StoreMove.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.LeftShelf_Check, IO_VALUE.LOW));
// }
// else
// {
// StoreMove.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.RightShelf_Check, IO_VALUE.LOW));
// }
// // StoreMove.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.TrayCheck_Door, IO_VALUE.LOW));
// // StoreMove.WaitList.Add(WaitResultInfo.WaitHeight(0));
// StoreMove.OneWaitCanEndStep = true;
//}
//else if (StoreMove.MoveStep == StoreMoveStep.SO_14_WaitTake)
//{
ShelfForward
(
StoreMove
.
MoveParam
.
PosInfo
.
ShelfType
,
StoreMove
);
}
else
if
(
StoreMove
.
MoveStep
==
StoreMoveStep
.
SO_14_GoBack
)
{
TimeSpan
span
=
DateTime
.
Now
-
startOutStoreTime
;
string
posId
=
StoreMove
.
MoveParam
!=
null
?
StoreMove
.
MoveParam
.
PosInfo
.
PosId
:
""
;
...
...
source/DeviceLibrary/acSquareStore/StoreManager.cs
查看文件 @
09f0b0c
...
...
@@ -23,6 +23,8 @@ namespace OnlineStore.DeviceLibrary
public
static
Box_Config
Config
=
null
;
private
static
bool
isInit
=
false
;
public
static
bool
IsConnectServer
=
!
ConfigAppSettings
.
GetValue
(
Setting_Init
.
http_server
).
Equals
(
""
);
public
static
bool
UseShelfCheck
=
ConfigAppSettings
.
GetIntValue
(
Setting_Init
.
UseTrayCheck
).
Equals
(
1
);
public
StoreManager
()
{
}
...
...
source/DeviceLibrary/lineConnect/LineConnect.cs
deleted
100644 → 0
查看文件 @
60c1622
using
OnlineStore.Common
;
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Text
;
using
System.Threading
;
using
System.Threading.Tasks
;
namespace
OnlineStore.DeviceLibrary
{
public
class
LineConnect
{
private
static
int
ClientKeepSecond
=
10
;
private
static
TcpClient
client
=
null
;
public
static
List
<
string
>
WaitInStoreList
=
new
List
<
string
>();
public
static
void
StartConnect
()
{
Task
.
Factory
.
StartNew
(
delegate
{
string
lineServer
=
ConfigAppSettings
.
GetValue
(
Setting_Init
.
LineServerIp
);
int
linePort
=
ConfigAppSettings
.
GetIntValue
(
Setting_Init
.
LineServerPort
);
if
(
lineServer
.
Equals
(
""
))
{
LogUtil
.
error
(
"未配置流水线地址,不需要连接"
);
return
;
}
client
=
new
TcpClient
();
bool
result
=
client
.
StartConnect
(
lineServer
,
linePort
,
HandlerMsg
,
2000
);
});
}
public
static
void
StopConnect
()
{
if
(
client
!=
null
)
{
client
.
close
();
}
}
private
static
int
seq
=
1
;
public
static
int
nextSeq
()
{
if
(
seq
.
Equals
(
Int32
.
MaxValue
))
{
LogUtil
.
info
(
"seq当前值:"
+
seq
+
",重置seq=0"
);
seq
=
0
;
}
Interlocked
.
Increment
(
ref
seq
);
return
seq
;
}
public
static
void
SendHeart
(
StoreSendBean
store
)
{
if
(
client
==
null
)
{
return
;
}
try
{
store
.
Cmd
=
cmd_heart
;
string
heartMsg
=
ToParamStr
(
store
);
client
.
send
(
heartMsg
);
}
catch
(
Exception
ex
)
{
LogUtil
.
error
(
"SendHeart 出错:"
+
ex
.
ToString
());
}
}
private
static
DateTime
LastOutStoreEndTime
=
DateTime
.
Now
;
public
static
void
OutStoreEnd
(
StoreSendBean
store
)
{
if
(
client
==
null
)
{
return
;
}
try
{
LastOutStoreEndTime
=
DateTime
.
Now
;
store
.
Cmd
=
cmd_outend
;
string
msg
=
ToParamStr
(
store
);
LogUtil
.
info
(
"OutStoreEnd:"
+
msg
);
client
.
send
(
msg
);
}
catch
(
Exception
ex
)
{
LogUtil
.
error
(
"OutStoreEnd 出错:"
+
ex
.
ToString
());
}
}
private
static
string
ToParamStr
(
StoreSendBean
store
)
{
return
JsonHelper
.
SerializeObject
(
store
)+
"\r"
;
}
private
static
void
HandlerMsg
(
string
message
)
{
try
{
message
=
message
.
Replace
(
"\r"
,
""
);
StoreReviceBean
reviceInfo
=
JsonHelper
.
DeserializeJsonToObject
<
StoreReviceBean
>(
message
);
//string[] msgArray = message.Split(cmd_spilt);
if
(
reviceInfo
==
null
)
{
LogUtil
.
debug
(
"收到消息:"
+
message
+
",解析失败"
);
}
else
{
string
cmd
=
reviceInfo
.
Cmd
;
CanOutStore
=
reviceInfo
.
CanOutStore
.
Equals
(
1
);
LastUpdateTime
=
DateTime
.
Now
;
if
(
cmd
.
Equals
(
cmd_startIn
))
{
LogUtil
.
info
(
"收到流水线入库消息:"
+
message
);
StoreManager
.
Store
.
ReviceLineInStoreCMD
(
reviceInfo
.
PosId
,
reviceInfo
.
PlateH
,
reviceInfo
.
PlateW
,
reviceInfo
.
WareCode
);
}
else
if
(
cmd
.
Equals
(
cmd_updateDebug
))
{
int
isDebug
=
reviceInfo
.
IsDebug
;
LogUtil
.
info
(
"收到流水线更改调试状态="
+
isDebug
);
StoreManager
.
Store
.
IsDebug
=
isDebug
.
Equals
(
1
)
?
true
:
false
;
ConfigAppSettings
.
SaveValue
(
Setting_Init
.
IsInDebug
,
isDebug
);
LogUtil
.
info
(
"切换调试状态= "
+
isDebug
+
";"
);
}
else
if
(
cmd
.
Equals
(
cmd_checStartIn
))
{
LogUtil
.
info
(
"收到流水线入库库位验证消息:"
+
message
);
//if (LineConnect.WaitInStoreList.Contains(reviceInfo.PosId))
//{
// LogUtil.error(" LineConnect.WaitInStoreList已存在库位【" + reviceInfo.PosId + "】先移除在验证");
// LineConnect.WaitInStoreList.Remove(reviceInfo.PosId);
//}
bool
result
=
StoreManager
.
Store
.
ReviceLineCheckInStoreCMD
(
reviceInfo
.
PosId
,
reviceInfo
.
PlateH
,
reviceInfo
.
PlateW
,
reviceInfo
.
WareCode
);
if
(
result
&&
(!
WaitInStoreList
.
Contains
(
reviceInfo
.
PosId
)))
{
LineConnect
.
WaitInStoreList
.
Add
(
reviceInfo
.
PosId
);
}
}
}
}
catch
(
Exception
ex
)
{
LogUtil
.
error
(
"处理流水线消息【"
+
message
+
"】出错:"
+
ex
.
ToString
()
);
}
}
public
static
char
cmd_spilt
=
';'
;
public
static
string
cmd_heart
=
"heart"
;
private
static
string
cmd_outend
=
"outend"
;
private
static
string
cmd_startIn
=
"starIn"
;
private
static
string
cmd_updateDebug
=
"updateDebug"
;
private
static
bool
CanOutStore
=
false
;
public
static
DateTime
LastUpdateTime
=
new
DateTime
(
0
);
public
static
string
cmd_checStartIn
=
"cmd_checStartIn"
;
public
static
bool
IsConnect
()
{
if
(
client
==
null
)
{
return
false
;
}
if
(
client
.
IsRun
()&&
client
.
IsConnected
())
{
return
true
;
}
return
false
;
}
public
static
bool
CanStartOut
()
{
TimeSpan
span
=
DateTime
.
Now
-
LastUpdateTime
;
if
(
span
.
TotalSeconds
<
ClientKeepSecond
&&
CanOutStore
)
{
return
true
;
}
return
false
;
}
/// <summary>
/// 是否可以重发消息
/// </summary>
/// <returns></returns>
public
static
bool
CanReSend
()
{
TimeSpan
span
=
DateTime
.
Now
-
LastOutStoreEndTime
;
if
(
span
.
TotalSeconds
>
8
)
{
return
true
;
}
return
false
;
}
}
public
class
StoreReviceBean
{
public
string
Cmd
=
""
;
public
int
CanOutStore
=
0
;
public
string
PosId
=
""
;
public
string
PlateH
=
"0"
;
public
string
PlateW
=
"0"
;
public
string
WareCode
=
""
;
public
int
IsDebug
=
0
;
}
public
class
StoreSendBean
{
public
StoreSendBean
(
int
id
,
string
cid
,
int
ss
,
int
runs
,
int
doorHasTray
,
int
alarmType
)
{
this
.
StoreId
=
id
;
this
.
Cid
=
cid
;
this
.
SStatus
=
ss
;
this
.
SRunStatus
=
runs
;
this
.
DoorHasTray
=
doorHasTray
;
this
.
AlarmType
=
alarmType
;
this
.
Seq
=
LineConnect
.
nextSeq
();
this
.
WaitInStoreList
=
new
List
<
string
>(
LineConnect
.
WaitInStoreList
);
this
.
data
=
new
Dictionary
<
string
,
string
>();
// WaitInStoreList.Add("1#AC1_1_1");
}
public
string
Cmd
=
LineConnect
.
cmd_heart
;
public
int
StoreId
=
0
;
public
string
Cid
=
""
;
public
int
Seq
=
0
;
public
int
SStatus
=
0
;
public
int
SRunStatus
=
0
;
public
int
DoorHasTray
=
0
;
public
int
AlarmType
=
0
;
public
List
<
string
>
WaitInStoreList
=
new
List
<
string
>();
public
Dictionary
<
string
,
string
>
data
=
new
Dictionary
<
string
,
string
>();
//public string PosId = "";
//public string PlateH = "0";
//public string PlateW = "0";
///// <summary>
///// urgentReel: true 表示紧急料,需要出到料串上
///// </summary>
//public bool urgentReel = false;
///// <summary>
///// cutReel: true 表示分盘料,需要出到料串上
///// </summary>
//public bool cutReel = false;
///// <summary>
///// smallReel: true 小料(7x8),放置到小料架上
///// </summary>
//public bool smallReel = false;
///// <summary>
///// rfid: 分配的料架RFID
///// </summary>
//public string rfid = "";
///// <summary>
///// rfidLoc: 料架的架位,值为 - 1时,可以自由分配皮带线,
///// 小料时,架位为1 - 46优先走1 / 2号皮带线,47 - 92优先走3 / 4号皮带线,
///// 70,71,72时只能分配到3 / 4号皮带线;
///// 大料时,架位1 - 6优先走1 / 2号皮带线, 7 - 12优先走3/ 4号皮带线
///// </summary>
//public int rfidLoc = 0;
}
}
source/DeviceLibrary/store/StoreStep.cs
查看文件 @
09f0b0c
using
log4net
;
using
OnlineStore.Common
;
using
OnlineStore.DeviceLibrary
;
using
OnlineStore.LoadCSVLibrary
;
using
System
;
using
System.Collections.Generic
;
using
System.Drawing
;
using
System.IO
;
using
System.IO.Ports
;
using
System.Linq
;
using
System.Text
;
using
System.Windows.Forms
;
namespace
OnlineStore.DeviceLibrary
{
/// <summary>
/// 等待启动/已经停止,初始化完成, 正常运行中,可以进行新的处理,忙碌,重置
/// </summary>
...
...
@@ -24,15 +11,15 @@ namespace OnlineStore.DeviceLibrary
/// 等待启动/已经停止
/// </summary>
Wait
=
0
,
///
//
<summary>
///
//
初始化 ,原点返回状态中,只有流水线使用
///
//
</summary>
/// <summary>
/// 初始化 ,原点返回状态中,只有流水线使用
/// </summary>
HomeMoving
=
1
,
/// <summary>
/// 设备正在重置中,请稍后
/// </summary>
Reset
=
2
,
Reset
=
2
,
/// <summary>
/// 正常运行中,可以进行新的处理
/// </summary>
...
...
@@ -59,7 +46,7 @@ namespace OnlineStore.DeviceLibrary
/// <summary>
///2=急停中
/// </summary>
SuddenStop
=
2
,
SuddenStop
=
2
,
/// <summary>
/// 3=故障中
/// </summary>
...
...
@@ -71,15 +58,15 @@ namespace OnlineStore.DeviceLibrary
/// <summary>
/// 5=设备调试中
/// </summary>
Debugging
=
5
,
Debugging
=
5
,
/// <summary>
/// 6=入库执行中
/// </summary>
InStoreExecute
=
6
,
InStoreExecute
=
6
,
/// <summary>
/// 7= 入仓位完成(料仓Box把料盘放入对应的库位中,装置还未恢复原始状态)
/// </summary>
InStoreEnd
=
7
,
InStoreEnd
=
7
,
/// <summary>
/// 8=入库失败
/// </summary>
...
...
@@ -103,7 +90,7 @@ namespace OnlineStore.DeviceLibrary
/// <summary>
/// 重置中(原点返回和重置都发此状态)
/// </summary>
ResetMove
=
13
,
ResetMove
=
13
,
}
/// <summary>
...
...
@@ -117,133 +104,127 @@ namespace OnlineStore.DeviceLibrary
Wait
=
0
,
#
region
料仓原点返回和重置步骤
/// <summary>
///
料仓原点返回和重置步骤
,,定位气缸下降
///
复位
,,定位气缸下降
/// </summary>
BOX_H_LocationCylinderBack
=
010
,
/// <summary>
/// 料仓原点返回和重置步骤,轴三先相对走3000
/// </summary>
BOX_H_InOutMove
=
011
,
SH_10_LocationCylinderBack
=
010
,
/// <summary>
///
料仓原点返回和重置步骤,,轴三进出轴先返回原点
///
复位,轴三先相对走3000
/// </summary>
BOX_H_InOutBack
=
012
,
SH_11_InOutMove
=
011
,
/// <summary>
///
料仓原点返回和重置步骤,,轴三返回P1
点
///
复位,,轴三进出轴先返回原
点
/// </summary>
BOX_H_InOutToP1
=
013
,
SH_12_InOutBack
=
012
,
/// <summary>
///
料仓原点返回和重置步骤,,升降轴,前后轴,压紧轴原点返回
///
复位,,轴三返回P1点
/// </summary>
BOX_H_OtherAxisBack
=
014
,
///// <summary>
///// 清理轴位置
///// </summary>
//BOX_H_WaitAxisCountClear = 015,
SH_13_InOutToP1
=
013
,
/// <summary>
///
前后轴返回P1
///
复位,,升降轴,原点返回
/// </summary>
BOX_H_MiddleAxisToP1
=
016
,
SH_14_UpdownBack
=
014
,
/// <summary>
///
叉子先退回P1
///
复位,前后轴原点返回
/// </summary>
BOX_M_H_InOutToP1
=
018
,
SH_15_MiddleBack
=
015
,
/// <summary>
///
前后轴回原点
///
复位:前后轴返回P1
/// </summary>
BOX_M_H_MiddleAxisHome
=
019
,
SH_16_OtherAxisToP1
=
016
,
/// <summary>
///
前后轴等待清理位置
///
复位:叉子走到P1
/// </summary>
BOX_M_H_MiddleWait
=
020
,
SP1_01_InOutToP1
=
031
,
/// <summary>
///
叉子走到P1
///
复位:关闭门
/// </summary>
BOX_M_H_TOP1_InOutToP1
=
030
,
SP1_02_CloseDoor
=
032
,
/// <summary>
///
压紧轴回原点
///
复位:升降轴到P1
/// </summary>
BOX_M_H_TOP1_CompressHome
=
031
,
SP1_03_OtherAxisToP1
=
033
,
/// <summary>
///
关闭门,前后轴到P1,升降
轴到P1
///
复位:前后
轴到P1
/// </summary>
BOX_M_H_TOP1_OtherAxisToP1
=
032
,
SP1_04_ShelfForward
=
034
,
#
endregion
#
region
料仓内部出库步骤
/// <summary>
///料仓出库,,定位气缸下降
/// </summary>
// SO_01_LocationCylinderDown=101,
/// <summary>
///料仓出库:叉子先运动到P1
///出库:叉子先运动到P1
/// </summary>
SO_02_DeviceBack
=
102
,
/// <summary>
///
料仓出库,,
前后轴至P2(库位点),升降轴至P5(库位出库前点) ,托架后退)
///
出库:
前后轴至P2(库位点),升降轴至P5(库位出库前点) ,托架后退)
/// </summary>
SO_03_ToBagPosition
=
103
,
/// <summary>
///
料仓出库,,
叉子进入库位中, 轴3( 叉子) 至P3(库位取放料点)
///
出库:
叉子进入库位中, 轴3( 叉子) 至P3(库位取放料点)
/// </summary>
SO_04_DeviceToBag
=
104
,
/// <summary>
///
料仓出库,,
库位的物品放入叉子上,轴2( 上下) 至P6( 库位出料缓冲点),轴4( 压紧) 至P2(压紧点)
///
出库:
库位的物品放入叉子上,轴2( 上下) 至P6( 库位出料缓冲点),轴4( 压紧) 至P2(压紧点)
/// </summary>
SO_05_BagWareToDevice
=
105
,
/// <summary>
///
料仓出库,,
叉子从 库位返回,轴3( 叉子) 至P1( 待机点)
///
出库:
叉子从 库位返回,轴3( 叉子) 至P1( 待机点)
/// </summary>
SO_06_BagDeviceBack
=
106
,
/// <summary>
///
料仓出库,定位气缸伸出(有压紧轴的不需要此步骤),,定位气缸伸出 Y103-1/PCI5O1-83) Y103-2/PCI5O1-90) Y103-3/PCI5O1-95) 伸出到位
///
出库:检测叉子是否有料
/// </summary>
// SO_07_LocationCylinder_Up = 107,
SO_07_CheckHasTray
=
107
,
/// <summary>
///
料仓出库,,
所有设备运行到门,,轴1( 转盘) 至P1( 待机点)轴2( 上下) 至P2( 进料口出料前点)
///
出库:
所有设备运行到门,,轴1( 转盘) 至P1( 待机点)轴2( 上下) 至P2( 进料口出料前点)
/// </summary>
SO_08_ToDoorPosition
=
108
,
/// <summary>
/// 料仓出库,定位气缸退回(有压紧轴的不需要此步骤),,定位气缸退回(Y104-1/PCI5O1-84) (Y104-2/PCI5O1-91) (Y104-2/PCI5O1-96) 退回到位
/// </summary>
// SO_09_LocationCylinder_Down = 109,
/// <summary>
/// 等待门口无料盘
/// </summary>
SO_09_WaitNoTray
=
115
,
SO_09_WaitNoTray
=
109
,
/// <summary>
///
料仓出库,,
叉子进出料口,,轴3( 叉子) 至P2( 进料口取料点)
///
出库:
叉子进出料口,,轴3( 叉子) 至P2( 进料口取料点)
/// /// </summary>
SO_10_DeviceToDoor
=
110
,
/// <summary>
///
料仓出库,,
把物品放下,,轴2( 上下) 至P8( 进料口出料缓冲点)轴4( 压紧) 至P1( 待机点)
///
出库:
把物品放下,,轴2( 上下) 至P8( 进料口出料缓冲点)轴4( 压紧) 至P1( 待机点)
/// </summary>
SO_11_DevicePutWare
=
111
,
/// <summary>
///
料仓出库,,
叉子从出料口返回,,轴3( 叉子) 动作至P1( 待机点)
///
出库:
叉子从出料口返回,,轴3( 叉子) 动作至P1( 待机点)
/// </summary>
SO_12_DeviceOutFromDoor
=
112
,
/// <summary>
/// 料仓出库,,升降轴返回,, 轴2至P1( 待机点)
/// 出库:判断物料信号
/// </summary>
SO_13_CheckShelfDI
=
113
,
/// <summary>
/// 出库:升降轴返回,, 轴2至P1( 待机点)
/// </summary>
SO_1
3_GoBack
=
113
,
SO_1
4_GoBack
=
114
,
/// <summary>
/// 等待拿走物品
/// </summary>
SO_1
4_WaitTake
=
114
,
SO_1
5_WaitTake
=
115
,
#
endregion
...
...
@@ -251,11 +232,8 @@ namespace OnlineStore.DeviceLibrary
/// <summary>
/// 入库检测
/// </summary>
SI_00_TrayCheck
=
200
,
///// <summary>
///// 入库,。定位气缸下降
///// </summary>
//SI_01_LocationCylinderDown=201,
SI_00_TrayCheck
=
200
,
/// <summary>
/// 入库。。进出轴(叉子)先返回P1,关闭门锁
/// </summary>
...
...
@@ -264,10 +242,7 @@ namespace OnlineStore.DeviceLibrary
/// 入库。。所有轴先回到待机点,轴2、轴1 动作到P1, 托架后退
/// </summary>
SI_03_ReturnHome
=
203
,
///// <summary>
///// 入库。。压紧物品(有压紧轴的才需要此步骤),轴4( 压紧) 至P3(压紧前点)
///// </summary>
//SI_04_CompressWare = 204,
/// <summary>
/// 入库。。叉子进入入料口,轴3( 叉子) 至P2( 进料口取料点)
/// </summary>
...
...
@@ -275,24 +250,23 @@ namespace OnlineStore.DeviceLibrary
/// <summary>
/// 入库。。把物品放入叉子上,轴2( 上下) 至P7( 进料口取料缓冲点)
/// </summary>
SI_06_DoorWarToDevice
=
206
,
SI_06_UpdownAxisUp
=
206
,
/// <summary>
/// 入库。。叉子 从入料口抽出,轴3( 叉子) 至P1( 待机点)
/// </summary>
SI_07_DeviceBackFromDoor
=
207
,
///// <summary>
///// 入库。。,定位气缸伸出 (有压紧轴的不需要此步骤)
///// </summary>
//SI_08_LocationCylinder_Up = 208,
SI_07_InoutBack
=
207
,
/// <summary>
/// 入库。。
移动到库位点,轴1( 转盘) 至P2( 库位点)轴2(上下) 至P3(库位入库前点)
/// 入库。。
等待物料信号到位
/// </summary>
SI_0
9_MoveToBag
=
209
,
SI_0
8_WaitShelfDI
=
208
,
/// <summary>
/// 入库。。
定位气缸退回 (有压紧轴的不需要此步骤
)
/// 入库。。
移动到库位点,轴1( 转盘) 至P2( 库位点)轴2(上下) 至P3(库位入库前点
)
/// </summary>
// SI_10_LocationCylinder_Down = 210,
SI_09_MoveToBag
=
209
,
/// <summary>
/// 入库。。叉子进入库位中, 进出轴至P4(库位取放料点)
/// </summary>
...
...
@@ -305,10 +279,15 @@ namespace OnlineStore.DeviceLibrary
/// 入库。。叉子从库位中返回,轴3( 叉子) 动作至P1( 待机点)
/// </summary>
SI_13_DeviceBackFromBag
=
213
,
/// <summary>
/// 入库。判断料叉物料检测信号是否消失
/// </summary>
SI_14_CheckTrayIsGo
=
214
,
/// <summary>
/// 入库。。返回待机点,轴2/轴1/轴4动作至P1( 待机点))开始
/// </summary>
SI_1
4_GoBack
=
214
,
SI_1
5_GoBack
=
215
,
#
endregion
...
...
@@ -342,426 +321,7 @@ namespace OnlineStore.DeviceLibrary
#
endregion
#
region
流水线入仓操作
/// <summary>
/// 流水线入仓,开始扫码 扫描枪触发,数据处理
/// </summary>
LI_Scannering
=
10001
,
/// <summary>
/// 流水线入仓,料仓号及库位号发送, 夹具号编码记忆(X5,X6.X7)数据接收
/// </summary>
LI_WaitServerResult
=
10002
,
/// <summary>
/// 等待100毫秒后再放行
/// </summary>
LI_00_Wait100
=
10003
,
/// <summary>
/// 阻挡气缸0-2下降
/// </summary>
LI_01_StopCylinder2Down
=
10004
,
/// <summary>
/// 检测夹具检测1=0 ) 开始
/// </summary>
LI_02_FixtureCheck
=
10005
,
/// <summary>
/// 阻挡气缸0-2上升
/// </summary>
LI_03_StopCylinder2Up
=
10006
,
/// <summary>
/// 阻挡气缸0-1下降
/// </summary>
LI_04_StopCylinder1Down
=
10007
,
#
endregion
#
region
流水线出库操作
/// <summary>
/// 流水线出库,等待100毫秒之后在放行
/// </summary>
LO_00_Wait100
=
11000
,
/// <summary>
/// 流水线出库,阻挡气缸0-2下降
/// </summary>
LO_01_StopCylinder2Down
=
11001
,
/// <summary>
/// 流水线出库, 检测夹具检测1=0
/// </summary>
LO_02_FixtureCheck
=
11002
,
/// <summary>
/// 流水线出库,阻挡气缸0-2上升( Y13=0)
/// </summary>
LO_03_StopCylinder2Up
=
11003
,
/// <summary>
/// 阻挡气缸0-1下降(Y12=1)
/// </summary>
LO_04_StopCylinder1Up
=
11004
,
#
endregion
#
region
移栽装置出入库共同模块
/// <summary>
///移载(流水线)装置出入库处理,, 阻挡气缸1-1下降( Y14=1)
/// </summary>
MIO_01_StopCylinder1Down
=
3081
,
/// <summary>
///移载(流水线)装置出入库处理,,夹具检测1-4=1
/// </summary>
MIO_02_FixtureCheck
=
3082
,
/// <summary>
///移载(流水线)装置出入库处理,,阻挡气缸1-1上升( Y14=0)
/// </summary>
MIO_03_StopCylinder2Down
=
3083
,
/// <summary>
/// 检测夹具检测IO1=1
/// </summary>
MIO_04_Check1High
=
3084
,
/// <summary>
/// 等待一秒钟
/// </summary>
MIO_05_WaitTime
=
3085
,
/// <summary>
///移载(流水线)装置出入库处理,,顶 升 气缸 上 升 (Y17 =0/Y1 16 =1 )检测X17=0X16=1
/// </summary>
MIO_06_TopCylinderUp
=
3086
,
/// <summary>
/// 此处 顶升气缸上升时等待一秒钟,再下降,现在看起来没有升到位就下降
/// </summary>
MIO_07_TopCylinderUpWait
=
3087
,
/// <summary>
/// 等待StoreMove完成当前操作开始入库
/// </summary>
MIO_08_WaitInStore
=
3088
,
/// <summary>
/// 等待StoreMove移走料盘开始放托盘通过
/// </summary>
MIO_09_WaitLetFixtureGo
=
3089
,
#
endregion
#
region
移栽装置出库处理
/// <summary>
/// 移载(流水线)装置出库处理, 检测夹具编码并记忆,托盘 是空盘,并且BOX在出库等待中,开始移栽料盘
/// </summary>
MO_05_CodeRember
=
3105
,
/// <summary>
/// 移载(流水线)装置出库处理,, ,顶升气缸1下降(Y16=0/Y17=1)
/// </summary>
MO_09_TopCylinder_Down
=
3109
,
/// <summary>
/// 移载(流水线)装置出库处理,, 阻挡气缸1-2下降( Y15=1)
/// </summary>
MO_10_StopCylinder2_Down
=
3110
,
/// <summary>
/// 移载(流水线)装置出库处理,, 夹具检测1-4=0,
/// </summary>
MO_11_Tray_Check
=
3111
,
/// <summary>
/// 移载(流水线)装置出库处理,,阻挡气缸1-1下降( Y14=1)阻挡气缸1-2上升( Y15=0)
/// </summary>
MO_12_StopCylinder_Back
=
3112
,
/// <summary>
/// 移栽装置出库处理。。前后气缸1前进
/// </summary>
MO_51_BeforeAfterCylinderBefore
=
3151
,
/// <summary>
/// 移栽装置出库处理。。 上下气缸1下降(Y22=0/Y23=1)
/// </summary>
MO_52_UpDownCylinderDown
=
3152
,
/// <summary>
/// 移栽装置出库处理。。 上下气缸1下降后,等待0.3秒再夹紧,防止没有下降到位就夹紧操作
/// </summary>
MO_53_UpDownCylinderDownWait
=
3153
,
/// <summary>
/// 移栽装置出库处理。 夹料气缸1夹紧( Y25=0/Y24=1)
/// </summary>
MO_54_ClampCylinderSlack
=
3154
,
/// <summary>
/// 移栽装置出库处理。。 上下气缸1上升(Y22=1/Y23=0)
/// </summary>
MO_55_UpDownCylinderUp
=
3155
,
/// <summary>
/// 移栽装置出库处理。。 前后气缸1后退( Y20=0/Y21=1)
/// </summary>
MO_56_BeforeAfterCylinderAfter
=
3156
,
/// <summary>
/// 移载(流水线)装置出库处理,,, 上下气缸1下降(Y22=0/Y23=1)
/// </summary>
MO_58_UpDownCylinderDown
=
3158
,
/// <summary>
/// 移载(流水线)装置出库处理,, 夹料气缸1放松( Y25=1/Y24=0)
/// </summary>
MO_59_ClampCylinderTighten
=
3159
,
/// <summary>
/// 移载(流水线)装置出库处理,, ,上下气缸1上升(Y22=1/Y23=0)
/// </summary>
MO_60_UpDownCylinderUp
=
3160
,
#
endregion
#
region
移载装置入库处理
/// <summary>
///移载装置入库处理,,检测 夹具编码( X1 3,X14,X15)
/// </summary>
MI_05_CodeCheck
=
3005
,
/// <summary>
/// 移载装置入库处理,,等待box等待状态才能继续操作
/// </summary>
MI_10_WaitBox
=
3006
,
/// <summary>
///移载装置入库处理,,编码与仓位一致,,上下气缸1下降(Y22=0/Y23=1)
/// </summary>
MI_07_UpDownCylinderDown
=
3007
,
/// <summary>
///移载装置入库处理,,编码与仓位一致,,上下气缸1下降后,等待0.3秒,防止没有 下降到位就夹紧
/// </summary>
MI_07_UpDownCylinderDownWait
=
3024
,
/// <summary>
///移载装置入库处理,, 夹料气缸1夹紧( Y25=0/Y24=1)
/// </summary>
MI_08_ClampCylinderSlack
=
3008
,
/// <summary>
///移载装置入库处理,, 上下气缸1上升(Y22=1/Y23=0)
/// </summary>
MI_09_UpDownCylinderUp
=
3009
,
/// <summary>
///移载装置入库处理,, ,前后气缸1前进( Y20=1/Y21=0)
/// </summary>
MI_10_BeforeAfterCylinderBefore
=
3010
,
/// <summary>
///移载装置入库处理,, 上下气缸1下降(Y22=0/Y23=1)
/// </summary>
MI_11_UpDownCylinderDown
=
3011
,
/// <summary>
///移载装置入库处理,, ,夹料气缸1放松( Y25=1/Y24=0)
/// </summary>
MI_12_ClampCylinderTighten
=
3012
,
/// <summary>
///移载装置入库处理,, 上下气缸1上升(Y22=1/Y23=0)
/// </summary>
MI_13_UpdownCylinderUp
=
3013
,
/// <summary>
///移载装置入库处理,, ,前后气缸1后退( Y20=0/Y21=1)
/// </summary>
MI_14_BeforeAfterCylinderAfter
=
3014
,
/// <summary>
///移载装置入库处理,, 检测到X102-1=1送料流程完成
/// </summary>
MI_15_SendEnd
=
3015
,
/// <summary>
///移载装置入库处理,,编码不一致,,顶升气缸1下降(Y16=0/Y17=1)
/// </summary>
MI_20_TopCylinderDown
=
3020
,
/// <summary>
///移载装置入库处理,,阻挡气缸1-2下降( Y15=1),
/// </summary>
MI_21_StopCylinderDown
=
3021
,
/// <summary>
///移载装置入库处理,检测Check4=0,
/// </summary>
MI_22_FixtureCheck_Low
=
3022
,
/// <summary>
///移载装置入库处理,,,阻挡气缸1-2 上升( Y15=0),等待200毫秒
/// </summary>
MI_23_StopCylinderReset
=
3023
,
#
endregion
//后面的是双层料仓的类型 值从20000开始
#
region
双层流水线调宽和处理
/// <summary>
/// 双层料仓流水线模块 。检测到板子进入,打开流水线
/// </summary>
LINEIN_OpenLine
=
20000
,
/// <summary>
/// 双层料仓流水线模块 。等待下位机要料信号=High
/// </summary>
LINEIN_WaitOutSingle
=
20001
,
/// <summary>
/// 双层料仓流水线模块 。检测到出料口信号=Low
/// </summary>
LINEIN_WaitOutSingleLow
=
20002
,
/// <summary>
/// 关闭皮带
/// </summary>
LINEIN_CloseLine
=
20003
,
/// <summary>
/// 等待下位机要料信号
/// </summary>
LINEIN_WatiMachineSingle
=
20004
,
/// <summary>
/// 双层料仓流水线模块 。线体调宽回原点
/// </summary>
LINECW_LineReturnHome
=
20010
,
/// <summary>
/// 双层料仓流水线模块 。线体调宽回原点
/// </summary>
LINECW_LineChangeWidth
=
20011
,
/// <summary>
/// 流水线原点返回,设置速度
/// </summary>
LINEH_SetSpeed_001
=
20020
,
/// <summary>
/// 流水线原点返回,反反向走到20000
/// </summary>
LINEH_RevertMove_002
=
20021
,
/// <summary>
/// 流水线原点返回,开始原点返回
/// </summary>
LINEH_LineHome_003
=
20022
,
#
endregion
#
region
在线料仓入库处理
/// <summary>
///在线双层料仓:入仓: 等待料盘进入
/// </summary>
DB_SI_00_WaitIO
=
20100
,
/// <summary>
///在线双层料仓:入仓:扫描二维码中
/// </summary>
DB_SI_01_Scanning
=
20101
,
/// <summary>
/// 在线双层料仓:入仓:根据二维码从服务器获取仓位号
/// </summary>
DB_SI_02_GetBoxNum
=
20102
,
/// <summary>
///在线双层料仓: 同时动作
/// 电缸运行到入料口下方的位置 , 料仓旋转到对应的位置
/// </summary>
DB_SI_03_InStoreReadyMove
=
20103
,
/// <summary>
/// 在线双层料仓:入仓:(取料叉子进入料口)、
/// </summary>
DB_SI_04_TakeDeviceToDoor
=
20104
,
/// <summary>
/// 在线双层料仓:入仓:(电缸稍微移动到料口上端位置),
/// </summary>
DB_SI_05_ModbusUpToDoor
=
20105
,
/// <summary>
///在线双层料仓: 取出料盘
/// </summary>
DB_SI_06_TakeSITray
=
20106
,
/// <summary>
/// 在线双层料仓:入仓(电缸运行到对应仓位的下方,,旋转电机2正转)
/// </summary>
DB_SI_07_MoveToRoom
=
20107
,
/// <summary>
/// 在线双层料仓:入仓(取料叉子进入仓位)
/// </summary>
DB_SI_08_TakeDeviceToRoom
=
20108
,
/// <summary>
///在线双层料仓: 入仓(电缸微动至对应料仓的下端位置)
/// </summary>
DB_SI_09_PutToRoom
=
20109
,
/// <summary>
/// 在线双层料仓:从仓位出来
/// </summary>
DB_SI_10_SIFromRoom
=
20110
,
/// <summary>
///在线双层料仓: 旋转电机2反转,回到中间等待位置
/// </summary>
DB_SI_11_MoveSIFromRoom
=
20111
,
/// <summary>
/// 在线双层料仓:关闭仓门
/// </summary>
DB_SI_12_CloseDoor
=
20112
,
#
endregion
#
region
在线料仓出库处理
/// <summary>
///在线双层料仓:: 出库处理:等待执行出库
/// </summary>
DB_SO_00_WaitStart
=
20200
,
/// <summary>
///在线双层料仓:
/// </summary>
DB_SO_01_Scanning
=
20201
,
/// <summary>
/// 在线双层料仓:
/// </summary>
DB_SO_02_GetBoxNum
=
20202
,
/// <summary>
///在线双层料仓:出库执行 同时动作
/// 电缸运行到入料口下方的位置 ,料仓旋转到对应的位置,旋转电机2正传
/// </summary>
DB_SO_03_ReadyMove
=
20203
,
/// <summary>
/// 在线双层料仓: 出仓:(取料叉子进入料仓)叉子前进
/// </summary>
DB_SO_04_TakeDeviceToDoor
=
20204
,
/// <summary>
/// 在线双层料仓: 出仓:(电缸稍微移动到料仓上端位置)
/// </summary>
DB_SO_05_ModbusUpToDoor
=
20205
,
/// <summary>
///在线双层料仓: 取出料盘,叉子后退
/// </summary>
DB_SO_06_TakeOutTray
=
20206
,
/// <summary>
/// 在线双层料仓: 出库执行(电缸移动至入料口的上端位置 旋转电机2正转)
/// </summary>
DB_SO_07_MoveToRoom
=
20207
,
/// <summary>
/// 在线双层料仓:出库执行 (叉子前进)
/// </summary>
DB_SO_08_TakeDeviceToRoom
=
20208
,
/// <summary>
///在线双层料仓: 出库执行 (电缸微动至对应料口的下端位置)
/// </summary>
DB_SO_09_PutToRoom
=
20209
,
/// <summary>
/// 在线双层料仓:出库执行 叉子后退
/// </summary>
DB_SO_10_OutFromRoom
=
20210
,
/// <summary>
/// 在线双层料仓:等待物料到达
/// </summary>
DB_SO_11_WaitTrayToDoor
=
20211
,
/// <summary>
/// 在线双层料仓:等待拿走料盘
/// </summary>
DB_SO_12_WaitTrayLeave
=
20212
,
///// <summary>
/////在线双层料仓:出库执行 旋转电机2反转,回到中间等待位置
///// </summary>
//DB_SO_11_MoveOutFromRoom = 20211,
///// <summary>
///// 在线双层料仓:出库执行(关闭仓门
///// </summary>
//DB_SO_CloseDoor = 20213,
#
endregion
/// <summary>
/// 在线双层料仓:回原点:叉子退回
/// </summary>
DB_H_01_ForkBack
=
20301
,
/// <summary>
/// 在线双层料仓:回原点:同时动作:转盘低速旋转 , 电缸回到原位 ,( I/O点控制) 旋转气缸旋回
/// </summary>
DB_H_02_BackHome
=
20302
,
/// <summary>
/// 在线双层料仓:回原点:旋回完成
/// </summary>
DB_H_03_BackEnd
=
20303
,
/// <summary>
/// 在线双层料仓:回原点:原点开关点亮,原点开关点亮,旋回端开关点亮,,转盘停止 ,电缸停止, 清理电钢和转盘的位置信息
/// </summary>
DB_H_04_ClearPosition
=
20304
,
}
public
enum
StoreAlarmType
...
...
@@ -773,7 +333,7 @@ namespace OnlineStore.DeviceLibrary
/// <summary>
/// 轴报警
/// </summary>
AxisAlarm
=
1
,
AxisAlarm
=
1
,
/// <summary>
/// 收到急停
/// </summary>
...
...
@@ -793,6 +353,6 @@ namespace OnlineStore.DeviceLibrary
/// <summary>
/// 电钢报警
/// </summary>
StellAlarm
=
50
,
StellAlarm
=
50
,
}
}
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论