Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
孙克
/
ACSingleStore
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit 589d47aa
由
几米阳光
编写于
2019-03-21 15:35:51 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
三个轴原点返回都改为负方向
1 个父辈
faf869d1
全部展开
隐藏空白字符变更
内嵌
并排
正在显示
6 个修改的文件
包含
41 行增加
和
37 行删除
source/ACSingleStore/FrmStoreBox.Designer.cs
source/DeviceLibrary/PanasonicServo/ACCMDManager.cs
source/DeviceLibrary/PanasonicServo/ACServerManager.cs
source/DeviceLibrary/PanasonicServo/ACServerManager_Partial.cs
source/DeviceLibrary/ShuoKe/ShuoKeControls.cs
source/DeviceLibrary/acSingleStore/AC_SA_BoxBean_Partial.cs
source/ACSingleStore/FrmStoreBox.Designer.cs
查看文件 @
589d47a
此文件的差异被折叠,
点击展开。
source/DeviceLibrary/PanasonicServo/ACCMDManager.cs
查看文件 @
589d47a
...
...
@@ -2,7 +2,7 @@
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Text
;
using
System.Text
;
namespace
OnlineStore.DeviceLibrary
{
public
class
ACCMDManager
...
...
@@ -11,7 +11,8 @@ namespace OnlineStore.DeviceLibrary
/// 0132h 原点接近传感器输入 (HOME) 状态 ReadOnly 0: 输入 OFF 1: 输入 ON
/// </summary>
public
static
string
Home_Single
=
"0132"
;
// 0022h 负方向驱动禁止输入(NOT) ReadOnly 0: 输入 OFF、 1: 输入 ON
// 0023h 正方向驱动禁止输入(POT) ReadOnly 0: 输入 OFF、 1: 输入 ON
/// <summary>
///速度 4601
/// </summary>
...
...
@@ -23,11 +24,11 @@ namespace OnlineStore.DeviceLibrary
/// <summary>
/// 0120h 选通输入 (STB) 操作 R/W 0000h:输入 OFF、FF00h:输入 ON
/// </summary>
public
static
string
STB_Addr
=
"0120"
;
public
static
string
STB_Addr
=
"0120"
;
/// <summary>
/// 0124h 减速停止输入 (S-STOP) 操作 R/W 0000h:输入 OFF、FF00h:输入 ON
/// </summary>
public
static
string
Stop_Addr
=
"0124"
;
public
static
string
Stop_Addr
=
"0124"
;
/// <summary>
/// 0123h 紧急停止输入 (H-STOP) 操作 R/W 0000h:输入 OFF、FF00h:输入 ON
/// </summary>
...
...
@@ -50,7 +51,7 @@ namespace OnlineStore.DeviceLibrary
/// 实际位置=600F
/// </summary>
public
static
string
ActualPosition
=
"600F"
;
/// <summary>
/// BUSY状态=0140,0140h 动作执行状态 (BUSY) ReadOnly 0:未执行 1:执行中
public
static
string
BUSYStatus
=
"0140"
;
...
...
@@ -73,7 +74,7 @@ namespace OnlineStore.DeviceLibrary
/// <summary>
/// 读线圈01
/// </summary>
public
static
byte
CMD_ReadCoil
=
0x01
;
public
static
byte
CMD_ReadCoil
=
0x01
;
/// <summary>
/// 写线圈 05
/// </summary>
...
...
@@ -128,12 +129,12 @@ namespace OnlineStore.DeviceLibrary
/// </summary>
public
static
string
Block_SuddenStop
=
"7"
;
public
static
byte
[]
buildCheckData
(
byte
[]
sendData
,
int
length
)
public
static
byte
[]
buildCheckData
(
byte
[]
sendData
,
int
length
)
{
ushort
pChecksum
=
0
;
SerialBean
.
CalculateCRC
(
sendData
,
length
,
out
pChecksum
);
Ac
SerialBean
.
CalculateCRC
(
sendData
,
length
,
out
pChecksum
);
string
checkStr
=
Convert
.
ToString
(
pChecksum
,
16
);
byte
[]
checkByte
=
SerialBean
.
StringToByte
(
checkStr
);
byte
[]
checkByte
=
Ac
SerialBean
.
StringToByte
(
checkStr
);
if
(
checkByte
.
Length
==
1
)
{
sendData
[
length
]
=
checkByte
[
0
];
...
...
@@ -152,7 +153,7 @@ namespace OnlineStore.DeviceLibrary
// ( 2) 读取寄存器( 03h)
if
(
cmd
.
Equals
(
CMD_ReadRegisters
))
{
return
Get03WriteData
(
slvAddr
,
addr
,
length
);
return
Get03WriteData
(
slvAddr
,
addr
,
length
);
}
else
if
(
cmd
.
Equals
(
CMD_WriteRegisters
))
{
...
...
@@ -176,7 +177,7 @@ namespace OnlineStore.DeviceLibrary
byte
[]
sendData
=
new
byte
[
8
];
sendData
[
0
]
=
(
byte
)
slvAddr
;
sendData
[
1
]
=
CMD_WriteCoil
;
byte
[]
addrByte
=
SerialBean
.
StringToByte
(
addr
.
ToString
());
byte
[]
addrByte
=
Ac
SerialBean
.
StringToByte
(
addr
.
ToString
());
if
(
addrByte
.
Length
==
1
)
{
sendData
[
2
]
=
0x00
;
...
...
@@ -188,7 +189,7 @@ namespace OnlineStore.DeviceLibrary
sendData
[
2
]
=
addrByte
[
0
];
}
byte
[]
dataByte
=
SerialBean
.
StringToByte
(
dataValue
);
byte
[]
dataByte
=
Ac
SerialBean
.
StringToByte
(
dataValue
);
if
(
dataByte
.
Length
==
1
)
{
sendData
[
4
]
=
0x00
;
...
...
@@ -203,13 +204,13 @@ namespace OnlineStore.DeviceLibrary
sendData
=
buildCheckData
(
sendData
,
sendData
.
Length
-
2
);
return
sendData
;
}
private
static
byte
[]
Get01WriteData
(
int
slvAddr
,
string
addr
,
int
length
)
private
static
byte
[]
Get01WriteData
(
int
slvAddr
,
string
addr
,
int
length
)
{
byte
[]
sendData
=
new
byte
[
8
];
sendData
[
0
]
=
(
byte
)
slvAddr
;
sendData
[
1
]
=
CMD_ReadCoil
;
byte
[]
addrByte
=
SerialBean
.
StringToByte
(
addr
.
ToString
());
byte
[]
addrByte
=
Ac
SerialBean
.
StringToByte
(
addr
.
ToString
());
if
(
addrByte
.
Length
==
1
)
{
sendData
[
2
]
=
0x00
;
...
...
@@ -221,7 +222,7 @@ namespace OnlineStore.DeviceLibrary
sendData
[
2
]
=
addrByte
[
0
];
}
byte
[]
dataByte
=
SerialBean
.
StringToByte
(
length
.
ToString
());
byte
[]
dataByte
=
Ac
SerialBean
.
StringToByte
(
length
.
ToString
());
if
(
dataByte
.
Length
==
1
)
{
sendData
[
4
]
=
0x00
;
...
...
@@ -249,10 +250,10 @@ namespace OnlineStore.DeviceLibrary
//低位
//CRC 低位
//高位
byte
[]
sendData
=
new
byte
[
8
];
byte
[]
sendData
=
new
byte
[
8
];
sendData
[
0
]
=
(
byte
)
slvAddr
;
sendData
[
1
]
=
CMD_ReadRegisters
;
byte
[]
addrByte
=
SerialBean
.
StringToByte
(
addr
.
ToString
());
byte
[]
addrByte
=
Ac
SerialBean
.
StringToByte
(
addr
.
ToString
());
if
(
addrByte
.
Length
==
1
)
{
sendData
[
2
]
=
0x00
;
...
...
@@ -264,7 +265,7 @@ namespace OnlineStore.DeviceLibrary
sendData
[
2
]
=
addrByte
[
0
];
}
byte
[]
dataByte
=
SerialBean
.
StringToByte
(
length
.
ToString
());
byte
[]
dataByte
=
Ac
SerialBean
.
StringToByte
(
length
.
ToString
());
if
(
dataByte
.
Length
==
1
)
{
sendData
[
4
]
=
0x00
;
...
...
@@ -276,7 +277,7 @@ namespace OnlineStore.DeviceLibrary
sendData
[
5
]
=
dataByte
[
0
];
}
sendData
=
buildCheckData
(
sendData
,
sendData
.
Length
-
2
);
sendData
=
buildCheckData
(
sendData
,
sendData
.
Length
-
2
);
return
sendData
;
}
...
...
@@ -294,7 +295,7 @@ namespace OnlineStore.DeviceLibrary
byte
[]
sendData
=
new
byte
[
8
];
sendData
[
0
]
=
(
byte
)
slvAddr
;
sendData
[
1
]
=
CMD_WriteRegisters
;
byte
[]
addrByte
=
SerialBean
.
StringToByte
(
addr
.
ToString
());
byte
[]
addrByte
=
Ac
SerialBean
.
StringToByte
(
addr
.
ToString
());
if
(
addrByte
.
Length
==
1
)
{
sendData
[
2
]
=
0x00
;
...
...
@@ -306,7 +307,7 @@ namespace OnlineStore.DeviceLibrary
sendData
[
2
]
=
addrByte
[
0
];
}
byte
[]
dataByte
=
SerialBean
.
StringToByte
(
dataValue
);
byte
[]
dataByte
=
Ac
SerialBean
.
StringToByte
(
dataValue
);
if
(
dataByte
.
Length
==
1
)
{
sendData
[
4
]
=
0x00
;
...
...
@@ -316,14 +317,15 @@ namespace OnlineStore.DeviceLibrary
{
sendData
[
4
]
=
dataByte
[
0
];
sendData
[
5
]
=
dataByte
[
1
];
//sendData[4] = dataByte[1];
//sendData[5] = dataByte[0];
}
sendData
=
buildCheckData
(
sendData
,
sendData
.
Length
-
2
);
sendData
=
buildCheckData
(
sendData
,
sendData
.
Length
-
2
);
return
sendData
;
}
}
}
source/DeviceLibrary/PanasonicServo/ACServerManager.cs
查看文件 @
589d47a
此文件的差异被折叠,
点击展开。
source/DeviceLibrary/PanasonicServo/ACServerManager_Partial.cs
查看文件 @
589d47a
此文件的差异被折叠,
点击展开。
source/DeviceLibrary/ShuoKe/ShuoKeControls.cs
查看文件 @
589d47a
此文件的差异被折叠,
点击展开。
source/DeviceLibrary/acSingleStore/AC_SA_BoxBean_Partial.cs
查看文件 @
589d47a
...
...
@@ -163,18 +163,9 @@ namespace OnlineStore.DeviceLibrary
}
else
if
(
wait
.
WaitType
==
5
)
{
if
(
wait
.
IsHomeMove
)
{
wait
.
IsEnd
=
ShuoKeControls
.
IsHomeMoveEnd
(
wait
.
SlvAddr
,
StoreMove
.
LastSetpTime
);
}
else
{
wait
.
IsEnd
=
ShuoKeControls
.
IsMoveEnd
(
wait
.
SlvAddr
,
StoreMove
.
LastSetpTime
);
}
if
(!
wait
.
IsEnd
)
{
ShuoKeControls
.
GetStatus
(
wait
.
SlvAddr
);
}
string
msg
=
""
;
wait
.
IsEnd
=
ShuoKeIsEnd
(
wait
,
out
msg
);
NotOkMsg
=
NotOkMsg
+
" "
+
msg
;
}
if
(
wait
.
IsEnd
)
{
...
...
@@ -206,7 +197,18 @@ namespace OnlineStore.DeviceLibrary
}
}
private
bool
ShuoKeIsEnd
(
WaitResultInfo
wait
,
out
string
msg
)
{
msg
=
""
;
if
(
wait
.
IsHomeMove
)
{
return
ShuoKeControls
.
IsHomeMoveEnd
(
wait
.
SlvAddr
,
StoreMove
.
LastSetpTime
,
out
msg
);
}
else
{
return
ShuoKeControls
.
IsMoveEnd
(
wait
.
SlvAddr
,
wait
.
TargetPosition
,
StoreMove
.
LastSetpTime
,
out
msg
);
}
}
#
endregion
#
region
入库
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论