Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
孙克
/
ACSingleStore
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit 4164548e
由
几米阳光
编写于
2018-12-13 13:15:15 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
原点返回时若原点亮,先反向走2000
1 个父辈
8c49230a
显示空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
49 行增加
和
17 行删除
source/DeviceLibrary/PanasonicServo/ACServerManager.cs
source/DeviceLibrary/acSingleStore/AC_SA_BoxBean.cs
source/DeviceLibrary/PanasonicServo/ACServerManager.cs
查看文件 @
4164548
...
@@ -295,22 +295,41 @@ namespace OnlineStore.DeviceLibrary
...
@@ -295,22 +295,41 @@ namespace OnlineStore.DeviceLibrary
public
static
void
HomeMove
(
string
portName
,
int
slvAddr
,
int
speed
)
public
static
void
HomeMove
(
string
portName
,
int
slvAddr
,
int
speed
)
{
{
//默认负方向原点返回
try
//byte[] data = ACCMDManager.GetWriteData(slvAddr, ACCMDManager.CMD_WriteRegisters, ACCMDManager.BlockNo, ACCMDManager.Block_HomeMove1, 2);
{
//SendData(portName, data);
//先判断是否在原点,如果已经在原点,先向正方向走2000
//旋转轴回正方向,其他轴回负方向
int
homeSingle
=
GetHomeSingle
(
portName
,
slvAddr
);
//if (portName.Equals(ACStoreManager.store.Config.Middle_Axis.DeviceName))
if
(
homeSingle
.
Equals
(
1
))
//{
{
// UpdateBlock(portName, slvAddr, ACCMDManager.Block_HomeMove0);
int
isHomeEnd
=
GetHomeEndStatus
(
portName
,
slvAddr
);
// LogUtil.info("旋转轴原点返回方向:正方向");
if
(
isHomeEnd
.
Equals
(
1
))
//}
{
//else if (portName.Equals(ACStoreManager.store.Config.InOut_Axis.DeviceName))
int
value
=
2000
;
//{
LogUtil
.
info
(
"轴【"
+
portName
+
"】原点返回时发现原点已亮且回过原点,需要先相对走"
+
value
);
// UpdateBlock(portName, slvAddr, ACCMDManager.Block_HomeMove0);
RelMove
(
portName
,
slvAddr
,
value
);
// LogUtil.info("进出轴原点返回方向:正方向");
bool
isStop
=
false
;
//}
for
(
int
i
=
0
;
i
<=
10
;
i
++)
//else
{
//{
Thread
.
Sleep
(
200
);
if
(
GetBusyStatus
(
portName
,
slvAddr
).
Equals
(
0
))
{
isStop
=
true
;
LogUtil
.
info
(
"轴【"
+
portName
+
"】 相对走"
+
value
+
"已结束"
);
break
;
}
}
if
(!
isStop
)
{
LogUtil
.
info
(
"轴【"
+
portName
+
"】 相对走"
+
value
+
"已等待2分钟,直接停止"
);
SuddenStop
(
portName
,
slvAddr
);
}
}
}
}
catch
(
Exception
ex
)
{
LogUtil
.
error
(
"轴【"
+
portName
+
"】原点返回前验证是否在原点出错:"
+
ex
.
StackTrace
);
}
UpdateBlock
(
portName
,
slvAddr
,
ACCMDManager
.
Block_HomeMove1
);
UpdateBlock
(
portName
,
slvAddr
,
ACCMDManager
.
Block_HomeMove1
);
LogUtil
.
debug
(
"回原点:反方向"
);
LogUtil
.
debug
(
"回原点:反方向"
);
//}
//}
...
...
source/DeviceLibrary/acSingleStore/AC_SA_BoxBean.cs
查看文件 @
4164548
...
@@ -257,6 +257,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -257,6 +257,7 @@ namespace OnlineStore.DeviceLibrary
StoreMove
.
NextMoveStep
(
StoreMoveStep
.
BOX_M_H_TOP1_InOutToP1
);
StoreMove
.
NextMoveStep
(
StoreMoveStep
.
BOX_M_H_TOP1_InOutToP1
);
LogUtil
.
info
(
LOGGER
,
StoreName
+
"到待机状态,进出轴到P1,判断叉子没有料盘"
);
LogUtil
.
info
(
LOGGER
,
StoreName
+
"到待机状态,进出轴到P1,判断叉子没有料盘"
);
ACAxisMove
(
Config
.
InOut_Axis
,
Config
.
InOutAxis_P1_Position
,
Config
.
InOutAxis_P1_Speed
);
ACAxisMove
(
Config
.
InOut_Axis
,
Config
.
InOutAxis_P1_Position
,
Config
.
InOutAxis_P1_Speed
);
ComBeforeHomeMove
();
//判断叉子没有料盘
//判断叉子没有料盘
//StoreMove.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.TrayCheck_Fixture, IO_VALUE.LOW));
//StoreMove.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.TrayCheck_Fixture, IO_VALUE.LOW));
}
}
...
@@ -375,6 +376,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -375,6 +376,7 @@ namespace OnlineStore.DeviceLibrary
//进出轴原点返回完成,将进出轴的位置设置=0
//进出轴原点返回完成,将进出轴的位置设置=0
AxisCountClear
(
Config
.
InOut_Axis
);
AxisCountClear
(
Config
.
InOut_Axis
);
ACAxisMove
(
Config
.
InOut_Axis
,
Config
.
InOutAxis_P1_Position
,
Config
.
InOutAxis_P1_Speed
);
ACAxisMove
(
Config
.
InOut_Axis
,
Config
.
InOutAxis_P1_Position
,
Config
.
InOutAxis_P1_Speed
);
ComBeforeHomeMove
();
//判断叉子没有料盘
//判断叉子没有料盘
//StoreMove.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.TrayCheck_Fixture, IO_VALUE.LOW));
//StoreMove.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.TrayCheck_Fixture, IO_VALUE.LOW));
CloseDoorAndWait
();
CloseDoorAndWait
();
...
@@ -447,7 +449,17 @@ namespace OnlineStore.DeviceLibrary
...
@@ -447,7 +449,17 @@ namespace OnlineStore.DeviceLibrary
default
:
break
;
default
:
break
;
}
}
}
}
private
void
ComBeforeHomeMove
()
{
if
(
IsHasCompress_Axis
)
{
int
relValue
=
-
2000
;
LogUtil
.
debug
(
"压紧轴相对位置:"
+
relValue
);
StoreMove
.
WaitList
.
Add
(
WaitResultInfo
.
WaitShuoKe
(
Config
.
CompressAxis_Slv
,
relValue
,
false
));
ShuoKeControls
.
RelativeMove
(
Config
.
CompressAxis_Slv
,
relValue
);
Thread
.
Sleep
(
100
);
}
}
private
void
ComMoveToPosition
(
int
targetPosition
)
private
void
ComMoveToPosition
(
int
targetPosition
)
{
{
if
(
IsHasCompress_Axis
)
if
(
IsHasCompress_Axis
)
...
@@ -503,6 +515,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -503,6 +515,7 @@ namespace OnlineStore.DeviceLibrary
//进出轴原点返回完成,将进出轴的位置设置=0
//进出轴原点返回完成,将进出轴的位置设置=0
AxisCountClear
(
Config
.
InOut_Axis
);
AxisCountClear
(
Config
.
InOut_Axis
);
ACAxisMove
(
Config
.
InOut_Axis
,
Config
.
InOutAxis_P1_Position
,
Config
.
InOutAxis_P1_Speed
);
ACAxisMove
(
Config
.
InOut_Axis
,
Config
.
InOutAxis_P1_Position
,
Config
.
InOutAxis_P1_Speed
);
ComBeforeHomeMove
();
//判断叉子没有料盘
//判断叉子没有料盘
//StoreMove.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.TrayCheck_Fixture, IO_VALUE.LOW));
//StoreMove.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.TrayCheck_Fixture, IO_VALUE.LOW));
CloseDoorAndWait
();
CloseDoorAndWait
();
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论