Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
孙克
/
ACSingleStore
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit 57fcc6e2
由
LN
编写于
2021-03-25 10:43:17 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
增加伺服ON输入信号读取
1 个父辈
a5ff6dbd
显示空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
69 行增加
和
24 行删除
source/ACSingleStore/FrmStoreBox.Designer.cs
source/ACSingleStore/FrmStoreBox.cs
source/DeviceLibrary/PanasonicServo/ACCMDManager.cs
source/DeviceLibrary/PanasonicServo/ACServerManager.cs
source/ACSingleStore/FrmStoreBox.Designer.cs
查看文件 @
57fcc6e
...
...
@@ -63,6 +63,8 @@
this
.
button5
=
new
System
.
Windows
.
Forms
.
Button
();
this
.
tabPage1
=
new
System
.
Windows
.
Forms
.
TabPage
();
this
.
groupAxis
=
new
System
.
Windows
.
Forms
.
GroupBox
();
this
.
label13
=
new
System
.
Windows
.
Forms
.
Label
();
this
.
textBoxON
=
new
System
.
Windows
.
Forms
.
TextBox
();
this
.
label5
=
new
System
.
Windows
.
Forms
.
Label
();
this
.
txtServoStatue
=
new
System
.
Windows
.
Forms
.
TextBox
();
this
.
label17
=
new
System
.
Windows
.
Forms
.
Label
();
...
...
@@ -635,6 +637,8 @@
//
this
.
groupAxis
.
Anchor
=
((
System
.
Windows
.
Forms
.
AnchorStyles
)(((
System
.
Windows
.
Forms
.
AnchorStyles
.
Top
|
System
.
Windows
.
Forms
.
AnchorStyles
.
Left
)
|
System
.
Windows
.
Forms
.
AnchorStyles
.
Right
)));
this
.
groupAxis
.
Controls
.
Add
(
this
.
label13
);
this
.
groupAxis
.
Controls
.
Add
(
this
.
textBoxON
);
this
.
groupAxis
.
Controls
.
Add
(
this
.
label5
);
this
.
groupAxis
.
Controls
.
Add
(
this
.
txtServoStatue
);
this
.
groupAxis
.
Controls
.
Add
(
this
.
label17
);
...
...
@@ -675,15 +679,32 @@
this
.
groupAxis
.
Font
=
new
System
.
Drawing
.
Font
(
"微软雅黑"
,
9F
,
System
.
Drawing
.
FontStyle
.
Regular
,
System
.
Drawing
.
GraphicsUnit
.
Point
,
((
byte
)(
134
)));
this
.
groupAxis
.
Location
=
new
System
.
Drawing
.
Point
(
6
,
6
);
this
.
groupAxis
.
Name
=
"groupAxis"
;
this
.
groupAxis
.
Size
=
new
System
.
Drawing
.
Size
(
546
,
299
);
this
.
groupAxis
.
Size
=
new
System
.
Drawing
.
Size
(
546
,
306
);
this
.
groupAxis
.
TabIndex
=
216
;
this
.
groupAxis
.
TabStop
=
false
;
this
.
groupAxis
.
Text
=
"伺服运动"
;
//
// label13
//
this
.
label13
.
AutoSize
=
true
;
this
.
label13
.
Location
=
new
System
.
Drawing
.
Point
(
28
,
157
);
this
.
label13
.
Name
=
"label13"
;
this
.
label13
.
Size
=
new
System
.
Drawing
.
Size
(
79
,
17
);
this
.
label13
.
TabIndex
=
328
;
this
.
label13
.
Text
=
"伺服ON输入:"
;
//
// textBoxON
//
this
.
textBoxON
.
Enabled
=
false
;
this
.
textBoxON
.
Location
=
new
System
.
Drawing
.
Point
(
113
,
154
);
this
.
textBoxON
.
Name
=
"textBoxON"
;
this
.
textBoxON
.
Size
=
new
System
.
Drawing
.
Size
(
25
,
23
);
this
.
textBoxON
.
TabIndex
=
327
;
//
// label5
//
this
.
label5
.
AutoSize
=
true
;
this
.
label5
.
Location
=
new
System
.
Drawing
.
Point
(
48
,
1
70
);
this
.
label5
.
Location
=
new
System
.
Drawing
.
Point
(
48
,
1
86
);
this
.
label5
.
Name
=
"label5"
;
this
.
label5
.
Size
=
new
System
.
Drawing
.
Size
(
59
,
17
);
this
.
label5
.
TabIndex
=
326
;
...
...
@@ -692,7 +713,7 @@
// txtServoStatue
//
this
.
txtServoStatue
.
Enabled
=
false
;
this
.
txtServoStatue
.
Location
=
new
System
.
Drawing
.
Point
(
113
,
1
67
);
this
.
txtServoStatue
.
Location
=
new
System
.
Drawing
.
Point
(
113
,
1
83
);
this
.
txtServoStatue
.
Name
=
"txtServoStatue"
;
this
.
txtServoStatue
.
Size
=
new
System
.
Drawing
.
Size
(
25
,
23
);
this
.
txtServoStatue
.
TabIndex
=
325
;
...
...
@@ -700,7 +721,7 @@
// label17
//
this
.
label17
.
AutoSize
=
true
;
this
.
label17
.
Location
=
new
System
.
Drawing
.
Point
(
155
,
2
71
);
this
.
label17
.
Location
=
new
System
.
Drawing
.
Point
(
155
,
2
63
);
this
.
label17
.
Name
=
"label17"
;
this
.
label17
.
Size
=
new
System
.
Drawing
.
Size
(
71
,
17
);
this
.
label17
.
TabIndex
=
324
;
...
...
@@ -710,7 +731,7 @@
// txtLimit2
//
this
.
txtLimit2
.
Enabled
=
false
;
this
.
txtLimit2
.
Location
=
new
System
.
Drawing
.
Point
(
232
,
26
8
);
this
.
txtLimit2
.
Location
=
new
System
.
Drawing
.
Point
(
232
,
26
0
);
this
.
txtLimit2
.
Name
=
"txtLimit2"
;
this
.
txtLimit2
.
Size
=
new
System
.
Drawing
.
Size
(
25
,
23
);
this
.
txtLimit2
.
TabIndex
=
321
;
...
...
@@ -718,7 +739,7 @@
// label19
//
this
.
label19
.
AutoSize
=
true
;
this
.
label19
.
Location
=
new
System
.
Drawing
.
Point
(
155
,
2
37
);
this
.
label19
.
Location
=
new
System
.
Drawing
.
Point
(
155
,
2
29
);
this
.
label19
.
Name
=
"label19"
;
this
.
label19
.
Size
=
new
System
.
Drawing
.
Size
(
71
,
17
);
this
.
label19
.
TabIndex
=
320
;
...
...
@@ -728,7 +749,7 @@
// txtLimit1
//
this
.
txtLimit1
.
Enabled
=
false
;
this
.
txtLimit1
.
Location
=
new
System
.
Drawing
.
Point
(
232
,
2
34
);
this
.
txtLimit1
.
Location
=
new
System
.
Drawing
.
Point
(
232
,
2
26
);
this
.
txtLimit1
.
Name
=
"txtLimit1"
;
this
.
txtLimit1
.
Size
=
new
System
.
Drawing
.
Size
(
25
,
23
);
this
.
txtLimit1
.
TabIndex
=
317
;
...
...
@@ -736,7 +757,7 @@
// label6
//
this
.
label6
.
AutoSize
=
true
;
this
.
label6
.
Location
=
new
System
.
Drawing
.
Point
(
167
,
203
);
this
.
label6
.
Location
=
new
System
.
Drawing
.
Point
(
167
,
195
);
this
.
label6
.
Name
=
"label6"
;
this
.
label6
.
Size
=
new
System
.
Drawing
.
Size
(
59
,
17
);
this
.
label6
.
TabIndex
=
300
;
...
...
@@ -745,7 +766,7 @@
// txtHomeSingle
//
this
.
txtHomeSingle
.
Enabled
=
false
;
this
.
txtHomeSingle
.
Location
=
new
System
.
Drawing
.
Point
(
232
,
200
);
this
.
txtHomeSingle
.
Location
=
new
System
.
Drawing
.
Point
(
232
,
192
);
this
.
txtHomeSingle
.
Name
=
"txtHomeSingle"
;
this
.
txtHomeSingle
.
Size
=
new
System
.
Drawing
.
Size
(
25
,
23
);
this
.
txtHomeSingle
.
TabIndex
=
297
;
...
...
@@ -753,7 +774,7 @@
// label11
//
this
.
label11
.
AutoSize
=
true
;
this
.
label11
.
Location
=
new
System
.
Drawing
.
Point
(
2
,
27
1
);
this
.
label11
.
Location
=
new
System
.
Drawing
.
Point
(
2
,
27
3
);
this
.
label11
.
Name
=
"label11"
;
this
.
label11
.
Size
=
new
System
.
Drawing
.
Size
(
105
,
17
);
this
.
label11
.
TabIndex
=
292
;
...
...
@@ -762,7 +783,7 @@
// txtHomeStatus
//
this
.
txtHomeStatus
.
Enabled
=
false
;
this
.
txtHomeStatus
.
Location
=
new
System
.
Drawing
.
Point
(
113
,
2
68
);
this
.
txtHomeStatus
.
Location
=
new
System
.
Drawing
.
Point
(
113
,
2
70
);
this
.
txtHomeStatus
.
Name
=
"txtHomeStatus"
;
this
.
txtHomeStatus
.
Size
=
new
System
.
Drawing
.
Size
(
25
,
23
);
this
.
txtHomeStatus
.
TabIndex
=
291
;
...
...
@@ -770,7 +791,7 @@
// label10
//
this
.
label10
.
AutoSize
=
true
;
this
.
label10
.
Location
=
new
System
.
Drawing
.
Point
(
41
,
2
37
);
this
.
label10
.
Location
=
new
System
.
Drawing
.
Point
(
41
,
2
44
);
this
.
label10
.
Name
=
"label10"
;
this
.
label10
.
Size
=
new
System
.
Drawing
.
Size
(
66
,
17
);
this
.
label10
.
TabIndex
=
289
;
...
...
@@ -779,7 +800,7 @@
// txtBusyStatus
//
this
.
txtBusyStatus
.
Enabled
=
false
;
this
.
txtBusyStatus
.
Location
=
new
System
.
Drawing
.
Point
(
113
,
2
34
);
this
.
txtBusyStatus
.
Location
=
new
System
.
Drawing
.
Point
(
113
,
2
41
);
this
.
txtBusyStatus
.
Name
=
"txtBusyStatus"
;
this
.
txtBusyStatus
.
Size
=
new
System
.
Drawing
.
Size
(
25
,
23
);
this
.
txtBusyStatus
.
TabIndex
=
288
;
...
...
@@ -787,7 +808,7 @@
// label2
//
this
.
label2
.
AutoSize
=
true
;
this
.
label2
.
Location
=
new
System
.
Drawing
.
Point
(
48
,
2
03
);
this
.
label2
.
Location
=
new
System
.
Drawing
.
Point
(
48
,
2
15
);
this
.
label2
.
Name
=
"label2"
;
this
.
label2
.
Size
=
new
System
.
Drawing
.
Size
(
59
,
17
);
this
.
label2
.
TabIndex
=
286
;
...
...
@@ -796,7 +817,7 @@
// txtAlarmStatus
//
this
.
txtAlarmStatus
.
Enabled
=
false
;
this
.
txtAlarmStatus
.
Location
=
new
System
.
Drawing
.
Point
(
113
,
2
00
);
this
.
txtAlarmStatus
.
Location
=
new
System
.
Drawing
.
Point
(
113
,
2
12
);
this
.
txtAlarmStatus
.
Name
=
"txtAlarmStatus"
;
this
.
txtAlarmStatus
.
Size
=
new
System
.
Drawing
.
Size
(
25
,
23
);
this
.
txtAlarmStatus
.
TabIndex
=
285
;
...
...
@@ -805,7 +826,7 @@
//
this
.
btnGetAlarm
.
BackColor
=
System
.
Drawing
.
SystemColors
.
Control
;
this
.
btnGetAlarm
.
FlatStyle
=
System
.
Windows
.
Forms
.
FlatStyle
.
Flat
;
this
.
btnGetAlarm
.
Location
=
new
System
.
Drawing
.
Point
(
290
,
2
15
);
this
.
btnGetAlarm
.
Location
=
new
System
.
Drawing
.
Point
(
290
,
2
07
);
this
.
btnGetAlarm
.
Name
=
"btnGetAlarm"
;
this
.
btnGetAlarm
.
Size
=
new
System
.
Drawing
.
Size
(
105
,
33
);
this
.
btnGetAlarm
.
TabIndex
=
284
;
...
...
@@ -820,7 +841,7 @@
this
.
btnReadPosition
.
FlatStyle
=
System
.
Windows
.
Forms
.
FlatStyle
.
Flat
;
this
.
btnReadPosition
.
Font
=
new
System
.
Drawing
.
Font
(
"微软雅黑"
,
9F
,
System
.
Drawing
.
FontStyle
.
Regular
,
System
.
Drawing
.
GraphicsUnit
.
Point
,
((
byte
)(
134
)));
this
.
btnReadPosition
.
ForeColor
=
System
.
Drawing
.
SystemColors
.
ControlText
;
this
.
btnReadPosition
.
Location
=
new
System
.
Drawing
.
Point
(
428
,
2
50
);
this
.
btnReadPosition
.
Location
=
new
System
.
Drawing
.
Point
(
428
,
2
42
);
this
.
btnReadPosition
.
Name
=
"btnReadPosition"
;
this
.
btnReadPosition
.
RightToLeft
=
System
.
Windows
.
Forms
.
RightToLeft
.
No
;
this
.
btnReadPosition
.
Size
=
new
System
.
Drawing
.
Size
(
105
,
33
);
...
...
@@ -833,7 +854,7 @@
//
this
.
label8
.
AutoSize
=
true
;
this
.
label8
.
Font
=
new
System
.
Drawing
.
Font
(
"微软雅黑"
,
9F
,
System
.
Drawing
.
FontStyle
.
Regular
,
System
.
Drawing
.
GraphicsUnit
.
Point
,
((
byte
)(
134
)));
this
.
label8
.
Location
=
new
System
.
Drawing
.
Point
(
167
,
1
67
);
this
.
label8
.
Location
=
new
System
.
Drawing
.
Point
(
167
,
1
59
);
this
.
label8
.
Name
=
"label8"
;
this
.
label8
.
Size
=
new
System
.
Drawing
.
Size
(
59
,
17
);
this
.
label8
.
TabIndex
=
255
;
...
...
@@ -873,7 +894,7 @@
//
// txtP
//
this
.
txtP
.
Location
=
new
System
.
Drawing
.
Point
(
232
,
1
64
);
this
.
txtP
.
Location
=
new
System
.
Drawing
.
Point
(
232
,
1
56
);
this
.
txtP
.
Name
=
"txtP"
;
this
.
txtP
.
ReadOnly
=
true
;
this
.
txtP
.
Size
=
new
System
.
Drawing
.
Size
(
87
,
23
);
...
...
@@ -975,7 +996,7 @@
//
this
.
btnComAlarmClear
.
BackColor
=
System
.
Drawing
.
SystemColors
.
Control
;
this
.
btnComAlarmClear
.
FlatStyle
=
System
.
Windows
.
Forms
.
FlatStyle
.
Flat
;
this
.
btnComAlarmClear
.
Location
=
new
System
.
Drawing
.
Point
(
290
,
2
54
);
this
.
btnComAlarmClear
.
Location
=
new
System
.
Drawing
.
Point
(
290
,
2
46
);
this
.
btnComAlarmClear
.
Name
=
"btnComAlarmClear"
;
this
.
btnComAlarmClear
.
Size
=
new
System
.
Drawing
.
Size
(
105
,
33
);
this
.
btnComAlarmClear
.
TabIndex
=
50
;
...
...
@@ -1129,7 +1150,7 @@
this
.
groupBox1
.
Controls
.
Add
(
this
.
label43
);
this
.
groupBox1
.
Controls
.
Add
(
this
.
label42
);
this
.
groupBox1
.
Font
=
new
System
.
Drawing
.
Font
(
"微软雅黑"
,
9F
,
System
.
Drawing
.
FontStyle
.
Regular
,
System
.
Drawing
.
GraphicsUnit
.
Point
,
((
byte
)(
134
)));
this
.
groupBox1
.
Location
=
new
System
.
Drawing
.
Point
(
6
,
3
08
);
this
.
groupBox1
.
Location
=
new
System
.
Drawing
.
Point
(
6
,
3
17
);
this
.
groupBox1
.
Name
=
"groupBox1"
;
this
.
groupBox1
.
Size
=
new
System
.
Drawing
.
Size
(
543
,
182
);
this
.
groupBox1
.
TabIndex
=
217
;
...
...
@@ -2016,7 +2037,7 @@
this
.
btnInOutP2
.
RightToLeft
=
System
.
Windows
.
Forms
.
RightToLeft
.
No
;
this
.
btnInOutP2
.
Size
=
new
System
.
Drawing
.
Size
(
140
,
33
);
this
.
btnInOutP2
.
TabIndex
=
211
;
this
.
btnInOutP2
.
Text
=
"进出轴取料点P2:"
;
this
.
btnInOutP2
.
Text
=
"进出轴
仓门
取料点P2:"
;
this
.
btnInOutP2
.
TextAlign
=
System
.
Drawing
.
ContentAlignment
.
MiddleLeft
;
this
.
btnInOutP2
.
UseVisualStyleBackColor
=
false
;
this
.
btnInOutP2
.
Click
+=
new
System
.
EventHandler
(
this
.
btnInOutP2_Click
);
...
...
@@ -2184,7 +2205,7 @@
this
.
btnInOutP3
.
RightToLeft
=
System
.
Windows
.
Forms
.
RightToLeft
.
No
;
this
.
btnInOutP3
.
Size
=
new
System
.
Drawing
.
Size
(
140
,
33
);
this
.
btnInOutP3
.
TabIndex
=
193
;
this
.
btnInOutP3
.
Text
=
"进出轴取料点P3:"
;
this
.
btnInOutP3
.
Text
=
"进出轴
库位
取料点P3:"
;
this
.
btnInOutP3
.
TextAlign
=
System
.
Drawing
.
ContentAlignment
.
MiddleLeft
;
this
.
btnInOutP3
.
UseVisualStyleBackColor
=
false
;
this
.
btnInOutP3
.
Click
+=
new
System
.
EventHandler
(
this
.
btnInOutP3_Click
);
...
...
@@ -2487,6 +2508,8 @@
private
System
.
Windows
.
Forms
.
Button
btnCheckPos
;
private
System
.
Windows
.
Forms
.
Button
btnStartAutoCheck
;
private
System
.
Windows
.
Forms
.
Button
btnCon
;
private
System
.
Windows
.
Forms
.
Label
label13
;
private
System
.
Windows
.
Forms
.
TextBox
textBoxON
;
}
}
source/ACSingleStore/FrmStoreBox.cs
查看文件 @
57fcc6e
...
...
@@ -1107,6 +1107,7 @@ namespace OnlineStore.ACSingleStore
{
string
PortName
=
txtAxisDeviceName
.
Text
;
short
SlvAddr
=
FormUtil
.
GetShortValue
(
txtAxisValue
);
txtServoStatue
.
Text
=
ACServerManager
.
SRV_ON
(
PortName
,
SlvAddr
)
?
"✔"
:
"✘"
;
txtServoStatue
.
Text
=
ACServerManager
.
ServerOnStatus
(
PortName
,
SlvAddr
)
?
"✔"
:
"✘"
;
this
.
txtAlarmStatus
.
Text
=
ACServerManager
.
GetAlarmStatus
(
PortName
,
SlvAddr
).
ToString
();
this
.
txtBusyStatus
.
Text
=
ACServerManager
.
GetBusyStatus
(
PortName
,
SlvAddr
).
ToString
();
...
...
source/DeviceLibrary/PanasonicServo/ACCMDManager.cs
查看文件 @
57fcc6e
...
...
@@ -7,6 +7,11 @@ namespace OnlineStore.DeviceLibrary
{
public
class
ACCMDManager
{
/// <summary>
/// 0020h 伺服 On 输入(SRV-ON) ReadOnly 0:输入 OFF、1:输入 ON
/// </summary>
public
static
string
SRV_ON
=
"0020"
;
/// <summary>
/// 0132h 原点接近传感器输入 (HOME) 状态 ReadOnly 0: 输入 OFF 1: 输入 ON
/// </summary>
...
...
source/DeviceLibrary/PanasonicServo/ACServerManager.cs
查看文件 @
57fcc6e
...
...
@@ -138,7 +138,23 @@ namespace OnlineStore.DeviceLibrary
}
}
/// <summary>
/// 是否有伺服使能信号
/// </summary>
public
static
bool
SRV_ON
(
string
portName
,
short
slvAddr
)
{
if
(!
serialBeanMap
.
ContainsKey
(
portName
))
{
return
false
;
}
PreReadCoilAddr
=
ACCMDManager
.
SRV_ON
;
byte
[]
dataArray
=
ACCMDManager
.
GetWriteData
(
slvAddr
,
ACCMDManager
.
CMD_ReadCoil
,
PreReadCoilAddr
,
"0000"
,
1
);
//SendData(portName,dataArray);
byte
[]
reviceData
=
SendCommand
(
portName
,
dataArray
,
ReviceOutTimeMS
,
6
);
int
result
=
GetCoilData
(
portName
,
reviceData
,
PreReadCoilAddr
);
//TODO
return
result
>=
1
;
}
/// <summary>
/// 是否成功打开伺服
/// </summary>
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论