Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
孙克
/
RC1250-AssemblyLine
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit 833f1d8e
由
LN
编写于
2020-06-23 14:37:15 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
皮带线逻辑优化
1 个父辈
938f54d5
隐藏空白字符变更
内嵌
并排
正在显示
8 个修改的文件
包含
93 行增加
和
24 行删除
source/AssemblyLineClient/FrmFeedingEquip.Designer.cs
source/AssemblyLineClient/记录.txt
source/DeviceLibrary/assemblyLine/DischargeLine.cs
source/DeviceLibrary/assemblyLine/DischargeLine_Partial.cs
source/DeviceLibrary/assemblyLine/MoveEquip_Partial.cs
source/DeviceLibrary/assemblyLine/ProvidingEquip_Partial.cs
source/DeviceLibrary/deviceLibrary/PanasonicServo/ACCMDManager.cs
source/DeviceLibrary/deviceLibrary/PanasonicServo/ACServerManager_Partial.cs
source/AssemblyLineClient/FrmFeedingEquip.Designer.cs
查看文件 @
833f1d8
...
@@ -656,7 +656,7 @@
...
@@ -656,7 +656,7 @@
this
.
lblThisSta
.
ImageAlign
=
System
.
Drawing
.
ContentAlignment
.
MiddleRight
;
this
.
lblThisSta
.
ImageAlign
=
System
.
Drawing
.
ContentAlignment
.
MiddleRight
;
this
.
lblThisSta
.
Location
=
new
System
.
Drawing
.
Point
(
406
,
21
);
this
.
lblThisSta
.
Location
=
new
System
.
Drawing
.
Point
(
406
,
21
);
this
.
lblThisSta
.
Name
=
"lblThisSta"
;
this
.
lblThisSta
.
Name
=
"lblThisSta"
;
this
.
lblThisSta
.
Size
=
new
System
.
Drawing
.
Size
(
8
66
,
330
);
this
.
lblThisSta
.
Size
=
new
System
.
Drawing
.
Size
(
8
81
,
330
);
this
.
lblThisSta
.
TabIndex
=
246
;
this
.
lblThisSta
.
TabIndex
=
246
;
this
.
lblThisSta
.
Text
=
"等待启动"
;
this
.
lblThisSta
.
Text
=
"等待启动"
;
this
.
lblThisSta
.
TextAlign
=
System
.
Drawing
.
ContentAlignment
.
MiddleCenter
;
this
.
lblThisSta
.
TextAlign
=
System
.
Drawing
.
ContentAlignment
.
MiddleCenter
;
...
...
source/AssemblyLineClient/记录.txt
查看文件 @
833f1d8
20200610
20200623
入库,料仓与服务器 通信超时改为3秒。入库验证时如果超时重新发送。
入库NG的到达NG口时再调用下取消入库任务。
20200610
BUG:托盘一直显示有料
BUG:托盘一直显示有料
伺服SuddenStop方法调用3次,防止停止失败。
伺服SuddenStop方法调用3次,防止停止失败。
增加四条出料皮带线滚刷功能。
增加四条出料皮带线滚刷功能。
...
...
source/DeviceLibrary/assemblyLine/DischargeLine.cs
查看文件 @
833f1d8
...
@@ -263,7 +263,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -263,7 +263,7 @@ namespace OnlineStore.DeviceLibrary
}
}
});
});
}
}
}
}
else
if
(
IOValue
(
IO_Type
.
DLine_Reset
).
Equals
(
IO_VALUE
.
HIGH
))
else
if
(
IOValue
(
IO_Type
.
DLine_Reset
).
Equals
(
IO_VALUE
.
HIGH
))
{
{
if
(
NoAlarm
())
if
(
NoAlarm
())
...
@@ -314,10 +314,10 @@ namespace OnlineStore.DeviceLibrary
...
@@ -314,10 +314,10 @@ namespace OnlineStore.DeviceLibrary
}
}
}
}
}
}
else
else
{
{
//皮带线3出口有料,分盘定位装置无料
//皮带线3出口有料,分盘定位装置无料
if
(
Line3TurnIsStop
()
&&
IOValue
(
IO_Type
.
SeparateDevice_Check
).
Equals
(
IO_VALUE
.
LOW
)
&&
StationInfo_NG
.
TrayValue
.
Equals
(
IO_VALUE
.
HIGH
)&&
ScanIsEnd
())
if
(
Line3TurnIsStop
()
&&
IOValue
(
IO_Type
.
SeparateDevice_Check
).
Equals
(
IO_VALUE
.
LOW
)
&&
StationInfo_NG
.
TrayValue
.
Equals
(
IO_VALUE
.
HIGH
)
&&
ScanIsEnd
())
{
{
StartOutStoreMove
(
new
InOutParam
());
StartOutStoreMove
(
new
InOutParam
());
}
}
...
@@ -350,6 +350,11 @@ namespace OnlineStore.DeviceLibrary
...
@@ -350,6 +350,11 @@ namespace OnlineStore.DeviceLibrary
IOMove
(
IO_Type
.
DLine_RunAlarm
,
IO_VALUE
.
HIGH
);
IOMove
(
IO_Type
.
DLine_RunAlarm
,
IO_VALUE
.
HIGH
);
}
}
if
(
MoveInfo
.
MoveType
.
Equals
(
LineMoveType
.
None
)
&&
SeparateStopTime
<
DateTime
.
Now
&&
IOValue
(
IO_Type
.
SeparateDevice_Run
).
Equals
(
IO_VALUE
.
HIGH
))
{
IOMove
(
IO_Type
.
SeparateDevice_Run
,
IO_VALUE
.
LOW
);
}
}
}
internal
bool
InStoreNgISBack
()
internal
bool
InStoreNgISBack
()
{
{
...
...
source/DeviceLibrary/assemblyLine/DischargeLine_Partial.cs
查看文件 @
833f1d8
...
@@ -11,8 +11,8 @@ namespace OnlineStore.DeviceLibrary
...
@@ -11,8 +11,8 @@ namespace OnlineStore.DeviceLibrary
{
{
partial
class
DischargeLine
partial
class
DischargeLine
{
{
private
int
LastWidth
=
0
;
private
int
LastWidth
=
0
;
private
DateTime
SeparateStopTime
=
DateTime
.
Now
;
protected
override
bool
CheckWaitResult
(
LineMoveInfo
moveInfo
,
WaitResultInfo
wait
)
protected
override
bool
CheckWaitResult
(
LineMoveInfo
moveInfo
,
WaitResultInfo
wait
)
{
{
if
(
wait
.
WaitType
.
Equals
(
WaitEnum
.
W301_DLineScanCode
))
if
(
wait
.
WaitType
.
Equals
(
WaitEnum
.
W301_DLineScanCode
))
...
@@ -186,9 +186,12 @@ namespace OnlineStore.DeviceLibrary
...
@@ -186,9 +186,12 @@ namespace OnlineStore.DeviceLibrary
IOMove
(
IO_Type
.
SeparateDevice_Run
,
IO_VALUE
.
HIGH
);
IOMove
(
IO_Type
.
SeparateDevice_Run
,
IO_VALUE
.
HIGH
);
if
(
IOValue
(
IO_Type
.
SeparateDevice_Check
).
Equals
(
IO_VALUE
.
HIGH
))
if
(
IOValue
(
IO_Type
.
SeparateDevice_Check
).
Equals
(
IO_VALUE
.
HIGH
))
{
{
SeparateStopTime
=
DateTime
.
Now
.
AddSeconds
(
3
);
int
robotIndex
=
GetRobotIndex
();
int
robotIndex
=
GetRobotIndex
();
LogUtil
.
info
(
hengyiName
+
MoveInfo
.
SLog
+
"送料,接驳台有料,调用arriveRobotLocation="
+
robotIndex
+
"["
+
StationInfo_Move
.
CodeStr
+
"]"
);
LogUtil
.
info
(
hengyiName
+
MoveInfo
.
SLog
+
"送料,接驳台有料,调用arriveRobotLocation="
+
robotIndex
+
"["
+
StationInfo_Move
.
CodeStr
+
"]"
);
SServerManager
.
arriveRobotLocation
(
Name
,
robotIndex
,
StationInfo_Move
.
CodeStr
);
SServerManager
.
arriveRobotLocation
(
Name
,
robotIndex
,
StationInfo_Move
.
CodeStr
);
MoveEndS
();
LogUtil
.
info
(
hengyiName
+
MoveInfo
.
SLog
+
"送料结束 "
);
}
}
else
else
{
{
...
@@ -197,17 +200,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -197,17 +200,7 @@ namespace OnlineStore.DeviceLibrary
MoveInfo
.
TimeOutSeconds
=
40
;
MoveInfo
.
TimeOutSeconds
=
40
;
MoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitIO
(
IO_Type
.
SeparateDevice_Check
,
IO_VALUE
.
HIGH
));
MoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitIO
(
IO_Type
.
SeparateDevice_Check
,
IO_VALUE
.
HIGH
));
}
}
//}
//else if (span.TotalSeconds <= 60)
//{
// int robotIndex = GetRobotIndex();
// LogUtil.info(hengyiName + MoveInfo.SLog + "送料,接驳台应有料"+FormUtil.GetSpanStr(span)+",调用arriveRobotLocation=" + robotIndex + "[" + StationInfo_Move.CodeStr + "]");
// SServerManager.arriveRobotLocation(Name, robotIndex, StationInfo_Move.CodeStr);
//}
//else
//{
// LogUtil.info(hengyiName + MoveInfo.SLog + "送料,接驳台无料");
//}
}
}
else
if
(
MoveInfo
.
MoveStep
.
Equals
(
LineMoveStep
.
DON_08_CRun
))
else
if
(
MoveInfo
.
MoveStep
.
Equals
(
LineMoveStep
.
DON_08_CRun
))
{
{
...
...
source/DeviceLibrary/assemblyLine/MoveEquip_Partial.cs
查看文件 @
833f1d8
...
@@ -668,7 +668,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -668,7 +668,7 @@ namespace OnlineStore.DeviceLibrary
if
(
isNeed
)
if
(
isNeed
)
{
{
SecondMoveInfo
.
NextMoveStep
(
LineMoveStep
.
MIO_05_WaitTime
);
SecondMoveInfo
.
NextMoveStep
(
LineMoveStep
.
MIO_05_WaitTime
);
CheckLog
(
"托盘阻挡"
+
SecondMoveInfo
.
SLog
+
" 等待
一秒钟)
"
);
CheckLog
(
"托盘阻挡"
+
SecondMoveInfo
.
SLog
+
" 等待
200
"
);
SecondMoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitTime
(
200
));
SecondMoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitTime
(
200
));
}
}
else
else
...
@@ -705,8 +705,8 @@ namespace OnlineStore.DeviceLibrary
...
@@ -705,8 +705,8 @@ namespace OnlineStore.DeviceLibrary
{
{
if
(!
LineServer
.
RightInPosId
(
DeviceID
,
SecondMoveInfo
.
MoveParam
.
PosId
))
if
(!
LineServer
.
RightInPosId
(
DeviceID
,
SecondMoveInfo
.
MoveParam
.
PosId
))
{
{
LogUtil
.
error
(
Name
+
" "
+
SecondMoveInfo
.
SLog
+
"["
+
SecondMoveInfo
.
MoveParam
.
PosId
+
"]料仓未验证成功,等待
3
秒"
);
LogUtil
.
error
(
Name
+
" "
+
SecondMoveInfo
.
SLog
+
"["
+
SecondMoveInfo
.
MoveParam
.
PosId
+
"]料仓未验证成功,等待
9
秒"
);
SecondMoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitTime
(
3
000
));
SecondMoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitTime
(
9
000
));
}
}
if
(
SecondMoveInfo
.
MoveParam
.
PlateH
>=
30
)
if
(
SecondMoveInfo
.
MoveParam
.
PlateH
>=
30
)
{
{
...
...
source/DeviceLibrary/assemblyLine/ProvidingEquip_Partial.cs
查看文件 @
833f1d8
...
@@ -144,6 +144,15 @@ namespace OnlineStore.DeviceLibrary
...
@@ -144,6 +144,15 @@ namespace OnlineStore.DeviceLibrary
if
(
trayInfo
.
IsFull
&&
trayInfo
.
InoutPar
.
InStoreNg
&&
this
.
Config
.
SidesWayNum
.
Equals
(
4
))
if
(
trayInfo
.
IsFull
&&
trayInfo
.
InoutPar
.
InStoreNg
&&
this
.
Config
.
SidesWayNum
.
Equals
(
4
))
{
{
outMsg
=
"入料NG料"
;
outMsg
=
"入料NG料"
;
//如果分配了库位,需要调用取消
if
(
trayInfo
.
InoutPar
.
WareCode
!=
""
&&
trayInfo
.
InoutPar
.
PosId
!=
""
)
{
Task
.
Factory
.
StartNew
(
delegate
{
SServerManager
.
cancelPutInTask
(
Name
,
trayInfo
.
InoutPar
.
WareCode
);
});
}
//入料失败料
//入料失败料
return
inoup
;
return
inoup
;
}
}
...
@@ -238,8 +247,31 @@ namespace OnlineStore.DeviceLibrary
...
@@ -238,8 +247,31 @@ namespace OnlineStore.DeviceLibrary
//空闲且皮带线出料已结束
//空闲且皮带线出料已结束
if
(
kongxian
&&
LineNotBusy
())
if
(
kongxian
&&
LineNotBusy
())
{
{
outMsg
=
"随意放"
;
//随机分配
return
inoup
;
Random
r
=
new
Random
();
int
value
=
r
.
Next
(
0
,
100000
)
%
6
;
if
(
lineNum
.
Equals
(
1
))
{
if
((
value
.
Equals
(
0
)
||
value
.
Equals
(
1
)))
{
outMsg
=
"随意放"
;
return
inoup
;
}
}
else
if
(
lineNum
.
Equals
(
2
))
{
if
((
value
.
Equals
(
2
)
||
value
.
Equals
(
3
)))
{
outMsg
=
"随意放"
;
return
inoup
;
}
}
else
{
outMsg
=
"随意放"
;
return
inoup
;
}
}
}
}
}
}
}
...
...
source/DeviceLibrary/deviceLibrary/PanasonicServo/ACCMDManager.cs
查看文件 @
833f1d8
...
@@ -8,6 +8,10 @@ namespace OnlineStore.DeviceLibrary
...
@@ -8,6 +8,10 @@ namespace OnlineStore.DeviceLibrary
public
class
ACCMDManager
public
class
ACCMDManager
{
{
/// <summary>
/// <summary>
/// 0130h 选通输入(STB) 状态 ReadOnly 0: 输入 OFF 1: 输入 ON
/// </summary>
internal
static
string
STB_State
=
"0130"
;
/// <summary>
/// 0132h 原点接近传感器输入 (HOME) 状态 ReadOnly 0: 输入 OFF 1: 输入 ON
/// 0132h 原点接近传感器输入 (HOME) 状态 ReadOnly 0: 输入 OFF 1: 输入 ON
/// </summary>
/// </summary>
public
static
string
Home_Single
=
"0132"
;
public
static
string
Home_Single
=
"0132"
;
...
...
source/DeviceLibrary/deviceLibrary/PanasonicServo/ACServerManager_Partial.cs
查看文件 @
833f1d8
...
@@ -299,10 +299,28 @@ namespace OnlineStore.DeviceLibrary
...
@@ -299,10 +299,28 @@ namespace OnlineStore.DeviceLibrary
Thread
.
Sleep
(
180
);
Thread
.
Sleep
(
180
);
}
}
}
}
}
}
public
static
void
OpenAndCloseSTB
(
string
portName
,
int
slvAddr
)
public
static
void
OpenAndCloseSTB
(
string
portName
,
int
slvAddr
)
{
{
if
(
GetBusyStatus
(
portName
,
slvAddr
).
Equals
(
1
))
{
LogUtil
.
error
(
"伺服【"
+
portName
+
"_"
+
slvAddr
+
"】OpenSTB时发现 busy=1,直接返回"
);
return
;
}
System
.
Threading
.
Thread
.
Sleep
(
SleepMSendons
);
if
(
GetSTBState
(
portName
,
slvAddr
).
Equals
(
1
))
{
LogUtil
.
error
(
"伺服【"
+
portName
+
"_"
+
slvAddr
+
"】OpenSTB时发现 STB=ON,先关闭STB"
);
CloseSTB
(
portName
,
slvAddr
);
System
.
Threading
.
Thread
.
Sleep
(
SleepMSendons
);
if
(
GetSTBState
(
portName
,
slvAddr
).
Equals
(
1
))
{
LogUtil
.
error
(
"伺服【"
+
portName
+
"_"
+
slvAddr
+
"】OpenSTB时发现 STB=ON,先关闭STB 后发现STB仍为ON,直接返回"
);
return
;
}
}
OnlyOpenSTB
(
portName
,
slvAddr
);
OnlyOpenSTB
(
portName
,
slvAddr
);
System
.
Threading
.
Thread
.
Sleep
(
200
);
System
.
Threading
.
Thread
.
Sleep
(
200
);
CloseSTB
(
portName
,
slvAddr
);
CloseSTB
(
portName
,
slvAddr
);
...
@@ -494,6 +512,19 @@ namespace OnlineStore.DeviceLibrary
...
@@ -494,6 +512,19 @@ namespace OnlineStore.DeviceLibrary
return
GetCoilData
(
portName
,
reviceData
,
ACCMDManager
.
Home_Single
);
return
GetCoilData
(
portName
,
reviceData
,
ACCMDManager
.
Home_Single
);
}
}
/// <summary>
/// <summary>
/// 获取STB信号值,1=On,0=OFF
/// </summary>
/// <param name="portName"></param>
/// <param name="slvAddr"></param>
/// <returns></returns>
public
static
int
GetSTBState
(
string
portName
,
int
slvAddr
)
{
PreReadCoilAddr
=
ACCMDManager
.
STB_State
;
byte
[]
dataArray
=
ACCMDManager
.
GetWriteData
(
slvAddr
,
ACCMDManager
.
CMD_ReadCoil
,
ACCMDManager
.
STB_State
,
"0000"
,
1
);
byte
[]
reviceData
=
SendCommand
(
portName
,
dataArray
,
ReviceOutTimeMS
,
6
);
return
GetCoilData
(
portName
,
reviceData
,
ACCMDManager
.
STB_State
);
}
/// <summary>
/// 负极限
/// 负极限
/// </summary>
/// </summary>
public
static
int
GetLimitNegativeSingle
(
string
portName
,
int
slvAddr
)
public
static
int
GetLimitNegativeSingle
(
string
portName
,
int
slvAddr
)
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论