Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
刘韬
/
1069_MIMO_PlUS
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit bde4b79a
由
张东亮
编写于
2024-03-06 16:53:26 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
轴回原命令异常重发
1 个父辈
b0770b49
隐藏空白字符变更
内嵌
并排
正在显示
8 个修改的文件
包含
52 行增加
和
22 行删除
DeviceLibrary/DeviceLibrary/AxisBean.cs
DeviceLibrary/DeviceLibrary/AxisManager.cs
DeviceLibrary/DeviceLibrary/HC/HCAxisManager.cs
DeviceLibrary/DeviceLibrary/IAxisManager.cs
DeviceLibrary/theMachine/MainMachine _BtnProcess.cs
DeviceLibrary/theMachine/MainMachine.cs
DeviceLibrary/theMachine/MainMachine_Store.cs
TheMachine/Form1.cs
DeviceLibrary/DeviceLibrary/AxisBean.cs
查看文件 @
bde4b79
...
@@ -4,6 +4,7 @@ using OnlineStore.LoadCSVLibrary;
...
@@ -4,6 +4,7 @@ using OnlineStore.LoadCSVLibrary;
using
System
;
using
System
;
using
System.Collections.Generic
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Linq
;
using
System.Security.Policy
;
using
System.Text
;
using
System.Text
;
using
System.Threading
;
using
System.Threading
;
using
System.Threading.Tasks
;
using
System.Threading.Tasks
;
...
@@ -122,12 +123,25 @@ namespace DeviceLibrary
...
@@ -122,12 +123,25 @@ namespace DeviceLibrary
}
}
Config
.
TargetPosition
=
0
;
Config
.
TargetPosition
=
0
;
LogUtil
.
info
(
AxisName
+
"speed["
+
Config
.
HomeHighSpeed
+
"]开始原点返回"
);
LogUtil
.
info
(
AxisName
+
"speed["
+
Config
.
HomeHighSpeed
+
"]开始原点返回"
);
if
(
MoveInfo
!=
null
)
MoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitAxis
(
Config
,
true
));
var
HomeLowSpeed
=
Config
.
HomeLowSpeed
>
0
?
Config
.
HomeLowSpeed
:
Config
.
HomeHighSpeed
/
10
;
var
HomeLowSpeed
=
Config
.
HomeLowSpeed
>
0
?
Config
.
HomeLowSpeed
:
Config
.
HomeHighSpeed
/
10
;
var
HomeAddSpeed
=
Config
.
HomeAddSpeed
>
0
?
Config
.
HomeAddSpeed
:
Config
.
HomeHighSpeed
*
5
;
var
HomeAddSpeed
=
Config
.
HomeAddSpeed
>
0
?
Config
.
HomeAddSpeed
:
Config
.
HomeHighSpeed
*
5
;
AxisManager
.
HomeMove
(
Config
.
DeviceName
,
(
short
)
Config
.
GetAxisValue
(),
Config
.
HomeHighSpeed
,
HomeLowSpeed
,
HomeAddSpeed
);
if
(
AxisManager
.
HomeMove
(
Config
.
DeviceName
,
(
short
)
Config
.
GetAxisValue
(),
Config
.
HomeHighSpeed
,
HomeLowSpeed
,
HomeAddSpeed
))
{
MoveInfo
?.
WaitList
.
Add
(
WaitResultInfo
.
WaitAxis
(
Config
,
true
));
}
else
{
Thread
.
Sleep
(
50
);
LogUtil
.
error
(
AxisName
+
"speed["
+
Config
.
HomeHighSpeed
+
"]发送原点返回命令失败,重试"
);
if
(
AxisManager
.
HomeMove
(
Config
.
DeviceName
,
(
short
)
Config
.
GetAxisValue
(),
Config
.
HomeHighSpeed
,
HomeLowSpeed
,
HomeAddSpeed
))
{
MoveInfo
?.
WaitList
.
Add
(
WaitResultInfo
.
WaitAxis
(
Config
,
true
));
}
}
}
}
/// <summary>
/// <summary>
...
@@ -243,15 +257,18 @@ namespace DeviceLibrary
...
@@ -243,15 +257,18 @@ namespace DeviceLibrary
//判断是否需要重新运动
//判断是否需要重新运动
if
(
MoveInfo
.
CanWhileCount
>
0
)
if
(
MoveInfo
.
CanWhileCount
>
0
)
{
{
msg
=
$
"{MoveInfo.Name} {axis.DisplayStr} 收到原点完成信号,当前位置{outCount},规划位置{outTarget},重新回原点,剩余[{MoveInfo.CanWhileCount}]]次。{axisS.ToStr()}"
;
string
msg1
=
$
"{MoveInfo.Name} {axis.DisplayStr} 收到原点完成信号,当前位置{outCount},规划位置{outTarget},重新回原点,剩余[{MoveInfo.CanWhileCount}]]次。{axisS.ToStr()}"
;
LogUtil
.
error
(
msg
);
LogUtil
.
error
(
msg
1
);
//LogUtil.error( StoreName + moveAxis.DisplayStr + "重新回原点");
//LogUtil.error( StoreName + moveAxis.DisplayStr + "重新回原点");
AxisManager
.
HomeMove
(
axis
.
DeviceName
,
axis
.
GetAxisValue
(),
axis
.
HomeHighSpeed
,
axis
.
HomeLowSpeed
,
axis
.
HomeAddSpeed
);
var
HomeLowSpeed
=
axis
.
HomeLowSpeed
>
0
?
axis
.
HomeLowSpeed
:
axis
.
HomeHighSpeed
/
10
;
var
HomeAddSpeed
=
axis
.
HomeAddSpeed
>
0
?
axis
.
HomeAddSpeed
:
axis
.
HomeHighSpeed
*
5
;
AxisManager
.
HomeMove
(
axis
.
DeviceName
,
(
short
)
axis
.
GetAxisValue
(),
axis
.
HomeHighSpeed
,
HomeLowSpeed
,
HomeAddSpeed
);
MoveInfo
.
CanWhileCount
--;
MoveInfo
.
CanWhileCount
--;
}
}
else
else
{
{
msg
=
$
"{MoveInfo.Name} {MoveInfo.MoveStep} {axis.DisplayStr} ,收到原点完成信号,当前位置[{outCount}],规划位置{outTarget},误差过大,需要报警。{axisS.ToStr()}"
;
msg
=
$
"{MoveInfo.Name} {MoveInfo.MoveStep} {axis.DisplayStr} ,收到原点完成信号,当前位置[{outCount}],规划位置{outTarget},误差过大,需要报警。{axisS.ToStr()}"
;
LogUtil
.
error
(
msg
);
LogUtil
.
error
(
msg
);
}
}
}
}
...
...
DeviceLibrary/DeviceLibrary/AxisManager.cs
查看文件 @
bde4b79
...
@@ -49,9 +49,9 @@ namespace DeviceLibrary
...
@@ -49,9 +49,9 @@ namespace DeviceLibrary
{
{
instance
.
RelMove
(
portName
,
slvAddr
,
position
,
targetSpeed
,
ptpAcc
,
ptpDec
);
instance
.
RelMove
(
portName
,
slvAddr
,
position
,
targetSpeed
,
ptpAcc
,
ptpDec
);
}
}
public
static
void
HomeMove
(
string
portName
,
short
slvAddr
,
int
highVel
,
int
lowVel
,
int
acc
)
public
static
bool
HomeMove
(
string
portName
,
short
slvAddr
,
int
highVel
,
int
lowVel
,
int
acc
)
{
{
instance
.
HomeMove
(
portName
,
slvAddr
,
highVel
,
lowVel
,
acc
);
return
instance
.
HomeMove
(
portName
,
slvAddr
,
highVel
,
lowVel
,
acc
);
}
}
public
static
void
SpeedMove
(
string
portName
,
short
slvAddr
,
int
speed
,
int
acc
,
int
dec
)
public
static
void
SpeedMove
(
string
portName
,
short
slvAddr
,
int
speed
,
int
acc
,
int
dec
)
...
...
DeviceLibrary/DeviceLibrary/HC/HCAxisManager.cs
查看文件 @
bde4b79
...
@@ -74,9 +74,9 @@ namespace DeviceLibrary
...
@@ -74,9 +74,9 @@ namespace DeviceLibrary
return
(
int
)
HCBoardManager
.
GetAxisPrfPos
(
slvAddr
);
return
(
int
)
HCBoardManager
.
GetAxisPrfPos
(
slvAddr
);
}
}
public
void
HomeMove
(
string
portName
,
short
slvAddr
,
int
highVel
,
int
lowVel
,
int
acc
)
public
bool
HomeMove
(
string
portName
,
short
slvAddr
,
int
highVel
,
int
lowVel
,
int
acc
)
{
{
HCBoardManager
.
StartHomeMove
(
slvAddr
,(
uint
)
highVel
,
(
uint
)
lowVel
,
(
uint
)
acc
);
return
HCBoardManager
.
StartHomeMove
(
slvAddr
,(
uint
)
highVel
,
(
uint
)
lowVel
,
(
uint
)
acc
);
}
}
public
bool
IsHomeMoveEnd
(
string
portName
,
short
slvAddr
)
public
bool
IsHomeMoveEnd
(
string
portName
,
short
slvAddr
)
{
{
...
...
DeviceLibrary/DeviceLibrary/IAxisManager.cs
查看文件 @
bde4b79
...
@@ -24,7 +24,7 @@ namespace DeviceLibrary
...
@@ -24,7 +24,7 @@ namespace DeviceLibrary
void
ServoOn
(
string
portName
,
short
slvAddr
);
void
ServoOn
(
string
portName
,
short
slvAddr
);
void
ServoOff
(
string
portName
,
short
slvAddr
);
void
ServoOff
(
string
portName
,
short
slvAddr
);
void
RelMove
(
string
portName
,
short
slvAddr
,
int
position
,
int
targetSpeed
,
int
ptpAcc
,
int
ptpDec
);
void
RelMove
(
string
portName
,
short
slvAddr
,
int
position
,
int
targetSpeed
,
int
ptpAcc
,
int
ptpDec
);
void
HomeMove
(
string
portName
,
short
slvAddr
,
int
highVel
,
int
lowVel
,
int
acc
);
bool
HomeMove
(
string
portName
,
short
slvAddr
,
int
highVel
,
int
lowVel
,
int
acc
);
void
SpeedMove
(
string
portName
,
short
slvAddr
,
int
speed
,
int
acc
,
int
dec
);
void
SpeedMove
(
string
portName
,
short
slvAddr
,
int
speed
,
int
acc
,
int
dec
);
void
SuddenStop
(
string
portName
,
short
slvAddr
);
void
SuddenStop
(
string
portName
,
short
slvAddr
);
...
...
DeviceLibrary/theMachine/MainMachine _BtnProcess.cs
查看文件 @
bde4b79
...
@@ -35,11 +35,6 @@ namespace DeviceLibrary
...
@@ -35,11 +35,6 @@ namespace DeviceLibrary
ProcessMsgEvent
?.
Invoke
(
Msg
.
get
());
ProcessMsgEvent
?.
Invoke
(
Msg
.
get
());
//暂停时按下reaet按钮
if
(
RobotManage
.
isRunning
&&
UserPause
)
{
RobotManage
.
UserPause
(
"Reset_BTN"
,
false
);
}
}
}
void
Run_BTN
()
void
Run_BTN
()
{
{
...
@@ -55,6 +50,11 @@ namespace DeviceLibrary
...
@@ -55,6 +50,11 @@ namespace DeviceLibrary
Msg
.
add
(
crc
.
GetString
(
L
.
runbtn_press_with_sudden
,
"急停中,按下启动按钮,无法启动."
),
MsgLevel
.
warning
);
Msg
.
add
(
crc
.
GetString
(
L
.
runbtn_press_with_sudden
,
"急停中,按下启动按钮,无法启动."
),
MsgLevel
.
warning
);
}
}
lastSuddenStop
=
false
;
lastSuddenStop
=
false
;
//暂停时按下reaet按钮
if
(
RobotManage
.
isRunning
&&
UserPause
)
{
RobotManage
.
UserPause
(
"Run_BTN"
,
false
);
}
LogUtil
.
info
(
"按下启动按钮"
);
LogUtil
.
info
(
"按下启动按钮"
);
ProcessMsgEvent
?.
Invoke
(
Msg
.
get
());
ProcessMsgEvent
?.
Invoke
(
Msg
.
get
());
}
}
...
...
DeviceLibrary/theMachine/MainMachine.cs
查看文件 @
bde4b79
...
@@ -345,6 +345,7 @@ namespace DeviceLibrary
...
@@ -345,6 +345,7 @@ namespace DeviceLibrary
LogUtil
.
info
(
"开始停止系统2."
);
LogUtil
.
info
(
"开始停止系统2."
);
mstart
=
false
;
mstart
=
false
;
AutoInOutTest
=
false
;
AutoInOutTest
=
false
;
ClearOutJob
();
ServerCM
.
StopConnectServer
();
ServerCM
.
StopConnectServer
();
Thread
.
Sleep
(
300
);
Thread
.
Sleep
(
300
);
Alarm
(
AlarmType
.
None
);
Alarm
(
AlarmType
.
None
);
...
...
DeviceLibrary/theMachine/MainMachine_Store.cs
查看文件 @
bde4b79
...
@@ -16,6 +16,10 @@ namespace DeviceLibrary
...
@@ -16,6 +16,10 @@ namespace DeviceLibrary
StoreJobList
OutStoreJobList
=
new
StoreJobList
(
$
"批量"
);
StoreJobList
OutStoreJobList
=
new
StoreJobList
(
$
"批量"
);
StoreJobList
OutSingleJobList
=
new
StoreJobList
(
$
"单盘"
);
StoreJobList
OutSingleJobList
=
new
StoreJobList
(
$
"单盘"
);
public
void
ClearOutJob
()
{
}
public
void
AddOutStoreTask
(
string
posId
,
int
plateW
,
int
plateH
)
public
void
AddOutStoreTask
(
string
posId
,
int
plateW
,
int
plateH
)
{
{
JobInfo
jobInfo
=
new
JobInfo
(
""
,
posId
,
plateW
,
plateH
);
JobInfo
jobInfo
=
new
JobInfo
(
""
,
posId
,
plateW
,
plateH
);
...
...
TheMachine/Form1.cs
查看文件 @
bde4b79
...
@@ -310,14 +310,22 @@ namespace TheMachine
...
@@ -310,14 +310,22 @@ namespace TheMachine
}
}
private
void
RobotManage_DataInitEvent
(
bool
state
,
string
msg
)
private
void
RobotManage_DataInitEvent
(
bool
state
,
string
msg
)
{
{
if
(
this
.
InvokeRequired
)
try
{
{
this
.
Invoke
((
EventHandler
)
delegate
if
(
this
.
InvokeRequired
)
{
{
RobotManage_DataInitEvent
(
state
,
msg
);
this
.
Invoke
((
EventHandler
)
delegate
});
{
return
;
RobotManage_DataInitEvent
(
state
,
msg
);
});
return
;
}
}
}
catch
(
Exception
ex
)
{
LogUtil
.
error
(
$
"RobotManage_DataInitEvent,{state},{msg}"
,
ex
);
}
ioc
.
Config
=
RobotManage
.
Config
;
ioc
.
Config
=
RobotManage
.
Config
;
bd
.
Config
=
RobotManage
.
Config
;
bd
.
Config
=
RobotManage
.
Config
;
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论