Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
孙克
/
ACSingleStore
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit 44258610
由
几米阳光
编写于
2019-01-08 15:56:39 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
报警时只红灯闪烁。出库时需要等待门口无料盘
1 个父辈
a213ccc2
隐藏空白字符变更
内嵌
并排
正在显示
8 个修改的文件
包含
100 行增加
和
52 行删除
source/ACSingleStore/记录.txt
source/DeviceLibrary/KangNaiDe/AITcpClient.cs
source/DeviceLibrary/KangNaiDe/KNDAIManager.cs
source/DeviceLibrary/KangNaiDe/KNDManager.cs
source/DeviceLibrary/KangNaiDe/MasterTcpClient.cs
source/DeviceLibrary/acSingleStore/AC_SA_BoxBean.cs
source/DeviceLibrary/acSingleStore/AC_SA_BoxBean_Partial.cs
source/DeviceLibrary/store/StoreStep.cs
source/ACSingleStore/记录.txt
查看文件 @
4425861
...
...
@@ -28,6 +28,12 @@
20190108
报警时只需要红灯闪烁。
出库时修改:出料口有料时,出料仍继续。
...
...
source/DeviceLibrary/KangNaiDe/AITcpClient.cs
查看文件 @
4425861
...
...
@@ -424,7 +424,7 @@ namespace OnlineStore.DeviceLibrary
{
if
(
socketClient
==
null
)
{
LOGGER
.
Error
(
"发送数据时发现socketClient=null"
);
LOGGER
.
Error
(
"
AITcpClient
发送数据时发现socketClient=null"
);
return
;
}
IPEndPoint
clientipe
=
(
IPEndPoint
)
socketClient
.
RemoteEndPoint
;
...
...
source/DeviceLibrary/KangNaiDe/KNDAIManager.cs
查看文件 @
4425861
...
...
@@ -72,7 +72,7 @@ namespace OnlineStore.DeviceLibrary
WriteAIScope
(
ioIp
,
1
);
Thread
.
Sleep
(
10
);
ReadAll
(
ioIp
);
LogUtil
.
info
(
LOGGER
,
"连接AI模块["
+
ioIp
+
"]"
);
LogUtil
.
info
(
LOGGER
,
"连接AI模块["
+
ioIp
+
"]
成功
"
);
}
catch
(
Exception
error
)
{
...
...
source/DeviceLibrary/KangNaiDe/KNDManager.cs
查看文件 @
4425861
...
...
@@ -77,7 +77,7 @@ namespace OnlineStore.DeviceLibrary
mastMap
.
Add
(
ioIp
,
MBmaster
);
Thread
.
Sleep
(
10
);
LogUtil
.
info
(
"连接IO模块["
+
ioIp
+
"]成功"
);
//读取所有的DO
ReadMultipleDO
(
ioIp
,
DefualtSlaveID
,
DoStartAddress
,
DefualtLength
);
}
...
...
@@ -119,13 +119,13 @@ namespace OnlineStore.DeviceLibrary
foreach
(
string
io
in
list
)
{
//判断是否连接,如果没有连接自动重连
MasterTcpClient
clinet
=
mastMap
[
io
];
if
(!
clinet
.
ISConnection
())
{
ushort
port
=
502
;
//ConnectionIP(io, port
);
LogUtil
.
error
(
LOGGER
,
io
+
"当前没有连上,重连"
+
io
);
}
MasterTcpClient
clinet
=
mastMap
[
io
];
if
(!
clinet
.
ISConnection
())
{
ushort
port
=
502
;
LogUtil
.
error
(
LOGGER
,
io
+
"当前没有连上,重连"
+
io
);
ConnectionIP
(
io
,
port
);
}
}
}
catch
(
Exception
ex
)
...
...
@@ -218,33 +218,41 @@ namespace OnlineStore.DeviceLibrary
}
isWrite
=
false
;
}
public
static
void
WriteSingleDO
(
string
ioIp
,
byte
slaveId
,
ushort
StartAddress
,
IO_VALUE
onOff
)
{
isWrite
=
true
;
try
{
ushort
ID
=
5
;
MasterTcpClient
MBmaster
=
null
;
if
(
mastMap
.
ContainsKey
(
ioIp
))
{
MBmaster
=
mastMap
[
ioIp
];
MBmaster
.
WriteSingleCoils
(
ID
,
StartAddress
,
onOff
,
slaveId
);
public
static
void
WriteSingleDO
(
string
ioIp
,
byte
slaveId
,
ushort
StartAddress
,
IO_VALUE
onOff
)
{
KNDIO
io
=
new
KNDIO
(
ioIp
,
slaveId
,
StartAddress
,
onOff
);
SaveDOValue
(
io
,
ioIp
);
}
else
{
LogUtil
.
error
(
LOGGER
,
"ReadSingleDO出错没有连接IO模块:"
+
ioIp
);
}
}
catch
(
Exception
ex
)
{
LOGGER
.
Error
(
"出错啦:"
+
ex
.
ToString
());
}
isWrite
=
false
;
}
isWrite
=
true
;
try
{
ushort
ID
=
5
;
MasterTcpClient
MBmaster
=
null
;
if
(
mastMap
.
ContainsKey
(
ioIp
))
{
MBmaster
=
mastMap
[
ioIp
];
bool
result
=
MBmaster
.
WriteSingleCoils
(
ID
,
StartAddress
,
onOff
,
slaveId
);
if
(!
result
)
{
LogUtil
.
error
(
LOGGER
,
"WriteSingleDO["
+
ioIp
+
"]["
+
slaveId
+
"]["
+
StartAddress
+
"]失败,尝试重新写一次"
);
result
=
MBmaster
.
WriteSingleCoils
(
ID
,
StartAddress
,
onOff
,
slaveId
);
}
if
(!
result
)
{
LogUtil
.
error
(
LOGGER
,
"WriteSingleDO["
+
ioIp
+
"]["
+
slaveId
+
"]["
+
StartAddress
+
"]失败,重新尝试仍失败"
);
}
KNDIO
io
=
new
KNDIO
(
ioIp
,
slaveId
,
StartAddress
,
onOff
);
SaveDOValue
(
io
,
ioIp
);
}
else
{
LogUtil
.
error
(
LOGGER
,
"WriteSingleDO["
+
ioIp
+
"]["
+
slaveId
+
"]["
+
StartAddress
+
"]出错没有连接IO模块:"
+
ioIp
);
}
}
catch
(
Exception
ex
)
{
LOGGER
.
Error
(
"出错啦:"
+
ex
.
ToString
());
}
isWrite
=
false
;
}
public
static
void
WriteSingleDO
(
string
ioIp
,
byte
slaveId
,
ushort
StartAddress
,
IO_VALUE
onOff
,
int
mSeconds
)
{
isWrite
=
true
;
...
...
source/DeviceLibrary/KangNaiDe/MasterTcpClient.cs
查看文件 @
4425861
...
...
@@ -378,15 +378,15 @@ namespace OnlineStore.DeviceLibrary
public
void
ReadInputRegister
(
ushort
id
,
ushort
startAddress
,
ushort
numInputs
,
byte
SlaveID
)
{
WriteAsyncData
(
CreateReadHeader
(
id
,
startAddress
,
numInputs
,
fctReadInputRegister
,
SlaveID
),
id
);
}
public
void
WriteSingleCoils
(
ushort
id
,
ushort
startAddress
,
IO_VALUE
ioValue
,
byte
SlaveID
)
}
public
bool
WriteSingleCoils
(
ushort
id
,
ushort
startAddress
,
IO_VALUE
ioValue
,
byte
SlaveID
)
{
byte
[]
data
;
bool
OnOff
=
ioValue
.
Equals
(
IO_VALUE
.
HIGH
);
data
=
CreateWriteHeader
(
id
,
startAddress
,
1
,
1
,
fctWriteSingleCoil
,
SlaveID
);
if
(
OnOff
==
true
)
data
[
10
]
=
255
;
else
data
[
10
]
=
0
;
WriteAsyncData
(
data
,
id
);
return
WriteAsyncData
(
data
,
id
);
}
public
void
WriteMultipleCoils
(
ushort
id
,
ushort
startAddress
,
ushort
numBits
,
byte
[]
values
,
byte
SlaveID
)
...
...
@@ -511,12 +511,12 @@ namespace OnlineStore.DeviceLibrary
// ------------------------------------------------------------------------
// Write asynchronous data
private
void
WriteAsyncData
(
byte
[]
write_data
,
ushort
id
)
private
bool
WriteAsyncData
(
byte
[]
write_data
,
ushort
id
)
{
if
(
socketClient
==
null
)
{
LOGGER
.
Error
(
"发送数据时发现socketClient=null"
);
return
;
LOGGER
.
Error
(
"
MasterTcpClient
发送数据时发现socketClient=null"
);
return
false
;
}
IPEndPoint
clientipe
=
(
IPEndPoint
)
socketClient
.
RemoteEndPoint
;
if
((
socketClient
!=
null
)
&&
(
socketClient
.
Connected
))
...
...
@@ -533,7 +533,8 @@ namespace OnlineStore.DeviceLibrary
//LogUtil.info( clientipe.ToString()+"发送数据:" + str);
socketClient
.
BeginSend
(
write_data
,
0
,
write_data
.
Length
,
SocketFlags
.
None
,
new
AsyncCallback
(
OnSend
),
null
);
//socketClient.BeginReceive(tcpSocketReviceBuffer, 0, tcpSocketReviceBuffer.Length, SocketFlags.None, new AsyncCallback(OnReceive), socketClient);
ReviceDataProcess
();
ReviceDataProcess
();
return
true
;
}
catch
(
SystemException
error
)
{
...
...
@@ -542,6 +543,7 @@ namespace OnlineStore.DeviceLibrary
}
}
else
CallException
(
id
,
write_data
[
7
],
excExceptionConnectionLost
,
tcpSocketReviceBuffer
);
return
false
;
}
// ------------------------------------------------------------------------
...
...
source/DeviceLibrary/acSingleStore/AC_SA_BoxBean.cs
查看文件 @
4425861
...
...
@@ -476,6 +476,7 @@ namespace OnlineStore.DeviceLibrary
}
private
void
OpenDoorAndWait
()
{
Thread
.
Sleep
(
60
);
KNDIOMove
(
IO_Type
.
Door_Down
,
IO_VALUE
.
LOW
);
KNDIOMove
(
IO_Type
.
Door_Up
,
IO_VALUE
.
HIGH
);
StoreMove
.
WaitList
.
Add
(
WaitResultInfo
.
WaitIO
(
IO_Type
.
Door_Down
,
IO_VALUE
.
LOW
));
...
...
@@ -804,6 +805,8 @@ namespace OnlineStore.DeviceLibrary
//机器未启动 灭 灭 灭
//机器设备故障(非温湿度)报警 亮 灭 闪
//报警时只需要亮红灯
DateTime
time
=
DateTime
.
Now
;
bool
isTemp30M
=
false
;
if
(
TempOrHumidityIsAlarm
)
...
...
@@ -832,6 +835,21 @@ namespace OnlineStore.DeviceLibrary
}
}
//报警时绿灯和黄灯灭
if
(
isNeedAlarmLed
)
{
if
(
KNDIOValue
(
IO_Type
.
AutoRun_HddLed
).
Equals
(
IO_VALUE
.
HIGH
))
{
KNDIOMove
(
IO_Type
.
AutoRun_HddLed
,
IO_VALUE
.
LOW
);
}
if
(
KNDIOValue
(
IO_Type
.
RunSign_HddLed
).
Equals
(
IO_VALUE
.
HIGH
))
{
KNDIOMove
(
IO_Type
.
AutoRun_HddLed
,
IO_VALUE
.
LOW
);
}
return
;
}
//绿灯闪
if
((
StoreMove
.
MoveType
.
Equals
(
StoreMoveType
.
InStore
)
||
StoreMove
.
MoveType
.
Equals
(
StoreMoveType
.
OutStore
)
||
storeRunStatus
.
Equals
(
StoreRunStatus
.
HomeMoving
)
||
storeRunStatus
.
Equals
(
StoreRunStatus
.
Reset
))
...
...
source/DeviceLibrary/acSingleStore/AC_SA_BoxBean_Partial.cs
查看文件 @
4425861
...
...
@@ -634,7 +634,7 @@ namespace OnlineStore.DeviceLibrary
ACAxisMove
(
Config
.
UpDown_Axis
,
moveP
.
UpDown_P2
,
Config
.
UpDownAxis_P2_Speed
);
ACAxisMove
(
Config
.
Middle_Axis
,
moveP
.
Middle_P1
,
Config
.
MiddleAxis_P1_Speed
);
//打开舱门
OpenDoorAndWait
();
//
OpenDoorAndWait();
}
else
{
...
...
@@ -650,10 +650,10 @@ namespace OnlineStore.DeviceLibrary
ACAxisMove
(
Config
.
UpDown_Axis
,
moveP
.
UpDown_P2
,
Config
.
UpDownAxis_P2_Speed
);
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.WaitIO(IO_Type.TrayCheck_Door, IO_VALUE.LOW));
//
StoreMove.WaitList.Add(WaitResultInfo.WaitHeight(0));
//打开舱门
OpenDoorAndWait
();
//
OpenDoorAndWait();
//StoreMove.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.TrayCheck_2, IO_VALUE.LOW));
}
...
...
@@ -661,7 +661,12 @@ namespace OnlineStore.DeviceLibrary
{
if
(
IsHasCompress_Axis
||
Config
.
IsHasLocationCylinder
.
Equals
(
0
))
{
SO_10_DeviceToDoorPro
();
//SO_10_DeviceToDoorPro();
StoreMove
.
NextMoveStep
(
StoreMoveStep
.
SO_091_WaitNoTray
);
StoreMove
.
WaitList
.
Add
(
WaitResultInfo
.
WaitIO
(
IO_Type
.
TrayCheck_Door
,
IO_VALUE
.
LOW
));
StoreMove
.
WaitList
.
Add
(
WaitResultInfo
.
WaitHeight
(
0
));
OpenDoorAndWait
();
}
else
{
...
...
@@ -673,11 +678,16 @@ namespace OnlineStore.DeviceLibrary
//此处需要等待移栽没有工作,才能把盘放入出料口
else
if
(
StoreMove
.
MoveStep
==
StoreMoveStep
.
SO_09_LocationCylinder_Down
)
{
StoreMove
.
NextMoveStep
(
StoreMoveStep
.
SO_091_WaitNoTray
);
OutStoreLog
(
"出库:SO_091 打开仓门,等待门口无料盘 "
);
StoreMove
.
WaitList
.
Add
(
WaitResultInfo
.
WaitIO
(
IO_Type
.
TrayCheck_Door
,
IO_VALUE
.
LOW
));
StoreMove
.
WaitList
.
Add
(
WaitResultInfo
.
WaitHeight
(
0
));
OpenDoorAndWait
();
}
else
if
(
StoreMove
.
MoveStep
==
StoreMoveStep
.
SO_091_WaitNoTray
)
{
SO_10_DeviceToDoorPro
();
//OutStoreLog("出库:SO_10 叉子进出料口,进出轴至P2(进料口取料点) ");
//StoreMove.NextMoveStep(StoreMoveStep.SO_10_DeviceToDoor);
//ACAxisMove(Config.InOut_Axis, moveP.InOut_P2, Config.InOutAxis_P2_Speed);
//NeedCheckSafetyLight = 1;
}
else
if
(
StoreMove
.
MoveStep
==
StoreMoveStep
.
SO_10_DeviceToDoor
)
{
...
...
source/DeviceLibrary/store/StoreStep.cs
查看文件 @
4425861
...
...
@@ -218,6 +218,10 @@ namespace OnlineStore.DeviceLibrary
/// 料仓出库,定位气缸退回(有压紧轴的不需要此步骤),,定位气缸退回(Y104-1/PCI5O1-84) (Y104-2/PCI5O1-91) (Y104-2/PCI5O1-96) 退回到位
/// </summary>
SO_09_LocationCylinder_Down
=
109
,
/// <summary>
/// 等待门口无料盘
/// </summary>
SO_091_WaitNoTray
=
115
,
/// <summary>
/// 料仓出库,,叉子进出料口,,轴3( 叉子) 至P2( 进料口取料点)
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论