Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
孙克
/
ACSingleStore
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit 9895791e
由
几米阳光
编写于
2019-03-12 17:09:17 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
1.测高AI模块BUG修改。
2.出库增加缓存功能,若出库失败也放入缓存。
1 个父辈
082ccb10
全部展开
隐藏空白字符变更
内嵌
并排
正在显示
5 个修改的文件
包含
37 行增加
和
22 行删除
source/DeviceLibrary/KangNaiDe/AITcpClient.cs
source/DeviceLibrary/KangNaiDe/KNDAIManager.cs
source/DeviceLibrary/acSingleStore/AC_SA_BoxBean.cs
source/DeviceLibrary/acSingleStore/AC_SA_BoxBean_Partial.cs
source/DeviceLibrary/store/KTK_DeviceBase.cs
source/DeviceLibrary/KangNaiDe/AITcpClient.cs
查看文件 @
9895791
此文件的差异被折叠,
点击展开。
source/DeviceLibrary/KangNaiDe/KNDAIManager.cs
查看文件 @
9895791
...
...
@@ -68,11 +68,11 @@ namespace OnlineStore.DeviceLibrary
MBmaster
.
OnException
+=
new
AITcpClient
.
ExceptionData
(
MBmaster_OnException
);
MBmaster
.
autoConnectOfBreak
=
false
;
mastMap
.
Add
(
ioIp
,
MBmaster
);
LogUtil
.
info
(
LOGGER
,
"连接AI模块["
+
ioIp
+
"]成功"
);
Thread
.
Sleep
(
10
);
WriteAIScope
(
ioIp
,
1
);
Thread
.
Sleep
(
10
);
ReadAll
(
ioIp
);
LogUtil
.
info
(
LOGGER
,
"连接AI模块["
+
ioIp
+
"]成功"
);
}
catch
(
Exception
error
)
{
...
...
@@ -157,8 +157,8 @@ namespace OnlineStore.DeviceLibrary
Thread
.
Sleep
(
2
);
isProcess
=
false
;
}
private
static
void
WriteAIScope
(
string
ioIp
,
int
value
)
private
static
void
WriteAIScope
(
string
ioIp
,
int
value
)
{
// 0 表示 0 - 10V, 1 表示 0 - 5V
WriteAIScope
(
ioIp
,
DefualtSlaveID
,
"03EA"
,
value
);
...
...
@@ -202,17 +202,17 @@ namespace OnlineStore.DeviceLibrary
}
mastMap
.
Clear
();
}
public
static
double
ConvertAI
(
double
aiValue
,
double
defaultValue
)
public
static
double
ConvertAI
(
double
aiValue
,
double
defaultValue
)
{
double
xishu
=
(
double
)
ConfigAppSettings
.
GetNumValue
(
Setting_Init
.
AI_ConvertPosition
);
double
result
=
Math
.
Round
((
aiValue
-
defaultValue
)/
xishu
,
2
);
double
xishu
=
(
double
)
ConfigAppSettings
.
GetNumValue
(
Setting_Init
.
AI_ConvertPosition
);
double
result
=
Math
.
Round
((
aiValue
-
defaultValue
)
/
xishu
,
2
);
return
result
;
}
public
static
double
GetAIValue
(
string
ioiP
,
int
index
)
{
double
aiValue
=
GetAIValue
(
ioiP
,
DefualtSlaveID
,
index
-
1
);
return
Math
.
Round
(
aiValue
,
2
);
double
aiValue
=
GetAIValue
(
ioiP
,
DefualtSlaveID
,
index
-
1
);
return
Math
.
Round
(
aiValue
,
2
);
}
public
static
double
GetAIValue
(
string
ioIP
,
byte
slaveId
,
int
index
)
...
...
@@ -284,7 +284,7 @@ namespace OnlineStore.DeviceLibrary
}
try
{
if
(
StoreManager
.
Store
.
KNDIOValue
(
IO_Type
.
TrayCheck_Door
).
Equals
(
IO_VALUE
.
HIGH
))
if
(
StoreManager
.
Store
!=
null
&&
StoreManager
.
Store
.
KNDIOValue
(
IO_Type
.
TrayCheck_Door
).
Equals
(
IO_VALUE
.
HIGH
))
{
if
(
StoreManager
.
Config
.
AIDI1_Addr
>
0
&&
StoreManager
.
Config
.
AIDI2_Addr
>
0
)
{
//每次上传后验证下
...
...
@@ -298,7 +298,7 @@ namespace OnlineStore.DeviceLibrary
// ConnectionIP(ioIp);
}
}
else
if
(
StoreManager
.
Config
.
AIDI3_Addr
>
0
&&
StoreManager
.
Config
.
AIDI4_Addr
>
0
)
else
if
(
StoreManager
.
Config
.
AIDI3_Addr
>
0
&&
StoreManager
.
Config
.
AIDI4_Addr
>
0
)
{
//每次上传后验证下
int
v1
=
(
int
)
GetAIValue
(
ioIp
,
StoreManager
.
Config
.
AIDI3_Addr
);
int
v2
=
(
int
)
GetAIValue
(
ioIp
,
StoreManager
.
Config
.
AIDI4_Addr
);
...
...
@@ -311,6 +311,7 @@ namespace OnlineStore.DeviceLibrary
}
}
}
}
catch
(
Exception
ex
)
{
...
...
@@ -349,7 +350,7 @@ namespace OnlineStore.DeviceLibrary
break
;
}
}
// LOGGER.Info ("Read data:【" + reviceMsg + "】 ");
// LOGGER.Info ("Read data:【" + reviceMsg + "】 ");
if
(
ID
==
0xFF
)
{
return
;
...
...
@@ -392,9 +393,9 @@ namespace OnlineStore.DeviceLibrary
}
catch
(
Exception
ex
)
{
LogUtil
.
error
(
LOGGER
,
"处理接受数据出错:"
+
ex
.
ToString
());
LogUtil
.
error
(
LOGGER
,
"处理接受数据出错:"
+
ex
.
ToString
());
}
}
}
private
static
void
MBmaster_OnException
(
string
ioIp
,
ushort
id
,
byte
function
,
byte
exception
,
byte
[]
reviceData
)
{
string
exc
=
"Modbus says error: "
;
...
...
@@ -413,7 +414,7 @@ namespace OnlineStore.DeviceLibrary
default
:
break
;
}
LOGGER
.
Error
(
"接收数据出错:"
+
exc
);
LOGGER
.
Error
(
"接收数据出错:"
+
exc
);
}
}
...
...
source/DeviceLibrary/acSingleStore/AC_SA_BoxBean.cs
查看文件 @
9895791
...
...
@@ -1225,7 +1225,12 @@ namespace OnlineStore.DeviceLibrary
if
(
currInOutFixture
.
WareNum
.
Equals
(
""
))
{
LogUtil
.
info
(
LOGGER
,
StoreName
+
"开始执行排队中的出库【"
+
currInOutFixture
.
ToStr
()
+
"】"
);
StartOutStoreMove
(
new
InOutStoreParam
(
""
,
currInOutFixture
.
PosId
,
currInOutFixture
.
plateH
,
currInOutFixture
.
plateW
));
bool
result
=
StartOutStoreMove
(
new
InOutStoreParam
(
""
,
currInOutFixture
.
PosId
,
currInOutFixture
.
plateH
,
currInOutFixture
.
plateW
));
if
(!
result
)
{
LogUtil
.
info
(
LOGGER
,
StoreName
+
" 执行排队中的出库【"
+
currInOutFixture
.
ToStr
()
+
"】失败,重新加入等待队列"
);
AddWaitOutInfo
(
currInOutFixture
);
}
}
}
}
...
...
@@ -1950,13 +1955,20 @@ namespace OnlineStore.DeviceLibrary
}
else
{
FixtureCodeInfo
currInOutFixture
=
new
FixtureCodeInfo
(
0
,
""
,
posId
,
plateW
,
plateH
);
if
(
CanStarInOut
())
{
StartOutStoreMove
(
new
InOutStoreParam
(
""
,
posId
,
position
));
bool
result
=
StartOutStoreMove
(
new
InOutStoreParam
(
""
,
posId
,
position
));
if
(!
result
)
{
LogUtil
.
info
(
LOGGER
,
StoreName
+
" 执行出库【"
+
currInOutFixture
.
ToStr
()
+
"】失败,加入等待队列"
);
AddWaitOutInfo
(
currInOutFixture
);
}
}
else
{
LogUtil
.
error
(
LOGGER
,
"收到服务器出库命令:出库【"
+
posId
+
"】失败,当前在忙碌中"
);
LogUtil
.
error
(
LOGGER
,
"执行出库【"
+
currInOutFixture
.
ToStr
()
+
"】失败,当前在忙碌中,加入等待队列"
);
AddWaitOutInfo
(
currInOutFixture
);
}
}
...
...
source/DeviceLibrary/acSingleStore/AC_SA_BoxBean_Partial.cs
查看文件 @
9895791
...
...
@@ -517,7 +517,7 @@ namespace OnlineStore.DeviceLibrary
/// <summary>
/// 开始出库运动
/// </summary>
public
override
void
StartOutStoreMove
(
InOutStoreParam
param
)
public
override
bool
StartOutStoreMove
(
InOutStoreParam
param
)
{
startOutStoreTime
=
DateTime
.
Now
;
string
posId
=
param
!=
null
?
param
.
PositionNum
:
""
;
...
...
@@ -526,12 +526,12 @@ namespace OnlineStore.DeviceLibrary
if
(!
LoadParamPosition
(
param
))
{
LogUtil
.
error
(
LOGGER
,
StoreName
+
" 启动出库【"
+
posId
+
"】出错,找不到库位信息"
);
return
;
return
false
;
}
if
(
KNDIOValue
(
IO_Type
.
TrayCheck_Fixture
).
Equals
(
IO_VALUE
.
HIGH
))
{
LogUtil
.
error
(
LOGGER
,
StoreName
+
" 启动出库【"
+
posId
+
"】出错,叉子料盘检测有料"
);
return
;
return
false
;
}
storeStatus
=
StoreStatus
.
OutStoreExecute
;
LogUtil
.
info
(
LOGGER
,
StoreName
+
"启动出库【"
+
posId
+
"】 "
,
storeMoveColor
);
...
...
@@ -552,11 +552,13 @@ namespace OnlineStore.DeviceLibrary
OutStoreLog
(
"出库:SO_01 定位气缸下降"
);
LocationDownAndWait
();
}
return
true
;
}
else
{
LogUtil
.
error
(
LOGGER
,
StoreName
+
" 启动出库出错,当前状态,storeStatus="
+
storeRunStatus
);
}
return
false
;
}
protected
override
void
OutStoreProcess
()
{
...
...
source/DeviceLibrary/store/KTK_DeviceBase.cs
查看文件 @
9895791
...
...
@@ -89,7 +89,7 @@ namespace OnlineStore.DeviceLibrary
/// <summary>
/// 开始出库运动
/// </summary>
public
abstract
void
StartOutStoreMove
(
InOutStoreParam
param
);
public
abstract
bool
StartOutStoreMove
(
InOutStoreParam
param
);
protected
abstract
void
OutStoreProcess
();
#
endregion
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论