Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
刘韬
/
SO775-DUOStore
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit 9af14a7c
由
LN
编写于
2020-07-13 17:12:48 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
增加父类equipBase
1 个父辈
4f262f65
隐藏空白字符变更
内嵌
并排
正在显示
11 个修改的文件
包含
903 行增加
和
741 行删除
doc/马来西亚DUO料仓电器BOM.xlsx
source/DUOStore/FrmStore.cs
source/DeviceLibrary/DeviceLibrary.csproj
source/DeviceLibrary/duoStore/BoxBean.cs
source/DeviceLibrary/duoStore/BoxBean_Partial.cs
source/DeviceLibrary/duoStore/DUOStoreBean.cs
source/DeviceLibrary/duoStore/EquipBase.cs
source/DeviceLibrary/store/KTK_Store.cs
source/DeviceLibrary/store/StoreStep.cs
source/DeviceLibrary/store/model/StoreMoveInfo.cs
source/LoadCVSLibrary/storeConfig/config/StoreType.cs
doc/马来西亚DUO料仓电器BOM.xlsx
查看文件 @
9af14a7
此文件类型无法预览
source/DUOStore/FrmStore.cs
查看文件 @
9af14a7
...
@@ -128,7 +128,7 @@ namespace OnlineStore.DUOStore
...
@@ -128,7 +128,7 @@ namespace OnlineStore.DUOStore
private
void
ExitApp
()
private
void
ExitApp
()
{
{
DialogResult
result
=
MessageBox
.
Show
(
"是否确定退出
包装料
料仓客户端?"
,
"提示"
,
MessageBoxButtons
.
YesNo
);
DialogResult
result
=
MessageBox
.
Show
(
"是否确定退出
DUO
料仓客户端?"
,
"提示"
,
MessageBoxButtons
.
YesNo
);
if
(
result
.
Equals
(
DialogResult
.
Yes
))
if
(
result
.
Equals
(
DialogResult
.
Yes
))
{
{
//如果料仓还在运行状态,先关闭料仓
//如果料仓还在运行状态,先关闭料仓
...
@@ -255,7 +255,7 @@ namespace OnlineStore.DUOStore
...
@@ -255,7 +255,7 @@ namespace OnlineStore.DUOStore
{
{
if
(
store
.
storeRunStatus
.
Equals
(
StoreRunStatus
.
Wait
))
if
(
store
.
storeRunStatus
.
Equals
(
StoreRunStatus
.
Wait
))
{
{
MessageBox
.
Show
(
store
.
Name
+
"
包装料
料仓未启动,不需要停止"
);
MessageBox
.
Show
(
store
.
Name
+
"
DUO
料仓未启动,不需要停止"
);
return
;
return
;
}
}
if
(
store
!=
null
)
if
(
store
!=
null
)
...
@@ -270,7 +270,7 @@ namespace OnlineStore.DUOStore
...
@@ -270,7 +270,7 @@ namespace OnlineStore.DUOStore
{
{
if
(
store
.
storeRunStatus
.
Equals
(
StoreRunStatus
.
Wait
))
if
(
store
.
storeRunStatus
.
Equals
(
StoreRunStatus
.
Wait
))
{
{
MessageBox
.
Show
(
store
.
Name
+
"
包装料
料仓未启动,无法复位"
);
MessageBox
.
Show
(
store
.
Name
+
"
DUO
料仓未启动,无法复位"
);
return
;
return
;
}
}
store
.
Reset
();
store
.
Reset
();
...
@@ -316,7 +316,7 @@ namespace OnlineStore.DUOStore
...
@@ -316,7 +316,7 @@ namespace OnlineStore.DUOStore
var
prevCpuTime
=
TimeSpan
.
Zero
;
var
prevCpuTime
=
TimeSpan
.
Zero
;
foreach
(
Process
process
in
processes
)
foreach
(
Process
process
in
processes
)
{
{
if
(
process
.
ProcessName
.
EndsWith
(
"
ACPacking
Store"
))
if
(
process
.
ProcessName
.
EndsWith
(
"
DUO
Store"
))
{
{
sbResult
.
AppendFormat
(
DateTime
.
Now
.
ToLongTimeString
()
+
", 名称:{0} 内存大小:{1}M "
,
process
.
ProcessName
,
process
.
PrivateMemorySize64
/
1024
/
1024F
);
sbResult
.
AppendFormat
(
DateTime
.
Now
.
ToLongTimeString
()
+
", 名称:{0} 内存大小:{1}M "
,
process
.
ProcessName
,
process
.
PrivateMemorySize64
/
1024
/
1024F
);
totalMemery
+=
process
.
PrivateMemorySize64
/
1024
;
totalMemery
+=
process
.
PrivateMemorySize64
/
1024
;
...
...
source/DeviceLibrary/DeviceLibrary.csproj
查看文件 @
9af14a7
...
@@ -79,6 +79,7 @@
...
@@ -79,6 +79,7 @@
<Compile Include="duoStore\BoxBean_Partial.cs" />
<Compile Include="duoStore\BoxBean_Partial.cs" />
<Compile Include="duoStore\BoxBean_Shelf.cs" />
<Compile Include="duoStore\BoxBean_Shelf.cs" />
<Compile Include="duoStore\DUOStoreBean_Partial.cs" />
<Compile Include="duoStore\DUOStoreBean_Partial.cs" />
<Compile Include="duoStore\EquipBase.cs" />
<Compile Include="duoStore\HoisterCylinder.cs" />
<Compile Include="duoStore\HoisterCylinder.cs" />
<Compile Include="duoStore\HumitureBean.cs" />
<Compile Include="duoStore\HumitureBean.cs" />
<Compile Include="duoStore\DUOStoreBean.cs" />
<Compile Include="duoStore\DUOStoreBean.cs" />
...
...
source/DeviceLibrary/duoStore/BoxBean.cs
查看文件 @
9af14a7
...
@@ -17,7 +17,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -17,7 +17,7 @@ namespace OnlineStore.DeviceLibrary
/// <summary>
/// <summary>
/// 流水线自动料仓-Box类
/// 流水线自动料仓-Box类
/// </summary>
/// </summary>
public
partial
class
BoxBean
:
KTK_Stor
e
public
partial
class
BoxBean
:
EquipBas
e
{
{
private
bool
IsIntSlvBlock
=
false
;
private
bool
IsIntSlvBlock
=
false
;
public
AutoInoutInfo
AutoInout
=
new
AutoInoutInfo
();
public
AutoInoutInfo
AutoInout
=
new
AutoInoutInfo
();
...
@@ -31,7 +31,6 @@ namespace OnlineStore.DeviceLibrary
...
@@ -31,7 +31,6 @@ namespace OnlineStore.DeviceLibrary
public
HumitureBean
humBean
=
null
;
public
HumitureBean
humBean
=
null
;
private
int
logType
=
1000
;
public
AxisBean
UpdownAxis
=
null
;
public
AxisBean
UpdownAxis
=
null
;
public
AxisBean
MiddleAxis
=
null
;
public
AxisBean
MiddleAxis
=
null
;
...
@@ -50,7 +49,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -50,7 +49,7 @@ namespace OnlineStore.DeviceLibrary
CID
=
config
.
CID
;
CID
=
config
.
CID
;
IoCheckTimer
.
Elapsed
+=
IoCheckTimer_Elapsed
;
IoCheckTimer
.
Elapsed
+=
IoCheckTimer_Elapsed
;
serverCon
nect
Timer
.
Elapsed
+=
server_connect_timer_Tick
;
serverConTimer
.
Elapsed
+=
server_connect_timer_Tick
;
logType
=
1000
*
config
.
Id
;
logType
=
1000
*
config
.
Id
;
//添加调试
//添加调试
IsDebug
=
config
.
IsInDebug
.
Equals
(
1
);
IsDebug
=
config
.
IsInDebug
.
Equals
(
1
);
...
@@ -76,11 +75,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -76,11 +75,7 @@ namespace OnlineStore.DeviceLibrary
UpdownAxis
=
new
AxisBean
(
config
.
UpDown_Axis
,
Name
);
UpdownAxis
=
new
AxisBean
(
config
.
UpDown_Axis
,
Name
);
ComAxis
=
new
AxisBean
(
config
.
Comp_Axis
,
Name
);
ComAxis
=
new
AxisBean
(
config
.
Comp_Axis
,
Name
);
mainTimer
.
Enabled
=
false
;
mainTimer
.
Enabled
=
false
;
int
isAuto
=
ConfigAppSettings
.
GetIntValue
(
Setting_Init
.
App_AutoRun
);
if
(
isAuto
==
1
)
{
mainTimer
.
Enabled
=
true
;
}
}
}
private
void
IoCheckTimer_Elapsed
(
object
sender
,
System
.
Timers
.
ElapsedEventArgs
e
)
private
void
IoCheckTimer_Elapsed
(
object
sender
,
System
.
Timers
.
ElapsedEventArgs
e
)
...
@@ -101,10 +96,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -101,10 +96,7 @@ namespace OnlineStore.DeviceLibrary
}
}
}
}
}
}
}
}
/// <summary>
/// 配置速度,加减速时间
/// </summary>
public
void
MoveAxisConfig
()
public
void
MoveAxisConfig
()
{
{
Config
.
UpDown_Axis
.
BreakOnDO
=
IO_Type
.
UpdownAxis_Break
;
Config
.
UpDown_Axis
.
BreakOnDO
=
IO_Type
.
UpdownAxis_Break
;
...
@@ -113,10 +105,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -113,10 +105,7 @@ namespace OnlineStore.DeviceLibrary
moveAxisList
.
Add
(
Config
.
UpDown_Axis
);
moveAxisList
.
Add
(
Config
.
UpDown_Axis
);
moveAxisList
.
Add
(
Config
.
InOut_Axis
);
moveAxisList
.
Add
(
Config
.
InOut_Axis
);
moveAxisList
.
Add
(
Config
.
Comp_Axis
);
moveAxisList
.
Add
(
Config
.
Comp_Axis
);
}
}
/// <summary>
/// 开始运行
/// </summary>
public
override
bool
StartRun
(
bool
isDebug
=
false
)
public
override
bool
StartRun
(
bool
isDebug
=
false
)
{
{
if
(!
StoreManager
.
Store
.
canStart
)
if
(!
StoreManager
.
Store
.
canStart
)
...
@@ -153,7 +142,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -153,7 +142,7 @@ namespace OnlineStore.DeviceLibrary
StartTime
=
DateTime
.
Now
;
StartTime
=
DateTime
.
Now
;
mainTimer
.
Enabled
=
true
;
mainTimer
.
Enabled
=
true
;
IoCheckTimer
.
Enabled
=
true
;
IoCheckTimer
.
Enabled
=
true
;
serverCon
nect
Timer
.
Enabled
=
true
;
serverConTimer
.
Enabled
=
true
;
return
true
;
return
true
;
}
}
...
@@ -196,7 +185,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -196,7 +185,7 @@ namespace OnlineStore.DeviceLibrary
}
}
storeRunStatus
=
StoreRunStatus
.
Reset
;
storeRunStatus
=
StoreRunStatus
.
Reset
;
storeStatus
=
StoreStatus
.
ResetMove
;
storeStatus
=
StoreStatus
.
ResetMove
;
MoveInfo
.
NewMove
(
MoveType
.
Store
Reset
);
MoveInfo
.
NewMove
(
MoveType
.
Reset
);
if
(!
OpenAllAxis
(
true
))
if
(!
OpenAllAxis
(
true
))
{
{
...
@@ -217,9 +206,8 @@ namespace OnlineStore.DeviceLibrary
...
@@ -217,9 +206,8 @@ namespace OnlineStore.DeviceLibrary
//开始复位动作
//开始复位动作
MoveInfo
.
NextMoveStep
(
StoreMoveStep
.
BOX_H01_InOutBack
);
MoveInfo
.
NextMoveStep
(
StoreMoveStep
.
BOX_H01_InOutBack
);
LogInfo
(
MoveInfo
.
MoveType
+
": 开始料架入库,线体停止,进出轴先原点返回 "
);
LogInfo
(
MoveInfo
.
MoveType
+
": 进出轴回原点 "
);
MoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitTime
(
2000
));
MoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitTime
(
2000
));
LineStop
();
InoutAxis
.
HomeMove
(
MoveInfo
);
InoutAxis
.
HomeMove
(
MoveInfo
);
}
}
...
@@ -238,13 +226,12 @@ namespace OnlineStore.DeviceLibrary
...
@@ -238,13 +226,12 @@ namespace OnlineStore.DeviceLibrary
case
StoreMoveStep
.
BOX_H01_InOutBack
:
case
StoreMoveStep
.
BOX_H01_InOutBack
:
MoveInfo
.
NextMoveStep
(
StoreMoveStep
.
BOX_H02_InoutToP1
);
MoveInfo
.
NextMoveStep
(
StoreMoveStep
.
BOX_H02_InoutToP1
);
MoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitTime
(
1000
));
MoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitTime
(
1000
));
LogInfo
(
MoveInfo
.
MoveType
+
":
,
进出轴到待机点P1,关闭仓门"
);
LogInfo
(
MoveInfo
.
MoveType
+
": 进出轴到待机点P1,关闭仓门"
);
InoutAxis
.
AbsMove
(
MoveInfo
,
Config
.
InOutAxis_P1
,
Config
.
InOutAxis_P1_Speed
);
InoutAxis
.
AbsMove
(
MoveInfo
,
Config
.
InOutAxis_P1
,
Config
.
InOutAxis_P1_Speed
);
CylinderMove
(
MoveInfo
,
IO_Type
.
OutDoor_Up
,
IO_Type
.
OutDoor_Down
);
CylinderMove
(
MoveInfo
,
IO_Type
.
OutDoor_Up
,
IO_Type
.
OutDoor_Down
);
break
;
break
;
case
StoreMoveStep
.
BOX_H02_InoutToP1
:
case
StoreMoveStep
.
BOX_H02_InoutToP1
:
LineStop
();
//如果此时轴三还在报警,需要提示错误并等待
//如果此时轴三还在报警,需要提示错误并等待
if
(
ACServerManager
.
GetAlarmStatus
(
Config
.
InOut_Axis
.
DeviceName
,
Config
.
InOut_Axis
.
GetAxisValue
())
>
0
)
if
(
ACServerManager
.
GetAlarmStatus
(
Config
.
InOut_Axis
.
DeviceName
,
Config
.
InOut_Axis
.
GetAxisValue
())
>
0
)
{
{
...
@@ -254,49 +241,34 @@ namespace OnlineStore.DeviceLibrary
...
@@ -254,49 +241,34 @@ namespace OnlineStore.DeviceLibrary
return
;
return
;
}
}
//复位和回原点要等轴3进出轴ORG亮了以后才能返回其他轴
//复位和回原点要等轴3进出轴ORG亮了以后才能返回其他轴
LogInfo
(
MoveInfo
.
MoveType
+
": , 压紧轴,旋转轴,上下轴开始 原点返回"
);
MoveInfo
.
NextMoveStep
(
StoreMoveStep
.
BOX_H03_OtherAxisHome
);
MoveInfo
.
NextMoveStep
(
StoreMoveStep
.
BOX_H03_OtherAxisHome
);
MoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitTime
(
2000
));
MoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitTime
(
2000
));
LogInfo
(
MoveInfo
.
MoveType
+
": 压紧轴,旋转轴,上下轴开始 原点返回,关闭NG门"
);
CylinderMove
(
MoveInfo
,
IO_Type
.
OutDoor_Up
,
IO_Type
.
OutDoor_Down
);
ComAxis
.
HomeMove
(
MoveInfo
);
ComAxis
.
HomeMove
(
MoveInfo
);
MiddleAxis
.
HomeMove
(
MoveInfo
);
MiddleAxis
.
HomeMove
(
MoveInfo
);
UpdownAxis
.
HomeMove
(
MoveInfo
);
UpdownAxis
.
HomeMove
(
MoveInfo
);
break
;
break
;
case
StoreMoveStep
.
BOX_H03_OtherAxisHome
:
case
StoreMoveStep
.
BOX_H03_OtherAxisHome
:
MoveInfo
.
NextMoveStep
(
StoreMoveStep
.
BOX_H04_OtherAxisBack
);
MoveInfo
.
NextMoveStep
(
StoreMoveStep
.
BOX_H04_OtherAxisBack
);
MoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitTime
(
2000
));
MoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitTime
(
2000
));
LogInfo
(
MoveInfo
.
MoveType
+
": 旋转轴运动到P1,上下轴走到P1,压紧轴到P1 "
);
LogInfo
(
MoveInfo
.
MoveType
+
": 旋转轴运动到P1,上下轴走到P1,压紧轴到P1
,
"
);
MiddleAxis
.
AbsMove
(
MoveInfo
,
Config
.
MiddleAxis_P1
,
Config
.
MiddleAxis_P1_Speed
);
MiddleAxis
.
AbsMove
(
MoveInfo
,
Config
.
MiddleAxis_P1
,
Config
.
MiddleAxis_P1_Speed
);
UpdownAxis
.
AbsMove
(
MoveInfo
,
Config
.
UpDownAxis_P1
,
Config
.
UpDownAxis_P1_Speed
);
UpdownAxis
.
AbsMove
(
MoveInfo
,
Config
.
UpDownAxis_P1
,
Config
.
UpDownAxis_P1_Speed
);
ComAxis
.
AbsMove
(
MoveInfo
,
Config
.
CompAxis_P1
,
Config
.
CompAxis_P1_Speed
);
ComAxis
.
AbsMove
(
MoveInfo
,
Config
.
CompAxis_P1
,
Config
.
CompAxis_P1_Speed
);
break
;
break
;
case
StoreMoveStep
.
BOX_H04_OtherAxisBack
:
case
StoreMoveStep
.
BOX_H04_OtherAxisBack
:
LogInfo
(
MoveInfo
.
MoveType
+
": 完成"
);
LogInfo
(
MoveInfo
.
MoveType
+
": 完成"
);
MoveEndToRuningStatus
();
MoveEndP
();
break
;
break
;
default
:
break
;
default
:
break
;
}
}
}
}
#
endregion
#
endregion
public
bool
OpenAllAxis
(
bool
isCheck
)
{
return
RunMultiAxis
(
true
,
IO_Type
.
Axis_Run
,
IO_Type
.
UpdownAxis_Break
,
new
AxisBean
[]
{
MiddleAxis
,
UpdownAxis
,
InoutAxis
,
ComAxis
});
}
public
void
CloseAllAxis
()
{
LogUtil
.
info
(
Name
+
"关闭刹车,关闭伺服"
);
CloseMultiAxis
(
IO_Type
.
Axis_Run
,
IO_Type
.
UpdownAxis_Break
,
new
AxisBean
[]
{
MiddleAxis
,
UpdownAxis
,
InoutAxis
,
ComAxis
});
}
/// <summary>
/// 停止运行
/// </summary>
public
override
void
StopRun
()
public
override
void
StopRun
()
{
{
lastPosId
=
""
;
lastPosId
=
""
;
...
@@ -304,7 +276,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -304,7 +276,7 @@ namespace OnlineStore.DeviceLibrary
WarnMsg
=
""
;
WarnMsg
=
""
;
AutoInout
.
StopAuto
();
AutoInout
.
StopAuto
();
IoCheckTimer
.
Enabled
=
false
;
IoCheckTimer
.
Enabled
=
false
;
serverCon
nect
Timer
.
Enabled
=
false
;
serverConTimer
.
Enabled
=
false
;
StopMove
();
StopMove
();
storeRunStatus
=
StoreRunStatus
.
Wait
;
storeRunStatus
=
StoreRunStatus
.
Wait
;
...
@@ -312,200 +284,14 @@ namespace OnlineStore.DeviceLibrary
...
@@ -312,200 +284,14 @@ namespace OnlineStore.DeviceLibrary
TimeSpan
span
=
DateTime
.
Now
-
StartTime
;
TimeSpan
span
=
DateTime
.
Now
-
StartTime
;
LogInfo
(
",停止运行,总运行时间:"
+
span
.
ToString
());
LogInfo
(
",停止运行,总运行时间:"
+
span
.
ToString
());
}
}
public
DateTime
LastAlarmTime
=
DateTime
.
Now
;
public
override
void
Alarm
(
AlarmType
alarmType
,
string
alarmDetial
=
""
,
string
alarmMsg
=
""
,
MoveType
storeMoveType
=
MoveType
.
None
)
public
override
void
Alarm
(
AlarmType
alarmType
,
string
alarmDetial
=
""
,
string
alarmMsg
=
""
,
MoveType
storeMoveType
=
MoveType
.
None
)
{
{
if
(
alarmType
.
Equals
(
AlarmType
.
None
).
Equals
(
false
))
base
.
Alarm
(
alarmType
,
alarmDetial
,
alarmMsg
,
storeMoveType
);
{
AutoInout
.
StopAuto
();
LastAlarmTime
=
DateTime
.
Now
;
}
SaveAlarmInfo
(
alarmType
,
alarmDetial
,
alarmMsg
,
storeMoveType
);
AutoInout
.
StopAuto
();
if
(
this
.
alarmType
.
Equals
(
alarmType
)
&&
alarmType
!=
AlarmType
.
SuddenStop
&&
alarmType
!=
AlarmType
.
NoAirCheck
)
{
return
;
}
LogUtil
.
error
(
Name
+
" 报警,报警类型:"
+
alarmType
);
this
.
alarmType
=
alarmType
;
if
(
alarmType
.
Equals
(
AlarmType
.
AxisAlarm
)
|
alarmType
.
Equals
(
AlarmType
.
AxisMoveError
))
{
LogUtil
.
error
(
Name
+
"轴报警, 停止运动, 打开报警灯"
);
StopMove
();
}
else
if
(
alarmType
==
AlarmType
.
SuddenStop
)
{
isInSuddenDown
=
true
;
LogUtil
.
error
(
Name
+
"收到急停信号,停止运动, 打开报警灯 "
);
StopMove
();
storeStatus
=
StoreStatus
.
SuddenStop
;
}
else
if
(
alarmType
.
Equals
(
AlarmType
.
NoAirCheck
))
{
isNoAirCheck
=
true
;
LogUtil
.
error
(
Name
+
" 未检测到气压信号 ,停止运动, 打开报警灯 "
);
StopMove
();
storeStatus
=
StoreStatus
.
SuddenStop
;
}
}
private
bool
InProcess
=
false
;
private
bool
IsChongfu
=
false
;
private
Stopwatch
stopwatch
=
new
Stopwatch
();
protected
override
void
timersTimer_Elapsed
(
object
sender
,
System
.
Timers
.
ElapsedEventArgs
e
)
{
if
(
InProcess
)
{
//TimeSpan span = DateTime.Now - preProcessTime;
if
(
stopwatch
.
Elapsed
.
TotalSeconds
<
10
)
{
return
;
}
else
{
LogUtil
.
error
(
"主定时器:InProcess已等待"
+
stopwatch
.
Elapsed
.
ToString
()
+
"重新处理"
);
IsChongfu
=
true
;
}
}
try
{
InProcess
=
true
;
//preProcessTime = DateTime.Now;
stopwatch
.
Restart
();
IoCheckProcess
();
ShowTimeLog
(
"IoCheckProcess"
);
TimerProcess
();
ShowTimeLog
(
"TimerProcess"
);
//检查运动轴报警
if
(
storeRunStatus
>
StoreRunStatus
.
Wait
&&
(!
isInSuddenDown
)
&&
(!
isNoAirCheck
))
{
ShowTimeLog
(
"开始检测轴报警"
);
CheckAxisAlarm
();
ShowTimeLog
(
"轴报警检测完成"
);
}
}
catch
(
Exception
ex
)
{
LogUtil
.
error
(
Name
+
"定时处理出错:"
+
ex
.
ToString
());
}
IsChongfu
=
false
;
InProcess
=
false
;
}
private
IO_VALUE
preAirValue
=
IO_VALUE
.
HIGH
;
private
void
AirCheckProcess
()
{
IO_VALUE
currAirValue
=
IOValue
(
IO_Type
.
Airpressure_Check
);
if
(
isInSuddenDown
)
{
return
;
}
if
(
isNoAirCheck
)
{
return
;
}
if
(
currAirValue
.
Equals
(
IO_VALUE
.
LOW
))
{
//判断是否持续了3秒
if
(
preAirValue
.
Equals
(
IO_VALUE
.
LOW
))
{
TimeSpan
span
=
DateTime
.
Now
-
lastAirCloseTime
;
if
(
span
.
TotalSeconds
>
StoreManager
.
Config
.
AirCheckSeconds
)
{
WarnMsg
=
"未检测到气压信号"
;
preAirValue
=
IO_VALUE
.
LOW
;
LogUtil
.
info
(
"已持续【"
+
FormUtil
.
GetSpanStr
(
span
)
+
"】未检测到气压信号,报警"
);
Alarm
(
AlarmType
.
NoAirCheck
,
"2"
,
WarnMsg
,
MoveType
.
None
);
return
;
}
}
else
{
lastAirCloseTime
=
DateTime
.
Now
;
isNoAirCheck
=
false
;
}
}
else
{
isNoAirCheck
=
false
;
}
preAirValue
=
currAirValue
;
}
private
void
ShowTimeLog
(
string
info
)
{
if
(
IsChongfu
)
{
LogUtil
.
info
(
Name
+
"【"
+
info
+
"】 处理完成,耗时:"
+
stopwatch
.
Elapsed
.
ToString
());
}
}
}
private
IO_VALUE
lastAutoRun
=
IO_VALUE
.
LOW
;
internal
override
void
TimerProcess
()
public
void
IoCheckProcess
()
{
DateTime
time
=
DateTime
.
Now
;
if
(
storeRunStatus
.
Equals
(
StoreRunStatus
.
Wait
))
{
//取新的Io状态
IO_VALUE
autoSingle
=
IOValue
(
IO_Type
.
Reset_BTN
);
if
(
ConfigAppSettings
.
GetIntValue
(
Setting_Init
.
App_AutoRun
).
Equals
(
1
))
{
if
(
autoSingle
.
Equals
(
IO_VALUE
.
HIGH
)
&&
lastAutoRun
.
Equals
(
IO_VALUE
.
LOW
))
{
//没有启动时收到复位按钮,相当于启动按钮
LogInfo
(
"没有启动时收到复位按钮,相当于启动按钮,开始调用启动方法!"
);
bool
result
=
StartRun
();
if
(
result
.
Equals
(
false
))
{
LogUtil
.
error
(
Name
+
"料仓启动失败,继续等待下次启动!"
);
mainTimer
.
Enabled
=
true
;
}
}
lastAutoRun
=
autoSingle
;
return
;
}
lastAutoRun
=
autoSingle
;
}
//判断急停
else
if
(
storeRunStatus
>=
StoreRunStatus
.
HomeMoving
)
{
////取新的Io状态
//IO_VALUE suddenBtn = IOValue(IO_Type.SuddenStop_BTN);
//IO_VALUE resetBtn = IOValue(IO_Type.Reset_BTN);
//急停按钮
if
(
IOValue
(
IO_Type
.
SuddenStop_BTN
).
Equals
(
IO_VALUE
.
LOW
))
{
return
;
}
else
if
(
IOValue
(
IO_Type
.
Reset_BTN
).
Equals
(
IO_VALUE
.
HIGH
))
{
//收到复位信号,若报警直接复位,若不报警且无操作,回到待机点
if
(
alarmType
.
Equals
(
AlarmType
.
None
)
&&
isInSuddenDown
.
Equals
(
false
)
&&
isNoAirCheck
.
Equals
(
false
))
{
if
(
MoveInfo
.
MoveType
.
Equals
(
MoveType
.
None
))
{
LogUtil
.
info
(
Name
+
"收到复位信号,当前无报警,且空闲中,暂不处理"
);
}
else
{
LogUtil
.
info
(
Name
+
"收到复位信号,当前无报警, 在"
+
MoveInfo
.
MoveType
+
"处理中,不处理复位"
);
}
}
else
{
//收到复位信号
LogUtil
.
info
(
"收到复位信号,自动复位"
);
WarnMsg
=
"收到复位信号,自动复位"
;
Reset
();
}
}
AirCheckProcess
();
}
}
public
void
TimerProcess
()
{
{
try
try
{
{
...
@@ -522,53 +308,22 @@ namespace OnlineStore.DeviceLibrary
...
@@ -522,53 +308,22 @@ namespace OnlineStore.DeviceLibrary
ShowTimeLog
(
"AutoResetProcess"
);
ShowTimeLog
(
"AutoResetProcess"
);
IOTimeOutProcess
();
IOTimeOutProcess
();
ShowTimeLog
(
"IOTimeOutProcess"
);
ShowTimeLog
(
"IOTimeOutProcess"
);
}
}
catch
(
Exception
ex
)
{
LogUtil
.
error
(
Name
+
"定时处理出错"
+
ex
.
ToString
());
}
}
private
DateTime
preIoTimerOutTime
=
DateTime
.
Now
;
}
//检查运动轴报警
/// <summary>
if
(
storeRunStatus
>
StoreRunStatus
.
Wait
&&
(!
isInSuddenDown
)
&&
(!
isNoAirCheck
))
/// io检测异常
/// </summary>
private
void
IOTimeOutProcess
()
{
try
{
TimeSpan
span
=
DateTime
.
Now
-
preIoTimerOutTime
;
if
(
span
.
TotalSeconds
>
1
)
{
{
preIoTimerOutTime
=
DateTime
.
Now
;
ShowTimeLog
(
"开始检测轴报警"
);
if
(!
alarmType
.
Equals
(
AlarmType
.
IoSingleTimeOut
))
CheckAxisAlarm
(
new
AxisBean
[]
{
MiddleAxis
,
UpdownAxis
,
InoutAxis
,
ComAxis
});
{
ShowTimeLog
(
"轴报警检测完成"
);
return
;
}
if
(
storeRunStatus
<
StoreRunStatus
.
Runing
||
isInSuddenDown
||
isNoAirCheck
)
{
return
;
}
//若BOX和移栽都没有在等待Io的过程中则此Io超时异常可能已经处理过
if
(
MoveInfo
.
IsInWait
==
false
)
{
LogUtil
.
info
(
Name
+
"之前有IO超时异常【"
+
alarmInfo
.
alarmDetail
+
"】,但是当前已经没有在等待中,清理信号超时异常!"
);
alarmType
=
AlarmType
.
None
;
WarnMsg
=
""
;
}
}
}
}
}
catch
(
Exception
ex
)
catch
(
Exception
ex
)
{
{
LogUtil
.
error
(
Name
+
"
IOTimeOutProcess出错:
"
+
ex
.
ToString
());
LogUtil
.
error
(
Name
+
"
定时处理出错
"
+
ex
.
ToString
());
}
}
}
}
/// <summary>
/// 超过配置次数时需要复位
/// </summary>
private
void
AutoResetProcess
()
private
void
AutoResetProcess
()
{
{
try
try
...
@@ -605,45 +360,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -605,45 +360,7 @@ namespace OnlineStore.DeviceLibrary
}
}
/// <summary>
/// 判断是否报警,返回 true表示报警 报警检测2秒钟检测一次
/// </summary>
/// <returns></returns>
private
DateTime
checkAlarmTime
=
DateTime
.
Now
;
public
bool
CheckAxisAlarm
()
{
if
(
alarmType
.
Equals
(
AlarmType
.
AxisAlarm
)
||
alarmType
.
Equals
(
AlarmType
.
AxisMoveError
))
{
return
true
;
}
TimeSpan
span
=
DateTime
.
Now
-
checkAlarmTime
;
//在回原点,复位,出入库时,检测报警间隔减小
if
((
storeRunStatus
.
Equals
(
StoreRunStatus
.
Runing
)
&&
span
.
TotalSeconds
<
3
)
||
span
.
TotalSeconds
<
1
)
{
return
false
;
}
checkAlarmTime
=
DateTime
.
Now
;
bool
isInAlarm
=
false
;
foreach
(
ConfigMoveAxis
axisInfo
in
moveAxisList
)
{
short
axis
=
axisInfo
.
GetAxisValue
();
string
deviceName
=
axisInfo
.
GetNameStr
();
if
(
ACServerManager
.
GetAlarmStatus
(
deviceName
,
axis
)
==
1
)
{
WarnMsg
=
Name
+
" 运动轴"
+
axisInfo
.
Explain
+
"报警"
;
Alarm
(
AlarmType
.
AxisAlarm
,
GetAlarmCodeByAxis
(
axisInfo
).
ToString
(),
WarnMsg
,
MoveType
.
None
);
isInAlarm
=
true
;
}
}
//判断报警状态
return
isInAlarm
;
}
/// <summary>
/// 停止所有运行
/// </summary>
public
override
void
StopMove
()
public
override
void
StopMove
()
{
{
IOMove
(
IO_Type
.
UpdownAxis_Break
,
IO_VALUE
.
LOW
);
IOMove
(
IO_Type
.
UpdownAxis_Break
,
IO_VALUE
.
LOW
);
...
@@ -658,32 +375,16 @@ namespace OnlineStore.DeviceLibrary
...
@@ -658,32 +375,16 @@ namespace OnlineStore.DeviceLibrary
LogInfo
(
"StopMove"
);
LogInfo
(
"StopMove"
);
isInPro
=
false
;
isInPro
=
false
;
}
}
private
void
MoveEndToRuningStatus
()
public
bool
OpenAllAxis
(
bool
isCheck
)
{
MoveInfo
.
EndMove
();
storeRunStatus
=
StoreRunStatus
.
Runing
;
storeStatus
=
StoreStatus
.
StoreOnline
;
if
(
alarmType
.
Equals
(
AlarmType
.
None
))
{
WarnMsg
=
""
;
}
}
public
void
LineRun
()
{
IOMove
(
IO_Type
.
Line_BackRun
,
IO_VALUE
.
LOW
);
IOMove
(
IO_Type
.
Line_Run
,
IO_VALUE
.
HIGH
);
}
public
void
LineBackRun
()
{
{
IOMove
(
IO_Type
.
Line_Run
,
IO_VALUE
.
LOW
);
return
RunMultiAxis
(
true
,
IO_Type
.
Axis_Run
,
IO_Type
.
UpdownAxis_Break
,
new
AxisBean
[]
{
MiddleAxis
,
UpdownAxis
,
InoutAxis
,
ComAxis
});
IOMove
(
IO_Type
.
Line_BackRun
,
IO_VALUE
.
HIGH
);
}
}
public
void
LineStop
()
public
void
CloseAllAxis
()
{
{
IOMove
(
IO_Type
.
Line_BackRun
,
IO_VALUE
.
LOW
);
LogUtil
.
info
(
Name
+
"关闭刹车,关闭伺服"
);
IOMove
(
IO_Type
.
Line_Run
,
IO_VALUE
.
LOW
);
CloseMultiAxis
(
IO_Type
.
Axis_Run
,
IO_Type
.
UpdownAxis_Break
,
new
AxisBean
[]
{
MiddleAxis
,
UpdownAxis
,
InoutAxis
,
ComAxis
});
}
}
public
string
GetMoveStr
()
public
string
GetMoveStr
()
{
{
...
...
source/DeviceLibrary/duoStore/BoxBean_Partial.cs
查看文件 @
9af14a7
...
@@ -287,10 +287,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -287,10 +287,7 @@ namespace OnlineStore.DeviceLibrary
TimeSpan
span
=
DateTime
.
Now
-
startInStoreTime
;
TimeSpan
span
=
DateTime
.
Now
-
startInStoreTime
;
string
posId
=
MoveInfo
.
MoveParam
!=
null
?
MoveInfo
.
MoveParam
.
PosID
:
""
;
string
posId
=
MoveInfo
.
MoveParam
!=
null
?
MoveInfo
.
MoveParam
.
PosID
:
""
;
LogUtil
.
info
(
Name
+
" 【"
+
posId
+
"】入库结束,耗时【"
+
FormUtil
.
GetSpanStr
(
span
)
+
"】"
);
LogUtil
.
info
(
Name
+
" 【"
+
posId
+
"】入库结束,耗时【"
+
FormUtil
.
GetSpanStr
(
span
)
+
"】"
);
MoveInfo
.
EndMove
();
MoveEndP
();
storeRunStatus
=
StoreRunStatus
.
Runing
;
//设备连接,入库后,BOX恢复原始状态
storeStatus
=
StoreStatus
.
StoreOnline
;
AutoInout
.
InOutEndProcess
(
this
,
MoveType
.
InStore
);
AutoInout
.
InOutEndProcess
(
this
,
MoveType
.
InStore
);
}
}
...
@@ -341,9 +338,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -341,9 +338,7 @@ namespace OnlineStore.DeviceLibrary
TimeSpan
span
=
DateTime
.
Now
-
startInStoreTime
;
TimeSpan
span
=
DateTime
.
Now
-
startInStoreTime
;
string
posId
=
MoveInfo
.
MoveParam
!=
null
?
MoveInfo
.
MoveParam
.
PosID
:
""
;
string
posId
=
MoveInfo
.
MoveParam
!=
null
?
MoveInfo
.
MoveParam
.
PosID
:
""
;
LogUtil
.
info
(
Name
+
" 【"
+
posId
+
"】NG料送料结束,耗时【"
+
FormUtil
.
GetSpanStr
(
span
)
+
"】"
);
LogUtil
.
info
(
Name
+
" 【"
+
posId
+
"】NG料送料结束,耗时【"
+
FormUtil
.
GetSpanStr
(
span
)
+
"】"
);
MoveInfo
.
EndMove
();
MoveEndP
();
storeRunStatus
=
StoreRunStatus
.
Runing
;
storeStatus
=
StoreStatus
.
StoreOnline
;
}
}
...
@@ -498,12 +493,10 @@ namespace OnlineStore.DeviceLibrary
...
@@ -498,12 +493,10 @@ namespace OnlineStore.DeviceLibrary
else
if
(
MoveInfo
.
MoveStep
==
StoreMoveStep
.
SO_10_GoBack
)
else
if
(
MoveInfo
.
MoveStep
==
StoreMoveStep
.
SO_10_GoBack
)
{
{
TimeSpan
span
=
DateTime
.
Now
-
startOutStoreTime
;
TimeSpan
span
=
DateTime
.
Now
-
startOutStoreTime
;
string
posId
=
MoveInfo
.
MoveParam
.
PosID
;
string
posId
=
MoveInfo
.
MoveParam
.
PosID
;
storeStatus
=
StoreStatus
.
StoreOnline
;
LogUtil
.
info
(
Name
+
" 【"
+
posId
+
"】 出库结束,耗时【"
+
FormUtil
.
GetSpanStr
(
span
)
+
"】!"
);
LogUtil
.
info
(
Name
+
" 【"
+
posId
+
"】 出库结束,耗时【"
+
FormUtil
.
GetSpanStr
(
span
)
+
"】!"
);
MoveInfo
.
EndMove
();
storeRunStatus
=
StoreRunStatus
.
Runing
;
MoveEndP
()
;
AutoInout
.
InOutEndProcess
(
this
,
MoveType
.
OutStore
);
AutoInout
.
InOutEndProcess
(
this
,
MoveType
.
OutStore
);
}
}
#
endregion
#
endregion
...
@@ -550,11 +543,10 @@ namespace OnlineStore.DeviceLibrary
...
@@ -550,11 +543,10 @@ namespace OnlineStore.DeviceLibrary
else
if
(
MoveInfo
.
IsStep
(
StoreMoveStep
.
SO_26_GoBack
))
else
if
(
MoveInfo
.
IsStep
(
StoreMoveStep
.
SO_26_GoBack
))
{
{
TimeSpan
span
=
DateTime
.
Now
-
startInStoreTime
;
TimeSpan
span
=
DateTime
.
Now
-
startInStoreTime
;
string
posId
=
MoveInfo
.
MoveParam
!=
null
?
MoveInfo
.
MoveParam
.
PosID
:
""
;
string
posId
=
MoveInfo
.
MoveParam
!=
null
?
MoveInfo
.
MoveParam
.
PosID
:
""
;
storeStatus
=
StoreStatus
.
StoreOnline
;
LogUtil
.
info
(
Name
+
" 【"
+
posId
+
"】 单盘出库结束,耗时【"
+
FormUtil
.
GetSpanStr
(
span
)
+
"】!"
);
LogUtil
.
info
(
Name
+
" 【"
+
posId
+
"】 单盘出库结束,耗时【"
+
FormUtil
.
GetSpanStr
(
span
)
+
"】!"
);
MoveInfo
.
EndMove
();
storeRunStatus
=
StoreRunStatus
.
Runing
;
MoveEndP
()
;
AutoInout
.
InOutEndProcess
(
this
,
MoveType
.
OutStore
);
AutoInout
.
InOutEndProcess
(
this
,
MoveType
.
OutStore
);
}
}
...
...
source/DeviceLibrary/duoStore/DUOStoreBean.cs
查看文件 @
9af14a7
...
@@ -14,10 +14,8 @@ using System.Timers;
...
@@ -14,10 +14,8 @@ using System.Timers;
namespace
OnlineStore.DeviceLibrary
namespace
OnlineStore.DeviceLibrary
{
{
public
partial
class
DUOStoreBean
:
KTK_Store
public
partial
class
DUOStoreBean
:
EquipBase
{
{
private
System
.
Timers
.
Timer
ledProcessTimer
=
null
;
public
Dictionary
<
int
,
BOX_Config
>
BoxConfigMap
{
get
;
set
;
}
public
Dictionary
<
int
,
BOX_Config
>
BoxConfigMap
{
get
;
set
;
}
public
Dictionary
<
int
,
BoxBean
>
BoxMap
=
new
Dictionary
<
int
,
BoxBean
>();
public
Dictionary
<
int
,
BoxBean
>
BoxMap
=
new
Dictionary
<
int
,
BoxBean
>();
...
@@ -40,7 +38,9 @@ namespace OnlineStore.DeviceLibrary
...
@@ -40,7 +38,9 @@ namespace OnlineStore.DeviceLibrary
lineConfig
.
IOSingle_TimerOut
=
5000
;
lineConfig
.
IOSingle_TimerOut
=
5000
;
}
}
Init
();
Init
();
InitTimer
();
IoCheckTimer
.
Elapsed
+=
IoCheckTimerProcess
;
serverConTimer
.
Elapsed
+=
ServerConnectTimer_Elapsed
;
baseConfig
=
lineConfig
;
baseConfig
=
lineConfig
;
this
.
Config
=
lineConfig
;
this
.
Config
=
lineConfig
;
this
.
ID
=
lineConfig
.
Id
;
this
.
ID
=
lineConfig
.
Id
;
...
@@ -66,23 +66,25 @@ namespace OnlineStore.DeviceLibrary
...
@@ -66,23 +66,25 @@ namespace OnlineStore.DeviceLibrary
IOManager
.
Init
();
IOManager
.
Init
();
CodeManager
.
LoadConfig
();
CodeManager
.
LoadConfig
();
Task
.
Factory
.
StartNew
(
delegate
Task
.
Factory
.
StartNew
(
delegate
{
{
// RFIDManager.RfidReader.Open(rfidList.ToArray());
// RFIDManager.RfidReader.Open(rfidList.ToArray());
IOManager
.
instance
.
ConnectionIOList
(
ioList
);
IOManager
.
instance
.
ConnectionIOList
(
ioList
);
addLastDI
(
IO_Type
.
Airpressure_Check
,
IOValue
(
IO_Type
.
Airpressure_Check
));
addLastDI
(
IO_Type
.
SuddenStop_BTN
,
IOValue
(
IO_Type
.
SuddenStop_BTN
));
addLastDI
(
IO_Type
.
Reset_BTN
,
IOValue
(
IO_Type
.
Reset_BTN
));
IOMove
(
IO_Type
.
Alarm_HddLed
,
IO_VALUE
.
LOW
);
IOMove
(
IO_Type
.
Alarm_HddLed
,
IO_VALUE
.
LOW
);
IOMove
(
IO_Type
.
AutoRun_HddLed
,
IO_VALUE
.
LOW
);
IOMove
(
IO_Type
.
AutoRun_HddLed
,
IO_VALUE
.
LOW
);
IOMove
(
IO_Type
.
RunSign_HddLed
,
IO_VALUE
.
LOW
);
IOMove
(
IO_Type
.
RunSign_HddLed
,
IO_VALUE
.
LOW
);
mainTimer
.
Enabled
=
true
;
mainTimer
.
Enabled
=
true
;
canStart
=
true
;
canStart
=
true
;
int
isAuto
=
ConfigAppSettings
.
GetIntValue
(
Setting_Init
.
App_AutoRun
);
if
(
isAuto
==
1
)
{
mainTimer
.
Enabled
=
true
;
}
});
});
}
}
private
void
AddDeviceName
(
List
<
string
>
targetList
,
List
<
string
>
list
)
private
void
AddDeviceName
(
List
<
string
>
targetList
,
List
<
string
>
list
)
{
{
foreach
(
string
str
in
list
)
foreach
(
string
str
in
list
)
...
@@ -93,20 +95,11 @@ namespace OnlineStore.DeviceLibrary
...
@@ -93,20 +95,11 @@ namespace OnlineStore.DeviceLibrary
}
}
}
}
}
}
public
void
InitTimer
()
{
ledProcessTimer
=
new
System
.
Timers
.
Timer
();
ledProcessTimer
.
Interval
=
1000
;
ledProcessTimer
.
Elapsed
+=
LedProcess
;
ledProcessTimer
.
AutoReset
=
true
;
ledProcessTimer
.
Enabled
=
false
;
}
private
void
IoCheckTimerProcess
(
object
sender
,
ElapsedEventArgs
e
)
{
}
#
endregion
#
endregion
#
region
启动,复位,停止,方法
public
override
bool
StartRun
(
bool
isDebug
=
false
)
public
override
bool
StartRun
(
bool
isDebug
=
false
)
{
{
if
(!
canStart
)
if
(!
canStart
)
...
@@ -129,25 +122,15 @@ namespace OnlineStore.DeviceLibrary
...
@@ -129,25 +122,15 @@ namespace OnlineStore.DeviceLibrary
}
}
else
else
{
{
LogUtil
.
info
(
Name
+
"开始启动
,连接agv调度,连接rfid
,启动时间:"
+
StartTime
.
ToString
());
LogUtil
.
info
(
Name
+
"开始启动
,启动时间:"
+
StartTime
.
ToString
());
storeRunStatus
=
StoreRunStatus
.
HomeMoving
;
storeRunStatus
=
StoreRunStatus
.
HomeMoving
;
StartTime
=
DateTime
.
Now
;
StartTime
=
DateTime
.
Now
;
//AgvClient.SetCancelState(false);
StartResetMove
();
//RFIDManager.Open(rfidList.ToArray());
mainTimer
.
Enabled
=
false
;
isInSuddenDown
=
false
;
isNoAirCheck
=
false
;
alarmType
=
AlarmType
.
None
;
WarnMsg
=
""
;
foreach
(
BoxBean
box
in
this
.
BoxMap
.
Values
)
foreach
(
BoxBean
box
in
this
.
BoxMap
.
Values
)
{
{
box
.
StartRun
();
box
.
StartRun
();
}
}
serverConTimer
.
Enabled
=
true
;
ledProcessTimer
.
Enabled
=
true
;
mainTimer
.
Enabled
=
true
;
mainTimer
.
Enabled
=
true
;
return
true
;
return
true
;
}
}
...
@@ -162,12 +145,8 @@ namespace OnlineStore.DeviceLibrary
...
@@ -162,12 +145,8 @@ namespace OnlineStore.DeviceLibrary
MoveInfo
.
EndMove
();
MoveInfo
.
EndMove
();
storeRunStatus
=
StoreRunStatus
.
Reset
;
storeRunStatus
=
StoreRunStatus
.
Reset
;
StartResetMove
();
mainTimer
.
Enabled
=
false
;
isInSuddenDown
=
false
;
isNoAirCheck
=
false
;
alarmType
=
AlarmType
.
None
;
WarnMsg
=
""
;
foreach
(
BoxBean
equip
in
BoxMap
.
Values
)
foreach
(
BoxBean
equip
in
BoxMap
.
Values
)
{
{
...
@@ -179,16 +158,143 @@ namespace OnlineStore.DeviceLibrary
...
@@ -179,16 +158,143 @@ namespace OnlineStore.DeviceLibrary
else
else
{
{
LogUtil
.
info
(
Name
+
"收到复位信号,"
+
equip
.
Name
+
" 正常无报警,不需要复位"
);
LogUtil
.
info
(
Name
+
"收到复位信号,"
+
equip
.
Name
+
" 正常无报警,不需要复位"
);
}
}
}
}
mainTimer
.
Enabled
=
true
;
mainTimer
.
Enabled
=
true
;
}
}
private
void
StartResetMove
()
{
mainTimer
.
Enabled
=
false
;
isInSuddenDown
=
false
;
isNoAirCheck
=
false
;
alarmType
=
AlarmType
.
None
;
WarnMsg
=
""
;
MoveInfo
.
NewMove
(
MoveType
.
Reset
);
MoveInfo
.
NextMoveStep
(
StoreMoveStep
.
LR_01_StopUp
);
LogUtil
.
info
(
Name
+
"开始复位 "
+
MoveInfo
.
MoveStep
+
" :四个阻挡全部上升"
);
MoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitTime
(
600
));
IOMove
(
IO_Type
.
Line_Stop1_Wait
,
IO_VALUE
.
LOW
);
IOMove
(
IO_Type
.
Line_Stop2_Work
,
IO_VALUE
.
LOW
);
IOMove
(
IO_Type
.
Line_Stop3_Buffer
,
IO_VALUE
.
LOW
);
IOMove
(
IO_Type
.
Line_Stop4_Out
,
IO_VALUE
.
LOW
);
MoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitIO
(
IO_Type
.
Line_Stop1_Wait
,
IO_VALUE
.
LOW
));
MoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitIO
(
IO_Type
.
Line_Stop2_Work
,
IO_VALUE
.
LOW
));
MoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitIO
(
IO_Type
.
Line_Stop3_Buffer
,
IO_VALUE
.
LOW
));
MoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitIO
(
IO_Type
.
Line_Stop4_Out
,
IO_VALUE
.
LOW
));
}
protected
override
void
ResetProcess
()
{
if
(
MoveInfo
.
IsInWait
)
{
CheckWait
();
}
if
(
MoveInfo
.
IsInWait
)
{
return
;
}
if
(
MoveInfo
.
IsStep
(
StoreMoveStep
.
LR_01_StopUp
))
{
MoveInfo
.
NextMoveStep
(
StoreMoveStep
.
LR_02_LineRun
);
LogUtil
.
info
(
Name
+
"复位 "
+
MoveInfo
.
MoveStep
+
" :流水线转动3秒"
);
MoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitTime
(
3000
));
LineRun
(
MoveInfo
);
}
else
if
(
MoveInfo
.
IsStep
(
StoreMoveStep
.
LR_02_LineRun
))
{
MoveInfo
.
NextMoveStep
(
StoreMoveStep
.
LR_03_BatchAxisHome
);
LogUtil
.
info
(
Name
+
"复位 "
+
MoveInfo
.
MoveStep
+
" :夹爪放松,提升轴回原点,上下轴回原点"
);
MoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitTime
(
1000
));
CylinderMove
(
MoveInfo
,
IO_Type
.
ClampCylinder_Clamp
,
IO_Type
.
ClampCylinder_Relax
);
T1_BatchAxis
.
HomeMove
(
MoveInfo
);
T3_UpdownAxis
.
HomeMove
(
MoveInfo
);
}
else
if
(
MoveInfo
.
IsStep
(
StoreMoveStep
.
LR_03_BatchAxisHome
))
{
MoveInfo
.
NextMoveStep
(
StoreMoveStep
.
LR_04_BatchToP1
);
LogUtil
.
info
(
Name
+
"复位 "
+
MoveInfo
.
MoveStep
+
" :提升轴到P1点,上下轴到待机点P1"
);
MoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitTime
(
1000
));
T1_BatchAxis
.
AbsMove
(
MoveInfo
,
Config
.
BatchAxis_P1
,
Config
.
BatchAxis_P1Speed
);
T3_UpdownAxis
.
AbsMove
(
MoveInfo
,
Config
.
UpdownAxis_P1
,
Config
.
UpdownAxis_P1Speed
);
}
else
if
(
MoveInfo
.
IsStep
(
StoreMoveStep
.
LR_04_BatchToP1
))
{
MoveInfo
.
NextMoveStep
(
StoreMoveStep
.
LR_05_Hoister_Back
);
LogUtil
.
info
(
Name
+
"复位 "
+
MoveInfo
.
MoveStep
+
" :取料电机后退,旋转轴回原点"
);
MoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitTime
(
1000
));
hoisterCylinder
.
StartBack
(
MoveInfo
);
T2_MiddleAxis
.
HomeMove
(
MoveInfo
);
}
else
if
(
MoveInfo
.
IsStep
(
StoreMoveStep
.
LR_05_Hoister_Back
))
{
MoveInfo
.
NextMoveStep
(
StoreMoveStep
.
LR_06_TopDown
);
LogUtil
.
info
(
Name
+
"复位 "
+
MoveInfo
.
MoveStep
+
" :顶升气缸下降,旋转轴到待机点P1"
);
MoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitTime
(
1000
));
CylinderMove
(
MoveInfo
,
IO_Type
.
TopCylinder_Up
,
IO_Type
.
TopCylinder_Down
);
T2_MiddleAxis
.
AbsMove
(
MoveInfo
,
Config
.
MiddleAxis_P2
,
Config
.
MiddleAxis_P2Speed
);
}
else
if
(
MoveInfo
.
IsStep
(
StoreMoveStep
.
LR_06_TopDown
))
{
MoveInfo
.
NextMoveStep
(
StoreMoveStep
.
LR_07_WaitBox
);
LogUtil
.
info
(
Name
+
"复位 "
+
MoveInfo
.
MoveStep
+
" :等待料仓复位完成"
);
}
else
if
(
MoveInfo
.
IsStep
(
StoreMoveStep
.
LR_07_WaitBox
))
{
bool
isOk
=
true
;
//判断是否所有的已经返回完成
string
msg
=
"等待BOX复位完成超时"
;
foreach
(
BoxBean
box
in
this
.
BoxMap
.
Values
)
{
if
((
box
.
storeRunStatus
.
Equals
(
StoreRunStatus
.
HomeMoving
)
||
box
.
storeRunStatus
.
Equals
(
StoreRunStatus
.
Reset
)))
//if ((box.storeRunStatus.Equals(StoreRunStatus.HomeMoving) || box.storeRunStatus.Equals(StoreRunStatus.Reset)) && box.IsDebug.Equals(false))
{
if
(
box
.
alarmType
.
Equals
(
AlarmType
.
None
))
{
msg
=
"等待"
+
box
.
Name
+
"复位完成超时"
;
isOk
=
false
;
break
;
}
else
{
WarnMsg
=
box
.
Name
+
"在复位过程中报警,需要重新复位"
;
}
}
}
if
(
isOk
)
{
//所有原点重置完成
LogUtil
.
info
(
Name
+
"所有设备重置完成"
);
MoveEndP
();
}
else
if
(
MoveInfo
.
IsTimeOut
(
120
))
{
WarnMsg
=
Name
+
"["
+
MoveInfo
.
MoveStep
+
"] "
+
msg
+
" ["
+
Math
.
Round
(
MoveInfo
.
StepSpan
().
TotalSeconds
,
1
)
+
"]秒"
;
LogUtil
.
error
(
WarnMsg
,
logType
+
21
);
Alarm
(
AlarmType
.
IoSingleTimeOut
);
}
}
}
public
override
void
StopMove
()
{
foreach
(
BoxBean
equip
in
this
.
BoxMap
.
Values
)
{
equip
.
StopMove
();
}
MoveInfo
.
EndMove
();
}
public
override
void
StopRun
()
public
override
void
StopRun
()
{
{
mainTimer
.
Enabled
=
false
;
mainTimer
.
Enabled
=
false
;
ledProcessTimer
.
Enabled
=
false
;
//停止运行时,把阻挡气缸上升
//停止运行时,把阻挡气缸上升
StopMove
();
StopMove
();
foreach
(
BoxBean
equip
in
BoxMap
.
Values
)
foreach
(
BoxBean
equip
in
BoxMap
.
Values
)
...
@@ -196,13 +302,14 @@ namespace OnlineStore.DeviceLibrary
...
@@ -196,13 +302,14 @@ namespace OnlineStore.DeviceLibrary
equip
.
StopRun
();
equip
.
StopRun
();
}
}
storeRunStatus
=
StoreRunStatus
.
Wait
;
storeRunStatus
=
StoreRunStatus
.
Wait
;
// RFIDManager.Close();
// RFIDManager.Close();
TimeSpan
span
=
DateTime
.
Now
-
StartTime
;
TimeSpan
span
=
DateTime
.
Now
-
StartTime
;
LogUtil
.
info
(
Name
+
",停止运行,关闭rfid,总运行时间:"
+
span
.
ToString
());
LogUtil
.
info
(
Name
+
",停止运行,关闭rfid,总运行时间:"
+
span
.
ToString
());
}
}
#
endregion
#
region
灯光处理
#
region
灯光处理
private
void
LedProcess
(
object
sender
,
ElapsedEventArgs
e
)
private
void
LedProcess
(
)
{
{
try
try
{
{
...
@@ -293,62 +400,163 @@ namespace OnlineStore.DeviceLibrary
...
@@ -293,62 +400,163 @@ namespace OnlineStore.DeviceLibrary
Thread
.
Sleep
(
5
);
Thread
.
Sleep
(
5
);
}
}
private
bool
IsDoValue
(
string
ioType
,
IO_VALUE
ioValue
)
#
endregion
#
region
定时处理
private
IO_VALUE
lastAutoRun
=
IO_VALUE
.
LOW
;
private
IO_VALUE
preAirValue
=
IO_VALUE
.
HIGH
;
private
void
AirCheckProcess
()
{
{
return
IOValue
(
ioType
).
Equals
(
ioValue
);
}
#
endregion
protected
override
void
timersTimer_Elapsed
(
object
sender
,
ElapsedEventArgs
e
)
IO_VALUE
currAirValue
=
IOValue
(
IO_Type
.
Airpressure_Check
);
{
if
(
isInSuddenDown
)
BusyMoveProcess
();
{
}
return
;
public
override
void
StopMove
()
}
{
if
(
isNoAirCheck
)
foreach
(
BoxBean
equip
in
this
.
BoxMap
.
Values
)
{
{
// if (!equip.IsDebug)
return
;
}
if
(
currAirValue
.
Equals
(
IO_VALUE
.
LOW
))
{
//判断是否持续了3秒
if
(
preAirValue
.
Equals
(
IO_VALUE
.
LOW
))
{
{
equip
.
StopMove
();
TimeSpan
span
=
DateTime
.
Now
-
lastAirCloseTime
;
}
if
(
span
.
TotalSeconds
>
StoreManager
.
Config
.
AirCheckSeconds
)
{
WarnMsg
=
"未检测到气压信号"
;
preAirValue
=
IO_VALUE
.
LOW
;
LogUtil
.
info
(
"已持续【"
+
FormUtil
.
GetSpanStr
(
span
)
+
"】未检测到气压信号,报警"
);
Alarm
(
AlarmType
.
NoAirCheck
,
"2"
,
WarnMsg
,
MoveType
.
None
);
return
;
}
}
else
{
lastAirCloseTime
=
DateTime
.
Now
;
isNoAirCheck
=
false
;
}
}
}
MoveInfo
.
EndMove
();
else
{
isNoAirCheck
=
false
;
}
preAirValue
=
currAirValue
;
}
private
void
ServerConnectTimer_Elapsed
(
object
sender
,
ElapsedEventArgs
e
)
{
LedProcess
();
}
}
private
void
IoCheckTimerProcess
(
object
sender
,
ElapsedEventArgs
e
)
protected
override
void
ResetProcess
()
{
{
bool
isOk
=
true
;
try
//判断是否所有的已经返回完成
foreach
(
BoxBean
box
in
this
.
BoxMap
.
Values
)
{
{
if
((
box
.
storeRunStatus
.
Equals
(
StoreRunStatus
.
HomeMoving
)
||
box
.
storeRunStatus
.
Equals
(
StoreRunStatus
.
Reset
))
)
DateTime
time
=
DateTime
.
Now
;
//if ((box.storeRunStatus.Equals(StoreRunStatus.HomeMoving) || box.storeRunStatus.Equals(StoreRunStatus.Reset)) && box.IsDebug.Equals(false))
if
(
storeRunStatus
.
Equals
(
StoreRunStatus
.
Wait
))
{
//取新的Io状态
IO_VALUE
autoSingle
=
IOValue
(
IO_Type
.
Reset_BTN
);
if
(
ConfigAppSettings
.
GetIntValue
(
Setting_Init
.
App_AutoRun
).
Equals
(
1
))
{
{
if
(
box
.
alarmType
.
Equals
(
AlarmType
.
None
))
if
(
autoSingle
.
Equals
(
IO_VALUE
.
HIGH
)
&&
lastAutoRun
.
Equals
(
IO_VALUE
.
LOW
))
{
//没有启动时收到复位按钮,相当于启动按钮
LogInfo
(
"没有启动时收到复位按钮,相当于启动按钮,开始调用启动方法!"
);
bool
result
=
StartRun
();
if
(
result
.
Equals
(
false
))
{
LogUtil
.
error
(
Name
+
"料仓启动失败,继续等待下次启动!"
);
mainTimer
.
Enabled
=
true
;
}
}
lastAutoRun
=
autoSingle
;
return
;
}
lastAutoRun
=
autoSingle
;
}
//判断急停
else
if
(
storeRunStatus
>=
StoreRunStatus
.
HomeMoving
)
{
//急停按钮
if
(
IOValue
(
IO_Type
.
SuddenStop_BTN
).
Equals
(
IO_VALUE
.
LOW
))
{
{
isOk
=
false
;
return
;
break
;
}
}
else
else
if
(
IOValue
(
IO_Type
.
Reset_BTN
).
Equals
(
IO_VALUE
.
HIGH
))
{
{
WarnMsg
=
box
.
Name
+
"在复位过程中报警,需要重新复位"
;
//收到复位信号,若报警直接复位,若不报警且无操作,回到待机点
if
(
alarmType
.
Equals
(
AlarmType
.
None
)
&&
isInSuddenDown
.
Equals
(
false
)
&&
isNoAirCheck
.
Equals
(
false
))
{
if
(
MoveInfo
.
MoveType
.
Equals
(
MoveType
.
None
))
{
LogUtil
.
info
(
Name
+
"收到复位信号,当前无报警,且空闲中,暂不处理"
);
}
else
{
LogUtil
.
info
(
Name
+
"收到复位信号,当前无报警, 在"
+
MoveInfo
.
MoveType
+
"处理中,不处理复位"
);
}
}
else
{
//收到复位信号
LogUtil
.
info
(
"收到复位信号,自动复位"
);
WarnMsg
=
"收到复位信号,自动复位"
;
Reset
();
}
}
}
AirCheckProcess
();
}
}
}
}
catch
(
Exception
ex
)
if
(
isOk
)
{
{
LogUtil
.
error
(
Name
+
"IoCheckTimerProcess 出错:"
+
ex
.
ToString
());
//所有原点重置完成
storeRunStatus
=
StoreRunStatus
.
Runing
;
LogUtil
.
info
(
Name
+
"所有设备重置完成"
);
}
}
}
}
public
override
void
Alarm
(
AlarmType
alarmType
,
string
alarmDetial
=
""
,
string
alarmMsg
=
""
,
MoveType
storeMoveType
=
MoveType
.
None
)
internal
override
void
TimerProcess
(
)
{
{
try
{
DateTime
time
=
DateTime
.
Now
;
if
(
MoveInfo
.
MoveType
!=
MoveType
.
None
)
{
BusyMoveProcess
();
ShowTimeLog
(
"BusyMoveProcess"
);
}
else
if
(
storeRunStatus
.
Equals
(
StoreRunStatus
.
Runing
))
{
ShowTimeLog
(
"AutoResetProcess"
);
IOTimeOutProcess
();
ShowTimeLog
(
"IOTimeOutProcess"
);
}
//检查运动轴报警
if
(
storeRunStatus
>
StoreRunStatus
.
Wait
&&
(!
isInSuddenDown
)
&&
(!
isNoAirCheck
))
{
ShowTimeLog
(
"开始检测轴报警"
);
CheckAxisAlarm
(
new
AxisBean
[]
{
T1_BatchAxis
,
T2_MiddleAxis
,
T3_UpdownAxis
});
ShowTimeLog
(
"轴报警检测完成"
);
}
}
catch
(
Exception
ex
)
{
LogUtil
.
error
(
Name
+
"定时处理出错"
+
ex
.
ToString
());
}
}
#
endregion
public
int
GetShelfNum
()
{
int
ShelfCheck1
=
(
int
)
IOValue
(
IO_Type
.
ShelfCheck1
);
int
ShelfCheck2
=
(
int
)
IOValue
(
IO_Type
.
ShelfCheck2
);
int
ShelfCheck3
=
(
int
)
IOValue
(
IO_Type
.
ShelfCheck3
);
int
ShelfCheck4
=
(
int
)
IOValue
(
IO_Type
.
ShelfCheck4
);
string
dStr
=
ShelfCheck4
.
ToString
()+
ShelfCheck3
.
ToString
()
+
ShelfCheck2
.
ToString
()
+
ShelfCheck1
.
ToString
();
int
num
=
Convert
.
ToInt32
(
dStr
,
2
);
return
num
;
}
}
public
void
LineRun
(
StoreMoveInfo
move
)
public
void
LineRun
(
StoreMoveInfo
move
)
...
...
source/DeviceLibrary/duoStore/EquipBase.cs
0 → 100644
查看文件 @
9af14a7
using
DeviceLib
;
using
OnlineStore.Common
;
using
OnlineStore.LoadCSVLibrary
;
using
System
;
using
System.Collections.Generic
;
using
System.Diagnostics
;
using
System.Linq
;
using
System.Text
;
using
System.Threading.Tasks
;
namespace
OnlineStore.DeviceLibrary
{
public
abstract
class
EquipBase
:
KTK_Store
{
internal
int
logType
=
1000
;
public
DateTime
LastAlarmTime
=
DateTime
.
Now
;
public
override
void
Alarm
(
AlarmType
alarmType
,
string
alarmDetial
=
""
,
string
alarmMsg
=
""
,
MoveType
storeMoveType
=
MoveType
.
None
)
{
if
(
alarmType
.
Equals
(
AlarmType
.
None
).
Equals
(
false
))
{
LastAlarmTime
=
DateTime
.
Now
;
}
SaveAlarmInfo
(
alarmType
,
alarmDetial
,
alarmMsg
,
storeMoveType
);
if
(
this
.
alarmType
.
Equals
(
alarmType
)
&&
alarmType
!=
AlarmType
.
SuddenStop
&&
alarmType
!=
AlarmType
.
NoAirCheck
)
{
return
;
}
LogUtil
.
error
(
Name
+
" 报警,报警类型:"
+
alarmType
);
this
.
alarmType
=
alarmType
;
if
(
alarmType
.
Equals
(
AlarmType
.
AxisAlarm
)
|
alarmType
.
Equals
(
AlarmType
.
AxisMoveError
))
{
LogUtil
.
error
(
Name
+
"轴报警, 停止运动, 打开报警灯"
);
StopMove
();
}
else
if
(
alarmType
==
AlarmType
.
SuddenStop
)
{
isInSuddenDown
=
true
;
LogUtil
.
error
(
Name
+
"收到急停信号,停止运动, 打开报警灯 "
);
StopMove
();
storeStatus
=
StoreStatus
.
SuddenStop
;
}
else
if
(
alarmType
.
Equals
(
AlarmType
.
NoAirCheck
))
{
isNoAirCheck
=
true
;
LogUtil
.
error
(
Name
+
" 未检测到气压信号 ,停止运动, 打开报警灯 "
);
StopMove
();
storeStatus
=
StoreStatus
.
SuddenStop
;
}
}
private
bool
InProcess
=
false
;
private
bool
IsChongfu
=
false
;
private
Stopwatch
stopwatch
=
new
Stopwatch
();
protected
override
void
timersTimer_Elapsed
(
object
sender
,
System
.
Timers
.
ElapsedEventArgs
e
)
{
if
(
InProcess
)
{
if
(
stopwatch
.
Elapsed
.
TotalSeconds
<
10
)
{
return
;
}
else
{
LogUtil
.
error
(
"主定时器:InProcess已等待"
+
stopwatch
.
Elapsed
.
ToString
()
+
"重新处理"
);
IsChongfu
=
true
;
}
}
try
{
InProcess
=
true
;
stopwatch
.
Restart
();
TimerProcess
();
ShowTimeLog
(
"TimerProcess"
);
}
catch
(
Exception
ex
)
{
LogUtil
.
error
(
Name
+
"定时处理出错:"
+
ex
.
ToString
());
}
IsChongfu
=
false
;
InProcess
=
false
;
}
internal
virtual
void
TimerProcess
()
{
}
internal
void
ShowTimeLog
(
string
info
)
{
if
(
IsChongfu
)
{
LogUtil
.
info
(
Name
+
"【"
+
info
+
"】 处理完成,耗时:"
+
stopwatch
.
Elapsed
.
ToString
());
}
}
internal
DateTime
preIoTimerOutTime
=
DateTime
.
Now
;
internal
void
IOTimeOutProcess
()
{
try
{
TimeSpan
span
=
DateTime
.
Now
-
preIoTimerOutTime
;
if
(
span
.
TotalSeconds
>
1
)
{
preIoTimerOutTime
=
DateTime
.
Now
;
if
(!
alarmType
.
Equals
(
AlarmType
.
IoSingleTimeOut
))
{
return
;
}
if
(
storeRunStatus
<
StoreRunStatus
.
Runing
||
isInSuddenDown
||
isNoAirCheck
)
{
return
;
}
//若BOX和移栽都没有在等待Io的过程中则此Io超时异常可能已经处理过
if
(
MoveInfo
.
IsInWait
==
false
)
{
LogUtil
.
info
(
Name
+
"之前有IO超时异常【"
+
alarmInfo
.
alarmDetail
+
"】,但是当前已经没有在等待中,清理信号超时异常!"
);
alarmType
=
AlarmType
.
None
;
WarnMsg
=
""
;
}
}
}
catch
(
Exception
ex
)
{
LogUtil
.
error
(
Name
+
"IOTimeOutProcess出错:"
+
ex
.
ToString
());
}
}
/// <summary>
/// 判断是否报警,返回 true表示报警 报警检测2秒钟检测一次
/// </summary>
/// <returns></returns>
internal
DateTime
checkAlarmTime
=
DateTime
.
Now
;
internal
bool
CheckAxisAlarm
(
AxisBean
[]
axisList
)
{
if
(
alarmType
.
Equals
(
AlarmType
.
AxisAlarm
)
||
alarmType
.
Equals
(
AlarmType
.
AxisMoveError
))
{
return
true
;
}
TimeSpan
span
=
DateTime
.
Now
-
checkAlarmTime
;
//在回原点,复位,出入库时,检测报警间隔减小
if
((
storeRunStatus
.
Equals
(
StoreRunStatus
.
Runing
)
&&
span
.
TotalSeconds
<
3
)
||
span
.
TotalSeconds
<
1
)
{
return
false
;
}
checkAlarmTime
=
DateTime
.
Now
;
bool
isInAlarm
=
false
;
foreach
(
AxisBean
axisInfo
in
axisList
)
{
short
axis
=
axisInfo
.
Config
.
GetAxisValue
();
string
deviceName
=
axisInfo
.
Config
.
GetNameStr
();
if
(
ACServerManager
.
GetAlarmStatus
(
deviceName
,
axis
)
==
1
)
{
WarnMsg
=
Name
+
" 运动轴"
+
axisInfo
.
Config
.
Explain
+
"报警"
;
Alarm
(
AlarmType
.
AxisAlarm
,
GetAlarmCodeByAxis
(
axisInfo
.
Config
).
ToString
(),
WarnMsg
,
MoveType
.
None
);
isInAlarm
=
true
;
}
}
//判断报警状态
return
isInAlarm
;
}
internal
bool
IsDoValue
(
string
ioType
,
IO_VALUE
ioValue
)
{
return
IOValue
(
ioType
).
Equals
(
ioValue
);
}
internal
void
MoveEndP
()
{
MoveInfo
.
EndMove
();
storeRunStatus
=
StoreRunStatus
.
Runing
;
storeStatus
=
StoreStatus
.
StoreOnline
;
if
(
alarmType
.
Equals
(
AlarmType
.
None
))
{
WarnMsg
=
""
;
}
}
#
region
出入库结果验证
internal
void
CheckWait
()
{
List
<
WaitResultInfo
>
list
=
MoveInfo
.
WaitList
;
//当等待超过一分钟时,需要打印提示
TimeSpan
span
=
DateTime
.
Now
-
MoveInfo
.
LastSetpTime
;
string
NotOkMsg
=
""
;
if
(
list
.
Count
<=
0
)
{
MoveInfo
.
EndStepWait
();
return
;
}
bool
isOk
=
true
;
if
(
MoveInfo
.
OneWaitCanEndStep
)
{
isOk
=
false
;
}
foreach
(
WaitResultInfo
wait
in
list
)
{
if
(
wait
.
IsEnd
)
{
continue
;
}
NotOkMsg
=
wait
.
ToStr
();
if
(
wait
.
WaitType
.
Equals
(
WaitEnum
.
W001_AxisMove
))
{
string
msg
=
""
;
if
(
wait
.
IsHomeMove
)
{
wait
.
IsEnd
=
AxisBean
.
HomeMoveIsEnd
(
MoveInfo
,
wait
.
AxisInfo
,
out
msg
);
}
else
{
wait
.
IsEnd
=
AxisBean
.
ACAxisMoveIsEnd
(
MoveInfo
,
wait
.
AxisInfo
,
wait
.
TargetPosition
,
wait
.
TargetSpeed
,
out
msg
);
}
if
(!
msg
.
Equals
(
""
))
{
isOk
=
false
;
WarnMsg
=
msg
;
Alarm
(
AlarmType
.
AxisMoveError
,
GetAlarmCodeByAxis
(
wait
.
AxisInfo
).
ToString
(),
WarnMsg
,
MoveInfo
.
MoveType
);
break
;
}
}
else
if
(
wait
.
WaitType
.
Equals
(
WaitEnum
.
W002_IOValue
))
{
wait
.
IsEnd
=
IOValue
(
wait
.
IoType
).
Equals
(
wait
.
IoValue
);
int
timeOutMs
=
StoreManager
.
Config
.
IOSingle_TimerOut
;
if
((!
wait
.
IsEnd
)
&&
span
.
TotalMilliseconds
>
timeOutMs
&&
NoAlarm
())
{
ConfigIO
io
=
baseConfig
.
getWaitIO
(
wait
.
IoType
);
WarnMsg
=
Name
+
"["
+
MoveInfo
.
MoveType
+
"]["
+
MoveInfo
.
MoveStep
+
"] 等待("
+
io
.
DisplayStr
+
"="
+
wait
.
IoValue
+
") 超时"
;
Alarm
(
AlarmType
.
IoSingleTimeOut
,
io
.
ElectricalDefinition
,
WarnMsg
,
MoveInfo
.
MoveType
);
LogUtil
.
error
(
Name
+
"["
+
MoveInfo
.
MoveType
+
"]["
+
MoveInfo
.
MoveStep
+
"] 等待("
+
io
.
DisplayStr
+
"="
+
wait
.
IoValue
+
") 超时"
,
logType
+
14
);
if
(!
MoveInfo
.
OneWaitCanEndStep
)
{
isOk
=
false
;
break
;
}
}
}
else
if
(
wait
.
WaitType
.
Equals
(
WaitEnum
.
W003_Time
))
{
wait
.
IsEnd
=
(
span
.
TotalMilliseconds
>=
wait
.
TimeMSeconds
);
}
if
(
wait
.
IsEnd
)
{
if
(
MoveInfo
.
OneWaitCanEndStep
)
{
isOk
=
true
;
break
;
}
}
else
{
if
(!
MoveInfo
.
OneWaitCanEndStep
)
{
isOk
=
false
;
break
;
}
}
}
if
(
isOk
)
{
MoveInfo
.
EndStepWait
();
}
else
if
(
span
.
TotalSeconds
>
MoveInfo
.
TimeOutSeconds
)
{
WarnMsg
=
Name
+
"["
+
MoveInfo
.
MoveType
+
"]["
+
MoveInfo
.
MoveStep
+
"]等待"
+
NotOkMsg
+
"超时["
+
Math
.
Round
(
span
.
TotalSeconds
,
1
)
+
"]秒"
;
int
second
=
10
;
second
=
(
int
)(
MoveInfo
.
TimeOutSeconds
/
span
.
TotalSeconds
)
*
10
;
if
(
second
>
120
)
{
second
=
120
;
}
else
if
(
second
<
10
)
{
second
=
10
;
}
LogUtil
.
error
(
WarnMsg
,
logType
+
100
,
second
);
Alarm
(
AlarmType
.
IoSingleTimeOut
,
""
,
WarnMsg
,
MoveInfo
.
MoveType
);
}
}
#
endregion
}
}
source/DeviceLibrary/store/KTK_Store.cs
查看文件 @
9af14a7
...
@@ -41,7 +41,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -41,7 +41,7 @@ namespace OnlineStore.DeviceLibrary
private
StoreRunStatus
storerunstatus
=
StoreRunStatus
.
Wait
;
private
StoreRunStatus
storerunstatus
=
StoreRunStatus
.
Wait
;
protected
System
.
Timers
.
Timer
mainTimer
;
protected
System
.
Timers
.
Timer
mainTimer
;
protected
System
.
Timers
.
Timer
serverCon
nect
Timer
=
new
System
.
Timers
.
Timer
();
protected
System
.
Timers
.
Timer
serverConTimer
=
new
System
.
Timers
.
Timer
();
protected
System
.
Timers
.
Timer
IoCheckTimer
=
new
System
.
Timers
.
Timer
();
protected
System
.
Timers
.
Timer
IoCheckTimer
=
new
System
.
Timers
.
Timer
();
private
bool
isInit
=
false
;
private
bool
isInit
=
false
;
...
@@ -75,33 +75,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -75,33 +75,7 @@ namespace OnlineStore.DeviceLibrary
public
AlarmInfo
alarmInfo
=
new
AlarmInfo
();
public
AlarmInfo
alarmInfo
=
new
AlarmInfo
();
/// <summary>
/// 记录上一次的部分IO状态,主要是急停,气压检测信号,复位信号,用来判断是否io发生改变
/// </summary>
public
Dictionary
<
string
,
IO_VALUE
>
DILastValueMap
=
new
Dictionary
<
string
,
IO_VALUE
>();
public
object
lastDiListLock
=
""
;
public
void
addLastDI
(
string
type
,
IO_VALUE
value
)
{
try
{
lock
(
lastDiListLock
)
{
if
(
DILastValueMap
.
ContainsKey
(
type
))
{
DILastValueMap
.
Remove
(
type
);
}
DILastValueMap
.
Add
(
type
,
value
);
}
}
catch
(
Exception
ex
)
{
LogUtil
.
error
(
ex
.
ToString
());
}
}
/// <summary>
/// <summary>
/// 获取料仓运行的时间
/// 获取料仓运行的时间
/// </summary>
/// </summary>
...
@@ -144,7 +118,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -144,7 +118,7 @@ namespace OnlineStore.DeviceLibrary
ResetProcess
();
ResetProcess
();
isInPro
=
false
;
isInPro
=
false
;
break
;
break
;
case
MoveType
.
Store
Reset
:
case
MoveType
.
Reset
:
ResetProcess
();
ResetProcess
();
isInPro
=
false
;
isInPro
=
false
;
break
;
break
;
...
@@ -236,10 +210,10 @@ namespace OnlineStore.DeviceLibrary
...
@@ -236,10 +210,10 @@ namespace OnlineStore.DeviceLibrary
mainTimer
.
Elapsed
+=
timersTimer_Elapsed
;
mainTimer
.
Elapsed
+=
timersTimer_Elapsed
;
mainTimer
.
AutoReset
=
true
;
mainTimer
.
AutoReset
=
true
;
serverCon
nect
Timer
=
new
System
.
Timers
.
Timer
();
serverConTimer
=
new
System
.
Timers
.
Timer
();
serverCon
nect
Timer
.
Interval
=
1000
;
serverConTimer
.
Interval
=
1000
;
serverCon
nect
Timer
.
AutoReset
=
true
;
serverConTimer
.
AutoReset
=
true
;
serverCon
nect
Timer
.
Enabled
=
false
;
serverConTimer
.
Enabled
=
false
;
IoCheckTimer
=
new
System
.
Timers
.
Timer
();
IoCheckTimer
=
new
System
.
Timers
.
Timer
();
IoCheckTimer
.
Interval
=
200
;
IoCheckTimer
.
Interval
=
200
;
...
...
source/DeviceLibrary/store/StoreStep.cs
查看文件 @
9af14a7
...
@@ -115,7 +115,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -115,7 +115,7 @@ namespace OnlineStore.DeviceLibrary
/// 无操作,等待状态
/// 无操作,等待状态
/// </summary>
/// </summary>
Wait
=
0
,
Wait
=
0
,
#
region
料仓复位
#
region
料仓复位
011
开始
/// <summary>
/// <summary>
/// BOX复位:进出轴回原点
/// BOX复位:进出轴回原点
...
@@ -125,478 +125,473 @@ namespace OnlineStore.DeviceLibrary
...
@@ -125,478 +125,473 @@ namespace OnlineStore.DeviceLibrary
/// <summary>
/// <summary>
/// BOX复位:进出轴回原点
/// BOX复位:进出轴回原点
/// </summary>
/// </summary>
BOX_H02_InoutToP1
,
BOX_H02_InoutToP1
,
/// <summary>
/// <summary>
/// BOX复位:其他轴回原点
/// BOX复位:其他轴回原点
/// </summary>
/// </summary>
BOX_H03_OtherAxisHome
,
BOX_H03_OtherAxisHome
,
/// <summary>
/// <summary>
/// BOX复位:升降轴,旋转轴,压紧轴原点返回
/// BOX复位:升降轴,旋转轴,压紧轴原点返回
/// </summary>
/// </summary>
BOX_H04_OtherAxisBack
,
BOX_H04_OtherAxisBack
,
#
endregion
#
endregion
#
region
料架进入料仓步骤
1000
开始
#
region
料仓内部入库步骤
200
开始
/// <summary>
/// <summary>
///
通知agv准备带料架agv
///
入库:进出轴返回P1
/// </summary>
/// </summary>
BI_00_ReadyShelf
=
1000
,
SI_01_InoutToP1
=
201
,
/// <summary>
/// <summary>
///
料架入库:入料口移门打开
///
入库: 升降轴,旋转轴到P1,压紧轴到P3
/// </summary>
/// </summary>
BI_01_DoorOpen
=
1001
,
SI_02_AxisBack
,
/// <summary>
/// <summary>
///
料架入库:等待agvReady
///
入库:进出轴到P2( 进料口取料点)
/// </summary>
/// </summary>
BI_02_WaitReady
=
100
2
,
SI_03_InoutToP
2
,
/// <summary>
/// <summary>
///
料架入库:线体正转,等待入料口检测到信号
///
入库:升降轴到P7( 进料口取料缓冲点)压紧轴到P2(压紧点)
/// </summary>
/// </summary>
BI_03_LineRun
=
1003
,
SI_04_GetReel
,
/// <summary>
/// <summary>
///
等待取料位检测到信号
///
入库:进出轴返回P1
/// </summary>
/// </summary>
BI_04_WaitTakeSingle
=
1004
,
SI_05_InoutToP1
,
/// <summary>
/// <summary>
///
料架入库:取料位检测到信号,停止线体正转
///
入库:移动到库位点,旋转轴到P2( 库位点),升降轴到P3(库位入库前点)
/// </summary>
/// </summary>
BI_05_LineStop
=
1005
,
SI_06_ToPos
,
/// <summary>
/// <summary>
///
料架入库:入料口移门关闭,等待1000
///
入库:进出轴到P3(库位取放料点)
/// </summary>
/// </summary>
BI_06_DoorClose
=
1006
,
SI_07_InoutToP3
,
/// <summary>
/// <summary>
///
线体再正转1秒
///
入库:升降轴到P4( 库位入料缓冲点)压紧轴到P3( 压紧前点)
/// </summary>
/// </summary>
BI_07_LineRun
=
1007
,
SI_08_PutReel
,
/// <summary>
/// <summary>
///
料架入库:定位装置上升
///
入库:进出轴返回P1
/// </summary>
/// </summary>
BI_08_LocationUp
=
1008
,
SI_09_InoutToP1
,
/// <summary>
/// <summary>
///
料架入库:顶升装置上升
///
入库:旋转轴,升降轴,压紧轴到待机点P1
/// </summary>
/// </summary>
BI_09_TopCylinderUp
=
1009
,
SI_10_GoBack
,
#
endregion
#
region
料架入库步骤,
3000
开始
/// <summary>
/// <summary>
/// 料架入库:开始循环从第一个空位逐个取料盘,扫码入库
/// 入库NG料:移动到出料口,旋转轴到P11,升降轴到P12高点
/// </summary>
BI_10_StartGetTray
=
3010
,
/// <summary>
/// 料架取料:叉子后退到待机点P1
/// </summary>
BI_11_InoutToP1
=
3011
,
/// <summary>
/// 料架取料:升降轴移动到P101低点,旋转轴移动到P101点,压紧轴到压紧前点
/// </summary>
/// </summary>
BI_12_MoveToShelf
=
3012
,
SI_21_ToOutDoor
,
/// <summary>
/// <summary>
///
料架取料:叉子前进到P101点
///
入库NG料:打开出料口门
/// </summary>
/// </summary>
BI_13_InoutToP101
=
3013
,
SI_22_OpenOutDoor
,
/// <summary>
/// <summary>
///
料架取料:升降轴上升到P102
点
///
入库NG料:进出轴到_P11-出料口取放料
点
/// </summary>
/// </summary>
BI_14_UpdownToP102
=
3014
,
SI_23_InoutToP11
,
/// <summary>
/// <summary>
///
料架取料:压紧轴开始缓慢压紧
///
入库NG料:升降轴到_P11-出料口-低点,压紧轴到压紧前点P3
/// </summary>
/// </summary>
BI_15_StartCompress
=
3015
,
SI_24_PurReel
,
/// <summary>
/// <summary>
///
料架取料:检测到料叉压紧确认信号,再次向下压紧指定的值
///
入库NG料:进出轴返回待机点P1
/// </summary>
/// </summary>
BI_16_ComDownMove
=
3016
,
SI_25_InoutToP1
,
/// <summary>
/// <summary>
///
料架取料:记录压紧高度,叉子后退到P1
///
入库NG料:升降轴,旋转轴,压紧轴返回P1,关闭出料口门
/// </summary>
/// </summary>
BI_17_InoutBack
=
3017
,
SI_26_GoBack
,
#
endregion
#
region
料仓内部出库
500
开始
//TODO 后退到待机点,然后去扫码点,放下料盘,扫码,扫码后再拿起料盘
/// <summary>
/// 扫码:升降轴移动到P2,旋转轴移动到P1
/// </summary>
BI_21_ToScanPosition
=
3021
,
/// <summary>
/// <summary>
///
扫码:进出轴到P2
///
料仓出库:进出轴到P1
/// </summary>
/// </summary>
BI_22_InOutToP2
,
SO_01_InoutBack
=
501
,
/// <summary>
/// <summary>
///
扫码:升降轴缓慢下降到P1,压紧轴返回压紧前点
///
料仓出库:压紧轴到压紧前点P3 ,旋转轴到库位点P2,轴2(上下) 至P5(库位出库前点)
/// </summary>
/// </summary>
BI_23_PutTrayDow
n
,
SO_02_ToPositio
n
,
/// <summary>
/// <summary>
///
扫码:进出轴返回待机点
///
料仓出库:进出轴到库位P3
/// </summary>
/// </summary>
BI_24_InOutToP1
,
SO_03_InoutToP3
,
/// <summary>
/// <summary>
///
扫码:记录宽度,开始扫码
///
料仓出库:升降轴到P6,轴4( 压紧) 至P2(压紧点)
/// </summary>
/// </summary>
BI_25_ScanCode
,
SO_04_GetReel
,
/// <summary>
/// <summary>
///
扫码:扫码成功,从服务器获取库位号,设置位置参数
///
料仓出库:进出轴返回P1
/// </summary>
/// </summary>
BI_26_GetPosId
,
SO_05_InoutBack
,
/// <summary>
/// <summary>
///
扫码:获取库位号成功,进出轴到P2
///
料仓出库:旋转轴至P1,升降轴至P2
/// </summary>
/// </summary>
BI_27_InoutToP2
,
SO_06_ToDoor
,
/// <summary>
/// 料仓出库:进出轴到P2
/// /// </summary>
SO_07_InoutToP2
,
/// <summary>
/// <summary>
///
扫码:升降轴到P1,压紧轴压紧
///
料仓出库: 放下物品 升降轴至P1,压紧轴到P3
/// </summary>
/// </summary>
BI_28_GetScanPTray
,
SO_08_PutReel
,
/// <summary>
/// <summary>
///
扫码:进出轴返回
///
料仓出库: 进出轴到P1
/// </summary>
/// </summary>
BI_29_InoutBackP1
,
SO_09_InoutBack
,
/// <summary>
/// <summary>
/// 料
架取料: 获取库位号完成,设置位置参数, 准备入库
/// 料
仓出库:升降轴,旋转轴到待机点P1
/// </summary>
/// </summary>
BI_30_SetInstoreParam
=
3030
,
SO_10_GoBack
,
/// <summary>
/// 单盘出库:移动到出料口,旋转轴到P11,升降轴到P12高点
/// </summary>
SO_21_ToOutDoor
,
/// <summary>
/// <summary>
///
入库。。移动到库位点,旋转轴至P2( 库位点)轴2(上下) 至P3(库位入库前点)
///
单盘出库:打开出料口门
/// </summary>
/// </summary>
BI_51_MoveToBag
=
3051
,
SO_22_OpenOutDoor
,
/// <summary>
/// <summary>
///
入库。。叉子进入库位中,进出轴到库位P3
///
单盘出库:进出轴到_P11-出料口取放料点
/// </summary>
/// </summary>
BI_52_DeviceToBag
=
3052
,
SO_23_InoutToP11
,
/// <summary>
/// <summary>
///
入库。。放下物品,升降轴到库位缓冲点P4,压紧轴到
P3
///
单盘出库:升降轴到_P11-出料口-低点,压紧轴到压紧前点
P3
/// </summary>
/// </summary>
BI_53_PutWareToBag
=
3053
,
SO_24_PurReel
,
/// <summary>
/// <summary>
///
入库。。叉子从库位中返回,进出轴到
P1
///
单盘出库:进出轴返回待机点
P1
/// </summary>
/// </summary>
BI_54_DeviceBackFromBag
=
3054
,
SO_25_InoutToP1
,
/// <summary>
/// <summary>
///
入库。。返回待机点,轴2/轴1/轴4动作至P1( 待机点))开始
///
单盘出库:升降轴,旋转轴,压紧轴返回P1,关闭出料口门
/// </summary>
/// </summary>
BI_55_GoBack
=
3055
,
SO_26_GoBack
,
#
endregion
#
region
流水线模块复位
1001
开始
/// <summary>
/// <summary>
///
送出料盘:扫码或获取库位失败,升降轴移动到NG料门口上端,旋转轴移动到NG料门口
///
复位:所有阻挡上升
/// </summary>
/// </summary>
BI_71_ToNGDoor
=
3071
,
LR_01_StopUp
=
1001
,
/// <summary>
/// <summary>
///
送出料盘:NG料口升降门上升
///
复位:流水线转动3秒
/// </summary>
/// </summary>
BI_72_NGDoorUp
=
3072
,
LR_02_LineRun
,
/// <summary>
/// <summary>
///
送出料盘:进出轴前进到NG料门口位置
///
复位:夹爪放松,提升轴回原点,上下轴回原点
/// </summary>
/// </summary>
BI_73_InoutToNGDoor
=
3073
,
LR_03_BatchAxisHome
,
/// <summary>
/// <summary>
///
送出料盘:升降轴缓慢下降,放下料盘
///
复位:提升轴到P1点,上下轴到待机点P1
/// </summary>
/// </summary>
BI_74_UpdownDown
=
3074
,
LR_04_BatchToP1
,
/// <summary>
/// <summary>
///
送出料盘:叉子后退到P1
///
复位:取料电机后退,旋转轴回原点
/// </summary>
/// </summary>
BI_75_InoutToP1
=
3075
,
LR_05_Hoister_Back
,
/// <summary>
/// <summary>
///
送出料盘:关门NG料门,送出料盘结束
///
复位:顶升气缸下降,旋转轴到待机点P1
/// </summary>
/// </summary>
BI_76_NGDoorDown
=
3076
,
LR_06_TopDown
,
/// <summary>
/// <summary>
///
NG流水线转动指定的时间3000
///
复位:等待料仓复位完成
/// </summary>
/// </summary>
BI_77_NGLineRun
=
3078
,
LR_07_WaitBox
,
#
endregion
#
endregion
#
region
把料架送出步骤
4000
开始
/// <summary>
/// 送出空料架:顶升气缸下降
/// </summary>
BS_01_TopDown
=
4001
,
/// <summary>
/// 送出空料架:定位气缸下降
/// </summary>
BS_02_LocatinDown
=
4002
,
#
region
入料装置入料处理,
2001
开始
//线体入口料串检测到料架
// 链条转动到线体上料等待区检测
//提升伺服先上升到待机点,SL1升降盘定位气缸1后退,定位气缸下降,料架才能进入上料工位
//料架进入上料工位后,定位气缸先上升
//提升伺服下降到P2
////升降盘定位气缸前进
//提升伺服缓慢上升,绝对位置=P1,若上升到P1么有X105,那么没有料盘
// 检测到X105信号,提升伺服停止
// 上料横移机构取料
// 上料横移机构下降
// 上料横移机构夹紧
// 上料横移机构上升
// 提升伺服开始缓慢上升到位
// 计算高度,宽度并记录
// 上料横移机构到放料端
//等待拦截到托盘,并顶升上升,定位上升
// 上料横移机构下降
// 移栽伺服下降到对应盘高位置
//上料气缸放松
// 移栽伺服上升,
// 上料横移机构上升
/// <summary>
/// <summary>
///
通知AGV准备空车
///
提升轴先返回P1
/// </summary>
/// </summary>
BS_03_WaitEmptyAgv
=
4003
,
LI_00_BatchAxisToP1
=
2001
,
/// <summary>
/// <summary>
///
送出空料架:打开仓门
///
入料流程:升降盘定位气缸后退
/// </summary>
/// </summary>
BS_04_DoorOpen
=
4004
,
LI_01_TrayLocation_After
,
/// <summary>
/// <summary>
///
送出空料架:等待agvReady
///
入料流程:定位气缸下降
/// </summary>
/// </summary>
BS_05_WaitReady
=
4005
,
LI_02_LocationCylinder_Down
,
/// <summary>
/// <summary>
///
送出空料架:线体反转
///
入口流水线转动,等待入料检测信号消失
/// </summary>
/// </summary>
BS_06_LineBackRun
=
4006
,
LI_03_LineStart
,
/// <summary>
/// <summary>
///
送出空料架:等待取料工位无信号
///
入口流水线转动,等待定位工位信号稳定1秒
/// </summary>
/// </summary>
BS_07_WaitShelfOut
=
4007
,
LI_04_WaitTime
,
/// <summary>
/// <summary>
///
送出空料架:等待取料工位无信号,入料口有信号
///
入料检测: 工位检测信号,定位气缸上升
/// </summary>
/// </summary>
BS_08_WaitLineIn
=
4008
,
LI_05_LocationCylinder_Up
,
/// <summary>
/// <summary>
///
送出空料架:再转动3000时间
///
入料检测:提升轴下降到位P2
/// </summary>
/// </summary>
BS_09_WaitTime
=
4009
,
LI_06_BatchAxisToP2
,
/// <summary>
/// <summary>
///
送出空料架:等待AGV离开后关闭仓门
///
入料检测:升降盘定位气缸第一次前进
/// </summary>
/// </summary>
BS_10_WaitAGVLeave
=
4010
,
LI_07_TrayLocation_Before
,
/// <summary>
/// <summary>
///
送出空料架:关闭仓门
///
入料检测:升降盘定位气缸第一次后退
/// </summary>
/// </summary>
BS_11_CloseDoor
=
4011
,
LI_08_TrayLocation_Back
,
#
endregion
#
region
料仓内部出库步骤
/// <summary>
/// <summary>
///
料仓出库,,定位气缸下降
///
入料检测:升降盘定位气缸前进
/// </summary>
/// </summary>
SO_01_LocationCylinderDown
=
101
,
LI_09_TrayLocation_Before
,
/// <summary>
/// <summary>
///
料仓出库:叉子先运动到P1
///
入料检测:上料轴开始慢速上升到P3点,等待检测到料盘
/// </summary>
/// </summary>
SO_02_DeviceBack
=
102
,
LI_10_AxisUpMove
,
/// <summary>
/// <summary>
///
料仓出库,,所有轴运行到库位, 轴4( 压紧) 至P3(压紧前点) ,轴1( 转盘) 至P2( 库位点),轴2(上下) 至P5(库位出库前点)
///
入料取料:横移机构先上升
/// </summary>
/// </summary>
SO_03_ToBagPosition
=
103
,
LI_11_CylinderUp
,
/// <summary>
/// 料仓出库,,叉子进入库位中, 轴3( 叉子) 至P3(库位取放料点)
/// </summary>
SO_04_DeviceToBag
=
104
,
/// <summary>
/// <summary>
///
料仓出库,, 库位的物品放入叉子上,轴2( 上下) 至P6( 库位出料缓冲点),轴4( 压紧) 至P2(压紧点)
///
入料取料:上料机构到放料端
/// </summary>
/// </summary>
SO_05_BagWareToDevice
=
105
,
LI_12_CylinderGive
,
/// <summary>
/// <summary>
///
料仓出库,,叉子从 库位返回,轴3( 叉子) 至P1( 待机点)
///
入料检测到料盘:扫码
/// </summary>
/// </summary>
SO_06_BagDeviceBack
=
106
,
LI_13_ScanCode
,
/// <summary>
/// <summary>
/// 料
仓出库,等待检测到料盘信号
/// 料
盘移栽:有料盘:上料横移机构取料
/// </summary>
/// </summary>
SO_07_CheckTray
=
107
,
LI_14_CylinderTake
,
/// <summary>
/// <summary>
///
料仓出库,,所有设备运行到门,,轴1( 转盘) 至P1( 待机点)轴2( 上下) 至P2( 进料口出料前点)
///
料盘移栽:升降轴到P3
/// </summary>
/// </summary>
SO_08_ToDoorPosition
=
108
,
LI_15_UpdownAxisToP3
,
/// <summary>
/// <summary>
///
料仓出库,定位气缸退回(有压紧轴的不需要此步骤),,定位气缸退回(Y104-1/PCI5O1-84) (Y104-2/PCI5O1-91) (Y104-2/PCI5O1-96) 退回到位
///
料盘移栽:上料横移机构夹紧
/// </summary>
/// </summary>
SO_09_LocationCylinder_Down
=
109
,
LI_16_CylinderTighten
,
/// <summary>
/// <summary>
///
等待门口无料盘
///
料盘移栽:升降伺服到P1点
/// </summary>
/// </summary>
SO_091_WaitNoTray
=
120
,
LI_17_UpdownAxisToP1
,
/// <summary>
/// <summary>
/// 料
仓出库,,叉子进出料口,,轴3( 叉子) 至P2( 进料口取料点)
/// 料
盘移栽:等待没有伺服料盘检测信号
///
///
</summary>
/// </summary>
SO_10_DeviceToDoor
=
110
,
LI_18_WaitNoLocationCheck
,
/// <summary>
/// <summary>
/// 料
仓出库,,把物品放下,,轴2( 上下) 至P8( 进料口出料缓冲点)轴4( 压紧) 至P1( 待机点)
/// 料
盘移栽:批量轴到P3点,检测是否有料盘
/// </summary>
/// </summary>
SO_11_DevicePutWare
=
111
,
LI_19_BatchAxisToP3
,
/// <summary>
/// <summary>
///
料仓出库,,叉子从出料口返回,,轴3( 叉子) 动作至P1( 待机点)
///
料盘移栽:记录高度尺寸
/// </summary>
/// </summary>
SO_12_DeviceOutFromDoor
=
112
,
LI_20_SaveSize
,
/// <summary>
/// <summary>
/// 料
仓出库:等待叉子无料盘
/// 料
盘移栽: 上料横移气缸放料SOL
/// </summary>
/// </summary>
SO_13_CheckTray
=
113
,
LI_21_CylinderGive
,
/// <summary>
/// <summary>
///
料仓出库,,升降轴返回,, 轴2至P1( 待机点)
///
提升轴下降到料盘不溢出的位置
/// </summary>
/// </summary>
SO_14_aGoBack
=
114
,
LI_22_BatchAxisDown
,
/// <summary>
/// <summary>
///
等待拿走物品
///
料盘移栽:从服务器获取入库库位号
/// </summary>
/// </summary>
SO_15_WaitTake
=
115
,
LI_23_GetPosID
,
#
endregion
#
region
料仓内部入库步骤
200
开始
/// <summary>
/// 入库:进出轴返回P1
/// </summary>
SI_01_InoutToP1
=
201
,
/// <summary>
/// <summary>
///
入库: 升降轴,旋转轴到P1,压紧轴到P3
///
料盘移栽:等待空托盘到达,移栽伺服下降到P2,并预扫码
/// </summary>
/// </summary>
SI_02_AxisBack
,
LI_24_WaitTray
,
/// <summary>
/// <summary>
/// 入库:进出轴到P2( 进料口取料点)
/// 料盘移栽: 上料机构下降
/// </summary>
SI_03_InoutToP2
,
/// <summary>
/// 入库:升降轴到P7( 进料口取料缓冲点)压紧轴到P2(压紧点)
/// </summary>
/// </summary>
SI_04_GetReel
,
LI_25_CylinderDown
,
/// <summary>
/// <summary>
///
入库:进出轴返回P1
///
料盘移栽: 上料气缸放松
/// </summary>
/// </summary>
SI_05_InoutToP1
,
LI_26_CylinderRelax
,
/// <summary>
/// <summary>
///
入库:移动到库位点,旋转轴到P2( 库位点),升降轴到P3(库位入库前点)
///
料盘移栽: 上料横移机构上升
/// </summary>
/// </summary>
SI_06_ToPos
,
LI_27_WaitCylinderUp
,
/// <summary>
/// <summary>
///
入库:进出轴到P3(库位取放料点)
///
料盘移栽:上料横移机构上升,定位或者顶升可以先下降
/// </summary>
/// </summary>
SI_07_InoutToP3
,
LI_28_CylinderUp
,
/// <summary>
/// <summary>
///
入库:升降轴到P4( 库位入料缓冲点)压紧轴到P3( 压紧前点)
///
料盘移栽:升降伺服到P1点
/// </summary>
/// </summary>
SI_08_PutReel
,
LI_29_UpDownAxisToP1
,
/// <summary>
/// <summary>
///
入库:进出轴返回P1
///
上料完成,未检测到料盘,提升伺服到P2点
/// </summary>
/// </summary>
SI_09_InoutToP
1
,
LI_31_BatchAxisToP2
=
1103
1
,
/// <summary>
/// <summary>
///
入库:旋转轴,升降轴,压紧轴到待机点P1
///
上料完成,升降盘定位气缸后退
/// </summary>
/// </summary>
SI_10_GoBack
,
LI_32_TrayLocationCylinder_After
=
11032
,
/// <summary>
/// <summary>
///
入库NG料:移动到出料口,旋转轴到P11,升降轴到P12高
点
///
上料完成,提升伺服到P1
点
/// </summary>
/// </summary>
SI_21_ToOutDoor
,
LI_33_BatchAxisToP1
=
11033
,
/// <summary>
/// <summary>
///
入库NG料:打开出料口门
///
上料完成,等待出料线体无料架
/// </summary>
/// </summary>
SI_22_OpenOutDoor
,
LI_34_OutCheck
=
11034
,
/// <summary>
/// <summary>
///
入库NG料:进出轴到_P11-出料口取放料点
///
上料完成,出口顶升气缸上升
/// </summary>
/// </summary>
SI_23_InoutToP11
,
LI_35_OutTopCylinder_Up
=
11035
,
/// <summary>
/// <summary>
///
入库NG料:升降轴到_P11-出料口-低点,压紧轴到压紧前点P3
///
上料完成, 线体横移电机运转,等待料架到达出口
/// </summary>
/// </summary>
SI_24_PurReel
,
LI_36_SideWayLineRun
=
11036
,
/// <summary>
/// <summary>
///
入库NG料:进出轴返回待机点P1
///
上料完成,等待料架到达出口
/// </summary>
/// </summary>
SI_25_InoutToP1
,
LI_37_WaitShelfGo
=
11307
,
/// <summary>
/// <summary>
///
入库NG料:升降轴,旋转轴,压紧轴返回P1,关闭出料口门
///
上料完成, 料架到达出口,线体横移电机停止
/// </summary>
/// </summary>
SI_26_GoBack
,
LI_38_LineStop
,
#
endregion
#
region
料仓内部出库
500
开始
/// <summary>
/// <summary>
///
料仓出库:进出轴到P1
///
上料完成, 料架到达出口,出口顶升下降,定位气缸下降,
/// </summary>
/// </summary>
SO_01_InoutBack
=
501
,
LI_39_TopDown
,
/// <summary>
/// <summary>
///
料仓出库:压紧轴到压紧前点P3 ,旋转轴到库位点P2,轴2(上下) 至P5(库位出库前点)
///
上料完成, 出口线体运转,料架到达出口处, 通知AGV取空料架
/// </summary>
/// </summary>
SO_02_ToPositio
n
,
LI_39_OutLineRu
n
,
/// <summary>
/// <summary>
///
料仓出库:进出轴到库位P3
///
上料完成, AGV到达,继续转动出口线体,送走出料料架,
/// </summary>
/// </summary>
SO_03_InoutToP3
,
LI_40_OutLineRun
,
/// <summary>
/// <summary>
///
料仓出库:升降轴到P6,轴4( 压紧) 至P2(压紧点)
///
上料完成, 料架送出,
/// </summary>
/// </summary>
SO_04_GetReel
,
LI_41_OutLineRun
,
#
endregion
/// <summary>
///料仓出库:进出轴返回P1
/// </summary>
SO_05_InoutBack
,
#
region
把料架送出步骤
4000
开始
/// <summary>
/// <summary>
///
料仓出库:旋转轴至P1,升降轴至P2
///
送出空料架:顶升气缸下降
/// </summary>
/// </summary>
SO_06_ToDoor
,
BS_01_TopDown
=
4001
,
/// <summary>
/// <summary>
/// 料仓出库:进出轴到P2
/// 送出空料架:定位气缸下降
/// /// </summary>
/// </summary>
SO_07_InoutToP2
,
BS_02_LocatinDown
=
4002
,
/// <summary>
/// <summary>
///
料仓出库: 放下物品 升降轴至P1,压紧轴到P3
///
通知AGV准备空车
/// </summary>
/// </summary>
SO_08_PutReel
,
BS_03_WaitEmptyAgv
=
4003
,
/// <summary>
/// <summary>
///
料仓出库: 进出轴到P1
///
送出空料架:打开仓门
/// </summary>
/// </summary>
SO_09_InoutBack
,
BS_04_DoorOpen
=
4004
,
/// <summary>
/// <summary>
///
料仓出库:升降轴,旋转轴到待机点P1
///
送出空料架:等待agvReady
/// </summary>
/// </summary>
SO_10_GoBack
,
BS_05_WaitReady
=
4005
,
/// <summary>
/// <summary>
///
单盘出库:移动到出料口,旋转轴到P11,升降轴到P12高点
///
送出空料架:线体反转
/// </summary>
/// </summary>
SO_21_ToOutDoor
,
BS_06_LineBackRun
=
4006
,
/// <summary>
/// <summary>
///
单盘出库:打开出料口门
///
送出空料架:等待取料工位无信号
/// </summary>
/// </summary>
SO_22_OpenOutDoor
,
BS_07_WaitShelfOut
=
4007
,
/// <summary>
/// <summary>
///
单盘出库:进出轴到_P11-出料口取放料点
///
送出空料架:等待取料工位无信号,入料口有信号
/// </summary>
/// </summary>
SO_23_InoutToP11
,
BS_08_WaitLineIn
=
4008
,
/// <summary>
/// <summary>
///
单盘出库:升降轴到_P11-出料口-低点,压紧轴到压紧前点P3
///
送出空料架:再转动3000时间
/// </summary>
/// </summary>
SO_24_PurReel
,
BS_09_WaitTime
=
4009
,
/// <summary>
/// <summary>
///
单盘出库:进出轴返回待机点P1
///
送出空料架:等待AGV离开后关闭仓门
/// </summary>
/// </summary>
SO_25_InoutToP1
,
BS_10_WaitAGVLeave
=
4010
,
/// <summary>
/// <summary>
///
单盘出库:升降轴,旋转轴,压紧轴返回P1,关闭出料口
门
///
送出空料架:关闭仓
门
/// </summary>
/// </summary>
SO_26_GoBack
,
BS_11_CloseDoor
=
4011
,
#
endregion
#
endregion
}
}
public
enum
AlarmType
public
enum
AlarmType
...
...
source/DeviceLibrary/store/model/StoreMoveInfo.cs
查看文件 @
9af14a7
...
@@ -113,6 +113,20 @@ namespace OnlineStore.DeviceLibrary
...
@@ -113,6 +113,20 @@ namespace OnlineStore.DeviceLibrary
{
{
return
moveStep
.
Equals
(
step
);
return
moveStep
.
Equals
(
step
);
}
}
public
bool
IsTimeOut
(
int
timeOutSeconds
=
60
)
{
TimeSpan
span
=
DateTime
.
Now
-
LastSetpTime
;
if
(
span
.
TotalSeconds
>
timeOutSeconds
)
{
return
true
;
}
return
false
;
}
public
TimeSpan
StepSpan
()
{
TimeSpan
span
=
DateTime
.
Now
-
LastSetpTime
;
return
span
;
}
}
}
public
class
WaitResultInfo
public
class
WaitResultInfo
...
@@ -377,14 +391,6 @@ namespace OnlineStore.DeviceLibrary
...
@@ -377,14 +391,6 @@ namespace OnlineStore.DeviceLibrary
/// <summary>
/// <summary>
/// 重置
/// 重置
/// </summary>
/// </summary>
StoreReset
=
4
,
Reset
=
4
,
///// <summary>
///// 移栽装置的停止,需要先远点返回,然后停止
///// </summary>
//StopMove=5,
///// <summary>
///// 移栽检测托盘
///// </summary>
//CheckFixture=6,
}
}
}
}
source/LoadCVSLibrary/storeConfig/config/StoreType.cs
查看文件 @
9af14a7
...
@@ -40,7 +40,7 @@ namespace OnlineStore.LoadCSVLibrary
...
@@ -40,7 +40,7 @@ namespace OnlineStore.LoadCSVLibrary
/// </summary>
/// </summary>
public
static
string
RC_AC_SA
=
"RC_AC_SA"
;
public
static
string
RC_AC_SA
=
"RC_AC_SA"
;
/// <summary>
/// <summary>
/// 松下伺服控制的
包装料
料仓
/// 松下伺服控制的
DUO
料仓
/// </summary>
/// </summary>
public
static
string
RC_AC_PA
=
"RC_AC_PA"
;
public
static
string
RC_AC_PA
=
"RC_AC_PA"
;
}
}
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论