Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
刘韬
/
MIMO
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit cf9f0446
由
刘韬
编写于
2022-10-17 09:03:11 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
1
1 个父辈
1243deb9
隐藏空白字符变更
内嵌
并排
正在显示
9 个修改的文件
包含
105 行增加
和
53 行删除
DeviceLibrary/DeviceLibrary/AxisBean.cs
DeviceLibrary/DeviceLibrary/ServerCommunication.cs
DeviceLibrary/theMachine/BoxTransport.cs
DeviceLibrary/theMachine/MainMachine _BtnProcess.cs
DeviceLibrary/theMachine/MainMachine.cs
DeviceLibrary/theMachine/MainMachine_Clamp.cs
DeviceLibrary/theMachine/MainMachine_String.cs
DeviceLibrary/theMachine/MoveStep.cs
TheMachine/Form1.cs
DeviceLibrary/DeviceLibrary/AxisBean.cs
查看文件 @
cf9f044
...
@@ -338,7 +338,7 @@ namespace DeviceLibrary
...
@@ -338,7 +338,7 @@ namespace DeviceLibrary
{
{
axisCheckTimer
=
new
System
.
Timers
.
Timer
();
axisCheckTimer
=
new
System
.
Timers
.
Timer
();
axisCheckTimer
.
AutoReset
=
true
;
axisCheckTimer
.
AutoReset
=
true
;
axisCheckTimer
.
Interval
+=
30
;
axisCheckTimer
.
Interval
+=
15
;
axisCheckTimer
.
Elapsed
+=
CheckTimer_Elapsed
;
axisCheckTimer
.
Elapsed
+=
CheckTimer_Elapsed
;
axisCheckTimer
.
Enabled
=
false
;
axisCheckTimer
.
Enabled
=
false
;
}
}
...
...
DeviceLibrary/DeviceLibrary/ServerCommunication.cs
查看文件 @
cf9f044
...
@@ -103,12 +103,16 @@ namespace DeviceLibrary
...
@@ -103,12 +103,16 @@ namespace DeviceLibrary
{
{
operation
.
data
.
Add
(
"singleIn"
,
"false"
);
operation
.
data
.
Add
(
"singleIn"
,
"false"
);
}
}
int
retrytimes
=
0
;
retry
:
Operation
resultOperation
=
HttpHelper
.
Post
(
GetPostApi
(),
operation
,
15000
,
printlog
);
Operation
resultOperation
=
HttpHelper
.
Post
(
GetPostApi
(),
operation
,
15000
,
printlog
);
if
(
resultOperation
==
null
||
operation
.
seq
!=
resultOperation
.
seq
)
if
(
RobotManage
.
isRunning
&&(
resultOperation
==
null
||
operation
.
seq
!=
resultOperation
.
seq
)
)
{
{
Thread
.
Sleep
(
1000
);
Thread
.
Sleep
(
1000
);
SendInStoreRequest
(
codelist
,
reel
,
printlog
);
//SendInStoreRequest(codelist, reel, printlog);
return
;
retrytimes
++;
if
(
retrytimes
<=
3
)
goto
retry
;
}
}
ResultProcess
(
resultOperation
);
ResultProcess
(
resultOperation
);
}
}
...
...
DeviceLibrary/theMachine/BoxTransport.cs
查看文件 @
cf9f044
...
@@ -168,11 +168,16 @@ namespace DeviceLibrary
...
@@ -168,11 +168,16 @@ namespace DeviceLibrary
case
MoveStep
.
StoreTS06
:
case
MoveStep
.
StoreTS06
:
RobotManage
.
CameraA
.
CameraGrabOne
(
RobotManage
.
CameraA
.
GetFixtureStateFilename
(
From
.
posid
,
WareCode
,
storeMoveType
,
FixtureState
.
FromIn
));
RobotManage
.
CameraA
.
CameraGrabOne
(
RobotManage
.
CameraA
.
GetFixtureStateFilename
(
From
.
posid
,
WareCode
,
storeMoveType
,
FixtureState
.
FromIn
));
MoveInfo
.
NextMoveStep
(
MoveStep
.
StoreTS07
);
MoveInfo
.
NextMoveStep
(
MoveStep
.
StoreTS07
);
Comp_Axis
.
AbsMove
(
MoveInfo
,
From
.
Comp_PL
,
Config
.
Comp_P2_speed
);
Comp_Axis
.
AbsMove
(
MoveInfo
,
From
.
Comp_PL
,
Config
.
Comp_P2_speed
);
if
(
From
.
posid
==
BoxStorePosition
.
clamp
)
if
(
From
.
posid
==
BoxStorePosition
.
clamp
)
{
{
RobotManage
.
mainMachine
.
CylinderMove
(
MoveInfo
,
IO_Type
.
Clamping_Relax
,
IO_Type
.
Clamping_Work
,
IO_VALUE
.
LOW
);
RobotManage
.
mainMachine
.
CylinderMove
(
MoveInfo
,
IO_Type
.
Clamping_Relax
,
IO_Type
.
Clamping_Work
,
IO_VALUE
.
LOW
);
}
}
else
{
MoveInfo
.
NextMoveStep
(
MoveStep
.
StoreTS08
);
UpDown_Axis
.
AbsMove
(
MoveInfo
,
From
.
UpDown_PH
,
Config
.
UpDown_P4_speed
);
MoveInfo
.
log
(
$
"{storeMoveType}:上下轴到达取料高点"
);
}
break
;
break
;
case
MoveStep
.
StoreTS07
:
case
MoveStep
.
StoreTS07
:
MoveInfo
.
NextMoveStep
(
MoveStep
.
StoreTS08
);
MoveInfo
.
NextMoveStep
(
MoveStep
.
StoreTS08
);
...
...
DeviceLibrary/theMachine/MainMachine _BtnProcess.cs
查看文件 @
cf9f044
...
@@ -22,6 +22,7 @@ namespace DeviceLibrary
...
@@ -22,6 +22,7 @@ namespace DeviceLibrary
if
(
IOValue
(
IO_Type
.
SuddenStop_BTN
).
Equals
(
IO_VALUE
.
HIGH
))
if
(
IOValue
(
IO_Type
.
SuddenStop_BTN
).
Equals
(
IO_VALUE
.
HIGH
))
{
{
Msg
.
add
(
crc
.
GetString
(
L
.
reset_press
,
"按下复位按钮."
),
MsgLevel
.
info
,
ErrInfo
.
ResetBtn
);
Msg
.
add
(
crc
.
GetString
(
L
.
reset_press
,
"按下复位按钮."
),
MsgLevel
.
info
,
ErrInfo
.
ResetBtn
);
ButtenEvent
?.
Invoke
(
null
,
ErrInfo
.
ResetBtn
);
}
}
else
else
{
{
...
@@ -41,7 +42,10 @@ namespace DeviceLibrary
...
@@ -41,7 +42,10 @@ namespace DeviceLibrary
if
(
IOValue
(
IO_Type
.
SuddenStop_BTN
).
Equals
(
IO_VALUE
.
HIGH
))
if
(
IOValue
(
IO_Type
.
SuddenStop_BTN
).
Equals
(
IO_VALUE
.
HIGH
))
{
{
if
(!
RobotManage
.
isRunning
)
if
(!
RobotManage
.
isRunning
)
{
Msg
.
add
(
crc
.
GetString
(
L
.
runbtn_press
,
"按下启动按钮,开始启动."
),
MsgLevel
.
info
,
ErrInfo
.
RunBtn
);
Msg
.
add
(
crc
.
GetString
(
L
.
runbtn_press
,
"按下启动按钮,开始启动."
),
MsgLevel
.
info
,
ErrInfo
.
RunBtn
);
ButtenEvent
?.
Invoke
(
null
,
ErrInfo
.
RunBtn
);
}
else
else
Msg
.
add
(
crc
.
GetString
(
L
.
system_is_running
,
"系统正在运行."
),
MsgLevel
.
info
);
Msg
.
add
(
crc
.
GetString
(
L
.
system_is_running
,
"系统正在运行."
),
MsgLevel
.
info
);
}
}
...
...
DeviceLibrary/theMachine/MainMachine.cs
查看文件 @
cf9f044
...
@@ -44,7 +44,7 @@ namespace DeviceLibrary
...
@@ -44,7 +44,7 @@ namespace DeviceLibrary
public
delegate
void
ProcessMsg
(
List
<
Msg
>
msg
);
public
delegate
void
ProcessMsg
(
List
<
Msg
>
msg
);
public
event
ProcessMsg
ProcessMsgEvent
;
public
event
ProcessMsg
ProcessMsgEvent
;
public
event
EventHandler
<
ErrInfo
>
ButtenEvent
;
internal
AxisBean
Middle_Axis
;
internal
AxisBean
Middle_Axis
;
public
AxisBean
UpDown_Axis
;
public
AxisBean
UpDown_Axis
;
internal
AxisBean
InOut_Axis
;
internal
AxisBean
InOut_Axis
;
...
@@ -310,7 +310,7 @@ namespace DeviceLibrary
...
@@ -310,7 +310,7 @@ namespace DeviceLibrary
ResetMoveInfo
.
log
(
"旋转轴,升降轴,回原,料叉P1待机点"
);
ResetMoveInfo
.
log
(
"旋转轴,升降轴,回原,料叉P1待机点"
);
InOut_Axis
.
AbsMove
(
ResetMoveInfo
,
Config
.
InOut_P1
,
Config
.
InOut_P1_speed
);
InOut_Axis
.
AbsMove
(
ResetMoveInfo
,
Config
.
InOut_P1
,
Config
.
InOut_P1_speed
);
Middle_Axis
.
HomeMove
(
ResetMoveInfo
,
forceHome
);
Middle_Axis
.
HomeMove
(
ResetMoveInfo
,
forceHome
);
UpDown_Axis
.
HomeMove
(
ResetMoveInfo
,
forceHome
);
UpDown_Axis
.
HomeMove
(
ResetMoveInfo
,
forceHome
);
//OpenFlipDoor(ResetMoveInfo);
//OpenFlipDoor(ResetMoveInfo);
break
;
break
;
case
MoveStep
.
H04_HomeReset
:
case
MoveStep
.
H04_HomeReset
:
...
@@ -323,8 +323,9 @@ namespace DeviceLibrary
...
@@ -323,8 +323,9 @@ namespace DeviceLibrary
ResetMoveInfo
.
log
(
"旋转轴,升降轴,到P1待机点"
);
ResetMoveInfo
.
log
(
"旋转轴,升降轴,到P1待机点"
);
Middle_Axis
.
AbsMove
(
ResetMoveInfo
,
Config
.
Middle_P1
,
Config
.
Middle_P1_speed
);
Middle_Axis
.
AbsMove
(
ResetMoveInfo
,
Config
.
Middle_P1
,
Config
.
Middle_P1_speed
);
UpDown_Axis
.
AbsMove
(
ResetMoveInfo
,
Config
.
UpDown_P1
,
Config
.
UpDown_P1_speed
);
UpDown_Axis
.
AbsMove
(
ResetMoveInfo
,
Config
.
UpDown_P1
,
Config
.
UpDown_P1_speed
);
Batch_Axis
.
AbsMove
(
ResetMoveInfo
,
Config
.
Batch_P1
,
Config
.
Batch_P1_speed
);
break
;
break
;
case
MoveStep
.
H06_HomeReset
:
case
MoveStep
.
H06_HomeReset
:
ResetMoveInfo
.
log
(
"压紧轴回原"
);
ResetMoveInfo
.
log
(
"压紧轴回原"
);
if
(
AxisManager
.
GetAlarmStatus
(
Comp_Axis
.
Config
.
DeviceName
,
Comp_Axis
.
Config
.
GetAxisValue
())
==
1
)
if
(
AxisManager
.
GetAlarmStatus
(
Comp_Axis
.
Config
.
DeviceName
,
Comp_Axis
.
Config
.
GetAxisValue
())
==
1
)
{
{
...
@@ -380,19 +381,20 @@ namespace DeviceLibrary
...
@@ -380,19 +381,20 @@ namespace DeviceLibrary
break
;
break
;
case
MoveStep
.
H11_HomeReset
:
case
MoveStep
.
H11_HomeReset
:
ResetMoveInfo
.
NextMoveStep
(
MoveStep
.
H12_HomeReset
);
ResetMoveInfo
.
NextMoveStep
(
MoveStep
.
H12_HomeReset
);
UpDown_Axis
.
AbsMove
(
ResetMoveInfo
,
Config
.
UpDown_P3
,
Config
.
UpDown_P3_speed
);
break
;
break
;
case
MoveStep
.
H12_HomeReset
:
case
MoveStep
.
H12_HomeReset
:
ResetMoveInfo
.
NextMoveStep
(
MoveStep
.
H13_HomeReset
);
ResetMoveInfo
.
NextMoveStep
(
MoveStep
.
H13_HomeReset
);
ResetMoveInfo
.
log
(
"打开NG口门"
);
ResetMoveInfo
.
log
(
"打开NG口门"
);
//CylinderMove(null, IO_Type.NGDoor_Close, IO_Type.NGDoor_Open, IO_VALUE.HIGH);
//CylinderMove(null, IO_Type.NGDoor_Close, IO_Type.NGDoor_Open, IO_VALUE.HIGH);
SingleDoor
.
ToHigh
(
null
);
SingleDoor
.
ToHigh
(
ResetMoveInfo
);
break
;
break
;
case
MoveStep
.
H13_HomeReset
:
case
MoveStep
.
H13_HomeReset
:
ResetMoveInfo
.
NextMoveStep
(
MoveStep
.
H14_HomeReset
);
ResetMoveInfo
.
NextMoveStep
(
MoveStep
.
H14_HomeReset
);
if
(!
NGDoor_Tray_Test_Reel
)
if
(!
NGDoor_Tray_Test_Reel
)
{
{
Msg
.
add
(
crc
.
GetString
(
L
.
x29_low_no_reel
,
"传感器X23未检测到单料口料盘."
)
,
MsgLevel
.
alarm
);
Msg
.
add
(
"传感器X20未检测到单料口料盘."
,
MsgLevel
.
alarm
);
RobotManage
.
UserPause
(
"传感器X2
3
未检测到单料口料盘."
);
RobotManage
.
UserPause
(
"传感器X2
0
未检测到单料口料盘."
);
}
}
//CylinderMove(ResetMoveInfo, IO_Type.NGDoor_Close, IO_Type.NGDoor_Open, IO_VALUE.HIGH);
//CylinderMove(ResetMoveInfo, IO_Type.NGDoor_Close, IO_Type.NGDoor_Open, IO_VALUE.HIGH);
SingleDoor
.
ToHigh
(
ResetMoveInfo
);
SingleDoor
.
ToHigh
(
ResetMoveInfo
);
...
@@ -546,6 +548,7 @@ namespace DeviceLibrary
...
@@ -546,6 +548,7 @@ namespace DeviceLibrary
//else
//else
{
{
Msg
.
add
(
crc
.
GetString
(
L
.
system_need_reset
,
"系统需要重置"
),
MsgLevel
.
alarm
,
ErrInfo
.
SuddenStop
);
Msg
.
add
(
crc
.
GetString
(
L
.
system_need_reset
,
"系统需要重置"
),
MsgLevel
.
alarm
,
ErrInfo
.
SuddenStop
);
ButtenEvent
?.
Invoke
(
null
,
ErrInfo
.
SuddenStop
);
ok
=
false
;
ok
=
false
;
}
}
}
}
...
@@ -595,6 +598,7 @@ namespace DeviceLibrary
...
@@ -595,6 +598,7 @@ namespace DeviceLibrary
{
{
Msg
.
add
(
crc
.
GetString
(
configMoveAxis
.
ProName
,
configMoveAxis
.
Explain
)
+
$
"[{configMoveAxis.GetAxisValue()}]:"
Msg
.
add
(
crc
.
GetString
(
configMoveAxis
.
ProName
,
configMoveAxis
.
Explain
)
+
$
"[{configMoveAxis.GetAxisValue()}]:"
+
crc
.
GetString
(
L
.
motion_alarm
,
"运动报警"
),
MsgLevel
.
alarm
,
ErrInfo
.
SuddenStop
);
+
crc
.
GetString
(
L
.
motion_alarm
,
"运动报警"
),
MsgLevel
.
alarm
,
ErrInfo
.
SuddenStop
);
ButtenEvent
?.
Invoke
(
null
,
ErrInfo
.
SuddenStop
);
}
}
...
...
DeviceLibrary/theMachine/MainMachine_Clamp.cs
查看文件 @
cf9f044
...
@@ -120,7 +120,7 @@ namespace DeviceLibrary
...
@@ -120,7 +120,7 @@ namespace DeviceLibrary
ClampMoveInfo
.
MoveParam
.
NgMsg
=
crc
.
GetString
(
L
.
not_detect_reel_height
,
"未检测到盘宽"
);
ClampMoveInfo
.
MoveParam
.
NgMsg
=
crc
.
GetString
(
L
.
not_detect_reel_height
,
"未检测到盘宽"
);
ClampMoveInfo
.
log
(
$
"未检测到盘宽"
);
ClampMoveInfo
.
log
(
$
"未检测到盘宽"
);
ReelGetted
(
false
);
ReelGetted
(
false
);
ClampMoveInfo
.
NextMoveStep
(
MoveStep
.
Wait
);
ClampMoveInfo
.
NextMoveStep
(
MoveStep
.
NGOUT_08
);
SingleDoor
.
ToHigh
(
ClampMoveInfo
);
SingleDoor
.
ToHigh
(
ClampMoveInfo
);
Msg
.
add
(
ClampMoveInfo
.
MoveParam
.
NgMsg
,
MsgLevel
.
alarm
);
Msg
.
add
(
ClampMoveInfo
.
MoveParam
.
NgMsg
,
MsgLevel
.
alarm
);
RobotManage
.
UserPause
(
"未检测到盘"
,
true
);
RobotManage
.
UserPause
(
"未检测到盘"
,
true
);
...
@@ -212,12 +212,14 @@ namespace DeviceLibrary
...
@@ -212,12 +212,14 @@ namespace DeviceLibrary
}
}
break
;
break
;
case
MoveStep
.
NGOUT_08
:
case
MoveStep
.
NGOUT_08
:
Msg
.
add
(
ClampMoveInfo
.
MoveParam
.
NgMsg
,
MsgLevel
.
warning
);
if
(
IOValue
(
IO_Type
.
SafetyLightCurtains
).
Equals
(
IO_VALUE
.
LOW
))
if
(
IOValue
(
IO_Type
.
SafetyLightCurtains
).
Equals
(
IO_VALUE
.
LOW
))
{
{
Msg
.
add
(
crc
.
GetString
(
L
.
wait_put_reel_into_ngdoor
,
"等待阻挡物离开光栅"
),
MsgLevel
.
warning
);
Msg
.
add
(
crc
.
GetString
(
L
.
wait_put_reel_into_ngdoor
,
"等待阻挡物离开光栅"
),
MsgLevel
.
warning
);
}
else
if
(
IOValue
(
IO_Type
.
NGDoor_Close
).
Equals
(
IO_VALUE
.
LOW
))
}
else
if
(
IOValue
(
IO_Type
.
NGDoor_Close
).
Equals
(
IO_VALUE
.
LOW
))
{
{
Msg
.
add
(
crc
.
GetString
(
L
.
wait_ngdoor_close
,
"等待单料门关闭"
),
MsgLevel
.
warning
);
Msg
.
add
(
crc
.
GetString
(
L
.
wait_ngdoor_close
,
"等待单料门关闭"
),
MsgLevel
.
warning
);
}
}
else
else
{
{
...
...
DeviceLibrary/theMachine/MainMachine_String.cs
查看文件 @
cf9f044
...
@@ -121,7 +121,7 @@ namespace DeviceLibrary
...
@@ -121,7 +121,7 @@ namespace DeviceLibrary
Msg
.
add
(
crc
.
GetString
(
L
.
out_store_free
,
"舱内有出库料盘"
),
MsgLevel
.
warning
);
//0704
Msg
.
add
(
crc
.
GetString
(
L
.
out_store_free
,
"舱内有出库料盘"
),
MsgLevel
.
warning
);
//0704
}
}
if
(
StringState
<
StringStateE
.
Full
&&
StoreMoveInfo
.
MoveStep
>=
MoveStep
.
StoreOut10
&&
IsBatchDoorClosed
)
if
(
StringState
<
StringStateE
.
Full
&&
StoreMoveInfo
.
MoveStep
>=
MoveStep
.
StoreOut10
&&
!
StoreMoveInfo
.
MoveParam
.
IsNg
&&
IsBatchDoorClosed
)
{
{
StringMoveInfo
.
NextMoveStep
(
MoveStep
.
StringLoad_01
);
StringMoveInfo
.
NextMoveStep
(
MoveStep
.
StringLoad_01
);
StringState
=
StringStateE
.
OutStore
;
StringState
=
StringStateE
.
OutStore
;
...
@@ -137,18 +137,31 @@ namespace DeviceLibrary
...
@@ -137,18 +137,31 @@ namespace DeviceLibrary
StringMoveInfo
.
NextMoveStep
(
MoveStep
.
StringLoad_02
);
StringMoveInfo
.
NextMoveStep
(
MoveStep
.
StringLoad_02
);
break
;
break
;
case
MoveStep
.
StringLoad_02
:
case
MoveStep
.
StringLoad_02
:
StringMoveInfo
.
NextMoveStep
(
MoveStep
.
StringLoad_0
3
);
StringMoveInfo
.
NextMoveStep
(
MoveStep
.
StringLoad_0
2a
);
newreel
=
true
;
newreel
=
true
;
downCheck1
=
false
;
downCheck1
=
false
;
downCheck2
=
false
;
downCheck2
=
false
;
downCheck3
=
false
;
downCheck3
=
false
;
break
;
break
;
case
MoveStep
.
StringLoad_02a
:
StringMoveInfo
.
NextMoveStep
(
MoveStep
.
StringLoad_02b
);
StringMoveInfo
.
log
(
$
"批量轴高速上升到顶部检测点"
);
BatchAxisToP2
(
StringMoveInfo
,
true
);
break
;
case
MoveStep
.
StringLoad_02b
:
StringMoveInfo
.
NextMoveStep
(
MoveStep
.
StringLoad_03
);
var
tpos1
=
Batch_Axis
.
GetAclPosition
()
-
Config
.
Batch_PoToMM
*
10
;
if
(
tpos1
<
0
)
tpos1
=
0
;
Batch_Axis
.
AbsMove
(
StringMoveInfo
,
tpos1
,
Config
.
Batch_P1_speed
);
StringMoveInfo
.
log
(
$
"批量轴下降1cm"
);
break
;
case
MoveStep
.
StringLoad_03
:
case
MoveStep
.
StringLoad_03
:
StringMoveInfo
.
NextMoveStep
(
MoveStep
.
StringLoad_04
);
StringMoveInfo
.
NextMoveStep
(
MoveStep
.
StringLoad_04
);
if
(
oldtestheight
||
newreel
)
if
(
oldtestheight
)
{
{
StringMoveInfo
.
log
(
$
"批量轴到顶部检测点"
);
StringMoveInfo
.
log
(
$
"批量轴到顶部检测点"
);
BatchAxisToP2
(
StringMoveInfo
,
newreel
);
BatchAxisToP2
(
StringMoveInfo
);
TestHeightTask
=
null
;
TestHeightTask
=
null
;
}
}
else
{
else
{
...
@@ -205,19 +218,19 @@ namespace DeviceLibrary
...
@@ -205,19 +218,19 @@ namespace DeviceLibrary
{
{
StringMoveInfo
.
NextMoveStep
(
MoveStep
.
StringReadyPut
);
StringMoveInfo
.
NextMoveStep
(
MoveStep
.
StringReadyPut
);
var
tpos
2
=
Batch_Axis
.
GetAclPosition
()
-
Config
.
Batch_PoToMM
*
Config
.
Batch_OutStoreDownMM
;
var
tpos
3
=
Batch_Axis
.
GetAclPosition
()
-
Config
.
Batch_PoToMM
*
Config
.
Batch_OutStoreDownMM
;
if
(
tpos
2
<
0
)
if
(
tpos
3
<
0
)
{
{
tpos
2
=
0
;
tpos
3
=
0
;
}
}
StringMoveInfo
.
log
(
$
"料串出库模式,下降{Config.Batch_OutStoreDownMM}mm,{tpos
2
},{Batch_Axis.GetAclPosition()}"
);
StringMoveInfo
.
log
(
$
"料串出库模式,下降{Config.Batch_OutStoreDownMM}mm,{tpos
3
},{Batch_Axis.GetAclPosition()}"
);
if
(
tpos
2
<
Config
.
Batch_P1
)
if
(
tpos
3
<
Config
.
Batch_P1
)
{
{
StringMoveInfo
.
NextMoveStep
(
MoveStep
.
StringOut_01
);
StringMoveInfo
.
NextMoveStep
(
MoveStep
.
StringOut_01
);
StringState
=
StringStateE
.
Full
;
StringState
=
StringStateE
.
Full
;
StringMoveInfo
.
log
(
$
"料串已满,无法出库,开始送出"
);
StringMoveInfo
.
log
(
$
"料串已满,无法出库,开始送出"
);
}
}
Batch_Axis
.
AbsMove
(
StringMoveInfo
,
tpos
2
,
Config
.
Batch_P1_speed
);
Batch_Axis
.
AbsMove
(
StringMoveInfo
,
tpos
3
,
Config
.
Batch_P1_speed
);
}
}
break
;
break
;
case
MoveStep
.
StringLoad_07
:
case
MoveStep
.
StringLoad_07
:
...
@@ -272,10 +285,10 @@ namespace DeviceLibrary
...
@@ -272,10 +285,10 @@ namespace DeviceLibrary
StringMoveInfo
.
log
(
$
"料盘取走失败,料盘下降"
);
StringMoveInfo
.
log
(
$
"料盘取走失败,料盘下降"
);
ReelGetFail
++;
ReelGetFail
++;
StringMoveInfo
.
NextMoveStep
(
MoveStep
.
StringReelGetFail_02
);
StringMoveInfo
.
NextMoveStep
(
MoveStep
.
StringReelGetFail_02
);
var
tpos
1
=
Batch_Axis
.
GetAclPosition
()
-
Config
.
Batch_PoToMM
*
20
;
var
tpos
2
=
Batch_Axis
.
GetAclPosition
()
-
Config
.
Batch_PoToMM
*
20
;
if
(
tpos
1
<
0
)
if
(
tpos
2
<
0
)
tpos
1
=
0
;
tpos
2
=
0
;
Batch_Axis
.
AbsMove
(
StringMoveInfo
,
tpos
1
,
Config
.
Batch_P1_speed
);
Batch_Axis
.
AbsMove
(
StringMoveInfo
,
tpos
2
,
Config
.
Batch_P1_speed
);
break
;
break
;
case
MoveStep
.
StringReelGetFail_02
:
case
MoveStep
.
StringReelGetFail_02
:
StringMoveInfo
.
log
(
$
"料盘取走失败,重新上升"
);
StringMoveInfo
.
log
(
$
"料盘取走失败,重新上升"
);
...
...
DeviceLibrary/theMachine/MoveStep.cs
查看文件 @
cf9f044
...
@@ -35,6 +35,8 @@ namespace DeviceLibrary
...
@@ -35,6 +35,8 @@ namespace DeviceLibrary
StringLoad_01
,
StringLoad_01
,
StringLoad_01a
,
StringLoad_01a
,
StringLoad_02
,
StringLoad_02
,
StringLoad_02a
,
StringLoad_02b
,
StringLoad_03
,
StringLoad_03
,
StringLoad_04
,
StringLoad_04
,
StringLoad_05
,
StringLoad_05
,
...
...
TheMachine/Form1.cs
查看文件 @
cf9f044
...
@@ -300,9 +300,14 @@ namespace TheMachine
...
@@ -300,9 +300,14 @@ namespace TheMachine
pnl
.
Enabled
=
true
;
pnl
.
Enabled
=
true
;
if
(
state
)
if
(
state
)
{
{
btn_run
.
Enabled
=
true
;
//btn_stop.Enabled = true;
//btn_stop.Enabled = true;
RobotManage
.
mainMachine
.
ProcessMsgEvent
+=
MainMachine_ProcessMsgEvent
;
if
(!
btn_run
.
Enabled
)
{
RobotManage
.
mainMachine
.
ProcessMsgEvent
+=
MainMachine_ProcessMsgEvent
;
RobotManage
.
mainMachine
.
ButtenEvent
+=
MainMachine_ButtenEvent
;
}
btn_run
.
Enabled
=
true
;
}
}
ioc
.
Config
=
RobotManage
.
Config
;
ioc
.
Config
=
RobotManage
.
Config
;
...
@@ -318,6 +323,39 @@ namespace TheMachine
...
@@ -318,6 +323,39 @@ namespace TheMachine
}
}
SetMsg
(
lm
);
SetMsg
(
lm
);
}
}
private
void
MainMachine_ButtenEvent
(
object
sender
,
ErrInfo
e
)
{
LogUtil
.
info
(
"UI "
+
e
.
ToString
());
if
(
e
==
ErrInfo
.
RunBtn
)
{
Task
.
Run
(()
=>
{
if
(!
RobotManage
.
isRunning
)
{
LogUtil
.
info
(
"Task.Run"
);
this
.
Invoke
((
EventHandler
)
delegate
{
LogUtil
.
info
(
"Invoke((EventHandler)delegate"
);
btn_run_Click
(
this
,
EventArgs
.
Empty
);
});
}
});
}
else
if
(
e
==
ErrInfo
.
SuddenStop
)
{
Task
.
Run
(()
=>
{
if
(
RobotManage
.
isRunning
)
this
.
Invoke
((
EventHandler
)
delegate
{
btn_stop_Click
(
this
,
EventArgs
.
Empty
);
});
});
}
}
void
SetMsg
(
List
<
Msg
>
msgs
)
void
SetMsg
(
List
<
Msg
>
msgs
)
{
{
this
.
SuspendLayout
();
this
.
SuspendLayout
();
...
@@ -348,30 +386,7 @@ namespace TheMachine
...
@@ -348,30 +386,7 @@ namespace TheMachine
{
{
btn_IgnoreX09
.
Visible
=
false
;
btn_IgnoreX09
.
Visible
=
false
;
}
}
else
if
(
msg
.
errInfo
==
ErrInfo
.
RunBtn
)
{
Task
.
Run
(()=>
{
if
(!
RobotManage
.
isRunning
)
{
this
.
Invoke
((
EventHandler
)
delegate
{
btn_run_Click
(
this
,
EventArgs
.
Empty
);
});
}
});
}
else
if
(
msg
.
errInfo
==
ErrInfo
.
SuddenStop
)
{
Task
.
Run
(()=>
{
if
(
RobotManage
.
isRunning
)
this
.
Invoke
((
EventHandler
)
delegate
{
btn_stop_Click
(
this
,
EventArgs
.
Empty
);
});
});
}
}
}
this
.
ResumeLayout
(
true
);
this
.
ResumeLayout
(
true
);
}
}
...
@@ -380,6 +395,7 @@ namespace TheMachine
...
@@ -380,6 +395,7 @@ namespace TheMachine
private
void
btn_run_Click
(
object
sender
,
EventArgs
e
)
private
void
btn_run_Click
(
object
sender
,
EventArgs
e
)
{
{
LogUtil
.
info
(
"btn_run_Click:"
+
sender
+
e
.
ToString
());
if
(!
RobotManage
.
isRunning
)
if
(!
RobotManage
.
isRunning
)
{
{
if
(
RobotManage
.
mainMachine
.
IOValue
(
IO_Type
.
SuddenStop_BTN
).
Equals
(
IO_VALUE
.
LOW
))
if
(
RobotManage
.
mainMachine
.
IOValue
(
IO_Type
.
SuddenStop_BTN
).
Equals
(
IO_VALUE
.
LOW
))
...
@@ -402,11 +418,13 @@ namespace TheMachine
...
@@ -402,11 +418,13 @@ namespace TheMachine
{
{
userpause
=
true
;
userpause
=
true
;
RobotManage
.
UserPause
(
userpause
);
RobotManage
.
UserPause
(
userpause
);
LogUtil
.
info
(
"用户按下暂停1"
);
}
}
else
if
(
userpause
)
else
if
(
userpause
)
{
{
userpause
=
false
;
userpause
=
false
;
RobotManage
.
UserPause
(
userpause
);
RobotManage
.
UserPause
(
userpause
);
LogUtil
.
info
(
"用户取消暂停2"
);
}
}
}
}
private
void
RobotManage_UserPauseSet
(
object
sender
,
bool
e
)
private
void
RobotManage_UserPauseSet
(
object
sender
,
bool
e
)
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论