Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
刘韬
/
SO815-AutoInOutStore
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
图表
网络
创建新的问题
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit 6522a61a
由
几米阳光
编写于
2018-12-04 16:08:05 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
上料部分代码
1 个父辈
d35479f7
隐藏空白字符变更
内嵌
并排
正在显示
25 个修改的文件
包含
1574 行增加
和
779 行删除
source/ACSingleStore/App.config
source/ACSingleStore/FrmAxisDebug.cs
source/ACSingleStore/FrmIOStatus.Designer.cs
source/ACSingleStore/FrmIOStatus.cs
source/ACSingleStore/FrmStoreBox.Designer.cs
source/ACSingleStore/FrmStoreBox.cs
source/Common/Setting_Init.cs
source/DeviceLibrary/DeviceLibrary.csproj
source/DeviceLibrary/KangNaiDe/KNDManager.cs
source/DeviceLibrary/PanasonicServo/ACCMDManager.cs
source/DeviceLibrary/PanasonicServo/ACServerManager_Partial.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/DeviceLibrary/acSingleStore/AutomaticBaiting.cs
source/DeviceLibrary/acSingleStore/AutomaticBaiting_Partial.cs
source/DeviceLibrary/acSingleStore/ACStoreManager.cs → source/DeviceLibrary/acSingleStore/StoreManager.cs
source/DeviceLibrary/store/KTK_DeviceBase.cs → source/DeviceLibrary/store/AC_DeviceBase.cs
source/DeviceLibrary/store/KTK_Store.cs → source/DeviceLibrary/store/AC_Store.cs
source/DeviceLibrary/store/LineAlarm.cs
source/DeviceLibrary/store/StoreMoveStep.cs
source/DeviceLibrary/store/model/StoreMoveInfo.cs
source/LoadCVSLibrary/storeConfig/config/AUTO_SA_Config.cs
source/LoadCVSLibrary/storeConfig/config/Store_IO_Type.cs
source/ACSingleStore/App.config
查看文件 @
6522a61
...
...
@@ -29,10 +29,10 @@
<
add
key
=
"CodeType"
value
=
"Data Matrix ECC 200"
/>
<!--<
add
key
=
"CodeType"
value
=
"Data Matrix ECC 200"
/>-->
<!--二维码参数文件所在路径,文件名与二维码类型名一样-->
<
add
key
=
"CodeParamPath"
value
=
"\CodeParam\"
/>
<
add
key
=
"AI_ConvertPosition"
value
=
"55"
/>
<
add
key
=
"CodeParamPath"
value
=
"\CodeParam\"
/>
<
add
key
=
"InOutDefaultPosition"
value
=
"3000"
/>
<
add
key
=
"Config_Pwd"
value
=
"123456"
/>
<
add
key
=
"AxisChangeValue"
value
=
"100"
/>
</
appSettings
>
<
log4net
>
<
appender
name
=
"RollingLogFileAppender"
type
=
"log4net.Appender.RollingFileAppender"
>
...
...
source/ACSingleStore/FrmAxisDebug.cs
查看文件 @
6522a61
...
...
@@ -51,7 +51,7 @@ namespace OnlineStore.AutoInOutStore
txtInOutSpeed
.
Text
=
inout
.
TargetSpeed
.
ToString
();
txtUpDownSpeed
.
Text
=
updown
.
TargetSpeed
.
ToString
();
txtAutoSpeed
.
Text
=
auto
.
TargetSpeed
.
ToString
();
txtComSpeed
.
Text
=
Auto
StoreManager
.
Config
.
CompressAxis_EndSpeed
.
ToString
();
txtComSpeed
.
Text
=
StoreManager
.
Config
.
CompressAxis_EndSpeed
.
ToString
();
timer1
.
Start
();
}
/// <summary>
...
...
@@ -135,7 +135,7 @@ namespace OnlineStore.AutoInOutStore
{
if
(
this
.
btnInOutMove
.
BackColor
.
Equals
(
System
.
Drawing
.
SystemColors
.
Control
))
{
if
(
Auto
StoreManager
.
Store
.
InOutAxisCanMove
().
Equals
(
false
))
if
(
StoreManager
.
Store
.
InOutAxisCanMove
().
Equals
(
false
))
{
MessageBox
.
Show
(
"定位气缸不在下降端,不能移动进出轴"
,
"警告"
,
MessageBoxButtons
.
OK
,
MessageBoxIcon
.
Warning
);
return
;
...
...
@@ -222,7 +222,7 @@ namespace OnlineStore.AutoInOutStore
{
if
(
btnInOutMovej
.
BackColor
.
Equals
(
System
.
Drawing
.
SystemColors
.
Control
))
{
if
(
Auto
StoreManager
.
Store
.
InOutAxisCanMove
().
Equals
(
false
))
if
(
StoreManager
.
Store
.
InOutAxisCanMove
().
Equals
(
false
))
{
MessageBox
.
Show
(
"定位气缸不在下降端,不能移动进出轴"
,
"警告"
,
MessageBoxButtons
.
OK
,
MessageBoxIcon
.
Warning
);
return
;
...
...
source/ACSingleStore/FrmIOStatus.Designer.cs
查看文件 @
6522a61
...
...
@@ -32,11 +32,9 @@
this
.
label14
=
new
System
.
Windows
.
Forms
.
Label
();
this
.
btnWriteSingleDO
=
new
System
.
Windows
.
Forms
.
Button
();
this
.
txtWriteTime
=
new
System
.
Windows
.
Forms
.
TextBox
();
this
.
btnLocationDown
=
new
System
.
Windows
.
Forms
.
Button
();
this
.
label5
=
new
System
.
Windows
.
Forms
.
Label
();
this
.
btnReadAllDi
=
new
System
.
Windows
.
Forms
.
Button
();
this
.
cmbWriteValue
=
new
System
.
Windows
.
Forms
.
ComboBox
();
this
.
btnLocationUp
=
new
System
.
Windows
.
Forms
.
Button
();
this
.
label6
=
new
System
.
Windows
.
Forms
.
Label
();
this
.
btnReadAllDo
=
new
System
.
Windows
.
Forms
.
Button
();
this
.
cmbWriteIO
=
new
System
.
Windows
.
Forms
.
ComboBox
();
...
...
@@ -48,6 +46,12 @@
this
.
tableLayoutPanel2
=
new
System
.
Windows
.
Forms
.
TableLayoutPanel
();
this
.
groupBox3
=
new
System
.
Windows
.
Forms
.
GroupBox
();
this
.
tableLayoutPanel1
=
new
System
.
Windows
.
Forms
.
TableLayoutPanel
();
this
.
btnSXil
=
new
System
.
Windows
.
Forms
.
Button
();
this
.
btnSXi
=
new
System
.
Windows
.
Forms
.
Button
();
this
.
btnDClose
=
new
System
.
Windows
.
Forms
.
Button
();
this
.
btnDOpen
=
new
System
.
Windows
.
Forms
.
Button
();
this
.
btnSuckingDiscDown
=
new
System
.
Windows
.
Forms
.
Button
();
this
.
btnSuckingDiscUp
=
new
System
.
Windows
.
Forms
.
Button
();
this
.
groupBox1
.
SuspendLayout
();
this
.
groupBox4
.
SuspendLayout
();
this
.
groupBox3
.
SuspendLayout
();
...
...
@@ -63,6 +67,12 @@
//
this
.
groupBox1
.
Anchor
=
((
System
.
Windows
.
Forms
.
AnchorStyles
)(((
System
.
Windows
.
Forms
.
AnchorStyles
.
Top
|
System
.
Windows
.
Forms
.
AnchorStyles
.
Bottom
)
|
System
.
Windows
.
Forms
.
AnchorStyles
.
Left
)));
this
.
groupBox1
.
Controls
.
Add
(
this
.
btnSXil
);
this
.
groupBox1
.
Controls
.
Add
(
this
.
btnSXi
);
this
.
groupBox1
.
Controls
.
Add
(
this
.
btnDClose
);
this
.
groupBox1
.
Controls
.
Add
(
this
.
btnDOpen
);
this
.
groupBox1
.
Controls
.
Add
(
this
.
btnSuckingDiscDown
);
this
.
groupBox1
.
Controls
.
Add
(
this
.
btnSuckingDiscUp
);
this
.
groupBox1
.
Controls
.
Add
(
this
.
btnCloseLed
);
this
.
groupBox1
.
Controls
.
Add
(
this
.
label3
);
this
.
groupBox1
.
Controls
.
Add
(
this
.
txtSlaveId
);
...
...
@@ -77,11 +87,9 @@
this
.
groupBox1
.
Controls
.
Add
(
this
.
label14
);
this
.
groupBox1
.
Controls
.
Add
(
this
.
btnWriteSingleDO
);
this
.
groupBox1
.
Controls
.
Add
(
this
.
txtWriteTime
);
this
.
groupBox1
.
Controls
.
Add
(
this
.
btnLocationDown
);
this
.
groupBox1
.
Controls
.
Add
(
this
.
label5
);
this
.
groupBox1
.
Controls
.
Add
(
this
.
btnReadAllDi
);
this
.
groupBox1
.
Controls
.
Add
(
this
.
cmbWriteValue
);
this
.
groupBox1
.
Controls
.
Add
(
this
.
btnLocationUp
);
this
.
groupBox1
.
Controls
.
Add
(
this
.
label6
);
this
.
groupBox1
.
Controls
.
Add
(
this
.
btnReadAllDo
);
this
.
groupBox1
.
Controls
.
Add
(
this
.
cmbWriteIO
);
...
...
@@ -98,7 +106,7 @@
// btnCloseLed
//
this
.
btnCloseLed
.
Font
=
new
System
.
Drawing
.
Font
(
"微软雅黑"
,
9F
,
System
.
Drawing
.
FontStyle
.
Regular
,
System
.
Drawing
.
GraphicsUnit
.
Point
,
((
byte
)(
134
)));
this
.
btnCloseLed
.
Location
=
new
System
.
Drawing
.
Point
(
173
,
317
);
this
.
btnCloseLed
.
Location
=
new
System
.
Drawing
.
Point
(
173
,
281
);
this
.
btnCloseLed
.
Name
=
"btnCloseLed"
;
this
.
btnCloseLed
.
Size
=
new
System
.
Drawing
.
Size
(
102
,
34
);
this
.
btnCloseLed
.
TabIndex
=
256
;
...
...
@@ -131,7 +139,7 @@
// btnOpenLed
//
this
.
btnOpenLed
.
Font
=
new
System
.
Drawing
.
Font
(
"微软雅黑"
,
9F
,
System
.
Drawing
.
FontStyle
.
Regular
,
System
.
Drawing
.
GraphicsUnit
.
Point
,
((
byte
)(
134
)));
this
.
btnOpenLed
.
Location
=
new
System
.
Drawing
.
Point
(
56
,
317
);
this
.
btnOpenLed
.
Location
=
new
System
.
Drawing
.
Point
(
56
,
281
);
this
.
btnOpenLed
.
Name
=
"btnOpenLed"
;
this
.
btnOpenLed
.
Size
=
new
System
.
Drawing
.
Size
(
102
,
34
);
this
.
btnOpenLed
.
TabIndex
=
255
;
...
...
@@ -174,7 +182,7 @@
// btnCloseAxisBreak
//
this
.
btnCloseAxisBreak
.
Font
=
new
System
.
Drawing
.
Font
(
"微软雅黑"
,
9F
,
System
.
Drawing
.
FontStyle
.
Regular
,
System
.
Drawing
.
GraphicsUnit
.
Point
,
((
byte
)(
134
)));
this
.
btnCloseAxisBreak
.
Location
=
new
System
.
Drawing
.
Point
(
173
,
2
83
);
this
.
btnCloseAxisBreak
.
Location
=
new
System
.
Drawing
.
Point
(
173
,
2
47
);
this
.
btnCloseAxisBreak
.
Name
=
"btnCloseAxisBreak"
;
this
.
btnCloseAxisBreak
.
Size
=
new
System
.
Drawing
.
Size
(
102
,
34
);
this
.
btnCloseAxisBreak
.
TabIndex
=
253
;
...
...
@@ -208,7 +216,7 @@
// btnOpenAxisBreak
//
this
.
btnOpenAxisBreak
.
Font
=
new
System
.
Drawing
.
Font
(
"微软雅黑"
,
9F
,
System
.
Drawing
.
FontStyle
.
Regular
,
System
.
Drawing
.
GraphicsUnit
.
Point
,
((
byte
)(
134
)));
this
.
btnOpenAxisBreak
.
Location
=
new
System
.
Drawing
.
Point
(
56
,
2
83
);
this
.
btnOpenAxisBreak
.
Location
=
new
System
.
Drawing
.
Point
(
56
,
2
47
);
this
.
btnOpenAxisBreak
.
Name
=
"btnOpenAxisBreak"
;
this
.
btnOpenAxisBreak
.
Size
=
new
System
.
Drawing
.
Size
(
102
,
34
);
this
.
btnOpenAxisBreak
.
TabIndex
=
252
;
...
...
@@ -249,17 +257,6 @@
this
.
txtWriteTime
.
TabIndex
=
238
;
this
.
txtWriteTime
.
Text
=
"0"
;
//
// btnLocationDown
//
this
.
btnLocationDown
.
Font
=
new
System
.
Drawing
.
Font
(
"微软雅黑"
,
9F
,
System
.
Drawing
.
FontStyle
.
Regular
,
System
.
Drawing
.
GraphicsUnit
.
Point
,
((
byte
)(
134
)));
this
.
btnLocationDown
.
Location
=
new
System
.
Drawing
.
Point
(
173
,
248
);
this
.
btnLocationDown
.
Name
=
"btnLocationDown"
;
this
.
btnLocationDown
.
Size
=
new
System
.
Drawing
.
Size
(
102
,
34
);
this
.
btnLocationDown
.
TabIndex
=
251
;
this
.
btnLocationDown
.
Text
=
"定位气缸下降"
;
this
.
btnLocationDown
.
UseVisualStyleBackColor
=
true
;
this
.
btnLocationDown
.
Click
+=
new
System
.
EventHandler
(
this
.
btnLocationDown_Click
);
//
// label5
//
this
.
label5
.
AutoSize
=
true
;
...
...
@@ -298,17 +295,6 @@
this
.
cmbWriteValue
.
TabIndex
=
236
;
this
.
cmbWriteValue
.
DrawItem
+=
new
System
.
Windows
.
Forms
.
DrawItemEventHandler
(
this
.
cmbWriteValue_DrawItem
);
//
// btnLocationUp
//
this
.
btnLocationUp
.
Font
=
new
System
.
Drawing
.
Font
(
"微软雅黑"
,
9F
,
System
.
Drawing
.
FontStyle
.
Regular
,
System
.
Drawing
.
GraphicsUnit
.
Point
,
((
byte
)(
134
)));
this
.
btnLocationUp
.
Location
=
new
System
.
Drawing
.
Point
(
56
,
248
);
this
.
btnLocationUp
.
Name
=
"btnLocationUp"
;
this
.
btnLocationUp
.
Size
=
new
System
.
Drawing
.
Size
(
102
,
34
);
this
.
btnLocationUp
.
TabIndex
=
250
;
this
.
btnLocationUp
.
Text
=
"定位气缸上升"
;
this
.
btnLocationUp
.
UseVisualStyleBackColor
=
true
;
this
.
btnLocationUp
.
Click
+=
new
System
.
EventHandler
(
this
.
btnLocationUp_Click
);
//
// label6
//
this
.
label6
.
AutoSize
=
true
;
...
...
@@ -354,7 +340,7 @@
this
.
btnCloseDoor
.
Name
=
"btnCloseDoor"
;
this
.
btnCloseDoor
.
Size
=
new
System
.
Drawing
.
Size
(
102
,
34
);
this
.
btnCloseDoor
.
TabIndex
=
249
;
this
.
btnCloseDoor
.
Text
=
"关闭仓门"
;
this
.
btnCloseDoor
.
Text
=
"关闭
进料口
仓门"
;
this
.
btnCloseDoor
.
UseVisualStyleBackColor
=
true
;
this
.
btnCloseDoor
.
Click
+=
new
System
.
EventHandler
(
this
.
btnCloseDoor_Click
);
//
...
...
@@ -365,7 +351,7 @@
this
.
btnOpenDoor
.
Name
=
"btnOpenDoor"
;
this
.
btnOpenDoor
.
Size
=
new
System
.
Drawing
.
Size
(
102
,
34
);
this
.
btnOpenDoor
.
TabIndex
=
248
;
this
.
btnOpenDoor
.
Text
=
"打开仓门"
;
this
.
btnOpenDoor
.
Text
=
"打开
进料口
仓门"
;
this
.
btnOpenDoor
.
UseVisualStyleBackColor
=
true
;
this
.
btnOpenDoor
.
Click
+=
new
System
.
EventHandler
(
this
.
btnOpenDoor_Click
);
//
...
...
@@ -446,6 +432,72 @@
this
.
tableLayoutPanel1
.
Size
=
new
System
.
Drawing
.
Size
(
218
,
542
);
this
.
tableLayoutPanel1
.
TabIndex
=
102
;
//
// btnSXil
//
this
.
btnSXil
.
Font
=
new
System
.
Drawing
.
Font
(
"微软雅黑"
,
9F
,
System
.
Drawing
.
FontStyle
.
Regular
,
System
.
Drawing
.
GraphicsUnit
.
Point
,
((
byte
)(
134
)));
this
.
btnSXil
.
Location
=
new
System
.
Drawing
.
Point
(
173
,
393
);
this
.
btnSXil
.
Name
=
"btnSXil"
;
this
.
btnSXil
.
Size
=
new
System
.
Drawing
.
Size
(
102
,
34
);
this
.
btnSXil
.
TabIndex
=
262
;
this
.
btnSXil
.
Text
=
"停止吸料"
;
this
.
btnSXil
.
UseVisualStyleBackColor
=
true
;
this
.
btnSXil
.
Click
+=
new
System
.
EventHandler
(
this
.
btnSXil_Click
);
//
// btnSXi
//
this
.
btnSXi
.
Font
=
new
System
.
Drawing
.
Font
(
"微软雅黑"
,
9F
,
System
.
Drawing
.
FontStyle
.
Regular
,
System
.
Drawing
.
GraphicsUnit
.
Point
,
((
byte
)(
134
)));
this
.
btnSXi
.
Location
=
new
System
.
Drawing
.
Point
(
56
,
393
);
this
.
btnSXi
.
Name
=
"btnSXi"
;
this
.
btnSXi
.
Size
=
new
System
.
Drawing
.
Size
(
102
,
34
);
this
.
btnSXi
.
TabIndex
=
261
;
this
.
btnSXi
.
Text
=
"开始吸料"
;
this
.
btnSXi
.
UseVisualStyleBackColor
=
true
;
this
.
btnSXi
.
Click
+=
new
System
.
EventHandler
(
this
.
btnSXi_Click
);
//
// btnDClose
//
this
.
btnDClose
.
Font
=
new
System
.
Drawing
.
Font
(
"微软雅黑"
,
9F
,
System
.
Drawing
.
FontStyle
.
Regular
,
System
.
Drawing
.
GraphicsUnit
.
Point
,
((
byte
)(
134
)));
this
.
btnDClose
.
Location
=
new
System
.
Drawing
.
Point
(
173
,
359
);
this
.
btnDClose
.
Name
=
"btnDClose"
;
this
.
btnDClose
.
Size
=
new
System
.
Drawing
.
Size
(
102
,
34
);
this
.
btnDClose
.
TabIndex
=
260
;
this
.
btnDClose
.
Text
=
"门锁关闭"
;
this
.
btnDClose
.
UseVisualStyleBackColor
=
true
;
this
.
btnDClose
.
Click
+=
new
System
.
EventHandler
(
this
.
btnDClose_Click
);
//
// btnDOpen
//
this
.
btnDOpen
.
Font
=
new
System
.
Drawing
.
Font
(
"微软雅黑"
,
9F
,
System
.
Drawing
.
FontStyle
.
Regular
,
System
.
Drawing
.
GraphicsUnit
.
Point
,
((
byte
)(
134
)));
this
.
btnDOpen
.
Location
=
new
System
.
Drawing
.
Point
(
56
,
359
);
this
.
btnDOpen
.
Name
=
"btnDOpen"
;
this
.
btnDOpen
.
Size
=
new
System
.
Drawing
.
Size
(
102
,
34
);
this
.
btnDOpen
.
TabIndex
=
259
;
this
.
btnDOpen
.
Text
=
"门锁打开"
;
this
.
btnDOpen
.
UseVisualStyleBackColor
=
true
;
this
.
btnDOpen
.
Click
+=
new
System
.
EventHandler
(
this
.
btnDOpen_Click
);
//
// btnSuckingDiscDown
//
this
.
btnSuckingDiscDown
.
Font
=
new
System
.
Drawing
.
Font
(
"微软雅黑"
,
9F
,
System
.
Drawing
.
FontStyle
.
Regular
,
System
.
Drawing
.
GraphicsUnit
.
Point
,
((
byte
)(
134
)));
this
.
btnSuckingDiscDown
.
Location
=
new
System
.
Drawing
.
Point
(
173
,
325
);
this
.
btnSuckingDiscDown
.
Name
=
"btnSuckingDiscDown"
;
this
.
btnSuckingDiscDown
.
Size
=
new
System
.
Drawing
.
Size
(
102
,
34
);
this
.
btnSuckingDiscDown
.
TabIndex
=
258
;
this
.
btnSuckingDiscDown
.
Text
=
"吸盘下降"
;
this
.
btnSuckingDiscDown
.
UseVisualStyleBackColor
=
true
;
this
.
btnSuckingDiscDown
.
Click
+=
new
System
.
EventHandler
(
this
.
btnSuckingDiscDown_Click
);
//
// btnSuckingDiscUp
//
this
.
btnSuckingDiscUp
.
Font
=
new
System
.
Drawing
.
Font
(
"微软雅黑"
,
9F
,
System
.
Drawing
.
FontStyle
.
Regular
,
System
.
Drawing
.
GraphicsUnit
.
Point
,
((
byte
)(
134
)));
this
.
btnSuckingDiscUp
.
Location
=
new
System
.
Drawing
.
Point
(
56
,
325
);
this
.
btnSuckingDiscUp
.
Name
=
"btnSuckingDiscUp"
;
this
.
btnSuckingDiscUp
.
Size
=
new
System
.
Drawing
.
Size
(
102
,
34
);
this
.
btnSuckingDiscUp
.
TabIndex
=
257
;
this
.
btnSuckingDiscUp
.
Text
=
"吸盘上升"
;
this
.
btnSuckingDiscUp
.
UseVisualStyleBackColor
=
true
;
this
.
btnSuckingDiscUp
.
Click
+=
new
System
.
EventHandler
(
this
.
btnSuckingDiscUp_Click
);
//
// FrmIOStatus
//
this
.
AutoScaleDimensions
=
new
System
.
Drawing
.
SizeF
(
7F
,
17F
);
...
...
@@ -499,13 +551,17 @@
private
System
.
Windows
.
Forms
.
Label
label3
;
private
System
.
Windows
.
Forms
.
Button
btnCloseDoor
;
private
System
.
Windows
.
Forms
.
Button
btnOpenDoor
;
private
System
.
Windows
.
Forms
.
Button
btnLocationDown
;
private
System
.
Windows
.
Forms
.
Button
btnLocationUp
;
private
System
.
Windows
.
Forms
.
Button
btnCloseAxisBreak
;
private
System
.
Windows
.
Forms
.
Button
btnOpenAxisBreak
;
private
System
.
Windows
.
Forms
.
Button
button1
;
private
System
.
Windows
.
Forms
.
Button
btnCloseLed
;
private
System
.
Windows
.
Forms
.
Button
btnOpenLed
;
private
System
.
Windows
.
Forms
.
Button
btnSXil
;
private
System
.
Windows
.
Forms
.
Button
btnSXi
;
private
System
.
Windows
.
Forms
.
Button
btnDClose
;
private
System
.
Windows
.
Forms
.
Button
btnDOpen
;
private
System
.
Windows
.
Forms
.
Button
btnSuckingDiscDown
;
private
System
.
Windows
.
Forms
.
Button
btnSuckingDiscUp
;
}
}
source/ACSingleStore/FrmIOStatus.cs
查看文件 @
6522a61
...
...
@@ -234,25 +234,25 @@ namespace OnlineStore.AutoInOutStore
}
private
void
btnOpenDoor_Click
(
object
sender
,
EventArgs
e
)
{
boxBean
.
KND
IOMove
(
IO_Type
.
Door_Up
,
IO_VALUE
.
HIGH
);
boxBean
.
KND
IOMove
(
IO_Type
.
Door_Down
,
IO_VALUE
.
LOW
);
KND
.
IOMove
(
IO_Type
.
Door_Up
,
IO_VALUE
.
HIGH
);
KND
.
IOMove
(
IO_Type
.
Door_Down
,
IO_VALUE
.
LOW
);
}
private
void
btnCloseDoor_Click
(
object
sender
,
EventArgs
e
)
{
boxBean
.
KND
IOMove
(
IO_Type
.
Door_Down
,
IO_VALUE
.
HIGH
);
boxBean
.
KND
IOMove
(
IO_Type
.
Door_Up
,
IO_VALUE
.
LOW
);
KND
.
IOMove
(
IO_Type
.
Door_Down
,
IO_VALUE
.
HIGH
);
KND
.
IOMove
(
IO_Type
.
Door_Up
,
IO_VALUE
.
LOW
);
}
private
void
btnLocationUp_Click
(
object
sender
,
EventArgs
e
)
{
boxBean
.
KND
IOMove
(
IO_Type
.
LocationCylinder_Down
,
IO_VALUE
.
LOW
);
boxBean
.
KND
IOMove
(
IO_Type
.
LocationCylinder_Up
,
IO_VALUE
.
HIGH
);
KND
.
IOMove
(
IO_Type
.
LocationCylinder_Down
,
IO_VALUE
.
LOW
);
KND
.
IOMove
(
IO_Type
.
LocationCylinder_Up
,
IO_VALUE
.
HIGH
);
}
private
void
btnLocationDown_Click
(
object
sender
,
EventArgs
e
)
{
boxBean
.
KND
IOMove
(
IO_Type
.
LocationCylinder_Down
,
IO_VALUE
.
HIGH
);
boxBean
.
KND
IOMove
(
IO_Type
.
LocationCylinder_Up
,
IO_VALUE
.
LOW
);
KND
.
IOMove
(
IO_Type
.
LocationCylinder_Down
,
IO_VALUE
.
HIGH
);
KND
.
IOMove
(
IO_Type
.
LocationCylinder_Up
,
IO_VALUE
.
LOW
);
}
private
void
FrmIOStatus_Shown
(
object
sender
,
EventArgs
e
)
...
...
@@ -262,12 +262,12 @@ namespace OnlineStore.AutoInOutStore
private
void
btnOpenAxisBreak_Click
(
object
sender
,
EventArgs
e
)
{
boxBean
.
KND
IOMove
(
IO_Type
.
Axis_Brake
,
IO_VALUE
.
HIGH
);
KND
.
IOMove
(
IO_Type
.
Axis_Brake
,
IO_VALUE
.
HIGH
);
}
private
void
btnCloseAxisBreak_Click
(
object
sender
,
EventArgs
e
)
{
boxBean
.
KND
IOMove
(
IO_Type
.
Axis_Brake
,
IO_VALUE
.
LOW
);
KND
.
IOMove
(
IO_Type
.
Axis_Brake
,
IO_VALUE
.
LOW
);
}
private
void
button1_Click
(
object
sender
,
EventArgs
e
)
...
...
@@ -277,12 +277,46 @@ namespace OnlineStore.AutoInOutStore
private
void
btnOpenLed_Click
(
object
sender
,
EventArgs
e
)
{
boxBean
.
KND
IOMove
(
IO_Type
.
CameraLight_Power
,
IO_VALUE
.
HIGH
);
KND
.
IOMove
(
IO_Type
.
CameraLight_Power
,
IO_VALUE
.
HIGH
);
}
private
void
btnCloseLed_Click
(
object
sender
,
EventArgs
e
)
{
boxBean
.
KNDIOMove
(
IO_Type
.
CameraLight_Power
,
IO_VALUE
.
LOW
);
KND
.
IOMove
(
IO_Type
.
CameraLight_Power
,
IO_VALUE
.
LOW
);
}
private
void
btnSuckingDiscUp_Click
(
object
sender
,
EventArgs
e
)
{
KND
.
IOMove
(
IO_Type
.
SuckingDisc_Down
,
IO_VALUE
.
LOW
);
KND
.
IOMove
(
IO_Type
.
SuckingDisc_Up
,
IO_VALUE
.
HIGH
);
}
private
void
btnSuckingDiscDown_Click
(
object
sender
,
EventArgs
e
)
{
KND
.
IOMove
(
IO_Type
.
SuckingDisc_Up
,
IO_VALUE
.
LOW
);
KND
.
IOMove
(
IO_Type
.
SuckingDisc_Down
,
IO_VALUE
.
HIGH
);
}
private
void
btnDOpen_Click
(
object
sender
,
EventArgs
e
)
{
KND
.
IOMove
(
IO_Type
.
AutoDoor_Close
,
IO_VALUE
.
LOW
);
KND
.
IOMove
(
IO_Type
.
AutoDoor_Open
,
IO_VALUE
.
HIGH
);
}
private
void
btnDClose_Click
(
object
sender
,
EventArgs
e
)
{
KND
.
IOMove
(
IO_Type
.
AutoDoor_Open
,
IO_VALUE
.
LOW
);
KND
.
IOMove
(
IO_Type
.
AutoDoor_Close
,
IO_VALUE
.
HIGH
);
}
private
void
btnSXi_Click
(
object
sender
,
EventArgs
e
)
{
KND
.
IOMove
(
IO_Type
.
SuckingDisc_Work
,
IO_VALUE
.
HIGH
);
}
private
void
btnSXil_Click
(
object
sender
,
EventArgs
e
)
{
KND
.
IOMove
(
IO_Type
.
SuckingDisc_Work
,
IO_VALUE
.
LOW
);
}
}
}
source/ACSingleStore/FrmStoreBox.Designer.cs
查看文件 @
6522a61
...
...
@@ -71,6 +71,9 @@
this
.
label49
=
new
System
.
Windows
.
Forms
.
Label
();
this
.
richTextBox1
=
new
System
.
Windows
.
Forms
.
RichTextBox
();
this
.
groupBox1
=
new
System
.
Windows
.
Forms
.
GroupBox
();
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
();
...
...
@@ -193,9 +196,15 @@
this
.
btnLineAbsMove
=
new
System
.
Windows
.
Forms
.
Button
();
this
.
label25
=
new
System
.
Windows
.
Forms
.
Label
();
this
.
comboBoxPortName
=
new
System
.
Windows
.
Forms
.
ComboBox
();
this
.
axis_1_Alarm
=
new
UserFromControl
.
IOStatusControl
();
this
.
axis_3_Alarm
=
new
UserFromControl
.
IOStatusControl
();
this
.
axis_2_Alarm
=
new
UserFromControl
.
IOStatusControl
();
this
.
tabControl1
=
new
System
.
Windows
.
Forms
.
TabControl
();
this
.
tabPage2
=
new
System
.
Windows
.
Forms
.
TabPage
();
this
.
tabPage3
=
new
System
.
Windows
.
Forms
.
TabPage
();
this
.
groupBox6
=
new
System
.
Windows
.
Forms
.
GroupBox
();
this
.
button6
=
new
System
.
Windows
.
Forms
.
Button
();
this
.
button5
=
new
System
.
Windows
.
Forms
.
Button
();
this
.
button4
=
new
System
.
Windows
.
Forms
.
Button
();
this
.
lblDoorStatus
=
new
System
.
Windows
.
Forms
.
Label
();
this
.
button3
=
new
System
.
Windows
.
Forms
.
Button
();
this
.
groupBox5
.
SuspendLayout
();
this
.
groupBox1
.
SuspendLayout
();
this
.
groupBox2
.
SuspendLayout
();
...
...
@@ -203,6 +212,10 @@
this
.
groupBox3
.
SuspendLayout
();
this
.
contextMenuStrip1
.
SuspendLayout
();
this
.
groupBox4
.
SuspendLayout
();
this
.
tabControl1
.
SuspendLayout
();
this
.
tabPage2
.
SuspendLayout
();
this
.
tabPage3
.
SuspendLayout
();
this
.
groupBox6
.
SuspendLayout
();
this
.
SuspendLayout
();
//
// timer1
...
...
@@ -219,7 +232,6 @@
this
.
lblWarnMsg
.
Size
=
new
System
.
Drawing
.
Size
(
462
,
40
);
this
.
lblWarnMsg
.
TabIndex
=
224
;
this
.
lblWarnMsg
.
TextAlign
=
System
.
Drawing
.
ContentAlignment
.
MiddleCenter
;
this
.
lblWarnMsg
.
Click
+=
new
System
.
EventHandler
(
this
.
lblWarnMsg_Click
);
//
// groupBox5
//
...
...
@@ -268,9 +280,9 @@
this
.
groupBox5
.
Controls
.
Add
(
this
.
cmbAxisList
);
this
.
groupBox5
.
Controls
.
Add
(
this
.
label49
);
this
.
groupBox5
.
Font
=
new
System
.
Drawing
.
Font
(
"微软雅黑"
,
9F
,
System
.
Drawing
.
FontStyle
.
Regular
,
System
.
Drawing
.
GraphicsUnit
.
Point
,
((
byte
)(
134
)));
this
.
groupBox5
.
Location
=
new
System
.
Drawing
.
Point
(
510
,
33
);
this
.
groupBox5
.
Location
=
new
System
.
Drawing
.
Point
(
6
,
2
);
this
.
groupBox5
.
Name
=
"groupBox5"
;
this
.
groupBox5
.
Size
=
new
System
.
Drawing
.
Size
(
512
,
326
);
this
.
groupBox5
.
Size
=
new
System
.
Drawing
.
Size
(
497
,
328
);
this
.
groupBox5
.
TabIndex
=
216
;
this
.
groupBox5
.
TabStop
=
false
;
this
.
groupBox5
.
Text
=
"伺服运动"
;
...
...
@@ -748,12 +760,13 @@
//
// richTextBox1
//
this
.
richTextBox1
.
Anchor
=
((
System
.
Windows
.
Forms
.
AnchorStyles
)(((
System
.
Windows
.
Forms
.
AnchorStyles
.
Top
|
System
.
Windows
.
Forms
.
AnchorStyles
.
Bottom
)
|
System
.
Windows
.
Forms
.
AnchorStyles
.
Left
)));
this
.
richTextBox1
.
Anchor
=
((
System
.
Windows
.
Forms
.
AnchorStyles
)((((
System
.
Windows
.
Forms
.
AnchorStyles
.
Top
|
System
.
Windows
.
Forms
.
AnchorStyles
.
Bottom
)
|
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
(
7
,
525
);
this
.
richTextBox1
.
Location
=
new
System
.
Drawing
.
Point
(
510
,
576
);
this
.
richTextBox1
.
Name
=
"richTextBox1"
;
this
.
richTextBox1
.
Size
=
new
System
.
Drawing
.
Size
(
496
,
212
);
this
.
richTextBox1
.
Size
=
new
System
.
Drawing
.
Size
(
519
,
163
);
this
.
richTextBox1
.
TabIndex
=
256
;
this
.
richTextBox1
.
Text
=
""
;
//
...
...
@@ -781,18 +794,48 @@
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
(
510
,
361
);
this
.
groupBox1
.
Location
=
new
System
.
Drawing
.
Point
(
6
,
333
);
this
.
groupBox1
.
Name
=
"groupBox1"
;
this
.
groupBox1
.
Size
=
new
System
.
Drawing
.
Size
(
512
,
199
);
this
.
groupBox1
.
Size
=
new
System
.
Drawing
.
Size
(
497
,
170
);
this
.
groupBox1
.
TabIndex
=
217
;
this
.
groupBox1
.
TabStop
=
false
;
this
.
groupBox1
.
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
(
127
,
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
(
329
,
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
(
224
,
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
;
this
.
label38
.
ImageAlign
=
System
.
Drawing
.
ContentAlignment
.
MiddleRight
;
this
.
label38
.
Location
=
new
System
.
Drawing
.
Point
(
49
,
49
);
this
.
label38
.
Location
=
new
System
.
Drawing
.
Point
(
49
,
37
);
this
.
label38
.
Name
=
"label38"
;
this
.
label38
.
Size
=
new
System
.
Drawing
.
Size
(
46
,
17
);
this
.
label38
.
TabIndex
=
263
;
...
...
@@ -800,7 +843,7 @@
//
// txtMiddleTarget
//
this
.
txtMiddleTarget
.
Location
=
new
System
.
Drawing
.
Point
(
105
,
1
61
);
this
.
txtMiddleTarget
.
Location
=
new
System
.
Drawing
.
Point
(
105
,
1
39
);
this
.
txtMiddleTarget
.
Name
=
"txtMiddleTarget"
;
this
.
txtMiddleTarget
.
ReadOnly
=
true
;
this
.
txtMiddleTarget
.
Size
=
new
System
.
Drawing
.
Size
(
87
,
23
);
...
...
@@ -808,7 +851,7 @@
//
// txtInoutTarget
//
this
.
txtInoutTarget
.
Location
=
new
System
.
Drawing
.
Point
(
306
,
1
61
);
this
.
txtInoutTarget
.
Location
=
new
System
.
Drawing
.
Point
(
306
,
1
39
);
this
.
txtInoutTarget
.
Name
=
"txtInoutTarget"
;
this
.
txtInoutTarget
.
ReadOnly
=
true
;
this
.
txtInoutTarget
.
Size
=
new
System
.
Drawing
.
Size
(
87
,
23
);
...
...
@@ -816,7 +859,7 @@
//
// txtUpdownTarget
//
this
.
txtUpdownTarget
.
Location
=
new
System
.
Drawing
.
Point
(
206
,
1
61
);
this
.
txtUpdownTarget
.
Location
=
new
System
.
Drawing
.
Point
(
206
,
1
39
);
this
.
txtUpdownTarget
.
Name
=
"txtUpdownTarget"
;
this
.
txtUpdownTarget
.
ReadOnly
=
true
;
this
.
txtUpdownTarget
.
Size
=
new
System
.
Drawing
.
Size
(
87
,
23
);
...
...
@@ -826,7 +869,7 @@
//
this
.
label12
.
AutoSize
=
true
;
this
.
label12
.
Font
=
new
System
.
Drawing
.
Font
(
"微软雅黑"
,
9F
,
System
.
Drawing
.
FontStyle
.
Regular
,
System
.
Drawing
.
GraphicsUnit
.
Point
,
((
byte
)(
134
)));
this
.
label12
.
Location
=
new
System
.
Drawing
.
Point
(
7
,
1
64
);
this
.
label12
.
Location
=
new
System
.
Drawing
.
Point
(
7
,
1
42
);
this
.
label12
.
Name
=
"label12"
;
this
.
label12
.
Size
=
new
System
.
Drawing
.
Size
(
92
,
17
);
this
.
label12
.
TabIndex
=
258
;
...
...
@@ -834,7 +877,7 @@
//
// lblCountPulse1
//
this
.
lblCountPulse1
.
Location
=
new
System
.
Drawing
.
Point
(
105
,
1
29
);
this
.
lblCountPulse1
.
Location
=
new
System
.
Drawing
.
Point
(
105
,
1
12
);
this
.
lblCountPulse1
.
Name
=
"lblCountPulse1"
;
this
.
lblCountPulse1
.
ReadOnly
=
true
;
this
.
lblCountPulse1
.
Size
=
new
System
.
Drawing
.
Size
(
87
,
23
);
...
...
@@ -842,7 +885,7 @@
//
// lblOutPulse1
//
this
.
lblOutPulse1
.
Location
=
new
System
.
Drawing
.
Point
(
105
,
97
);
this
.
lblOutPulse1
.
Location
=
new
System
.
Drawing
.
Point
(
105
,
85
);
this
.
lblOutPulse1
.
Name
=
"lblOutPulse1"
;
this
.
lblOutPulse1
.
ReadOnly
=
true
;
this
.
lblOutPulse1
.
Size
=
new
System
.
Drawing
.
Size
(
87
,
23
);
...
...
@@ -850,7 +893,7 @@
//
// lblCountPulse3
//
this
.
lblCountPulse3
.
Location
=
new
System
.
Drawing
.
Point
(
306
,
1
29
);
this
.
lblCountPulse3
.
Location
=
new
System
.
Drawing
.
Point
(
306
,
1
12
);
this
.
lblCountPulse3
.
Name
=
"lblCountPulse3"
;
this
.
lblCountPulse3
.
ReadOnly
=
true
;
this
.
lblCountPulse3
.
Size
=
new
System
.
Drawing
.
Size
(
87
,
23
);
...
...
@@ -858,7 +901,7 @@
//
// lblOutPulse3
//
this
.
lblOutPulse3
.
Location
=
new
System
.
Drawing
.
Point
(
306
,
97
);
this
.
lblOutPulse3
.
Location
=
new
System
.
Drawing
.
Point
(
306
,
85
);
this
.
lblOutPulse3
.
Name
=
"lblOutPulse3"
;
this
.
lblOutPulse3
.
ReadOnly
=
true
;
this
.
lblOutPulse3
.
Size
=
new
System
.
Drawing
.
Size
(
87
,
23
);
...
...
@@ -866,7 +909,7 @@
//
// lblCountPulse2
//
this
.
lblCountPulse2
.
Location
=
new
System
.
Drawing
.
Point
(
207
,
1
29
);
this
.
lblCountPulse2
.
Location
=
new
System
.
Drawing
.
Point
(
207
,
1
12
);
this
.
lblCountPulse2
.
Name
=
"lblCountPulse2"
;
this
.
lblCountPulse2
.
ReadOnly
=
true
;
this
.
lblCountPulse2
.
Size
=
new
System
.
Drawing
.
Size
(
87
,
23
);
...
...
@@ -874,7 +917,7 @@
//
// lblOutPulse2
//
this
.
lblOutPulse2
.
Location
=
new
System
.
Drawing
.
Point
(
206
,
97
);
this
.
lblOutPulse2
.
Location
=
new
System
.
Drawing
.
Point
(
206
,
85
);
this
.
lblOutPulse2
.
Name
=
"lblOutPulse2"
;
this
.
lblOutPulse2
.
ReadOnly
=
true
;
this
.
lblOutPulse2
.
Size
=
new
System
.
Drawing
.
Size
(
87
,
23
);
...
...
@@ -884,7 +927,7 @@
//
this
.
label4
.
AutoSize
=
true
;
this
.
label4
.
ImageAlign
=
System
.
Drawing
.
ContentAlignment
.
MiddleRight
;
this
.
label4
.
Location
=
new
System
.
Drawing
.
Point
(
303
,
20
);
this
.
label4
.
Location
=
new
System
.
Drawing
.
Point
(
303
,
14
);
this
.
label4
.
Name
=
"label4"
;
this
.
label4
.
Size
=
new
System
.
Drawing
.
Size
(
80
,
17
);
this
.
label4
.
TabIndex
=
100
;
...
...
@@ -894,7 +937,7 @@
//
this
.
label3
.
AutoSize
=
true
;
this
.
label3
.
ImageAlign
=
System
.
Drawing
.
ContentAlignment
.
MiddleRight
;
this
.
label3
.
Location
=
new
System
.
Drawing
.
Point
(
204
,
20
);
this
.
label3
.
Location
=
new
System
.
Drawing
.
Point
(
204
,
14
);
this
.
label3
.
Name
=
"label3"
;
this
.
label3
.
Size
=
new
System
.
Drawing
.
Size
(
80
,
17
);
this
.
label3
.
TabIndex
=
99
;
...
...
@@ -904,7 +947,7 @@
//
this
.
label1
.
AutoSize
=
true
;
this
.
label1
.
ImageAlign
=
System
.
Drawing
.
ContentAlignment
.
MiddleRight
;
this
.
label1
.
Location
=
new
System
.
Drawing
.
Point
(
106
,
20
);
this
.
label1
.
Location
=
new
System
.
Drawing
.
Point
(
106
,
14
);
this
.
label1
.
Name
=
"label1"
;
this
.
label1
.
Size
=
new
System
.
Drawing
.
Size
(
80
,
17
);
this
.
label1
.
TabIndex
=
97
;
...
...
@@ -914,7 +957,7 @@
//
this
.
label43
.
AutoSize
=
true
;
this
.
label43
.
Font
=
new
System
.
Drawing
.
Font
(
"微软雅黑"
,
9F
,
System
.
Drawing
.
FontStyle
.
Regular
,
System
.
Drawing
.
GraphicsUnit
.
Point
,
((
byte
)(
134
)));
this
.
label43
.
Location
=
new
System
.
Drawing
.
Point
(
15
,
99
);
this
.
label43
.
Location
=
new
System
.
Drawing
.
Point
(
15
,
87
);
this
.
label43
.
Name
=
"label43"
;
this
.
label43
.
Size
=
new
System
.
Drawing
.
Size
(
80
,
17
);
this
.
label43
.
TabIndex
=
23
;
...
...
@@ -924,7 +967,7 @@
//
this
.
label42
.
AutoSize
=
true
;
this
.
label42
.
Font
=
new
System
.
Drawing
.
Font
(
"微软雅黑"
,
9F
,
System
.
Drawing
.
FontStyle
.
Regular
,
System
.
Drawing
.
GraphicsUnit
.
Point
,
((
byte
)(
134
)));
this
.
label42
.
Location
=
new
System
.
Drawing
.
Point
(
15
,
1
30
);
this
.
label42
.
Location
=
new
System
.
Drawing
.
Point
(
15
,
1
13
);
this
.
label42
.
Name
=
"label42"
;
this
.
label42
.
Size
=
new
System
.
Drawing
.
Size
(
80
,
17
);
this
.
label42
.
TabIndex
=
24
;
...
...
@@ -975,13 +1018,12 @@
this
.
groupBox2
.
Controls
.
Add
(
this
.
btnUpDownP6
);
this
.
groupBox2
.
Controls
.
Add
(
this
.
btnUpDownP3
);
this
.
groupBox2
.
Controls
.
Add
(
this
.
btnUpDownP4
);
this
.
groupBox2
.
Location
=
new
System
.
Drawing
.
Point
(
7
,
124
);
this
.
groupBox2
.
Location
=
new
System
.
Drawing
.
Point
(
7
,
343
);
this
.
groupBox2
.
Name
=
"groupBox2"
;
this
.
groupBox2
.
Size
=
new
System
.
Drawing
.
Size
(
496
,
396
);
this
.
groupBox2
.
TabIndex
=
100
;
this
.
groupBox2
.
TabStop
=
false
;
this
.
groupBox2
.
Text
=
"料仓操作"
;
this
.
groupBox2
.
Enter
+=
new
System
.
EventHandler
(
this
.
groupBox2_Enter
);
this
.
groupBox2
.
Text
=
"出入库操作"
;
//
// lblTemp
//
...
...
@@ -1637,7 +1679,7 @@
this
.
日志
ToolStripMenuItem
});
this
.
menuStrip1
.
Location
=
new
System
.
Drawing
.
Point
(
0
,
0
);
this
.
menuStrip1
.
Name
=
"menuStrip1"
;
this
.
menuStrip1
.
Size
=
new
System
.
Drawing
.
Size
(
10
29
,
29
);
this
.
menuStrip1
.
Size
=
new
System
.
Drawing
.
Size
(
10
31
,
29
);
this
.
menuStrip1
.
TabIndex
=
257
;
this
.
menuStrip1
.
Text
=
"menuStrip1"
;
//
...
...
@@ -1731,56 +1773,56 @@
// 查看IOToolStripMenuItem
//
this
.
查看
IOToolStripMenuItem
.
Name
=
"查看IOToolStripMenuItem"
;
this
.
查看
IOToolStripMenuItem
.
Size
=
new
System
.
Drawing
.
Size
(
1
75
,
26
);
this
.
查看
IOToolStripMenuItem
.
Size
=
new
System
.
Drawing
.
Size
(
1
92
,
26
);
this
.
查看
IOToolStripMenuItem
.
Text
=
"查看IO"
;
this
.
查看
IOToolStripMenuItem
.
Click
+=
new
System
.
EventHandler
(
this
.
查看
IOToolStripMenuItem_Click
);
//
// toolStripSeparator5
//
this
.
toolStripSeparator5
.
Name
=
"toolStripSeparator5"
;
this
.
toolStripSeparator5
.
Size
=
new
System
.
Drawing
.
Size
(
1
72
,
6
);
this
.
toolStripSeparator5
.
Size
=
new
System
.
Drawing
.
Size
(
1
89
,
6
);
//
// 料仓运转ONToolStripMenuItem
//
this
.
料仓运转
ONToolStripMenuItem
.
Name
=
"料仓运转ONToolStripMenuItem"
;
this
.
料仓运转
ONToolStripMenuItem
.
Size
=
new
System
.
Drawing
.
Size
(
1
75
,
26
);
this
.
料仓运转
ONToolStripMenuItem
.
Size
=
new
System
.
Drawing
.
Size
(
1
92
,
26
);
this
.
料仓运转
ONToolStripMenuItem
.
Text
=
"料仓运转ON"
;
this
.
料仓运转
ONToolStripMenuItem
.
Click
+=
new
System
.
EventHandler
(
this
.
料仓运转
ONToolStripMenuItem_Click
);
//
// toolStripSeparator6
//
this
.
toolStripSeparator6
.
Name
=
"toolStripSeparator6"
;
this
.
toolStripSeparator6
.
Size
=
new
System
.
Drawing
.
Size
(
1
72
,
6
);
this
.
toolStripSeparator6
.
Size
=
new
System
.
Drawing
.
Size
(
1
89
,
6
);
//
// 料仓运转OFFToolStripMenuItem
//
this
.
料仓运转
OFFToolStripMenuItem
.
Name
=
"料仓运转OFFToolStripMenuItem"
;
this
.
料仓运转
OFFToolStripMenuItem
.
Size
=
new
System
.
Drawing
.
Size
(
1
75
,
26
);
this
.
料仓运转
OFFToolStripMenuItem
.
Size
=
new
System
.
Drawing
.
Size
(
1
92
,
26
);
this
.
料仓运转
OFFToolStripMenuItem
.
Text
=
"料仓运转OFF"
;
this
.
料仓运转
OFFToolStripMenuItem
.
Click
+=
new
System
.
EventHandler
(
this
.
料仓运转
OFFToolStripMenuItem_Click
);
//
// toolStripSeparator7
//
this
.
toolStripSeparator7
.
Name
=
"toolStripSeparator7"
;
this
.
toolStripSeparator7
.
Size
=
new
System
.
Drawing
.
Size
(
1
72
,
6
);
this
.
toolStripSeparator7
.
Size
=
new
System
.
Drawing
.
Size
(
1
89
,
6
);
//
// 打开舱门ToolStripMenuItem
//
this
.
打开舱门
ToolStripMenuItem
.
Name
=
"打开舱门ToolStripMenuItem"
;
this
.
打开舱门
ToolStripMenuItem
.
Size
=
new
System
.
Drawing
.
Size
(
1
75
,
26
);
this
.
打开舱门
ToolStripMenuItem
.
Text
=
"打开仓门"
;
this
.
打开舱门
ToolStripMenuItem
.
Size
=
new
System
.
Drawing
.
Size
(
1
92
,
26
);
this
.
打开舱门
ToolStripMenuItem
.
Text
=
"打开
进料口
仓门"
;
this
.
打开舱门
ToolStripMenuItem
.
Click
+=
new
System
.
EventHandler
(
this
.
打开舱门
ToolStripMenuItem_Click
);
//
// toolStripSeparator8
//
this
.
toolStripSeparator8
.
Name
=
"toolStripSeparator8"
;
this
.
toolStripSeparator8
.
Size
=
new
System
.
Drawing
.
Size
(
1
72
,
6
);
this
.
toolStripSeparator8
.
Size
=
new
System
.
Drawing
.
Size
(
1
89
,
6
);
//
// 关闭仓门ToolStripMenuItem
//
this
.
关闭仓门
ToolStripMenuItem
.
Name
=
"关闭仓门ToolStripMenuItem"
;
this
.
关闭仓门
ToolStripMenuItem
.
Size
=
new
System
.
Drawing
.
Size
(
1
75
,
26
);
this
.
关闭仓门
ToolStripMenuItem
.
Text
=
"关闭仓门"
;
this
.
关闭仓门
ToolStripMenuItem
.
Size
=
new
System
.
Drawing
.
Size
(
1
92
,
26
);
this
.
关闭仓门
ToolStripMenuItem
.
Text
=
"关闭
进料口
仓门"
;
this
.
关闭仓门
ToolStripMenuItem
.
Click
+=
new
System
.
EventHandler
(
this
.
关闭仓门
ToolStripMenuItem_Click
);
//
// 设备调试ToolStripMenuItem
...
...
@@ -1965,16 +2007,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
(
510
,
562
);
this
.
groupBox4
.
Location
=
new
System
.
Drawing
.
Point
(
8
,
7
);
this
.
groupBox4
.
Name
=
"groupBox4"
;
this
.
groupBox4
.
Size
=
new
System
.
Drawing
.
Size
(
512
,
160
);
this
.
groupBox4
.
Size
=
new
System
.
Drawing
.
Size
(
493
,
523
);
this
.
groupBox4
.
TabIndex
=
271
;
this
.
groupBox4
.
TabStop
=
false
;
this
.
groupBox4
.
Text
=
"压紧轴"
;
//
// btnRelMove
//
this
.
btnRelMove
.
Location
=
new
System
.
Drawing
.
Point
(
285
,
56
);
this
.
btnRelMove
.
Location
=
new
System
.
Drawing
.
Point
(
285
,
103
);
this
.
btnRelMove
.
Name
=
"btnRelMove"
;
this
.
btnRelMove
.
Size
=
new
System
.
Drawing
.
Size
(
105
,
33
);
this
.
btnRelMove
.
TabIndex
=
96
;
...
...
@@ -2002,7 +2044,7 @@
//
// btnGetPosition
//
this
.
btnGetPosition
.
Location
=
new
System
.
Drawing
.
Point
(
395
,
56
);
this
.
btnGetPosition
.
Location
=
new
System
.
Drawing
.
Point
(
176
,
210
);
this
.
btnGetPosition
.
Name
=
"btnGetPosition"
;
this
.
btnGetPosition
.
Size
=
new
System
.
Drawing
.
Size
(
105
,
33
);
this
.
btnGetPosition
.
TabIndex
=
93
;
...
...
@@ -2017,7 +2059,7 @@
this
.
cmbHomeType
.
Items
.
AddRange
(
new
object
[]
{
"0=反方向"
,
"1=正方向"
});
this
.
cmbHomeType
.
Location
=
new
System
.
Drawing
.
Point
(
67
,
1
28
);
this
.
cmbHomeType
.
Location
=
new
System
.
Drawing
.
Point
(
67
,
1
75
);
this
.
cmbHomeType
.
Name
=
"cmbHomeType"
;
this
.
cmbHomeType
.
Size
=
new
System
.
Drawing
.
Size
(
103
,
25
);
this
.
cmbHomeType
.
TabIndex
=
92
;
...
...
@@ -2025,7 +2067,7 @@
// label13
//
this
.
label13
.
AutoSize
=
true
;
this
.
label13
.
Location
=
new
System
.
Drawing
.
Point
(
5
,
1
32
);
this
.
label13
.
Location
=
new
System
.
Drawing
.
Point
(
5
,
1
79
);
this
.
label13
.
Name
=
"label13"
;
this
.
label13
.
Size
=
new
System
.
Drawing
.
Size
(
68
,
17
);
this
.
label13
.
TabIndex
=
91
;
...
...
@@ -2034,7 +2076,7 @@
// label17
//
this
.
label17
.
AutoSize
=
true
;
this
.
label17
.
Location
=
new
System
.
Drawing
.
Point
(
5
,
98
);
this
.
label17
.
Location
=
new
System
.
Drawing
.
Point
(
5
,
145
);
this
.
label17
.
Name
=
"label17"
;
this
.
label17
.
Size
=
new
System
.
Drawing
.
Size
(
44
,
17
);
this
.
label17
.
TabIndex
=
90
;
...
...
@@ -2042,7 +2084,7 @@
//
// txtSpeed
//
this
.
txtSpeed
.
Location
=
new
System
.
Drawing
.
Point
(
67
,
95
);
this
.
txtSpeed
.
Location
=
new
System
.
Drawing
.
Point
(
67
,
142
);
this
.
txtSpeed
.
MaxLength
=
15
;
this
.
txtSpeed
.
Name
=
"txtSpeed"
;
this
.
txtSpeed
.
Size
=
new
System
.
Drawing
.
Size
(
103
,
23
);
...
...
@@ -2051,7 +2093,7 @@
//
// btnVolMove
//
this
.
btnVolMove
.
Location
=
new
System
.
Drawing
.
Point
(
176
,
90
);
this
.
btnVolMove
.
Location
=
new
System
.
Drawing
.
Point
(
176
,
137
);
this
.
btnVolMove
.
Name
=
"btnVolMove"
;
this
.
btnVolMove
.
Size
=
new
System
.
Drawing
.
Size
(
105
,
33
);
this
.
btnVolMove
.
TabIndex
=
88
;
...
...
@@ -2061,7 +2103,7 @@
//
// btnClose
//
this
.
btnClose
.
Location
=
new
System
.
Drawing
.
Point
(
395
,
22
);
this
.
btnClose
.
Location
=
new
System
.
Drawing
.
Point
(
171
,
59
);
this
.
btnClose
.
Name
=
"btnClose"
;
this
.
btnClose
.
Size
=
new
System
.
Drawing
.
Size
(
105
,
33
);
this
.
btnClose
.
TabIndex
=
87
;
...
...
@@ -2071,7 +2113,7 @@
//
// btnOpen
//
this
.
btnOpen
.
Location
=
new
System
.
Drawing
.
Point
(
285
,
22
);
this
.
btnOpen
.
Location
=
new
System
.
Drawing
.
Point
(
61
,
59
);
this
.
btnOpen
.
Name
=
"btnOpen"
;
this
.
btnOpen
.
Size
=
new
System
.
Drawing
.
Size
(
105
,
33
);
this
.
btnOpen
.
TabIndex
=
86
;
...
...
@@ -2081,7 +2123,7 @@
//
// btnStatusSearch
//
this
.
btnStatusSearch
.
Location
=
new
System
.
Drawing
.
Point
(
285
,
90
);
this
.
btnStatusSearch
.
Location
=
new
System
.
Drawing
.
Point
(
285
,
137
);
this
.
btnStatusSearch
.
Name
=
"btnStatusSearch"
;
this
.
btnStatusSearch
.
Size
=
new
System
.
Drawing
.
Size
(
105
,
33
);
this
.
btnStatusSearch
.
TabIndex
=
85
;
...
...
@@ -2092,7 +2134,7 @@
// label19
//
this
.
label19
.
AutoSize
=
true
;
this
.
label19
.
Location
=
new
System
.
Drawing
.
Point
(
5
,
64
);
this
.
label19
.
Location
=
new
System
.
Drawing
.
Point
(
5
,
111
);
this
.
label19
.
Name
=
"label19"
;
this
.
label19
.
Size
=
new
System
.
Drawing
.
Size
(
44
,
17
);
this
.
label19
.
TabIndex
=
84
;
...
...
@@ -2100,7 +2142,7 @@
//
// txtLinePosition
//
this
.
txtLinePosition
.
Location
=
new
System
.
Drawing
.
Point
(
67
,
61
);
this
.
txtLinePosition
.
Location
=
new
System
.
Drawing
.
Point
(
67
,
108
);
this
.
txtLinePosition
.
MaxLength
=
15
;
this
.
txtLinePosition
.
Name
=
"txtLinePosition"
;
this
.
txtLinePosition
.
Size
=
new
System
.
Drawing
.
Size
(
103
,
23
);
...
...
@@ -2109,7 +2151,7 @@
//
// btnHomeMove
//
this
.
btnHomeMove
.
Location
=
new
System
.
Drawing
.
Point
(
176
,
1
24
);
this
.
btnHomeMove
.
Location
=
new
System
.
Drawing
.
Point
(
176
,
1
71
);
this
.
btnHomeMove
.
Name
=
"btnHomeMove"
;
this
.
btnHomeMove
.
Size
=
new
System
.
Drawing
.
Size
(
105
,
33
);
this
.
btnHomeMove
.
TabIndex
=
12
;
...
...
@@ -2119,7 +2161,7 @@
//
// btnClearPosition
//
this
.
btnClearPosition
.
Location
=
new
System
.
Drawing
.
Point
(
395
,
9
0
);
this
.
btnClearPosition
.
Location
=
new
System
.
Drawing
.
Point
(
285
,
21
0
);
this
.
btnClearPosition
.
Name
=
"btnClearPosition"
;
this
.
btnClearPosition
.
Size
=
new
System
.
Drawing
.
Size
(
105
,
33
);
this
.
btnClearPosition
.
TabIndex
=
11
;
...
...
@@ -2129,7 +2171,7 @@
//
// btnStop
//
this
.
btnStop
.
Location
=
new
System
.
Drawing
.
Point
(
285
,
1
24
);
this
.
btnStop
.
Location
=
new
System
.
Drawing
.
Point
(
285
,
1
71
);
this
.
btnStop
.
Name
=
"btnStop"
;
this
.
btnStop
.
Size
=
new
System
.
Drawing
.
Size
(
105
,
33
);
this
.
btnStop
.
TabIndex
=
10
;
...
...
@@ -2139,7 +2181,7 @@
//
// btnLineAbsMove
//
this
.
btnLineAbsMove
.
Location
=
new
System
.
Drawing
.
Point
(
176
,
56
);
this
.
btnLineAbsMove
.
Location
=
new
System
.
Drawing
.
Point
(
176
,
103
);
this
.
btnLineAbsMove
.
Name
=
"btnLineAbsMove"
;
this
.
btnLineAbsMove
.
Size
=
new
System
.
Drawing
.
Size
(
105
,
33
);
this
.
btnLineAbsMove
.
TabIndex
=
9
;
...
...
@@ -2165,45 +2207,115 @@
this
.
comboBoxPortName
.
Size
=
new
System
.
Drawing
.
Size
(
103
,
25
);
this
.
comboBoxPortName
.
TabIndex
=
0
;
//
// 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
(
127
,
49
);
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
(
329
,
49
);
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
// tabControl1
//
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
(
224
,
49
);
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
;
this
.
tabControl1
.
Anchor
=
((
System
.
Windows
.
Forms
.
AnchorStyles
)(((
System
.
Windows
.
Forms
.
AnchorStyles
.
Top
|
System
.
Windows
.
Forms
.
AnchorStyles
.
Left
)
|
System
.
Windows
.
Forms
.
AnchorStyles
.
Right
)));
this
.
tabControl1
.
Controls
.
Add
(
this
.
tabPage2
);
this
.
tabControl1
.
Controls
.
Add
(
this
.
tabPage3
);
this
.
tabControl1
.
Font
=
new
System
.
Drawing
.
Font
(
"微软雅黑"
,
9F
,
System
.
Drawing
.
FontStyle
.
Regular
,
System
.
Drawing
.
GraphicsUnit
.
Point
,
((
byte
)(
134
)));
this
.
tabControl1
.
Location
=
new
System
.
Drawing
.
Point
(
510
,
36
);
this
.
tabControl1
.
Name
=
"tabControl1"
;
this
.
tabControl1
.
SelectedIndex
=
0
;
this
.
tabControl1
.
Size
=
new
System
.
Drawing
.
Size
(
519
,
538
);
this
.
tabControl1
.
TabIndex
=
301
;
//
// tabPage2
//
this
.
tabPage2
.
Controls
.
Add
(
this
.
groupBox5
);
this
.
tabPage2
.
Controls
.
Add
(
this
.
groupBox1
);
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
(
511
,
508
);
this
.
tabPage2
.
TabIndex
=
1
;
this
.
tabPage2
.
Text
=
"伺服调试"
;
this
.
tabPage2
.
UseVisualStyleBackColor
=
true
;
//
// tabPage3
//
this
.
tabPage3
.
Controls
.
Add
(
this
.
groupBox4
);
this
.
tabPage3
.
Location
=
new
System
.
Drawing
.
Point
(
4
,
26
);
this
.
tabPage3
.
Name
=
"tabPage3"
;
this
.
tabPage3
.
Size
=
new
System
.
Drawing
.
Size
(
511
,
508
);
this
.
tabPage3
.
TabIndex
=
2
;
this
.
tabPage3
.
Text
=
"压紧轴调试"
;
this
.
tabPage3
.
UseVisualStyleBackColor
=
true
;
//
// groupBox6
//
this
.
groupBox6
.
Controls
.
Add
(
this
.
button6
);
this
.
groupBox6
.
Controls
.
Add
(
this
.
button5
);
this
.
groupBox6
.
Controls
.
Add
(
this
.
button4
);
this
.
groupBox6
.
Controls
.
Add
(
this
.
lblDoorStatus
);
this
.
groupBox6
.
Controls
.
Add
(
this
.
button3
);
this
.
groupBox6
.
Font
=
new
System
.
Drawing
.
Font
(
"微软雅黑"
,
9F
,
System
.
Drawing
.
FontStyle
.
Regular
,
System
.
Drawing
.
GraphicsUnit
.
Point
,
((
byte
)(
134
)));
this
.
groupBox6
.
Location
=
new
System
.
Drawing
.
Point
(
7
,
128
);
this
.
groupBox6
.
Name
=
"groupBox6"
;
this
.
groupBox6
.
Size
=
new
System
.
Drawing
.
Size
(
497
,
209
);
this
.
groupBox6
.
TabIndex
=
302
;
this
.
groupBox6
.
TabStop
=
false
;
this
.
groupBox6
.
Text
=
"自动上下料操作"
;
//
// button6
//
this
.
button6
.
Font
=
new
System
.
Drawing
.
Font
(
"微软雅黑"
,
9F
,
System
.
Drawing
.
FontStyle
.
Regular
,
System
.
Drawing
.
GraphicsUnit
.
Point
,
((
byte
)(
134
)));
this
.
button6
.
Location
=
new
System
.
Drawing
.
Point
(
171
,
112
);
this
.
button6
.
Name
=
"button6"
;
this
.
button6
.
Size
=
new
System
.
Drawing
.
Size
(
105
,
38
);
this
.
button6
.
TabIndex
=
227
;
this
.
button6
.
Text
=
"关闭门锁"
;
this
.
button6
.
UseVisualStyleBackColor
=
true
;
//
// button5
//
this
.
button5
.
Font
=
new
System
.
Drawing
.
Font
(
"微软雅黑"
,
9F
,
System
.
Drawing
.
FontStyle
.
Regular
,
System
.
Drawing
.
GraphicsUnit
.
Point
,
((
byte
)(
134
)));
this
.
button5
.
Location
=
new
System
.
Drawing
.
Point
(
171
,
68
);
this
.
button5
.
Name
=
"button5"
;
this
.
button5
.
Size
=
new
System
.
Drawing
.
Size
(
105
,
38
);
this
.
button5
.
TabIndex
=
226
;
this
.
button5
.
Text
=
"批量入库开始"
;
this
.
button5
.
UseVisualStyleBackColor
=
true
;
//
// button4
//
this
.
button4
.
Font
=
new
System
.
Drawing
.
Font
(
"微软雅黑"
,
9F
,
System
.
Drawing
.
FontStyle
.
Regular
,
System
.
Drawing
.
GraphicsUnit
.
Point
,
((
byte
)(
134
)));
this
.
button4
.
Location
=
new
System
.
Drawing
.
Point
(
39
,
112
);
this
.
button4
.
Name
=
"button4"
;
this
.
button4
.
Size
=
new
System
.
Drawing
.
Size
(
105
,
38
);
this
.
button4
.
TabIndex
=
225
;
this
.
button4
.
Text
=
"打开门锁"
;
this
.
button4
.
UseVisualStyleBackColor
=
true
;
//
// lblDoorStatus
//
this
.
lblDoorStatus
.
AutoSize
=
true
;
this
.
lblDoorStatus
.
Font
=
new
System
.
Drawing
.
Font
(
"微软雅黑"
,
10.5F
,
System
.
Drawing
.
FontStyle
.
Regular
,
System
.
Drawing
.
GraphicsUnit
.
Point
,
((
byte
)(
134
)));
this
.
lblDoorStatus
.
ForeColor
=
System
.
Drawing
.
Color
.
Green
;
this
.
lblDoorStatus
.
Location
=
new
System
.
Drawing
.
Point
(
35
,
29
);
this
.
lblDoorStatus
.
Name
=
"lblDoorStatus"
;
this
.
lblDoorStatus
.
Size
=
new
System
.
Drawing
.
Size
(
121
,
20
);
this
.
lblDoorStatus
.
TabIndex
=
224
;
this
.
lblDoorStatus
.
Text
=
"仓门状态:关闭中"
;
//
// button3
//
this
.
button3
.
Font
=
new
System
.
Drawing
.
Font
(
"微软雅黑"
,
9F
,
System
.
Drawing
.
FontStyle
.
Regular
,
System
.
Drawing
.
GraphicsUnit
.
Point
,
((
byte
)(
134
)));
this
.
button3
.
Location
=
new
System
.
Drawing
.
Point
(
39
,
68
);
this
.
button3
.
Name
=
"button3"
;
this
.
button3
.
Size
=
new
System
.
Drawing
.
Size
(
105
,
38
);
this
.
button3
.
TabIndex
=
103
;
this
.
button3
.
Text
=
"批量入库"
;
this
.
button3
.
UseVisualStyleBackColor
=
true
;
//
// FrmStoreBox
//
this
.
AutoScaleDimensions
=
new
System
.
Drawing
.
SizeF
(
96F
,
96F
);
this
.
AutoScaleMode
=
System
.
Windows
.
Forms
.
AutoScaleMode
.
Dpi
;
this
.
ClientSize
=
new
System
.
Drawing
.
Size
(
10
29
,
749
);
this
.
Controls
.
Add
(
this
.
groupBox
4
);
this
.
Controls
.
Add
(
this
.
groupBox
1
);
this
.
ClientSize
=
new
System
.
Drawing
.
Size
(
10
31
,
749
);
this
.
Controls
.
Add
(
this
.
groupBox
6
);
this
.
Controls
.
Add
(
this
.
tabControl
1
);
this
.
Controls
.
Add
(
this
.
groupBox3
);
this
.
Controls
.
Add
(
this
.
groupBox5
);
this
.
Controls
.
Add
(
this
.
richTextBox1
);
this
.
Controls
.
Add
(
this
.
groupBox2
);
this
.
Controls
.
Add
(
this
.
menuStrip1
);
...
...
@@ -2230,6 +2342,11 @@
this
.
contextMenuStrip1
.
ResumeLayout
(
false
);
this
.
groupBox4
.
ResumeLayout
(
false
);
this
.
groupBox4
.
PerformLayout
();
this
.
tabControl1
.
ResumeLayout
(
false
);
this
.
tabPage2
.
ResumeLayout
(
false
);
this
.
tabPage3
.
ResumeLayout
(
false
);
this
.
groupBox6
.
ResumeLayout
(
false
);
this
.
groupBox6
.
PerformLayout
();
this
.
ResumeLayout
(
false
);
this
.
PerformLayout
();
...
...
@@ -2409,6 +2526,15 @@
private
System
.
Windows
.
Forms
.
Button
btnLineAbsMove
;
private
System
.
Windows
.
Forms
.
Label
label25
;
private
System
.
Windows
.
Forms
.
ComboBox
comboBoxPortName
;
private
System
.
Windows
.
Forms
.
TabControl
tabControl1
;
private
System
.
Windows
.
Forms
.
TabPage
tabPage2
;
private
System
.
Windows
.
Forms
.
TabPage
tabPage3
;
private
System
.
Windows
.
Forms
.
GroupBox
groupBox6
;
private
System
.
Windows
.
Forms
.
Label
lblDoorStatus
;
private
System
.
Windows
.
Forms
.
Button
button3
;
private
System
.
Windows
.
Forms
.
Button
button4
;
private
System
.
Windows
.
Forms
.
Button
button5
;
private
System
.
Windows
.
Forms
.
Button
button6
;
}
}
source/ACSingleStore/FrmStoreBox.cs
查看文件 @
6522a61
...
...
@@ -40,7 +40,7 @@ namespace OnlineStore.AutoInOutStore
}
private
void
InitStoreValue
()
{
this
.
store
=
Auto
StoreManager
.
InitStore
();
this
.
store
=
StoreManager
.
InitStore
();
if
(
store
==
null
)
{
LogUtil
.
error
(
LOGGER
,
"找不到对应的料仓"
);
...
...
@@ -88,7 +88,7 @@ namespace OnlineStore.AutoInOutStore
txtInOutP2
.
Text
=
ktkPosition
.
InOutAxis_DoorPosition_P2
.
ToString
();
//txtUpDownP1.Text = ktkPosition.UpDownAxis_DoorOPosition_P1.ToString();
}
List
<
string
>
port
=
new
List
<
string
>(
SerialPort
.
GetPortNames
());
comboBoxPortName
.
DataSource
=
port
;
if
(
port
.
IndexOf
(
store
.
Config
.
CompressAxis_PortName
)
>=
0
)
...
...
@@ -147,7 +147,7 @@ namespace OnlineStore.AutoInOutStore
}
private
bool
LoadOk
=
false
;
private
void
FrmTest_Load
(
object
sender
,
EventArgs
e
)
{
{
LogUtil
.
logBox
=
this
.
richTextBox1
;
initValue
();
this
.
ShowInTaskbar
=
true
;
...
...
@@ -190,13 +190,19 @@ namespace OnlineStore.AutoInOutStore
//ReadPosistion();
if
(
store
.
storeRunStatus
>
StoreRunStatus
.
Wait
)
{
if
(
AutomaticBaiting
.
AutoDoorSatus
.
Equals
(
1
))
{
lblDoorStatus
.
Text
=
"仓门状态:关闭"
;
}
else
{
lblDoorStatus
.
Text
=
"仓门状态:打开"
;
}
if
(
启动
ToolStripMenuItem
.
Enabled
.
Equals
(
true
))
{
StoreOpenStatus
(
true
);
}
lblThisSta
.
Text
=
store
.
GetRunStr
();
}
lblThisSta
.
Text
=
store
.
GetRunStr
();
//复位按钮状态显示
if
(
复位
ToolStripMenuItem
.
Enabled
==
false
)
{
...
...
@@ -228,14 +234,14 @@ namespace OnlineStore.AutoInOutStore
if
(
store
.
Config
.
IsHasDoorLimit
.
Equals
(
1
))
{
if
(
store
.
KND
IOValue
(
IO_Type
.
DoorColse_Single
).
Equals
(
IO_VALUE
.
LOW
))
if
(
KND
.
IOValue
(
IO_Type
.
DoorColse_Single
).
Equals
(
IO_VALUE
.
LOW
))
{
lblWarnMsg
.
Text
=
lblWarnMsg
.
Text
+
" 前门未关"
;
}
}
//如果不在出入库中,且叉子上有信号,需要提示检查叉子
if
(
store
.
storeRunStatus
.
Equals
(
StoreRunStatus
.
Runing
)
&&
store
.
KND
IOValue
(
IO_Type
.
TrayCheck_Fixture
).
Equals
(
IO_VALUE
.
HIGH
))
if
(
store
.
storeRunStatus
.
Equals
(
StoreRunStatus
.
Runing
)
&&
KND
.
IOValue
(
IO_Type
.
TrayCheck_Fixture
).
Equals
(
IO_VALUE
.
HIGH
))
{
lblWarnMsg
.
Text
=
lblWarnMsg
.
Text
+
" 叉子料盘检测有料,请检查"
;
}
...
...
@@ -273,6 +279,7 @@ namespace OnlineStore.AutoInOutStore
lblThisSta
.
Text
=
"等待启动"
;
lblWarnMsg
.
Text
=
""
;
btnStartAuTo
.
Text
=
"开始自动出入库"
;
lblDoorStatus
.
Text
=
"仓门状态未知"
;
}
}
...
...
@@ -283,7 +290,7 @@ namespace OnlineStore.AutoInOutStore
//判断私服是否打开、
if
(
ACServerManager
.
ServerOnStatus
(
portName
,
SlvAddr
))
{
lblServerOn
.
Text
=
"伺服ON"
;
lblServerOn
.
Text
=
"伺服ON"
;
}
else
{
...
...
@@ -504,8 +511,8 @@ namespace OnlineStore.AutoInOutStore
return
;
}
}
LogUtil
.
info
(
"点击【绝对运动】,端口号【"
+
portName
+
"】地址【"
+
SlvAddr
+
"】位置【"
+
position
+
"】速度【"
+
speed
+
"】"
);
ACServerManager
.
AbsMove
(
portName
,
SlvAddr
,
position
,
speed
);
LogUtil
.
info
(
"点击【绝对运动】,端口号【"
+
portName
+
"】地址【"
+
SlvAddr
+
"】位置【"
+
position
+
"】速度【"
+
speed
+
"】"
);
ACServerManager
.
AbsMove
(
portName
,
SlvAddr
,
position
,
speed
);
}
private
void
btnAxisVMove_Click
(
object
sender
,
EventArgs
e
)
{
...
...
@@ -526,7 +533,7 @@ namespace OnlineStore.AutoInOutStore
}
}
LogUtil
.
info
(
"点击【匀速运动】,端口号【"
+
portName
+
"】地址【"
+
SlvAddr
+
"】 速度【"
+
speed
+
"】"
);
ACServerManager
.
SpeedMove
(
portName
,
SlvAddr
,
speed
);
ACServerManager
.
SpeedMove
(
portName
,
SlvAddr
,
speed
);
}
private
void
btnAxisRMove_Click
(
object
sender
,
EventArgs
e
)
...
...
@@ -560,7 +567,7 @@ namespace OnlineStore.AutoInOutStore
ACServerManager
.
RelMove
(
portName
,
SlvAddr
,
position
,
speed
);
}
private
void
btnAxisStop_Click
(
object
sender
,
EventArgs
e
)
{
...
...
@@ -674,7 +681,7 @@ namespace OnlineStore.AutoInOutStore
if
(
needUpdate
)
{
//更新缓存
Auto
StoreManager
.
UpdateBoxConfig
(
store
.
Config
);
StoreManager
.
UpdateBoxConfig
(
store
.
Config
);
}
}
...
...
@@ -701,7 +708,7 @@ namespace OnlineStore.AutoInOutStore
{
InOutDefaultPosition
=
3000
;
}
int
currValue
=
ACServerManager
.
GetActualtPosition
(
store
.
Config
.
InOut_Axis
.
DeviceName
,
store
.
Config
.
InOut_Axis
.
GetAxisValue
());
int
currValue
=
ACServerManager
.
GetActualtPosition
(
store
.
Config
.
InOut_Axis
.
DeviceName
,
store
.
Config
.
InOut_Axis
.
GetAxisValue
());
if
(
currValue
<=
InOutDefaultPosition
)
{
return
true
;
...
...
@@ -718,13 +725,13 @@ namespace OnlineStore.AutoInOutStore
}
private
void
AxisABSMove
(
ConfigMoveAxis
moveAxis
,
int
targetPosition
,
int
targetSpeed
)
{
moveAxis
.
TargetPosition
=
targetPosition
;
moveAxis
.
TargetPosition
=
targetPosition
;
ACServerManager
.
AbsMove
(
moveAxis
.
DeviceName
,
moveAxis
.
GetAxisValue
(),
targetPosition
,
targetSpeed
);
}
private
void
btnUpDownP1_Click
(
object
sender
,
EventArgs
e
)
{
if
(
InOutIsIsP1
())
{
{
int
value
=
FormUtil
.
GetIntValue
(
txtUpDownP1
);
AxisABSMove
(
store
.
Config
.
UpDown_Axis
,
value
,
store
.
Config
.
UpDownAxis_P1_Speed
);
}
...
...
@@ -908,7 +915,7 @@ namespace OnlineStore.AutoInOutStore
//{
// FormManager.ShowAxisConfig(store);
//}
private
void
轴卡点动
ToolStripMenuItem_Click
(
object
sender
,
EventArgs
e
)
{
...
...
@@ -971,14 +978,14 @@ namespace OnlineStore.AutoInOutStore
private
void
料仓运转
ONToolStripMenuItem_Click
(
object
sender
,
EventArgs
e
)
{
this
.
Enabled
=
false
;
store
.
RunAxis
(
false
);
store
.
RunAxis
(
false
);
this
.
Enabled
=
true
;
LogUtil
.
info
(
"料仓运转ON完成"
);
}
private
void
扫码测试
ToolStripMenuItem_Click
(
object
sender
,
EventArgs
e
)
{
store
.
KNDIOMove
(
IO_Type
.
CameraLight_Power
,
IO_VALUE
.
HIGH
);
KND
.
IOMove
(
IO_Type
.
CameraLight_Power
,
IO_VALUE
.
HIGH
);
string
message
=
""
;
string
outMsg
=
""
;
//List<string> codeList = HDevelopExport.CameraScan(out outMsg);
...
...
@@ -989,17 +996,17 @@ namespace OnlineStore.AutoInOutStore
//}
List
<
string
>
codeList
=
CodeManager
.
CameraScan
();
foreach
(
string
str
in
codeList
)
{
message
=
message
+
str
+
"##"
;
{
message
=
message
+
str
+
"##"
;
}
LogUtil
.
info
(
"扫码测试收到二维码【"
+
outMsg
+
"】:"
+
message
);
store
.
KND
IOMove
(
IO_Type
.
CameraLight_Power
,
IO_VALUE
.
LOW
);
LogUtil
.
info
(
"扫码测试收到二维码【"
+
outMsg
+
"】:"
+
message
);
KND
.
IOMove
(
IO_Type
.
CameraLight_Power
,
IO_VALUE
.
LOW
);
}
private
void
打开舱门
ToolStripMenuItem_Click
(
object
sender
,
EventArgs
e
)
{
store
.
KND
IOMove
(
IO_Type
.
Door_Up
,
IO_VALUE
.
HIGH
);
store
.
KND
IOMove
(
IO_Type
.
Door_Down
,
IO_VALUE
.
LOW
);
KND
.
IOMove
(
IO_Type
.
Door_Up
,
IO_VALUE
.
HIGH
);
KND
.
IOMove
(
IO_Type
.
Door_Down
,
IO_VALUE
.
LOW
);
}
private
void
料仓运转
OFFToolStripMenuItem_Click
(
object
sender
,
EventArgs
e
)
...
...
@@ -1010,8 +1017,8 @@ namespace OnlineStore.AutoInOutStore
private
void
关闭仓门
ToolStripMenuItem_Click
(
object
sender
,
EventArgs
e
)
{
store
.
KND
IOMove
(
IO_Type
.
Door_Down
,
IO_VALUE
.
HIGH
);
store
.
KND
IOMove
(
IO_Type
.
Door_Up
,
IO_VALUE
.
LOW
);
KND
.
IOMove
(
IO_Type
.
Door_Down
,
IO_VALUE
.
HIGH
);
KND
.
IOMove
(
IO_Type
.
Door_Up
,
IO_VALUE
.
LOW
);
}
private
void
回待机点
ToolStripMenuItem_Click
(
object
sender
,
EventArgs
e
)
...
...
@@ -1065,7 +1072,7 @@ namespace OnlineStore.AutoInOutStore
}
/// <summary>
/// <summary>
/// 判断AC伺服电机轴是否运动完成
/// </summary>
protected
bool
ACAxisMoveIsEnd
(
ConfigMoveAxis
moveAxis
,
int
targetPosition
,
int
targetSpeed
,
out
string
msg
)
...
...
@@ -1093,9 +1100,9 @@ namespace OnlineStore.AutoInOutStore
else
if
(
errorCount
<=
moveAxis
.
CanErrorCountMin
)
{
LogUtil
.
info
(
LOGGER
,
" DeviceName="
+
deviceName
+
",AxisNo="
+
axisNo
+
",targetPosition="
+
targetPosition
+
",当前outCount="
+
outCount
+
",误差值小于最小误差【"
+
moveAxis
.
CanErrorCountMin
+
"】,默认轴已经停止运动"
);
",误差值小于最小误差【"
+
moveAxis
.
CanErrorCountMin
+
"】,默认轴已经停止运动"
);
return
true
;
}
}
return
false
;
}
public
bool
IsInProcess
=
false
;
...
...
@@ -1113,7 +1120,7 @@ namespace OnlineStore.AutoInOutStore
foreach
(
WaitResultInfo
wait
in
list
)
{
if
(
wait
.
WaitType
==
1
)
{
{
string
msg
=
""
;
bool
isEnd
=
ACAxisMoveIsEnd
(
wait
.
AxisInfo
,
wait
.
TargetPosition
,
wait
.
TargetSpeed
,
out
msg
);
if
(!
msg
.
Equals
(
""
))
...
...
@@ -1127,7 +1134,7 @@ namespace OnlineStore.AutoInOutStore
isOk
=
false
;
break
;
}
}
}
}
if
(
list
.
Count
>
0
&&
isOk
.
Equals
(
true
))
{
...
...
@@ -1139,8 +1146,8 @@ namespace OnlineStore.AutoInOutStore
IsInProcess
=
false
;
}
public
List
<
WaitResultInfo
>
waitResultList
=
new
List
<
WaitResultInfo
>();
private
int
GetSlaveAddr
()
{
return
FormUtil
.
GetShortValue
(
txtAxisValue
);
...
...
@@ -1166,7 +1173,7 @@ namespace OnlineStore.AutoInOutStore
return
;
}
}
int
speed
=
FormUtil
.
GetIntValue
(
txtASpeed
);
LogUtil
.
info
(
"点击【原点返回】,端口号【"
+
portName
+
"】地址【"
+
SlvAddr
+
"】 速度【"
+
speed
+
"】"
);
ACServerManager
.
HomeMove
(
portName
,
SlvAddr
,
speed
);
...
...
@@ -1186,9 +1193,9 @@ namespace OnlineStore.AutoInOutStore
private
void
button1_Click_1
(
object
sender
,
EventArgs
e
)
{
int
value
=
ACServerManager
.
GetBusyStatus
(
GetPortName
(),
GetSlaveAddr
());
this
.
txtBusyStatus
.
Text
=
value
.
ToString
();
this
.
txtBusyStatus
.
Text
=
value
.
ToString
();
}
private
void
button2_Click
(
object
sender
,
EventArgs
e
)
{
int
value
=
ACServerManager
.
GetHomeEndStatus
(
GetPortName
(),
GetSlaveAddr
());
...
...
@@ -1227,9 +1234,9 @@ namespace OnlineStore.AutoInOutStore
{
FrmPwd
fw
=
new
FrmPwd
(
10
);
DialogResult
result
=
fw
.
ShowDialog
();
if
(!
result
.
Equals
(
DialogResult
.
OK
))
if
(!
result
.
Equals
(
DialogResult
.
OK
))
{
LogUtil
.
info
(
"切换界面显示时,没有正确输入密码"
);
LogUtil
.
info
(
"切换界面显示时,没有正确输入密码"
);
return
;
}
this
.
Visible
=
true
;
...
...
@@ -1265,7 +1272,7 @@ namespace OnlineStore.AutoInOutStore
}
private
void
toolStripMenuItem1_Click
(
object
sender
,
EventArgs
e
)
{
DialogResult
result
=
MessageBox
.
Show
(
"是否确定退出?"
,
"提示"
,
MessageBoxButtons
.
YesNo
,
MessageBoxIcon
.
Question
);
DialogResult
result
=
MessageBox
.
Show
(
"是否确定退出?"
,
"提示"
,
MessageBoxButtons
.
YesNo
,
MessageBoxIcon
.
Question
);
if
(
result
.
Equals
(
DialogResult
.
Yes
))
{
ExitApp
();
...
...
@@ -1287,7 +1294,7 @@ namespace OnlineStore.AutoInOutStore
private
void
退出
ToolStripMenuItem_Click
(
object
sender
,
EventArgs
e
)
{
DialogResult
result
=
MessageBox
.
Show
(
"是否确定退出?"
,
"提示"
,
MessageBoxButtons
.
YesNo
,
MessageBoxIcon
.
Question
);
DialogResult
result
=
MessageBox
.
Show
(
"是否确定退出?"
,
"提示"
,
MessageBoxButtons
.
YesNo
,
MessageBoxIcon
.
Question
);
if
(
result
.
Equals
(
DialogResult
.
Yes
))
{
ExitApp
();
...
...
@@ -1296,21 +1303,21 @@ namespace OnlineStore.AutoInOutStore
private
void
摄像机调试
ToolStripMenuItem_Click
(
object
sender
,
EventArgs
e
)
{
store
.
KND
IOMove
(
IO_Type
.
CameraLight_Power
,
IO_VALUE
.
HIGH
);
CodeLibrary
.
FrmCodeDecode
frm
=
new
FrmCodeDecode
(
);
KND
.
IOMove
(
IO_Type
.
CameraLight_Power
,
IO_VALUE
.
HIGH
);
CodeLibrary
.
FrmCodeDecode
frm
=
new
FrmCodeDecode
(
);
frm
.
ShowDialog
();
store
.
KND
IOMove
(
IO_Type
.
CameraLight_Power
,
IO_VALUE
.
LOW
);
KND
.
IOMove
(
IO_Type
.
CameraLight_Power
,
IO_VALUE
.
LOW
);
}
private
void
学习二维码
ToolStripMenuItem_Click
(
object
sender
,
EventArgs
e
)
{
store
.
KND
IOMove
(
IO_Type
.
CameraLight_Power
,
IO_VALUE
.
HIGH
);
KND
.
IOMove
(
IO_Type
.
CameraLight_Power
,
IO_VALUE
.
HIGH
);
string
nameStr
=
ConfigAppSettings
.
GetValue
(
Setting_Init
.
CameraName
);
string
codeStr
=
ConfigAppSettings
.
GetValue
(
Setting_Init
.
CodeType
);
HDCodeLearnHelper
.
LoadConfig
(
nameStr
,
codeStr
);
FrmCodeLearn
learn
=
new
FrmCodeLearn
();
learn
.
ShowDialog
();
store
.
KND
IOMove
(
IO_Type
.
CameraLight_Power
,
IO_VALUE
.
LOW
);
KND
.
IOMove
(
IO_Type
.
CameraLight_Power
,
IO_VALUE
.
LOW
);
}
private
void
btnReadHomeSingle_Click
(
object
sender
,
EventArgs
e
)
...
...
@@ -1320,9 +1327,9 @@ namespace OnlineStore.AutoInOutStore
}
private
void
btnOpen_Click
(
object
sender
,
EventArgs
e
)
{
if
(
Auto
StoreManager
.
OpenShuoKe
(
store
))
if
(
StoreManager
.
OpenShuoKe
(
store
))
{
store
.
SetShuokeSpeed
(
);
ShuoKeControls
.
SetConfigSpeed
(
StoreManager
.
Config
);
FormComStatus
(
true
);
}
}
...
...
@@ -1362,7 +1369,7 @@ namespace OnlineStore.AutoInOutStore
{
int
posi
=
FormUtil
.
GetIntValue
(
txtLinePosition
);
ShuoKeControls
.
RelativeMove
(
this
.
store
.
Config
.
CompressAxis_Slv
,
posi
);
}
}
private
void
btnStatusSearch_Click
(
object
sender
,
EventArgs
e
)
{
ShuoKeControls
.
GetStatus
(
store
.
Config
.
CompressAxis_Slv
);
...
...
@@ -1379,15 +1386,5 @@ namespace OnlineStore.AutoInOutStore
btnStatusSearch
.
Enabled
=
isOpen
;
// Bt_ClearCounter.Enabled = isOpen;
}
private
void
groupBox2_Enter
(
object
sender
,
EventArgs
e
)
{
}
private
void
lblWarnMsg_Click
(
object
sender
,
EventArgs
e
)
{
}
}
}
source/Common/Setting_Init.cs
查看文件 @
6522a61
...
...
@@ -61,15 +61,16 @@ namespace OnlineStore.Common
/// 配置文件路径 Data Matrix ECC 200.dcm
/// </summary>
public
static
string
CodeParamPath
=
"CodeParamPath"
;
/// <summary>
/// 高度传感器转换系数
/// </summary>
public
static
string
AI_ConvertPosition
=
"AI_ConvertPosition"
;
/// <summary>
/// 进出轴最大待机点,需要小于3000
/// </summary>
public
static
string
InOutDefaultPosition
=
"InOutDefaultPosition"
;
public
static
string
Config_Pwd
=
"Config_Pwd"
;
/// <summary>
/// 上料轴转换系数,plus/mm
/// </summary>
public
static
string
AxisChangeValue
=
"AxisChangeValue"
;
}
}
source/DeviceLibrary/DeviceLibrary.csproj
查看文件 @
6522a61
...
...
@@ -58,7 +58,9 @@
<ItemGroup>
<Compile Include="acSingleStore\AC_SA_BoxBean.cs" />
<Compile Include="acSingleStore\AC_SA_BoxBean_Partial.cs" />
<Compile Include="acSingleStore\ACStoreManager.cs" />
<Compile Include="acSingleStore\AutomaticBaiting_Partial.cs" />
<Compile Include="acSingleStore\StoreManager.cs" />
<Compile Include="acSingleStore\AutomaticBaiting.cs" />
<Compile Include="halcon\CodeManager.cs" />
<Compile Include="KangNaiDe\KNDManager.cs" />
<Compile Include="KangNaiDe\MasterTcpClient.cs" />
...
...
@@ -76,7 +78,7 @@
<Compile Include="ShuoKe\ShuoKeControls.cs" />
<Compile Include="store\model\AxisAlarmInfo.cs" />
<Compile Include="store\model\FixtureCodeInfo.cs" />
<Compile Include="store\
KTK
_DeviceBase.cs" />
<Compile Include="store\
AC
_DeviceBase.cs" />
<Compile Include="store\InOrOutStoreParam.cs">
<SubType>Code</SubType>
</Compile>
...
...
@@ -84,7 +86,7 @@
<Compile Include="store\model\StoreMoveInfo.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="store\
KTK
_Store.cs" />
<Compile Include="store\
AC
_Store.cs" />
<Compile Include="store\StoreMoveStep.cs">
<SubType>Code</SubType>
</Compile>
...
...
source/DeviceLibrary/KangNaiDe/KNDManager.cs
查看文件 @
6522a61
...
...
@@ -12,6 +12,49 @@ using System.Threading;
namespace
OnlineStore.DeviceLibrary
{
public
class
KND
{
#
region
KNDIO
public
static
void
IOMove
(
string
ioType
,
IO_VALUE
ioValue
)
{
if
(
StoreManager
.
Config
.
StoreDOList
.
ContainsKey
(
ioType
))
{
ConfigIO
configIo
=
StoreManager
.
Config
.
StoreDOList
[
ioType
];
KNDManager
.
WriteSingleDO
(
configIo
.
DeviceName
,
configIo
.
SlaveID
,
configIo
.
GetIOAddr
(),
ioValue
);
Thread
.
Sleep
(
60
);
}
else
{
LogUtil
.
error
(
"没有DO="
+
ioType
);
}
}
public
static
IO_VALUE
IOValue
(
string
ioType
)
{
IO_VALUE
ioValue
=
IO_VALUE
.
LOW
;
if
(
StoreManager
.
Config
.
StoreDIList
.
ContainsKey
(
ioType
))
{
ConfigIO
configIo
=
StoreManager
.
Config
.
StoreDIList
[
ioType
];
ioValue
=
KNDManager
.
GetDIValue
(
configIo
.
DeviceName
,
configIo
.
SlaveID
,
configIo
.
GetIOAddr
());
//UpdateDoValue(ioType, ioValue);
}
else
if
(
StoreManager
.
Config
.
StoreDOList
.
ContainsKey
(
ioType
))
{
ConfigIO
configIo
=
StoreManager
.
Config
.
StoreDOList
[
ioType
];
ioValue
=
KNDManager
.
GetDOValue
(
configIo
.
DeviceName
,
configIo
.
SlaveID
,
configIo
.
GetIOAddr
());
}
else
{
LogUtil
.
error
(
"没有DO="
+
ioType
);
}
return
ioValue
;
}
#
endregion
}
/// <summary>
/// 康奈德IO控制模块
/// </summary>
...
...
@@ -30,6 +73,8 @@ namespace OnlineStore.DeviceLibrary
private
static
object
DOMapLock
=
""
;
public
static
System
.
Timers
.
Timer
timer
=
null
;
private
static
ushort
port
=
502
;
public
static
void
ConnectionIP
(
string
ioIp
)
{
if
(
timer
==
null
)
...
...
@@ -80,7 +125,7 @@ namespace OnlineStore.DeviceLibrary
Thread
.
Sleep
(
10
);
//读取所有的DO
ReadMultipleDO
(
ioIp
,
DefualtSlaveID
,
DoStartAddress
,
Auto
StoreManager
.
Config
.
GetDOLength
(
ioIp
));
ReadMultipleDO
(
ioIp
,
DefualtSlaveID
,
DoStartAddress
,
StoreManager
.
Config
.
GetDOLength
(
ioIp
));
}
catch
(
Exception
error
)
...
...
@@ -192,7 +237,7 @@ namespace OnlineStore.DeviceLibrary
foreach
(
string
key
in
mastMap
.
Keys
)
{
byte
[]
data
=
new
byte
[]
{
0
,
0
};
WriteMultipleDO
(
key
,
DefualtSlaveID
,
DoStartAddress
,
Auto
StoreManager
.
Config
.
GetDOLength
(
key
),
data
);
WriteMultipleDO
(
key
,
DefualtSlaveID
,
DoStartAddress
,
StoreManager
.
Config
.
GetDOLength
(
key
),
data
);
}
}
...
...
@@ -209,7 +254,7 @@ namespace OnlineStore.DeviceLibrary
}
public
static
void
CloseAllDO
(
string
ioIp
,
byte
slaveId
)
{
ushort
length
=
Auto
StoreManager
.
Config
.
GetDOLength
(
ioIp
);
ushort
length
=
StoreManager
.
Config
.
GetDOLength
(
ioIp
);
byte
[]
bytes
=
new
byte
[
length
];
for
(
int
i
=
0
;
i
<
length
;
i
++)
{
...
...
@@ -394,7 +439,7 @@ namespace OnlineStore.DeviceLibrary
{
try
{
ushort
DILength
=
Auto
StoreManager
.
Config
.
GetDILength
(
ioIp
);
ushort
DILength
=
StoreManager
.
Config
.
GetDILength
(
ioIp
);
string
finalData
=
""
;
if
(
values
.
Length
==
2
&&
DILength
.
Equals
(
16
))
{
...
...
@@ -444,7 +489,7 @@ namespace OnlineStore.DeviceLibrary
private
static
void
SaveDOData
(
string
ioIp
,
ushort
ID
,
byte
[]
values
)
{
ushort
DoLength
=
Auto
StoreManager
.
Config
.
GetDOLength
(
ioIp
);
ushort
DoLength
=
StoreManager
.
Config
.
GetDOLength
(
ioIp
);
string
finalData
=
""
;
if
(
values
.
Length
==
2
&&
DoLength
.
Equals
(
16
))
{
...
...
source/DeviceLibrary/PanasonicServo/ACCMDManager.cs
查看文件 @
6522a61
...
...
@@ -11,8 +11,18 @@ namespace OnlineStore.DeviceLibrary
/// 0132h 原点接近传感器输入 (HOME) 状态 ReadOnly 0: 输入 OFF 1: 输入 ON
/// </summary>
public
static
string
Home_Single
=
"0132"
;
//
//
/// <summary>
/// 0022h 负方向驱动禁止输入(NOT) ReadOnly 0: 输入 OFF、 1: 输入 ON
/// </summary>
public
static
string
Limit_Negative_Single
=
"0022"
;
/// <summary>
/// 0023h 正方向驱动禁止输入(POT) ReadOnly 0: 输入 OFF、 1: 输入 ON
/// </summary>
public
static
string
Limit_Positive_Single
=
"0023"
;
/// <summary>
///速度 4601
/// </summary>
public
static
string
Speed_Addr
=
"4601"
;
...
...
source/DeviceLibrary/PanasonicServo/ACServerManager_Partial.cs
查看文件 @
6522a61
...
...
@@ -496,6 +496,21 @@ namespace OnlineStore.DeviceLibrary
return
GetCoilData
(
portName
,
reviceData
,
ACCMDManager
.
Home_Single
);
}
public
static
int
GetLimitNegativeSingle
(
string
portName
,
int
slvAddr
)
{
PreReadCoilAddr
=
ACCMDManager
.
Home_Single
;
byte
[]
dataArray
=
ACCMDManager
.
GetWriteData
(
slvAddr
,
ACCMDManager
.
CMD_ReadCoil
,
ACCMDManager
.
Limit_Negative_Single
,
"0000"
,
1
);
byte
[]
reviceData
=
SendCommand
(
portName
,
dataArray
,
100
,
6
);
return
GetCoilData
(
portName
,
reviceData
,
ACCMDManager
.
Home_Single
);
}
public
static
int
GetLimitPositiveSingle
(
string
portName
,
int
slvAddr
)
{
PreReadCoilAddr
=
ACCMDManager
.
Home_Single
;
byte
[]
dataArray
=
ACCMDManager
.
GetWriteData
(
slvAddr
,
ACCMDManager
.
CMD_ReadCoil
,
ACCMDManager
.
Limit_Positive_Single
,
"0000"
,
1
);
byte
[]
reviceData
=
SendCommand
(
portName
,
dataArray
,
100
,
6
);
return
GetCoilData
(
portName
,
reviceData
,
ACCMDManager
.
Home_Single
);
}
}
/// <summary>
/// 记录最后一次获得的寄存器的值
...
...
source/DeviceLibrary/ShuoKe/ShuoKeControls.cs
查看文件 @
6522a61
using
log4net
;
using
OnlineStore.Common
;
using
OnlineStore.LoadCSVLibrary
;
using
System
;
using
System.Collections.Generic
;
using
System.IO.Ports
;
...
...
@@ -241,6 +242,23 @@ namespace OnlineStore.DeviceLibrary
byte
[]
sendData
=
WriteData
(
slvAddr
,
ShuoKeCMD
.
HomeMove
,
0x01
,
homeType
);
Thread
.
Sleep
(
100
);
}
public
static
void
SetConfigSpeed
(
AUTO_SA_Config
Config
)
{
ShuoKeControls
.
SetSpeed
(
Config
.
CompressAxis_Slv
,
ShuoKeCMD
.
SetAddSpeed
,
Config
.
CompressAxis_AddSpeed
);
Thread
.
Sleep
(
60
);
ShuoKeControls
.
SetSpeed
(
Config
.
CompressAxis_Slv
,
ShuoKeCMD
.
SetDelSpeed
,
Config
.
CompressAxis_DelSpeed
);
Thread
.
Sleep
(
60
);
ShuoKeControls
.
SetSpeed
(
Config
.
CompressAxis_Slv
,
ShuoKeCMD
.
SetEndSpeed
,
Config
.
CompressAxis_EndSpeed
);
Thread
.
Sleep
(
60
);
ShuoKeControls
.
SetSpeed
(
Config
.
CompressAxis_Slv
,
ShuoKeCMD
.
SetHomeSpeed
,
Config
.
CompressAxis_HomeSpeed
);
Thread
.
Sleep
(
60
);
ShuoKeControls
.
SetSpeed
(
Config
.
CompressAxis_Slv
,
ShuoKeCMD
.
SetMaxSpeed
,
Config
.
CompressAxis_MaxSpeed
);
Thread
.
Sleep
(
60
);
ShuoKeControls
.
SetSpeed
(
Config
.
CompressAxis_Slv
,
ShuoKeCMD
.
SetStartSpeed
,
Config
.
CompressAxis_StartSpeed
);
}
public
static
void
VolMove
(
int
slvAddr
,
int
speed
)
{
byte
[]
sendData
=
WriteData
(
slvAddr
,
ShuoKeCMD
.
VolMove
,
0x04
,
speed
);
...
...
source/DeviceLibrary/StoreConfig/AC/StoreConfig.csv
查看文件 @
6522a61
...
...
@@ -11,8 +11,8 @@ DI,料盘宽度检测1,WidthCheck1,208,192.168.200.10,0,料盘宽度检测1,X09,DI-09,0,
DI,料盘宽度检测2,WidthCheck2,209,192.168.200.10,0,料盘宽度检测2,X10,DI-10,0,
DI,料盘检测1(上料机构),TrayCheck_LoadMaterial ,210,192.168.200.10,0,料盘检测1(上料机构),X11,DI-11,0,
DI,上料机构出料检测,OutCheck,211,192.168.200.10,0,上料机构出料检测,X12,DI-12,0,
DI,门锁气缸打开端,Door_Open,212,192.168.200.10,0,门锁气缸打开端,X13,DI-13,0,
DI,门锁气缸关闭端,Door_Close,213,192.168.200.10,0,门锁气缸关闭端,X14,DI-14,0,
DI,门锁气缸打开端,
Auto
Door_Open,212,192.168.200.10,0,门锁气缸打开端,X13,DI-13,0,
DI,门锁气缸关闭端,
Auto
Door_Close,213,192.168.200.10,0,门锁气缸关闭端,X14,DI-14,0,
DI,料盘检测2(料叉机构),TrayCheck_Fixture,214,192.168.200.10,0,料盘检测2(料叉机构),X15,DI-15,0,
DI,压紧机构计量检测,CompressAxis_Check,215,192.168.200.10,0,压紧机构计量检测,X16,DI-16,0,
DO,自动指示灯,AutoRun_HddLed,100,192.168.200.10,0,自动指示灯,Y01,DO-01,0,
...
...
@@ -27,8 +27,8 @@ DO,进料口门上升SOL,Door_Up,108,192.168.200.10,0,进料口门上升SOL,Y09,DO-09,0,
DO,进料口门下降SOL,Door_Down,109,192.168.200.10,0,进料口门下降SOL,Y10,DO-10,0,
DO,吸盘气缸上升SOL,SuckingDisc_Up,110,192.168.200.10,0,吸盘气缸上升SOL,Y11,DO-11,0,
DO,吸盘气缸下降SOL,SuckingDisc_Down,111,192.168.200.10,0,吸盘气缸下降SOL,Y12,DO-12,0,
DO,门锁气缸打开SOL,Door_Open,112,192.168.200.10,0,门锁气缸打开SOL,Y13,DO-13,0,
DO,门锁气缸关闭SOL,Door_Close,113,192.168.200.10,0,门锁气缸关闭SOL,Y14,DO-14,0,
DO,门锁气缸打开SOL,
Auto
Door_Open,112,192.168.200.10,0,门锁气缸打开SOL,Y13,DO-13,0,
DO,门锁气缸关闭SOL,
Auto
Door_Close,113,192.168.200.10,0,门锁气缸关闭SOL,Y14,DO-14,0,
,,,114,192.168.200.10,0,,Y15,DO-15,0,
,,,115,192.168.200.10,0,,Y16,DO-16,0,
DI,上料机构门关闭,DoorClose_LoadMaterial,200,192.168.200.11,0,上料机构门关闭,X17,DI-21,0,
...
...
@@ -125,11 +125,7 @@ PRO,硕科步进电机(压紧轴)控制减速度,CompressAxis_DelSpeed,15000,,,,,,,
PRO,硕科步进电机(压紧轴)控制归零速度(原点返回速度),CompressAxis_HomeSpeed,15000,,,,,,,
PRO,硕科步进电机轴地址(压紧轴),CompressAxis_Slv,1,,,,,, ,
,,,,,,,,,,
PRO,模拟量IO模块的IP地址,AIDevice_IP,192.168.200.12,,,,,,,
PRO,模拟信号1默认高度,AIDI1_DefaultPosition,2500,,,,,,,
PRO,模拟信号2默认高度,AIDI2_DefaultPosition,2500,,,,,,,
PRO,模拟信号3默认高度,AIDI3_DefaultPosition,2500,,,,,,,
PRO,(轴五)自动轴目标速度,AutoAxis_TargetSpeed,1000,,,,,,,
PRO,(轴五)自动轴目标速度,AutoAxis_TargetSpeed,50,,,,,,,
PRO,(轴五)自动轴加速度,AutoAxis_AddSpeed,300,,,,,,,
PRO,(轴五)自动轴减速度,AutoAxis_DelSpeed,300,,,,,,,
PRO,(轴五)自动轴原点低速,AutoAxis_HomeLowSpeed,20,,,,,,,
...
...
source/DeviceLibrary/acSingleStore/AC_SA_BoxBean.cs
查看文件 @
6522a61
...
...
@@ -14,7 +14,7 @@ namespace OnlineStore.DeviceLibrary
/// <summary>
/// 流水线自动料仓-Box类
/// </summary>
public
partial
class
AC_SA_BoxBean
:
KTK
_Store
public
partial
class
AC_SA_BoxBean
:
AC
_Store
{
private
static
bool
IsIntSlvBlock
=
false
;
/// <summary>
...
...
@@ -46,6 +46,11 @@ namespace OnlineStore.DeviceLibrary
private
System
.
Timers
.
Timer
IoCheckTimer
=
new
System
.
Timers
.
Timer
();
public
AC_SA_BoxBean
(
AUTO_SA_Config
config
)
{
StoreName
=
(
"料仓BOX_"
+
config
.
Id
+
" "
).
ToUpper
();
this
.
StoreID
=
config
.
Id
;
this
.
Config
=
config
;
this
.
DIList
=
config
.
StoreDIList
;
this
.
DOList
=
config
.
StoreDOList
;
Init
();
serverConnectTimer
=
new
System
.
Timers
.
Timer
();
serverConnectTimer
.
Interval
=
1000
;
...
...
@@ -63,11 +68,7 @@ namespace OnlineStore.DeviceLibrary
IsDebug
=
true
;
}
IsHasCompress_Axis
=
config
.
IsHasCompress_Axis
.
Equals
(
1
);
StoreName
=
(
"料仓BOX_"
+
config
.
Id
+
" "
).
ToUpper
();
this
.
StoreID
=
config
.
Id
;
this
.
Config
=
config
;
this
.
DIList
=
config
.
StoreDIList
;
this
.
DOList
=
config
.
StoreDOList
;
Max_Humidity
=
config
.
Max_Humidity
;
Max_Temperature
=
config
.
Max_Temperature
;
moveAxisList
=
new
List
<
ConfigMoveAxis
>();
...
...
@@ -93,9 +94,7 @@ namespace OnlineStore.DeviceLibrary
//初始化 //连接设备
KNDManager
.
ConnectionKND
(
Config
.
DIODeviceNameList
);
//KNDAIManager.ConnectionIP(Config.AIDevice_IP);
//scanSocket.OnScanRevice += onCodeReceived;
mainTimer
.
Enabled
=
false
;
int
isAuto
=
ConfigAppSettings
.
GetIntValue
(
Setting_Init
.
App_AutoRun
);
if
(
isAuto
==
1
)
...
...
@@ -105,9 +104,9 @@ namespace OnlineStore.DeviceLibrary
Thread
.
Sleep
(
300
);
//默认三个灯都亮
KNDIOMove
(
IO_Type
.
Alarm_HddLed
,
IO_VALUE
.
LOW
);
KNDIOMove
(
IO_Type
.
AutoRun_HddLed
,
IO_VALUE
.
LOW
);
KNDIOMove
(
IO_Type
.
RunSign_HddLed
,
IO_VALUE
.
LOW
);
KND
.
IOMove
(
IO_Type
.
Alarm_HddLed
,
IO_VALUE
.
LOW
);
KND
.
IOMove
(
IO_Type
.
AutoRun_HddLed
,
IO_VALUE
.
LOW
);
KND
.
IOMove
(
IO_Type
.
RunSign_HddLed
,
IO_VALUE
.
LOW
);
}
private
void
IoCheckTimer_Elapsed
(
object
sender
,
System
.
Timers
.
ElapsedEventArgs
e
)
...
...
@@ -115,7 +114,7 @@ namespace OnlineStore.DeviceLibrary
//判断急停
if
(
storeRunStatus
>=
StoreRunStatus
.
HomeMoving
)
{
if
(
KNDIOValue
(
IO_Type
.
SuddenStop_BTN
).
Equals
(
IO_VALUE
.
LOW
))
if
(
KND
.
IOValue
(
IO_Type
.
SuddenStop_BTN
).
Equals
(
IO_VALUE
.
LOW
))
{
if
(
isInSuddenDown
.
Equals
(
false
))
{
...
...
@@ -158,11 +157,12 @@ namespace OnlineStore.DeviceLibrary
/// </summary>
public
override
bool
StartRun
()
{
LogUtil
.
info
(
LOGGER
,
StoreName
+
"开始启动,启动时间:"
+
StartTime
.
ToString
());
runTimeWatch
.
Reset
();
LogUtil
.
info
(
LOGGER
,
StoreName
+
"开始启动,启动时间:"
+
DateTime
.
Now
.
ToLongTimeString
());
if
(
IsHasCompress_Axis
)
{
if
(
ShuoKeControls
.
isRun
==
false
&&
(!
Auto
StoreManager
.
OpenShuoKe
(
this
)))
if
(
ShuoKeControls
.
isRun
==
false
&&
(!
StoreManager
.
OpenShuoKe
(
this
)))
{
LogUtil
.
info
(
StoreName
+
"打开驱动器串口失败,启动失败!"
);
return
false
;
...
...
@@ -173,8 +173,8 @@ namespace OnlineStore.DeviceLibrary
alarmType
=
StoreAlarmType
.
None
;
//急停按钮和气压检测需要一起判断
IO_VALUE
suddenBtn
=
KNDIOValue
(
IO_Type
.
SuddenStop_BTN
);
IO_VALUE
airCheck
=
KNDIOValue
(
IO_Type
.
Airpressure_Check
);
IO_VALUE
suddenBtn
=
KND
.
IOValue
(
IO_Type
.
SuddenStop_BTN
);
IO_VALUE
airCheck
=
KND
.
IOValue
(
IO_Type
.
Airpressure_Check
);
//if (suddenBtn == IO_VALUE.HIGH)
if
(
suddenBtn
==
IO_VALUE
.
HIGH
&&
airCheck
==
IO_VALUE
.
HIGH
)
...
...
@@ -187,16 +187,9 @@ namespace OnlineStore.DeviceLibrary
}
//TODO 启动时先所有轴远点返回,测试暂时关闭
storeRunStatus
=
StoreRunStatus
.
HomeMoving
;
//启动温湿度服务器
//HumitureServer.StartTemperateServer(Config.TemperateServer_Port);
HumitureController
.
Init
(
Config
.
Humiture_Port
);
//Task.Factory.StartNew(delegate ()
//{
// HDevelopExport.OpenAllCamera();
//});
ReturnHome
();
StartTime
=
DateTime
.
Now
;
storeRunStatus
=
StoreRunStatus
.
HomeMoving
;
HumitureController
.
Init
(
Config
.
Humiture_Port
);
ReturnHome
();
mainTimer
.
Enabled
=
true
;
IoCheckTimer
.
Enabled
=
true
;
serverConnectTimer
.
Enabled
=
true
;
...
...
@@ -217,16 +210,16 @@ namespace OnlineStore.DeviceLibrary
}
}
#
region
原点返回和复位处理
private
void
ReturnHome
()
{
WarnMsg
=
""
;
CurrInOutACount
=
0
;
CurrInOutCount
=
0
;
KNDIOMove
(
IO_Type
.
Alarm_HddLed
,
IO_VALUE
.
LOW
);
KNDIOMove
(
IO_Type
.
AutoRun_HddLed
,
IO_VALUE
.
HIGH
);
KNDIOMove
(
IO_Type
.
RunSign_HddLed
,
IO_VALUE
.
LOW
);
KND
.
IOMove
(
IO_Type
.
Alarm_HddLed
,
IO_VALUE
.
LOW
);
KND
.
IOMove
(
IO_Type
.
AutoRun_HddLed
,
IO_VALUE
.
HIGH
);
KND
.
IOMove
(
IO_Type
.
RunSign_HddLed
,
IO_VALUE
.
LOW
);
storeRunStatus
=
StoreRunStatus
.
HomeMoving
;
StoreMove
.
NewMove
(
StoreMoveType
.
ReturnHome
);
...
...
@@ -234,23 +227,10 @@ namespace OnlineStore.DeviceLibrary
ACAxisHomeMove
(
Config
.
InOut_Axis
);
LogUtil
.
info
(
LOGGER
,
StoreName
+
"开始原点返回,先把进出轴回原点"
);
//设置速度
S
etShuokeSpeed
(
);
S
huoKeControls
.
SetConfigSpeed
(
Config
);
StoreMove
.
WaitList
.
Add
(
WaitResultInfo
.
WaitTime
(
2000
));
}
public
void
SetShuokeSpeed
()
{
ShuoKeControls
.
SetSpeed
(
Config
.
CompressAxis_Slv
,
ShuoKeCMD
.
SetAddSpeed
,
Config
.
CompressAxis_AddSpeed
);
Thread
.
Sleep
(
60
);
ShuoKeControls
.
SetSpeed
(
Config
.
CompressAxis_Slv
,
ShuoKeCMD
.
SetDelSpeed
,
Config
.
CompressAxis_DelSpeed
);
Thread
.
Sleep
(
60
);
ShuoKeControls
.
SetSpeed
(
Config
.
CompressAxis_Slv
,
ShuoKeCMD
.
SetEndSpeed
,
Config
.
CompressAxis_EndSpeed
);
Thread
.
Sleep
(
60
);
ShuoKeControls
.
SetSpeed
(
Config
.
CompressAxis_Slv
,
ShuoKeCMD
.
SetHomeSpeed
,
Config
.
CompressAxis_HomeSpeed
);
Thread
.
Sleep
(
60
);
ShuoKeControls
.
SetSpeed
(
Config
.
CompressAxis_Slv
,
ShuoKeCMD
.
SetMaxSpeed
,
Config
.
CompressAxis_MaxSpeed
);
Thread
.
Sleep
(
60
);
ShuoKeControls
.
SetSpeed
(
Config
.
CompressAxis_Slv
,
ShuoKeCMD
.
SetStartSpeed
,
Config
.
CompressAxis_StartSpeed
);
}
public
void
MoveToP1
()
{
//压紧轴回原点,叉子回到P1,关闭门旋转轴和升降轴回到P1
...
...
@@ -274,22 +254,16 @@ namespace OnlineStore.DeviceLibrary
CurrInOutCount
=
0
;
CurrInOutACount
=
0
;
KNDIOMove
(
IO_Type
.
Alarm_HddLed
,
IO_VALUE
.
LOW
);
KNDIOMove
(
IO_Type
.
AutoRun_HddLed
,
IO_VALUE
.
HIGH
);
KNDIOMove
(
IO_Type
.
RunSign_HddLed
,
IO_VALUE
.
LOW
);
KND
.
IOMove
(
IO_Type
.
Alarm_HddLed
,
IO_VALUE
.
LOW
);
KND
.
IOMove
(
IO_Type
.
AutoRun_HddLed
,
IO_VALUE
.
HIGH
);
KND
.
IOMove
(
IO_Type
.
RunSign_HddLed
,
IO_VALUE
.
LOW
);
//复位之前先停止运行
if
(
isNeedClearAuto
)
{
autoNext
=
false
;
}
//Task.Factory.StartNew(delegate ()
//{
// HDevelopExport.OpenAllCamera();
//});
ACServerManager
.
SuddenStop
(
Config
.
Middle_Axis
.
DeviceName
,
Config
.
Middle_Axis
.
GetAxisValue
());
ACServerManager
.
SuddenStop
(
Config
.
UpDown_Axis
.
DeviceName
,
Config
.
UpDown_Axis
.
GetAxisValue
());
ACServerManager
.
SuddenStop
(
Config
.
InOut_Axis
.
DeviceName
,
Config
.
InOut_Axis
.
GetAxisValue
());
AxisSuddenStop
();
isInSuddenDown
=
false
;
isNoAirCheck
=
false
;
alarmType
=
StoreAlarmType
.
None
;
...
...
@@ -298,9 +272,7 @@ namespace OnlineStore.DeviceLibrary
StoreMove
.
NewMove
(
StoreMoveType
.
StoreReset
);
WarnMsg
=
""
;
if
(!
RunAxis
(
true
))
////打开四个轴
//if (!OpenAllAxis())
if
(!
RunAxis
(
true
))
{
LogUtil
.
info
(
LOGGER
,
StoreName
+
"复位时打开轴失败,需要再次复位,直接报警停止复位"
);
return
;
...
...
@@ -309,7 +281,7 @@ namespace OnlineStore.DeviceLibrary
{
InoutStartReset
();
//硕科压紧轴回原点
S
etShuokeSpeed
(
);
S
huoKeControls
.
SetConfigSpeed
(
Config
);
}
else
{
...
...
@@ -356,11 +328,7 @@ namespace OnlineStore.DeviceLibrary
}
switch
(
StoreMove
.
MoveStep
)
{
case
StoreMoveStep
.
BOX_H_LocationCylinderBack
:
//StoreMove.NextMoveStep(StoreMoveStep.BOX_H_InOutBack);
//ACAxisHomeMove(Config.InOut_Axis);
//LogUtil.info(LOGGER, StoreName + "复位中:进出轴回原点。。");
//StoreMove.WaitList.Add(WaitResultInfo.WaitTime(2000));
case
StoreMoveStep
.
BOX_H_LocationCylinderBack
:
InoutStartReset
();
break
;
case
StoreMoveStep
.
BOX_H_InOutMove
:
...
...
@@ -373,8 +341,7 @@ namespace OnlineStore.DeviceLibrary
Thread
.
Sleep
(
200
);
StoreMove
.
NextMoveStep
(
StoreMoveStep
.
BOX_H_InOutToP1
);
LogUtil
.
info
(
LOGGER
,
StoreName
+
"复位中:进出轴到待机点P1,关闭舱门"
);
//进出轴原点返回完成,将进出轴的位置设置=0
AxisCountClear
(
Config
.
InOut_Axis
);
ACAxisMove
(
Config
.
InOut_Axis
,
Config
.
InOutAxis_P1_Position
,
Config
.
InOutAxis_P1_Speed
);
//判断叉子没有料盘
//StoreMove.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.TrayCheck_Fixture, IO_VALUE.LOW));
...
...
@@ -457,20 +424,19 @@ namespace OnlineStore.DeviceLibrary
StoreMove
.
WaitList
.
Add
(
WaitResultInfo
.
WaitShuoKe
(
Config
.
CompressAxis_Slv
,
targetPosition
,
false
));
ShuoKeControls
.
AbsMove
(
Config
.
CompressAxis_Slv
,
targetPosition
);
Thread
.
Sleep
(
100
);
}
}
}
private
void
OpenDoorAndWait
()
{
KNDIOMove
(
IO_Type
.
Door_Down
,
IO_VALUE
.
LOW
);
KNDIOMove
(
IO_Type
.
Door_Up
,
IO_VALUE
.
HIGH
);
KND
.
IOMove
(
IO_Type
.
Door_Down
,
IO_VALUE
.
LOW
);
KND
.
IOMove
(
IO_Type
.
Door_Up
,
IO_VALUE
.
HIGH
);
StoreMove
.
WaitList
.
Add
(
WaitResultInfo
.
WaitIO
(
IO_Type
.
Door_Down
,
IO_VALUE
.
LOW
));
StoreMove
.
WaitList
.
Add
(
WaitResultInfo
.
WaitIO
(
IO_Type
.
Door_Up
,
IO_VALUE
.
HIGH
));
}
private
void
CloseDoorAndWait
()
{
KNDIOMove
(
IO_Type
.
Door_Down
,
IO_VALUE
.
HIGH
);
KNDIOMove
(
IO_Type
.
Door_Up
,
IO_VALUE
.
LOW
);
KND
.
IOMove
(
IO_Type
.
Door_Down
,
IO_VALUE
.
HIGH
);
KND
.
IOMove
(
IO_Type
.
Door_Up
,
IO_VALUE
.
LOW
);
StoreMove
.
WaitList
.
Add
(
WaitResultInfo
.
WaitIO
(
IO_Type
.
Door_Down
,
IO_VALUE
.
HIGH
));
StoreMove
.
WaitList
.
Add
(
WaitResultInfo
.
WaitIO
(
IO_Type
.
Door_Up
,
IO_VALUE
.
LOW
));
}
...
...
@@ -501,8 +467,7 @@ namespace OnlineStore.DeviceLibrary
Thread
.
Sleep
(
200
);
StoreMove
.
NextMoveStep
(
StoreMoveStep
.
BOX_H_InOutToP1
);
LogUtil
.
info
(
LOGGER
,
StoreName
+
"原点返回中,进出轴退回P1点,关闭仓门,检测叉子没有料盘"
);
//进出轴原点返回完成,将进出轴的位置设置=0
AxisCountClear
(
Config
.
InOut_Axis
);
ACAxisMove
(
Config
.
InOut_Axis
,
Config
.
InOutAxis_P1_Position
,
Config
.
InOutAxis_P1_Speed
);
//判断叉子没有料盘
//StoreMove.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.TrayCheck_Fixture, IO_VALUE.LOW));
...
...
@@ -549,7 +514,7 @@ namespace OnlineStore.DeviceLibrary
public
bool
RunAxis
(
bool
isCheck
)
{
KNDIOMove
(
IO_Type
.
Run_Sign
,
IO_VALUE
.
HIGH
);
KND
.
IOMove
(
IO_Type
.
Run_Sign
,
IO_VALUE
.
HIGH
);
Thread
.
Sleep
(
1000
);
//打开所有轴
foreach
(
ConfigMoveAxis
moveAxis
in
moveAxisList
)
...
...
@@ -579,7 +544,7 @@ namespace OnlineStore.DeviceLibrary
}
}
IsIntSlvBlock
=
true
;
KNDIOMove
(
IO_Type
.
Axis_Brake
,
IO_VALUE
.
HIGH
);
KND
.
IOMove
(
IO_Type
.
Axis_Brake
,
IO_VALUE
.
HIGH
);
return
true
;
}
/// <summary>
...
...
@@ -624,7 +589,7 @@ namespace OnlineStore.DeviceLibrary
public
void
CloseAllAxis
()
{
LogUtil
.
info
(
StoreName
+
"关闭刹车,关闭伺服"
);
KNDIOMove
(
IO_Type
.
Axis_Brake
,
IO_VALUE
.
LOW
);
KND
.
IOMove
(
IO_Type
.
Axis_Brake
,
IO_VALUE
.
LOW
);
foreach
(
ConfigMoveAxis
axis
in
moveAxisList
)
{
ACServerManager
.
ServoOff
(
axis
.
DeviceName
,
axis
.
GetAxisValue
());
...
...
@@ -632,10 +597,10 @@ namespace OnlineStore.DeviceLibrary
ACServerManager
.
ColsePort
(
axis
.
DeviceName
);
}
Thread
.
Sleep
(
100
);
KNDIOMove
(
IO_Type
.
Run_Sign
,
IO_VALUE
.
LOW
);
KND
.
IOMove
(
IO_Type
.
Run_Sign
,
IO_VALUE
.
LOW
);
}
p
rivate
int
GetAlarmCodeByAxis
(
ConfigMoveAxis
axis
)
p
ublic
int
GetAlarmCodeByAxis
(
ConfigMoveAxis
axis
)
{
int
alarmCode
=
LineAlarm
.
InOutAxisAlarm
;
int
axisType
=
axis
.
GetAxisValue
()
%
4
;
...
...
@@ -650,6 +615,9 @@ namespace OnlineStore.DeviceLibrary
else
if
(
axisType
==
3
)
{
alarmCode
=
LineAlarm
.
InOutAxisAlarm
;
}
else
if
(
axisType
==
4
)
{
alarmCode
=
LineAlarm
.
AutoAxisAlarm
;
}
else
{
...
...
@@ -671,18 +639,17 @@ namespace OnlineStore.DeviceLibrary
storeRunStatus
=
StoreRunStatus
.
Wait
;
mainTimer
.
Enabled
=
false
;
TimeSpan
span
=
DateTime
.
Now
-
StartTime
;
IsRun
=
false
;
KNDManager
.
CloseAllDO
();
if
(
IsHasCompress_Axis
)
{
ShuoKeControls
.
ClosePort
();
}
//HDevelopExport.CloseAllCamera();
HumitureServer
.
StopTemperateServer
();
LogUtil
.
info
(
LOGGER
,
StoreName
+
",停止运行,总运行时间:"
+
span
.
ToString
());
}
HumitureController
.
Release
();
StoreManager
.
CurrInOutType
=
0
;
LogUtil
.
info
(
LOGGER
,
StoreName
+
",停止运行,总运行时间:"
+
runTimeWatch
.
Elapsed
.
ToString
());
}
public
override
void
Alarm
(
StoreAlarmType
alarmType
,
string
alarmDetial
,
string
alarmMsg
,
StoreMoveType
storeMoveType
)
...
...
@@ -700,14 +667,14 @@ namespace OnlineStore.DeviceLibrary
if
(
alarmType
.
Equals
(
StoreAlarmType
.
AxisAlarm
)
|
alarmType
.
Equals
(
StoreAlarmType
.
AxisMoveError
))
{
LogUtil
.
error
(
LOGGER
,
StoreName
+
"轴报警,关闭刹车,停止运动,关闭轴,打开报警灯"
);
KNDIOMove
(
IO_Type
.
Axis_Brake
,
IO_VALUE
.
LOW
);
KND
.
IOMove
(
IO_Type
.
Axis_Brake
,
IO_VALUE
.
LOW
);
StopMove
(
true
);
}
else
if
(
alarmType
==
StoreAlarmType
.
SuddenStop
)
{
isInSuddenDown
=
true
;
LogUtil
.
error
(
LOGGER
,
StoreName
+
"收到急停信号,关闭刹车,停止运动,关闭轴,打开报警灯 "
);
KNDIOMove
(
IO_Type
.
Axis_Brake
,
IO_VALUE
.
LOW
);
KND
.
IOMove
(
IO_Type
.
Axis_Brake
,
IO_VALUE
.
LOW
);
StoreMove
.
EndMove
();
StopMove
(
true
);
storeStatus
=
StoreStatus
.
SuddenStop
;
...
...
@@ -716,15 +683,11 @@ namespace OnlineStore.DeviceLibrary
{
isNoAirCheck
=
true
;
LogUtil
.
error
(
LOGGER
,
StoreName
+
" 未检测到气压信号 ,打开刹车,停止运动,关闭轴,打开报警灯 "
);
KNDIOMove
(
IO_Type
.
Axis_Brake
,
IO_VALUE
.
LOW
);
KND
.
IOMove
(
IO_Type
.
Axis_Brake
,
IO_VALUE
.
LOW
);
StoreMove
.
EndMove
();
StopMove
(
true
);
storeStatus
=
StoreStatus
.
SuddenStop
;
}
//if (alarmType != StoreAlarmType.IoSingleTimeOut)
//{
// StopMove();
//}
}
private
bool
InProcess
=
false
;
//private DateTime preProcessTime = DateTime.Now;
...
...
@@ -761,6 +724,7 @@ namespace OnlineStore.DeviceLibrary
CheckAxisAlarm
();
ShowTimeLog
(
"轴报警检测完成"
);
}
AutomaticBaiting
.
TimerProcess
();
}
catch
(
Exception
ex
)
{
...
...
@@ -775,72 +739,7 @@ namespace OnlineStore.DeviceLibrary
{
LogUtil
.
info
(
"【"
+
info
+
"】 处理完成,耗时:"
+
stopwatch
.
Elapsed
.
ToString
());
}
}
//private void LedProcess()
//{
//try
//{
// DateTime time = DateTime.Now;
// //黄灯
// if (IsNotScanCode || storeRunStatus.Equals(StoreRunStatus.HomeMoving) || storeRunStatus.Equals(StoreRunStatus.Reset))
// {
// //开机执行中时黄灯闪烁
// if (KNDIOValue(IO_Type.RunSign_HddLed).Equals(IO_VALUE.HIGH))
// {
// KNDIOMove(IO_Type.RunSign_HddLed, IO_VALUE.LOW);
// }
// else
// {
// KNDIOMove(IO_Type.RunSign_HddLed, IO_VALUE.HIGH);
// }
// }
// else
// {
// if (KNDIOValue(IO_Type.RunSign_HddLed).Equals(IO_VALUE.HIGH))
// {
// KNDIOMove(IO_Type.RunSign_HddLed, IO_VALUE.LOW);
// }
// }
// //路灯亮
// //出入库执行中,绿灯闪烁
// if ((StoreMove.MoveType.Equals(StoreMoveType.InStore) || StoreMove.MoveType.Equals(StoreMoveType.OutStore)) && KNDIOValue(IO_Type.AutoRun_HddLed).Equals(IO_VALUE.HIGH))
// {
// KNDIOMove(IO_Type.AutoRun_HddLed, IO_VALUE.LOW);
// }
// else
// {
// if (KNDIOValue(IO_Type.AutoRun_HddLed).Equals(IO_VALUE.LOW))
// {
// KNDIOMove(IO_Type.AutoRun_HddLed, IO_VALUE.HIGH);
// }
// }
// bool isNeedAlarmLed = false;
// //报警灯
// if (!alarmType.Equals(StoreAlarmType.None) || isNoAirCheck || isInSuddenDown)
// {
// isNeedAlarmLed = true;
// }
// if (isNeedAlarmLed)
// {
// if (KNDIOValue(IO_Type.Alarm_HddLed).Equals(IO_VALUE.LOW))
// {
// KNDIOMove(IO_Type.Alarm_HddLed, IO_VALUE.HIGH);
// }
// }
// else
// {
// if (KNDIOValue(IO_Type.Alarm_HddLed).Equals(IO_VALUE.HIGH))
// {
// KNDIOMove(IO_Type.Alarm_HddLed, IO_VALUE.LOW);
// }
// }
//}
//catch (Exception ex)
//{
// LOGGER.Error(StoreName + "灯处理定时器出错:", ex);
//}
//}
}
private
void
LedProcess
()
{
try
...
...
@@ -871,47 +770,47 @@ namespace OnlineStore.DeviceLibrary
{
isNeedAlarmLed
=
true
;
}
if
(
isNeedAlarmLed
&&
KNDIOValue
(
IO_Type
.
Alarm_HddLed
).
Equals
(
IO_VALUE
.
LOW
))
if
(
isNeedAlarmLed
&&
KND
.
IOValue
(
IO_Type
.
Alarm_HddLed
).
Equals
(
IO_VALUE
.
LOW
))
{
KNDIOMove
(
IO_Type
.
Alarm_HddLed
,
IO_VALUE
.
HIGH
);
KND
.
IOMove
(
IO_Type
.
Alarm_HddLed
,
IO_VALUE
.
HIGH
);
}
else
{
if
(
KNDIOValue
(
IO_Type
.
Alarm_HddLed
).
Equals
(
IO_VALUE
.
HIGH
))
if
(
KND
.
IOValue
(
IO_Type
.
Alarm_HddLed
).
Equals
(
IO_VALUE
.
HIGH
))
{
KNDIOMove
(
IO_Type
.
Alarm_HddLed
,
IO_VALUE
.
LOW
);
KND
.
IOMove
(
IO_Type
.
Alarm_HddLed
,
IO_VALUE
.
LOW
);
}
}
//绿灯闪
if
((
StoreMove
.
MoveType
.
Equals
(
StoreMoveType
.
InStore
)
||
StoreMove
.
MoveType
.
Equals
(
StoreMoveType
.
OutStore
)
||
storeRunStatus
.
Equals
(
StoreRunStatus
.
HomeMoving
)
||
storeRunStatus
.
Equals
(
StoreRunStatus
.
Reset
))
&&
KNDIOValue
(
IO_Type
.
AutoRun_HddLed
).
Equals
(
IO_VALUE
.
HIGH
))
&&
KND
.
IOValue
(
IO_Type
.
AutoRun_HddLed
).
Equals
(
IO_VALUE
.
HIGH
))
{
KNDIOMove
(
IO_Type
.
AutoRun_HddLed
,
IO_VALUE
.
LOW
);
KND
.
IOMove
(
IO_Type
.
AutoRun_HddLed
,
IO_VALUE
.
LOW
);
}
else
{
//绿灯亮
KNDIOMove
(
IO_Type
.
AutoRun_HddLed
,
IO_VALUE
.
HIGH
);
KND
.
IOMove
(
IO_Type
.
AutoRun_HddLed
,
IO_VALUE
.
HIGH
);
}
//黄灯
if
(
StoreMove
.
MoveType
.
Equals
(
StoreMoveType
.
InStore
)
||
StoreMove
.
MoveType
.
Equals
(
StoreMoveType
.
OutStore
)
||
TempOrHumidityIsAlarm
||
isTemp30M
)
{
if
(
KNDIOValue
(
IO_Type
.
RunSign_HddLed
).
Equals
(
IO_VALUE
.
HIGH
))
if
(
KND
.
IOValue
(
IO_Type
.
RunSign_HddLed
).
Equals
(
IO_VALUE
.
HIGH
))
{
KNDIOMove
(
IO_Type
.
RunSign_HddLed
,
IO_VALUE
.
LOW
);
KND
.
IOMove
(
IO_Type
.
RunSign_HddLed
,
IO_VALUE
.
LOW
);
}
else
{
KNDIOMove
(
IO_Type
.
RunSign_HddLed
,
IO_VALUE
.
HIGH
);
KND
.
IOMove
(
IO_Type
.
RunSign_HddLed
,
IO_VALUE
.
HIGH
);
}
}
else
{
if
(
KNDIOValue
(
IO_Type
.
RunSign_HddLed
).
Equals
(
IO_VALUE
.
HIGH
))
if
(
KND
.
IOValue
(
IO_Type
.
RunSign_HddLed
).
Equals
(
IO_VALUE
.
HIGH
))
{
KNDIOMove
(
IO_Type
.
RunSign_HddLed
,
IO_VALUE
.
LOW
);
KND
.
IOMove
(
IO_Type
.
RunSign_HddLed
,
IO_VALUE
.
LOW
);
}
}
}
...
...
@@ -928,7 +827,7 @@ namespace OnlineStore.DeviceLibrary
if
(
storeRunStatus
.
Equals
(
StoreRunStatus
.
Wait
))
{
//取新的Io状态
IO_VALUE
autoSingle
=
KNDIOValue
(
IO_Type
.
AutoRun_Single
);
IO_VALUE
autoSingle
=
KND
.
IOValue
(
IO_Type
.
AutoRun_Single
);
if
(
ConfigAppSettings
.
GetIntValue
(
Setting_Init
.
App_AutoRun
)
.
Equals
(
1
))
{
if
(
autoSingle
.
Equals
(
IO_VALUE
.
HIGH
)
&&
lastAutoRun
.
Equals
(
IO_VALUE
.
LOW
))
...
...
@@ -955,8 +854,8 @@ namespace OnlineStore.DeviceLibrary
else
if
(
storeRunStatus
>=
StoreRunStatus
.
HomeMoving
)
{
//取新的Io状态
IO_VALUE
suddenBtn
=
KNDIOValue
(
IO_Type
.
SuddenStop_BTN
);
IO_VALUE
resetBtn
=
KNDIOValue
(
IO_Type
.
Reset_BTN
);
IO_VALUE
suddenBtn
=
KND
.
IOValue
(
IO_Type
.
SuddenStop_BTN
);
IO_VALUE
resetBtn
=
KND
.
IOValue
(
IO_Type
.
Reset_BTN
);
//急停按钮
if
(
suddenBtn
.
Equals
(
IO_VALUE
.
LOW
))
...
...
@@ -1017,7 +916,7 @@ namespace OnlineStore.DeviceLibrary
try
{
//遮挡光栅信号
if
(
KNDIOValue
(
IO_Type
.
SafetyLightCurtains
).
Equals
(
IO_VALUE
.
LOW
))
if
(
KND
.
IOValue
(
IO_Type
.
SafetyLightCurtains
).
Equals
(
IO_VALUE
.
LOW
))
{
if
(
NeedCheckSafetyLight
.
Equals
(
1
))
{
...
...
@@ -1074,54 +973,54 @@ namespace OnlineStore.DeviceLibrary
}
else
if
(
storeRunStatus
.
Equals
(
StoreRunStatus
.
Runing
))
{
//判断是否需要出入库
if
(
StoreMove
.
MoveType
.
Equals
(
StoreMoveType
.
None
)&&
alarmType
.
Equals
(
StoreAlarmType
.
None
))
{
IO_VALUE
checkIO
=
KND
IOValue
(
IO_Type
.
TrayCheck_Door
);
//判断料门口是否有料
if
((
checkIO
.
Equals
(
IO_VALUE
.
HIGH
))&&
GetHeight
()>
0
)
{
if
(
IsScanCode
)
{
return
;
}
//检测到料盘,等待1.5秒后扫码
if
(
isWaitScan
)
{
TimeSpan
span
=
DateTime
.
Now
-
StartWaitScanTime
;
if
(
span
.
TotalSeconds
>
1
)
{
isWaitScan
=
false
;
IsScanCode
=
true
;
//
//
判断是否需要出入库
//
if (StoreMove.MoveType.Equals(StoreMoveType.None)&&alarmType.Equals(StoreAlarmType.None))
//
{
// IO_VALUE checkIO = KND.
IOValue(IO_Type.TrayCheck_Door);
//
//判断料门口是否有料
// if ((checkIO.Equals(IO_VALUE.HIGH))&&
GetHeight()>0)
//
{
//
if (IsScanCode)
//
{
//
return;
//
}
//
//检测到料盘,等待1.5秒后扫码
//
if (isWaitScan)
//
{
//
TimeSpan span = DateTime.Now - StartWaitScanTime;
//
if (span.TotalSeconds > 1)
//
{
//
isWaitScan = false;
//
IsScanCode = true;
//BeginScannering();
//判断料盘尺寸
if
(
GetSize
()<=
7
)
{
LogUtil
.
info
(
StoreName
+
"检测到寸料盘,开始扫码"
);
GetCameraCode
();
}
else
{
LogUtil
.
info
(
StoreName
+
"检测到大于7寸的料盘,请放入正确的料盘"
);
IsScanCode
=
false
;
}
}
}
else
{
isWaitScan
=
true
;
StartWaitScanTime
=
DateTime
.
Now
;
}
}
else
{
isWaitScan
=
false
;
}
}
//
//BeginScannering();
//
//判断料盘尺寸
//
if (GetSize()<=7)
//
{
//
LogUtil.info(StoreName + "检测到寸料盘,开始扫码");
//
GetCameraCode();
//
}
//
else
//
{
//
LogUtil.info(StoreName + "检测到大于7寸的料盘,请放入正确的料盘");
//
IsScanCode = false ;
//
}
//
}
//
}
//
else
//
{
//
isWaitScan = true;
//
StartWaitScanTime = DateTime.Now;
//
}
//
}
//
else
//
{
//
isWaitScan = false;
//
}
//
}
ShowTimeLog
(
"判断是否需要出入库"
);
//
ShowTimeLog("判断是否需要出入库");
AutoResetProcess
();
ShowTimeLog
(
"AutoResetProcess"
);
IOTimeOutProcess
();
...
...
@@ -1135,10 +1034,6 @@ namespace OnlineStore.DeviceLibrary
}
}
//private void BeginScannering()
//{
// scanSocket.BeginScannering();
//}
private
DateTime
preIoTimerOutTime
=
DateTime
.
Now
;
/// <summary>
...
...
@@ -1242,7 +1137,7 @@ namespace OnlineStore.DeviceLibrary
/// </summary>
/// <returns></returns>
private
DateTime
checkAlarmTime
=
DateTime
.
Now
;
p
ublic
bool
CheckAxisAlarm
()
p
rivate
bool
CheckAxisAlarm
()
{
if
(
alarmType
.
Equals
(
StoreAlarmType
.
AxisAlarm
)
||
alarmType
.
Equals
(
StoreAlarmType
.
AxisMoveError
))
{
...
...
@@ -1297,16 +1192,16 @@ namespace OnlineStore.DeviceLibrary
//判断报警状态
return
isInAlarm
;
}
/// <summary>
/// 停止所有运行
/// </summary>
public
override
void
StopMove
(
bool
IsCloseAxis
)
public
void
AxisSuddenStop
()
{
//运动版停止
ACServerManager
.
SuddenStop
(
Config
.
Middle_Axis
.
DeviceName
,
Config
.
Middle_Axis
.
GetAxisValue
());
ACServerManager
.
SuddenStop
(
Config
.
UpDown_Axis
.
DeviceName
,
Config
.
UpDown_Axis
.
GetAxisValue
());
ACServerManager
.
SuddenStop
(
Config
.
InOut_Axis
.
DeviceName
,
Config
.
InOut_Axis
.
GetAxisValue
());
ACServerManager
.
SuddenStop
(
Config
.
Auto_Axis
.
DeviceName
,
Config
.
Auto_Axis
.
GetAxisValue
());
}
public
override
void
StopMove
(
bool
IsCloseAxis
)
{
AxisSuddenStop
();
if
(
IsHasCompress_Axis
)
{
ShuoKeControls
.
SuddownStop
(
Config
.
CompressAxis_Slv
);
...
...
@@ -1316,8 +1211,8 @@ namespace OnlineStore.DeviceLibrary
if
(
Config
.
IsHasLocationCylinder
>=
1
)
{
//定位气缸停止
KNDIOMove
(
IO_Type
.
LocationCylinder_Down
,
IO_VALUE
.
LOW
);
KNDIOMove
(
IO_Type
.
LocationCylinder_Up
,
IO_VALUE
.
LOW
);
KND
.
IOMove
(
IO_Type
.
LocationCylinder_Down
,
IO_VALUE
.
LOW
);
KND
.
IOMove
(
IO_Type
.
LocationCylinder_Up
,
IO_VALUE
.
LOW
);
}
}
if
(
IsCloseAxis
)
...
...
@@ -1325,8 +1220,8 @@ namespace OnlineStore.DeviceLibrary
CloseAllAxis
();
}
LogUtil
.
info
(
LOGGER
,
StoreName
+
"StopMove"
);
KNDIOMove
(
IO_Type
.
Door_Down
,
IO_VALUE
.
LOW
);
KNDIOMove
(
IO_Type
.
Door_Up
,
IO_VALUE
.
LOW
);
KND
.
IOMove
(
IO_Type
.
Door_Down
,
IO_VALUE
.
LOW
);
KND
.
IOMove
(
IO_Type
.
Door_Up
,
IO_VALUE
.
LOW
);
//HDevelopExport.CloseAllCamera();
isInPro
=
false
;
}
...
...
@@ -1358,7 +1253,7 @@ namespace OnlineStore.DeviceLibrary
/// 扫码枪数据接收
/// </summary>
/// <param name="message"></param>
p
rivate
void
onCodeReceived
(
string
message
)
p
ublic
void
onCodeReceived
(
string
message
)
{
try
{
...
...
@@ -1386,7 +1281,7 @@ namespace OnlineStore.DeviceLibrary
operation
.
op
=
1
;
operation
.
data
=
new
Dictionary
<
string
,
string
>()
{
{
"code"
,
message
},
{
"boxId"
,
StoreID
.
ToString
()
}
};
string
server
=
ConfigAppSettings
.
GetValue
(
Setting_Init
.
http_server
);
Operation
resultOperation
=
HttpHelper
.
Post
(
Auto
StoreManager
.
GetPostApi
(
server
),
operation
,
false
);
Operation
resultOperation
=
HttpHelper
.
Post
(
StoreManager
.
GetPostApi
(
server
),
operation
,
false
);
if
(
resultOperation
==
null
)
{
// CodeMsg = "二维码【" + message + "】没有收到服务器反馈";
...
...
@@ -1456,123 +1351,6 @@ namespace OnlineStore.DeviceLibrary
#
endregion
#
region
Halcon
扫码枪代码
public
bool
IsTestCamera
=
false
;
private
System
.
Timers
.
Timer
scanTimer
=
null
;
public
void
GetCameraCode
()
{
if
(
IsTestCamera
&&
IsInScan
())
{
LogUtil
.
info
(
"上次扫码还未执行完毕,请稍后!"
);
return
;
}
if
(
scanTimer
==
null
)
{
scanTimer
=
new
System
.
Timers
.
Timer
();
scanTimer
.
Interval
=
10
;
scanTimer
.
AutoReset
=
false
;
scanTimer
.
Enabled
=
false
;
scanTimer
.
Elapsed
+=
scanTimer_Elapsed
;
}
scanTimer
.
Enabled
=
true
;
}
private
string
spiltStr
=
"##"
;
private
void
scanTimer_Elapsed
(
object
sender
,
System
.
Timers
.
ElapsedEventArgs
e
)
{
int
height
=
GetHeight
();
DateTime
date
=
DateTime
.
Now
;
scanTimer
.
Enabled
=
false
;
KNDIOMove
(
IO_Type
.
CameraLight_Power
,
IO_VALUE
.
HIGH
);
string
outMsg
=
""
;
string
message
=
""
;
//List<string> codeList = HDevelopExport.CameraScan(out outMsg);
////= 1 + 123.4x100.5 - 7x12 = CODE
//foreach (string str in codeList)
//{
// string code = HDevelopExport.SubStrCode(str);
// code = "=1+0x0-7x" + height + " =" + code;
// message = message + code + spiltStr;
//}
List
<
string
>
codeList
=
CodeManager
.
CameraScan
();
foreach
(
string
str
in
codeList
)
{
message
=
message
+
"=1+0x0-7x"
+
height
+
" ="
+
str
+
spiltStr
;
}
if
(!
outMsg
.
Equals
(
""
))
{
CodeMsg
=
"盘尺寸错误,清理二维码【"
+
message
+
"】"
;
LogUtil
.
error
(
"盘尺寸错误,清理二维码【"
+
message
+
"】"
);
message
=
""
;
}
KNDIOMove
(
IO_Type
.
CameraLight_Power
,
IO_VALUE
.
LOW
);
onCodeReceived
(
message
);
}
private
DateTime
LastScanTime
=
DateTime
.
Now
;
private
bool
IsInScan
()
{
if
(!
IsScanCode
)
{
return
false
;
}
TimeSpan
span
=
DateTime
.
Now
-
LastScanTime
;
if
(
span
.
TotalSeconds
>
60
)
{
//大于60秒表示超时了,可以重新开始扫码
return
false
;
}
return
true
;
}
#
endregion
#
region
高度传感器处理
public
int
GetSize
()
{
return
7
;
//double ai1Value = KNDAIManager.ConvertAI(KNDAIManager.GetAIValue(Config.AIDevice_IP, 1), Config.AIDI1_DefaultPosition);
//double ai2Value = KNDAIManager.ConvertAI(KNDAIManager.GetAIValue(Config.AIDevice_IP, 2), Config.AIDI2_DefaultPosition);
//double ai3Value = KNDAIManager.ConvertAI(KNDAIManager.GetAIValue(Config.AIDevice_IP, 3), Config.AIDI3_DefaultPosition);
//if (ai1Value > 14 && ai2Value > 14 && ai3Value > 14)
//{
// return 13;
//}
//return 7;
}
public
int
GetHeight
()
{
int
result
=
0
;
//double ai1Value = KNDAIManager.ConvertAI(KNDAIManager.GetAIValue(Config.AIDevice_IP, 1), Config.AIDI1_DefaultPosition);
//double ai2Value = KNDAIManager.ConvertAI(KNDAIManager.GetAIValue(Config.AIDevice_IP, 2), Config.AIDI2_DefaultPosition);
//double ai3Value = KNDAIManager.ConvertAI(KNDAIManager.GetAIValue(Config.AIDevice_IP, 3), Config.AIDI3_DefaultPosition);
//double Value = Math.Round((ai1Value + ai2Value + ai3Value) / 3, 1);
//if (Value > 14)
//{
// result = 16;
//}
//else if (Value >= 10)
//{
// result = 12;
//}
//else if (Value >= 4)
//{
// result = 8;
//}
//else
//{
// result = 0;
//}
return
result
;
}
#
endregion
#
region
温湿度处理
/// <summary>
/// 湿度标准,超过后需要报警
...
...
@@ -1628,7 +1406,7 @@ namespace OnlineStore.DeviceLibrary
LOGGER
.
Info
(
"当前最大湿度:"
+
currMaxHumidity
.
ToString
()
+
",开始吹气湿度:"
+
startBlowHumidity
+
",当前不在吹气中,且间隔超过"
+
Config
.
BlowAir_Interval
+
"分钟,开始吹气!"
);
IsInBlowing
=
true
;
//Thread.Sleep(100);
KNDIOMove
(
IO_Type
.
StartOrStopBlow
,
IO_VALUE
.
HIGH
);
KND
.
IOMove
(
IO_Type
.
StartOrStopBlow
,
IO_VALUE
.
HIGH
);
LastBeginBlowTime
=
DateTime
.
Now
;
LastEndBlowTime
=
DateTime
.
Now
;
}
...
...
@@ -1639,7 +1417,7 @@ namespace OnlineStore.DeviceLibrary
LOGGER
.
Info
(
"当前最大湿度:"
+
currMaxHumidity
.
ToString
()
+
",停止吹气湿度:"
+
stopBlowHumidity
+
",停止吹气!"
);
IsInBlowing
=
false
;
//Thread.Sleep(100);
KNDIOMove
(
IO_Type
.
StartOrStopBlow
,
IO_VALUE
.
LOW
);
KND
.
IOMove
(
IO_Type
.
StartOrStopBlow
,
IO_VALUE
.
LOW
);
LastEndBlowTime
=
DateTime
.
Now
;
}
if
(
IsInBlowing
)
...
...
@@ -1651,7 +1429,7 @@ namespace OnlineStore.DeviceLibrary
LOGGER
.
Info
(
"已经吹气"
+
span
.
TotalMinutes
+
"分钟,超过配置的吹气时间"
+
Config
.
BlowAir_Time
+
"分钟,停止吹气!"
);
IsInBlowing
=
false
;
//Thread.Sleep(100);
KNDIOMove
(
IO_Type
.
StartOrStopBlow
,
IO_VALUE
.
LOW
);
KND
.
IOMove
(
IO_Type
.
StartOrStopBlow
,
IO_VALUE
.
LOW
);
LastEndBlowTime
=
DateTime
.
Now
;
}
}
...
...
@@ -1674,7 +1452,7 @@ namespace OnlineStore.DeviceLibrary
TempAlarmTime
=
DateTime
.
Now
;
TempOrHumidityIsAlarm
=
true
;
//Thread.Sleep(100);
KNDIOMove
(
IO_Type
.
StartOrStopBlow
,
IO_VALUE
.
LOW
);
KND
.
IOMove
(
IO_Type
.
StartOrStopBlow
,
IO_VALUE
.
LOW
);
}
else
if
(
temp
<
Max_Temperature
)
{
...
...
@@ -1683,7 +1461,7 @@ namespace OnlineStore.DeviceLibrary
LOGGER
.
Info
(
"不在吹气中,且当前温度【"
+
param
.
Temperate
+
"】低于【"
+
Max_Temperature
+
"】,关闭报警!"
);
TempOrHumidityIsAlarm
=
false
;
//Thread.Sleep(100);
KNDIOMove
(
IO_Type
.
StartOrStopBlow
,
IO_VALUE
.
LOW
);
KND
.
IOMove
(
IO_Type
.
StartOrStopBlow
,
IO_VALUE
.
LOW
);
}
}
}
...
...
@@ -1694,6 +1472,7 @@ namespace OnlineStore.DeviceLibrary
}
}
#
endregion
#
region
与服务器通信定时器,每
1
秒向服务器通知一次状态
,
同时执行出库操作
private
string
CodeMsg
=
""
;
...
...
@@ -1707,7 +1486,7 @@ namespace OnlineStore.DeviceLibrary
//HumitureServer.RandomData(Config.GetTempAddrList());
isInProcess
=
true
;
if
(
Auto
StoreManager
.
IsConnectServer
)
if
(
StoreManager
.
IsConnectServer
)
{
try
{
...
...
@@ -1812,7 +1591,7 @@ namespace OnlineStore.DeviceLibrary
Operation
lineOperation
=
getLineBoxStatus
();
string
server
=
ConfigAppSettings
.
GetValue
(
Setting_Init
.
http_server
);
Operation
resultOperation
=
HttpHelper
.
Post
(
Auto
StoreManager
.
GetPostApi
(
server
),
lineOperation
,
false
);
Operation
resultOperation
=
HttpHelper
.
Post
(
StoreManager
.
GetPostApi
(
server
),
lineOperation
,
false
);
//发送状态信息到服务器
if
(
resultOperation
==
null
||
(
resultOperation
.
op
!=
2
))
{
...
...
@@ -1879,42 +1658,5 @@ namespace OnlineStore.DeviceLibrary
}
#
endregion
#
region
KNDIO
public
void
KNDIOMove
(
string
ioType
,
IO_VALUE
ioValue
)
{
if
(
Config
.
StoreDOList
.
ContainsKey
(
ioType
))
{
ConfigIO
configIo
=
Config
.
StoreDOList
[
ioType
];
KNDManager
.
WriteSingleDO
(
configIo
.
DeviceName
,
configIo
.
SlaveID
,
configIo
.
GetIOAddr
(),
ioValue
);
Thread
.
Sleep
(
60
);
}
else
{
LogUtil
.
error
(
LOGGER
,
StoreName
+
"没有DO="
+
ioType
);
}
}
public
IO_VALUE
KNDIOValue
(
string
ioType
)
{
IO_VALUE
ioValue
=
IO_VALUE
.
LOW
;
if
(
Config
.
StoreDIList
.
ContainsKey
(
ioType
))
{
ConfigIO
configIo
=
Config
.
StoreDIList
[
ioType
];
ioValue
=
KNDManager
.
GetDIValue
(
configIo
.
DeviceName
,
configIo
.
SlaveID
,
configIo
.
GetIOAddr
());
//UpdateDoValue(ioType, ioValue);
}
else
if
(
Config
.
StoreDOList
.
ContainsKey
(
ioType
))
{
ConfigIO
configIo
=
Config
.
StoreDOList
[
ioType
];
ioValue
=
KNDManager
.
GetDOValue
(
configIo
.
DeviceName
,
configIo
.
SlaveID
,
configIo
.
GetIOAddr
());
}
else
{
LogUtil
.
error
(
LOGGER
,
StoreName
+
"没有DO="
+
ioType
);
}
return
ioValue
;
}
#
endregion
}
}
\ No newline at end of file
source/DeviceLibrary/acSingleStore/AC_SA_BoxBean_Partial.cs
查看文件 @
6522a61
...
...
@@ -144,7 +144,7 @@ namespace OnlineStore.DeviceLibrary
}
else
if
(
wait
.
WaitType
==
2
)
{
wait
.
IsEnd
=
KNDIOValue
(
wait
.
IoType
).
Equals
(
wait
.
IoValue
);
wait
.
IsEnd
=
KND
.
IOValue
(
wait
.
IoType
).
Equals
(
wait
.
IoValue
);
int
timeOutMs
=
Config
.
IOSingle_TimerOut
;
if
(
StoreMove
.
MoveStep
==
StoreMoveStep
.
SO_14_WaitTake
)
{
...
...
@@ -165,11 +165,7 @@ namespace OnlineStore.DeviceLibrary
wait
.
IsEnd
=
(
span
.
TotalMilliseconds
>=
wait
.
TimeMSeconds
);
}
else
if
(
wait
.
WaitType
==
7
)
{
wait
.
IsEnd
=
(
wait
.
HeightValue
.
Equals
(
GetHeight
()));
if
(
wait
.
IsEnd
)
{
LogUtil
.
info
(
"等待height="
+
wait
.
HeightValue
+
"完成"
);
}
//wait.IsEnd = (wait.HeightValue.Equals(GetHeight()));
}
else
if
(
wait
.
WaitType
==
5
)
{
...
...
@@ -256,7 +252,7 @@ namespace OnlineStore.DeviceLibrary
LogUtil
.
error
(
LOGGER
,
StoreName
+
" 启动入库【"
+
posId
+
"】出错,找不到库位信息"
);
return
;
}
if
(
KNDIOValue
(
IO_Type
.
TrayCheck_Fixture
).
Equals
(
IO_VALUE
.
HIGH
))
if
(
KND
.
IOValue
(
IO_Type
.
TrayCheck_Fixture
).
Equals
(
IO_VALUE
.
HIGH
))
{
LogUtil
.
error
(
LOGGER
,
StoreName
+
" 启动入库【"
+
posId
+
"】出错,叉子料盘检测有料"
);
return
;
...
...
@@ -407,8 +403,8 @@ namespace OnlineStore.DeviceLibrary
ACAxisMove
(
Config
.
Middle_Axis
,
moveP
.
Middle_P2
,
Config
.
MiddleAxis_P2_Speed
);
ACAxisMove
(
Config
.
UpDown_Axis
,
moveP
.
UpDown_P3
,
Config
.
UpDownAxis_P3_Speed
);
//关闭舱门
KNDIOMove
(
IO_Type
.
Door_Down
,
IO_VALUE
.
HIGH
);
KNDIOMove
(
IO_Type
.
Door_Up
,
IO_VALUE
.
LOW
);
KND
.
IOMove
(
IO_Type
.
Door_Down
,
IO_VALUE
.
HIGH
);
KND
.
IOMove
(
IO_Type
.
Door_Up
,
IO_VALUE
.
LOW
);
}
else
{
...
...
@@ -424,8 +420,8 @@ namespace OnlineStore.DeviceLibrary
ACAxisMove
(
Config
.
Middle_Axis
,
moveP
.
Middle_P2
,
Config
.
MiddleAxis_P1_Speed
);
ACAxisMove
(
Config
.
UpDown_Axis
,
moveP
.
UpDown_P3
,
Config
.
UpDownAxis_P3_Speed
);
//关闭舱门
KNDIOMove
(
IO_Type
.
Door_Down
,
IO_VALUE
.
HIGH
);
KNDIOMove
(
IO_Type
.
Door_Up
,
IO_VALUE
.
LOW
);
KND
.
IOMove
(
IO_Type
.
Door_Down
,
IO_VALUE
.
HIGH
);
KND
.
IOMove
(
IO_Type
.
Door_Up
,
IO_VALUE
.
LOW
);
}
else
if
(
StoreMove
.
MoveStep
==
StoreMoveStep
.
SI_09_MoveToBag
)
{
...
...
@@ -444,7 +440,7 @@ namespace OnlineStore.DeviceLibrary
}
else
if
(
StoreMove
.
MoveStep
==
StoreMoveStep
.
SI_10_LocationCylinder_Down
)
{
//KNDIOMove(IO_Type.LocationCylinder_Down, IO_VALUE.LOW);
//KND
.
IOMove(IO_Type.LocationCylinder_Down, IO_VALUE.LOW);
InStoreLog
(
"入库:SI_11 叉子进入库位中,进出轴至P3(库位取放料点) "
);
StoreMove
.
NextMoveStep
(
StoreMoveStep
.
SI_11_DeviceToBag
);
ACAxisMove
(
Config
.
InOut_Axis
,
moveP
.
InOut_P3
,
Config
.
InOutAxis_P3_Speed
);
...
...
@@ -528,7 +524,7 @@ namespace OnlineStore.DeviceLibrary
LogUtil
.
error
(
LOGGER
,
StoreName
+
" 启动出库【"
+
posId
+
"】出错,找不到库位信息"
);
return
;
}
if
(
KNDIOValue
(
IO_Type
.
TrayCheck_Fixture
).
Equals
(
IO_VALUE
.
HIGH
))
if
(
KND
.
IOValue
(
IO_Type
.
TrayCheck_Fixture
).
Equals
(
IO_VALUE
.
HIGH
))
{
LogUtil
.
error
(
LOGGER
,
StoreName
+
" 启动出库【"
+
posId
+
"】出错,叉子料盘检测有料"
);
return
;
...
...
@@ -646,7 +642,7 @@ namespace OnlineStore.DeviceLibrary
ACAxisMove
(
Config
.
Middle_Axis
,
moveP
.
Middle_P1
,
Config
.
MiddleAxis_P1_Speed
);
//此处需要等待box门口没有盘
StoreMove
.
WaitList
.
Add
(
WaitResultInfo
.
WaitIO
(
IO_Type
.
TrayCheck_Door
,
IO_VALUE
.
LOW
));
StoreMove
.
WaitList
.
Add
(
WaitResultInfo
.
WaitHeight
(
0
));
//
StoreMove.WaitList.Add(WaitResultInfo.WaitHeight(0));
//打开舱门
OpenDoorAndWait
();
//StoreMove.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.TrayCheck_2, IO_VALUE.LOW));
...
...
@@ -705,7 +701,7 @@ namespace OnlineStore.DeviceLibrary
StoreMove
.
NextMoveStep
(
StoreMoveStep
.
SO_14_WaitTake
);
OutStoreLog
(
"出库:SO_14_WaitTake 等待拿走物品,最多等待10000"
);
StoreMove
.
WaitList
.
Add
(
WaitResultInfo
.
WaitTime
(
10000
));
StoreMove
.
WaitList
.
Add
(
WaitResultInfo
.
WaitHeight
(
0
));
//
StoreMove.WaitList.Add(WaitResultInfo.WaitHeight(0));
StoreMove
.
OneWaitCanEndStep
=
true
;
}
else
if
(
StoreMove
.
MoveStep
==
StoreMoveStep
.
SO_14_WaitTake
)
...
...
@@ -735,15 +731,15 @@ namespace OnlineStore.DeviceLibrary
}
public
bool
InOutAxisCanMove
()
{
if
(
Auto
StoreManager
.
Store
.
Config
.
IsHasLocationCylinder
.
Equals
(
0
))
if
(
StoreManager
.
Store
.
Config
.
IsHasLocationCylinder
.
Equals
(
0
))
{
return
true
;
}
if
(
KNDIOValue
(
IO_Type
.
LocationCylinder_Down
).
Equals
(
IO_VALUE
.
HIGH
)
&&
KNDIOValue
(
IO_Type
.
LocationCylinder_Up
).
Equals
(
IO_VALUE
.
LOW
)
&&
KNDIOValue
(
IO_Type
.
LocationCylinder2_Down
).
Equals
(
IO_VALUE
.
HIGH
)
&&
KNDIOValue
(
IO_Type
.
LocationCylinder2_Up
).
Equals
(
IO_VALUE
.
LOW
))
if
(
KND
.
IOValue
(
IO_Type
.
LocationCylinder_Down
).
Equals
(
IO_VALUE
.
HIGH
)
&&
KND
.
IOValue
(
IO_Type
.
LocationCylinder_Up
).
Equals
(
IO_VALUE
.
LOW
)
&&
KND
.
IOValue
(
IO_Type
.
LocationCylinder2_Down
).
Equals
(
IO_VALUE
.
HIGH
)
&&
KND
.
IOValue
(
IO_Type
.
LocationCylinder2_Up
).
Equals
(
IO_VALUE
.
LOW
))
{
return
true
;
}
...
...
@@ -753,8 +749,8 @@ namespace OnlineStore.DeviceLibrary
{
if
(
Config
.
IsHasLocationCylinder
>=
1
)
{
KNDIOMove
(
IO_Type
.
LocationCylinder_Up
,
IO_VALUE
.
HIGH
);
KNDIOMove
(
IO_Type
.
LocationCylinder_Down
,
IO_VALUE
.
LOW
);
KND
.
IOMove
(
IO_Type
.
LocationCylinder_Up
,
IO_VALUE
.
HIGH
);
KND
.
IOMove
(
IO_Type
.
LocationCylinder_Down
,
IO_VALUE
.
LOW
);
StoreMove
.
WaitList
.
Add
(
WaitResultInfo
.
WaitIO
(
IO_Type
.
LocationCylinder_Up
,
IO_VALUE
.
HIGH
));
StoreMove
.
WaitList
.
Add
(
WaitResultInfo
.
WaitIO
(
IO_Type
.
LocationCylinder_Down
,
IO_VALUE
.
LOW
));
StoreMove
.
WaitList
.
Add
(
WaitResultInfo
.
WaitIO
(
IO_Type
.
LocationCylinder2_Up
,
IO_VALUE
.
HIGH
));
...
...
@@ -765,8 +761,8 @@ namespace OnlineStore.DeviceLibrary
{
if
(
Config
.
IsHasLocationCylinder
>=
1
)
{
KNDIOMove
(
IO_Type
.
LocationCylinder_Down
,
IO_VALUE
.
HIGH
);
KNDIOMove
(
IO_Type
.
LocationCylinder_Up
,
IO_VALUE
.
LOW
);
KND
.
IOMove
(
IO_Type
.
LocationCylinder_Down
,
IO_VALUE
.
HIGH
);
KND
.
IOMove
(
IO_Type
.
LocationCylinder_Up
,
IO_VALUE
.
LOW
);
StoreMove
.
WaitList
.
Add
(
WaitResultInfo
.
WaitIO
(
IO_Type
.
LocationCylinder_Down
,
IO_VALUE
.
HIGH
));
StoreMove
.
WaitList
.
Add
(
WaitResultInfo
.
WaitIO
(
IO_Type
.
LocationCylinder_Up
,
IO_VALUE
.
LOW
));
StoreMove
.
WaitList
.
Add
(
WaitResultInfo
.
WaitIO
(
IO_Type
.
LocationCylinder2_Down
,
IO_VALUE
.
HIGH
));
...
...
source/DeviceLibrary/acSingleStore/AutomaticBaiting.cs
0 → 100644
查看文件 @
6522a61
using
OnlineStore.Common
;
using
OnlineStore.LoadCSVLibrary
;
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Text
;
namespace
OnlineStore.DeviceLibrary
{
public
partial
class
AutomaticBaiting
{
public
static
int
LastHeight
=
0
;
public
static
int
LastSize
=
0
;
public
static
string
LastCode
=
""
;
public
static
int
AxisChangeValue
=
ConfigAppSettings
.
GetIntValue
(
Setting_Init
.
AxisChangeValue
);
public
static
string
WarnMsg
=
""
;
public
static
string
Name
=
"自动上下料"
;
public
static
StoreMoveInfo
StoreMove
=
null
;
public
static
StoreRunStatus
AutoBaitingStatus
=
StoreRunStatus
.
Wait
;
/// <summary>
/// 门状态,0=位初始化,1=关闭,2=打开,
/// </summary>
public
static
int
AutoDoorSatus
=
0
;
/// <summary>
/// 初始化数据
/// </summary>
public
static
void
Init
()
{
StoreMove
=
new
StoreMoveInfo
(
Name
);
}
/// <summary>
/// 定时处理
/// </summary>
public
static
void
TimerProcess
()
{
if
(
AutoBaitingStatus
>=
StoreRunStatus
.
Wait
)
{
if
(
StoreMove
.
MoveType
.
Equals
(
StoreMoveType
.
StoreReset
))
{
ResetProcess
();
}
else
if
(
StoreMove
.
MoveType
.
Equals
(
StoreMoveType
.
InStore
))
{
InStoreProcess
();
}
else
if
(
StoreMove
.
MoveType
.
Equals
(
StoreMoveType
.
OutStore
))
{
OutStoreProcess
();
}
}
}
/// <summary>
/// 判断是否可以启动
/// </summary>
/// <returns></returns>
public
static
string
CanStart
()
{
string
msg
=
""
;
//需要判断门关闭
if
(!
DoorIsClose
())
{
msg
=
"上料机构门未关闭"
;
return
msg
;
}
//吸盘压力确认
if
(
KND
.
IOValue
(
IO_Type
.
SuckingDisc_Air
).
Equals
(
IO_VALUE
.
LOW
))
{
msg
=
"吸盘压力无信号"
;
return
msg
;
}
return
msg
;
}
public
static
bool
StartReset
()
{
string
msg
=
CanStart
();
if
(!
String
.
IsNullOrEmpty
(
msg
))
{
LogUtil
.
info
(
Name
+
"复位失败:"
+
msg
);
return
false
;
}
AutoBaitingStatus
=
StoreRunStatus
.
Reset
;
StoreMove
.
NewMove
(
StoreMoveType
.
StoreReset
);
StoreMove
.
NextMoveStep
(
StoreMoveStep
.
AUTO_R01_CloseDoor
);
//关闭门,轴回原点,检测
AutoDoorClose
(
true
);
KND
.
IOMove
(
IO_Type
.
SuckingDisc_Work
,
IO_VALUE
.
LOW
);
LogUtil
.
info
(
Name
+
"复位中:关闭门锁"
);
return
true
;
}
private
static
void
ResetProcess
()
{
if
(
StoreMove
.
IsInWait
)
{
CheckWait
();
}
if
(
StoreMove
.
IsInWait
)
{
return
;
}
switch
(
StoreMove
.
MoveStep
)
{
case
StoreMoveStep
.
AUTO_R01_CloseDoor
:
StoreMove
.
NextMoveStep
(
StoreMoveStep
.
AUTO_R02_AutoAxisHome
);
LogUtil
.
info
(
Name
+
"复位中:自动轴原点返回"
);
ACAxisHomeMove
(
StoreManager
.
Config
.
Auto_Axis
);
break
;
case
StoreMoveStep
.
AUTO_R02_AutoAxisHome
:
StoreMove
.
NextMoveStep
(
StoreMoveStep
.
AUTO_R03_AutoAxisHome
);
LogUtil
.
info
(
Name
+
"复位中:匀速向上运动,检测 是否有料盘"
);
ACAxisSpeedMove
(
StoreManager
.
Config
.
Auto_Axis
,
StoreManager
.
Config
.
Auto_Axis
.
TargetSpeed
);
break
;
case
StoreMoveStep
.
AUTO_R03_AutoAxisHome
:
if
(
KND
.
IOValue
(
IO_Type
.
TrayCheck_LoadMaterial
).
Equals
(
IO_VALUE
.
LOW
))
{
LogUtil
.
info
(
Name
+
"复位中: 没有料盘,不需要上料,上料轴回0点"
);
StoreMove
.
NextMoveStep
(
StoreMoveStep
.
AUTO_R04_AutoBack
);
ACAxisHomeMove
(
StoreManager
.
Config
.
Auto_Axis
);
}
else
{
LogUtil
.
info
(
Name
+
"复位完成,有料盘,需要开始自动入料"
);
StoreMove
.
EndMove
();
AutoBaitingStatus
=
StoreRunStatus
.
Runing
;
//TODO
StartInOut
();
}
break
;
case
StoreMoveStep
.
AUTO_R04_AutoBack
:
LogUtil
.
info
(
Name
+
"复位完成"
);
StoreMove
.
EndMove
();
AutoBaitingStatus
=
StoreRunStatus
.
Runing
;
WarnMsg
=
""
;
break
;
default
:
break
;
}
}
public
static
bool
StartInOut
()
{
if
(
AutoBaitingStatus
==
StoreRunStatus
.
Runing
)
{
AutoBaitingStatus
=
StoreRunStatus
.
Busy
;
StoreMove
.
NewMove
(
StoreMoveType
.
InStore
);
StoreMove
.
NextMoveStep
(
StoreMoveStep
.
AUTO_I01_MoveToUp
);
if
(
KND
.
IOValue
(
IO_Type
.
TrayCheck_LoadMaterial
).
Equals
(
IO_VALUE
.
HIGH
))
{
LogUtil
.
error
(
Name
+
" 启动入料 ,已检测到料盘,轴不需要上升"
);
}
else
{
LogUtil
.
error
(
Name
+
" 启动入料 ,轴上升到检测到料盘"
);
ACAxisSpeedMove
(
StoreManager
.
Config
.
Auto_Axis
,
StoreManager
.
Config
.
Auto_Axis
.
TargetSpeed
);
}
return
true
;
}
else
{
LogUtil
.
error
(
Name
+
" 启动入料出错,当前状态,AutoBaitingStatus="
+
AutoBaitingStatus
);
return
false
;
}
}
private
static
void
InStoreProcess
()
{
if
(
StoreMove
.
IsInWait
)
{
CheckWait
();
}
if
(
StoreMove
.
IsInWait
)
{
return
;
}
if
(
StoreMove
.
MoveStep
.
Equals
(
StoreMoveStep
.
AUTO_I01_MoveToUp
))
{
SuckingDiscWork
();
}
else
if
(
StoreMove
.
MoveType
.
Equals
(
StoreMoveStep
.
AUTO_I02_SuckingDisc_Down
))
{
StoreMove
.
NextMoveStep
(
StoreMoveStep
.
AUTO_I03_SuckingDisc_Work
);
LogUtil
.
info
(
Name
+
"入料: 开始吸料盘"
);
KND
.
IOMove
(
IO_Type
.
SuckingDisc_Work
,
IO_VALUE
.
HIGH
);
StoreMove
.
WaitList
.
Add
(
WaitResultInfo
.
WaitTime
(
200
));
}
else
if
(
StoreMove
.
MoveType
.
Equals
(
StoreMoveStep
.
AUTO_I03_SuckingDisc_Work
))
{
StoreMove
.
NextMoveStep
(
StoreMoveStep
.
AUTO_I04_SuckingDisc_Up
);
LogUtil
.
info
(
Name
+
"入料: 吸盘上升,同时上料轴也上升"
);
CylinderMove
(
IO_Type
.
SuckingDisc_Up
,
IO_Type
.
SuckingDisc_Down
,
true
);
ACAxisSpeedMove
(
StoreManager
.
Config
.
Auto_Axis
,
StoreManager
.
Config
.
Auto_Axis
.
TargetSpeed
);
}
else
if
(
StoreMove
.
MoveType
.
Equals
(
StoreMoveStep
.
AUTO_I04_SuckingDisc_Up
))
{
//需要料仓没有出入库才可以扫码
if
(
StoreManager
.
Store
.
CanStarInOut
())
{
LastHeight
=
0
;
LastSize
=
0
;
LastCode
=
""
;
StoreMove
.
NextMoveStep
(
StoreMoveStep
.
AUTO_I05_ScanCode
);
//计算高度
EndMovePosition
=
ACServerManager
.
GetActualtPosition
(
StoreManager
.
Config
.
Auto_Axis
.
DeviceName
,
StoreManager
.
Config
.
Auto_Axis
.
GetAxisValue
());
int
height
=
Math
.
Abs
(
EndMovePosition
-
StartMovePosition
)
/
AxisChangeValue
;
int
size
=
GetSize
();
LogUtil
.
info
(
Name
+
"入料: 开始扫码,料盘尺寸:【"
+
size
+
"*"
+
height
+
"】"
);
LastHeight
=
height
;
LastSize
=
size
;
StoreMove
.
WaitList
.
Add
(
WaitResultInfo
.
WaitCodeOK
());
StoreMove
.
WaitList
.
Add
(
WaitResultInfo
.
WaitTime
(
2000
));
StoreMove
.
OneWaitCanEndStep
=
true
;
}
}
else
if
(
StoreMove
.
MoveType
.
Equals
(
StoreMoveStep
.
AUTO_I05_ScanCode
))
{
if
(
LastCode
.
Equals
(
""
))
{
StoreMove
.
NextMoveStep
(
StoreMoveStep
.
AUTO_I07_OpenDoor
);
LogUtil
.
info
(
Name
+
"入料: 未扫到二维码,打开仓门"
);
CylinderMove
(
IO_Type
.
Door_Up
,
IO_Type
.
Door_Down
,
true
);
}
else
{
StoreMove
.
NextMoveStep
(
StoreMoveStep
.
AUTO_I06_WaitTrayLeave
);
LogUtil
.
info
(
Name
+
"入料: 开始入料,等待料盘拿走"
);
StoreMove
.
WaitList
.
Add
(
WaitResultInfo
.
WaitIO
(
IO_Type
.
SuckingDisc_Work
,
IO_VALUE
.
LOW
));
StoreMove
.
WaitList
.
Add
(
WaitResultInfo
.
WaitIO
(
IO_Type
.
WidthCheck1
,
IO_VALUE
.
LOW
));
StoreMove
.
WaitList
.
Add
(
WaitResultInfo
.
WaitIO
(
IO_Type
.
WidthCheck2
,
IO_VALUE
.
LOW
));
}
}
else
if
(
StoreMove
.
MoveType
.
Equals
(
StoreMoveStep
.
AUTO_I06_WaitTrayLeave
))
{
SuckingDiscWork
();
}
else
if
(
StoreMove
.
MoveType
.
Equals
(
StoreMoveStep
.
AUTO_I07_OpenDoor
)){
StoreMove
.
NextMoveStep
(
StoreMoveStep
.
AUTO_I08_WaitTakeTray
);
LogUtil
.
info
(
Name
+
"入料: 未扫到二维码,等待拿走料盘"
);
StoreMove
.
WaitList
.
Add
(
WaitResultInfo
.
WaitIO
(
IO_Type
.
SuckingDisc_Work
,
IO_VALUE
.
LOW
));
StoreMove
.
WaitList
.
Add
(
WaitResultInfo
.
WaitIO
(
IO_Type
.
WidthCheck1
,
IO_VALUE
.
LOW
));
StoreMove
.
WaitList
.
Add
(
WaitResultInfo
.
WaitIO
(
IO_Type
.
WidthCheck2
,
IO_VALUE
.
LOW
));
}
else
if
(
StoreMove
.
MoveType
.
Equals
(
StoreMoveStep
.
AUTO_I08_WaitTakeTray
))
{
StoreMove
.
NextMoveStep
(
StoreMoveStep
.
AUTO_I09_TrayLeaveWaitTime
);
LogUtil
.
info
(
Name
+
"入料: 未扫到二维码,料盘已拿走,等待1秒后关门"
);
StoreMove
.
WaitList
.
Add
(
WaitResultInfo
.
WaitTime
(
1000
));
}
else
if
(
StoreMove
.
MoveType
.
Equals
(
StoreMoveStep
.
AUTO_I09_TrayLeaveWaitTime
))
{
StoreMove
.
NextMoveStep
(
StoreMoveStep
.
AUTO_I10_CloseDoor
);
LogUtil
.
info
(
Name
+
"入料: 未扫到二维码,料盘已拿走,关闭仓门"
);
CylinderMove
(
IO_Type
.
Door_Down
,
IO_Type
.
Door_Up
,
true
);
}
else
if
(
StoreMove
.
MoveType
.
Equals
(
StoreMoveStep
.
AUTO_I10_CloseDoor
))
{
SuckingDiscWork
();
}
else
{
LogUtil
.
error
(
Name
+
"未找到步骤:"
+
StoreMove
.
MoveType
);
}
}
/// <summary>
/// 吸盘下降开始吸走料盘
/// </summary>
private
static
void
SuckingDiscWork
()
{
if
(
KND
.
IOValue
(
IO_Type
.
TrayCheck_LoadMaterial
).
Equals
(
IO_VALUE
.
HIGH
))
{
StoreMove
.
NextMoveStep
(
StoreMoveStep
.
AUTO_I02_SuckingDisc_Down
);
LogUtil
.
info
(
Name
+
"入料: 检测到料盘, 吸盘开始下降"
);
CylinderMove
(
IO_Type
.
SuckingDisc_Down
,
IO_Type
.
SuckingDisc_Up
,
true
);
}
else
{
//TODO
LogUtil
.
info
(
Name
+
"入料:已经没有料盘,入料结束"
);
StoreMove
.
EndMove
();
AutoBaitingStatus
=
StoreRunStatus
.
Runing
;
}
}
public
static
void
OutStoreProcess
()
{
}
public
static
bool
DoorIsClose
()
{
if
(
KND
.
IOValue
(
IO_Type
.
DoorClose_LoadMaterial
).
Equals
(
IO_VALUE
.
HIGH
))
{
return
true
;
}
return
false
;
}
public
static
void
AutoDoorOpen
(
bool
isWait
)
{
KND
.
IOMove
(
IO_Type
.
AutoDoor_Close
,
IO_VALUE
.
LOW
);
KND
.
IOMove
(
IO_Type
.
AutoDoor_Open
,
IO_VALUE
.
HIGH
);
if
(
isWait
)
{
StoreMove
.
WaitList
.
Add
(
WaitResultInfo
.
WaitIO
(
IO_Type
.
AutoDoor_Close
,
IO_VALUE
.
LOW
));
StoreMove
.
WaitList
.
Add
(
WaitResultInfo
.
WaitIO
(
IO_Type
.
AutoDoor_Open
,
IO_VALUE
.
HIGH
));
}
}
public
static
void
AutoDoorClose
(
bool
isWait
)
{
if
(
isWait
)
{
StoreMove
.
WaitList
.
Add
(
WaitResultInfo
.
WaitIO
(
IO_Type
.
AutoDoor_Open
,
IO_VALUE
.
LOW
));
StoreMove
.
WaitList
.
Add
(
WaitResultInfo
.
WaitIO
(
IO_Type
.
AutoDoor_Close
,
IO_VALUE
.
HIGH
));
}
KND
.
IOMove
(
IO_Type
.
AutoDoor_Open
,
IO_VALUE
.
LOW
);
KND
.
IOMove
(
IO_Type
.
AutoDoor_Close
,
IO_VALUE
.
HIGH
);
}
//public static void SuckingDiscDown(bool isWait)
//{
// if (isWait)
// {
// StoreMove.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.SuckingDisc_Up, IO_VALUE.LOW));
// StoreMove.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.SuckingDisc_Down, IO_VALUE.HIGH));
// }
// KND.IOMove(IO_Type.SuckingDisc_Up, IO_VALUE.LOW);
// KND.IOMove(IO_Type.SuckingDisc_Down, IO_VALUE.HIGH);
//}
//public static void SuckingDiscUp(bool isWait)
//{
// if (isWait)
// {
// StoreMove.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.SuckingDisc_Down, IO_VALUE.LOW));
// StoreMove.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.SuckingDisc_Up, IO_VALUE.HIGH));
// }
// KND.IOMove(IO_Type.SuckingDisc_Down, IO_VALUE.LOW);
// KND.IOMove(IO_Type.SuckingDisc_Up, IO_VALUE.HIGH);
//}
}
}
source/DeviceLibrary/acSingleStore/AutomaticBaiting_Partial.cs
0 → 100644
查看文件 @
6522a61
using
OnlineStore.Common
;
using
OnlineStore.LoadCSVLibrary
;
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Text
;
using
System.Threading.Tasks
;
namespace
OnlineStore.DeviceLibrary
{
public
partial
class
AutomaticBaiting
{
private
static
int
StartMovePosition
=
0
;
private
static
int
EndMovePosition
=
0
;
public
static
int
AutoAxisIsMove
=
0
;
private
static
void
ACAxisSpeedMove
(
ConfigMoveAxis
moveAxis
,
int
targetSpeed
)
{
AutoAxisIsMove
=
1
;
StartMovePosition
=
ACServerManager
.
GetActualtPosition
(
moveAxis
.
DeviceName
,
moveAxis
.
GetAxisValue
());
EndMovePosition
=
StartMovePosition
;
StoreMove
.
WaitList
.
Add
(
WaitResultInfo
.
WaitAutoAxisStop
(
moveAxis
));
ACServerManager
.
SpeedMove
(
moveAxis
.
DeviceName
,
moveAxis
.
GetAxisValue
(),
targetSpeed
);
}
private
static
void
ACAxisHomeMove
(
ConfigMoveAxis
moveAxis
)
{
moveAxis
.
TargetPosition
=
0
;
LogUtil
.
debug
(
Name
+
moveAxis
.
DisplayStr
+
"speed["
+
moveAxis
.
TargetSpeed
+
"]开始原点返回"
);
StoreMove
.
WaitList
.
Add
(
WaitResultInfo
.
WaitAxis
(
moveAxis
,
true
));
ACServerManager
.
HomeMove
(
moveAxis
.
DeviceName
,
(
short
)
moveAxis
.
GetAxisValue
(),
moveAxis
.
HomeHighSpeed
);
}
private
static
bool
ACHomeMoveIsEnd
(
ConfigMoveAxis
moveAxis
,
out
string
msg
)
{
msg
=
""
;
if
(
ACServerManager
.
IsHomeMoveEnd
(
moveAxis
.
DeviceName
,
moveAxis
.
GetAxisValue
()))
{
//原点完成并且位置=0
int
outCount
=
ACServerManager
.
GetActualtPosition
(
moveAxis
.
DeviceName
,
moveAxis
.
GetAxisValue
());
int
errorCount
=
Math
.
Abs
(
outCount
);
if
(
errorCount
>
moveAxis
.
CanErrorCountMax
)
{
////判断是否需要重新运动
//if (StoreMove.CanWhileCount > 0)
//{
// LogUtil.error(Name+ moveAxis.DisplayStr + "收到原点完成信号,当前位置[" + outCount + "],重新回原点,剩余[" + StoreMove.CanWhileCount + "]次");
// ACServerManager.HomeMove(moveAxis.DeviceName, moveAxis.GetAxisValue(), moveAxis.HomeHighSpeed);
// StoreMove.CanWhileCount--;
//}
//else
//{
msg
=
Name
+
" storeMoveStep="
+
StoreMove
.
MoveStep
+
moveAxis
.
DisplayStr
+
"收到原点完成信号,当前位置["
+
outCount
+
"],误差过大,需要报警"
;
LogUtil
.
error
(
msg
);
return
false
;
//}
}
return
true
;
}
return
false
;
}
private
static
void
CheckWait
()
{
List
<
WaitResultInfo
>
list
=
StoreMove
.
WaitList
;
if
(
list
.
Count
<=
0
)
{
StoreMove
.
EndStepWait
();
return
;
}
//当等待超过一分钟时,需要打印提示
TimeSpan
span
=
DateTime
.
Now
-
StoreMove
.
LastSetpTime
;
string
NotOkMsg
=
""
;
bool
isOk
=
!
StoreMove
.
OneWaitCanEndStep
;
foreach
(
WaitResultInfo
wait
in
list
)
{
if
(
wait
.
IsEnd
)
{
continue
;
}
NotOkMsg
=
wait
.
ToStr
();
if
(
wait
.
WaitType
==
1
)
{
wait
.
IsEnd
=
AxisMoveISEnd
(
wait
);
}
else
if
(
wait
.
WaitType
==
2
)
{
wait
.
IsEnd
=
KND
.
IOValue
(
wait
.
IoType
).
Equals
(
wait
.
IoValue
);
int
timeOutMs
=
StoreManager
.
Config
.
IOSingle_TimerOut
;
if
((!
wait
.
IsEnd
)
&&
span
.
TotalMilliseconds
>
timeOutMs
)
{
ConfigIO
io
=
StoreManager
.
Config
.
getWaitIO
(
wait
.
IoType
);
WarnMsg
=
Name
+
" 等待信号"
+
io
.
DisplayStr
+
"="
+
wait
.
IoValue
+
"超时!"
;
StoreManager
.
Store
.
Alarm
(
StoreAlarmType
.
IoSingleTimeOut
,
io
.
ElectricalDefinition
,
WarnMsg
,
StoreMove
.
MoveType
);
LogUtil
.
error
(
WarnMsg
);
isOk
=
false
;
break
;
}
}
else
if
(
wait
.
WaitType
==
3
)
{
wait
.
IsEnd
=
(
span
.
TotalMilliseconds
>=
wait
.
TimeMSeconds
);
}
else
if
(
wait
.
WaitType
==
5
)
{
}
else
if
(
wait
.
WaitType
==
6
)
{
IO_VALUE
value
=
(
IO_VALUE
)
ACServerManager
.
GetHomeSingle
(
wait
.
AxisInfo
.
DeviceName
,
wait
.
AxisInfo
.
GetAxisValue
());
wait
.
IsEnd
=
wait
.
IoValue
.
Equals
(
value
);
}
else
if
(
wait
.
WaitType
==
7
)
{
}
else
if
(
wait
.
WaitType
==
8
)
{
IO_VALUE
value
=
(
IO_VALUE
)
ACServerManager
.
GetLimitNegativeSingle
(
wait
.
AxisInfo
.
DeviceName
,
wait
.
AxisInfo
.
GetAxisValue
());
wait
.
IsEnd
=
wait
.
IoValue
.
Equals
(
value
);
}
else
if
(
wait
.
WaitType
==
9
)
{
IO_VALUE
value
=
(
IO_VALUE
)
ACServerManager
.
GetLimitPositiveSingle
(
wait
.
AxisInfo
.
DeviceName
,
wait
.
AxisInfo
.
GetAxisValue
());
wait
.
IsEnd
=
wait
.
IoValue
.
Equals
(
value
);
}
else
if
(
wait
.
WaitType
==
10
)
{
wait
.
IsEnd
=
AutoAxisIsEnd
(
wait
);
}
else
if
(
wait
.
WaitType
==
11
)
{
wait
.
IsEnd
=
!
String
.
IsNullOrEmpty
(
LastCode
);
}
if
(
wait
.
IsEnd
)
{
if
(
StoreMove
.
OneWaitCanEndStep
)
{
isOk
=
true
;
break
;
}
}
else
{
if
(!
StoreMove
.
OneWaitCanEndStep
)
{
isOk
=
false
;
break
;
}
}
}
if
(
isOk
)
{
StoreMove
.
EndStepWait
();
}
else
if
(
span
.
TotalSeconds
>
StoreMove
.
TimeOutSeconds
)
{
if
(
NotOkMsg
.
Equals
(
""
))
{
WarnMsg
=
Name
+
"等待超时【"
+
StoreMove
.
MoveType
+
"】【"
+
StoreMove
.
MoveStep
+
"】已等待【"
+
Math
.
Round
(
span
.
TotalSeconds
)
+
"】秒"
;
foreach
(
WaitResultInfo
wait
in
list
)
{
WarnMsg
=
WarnMsg
+
"\r\n"
+
wait
.
ToStr
();
}
LogUtil
.
error
(
WarnMsg
);
}
else
{
WarnMsg
=
Name
+
"【"
+
StoreMove
.
MoveType
+
"】【"
+
StoreMove
.
MoveStep
+
"】等待超时 ["
+
NotOkMsg
+
"]已等待["
+
Math
.
Round
(
span
.
TotalSeconds
,
1
)
+
"]秒"
;
LogUtil
.
error
(
WarnMsg
);
}
StoreManager
.
Store
.
Alarm
(
StoreAlarmType
.
IoSingleTimeOut
,
""
,
WarnMsg
,
StoreMove
.
MoveType
);
}
}
private
static
bool
AxisMoveISEnd
(
WaitResultInfo
wait
)
{
string
msg
=
""
;
if
(
wait
.
IsHomeMove
)
{
wait
.
IsEnd
=
ACHomeMoveIsEnd
(
wait
.
AxisInfo
,
out
msg
);
}
if
(!
wait
.
IsEnd
)
{
IO_VALUE
value
=
(
IO_VALUE
)
ACServerManager
.
GetHomeSingle
(
wait
.
AxisInfo
.
DeviceName
,
wait
.
AxisInfo
.
GetAxisValue
());
if
(
value
.
Equals
(
IO_VALUE
.
HIGH
))
{
ACServerManager
.
SuddenStop
(
wait
.
AxisInfo
.
DeviceName
,
wait
.
AxisInfo
.
GetAxisValue
());
LogUtil
.
error
(
Name
+
wait
.
ToStr
()
+
"原点返回过程中到达 负限位,直接停止运动"
);
StoreManager
.
Store
.
Alarm
(
StoreAlarmType
.
AxisMoveError
,
StoreManager
.
Store
.
GetAlarmCodeByAxis
(
wait
.
AxisInfo
).
ToString
(),
WarnMsg
,
StoreMove
.
MoveType
);
}
}
if
(!
msg
.
Equals
(
""
))
{
WarnMsg
=
msg
;
StoreManager
.
Store
.
Alarm
(
StoreAlarmType
.
AxisMoveError
,
StoreManager
.
Store
.
GetAlarmCodeByAxis
(
wait
.
AxisInfo
).
ToString
(),
WarnMsg
,
StoreMove
.
MoveType
);
}
return
wait
.
IsEnd
;
}
private
static
bool
AutoAxisIsEnd
(
WaitResultInfo
wait
)
{
bool
result
=
false
;
if
(
KND
.
IOValue
(
IO_Type
.
TrayCheck_LoadMaterial
).
Equals
(
IO_VALUE
.
HIGH
))
{
result
=
true
;
}
else
{
IO_VALUE
LimitN
=
(
IO_VALUE
)
ACServerManager
.
GetLimitNegativeSingle
(
wait
.
AxisInfo
.
DeviceName
,
wait
.
AxisInfo
.
GetAxisValue
());
if
(
LimitN
.
Equals
(
IO_VALUE
.
HIGH
))
{
result
=
true
;
}
}
if
(
result
)
{
AutoAxisIsMove
=
0
;
ACServerManager
.
SuddenStop
(
wait
.
AxisInfo
.
DeviceName
,
wait
.
AxisInfo
.
GetAxisValue
());
}
return
result
;
}
public
static
int
GetSize
()
{
if
(
KND
.
IOValue
(
IO_Type
.
WidthCheck1
).
Equals
(
IO_VALUE
.
HIGH
))
{
if
(
KND
.
IOValue
(
IO_Type
.
WidthCheck2
).
Equals
(
IO_VALUE
.
HIGH
))
{
return
13
;
}
else
{
return
7
;
}
}
return
0
;
}
#
region
Halcon
扫码枪代码
public
bool
IsTestCamera
=
false
;
private
static
string
spiltStr
=
"##"
;
public
static
void
GetCameraCode
()
{
Task
.
Factory
.
StartNew
(
delegate
()
{
KND
.
IOMove
(
IO_Type
.
CameraLight_Power
,
IO_VALUE
.
HIGH
);
string
message
=
""
;
List
<
string
>
codeList
=
CodeManager
.
CameraScan
();
if
(
codeList
.
Count
<=
0
)
{
codeList
=
CodeManager
.
CameraScan
();
}
foreach
(
string
str
in
codeList
)
{
message
=
message
+
"=1+0x0-"
+
LastSize
+
"x"
+
LastHeight
+
" ="
+
str
+
spiltStr
;
}
LastCode
=
message
;
if
(
LastCode
.
Equals
(
""
))
{
LogUtil
.
error
(
"未扫到二维码,请拿走料盘"
);
WarnMsg
=
"未扫到二维码,请拿走料盘"
;
}
KND
.
IOMove
(
IO_Type
.
CameraLight_Power
,
IO_VALUE
.
LOW
);
StoreManager
.
Store
.
onCodeReceived
(
message
);
});
}
#
endregion
private
static
void
CylinderMove
(
string
highType
,
string
lowType
,
bool
isWait
)
{
if
(
isWait
)
{
StoreMove
.
WaitList
.
Add
(
WaitResultInfo
.
WaitIO
(
lowType
,
IO_VALUE
.
LOW
));
StoreMove
.
WaitList
.
Add
(
WaitResultInfo
.
WaitIO
(
highType
,
IO_VALUE
.
HIGH
));
}
KND
.
IOMove
(
lowType
,
IO_VALUE
.
LOW
);
KND
.
IOMove
(
highType
,
IO_VALUE
.
HIGH
);
}
}
}
source/DeviceLibrary/acSingleStore/
AC
StoreManager.cs
→
source/DeviceLibrary/acSingleStore/StoreManager.cs
查看文件 @
6522a61
...
...
@@ -11,8 +11,15 @@ using System.Windows.Forms;
namespace
OnlineStore.DeviceLibrary
{
public
class
Auto
StoreManager
public
class
StoreManager
{
/// <summary>
/// 当前出入库的模式
/// </summary>
public
static
int
CurrInOutType
=
0
;
private
static
string
api_communication
=
"service/store/communication"
;
//流水线状态通信接口
private
static
string
api_nextFeeder
=
"service/store/nextFeeder"
;
// 出库站位列表切换接口
public
static
readonly
ILog
LOGGER
=
LogManager
.
GetLogger
(
System
.
Reflection
.
MethodBase
.
GetCurrentMethod
().
DeclaringType
);
...
...
@@ -20,7 +27,7 @@ namespace OnlineStore.DeviceLibrary
public
static
AUTO_SA_Config
Config
=
null
;
private
static
bool
isInit
=
false
;
public
static
bool
IsConnectServer
=!
ConfigAppSettings
.
GetValue
(
Setting_Init
.
http_server
).
Equals
(
""
);
public
Auto
StoreManager
()
public
StoreManager
()
{
}
public
static
bool
OpenShuoKe
(
AC_SA_BoxBean
box
)
...
...
@@ -95,10 +102,9 @@ namespace OnlineStore.DeviceLibrary
CSVPositionReader
<
AutoStorePosition
>.
ReloadCSVFile
(
positionConfigFile
);
}
Config
=
(
AUTO_SA_Config
)
storeConfig
;
AC_SA_BoxBean
storeBean
=
new
AC_SA_BoxBean
(
Config
);
storeBean
.
CID
=
CID
;
LogUtil
.
info
(
LOGGER
,
"加载料仓完成!"
);
Store
=
storeBean
;
Store
=
new
AC_SA_BoxBean
(
Config
);
Store
.
CID
=
CID
;
LogUtil
.
info
(
LOGGER
,
"加载料仓完成!"
);
return
Store
;
}
}
...
...
source/DeviceLibrary/store/
KTK
_DeviceBase.cs
→
source/DeviceLibrary/store/
AC
_DeviceBase.cs
查看文件 @
6522a61
...
...
@@ -10,7 +10,7 @@ using System.Text;
namespace
OnlineStore.DeviceLibrary
{
public
abstract
class
KTK
_DeviceBase
public
abstract
class
AC
_DeviceBase
{
/// <summary>
/// 料仓单个调试状态(默认不是调试状态)
...
...
@@ -53,13 +53,15 @@ namespace OnlineStore.DeviceLibrary
{
if
(!
isInit
)
{
StoreMove
=
new
StoreMoveInfo
(
Store
ID
);
StoreMove
=
new
StoreMoveInfo
(
Store
Name
);
mainTimer
=
new
System
.
Timers
.
Timer
();
mainTimer
.
Enabled
=
false
;
mainTimer
.
Interval
=
300
;
mainTimer
.
Elapsed
+=
timersTimer_Elapsed
;
mainTimer
.
AutoReset
=
true
;
isInit
=
true
;
}
}
...
...
source/DeviceLibrary/store/
KTK
_Store.cs
→
source/DeviceLibrary/store/
AC
_Store.cs
查看文件 @
6522a61
...
...
@@ -3,6 +3,7 @@ using OnlineStore.Common;
using
OnlineStore.LoadCSVLibrary
;
using
System
;
using
System.Collections.Generic
;
using
System.Diagnostics
;
using
System.Drawing
;
using
System.Linq
;
using
System.Text
;
...
...
@@ -14,24 +15,14 @@ namespace OnlineStore.DeviceLibrary
/// <summary>
/// 康泰克单台自动料仓
/// </summary>
public
abstract
class
KTK_Store
:
KTK
_DeviceBase
public
abstract
class
AC_Store
:
AC
_DeviceBase
{
public
KTK
_Store
()
public
AC
_Store
()
{
}
/// <summary>
/// 开始运行的时间
/// </summary>
public
DateTime
StartTime
{
get
;
set
;
}
public
DateTime
statusTime
=
DateTime
.
Now
;
/// <summary>
/// 伺服运行时间列表,key=轴,key=开始时间,value=结束时间
/// </summary>
//public Dictionary<int, Dictionary<DateTime, DateTime>> AxisRunTimeMap = new Dictionary<int, Dictionary<DateTime, DateTime>>();
//public Dictionary<int, DateTime> AxisLastStartTime = new Dictionary<int, DateTime>();
}
public
Stopwatch
runTimeWatch
=
new
Stopwatch
();
/// <summary>
/// 最后一次气压检测变为0的时间
/// </summary>
...
...
@@ -60,8 +51,7 @@ namespace OnlineStore.DeviceLibrary
public
object
lastDiListLock
=
""
;
public
void
addLastDI
(
string
type
,
IO_VALUE
value
)
{
{
try
{
lock
(
lastDiListLock
)
...
...
@@ -78,45 +68,14 @@ namespace OnlineStore.DeviceLibrary
LOGGER
.
Error
(
ex
.
ToString
());
}
}
/// <summary>
/// 获取料仓运行的时间
/// </summary>
/// <returns></returns>
public
TimeSpan
GetStoreRunTime
()
{
if
(
StartTime
!=
null
)
{
return
DateTime
.
Now
-
StartTime
;
}
else
{
return
new
TimeSpan
(
0
);
}
}
protected
void
AddAxisMoveTime
(
ConfigMoveAxis
axis
)
{
//int axisNo = axis.GetAxisValue();
//if (AxisLastStartTime.ContainsKey(axisNo))
//{
// AxisLastStartTime.Remove(axisNo);
//}
//AxisLastStartTime.Add(axisNo, DateTime.Now);
}
/// <summary>
/// 运动处理
/// </summary>
protected
bool
isInPro
=
false
;
protected
virtual
void
BusyMoveProcess
()
{
//if (isInPro)
//{
// return;
//}
{
isInPro
=
true
;
try
{
...
...
@@ -226,8 +185,7 @@ namespace OnlineStore.DeviceLibrary
{
moveAxis
.
TargetPosition
=
0
;
LogUtil
.
debug
(
LOGGER
,
moveAxis
.
DisplayStr
+
"speed["
+
moveAxis
.
TargetSpeed
+
"]开始原点返回"
);
StoreMove
.
WaitList
.
Add
(
WaitResultInfo
.
WaitAxis
(
moveAxis
,
true
));
AddAxisMoveTime
(
moveAxis
);
StoreMove
.
WaitList
.
Add
(
WaitResultInfo
.
WaitAxis
(
moveAxis
,
true
));
ACServerManager
.
HomeMove
(
moveAxis
.
DeviceName
,
(
short
)
moveAxis
.
GetAxisValue
(),
moveAxis
.
HomeHighSpeed
);
}
...
...
@@ -237,8 +195,7 @@ namespace OnlineStore.DeviceLibrary
protected
void
ACAxisMove
(
ConfigMoveAxis
moveAxis
,
int
targetPosition
,
int
targetSpeed
)
{
StoreMove
.
WaitList
.
Add
(
WaitResultInfo
.
WaitAxis
(
moveAxis
,
targetPosition
,
targetSpeed
));
moveAxis
.
TargetPosition
=
targetPosition
;
AddAxisMoveTime
(
moveAxis
);
moveAxis
.
TargetPosition
=
targetPosition
;
ACServerManager
.
AbsMove
(
moveAxis
.
DeviceName
,
moveAxis
.
GetAxisValue
(),
targetPosition
,
targetSpeed
);
}
...
...
@@ -309,44 +266,33 @@ namespace OnlineStore.DeviceLibrary
}
return
false
;
}
protected
bool
ACHomeMoveIsEnd
(
ConfigMoveAxis
moveAxis
,
out
string
msg
)
protected
bool
ACHomeMoveIsEnd
(
ConfigMoveAxis
moveAxis
,
out
string
msg
)
{
msg
=
""
;
if
(
ACServerManager
.
IsHomeMoveEnd
(
moveAxis
.
DeviceName
,
moveAxis
.
GetAxisValue
())
)
if
(
ACServerManager
.
IsHomeMoveEnd
(
moveAxis
.
DeviceName
,
moveAxis
.
GetAxisValue
()))
{
//原点完成并且位置=0
int
outCount
=
ACServerManager
.
GetActualtPosition
(
moveAxis
.
DeviceName
,
moveAxis
.
GetAxisValue
());
int
errorCount
=
Math
.
Abs
(
outCount
);
if
(
errorCount
>
moveAxis
.
CanErrorCountMax
)
int
errorCount
=
Math
.
Abs
(
outCount
);
if
(
errorCount
<=
moveAxis
.
CanErrorCountMax
)
{
//判断是否需要重新运动
if
(
StoreMove
.
CanWhileCount
>
0
)
{
LogUtil
.
error
(
LOGGER
,
moveAxis
.
DisplayStr
+
"收到原点完成信号,当前位置["
+
outCount
+
"],重新回原点,剩余["
+
StoreMove
.
CanWhileCount
+
"]次"
);
//LogUtil.error(LOGGER, StoreName + moveAxis.DisplayStr + "重新回原点");
ACServerManager
.
HomeMove
(
moveAxis
.
DeviceName
,
moveAxis
.
GetAxisValue
(),
moveAxis
.
HomeHighSpeed
);
StoreMove
.
CanWhileCount
--;
}
else
{
msg
=
StoreName
+
" storeMoveStep="
+
StoreMove
.
MoveStep
+
moveAxis
.
DisplayStr
+
"收到原点完成信号,当前位置["
+
outCount
+
"],误差过大,需要报警"
;
LogUtil
.
error
(
LOGGER
,
msg
);
return
false
;
}
return
true
;
}
else
//判断是否需要重新运动
if
(
StoreMove
.
CanWhileCount
>
0
)
{
return
true
;
LogUtil
.
error
(
LOGGER
,
moveAxis
.
DisplayStr
+
"收到原点完成信号,当前位置["
+
outCount
+
"],重新回原点,剩余["
+
StoreMove
.
CanWhileCount
+
"]次"
);
ACServerManager
.
HomeMove
(
moveAxis
.
DeviceName
,
moveAxis
.
GetAxisValue
(),
moveAxis
.
HomeHighSpeed
);
StoreMove
.
CanWhileCount
--;
}
return
true
;
else
{
msg
=
StoreName
+
" storeMoveStep="
+
StoreMove
.
MoveStep
+
moveAxis
.
DisplayStr
+
"收到原点完成信号,当前位置["
+
outCount
+
"],误差过大,需要报警"
;
LogUtil
.
error
(
LOGGER
,
msg
);
}
}
return
false
;
}
protected
bool
AxisCountClear
(
ConfigMoveAxis
moveAxis
)
{
return
true
;
}
}
}
...
...
source/DeviceLibrary/store/LineAlarm.cs
查看文件 @
6522a61
...
...
@@ -37,6 +37,10 @@ namespace OnlineStore.DeviceLibrary
/// </summary>
public
static
int
CompressAxisAlarm
=
14
;
/// <summary>
/// 轴五(自动轴)报警
/// </summary>
public
static
int
AutoAxisAlarm
=
20
;
/// <summary>
/// 轴异常停止(没有走到对应的位置就停止)
/// </summary>
public
static
int
AxisErrorStop
=
15
;
...
...
source/DeviceLibrary/store/StoreMoveStep.cs
查看文件 @
6522a61
...
...
@@ -307,10 +307,102 @@ namespace OnlineStore.DeviceLibrary
SI_14_GoBack
=
214
,
#
endregion
#
region
自动上下料机构复位
/// <summary>
/// 关闭门锁
/// </summary>
AUTO_R01_CloseDoor
=
1101
,
/// <summary>
/// 自动轴原点返回
/// </summary>
AUTO_R02_AutoAxisHome
=
1102
,
/// <summary>
/// 检测机构内是否有料盘
/// </summary>
AUTO_R03_AutoAxisHome
=
1103
,
/// <summary>
/// 上料轴返回0点
/// </summary>
AUTO_R04_AutoBack
=
1104
,
#
endregion
#
region
自动上下料上料功能
/// <summary>
/// 先上升到料盘检测1(上料机构)信号亮
/// </summary>
AUTO_I01_MoveToUp
,
/// <summary>
/// 吸盘下降
/// </summary>
AUTO_I02_SuckingDisc_Down
,
/// <summary>
/// 吸盘吸料盘
/// </summary>
AUTO_I03_SuckingDisc_Work
,
/// <summary>
/// 吸盘上升 ,同时上料轴也要上升
/// </summary>
AUTO_I04_SuckingDisc_Up
,
/// <summary>
/// 扫码
/// </summary>
AUTO_I05_ScanCode
,
/// <summary>
/// 等待料盘被叉子拿走
/// </summary>
AUTO_I06_WaitTrayLeave
,
/// <summary>
/// 打开仓门
/// </summary>
AUTO_I07_OpenDoor
,
/// <summary>
/// 等待拿走料盘
/// </summary>
AUTO_I08_WaitTakeTray
,
/// <summary>
/// 料盘已手动拿走,需要等一秒钟后关闭仓门
/// </summary>
AUTO_I09_TrayLeaveWaitTime
,
/// <summary>
/// 关闭仓门
/// </summary>
AUTO_I10_CloseDoor
,
#
endregion
#
region
自动上下料出料功能
/// <summary>
/// 吸盘吸走料盘,同时上料轴开始上升
/// </summary>
AUTO_O01_SuckingDisc_Work
,
/// <summary>
/// 等待1秒后吸盘下降
/// </summary>
AUTO_O02_WaitTimeDown
,
/// <summary>
/// 吸盘下降
/// </summary>
AUTO_O03_SuckingDisc_Down
,
/// <summary>
/// 放下料盘
/// </summary>
AUTO_O04_PutTrayDown
,
#
endregion
}
public
enum
StoreAlarmType
...
...
source/DeviceLibrary/store/model/StoreMoveInfo.cs
查看文件 @
6522a61
...
...
@@ -18,12 +18,12 @@ namespace OnlineStore.DeviceLibrary
/// 超时时间
/// </summary>
public
int
TimeOutSeconds
=
60
;
public
StoreMoveInfo
(
int
storeId
)
public
StoreMoveInfo
(
string
deviceName
)
{
moveType
=
StoreMoveType
.
None
;
MoveParam
=
new
InOutStoreParam
();
this
.
storeId
=
storeId
;
this
.
DeviceName
=
deviceName
;
this
.
moveStep
=
StoreMoveStep
.
Wait
;
IsInWait
=
false
;
MoveNum
=
0
;
...
...
@@ -54,7 +54,7 @@ namespace OnlineStore.DeviceLibrary
/// <summary>
/// 当前运动是哪个料仓
/// </summary>
public
int
storeId
{
get
;
set
;
}
public
string
DeviceName
{
get
;
set
;
}
/// <summary>
/// 是否再当前步骤等待中
...
...
@@ -144,6 +144,7 @@ namespace OnlineStore.DeviceLibrary
{
private
WaitResultInfo
()
{
IsEnd
=
false
;
}
public
static
WaitResultInfo
WaitIO
(
string
ioType
,
IO_VALUE
ioValue
)
...
...
@@ -233,14 +234,65 @@ namespace OnlineStore.DeviceLibrary
return
wait
;
}
public
static
WaitResultInfo
WaitHeight
(
int
height
)
//public static WaitResultInfo WaitHeight(int height)
//{
// WaitResultInfo wait = new WaitResultInfo();
// wait.WaitType = 7;
// wait.HeightValue = height;
// wait.IsEnd = false;
// return wait;
//}
/// <summary>
/// 等待轴的反限位为指定值
/// </summary>
public
static
WaitResultInfo
WaitAxistNegativeLimit
(
ConfigMoveAxis
moveAxis
,
IO_VALUE
ioValue
)
{
WaitResultInfo
wait
=
new
WaitResultInfo
();
wait
.
WaitType
=
7
;
wait
.
HeightValue
=
height
;
WaitResultInfo
wait
=
new
WaitResultInfo
();
wait
.
CanWhileMoveCount
=
0
;
wait
.
WaitType
=
8
;
wait
.
AxisInfo
=
moveAxis
;
wait
.
IsHomeMove
=
true
;
wait
.
IoValue
=
ioValue
;
wait
.
IsEnd
=
false
;
return
wait
;
}
/// <summary>
/// 等待轴的正限位为指定值
/// </summary>
public
static
WaitResultInfo
WaitAxistPositiveLimit
(
ConfigMoveAxis
moveAxis
,
IO_VALUE
ioValue
)
{
WaitResultInfo
wait
=
new
WaitResultInfo
();
wait
.
CanWhileMoveCount
=
0
;
wait
.
WaitType
=
9
;
wait
.
AxisInfo
=
moveAxis
;
wait
.
IsHomeMove
=
true
;
wait
.
IoValue
=
ioValue
;
wait
.
IsEnd
=
false
;
return
wait
;
}
/// <summary>
/// 等待上料轴运动 停止
/// </summary>
/// <returns></returns>
public
static
WaitResultInfo
WaitAutoAxisStop
(
ConfigMoveAxis
moveAxis
)
{
WaitResultInfo
wait
=
new
WaitResultInfo
();
wait
.
CanWhileMoveCount
=
0
;
wait
.
AxisInfo
=
moveAxis
;
wait
.
WaitType
=
10
;
wait
.
IsHomeMove
=
true
;
wait
.
IsEnd
=
false
;
return
wait
;
}
public
static
WaitResultInfo
WaitCodeOK
()
{
WaitResultInfo
wait
=
new
WaitResultInfo
();
wait
.
WaitType
=
11
;
return
wait
;
}
public
string
ToStr
()
{
if
(
WaitType
==
1
)
...
...
@@ -273,10 +325,26 @@ namespace OnlineStore.DeviceLibrary
else
if
(
WaitType
==
6
)
{
return
"轴【"
+
AxisInfo
.
DisplayStr
+
"】ORG信号:【"
+
IoValue
+
"】 "
;
}
else
if
(
WaitType
==
7
)
}
else
if
(
WaitType
==
7
)
{
return
"料盘高度【"
+
HeightValue
+
"】 "
;
}
else
if
(
WaitType
==
8
)
{
return
"轴【"
+
AxisInfo
.
DisplayStr
+
"】负限位:【"
+
IoValue
+
"】 "
;
}
else
if
(
WaitType
==
9
)
{
return
"轴【"
+
AxisInfo
.
DisplayStr
+
"】正限位:【"
+
IoValue
+
"】 "
;
}
else
if
(
WaitType
==
10
)
{
return
"上料轴运动停止 "
;
}
else
if
(
WaitType
==
11
)
{
return
"等待扫码结束"
;
}
else
{
return
"Wait位置类型:WaitType=【"
+
WaitType
+
"】"
;
...
...
@@ -288,6 +356,8 @@ namespace OnlineStore.DeviceLibrary
public
int
CanWhileMoveCount
{
get
;
set
;
}
/// <summary>
/// 等待结果,1=轴运动,2=IO运动,3=时间,4=电钢,5=硕科电机,6=等待轴原点信号
/// 7=等待高度为0,8=等待轴的负限位,9=等待轴的正限位。10=上料轴运动停止
/// 11=扫码结束。
/// </summary>
public
int
WaitType
{
get
;
set
;
}
/// <summary>
...
...
source/LoadCVSLibrary/storeConfig/config/AUTO_SA_Config.cs
查看文件 @
6522a61
...
...
@@ -471,27 +471,27 @@ namespace OnlineStore.LoadCSVLibrary
public
string
Humiture_Port
{
get
;
set
;
}
/// <summary>
/// PRO 模拟量IO模块的IP地址 AIDevice_IP 192.168.200.11
/// </summary>
[
ConfigProAttribute
(
"AIDevice_IP"
,
true
)]
public
string
AIDevice_IP
{
get
;
set
;
}
///
//
<summary>
///
//
PRO 模拟量IO模块的IP地址 AIDevice_IP 192.168.200.11
///
//
</summary>
//
[ConfigProAttribute("AIDevice_IP", true)]
//
public string AIDevice_IP { get; set; }
/// <summary>
/// PRO,模拟信号1默认高度,AIDI1_DefaultPosition,1,,,,,,,
/// </summary>
[
ConfigProAttribute
(
"AIDI1_DefaultPosition"
,
true
)]
public
double
AIDI1_DefaultPosition
{
get
;
set
;
}
/// <summary>
/// PRO,模拟信号2默认高度,AIDI2_DefaultPosition,1,,,,,,,
/// </summary>
[
ConfigProAttribute
(
"AIDI2_DefaultPosition"
,
true
)]
public
double
AIDI2_DefaultPosition
{
get
;
set
;
}
/// <summary>
/// PRO,模拟信号3默认高度,AIDI3_DefaultPosition,1,,,,,,,
/// </summary>
[
ConfigProAttribute
(
"AIDI3_DefaultPosition"
,
true
)]
public
double
AIDI3_DefaultPosition
{
get
;
set
;
}
///
//
<summary>
///
//
PRO,模拟信号1默认高度,AIDI1_DefaultPosition,1,,,,,,,
///
//
</summary>
//
[ConfigProAttribute("AIDI1_DefaultPosition", true)]
//
public double AIDI1_DefaultPosition { get; set; }
///
//
<summary>
///
//
PRO,模拟信号2默认高度,AIDI2_DefaultPosition,1,,,,,,,
///
//
</summary>
//
[ConfigProAttribute("AIDI2_DefaultPosition", true)]
//
public double AIDI2_DefaultPosition { get; set; }
///
//
<summary>
///
//
PRO,模拟信号3默认高度,AIDI3_DefaultPosition,1,,,,,,,
///
//
</summary>
//
[ConfigProAttribute("AIDI3_DefaultPosition", true)]
//
public double AIDI3_DefaultPosition { get; set; }
/// <summary>
...
...
@@ -647,8 +647,8 @@ namespace OnlineStore.LoadCSVLibrary
MustHaveDIList
.
Add
(
IO_Type
.
WidthCheck2
);
MustHaveDIList
.
Add
(
IO_Type
.
TrayCheck_LoadMaterial
);
MustHaveDIList
.
Add
(
IO_Type
.
OutCheck
);
MustHaveDIList
.
Add
(
IO_Type
.
Door_Open
);
MustHaveDIList
.
Add
(
IO_Type
.
Door_Close
);
MustHaveDIList
.
Add
(
IO_Type
.
Auto
Door_Open
);
MustHaveDIList
.
Add
(
IO_Type
.
Auto
Door_Close
);
MustHaveDIList
.
Add
(
IO_Type
.
TrayCheck_Fixture
);
MustHaveDIList
.
Add
(
IO_Type
.
CompressAxis_Check
);
...
...
@@ -671,8 +671,8 @@ namespace OnlineStore.LoadCSVLibrary
MustHaveDOList
.
Add
(
IO_Type
.
Door_Down
);
MustHaveDOList
.
Add
(
IO_Type
.
SuckingDisc_Up
);
MustHaveDOList
.
Add
(
IO_Type
.
SuckingDisc_Down
);
MustHaveDOList
.
Add
(
IO_Type
.
Door_Open
);
MustHaveDOList
.
Add
(
IO_Type
.
Door_Close
);
MustHaveDOList
.
Add
(
IO_Type
.
Auto
Door_Open
);
MustHaveDOList
.
Add
(
IO_Type
.
Auto
Door_Close
);
}
public
static
void
ConfigAxis
(
AUTO_SA_Config
Config
)
{
...
...
source/LoadCVSLibrary/storeConfig/config/Store_IO_Type.cs
查看文件 @
6522a61
...
...
@@ -138,11 +138,11 @@ namespace OnlineStore.LoadCSVLibrary
/// <summary>
/// 门锁气缸打开端 Door_Open X13 DI-13
/// </summary>
public
static
string
Door_Open
=
"Door_Open"
;
public
static
string
Auto
Door_Open
=
"Door_Open"
;
/// <summary>
/// 门锁气缸关闭端 Door_Close X14 DI-14
/// </summary>
public
static
string
Door_Close
=
"Door_Close"
;
public
static
string
Auto
Door_Close
=
"Door_Close"
;
/// <summary>
/// 料盘检测2(料叉机构) TrayCheck_Fixture X15 DI-15
/// </summary>
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论