Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
刘韬
/
SO815-AutoInOutStore
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
图表
网络
创建新的问题
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit 8e192785
由
几米阳光
编写于
2019-05-15 09:37:49 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
0515调试修改。
1 个父辈
22f5946d
隐藏空白字符变更
内嵌
并排
正在显示
10 个修改的文件
包含
215 行增加
和
76 行删除
dll/Asa.IOModule.AIOBOX.dll
dll/Asa.IOModule.AIOBOX.xml
source/ACSingleStore/App.config
source/ACSingleStore/记录.txt
source/DeviceLibrary/DeviceLibrary/IO/AIOBOX/AIOBOXManager.cs
source/DeviceLibrary/DeviceLibrary/IO/IOManager.cs
source/DeviceLibrary/DeviceLibrary/ShuoKe/MeteringSignalBean.cs
source/DeviceLibrary/DeviceLibrary/ShuoKe/ShuoKeController.cs
source/DeviceLibrary/acSingleStore/AC_SA_BoxBean_Partial.cs
source/DeviceLibrary/acSingleStore/AutomaticBaiting_Partial.cs
dll/Asa.IOModule.AIOBOX.dll
查看文件 @
8e19278
此文件类型无法预览
dll/Asa.IOModule.AIOBOX.xml
查看文件 @
8e19278
...
@@ -4,11 +4,6 @@
...
@@ -4,11 +4,6 @@
<name>
Asa.IOModule.AIOBOX
</name>
<name>
Asa.IOModule.AIOBOX
</name>
</assembly>
</assembly>
<members>
<members>
<member
name=
"T:Asa.IOModule.AIOBOX1"
>
<summary>
AIOBOX操作类
</summary>
</member>
<member
name=
"T:Asa.IOModule.AIOBOX"
>
<member
name=
"T:Asa.IOModule.AIOBOX"
>
<summary>
<summary>
AIOBOX操作类
AIOBOX操作类
...
@@ -59,7 +54,20 @@
...
@@ -59,7 +54,20 @@
</member>
</member>
<member
name=
"E:Asa.IOModule.AIOBOX.Log_RxTx_Event"
>
<member
name=
"E:Asa.IOModule.AIOBOX.Log_RxTx_Event"
>
<summary>
<summary>
日志输出事件
日志输出事件,发送命令的标识减去接收命令的标识
</summary>
</member>
<member
name=
"T:Asa.IOModule.AIOBOX.Reconnect"
>
<summary>
断开重连
</summary>
<param
name=
"box"
></param>
<param
name=
"times"
>
断开次数
</param>
<param
name=
"conn"
></param>
</member>
<member
name=
"E:Asa.IOModule.AIOBOX.Reconnect_Event"
>
<summary>
断开重连事件
</summary>
</summary>
</member>
</member>
<member
name=
"M:Asa.IOModule.AIOBOX.#ctor"
>
<member
name=
"M:Asa.IOModule.AIOBOX.#ctor"
>
...
@@ -87,16 +95,6 @@
...
@@ -87,16 +95,6 @@
错误信息
错误信息
</summary>
</summary>
</member>
</member>
<member
name=
"P:Asa.IOModule.AIOBOX.AutoReadDI"
>
<summary>
自动读取DI状态,触发DI_Changed_Event
</summary>
</member>
<member
name=
"P:Asa.IOModule.AIOBOX.AutoReadDO"
>
<summary>
自动读取DO状态,触发DO_Changed_Event
</summary>
</member>
<member
name=
"P:Asa.IOModule.AIOBOX.LogOut"
>
<member
name=
"P:Asa.IOModule.AIOBOX.LogOut"
>
<summary>
<summary>
日志输出
日志输出
...
@@ -118,6 +116,20 @@
...
@@ -118,6 +116,20 @@
关闭连接
关闭连接
</summary>
</summary>
</member>
</member>
<member
name=
"M:Asa.IOModule.AIOBOX.AutoReadDI(System.Boolean,System.Int32)"
>
<summary>
自动读取DI状态,触发DI_Changed_Event
</summary>
<param
name=
"read"
>
是否自动读取
</param>
<param
name=
"sleep"
>
间隔,必须大于10ms
</param>
</member>
<member
name=
"M:Asa.IOModule.AIOBOX.AutoReadDO(System.Boolean,System.Int32)"
>
<summary>
自动读取DO状态,触发DO_Changed_Event
</summary>
<param
name=
"read"
>
是否自动读取
</param>
<param
name=
"sleep"
>
间隔,必须大于10ms
</param>
</member>
<member
name=
"M:Asa.IOModule.AIOBOX.ReverseStatus(Asa.IOModule.Box_Sta)"
>
<member
name=
"M:Asa.IOModule.AIOBOX.ReverseStatus(Asa.IOModule.Box_Sta)"
>
<summary>
<summary>
相反状态
相反状态
...
@@ -163,6 +175,35 @@
...
@@ -163,6 +175,35 @@
<param
name=
"sta"
></param>
<param
name=
"sta"
></param>
<returns></returns>
<returns></returns>
</member>
</member>
<member
name=
"M:Asa.IOModule.AIOBOX.GetLocalIP"
>
<summary>
获取本地IPv4地址
</summary>
<returns></returns>
</member>
<member
name=
"M:Asa.IOModule.AIOBOX.Send"
>
<summary>
发送命令
</summary>
</member>
<member
name=
"M:Asa.IOModule.AIOBOX.Receive"
>
<summary>
接收命令
</summary>
</member>
<member
name=
"M:Asa.IOModule.AIOBOX.ReadSingle(System.Byte[])"
>
<summary>
读取单个DO
</summary>
<param
name=
"buff"
></param>
</member>
<member
name=
"M:Asa.IOModule.AIOBOX.ReadDO(System.Byte[])"
>
<summary>
读取所有DO状态
</summary>
<param
name=
"buff"
></param>
<returns></returns>
</member>
<member
name=
"M:Asa.IOModule.AIOBOX.ReadDI(System.Byte[])"
>
<member
name=
"M:Asa.IOModule.AIOBOX.ReadDI(System.Byte[])"
>
<summary>
<summary>
读取所有DI状态
读取所有DI状态
...
@@ -175,7 +216,7 @@
...
@@ -175,7 +216,7 @@
</summary>
</summary>
<returns></returns>
<returns></returns>
</member>
</member>
<member
name=
"M:Asa.IOModule.AIOBOX.Trigger
_
DIO"
>
<member
name=
"M:Asa.IOModule.AIOBOX.TriggerDIO"
>
<summary>
<summary>
触发DIO改变事件
触发DIO改变事件
</summary>
</summary>
...
@@ -185,7 +226,12 @@
...
@@ -185,7 +226,12 @@
日志输出线程
日志输出线程
</summary>
</summary>
</member>
</member>
<member
name=
"M:Asa.IOModule.AIOBOX.Auto_Read_DIO"
>
<member
name=
"M:Asa.IOModule.AIOBOX.AutoReadDI"
>
<summary>
自动读取DIO线程
</summary>
</member>
<member
name=
"M:Asa.IOModule.AIOBOX.AutoReadDO"
>
<summary>
<summary>
自动读取DIO线程
自动读取DIO线程
</summary>
</summary>
...
@@ -201,6 +247,16 @@
...
@@ -201,6 +247,16 @@
</summary>
</summary>
<param
name=
"args"
></param>
<param
name=
"args"
></param>
</member>
</member>
<member
name=
"M:Asa.IOModule.AIOBOX.Reconn"
>
<summary>
断开重连
</summary>
</member>
<member
name=
"M:Asa.IOModule.AIOBOX.CloseConn"
>
<summary>
关闭连接
</summary>
</member>
<member
name=
"T:Asa.IOModule.Reg"
>
<member
name=
"T:Asa.IOModule.Reg"
>
<summary>
<summary>
IO模块寄存器
IO模块寄存器
...
@@ -449,6 +505,11 @@
...
@@ -449,6 +505,11 @@
32位,16DI + 16DO
32位,16DI + 16DO
</summary>
</summary>
</member>
</member>
<member
name=
"F:Asa.IOModule.Box_Type.DO_16"
>
<summary>
16位DO
</summary>
</member>
<member
name=
"T:Asa.IOModule.Box_Sta"
>
<member
name=
"T:Asa.IOModule.Box_Sta"
>
<summary>
<summary>
IO模块寄存器状态
IO模块寄存器状态
...
...
source/ACSingleStore/App.config
查看文件 @
8e19278
...
@@ -42,7 +42,9 @@
...
@@ -42,7 +42,9 @@
<
add
key
=
"HasDisableDoorControl"
value
=
"1"
/>
<
add
key
=
"HasDisableDoorControl"
value
=
"1"
/>
<
add
key
=
"ACBaudRate"
value
=
"115200"
/>
<
add
key
=
"ACBaudRate"
value
=
"115200"
/>
<
add
key
=
"Default_Language"
value
=
"zh-CN"
/>
<
add
key
=
"Default_Language"
value
=
"zh-CN"
/>
<
add
key
=
"UseAIOBOX"
value
=
"1"
/>
<
add
key
=
"UseAIOBOX"
value
=
"1"
/>
<
add
key
=
"DIMS"
value
=
"40"
/>
<
add
key
=
"DOMS"
value
=
"200"
/>
</
appSettings
>
</
appSettings
>
<
log4net
>
<
log4net
>
<
appender
name
=
"RollingLogFileAppender"
type
=
"log4net.Appender.RollingFileAppender"
>
<
appender
name
=
"RollingLogFileAppender"
type
=
"log4net.Appender.RollingFileAppender"
>
...
...
source/ACSingleStore/记录.txt
查看文件 @
8e19278
...
@@ -166,10 +166,15 @@ PRO,最后一盘料需要补充的高度,LastTrayAddHeight,10,,,,,,,,,
...
@@ -166,10 +166,15 @@ PRO,最后一盘料需要补充的高度,LastTrayAddHeight,10,,,,,,,,,
压紧轴需要运动一段时间自动回原点。
压紧轴需要运动一段时间自动回原点。
复位时自动出入库会清理
复位时自动出入库会清理
IO模块增加重连功能。
IO模块增加重连功能。
20190515
压紧轴计量检测改为20毫秒读一次。
吸盘上升下降增加重复写,批量轴匀速运动增加重写功能。
IO模块读取时间改为可配置。
...
...
source/DeviceLibrary/DeviceLibrary/IO/AIOBOX/AIOBOXManager.cs
查看文件 @
8e19278
...
@@ -19,7 +19,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -19,7 +19,7 @@ namespace OnlineStore.DeviceLibrary
public
readonly
ILog
LOGGER
=
LogManager
.
GetLogger
(
MethodBase
.
GetCurrentMethod
().
DeclaringType
);
public
readonly
ILog
LOGGER
=
LogManager
.
GetLogger
(
MethodBase
.
GetCurrentMethod
().
DeclaringType
);
public
Dictionary
<
string
,
AIOBOX
>
AIOMap
=
new
Dictionary
<
string
,
AIOBOX
>();
public
Dictionary
<
string
,
AIOBOX
>
AIOMap
=
new
Dictionary
<
string
,
AIOBOX
>();
public
string
DefaultIP
=
""
;
public
Dictionary
<
string
,
List
<
Box_Sta
>>
DIValueMap
=
new
Dictionary
<
string
,
List
<
Box_Sta
>>();
public
Dictionary
<
string
,
List
<
Box_Sta
>>
DIValueMap
=
new
Dictionary
<
string
,
List
<
Box_Sta
>>();
public
Dictionary
<
string
,
List
<
Box_Sta
>>
DOValueMap
=
new
Dictionary
<
string
,
List
<
Box_Sta
>>();
public
Dictionary
<
string
,
List
<
Box_Sta
>>
DOValueMap
=
new
Dictionary
<
string
,
List
<
Box_Sta
>>();
private
object
DIMapLock
=
""
;
private
object
DIMapLock
=
""
;
...
@@ -54,10 +54,21 @@ namespace OnlineStore.DeviceLibrary
...
@@ -54,10 +54,21 @@ namespace OnlineStore.DeviceLibrary
// Create new modbus master and add event functions
// Create new modbus master and add event functions
aioBox
=
new
AIOBOX
();
aioBox
=
new
AIOBOX
();
aioBox
.
IP
=
ioIp
;
aioBox
.
IP
=
ioIp
;
DefaultIP
=
ioIp
;
int
DIMS
=
ConfigAppSettings
.
GetIntValue
(
"DIMS"
);
aioBox
.
AutoReadDI
=
true
;
if
(
DIMS
<
20
)
aioBox
.
AutoReadDO
=
true
;
{
DIMS
=
20
;
}
int
DOMS
=
ConfigAppSettings
.
GetIntValue
(
"DOMS"
);
if
(
DOMS
<
200
)
{
DOMS
=
200
;
}
aioBox
.
AutoReadDI
(
true
,
DIMS
);
aioBox
.
AutoReadDO
(
true
,
DOMS
);
aioBox
.
LogOut
=
true
;
aioBox
.
LogOut
=
true
;
aioBox
.
Reconnect_Event
+=
AioBox_Reconnect_Event
;
if
(
StoreManager
.
Config
.
GetDILength
(
ioIp
).
Equals
(
8
))
if
(
StoreManager
.
Config
.
GetDILength
(
ioIp
).
Equals
(
8
))
{
{
aioBox
.
Type
=
Box_Type
.
DIO_16
;
aioBox
.
Type
=
Box_Type
.
DIO_16
;
...
@@ -69,8 +80,9 @@ namespace OnlineStore.DeviceLibrary
...
@@ -69,8 +80,9 @@ namespace OnlineStore.DeviceLibrary
aioBox
.
DI_Changed_Event
+=
AioBox_DI_Changed_Event
;
;
aioBox
.
DI_Changed_Event
+=
AioBox_DI_Changed_Event
;
;
aioBox
.
DO_Changed_Event
+=
AioBox_DO_Changed_Event
;
aioBox
.
DO_Changed_Event
+=
AioBox_DO_Changed_Event
;
aioBox
.
Log_Out_Event
+=
AioBox_Log_Out_Event
;
aioBox
.
Log_Out_Event
+=
AioBox_Log_Out_Event
;
aioBox
.
Log_RxTx_Event
+=
AioBox_Log_RxTx_Event
;
AIOMap
.
Add
(
ioIp
,
aioBox
);
AIOMap
.
Add
(
ioIp
,
aioBox
);
LogUtil
.
info
(
"开始连接IO模块
【"
+
ioIp
+
"】
,尝试重连三次"
);
LogUtil
.
info
(
"开始连接IO模块
["
+
ioIp
+
"["
+
DIMS
+
"]["
+
DOMS
+
"]
,尝试重连三次"
);
for
(
int
i
=
1
;
i
<=
3
;
i
++)
for
(
int
i
=
1
;
i
<=
3
;
i
++)
{
{
bool
result
=
aioBox
.
Connect
();
bool
result
=
aioBox
.
Connect
();
...
@@ -103,14 +115,34 @@ namespace OnlineStore.DeviceLibrary
...
@@ -103,14 +115,34 @@ namespace OnlineStore.DeviceLibrary
}
}
}
}
private
void
AioBox_
Log_Out_Event
(
AIOBOX
box
,
string
[]
s
)
private
void
AioBox_
Reconnect_Event
(
AIOBOX
box
,
int
times
,
ref
bool
conn
)
{
{
foreach
(
string
str
in
s
)
conn
=
true
;
LogUtil
.
error
(
"重连AIO模块【"
+
box
.
IP
+
"】次数:"
+
times
+
"【"
+
box
.
ErrInfo
+
"】"
);
}
private
DateTime
lastLogTime
=
DateTime
.
Now
;
private
void
AioBox_Log_RxTx_Event
(
AIOBOX
box
,
string
[]
s
)
{
TimeSpan
span
=
DateTime
.
Now
-
lastLogTime
;
if
(
span
.
TotalMinutes
>
1
)
{
{
LogUtil
.
AIOLog
.
Debug
(
"["
+
box
.
IP
+
"]"
+
str
);
lastLogTime
=
DateTime
.
Now
;
foreach
(
string
str
in
s
)
{
LogUtil
.
AIOLog
.
Debug
(
"["
+
box
.
IP
+
"]"
+
str
);
}
}
}
}
}
private
void
AioBox_Log_Out_Event
(
AIOBOX
box
,
string
[]
s
)
{
//foreach (string str in s)
//{
// LogUtil.AIOLog.Debug( "["+box.IP+"]"+ str);
//}
}
private
void
AioBox_DI_Changed_Event
(
AIOBOX
box
,
Box_Sta
[]
sta
)
private
void
AioBox_DI_Changed_Event
(
AIOBOX
box
,
Box_Sta
[]
sta
)
{
{
try
try
...
@@ -213,25 +245,25 @@ namespace OnlineStore.DeviceLibrary
...
@@ -213,25 +245,25 @@ namespace OnlineStore.DeviceLibrary
try
try
{
{
List
<
string
>
list
=
new
List
<
string
>(
AIOMap
.
Keys
);
//
List<string> list = new List<string>(AIOMap.Keys);
foreach
(
string
io
in
list
)
//
foreach (string io in list)
{
//
{
//判断是否连接,如果没有连接自动重连
//
//判断是否连接,如果没有连接自动重连
AIOBOX
client
=
AIOMap
[
io
];
//
AIOBOX client = AIOMap[io];
if
(!
client
.
IsConn
)
//
if (!client.IsConn)
{
//
{
//重连
//
//重连
bool
result
=
client
.
Connect
();
//
bool result = client.Connect();
if
(
result
)
//
if (result)
{
//
{
LogUtil
.
info
(
"重连O模块【"
+
client
.
IP
+
"】成功:"
+
client
.
ErrInfo
);
//
LogUtil.info("重连O模块【" + client.IP + "】成功:" + client.ErrInfo);
}
//
}
else
//
else
{
//
{
LogUtil
.
error
(
"重连O模块【"
+
client
.
IP
+
"】失败:"
+
client
.
ErrInfo
);
//
LogUtil.error("重连O模块【" + client.IP + "】失败:" + client.ErrInfo);
}
//
}
}
//
}
}
//
}
}
}
catch
(
Exception
ex
)
catch
(
Exception
ex
)
{
{
...
...
source/DeviceLibrary/DeviceLibrary/IO/IOManager.cs
查看文件 @
8e19278
...
@@ -57,6 +57,20 @@ namespace OnlineStore.DeviceLibrary
...
@@ -57,6 +57,20 @@ namespace OnlineStore.DeviceLibrary
}
}
return
ioValue
;
return
ioValue
;
}
}
public
static
IO_VALUE
DOValue
(
string
ioType
)
{
IO_VALUE
ioValue
=
IO_VALUE
.
LOW
;
if
(
StoreManager
.
Config
.
StoreDOList
.
ContainsKey
(
ioType
))
{
ConfigIO
configIo
=
StoreManager
.
Config
.
StoreDOList
[
ioType
];
ioValue
=
instance
.
GetDOValue
(
configIo
.
DeviceName
,
configIo
.
SlaveID
,
configIo
.
GetIOAddr
());
}
else
{
LogUtil
.
error
(
"没有DO="
+
ioType
);
}
return
ioValue
;
}
#
endregion
#
endregion
public
static
void
Init
()
public
static
void
Init
()
{
{
...
...
source/DeviceLibrary/DeviceLibrary/ShuoKe/MeteringSignalBean.cs
查看文件 @
8e19278
...
@@ -18,7 +18,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -18,7 +18,7 @@ namespace OnlineStore.DeviceLibrary
/// 信号变化次数
/// 信号变化次数
/// </summary>
/// </summary>
public
static
int
SignalChangeCount
=
0
;
public
static
int
SignalChangeCount
=
0
;
public
static
int
T
ra
getChangeCount
=
0
;
public
static
int
T
ar
getChangeCount
=
0
;
public
static
IO_VALUE
PreSignalValue
=
IO_VALUE
.
LOW
;
public
static
IO_VALUE
PreSignalValue
=
IO_VALUE
.
LOW
;
private
static
System
.
Timers
.
Timer
timer
=
null
;
private
static
System
.
Timers
.
Timer
timer
=
null
;
public
static
void
StartCheck
(
int
targetPositon
,
int
currPosition
)
public
static
void
StartCheck
(
int
targetPositon
,
int
currPosition
)
...
@@ -32,16 +32,16 @@ namespace OnlineStore.DeviceLibrary
...
@@ -32,16 +32,16 @@ namespace OnlineStore.DeviceLibrary
}
}
private
static
void
StartCheck
(
int
targetCount
)
private
static
void
StartCheck
(
int
targetCount
)
{
{
T
ra
getChangeCount
=
targetCount
;
T
ar
getChangeCount
=
targetCount
;
if
(
timer
==
null
)
if
(
timer
==
null
)
{
{
timer
=
new
System
.
Timers
.
Timer
();
timer
=
new
System
.
Timers
.
Timer
();
timer
.
Interval
=
5
0
;
timer
.
Interval
=
2
0
;
timer
.
AutoReset
=
true
;
timer
.
AutoReset
=
true
;
timer
.
Elapsed
+=
Timer_Elapsed
;
timer
.
Elapsed
+=
Timer_Elapsed
;
timer
.
Enabled
=
false
;
timer
.
Enabled
=
false
;
}
}
LogUtil
.
debug
(
"开始压紧轴计量检测,预计变化"
+
T
ra
getChangeCount
+
"次"
);
LogUtil
.
debug
(
"开始压紧轴计量检测,预计变化"
+
T
ar
getChangeCount
+
"次"
);
IsInProcess
=
false
;
IsInProcess
=
false
;
PreSignalValue
=
IO_VALUE
.
LOW
;
PreSignalValue
=
IO_VALUE
.
LOW
;
SignalChangeCount
=
0
;
SignalChangeCount
=
0
;
...
@@ -53,7 +53,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -53,7 +53,7 @@ namespace OnlineStore.DeviceLibrary
if
(
timer
==
null
)
if
(
timer
==
null
)
{
return
;
}
{
return
;
}
timer
.
Stop
();
timer
.
Stop
();
T
ra
getChangeCount
=
0
;
T
ar
getChangeCount
=
0
;
SignalChangeCount
=
0
;
SignalChangeCount
=
0
;
}
}
private
static
bool
IsInProcess
=
false
;
private
static
bool
IsInProcess
=
false
;
...
@@ -67,10 +67,10 @@ namespace OnlineStore.DeviceLibrary
...
@@ -67,10 +67,10 @@ namespace OnlineStore.DeviceLibrary
if
(
value
.
Equals
(
IO_VALUE
.
HIGH
)
&&
PreSignalValue
.
Equals
(
IO_VALUE
.
LOW
))
if
(
value
.
Equals
(
IO_VALUE
.
HIGH
)
&&
PreSignalValue
.
Equals
(
IO_VALUE
.
LOW
))
{
{
SignalChangeCount
++;
SignalChangeCount
++;
LogUtil
.
debug
(
"检测到信号变化,已经变化"
+
SignalChangeCount
+
"次
"
);
LogUtil
.
info
(
"MeteringSignal检测到信号变化,已经变化"
+
SignalChangeCount
+
"次(目标次数"
+
TargetChangeCount
+
")
"
);
}
}
PreSignalValue
=
value
;
PreSignalValue
=
value
;
if
(
T
ra
getChangeCount
<=
SignalChangeCount
)
if
(
T
ar
getChangeCount
<=
SignalChangeCount
)
{
{
timer
.
Stop
();
timer
.
Stop
();
}
}
...
...
source/DeviceLibrary/DeviceLibrary/ShuoKe/ShuoKeController.cs
查看文件 @
8e19278
...
@@ -287,6 +287,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -287,6 +287,7 @@ namespace OnlineStore.DeviceLibrary
#
region
驱动器操作方法
#
region
驱动器操作方法
public
static
ShuoKeInfo
GetStatus
(
int
slvAddr
)
public
static
ShuoKeInfo
GetStatus
(
int
slvAddr
)
{
{
Thread
.
Sleep
(
SleepMS
);
byte
[]
reviceData
=
SendData
(
slvAddr
,
ShuoKeCMD
.
SearchMoveStatus
,
0x00
,
0
,
10
);
byte
[]
reviceData
=
SendData
(
slvAddr
,
ShuoKeCMD
.
SearchMoveStatus
,
0x00
,
0
,
10
);
return
DataToStatus
(
reviceData
);
return
DataToStatus
(
reviceData
);
}
}
...
...
source/DeviceLibrary/acSingleStore/AC_SA_BoxBean_Partial.cs
查看文件 @
8e19278
...
@@ -257,15 +257,15 @@ namespace OnlineStore.DeviceLibrary
...
@@ -257,15 +257,15 @@ namespace OnlineStore.DeviceLibrary
bool
isend
=
ShuoKeControls
.
IsMoveEnd
(
wait
.
SlvAddr
,
wait
.
TargetPosition
,
StoreMove
.
LastSetpTime
,
out
msg
);
bool
isend
=
ShuoKeControls
.
IsMoveEnd
(
wait
.
SlvAddr
,
wait
.
TargetPosition
,
StoreMove
.
LastSetpTime
,
out
msg
);
if
(
isend
)
if
(
isend
)
{
{
bool
isCheckOk
=
(
MeteringSignal
.
T
ra
getChangeCount
<=
MeteringSignal
.
SignalChangeCount
);
bool
isCheckOk
=
(
MeteringSignal
.
T
ar
getChangeCount
<=
MeteringSignal
.
SignalChangeCount
);
if
(
isCheckOk
||
MeteringSignal
.
T
ra
getChangeCount
<=
0
)
if
(
isCheckOk
||
MeteringSignal
.
T
ar
getChangeCount
<=
0
)
{
{
MeteringSignal
.
StopCheck
();
MeteringSignal
.
StopCheck
();
return
true
;
return
true
;
}
}
else
else
{
{
msg
=
"压紧轴计量检测目标【"
+
MeteringSignal
.
T
ra
getChangeCount
+
"】实际【"
+
MeteringSignal
.
SignalChangeCount
+
"】"
;
msg
=
"压紧轴计量检测目标【"
+
MeteringSignal
.
T
ar
getChangeCount
+
"】实际【"
+
MeteringSignal
.
SignalChangeCount
+
"】"
;
LogUtil
.
error
(
"压紧轴已经停止运动,但是 "
+
msg
,
110
);
LogUtil
.
error
(
"压紧轴已经停止运动,但是 "
+
msg
,
110
);
return
false
;
return
false
;
}
}
...
...
source/DeviceLibrary/acSingleStore/AutomaticBaiting_Partial.cs
查看文件 @
8e19278
...
@@ -49,19 +49,19 @@ namespace OnlineStore.DeviceLibrary
...
@@ -49,19 +49,19 @@ namespace OnlineStore.DeviceLibrary
int
errorCount
=
Math
.
Abs
(
outCount
);
int
errorCount
=
Math
.
Abs
(
outCount
);
if
(
errorCount
>
moveAxis
.
CanErrorCountMax
)
if
(
errorCount
>
moveAxis
.
CanErrorCountMax
)
{
{
//
//
判断是否需要重新运动
//判断是否需要重新运动
//
if (StoreMove.CanWhileCount > 0)
if
(
StoreMove
.
CanWhileCount
>
0
)
//
{
{
// LogUtil.error(Name+ moveAxis.DisplayStr + "收到原点完成信号,当前位置[" + outCount + "],重新回原点,剩余[" + StoreMove.CanWhileCount + "]次");
LogUtil
.
error
(
Name
+
moveAxis
.
DisplayStr
+
"收到原点完成信号,当前位置["
+
outCount
+
"],重新回原点,剩余["
+
StoreMove
.
CanWhileCount
+
"]次"
);
//
ACServerManager.HomeMove(moveAxis.DeviceName, moveAxis.GetAxisValue(), moveAxis.HomeHighSpeed);
ACServerManager
.
HomeMove
(
moveAxis
.
DeviceName
,
moveAxis
.
GetAxisValue
(),
moveAxis
.
HomeHighSpeed
);
//
StoreMove.CanWhileCount--;
StoreMove
.
CanWhileCount
--;
//
}
}
//
else
else
//
{
{
msg
=
Name
+
" storeMoveStep="
+
StoreMove
.
MoveStep
+
moveAxis
.
DisplayStr
+
"收到原点完成信号,当前位置["
+
outCount
+
"],误差过大,需要报警"
;
msg
=
Name
+
" storeMoveStep="
+
StoreMove
.
MoveStep
+
moveAxis
.
DisplayStr
+
"收到原点完成信号,当前位置["
+
outCount
+
"],误差过大,需要报警"
;
LogUtil
.
error
(
msg
,
100
);
LogUtil
.
error
(
msg
,
100
);
return
false
;
return
false
;
//}
}
}
}
return
true
;
return
true
;
}
}
...
@@ -111,6 +111,16 @@ namespace OnlineStore.DeviceLibrary
...
@@ -111,6 +111,16 @@ namespace OnlineStore.DeviceLibrary
// isOk = false;
// isOk = false;
// break;
// break;
//}
//}
//如果是气缸动作,若Do未输出,重新写一遍
if
(!
wait
.
IsEnd
&&
span
.
TotalSeconds
>
1
&&
(
wait
.
IoType
.
Equals
(
IO_Type
.
SuckingDisc_Down
)
||
wait
.
IoType
.
Equals
(
IO_Type
.
SuckingDisc_Up
)))
{
IO_VALUE
doValue
=
IOManager
.
DOValue
(
wait
.
IoType
);
if
(!
doValue
.
Equals
(
wait
.
IoValue
))
{
LogUtil
.
error
(
"等待["
+
NotOkMsg
+
"],重写DO("
+
wait
.
IoType
+
"="
+
wait
.
IoValue
+
")"
);
IOManager
.
IOMove
(
wait
.
IoType
,
wait
.
IoValue
);
}
}
}
}
else
if
(
wait
.
WaitType
==
(
int
)
Wait_Type
.
Time_3
)
else
if
(
wait
.
WaitType
==
(
int
)
Wait_Type
.
Time_3
)
{
{
...
@@ -235,20 +245,34 @@ namespace OnlineStore.DeviceLibrary
...
@@ -235,20 +245,34 @@ namespace OnlineStore.DeviceLibrary
{
{
bool
result
=
false
;
bool
result
=
false
;
if
(
IOManager
.
IOValue
(
wait
.
IoType
).
Equals
(
IO_VALUE
.
HIGH
))
if
(
IOManager
.
IOValue
(
wait
.
IoType
).
Equals
(
IO_VALUE
.
HIGH
))
{
{
LogUtil
.
debug
(
wait
.
ToStr
()
+
" 检测到【"
+
wait
.
IoType
+
"】信号,可以停止运动"
);
LogUtil
.
debug
(
wait
.
ToStr
()
+
" 检测到【"
+
wait
.
IoType
+
"】信号,可以停止运动"
);
result
=
true
;
result
=
true
;
}
}
else
if
(
IOManager
.
IOValue
(
IO_Type
.
BatchAxis_Limit
).
Equals
(
IO_VALUE
.
HIGH
))
else
if
(
IOManager
.
IOValue
(
IO_Type
.
BatchAxis_Limit
).
Equals
(
IO_VALUE
.
HIGH
))
{
{
LogUtil
.
debug
(
wait
.
ToStr
()
+
" 检测到正极限信号,可以停止运动"
);
LogUtil
.
debug
(
wait
.
ToStr
()
+
" 检测到正极限信号,可以停止运动"
);
result
=
true
;
result
=
true
;
}
}
if
(
result
)
if
(
result
)
{
{
LogUtil
.
debug
(
wait
.
ToStr
()
+
" 停止运动"
);
LogUtil
.
debug
(
wait
.
ToStr
()
+
" 停止运动"
);
ACServerManager
.
SuddenStop
(
wait
.
AxisInfo
);
ACServerManager
.
SuddenStop
(
wait
.
AxisInfo
);
}
}
else
{
if
(
AutoBaitingStatus
.
Equals
(
StoreRunStatus
.
Busy
)
&&
StoreMove
.
CanWhileCount
>
0
)
{
//如果批量轴已经停止运动,重新开始
bool
isEnd
=
ACServerManager
.
GetBusyStatus
(
wait
.
AxisInfo
.
DeviceName
,
wait
.
AxisInfo
.
GetAxisValue
()).
Equals
(
0
);
if
(
isEnd
)
{
//判断是否需要重新运动
StoreMove
.
CanWhileCount
--;
LogUtil
.
error
(
wait
.
ToStr
()
+
"未收到信号且停止运动,重新匀速"
+
StoreManager
.
Config
.
BatchAxis_SlowSpeed
+
"运动,剩余["
+
StoreMove
.
CanWhileCount
+
"]次"
);
ACServerManager
.
SpeedMove
(
wait
.
AxisInfo
.
DeviceName
,
wait
.
AxisInfo
.
GetAxisValue
(),
StoreManager
.
Config
.
BatchAxis_SlowSpeed
);
}
}
}
return
result
;
return
result
;
}
}
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论