Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
孙克
/
ACSingleStore
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit 8ce0afe4
由
ke.sun
编写于
2018-04-04 17:04:35 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
调试修改
1 个父辈
c2b136f3
全部展开
隐藏空白字符变更
内嵌
并排
正在显示
7 个修改的文件
包含
84 行增加
和
83 行删除
source/ACSingleStore/FrmStoreBox.cs
source/DeviceLibrary/PanasonicServo/ACServerManager.cs
source/DeviceLibrary/PanasonicServo/ACServerManager_Partial.cs
source/DeviceLibrary/StoreConfig/AC/StoreConfig.csv
source/DeviceLibrary/acSingleStore/AC_SA_BoxBean.cs
source/DeviceLibrary/acSingleStore/AC_SA_BoxBean_Partial.cs
source/DeviceLibrary/store/KTK_Store.cs
source/ACSingleStore/FrmStoreBox.cs
查看文件 @
8ce0afe
...
@@ -840,7 +840,7 @@ namespace OnlineStore.ACSingleStore
...
@@ -840,7 +840,7 @@ namespace OnlineStore.ACSingleStore
private
void
料仓运转
ONToolStripMenuItem_Click
(
object
sender
,
EventArgs
e
)
private
void
料仓运转
ONToolStripMenuItem_Click
(
object
sender
,
EventArgs
e
)
{
{
this
.
Enabled
=
false
;
this
.
Enabled
=
false
;
store
.
RunAxis
();
store
.
RunAxis
(
false
);
this
.
Enabled
=
true
;
this
.
Enabled
=
true
;
LogUtil
.
info
(
"料仓运转ON完成"
);
LogUtil
.
info
(
"料仓运转ON完成"
);
}
}
...
...
source/DeviceLibrary/PanasonicServo/ACServerManager.cs
查看文件 @
8ce0afe
...
@@ -96,51 +96,51 @@ namespace OnlineStore.DeviceLibrary
...
@@ -96,51 +96,51 @@ namespace OnlineStore.DeviceLibrary
{
{
LogUtil
.
info
(
"开始初始化伺服【"
+
portName
+
"】【"
+
slvAddr
+
"】"
);
LogUtil
.
info
(
"开始初始化伺服【"
+
portName
+
"】【"
+
slvAddr
+
"】"
);
//写入block
//写入block
int
sleep
=
10
;
string
slvAddrStr
=
string
.
Format
(
strFromat
,
slvAddr
);
string
slvAddrStr
=
string
.
Format
(
strFromat
,
slvAddr
);
//block0=原点返回,正方向
//block0=原点返回,正方向
string
str0
=
slvAddrStr
+
"104800 000408 00000420 00000000 ffff"
;
string
str0
=
slvAddrStr
+
"104800 000408 00000420 00000000 ffff"
;
SendStrAndSleep
(
portName
,
str0
);
SendStrAndSleep
(
portName
,
str0
,
sleep
);
//block1=原点返回,反方向
//block1=原点返回,反方向
string
str1
=
slvAddrStr
+
"104804 000408 04000420 00000000 ffff"
;
string
str1
=
slvAddrStr
+
"104804 000408 04000420 00000000 ffff"
;
SendStrAndSleep
(
portName
,
str1
);
SendStrAndSleep
(
portName
,
str1
,
sleep
);
//block2=绝对位置运动
//block2=绝对位置运动
string
str2
=
slvAddrStr
+
"104808 000408 10000211EC78FFFF ffff"
;
string
str2
=
slvAddrStr
+
"104808 000408 10000211EC78FFFF ffff"
;
SendStrAndSleep
(
portName
,
str2
);
SendStrAndSleep
(
portName
,
str2
,
sleep
);
//block3=相对位置运动
//block3=相对位置运动
string
str3
=
slvAddrStr
+
"10480C 000408 10000111EC78FFFF ffff"
;
string
str3
=
slvAddrStr
+
"10480C 000408 10000111EC78FFFF ffff"
;
SendStrAndSleep
(
portName
,
str3
);
SendStrAndSleep
(
portName
,
str3
,
sleep
);
//block4=正方向匀速运动
//block4=正方向匀速运动
string
str4
=
slvAddrStr
+
"104810 000408 10000311 00000000 ffff"
;
string
str4
=
slvAddrStr
+
"104810 000408 10000311 00000000 ffff"
;
SendStrAndSleep
(
portName
,
str4
);
SendStrAndSleep
(
portName
,
str4
,
sleep
);
//block5=反方向匀速运动
//block5=反方向匀速运动
string
str5
=
slvAddrStr
+
"104814 000408 14000311 00000000 ffff"
;
string
str5
=
slvAddrStr
+
"104814 000408 14000311 00000000 ffff"
;
SendStrAndSleep
(
portName
,
str5
);
SendStrAndSleep
(
portName
,
str5
,
sleep
);
//block6=减速停止
//block6=减速停止
string
str6
=
slvAddrStr
+
"104818 000408 00000500 00000000 ffff"
;
string
str6
=
slvAddrStr
+
"104818 000408 00000500 00000000 ffff"
;
SendStrAndSleep
(
portName
,
str6
);
SendStrAndSleep
(
portName
,
str6
,
sleep
);
//block7=紧急停止
//block7=紧急停止
string
str7
=
slvAddrStr
+
"10481c 000408 00000510 00000000 ffff"
;
string
str7
=
slvAddrStr
+
"10481c 000408 00000510 00000000 ffff"
;
SendStrAndSleep
(
portName
,
str7
);
SendStrAndSleep
(
portName
,
str7
,
sleep
);
//0106460001009D12
//0106460001009D12
//速度 V1 =100
//速度 V1 =100
string
v1
=
slvAddrStr
+
"064601 "
+
SpeedToStr
(
targetSpeed
,
4
)
+
" ffff"
;
string
v1
=
slvAddrStr
+
"064601 "
+
SpeedToStr
(
targetSpeed
,
4
)
+
" ffff"
;
SendStrAndSleep
(
portName
,
v1
);
SendStrAndSleep
(
portName
,
v1
,
sleep
);
//加速度 A1 =30
//加速度 A1 =30
string
a1
=
slvAddrStr
+
"064611 "
+
SpeedToStr
(
addSpeed
,
4
)
+
" ffff"
;
string
a1
=
slvAddrStr
+
"064611 "
+
SpeedToStr
(
addSpeed
,
4
)
+
" ffff"
;
SendStrAndSleep
(
portName
,
a1
);
SendStrAndSleep
(
portName
,
a1
,
sleep
);
//减速度 D1=30
//减速度 D1=30
string
d1
=
slvAddrStr
+
"064621 "
+
SpeedToStr
(
delSpeed
,
4
)
+
" ffff"
;
string
d1
=
slvAddrStr
+
"064621 "
+
SpeedToStr
(
delSpeed
,
4
)
+
" ffff"
;
SendStrAndSleep
(
portName
,
d1
);
SendStrAndSleep
(
portName
,
d1
,
sleep
);
//原点返回高速 homeHighSpeed=100
//原点返回高速 homeHighSpeed=100
SendStrAndSleep
(
portName
,
slvAddrStr
+
"06 4637 "
+
SpeedToStr
(
homeHighSpeed
,
4
)
+
" ffff"
);
SendStrAndSleep
(
portName
,
slvAddrStr
+
"06 4637 "
+
SpeedToStr
(
homeHighSpeed
,
4
)
+
" ffff"
,
sleep
);
//原点返回抵速 homeLowSpeed=50
//原点返回抵速 homeLowSpeed=50
SendStrAndSleep
(
portName
,
slvAddrStr
+
"06 4638 "
+
SpeedToStr
(
homeLowSpeed
,
4
)
+
" ffff"
);
SendStrAndSleep
(
portName
,
slvAddrStr
+
"06 4638 "
+
SpeedToStr
(
homeLowSpeed
,
4
)
+
" ffff"
,
sleep
);
//原点返回加速度=30
//原点返回加速度=30
SendStrAndSleep
(
portName
,
slvAddrStr
+
"06 4639 "
+
SpeedToStr
(
homeAddSpeed
,
4
)
+
" ffff"
);
SendStrAndSleep
(
portName
,
slvAddrStr
+
"06 4639 "
+
SpeedToStr
(
homeAddSpeed
,
4
)
+
" ffff"
,
sleep
);
UpdateEEPROM
(
portName
,
slvAddr
);
UpdateEEPROM
(
portName
,
slvAddr
);
}
}
public
static
void
UpdateEEPROM
(
string
portName
,
int
slvAddr
)
public
static
void
UpdateEEPROM
(
string
portName
,
int
slvAddr
)
...
@@ -177,7 +177,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -177,7 +177,7 @@ namespace OnlineStore.DeviceLibrary
//先更新速度
//先更新速度
string
slvAddrStr
=
string
.
Format
(
strFromat
,
slvAddr
);
string
slvAddrStr
=
string
.
Format
(
strFromat
,
slvAddr
);
string
v1
=
slvAddrStr
+
"064601 "
+
SpeedToStr
(
targetSpeed
,
4
)
+
" ffff"
;
string
v1
=
slvAddrStr
+
"064601 "
+
SpeedToStr
(
targetSpeed
,
4
)
+
" ffff"
;
SendStrAndSleep
(
portName
,
v1
);
SendStrAndSleep
(
portName
,
v1
,
SleepMSendons
);
RelMove
(
portName
,
slvAddr
,
position
);
RelMove
(
portName
,
slvAddr
,
position
);
}
}
...
@@ -270,7 +270,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -270,7 +270,7 @@ namespace OnlineStore.DeviceLibrary
//0106460001009D12
//0106460001009D12
//速度 V1 =100
//速度 V1 =100
string
v1
=
slvAddrStr
+
"064601 "
+
SpeedToStr
(
targetSpeed
,
4
)
+
" ffff"
;
string
v1
=
slvAddrStr
+
"064601 "
+
SpeedToStr
(
targetSpeed
,
4
)
+
" ffff"
;
SendStrAndSleep
(
portName
,
v1
);
SendStrAndSleep
(
portName
,
v1
,
SleepMSendons
);
//绝对运动
//绝对运动
AbsMove
(
portName
,
slvAddr
,
targetPosition
);
AbsMove
(
portName
,
slvAddr
,
targetPosition
);
...
...
source/DeviceLibrary/PanasonicServo/ACServerManager_Partial.cs
查看文件 @
8ce0afe
...
@@ -39,14 +39,14 @@ namespace OnlineStore.DeviceLibrary
...
@@ -39,14 +39,14 @@ namespace OnlineStore.DeviceLibrary
Thread
.
Sleep
(
100
);
Thread
.
Sleep
(
100
);
OnlyOpenSTB
(
portName
,
slvAddr
);
OnlyOpenSTB
(
portName
,
slvAddr
);
}
}
public
static
void
SendStrAndSleep
(
string
portName
,
string
str
)
public
static
void
SendStrAndSleep
(
string
portName
,
string
str
,
int
sleepS
)
{
{
byte
[]
data
=
SerialBean
.
StringToByte
(
str
);
byte
[]
data
=
SerialBean
.
StringToByte
(
str
);
data
[
data
.
Length
-
1
]
=
0x00
;
data
[
data
.
Length
-
1
]
=
0x00
;
data
[
data
.
Length
-
2
]
=
0x00
;
data
[
data
.
Length
-
2
]
=
0x00
;
data
=
ACCMDManager
.
buildCheckData
(
data
,
data
.
Length
-
2
);
data
=
ACCMDManager
.
buildCheckData
(
data
,
data
.
Length
-
2
);
SendData
(
portName
,
data
);
SendData
(
portName
,
data
);
System
.
Threading
.
Thread
.
Sleep
(
SleepMSendons
);
System
.
Threading
.
Thread
.
Sleep
(
sleepS
);
}
}
public
static
void
SendStr
(
string
portName
,
string
str
)
public
static
void
SendStr
(
string
portName
,
string
str
)
{
{
...
@@ -206,7 +206,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -206,7 +206,7 @@ namespace OnlineStore.DeviceLibrary
AcSerialBean
bean
=
GetSerialBean
(
portName
);
AcSerialBean
bean
=
GetSerialBean
(
portName
);
if
(
bean
==
null
)
if
(
bean
==
null
)
{
{
LogUtil
.
info
(
"ACServerManager SendData(string portName, byte[] data)试图写入数据:"
+
strSend
+
",发现串口【"
+
portName
+
"】不在列表中
"
);
LogUtil
.
debug
(
"ACServerManager SendData 试图向未打开串口【"
+
portName
+
"】写入数据:"
+
strSend
+
"。
"
);
return
;
return
;
}
}
...
@@ -244,7 +244,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -244,7 +244,7 @@ namespace OnlineStore.DeviceLibrary
AcSerialBean
bean
=
GetSerialBean
(
portName
);
AcSerialBean
bean
=
GetSerialBean
(
portName
);
if
(
bean
==
null
)
if
(
bean
==
null
)
{
{
LogUtil
.
info
(
"ACServerManager SendCommand(string portName, byte[] data, int outTime, int reviceLength) 试图写入数据:"
+
strSend
+
",发现串口【"
+
portName
+
"】不在列表中
"
);
LogUtil
.
debug
(
"ACServerManager SendCommand 试图向未打开串口【"
+
portName
+
"】写入数据:"
+
strSend
+
"。
"
);
}
}
else
else
{
{
...
@@ -345,7 +345,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -345,7 +345,7 @@ namespace OnlineStore.DeviceLibrary
int
length
=
2
;
int
length
=
2
;
byte
[]
dataArray
=
ACCMDManager
.
GetWriteData
(
slvAddr
,
ACCMDManager
.
CMD_WriteCoil
,
addr
,
data
,
length
);
byte
[]
dataArray
=
ACCMDManager
.
GetWriteData
(
slvAddr
,
ACCMDManager
.
CMD_WriteCoil
,
addr
,
data
,
length
);
SendData
(
portName
,
dataArray
);
SendData
(
portName
,
dataArray
);
System
.
Threading
.
Thread
.
Sleep
(
100
0
);
System
.
Threading
.
Thread
.
Sleep
(
100
);
data
=
"0000"
;
data
=
"0000"
;
dataArray
=
ACCMDManager
.
GetWriteData
(
slvAddr
,
ACCMDManager
.
CMD_WriteCoil
,
addr
,
data
,
length
);
dataArray
=
ACCMDManager
.
GetWriteData
(
slvAddr
,
ACCMDManager
.
CMD_WriteCoil
,
addr
,
data
,
length
);
SendData
(
portName
,
dataArray
);
SendData
(
portName
,
dataArray
);
...
...
source/DeviceLibrary/StoreConfig/AC/StoreConfig.csv
查看文件 @
8ce0afe
...
@@ -43,24 +43,24 @@ PRO,气压检测IO关闭需要持续的时间,AirCheckSeconds,3,,,,,,
...
@@ -43,24 +43,24 @@ PRO,气压检测IO关闭需要持续的时间,AirCheckSeconds,3,,,,,,
PRO,温湿度传感器地址,TemperateServer_Port,9001,,,,,,
PRO,温湿度传感器地址,TemperateServer_Port,9001,,,,,,
PRO,预警温度,WarnTemperate,80,,,,,,
PRO,预警温度,WarnTemperate,80,,,,,,
PRO,预警湿度,WarnHumidity,80,,,,,,
PRO,预警湿度,WarnHumidity,80,,,,,,
PRO,(轴一)旋转轴目标速度,MiddleAxis_TargetSpeed,
1
00,,,,,,
PRO,(轴一)旋转轴目标速度,MiddleAxis_TargetSpeed,
2
00,,,,,,
PRO,(轴一)旋转轴加速度,MiddleAxis_AddSpeed,
3
0,,,,,,
PRO,(轴一)旋转轴加速度,MiddleAxis_AddSpeed,
50
0,,,,,,
PRO,(轴一)旋转轴减速度,MiddleAxis_DelSpeed,
3
0,,,,,,
PRO,(轴一)旋转轴减速度,MiddleAxis_DelSpeed,
50
0,,,,,,
PRO,(轴一)旋转轴原点低速度,MiddleAxis_HomeLowSpeed,
20
,,,,,,
PRO,(轴一)旋转轴原点低速度,MiddleAxis_HomeLowSpeed,
5
,,,,,,
PRO,(轴一)旋转轴原点高速,MiddleAxis_HomeHighSpeed,
4
0,,,,,,
PRO,(轴一)旋转轴原点高速,MiddleAxis_HomeHighSpeed,
5
0,,,,,,
PRO,(轴一)旋转轴原点加速度,MiddleAxis_HomeAddSpeed,
1
0,,,,,
PRO,(轴一)旋转轴原点加速度,MiddleAxis_HomeAddSpeed,
80
0,,,,,
PRO,(轴二)升降轴轴目标速度,UpdownAxis_TargetSpeed,
1
00,,,,,,
PRO,(轴二)升降轴轴目标速度,UpdownAxis_TargetSpeed,
2
00,,,,,,
PRO,(轴二)升降轴轴加速度,UpdownAxis_AddSpeed,
3
0,,,,,,
PRO,(轴二)升降轴轴加速度,UpdownAxis_AddSpeed,
50
0,,,,,,
PRO,(轴二)升降轴轴减速度,UpdownAxis_DelSpeed,
3
0,,,,,,
PRO,(轴二)升降轴轴减速度,UpdownAxis_DelSpeed,
50
0,,,,,,
PRO,(轴二)升降轴轴原点低速度,UpdownAxis_HomeLowSpeed,
2
0,,,,,,
PRO,(轴二)升降轴轴原点低速度,UpdownAxis_HomeLowSpeed,
1
0,,,,,,
PRO,(轴二)升降轴轴原点高速,UpdownAxis_HomeHighSpeed,
4
0,,,,,
PRO,(轴二)升降轴轴原点高速,UpdownAxis_HomeHighSpeed,
5
0,,,,,
PRO,(轴二)升降轴轴原点加速度,UpdownAxis_HomeAddSpeed,
1
0,,,,,
PRO,(轴二)升降轴轴原点加速度,UpdownAxis_HomeAddSpeed,
50
0,,,,,
PRO,(轴三)进出轴目标速度,InoutAxis_TargetSpeed,
1
00,,,,,,
PRO,(轴三)进出轴目标速度,InoutAxis_TargetSpeed,
2
00,,,,,,
PRO,(轴三)进出轴加速度,InoutAxis_AddSpeed,
3
0,,,,,,
PRO,(轴三)进出轴加速度,InoutAxis_AddSpeed,
50
0,,,,,,
PRO,(轴三)进出轴减速度,InoutAxis_DelSpeed,
3
0,,,,,,
PRO,(轴三)进出轴减速度,InoutAxis_DelSpeed,
50
0,,,,,,
PRO,(轴三)进出轴原点低速,InoutAxis_HomeLowSpeed,
4
0,,,,,,
PRO,(轴三)进出轴原点低速,InoutAxis_HomeLowSpeed,
2
0,,,,,,
PRO,(轴三)进出轴原点高速,InoutAxis_HomeHighSpeed,60,,,,,,
PRO,(轴三)进出轴原点高速,InoutAxis_HomeHighSpeed,60,,,,,,
PRO,(轴三)进出轴原点加速度,InoutAxis_HomeAddSpeed,
2
0,,,,,,
PRO,(轴三)进出轴原点加速度,InoutAxis_HomeAddSpeed,
50
0,,,,,,
PRO,升降轴(轴2)P1速度,UpDownAxis_P1_Speed,100,,,,,,
PRO,升降轴(轴2)P1速度,UpDownAxis_P1_Speed,100,,,,,,
PRO,升降轴(轴2)P2速度,UpDownAxis_P2_Speed,100,,,,,,
PRO,升降轴(轴2)P2速度,UpDownAxis_P2_Speed,100,,,,,,
PRO,升降轴(轴2)P3速度,UpDownAxis_P3_Speed,100,,,,,,
PRO,升降轴(轴2)P3速度,UpDownAxis_P3_Speed,100,,,,,,
...
@@ -83,20 +83,7 @@ PRO,(轴三)进出轴停止时可误差的脉冲数的最大值,InoutAxis_ErrorCountMax,1000,,,,,
...
@@ -83,20 +83,7 @@ PRO,(轴三)进出轴停止时可误差的脉冲数的最大值,InoutAxis_ErrorCountMax,1000,,,,,
PRO,出入库多少次,会自动重置旋转轴,Box_ResetMCount,1000,,,,,,
PRO,出入库多少次,会自动重置旋转轴,Box_ResetMCount,1000,,,,,,
PRO,出入库多少次,会自动重置所有轴操作,Box_ResetACount,100,,,,,,
PRO,出入库多少次,会自动重置所有轴操作,Box_ResetACount,100,,,,,,
PRO,IO信号超时时间(毫秒),IOSingle_TimerOut,10000,,,,,,
PRO,IO信号超时时间(毫秒),IOSingle_TimerOut,10000,,,,,,
PRO,是否使用料盘检测信号,IsUse_Tray_Check,0,,,,,,
PRO,是否使用料盘检测信号,IsUse_Tray_Check,0,,,,,,
,,,,,,,,,
PRO,硕科步进电机(压紧轴)控制端口号,CompressAxis_PortName,COM4,,,,,,
PRO,硕科步进电机(压紧轴)控制波特率,CompressAxis_PortBaudrate,9600,,,,,,
PRO,硕科步进电机(压紧轴)控制奇偶校验,CompressAxis_PortParity,0,,,,,,
PRO,硕科步进电机(压紧轴)控制停止位,CompressAxis_StopBits,1,,,,,,
PRO,硕科步进电机(压紧轴)控制初速度,CompressAxis_StartSpeed,50000,,,,,,
PRO,硕科步进电机(压紧轴)控制最大速度,CompressAxis_MaxSpeed,200000,,,,,,
PRO,硕科步进电机(压紧轴)控制末速度,CompressAxis_EndSpeed,70000,,,,,,
PRO,硕科步进电机(压紧轴)控制加速度,CompressAxis_AddSpeed,50000,,,,,,
PRO,硕科步进电机(压紧轴)控制减速度,CompressAxis_DelSpeed,50000,,,,,,
PRO,硕科步进电机(压紧轴)控制归零速度(原点返回速度),CompressAxis_HomeSpeed,50000,,,,,,
PRO,硕科步进电机轴地址(压紧轴),CompressAxis_Slv,1,,,,,,
,,,,,,,,,
PRO,(轴一)旋转轴最小限位,MiddleAxis_PositionMin,0,,,,,,
PRO,(轴一)旋转轴最小限位,MiddleAxis_PositionMin,0,,,,,,
PRO,(轴二)升降轴最小限位,UpdownAxis_PositionMin,0,,,,,,
PRO,(轴二)升降轴最小限位,UpdownAxis_PositionMin,0,,,,,,
PRO,(轴三)进出轴最小限位,InoutAxis_PositionMin,0,,,,,,
PRO,(轴三)进出轴最小限位,InoutAxis_PositionMin,0,,,,,,
...
...
source/DeviceLibrary/acSingleStore/AC_SA_BoxBean.cs
查看文件 @
8ce0afe
...
@@ -12,7 +12,9 @@ namespace OnlineStore.DeviceLibrary
...
@@ -12,7 +12,9 @@ namespace OnlineStore.DeviceLibrary
/// 流水线自动料仓-Box类
/// 流水线自动料仓-Box类
/// </summary>
/// </summary>
public
partial
class
AC_SA_BoxBean
:
KTK_Store
public
partial
class
AC_SA_BoxBean
:
KTK_Store
{
/// <summary>
{
private
static
bool
IsIntSlvBlock
=
false
;
/// <summary>
/// 开始运行
/// 开始运行
/// </summary>
/// </summary>
public
static
bool
IsRun
=
false
;
public
static
bool
IsRun
=
false
;
...
@@ -235,14 +237,11 @@ namespace OnlineStore.DeviceLibrary
...
@@ -235,14 +237,11 @@ namespace OnlineStore.DeviceLibrary
//if (suddenBtn == IO_VALUE.HIGH && airCheck == IO_VALUE.HIGH)
//if (suddenBtn == IO_VALUE.HIGH && airCheck == IO_VALUE.HIGH)
{
{
//lastAirValue = airCheck;
//lastAirValue = airCheck;
lastAirCloseTime
=
DateTime
.
Now
;
lastAirCloseTime
=
DateTime
.
Now
;
if
(!
RunAxis
(
true
))
RunAxis
();
//打开所有轴
if
(!
OpenAllAxis
())
{
{
return
false
;
return
false
;
}
}
//TODO 启动时先所有轴远点返回,测试暂时关闭
//TODO 启动时先所有轴远点返回,测试暂时关闭
storeRunStatus
=
StoreRunStatus
.
HomeMoving
;
storeRunStatus
=
StoreRunStatus
.
HomeMoving
;
...
@@ -340,11 +339,12 @@ namespace OnlineStore.DeviceLibrary
...
@@ -340,11 +339,12 @@ namespace OnlineStore.DeviceLibrary
StoreMove
.
NewMove
(
StoreMoveType
.
StoreReset
);
StoreMove
.
NewMove
(
StoreMoveType
.
StoreReset
);
WarnMsg
=
""
;
WarnMsg
=
""
;
RunAxis
();
if
(!
RunAxis
(
true
))
//打开四个轴
//
//
打开四个轴
if
(!
OpenAllAxis
())
//
if (!OpenAllAxis())
{
{
LogUtil
.
info
(
LOGGER
,
StoreName
+
"复位时打开轴失败,需要再次复位,直接报警停止复位"
);
LogUtil
.
info
(
LOGGER
,
StoreName
+
"复位时打开轴失败,需要再次复位,直接报警停止复位"
);
return
;
}
}
if
(
IsHasCompress_Axis
)
if
(
IsHasCompress_Axis
)
{
{
...
@@ -553,7 +553,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -553,7 +553,7 @@ namespace OnlineStore.DeviceLibrary
}
}
#
endregion
#
endregion
public
void
RunAxis
(
)
public
bool
RunAxis
(
bool
isCheck
)
{
{
KNDIOMove
(
IO_Type
.
Run_Sign
,
IO_VALUE
.
HIGH
);
KNDIOMove
(
IO_Type
.
Run_Sign
,
IO_VALUE
.
HIGH
);
Thread
.
Sleep
(
1000
);
Thread
.
Sleep
(
1000
);
...
@@ -563,17 +563,31 @@ namespace OnlineStore.DeviceLibrary
...
@@ -563,17 +563,31 @@ namespace OnlineStore.DeviceLibrary
string
portName
=
moveAxis
.
DeviceName
;
string
portName
=
moveAxis
.
DeviceName
;
short
slvAddr
=
moveAxis
.
GetAxisValue
();
short
slvAddr
=
moveAxis
.
GetAxisValue
();
ACServerManager
.
OpenPort
(
portName
);
ACServerManager
.
OpenPort
(
portName
);
Thread
.
Sleep
(
10
0
);
Thread
.
Sleep
(
5
0
);
//初始化串口
//初始化串口
//ACServerManager.InitSlvAddr(portName, slvAddr);
//ACServerManager.InitSlvAddr(portName, slvAddr);
ACServerManager
.
InitSlvAddr
(
portName
,
slvAddr
,
moveAxis
.
TargetSpeed
,
moveAxis
.
AddSpeed
,
moveAxis
.
DelSpeed
,
if
(!
IsIntSlvBlock
)
moveAxis
.
HomeHighSpeed
,
moveAxis
.
HomeLowSpeed
,
moveAxis
.
HomeAddSpeed
);
{
ACServerManager
.
InitSlvAddr
(
portName
,
slvAddr
,
moveAxis
.
TargetSpeed
,
moveAxis
.
AddSpeed
,
moveAxis
.
DelSpeed
,
Thread
.
Sleep
(
100
);
moveAxis
.
HomeHighSpeed
,
moveAxis
.
HomeLowSpeed
,
moveAxis
.
HomeAddSpeed
);
//打开伺服
Thread
.
Sleep
(
100
);
}
ACServerManager
.
AlarmClear
(
portName
,
slvAddr
);
Thread
.
Sleep
(
50
);
ACServerManager
.
ServoOn
(
portName
,
slvAddr
);
ACServerManager
.
ServoOn
(
portName
,
slvAddr
);
}
}
Thread
.
Sleep
(
1000
);
//打开所有轴
if
(
isCheck
)
{
if
(!
OpenAllAxis
())
{
return
false
;
}
}
IsIntSlvBlock
=
true
;
KNDIOMove
(
IO_Type
.
Axis_Brake
,
IO_VALUE
.
HIGH
);
KNDIOMove
(
IO_Type
.
Axis_Brake
,
IO_VALUE
.
HIGH
);
return
true
;
}
}
/// <summary>
/// <summary>
/// 打开所有轴
/// 打开所有轴
...
@@ -594,8 +608,8 @@ namespace OnlineStore.DeviceLibrary
...
@@ -594,8 +608,8 @@ namespace OnlineStore.DeviceLibrary
LogUtil
.
info
(
LOGGER
,
StoreName
+
"第一次打开轴"
+
axis
.
Explain
+
"失败,先清理一下报警,再重新打开一次"
);
LogUtil
.
info
(
LOGGER
,
StoreName
+
"第一次打开轴"
+
axis
.
Explain
+
"失败,先清理一下报警,再重新打开一次"
);
ACServerManager
.
AlarmClear
(
axis
.
DeviceName
,
axis
.
GetAxisValue
());
ACServerManager
.
AlarmClear
(
axis
.
DeviceName
,
axis
.
GetAxisValue
());
System
.
Threading
.
Thread
.
Sleep
(
1200
);
System
.
Threading
.
Thread
.
Sleep
(
1200
);
ACServerManager
.
ServoOn
(
axis
.
DeviceName
,
axis
.
GetAxisValue
());
ACServerManager
.
ServoOn
(
axis
.
DeviceName
,
axis
.
GetAxisValue
());
System
.
Threading
.
Thread
.
Sleep
(
100
);
if
(
ACServerManager
.
ServerOnStatus
(
axis
.
DeviceName
,
axis
.
GetAxisValue
()))
if
(
ACServerManager
.
ServerOnStatus
(
axis
.
DeviceName
,
axis
.
GetAxisValue
()))
{
{
LogUtil
.
info
(
LOGGER
,
StoreName
+
"清理报警后重新打卡轴成功:"
+
axis
.
Explain
);
LogUtil
.
info
(
LOGGER
,
StoreName
+
"清理报警后重新打卡轴成功:"
+
axis
.
Explain
);
...
@@ -685,7 +699,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -685,7 +699,7 @@ namespace OnlineStore.DeviceLibrary
{
{
return
;
return
;
}
}
LogUtil
.
error
(
LOGGER
,
StoreName
+
"
XXXXXXXXXXXXXXXXXXXX
报警,报警类型:"
+
alarmType
);
LogUtil
.
error
(
LOGGER
,
StoreName
+
" 报警,报警类型:"
+
alarmType
);
if
(
alarmType
!=
StoreAlarmType
.
IoSingleTimeOut
)
if
(
alarmType
!=
StoreAlarmType
.
IoSingleTimeOut
)
{
{
StopMove
();
StopMove
();
...
@@ -909,7 +923,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -909,7 +923,7 @@ namespace OnlineStore.DeviceLibrary
// isNoAirCheck = false;
// isNoAirCheck = false;
//}
//}
//检查运动轴报警
//检查运动轴报警
if
(
storeRunStatus
>
=
StoreRunStatus
.
Runing
&&
(!
isInSuddenDown
))
if
(
storeRunStatus
>
StoreRunStatus
.
Wait
&&
(!
isInSuddenDown
))
{
{
CheckAxisAlarm
();
CheckAxisAlarm
();
}
}
...
...
source/DeviceLibrary/acSingleStore/AC_SA_BoxBean_Partial.cs
查看文件 @
8ce0afe
此文件的差异被折叠,
点击展开。
source/DeviceLibrary/store/KTK_Store.cs
查看文件 @
8ce0afe
...
@@ -283,16 +283,16 @@ namespace OnlineStore.DeviceLibrary
...
@@ -283,16 +283,16 @@ namespace OnlineStore.DeviceLibrary
//判断是否需要重新运动
//判断是否需要重新运动
if
(
StoreMove
.
CanWhileCount
>
0
)
if
(
StoreMove
.
CanWhileCount
>
0
)
{
{
LogUtil
.
error
(
LOGGER
,
StoreName
+
" storeMoveStep="
+
StoreMove
.
MoveStep
+
moveAxis
.
DisplayStr
+
"目标位置["
+
targetPosition
+
"]速度["
+
targetSpeed
+
"]当前位置["
+
outCount
+
LogUtil
.
error
(
LOGGER
,
moveAxis
.
DisplayStr
+
"目标位置["
+
targetPosition
+
"]当前位置["
+
outCount
+
"]
,误差值大于最大误差["
+
moveAxis
.
CanErrorCountMax
+
"],但是轴已经停止运动,还有["
+
StoreMove
.
CanWhileCount
+
"]次可以重复运动的次数
"
);
"]
,误差过大,重新开始运动,剩余["
+
StoreMove
.
CanWhileCount
+
"]次
"
);
LogUtil
.
error
(
LOGGER
,
StoreName
+
" storeMoveStep="
+
StoreMove
.
MoveStep
+
moveAxis
.
DisplayStr
+
"目标位置["
+
targetPosition
+
"]重新开始运动"
);
//
LogUtil.error(LOGGER, StoreName + " storeMoveStep=" + StoreMove.MoveStep + moveAxis.DisplayStr + "目标位置[" + targetPosition + "]重新开始运动");
ACServerManager
.
AbsMove
(
moveAxis
.
DeviceName
,
moveAxis
.
GetAxisValue
(),
targetPosition
,
targetSpeed
);
ACServerManager
.
AbsMove
(
moveAxis
.
DeviceName
,
moveAxis
.
GetAxisValue
(),
targetPosition
,
targetSpeed
);
StoreMove
.
CanWhileCount
--;
StoreMove
.
CanWhileCount
--;
}
}
else
else
{
{
msg
=
StoreName
+
" storeMoveStep="
+
StoreMove
.
MoveStep
+
moveAxis
.
DisplayStr
+
"目标位置["
+
targetPosition
+
"]当前位置["
+
outCount
msg
=
StoreName
+
" storeMoveStep="
+
StoreMove
.
MoveStep
+
moveAxis
.
DisplayStr
+
"目标位置["
+
targetPosition
+
"]当前位置["
+
outCount
+
"]
误差值大于最大误差["
+
moveAxis
.
CanErrorCountMax
+
"],但是轴已经停止运动
,需要报警"
;
+
"]
,误差过大
,需要报警"
;
LogUtil
.
error
(
LOGGER
,
msg
);
LogUtil
.
error
(
LOGGER
,
msg
);
return
false
;
return
false
;
}
}
...
@@ -324,14 +324,14 @@ namespace OnlineStore.DeviceLibrary
...
@@ -324,14 +324,14 @@ namespace OnlineStore.DeviceLibrary
//判断是否需要重新运动
//判断是否需要重新运动
if
(
StoreMove
.
CanWhileCount
>
0
)
if
(
StoreMove
.
CanWhileCount
>
0
)
{
{
LogUtil
.
error
(
LOGGER
,
StoreName
+
moveAxis
.
DisplayStr
+
"收到原点完成信号,当前位置["
+
outCount
+
"],还有["
+
StoreMove
.
CanWhileCount
+
"]次可以重复运动的次数
"
);
LogUtil
.
error
(
LOGGER
,
moveAxis
.
DisplayStr
+
"收到原点完成信号,当前位置["
+
outCount
+
"],重新回原点,剩余["
+
StoreMove
.
CanWhileCount
+
"]次
"
);
LogUtil
.
error
(
LOGGER
,
StoreName
+
moveAxis
.
DisplayStr
+
"重新回原点"
);
//
LogUtil.error(LOGGER, StoreName + moveAxis.DisplayStr + "重新回原点");
ACServerManager
.
HomeMove
(
moveAxis
.
DeviceName
,
moveAxis
.
GetAxisValue
(),
moveAxis
.
HomeHighSpeed
);
ACServerManager
.
HomeMove
(
moveAxis
.
DeviceName
,
moveAxis
.
GetAxisValue
(),
moveAxis
.
HomeHighSpeed
);
StoreMove
.
CanWhileCount
--;
StoreMove
.
CanWhileCount
--;
}
}
else
else
{
{
msg
=
StoreName
+
" storeMoveStep="
+
StoreMove
.
MoveStep
+
moveAxis
.
DisplayStr
+
"收到原点完成信号,当前位置["
+
outCount
+
"]
,误差值大于["
+
moveAxis
.
CanErrorCountMax
+
"],
需要报警"
;
msg
=
StoreName
+
" storeMoveStep="
+
StoreMove
.
MoveStep
+
moveAxis
.
DisplayStr
+
"收到原点完成信号,当前位置["
+
outCount
+
"]
,误差过大,
需要报警"
;
LogUtil
.
error
(
LOGGER
,
msg
);
LogUtil
.
error
(
LOGGER
,
msg
);
return
false
;
return
false
;
}
}
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论