Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
刘韬
/
SO815-AutoInOutStore
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
图表
网络
创建新的问题
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit 556fc0fa
由
几米阳光
编写于
2018-12-24 14:15:14 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
出料时批量上下轴要先下降,叉子才能下降。修改压紧轴运动代码
1 个父辈
5b74988c
显示空白字符变更
内嵌
并排
正在显示
19 个修改的文件
包含
1038 行增加
和
219 行删除
source/ACSingleStore/App.config
source/ACSingleStore/FrmStoreBox.Designer.cs
source/ACSingleStore/FrmStoreBox.cs
source/ACSingleStore/记录.txt
source/Common/Setting_Init.cs
source/Common/util/AcSerialBean.cs
source/Common/util/HumitureController.cs
source/Common/util/SerialBean.cs
source/DeviceLibrary/DeviceLibrary.csproj
source/DeviceLibrary/PanasonicServo/ACCMDManager.cs
source/DeviceLibrary/PanasonicServo/ACServerManager.cs
source/DeviceLibrary/PanasonicServo/ACServerManager_Partial.cs
source/DeviceLibrary/ShuoKe/MeteringSignalBean.cs
source/DeviceLibrary/ShuoKe/ShuoKeController.cs
source/DeviceLibrary/ShuoKe/ShuoKeControls.cs
source/DeviceLibrary/StoreConfig/AC/StoreConfig.csv
source/DeviceLibrary/acSingleStore/AC_SA_BoxBean.cs
source/DeviceLibrary/acSingleStore/AC_SA_BoxBean_Partial.cs
source/LoadCVSLibrary/storeConfig/config/AUTO_SA_Config.cs
source/ACSingleStore/App.config
查看文件 @
556fc0f
...
...
@@ -31,8 +31,10 @@
<
add
key
=
"CodeParamPath"
value
=
"\CodeParam\"
/>
<
add
key
=
"InOutDefaultPosition"
value
=
"10000"
/>
<
add
key
=
"Config_Pwd"
value
=
"123456"
/>
<!--
5000
脉冲对应
1
mm
-->
<!--
批量上下料轴
5000
脉冲对应
1
mm
-->
<
add
key
=
"AxisChangeValue"
value
=
"5000"
/>
<!--压紧轴计量检测信号亮
1
次的脉冲值-->
<
add
key
=
"ComAxisChangeValue"
value
=
"2400"
/>
</
appSettings
>
<
log4net
>
<
appender
name
=
"RollingLogFileAppender"
type
=
"log4net.Appender.RollingFileAppender"
>
...
...
source/ACSingleStore/FrmStoreBox.Designer.cs
查看文件 @
556fc0f
...
...
@@ -27,6 +27,7 @@
this
.
timer1
=
new
System
.
Windows
.
Forms
.
Timer
(
this
.
components
);
this
.
lblWarnMsg
=
new
System
.
Windows
.
Forms
.
Label
();
this
.
groupBox5
=
new
System
.
Windows
.
Forms
.
GroupBox
();
this
.
btnUpdateSpeed
=
new
System
.
Windows
.
Forms
.
Button
();
this
.
btnUpdateStatus
=
new
System
.
Windows
.
Forms
.
Button
();
this
.
label24
=
new
System
.
Windows
.
Forms
.
Label
();
this
.
label26
=
new
System
.
Windows
.
Forms
.
Label
();
...
...
@@ -82,10 +83,14 @@
this
.
groupBox1
=
new
System
.
Windows
.
Forms
.
GroupBox
();
this
.
lblAxisStatus
=
new
System
.
Windows
.
Forms
.
Label
();
this
.
button3
=
new
System
.
Windows
.
Forms
.
Button
();
this
.
axis_5_Alarm
=
new
UserFromControl
.
IOStatusControl
();
this
.
txtBatchTarget
=
new
System
.
Windows
.
Forms
.
TextBox
();
this
.
lblCountPulse5
=
new
System
.
Windows
.
Forms
.
TextBox
();
this
.
lblOutPulse5
=
new
System
.
Windows
.
Forms
.
TextBox
();
this
.
label20
=
new
System
.
Windows
.
Forms
.
Label
();
this
.
axis_1_Alarm
=
new
UserFromControl
.
IOStatusControl
();
this
.
axis_3_Alarm
=
new
UserFromControl
.
IOStatusControl
();
this
.
axis_2_Alarm
=
new
UserFromControl
.
IOStatusControl
();
this
.
label38
=
new
System
.
Windows
.
Forms
.
Label
();
this
.
txtMiddleTarget
=
new
System
.
Windows
.
Forms
.
TextBox
();
this
.
txtInoutTarget
=
new
System
.
Windows
.
Forms
.
TextBox
();
...
...
@@ -227,6 +232,7 @@
this
.
btnTempClose
=
new
System
.
Windows
.
Forms
.
Button
();
this
.
btnTempInit
=
new
System
.
Windows
.
Forms
.
Button
();
this
.
groupBox6
=
new
System
.
Windows
.
Forms
.
GroupBox
();
this
.
lblBatchMsg
=
new
System
.
Windows
.
Forms
.
Label
();
this
.
btnOpenDoor
=
new
System
.
Windows
.
Forms
.
Button
();
this
.
lblWaitTragGo
=
new
System
.
Windows
.
Forms
.
Label
();
this
.
btnWaitTrgGo
=
new
System
.
Windows
.
Forms
.
Button
();
...
...
@@ -237,12 +243,7 @@
this
.
btnGetOutTray
=
new
System
.
Windows
.
Forms
.
Button
();
this
.
lblDoorStatus
=
new
System
.
Windows
.
Forms
.
Label
();
this
.
btnBatchInStore
=
new
System
.
Windows
.
Forms
.
Button
();
this
.
lblBatchMsg
=
new
System
.
Windows
.
Forms
.
Label
();
this
.
axis_5_Alarm
=
new
UserFromControl
.
IOStatusControl
();
this
.
axis_1_Alarm
=
new
UserFromControl
.
IOStatusControl
();
this
.
axis_3_Alarm
=
new
UserFromControl
.
IOStatusControl
();
this
.
axis_2_Alarm
=
new
UserFromControl
.
IOStatusControl
();
this
.
btnUpdateSpeed
=
new
System
.
Windows
.
Forms
.
Button
();
this
.
lblComMsg
=
new
System
.
Windows
.
Forms
.
Label
();
this
.
groupBox5
.
SuspendLayout
();
this
.
groupBox1
.
SuspendLayout
();
this
.
groupBox2
.
SuspendLayout
();
...
...
@@ -337,13 +338,28 @@
this
.
groupBox5
.
TabStop
=
false
;
this
.
groupBox5
.
Text
=
"伺服运动"
;
//
// btnUpdateSpeed
//
this
.
btnUpdateSpeed
.
BackColor
=
System
.
Drawing
.
SystemColors
.
Control
;
this
.
btnUpdateSpeed
.
Cursor
=
System
.
Windows
.
Forms
.
Cursors
.
Default
;
this
.
btnUpdateSpeed
.
Font
=
new
System
.
Drawing
.
Font
(
"微软雅黑"
,
9F
,
System
.
Drawing
.
FontStyle
.
Regular
,
System
.
Drawing
.
GraphicsUnit
.
Point
,
((
byte
)(
134
)));
this
.
btnUpdateSpeed
.
ForeColor
=
System
.
Drawing
.
SystemColors
.
ControlText
;
this
.
btnUpdateSpeed
.
Location
=
new
System
.
Drawing
.
Point
(
312
,
154
);
this
.
btnUpdateSpeed
.
Name
=
"btnUpdateSpeed"
;
this
.
btnUpdateSpeed
.
RightToLeft
=
System
.
Windows
.
Forms
.
RightToLeft
.
No
;
this
.
btnUpdateSpeed
.
Size
=
new
System
.
Drawing
.
Size
(
90
,
33
);
this
.
btnUpdateSpeed
.
TabIndex
=
310
;
this
.
btnUpdateSpeed
.
Text
=
"更改速度"
;
this
.
btnUpdateSpeed
.
UseVisualStyleBackColor
=
true
;
this
.
btnUpdateSpeed
.
Click
+=
new
System
.
EventHandler
(
this
.
btnUpdateSpeed_Click
);
//
// btnUpdateStatus
//
this
.
btnUpdateStatus
.
BackColor
=
System
.
Drawing
.
SystemColors
.
Control
;
this
.
btnUpdateStatus
.
Cursor
=
System
.
Windows
.
Forms
.
Cursors
.
Default
;
this
.
btnUpdateStatus
.
Font
=
new
System
.
Drawing
.
Font
(
"微软雅黑"
,
9F
,
System
.
Drawing
.
FontStyle
.
Regular
,
System
.
Drawing
.
GraphicsUnit
.
Point
,
((
byte
)(
134
)));
this
.
btnUpdateStatus
.
ForeColor
=
System
.
Drawing
.
SystemColors
.
ControlText
;
this
.
btnUpdateStatus
.
Location
=
new
System
.
Drawing
.
Point
(
203
,
15
6
);
this
.
btnUpdateStatus
.
Location
=
new
System
.
Drawing
.
Point
(
203
,
15
4
);
this
.
btnUpdateStatus
.
Name
=
"btnUpdateStatus"
;
this
.
btnUpdateStatus
.
RightToLeft
=
System
.
Windows
.
Forms
.
RightToLeft
.
No
;
this
.
btnUpdateStatus
.
Size
=
new
System
.
Drawing
.
Size
(
105
,
33
);
...
...
@@ -463,7 +479,7 @@
// chbAutoRead
//
this
.
chbAutoRead
.
AutoSize
=
true
;
this
.
chbAutoRead
.
Location
=
new
System
.
Drawing
.
Point
(
47
,
16
5
);
this
.
chbAutoRead
.
Location
=
new
System
.
Drawing
.
Point
(
47
,
16
0
);
this
.
chbAutoRead
.
Name
=
"chbAutoRead"
;
this
.
chbAutoRead
.
Size
=
new
System
.
Drawing
.
Size
(
99
,
21
);
this
.
chbAutoRead
.
TabIndex
=
296
;
...
...
@@ -584,7 +600,7 @@
this
.
btnReadPosition
.
Cursor
=
System
.
Windows
.
Forms
.
Cursors
.
Default
;
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
(
401
,
15
3
);
this
.
btnReadPosition
.
Location
=
new
System
.
Drawing
.
Point
(
401
,
15
4
);
this
.
btnReadPosition
.
Name
=
"btnReadPosition"
;
this
.
btnReadPosition
.
RightToLeft
=
System
.
Windows
.
Forms
.
RightToLeft
.
No
;
this
.
btnReadPosition
.
Size
=
new
System
.
Drawing
.
Size
(
90
,
33
);
...
...
@@ -599,7 +615,7 @@
this
.
lblServerOn
.
AutoSize
=
true
;
this
.
lblServerOn
.
Font
=
new
System
.
Drawing
.
Font
(
"微软雅黑"
,
10.5F
,
System
.
Drawing
.
FontStyle
.
Bold
,
System
.
Drawing
.
GraphicsUnit
.
Point
,
((
byte
)(
134
)));
this
.
lblServerOn
.
ForeColor
=
System
.
Drawing
.
Color
.
Red
;
this
.
lblServerOn
.
Location
=
new
System
.
Drawing
.
Point
(
48
,
16
7
);
this
.
lblServerOn
.
Location
=
new
System
.
Drawing
.
Point
(
48
,
16
1
);
this
.
lblServerOn
.
Name
=
"lblServerOn"
;
this
.
lblServerOn
.
Size
=
new
System
.
Drawing
.
Size
(
0
,
19
);
this
.
lblServerOn
.
TabIndex
=
268
;
...
...
@@ -902,9 +918,9 @@
|
System
.
Windows
.
Forms
.
AnchorStyles
.
Left
)
|
System
.
Windows
.
Forms
.
AnchorStyles
.
Right
)));
this
.
richTextBox1
.
Font
=
new
System
.
Drawing
.
Font
(
"微软雅黑"
,
9F
,
System
.
Drawing
.
FontStyle
.
Regular
,
System
.
Drawing
.
GraphicsUnit
.
Point
,
((
byte
)(
134
)));
this
.
richTextBox1
.
Location
=
new
System
.
Drawing
.
Point
(
510
,
4
73
);
this
.
richTextBox1
.
Location
=
new
System
.
Drawing
.
Point
(
510
,
4
86
);
this
.
richTextBox1
.
Name
=
"richTextBox1"
;
this
.
richTextBox1
.
Size
=
new
System
.
Drawing
.
Size
(
571
,
2
66
);
this
.
richTextBox1
.
Size
=
new
System
.
Drawing
.
Size
(
571
,
2
51
);
this
.
richTextBox1
.
TabIndex
=
256
;
this
.
richTextBox1
.
Text
=
""
;
//
...
...
@@ -939,7 +955,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
(
8
,
1
87
);
this
.
groupBox1
.
Location
=
new
System
.
Drawing
.
Point
(
8
,
1
99
);
this
.
groupBox1
.
Name
=
"groupBox1"
;
this
.
groupBox1
.
Size
=
new
System
.
Drawing
.
Size
(
549
,
212
);
this
.
groupBox1
.
TabIndex
=
217
;
...
...
@@ -972,6 +988,16 @@
this
.
button3
.
UseVisualStyleBackColor
=
true
;
this
.
button3
.
Click
+=
new
System
.
EventHandler
(
this
.
button3_Click
);
//
// axis_5_Alarm
//
this
.
axis_5_Alarm
.
IOName
=
""
;
this
.
axis_5_Alarm
.
IOValue
=
0
;
this
.
axis_5_Alarm
.
isCanClick
=
false
;
this
.
axis_5_Alarm
.
Location
=
new
System
.
Drawing
.
Point
(
418
,
37
);
this
.
axis_5_Alarm
.
Name
=
"axis_5_Alarm"
;
this
.
axis_5_Alarm
.
Size
=
new
System
.
Drawing
.
Size
(
43
,
39
);
this
.
axis_5_Alarm
.
TabIndex
=
271
;
//
// txtBatchTarget
//
this
.
txtBatchTarget
.
Location
=
new
System
.
Drawing
.
Point
(
395
,
139
);
...
...
@@ -1006,6 +1032,36 @@
this
.
label20
.
TabIndex
=
267
;
this
.
label20
.
Text
=
"批量出入料轴"
;
//
// axis_1_Alarm
//
this
.
axis_1_Alarm
.
IOName
=
""
;
this
.
axis_1_Alarm
.
IOValue
=
0
;
this
.
axis_1_Alarm
.
isCanClick
=
false
;
this
.
axis_1_Alarm
.
Location
=
new
System
.
Drawing
.
Point
(
116
,
37
);
this
.
axis_1_Alarm
.
Name
=
"axis_1_Alarm"
;
this
.
axis_1_Alarm
.
Size
=
new
System
.
Drawing
.
Size
(
43
,
39
);
this
.
axis_1_Alarm
.
TabIndex
=
264
;
//
// axis_3_Alarm
//
this
.
axis_3_Alarm
.
IOName
=
""
;
this
.
axis_3_Alarm
.
IOValue
=
0
;
this
.
axis_3_Alarm
.
isCanClick
=
false
;
this
.
axis_3_Alarm
.
Location
=
new
System
.
Drawing
.
Point
(
318
,
37
);
this
.
axis_3_Alarm
.
Name
=
"axis_3_Alarm"
;
this
.
axis_3_Alarm
.
Size
=
new
System
.
Drawing
.
Size
(
43
,
39
);
this
.
axis_3_Alarm
.
TabIndex
=
266
;
//
// axis_2_Alarm
//
this
.
axis_2_Alarm
.
IOName
=
""
;
this
.
axis_2_Alarm
.
IOValue
=
0
;
this
.
axis_2_Alarm
.
isCanClick
=
false
;
this
.
axis_2_Alarm
.
Location
=
new
System
.
Drawing
.
Point
(
213
,
37
);
this
.
axis_2_Alarm
.
Name
=
"axis_2_Alarm"
;
this
.
axis_2_Alarm
.
Size
=
new
System
.
Drawing
.
Size
(
43
,
39
);
this
.
axis_2_Alarm
.
TabIndex
=
265
;
//
// label38
//
this
.
label38
.
AutoSize
=
true
;
...
...
@@ -2191,6 +2247,7 @@
//
this
.
groupBox4
.
Anchor
=
((
System
.
Windows
.
Forms
.
AnchorStyles
)(((
System
.
Windows
.
Forms
.
AnchorStyles
.
Top
|
System
.
Windows
.
Forms
.
AnchorStyles
.
Left
)
|
System
.
Windows
.
Forms
.
AnchorStyles
.
Right
)));
this
.
groupBox4
.
Controls
.
Add
(
this
.
lblComMsg
);
this
.
groupBox4
.
Controls
.
Add
(
this
.
btnRelMove
);
this
.
groupBox4
.
Controls
.
Add
(
this
.
txtAddr
);
this
.
groupBox4
.
Controls
.
Add
(
this
.
label18
);
...
...
@@ -2212,16 +2269,16 @@
this
.
groupBox4
.
Controls
.
Add
(
this
.
label25
);
this
.
groupBox4
.
Controls
.
Add
(
this
.
comboBoxPortName
);
this
.
groupBox4
.
Font
=
new
System
.
Drawing
.
Font
(
"微软雅黑"
,
9F
,
System
.
Drawing
.
FontStyle
.
Regular
,
System
.
Drawing
.
GraphicsUnit
.
Point
,
((
byte
)(
134
)));
this
.
groupBox4
.
Location
=
new
System
.
Drawing
.
Point
(
8
,
7
);
this
.
groupBox4
.
Location
=
new
System
.
Drawing
.
Point
(
8
,
4
);
this
.
groupBox4
.
Name
=
"groupBox4"
;
this
.
groupBox4
.
Size
=
new
System
.
Drawing
.
Size
(
549
,
1
75
);
this
.
groupBox4
.
Size
=
new
System
.
Drawing
.
Size
(
549
,
1
94
);
this
.
groupBox4
.
TabIndex
=
271
;
this
.
groupBox4
.
TabStop
=
false
;
this
.
groupBox4
.
Text
=
"压紧轴"
;
//
// btnRelMove
//
this
.
btnRelMove
.
Location
=
new
System
.
Drawing
.
Point
(
282
,
61
);
this
.
btnRelMove
.
Location
=
new
System
.
Drawing
.
Point
(
282
,
54
);
this
.
btnRelMove
.
Name
=
"btnRelMove"
;
this
.
btnRelMove
.
Size
=
new
System
.
Drawing
.
Size
(
100
,
33
);
this
.
btnRelMove
.
TabIndex
=
96
;
...
...
@@ -2232,7 +2289,7 @@
// txtAddr
//
this
.
txtAddr
.
Enabled
=
false
;
this
.
txtAddr
.
Location
=
new
System
.
Drawing
.
Point
(
210
,
2
7
);
this
.
txtAddr
.
Location
=
new
System
.
Drawing
.
Point
(
210
,
2
2
);
this
.
txtAddr
.
Name
=
"txtAddr"
;
this
.
txtAddr
.
Size
=
new
System
.
Drawing
.
Size
(
48
,
23
);
this
.
txtAddr
.
TabIndex
=
95
;
...
...
@@ -2241,7 +2298,7 @@
// label18
//
this
.
label18
.
AutoSize
=
true
;
this
.
label18
.
Location
=
new
System
.
Drawing
.
Point
(
174
,
30
);
this
.
label18
.
Location
=
new
System
.
Drawing
.
Point
(
174
,
25
);
this
.
label18
.
Name
=
"label18"
;
this
.
label18
.
Size
=
new
System
.
Drawing
.
Size
(
32
,
17
);
this
.
label18
.
TabIndex
=
94
;
...
...
@@ -2249,7 +2306,7 @@
//
// btnGetPosition
//
this
.
btnGetPosition
.
Location
=
new
System
.
Drawing
.
Point
(
387
,
62
);
this
.
btnGetPosition
.
Location
=
new
System
.
Drawing
.
Point
(
387
,
54
);
this
.
btnGetPosition
.
Name
=
"btnGetPosition"
;
this
.
btnGetPosition
.
Size
=
new
System
.
Drawing
.
Size
(
100
,
33
);
this
.
btnGetPosition
.
TabIndex
=
93
;
...
...
@@ -2264,7 +2321,7 @@
this
.
cmbHomeType
.
Items
.
AddRange
(
new
object
[]
{
"0=反方向"
,
"1=正方向"
});
this
.
cmbHomeType
.
Location
=
new
System
.
Drawing
.
Point
(
67
,
1
33
);
this
.
cmbHomeType
.
Location
=
new
System
.
Drawing
.
Point
(
67
,
1
26
);
this
.
cmbHomeType
.
Name
=
"cmbHomeType"
;
this
.
cmbHomeType
.
Size
=
new
System
.
Drawing
.
Size
(
103
,
25
);
this
.
cmbHomeType
.
TabIndex
=
92
;
...
...
@@ -2272,7 +2329,7 @@
// label13
//
this
.
label13
.
AutoSize
=
true
;
this
.
label13
.
Location
=
new
System
.
Drawing
.
Point
(
5
,
13
7
);
this
.
label13
.
Location
=
new
System
.
Drawing
.
Point
(
5
,
13
0
);
this
.
label13
.
Name
=
"label13"
;
this
.
label13
.
Size
=
new
System
.
Drawing
.
Size
(
68
,
17
);
this
.
label13
.
TabIndex
=
91
;
...
...
@@ -2281,7 +2338,7 @@
// label17
//
this
.
label17
.
AutoSize
=
true
;
this
.
label17
.
Location
=
new
System
.
Drawing
.
Point
(
5
,
104
);
this
.
label17
.
Location
=
new
System
.
Drawing
.
Point
(
5
,
97
);
this
.
label17
.
Name
=
"label17"
;
this
.
label17
.
Size
=
new
System
.
Drawing
.
Size
(
44
,
17
);
this
.
label17
.
TabIndex
=
90
;
...
...
@@ -2289,7 +2346,7 @@
//
// txtSpeed
//
this
.
txtSpeed
.
Location
=
new
System
.
Drawing
.
Point
(
67
,
100
);
this
.
txtSpeed
.
Location
=
new
System
.
Drawing
.
Point
(
67
,
93
);
this
.
txtSpeed
.
MaxLength
=
15
;
this
.
txtSpeed
.
Name
=
"txtSpeed"
;
this
.
txtSpeed
.
Size
=
new
System
.
Drawing
.
Size
(
103
,
23
);
...
...
@@ -2298,7 +2355,7 @@
//
// btnVolMove
//
this
.
btnVolMove
.
Location
=
new
System
.
Drawing
.
Point
(
176
,
95
);
this
.
btnVolMove
.
Location
=
new
System
.
Drawing
.
Point
(
176
,
88
);
this
.
btnVolMove
.
Name
=
"btnVolMove"
;
this
.
btnVolMove
.
Size
=
new
System
.
Drawing
.
Size
(
100
,
33
);
this
.
btnVolMove
.
TabIndex
=
88
;
...
...
@@ -2308,7 +2365,7 @@
//
// btnClose
//
this
.
btnClose
.
Location
=
new
System
.
Drawing
.
Point
(
375
,
20
);
this
.
btnClose
.
Location
=
new
System
.
Drawing
.
Point
(
375
,
15
);
this
.
btnClose
.
Name
=
"btnClose"
;
this
.
btnClose
.
Size
=
new
System
.
Drawing
.
Size
(
100
,
33
);
this
.
btnClose
.
TabIndex
=
87
;
...
...
@@ -2318,7 +2375,7 @@
//
// btnOpen
//
this
.
btnOpen
.
Location
=
new
System
.
Drawing
.
Point
(
265
,
20
);
this
.
btnOpen
.
Location
=
new
System
.
Drawing
.
Point
(
265
,
15
);
this
.
btnOpen
.
Name
=
"btnOpen"
;
this
.
btnOpen
.
Size
=
new
System
.
Drawing
.
Size
(
100
,
33
);
this
.
btnOpen
.
TabIndex
=
86
;
...
...
@@ -2328,7 +2385,7 @@
//
// btnStatusSearch
//
this
.
btnStatusSearch
.
Location
=
new
System
.
Drawing
.
Point
(
282
,
95
);
this
.
btnStatusSearch
.
Location
=
new
System
.
Drawing
.
Point
(
282
,
88
);
this
.
btnStatusSearch
.
Name
=
"btnStatusSearch"
;
this
.
btnStatusSearch
.
Size
=
new
System
.
Drawing
.
Size
(
100
,
33
);
this
.
btnStatusSearch
.
TabIndex
=
85
;
...
...
@@ -2339,7 +2396,7 @@
// label19
//
this
.
label19
.
AutoSize
=
true
;
this
.
label19
.
Location
=
new
System
.
Drawing
.
Point
(
5
,
70
);
this
.
label19
.
Location
=
new
System
.
Drawing
.
Point
(
5
,
63
);
this
.
label19
.
Name
=
"label19"
;
this
.
label19
.
Size
=
new
System
.
Drawing
.
Size
(
44
,
17
);
this
.
label19
.
TabIndex
=
84
;
...
...
@@ -2347,7 +2404,7 @@
//
// txtLinePosition
//
this
.
txtLinePosition
.
Location
=
new
System
.
Drawing
.
Point
(
67
,
66
);
this
.
txtLinePosition
.
Location
=
new
System
.
Drawing
.
Point
(
67
,
59
);
this
.
txtLinePosition
.
MaxLength
=
15
;
this
.
txtLinePosition
.
Name
=
"txtLinePosition"
;
this
.
txtLinePosition
.
Size
=
new
System
.
Drawing
.
Size
(
103
,
23
);
...
...
@@ -2356,7 +2413,7 @@
//
// btnHomeMove
//
this
.
btnHomeMove
.
Location
=
new
System
.
Drawing
.
Point
(
176
,
12
9
);
this
.
btnHomeMove
.
Location
=
new
System
.
Drawing
.
Point
(
176
,
12
2
);
this
.
btnHomeMove
.
Name
=
"btnHomeMove"
;
this
.
btnHomeMove
.
Size
=
new
System
.
Drawing
.
Size
(
100
,
33
);
this
.
btnHomeMove
.
TabIndex
=
12
;
...
...
@@ -2366,7 +2423,7 @@
//
// btnClearPosition
//
this
.
btnClearPosition
.
Location
=
new
System
.
Drawing
.
Point
(
387
,
99
);
this
.
btnClearPosition
.
Location
=
new
System
.
Drawing
.
Point
(
387
,
88
);
this
.
btnClearPosition
.
Name
=
"btnClearPosition"
;
this
.
btnClearPosition
.
Size
=
new
System
.
Drawing
.
Size
(
100
,
33
);
this
.
btnClearPosition
.
TabIndex
=
11
;
...
...
@@ -2376,7 +2433,7 @@
//
// btnStop
//
this
.
btnStop
.
Location
=
new
System
.
Drawing
.
Point
(
282
,
12
9
);
this
.
btnStop
.
Location
=
new
System
.
Drawing
.
Point
(
282
,
12
2
);
this
.
btnStop
.
Name
=
"btnStop"
;
this
.
btnStop
.
Size
=
new
System
.
Drawing
.
Size
(
100
,
33
);
this
.
btnStop
.
TabIndex
=
10
;
...
...
@@ -2386,7 +2443,7 @@
//
// btnLineAbsMove
//
this
.
btnLineAbsMove
.
Location
=
new
System
.
Drawing
.
Point
(
176
,
61
);
this
.
btnLineAbsMove
.
Location
=
new
System
.
Drawing
.
Point
(
176
,
54
);
this
.
btnLineAbsMove
.
Name
=
"btnLineAbsMove"
;
this
.
btnLineAbsMove
.
Size
=
new
System
.
Drawing
.
Size
(
100
,
33
);
this
.
btnLineAbsMove
.
TabIndex
=
9
;
...
...
@@ -2397,7 +2454,7 @@
// label25
//
this
.
label25
.
AutoSize
=
true
;
this
.
label25
.
Location
=
new
System
.
Drawing
.
Point
(
5
,
30
);
this
.
label25
.
Location
=
new
System
.
Drawing
.
Point
(
5
,
25
);
this
.
label25
.
Name
=
"label25"
;
this
.
label25
.
Size
=
new
System
.
Drawing
.
Size
(
56
,
17
);
this
.
label25
.
TabIndex
=
1
;
...
...
@@ -2407,7 +2464,7 @@
//
this
.
comboBoxPortName
.
DropDownStyle
=
System
.
Windows
.
Forms
.
ComboBoxStyle
.
DropDownList
;
this
.
comboBoxPortName
.
FormattingEnabled
=
true
;
this
.
comboBoxPortName
.
Location
=
new
System
.
Drawing
.
Point
(
67
,
2
6
);
this
.
comboBoxPortName
.
Location
=
new
System
.
Drawing
.
Point
(
67
,
2
1
);
this
.
comboBoxPortName
.
Name
=
"comboBoxPortName"
;
this
.
comboBoxPortName
.
Size
=
new
System
.
Drawing
.
Size
(
103
,
25
);
this
.
comboBoxPortName
.
TabIndex
=
0
;
...
...
@@ -2423,7 +2480,7 @@
this
.
tabControl1
.
Location
=
new
System
.
Drawing
.
Point
(
510
,
36
);
this
.
tabControl1
.
Name
=
"tabControl1"
;
this
.
tabControl1
.
SelectedIndex
=
0
;
this
.
tabControl1
.
Size
=
new
System
.
Drawing
.
Size
(
575
,
4
35
);
this
.
tabControl1
.
Size
=
new
System
.
Drawing
.
Size
(
575
,
4
46
);
this
.
tabControl1
.
TabIndex
=
301
;
//
// tabPage2
...
...
@@ -2432,7 +2489,7 @@
this
.
tabPage2
.
Location
=
new
System
.
Drawing
.
Point
(
4
,
26
);
this
.
tabPage2
.
Name
=
"tabPage2"
;
this
.
tabPage2
.
Padding
=
new
System
.
Windows
.
Forms
.
Padding
(
3
);
this
.
tabPage2
.
Size
=
new
System
.
Drawing
.
Size
(
567
,
4
05
);
this
.
tabPage2
.
Size
=
new
System
.
Drawing
.
Size
(
567
,
4
16
);
this
.
tabPage2
.
TabIndex
=
1
;
this
.
tabPage2
.
Text
=
"伺服调试"
;
this
.
tabPage2
.
UseVisualStyleBackColor
=
true
;
...
...
@@ -2443,7 +2500,7 @@
this
.
tabPage3
.
Controls
.
Add
(
this
.
groupBox1
);
this
.
tabPage3
.
Location
=
new
System
.
Drawing
.
Point
(
4
,
26
);
this
.
tabPage3
.
Name
=
"tabPage3"
;
this
.
tabPage3
.
Size
=
new
System
.
Drawing
.
Size
(
567
,
4
05
);
this
.
tabPage3
.
Size
=
new
System
.
Drawing
.
Size
(
567
,
4
16
);
this
.
tabPage3
.
TabIndex
=
2
;
this
.
tabPage3
.
Text
=
"压紧轴调试"
;
this
.
tabPage3
.
UseVisualStyleBackColor
=
true
;
...
...
@@ -2593,6 +2650,16 @@
this
.
groupBox6
.
TabStop
=
false
;
this
.
groupBox6
.
Text
=
"批量上下料操作"
;
//
// lblBatchMsg
//
this
.
lblBatchMsg
.
Font
=
new
System
.
Drawing
.
Font
(
"微软雅黑"
,
9F
,
System
.
Drawing
.
FontStyle
.
Regular
,
System
.
Drawing
.
GraphicsUnit
.
Point
,
((
byte
)(
134
)));
this
.
lblBatchMsg
.
ForeColor
=
System
.
Drawing
.
Color
.
Red
;
this
.
lblBatchMsg
.
Location
=
new
System
.
Drawing
.
Point
(
14
,
49
);
this
.
lblBatchMsg
.
Name
=
"lblBatchMsg"
;
this
.
lblBatchMsg
.
Size
=
new
System
.
Drawing
.
Size
(
472
,
43
);
this
.
lblBatchMsg
.
TabIndex
=
233
;
this
.
lblBatchMsg
.
TextAlign
=
System
.
Drawing
.
ContentAlignment
.
MiddleCenter
;
//
// btnOpenDoor
//
this
.
btnOpenDoor
.
Font
=
new
System
.
Drawing
.
Font
(
"微软雅黑"
,
9F
,
System
.
Drawing
.
FontStyle
.
Regular
,
System
.
Drawing
.
GraphicsUnit
.
Point
,
((
byte
)(
134
)));
...
...
@@ -2609,7 +2676,7 @@
this
.
lblWaitTragGo
.
AutoSize
=
true
;
this
.
lblWaitTragGo
.
Font
=
new
System
.
Drawing
.
Font
(
"微软雅黑"
,
12F
,
System
.
Drawing
.
FontStyle
.
Bold
,
System
.
Drawing
.
GraphicsUnit
.
Point
,
((
byte
)(
134
)));
this
.
lblWaitTragGo
.
ForeColor
=
System
.
Drawing
.
Color
.
Red
;
this
.
lblWaitTragGo
.
Location
=
new
System
.
Drawing
.
Point
(
14
7
,
104
);
this
.
lblWaitTragGo
.
Location
=
new
System
.
Drawing
.
Point
(
14
1
,
105
);
this
.
lblWaitTragGo
.
Name
=
"lblWaitTragGo"
;
this
.
lblWaitTragGo
.
Size
=
new
System
.
Drawing
.
Size
(
250
,
22
);
this
.
lblWaitTragGo
.
TabIndex
=
231
;
...
...
@@ -2618,7 +2685,7 @@
// btnWaitTrgGo
//
this
.
btnWaitTrgGo
.
Font
=
new
System
.
Drawing
.
Font
(
"微软雅黑"
,
9F
,
System
.
Drawing
.
FontStyle
.
Regular
,
System
.
Drawing
.
GraphicsUnit
.
Point
,
((
byte
)(
134
)));
this
.
btnWaitTrgGo
.
Location
=
new
System
.
Drawing
.
Point
(
19
,
96
);
this
.
btnWaitTrgGo
.
Location
=
new
System
.
Drawing
.
Point
(
22
,
98
);
this
.
btnWaitTrgGo
.
Name
=
"btnWaitTrgGo"
;
this
.
btnWaitTrgGo
.
Size
=
new
System
.
Drawing
.
Size
(
105
,
38
);
this
.
btnWaitTrgGo
.
TabIndex
=
230
;
...
...
@@ -2703,70 +2770,16 @@
this
.
btnBatchInStore
.
UseVisualStyleBackColor
=
true
;
this
.
btnBatchInStore
.
Click
+=
new
System
.
EventHandler
(
this
.
btnBatchInStore_Click
);
//
// lblBatchMsg
//
this
.
lblBatchMsg
.
Font
=
new
System
.
Drawing
.
Font
(
"微软雅黑"
,
9F
,
System
.
Drawing
.
FontStyle
.
Regular
,
System
.
Drawing
.
GraphicsUnit
.
Point
,
((
byte
)(
134
)));
this
.
lblBatchMsg
.
ForeColor
=
System
.
Drawing
.
Color
.
Red
;
this
.
lblBatchMsg
.
Location
=
new
System
.
Drawing
.
Point
(
14
,
49
);
this
.
lblBatchMsg
.
Name
=
"lblBatchMsg"
;
this
.
lblBatchMsg
.
Size
=
new
System
.
Drawing
.
Size
(
472
,
43
);
this
.
lblBatchMsg
.
TabIndex
=
233
;
this
.
lblBatchMsg
.
TextAlign
=
System
.
Drawing
.
ContentAlignment
.
MiddleCenter
;
//
// axis_5_Alarm
// lblComMsg
//
this
.
axis_5_Alarm
.
IOName
=
""
;
this
.
axis_5_Alarm
.
IOValue
=
0
;
this
.
axis_5_Alarm
.
isCanClick
=
false
;
this
.
axis_5_Alarm
.
Location
=
new
System
.
Drawing
.
Point
(
418
,
37
);
this
.
axis_5_Alarm
.
Name
=
"axis_5_Alarm"
;
this
.
axis_5_Alarm
.
Size
=
new
System
.
Drawing
.
Size
(
43
,
39
);
this
.
axis_5_Alarm
.
TabIndex
=
271
;
//
// axis_1_Alarm
//
this
.
axis_1_Alarm
.
IOName
=
""
;
this
.
axis_1_Alarm
.
IOValue
=
0
;
this
.
axis_1_Alarm
.
isCanClick
=
false
;
this
.
axis_1_Alarm
.
Location
=
new
System
.
Drawing
.
Point
(
116
,
37
);
this
.
axis_1_Alarm
.
Name
=
"axis_1_Alarm"
;
this
.
axis_1_Alarm
.
Size
=
new
System
.
Drawing
.
Size
(
43
,
39
);
this
.
axis_1_Alarm
.
TabIndex
=
264
;
//
// axis_3_Alarm
//
this
.
axis_3_Alarm
.
IOName
=
""
;
this
.
axis_3_Alarm
.
IOValue
=
0
;
this
.
axis_3_Alarm
.
isCanClick
=
false
;
this
.
axis_3_Alarm
.
Location
=
new
System
.
Drawing
.
Point
(
318
,
37
);
this
.
axis_3_Alarm
.
Name
=
"axis_3_Alarm"
;
this
.
axis_3_Alarm
.
Size
=
new
System
.
Drawing
.
Size
(
43
,
39
);
this
.
axis_3_Alarm
.
TabIndex
=
266
;
//
// axis_2_Alarm
//
this
.
axis_2_Alarm
.
IOName
=
""
;
this
.
axis_2_Alarm
.
IOValue
=
0
;
this
.
axis_2_Alarm
.
isCanClick
=
false
;
this
.
axis_2_Alarm
.
Location
=
new
System
.
Drawing
.
Point
(
213
,
37
);
this
.
axis_2_Alarm
.
Name
=
"axis_2_Alarm"
;
this
.
axis_2_Alarm
.
Size
=
new
System
.
Drawing
.
Size
(
43
,
39
);
this
.
axis_2_Alarm
.
TabIndex
=
265
;
//
// btnUpdateSpeed
//
this
.
btnUpdateSpeed
.
BackColor
=
System
.
Drawing
.
SystemColors
.
Control
;
this
.
btnUpdateSpeed
.
Cursor
=
System
.
Windows
.
Forms
.
Cursors
.
Default
;
this
.
btnUpdateSpeed
.
Font
=
new
System
.
Drawing
.
Font
(
"微软雅黑"
,
9F
,
System
.
Drawing
.
FontStyle
.
Regular
,
System
.
Drawing
.
GraphicsUnit
.
Point
,
((
byte
)(
134
)));
this
.
btnUpdateSpeed
.
ForeColor
=
System
.
Drawing
.
SystemColors
.
ControlText
;
this
.
btnUpdateSpeed
.
Location
=
new
System
.
Drawing
.
Point
(
312
,
156
);
this
.
btnUpdateSpeed
.
Name
=
"btnUpdateSpeed"
;
this
.
btnUpdateSpeed
.
RightToLeft
=
System
.
Windows
.
Forms
.
RightToLeft
.
No
;
this
.
btnUpdateSpeed
.
Size
=
new
System
.
Drawing
.
Size
(
90
,
33
);
this
.
btnUpdateSpeed
.
TabIndex
=
310
;
this
.
btnUpdateSpeed
.
Text
=
"更改速度"
;
this
.
btnUpdateSpeed
.
UseVisualStyleBackColor
=
true
;
this
.
btnUpdateSpeed
.
Click
+=
new
System
.
EventHandler
(
this
.
btnUpdateSpeed_Click
);
this
.
lblComMsg
.
AutoSize
=
true
;
this
.
lblComMsg
.
Font
=
new
System
.
Drawing
.
Font
(
"微软雅黑"
,
9F
,
System
.
Drawing
.
FontStyle
.
Regular
,
System
.
Drawing
.
GraphicsUnit
.
Point
,
((
byte
)(
134
)));
this
.
lblComMsg
.
ForeColor
=
System
.
Drawing
.
Color
.
Green
;
this
.
lblComMsg
.
Location
=
new
System
.
Drawing
.
Point
(
29
,
165
);
this
.
lblComMsg
.
Name
=
"lblComMsg"
;
this
.
lblComMsg
.
Size
=
new
System
.
Drawing
.
Size
(
80
,
17
);
this
.
lblComMsg
.
TabIndex
=
281
;
this
.
lblComMsg
.
Text
=
"步进电机信息"
;
//
// FrmStoreBox
//
...
...
@@ -3036,6 +3049,7 @@
public
System
.
Windows
.
Forms
.
Button
btnUpdownP2
;
private
System
.
Windows
.
Forms
.
Label
lblBatchMsg
;
public
System
.
Windows
.
Forms
.
Button
btnUpdateSpeed
;
private
System
.
Windows
.
Forms
.
Label
lblComMsg
;
}
}
source/ACSingleStore/FrmStoreBox.cs
查看文件 @
556fc0f
...
...
@@ -87,7 +87,7 @@ namespace OnlineStore.AutoInOutStore
//txtUpDownP1.Text = ktkPosition.UpDownAxis_DoorOPosition_P1.ToString();
}
txtSpeed
.
Text
=
store
.
Config
.
CompressAxis_EndSpeed
.
ToString
();
List
<
string
>
port
=
new
List
<
string
>(
SerialPort
.
GetPortNames
());
comboBoxPortName
.
DataSource
=
port
;
if
(
port
.
IndexOf
(
store
.
Config
.
CompressAxis_PortName
)
>=
0
)
...
...
@@ -1433,7 +1433,9 @@ namespace OnlineStore.AutoInOutStore
}
private
void
btnGetPosition_Click
(
object
sender
,
EventArgs
e
)
{
ShuoKeControls
.
GetABSPosition
(
store
.
Config
.
CompressAxis_Slv
);
int
value
=
ShuoKeControls
.
GetABSPosition
(
store
.
Config
.
CompressAxis_Slv
);
lblComMsg
.
Text
=
DateTime
.
Now
.
ToLongTimeString
()
+
"实时位置:"
+
value
;
}
private
void
btnStop_Click
(
object
sender
,
EventArgs
e
)
{
...
...
@@ -1460,7 +1462,8 @@ namespace OnlineStore.AutoInOutStore
}
private
void
btnStatusSearch_Click
(
object
sender
,
EventArgs
e
)
{
ShuoKeControls
.
GetStatus
(
store
.
Config
.
CompressAxis_Slv
);
ShuoKeInfo
info
=
ShuoKeControls
.
GetStatus
(
store
.
Config
.
CompressAxis_Slv
);
lblComMsg
.
Text
=
info
.
ToShowStr
();
}
private
void
FormComStatus
(
bool
isOpen
)
{
...
...
source/ACSingleStore/记录.txt
查看文件 @
556fc0f
...
...
@@ -72,6 +72,12 @@ X22_气压检测:
20181219-20181224修改
批量出库时,轴先移动到检测点亮,然后下降指定的高度,叉子出到批量装置时,把料盘放在批量上下轴上。
增加配置:上料轴最大出料高度,
上料轴出料时需要距离检测信号下降的高度。
压紧轴改为同步返回数据模式,压紧轴增加计量检测功能。
...
...
source/Common/Setting_Init.cs
查看文件 @
556fc0f
...
...
@@ -76,5 +76,7 @@ namespace OnlineStore.Common
/// 是否是代码运行,不需要连接设备
/// </summary>
public
static
string
CodeRun
=
"CodeRun"
;
public
static
string
ComAxisChangeValue
=
"ComAxisChangeValue"
;
}
}
source/Common/util/AcSerialBean.cs
查看文件 @
556fc0f
source/Common/util/HumitureController.cs
查看文件 @
556fc0f
...
...
@@ -116,9 +116,9 @@ namespace OnlineStore.Common
private
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
];
...
...
source/Common/util/SerialBean.cs
查看文件 @
556fc0f
...
...
@@ -461,23 +461,23 @@ namespace OnlineStore.Common
/// </summary>
/// <param name="s"></param>
/// <returns></returns>
public
static
byte
[]
StringToByte
(
string
s
)
{
string
temps
=
ReplaceSpace
(
s
);
if
(
temps
.
Length
%
2
!=
0
)
{
temps
=
"0"
+
temps
;
}
byte
[]
tempb
=
new
byte
[
50
];
int
j
=
0
;
for
(
int
i
=
0
;
i
<
temps
.
Length
;
i
=
i
+
2
,
j
++)
{
tempb
[
j
]
=
Convert
.
ToByte
(
temps
.
Substring
(
i
,
2
),
16
);
}
byte
[]
send
=
new
byte
[
j
];
Array
.
Copy
(
tempb
,
send
,
j
);
return
send
;
}
//
public static byte[] StringToByte(string s)
//
{
//
string temps = ReplaceSpace(s);
//
if (temps.Length % 2 != 0)
//
{
//
temps = "0" + temps;
//
}
//
byte[] tempb = new byte[50];
//
int j = 0;
//
for (int i = 0; i < temps.Length; i = i + 2, j++)
//
{
//
tempb[j] = Convert.ToByte(temps.Substring(i, 2), 16);
//
}
//
byte[] send = new byte[j];
//
Array.Copy(tempb, send, j);
//
return send;
//
}
//除去空格
public
static
string
ReplaceSpace
(
string
str
)
...
...
@@ -525,33 +525,33 @@ namespace OnlineStore.Common
pChecksum
=
check
;
}
public
static
void
CalculateCRC
(
byte
[]
pByte
,
int
nNumberOfBytes
,
out
ushort
pChecksum
)
{
int
nBit
;
ushort
nShiftedBit
;
pChecksum
=
0xFFFF
;
for
(
int
nByte
=
0
;
nByte
<
nNumberOfBytes
;
nByte
++)
{
pChecksum
^=
pByte
[
nByte
];
for
(
nBit
=
0
;
nBit
<
8
;
nBit
++)
{
if
((
pChecksum
&
0x1
)
==
1
)
{
nShiftedBit
=
1
;
}
else
{
nShiftedBit
=
0
;
}
pChecksum
>>=
1
;
if
(
nShiftedBit
!=
0
)
{
pChecksum
^=
0xA001
;
}
}
}
}
//
public static void CalculateCRC(byte[] pByte, int nNumberOfBytes, out ushort pChecksum)
//
{
//
int nBit;
//
ushort nShiftedBit;
//
pChecksum = 0xFFFF;
//
for (int nByte = 0; nByte < nNumberOfBytes; nByte++)
//
{
//
pChecksum ^= pByte[nByte];
//
for (nBit = 0; nBit < 8; nBit++)
//
{
//
if ((pChecksum & 0x1) == 1)
//
{
//
nShiftedBit = 1;
//
}
//
else
//
{
//
nShiftedBit = 0;
//
}
//
pChecksum >>= 1;
//
if (nShiftedBit != 0)
//
{
//
pChecksum ^= 0xA001;
//
}
//
}
//
}
//
}
#
endregion
}
...
...
source/DeviceLibrary/DeviceLibrary.csproj
查看文件 @
556fc0f
...
...
@@ -67,12 +67,13 @@
<Compile Include="PanasonicServo\ACCMDManager.cs" />
<Compile Include="PanasonicServo\ACServerManager.cs" />
<Compile Include="PanasonicServo\ACServerManager_Partial.cs" />
<Compile Include="ShuoKe\MeteringSignalBean.cs" />
<Compile Include="ShuoKe\ShuoKeController.cs" />
<Compile Include="store\LineMoveP.cs" />
<Compile Include="store\LineAlarm.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="ShuoKe\ShuoKeControls.cs" />
<Compile Include="store\model\AxisAlarmInfo.cs" />
<Compile Include="store\model\FixtureCodeInfo.cs" />
<Compile Include="store\InOrOutStoreParam.cs">
...
...
source/DeviceLibrary/PanasonicServo/ACCMDManager.cs
查看文件 @
556fc0f
...
...
@@ -141,9 +141,9 @@ namespace OnlineStore.DeviceLibrary
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
];
...
...
@@ -186,7 +186,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
;
...
...
@@ -198,7 +198,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
;
...
...
@@ -219,7 +219,7 @@ namespace OnlineStore.DeviceLibrary
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
;
...
...
@@ -231,7 +231,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
;
...
...
@@ -262,7 +262,7 @@ namespace OnlineStore.DeviceLibrary
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
;
...
...
@@ -274,7 +274,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
;
...
...
@@ -304,7 +304,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
;
...
...
@@ -316,7 +316,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
;
...
...
source/DeviceLibrary/PanasonicServo/ACServerManager.cs
查看文件 @
556fc0f
...
...
@@ -246,8 +246,8 @@ namespace OnlineStore.DeviceLibrary
public
static
void
RelMove
(
string
portName
,
int
slvAddr
,
int
position
)
{
//int position = Convert.ToInt32(txtPosition.Text);
byte
[]
positionData
=
SerialBean
.
StringToByte
(
position
.
ToString
(
"X8"
));
byte
[]
data
=
SerialBean
.
StringToByte
(
"0110480C 000408 10000111EC78FFFF ffff"
);
byte
[]
positionData
=
Ac
SerialBean
.
StringToByte
(
position
.
ToString
(
"X8"
));
byte
[]
data
=
Ac
SerialBean
.
StringToByte
(
"0110480C 000408 10000111EC78FFFF ffff"
);
data
[
0
]
=
(
byte
)
slvAddr
;
data
[
data
.
Length
-
1
]
=
0x00
;
data
[
data
.
Length
-
2
]
=
0x00
;
...
...
@@ -397,8 +397,8 @@ namespace OnlineStore.DeviceLibrary
public
static
void
AbsMove
(
string
portName
,
int
slvAddr
,
int
position
)
{
//int position = Convert.ToInt32(txtPosition.Text, 10);
byte
[]
positionData
=
SerialBean
.
StringToByte
(
position
.
ToString
(
"X8"
));
byte
[]
data
=
SerialBean
.
StringToByte
(
"01104808 000408 10000211 EC78FFFF ffff"
);
byte
[]
positionData
=
Ac
SerialBean
.
StringToByte
(
position
.
ToString
(
"X8"
));
byte
[]
data
=
Ac
SerialBean
.
StringToByte
(
"01104808 000408 10000211 EC78FFFF ffff"
);
data
[
0
]
=
(
byte
)
slvAddr
;
data
[
data
.
Length
-
1
]
=
0x00
;
data
[
data
.
Length
-
2
]
=
0x00
;
...
...
source/DeviceLibrary/PanasonicServo/ACServerManager_Partial.cs
查看文件 @
556fc0f
...
...
@@ -41,7 +41,7 @@ namespace OnlineStore.DeviceLibrary
//}
public
static
void
SendStrAndSleep
(
string
portName
,
string
str
,
int
sleepS
)
{
byte
[]
data
=
SerialBean
.
StringToByte
(
str
);
byte
[]
data
=
Ac
SerialBean
.
StringToByte
(
str
);
data
[
data
.
Length
-
1
]
=
0x00
;
data
[
data
.
Length
-
2
]
=
0x00
;
data
=
ACCMDManager
.
buildCheckData
(
data
,
data
.
Length
-
2
);
...
...
@@ -50,7 +50,7 @@ namespace OnlineStore.DeviceLibrary
}
public
static
void
SendStr
(
string
portName
,
string
str
)
{
byte
[]
data
=
SerialBean
.
StringToByte
(
str
);
byte
[]
data
=
Ac
SerialBean
.
StringToByte
(
str
);
data
[
data
.
Length
-
1
]
=
0x00
;
data
[
data
.
Length
-
2
]
=
0x00
;
data
=
ACCMDManager
.
buildCheckData
(
data
,
data
.
Length
-
2
);
...
...
@@ -283,7 +283,7 @@ namespace OnlineStore.DeviceLibrary
public
static
void
SendStr
(
string
portName
,
int
slvAddr
,
string
str
)
{
//string str = txtSendStr.Text;
byte
[]
data
=
SerialBean
.
StringToByte
(
str
);
byte
[]
data
=
Ac
SerialBean
.
StringToByte
(
str
);
data
[
data
.
Length
-
1
]
=
0x00
;
data
[
data
.
Length
-
2
]
=
0x00
;
data
=
ACCMDManager
.
buildCheckData
(
data
,
data
.
Length
-
2
);
...
...
source/DeviceLibrary/ShuoKe/MeteringSignalBean.cs
0 → 100644
查看文件 @
556fc0f
using
OnlineStore.Common
;
using
OnlineStore.LoadCSVLibrary
;
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Text
;
using
System.Timers
;
namespace
OnlineStore.DeviceLibrary
{
/// <summary>
/// 压紧机构计量检测信号处理
/// </summary>
public
class
MeteringSignal
{
public
static
int
ComAxisChangeValue
=
ConfigAppSettings
.
GetIntValue
(
Setting_Init
.
ComAxisChangeValue
);
/// <summary>
/// 信号变化次数
/// </summary>
public
static
int
SignalChangeCount
=
0
;
public
static
int
TragetChangeCount
=
0
;
public
static
IO_VALUE
PreSignalValue
=
IO_VALUE
.
LOW
;
private
static
System
.
Timers
.
Timer
timer
=
null
;
public
static
void
StartCheck
(
int
targetPositon
,
int
currPosition
)
{
int
chazhi
=
Math
.
Abs
(
targetPositon
-
currPosition
);
int
count
=
chazhi
/
ComAxisChangeValue
;
if
(
count
>
0
&&
chazhi
>
ComAxisChangeValue
)
{
StartCheck
(
count
);
}
}
private
static
void
StartCheck
(
int
targetCount
)
{
TragetChangeCount
=
targetCount
;
if
(
timer
==
null
)
{
timer
=
new
System
.
Timers
.
Timer
();
timer
.
Interval
=
50
;
timer
.
AutoReset
=
true
;
timer
.
Elapsed
+=
Timer_Elapsed
;
timer
.
Enabled
=
false
;
}
LogUtil
.
debug
(
"开始压紧轴计量检测,预计变化"
+
TragetChangeCount
+
"次"
);
IsInProcess
=
false
;
PreSignalValue
=
IO_VALUE
.
LOW
;
SignalChangeCount
=
0
;
timer
.
Start
();
}
public
static
void
StopCheck
()
{
if
(
timer
==
null
)
{
return
;
}
timer
.
Stop
();
}
private
static
bool
IsInProcess
=
false
;
protected
static
void
Timer_Elapsed
(
object
sender
,
ElapsedEventArgs
e
)
{
if
(
IsInProcess
)
{
return
;
}
IsInProcess
=
true
;
IO_VALUE
value
=
KND
.
IOValue
(
IO_Type
.
CompressAxis_Check
);
if
(
value
.
Equals
(
IO_VALUE
.
HIGH
)
&&
PreSignalValue
.
Equals
(
IO_VALUE
.
LOW
))
{
SignalChangeCount
++;
LogUtil
.
debug
(
"检测到信号变化,已经变化"
+
SignalChangeCount
+
"次"
);
}
PreSignalValue
=
value
;
if
(
TragetChangeCount
<=
SignalChangeCount
)
{
timer
.
Stop
();
}
IsInProcess
=
false
;
}
}
}
source/DeviceLibrary/ShuoKe/ShuoKeController.cs
0 → 100644
查看文件 @
556fc0f
using
log4net
;
using
OnlineStore.Common
;
using
OnlineStore.LoadCSVLibrary
;
using
System
;
using
System.Collections.Generic
;
using
System.IO.Ports
;
using
System.Linq
;
using
System.Text
;
using
System.Threading
;
namespace
OnlineStore.DeviceLibrary
{
/// <summary>
/// 硕科控制模块代码
/// </summary>
public
class
ShuoKeControls
{
public
static
readonly
ILog
LOGGER
=
LogManager
.
GetLogger
(
System
.
Reflection
.
MethodBase
.
GetCurrentMethod
().
DeclaringType
);
private
static
AcSerialBean
bean
=
null
;
public
static
bool
isRun
=
false
;
private
static
Dictionary
<
int
,
ShuoKeInfo
>
shuokeMap
=
new
Dictionary
<
int
,
ShuoKeInfo
>();
public
static
string
PortName
=
""
;
private
static
int
SleepMS
=
50
;
private
static
int
DReviceLength
=
5
;
#
region
串口操作
public
static
bool
ResertInitPort
(
string
comPortName
,
int
baudRate
,
int
tparity
,
int
dataBits
,
StopBits
stopBits
)
{
PortName
=
comPortName
;
if
(
isRun
)
{
ClosePort
();
}
return
InitPort
(
comPortName
,
baudRate
,
tparity
,
dataBits
,
stopBits
);
}
public
static
bool
InitPort
(
string
comPortName
,
int
baudRate
,
int
tparity
,
int
dataBits
,
StopBits
stopBits
)
{
if
(
isRun
)
{
return
true
;
}
try
{
PortName
=
comPortName
;
Parity
parity
=
(
Parity
)
tparity
;
bean
=
new
AcSerialBean
(
comPortName
,
baudRate
,
parity
,
8
,
stopBits
);
bool
result
=
bean
.
openPort
();
if
(!
result
)
{
return
false
;
}
//bean.DataReceived += DataReceived;
isRun
=
true
;
}
catch
(
Exception
ex
)
{
isRun
=
false
;
LogUtil
.
error
(
LOGGER
,
"打开步进控制器串口失败:"
+
ex
.
ToString
());
return
false
;
}
return
true
;
}
public
static
void
ClosePort
()
{
isRun
=
false
;
if
(
bean
==
null
)
{
return
;
}
bean
.
closePort
();
LogUtil
.
info
(
LOGGER
,
"关闭步进控制器串口完成"
);
}
/// <summary>
/// 发送数据并获取返回值
/// </summary>
/// <param name="data">发送的数据</param>
/// <param name="outTime">超时时间</param>
/// <returns>返回值的长度</returns>
public
static
byte
[]
SendCommand
(
byte
[]
data
,
int
outTime
,
int
reviceLength
)
{
if
(
outTime
<=
0
)
{
outTime
=
30
;
}
if
(
outTime
>
80
)
{
outTime
=
80
;
}
byte
[]
returnData
=
null
;
try
{
if
(
data
==
null
)
{
return
returnData
;
}
string
strSend
=
""
;
for
(
int
i
=
0
;
i
<
data
.
Length
;
i
++)
{
strSend
+=
string
.
Format
(
"{0:X2} "
,
data
[
i
]);
}
if
(
strSend
.
Equals
(
""
))
{
return
returnData
;
}
LogUtil
.
debug
(
"串口"
+
PortName
+
" 写入数据:"
+
strSend
+
""
);
if
(
bean
==
null
)
{
LogUtil
.
debug
(
" 试图向未打开串口【"
+
PortName
+
"】写入数据:"
+
strSend
+
"。"
);
}
else
{
bean
.
SendCommand
(
data
,
ref
returnData
,
outTime
,
reviceLength
);
}
}
catch
(
Exception
ex
)
{
LogUtil
.
info
(
ex
.
ToString
());
}
return
returnData
;
}
private
static
void
DataReceived
(
string
portName
,
object
sender
,
SerialDataReceivedEventArgs
e
,
byte
[]
bits
)
{
string
strSend
=
""
;
for
(
int
i
=
0
;
i
<
bits
.
Length
;
i
++)
{
strSend
+=
string
.
Format
(
"{0:X2} "
,
bits
[
i
]);
}
if
(
strSend
.
Equals
(
""
))
{
return
;
}
//校验
ushort
pChecksum
=
0
;
AcSerialBean
.
CalculateCRC
(
bits
,
bits
.
Length
-
2
,
out
pChecksum
);
string
checkStr
=
Convert
.
ToString
(
pChecksum
,
16
);
byte
[]
checkByte
=
AcSerialBean
.
StringToByte
(
checkStr
);
if
(
checkByte
.
Length
==
1
)
{
if
(!
bits
[
bits
.
Length
-
2
].
Equals
(
checkByte
[
0
]))
{
bean
.
clearInBuffer
();
LogUtil
.
info
(
LOGGER
,
" 【"
+
portName
+
"】 收到数据【"
+
strSend
+
"】,校验错误"
);
return
;
}
}
else
{
if
(!
bits
[
bits
.
Length
-
1
].
Equals
(
checkByte
[
0
])
||
(!
bits
[
bits
.
Length
-
2
].
Equals
(
checkByte
[
1
])))
{
bean
.
clearInBuffer
();
LogUtil
.
info
(
LOGGER
,
" 【"
+
portName
+
"】 收到数据【"
+
strSend
+
"】,校验错误"
);
return
;
}
}
LogUtil
.
debug
(
LOGGER
,
" 【"
+
portName
+
"】 收到数据【"
+
strSend
+
"】"
);
int
slvAddr
=
(
int
)
bits
[
0
];
byte
cmd
=
bits
[
1
];
//查询状态
if
(
cmd
.
Equals
(
ShuoKeCMD
.
SearchMoveStatus
))
{
ShuoKeInfo
info
=
DataToStatus
(
bits
);
}
else
if
(
cmd
.
Equals
(
ShuoKeCMD
.
GetAbsPosition
))
{
int
position
=
DataToPosition
(
bits
);
}
}
private
static
bool
CheckByte
(
byte
[]
bits
)
{
string
strSend
=
""
;
for
(
int
i
=
0
;
i
<
bits
.
Length
;
i
++)
{
strSend
+=
string
.
Format
(
"{0:X2} "
,
bits
[
i
]);
}
//校验
ushort
pChecksum
=
0
;
AcSerialBean
.
CalculateCRC
(
bits
,
bits
.
Length
-
2
,
out
pChecksum
);
string
checkStr
=
Convert
.
ToString
(
pChecksum
,
16
);
byte
[]
checkByte
=
AcSerialBean
.
StringToByte
(
checkStr
);
if
(
checkByte
.
Length
==
1
)
{
if
(!
bits
[
bits
.
Length
-
2
].
Equals
(
checkByte
[
0
]))
{
bean
.
clearInBuffer
();
LogUtil
.
info
(
LOGGER
,
"【"
+
PortName
+
"】收到数据【"
+
strSend
+
"】校验错误"
);
return
false
;
}
}
else
{
if
(!
bits
[
bits
.
Length
-
1
].
Equals
(
checkByte
[
0
])
||
(!
bits
[
bits
.
Length
-
2
].
Equals
(
checkByte
[
1
])))
{
bean
.
clearInBuffer
();
LogUtil
.
info
(
LOGGER
,
"【"
+
PortName
+
"】收到数据【"
+
strSend
+
"】校验错误"
);
return
false
;
}
}
return
true
;
}
private
static
int
DataToPosition
(
byte
[]
bits
)
{
int
absValue
=
-
1
;
if
(!
CheckByte
(
bits
))
{
return
absValue
;
}
if
(
bits
.
Length
>=
7
)
{
int
slvAddr
=
(
int
)
bits
[
0
];
byte
[]
positionData
=
new
byte
[
4
];
Array
.
Copy
(
bits
,
3
,
positionData
,
0
,
4
);
string
a
=
AcSerialBean
.
byteToHexStr
(
positionData
);
absValue
=
Convert
.
ToInt32
(
a
,
16
);
LogUtil
.
debug
(
LOGGER
,
"收到驱动器【"
+
slvAddr
+
"】绝对位置【"
+
absValue
+
"】"
);
if
(
shuokeMap
.
ContainsKey
(
slvAddr
))
{
shuokeMap
[
slvAddr
].
LastPosition
=
absValue
;
}
else
{
ShuoKeInfo
info
=
new
ShuoKeInfo
(
slvAddr
,
absValue
);
shuokeMap
.
Add
(
slvAddr
,
info
);
}
}
return
absValue
;
}
private
static
ShuoKeInfo
DataToStatus
(
byte
[]
bits
)
{
ShuoKeInfo
info
=
new
ShuoKeInfo
(-
1
,
-
1
);
if
(!
CheckByte
(
bits
))
{
return
info
;
}
if
(
bits
.
Length
>=
8
)
{
//[数据1]:1表示运动中,0表示停止
//[数据2]:LL-左限位IO状态 1表示有效 0表示无效
//[数据3]:O-原点IO状态 1表示有效 0表示无效,,=1表示原点灭,=0表示当前原点亮
// [数据4]:RL-右限位IO状态 1表示有效 0表示无效
//[数据5]:EN-使能IO状态 1表示有效 0表示无效
int
slvAddr
=
(
int
)
bits
[
0
];
byte
cmd
=
bits
[
1
];
int
isInMove
=
bits
[
3
];
int
isLLimit
=
bits
[
4
];
int
isOrg
=
bits
[
5
];
int
isRLimit
=
bits
[
6
];
int
isEn
=
bits
[
7
];
info
=
new
ShuoKeInfo
(
isInMove
,
slvAddr
,
isLLimit
,
isOrg
,
isRLimit
,
isEn
);
try
{
if
(
shuokeMap
.
ContainsKey
(
slvAddr
))
{
info
.
LastPosition
=
shuokeMap
[
slvAddr
].
LastPosition
;
shuokeMap
.
Remove
(
slvAddr
);
}
shuokeMap
.
Add
(
slvAddr
,
info
);
}
catch
(
Exception
ex
)
{
LogUtil
.
error
(
LOGGER
,
"记录状态出错:"
+
ex
.
ToString
());
}
LogUtil
.
debug
(
LOGGER
,
"收到驱动器【"
+
slvAddr
+
"】运动状态:运动【"
+
isInMove
+
"】左限位【"
+
isLLimit
+
"】右限位【"
+
isRLimit
+
"】原点【"
+
isOrg
+
"】使能【"
+
isEn
+
"】"
);
}
return
info
;
}
public
static
int
GetLastPosition
(
int
slvAddr
)
{
if
(
shuokeMap
.
ContainsKey
(
slvAddr
))
{
ShuoKeInfo
info
=
shuokeMap
[
slvAddr
];
return
info
.
LastPosition
;
}
return
-
1
;
}
#
endregion
#
region
逻辑判断
public
static
bool
IsMoveEnd
(
int
slvAddr
,
int
targetPosition
,
DateTime
time
,
out
string
msg
)
{
ShuoKeInfo
shuokeInfo
=
GetStatus
(
slvAddr
);
msg
=
" IsInMove【"
+
shuokeInfo
.
IsInMove
+
"】 "
;
if
(
shuokeInfo
.
IsInMove
==
0
&&
shuokeInfo
.
UpdateTime
>
time
)
{
int
position
=
GetABSPosition
(
slvAddr
);
msg
+=
"位置【"
+
position
+
"】"
;
if
(
Math
.
Abs
(
position
-
targetPosition
)
<
10
||
targetPosition
.
Equals
(-
2000
))
{
return
true
;
}
else
{
LogUtil
.
info
(
"【"
+
PortName
+
"】 目标位置【"
+
targetPosition
+
"】当前位置【"
+
position
+
"】,已经不再运动中"
);
}
}
return
false
;
}
public
static
bool
IsHomeMoveEnd
(
int
slvAddr
,
DateTime
time
,
out
string
msg
)
{
ShuoKeInfo
shuokeInfo
=
GetStatus
(
slvAddr
);
msg
=
" IsInMove【"
+
shuokeInfo
.
IsInMove
+
"】Org【"
+
shuokeInfo
.
Org
+
"】"
;
if
(
shuokeInfo
.
IsInMove
.
Equals
(
0
)
&&
shuokeInfo
.
Org
.
Equals
(
0
)&&
shuokeInfo
.
UpdateTime
>
time
)
{
return
true
;
}
return
false
;
}
#
endregion
#
region
驱动器操作方法
public
static
ShuoKeInfo
GetStatus
(
int
slvAddr
)
{
byte
[]
reviceData
=
SendData
(
slvAddr
,
ShuoKeCMD
.
SearchMoveStatus
,
0x00
,
0
,
10
);
return
DataToStatus
(
reviceData
);
}
public
static
void
DStoop
(
int
slvAddr
)
{
byte
[]
reviceData
=
SendData
(
slvAddr
,
ShuoKeCMD
.
DStopMove
,
0x00
,
0
,
DReviceLength
);
}
public
static
void
SuddownStop
(
int
slvAddr
)
{
byte
[]
reviceData
=
SendData
(
slvAddr
,
ShuoKeCMD
.
SuddownStopMove
,
0x00
,
0
,
DReviceLength
);
}
public
static
int
GetABSPosition
(
int
slvAddr
)
{
byte
[]
reviceData
=
SendData
(
slvAddr
,
ShuoKeCMD
.
GetAbsPosition
,
0x00
,
0
,
9
);
return
DataToPosition
(
reviceData
);
}
// <param name="homeType">0=反方向,1=正方向</param>
public
static
void
HomeMove
(
int
slvAddr
,
byte
homeType
)
{
string
fangx
=
homeType
.
Equals
(
0
)
?
"反方向"
:
"正方向"
;
LogUtil
.
info
(
"压紧轴原点返回:"
+
fangx
);
byte
[]
reviceData
=
SendData
(
slvAddr
,
ShuoKeCMD
.
HomeMove
,
0x01
,
homeType
,
DReviceLength
);
}
public
static
void
SetConfigSpeed
(
AUTO_SA_Config
Config
)
{
ShuoKeControls
.
SetSpeed
(
Config
.
CompressAxis_Slv
,
ShuoKeCMD
.
SetAddSpeed
,
Config
.
CompressAxis_AddSpeed
);
ShuoKeControls
.
SetSpeed
(
Config
.
CompressAxis_Slv
,
ShuoKeCMD
.
SetDelSpeed
,
Config
.
CompressAxis_DelSpeed
);
ShuoKeControls
.
SetSpeed
(
Config
.
CompressAxis_Slv
,
ShuoKeCMD
.
SetEndSpeed
,
Config
.
CompressAxis_EndSpeed
);
ShuoKeControls
.
SetSpeed
(
Config
.
CompressAxis_Slv
,
ShuoKeCMD
.
SetHomeSpeed
,
Config
.
CompressAxis_HomeSpeed
);
ShuoKeControls
.
SetSpeed
(
Config
.
CompressAxis_Slv
,
ShuoKeCMD
.
SetMaxSpeed
,
Config
.
CompressAxis_MaxSpeed
);
ShuoKeControls
.
SetSpeed
(
Config
.
CompressAxis_Slv
,
ShuoKeCMD
.
SetStartSpeed
,
Config
.
CompressAxis_StartSpeed
);
}
public
static
void
VolMove
(
int
slvAddr
,
int
speed
)
{
byte
[]
reviceData
=
SendData
(
slvAddr
,
ShuoKeCMD
.
VolMove
,
0x04
,
speed
,
DReviceLength
);
}
public
static
void
AbsMove
(
int
slvAddr
,
int
TargetPosition
)
{
// 47、设置绝对位置并开始运动:不支持广播(开环的32位脉冲统计长度)
//正负数表示绝对位置,如果已经到位置,则不做运动。(M4505S特有命令)
//发送: 应答:
//[设备地址] 0x01 [设备地址] 0x01
//[命令] 0x50 [命令] 0x50
//[数据长度] 4 [数据长度] 0
//[数据] xxxxxxxx [数据] 无
//[CRC校验1] 0xnn [CRC校验1] 0xnn
//[CRC校验2] 0xnn [CRC校验2] 0xnn
//数据:4BYTE,(支持32位有符号脉冲位置)
byte
[]
reviceData
=
SendData
(
slvAddr
,
ShuoKeCMD
.
AbsMove
,
0x04
,
TargetPosition
,
DReviceLength
);
}
public
static
void
RelativeMove
(
int
slvAddr
,
int
position
)
{
//1是正方向
byte
fangxiang
=
0x01
;
if
(
position
<
0
)
{
fangxiang
=
0x00
;
position
=
Math
.
Abs
(
position
);
}
byte
dataLength
=
0x04
;
byte
[]
sendData
=
new
byte
[
5
+
dataLength
];
sendData
[
0
]
=
(
byte
)
slvAddr
;
sendData
[
1
]
=
ShuoKeCMD
.
RelativeMove
;
sendData
[
2
]
=
dataLength
;
sendData
[
3
]
=
0x00
;
sendData
[
4
]
=
0x00
;
sendData
[
5
]
=
0x00
;
sendData
[
6
]
=
0x00
;
string
speed
=
Convert
.
ToString
(
position
,
16
);
byte
[]
speedByte
=
AcSerialBean
.
StringToByte
(
speed
);
for
(
int
i
=
0
;
i
<
speedByte
.
Length
;
i
++)
{
if
(
i
>=
4
)
{
break
;
}
sendData
[
6
-
(
speedByte
.
Length
-
1
-
i
)]
=
speedByte
[
i
];
}
sendData
[
3
]
=
fangxiang
;
sendData
=
buildCheckData
(
sendData
,
3
+
dataLength
);
byte
[]
reviceData
=
SendCommand
(
sendData
,
SleepMS
,
DReviceLength
);
Thread
.
Sleep
(
SleepMS
);
}
public
static
void
PositionClear
(
int
slvAddr
,
byte
setCMD
)
{
byte
[]
reviceData
=
SendData
(
slvAddr
,
setCMD
,
0x00
,
0
,
DReviceLength
);
}
/// <summary>
/// 设置电机的速度
/// </summary>
/// <param name="slvAddr">电机地址</param>
/// <param name="setCMD">设置速度的命令号</param>
/// <param name="speedValue">速度值</param>
public
static
void
SetSpeed
(
int
slvAddr
,
byte
setCMD
,
int
speedValue
)
{
byte
[]
reviceData
=
SendData
(
slvAddr
,
setCMD
,
0x04
,
speedValue
,
DReviceLength
);
Thread
.
Sleep
(
10
);
}
private
static
byte
[]
SendData
(
int
slvAddr
,
byte
cmd
,
byte
dataLength
,
int
dataValue
,
int
reviceDataLength
)
{
byte
[]
sendData
=
new
byte
[
5
+
dataLength
];
sendData
[
0
]
=
(
byte
)
slvAddr
;
sendData
[
1
]
=
cmd
;
sendData
[
2
]
=
dataLength
;
if
(
dataLength
.
Equals
(
0x00
))
{
}
else
if
(
dataLength
.
Equals
(
0x01
))
{
sendData
[
3
]
=
(
byte
)
dataValue
;
}
else
if
(
dataLength
.
Equals
(
0x04
))
{
sendData
[
3
]
=
0x00
;
sendData
[
4
]
=
0x00
;
sendData
[
5
]
=
0x00
;
sendData
[
6
]
=
0x00
;
string
speed
=
Convert
.
ToString
(
dataValue
,
16
);
byte
[]
speedByte
=
AcSerialBean
.
StringToByte
(
speed
);
for
(
int
i
=
0
;
i
<
speedByte
.
Length
;
i
++)
{
if
(
i
>=
4
)
{
break
;
}
sendData
[
6
-
(
speedByte
.
Length
-
1
-
i
)]
=
speedByte
[
i
];
}
}
sendData
=
buildCheckData
(
sendData
,
3
+
dataLength
);
byte
[]
reviceData
=
SendCommand
(
sendData
,
SleepMS
,
reviceDataLength
);
Thread
.
Sleep
(
SleepMS
);
return
reviceData
;
}
private
static
byte
[]
buildCheckData
(
byte
[]
sendData
,
int
length
)
{
ushort
pChecksum
=
0
;
AcSerialBean
.
CalculateCRC
(
sendData
,
length
,
out
pChecksum
);
string
checkStr
=
Convert
.
ToString
(
pChecksum
,
16
);
byte
[]
checkByte
=
AcSerialBean
.
StringToByte
(
checkStr
);
if
(
checkByte
.
Length
==
1
)
{
sendData
[
length
]
=
checkByte
[
0
];
sendData
[
length
+
1
]
=
0x00
;
}
else
{
sendData
[
length
+
1
]
=
checkByte
[
0
];
sendData
[
length
]
=
checkByte
[
1
];
}
return
sendData
;
}
#
endregion
}
public
class
ShuoKeCMD
{
/// <summary>
/// 设置运动初速度://SndHex:01 25 04 00 00 00 64 FC DE
/// </summary>
public
static
byte
SetStartSpeed
=
0x25
;
/// <summary>
/// 设置运动最大速度://SndHex:01 27 04 00 00 27 10 E6 EB
/// </summary>
public
static
byte
SetMaxSpeed
=
0x27
;
/// <summary>
/// 设置运动末速度://SndHex:01 29 04 00 00 03 E8 FD 47
/// </summary>
public
static
byte
SetEndSpeed
=
0x29
;
/// <summary>
/// 设置运动加速度://SndHex:01 2B 04 00 00 13 88 F1 4D
/// </summary>
public
static
byte
SetAddSpeed
=
0x2B
;
/// <summary>
/// 设置运动减速度://SndHex:01 2D 04 00 00 03 E8 FC C3
/// </summary>
public
static
byte
SetDelSpeed
=
0x2D
;
/// <summary>
/// 设置归零运动速度://SndHex:01 2F 04 00 00 27 10 E7 A3
/// </summary>
public
static
byte
SetHomeSpeed
=
0x2F
;
/// <summary>
/// //查找原点命令:
//SndHex:01 3E 01 00 61 84
/// </summary>
public
static
byte
HomeMove
=
0x3E
;
/// <summary>
/// 绝对位置运动//SndHex:01 50 04 FF FF D8 F0 AC 30
/// </summary>
public
static
byte
AbsMove
=
0x50
;
/// <summary>
/// 急停命令://SndHex:01 3C 00 31 00
/// </summary>
public
static
byte
SuddownStopMove
=
0x3C
;
/// <summary>
/// 减速停止命令://SndHex:01 3D 00 30 90
/// </summary>
public
static
byte
DStopMove
=
0x3D
;
/// <summary>
/// 绝对位置清零: //SndHex:01 38 00 33 C0
/// </summary>
public
static
byte
AbsPositionClear
=
0x38
;
/// <summary>
/// 相对位置清零: //SndHex:01 3A 00 32 A0
/// </summary>
public
static
byte
RelPositionClear
=
0x3A
;
/// <summary>
/// 查询运动状态://SndHex:01 3B 00 33 30
/// </summary>
public
static
byte
SearchMoveStatus
=
0x3B
;
/// <summary>
//查询设备地址://SndHex:00 21 00 69 90
/// </summary>
public
static
byte
SearchSlvAddr
=
0x21
;
/// <summary>
/// 设置32位运动速度,并恒速运动:SndHex:01 33 04 00 00 27 10 E5 FF
/// </summary>
public
static
byte
VolMove
=
0x33
;
/// <summary>
/// 查询绝对位置
/// </summary>
public
static
byte
GetAbsPosition
=
0x37
;
/// <summary>
/// 相对位置运动
/// </summary>
public
static
byte
RelativeMove
=
0x32
;
}
public
class
ShuoKeInfo
{
public
ShuoKeInfo
(
int
slv
,
int
position
)
{
this
.
IsInMove
=
-
1
;
this
.
SlvAddr
=
slv
;
this
.
LLimit
=
-
1
;
this
.
RLimit
=
-
1
;
this
.
Org
=
-
1
;
this
.
En
=
-
1
;
UpdateTime
=
DateTime
.
Now
;
LastPosition
=
position
;
}
public
ShuoKeInfo
(
int
ismove
,
int
slv
,
int
ll
,
int
org
,
int
rl
,
int
en
)
{
this
.
IsInMove
=
ismove
;
this
.
SlvAddr
=
slv
;
this
.
LLimit
=
ll
;
this
.
RLimit
=
rl
;
this
.
Org
=
org
;
this
.
En
=
en
;
UpdateTime
=
DateTime
.
Now
;
LastPosition
=
0
;
}
public
int
LastPosition
{
get
;
set
;
}
/// <summary>
/// 驱动器地址
/// </summary>
public
int
SlvAddr
{
get
;
set
;
}
/// <summary>
/// 是否在运动中
/// </summary>
public
int
IsInMove
{
get
;
set
;
}
/// <summary>
/// 左极限
/// </summary>
public
int
LLimit
{
get
;
set
;
}
/// <summary>
/// 右极限
/// </summary>
public
int
RLimit
{
get
;
set
;
}
/// <summary>
/// 原点信号是否有效
/// </summary>
public
int
Org
{
get
;
set
;
}
/// <summary>
/// 使能是否有效
/// </summary>
public
int
En
{
get
;
set
;
}
public
DateTime
UpdateTime
{
get
;
set
;
}
public
string
ToShowStr
()
{
return
"运动["
+
IsInMove
+
"]左限位["
+
LLimit
+
"]右限位["
+
RLimit
+
"]原点["
+
Org
+
"]使能["
+
En
+
"]["
+
UpdateTime
.
ToShortTimeString
()
+
"]"
;
}
}
}
source/DeviceLibrary/ShuoKe/ShuoKeControls.cs
查看文件 @
556fc0f
...
...
@@ -94,9 +94,9 @@ namespace OnlineStore.DeviceLibrary
//校验
ushort
pChecksum
=
0
;
SerialBean
.
CalculateCRC
(
bits
,
bits
.
Length
-
2
,
out
pChecksum
);
Ac
SerialBean
.
CalculateCRC
(
bits
,
bits
.
Length
-
2
,
out
pChecksum
);
string
checkStr
=
Convert
.
ToString
(
pChecksum
,
16
);
byte
[]
checkByte
=
SerialBean
.
StringToByte
(
checkStr
);
byte
[]
checkByte
=
Ac
SerialBean
.
StringToByte
(
checkStr
);
if
(
checkByte
.
Length
==
1
)
{
if
(!
bits
[
bits
.
Length
-
2
].
Equals
(
checkByte
[
0
]))
...
...
@@ -299,7 +299,7 @@ namespace OnlineStore.DeviceLibrary
sendData
[
5
]
=
0x00
;
sendData
[
6
]
=
0x00
;
string
speed
=
Convert
.
ToString
(
position
,
16
);
byte
[]
speedByte
=
SerialBean
.
StringToByte
(
speed
);
byte
[]
speedByte
=
Ac
SerialBean
.
StringToByte
(
speed
);
for
(
int
i
=
0
;
i
<
speedByte
.
Length
;
i
++)
{
...
...
@@ -349,7 +349,7 @@ namespace OnlineStore.DeviceLibrary
sendData
[
5
]
=
0x00
;
sendData
[
6
]
=
0x00
;
string
speed
=
Convert
.
ToString
(
dataValue
,
16
);
byte
[]
speedByte
=
SerialBean
.
StringToByte
(
speed
);
byte
[]
speedByte
=
Ac
SerialBean
.
StringToByte
(
speed
);
for
(
int
i
=
0
;
i
<
speedByte
.
Length
;
i
++)
{
...
...
@@ -367,9 +367,9 @@ namespace OnlineStore.DeviceLibrary
private
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
];
...
...
source/DeviceLibrary/StoreConfig/AC/StoreConfig.csv
查看文件 @
556fc0f
...
...
@@ -139,7 +139,8 @@ PRO,(轴五)上料轴最大误差脉冲值,BatchAxis_ErrorCountMax,1000,,,,,,,
PRO,(轴五)上料轴最小限位,BatchAxis_PositionMin,0,,,,,,,
PRO,(轴五)上料轴最大限位,BatchAxis_PositionMax,0,,,,,,,
PRO,(轴五)上料轴P1速度,BatchAxis_P1_Speed,300,,,,,,,
,,,,,,,,,,
PRO,(轴五)上料轴出料时距离检测信号需要下降的高度,BatchAxis_OutDownPosition,3000,,,,,,,
PRO,(轴五)上料轴最最大料盘高度,到达后无法批量出库,BatchAxis_MaxHeight,100,,,,,,,
,,,,,,,,,,
PRO,IO模块对应的DI数量,IO_DILength,192.168.202.11#16;192.168.200.12#4,,,,,, ,
PRO,模块对应的DO数量,IO_DOLength,192.168.202.11#16;192.168.200.12#4,,,,,,,
source/DeviceLibrary/acSingleStore/AC_SA_BoxBean.cs
查看文件 @
556fc0f
...
...
@@ -292,24 +292,24 @@ namespace OnlineStore.DeviceLibrary
{
string
portName
=
Config
.
InOut_Axis
.
DeviceName
;
int
slvAddr
=
Config
.
InOut_Axis
.
GetAxisValue
();
if
(
ACServerManager
.
GetHomeEndStatus
(
portName
,
slvAddr
).
Equals
(
1
)
&&
ACServerManager
.
GetHomeSingle
(
portName
,
slvAddr
).
Equals
(
1
))
{
StoreMove
.
NextMoveStep
(
StoreMoveStep
.
BOX_H_InOutMove
);
LogUtil
.
info
(
LOGGER
,
StoreName
+
"复位中,进出轴原点亮且已经原点返回过,先相对走-5000"
);
int
currPos
=
ACServerManager
.
GetActualtPosition
(
portName
,
slvAddr
);
int
targetPos
=
currPos
-
5000
;
ACAxisMove
(
Config
.
InOut_Axis
,
targetPos
,
Config
.
InoutAxis_HomeLowSpeed
);
ResetCloseDoor
();
}
else
{
//
if (ACServerManager.GetHomeEndStatus(portName, slvAddr).Equals(1)
//
&& ACServerManager.GetHomeSingle(portName, slvAddr).Equals(1))
//
{
//
StoreMove.NextMoveStep(StoreMoveStep.BOX_H_InOutMove);
//
LogUtil.info(LOGGER, StoreName + "复位中,进出轴原点亮且已经原点返回过,先相对走-5000");
//
int currPos = ACServerManager.GetActualtPosition(portName, slvAddr);
//
int targetPos = currPos - 5000;
//
ACAxisMove(Config.InOut_Axis, targetPos, Config.InoutAxis_HomeLowSpeed);
//
ResetCloseDoor();
//
}
//
else
//
{
StoreMove
.
NextMoveStep
(
StoreMoveStep
.
BOX_H_InOutBack
);
LogUtil
.
info
(
LOGGER
,
StoreName
+
"复位中,进出轴开始原点返回"
);
ACAxisHomeMove
(
Config
.
InOut_Axis
);
StoreMove
.
WaitList
.
Add
(
WaitResultInfo
.
WaitTime
(
2000
));
ResetCloseDoor
();
}
//
}
}
/// <summary>
/// 复位处理
...
...
@@ -426,9 +426,17 @@ namespace OnlineStore.DeviceLibrary
}
private
void
ComMoveToPosition
(
int
targetPosition
)
{
ComMoveToPosition
(
targetPosition
,
false
);
}
private
void
ComMoveToPosition
(
int
targetPosition
,
bool
isNeedCheckSingle
)
{
if
(
IsHasCompress_Axis
)
{
LogUtil
.
debug
(
"压紧轴绝对运动目标位置:"
+
targetPosition
);
if
(
isNeedCheckSingle
)
{
MeteringSignal
.
StartCheck
(
targetPosition
,
ShuoKeControls
.
GetABSPosition
(
Config
.
CompressAxis_Slv
));
}
StoreMove
.
WaitList
.
Add
(
WaitResultInfo
.
WaitShuoKe
(
Config
.
CompressAxis_Slv
,
targetPosition
,
false
));
ShuoKeControls
.
AbsMove
(
Config
.
CompressAxis_Slv
,
targetPosition
);
Thread
.
Sleep
(
100
);
...
...
source/DeviceLibrary/acSingleStore/AC_SA_BoxBean_Partial.cs
查看文件 @
556fc0f
...
...
@@ -204,29 +204,32 @@ namespace OnlineStore.DeviceLibrary
}
else
if
(
wait
.
WaitType
==
(
int
)
Wait_Type
.
ShuoKe_5
)
{
ShuoKeInfo
info
=
null
;
if
(
wait
.
IsHomeMove
)
{
wait
.
IsEnd
=
ShuoKeControls
.
IsHomeMoveEnd
(
wait
.
SlvAddr
,
StoreMove
.
LastSetpTime
,
out
info
);
}
else
{
wait
.
IsEnd
=
ShuoKeControls
.
IsMoveEnd
(
wait
.
SlvAddr
,
StoreMove
.
LastSetpTime
,
out
info
);
}
if
(!
wait
.
IsEnd
)
{
if
(
info
==
null
)
{
string
msg
=
""
;
wait
.
IsEnd
=
ShuoKeIsEnd
(
wait
,
out
msg
);
NotOkMsg
=
NotOkMsg
+
" "
+
msg
;
//ShuoKeInfo info = null;
//if (wait.IsHomeMove)
//{
// wait.IsEnd = ShuoKeControls.IsHomeMoveEnd(wait.SlvAddr, StoreMove.LastSetpTime, out info);
//}
//else
//{
// wait.IsEnd = ShuoKeControls.IsMoveEnd(wait.SlvAddr, StoreMove.LastSetpTime, out info);
//}
//if (!wait.IsEnd)
//{
// if (info == null)
// {
NotOkMsg
+=
"info=null;"
;
}
else
{
//
NotOkMsg += "info=null;";
//
}
//
else
//
{
NotOkMsg
+=
""
+
info
.
ToShowStr
();
}
ShuoKeControls
.
GetStatus
(
wait
.
SlvAddr
);
}
//
NotOkMsg += "" + info.ToShowStr();
//
}
//
ShuoKeControls.GetStatus(wait.SlvAddr);
//
}
}
if
(
wait
.
IsEnd
)
{
...
...
@@ -269,6 +272,36 @@ namespace OnlineStore.DeviceLibrary
Alarm
(
StoreAlarmType
.
IoSingleTimeOut
,
""
,
WarnMsg
,
StoreMove
.
MoveType
);
}
}
private
bool
ShuoKeIsEnd
(
WaitResultInfo
wait
,
out
string
msg
)
{
//bool result = false;
msg
=
""
;
if
(
wait
.
IsHomeMove
)
{
return
ShuoKeControls
.
IsHomeMoveEnd
(
wait
.
SlvAddr
,
StoreMove
.
LastSetpTime
,
out
msg
);
}
else
{
bool
isend
=
ShuoKeControls
.
IsMoveEnd
(
wait
.
SlvAddr
,
wait
.
TargetPosition
,
StoreMove
.
LastSetpTime
,
out
msg
);
if
(
isend
)
{
bool
isCheckOk
=
(
MeteringSignal
.
TragetChangeCount
<=
MeteringSignal
.
SignalChangeCount
);
if
(
isCheckOk
||
MeteringSignal
.
TragetChangeCount
<=
0
)
{
MeteringSignal
.
StopCheck
();
return
true
;
}
else
{
msg
=
"压紧轴计量检测目标【"
+
MeteringSignal
.
TragetChangeCount
+
"】实际【"
+
MeteringSignal
.
SignalChangeCount
+
"】"
;
LogUtil
.
error
(
"压紧轴已经停止运动,但是 "
+
msg
);
return
false
;
}
}
}
return
false
;
}
#
endregion
...
...
@@ -397,7 +430,7 @@ namespace OnlineStore.DeviceLibrary
{
InStoreLog
(
"入库:SI_06 压紧轴压紧,压紧轴到P2 "
);
StoreMove
.
NextMoveStep
(
StoreMoveStep
.
SI_06_CompressWork
);
ComMoveToPosition
(
moveP
.
ComPress_P2
);
ComMoveToPosition
(
moveP
.
ComPress_P2
,
true
);
}
else
{
...
...
@@ -471,7 +504,7 @@ namespace OnlineStore.DeviceLibrary
//SendLineStatus(StoreID, posId, StoreStatus.InStoreEnd);
StoreMove
.
NextMoveStep
(
StoreMoveStep
.
SI_12_PutWareToBag
);
ComMoveToPosition
(
moveP
.
ComPress_P3
);
ComMoveToPosition
(
moveP
.
ComPress_P3
,
true
);
ACAxisMove
(
Config
.
UpDown_Axis
,
moveP
.
UpDown_P4
,
Config
.
UpDownAxis_P4_Speed
);
}
else
if
(
StoreMove
.
MoveStep
==
StoreMoveStep
.
SI_12_PutWareToBag
)
...
...
@@ -587,6 +620,13 @@ namespace OnlineStore.DeviceLibrary
return
false
;
}
}
int
height
=
param
.
GetACPosition
().
BagHeight
;
if
(
AutomaticBaiting
.
BatchOutStoreHeight
+
height
>
Config
.
BatchAxis_MaxHeight
)
{
LogUtil
.
error
(
LOGGER
,
StoreName
+
logMsg
+
" 出错,当前高【"
+
AutomaticBaiting
.
BatchOutStoreHeight
+
"】出库料盘高【"
+
height
+
"】,最大高【"
+
Config
.
BatchAxis_MaxHeight
+
"】"
);
LogUtil
.
error
(
LOGGER
,
StoreName
+
logMsg
+
" 出错,批量上下料机构已满,请先拿出料盘"
);
return
false
;
}
storeStatus
=
StoreStatus
.
OutStoreExecute
;
LogUtil
.
info
(
LOGGER
,
StoreName
+
logMsg
);
...
...
@@ -630,10 +670,35 @@ namespace OnlineStore.DeviceLibrary
else
if
(
StoreMove
.
MoveStep
==
StoreMoveStep
.
SO_02_DeviceBack
)
{
StoreMove
.
NextMoveStep
(
StoreMoveStep
.
SO_03_ToBagPosition
);
if
(
StoreMove
.
IsBatchInOutStore
)
{
int
targetValue
=
GetBatchTargetValue
(
Config
.
BatchAxis_OutDownPosition
);
if
(
targetValue
>=
1000
+
moveP
.
BatchAxis_DownValue
)
{
StoreMove
.
TimeOutSeconds
=
120
;
ACAxisMove
(
Config
.
Batch_Axis
,
targetValue
,
Config
.
BatchAxis_P1_Speed
);
OutStoreLog
(
"出库:SO_03 批量上下料轴下降【"
+
Config
.
BatchAxis_OutDownPosition
+
"】目标【"
+
targetValue
+
"】 "
);
}
else
{
AutomaticBaiting
.
BatchOutStoreCount
++;
AutomaticBaiting
.
BatchOutStoreHeight
=
1000
;
OutStoreLog
(
"出库:SO_03批量上下料轴需要下降【"
+
Config
.
BatchAxis_OutDownPosition
+
"】目标【"
+
targetValue
+
"】 ,请检查料盘是否已满"
);
//停止出库
string
posId
=
StoreMove
.
MoveParam
!=
null
?
StoreMove
.
MoveParam
.
PositionNum
:
""
;
storeStatus
=
StoreStatus
.
StoreOnline
;
LogUtil
.
error
(
LOGGER
,
StoreName
+
" 【"
+
posId
+
"】 出库中断,请检查料盘是否已满,耗时【"
+
FormUtil
.
GetSpanStr
(
InOutWatch
.
Elapsed
)
+
"】!"
);
StoreMove
.
EndMove
();
storeRunStatus
=
StoreRunStatus
.
Runing
;
InOutEndProcess
(
StoreMoveType
.
OutStore
);
return
;
}
}
OutStoreLog
(
"出库:SO_03 走到库位,压紧轴至P3(压紧前点) ,旋转轴至P2(库位点),升降轴至P5(库位出库前点)"
);
ComMoveToPosition
(
moveP
.
ComPress_P3
);
ACAxisMove
(
Config
.
Middle_Axis
,
StoreMove
.
MoveParam
.
MoveP
.
Middle_P2
,
Config
.
MiddleAxis_P2_Speed
);
ACAxisMove
(
Config
.
UpDown_Axis
,
StoreMove
.
MoveParam
.
MoveP
.
UpDown_P5
,
Config
.
UpDownAxis_P5_Speed
);
}
else
if
(
StoreMove
.
MoveStep
==
StoreMoveStep
.
SO_03_ToBagPosition
)
{
...
...
@@ -645,7 +710,7 @@ namespace OnlineStore.DeviceLibrary
{
OutStoreLog
(
"出库:SO_05 拿起物品,升降轴至P6(库位出料缓冲点),压紧轴至P2(压紧点) "
);
StoreMove
.
NextMoveStep
(
StoreMoveStep
.
SO_05_BagWareToDevice
);
ComMoveToPosition
(
moveP
.
ComPress_P2
);
ComMoveToPosition
(
moveP
.
ComPress_P2
,
true
);
ACAxisMove
(
Config
.
UpDown_Axis
,
moveP
.
UpDown_P6
,
Config
.
UpDownAxis_P6_Speed
);
}
else
if
(
StoreMove
.
MoveStep
==
StoreMoveStep
.
SO_05_BagWareToDevice
)
...
...
@@ -707,7 +772,7 @@ namespace OnlineStore.DeviceLibrary
{
StoreMove
.
NextMoveStep
(
StoreMoveStep
.
SO_11_PutTray
);
OutStoreLog
(
"出库:SO_11_PutTray 放下料盘,升降轴到P8(出库低点),压紧轴至P3(压紧前点)"
);
ComMoveToPosition
(
StoreMove
.
MoveParam
.
MoveP
.
ComPress_P3
);
ComMoveToPosition
(
StoreMove
.
MoveParam
.
MoveP
.
ComPress_P3
,
true
);
ACAxisMove
(
Config
.
UpDown_Axis
,
StoreMove
.
MoveParam
.
MoveP
.
UpDown_OutLow_P8
,
Config
.
UpDownAxis_P8_Speed
);
}
else
if
(
KND
.
IOValue
(
IO_Type
.
SafetyLightCurtains
).
Equals
(
IO_VALUE
.
HIGH
))
...
...
@@ -770,15 +835,19 @@ namespace OnlineStore.DeviceLibrary
}
}
}
private
void
BatchAxisUpTrayHeight
(
)
private
int
GetBatchTargetValue
(
int
downValue
)
{
//上料轴需要向下走
int
currPosition
=
ACServerManager
.
GetActualtPosition
(
StoreManager
.
Config
.
Batch_Axis
);
if
(
currPosition
.
Equals
(-
1
))
{
currPosition
=
ACServerManager
.
GetActualtPosition
(
StoreManager
.
Config
.
Batch_Axis
);
}
int
targetValue
=
currPosition
-
StoreMove
.
MoveParam
.
MoveP
.
BatchAxis_DownValue
;
int
targetValue
=
currPosition
-
downValue
;
return
targetValue
;
}
private
void
BatchAxisUpTrayHeight
()
{
int
targetValue
=
GetBatchTargetValue
(
StoreMove
.
MoveParam
.
MoveP
.
BatchAxis_DownValue
);
//记录高度
AutomaticBaiting
.
BatchOutStoreCount
++;
AutomaticBaiting
.
BatchOutStoreHeight
+=
StoreMove
.
MoveParam
.
GetACPosition
().
BagHeight
;
...
...
source/LoadCVSLibrary/storeConfig/config/AUTO_SA_Config.cs
查看文件 @
556fc0f
...
...
@@ -566,6 +566,19 @@ namespace OnlineStore.LoadCSVLibrary
/// <summary>
/// PRO(轴五)上料轴出料时距离检测信号需要下降的高度 BatchAxis_OutDownPosition
///</summary>
[
ConfigProAttribute
(
"BatchAxis_OutDownPosition"
,
true
)]
public
int
BatchAxis_OutDownPosition
{
get
;
set
;
}
/// <summary>
/// PRO(轴五)上料轴最最大料盘高度,到达后无法批量出库 BatchAxis_MaxHeight
///</summary>
[
ConfigProAttribute
(
"BatchAxis_MaxHeight"
,
true
)]
public
int
BatchAxis_MaxHeight
{
get
;
set
;
}
/// <summary>
/// PRO,默认的料盘宽度(不可更改),Default_TrayWidth,7
/// </summary>
[
ConfigProAttribute
(
"Default_TrayWidth"
)]
...
...
@@ -581,6 +594,8 @@ namespace OnlineStore.LoadCSVLibrary
[
ConfigProAttribute
(
"IO_DOLength"
)]
public
string
IO_DOLength
{
get
;
set
;
}
private
Dictionary
<
string
,
ushort
>
DILengthMap
=
null
;
private
Dictionary
<
string
,
ushort
>
DOLengthMap
=
null
;
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论