Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
李娜
/
SO908-XLRStore
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit 322170bb
由
张东亮
编写于
2021-11-12 10:33:42 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
存储机构-添加进出轴扭矩打印
1 个父辈
1fa71d78
隐藏空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
97 行增加
和
54 行删除
source/DeviceLibrary/deviceLibrary/AXIS/HC/HCAxisManager.cs
source/DeviceLibrary/manager/model/DeviceStep.cs
source/DeviceLibrary/storeBean/EquipBase.cs
source/DeviceLibrary/storeBean/boxBean/BoxEquip_InExecute.cs
source/DeviceLibrary/deviceLibrary/AXIS/HC/HCAxisManager.cs
查看文件 @
322170b
...
@@ -158,6 +158,14 @@ namespace OnlineStore.DeviceLibrary
...
@@ -158,6 +158,14 @@ namespace OnlineStore.DeviceLibrary
}
}
return
false
;
return
false
;
}
}
/// <summary>
/// 获取轴扭矩
/// </summary>
/// <param name="slvAddr"></param>
/// <returns></returns>
public
short
GetAxActTorq
(
short
slvAddr
)
{
return
HCBoardManager
.
GetAxActTorq
(
slvAddr
);
}
}
}
}
}
source/DeviceLibrary/manager/model/DeviceStep.cs
查看文件 @
322170b
...
@@ -454,7 +454,10 @@ namespace OnlineStore.DeviceLibrary
...
@@ -454,7 +454,10 @@ namespace OnlineStore.DeviceLibrary
/// 料仓入库:料斗拉取进出轴到P1(待机点),检查另一边入库情况
/// 料仓入库:料斗拉取进出轴到P1(待机点),检查另一边入库情况
/// </summary>
/// </summary>
SI_19_InoutBack
,
SI_19_InoutBack
,
/// <summary>
/// 料仓入库:如果上料机构入料口有料,则去待机点
/// </summary>
SI_20_ToStandby
,
#
endregion
#
endregion
#
region
存储机构自动对位功能
400
开始
#
region
存储机构自动对位功能
400
开始
...
...
source/DeviceLibrary/storeBean/EquipBase.cs
查看文件 @
322170b
using
OnlineStore.Common
;
using
OnlineStore.Common
;
using
OnlineStore.LoadCSVLibrary
;
using
OnlineStore.LoadCSVLibrary
;
using
System
;
using
System
;
...
@@ -14,8 +14,8 @@ using System.Timers;
...
@@ -14,8 +14,8 @@ using System.Timers;
namespace
OnlineStore.DeviceLibrary
namespace
OnlineStore.DeviceLibrary
{
{
public
abstract
class
EquipBase
:
DeviceBase
public
abstract
class
EquipBase
:
DeviceBase
{
{
public
bool
IsDebug
=
false
;
public
bool
IsDebug
=
false
;
public
bool
MoveStop
=
false
;
public
bool
MoveStop
=
false
;
protected
int
TimerMaxSeconds
=
3
;
protected
int
TimerMaxSeconds
=
3
;
...
@@ -26,10 +26,10 @@ namespace OnlineStore.DeviceLibrary
...
@@ -26,10 +26,10 @@ namespace OnlineStore.DeviceLibrary
mainTimer
.
Enabled
=
open
;
mainTimer
.
Enabled
=
open
;
ledProcessTimer
.
Enabled
=
open
;
ledProcessTimer
.
Enabled
=
open
;
}
}
protected
abstract
void
BaseTimerProcess
();
protected
abstract
void
BaseTimerProcess
();
protected
override
void
mainTimer_Elapsed
(
object
sender
,
System
.
Timers
.
ElapsedEventArgs
e
)
protected
override
void
mainTimer_Elapsed
(
object
sender
,
System
.
Timers
.
ElapsedEventArgs
e
)
{
{
TimerProcess
();
TimerProcess
();
...
@@ -60,7 +60,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -60,7 +60,7 @@ namespace OnlineStore.DeviceLibrary
}
}
this
.
alarmType
=
alarmType
;
this
.
alarmType
=
alarmType
;
if
(
alarmType
.
Equals
(
AlarmType
.
SuddenStop
)
||
alarmType
.
Equals
(
AlarmType
.
NoAirpressure_Check
)
||
if
(
alarmType
.
Equals
(
AlarmType
.
SuddenStop
)
||
alarmType
.
Equals
(
AlarmType
.
NoAirpressure_Check
)
||
alarmType
.
Equals
(
AlarmType
.
AxisAlarm
)
||
alarmType
.
Equals
(
AlarmType
.
AxisMoveError
))
alarmType
.
Equals
(
AlarmType
.
AxisAlarm
)
||
alarmType
.
Equals
(
AlarmType
.
AxisMoveError
))
{
{
StopMove
();
StopMove
();
}
}
...
@@ -85,8 +85,8 @@ namespace OnlineStore.DeviceLibrary
...
@@ -85,8 +85,8 @@ namespace OnlineStore.DeviceLibrary
ResetProcess
();
ResetProcess
();
}
}
if
(
MoveInfo
.
MoveType
.
Equals
(
MoveType
.
InStore
))
if
(
MoveInfo
.
MoveType
.
Equals
(
MoveType
.
InStore
))
{
{
InstoreProcess
();
InstoreProcess
();
}
}
else
if
(
MoveInfo
.
MoveType
.
Equals
(
MoveType
.
OutStore
))
else
if
(
MoveInfo
.
MoveType
.
Equals
(
MoveType
.
OutStore
))
{
{
...
@@ -142,9 +142,9 @@ namespace OnlineStore.DeviceLibrary
...
@@ -142,9 +142,9 @@ namespace OnlineStore.DeviceLibrary
//取新的Io状态
//取新的Io状态
IO_VALUE
fuweiValue
=
IOValue
(
IO_Type
.
Reset_BTN
);
IO_VALUE
fuweiValue
=
IOValue
(
IO_Type
.
Reset_BTN
);
if
(
DILastValueMap
.
ContainsKey
(
IO_Type
.
Reset_BTN
))
if
(
DILastValueMap
.
ContainsKey
(
IO_Type
.
Reset_BTN
))
{
{
IO_VALUE
lastFuwei
=
DILastValueMap
[
IO_Type
.
Reset_BTN
];
IO_VALUE
lastFuwei
=
DILastValueMap
[
IO_Type
.
Reset_BTN
];
bool
isAutoStart
=
ConfigAppSettings
.
GetIntValue
(
Setting_Init
.
App_AutoRun
)
==
1
;
bool
isAutoStart
=
ConfigAppSettings
.
GetIntValue
(
Setting_Init
.
App_AutoRun
)
==
1
;
//收到复位信号后启动
//收到复位信号后启动
if
(
isAutoStart
&&
fuweiValue
.
Equals
(
IO_VALUE
.
HIGH
)
&&
lastFuwei
.
Equals
(
IO_VALUE
.
LOW
))
if
(
isAutoStart
&&
fuweiValue
.
Equals
(
IO_VALUE
.
HIGH
)
&&
lastFuwei
.
Equals
(
IO_VALUE
.
LOW
))
{
{
...
@@ -193,47 +193,47 @@ namespace OnlineStore.DeviceLibrary
...
@@ -193,47 +193,47 @@ namespace OnlineStore.DeviceLibrary
LogUtil
.
error
(
"IOTimeOutProcess出错:"
,
ex
);
LogUtil
.
error
(
"IOTimeOutProcess出错:"
,
ex
);
}
}
}
}
public
bool
CanStartRun
()
public
bool
CanStartRun
()
{
{
string
canResult
=
StoreManager
.
XLRStore
.
CanStart
();
string
canResult
=
StoreManager
.
XLRStore
.
CanStart
();
if
(
String
.
IsNullOrEmpty
(
canResult
).
Equals
(
false
))
if
(
String
.
IsNullOrEmpty
(
canResult
).
Equals
(
false
))
{
{
SetWarnMsg
(
Name
+
canResult
);
SetWarnMsg
(
Name
+
canResult
);
return
false
;
return
false
;
}
}
if
(
IOValue
(
IO_Type
.
SuddenStop_BTN
).
Equals
(
IO_VALUE
.
LOW
))
if
(
IOValue
(
IO_Type
.
SuddenStop_BTN
).
Equals
(
IO_VALUE
.
LOW
))
{
{
SetWarnMsg
(
Name
+
"启动失败:急停未开"
);
SetWarnMsg
(
Name
+
"启动失败:急停未开"
);
return
false
;
return
false
;
}
}
else
if
(
this
.
baseConfig
.
DType
.
Equals
(
DeviceType
.
InputEquip
)&&
IOValue
(
IO_Type
.
Airpressure_Check
).
Equals
(
IO_VALUE
.
LOW
))
else
if
(
this
.
baseConfig
.
DType
.
Equals
(
DeviceType
.
InputEquip
)
&&
IOValue
(
IO_Type
.
Airpressure_Check
).
Equals
(
IO_VALUE
.
LOW
))
{
{
SetWarnMsg
(
Name
+
"启动失败:没有气压信号"
);
SetWarnMsg
(
Name
+
"启动失败:没有气压信号"
);
return
false
;
return
false
;
}
}
return
true
;
return
true
;
}
}
public
void
ChangeDebug
(
bool
isDebug
)
public
void
ChangeDebug
(
bool
isDebug
)
{
{
}
}
#
region
伺服运动
#
region
伺服运动
public
bool
RunAxis
(
bool
isCheck
,
AxisBean
axis
)
public
bool
RunAxis
(
bool
isCheck
,
AxisBean
axis
)
{
{
string
msg
=
""
;
string
msg
=
""
;
bool
result
=
axis
.
Open
(
isCheck
,
out
msg
);
bool
result
=
axis
.
Open
(
isCheck
,
out
msg
);
if
(
result
&&
String
.
IsNullOrEmpty
(
msg
))
if
(
result
&&
String
.
IsNullOrEmpty
(
msg
))
{
{
return
true
;
return
true
;
}
}
return
false
;
return
false
;
}
}
public
void
CloseAxis
(
AxisBean
axis
)
public
void
CloseAxis
(
AxisBean
axis
)
{
{
axis
.
ServoOff
();
axis
.
ServoOff
();
}
}
...
@@ -248,9 +248,9 @@ namespace OnlineStore.DeviceLibrary
...
@@ -248,9 +248,9 @@ namespace OnlineStore.DeviceLibrary
if
(
alarmIo
.
Equals
(
1
))
if
(
alarmIo
.
Equals
(
1
))
{
{
WarnMsg
=
Name
+
" "
+
axisInfo
.
AxisName
+
"报警"
;
WarnMsg
=
Name
+
" "
+
axisInfo
.
AxisName
+
"报警"
;
LogUtil
.
error
(
WarnMsg
);
LogUtil
.
error
(
WarnMsg
);
if
(
NeedAlarm
)
if
(
NeedAlarm
)
{
{
Alarm
(
AlarmType
.
AxisAlarm
);
Alarm
(
AlarmType
.
AxisAlarm
);
...
@@ -262,11 +262,12 @@ namespace OnlineStore.DeviceLibrary
...
@@ -262,11 +262,12 @@ namespace OnlineStore.DeviceLibrary
return
false
;
return
false
;
}
}
#
endregion
#
endregion
#
region
CheckWait
处理
#
region
CheckWait
处理
protected
DateTime
preRWTime
=
DateTime
.
Now
;
protected
DateTime
preRWTime
=
DateTime
.
Now
;
short
curTor
,
preTor
;
internal
void
CheckWait
(
DeviceMoveInfo
moveInfo
)
internal
void
CheckWait
(
DeviceMoveInfo
moveInfo
)
{
{
try
try
...
@@ -312,6 +313,21 @@ namespace OnlineStore.DeviceLibrary
...
@@ -312,6 +313,21 @@ namespace OnlineStore.DeviceLibrary
// LogInfo($"移栽升降轴 目标位置:{wait.TargetPosition},当前位置:{outCount}");
// LogInfo($"移栽升降轴 目标位置:{wait.TargetPosition},当前位置:{outCount}");
//}
//}
wait
.
IsEnd
=
AxisBean
.
ACAxisMoveIsEnd
(
moveInfo
,
wait
.
AxisInfo
,
wait
.
TargetPosition
,
wait
.
TargetSpeed
,
out
msg
);
wait
.
IsEnd
=
AxisBean
.
ACAxisMoveIsEnd
(
moveInfo
,
wait
.
AxisInfo
,
wait
.
TargetPosition
,
wait
.
TargetSpeed
,
out
msg
);
try
{
if
(
wait
.
AxisInfo
.
DeviceName
.
Equals
(
"料斗拉取进出轴"
))
{
short
axisNo
=
wait
.
AxisInfo
.
GetAxisValue
();
preTor
=
curTor
;
curTor
=
((
HCAxisManager
)
AxisManager
.
instance
).
GetAxActTorq
(
axisNo
);
if
(!
preTor
.
Equals
(
curTor
))
LogInfo
(
$
"料斗拉取进出轴 扭矩:{curTor}"
);
}
}
catch
(
Exception
e
)
{
LogUtil
.
error
(
"获取料斗拉取进出轴轴距失败"
,
e
);
}
}
}
if
(!
msg
.
Equals
(
""
))
if
(!
msg
.
Equals
(
""
))
{
{
...
@@ -381,7 +397,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -381,7 +397,7 @@ namespace OnlineStore.DeviceLibrary
{
{
wait
.
IsEnd
=
CheckWaitResult
(
moveInfo
,
wait
);
wait
.
IsEnd
=
CheckWaitResult
(
moveInfo
,
wait
);
}
}
if
(
wait
.
IsEnd
)
if
(
wait
.
IsEnd
)
{
{
if
(
moveInfo
.
OneWaitCanEndStep
)
if
(
moveInfo
.
OneWaitCanEndStep
)
...
@@ -403,17 +419,17 @@ namespace OnlineStore.DeviceLibrary
...
@@ -403,17 +419,17 @@ namespace OnlineStore.DeviceLibrary
{
{
if
(
moveInfo
.
WaitList
.
Count
>
cutWLcount
&&
!
moveInfo
.
OneWaitCanEndStep
)
if
(
moveInfo
.
WaitList
.
Count
>
cutWLcount
&&
!
moveInfo
.
OneWaitCanEndStep
)
{
{
LogUtil
.
info
(
moveInfo
.
Name
+
" moveInfo.WaitList.Count:"
+
moveInfo
.
WaitList
.
Count
.
ToString
()+
",cutWLcount:"
+
cutWLcount
.
ToString
());
;
LogUtil
.
info
(
moveInfo
.
Name
+
" moveInfo.WaitList.Count:"
+
moveInfo
.
WaitList
.
Count
.
ToString
()
+
",cutWLcount:"
+
cutWLcount
.
ToString
());
;
}
}
moveInfo
.
EndStepWait
();
moveInfo
.
EndStepWait
();
}
}
else
if
(
span
.
TotalSeconds
>
moveInfo
.
TimeOutSeconds
)
else
if
(
span
.
TotalSeconds
>
moveInfo
.
TimeOutSeconds
)
{
{
WarnMsg
=
moveInfo
.
Name
+
"["
+
moveInfo
.
MoveType
+
"]["
+
moveInfo
.
MoveStep
+
"]等待"
+
NotOkMsg
WarnMsg
=
moveInfo
.
Name
+
"["
+
moveInfo
.
MoveType
+
"]["
+
moveInfo
.
MoveStep
+
"]等待"
+
NotOkMsg
+
"超时["
+
Math
.
Round
(
span
.
TotalSeconds
,
1
)
+
"]秒"
;
+
"超时["
+
Math
.
Round
(
span
.
TotalSeconds
,
1
)
+
"]秒"
;
//int second = 10;
//int second = 10;
//second = (int)(span.TotalSeconds/moveInfo.TimeOutSeconds ) * 10;
//second = (int)(span.TotalSeconds/moveInfo.TimeOutSeconds ) * 10;
//if (second > 120)
//if (second > 120)
//{
//{
...
@@ -424,7 +440,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -424,7 +440,7 @@ namespace OnlineStore.DeviceLibrary
// second = 10;
// second = 10;
//}
//}
LogUtil
.
error
(
WarnMsg
,
moveInfo
.
ErrorLogType
,
moveInfo
.
logSeconds
());
LogUtil
.
error
(
WarnMsg
,
moveInfo
.
ErrorLogType
,
moveInfo
.
logSeconds
());
Alarm
(
AlarmType
.
IoSingleTimeOut
);
Alarm
(
AlarmType
.
IoSingleTimeOut
);
}
}
}
}
catch
(
Exception
ex
)
catch
(
Exception
ex
)
...
@@ -442,7 +458,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -442,7 +458,7 @@ namespace OnlineStore.DeviceLibrary
#
region
日志打印
#
region
日志打印
internal
int
WorkLogLevel
=
1
;
internal
int
WorkLogLevel
=
1
;
protected
void
InoutLog
(
string
msg
,
int
level
=
1
)
protected
void
InoutLog
(
string
msg
,
int
level
=
1
)
{
{
if
(
level
<
0
)
if
(
level
<
0
)
{
{
...
@@ -453,42 +469,42 @@ namespace OnlineStore.DeviceLibrary
...
@@ -453,42 +469,42 @@ namespace OnlineStore.DeviceLibrary
level
=
WorkLogLevel
;
level
=
WorkLogLevel
;
}
}
string
code
=
""
;
string
code
=
""
;
if
(
MoveInfo
.
MoveParam
!=
null
&&
MoveInfo
.
MoveParam
.
PosInfo
!=
null
&&
MoveInfo
.
MoveParam
.
PosInfo
.
barcode
!=
null
)
if
(
MoveInfo
.
MoveParam
!=
null
&&
MoveInfo
.
MoveParam
.
PosInfo
!=
null
&&
MoveInfo
.
MoveParam
.
PosInfo
.
barcode
!=
null
)
{
{
if
(!
MoveInfo
.
MoveParam
.
PosInfo
.
barcode
.
Equals
(
""
))
if
(!
MoveInfo
.
MoveParam
.
PosInfo
.
barcode
.
Equals
(
""
))
{
{
code
=
MoveInfo
.
MoveParam
.
PosInfo
.
barcode
;
code
=
MoveInfo
.
MoveParam
.
PosInfo
.
barcode
;
}
}
}
}
if
(
level
.
Equals
(
1
))
if
(
level
.
Equals
(
1
))
{
{
LogUtil
.
info
(
MoveInfo
.
Name
+
"["
+
code
+
"]"
+
"["
+
MoveInfo
.
MoveStep
+
"] "
+
msg
);
LogUtil
.
info
(
MoveInfo
.
Name
+
"["
+
code
+
"]"
+
"["
+
MoveInfo
.
MoveStep
+
"] "
+
msg
);
}
}
else
else
{
{
LogUtil
.
debug
(
MoveInfo
.
Name
+
"["
+
code
+
"]"
+
"["
+
MoveInfo
.
MoveStep
+
"] "
+
msg
);
LogUtil
.
debug
(
MoveInfo
.
Name
+
"["
+
code
+
"]"
+
"["
+
MoveInfo
.
MoveStep
+
"] "
+
msg
);
}
}
}
}
public
virtual
string
GetMoveStr
()
public
virtual
string
GetMoveStr
()
{
{
string
msg
=
""
;
string
msg
=
""
;
int
tLength
=
15
;
int
tLength
=
15
;
msg
+=
"runS: "
+
runStatus
+
"\n"
;
msg
+=
"runS: "
+
runStatus
+
"\n"
;
msg
+=
"alarm: "
+
alarmType
+
" "
+
LastAlarmTime
.
ToLongTimeString
()
+
"\n"
;
msg
+=
"alarm: "
+
alarmType
+
" "
+
LastAlarmTime
.
ToLongTimeString
()
+
"\n"
;
msg
+=
"MoveT:"
+
MoveInfo
.
MoveType
+
"\n"
;
msg
+=
"MoveT:"
+
MoveInfo
.
MoveType
+
"\n"
;
msg
+=
"MoveS :"
+
MoveInfo
.
MoveStep
+
"\n"
;
msg
+=
"MoveS :"
+
MoveInfo
.
MoveStep
+
"\n"
;
return
msg
;
return
msg
;
}
}
#
endregion
#
endregion
#
region
灯光处理
#
region
灯光处理
protected
void
CloseLed
()
protected
void
CloseLed
()
{
{
...
@@ -531,7 +547,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -531,7 +547,7 @@ namespace OnlineStore.DeviceLibrary
{
{
yellowMove
=
true
;
yellowMove
=
true
;
}
}
...
...
source/DeviceLibrary/storeBean/boxBean/BoxEquip_InExecute.cs
查看文件 @
322170b
...
@@ -371,10 +371,20 @@ namespace OnlineStore.DeviceLibrary
...
@@ -371,10 +371,20 @@ namespace OnlineStore.DeviceLibrary
case
StepEnum
.
SI_19_InoutBack
:
case
StepEnum
.
SI_19_InoutBack
:
if
(!
CheckInStoreOtherSideInfo
())
if
(!
CheckInStoreOtherSideInfo
())
{
{
SetBoxStatus
(
DeviceStatus
.
StoreOnline
,
RunStatus
.
Runing
);
if
(
InDoorSigCheck
())
LogInfo
(
$
"入库 {MoveInfo.SLog}:入库结束[{MoveInfo.MoveParam.PosInfo.PosId}][耗时:{(DateTime.Now - startTime).TotalSeconds.ToString("
f2
")}秒][{MoveInfo.MoveParam.PosInfo.GetPosSide()}面]"
);
{
MoveInfo
.
EndMove
();
MoveInfo
.
NextMoveStep
(
StepEnum
.
SI_20_ToStandby
);
AutoInout
.
InOutEndProcess
(
this
,
MoveType
.
InStore
);
LogInfo
(
$
"入库 {MoveInfo.SLog}:入料口有料,行走机构去待机点[{MoveInfo.MoveParam.PosInfo.GetPosSide()}面]"
);
MoveAxisToP1
();
}
else
{
SetBoxStatus
(
DeviceStatus
.
StoreOnline
,
RunStatus
.
Runing
);
LogInfo
(
$
"入库 {MoveInfo.SLog}:入库结束[{MoveInfo.MoveParam.PosInfo.PosId}][耗时:{(DateTime.Now - startTime).TotalSeconds.ToString("
f2
")}秒][{MoveInfo.MoveParam.PosInfo.GetPosSide()}面]"
);
MoveInfo
.
EndMove
();
AutoInout
.
InOutEndProcess
(
this
,
MoveType
.
InStore
);
}
}
}
else
else
{
{
...
@@ -387,6 +397,12 @@ namespace OnlineStore.DeviceLibrary
...
@@ -387,6 +397,12 @@ namespace OnlineStore.DeviceLibrary
}
}
break
;
break
;
case
StepEnum
.
SI_20_ToStandby
:
SetBoxStatus
(
DeviceStatus
.
StoreOnline
,
RunStatus
.
Runing
);
LogInfo
(
$
"入库 {MoveInfo.SLog}:入库结束[{MoveInfo.MoveParam.PosInfo.PosId}][耗时:{(DateTime.Now - startTime).TotalSeconds.ToString("
f2
")}秒][{MoveInfo.MoveParam.PosInfo.GetPosSide()}面]"
);
MoveInfo
.
EndMove
();
AutoInout
.
InOutEndProcess
(
this
,
MoveType
.
InStore
);
break
;
}
}
}
}
#
endregion
#
endregion
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论