Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
刘韬
/
1053_CycleLine
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit f8d997d6
由
刘韬
编写于
2022-12-08 09:40:00 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
1
1 个父辈
75d50573
显示空白字符变更
内嵌
并排
正在显示
8 个修改的文件
包含
89 行增加
和
27 行删除
DeviceLibrary/theMachine/MainMachine.cs
DeviceLibrary/theMachine/TrayManager.cs
DeviceLibrary/theMachine/sub/SideMove.cs
DeviceLibrary/theMachine/sub/TransplantMove.cs
DeviceLibrary/theMachine/sub/TrayStop.cs
RemoteSheardObject/Class1.cs
RemoteSheardObject/RemoteSheardObject.csproj
TheMachine/UC/RfidControl.cs
DeviceLibrary/theMachine/MainMachine.cs
查看文件 @
f8d997d
...
...
@@ -254,14 +254,24 @@ namespace DeviceLibrary
if
(
span
.
TotalSeconds
>
2
)
{
checkAlarmTime
=
DateTime
.
Now
;
foreach
(
ConfigMoveAxis
configMoveAxis
in
Config
.
moveAxisList
)
AxisBean
.
List
.
ToList
().
ForEach
((
x
)
=>
{
x
.
Value
.
ForEach
(
y
=>
{
AxisManager
.
AlarmClear
(
y
.
Config
.
DeviceName
,
y
.
Config
.
GetAxisValue
());
if
(
AxisManager
.
GetAlarmStatus
(
y
.
Config
.
DeviceName
,
y
.
Config
.
GetAxisValue
())
==
1
)
{
if
(
AxisManager
.
GetAlarmStatus
(
configMoveAxis
.
DeviceName
,
configMoveAxis
.
GetAxisValue
())
==
1
)
{
Msg
.
add
(
crc
.
GetString
(
configMoveAxis
.
ProName
,
configMoveAxis
.
Explain
)
+
$
"[{configMoveAxis.GetAxisValue()}]:"
+
crc
.
GetString
(
"Res0179"
,
"运动报警"
),
MsgLevel
.
alarm
,
ErrInfo
.
SuddenStop
);
Msg
.
add
(
crc
.
GetString
(
y
.
Config
.
ProName
,
y
.
Config
.
Explain
)
+
$
"[{y.Config.GetAxisValue()}]:"
+
crc
.
GetString
(
"Res0179"
,
"运动报警"
),
MsgLevel
.
alarm
,
ErrInfo
.
SuddenStop
);
ok
=
false
;
var
errcode
=
HuichuanLibrary
.
HCBoardManager
.
GetAxErrCode
(
y
.
Config
.
GetAxisValue
());
var
errcodebyte
=
BitConverter
.
GetBytes
(
errcode
).
ToList
();
errcodebyte
.
Reverse
();
HuichuanLibrary
.
HCBoardManager
.
GetSdo
((
ushort
)
y
.
Config
.
GetAxisValue
(),
0x203f
,
0
,
out
byte
[]
data
,
out
uint
datalen
);
var
errdatabyte
=
data
.
ToList
();
errdatabyte
.
Reverse
();
LogUtil
.
error
(
y
.
Config
.
GetAxisValue
()
+
","
+
y
.
Config
.
Explain
+
" errcode "
+
BitConverter
.
ToString
(
errcodebyte
.
ToArray
())
+
","
+
BitConverter
.
ToString
(
errdatabyte
.
ToArray
()));
LogUtil
.
error
(
string
.
Join
(
","
,
HuichuanLibrary
.
HCBoardManager
.
GetAxisErrorDetail
(
y
.
Config
.
GetAxisValue
())));
}
}
});
});
}
}
return
ok
;
...
...
DeviceLibrary/theMachine/TrayManager.cs
查看文件 @
f8d997d
...
...
@@ -279,8 +279,8 @@ namespace DeviceLibrary
public
static
Dictionary
<
int
,
string
>
AddrDesc
=
new
Dictionary
<
int
,
string
>();
static
TrayManager
()
{
TrayTypeDesc
.
Add
(
TrayTypeE
.
None
,
crc
.
GetString
(
"Res0002"
,
"空"
));
TrayTypeDesc
.
Add
(
TrayTypeE
.
MTP1
,
crc
.
GetString
(
"Res000
3"
,
"流水线治具
托盘"
));
TrayTypeDesc
.
Add
(
TrayTypeE
.
MTP2
,
crc
.
GetString
(
"Res000
4"
,
"流水线料盘托盘"
));
TrayTypeDesc
.
Add
(
TrayTypeE
.
MTP1
,
crc
.
GetString
(
"Res000
4"
,
"流水线料盘
托盘"
));
TrayTypeDesc
.
Add
(
TrayTypeE
.
MTP2
,
crc
.
GetString
(
"Res000
3"
,
"流水线治具托盘"
));
TrayTypeDesc
.
Add
(
TrayTypeE
.
S007
,
crc
.
GetString
(
"Res0005"
,
"料串"
));
TrayTypeDesc
.
Add
(
TrayTypeE
.
M03
,
crc
.
GetString
(
"Res0006"
,
"Tray料格"
));
TrayTypeDesc
.
Add
(
TrayTypeE
.
M02
,
crc
.
GetString
(
"Res0007"
,
"PCB料格"
));
...
...
DeviceLibrary/theMachine/sub/SideMove.cs
查看文件 @
f8d997d
...
...
@@ -100,6 +100,8 @@ namespace DeviceLibrary
}
int
StopBufDelayMS
=
500
;
int
StopDelayMS
=
1000
;
bool
LastGoInFail
=
false
;
DateTime
LastGoInFailTime
=
DateTime
.
Now
;
#
region
无
Rfid
横移
public
void
NoRfidProcess
()
{
...
...
@@ -113,7 +115,13 @@ namespace DeviceLibrary
break
;
case
MoveStep
.
SideMove_01
:
LSAMoveInfo
.
NextMoveStep
(
MoveStep
.
SideMove_01
);
if
(
IOValue
(
IO_Type
.
Ls_A_Front_Check
).
Equals
(
IO_VALUE
.
HIGH
))
bool
Forcetry
=
false
;
if
(
LastGoInFail
&&
(
LastGoInFailTime
-
DateTime
.
Now
).
TotalSeconds
>
5
)
{
Forcetry
=
true
;
LSAMoveInfo
.
log
(
"上次托盘进入失败本次重试"
);
}
if
(
IOValue
(
IO_Type
.
Ls_A_Front_Check
).
Equals
(
IO_VALUE
.
HIGH
)||
Forcetry
)
{
LSAMoveInfo
.
NextMoveStep
(
MoveStep
.
SideMove_02
);
Location_A
.
ToLow
(
LSAMoveInfo
);
...
...
@@ -134,10 +142,17 @@ namespace DeviceLibrary
LSAMoveInfo
.
NextMoveStep
(
MoveStep
.
SideMove_04
);
IOMove
(
IO_Type
.
Ls_B_BufStop_Fwd
,
IO_VALUE
.
HIGH
,
500
);
LSAMoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitTime
(
500
));
LastGoInFail
=
false
;
}
else
if
(
LSAMoveInfo
.
IsTimeOut
(
10
))
{
LSAMoveInfo
.
NextMoveStep
(
MoveStep
.
SideMove_01
);
if
(!
LastGoInFail
)
{
LastGoInFail
=
true
;
LastGoInFailTime
=
DateTime
.
Now
;
LSAMoveInfo
.
log
(
"托盘进入失败"
);
}
}
break
;
...
...
@@ -215,6 +230,14 @@ namespace DeviceLibrary
case
MoveStep
.
SideMove_01
:
Minfo
.
NextMoveStep
(
MoveStep
.
SideMove_01
);
bool
Forcetry
=
false
;
if
(
LastGoInFail
&&
(
LastGoInFailTime
-
DateTime
.
Now
).
TotalSeconds
>
5
)
{
Forcetry
=
true
;
LSAMoveInfo
.
log
(
"上次托盘进入失败本次重试"
);
}
if
(
lsb
.
MoveStep
>=
MoveStep
.
SideMove_10
)
{
Msg
.
add
(
sideb
+
crc
.
GetString
(
"Res0015"
,
"侧穿越中"
),
MsgLevel
.
info
);
}
else
if
(
IOValue
(
Ls_A_Tray_Check
).
Equals
(
IO_VALUE
.
HIGH
))
...
...
@@ -223,7 +246,7 @@ namespace DeviceLibrary
Minfo
.
NextMoveStep
(
MoveStep
.
SideMove_06
);
Location_a
.
ToLow
(
Minfo
);
}
else
if
(
IOValue
(
Ls_A_Front_Check
).
Equals
(
IO_VALUE
.
HIGH
))
else
if
(
IOValue
(
Ls_A_Front_Check
).
Equals
(
IO_VALUE
.
HIGH
)
||
Forcetry
)
{
Minfo
.
NextMoveStep
(
MoveStep
.
SideMove_02
);
Location_a
.
ToLow
(
Minfo
);
...
...
@@ -248,12 +271,17 @@ namespace DeviceLibrary
Minfo
.
log
(
$
"检测到进入的托盘"
);
Minfo
.
CanWhileCount
=
3
;
Minfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitTime
(
2000
));
}
else
if
(
Minfo
.
IsTimeOut
(
10
))
{
Minfo
.
log
(
$
"没有检测到进入的托盘"
);
Minfo
.
NextMoveStep
(
MoveStep
.
SideMove_01
);
if
(!
LastGoInFail
)
{
LastGoInFail
=
true
;
LastGoInFailTime
=
DateTime
.
Now
;
LSAMoveInfo
.
log
(
"托盘进入失败"
);
}
}
break
;
case
MoveStep
.
SideMove_04
:
...
...
@@ -267,7 +295,7 @@ namespace DeviceLibrary
//Location_a.ToHigh(Minfo);
break
;
case
MoveStep
.
SideMove_05
:
if
(
RFID
.
ReadByte
(
0x20
,
16
,
out
byte
[]
data
))
if
(
RFID
.
ReadByte
(
0x20
,
16
,
out
byte
[]
data
,
out
string
errmsg
))
{
var
rfid
=
Common
.
RfidFilter
(
data
);
TrayManager
.
Process
(
rfid
,
addr
,
out
TrayInfo
trayInfo
);
...
...
@@ -283,6 +311,7 @@ namespace DeviceLibrary
{
Minfo
.
CanWhileCount
--;
Minfo
.
log
(
$
"RFid读取失败,重试第{3- Minfo.CanWhileCount}次"
);
Minfo
.
log
(
"RFIDerr:"
+
errmsg
);
Minfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitMsg
(
crc
.
GetString
(
"Res0016"
,
"RFid读取失败"
),
MsgLevel
.
warning
));
}
else
{
...
...
@@ -393,6 +422,10 @@ namespace DeviceLibrary
break
;
case
MoveStep
.
H01_HomeReset
:
LSAMoveInfo
.
NextMoveStep
(
MoveStep
.
H02_HomeReset
);
LSAMoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitTime
(
10
*
1000
));
break
;
case
MoveStep
.
H02_HomeReset
:
LSAMoveInfo
.
NextMoveStep
(
MoveStep
.
H03_HomeReset
);
IOMove
(
IO_Type
.
Ls_A_BufStop_Rwd
,
IO_VALUE
.
HIGH
,
StopBufDelayMS
);
IOMove
(
IO_Type
.
Ls_B_BufStop_Rwd
,
IO_VALUE
.
HIGH
,
StopBufDelayMS
);
var
loAdown
=
IOValue
(
IO_Type
.
Ls_A_Location_Down
).
Equals
(
IO_VALUE
.
HIGH
);
...
...
@@ -430,34 +463,34 @@ namespace DeviceLibrary
}
}
break
;
case
MoveStep
.
H0
2
_HomeReset
:
LSAMoveInfo
.
NextMoveStep
(
MoveStep
.
H0
3
_HomeReset
);
case
MoveStep
.
H0
3
_HomeReset
:
LSAMoveInfo
.
NextMoveStep
(
MoveStep
.
H0
4
_HomeReset
);
Location_A
.
ToHigh
(
LSAMoveInfo
);
Location_B
.
ToHigh
(
LSAMoveInfo
);
if
(
LS_Type
==
LS_TypeE
.
NoRfid
)
IOMove
(
IO_Type
.
Ls_B_BufStop_Fwd
,
IO_VALUE
.
HIGH
,
StopBufDelayMS
);
LSAMoveInfo
.
log
(
$
"顶升顶起"
);
break
;
case
MoveStep
.
H0
3
_HomeReset
:
LSAMoveInfo
.
NextMoveStep
(
MoveStep
.
H0
4
_HomeReset
);
case
MoveStep
.
H0
4
_HomeReset
:
LSAMoveInfo
.
NextMoveStep
(
MoveStep
.
H0
5
_HomeReset
);
Line
.
LineRun
(
"n"
,
false
,
10
);
LSAMoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitTime
(
2000
));
LSAMoveInfo
.
log
(
$
"横移点击运行"
);
break
;
case
MoveStep
.
H0
4
_HomeReset
:
LSAMoveInfo
.
NextMoveStep
(
MoveStep
.
H0
5
_HomeReset
);
case
MoveStep
.
H0
5
_HomeReset
:
LSAMoveInfo
.
NextMoveStep
(
MoveStep
.
H0
6
_HomeReset
);
Location_A
.
ToLow
(
LSAMoveInfo
);
Location_B
.
ToLow
(
LSAMoveInfo
);
LSAMoveInfo
.
log
(
$
"顶升下降"
);
break
;
case
MoveStep
.
H0
5
_HomeReset
:
LSAMoveInfo
.
NextMoveStep
(
MoveStep
.
H0
6
_HomeReset
);
case
MoveStep
.
H0
6
_HomeReset
:
LSAMoveInfo
.
NextMoveStep
(
MoveStep
.
H0
7
_HomeReset
);
if
(
LS_Type
!=
LS_TypeE
.
NoRfid
)
IOMove
(
IO_Type
.
Ls_B_Stop
,
IO_VALUE
.
HIGH
,
StopDelayMS
);
LSAMoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitTime
(
2000
));
LSAMoveInfo
.
log
(
$
"缓冲回退"
);
break
;
case
MoveStep
.
H0
6
_HomeReset
:
case
MoveStep
.
H0
7
_HomeReset
:
LSAMoveInfo
.
log
(
"回原完成"
);
DeviceState
=
DeviceStateE
.
Run
;
LSAMoveInfo
.
EndMove
();
...
...
DeviceLibrary/theMachine/sub/TransplantMove.cs
查看文件 @
f8d997d
...
...
@@ -122,7 +122,7 @@ namespace DeviceLibrary
}
break
;
case
MoveStep
.
TransplantMove_03
:
if
(
RFID_1
.
ReadByte
(
0x20
,
16
,
out
byte
[]
data
))
if
(
RFID_1
.
ReadByte
(
0x20
,
16
,
out
byte
[]
data
,
out
string
errmsg
))
{
CurrrentRFID
=
Common
.
RfidFilter
(
data
);
MoveInfo
.
MoveParam
.
RFID
=
CurrrentRFID
;
...
...
@@ -200,6 +200,7 @@ namespace DeviceLibrary
{
MoveInfo
.
CanWhileCount
--;
MoveInfo
.
log
(
$
"RFid读取失败,重试第{3 - MoveInfo.CanWhileCount}次"
);
MoveInfo
.
log
(
"RFIDerr:"
+
errmsg
);
MoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitMsg
(
crc
.
GetString
(
"Res0016"
,
"RFid读取失败"
),
MsgLevel
.
warning
));
}
else
...
...
@@ -324,7 +325,7 @@ namespace DeviceLibrary
remoteLoad
.
RequestLoadInfo
.
LoadParam
=
MoveInfo
.
MoveParam
.
clone
();
var
tarytype
=
CurrrentTrayInfo
.
TrayType
;
remoteLoad
.
RequestLoadInfo
.
TrayType
=
tarytype
.
ToString
();
if
(
tarytype
==
TrayTypeE
.
MTP
1
)
if
(
tarytype
==
TrayTypeE
.
MTP
2
)
remoteLoad
.
RequestLoadInfo
.
DeviceGroupName
=
StoreCID
.
AMH_ML5_1
;
else
remoteLoad
.
RequestLoadInfo
.
DeviceGroupName
=
StoreCID
.
AMH_ML5_2
;
...
...
DeviceLibrary/theMachine/sub/TrayStop.cs
查看文件 @
f8d997d
...
...
@@ -121,7 +121,7 @@ namespace DeviceLibrary
}
break
;
case
MoveStep
.
TrayStop_03
:
if
(
RFID_1
.
ReadByte
(
0x20
,
16
,
out
byte
[]
data
))
if
(
RFID_1
.
ReadByte
(
0x20
,
16
,
out
byte
[]
data
,
out
string
errmsg
))
{
CurrrentRFID
=
Common
.
RfidFilter
(
data
);
TrayManager
.
Process
(
CurrrentRFID
,
DeviceGroup
.
addr_1
,
out
TrayInfo
trayInfo
);
...
...
@@ -174,6 +174,7 @@ namespace DeviceLibrary
{
MoveInfo
.
CanWhileCount
--;
MoveInfo
.
log
(
$
"RFid读取失败,重试第{3 - MoveInfo.CanWhileCount}次"
);
MoveInfo
.
log
(
"RFIDerr:"
+
errmsg
);
MoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitMsg
(
crc
.
GetString
(
"Res0016"
,
"RFid读取失败"
),
MsgLevel
.
warning
));
}
else
...
...
RemoteSheardObject/Class1.cs
查看文件 @
f8d997d
...
...
@@ -50,8 +50,8 @@ public enum RobotStatusE
public
enum
TrayTypeE
{
None
,
MTP1
,
//流水线
治具
托盘
MTP2
,
//流水线
料盘
托盘
MTP1
,
//流水线
料盘
托盘
MTP2
,
//流水线
治具
托盘
S007
,
//料串
M03
,
//Tray料格
M02
,
//PCB料格
...
...
@@ -173,3 +173,18 @@ public enum RemoteResult
False
,
True
}
[Serializable]
public
class
MTP
{
/// <summary>
/// 料盘托盘
/// </summary>
public
static
readonly
string
MTP1
=
"MTP1"
;
/// <summary>
/// 治具托盘
/// </summary>
public
static
readonly
string
MTP2
=
"MTP2"
;
}
\ No newline at end of file
RemoteSheardObject/RemoteSheardObject.csproj
查看文件 @
f8d997d
...
...
@@ -21,6 +21,7 @@
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<DocumentationFile>bin\Debug\RemoteSheardObject.xml</DocumentationFile>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
...
...
TheMachine/UC/RfidControl.cs
查看文件 @
f8d997d
using
DeviceLibrary
;
using
OnlineStore
;
using
OnlineStore.Common
;
using
System
;
using
System.Collections.Generic
;
using
System.ComponentModel
;
...
...
@@ -28,13 +29,13 @@ namespace TheMachine.UC
private
void
button_read_Click
(
object
sender
,
EventArgs
e
)
{
if
(
rFID_C2S1
.
ReadByte
(
0x20
,
16
,
out
byte
[]
data
))
{
if
(
rFID_C2S1
.
ReadByte
(
0x20
,
16
,
out
byte
[]
data
,
out
string
errmsg
))
{
var
rfid
=
Common
.
RfidFilter
(
data
);
textBox_rfidlabel
.
Text
=
rfid
;
}
else
{
LogUtil
.
error
(
"RFIDerr:"
+
errmsg
);
textBox_rfidlabel
.
Text
=
crc
.
GetString
(
"Res0033"
,
"读取失败"
);
}
}
}
}
\ No newline at end of file
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论