Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
刘韬
/
SO815-AutoInOutStore
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
图表
网络
创建新的问题
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit 6f82d41d
由
LN
编写于
2019-09-02 09:16:02 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
1
1 个父辈
6d2f5ddc
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
82 行增加
和
39 行删除
source/DeviceLibrary/DeviceLibrary/IO/AIOBOX/AIOBOXManager.cs
source/DeviceLibrary/DeviceLibrary/IO/IOManager.cs
source/DeviceLibrary/StoreConfig/AC/StoreConfig.csv
source/DeviceLibrary/DeviceLibrary/IO/AIOBOX/AIOBOXManager.cs
查看文件 @
6f82d41
...
@@ -27,6 +27,52 @@ namespace OnlineStore.DeviceLibrary
...
@@ -27,6 +27,52 @@ namespace OnlineStore.DeviceLibrary
private
object
DILock
=
""
;
private
object
DILock
=
""
;
private
object
DOLock
=
""
;
private
object
DOLock
=
""
;
private
List
<
string
>
IoIPLIst
=
new
List
<
string
>();
private
System
.
Timers
.
Timer
conTimer
=
null
;
public
override
void
ConnectionIOList
(
List
<
string
>
DIONameList
)
{
if
(
conTimer
==
null
)
{
conTimer
=
new
System
.
Timers
.
Timer
();
conTimer
.
AutoReset
=
true
;
conTimer
.
Interval
=
60000
;
conTimer
.
Elapsed
+=
ConTimer_Elapsed
;
}
conTimer
.
Enabled
=
false
;
IoIPLIst
=
new
List
<
string
>(
DIONameList
);
foreach
(
string
ip
in
DIONameList
)
{
ConnectionIP
(
ip
);
}
if
(
IoIPLIst
.
Count
>
0
)
{
//启动定时器,1一分钟重连一次
conTimer
.
Start
();
}
}
private
void
ConTimer_Elapsed
(
object
sender
,
System
.
Timers
.
ElapsedEventArgs
e
)
{
try
{
List
<
string
>
list
=
new
List
<
string
>(
IoIPLIst
);
if
(
list
.
Count
>
0
)
{
foreach
(
string
ip
in
list
)
{
LogUtil
.
info
(
"重连AOI :"
+
ip
);
ConnectionIP
(
ip
);
}
}
}
catch
(
Exception
ex
)
{
LogUtil
.
error
(
"AOI ConTimer_Elapsed 出错: "
+
ex
.
ToString
());
}
}
public
void
ConnectionIP
(
string
ioIp
)
public
void
ConnectionIP
(
string
ioIp
)
{
{
AIOBOX
aioBox
=
null
;
AIOBOX
aioBox
=
null
;
...
@@ -82,8 +128,8 @@ namespace OnlineStore.DeviceLibrary
...
@@ -82,8 +128,8 @@ namespace OnlineStore.DeviceLibrary
//aioBox.Log_RxTx_Event += AioBox_Log_RxTx_Event;
//aioBox.Log_RxTx_Event += AioBox_Log_RxTx_Event;
AIOMap
.
Add
(
ioIp
,
aioBox
);
AIOMap
.
Add
(
ioIp
,
aioBox
);
LogUtil
.
debug
(
"开始连接"
+
logName
+
",尝试重连
5
次"
);
LogUtil
.
debug
(
"开始连接"
+
logName
+
",尝试重连
3
次"
);
for
(
int
i
=
1
;
i
<=
5
;
i
++)
for
(
int
i
=
1
;
i
<=
3
;
i
++)
{
{
bool
result
=
aioBox
.
Connect
();
bool
result
=
aioBox
.
Connect
();
if
(
result
)
if
(
result
)
...
@@ -92,6 +138,10 @@ namespace OnlineStore.DeviceLibrary
...
@@ -92,6 +138,10 @@ namespace OnlineStore.DeviceLibrary
Thread
.
Sleep
(
10
);
Thread
.
Sleep
(
10
);
//读取所有的DO
//读取所有的DO
ReadAllDI
(
ioIp
,
0
);
ReadAllDI
(
ioIp
,
0
);
if
(
IoIPLIst
.
Contains
(
ioIp
))
{
IoIPLIst
.
Remove
(
ioIp
);
}
break
;
break
;
}
}
else
else
...
@@ -258,13 +308,6 @@ namespace OnlineStore.DeviceLibrary
...
@@ -258,13 +308,6 @@ namespace OnlineStore.DeviceLibrary
}
}
public
override
void
ConnectionIOList
(
List
<
string
>
DIONameList
)
{
foreach
(
string
ip
in
DIONameList
)
{
ConnectionIP
(
ip
);
}
}
//关闭所有的DO
//关闭所有的DO
public
override
void
CloseAllDO
()
public
override
void
CloseAllDO
()
...
...
source/DeviceLibrary/DeviceLibrary/IO/IOManager.cs
查看文件 @
6f82d41
...
@@ -11,33 +11,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -11,33 +11,7 @@ namespace OnlineStore.DeviceLibrary
public
abstract
class
IOManager
public
abstract
class
IOManager
{
{
public
static
IOManager
instance
=
null
;
public
static
IOManager
instance
=
null
;
protected
static
ushort
GetDILength
(
string
ioIp
)
{
try
{
return
StoreManager
.
Config
.
GetDILength
(
ioIp
);
}
catch
(
Exception
ex
)
{
}
return
16
;
}
protected
static
ushort
GetDOLength
(
string
ioIp
)
{
try
{
return
StoreManager
.
Config
.
GetDOLength
(
ioIp
);
}
catch
(
Exception
ex
)
{
}
return
16
;
}
public
abstract
void
ConnectionIOList
(
List
<
string
>
dIODeviceNameList
);
#
region
KNDIO
#
region
KNDIO
...
@@ -108,6 +82,33 @@ namespace OnlineStore.DeviceLibrary
...
@@ -108,6 +82,33 @@ namespace OnlineStore.DeviceLibrary
instance
=
new
KNDManager
();
instance
=
new
KNDManager
();
}
}
}
}
protected
static
ushort
GetDILength
(
string
ioIp
)
{
try
{
return
StoreManager
.
Config
.
GetDILength
(
ioIp
);
}
catch
(
Exception
ex
)
{
}
return
16
;
}
protected
static
ushort
GetDOLength
(
string
ioIp
)
{
try
{
return
StoreManager
.
Config
.
GetDOLength
(
ioIp
);
}
catch
(
Exception
ex
)
{
}
return
16
;
}
public
abstract
void
ConnectionIOList
(
List
<
string
>
dIODeviceNameList
);
public
abstract
void
ReadAllDI
(
string
deviceName
,
byte
slaveId
);
public
abstract
void
ReadAllDI
(
string
deviceName
,
byte
slaveId
);
public
abstract
void
ReadAllDO
(
string
deviceName
,
byte
slaveId
);
public
abstract
void
ReadAllDO
(
string
deviceName
,
byte
slaveId
);
...
...
source/DeviceLibrary/StoreConfig/AC/StoreConfig.csv
查看文件 @
6f82d41
...
@@ -80,8 +80,8 @@ PRO,升降轴从吸盘下方接料后下降的高度,UpDownAxis_DownValue,10000,,,,,,,
...
@@ -80,8 +80,8 @@ PRO,升降轴从吸盘下方接料后下降的高度,UpDownAxis_DownValue,10000,,,,,,,
PRO,升降轴 入库P1点集合,UpDownAxis_P1_List,8#385000;12#385000;16#380000;20#380000;24#375000;28#370000;32#370000;36#370000;40#370000;52#370000;75#345000;,,,,,,,
PRO,升降轴 入库P1点集合,UpDownAxis_P1_List,8#385000;12#385000;16#380000;20#380000;24#375000;28#370000;32#370000;36#370000;40#370000;52#370000;75#345000;,,,,,,,
PRO,旋转轴(轴一)P1 待机原位点,MiddleAxis_P1_Position,218700,,,,,,,
PRO,旋转轴(轴一)P1 待机原位点,MiddleAxis_P1_Position,218700,,,,,,,
PRO,进出轴(轴三)P1待机原位点,InOutAxis_P1_Position,1000,,,,,,,
PRO,进出轴(轴三)P1待机原位点,InOutAxis_P1_Position,1000,,,,,,,
PRO,压紧轴
(轴4)
P1待机原位点,CompressAxis_P1_Position,-25000,,,,,,,
PRO,压紧轴
(轴四)
P1待机原位点,CompressAxis_P1_Position,-25000,,,,,,,
PRO,压紧轴
(轴4)
P2压紧点集合,CompressAxis_P2_List,8#-215000;12#-215000;16#-205000;20#-200000;24#-185000;28#-170000;32#-160000;36#-150000;40#-140000;44#-130000;48#-120000;52#-120000;75#-50000;,,,,,,,
PRO,压紧轴
(轴四)
P2压紧点集合,CompressAxis_P2_List,8#-215000;12#-215000;16#-205000;20#-200000;24#-185000;28#-170000;32#-160000;36#-150000;40#-140000;44#-130000;48#-120000;52#-120000;75#-50000;,,,,,,,
PRO,是否使用定位气缸,IsHasLocationCylinder,0,,,,,,,
PRO,是否使用定位气缸,IsHasLocationCylinder,0,,,,,,,
PRO,是否有左右侧门,IsHasDoorLimit,1,,,,,,,
PRO,是否有左右侧门,IsHasDoorLimit,1,,,,,,,
PRO,是否使用压紧轴(1=使用),IsHasCompress_Axis,1,,,,,,,
PRO,是否使用压紧轴(1=使用),IsHasCompress_Axis,1,,,,,,,
...
@@ -180,4 +180,3 @@ PRO,(轴四)压紧轴P2速度,CompAxis_P2_Speed,100,,,,,,,
...
@@ -180,4 +180,3 @@ PRO,(轴四)压紧轴P2速度,CompAxis_P2_Speed,100,,,,,,,
PRO,(轴四)压紧轴P3速度,CompAxis_P3_Speed,100,,,,,,,
PRO,(轴四)压紧轴P3速度,CompAxis_P3_Speed,100,,,,,,,
,,,,,,,,, ,
,,,,,,,,, ,
PRO,特殊二维码尺寸配置,CodeSizeConfig,XA=13x48#XB=13x32#FA=7x32,,,,,,,
PRO,特殊二维码尺寸配置,CodeSizeConfig,XA=13x48#XB=13x32#FA=7x32,,,,,,,
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论