Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
刘韬
/
SO1196_X800
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit f38a5be1
由
刘韬
编写于
2024-03-28 09:26:03 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
1
1 个父辈
9d5f1ef3
全部展开
隐藏空白字符变更
内嵌
并排
正在显示
13 个修改的文件
包含
119 行增加
和
52 行删除
DeviceLibrary/DeviceLibrary/AxisBean.cs
DeviceLibrary/DeviceLibrary/PrinterHelper.cs
DeviceLibrary/theMachine/MainMachine _Common.cs
DeviceLibrary/theMachine/MainMachine.cs
DeviceLibrary/theMachine/MainMachine_Counting.cs
DeviceLibrary/theMachine/MainMachine_InMove.cs
DeviceLibrary/theMachine/MainMachine_OutCar.cs
DeviceLibrary/theMachine/MainMachine_OutMove.cs
SO20117_AutoCountAndLabel.sln → SO1196_AutoCountAndLabel.sln
TheMachine/Form1.Designer.cs
TheMachine/Form1.cs
TheMachine/Program.cs
TheMachine/UC/CylinderButton.cs
DeviceLibrary/DeviceLibrary/AxisBean.cs
查看文件 @
f38a5be
...
@@ -341,7 +341,7 @@ namespace DeviceLibrary
...
@@ -341,7 +341,7 @@ namespace DeviceLibrary
#
region
匀速上升处理
#
region
匀速上升处理
private
System
.
Timers
.
Timer
axisCheckTimer
=
null
;
private
System
.
Timers
.
Timer
axisCheckTimer
=
null
;
internal
string
[]
TargetIoType
=
new
string
[]
{
};
internal
string
[]
TargetIoType
=
new
string
[]
{
};
internal
IO_VALUE
TargetIoValue
=
IO_VALUE
.
HIGH
;
internal
volatile
IO_VALUE
TargetIoValue
=
IO_VALUE
.
HIGH
;
public
bool
BatchAxisStartCheck
(
string
[]
targetIo
,
IO_VALUE
value
=
IO_VALUE
.
HIGH
)
public
bool
BatchAxisStartCheck
(
string
[]
targetIo
,
IO_VALUE
value
=
IO_VALUE
.
HIGH
)
{
{
if
(
axisCheckTimer
==
null
)
if
(
axisCheckTimer
==
null
)
...
@@ -365,6 +365,7 @@ namespace DeviceLibrary
...
@@ -365,6 +365,7 @@ namespace DeviceLibrary
{
{
axisCheckTimer
.
Stop
();
axisCheckTimer
.
Stop
();
}
}
TargetIoValue
=
IO_VALUE
.
None
;
return
true
;
return
true
;
}
}
private
bool
IsInProcess
=
false
;
private
bool
IsInProcess
=
false
;
...
@@ -378,9 +379,9 @@ namespace DeviceLibrary
...
@@ -378,9 +379,9 @@ namespace DeviceLibrary
{
{
if
(
IOManager
.
IOValue
(
io
).
Equals
(
TargetIoValue
))
if
(
IOManager
.
IOValue
(
io
).
Equals
(
TargetIoValue
))
{
{
SuddenStop
();
SuddenStop
();
StopAxisCheckMove
();
LogUtil
.
info
(
AxisName
+
"上料轴,检测到 "
+
io
+
"="
+
TargetIoValue
+
",停止运动"
);
LogUtil
.
info
(
AxisName
+
"上料轴,检测到 "
+
io
+
"="
+
TargetIoValue
+
",停止运动"
);
StopAxisCheckMove
();
break
;
break
;
}
}
}
}
...
...
DeviceLibrary/DeviceLibrary/PrinterHelper.cs
查看文件 @
f38a5be
...
@@ -61,6 +61,7 @@ namespace DeviceLibrary
...
@@ -61,6 +61,7 @@ namespace DeviceLibrary
print
.
LoadLabel
(
labelname
);
print
.
LoadLabel
(
labelname
);
var
bmp
=
print
.
PrintPreview
(
data
);
var
bmp
=
print
.
PrintPreview
(
data
);
//print.Print(data);
if
(!
zebraManger
.
PrintImage
(
bmp
,
out
msg
))
if
(!
zebraManger
.
PrintImage
(
bmp
,
out
msg
))
{
{
LogUtil
.
error
(
msg
);
LogUtil
.
error
(
msg
);
...
...
DeviceLibrary/theMachine/MainMachine _Common.cs
查看文件 @
f38a5be
...
@@ -122,37 +122,46 @@ namespace DeviceLibrary
...
@@ -122,37 +122,46 @@ namespace DeviceLibrary
else
if
(
wait
.
WaitType
.
Equals
(
WaitEnum
.
W008_BatchAxis
))
else
if
(
wait
.
WaitType
.
Equals
(
WaitEnum
.
W008_BatchAxis
))
{
{
AxisBean
axisBean
=
AxisBean
.
List
.
Find
(
a
=>
a
.
Config
.
GetAxisValue
()
==
wait
.
AxisInfo
.
GetAxisValue
());
AxisBean
axisBean
=
AxisBean
.
List
.
Find
(
a
=>
a
.
Config
.
GetAxisValue
()
==
wait
.
AxisInfo
.
GetAxisValue
());
//等待信号亮或者走到绝对位置才停止
if
(
axisBean
.
TargetIoValue
==
IO_VALUE
.
None
)
var
tio
=
axisBean
.
TargetIoType
.
Where
(
io
=>
{
return
IOValue
(
io
).
Equals
(
axisBean
.
TargetIoValue
);
});
if
(
tio
.
Count
()>
0
)
{
{
LogUtil
.
info
(
Name
+
"CheckWaitResult 检测到"
+
string
.
Join
(
","
,
tio
.
ToArray
())
+
"="
+
axisBean
.
TargetIoValue
+
",停止运行"
);
axisBean
.
StopAxisCheckMove
();
if
(
AxisManager
.
GetBusyStatus
(
wait
.
AxisInfo
.
DeviceName
,
wait
.
AxisInfo
.
GetAxisValue
()).
Equals
(
1
))
{
axisBean
.
SuddenStop
();
}
wait
.
IsEnd
=
true
;
wait
.
IsEnd
=
true
;
axisBean
.
SuddenStop
();
LogUtil
.
info
(
Name
+
"axisCheckTimer 已经结束,停止运行"
);
}
}
else
else
{
{
bool
isbusy
=
AxisManager
.
GetBusyStatus
(
wait
.
AxisInfo
.
DeviceName
,
wait
.
AxisInfo
.
GetAxisValue
()).
Equals
(
1
);
//等待信号亮或者走到绝对位置才停止
if
(!
isbusy
)
var
tio
=
axisBean
.
TargetIoType
.
Where
(
io
=>
{
return
IOValue
(
io
).
Equals
(
axisBean
.
TargetIoValue
);
});
if
(
tio
.
Count
()
>
0
)
{
{
int
outCount
=
AxisManager
.
GetActualtPosition
(
wait
.
AxisInfo
.
DeviceName
,
wait
.
AxisInfo
.
GetAxisValue
());
LogUtil
.
info
(
Name
+
"CheckWaitResult 检测到"
+
string
.
Join
(
","
,
tio
.
ToArray
())
+
"="
+
axisBean
.
TargetIoValue
+
",停止运行"
);
LogUtil
.
info
(
$
"{wait.AxisInfo.Explain},当前位置:{outCount}"
);
axisBean
.
StopAxisCheckMove
();
int
errorCount
=
Math
.
Abs
(
outCount
-
wait
.
TargetPosition
);
if
(
AxisManager
.
GetBusyStatus
(
wait
.
AxisInfo
.
DeviceName
,
wait
.
AxisInfo
.
GetAxisValue
()).
Equals
(
1
))
if
(
errorCount
<=
wait
.
AxisInfo
.
CanErrorCountMax
)
{
{
LogUtil
.
info
(
$
"{wait.AxisInfo.Explain},到达目标:errorCount:{errorCount},停止上升"
);
axisBean
.
SuddenStop
();
axisBean
.
StopAxisCheckMove
();
wait
.
IsEnd
=
true
;
}
}
else
wait
.
IsEnd
=
true
;
}
else
{
bool
isbusy
=
AxisManager
.
GetBusyStatus
(
wait
.
AxisInfo
.
DeviceName
,
wait
.
AxisInfo
.
GetAxisValue
()).
Equals
(
1
);
if
(!
isbusy
&&
axisBean
.
TargetIoValue
!=
IO_VALUE
.
None
)
{
{
LogUtil
.
info
(
$
"{wait.AxisInfo.Explain},继续上升:{wait.TargetPosition}"
);
int
outCount
=
AxisManager
.
GetActualtPosition
(
wait
.
AxisInfo
.
DeviceName
,
wait
.
AxisInfo
.
GetAxisValue
());
axisBean
.
AbsMove
(
null
,
wait
.
TargetPosition
,
wait
.
TargetSpeed
);
LogUtil
.
info
(
$
"{wait.AxisInfo.Explain},当前位置:{outCount}"
);
wait
.
IsEnd
=
false
;
int
errorCount
=
Math
.
Abs
(
outCount
-
wait
.
TargetPosition
);
if
(
errorCount
<=
wait
.
AxisInfo
.
CanErrorCountMax
)
{
LogUtil
.
info
(
$
"{wait.AxisInfo.Explain},到达目标:errorCount:{errorCount},停止上升"
);
axisBean
.
StopAxisCheckMove
();
wait
.
IsEnd
=
true
;
}
else
{
LogUtil
.
info
(
$
"{wait.AxisInfo.Explain},继续上升:{wait.TargetPosition}"
);
axisBean
.
AbsMove
(
null
,
wait
.
TargetPosition
,
wait
.
TargetSpeed
);
wait
.
IsEnd
=
false
;
}
}
}
}
}
}
}
...
...
DeviceLibrary/theMachine/MainMachine.cs
查看文件 @
f38a5be
...
@@ -358,7 +358,7 @@ namespace DeviceLibrary
...
@@ -358,7 +358,7 @@ namespace DeviceLibrary
ResetMoveInfo
.
log
(
"小车批量轴, 贴标z轴回原"
);
ResetMoveInfo
.
log
(
"小车批量轴, 贴标z轴回原"
);
Loading_Batch_Axis
.
HomeMove
(
null
,
forceHome
);
Loading_Batch_Axis
.
HomeMove
(
null
,
forceHome
);
Unloading_Batch_Axis
.
HomeMove
(
null
,
forceHome
);
Unloading_Batch_Axis
.
HomeMove
(
null
,
forceHome
);
Label_Z_Axis
.
HomeMove
(
ResetMoveInfo
,
forceHome
);
Label_Z_Axis
.
HomeMove
(
null
,
forceHome
);
GrabImageEX
();
GrabImageEX
();
break
;
break
;
case
MoveStep
.
H02_HomeReset_02
:
case
MoveStep
.
H02_HomeReset_02
:
...
@@ -366,6 +366,7 @@ namespace DeviceLibrary
...
@@ -366,6 +366,7 @@ namespace DeviceLibrary
ResetMoveInfo
.
log
(
"2侧升降轴回原"
);
ResetMoveInfo
.
log
(
"2侧升降轴回原"
);
Loading_UpDown_Axis
.
HomeMove
(
ResetMoveInfo
,
forceHome
);
Loading_UpDown_Axis
.
HomeMove
(
ResetMoveInfo
,
forceHome
);
Unloading_UpDown_Axis
.
HomeMove
(
ResetMoveInfo
,
forceHome
);
Unloading_UpDown_Axis
.
HomeMove
(
ResetMoveInfo
,
forceHome
);
Label_Z_Axis
.
HomeMove
(
ResetMoveInfo
,
forceHome
);
break
;
break
;
case
MoveStep
.
H02_HomeReset
:
case
MoveStep
.
H02_HomeReset
:
ResetMoveInfo
.
NextMoveStep
(
MoveStep
.
H02_HomeReset_1
);
ResetMoveInfo
.
NextMoveStep
(
MoveStep
.
H02_HomeReset_1
);
...
@@ -387,13 +388,15 @@ namespace DeviceLibrary
...
@@ -387,13 +388,15 @@ namespace DeviceLibrary
case
MoveStep
.
H03_HomeReset
:
case
MoveStep
.
H03_HomeReset
:
ResetMoveInfo
.
NextMoveStep
(
MoveStep
.
H04_HomeReset
);
ResetMoveInfo
.
NextMoveStep
(
MoveStep
.
H04_HomeReset
);
ResetMoveInfo
.
log
(
"2侧旋转轴回原"
);
ResetMoveInfo
.
log
(
"2侧旋转轴回原"
);
Loading_Middle_Axis
.
HomeMove
(
ResetMoveInfo
,
forceHome
);
Loading_Middle_Axis
.
HomeMove
(
null
,
forceHome
);
Unloading_Middle_Axis
.
HomeMove
(
ResetMoveInfo
,
forceHome
);
Unloading_Middle_Axis
.
HomeMove
(
null
,
forceHome
);
break
;
break
;
case
MoveStep
.
H04_HomeReset
:
case
MoveStep
.
H04_HomeReset
:
ResetMoveInfo
.
NextMoveStep
(
MoveStep
.
H05_HomeReset
);
ResetMoveInfo
.
NextMoveStep
(
MoveStep
.
H05_HomeReset
);
Loading_Batch_Axis
.
HomeMove
(
ResetMoveInfo
,
forceHome
);
Loading_Batch_Axis
.
HomeMove
(
ResetMoveInfo
,
forceHome
);
Unloading_Batch_Axis
.
HomeMove
(
ResetMoveInfo
,
forceHome
);
Unloading_Batch_Axis
.
HomeMove
(
ResetMoveInfo
,
forceHome
);
Loading_Middle_Axis
.
HomeMove
(
ResetMoveInfo
,
forceHome
);
Unloading_Middle_Axis
.
HomeMove
(
ResetMoveInfo
,
forceHome
);
break
;
break
;
case
MoveStep
.
H05_HomeReset
:
case
MoveStep
.
H05_HomeReset
:
ResetMoveInfo
.
NextMoveStep
(
MoveStep
.
H06_HomeReset
);
ResetMoveInfo
.
NextMoveStep
(
MoveStep
.
H06_HomeReset
);
...
...
DeviceLibrary/theMachine/MainMachine_Counting.cs
查看文件 @
f38a5be
...
@@ -271,13 +271,13 @@ namespace DeviceLibrary
...
@@ -271,13 +271,13 @@ namespace DeviceLibrary
CountMoveInfo
.
log
(
"料盘已取走"
);
CountMoveInfo
.
log
(
"料盘已取走"
);
break
;
break
;
case
MoveStep
.
Count_20
:
case
MoveStep
.
Count_20
:
if
(
IOValue
(
IO_Type
.
Counting_ExitDoor_Close
).
Equals
(
IO_VALUE
.
HIGH
)
||
OutMoveInfo
.
MoveStep
>=
MoveStep
.
Out_03
)
if
(
OutMoveInfo
.
MoveStep
>=
MoveStep
.
Out_09
)
{
{
CountMoveInfo
.
NextMoveStep
(
MoveStep
.
Count_21
);
CountMoveInfo
.
NextMoveStep
(
MoveStep
.
Count_21
);
CountMoveInfo
.
log
(
"
出口门已关闭
"
);
CountMoveInfo
.
log
(
"
料盘已取走
"
);
}
}
else
if
(
CountMoveInfo
.
IsTimeOut
(
60
))
{
else
if
(
CountMoveInfo
.
IsTimeOut
(
60
))
{
CountMoveInfo
.
log
(
"等待
出口门关闭
"
);
CountMoveInfo
.
log
(
"等待
料盘取走超时
"
);
}
}
break
;
break
;
case
MoveStep
.
Count_21
:
case
MoveStep
.
Count_21
:
...
...
DeviceLibrary/theMachine/MainMachine_InMove.cs
查看文件 @
f38a5be
...
@@ -130,7 +130,7 @@ namespace DeviceLibrary
...
@@ -130,7 +130,7 @@ namespace DeviceLibrary
InMoveInfo
.
log
(
$
"旋转轴到达p1点,升降轴到放料P2"
);
InMoveInfo
.
log
(
$
"旋转轴到达p1点,升降轴到放料P2"
);
break
;
break
;
case
MoveStep
.
In_11
:
case
MoveStep
.
In_11
:
if
(
CountMoveInfo
.
MoveStep
==
MoveStep
.
Wait
)
if
(
CountMoveInfo
.
MoveStep
==
MoveStep
.
Wait
||
IOValue
(
IO_Type
.
Counting_EnterDoor_Open
).
Equals
(
IO_VALUE
.
HIGH
)
)
{
{
InMoveInfo
.
NextMoveStep
(
MoveStep
.
In_12
);
InMoveInfo
.
NextMoveStep
(
MoveStep
.
In_12
);
InMoveInfo
.
log
(
$
"点料机已空闲"
);
InMoveInfo
.
log
(
$
"点料机已空闲"
);
...
@@ -151,9 +151,16 @@ namespace DeviceLibrary
...
@@ -151,9 +151,16 @@ namespace DeviceLibrary
InMoveInfo
.
log
(
$
"旋转轴,升降轴到达放料p2点"
);
InMoveInfo
.
log
(
$
"旋转轴,升降轴到达放料p2点"
);
break
;
break
;
case
MoveStep
.
In_14
:
case
MoveStep
.
In_14
:
InMoveInfo
.
NextMoveStep
(
MoveStep
.
In_15
);
if
(
CountMoveInfo
.
MoveStep
==
MoveStep
.
Wait
)
Loading_InOut_Axis
.
AbsMove
(
InMoveInfo
,
InToPos
.
InOut_P2
,
Config
.
Loading_InOut_Axis_P1_speed
);
{
InMoveInfo
.
log
(
$
"进出轴达放料p2点"
);
InMoveInfo
.
NextMoveStep
(
MoveStep
.
In_15
);
Loading_InOut_Axis
.
AbsMove
(
InMoveInfo
,
InToPos
.
InOut_P2
,
Config
.
Loading_InOut_Axis_P1_speed
);
InMoveInfo
.
log
(
$
"进出轴达放料p2点"
);
}
else
{
Msg
.
add
(
"等待点料机空闲"
,
MsgLevel
.
info
);
}
break
;
break
;
case
MoveStep
.
In_15
:
case
MoveStep
.
In_15
:
if
(
IOValue
(
IO_Type
.
Counting_Reel_Check
).
Equals
(
IO_VALUE
.
LOW
))
if
(
IOValue
(
IO_Type
.
Counting_Reel_Check
).
Equals
(
IO_VALUE
.
LOW
))
...
@@ -174,7 +181,7 @@ namespace DeviceLibrary
...
@@ -174,7 +181,7 @@ namespace DeviceLibrary
case
MoveStep
.
In_16
:
case
MoveStep
.
In_16
:
InMoveInfo
.
NextMoveStep
(
MoveStep
.
In_17
);
InMoveInfo
.
NextMoveStep
(
MoveStep
.
In_17
);
IOMove
(
IO_Type
.
Loading_ReelVacuum_On
,
IO_VALUE
.
LOW
);
IOMove
(
IO_Type
.
Loading_ReelVacuum_On
,
IO_VALUE
.
LOW
);
InMoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitTime
(
5
00
));
InMoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitTime
(
20
00
));
InMoveInfo
.
log
(
$
"关闭吸盘"
);
InMoveInfo
.
log
(
$
"关闭吸盘"
);
break
;
break
;
case
MoveStep
.
In_17
:
case
MoveStep
.
In_17
:
...
...
DeviceLibrary/theMachine/MainMachine_OutCar.cs
查看文件 @
f38a5be
...
@@ -64,9 +64,18 @@ namespace DeviceLibrary
...
@@ -64,9 +64,18 @@ namespace DeviceLibrary
else
else
OutCarType
=
CarTypeE
.
Car13
;
OutCarType
=
CarTypeE
.
Car13
;
OutCarMoveInfo
.
log
(
$
"检测到料车尺寸:{InCarType}"
);
OutCarMoveInfo
.
NextMoveStep
(
MoveStep
.
OutCar_03
);
if
(
InCarType
!=
CarTypeE
.
None
&&
InCarType
!=
OutCarType
)
Unloading_NOCar_Led
.
LedState
=
LedState
.
on
;
{
OutCarMoveInfo
.
NextMoveStep
(
MoveStep
.
OutCarOut_01
);
OutCarMoveInfo
.
log
(
"检测到出料车与入料车尺寸不符"
);
}
else
{
OutCarMoveInfo
.
log
(
$
"检测到料车尺寸:{OutCarType}"
);
OutCarMoveInfo
.
NextMoveStep
(
MoveStep
.
OutCar_03
);
Unloading_NOCar_Led
.
LedState
=
LedState
.
on
;
}
}
}
else
{
else
{
OutCarMoveInfo
.
log
(
$
"小车丢失,重新检测"
);
OutCarMoveInfo
.
log
(
$
"小车丢失,重新检测"
);
...
@@ -86,7 +95,7 @@ namespace DeviceLibrary
...
@@ -86,7 +95,7 @@ namespace DeviceLibrary
if
(
lowlist
.
Length
>
0
)
if
(
lowlist
.
Length
>
0
)
{
{
OutCarMoveInfo
.
log
(
$
"批量轴高速上升到顶部检测点"
);
OutCarMoveInfo
.
log
(
$
"批量轴高速上升到顶部检测点"
);
BatchAxisToP2
(
OutCarMoveInfo
,
Unloading_Batch_Axis
,
OutGetLowReelCheckIOList
()
,
IO_VALUE
.
HIGH
,
Config
.
Unloading_Batch_Axis_P2
,
Config
.
Unloading_Batch_Axis_P1_speed
);
BatchAxisToP2
(
OutCarMoveInfo
,
Unloading_Batch_Axis
,
lowlist
,
IO_VALUE
.
HIGH
,
Config
.
Unloading_Batch_Axis_P2
,
Config
.
Unloading_Batch_Axis_P1_speed
);
}
}
else
{
else
{
OutCarMoveInfo
.
log
(
$
"批量轴所有监测点都已Low"
);
OutCarMoveInfo
.
log
(
$
"批量轴所有监测点都已Low"
);
...
...
DeviceLibrary/theMachine/MainMachine_OutMove.cs
查看文件 @
f38a5be
...
@@ -51,9 +51,13 @@ namespace DeviceLibrary
...
@@ -51,9 +51,13 @@ namespace DeviceLibrary
}
}
break
;
break
;
case
MoveStep
.
Out_01
:
case
MoveStep
.
Out_01
:
OutMoveInfo
.
NextMoveStep
(
MoveStep
.
Out_0
2
);
OutMoveInfo
.
NextMoveStep
(
MoveStep
.
Out_0
3
);
Unloading_InOut_Axis
.
AbsMove
(
OutMoveInfo
,
Config
.
Unloading_InOut_Axis_P1
,
Config
.
Unloading_InOut_Axis_P1_speed
);
Unloading_InOut_Axis
.
AbsMove
(
OutMoveInfo
,
Config
.
Unloading_InOut_Axis_P1
,
Config
.
Unloading_InOut_Axis_P1_speed
);
OutMoveInfo
.
log
(
$
"进出轴回到p1"
);
OutMoveInfo
.
log
(
$
"进出轴回到p1"
);
CylinderMove
(
OutMoveInfo
,
IO_Type
.
Counting_ExitDoor_Close
,
IO_Type
.
Counting_ExitDoor_Open
,
IO_VALUE
.
HIGH
);
if
(
InMoveInfo
.
MoveStep
>=
MoveStep
.
In_10
&&
InMoveInfo
.
MoveStep
<=
MoveStep
.
In_13
)
CylinderMove
(
null
,
IO_Type
.
Counting_EnterDoor_Close
,
IO_Type
.
Counting_EnterDoor_Open
,
IO_VALUE
.
HIGH
);
OutMoveInfo
.
log
(
$
"打开点料机出口大门"
);
break
;
break
;
case
MoveStep
.
Out_02
:
case
MoveStep
.
Out_02
:
OutMoveInfo
.
NextMoveStep
(
MoveStep
.
Out_03
);
OutMoveInfo
.
NextMoveStep
(
MoveStep
.
Out_03
);
...
@@ -120,6 +124,8 @@ namespace DeviceLibrary
...
@@ -120,6 +124,8 @@ namespace DeviceLibrary
break
;
break
;
case
MoveStep
.
Out_09
:
case
MoveStep
.
Out_09
:
OutMoveInfo
.
NextMoveStep
(
MoveStep
.
Out_10
);
OutMoveInfo
.
NextMoveStep
(
MoveStep
.
Out_10
);
if
(
CountMoveInfo
.
MoveStep
==
MoveStep
.
Count_ReadyOut
)
CountMoveInfo
.
NextMoveStep
(
MoveStep
.
Count_Outted
);
Unloading_Middle_Axis
.
AbsMove
(
OutMoveInfo
,
Config
.
Unloading_Middle_Axis_P1
,
Config
.
Unloading_Middle_Axis_P1_speed
);
Unloading_Middle_Axis
.
AbsMove
(
OutMoveInfo
,
Config
.
Unloading_Middle_Axis_P1
,
Config
.
Unloading_Middle_Axis_P1_speed
);
Unloading_UpDown_Axis
.
AbsMove
(
OutMoveInfo
,
Config
.
Unloading_UpDown_Axis_P1
,
Config
.
Unloading_UpDown_Axis_P1_speed
);
Unloading_UpDown_Axis
.
AbsMove
(
OutMoveInfo
,
Config
.
Unloading_UpDown_Axis_P1
,
Config
.
Unloading_UpDown_Axis_P1_speed
);
OutMoveInfo
.
log
(
$
"旋转轴, 升降轴到p1"
);
OutMoveInfo
.
log
(
$
"旋转轴, 升降轴到p1"
);
...
@@ -131,8 +137,7 @@ namespace DeviceLibrary
...
@@ -131,8 +137,7 @@ namespace DeviceLibrary
if
(
OutMoveInfo
.
MoveParam
.
IsNg
)
if
(
OutMoveInfo
.
MoveParam
.
IsNg
)
OutMoveInfo
.
NextMoveStep
(
MoveStep
.
Out_20
);
OutMoveInfo
.
NextMoveStep
(
MoveStep
.
Out_20
);
if
(
CountMoveInfo
.
MoveStep
==
MoveStep
.
Count_ReadyOut
)
CountMoveInfo
.
NextMoveStep
(
MoveStep
.
Count_Outted
);
break
;
break
;
case
MoveStep
.
Out_11
:
case
MoveStep
.
Out_11
:
if
(
string
.
IsNullOrEmpty
(
OutMoveInfo
.
MoveParam
.
ReeID
))
{
if
(
string
.
IsNullOrEmpty
(
OutMoveInfo
.
MoveParam
.
ReeID
))
{
...
@@ -197,7 +202,7 @@ namespace DeviceLibrary
...
@@ -197,7 +202,7 @@ namespace DeviceLibrary
}
}
}
}
else
if
(
OutCarMoveInfo
.
MoveStep
==
MoveStep
.
OutCarReadyPut
)
else
if
(
OutCarMoveInfo
.
MoveStep
==
MoveStep
.
OutCarReadyPut
&&
(
InCarType
==
OutCarType
||
InCarType
==
CarTypeE
.
None
)
)
{
{
OutMoveInfo
.
MoveParam
.
CurrentStringNum
=
OutCurrentStringNum
;
OutMoveInfo
.
MoveParam
.
CurrentStringNum
=
OutCurrentStringNum
;
var
topos
=
"Unloading_T"
+
OutCurrentStringNum
;
var
topos
=
"Unloading_T"
+
OutCurrentStringNum
;
...
@@ -207,7 +212,12 @@ namespace DeviceLibrary
...
@@ -207,7 +212,12 @@ namespace DeviceLibrary
Unloading_UpDown_Axis
.
AbsMove
(
OutMoveInfo
,
OutToPos
.
UpDown_P2
,
Config
.
Unloading_UpDown_Axis_P1_speed
);
Unloading_UpDown_Axis
.
AbsMove
(
OutMoveInfo
,
OutToPos
.
UpDown_P2
,
Config
.
Unloading_UpDown_Axis_P1_speed
);
OutMoveInfo
.
log
(
$
"旋转轴,升降轴到达p2点"
);
OutMoveInfo
.
log
(
$
"旋转轴,升降轴到达p2点"
);
}
}
else
{
else
if
(
InCarType
!=
OutCarType
)
{
Msg
.
add
(
"出料车尺寸与入料车不符"
,
MsgLevel
.
alarm
);
LogUtil
.
info
(
"出料车尺寸与入料车不符"
);
}
else
{
Msg
.
add
(
"等待出口料车可以放料"
,
MsgLevel
.
info
);
Msg
.
add
(
"等待出口料车可以放料"
,
MsgLevel
.
info
);
LogUtil
.
info
(
"等待出口料车可以放料"
);
LogUtil
.
info
(
"等待出口料车可以放料"
);
}
}
...
@@ -215,7 +225,7 @@ namespace DeviceLibrary
...
@@ -215,7 +225,7 @@ namespace DeviceLibrary
case
MoveStep
.
Out_21
:
case
MoveStep
.
Out_21
:
OutMoveInfo
.
NextMoveStep
(
MoveStep
.
Out_22
);
OutMoveInfo
.
NextMoveStep
(
MoveStep
.
Out_22
);
Unloading_InOut_Axis
.
AbsMove
(
OutMoveInfo
,
OutToPos
.
InOut_P2
,
Config
.
Unloading_InOut_Axis_P1_speed
);
Unloading_InOut_Axis
.
AbsMove
(
OutMoveInfo
,
OutToPos
.
InOut_P2
,
Config
.
Unloading_InOut_Axis_P1_speed
);
OutMoveInfo
.
log
(
$
"进出轴达p2点"
);
OutMoveInfo
.
log
(
$
"进出轴达p2点"
);
break
;
break
;
case
MoveStep
.
Out_22
:
case
MoveStep
.
Out_22
:
OutMoveInfo
.
NextMoveStep
(
MoveStep
.
Out_23
);
OutMoveInfo
.
NextMoveStep
(
MoveStep
.
Out_23
);
...
@@ -277,8 +287,10 @@ namespace DeviceLibrary
...
@@ -277,8 +287,10 @@ namespace DeviceLibrary
break
;
break
;
case
MoveStep
.
Out_30
:
case
MoveStep
.
Out_30
:
OutMoveInfo
.
NextMoveStep
(
MoveStep
.
Out_31
);
OutMoveInfo
.
NextMoveStep
(
MoveStep
.
Out_31
);
BatchAxisToP2
(
OutMoveInfo
,
Unloading_Batch_Axis
,
OutGetReelCheckIOList
(
OutCurrentStringNum
),
IO_VALUE
.
HIGH
,
Config
.
Unloading_Batch_Axis_P2
,
Config
.
Unloading_Batch_Axis_P2_speed
);
var
target
=
Unloading_Batch_Axis
.
GetAclPosition
();
OutMoveInfo
.
log
(
$
"批量轴慢速上升到检测点亮"
);
target
=
target
+
(
OutMoveInfo
.
MoveParam
.
PlateH
+
20
)
*
1000
;
BatchAxisToP2
(
OutMoveInfo
,
Unloading_Batch_Axis
,
OutGetReelCheckIOList
(
OutCurrentStringNum
),
IO_VALUE
.
HIGH
,
target
,
Config
.
Unloading_Batch_Axis_P2_speed
);
OutMoveInfo
.
log
(
$
"批量轴慢速上升到检测点亮,当前位置:{Unloading_Batch_Axis.GetAclPosition()},控制上升:{OutMoveInfo.MoveParam.PlateH},{target}"
);
break
;
break
;
case
MoveStep
.
Out_31
:
case
MoveStep
.
Out_31
:
OutMoveInfo
.
NextMoveStep
(
MoveStep
.
Out_WaitForLabel
);
OutMoveInfo
.
NextMoveStep
(
MoveStep
.
Out_WaitForLabel
);
...
...
SO
20117
_AutoCountAndLabel.sln
→
SO
1196
_AutoCountAndLabel.sln
查看文件 @
f38a5be
Microsoft Visual Studio Solution File, Format Version 12.00
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 1
6
# Visual Studio Version 1
7
VisualStudioVersion = 1
6.0.30907.101
VisualStudioVersion = 1
7.9.34701.34
MinimumVisualStudioVersion = 10.0.40219.1
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LoadCSVLibrary", "LoadCVSLibrary\LoadCSVLibrary.csproj", "{064BEBF5-8FAA-4EA2-A5F3-A06E6E7D9251}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LoadCSVLibrary", "LoadCVSLibrary\LoadCSVLibrary.csproj", "{064BEBF5-8FAA-4EA2-A5F3-A06E6E7D9251}"
EndProject
EndProject
...
...
TheMachine/Form1.Designer.cs
查看文件 @
f38a5be
此文件的差异被折叠,
点击展开。
TheMachine/Form1.cs
查看文件 @
f38a5be
...
@@ -344,6 +344,14 @@ namespace TheMachine
...
@@ -344,6 +344,14 @@ namespace TheMachine
lm
.
Add
(
m
);
lm
.
Add
(
m
);
}
}
SetMsg
(
lm
);
SetMsg
(
lm
);
foreach
(
var
cn
in
pnl
.
Controls
)
{
if
(
cn
is
CylinderButton
)
{
(
cn
as
CylinderButton
).
DataUpdate
();
}
}
}
}
private
void
MainMachine_ButtenEvent
(
object
sender
,
ErrInfo
e
)
private
void
MainMachine_ButtenEvent
(
object
sender
,
ErrInfo
e
)
...
...
TheMachine/Program.cs
查看文件 @
f38a5be
...
@@ -84,7 +84,7 @@ namespace TheMachine
...
@@ -84,7 +84,7 @@ namespace TheMachine
Environment
.
CurrentDirectory
=
Application
.
StartupPath
;
Environment
.
CurrentDirectory
=
Application
.
StartupPath
;
XmlConfigurator
.
Configure
();
XmlConfigurator
.
Configure
();
var
pn
=
ServerCommunication
.
GetPnByReelid
(
"123"
);
//var pn= ServerCommunication.GetPnByReelid("S202306181351530002");
//var pn= ServerCommunication.GetPnByReelid("S202306181351530002");
//LogUtil.info(pn);
//LogUtil.info(pn);
//return;
//return;
...
...
TheMachine/UC/CylinderButton.cs
查看文件 @
f38a5be
...
@@ -82,7 +82,9 @@ namespace TheMachine
...
@@ -82,7 +82,9 @@ namespace TheMachine
}
}
}
}
void
DataUpdate
()
{
[
Category
(
"数据"
),
Description
(
"需要确认"
),
Browsable
(
true
)]
public
bool
Confirm
{
get
;
set
;}=
false
;
public
void
DataUpdate
()
{
if
(
string
.
IsNullOrEmpty
(
io_high
)
||
!
DeviceConfig
.
AllDOlist
.
ContainsKey
(
io_high
))
if
(
string
.
IsNullOrEmpty
(
io_high
)
||
!
DeviceConfig
.
AllDOlist
.
ContainsKey
(
io_high
))
this
.
Text
=
$
"IO {io_high} Not Find"
;
this
.
Text
=
$
"IO {io_high} Not Find"
;
else
else
...
@@ -111,6 +113,9 @@ namespace TheMachine
...
@@ -111,6 +113,9 @@ namespace TheMachine
}
}
void
StateUpdate
()
void
StateUpdate
()
{
{
if
(
configio_high
==
null
)
return
;
io_state
=
IOManager
.
GetDOValue
(
configio_high
.
DeviceName
,
configio_high
.
SlaveID
,
configio_high
.
GetIOAddr
());
io_state
=
IOManager
.
GetDOValue
(
configio_high
.
DeviceName
,
configio_high
.
SlaveID
,
configio_high
.
GetIOAddr
());
if
(
configio_low
!=
null
)
if
(
configio_low
!=
null
)
{
{
...
@@ -142,6 +147,18 @@ namespace TheMachine
...
@@ -142,6 +147,18 @@ namespace TheMachine
}
}
private
void
CylinderButton_Click
(
object
sender
,
EventArgs
e
)
private
void
CylinderButton_Click
(
object
sender
,
EventArgs
e
)
{
{
if
(
Confirm
)
{
if
(
RobotManage
.
isRunning
)
{
MessageBox
.
Show
(
$
"设备正在运行,不能操作IO"
);
return
;
}
var
r
=
MessageBox
.
Show
(
$
"您正在点击:{Text}"
,
"请注意"
,
MessageBoxButtons
.
OKCancel
);
if
(
r
!=
DialogResult
.
OK
)
{
return
;
}
}
if
(
io_state
.
Equals
(
IO_VALUE
.
LOW
))
if
(
io_state
.
Equals
(
IO_VALUE
.
LOW
))
{
{
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论