Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
刘韬
/
SO1007_XLC_Store
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit 821c9a8e
由
刘韬
编写于
2021-12-28 12:43:59 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
优化报警提示添加信号编号
1 个父辈
8c7b3fe3
隐藏空白字符变更
内嵌
并排
正在显示
14 个修改的文件
包含
176 行增加
和
55 行删除
DeviceLibrary/DeviceLibrary/Camera.cs
DeviceLibrary/DeviceLibrary/LiftMonitor.cs
DeviceLibrary/DeviceLibrary/OKLEController.cs
DeviceLibrary/DeviceLibrary/ServerCommunication.cs
DeviceLibrary/theMachine/AxisBean.cs
DeviceLibrary/theMachine/BoxTransport.cs
DeviceLibrary/theMachine/LabelParam.cs
DeviceLibrary/theMachine/MainMachine _IN.cs
DeviceLibrary/theMachine/MainMachine _Out.cs
DeviceLibrary/theMachine/MainMachine.cs
DeviceLibrary/theMachine/MoveInfo.cs
DeviceLibrary/theMachine/RobotManage.cs
TheMachine/Form1.cs
称重控制器操作手册[V9.0ARM]-B5(1).pdf
DeviceLibrary/DeviceLibrary/Camera.cs
查看文件 @
821c9a8
...
...
@@ -76,9 +76,14 @@ public class HIKCamera
return
true
;
}
int
errortimes
=
0
;
bool
camerathreadrun
=
true
;
public
void
stopCamera
()
{
camerathreadrun
=
false
;
}
void
startCamera
()
{
while
(
true
)
camerathreadrun
=
true
;
while
(
camerathreadrun
)
{
try
{
...
...
@@ -92,6 +97,7 @@ public class HIKCamera
{
errortimes
++;
LogUtil
.
error
(
Name
+
$
"相机获取图像出错,{errortimes}"
);
Thread
.
Sleep
(
5000
);
}
else
if
(
errortimes
==
5
)
{
...
...
DeviceLibrary/DeviceLibrary/LiftMonitor.cs
查看文件 @
821c9a8
...
...
@@ -15,6 +15,7 @@ namespace DeviceLibrary
string
axisbreak
;
AxisBean
axisBean
;
int
speed
;
int
StrokeLength
=
270000
;
public
LiftMonitor
(
string
_up
,
string
_down
,
string
_break
,
AxisBean
_axisBean
,
int
_speed
)
{
up
=
_up
;
down
=
_down
;
...
...
@@ -37,17 +38,17 @@ namespace DeviceLibrary
public
void
LiftUp
(
MoveInfo
moveInfo
)
{
if
(
moveInfo
==
null
)
moveInfo
=
new
MoveInfo
(
"界面"
);
moveInfo
=
new
MoveInfo
(
"界面"
,
false
);
if
(
IOManager
.
IOValue
(
up
.
ToString
()).
Equals
(
IO_VALUE
.
HIGH
))
{
moveInfo
.
log
(
$
"{axisBean.AxisName},已在位置,无需上升"
);
return
;
}
IOManager
.
IOMove
(
axisbreak
,
IO_VALUE
.
HIGH
);
axisBean
.
SpeedMove
(
speed
);
axisBean
.
RelMove
(
StrokeLength
,
(
double
)
speed
);
DateTime
d
=
DateTime
.
Now
;
moveInfo
.
log
(
$
"{axisBean.AxisName},LiftUp"
);
if
(
moveInfo
!=
null
)
moveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitAction
(
new
Func
<
WaitResultInfo
,
bool
>(
WaitUp
),
"等待顶升
机构上升"
));
moveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitAction
(
new
Func
<
WaitResultInfo
,
bool
>(
WaitUp
),
$
"等待顶升[{axisBean.Config.Explain}]
机构上升"
));
Task
.
Run
(()=>
{
while
(!
IOManager
.
IOValue
(
up
.
ToString
()).
Equals
(
IO_VALUE
.
HIGH
))
{
Task
.
Delay
(
30
);
...
...
@@ -67,25 +68,25 @@ namespace DeviceLibrary
}
if
(!
axisBean
.
IsBusy
)
{
axisBean
.
SpeedMove
(
speed
);
axisBean
.
RelMove
(
StrokeLength
,
(
double
)
speed
);
}
return
false
;
}
public
void
LiftDown
(
MoveInfo
moveInfo
)
{
if
(
moveInfo
==
null
)
moveInfo
=
new
MoveInfo
(
"界面"
);
moveInfo
=
new
MoveInfo
(
"界面"
,
false
);
if
(
IOManager
.
IOValue
(
down
.
ToString
()).
Equals
(
IO_VALUE
.
HIGH
))
{
moveInfo
.
log
(
$
"{axisBean.AxisName},已在位置,无需下降"
);
return
;
}
IOManager
.
IOMove
(
axisbreak
,
IO_VALUE
.
HIGH
);
axisBean
.
SpeedMove
(-
speed
);
axisBean
.
RelMove
(-
StrokeLength
,
(
double
)
speed
);
DateTime
d
=
DateTime
.
Now
;
moveInfo
.
log
(
$
"{axisBean.AxisName},LiftDown"
);
if
(
moveInfo
!=
null
)
moveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitAction
(
new
Func
<
WaitResultInfo
,
bool
>(
WaitDown
),
"等待顶升
机构下降"
));
moveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitAction
(
new
Func
<
WaitResultInfo
,
bool
>(
WaitDown
),
$
"等待顶升[{axisBean.Config.Explain}]
机构下降"
));
Task
.
Run
(()
=>
{
while
(!
IOManager
.
IOValue
(
down
.
ToString
()).
Equals
(
IO_VALUE
.
HIGH
))
...
...
@@ -108,7 +109,7 @@ namespace DeviceLibrary
if
(!
axisBean
.
IsBusy
)
{
axisBean
.
SpeedMove
(-
speed
);
axisBean
.
RelMove
(-
StrokeLength
,
(
double
)
speed
);
}
return
false
;
}
...
...
DeviceLibrary/DeviceLibrary/OKLEController.cs
查看文件 @
821c9a8
...
...
@@ -105,7 +105,51 @@ public class OKLEController
}
}
}
public
static
double
SetZero
(
string
port
)
{
double
weight
=
0d
;
AcSerialBean
sb
=
GetSerialBean
(
port
);
if
(
sb
==
null
)
{
return
weight
;
}
if
(!
Monitor
.
TryEnter
(
sb
))
return
ValueBuffer
[
port
];
try
{
LogName
=
"[OKLE_"
+
port
+
"]"
;
//12..1.2读取力值(毛重)指令,指令格式:01 03 00 50 00 02 C4 1A
//01 03 00 00 00 02 C4 0B
byte
[]
sendData
=
new
byte
[
8
];
sendData
[
0
]
=
0x01
;
sendData
[
1
]
=
0x06
;
sendData
[
2
]
=
0x00
;
sendData
[
3
]
=
0x07
;
sendData
[
4
]
=
0xA5
;
sendData
[
5
]
=
0x0D
;
//sendData[6] = 0xC4;
//sendData[7] = 0x0B;
sendData
=
buildCheckData
(
sendData
,
sendData
.
Length
-
2
);
string
str
=
AcSerialBean
.
byteToHexStr
(
sendData
,
" "
);
byte
[]
reviceData
=
new
byte
[
15
];
bool
isOk
=
false
;
sb
.
SendCommand
(
sendData
,
ref
reviceData
,
100
,
out
isOk
);
LogUtil
.
debug
(
LogName
+
"发送数据:"
+
str
+
",收到数据 :"
+
AcSerialBean
.
byteToHexStr
(
reviceData
,
" "
));
ValueBuffer
[
port
]
=
getReviceData
(
reviceData
);
return
ValueBuffer
[
port
];
}
catch
(
Exception
e
)
{
LogUtil
.
debug
(
LogName
+
e
.
ToString
());
return
ValueBuffer
[
port
];
}
finally
{
Monitor
.
Exit
(
sb
);
}
}
public
static
double
queryData
(
string
port
)
{
...
...
@@ -138,7 +182,7 @@ public class OKLEController
byte
[]
reviceData
=
new
byte
[
15
];
bool
isOk
=
false
;
sb
.
SendCommand
(
sendData
,
ref
reviceData
,
100
,
out
isOk
);
LogUtil
.
debug
(
LogName
+
"发送数据:"
+
str
+
",收到数据 :"
+
AcSerialBean
.
byteToHexStr
(
reviceData
,
" "
));
//
LogUtil.debug(LogName + "发送数据:" + str + ",收到数据 :" + AcSerialBean.byteToHexStr(reviceData, " "));
ValueBuffer
[
port
]
=
getReviceData
(
reviceData
);
return
ValueBuffer
[
port
];
}
...
...
DeviceLibrary/DeviceLibrary/ServerCommunication.cs
查看文件 @
821c9a8
...
...
@@ -4,6 +4,7 @@ using System;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Text
;
using
System.Threading
;
using
System.Threading.Tasks
;
namespace
DeviceLibrary
...
...
@@ -17,6 +18,36 @@ namespace DeviceLibrary
string
StoreName
;
string
WarnMsg
=
""
;
private
System
.
Timers
.
Timer
serverConnectTimer
=
new
System
.
Timers
.
Timer
();
public
ServerCommunication
()
{
serverConnectTimer
.
Interval
=
1000
;
serverConnectTimer
.
AutoReset
=
true
;
serverConnectTimer
.
Enabled
=
false
;
serverConnectTimer
.
Elapsed
+=
ServerConnectTimer_Elapsed
;
;
}
private
void
ServerConnectTimer_Elapsed
(
object
sender
,
System
.
Timers
.
ElapsedEventArgs
e
)
{
if
(!
Monitor
.
TryEnter
(
serverConnectTimer
))
return
;
try
{
SendLineStatus
();
}
catch
{
}
finally
{
Monitor
.
Exit
(
serverConnectTimer
);
}
}
public
void
StartConnectServer
()
{
serverConnectTimer
.
Enabled
=
true
;
}
public
void
StopConnectServer
()
{
serverConnectTimer
.
Enabled
=
false
;
}
public
void
ProcessMsg
(
List
<
Msg
>
msg
)
{
WarnMsg
=
string
.
Join
(
","
,
msg
.
Select
(
x
=>
x
.
msgtxt
));
}
...
...
@@ -196,7 +227,7 @@ namespace DeviceLibrary
Operation
resultOperation
=
HttpHelper
.
Post
(
GetPostApi
(),
lineOperation
,
false
);
ResultProcess
(
resultOperation
);
TimeSpan
span
=
DateTime
.
Now
-
time
;
if
(
span
.
TotalMilliseconds
>
2
00
)
if
(
span
.
TotalMilliseconds
>
7
00
)
{
LogUtil
.
info
(
StoreName
+
"TimerProcess["
+
span
.
TotalMilliseconds
+
"]"
);
}
...
...
DeviceLibrary/theMachine/AxisBean.cs
查看文件 @
821c9a8
...
...
@@ -249,6 +249,28 @@ namespace DeviceLibrary
AxisManager
.
AbsMove
(
Config
.
DeviceName
,
Config
.
GetAxisValue
(),
targetPos
,
(
int
)
targetSpeed
,
(
int
)
targetSpeed
*
4
,
(
int
)
targetSpeed
*
4
);
// , Config.AddSpeed, Config.DelSpeed);
}
/// <summary>
/// 绝对运动至点,不等待结果
/// </summary>
public
void
RelMove
(
int
targetPos
,
double
targetSpeed
)
{
if
(
targetPos
.
Equals
(-
1
))
{
return
;
}
LastPosition
=
-
1
;
//if (targetSpeed <= 0)//targetSpeed > Config.TargetSpeed ||
//{
// targetSpeed = Config.TargetSpeed;
//}
//小于1,表示是目标速度的百分比
if
(
targetSpeed
<=
1
)
{
targetSpeed
=
Config
.
TargetSpeed
*
targetSpeed
;
}
AxisManager
.
RelMove
(
Config
.
DeviceName
,
Config
.
GetAxisValue
(),
targetPos
,
(
int
)
targetSpeed
,
(
int
)
targetSpeed
*
4
,
(
int
)
targetSpeed
*
4
);
// , Config.AddSpeed, Config.DelSpeed);
}
public
bool
IsBusy
{
get
=>
AxisManager
.
GetBusyStatus
(
Config
.
DeviceName
,
Config
.
GetAxisValue
())
==
1
;
}
...
...
DeviceLibrary/theMachine/BoxTransport.cs
查看文件 @
821c9a8
...
...
@@ -24,6 +24,7 @@ namespace DeviceLibrary
public
event
Action
<
string
,
StoreMoveType
,
bool
>
InOutEndProcessEvent
;
public
bool
IsComplateOrFree
{
get
=>
MoveInfo
.
MoveStep
==
MoveStep
.
Wait
;
}
public
bool
IsTakedBox
{
get
=>
MoveInfo
.
MoveStep
>=
MoveStep
.
StoreTS10
;
}
public
bool
IsPutOnOut
{
get
=>
To
.
posid
==
BoxStorePosition
.
outdoor
&&
MoveInfo
.
MoveStep
<
MoveStep
.
StoreTS10
&&
MoveInfo
.
MoveStep
>=
MoveStep
.
StoreTS16
;
}
public
BoxTransport
(
Robot_Config
_Config
,
MainMachine
_mainMachine
)
{
Config
=
_Config
;
...
...
@@ -89,13 +90,13 @@ namespace DeviceLibrary
if
(
IOManager
.
IOValue
(
IO_Type
.
SideA_ForkMaterial_Check
).
Equals
(
IO_VALUE
.
HIGH
)
||
IOManager
.
IOValue
(
IO_Type
.
SideB_ForkMaterial_Check
).
Equals
(
IO_VALUE
.
HIGH
))
{
Msg
.
add
(
"伸缩叉2侧检测到有物料无法继续,请检查"
,
MsgLevel
.
alarm
);
RobotManage
.
UserPause
(
"伸缩
2侧叉
检测到有物料无法继续,请检查"
);
Msg
.
add
(
"伸缩叉2侧
X10/X11
检测到有物料无法继续,请检查"
,
MsgLevel
.
alarm
);
RobotManage
.
UserPause
(
"伸缩
叉2侧X10,X11
检测到有物料无法继续,请检查"
);
}
else
if
(
IOManager
.
IOValue
(
IO_Type
.
ForkMaterial_Check
).
Equals
(
IO_VALUE
.
HIGH
))
{
Msg
.
add
(
"出库时伸缩叉检测到有物料无法继续,请检查"
,
MsgLevel
.
alarm
);
RobotManage
.
UserPause
(
"出库时伸缩叉检测到有物料无法继续,请检查"
);
Msg
.
add
(
"出库时伸缩叉
X09
检测到有物料无法继续,请检查"
,
MsgLevel
.
alarm
);
RobotManage
.
UserPause
(
"出库时伸缩叉
X09
检测到有物料无法继续,请检查"
);
}
else
{
...
...
@@ -118,15 +119,15 @@ namespace DeviceLibrary
}
break
;
case
MoveStep
.
StoreTS04
:
MoveInfo
.
NextMoveStep
(
MoveStep
.
StoreTS0
5
);
MoveInfo
.
NextMoveStep
(
MoveStep
.
StoreTS0
6
);
YAxis
.
AbsMove
(
MoveInfo
,
From
.
Yaxis_PL
,
Config
.
Yaxis_P1_speed
);
MoveInfo
.
log
(
$
"{storeMoveType}:上下轴到达取料低点"
);
break
;
case
MoveStep
.
StoreTS05
:
MoveInfo
.
NextMoveStep
(
MoveStep
.
StoreTS06
);
XAxis
.
AbsMove
(
MoveInfo
,
From
.
Xaxis_P2
,
Config
.
Xaxis_P2_speed
);
MoveInfo
.
log
(
$
"{storeMoveType}:行走机构到达取料点"
);
break
;
case
MoveStep
.
StoreTS05
:
MoveInfo
.
NextMoveStep
(
MoveStep
.
StoreTS06
);
break
;
case
MoveStep
.
StoreTS06
:
MoveInfo
.
NextMoveStep
(
MoveStep
.
StoreTS07
);
ZAxis
.
AbsMove
(
MoveInfo
,
From
.
Zaxis_P2
,
Config
.
Zaxis_P2_speed
);
...
...
@@ -136,7 +137,7 @@ namespace DeviceLibrary
GetCamera
(
From
.
Zaxis_P2
).
CameraGrabOne
(
RobotManage
.
CameraA
.
GetFixtureStateFilename
(
From
.
posid
,
WareCode
,
storeMoveType
,
FixtureState
.
In
));
MoveInfo
.
NextMoveStep
(
MoveStep
.
StoreTS08
);
YAxis
.
AbsMove
(
MoveInfo
,
From
.
Yaxis_PH
,
Config
.
Yaxis_P4_speed
);
MoveInfo
.
log
(
$
"{storeMoveType}:上下轴到达取料
低
点"
);
MoveInfo
.
log
(
$
"{storeMoveType}:上下轴到达取料
高
点"
);
break
;
case
MoveStep
.
StoreTS08
:
MoveInfo
.
NextMoveStep
(
MoveStep
.
StoreTS09
);
...
...
@@ -148,13 +149,13 @@ namespace DeviceLibrary
if
(
IOManager
.
IOValue
(
IO_Type
.
SideA_ForkMaterial_Check
).
Equals
(
IO_VALUE
.
HIGH
)
||
IOManager
.
IOValue
(
IO_Type
.
SideB_ForkMaterial_Check
).
Equals
(
IO_VALUE
.
HIGH
))
{
Msg
.
add
(
"伸缩叉2侧检测到有物料无法继续,请检查"
,
MsgLevel
.
alarm
);
RobotManage
.
UserPause
(
"伸缩叉2侧检测到有物料无法继续,请检查"
);
Msg
.
add
(
"伸缩叉2侧
X10/X11
检测到有物料无法继续,请检查"
,
MsgLevel
.
alarm
);
RobotManage
.
UserPause
(
"伸缩叉2侧
X10/X11
检测到有物料无法继续,请检查"
);
}
else
if
(
IOManager
.
IOValue
(
IO_Type
.
ForkMaterial_Check
).
Equals
(
IO_VALUE
.
LOW
))
{
Msg
.
add
(
"出库时伸缩叉
没有取到物料
,请检查"
,
MsgLevel
.
alarm
);
RobotManage
.
UserPause
(
"出库时伸缩叉
没有取到物料
,请检查"
);
Msg
.
add
(
"出库时伸缩叉
X09检测到有物料无法继续
,请检查"
,
MsgLevel
.
alarm
);
RobotManage
.
UserPause
(
"出库时伸缩叉
X09检测到有物料无法继续
,请检查"
);
}
else
{
...
...
@@ -169,15 +170,15 @@ namespace DeviceLibrary
}
break
;
case
MoveStep
.
StoreTS10
:
MoveInfo
.
NextMoveStep
(
MoveStep
.
StoreTS1
1
);
MoveInfo
.
NextMoveStep
(
MoveStep
.
StoreTS1
2
);
XAxis
.
AbsMove
(
MoveInfo
,
To
.
Xaxis_P2
,
Config
.
Xaxis_P2_speed
);
MoveInfo
.
log
(
$
"{storeMoveType}:行走机构到达目的地"
);
break
;
case
MoveStep
.
StoreTS11
:
MoveInfo
.
NextMoveStep
(
MoveStep
.
StoreTS12
);
YAxis
.
AbsMove
(
MoveInfo
,
To
.
Yaxis_PH
,
Config
.
Yaxis_P1_speed
);
MoveInfo
.
log
(
$
"{storeMoveType}:上下轴到达目的地高点"
);
break
;
case
MoveStep
.
StoreTS11
:
MoveInfo
.
NextMoveStep
(
MoveStep
.
StoreTS12
);
break
;
case
MoveStep
.
StoreTS12
:
MoveInfo
.
NextMoveStep
(
MoveStep
.
StoreTS13
);
ZAxis
.
AbsMove
(
MoveInfo
,
To
.
Zaxis_P2
,
Config
.
Zaxis_P2_speed
);
...
...
@@ -199,13 +200,13 @@ namespace DeviceLibrary
if
(
IOManager
.
IOValue
(
IO_Type
.
SideA_ForkMaterial_Check
).
Equals
(
IO_VALUE
.
HIGH
)
||
IOManager
.
IOValue
(
IO_Type
.
SideB_ForkMaterial_Check
).
Equals
(
IO_VALUE
.
HIGH
))
{
Msg
.
add
(
"伸缩叉2侧检测到有物料无法继续,请检查"
,
MsgLevel
.
alarm
);
RobotManage
.
UserPause
(
"伸缩叉检测到有物料无法继续,请检查"
);
Msg
.
add
(
"伸缩叉2侧
X10/X11
检测到有物料无法继续,请检查"
,
MsgLevel
.
alarm
);
RobotManage
.
UserPause
(
"伸缩叉
2侧X10/X11
检测到有物料无法继续,请检查"
);
}
else
if
(
IOManager
.
IOValue
(
IO_Type
.
ForkMaterial_Check
).
Equals
(
IO_VALUE
.
HIGH
))
{
Msg
.
add
(
"入库后伸缩叉上任然检测到物料,请检查"
,
MsgLevel
.
alarm
);
RobotManage
.
UserPause
(
"入库后伸缩叉上任然检测到物料,请检查"
);
Msg
.
add
(
"入库后伸缩叉
X09
上任然检测到物料,请检查"
,
MsgLevel
.
alarm
);
RobotManage
.
UserPause
(
"入库后伸缩叉
X09
上任然检测到物料,请检查"
);
}
else
{
...
...
@@ -215,9 +216,9 @@ namespace DeviceLibrary
break
;
case
MoveStep
.
StoreTS16
:
MoveInfo
.
NextMoveStep
(
MoveStep
.
StoreTS17
);
//
YAxis.AbsMove(MoveInfo, Config.Yaxis_P1, Config.Yaxis_P1_speed);
//
XAxis.AbsMove(MoveInfo, Config.Xaxis_P1, Config.Xaxis_P1_speed);
//
MoveInfo.log($"{storeMoveType}:上下轴,行走机构返回待机点P1");
YAxis
.
AbsMove
(
MoveInfo
,
Config
.
Yaxis_P1
,
Config
.
Yaxis_P1_speed
);
XAxis
.
AbsMove
(
MoveInfo
,
Config
.
Xaxis_P1
,
Config
.
Xaxis_P1_speed
);
MoveInfo
.
log
(
$
"{storeMoveType}:上下轴,行走机构返回待机点P1"
);
ErrMsgTxt
=
""
;
break
;
case
MoveStep
.
StoreTS17
:
...
...
DeviceLibrary/theMachine/LabelParam.cs
查看文件 @
821c9a8
...
...
@@ -126,6 +126,8 @@ namespace DeviceLibrary
Yaxis_PL
=
aCStorePosition
.
UpDownAxis_ILPosition_P4
;
posid
=
aCStorePosition
.
PositionNum
;
}
public
const
string
indoor
=
"入料口"
;
public
const
string
outdoor
=
"出料口"
;
public
BoxStorePosition
(
Robot_Config
Config
,
StoreSide
storeSide
)
{
...
...
@@ -135,14 +137,14 @@ namespace DeviceLibrary
Zaxis_P2
=
Config
.
Zaxis_P2
;
Yaxis_PH
=
Config
.
Yaxis_P4
;
Yaxis_PL
=
Config
.
Yaxis_P2
;
posid
=
"入料口"
;
posid
=
indoor
;
}
else
{
Xaxis_P2
=
Config
.
Xaxis_P3
;
Zaxis_P2
=
Config
.
Zaxis_P3
;
Yaxis_PH
=
Config
.
Yaxis_P5
;
Yaxis_PL
=
Config
.
Yaxis_P3
;
posid
=
"出料口"
;
posid
=
outdoor
;
}
}
...
...
DeviceLibrary/theMachine/MainMachine _IN.cs
查看文件 @
821c9a8
...
...
@@ -168,7 +168,7 @@ namespace DeviceLibrary
case
MoveStep
.
In07
:
if
(
IOValue
(
IO_Type
.
InOverHead_Check
).
Equals
(
IO_VALUE
.
HIGH
))
{
LineIn
.
LineStop
(
"work"
);
InMoveInfo
.
log
(
$
"检测到物料超高,停止滚筒"
);
InMoveInfo
.
log
(
$
"
X18
检测到物料超高,停止滚筒"
);
InMoveInfo
.
NextMoveStep
(
MoveStep
.
InOverHead
);
ServerCM
.
cancelPutInTask
(
""
,
InMoveInfo
.
MoveParam
.
WareCode
);
return
;
...
...
@@ -183,7 +183,7 @@ namespace DeviceLibrary
}
else
if
(
InMoveInfo
.
IsTimeOut
(
10
))
{
Msg
.
add
(
"周转箱进入超时"
,
MsgLevel
.
warning
);
Msg
.
add
(
"周转箱进入
等待X26信号
超时"
,
MsgLevel
.
warning
);
InMoveInfo
.
log
(
$
"周转箱进入超时"
);
}
break
;
...
...
@@ -212,7 +212,7 @@ namespace DeviceLibrary
InMoveInfo
.
log
(
"周转箱已取走,顶升下降"
);
break
;
case
MoveStep
.
InOverHead
:
Msg
.
add
(
"物料超高,请取出周转箱"
,
MsgLevel
.
warning
);
Msg
.
add
(
"
X18检测到
物料超高,请取出周转箱"
,
MsgLevel
.
warning
);
if
(
IOMonitor
.
IODebound
(
IO_Type
.
InStopMaterial_Check
,
Config
,
IO_VALUE
.
LOW
))
{
CylinderMove
(
InMoveInfo
,
IO_Type
.
InStop_Down
,
IO_Type
.
InStop_Up
,
IO_VALUE
.
HIGH
);
InMoveInfo
.
NextMoveStep
(
MoveStep
.
Wait
);
...
...
DeviceLibrary/theMachine/MainMachine _Out.cs
查看文件 @
821c9a8
...
...
@@ -33,7 +33,7 @@ namespace DeviceLibrary
{
OutMoveInfo
.
NextMoveStep
(
MoveStep
.
WaitErr
);
}
else
if
(
IOValue
(
IO_Type
.
OutEntryMaterialTop_Check
).
Equals
(
IO_VALUE
.
HIGH
))
else
if
(
IOValue
(
IO_Type
.
OutEntryMaterialTop_Check
).
Equals
(
IO_VALUE
.
HIGH
)
&&
RobotManage
.
mainMachine
.
boxTransport
.
IsPutOnOut
)
{
Msg
.
add
(
"检测到出料口有周转箱"
,
MsgLevel
.
warning
);
OutMoveInfo
.
log
(
$
"检测到出料口有周转箱,送出"
);
...
...
@@ -49,7 +49,7 @@ namespace DeviceLibrary
case
MoveStep
.
OutBoxPutOn
:
if
(
IOValue
(
IO_Type
.
OutEntryMaterialTop_Check
).
Equals
(
IO_VALUE
.
LOW
))
{
Msg
.
add
(
"出口没有检测到周转箱"
,
MsgLevel
.
warning
);
Msg
.
add
(
"出口
X39
没有检测到周转箱"
,
MsgLevel
.
warning
);
}
else
{
...
...
@@ -74,7 +74,7 @@ namespace DeviceLibrary
break
;
case
MoveStep
.
Out02
:
OutMoveInfo
.
NextMoveStep
(
MoveStep
.
Out03
);
LineOut
.
LineRun
(
"work"
,
3
);
LineOut
.
LineRun
(
"work"
,
6
);
OutMoveInfo
.
log
(
$
"料箱抵达出口"
);
OutMoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitTime
(
2000
));
break
;
...
...
DeviceLibrary/theMachine/MainMachine.cs
查看文件 @
821c9a8
...
...
@@ -227,24 +227,35 @@ namespace DeviceLibrary
if
(
m
.
Find
((
aa
)
=>
aa
.
msgLevel
==
MsgLevel
.
alarm
)
==
null
)
{
AlarmBuzzer
.
OFF
();
if
(
ServerCM
.
storeStatus
!=
StoreStatus
.
InStoreExecute
&&
ServerCM
.
storeStatus
!=
StoreStatus
.
OutStoreExecute
)
ServerCM
.
storeStatus
=
StoreStatus
.
StoreOnline
;
}
else
{
AlarmBuzzer
.
ON
();
ServerCM
.
storeStatus
=
StoreStatus
.
Warning
;
}
//ProcessMoveinfoEvent?.Invoke(MoveInfo.List);
if
(!
UserPause
)
Msg
.
clear
();
else
ServerCM
.
storeStatus
=
StoreStatus
.
Debugging
;
}
}
LogUtil
.
info
(
"主线程已退出."
);
}
public
void
Start
()
{
ServerCM
.
StartConnectServer
();
Run
();
}
public
void
Stop
()
{
mstart
=
false
;
ServerCM
.
StopConnectServer
();
Thread
.
Sleep
(
300
);
Alarm
(
AlarmType
.
None
);
StopMove
(
true
);
IOMove
(
IO_Type
.
InMoto_Run
,
IO_VALUE
.
LOW
);
IOMove
(
IO_Type
.
OutMoto_Run
,
IO_VALUE
.
LOW
);
}
public
void
BeginHomeReset
(
bool
firstRun
=
false
)
{
if
(!
firstRun
)
...
...
@@ -271,14 +282,14 @@ namespace DeviceLibrary
case
MoveStep
.
H01_HomeReset
:
ResetMoveInfo
.
NextMoveStep
(
MoveStep
.
H02_HomeReset
);
ResetMoveInfo
.
log
(
"开始回原,进出轴回原"
);
ServerCM
.
storeStatus
=
StoreStatus
.
ResetMove
;
ZAxis
.
HomeMove
(
ResetMoveInfo
,
forceHome
);
break
;
case
MoveStep
.
H02_HomeReset
:
if
(
IOValue
(
IO_Type
.
SideA_ForkMaterial_Check
).
Equals
(
IO_VALUE
.
HIGH
)
||
IOValue
(
IO_Type
.
SideB_ForkMaterial_Check
).
Equals
(
IO_VALUE
.
HIGH
))
{
Msg
.
add
(
"
料叉上有没有放正的物料
"
,
MsgLevel
.
warning
);
Msg
.
add
(
"
伸缩叉2侧X10/X11检测到有物料无法继续
"
,
MsgLevel
.
warning
);
RobotManage
.
UserPause
(
"回源时料叉上有物料"
);
return
;
}
...
...
@@ -310,18 +321,16 @@ namespace DeviceLibrary
CylinderMove
(
InMoveInfo
,
IO_Type
.
OutExitStop_Down
,
IO_Type
.
OutExitStop_Up
,
IO_VALUE
.
HIGH
);
break
;
case
MoveStep
.
H06_HomeReset
:
if
(
IOValue
(
IO_Type
.
ForkMaterial_Check
).
Equals
(
IO_VALUE
.
HIGH
)
||
IOValue
(
IO_Type
.
SideA_ForkMaterial_Check
).
Equals
(
IO_VALUE
.
HIGH
)
||
IOValue
(
IO_Type
.
SideB_ForkMaterial_Check
).
Equals
(
IO_VALUE
.
HIGH
))
if
(
IOValue
(
IO_Type
.
ForkMaterial_Check
).
Equals
(
IO_VALUE
.
HIGH
))
{
ResetMoveInfo
.
NextMoveStep
(
MoveStep
.
H07_HomeReset
);
ResetMoveInfo
.
log
(
"进出轴上有周转箱"
);
ResetMoveInfo
.
log
(
"进出轴
X09
上有周转箱"
);
}
else
if
(
IOValue
(
IO_Type
.
SideA_ForkMaterial_Check
).
Equals
(
IO_VALUE
.
HIGH
)
||
IOValue
(
IO_Type
.
SideB_ForkMaterial_Check
).
Equals
(
IO_VALUE
.
HIGH
))
{
Msg
.
add
(
"
料叉上有没有放正的物料
"
,
MsgLevel
.
warning
);
Msg
.
add
(
"
伸缩叉2侧X10/X11检测到有物料无法继续
"
,
MsgLevel
.
warning
);
RobotManage
.
UserPause
(
"回源时料叉上有物料"
);
return
;
}
...
...
@@ -346,10 +355,12 @@ namespace DeviceLibrary
}
break
;
case
MoveStep
.
HEND_HomeReset
:
OKLEController
.
SetZero
(
Config
.
WeightSensorPort
);
forceHome
=
false
;
ResetMoveInfo
.
log
(
"回原完成"
);
ResetMoveInfo
.
EndMove
();
runStatus
=
RunStatus
.
Running
;
ServerCM
.
storeStatus
=
StoreStatus
.
StoreOnline
;
break
;
}
}
...
...
DeviceLibrary/theMachine/MoveInfo.cs
查看文件 @
821c9a8
...
...
@@ -12,14 +12,14 @@ namespace DeviceLibrary
{
public
static
List
<
MoveInfo
>
List
=
new
List
<
MoveInfo
>();
public
int
TimeOutSeconds
=
60
;
public
MoveInfo
(
string
name
)
public
MoveInfo
(
string
name
,
bool
addtolist
=
true
)
{
MoveParam
=
new
BoxParam
();
this
.
moveStep
=
MoveStep
.
Wait
;
IsInWait
=
false
;
this
.
Name
=
name
;
List
.
Add
(
this
);
if
(
addtolist
)
List
.
Add
(
this
);
}
public
string
Name
{
get
;
set
;
}
...
...
DeviceLibrary/theMachine/RobotManage.cs
查看文件 @
821c9a8
...
...
@@ -101,8 +101,9 @@ namespace DeviceLibrary
if
(!
IsConfigMode
)
return
;
}
mainThread
=
new
Thread
(
new
ThreadStart
(
mainMachine
.
Run
));
mainThread
=
new
Thread
(
new
ThreadStart
(
mainMachine
.
Start
));
mainThread
.
Start
();
isRunning
=
true
;
GC
.
KeepAlive
(
mainThread
);
Task
.
Run
(()=>
{
...
...
@@ -129,6 +130,8 @@ namespace DeviceLibrary
{
LogUtil
.
info
(
"开始关闭系统."
);
IOManager
.
CloseAllConnection
();
CameraA
.
stopCamera
();
CameraB
.
stopCamera
();
}
public
static
void
UserPause
(
bool
userpause
)
{
...
...
TheMachine/Form1.cs
查看文件 @
821c9a8
...
...
@@ -22,7 +22,7 @@ namespace TheMachine
{
InitializeComponent
();
this
.
FormClosing
+=
Form1_FormClosing
;
this
.
Text
=
Config
.
Get
(
Setting_Init
.
App_Title
);
this
.
Text
=
Config
.
Get
(
Setting_Init
.
App_Title
)
+
" "
+
Config
.
Get
(
"CID"
)
;
t1
.
Interval
=
1000
;
t1
.
Tick
+=
T1_Tick
;
...
...
称重控制器操作手册[V9.0ARM]-B5(1).pdf
0 → 100644
查看文件 @
821c9a8
此文件类型无法预览
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论