Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
张东亮
/
NS200
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
图表
网络
创建新的问题
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit 363fea0d
由
张东亮
编写于
2023-04-10 13:29:49 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
贴标
1 个父辈
232d4f2f
隐藏空白字符变更
内嵌
并排
正在显示
8 个修改的文件
包含
100 行增加
和
130 行删除
DeviceLibrary/AutoScanAndLabel/Common.cs
DeviceLibrary/AutoScanAndLabel/MainMachine _LeftProcess.cs
DeviceLibrary/AutoScanAndLabel/MainMachine _MiddleProcess.cs
DeviceLibrary/AutoScanAndLabel/MainMachine _RightProcess.cs
DeviceLibrary/AutoScanAndLabel/MainMachine.cs
DeviceLibrary/AutoScanAndLabel/MoveStep.cs
DeviceLibrary/Config/Config.csv
LoadCVSLibrary/storeConfig/config/IO_Type.cs
DeviceLibrary/AutoScanAndLabel/Common.cs
查看文件 @
363fea0
...
@@ -43,6 +43,12 @@ namespace DeviceLibrary
...
@@ -43,6 +43,12 @@ namespace DeviceLibrary
return
(
float
)(
Math
.
Acos
(
cosM
)
*
180
/
Math
.
PI
*
k
);
return
(
float
)(
Math
.
Acos
(
cosM
)
*
180
/
Math
.
PI
*
k
);
}
}
/// <summary>
/// 获取以点为中心的角度,-180~180
/// </summary>
/// <param name="pt1"></param>
/// <param name="pt2"></param>
/// <returns></returns>
public
static
double
getAngle
(
Point
pt1
,
Point
pt2
)
public
static
double
getAngle
(
Point
pt1
,
Point
pt2
)
{
{
double
mb_x
=
pt2
.
X
-
pt1
.
X
;
double
mb_x
=
pt2
.
X
-
pt1
.
X
;
...
@@ -173,14 +179,14 @@ namespace DeviceLibrary
...
@@ -173,14 +179,14 @@ namespace DeviceLibrary
labelAngle
=
angles
[
0
]
+
180
;
labelAngle
=
angles
[
0
]
+
180
;
}
}
widthOffset
=
widthOffsets
.
Max
()
;
widthOffset
=
widthOffsets
[
0
]
;
LogUtil
.
info
(
$
"use widthOffset:{widthOffset}"
);
LogUtil
.
info
(
$
"use widthOffset:{widthOffset}"
);
labelAngle
=
labelAngle
>
360
?
labelAngle
-
360
:
labelAngle
;
labelAngle
=
labelAngle
>
360
?
labelAngle
-
360
:
labelAngle
;
labelAngle
=
labelAngle
>
360
?
labelAngle
-
360
:
labelAngle
;
labelAngle
=
labelAngle
>
360
?
labelAngle
-
360
:
labelAngle
;
LogUtil
.
info
(
$
"labelAngle1:{labelAngle}"
);
LogUtil
.
info
(
$
"labelAngle1:{labelAngle}"
);
var
p1
=
PointWithAngle
(
org
,
labelAngle
,
widthOffset
);
var
p1
=
PointWithAngle
(
org
,
labelAngle
,
widthOffset
);
g
.
FillEllipse
(
tmpPlace
,
new
Rectangle
(
p1
,
pointsize
));
g
.
FillEllipse
(
tmpPlace
,
new
Rectangle
(
p1
,
pointsize
));
//匹配照片角度与贴标旋转轴的角度差
//匹配照片角度与贴标旋转轴的角度差
--左右两侧角度
labelAngle
+=
83
;
labelAngle
+=
83
;
LogUtil
.
info
(
$
"labelAngle2:{labelAngle}"
);
LogUtil
.
info
(
$
"labelAngle2:{labelAngle}"
);
//g.FillEllipse(red, new Rectangle(PointRotate(org, op, labelAngle), pointsize));
//g.FillEllipse(red, new Rectangle(PointRotate(org, op, labelAngle), pointsize));
...
@@ -190,12 +196,22 @@ namespace DeviceLibrary
...
@@ -190,12 +196,22 @@ namespace DeviceLibrary
//贴标偏移
//贴标偏移
var
p3
=
PointWithAngle
(
p2
,
labelAngle
,
Label_R_Offset
);
var
p3
=
PointWithAngle
(
p2
,
labelAngle
,
Label_R_Offset
);
labelAngle
-=
83
;
labelAngle
=
labelAngle
>
360
?
labelAngle
-
360
:
labelAngle
;
labelAngle
=
labelAngle
>
360
?
labelAngle
-
360
:
labelAngle
;
labelAngle
=
360
-
labelAngle
;
LogUtil
.
info
(
$
"labelAngle4:{labelAngle}"
);
labelAngle
+=
Label_R_Angle_Diff
;
if
(
labelAngle
<=
180
)
{
labelAngle
=
Label_R_Angle_Diff
-
(
180
-
labelAngle
);
}
else
{
labelAngle
=(
labelAngle
-
180
)
+
Label_R_Angle_Diff
;
}
//labelAngle = 360 - labelAngle;
////贴标位置相对于水平正方向的角度
//LogUtil.info($"labelAngle4:{labelAngle}");
////标签横向位置相对圆心的角度
//labelAngle += Label_R_Angle_Diff;
labelAngle
=
labelAngle
<
0
?
labelAngle
+
360
:
labelAngle
;
labelAngle
=
labelAngle
>
360
?
labelAngle
-
360
:
labelAngle
;
labelAngle
=
labelAngle
>
360
?
labelAngle
-
360
:
labelAngle
;
LogUtil
.
info
(
$
"labelAngle5:{labelAngle}"
);
LogUtil
.
info
(
$
"labelAngle5:{labelAngle}"
);
g
.
FillEllipse
(
yeelow
,
new
Rectangle
(
p3
,
pointsize
));
g
.
FillEllipse
(
yeelow
,
new
Rectangle
(
p3
,
pointsize
));
...
@@ -209,7 +225,7 @@ namespace DeviceLibrary
...
@@ -209,7 +225,7 @@ namespace DeviceLibrary
LabelResult
?.
Invoke
(
new
LabelResult
()
{
Bitmap
=
(
Bitmap
)
bitmap
.
Clone
()
});
LabelResult
?.
Invoke
(
new
LabelResult
()
{
Bitmap
=
(
Bitmap
)
bitmap
.
Clone
()
});
bitmap
.
Dispose
();
bitmap
.
Dispose
();
return
p
3
;
return
p
2
;
}
}
static
IdWorker
id
=
new
IdWorker
(
1
,
1
);
static
IdWorker
id
=
new
IdWorker
(
1
,
1
);
static
string
[]
pnreglist
;
static
string
[]
pnreglist
;
...
...
DeviceLibrary/AutoScanAndLabel/MainMachine _LeftProcess.cs
查看文件 @
363fea0
...
@@ -37,19 +37,20 @@ namespace DeviceLibrary
...
@@ -37,19 +37,20 @@ namespace DeviceLibrary
LeftMoveInfo
.
log
(
$
"批量轴上升到P2位置,二次提升,LeftStartMovePosition={LeftStartMovePosition}"
);
LeftMoveInfo
.
log
(
$
"批量轴上升到P2位置,二次提升,LeftStartMovePosition={LeftStartMovePosition}"
);
break
;
break
;
case
MoveStep
.
L03
:
case
MoveStep
.
L03
:
if
(
IOValue
(
IO_Type
.
LeftOverHead_Check
).
Equals
(
IO_VALUE
.
HIGH
))
//if (IOValue(IO_Type.LeftOverHead_Check).Equals(IO_VALUE.HIGH))
//{
// LeftMoveInfo.NextMoveStep(MoveStep.L02);
// Left_Batch_Axis.AbsMove(LeftMoveInfo, LeftStartMovePosition, Config.Left_Batch_P2_speed);
// LeftMoveInfo.log($"批量轴上升过头,下降到:LeftStartMovePosition={LeftStartMovePosition}");
//}
//else
{
{
LeftMoveInfo
.
NextMoveStep
(
MoveStep
.
L02
);
Left_Batch_Axis
.
AbsMove
(
LeftMoveInfo
,
LeftStartMovePosition
,
Config
.
Left_Batch_P2_speed
);
LeftMoveInfo
.
log
(
$
"批量轴上升过头,下降到:LeftStartMovePosition={LeftStartMovePosition}"
);
}
else
{
LeftMoveInfo
.
NextMoveStep
(
MoveStep
.
L04
);
LeftMoveInfo
.
NextMoveStep
(
MoveStep
.
L04
);
}
}
break
;
break
;
case
MoveStep
.
L04
:
case
MoveStep
.
L04
:
var
currpos
=
Left_Batch_Axis
.
GetAclPosition
()
-
LeftMoveInfo
.
MoveParam
.
HeightPos
;
var
currpos
=
Left_Batch_Axis
.
GetAclPosition
();
if
(
currpos
<
Config
.
Left_Batch_P1
)
if
(
currpos
<
=
Config
.
Left_Batch_P1
)
{
{
//LeftShelfNoTray = true;
//LeftShelfNoTray = true;
LeftMoveInfo
.
NextMoveStep
(
MoveStep
.
L40_ShelfFull
);
LeftMoveInfo
.
NextMoveStep
(
MoveStep
.
L40_ShelfFull
);
...
@@ -63,7 +64,7 @@ namespace DeviceLibrary
...
@@ -63,7 +64,7 @@ namespace DeviceLibrary
}
}
break
;
break
;
case
MoveStep
.
L10_WaitReelPut
:
case
MoveStep
.
L10_WaitReelPut
:
Msg
.
add
(
crc
.
GetString
(
"Res0095"
,
"左侧空闲中"
),
MsgLevel
.
info
);
Msg
.
add
(
crc
.
GetString
(
"Res0095"
,
"左侧空闲中"
),
MsgLevel
.
info
);
break
;
break
;
case
MoveStep
.
L11_ReelPutted
:
case
MoveStep
.
L11_ReelPutted
:
LeftCount
++;
LeftCount
++;
...
@@ -73,23 +74,24 @@ namespace DeviceLibrary
...
@@ -73,23 +74,24 @@ namespace DeviceLibrary
LeftMoveInfo
.
log
(
$
"左侧料盘已放入,批量轴下降"
);
LeftMoveInfo
.
log
(
$
"左侧料盘已放入,批量轴下降"
);
break
;
break
;
case
MoveStep
.
L12
:
case
MoveStep
.
L12
:
if
(
IOValue
(
IO_Type
.
LeftOverHead_Check
).
Equals
(
IO_VALUE
.
HIGH
))
//
if (IOValue(IO_Type.LeftOverHead_Check).Equals(IO_VALUE.HIGH))
{
//
{
LeftMoveInfo
.
NextMoveStep
(
MoveStep
.
L11_ReelPutted
);
//
LeftMoveInfo.NextMoveStep(MoveStep.L11_ReelPutted);
Left_Batch_Axis
.
AbsMove
(
LeftMoveInfo
,
LeftStartMovePosition
,
Config
.
Left_Batch_P2_speed
);
//
Left_Batch_Axis.AbsMove(LeftMoveInfo, LeftStartMovePosition, Config.Left_Batch_P2_speed);
LeftMoveInfo
.
log
(
$
"批量轴上升过头,下降到:LeftStartMovePosition={LeftStartMovePosition}"
);
//
LeftMoveInfo.log($"批量轴上升过头,下降到:LeftStartMovePosition={LeftStartMovePosition}");
}
//
}
else
//
else
{
{
LabelMoveInfo
.
MoveParam
=
LeftMoveInfo
.
MoveParam
.
clone
();
LabelMoveInfo
.
MoveParam
=
LeftMoveInfo
.
MoveParam
.
clone
();
LeftMoveInfo
.
NextMoveStep
(
MoveStep
.
L20_WaitLabel
);
LeftMoveInfo
.
NextMoveStep
(
MoveStep
.
L20_WaitLabel
);
LeftMoveInfo
.
log
(
$
"批量轴完成上升,等待贴标"
);
LeftMoveInfo
.
log
(
$
"批量轴完成上升,等待贴标"
);
}
}
break
;
break
;
case
MoveStep
.
L20_WaitLabel
:
case
MoveStep
.
L20_WaitLabel
:
break
;
break
;
case
MoveStep
.
L30_LabelFinish
:
case
MoveStep
.
L30_LabelFinish
:
if
(
SafeReleaseLeftShelf
)
{
if
(
SafeReleaseLeftShelf
)
{
//LeftShelfNoTray = true;
//LeftShelfNoTray = true;
SafeReleaseLeftShelf
=
false
;
SafeReleaseLeftShelf
=
false
;
LeftMoveInfo
.
NextMoveStep
(
MoveStep
.
L40_ShelfFull
);
LeftMoveInfo
.
NextMoveStep
(
MoveStep
.
L40_ShelfFull
);
...
@@ -98,7 +100,8 @@ namespace DeviceLibrary
...
@@ -98,7 +100,8 @@ namespace DeviceLibrary
else
else
{
{
LeftMoveInfo
.
NextMoveStep
(
MoveStep
.
L04
);
LeftMoveInfo
.
NextMoveStep
(
MoveStep
.
L04
);
LeftMoveInfo
.
log
(
$
"贴标完成,准备下一盘料"
);
LeftBatchAxisToP2
(
false
);
LeftMoveInfo
.
log
(
$
"贴标完成,准备下一盘料,批量轴上升到P2位置,二次提升,LeftStartMovePosition={LeftStartMovePosition}"
);
}
}
break
;
break
;
case
MoveStep
.
L40_ShelfFull
:
case
MoveStep
.
L40_ShelfFull
:
...
@@ -111,10 +114,10 @@ namespace DeviceLibrary
...
@@ -111,10 +114,10 @@ namespace DeviceLibrary
LeftMoveInfo
.
EndMove
();
LeftMoveInfo
.
EndMove
();
LeftMoveInfo
.
log
(
$
"结束运动"
);
LeftMoveInfo
.
log
(
$
"结束运动"
);
break
;
break
;
//}
//}
//料串出料流程
//料串出料流程
//switch (LeftMoveInfo.MoveStep)
//switch (LeftMoveInfo.MoveStep)
//{
//{
case
MoveStep
.
L50_OutShelf
:
case
MoveStep
.
L50_OutShelf
:
LeftMoveInfo
.
NextMoveStep
(
MoveStep
.
L51
);
LeftMoveInfo
.
NextMoveStep
(
MoveStep
.
L51
);
Left_Batch_Axis
.
AbsMove
(
LeftMoveInfo
,
Config
.
Left_Batch_P1
,
Config
.
Left_Batch_P1_speed
);
Left_Batch_Axis
.
AbsMove
(
LeftMoveInfo
,
Config
.
Left_Batch_P1
,
Config
.
Left_Batch_P1_speed
);
...
@@ -149,10 +152,10 @@ namespace DeviceLibrary
...
@@ -149,10 +152,10 @@ namespace DeviceLibrary
IOMove
(
IO_Type
.
LeftMoto_Reverse
,
IO_VALUE
.
HIGH
,
false
,
500
);
IOMove
(
IO_Type
.
LeftMoto_Reverse
,
IO_VALUE
.
HIGH
,
false
,
500
);
LeftMoveInfo
.
log
(
$
"电滚停止"
);
LeftMoveInfo
.
log
(
$
"电滚停止"
);
break
;
break
;
//}
//}
//料串入料流程
//料串入料流程
//switch (LeftMoveInfo.MoveStep)
//switch (LeftMoveInfo.MoveStep)
//{
//{
case
MoveStep
.
L60_InShelf
:
case
MoveStep
.
L60_InShelf
:
LeftMoveInfo
.
NextMoveStep
(
MoveStep
.
L61
);
LeftMoveInfo
.
NextMoveStep
(
MoveStep
.
L61
);
Left_Batch_Axis
.
AbsMove
(
LeftMoveInfo
,
Config
.
Left_Batch_P1
,
Config
.
Left_Batch_P1_speed
);
Left_Batch_Axis
.
AbsMove
(
LeftMoveInfo
,
Config
.
Left_Batch_P1
,
Config
.
Left_Batch_P1_speed
);
...
@@ -206,16 +209,16 @@ namespace DeviceLibrary
...
@@ -206,16 +209,16 @@ namespace DeviceLibrary
string
state
=
""
;
string
state
=
""
;
if
(
IOValue
(
IO_Type
.
LeftEnd_Check
).
Equals
(
IO_VALUE
.
HIGH
))
if
(
IOValue
(
IO_Type
.
LeftEnd_Check
).
Equals
(
IO_VALUE
.
HIGH
))
{
{
state
+=
string
.
Format
(
crc
.
GetString
(
"Res0069"
,
"有料串,已放置{0}张料盘"
),
LeftCount
);
state
+=
string
.
Format
(
crc
.
GetString
(
"Res0069"
,
"有料串,已放置{0}张料盘"
),
LeftCount
);
if
(
LeftShelfNoTray
)
if
(
LeftShelfNoTray
)
state
+=
","
+
crc
.
GetString
(
"Res0043"
,
"料串已满"
);
state
+=
","
+
crc
.
GetString
(
"Res0043"
,
"料串已满"
);
else
else
state
+=
"."
;
state
+=
"."
;
state
+=
crc
.
GetString
(
"Res0045"
,
"当前ReelID:"
)
+
LeftMoveInfo
.
MoveParam
.
WareCode
;
state
+=
crc
.
GetString
(
"Res0045"
,
"当前ReelID:"
)
+
LeftMoveInfo
.
MoveParam
.
WareCode
;
}
}
else
else
{
{
return
crc
.
GetString
(
"Res0046"
,
"无料串"
);
return
crc
.
GetString
(
"Res0046"
,
"无料串"
);
}
}
return
state
;
return
state
;
...
@@ -238,7 +241,7 @@ namespace DeviceLibrary
...
@@ -238,7 +241,7 @@ namespace DeviceLibrary
}
}
LeftMoveInfo
.
log
(
"BatchAxisToP2 目标P2: "
+
targetP2
+
"("
+
currPosition
+
")"
);
LeftMoveInfo
.
log
(
"BatchAxisToP2 目标P2: "
+
targetP2
+
"("
+
currPosition
+
")"
);
}
}
//targetSpeed = Config.BatchAxis_P3Speed / 2
;
targetSpeed
=
Config
.
Left_Batch_P2_speed
/
10
;
}
}
LeftMoveInfo
.
TimeOutSeconds
=
200
;
LeftMoveInfo
.
TimeOutSeconds
=
200
;
LeftMoveInfo
.
CanWhileCount
=
0
;
LeftMoveInfo
.
CanWhileCount
=
0
;
...
@@ -256,7 +259,7 @@ namespace DeviceLibrary
...
@@ -256,7 +259,7 @@ namespace DeviceLibrary
void
LeftBatchAxisToP1
()
void
LeftBatchAxisToP1
()
{
{
int
targetP1
=
Config
.
Left_Batch_P1
;
int
targetP1
=
Config
.
Left_Batch_P1
;
int
targetSpeed
=
Config
.
Left_Batch_P2_speed
/
10
;
int
targetSpeed
=
Config
.
Left_Batch_P2_speed
/
10
;
LeftMoveInfo
.
TimeOutSeconds
=
200
;
LeftMoveInfo
.
TimeOutSeconds
=
200
;
LeftMoveInfo
.
CanWhileCount
=
0
;
LeftMoveInfo
.
CanWhileCount
=
0
;
...
...
DeviceLibrary/AutoScanAndLabel/MainMachine _MiddleProcess.cs
查看文件 @
363fea0
...
@@ -100,20 +100,16 @@ namespace DeviceLibrary
...
@@ -100,20 +100,16 @@ namespace DeviceLibrary
}
}
//等待右侧料串计算盘高
//等待右侧料串计算盘高
//else if (RightMoveInfo.MoveStep >= MoveStep.R06_GettedReelHigh && RightMoveInfo.MoveStep <= MoveStep.R10_WaitReelLeave)
//else if (RightMoveInfo.MoveStep >= MoveStep.R06_GettedReelHigh && RightMoveInfo.MoveStep <= MoveStep.R10_WaitReelLeave)
else
if
(
LastHeightPos
>
0
)
else
//
if (LastHeightPos > 0)
{
{
MiddleMoveInfo
.
NextMoveStep
(
MoveStep
.
M07
);
MiddleMoveInfo
.
NextMoveStep
(
MoveStep
.
M07
);
MiddleMoveInfo
.
MoveParam
.
PlateH
=
LastHeight
;
MiddleMoveInfo
.
log
(
$
"开始往左侧料串移栽,{MiddleMoveInfo.MoveParam.ToStr()}"
);
MiddleMoveInfo
.
MoveParam
.
HeightPos
=
LastHeightPos
;
LastHeightPos
=
0
;
MiddleMoveInfo
.
NextMoveStep
(
MoveStep
.
M07
);
MiddleMoveInfo
.
log
(
$
"已获取盘高,开始往左侧料串移栽,{MiddleMoveInfo.MoveParam.ToStr()}"
);
}
}
else
if
(
MiddleMoveInfo
.
IsTimeOut
(
60
))
//
else if (MiddleMoveInfo.IsTimeOut(60))
{
//
{
MiddleMoveInfo
.
log
(
"等待计算盘高"
);
//
MiddleMoveInfo.log("等待计算盘高");
}
//
}
break
;
break
;
case
MoveStep
.
M07
:
case
MoveStep
.
M07
:
if
(!
Take_Middle_Axis
.
IsSafe
(
Config
.
Take_Middle_P3
,
out
string
msg
))
if
(!
Take_Middle_Axis
.
IsSafe
(
Config
.
Take_Middle_P3
,
out
string
msg
))
...
...
DeviceLibrary/AutoScanAndLabel/MainMachine _RightProcess.cs
查看文件 @
363fea0
...
@@ -38,13 +38,13 @@ namespace DeviceLibrary
...
@@ -38,13 +38,13 @@ namespace DeviceLibrary
RightMoveInfo
.
log
(
$
"批量轴上升到P2位置,二次提升,RightStartMovePosition={RightStartMovePosition}"
);
RightMoveInfo
.
log
(
$
"批量轴上升到P2位置,二次提升,RightStartMovePosition={RightStartMovePosition}"
);
break
;
break
;
case
MoveStep
.
R03
:
case
MoveStep
.
R03
:
if
(
IOValue
(
IO_Type
.
RightOverHead_Check
).
Equals
(
IO_VALUE
.
HIGH
))
//
if (IOValue(IO_Type.RightOverHead_Check).Equals(IO_VALUE.HIGH))
{
//
{
RightMoveInfo
.
NextMoveStep
(
MoveStep
.
R02
);
//
RightMoveInfo.NextMoveStep(MoveStep.R02);
Right_Batch_Axis
.
AbsMove
(
RightMoveInfo
,
RightStartMovePosition
,
Config
.
Right_Batch_P2_speed
);
//
Right_Batch_Axis.AbsMove(RightMoveInfo, RightStartMovePosition, Config.Right_Batch_P2_speed);
RightMoveInfo
.
log
(
$
"批量轴上升过头,下降到:RightStartMovePosition={RightStartMovePosition}"
);
//
RightMoveInfo.log($"批量轴上升过头,下降到:RightStartMovePosition={RightStartMovePosition}");
}
//
}
else
//
else
{
{
RightMoveInfo
.
NextMoveStep
(
MoveStep
.
R04
);
RightMoveInfo
.
NextMoveStep
(
MoveStep
.
R04
);
}
}
...
@@ -54,10 +54,10 @@ namespace DeviceLibrary
...
@@ -54,10 +54,10 @@ namespace DeviceLibrary
{
{
if
(
MiddleMoveInfo
.
MoveStep
>=
MoveStep
.
M09
||
MiddleMoveInfo
.
MoveStep
<
MoveStep
.
M02
)
if
(
MiddleMoveInfo
.
MoveStep
>=
MoveStep
.
M09
||
MiddleMoveInfo
.
MoveStep
<
MoveStep
.
M02
)
{
{
RightMoveInfo
.
NextMoveStep
(
MoveStep
.
R06_GettedReel
High
);
RightMoveInfo
.
NextMoveStep
(
MoveStep
.
R06_GettedReel
Info
);
GetHeight
();
//
GetHeight();
ScanCode
();
ScanCode
();
RightMoveInfo
.
log
(
$
"开始扫码
,并获取上一盘料高度,LastHeight={LastHeight}"
);
RightMoveInfo
.
log
(
$
"开始扫码
"
);
//并获取上一盘料高度,LastHeight={LastHeight}
}
}
}
}
else
else
...
@@ -82,7 +82,7 @@ namespace DeviceLibrary
...
@@ -82,7 +82,7 @@ namespace DeviceLibrary
RightMoveInfo
.
log
(
$
"批量轴已上升到顶,料串已空."
);
RightMoveInfo
.
log
(
$
"批量轴已上升到顶,料串已空."
);
}
}
break
;
break
;
case
MoveStep
.
R06_GettedReel
High
:
case
MoveStep
.
R06_GettedReel
Info
:
if
(
RightScanTask
.
IsCompleted
)
if
(
RightScanTask
.
IsCompleted
)
{
{
var
(
x
,
k
,
s
)
=
RightScanTask
.
Result
;
var
(
x
,
k
,
s
)
=
RightScanTask
.
Result
;
...
@@ -334,58 +334,6 @@ namespace DeviceLibrary
...
@@ -334,58 +334,6 @@ namespace DeviceLibrary
Right_Batch_Axis
.
BatchAxisStartCheck
(
IO_Type
.
RightTop_Check
,
IO_VALUE
.
HIGH
);
Right_Batch_Axis
.
BatchAxisStartCheck
(
IO_Type
.
RightTop_Check
,
IO_VALUE
.
HIGH
);
}
}
int
RightEndMovePosition
=
0
;
int
RightEndMovePosition
=
0
;
int
LastHeight
=
0
;
int
LastHeightPos
=
0
;
private
int
GetHeight
()
{
LastHeight
=
0
;
LastHeightPos
=
0
;
int
AxisChangeValue
=
Config
.
Right_Batch_ChangeValue
;
//计算高度
RightEndMovePosition
=
Right_Batch_Axis
.
GetAclPosition
();
bool
isLast
=
false
;
int
chaz
=
Math
.
Abs
(
RightEndMovePosition
-
Config
.
Right_Batch_P2
);
if
(
chaz
<
Right_Batch_Axis
.
Config
.
CanErrorCountMax
)
{
isLast
=
true
;
}
float
height
=
(
float
)
Math
.
Ceiling
(
1F
*
Math
.
Abs
(
RightEndMovePosition
-
RightStartMovePosition
)
/
AxisChangeValue
);
LastHeightPos
=
Math
.
Abs
(
RightEndMovePosition
-
RightStartMovePosition
);
string
buchongStr
=
""
;
if
(
isLast
)
{
buchongStr
=
$
"(最后一盘料已补充5)"
;
height
+=
5
;
}
//如果检测出<=15,都按照8计算
if
(
height
<=
15
)
{
LastHeight
=
8
;
}
else
{
List
<
int
>
heightList
=
new
List
<
int
>
{
8
,
12
,
16
,
20
};
heightList
=
(
from
m
in
heightList
orderby
m
descending
select
m
).
ToList
<
int
>();
float
minCha
=
height
;
foreach
(
int
h
in
heightList
)
{
//取差值最小的接近值
float
cha
=
Math
.
Abs
(
h
-
(
height
-
4
));
if
(
cha
<
minCha
)
{
LastHeight
=
h
;
minCha
=
cha
;
}
}
}
if
(
LastHeight
<=
8
)
{
LastHeight
=
8
;
}
string
msg
=
Name
+
$
" 计算盘高:上升前 [{RightStartMovePosition}]实时[{RightEndMovePosition}]差值[{(RightEndMovePosition - RightStartMovePosition)}]系数[{AxisChangeValue}] 计算后{buchongStr}[{height}],归类为【{LastHeight}mm】"
;
LogUtil
.
info
(
msg
);
return
LastHeight
;
}
}
}
}
}
\ No newline at end of file
\ No newline at end of file
DeviceLibrary/AutoScanAndLabel/MainMachine.cs
查看文件 @
363fea0
...
@@ -68,9 +68,9 @@ namespace DeviceLibrary
...
@@ -68,9 +68,9 @@ namespace DeviceLibrary
/// </summary>
/// </summary>
public
bool
isInSuddenDown
=
false
;
public
bool
isInSuddenDown
=
false
;
public
ServerCommunication
ServerCM
;
public
ServerCommunication
ServerCM
;
DeviceLib
.
WebApi
.
HttpService
agvService
=
new
DeviceLib
.
WebApi
.
HttpService
(
ConfigHelper
.
Config
.
Get
(
"AGVService_Port"
,
8088
));
DeviceLib
.
WebApi
.
HttpService
agvService
=
new
DeviceLib
.
WebApi
.
HttpService
(
ConfigHelper
.
Config
.
Get
(
"AGVService_Port"
,
8088
));
public
MainMachine
(
Robot_Config
_config
)
public
MainMachine
(
Robot_Config
_config
)
{
{
Config
=
_config
;
Config
=
_config
;
...
@@ -315,8 +315,11 @@ namespace DeviceLibrary
...
@@ -315,8 +315,11 @@ namespace DeviceLibrary
break
;
break
;
}
}
}
}
bool
isAgvRun
{
get
=>
LeftMoveInfo
.
MoveStep
>=
MoveStep
.
L60_InShelf
||
LeftMoveInfo
.
MoveStep
>=
MoveStep
.
L50_OutShelf
bool
isAgvRun
||
RightMoveInfo
.
MoveStep
>=
MoveStep
.
R30_OutShelf
||
RightMoveInfo
.
MoveStep
>=
MoveStep
.
R40_InShelf
;
}
{
get
=>
LeftMoveInfo
.
MoveStep
>=
MoveStep
.
L60_InShelf
||
LeftMoveInfo
.
MoveStep
>=
MoveStep
.
L50_OutShelf
||
RightMoveInfo
.
MoveStep
>=
MoveStep
.
R30_OutShelf
||
RightMoveInfo
.
MoveStep
>=
MoveStep
.
R40_InShelf
;
}
public
bool
IgnoreSafecheck
=
false
;
public
bool
IgnoreSafecheck
=
false
;
public
bool
IgnoreGratingSignal
=
false
;
public
bool
IgnoreGratingSignal
=
false
;
...
@@ -361,15 +364,19 @@ namespace DeviceLibrary
...
@@ -361,15 +364,19 @@ namespace DeviceLibrary
}
}
Msg
.
add
(
crc
.
GetString
(
"Res0064"
,
"左后门没有关闭"
)
+
(
ok
?
crc
.
GetString
(
"Res0061"
,
"[已忽略]"
)
:
""
),
MsgLevel
.
warning
);
Msg
.
add
(
crc
.
GetString
(
"Res0064"
,
"左后门没有关闭"
)
+
(
ok
?
crc
.
GetString
(
"Res0061"
,
"[已忽略]"
)
:
""
),
MsgLevel
.
warning
);
}
}
if
(
IOValue
(
IO_Type
.
RightBackDoor_Check
).
Equals
(
IO_VALUE
.
LOW
))
if
(
Config
.
DIList
.
ContainsKey
(
IO_Type
.
RightBackDoor_Check
))
{
{
if
(
!
IgnoreSafecheck
)
if
(
IOValue
(
IO_Type
.
RightBackDoor_Check
).
Equals
(
IO_VALUE
.
LOW
)
)
{
{
ok
=
false
;
if
(!
IgnoreSafecheck
)
DeviceSuddenStop
();
{
ok
=
false
;
DeviceSuddenStop
();
}
Msg
.
add
(
crc
.
GetString
(
"Res0065"
,
"右后门没有关闭"
)
+
(
ok
?
crc
.
GetString
(
"Res0061"
,
"[已忽略]"
)
:
""
),
MsgLevel
.
warning
);
}
}
Msg
.
add
(
crc
.
GetString
(
"Res0065"
,
"右后门没有关闭"
)
+
(
ok
?
crc
.
GetString
(
"Res0061"
,
"[已忽略]"
)
:
""
),
MsgLevel
.
warning
);
}
}
lastSafeCheckStatus
=
ok
;
lastSafeCheckStatus
=
ok
;
return
ok
;
return
ok
;
}
}
...
...
DeviceLibrary/AutoScanAndLabel/MoveStep.cs
查看文件 @
363fea0
...
@@ -27,7 +27,7 @@ namespace DeviceLibrary
...
@@ -27,7 +27,7 @@ namespace DeviceLibrary
R03
,
R03
,
R04
,
R04
,
R05
,
R05
,
R06_GettedReel
High
,
//获取料盘高度
R06_GettedReel
Info
,
//获取料盘高度
R07
,
R07
,
R08
,
R08
,
R10_WaitReelLeave
,
//等待料盘离开
R10_WaitReelLeave
,
//等待料盘离开
...
...
DeviceLibrary/Config/Config.csv
查看文件 @
363fea0
...
@@ -63,7 +63,7 @@ DI,0,急停,SuddenStop_BTN,0,HC,X00,,,,,,,,,,
...
@@ -63,7 +63,7 @@ DI,0,急停,SuddenStop_BTN,0,HC,X00,,,,,,,,,,
DI,0,进料口确认按钮,Right_BTN,1,HC,X01,,,,,,,,,,
DI,0,进料口确认按钮,Right_BTN,1,HC,X01,,,,,,,,,,
DI,0,出料口确认按钮,Left_BTN,2,HC,X02,,,,,,,,,,
DI,0,出料口确认按钮,Left_BTN,2,HC,X02,,,,,,,,,,
DI,0,后门左门禁,LeftBackDoor_Check,3,HC,X03,,,,,,,,,,
DI,0,后门左门禁,LeftBackDoor_Check,3,HC,X03,,,,,,,,,,
DI
,0,后门右门禁,RightBackDoor_Check,4,HC,X04,,,,,,,,,,
,0,后门右门禁,RightBackDoor_Check,4,HC,X04,,,,,,,,,,
DI,0,气压检测,Airpressure_Check,5,HC,X05,,,,,,,,,,
DI,0,气压检测,Airpressure_Check,5,HC,X05,,,,,,,,,,
DI,0,光栅信号,GratingSignal_Check,6,HC,X06,,,,,,,,,,
DI,0,光栅信号,GratingSignal_Check,6,HC,X06,,,,,,,,,,
DI,0,NG料箱检测,HasNgBox,7,HC,X07,,,,,,,,,,
DI,0,NG料箱检测,HasNgBox,7,HC,X07,,,,,,,,,,
...
@@ -81,9 +81,9 @@ DI,0,出料口料串到位检测,LeftEnd_Check,18,HC,X18,,,,,,,,,,
...
@@ -81,9 +81,9 @@ DI,0,出料口料串到位检测,LeftEnd_Check,18,HC,X18,,,,,,,,,,
DI,0,出料口阻挡气缸上升端,LeftStopUP,19,HC,X19,,,,,,,,,,
DI,0,出料口阻挡气缸上升端,LeftStopUP,19,HC,X19,,,,,,,,,,
DI,0,出料口阻挡气缸下降端,LeftStopDown,20,HC,X20,,,,,,,,,,
DI,0,出料口阻挡气缸下降端,LeftStopDown,20,HC,X20,,,,,,,,,,
DI,0,进料定位料盘检测,RightTop_Check,21,HC,X21,,,,,,,,,,
DI,0,进料定位料盘检测,RightTop_Check,21,HC,X21,,,,,,,,,,
DI
,0,进料定位料盘超限检测,RightOverHead_Check,22,HC,X22,,,,,,,,,,
,0,进料定位料盘超限检测,RightOverHead_Check,22,HC,X22,,,,,,,,,,
DI,0,出料定位料盘检测,LeftTop_Check,23,HC,X23,,,,,,,,,,
DI,0,出料定位料盘检测,LeftTop_Check,23,HC,X23,,,,,,,,,,
DI
,0,出料定位料盘超限检测,LeftOverHead_Check,24,HC,X24,,,,,,,,,,
,0,出料定位料盘超限检测,LeftOverHead_Check,24,HC,X24,,,,,,,,,,
DI,0,吸嘴气缸前进端,LabelCylinder_Fwd,25,HC,X25,,,,,,,,,,
DI,0,吸嘴气缸前进端,LabelCylinder_Fwd,25,HC,X25,,,,,,,,,,
DI,0,吸嘴气缸后退端,LabelCylinder_Bck,26,HC,X26,,,,,,,,,,
DI,0,吸嘴气缸后退端,LabelCylinder_Bck,26,HC,X26,,,,,,,,,,
DI,0,吸盘压力检测,TraySize_7,27,HC,X27,,,,,,,,,,
DI,0,吸盘压力检测,TraySize_7,27,HC,X27,,,,,,,,,,
...
...
LoadCVSLibrary/storeConfig/config/IO_Type.cs
查看文件 @
363fea0
...
@@ -116,17 +116,17 @@ namespace OnlineStore.LoadCSVLibrary
...
@@ -116,17 +116,17 @@ namespace OnlineStore.LoadCSVLibrary
/// </summary>
/// </summary>
public
static
string
RightTop_Check
=
"RightTop_Check"
;
public
static
string
RightTop_Check
=
"RightTop_Check"
;
/// <summary>
/// <summary>
/// DI,0,进料定位料盘超限检测,RightOverHead_Check,22,HC,X22,,,,,,,,,,
/// DI,0,进料定位料盘超限检测,RightOverHead_Check,22,HC,X22,,,,,,,,,,
--不用
/// </summary>
/// </summary>
public
static
string
RightOverHead_Check
=
"RightOverHead_Check"
;
//
public static string RightOverHead_Check = "RightOverHead_Check";
/// <summary>
/// <summary>
/// DI,0,出料定位料盘检测,LeftTop_Check,23,HC,X23,,,,,,,,,,
/// DI,0,出料定位料盘检测,LeftTop_Check,23,HC,X23,,,,,,,,,,
/// </summary>
/// </summary>
public
static
string
LeftTop_Check
=
"LeftTop_Check"
;
public
static
string
LeftTop_Check
=
"LeftTop_Check"
;
/// <summary>
/// <summary>
/// DI,0,出料定位料盘超限检测,LeftOverHead_Check,24,HC,X24,,,,,,,,,,
/// DI,0,出料定位料盘超限检测,LeftOverHead_Check,24,HC,X24,,,,,,,,,,
--不用
/// </summary>
/// </summary>
public
static
string
LeftOverHead_Check
=
"LeftOverHead_Check"
;
//
public static string LeftOverHead_Check = "LeftOverHead_Check";
/// <summary>
/// <summary>
/// DI,0,吸嘴气缸前进端,LabelCylinder_Fwd,25,HC,X25,,,,,,,,,,
/// DI,0,吸嘴气缸前进端,LabelCylinder_Fwd,25,HC,X25,,,,,,,,,,
/// </summary>
/// </summary>
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论