Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
孙克
/
RC1250-AssemblyLine
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit 257c8e93
由
LN
编写于
2019-12-09 11:09:31 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
写IO增加验证
1 个父辈
48ff972a
隐藏空白字符变更
内嵌
并排
正在显示
8 个修改的文件
包含
184 行增加
和
158 行删除
source/AssemblyLineClient/FrmLineStore.cs
source/DeviceLibrary/assemblyLine/DischargeLine.cs
source/DeviceLibrary/assemblyLine/FeedingEquip.cs
source/DeviceLibrary/assemblyLine/FeedingEquip_InStore.cs
source/DeviceLibrary/assemblyLine/LineBean.cs
source/DeviceLibrary/assemblyLine/LineBean_Partial.cs
source/DeviceLibrary/assemblymanager/TrayManager.cs
source/DeviceLibrary/model/KTK_Store.cs
source/AssemblyLineClient/FrmLineStore.cs
查看文件 @
257c8e9
...
...
@@ -260,7 +260,7 @@ namespace OnlineStore.AssemblyLine
//AIManager.CloseConnect();
ACServerManager
.
CloseAllPort
();
// CodeManager.CloseAllCamera();
TrayManager
.
RfidReader
.
Close
();
//
TrayManager.RfidReader.Close();
//this.Close();
System
.
Environment
.
Exit
(
System
.
Environment
.
ExitCode
);
}
...
...
source/DeviceLibrary/assemblyLine/DischargeLine.cs
查看文件 @
257c8e9
...
...
@@ -126,10 +126,10 @@ namespace OnlineStore.DeviceLibrary
LogInfo
(
"停止运动:(定位气缸下降,皮带线停转 )开始 "
);
CylinderMove
(
null
,
IO_Type
.
SeparateDevice_Up
,
IO_Type
.
SeparateDevice_Down
);
IO
Move
(
IO_Type
.
DLine_Run1
,
IO_VALUE
.
LOW
);
IO
Move
(
IO_Type
.
DLine_Run2
,
IO_VALUE
.
LOW
);
IO
Move
(
IO_Type
.
DLine_Run3
,
IO_VALUE
.
LOW
);
IO
Move
(
IO_Type
.
SeparateDevice_Run
,
IO_VALUE
.
LOW
);
CheckAnd
Move
(
IO_Type
.
DLine_Run1
,
IO_VALUE
.
LOW
);
CheckAnd
Move
(
IO_Type
.
DLine_Run2
,
IO_VALUE
.
LOW
);
CheckAnd
Move
(
IO_Type
.
DLine_Run3
,
IO_VALUE
.
LOW
);
CheckAnd
Move
(
IO_Type
.
SeparateDevice_Run
,
IO_VALUE
.
LOW
);
}
/// <summary>
...
...
@@ -143,14 +143,14 @@ namespace OnlineStore.DeviceLibrary
}
StopMove
();
//停止运行时,把所有IO 置零
IO
Move
(
IO_Type
.
DLine_RunStatus
,
IO_VALUE
.
LOW
);
IO
Move
(
IO_Type
.
DLine_RunAlarm
,
IO_VALUE
.
LOW
);
IO
Move
(
IO_Type
.
DLine_Run1
,
IO_VALUE
.
LOW
);
IO
Move
(
IO_Type
.
DLine_Run2
,
IO_VALUE
.
LOW
);
IO
Move
(
IO_Type
.
DLine_Run3
,
IO_VALUE
.
LOW
);
IO
Move
(
IO_Type
.
SeparateDevice_Run
,
IO_VALUE
.
LOW
);
IO
Move
(
IO_Type
.
SeparateDevice_Up
,
IO_VALUE
.
LOW
);
IO
Move
(
IO_Type
.
SeparateDevice_Down
,
IO_VALUE
.
LOW
);
CheckAnd
Move
(
IO_Type
.
DLine_RunStatus
,
IO_VALUE
.
LOW
);
CheckAnd
Move
(
IO_Type
.
DLine_RunAlarm
,
IO_VALUE
.
LOW
);
CheckAnd
Move
(
IO_Type
.
DLine_Run1
,
IO_VALUE
.
LOW
);
CheckAnd
Move
(
IO_Type
.
DLine_Run2
,
IO_VALUE
.
LOW
);
CheckAnd
Move
(
IO_Type
.
DLine_Run3
,
IO_VALUE
.
LOW
);
CheckAnd
Move
(
IO_Type
.
SeparateDevice_Run
,
IO_VALUE
.
LOW
);
CheckAnd
Move
(
IO_Type
.
SeparateDevice_Up
,
IO_VALUE
.
LOW
);
CheckAnd
Move
(
IO_Type
.
SeparateDevice_Down
,
IO_VALUE
.
LOW
);
runStatus
=
LineRunStatus
.
Wait
;
}
...
...
source/DeviceLibrary/assemblyLine/FeedingEquip.cs
查看文件 @
257c8e9
...
...
@@ -107,19 +107,30 @@ namespace OnlineStore.DeviceLibrary
ResetClearData
();
lineStatus
=
LineStatus
.
ResetMove
;
IOMove
(
IO_Type
.
SL_HddLed
,
IO_VALUE
.
HIGH
);
MoveInfo
.
NextMoveStep
(
LineMoveStep
.
FR_00_LineRun
);
LogInfo
(
MoveInfo
.
MoveType
+
":"
+
MoveInfo
.
SLog
+
":开始复位,放料顶升下降, 所有阻挡上升,链条先转动3秒钟或等待定位工位有料架"
);
MoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitTime
(
3000
));
//CylinderMove(MoveInfo, IO_Type.SL_MoveCylinder_Down, IO_Type.SL_MoveCylinder_Up);
//CylinderMove(MoveInfo, IO_Type.SL_OutTopCylinder_Up, IO_Type.SL_OutTopCylinder_Down);
MoveInfo
.
NextMoveStep
(
LineMoveStep
.
FR_00_LineRun
);
//阻挡上升
IOMove
(
IO_Type
.
SL_Entry_StopDown
,
IO_VALUE
.
LOW
);
IOMove
(
IO_Type
.
SL_Buffer_StopDown
,
IO_VALUE
.
LOW
);
IOMove
(
IO_Type
.
SL_Out_StopDown
,
IO_VALUE
.
LOW
);
if
(
IOValue
(
IO_Type
.
SL_Location_Check
).
Equals
(
IO_VALUE
.
HIGH
))
{
LogInfo
(
MoveInfo
.
MoveType
+
":"
+
MoveInfo
.
SLog
+
":开始复位,放料顶升下降, 所有阻挡上升,检测到定位工位有信号,不转动链条"
);
}
else
{
LogInfo
(
MoveInfo
.
MoveType
+
":"
+
MoveInfo
.
SLog
+
":开始复位,放料顶升下降, 所有阻挡上升,链条先转动3秒钟 "
);
MoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitTime
(
3000
));
//线体开始转动
IOMove
(
IO_Type
.
SL_Line_Run
,
IO_VALUE
.
HIGH
);
IOMove
(
IO_Type
.
SL_LocationSideWay_Run
,
IO_VALUE
.
HIGH
);
IOMove
(
IO_Type
.
SL_OutSideWay_Run
,
IO_VALUE
.
HIGH
);
MoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitIO
(
IO_Type
.
SL_Location_Check
,
IO_VALUE
.
HIGH
));
MoveInfo
.
OneWaitCanEndStep
=
true
;
}
CheckAndMove
(
IO_Type
.
SL_Entry_StopDown
,
IO_VALUE
.
LOW
);
CheckAndMove
(
IO_Type
.
SL_Buffer_StopDown
,
IO_VALUE
.
LOW
);
CheckAndMove
(
IO_Type
.
SL_Out_StopDown
,
IO_VALUE
.
LOW
);
if
(
Config
.
SidesWayNum
<=
0
)
{
IO
Move
(
IO_Type
.
FL_StopCylinder_Down1
,
IO_VALUE
.
LOW
);
IO
Move
(
IO_Type
.
FL_StopCylinder_Down2
,
IO_VALUE
.
LOW
);
CheckAnd
Move
(
IO_Type
.
FL_StopCylinder_Down1
,
IO_VALUE
.
LOW
);
CheckAnd
Move
(
IO_Type
.
FL_StopCylinder_Down2
,
IO_VALUE
.
LOW
);
//顶升气缸下降
CylinderMove
(
null
,
IO_Type
.
FL_TopCylinder_Up
,
IO_Type
.
FL_TopCylinder_Down
);
}
...
...
@@ -128,12 +139,7 @@ namespace OnlineStore.DeviceLibrary
CylinderMove
(
null
,
IO_Type
.
SW_LocationCylinder_Up
,
IO_Type
.
SW_LocationCylinder_Down
);
CylinderMove
(
null
,
IO_Type
.
SW_TopCylinder_Up
,
IO_Type
.
SW_TopCylinder_Down
);
}
//线体停止
IOMove
(
IO_Type
.
SL_Line_Run
,
IO_VALUE
.
HIGH
);
IOMove
(
IO_Type
.
SL_LocationSideWay_Run
,
IO_VALUE
.
HIGH
);
IOMove
(
IO_Type
.
SL_OutSideWay_Run
,
IO_VALUE
.
HIGH
);
MoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitIO
(
IO_Type
.
SL_Location_Check
,
IO_VALUE
.
HIGH
));
MoveInfo
.
OneWaitCanEndStep
=
true
;
isInPro
=
false
;
}
//复位时,应该先提升伺服回原点,然后提升伺服下降到P2点,放开定位气缸,顶升气缸下降,提升伺服在上升到P1点。
...
...
@@ -363,8 +369,8 @@ namespace OnlineStore.DeviceLibrary
if
(
Config
.
SidesWayNum
<=
0
)
{
LogInfo
(
"下降放料阻挡12 ,下降FL顶升气缸,上升横移机构 "
);
IO
Move
(
IO_Type
.
FL_StopCylinder_Down1
,
IO_VALUE
.
HIGH
);
IO
Move
(
IO_Type
.
FL_StopCylinder_Down2
,
IO_VALUE
.
HIGH
);
CheckAnd
Move
(
IO_Type
.
FL_StopCylinder_Down1
,
IO_VALUE
.
HIGH
);
CheckAnd
Move
(
IO_Type
.
FL_StopCylinder_Down2
,
IO_VALUE
.
HIGH
);
//顶升气缸下降
CylinderMove
(
null
,
IO_Type
.
FL_TopCylinder_Up
,
IO_Type
.
FL_TopCylinder_Down
);
}
...
...
@@ -379,19 +385,19 @@ namespace OnlineStore.DeviceLibrary
if
(
Config
.
SidesWayNum
<=
0
)
{
LogInfo
(
"上升放料阻挡12,关闭顶升气缸,关闭横移上下气缸"
);
IO
Move
(
IO_Type
.
FL_StopCylinder_Down1
,
IO_VALUE
.
LOW
);
IO
Move
(
IO_Type
.
FL_StopCylinder_Down2
,
IO_VALUE
.
LOW
);
CheckAnd
Move
(
IO_Type
.
FL_StopCylinder_Down1
,
IO_VALUE
.
LOW
);
CheckAnd
Move
(
IO_Type
.
FL_StopCylinder_Down2
,
IO_VALUE
.
LOW
);
//顶升气缸下降
IO
Move
(
IO_Type
.
FL_TopCylinder_Up
,
IO_VALUE
.
LOW
);
IO
Move
(
IO_Type
.
FL_TopCylinder_Down
,
IO_VALUE
.
LOW
);
CheckAnd
Move
(
IO_Type
.
FL_TopCylinder_Up
,
IO_VALUE
.
LOW
);
CheckAnd
Move
(
IO_Type
.
FL_TopCylinder_Down
,
IO_VALUE
.
LOW
);
}
else
{
LogInfo
(
" 关闭横移上下气缸"
);
}
IO
Move
(
IO_Type
.
SL_MoveCylinder_Down
,
IO_VALUE
.
LOW
);
IO
Move
(
IO_Type
.
SL_MoveCylinder_Up
,
IO_VALUE
.
LOW
);
CheckAnd
Move
(
IO_Type
.
SL_MoveCylinder_Down
,
IO_VALUE
.
LOW
);
CheckAnd
Move
(
IO_Type
.
SL_MoveCylinder_Up
,
IO_VALUE
.
LOW
);
}
/// <summary>
...
...
@@ -444,7 +450,6 @@ namespace OnlineStore.DeviceLibrary
private
IO_VALUE
TargetIoValue
=
IO_VALUE
.
HIGH
;
private
bool
BatchAxisStartCheck
(
string
targetIo
=
""
,
IO_VALUE
value
=
IO_VALUE
.
HIGH
)
{
isOk
=
false
;
if
(
String
.
IsNullOrEmpty
(
targetIo
))
{
targetIo
=
IO_Type
.
SL_AxisLocationCheck
;
...
...
@@ -464,45 +469,38 @@ namespace OnlineStore.DeviceLibrary
}
private
bool
BatchAxisStopCheck
()
{
isOk
=
false
;
{
if
(!(
axisCheckTimer
==
null
))
{
axisCheckTimer
.
Stop
();
}
return
true
;
}
private
bool
IsInProcess
=
false
;
private
bool
isOk
=
false
;
private
bool
IsInProcess
=
false
;
private
DateTime
lastOkTime
=
DateTime
.
Now
;
private
void
CheckTimer_Elapsed
(
object
sender
,
System
.
Timers
.
ElapsedEventArgs
e
)
{
if
(
IsInProcess
)
{
return
;
}
IsInProcess
=
true
;
if
(
IOValue
(
TargetIoType
).
Equals
(
TargetIoValue
))
{
//if (!isOk)
//{
// isOk = true;
// lastOkTime = DateTime.Now;
//}
//else
//{
//TimeSpan span = DateTime.Now - lastOkTime;
//if (span.TotalMilliseconds > 100)
{
LogUtil
.
info
(
Name
+
"上料轴,检测到 "
+
TargetIoType
+
"="
+
TargetIoValue
+
",可以停止运动"
);
BatchAxis
.
SuddenStop
();
BatchAxisStopCheck
();
}
//}
TimeSpan
pan
=
DateTime
.
Now
-
lastOkTime
;
if
(
IsInProcess
&&
pan
.
TotalMilliseconds
<
300
)
{
return
;
}
try
{
IsInProcess
=
true
;
lastOkTime
=
DateTime
.
Now
;
if
(
IOValue
(
TargetIoType
).
Equals
(
TargetIoValue
))
{
LogUtil
.
info
(
Name
+
"上料轴,检测到 "
+
TargetIoType
+
"="
+
TargetIoValue
+
",可以停止运动"
);
BatchAxis
.
SuddenStop
();
BatchAxisStopCheck
();
}
}
catch
(
Exception
ex
)
{
LogUtil
.
error
(
"CheckTimer_Elapsed出错:"
+
ex
.
ToString
());
}
else
finally
{
isOk
=
false
;
IsInProcess
=
false
;
}
IsInProcess
=
false
;
}
...
...
source/DeviceLibrary/assemblyLine/FeedingEquip_InStore.cs
查看文件 @
257c8e9
...
...
@@ -16,6 +16,8 @@ namespace OnlineStore.DeviceLibrary
{
if
(
IOValue
(
TargetIoType
).
Equals
(
TargetIoValue
))
{
LogInfo
(
"CheckWaitResult 检测到"
+
TargetIoType
+
"="
+
TargetIoValue
+
",停止运行"
);
BatchAxis
.
SuddenStop
();
BatchAxisStopCheck
();
return
true
;
}
...
...
@@ -82,8 +84,8 @@ namespace OnlineStore.DeviceLibrary
CheckLog
(
"检测到SW_StopCheck:"
+
SecondMoveInfo
.
SLog
+
"阻挡气缸下降 ,最多等待1秒"
);
SecondMoveInfo
.
NextMoveStep
(
LineMoveStep
.
MIO_01_StopCylinder1Down
);
IOMove
(
IO_Type
.
SW_StopDown
,
IO_VALUE
.
HIGH
);
SecondMoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitIO
(
IO_Type
.
SW_StopDown
,
IO_VALUE
.
HIGH
));
SecondMoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitTime
(
10
00
));
SecondMoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitIO
(
IO_Type
.
SW_StopDown
,
IO_VALUE
.
LOW
));
SecondMoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitTime
(
5
00
));
//}
//else
//{
...
...
@@ -595,13 +597,13 @@ namespace OnlineStore.DeviceLibrary
{
MoveInfo
.
NextMoveStep
(
LineMoveStep
.
FI_17_UpdownAxisToP1
);
InLog
(
"料盘移栽"
+
MoveInfo
.
SLog
+
":升降伺服到P1点"
);
UpdownAxis
.
AbsMove
(
MoveInfo
,
Config
.
UpDownAxisP1
,
Config
.
UpdownAxis_P1Speed
);
UpdownAxis
.
AbsMove
(
MoveInfo
,
Config
.
UpDownAxisP1
,
Config
.
UpdownAxis_P1Speed
);
}
else
if
(
MoveInfo
.
MoveStep
.
Equals
(
LineMoveStep
.
FI_17_UpdownAxisToP1
))
{
MoveInfo
.
NextMoveStep
(
LineMoveStep
.
FI_17_BatchAxisToP3
);
InLog
(
"料盘移栽"
+
MoveInfo
.
SLog
+
":提升伺服运动到P3"
);
InLog
(
"料盘移栽"
+
MoveInfo
.
SLog
+
":提升伺服运动到P3,横移气缸上升"
);
CylinderMove
(
null
,
IO_Type
.
SL_MoveCylinder_Down
,
IO_Type
.
SL_MoveCylinder_Up
);
BatchAxisToP3
();
}
else
if
(
MoveInfo
.
MoveStep
.
Equals
(
LineMoveStep
.
FI_17_BatchAxisToP3
))
...
...
source/DeviceLibrary/assemblyLine/LineBean.cs
查看文件 @
257c8e9
...
...
@@ -185,12 +185,12 @@ namespace OnlineStore.DeviceLibrary
Thread
.
Sleep
(
5
);
if
(!
IsDebug
)
{
Task
.
Factory
.
StartNew
(
delegate
{
string
[]
rfidArray
=
rfidList
.
ToArray
();
//连接rfip
TrayManager
.
RfidReader
.
Open
(
rfidArray
);
});
//
Task.Factory.StartNew(delegate
//
{
//
string[] rfidArray = rfidList.ToArray();
//
//连接rfip
//
TrayManager.RfidReader.Open(rfidArray);
//
});
}
addLastDI
(
IO_Type
.
Airpressure_Check
,
IOValue
(
IO_Type
.
Airpressure_Check
));
addLastDI
(
IO_Type
.
SuddenStop_BTN
,
IOValue
(
IO_Type
.
SuddenStop_BTN
));
...
...
@@ -345,8 +345,8 @@ namespace OnlineStore.DeviceLibrary
//横移轨道下降
SideWayStop
();
IO
Move
(
IO_Type
.
SW2_StopDown
,
IO_VALUE
.
LOW
);
IO
Move
(
IO_Type
.
SW4_StopDown
,
IO_VALUE
.
LOW
);
CheckAnd
Move
(
IO_Type
.
SW2_StopDown
,
IO_VALUE
.
LOW
);
CheckAnd
Move
(
IO_Type
.
SW4_StopDown
,
IO_VALUE
.
LOW
);
//定位下降
CylinderMove
(
MoveInfo
,
IO_Type
.
SW1_LocationCylinder_Up
,
IO_Type
.
SW1_LocationCylinder_Down
);
...
...
@@ -790,6 +790,12 @@ namespace OnlineStore.DeviceLibrary
SideWayTimerProcess
();
}
TimeSpan
span
=
DateTime
.
Now
-
time
;
if
(
span
.
TotalMilliseconds
>
1000
)
{
LogUtil
.
error
(
Name
+
"主定时器处理耗时:"
+
FormUtil
.
GetSpanStr
(
span
));
}
}
catch
(
Exception
ex
)
{
...
...
source/DeviceLibrary/assemblyLine/LineBean_Partial.cs
查看文件 @
257c8e9
...
...
@@ -415,6 +415,7 @@ namespace OnlineStore.DeviceLibrary
private
bool
sdIsInprocess
=
false
;
private
DateTime
sdlastProTime
=
DateTime
.
Now
;
private
int
TraySingleWaitTime
=
500
;
private
void
SideWayTimerProcess
()
{
TimeSpan
span
=
DateTime
.
Now
-
sdlastProTime
;
...
...
@@ -439,7 +440,7 @@ namespace OnlineStore.DeviceLibrary
TrayManager
.
CanMoveSidesWay
(
4
)
&&
TrayManager
.
CanMoveSidesWay
(
1
))
{
TimeSpan
span12
=
DateTime
.
Now
-
SideWay41Ntime
;
if
(
SideWay41IsWait
&&
span12
.
Total
Seconds
>
1
)
if
(
SideWay41IsWait
&&
span12
.
Total
Milliseconds
>
TraySingleWaitTime
)
{
SW41_MoveInfo
.
NewMove
(
LineMoveType
.
InStore
);
SW41_MoveInfo
.
NextMoveStep
(
LineMoveStep
.
SW02_WaitFixtureCheck
);
...
...
@@ -456,19 +457,14 @@ namespace OnlineStore.DeviceLibrary
TrayManager
.
CanMoveSidesWay
(
4
)
&&
TrayManager
.
CanMoveSidesWay
(
1
))
{
TimeSpan
span14
=
DateTime
.
Now
-
SideWay41Ntime
;
if
(
SideWay41IsWait
&&
span14
.
Total
Seconds
>
1
)
if
(
SideWay41IsWait
&&
span14
.
Total
Milliseconds
>
TraySingleWaitTime
)
{
// TrayManager.UpdateSWState(4, 4);
//TrayManager.UpdateSWState(1, 4);
SW41_MoveInfo
.
NewMove
(
LineMoveType
.
InStore
);
SW41_MoveInfo
.
NextMoveStep
(
LineMoveStep
.
SW0
1_StopDown
);
SW41_MoveInfo
.
NextMoveStep
(
LineMoveStep
.
SW0
0_Wait
);
UpateSw41TrayNum
();
SWLog
(
"横移轨道41:检测到SW4_StopCheck, 等待1000,阻挡气缸下降,定位气缸下降 ,更新托盘号 ["
+
Sw41TrayNum
+
"] "
);
IOMove
(
IO_Type
.
SW4_StopDown
,
IO_VALUE
.
HIGH
);
SW41_MoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitTime
(
1000
));
// SW41_MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.SW4_TrayCheck, IO_VALUE.HIGH));
CylinderMove
(
SW41_MoveInfo
,
IO_Type
.
SW4_LocationCylinder_Up
,
IO_Type
.
SW1_LocationCylinder_Down
);
CylinderMove
(
SW41_MoveInfo
,
IO_Type
.
SW4_LocationCylinder_Up
,
IO_Type
.
SW1_LocationCylinder_Down
);
SWLog
(
"横移轨道41:检测到SW4_StopCheck, 定位气缸下降 ,更新托盘号 ["
+
Sw41TrayNum
+
"] "
);
CylinderMove
(
SW41_MoveInfo
,
IO_Type
.
SW4_LocationCylinder_Up
,
IO_Type
.
SW4_LocationCylinder_Down
);
CylinderMove
(
SW41_MoveInfo
,
IO_Type
.
SW1_LocationCylinder_Up
,
IO_Type
.
SW1_LocationCylinder_Down
);
}
else
if
(!
SideWay41IsWait
)
{
...
...
@@ -499,10 +495,8 @@ namespace OnlineStore.DeviceLibrary
TrayManager
.
CanMoveSidesWay
(
2
)
&&
TrayManager
.
CanMoveSidesWay
(
3
))
{
TimeSpan
span34
=
DateTime
.
Now
-
SideWay23Ntime
;
if
(
SideWay23IsWait
&&
span34
.
TotalSeconds
>
1
)
{
// TrayManager.UpdateSWState(2, 2);
//TrayManager.UpdateSWState(3, 2);
if
(
SideWay23IsWait
&&
span34
.
TotalMilliseconds
>
TraySingleWaitTime
)
{
SW23_MoveInfo
.
NewMove
(
LineMoveType
.
InStore
);
SW23_MoveInfo
.
NextMoveStep
(
LineMoveStep
.
SW02_WaitFixtureCheck
);
UpateSw23TrayNum
();
...
...
@@ -523,19 +517,14 @@ namespace OnlineStore.DeviceLibrary
TrayManager
.
CanMoveSidesWay
(
2
)
&&
TrayManager
.
CanMoveSidesWay
(
3
))
{
TimeSpan
span34
=
DateTime
.
Now
-
SideWay23Ntime
;
if
(
SideWay23IsWait
&&
span34
.
TotalSeconds
>
1
)
{
// TrayManager.UpdateSWState(2, 2);
//TrayManager.UpdateSWState(3, 2);
if
(
SideWay23IsWait
&&
span34
.
TotalMilliseconds
>
TraySingleWaitTime
)
{
SW23_MoveInfo
.
NewMove
(
LineMoveType
.
InStore
);
SW23_MoveInfo
.
NextMoveStep
(
LineMoveStep
.
SW01_StopDown
);
UpateSw23TrayNum
();
SWLog
(
"横移轨道23:检测到SW2_StopCheck, 等待1000,定位气缸下降 ,更新托盘号 ["
+
Sw23TrayNum
+
"] "
);
IOMove
(
IO_Type
.
SW2_StopDown
,
IO_VALUE
.
HIGH
);
SW23_MoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitTime
(
1000
));
// SW23_MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.SW2_TrayCheck, IO_VALUE.HIGH));
CylinderMove
(
SW23_MoveInfo
,
IO_Type
.
SW2_LocationCylinder_Up
,
IO_Type
.
SW3_LocationCylinder_Down
);
CylinderMove
(
SW23_MoveInfo
,
IO_Type
.
SW2_LocationCylinder_Up
,
IO_Type
.
SW3_LocationCylinder_Down
);
SWLog
(
"横移轨道23:检测到SW2_StopCheck, 定位气缸下降 ,更新托盘号 ["
+
Sw23TrayNum
+
"] "
);
CylinderMove
(
SW23_MoveInfo
,
IO_Type
.
SW2_LocationCylinder_Up
,
IO_Type
.
SW2_LocationCylinder_Down
);
CylinderMove
(
SW23_MoveInfo
,
IO_Type
.
SW3_LocationCylinder_Up
,
IO_Type
.
SW3_LocationCylinder_Down
);
}
else
if
(!
SideWay23IsWait
)
{
...
...
@@ -604,7 +593,14 @@ namespace OnlineStore.DeviceLibrary
{
return
;
}
if
(
SW41_MoveInfo
.
MoveStep
.
Equals
(
LineMoveStep
.
SW01_StopDown
))
if
(
SW41_MoveInfo
.
MoveStep
.
Equals
(
LineMoveStep
.
SW00_Wait
))
{
SW41_MoveInfo
.
NextMoveStep
(
LineMoveStep
.
SW01_StopDown
);
SWLog
(
"横移轨道41: 阻挡气缸下降 等待 "
+
TrayManager
.
StopDownWaitTime
);
IOMove
(
IO_Type
.
SW4_StopDown
,
IO_VALUE
.
HIGH
);
SW41_MoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitTime
(
TrayManager
.
StopDownWaitTime
));
}
else
if
(
SW41_MoveInfo
.
MoveStep
.
Equals
(
LineMoveStep
.
SW01_StopDown
))
{
SW41_MoveInfo
.
NextMoveStep
(
LineMoveStep
.
SW02_WaitFixtureCheck
);
SWLog
(
"横移轨道41: 等待横移4托盘检测信号 ,SW4_StopDown上升 "
);
...
...
@@ -650,14 +646,14 @@ namespace OnlineStore.DeviceLibrary
SW41_MoveInfo
.
NextMoveStep
(
LineMoveStep
.
SW07_TopCylinderDown
);
SWLog
(
"横移轨道41:托盘已到达出口,顶升气缸下降,判断入料1是否需要此托盘 "
);
CylinderMove
(
SW41_MoveInfo
,
IO_Type
.
SW4_TopCylinder_Up
,
IO_Type
.
SW4_TopCylinder_Down
);
if
(!
CheckTrayIsNeed
(
101
,
Sw41TrayNum
))
if
(!
CheckTrayIsNeed
(
101
,
Sw41TrayNum
))
{
CylinderMove
(
SW41_MoveInfo
,
IO_Type
.
SW1_TopCylinder_Up
,
IO_Type
.
SW1_TopCylinder_Down
);
}
}
else
if
(
SW41_MoveInfo
.
MoveStep
.
Equals
(
LineMoveStep
.
SW07_TopCylinderDown
))
{
if
(
CheckTrayIsNeed
(
101
,
Sw41TrayNum
))
if
(
CheckTrayIsNeed
(
101
,
Sw41TrayNum
))
{
SW41_MoveInfo
.
NextMoveStep
(
LineMoveStep
.
SW09_WaitTrayGo
);
SWLog
(
"横移轨道41:关闭皮带电机,不需要等待 托盘离开"
);
...
...
@@ -715,7 +711,14 @@ namespace OnlineStore.DeviceLibrary
{
return
;
}
if
(
SW23_MoveInfo
.
MoveStep
.
Equals
(
LineMoveStep
.
SW01_StopDown
))
if
(
SW23_MoveInfo
.
MoveStep
.
Equals
(
LineMoveStep
.
SW00_Wait
))
{
SW23_MoveInfo
.
NextMoveStep
(
LineMoveStep
.
SW01_StopDown
);
SWLog
(
"横移轨道23:阻挡气缸下降 等待 "
+
TrayManager
.
StopDownWaitTime
);
IOMove
(
IO_Type
.
SW2_StopDown
,
IO_VALUE
.
HIGH
);
SW23_MoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitTime
(
TrayManager
.
StopDownWaitTime
));
}
else
if
(
SW23_MoveInfo
.
MoveStep
.
Equals
(
LineMoveStep
.
SW01_StopDown
))
{
SW23_MoveInfo
.
NextMoveStep
(
LineMoveStep
.
SW02_WaitFixtureCheck
);
SWLog
(
"横移轨道23:SW2_StopDown上升 等待横移3托盘检测信号 "
);
...
...
@@ -761,14 +764,14 @@ namespace OnlineStore.DeviceLibrary
SW23_MoveInfo
.
NextMoveStep
(
LineMoveStep
.
SW07_TopCylinderDown
);
SWLog
(
"横移轨道23:托盘已到达出口,顶升气缸下降 "
);
CylinderMove
(
SW23_MoveInfo
,
IO_Type
.
SW2_TopCylinder_Up
,
IO_Type
.
SW2_TopCylinder_Down
);
if
(!
CheckTrayIsNeed
(
104
,
Sw23TrayNum
))
if
(!
CheckTrayIsNeed
(
104
,
Sw23TrayNum
))
{
CylinderMove
(
SW23_MoveInfo
,
IO_Type
.
SW3_TopCylinder_Up
,
IO_Type
.
SW3_TopCylinder_Down
);
}
}
else
if
(
SW23_MoveInfo
.
MoveStep
.
Equals
(
LineMoveStep
.
SW07_TopCylinderDown
))
{
if
(
CheckTrayIsNeed
(
104
,
Sw23TrayNum
))
if
(
CheckTrayIsNeed
(
104
,
Sw23TrayNum
))
{
SW23_MoveInfo
.
NextMoveStep
(
LineMoveStep
.
SW09_WaitTrayGo
);
SWLog
(
"横移轨道41:关闭皮带电机,不需要等待 托盘离开"
);
...
...
source/DeviceLibrary/assemblymanager/TrayManager.cs
查看文件 @
257c8e9
...
...
@@ -12,7 +12,8 @@ namespace OnlineStore.DeviceLibrary
{
public
class
TrayManager
{
public
static
RFID
RfidReader
=
new
RFID
();
public
static
int
StopDownWaitTime
=
1000
;
// public static RFID RfidReader = new RFID();
///// <summary>
///// 出库时,可以不下降直接放料盘的宽度
///// </summary>
...
...
@@ -184,62 +185,63 @@ namespace OnlineStore.DeviceLibrary
public
static
int
GetTrayNum
(
int
subType
,
bool
isClear
=
false
)
{
return
9
;
if
(
subType
.
Equals
(
104
))
{
return
LineManager
.
Line
.
Sw23TrayNum
;
}
else
if
(
subType
.
Equals
(
101
))
{
return
LineManager
.
Line
.
Sw41TrayNum
;
}
//
if (subType.Equals(104))
//
{
//
return LineManager.Line.Sw23TrayNum;
//
}
//
else if (subType.Equals(101))
//
{
//
return LineManager.Line.Sw41TrayNum;
//
}
string
ip
=
GetRFIP
(
subType
);
//获取盘号
RFIDData
data
=
ReadRFID
(
ip
);
if
(
data
!=
null
)
{
if
(
data
.
RFType
.
Equals
((
byte
)
'E'
))
{
return
data
.
Num
;
}
return
0
;
//else
//{
// LogUtil.error("读取托盘RFID[" + subType + "][" + ip + "]的数据出错:" + data.ToStr());
//}
}
if
(
isClear
)
{
RfidReader
.
Clear
(
ip
);
}
//
string ip = GetRFIP(subType);
//
//
获取盘号
//
RFIDData data = ReadRFID(ip);
//
if (data != null)
//
{
//
if (data.RFType.Equals((byte)'E'))
//
{
//
return data.Num;
//
}
//
return 0;
//
//else
//
//{
//
// LogUtil.error("读取托盘RFID[" + subType + "][" + ip + "]的数据出错:" + data.ToStr());
//
//}
//
}
//
if (isClear)
//
{
//
RfidReader.Clear(ip);
//
}
return
0
;
}
public
static
RFIDData
GetShelfData
(
int
subType
)
{
string
ip
=
GetRFIP
(
subType
,
1
);
return
ReadRFID
(
ip
);
return
ReadRFID
(
ip
);
}
public
static
RFIDData
ReadRFID
(
string
ip
)
{
try
{
if
(
String
.
IsNullOrEmpty
(
ip
).
Equals
(
false
)&&
LineManager
.
Line
.
rfidList
.
Contains
(
ip
))
{
//获取盘号
byte
[]
data
=
RfidReader
.
Read
(
ip
);
if
(
data
!=
null
&&
data
.
Length
>=
2
)
{
RFIDData
d
=
new
RFIDData
(
data
);
return
d
;
}
}
}
catch
(
Exception
ex
)
{
//LogUtil.error("ReadRFID["+ip+"]出错:" + ex.ToString());
}
return
new
RFIDData
(-
1
,-
1
);
//try
//{
// if (String.IsNullOrEmpty(ip).Equals(false) && LineManager.Line.rfidList.Contains(ip))
// {
// //获取盘号
// byte[] data = RfidReader.Read(ip);
// if (data != null && data.Length >= 2)
// {
// RFIDData d = new RFIDData(data);
// return d;
// }
// }
//}
//catch (Exception ex)
//{
// //LogUtil.error("ReadRFID["+ip+"]出错:" + ex.ToString());
//}
return
new
RFIDData
(-
1
,
-
1
);
}
private
static
string
GetRFIP
(
int
subType
,
int
rtType
=
0
)
...
...
source/DeviceLibrary/model/KTK_Store.cs
查看文件 @
257c8e9
...
...
@@ -328,7 +328,7 @@ namespace OnlineStore.DeviceLibrary
}
}
public
void
CylinderMove
(
LineMoveInfo
moveInfo
,
string
IoLowType
,
string
IoHighType
)
public
void
CylinderMove
(
LineMoveInfo
moveInfo
,
string
IoLowType
,
string
IoHighType
,
bool
isCheckMove
=
false
)
{
if
(
baseConfig
.
DType
.
Equals
(
DeviceType
.
FeedingEquip
))
{
...
...
@@ -341,14 +341,29 @@ namespace OnlineStore.DeviceLibrary
return
;
}
}
IOMove
(
IoLowType
,
IO_VALUE
.
LOW
);
IOMove
(
IoHighType
,
IO_VALUE
.
HIGH
);
if
(
isCheckMove
||
moveInfo
==
null
)
{
CheckAndMove
(
IoLowType
,
IO_VALUE
.
LOW
);
CheckAndMove
(
IoHighType
,
IO_VALUE
.
HIGH
);
}
else
{
IOMove
(
IoLowType
,
IO_VALUE
.
LOW
);
IOMove
(
IoHighType
,
IO_VALUE
.
HIGH
);
}
if
(
moveInfo
!=
null
)
{
moveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitIO
(
IoLowType
,
IO_VALUE
.
LOW
));
moveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitIO
(
IoHighType
,
IO_VALUE
.
HIGH
));
}
}
public
void
CheckAndMove
(
string
IoType
,
IO_VALUE
value
)
{
if
(!
IOValue
(
IoType
).
Equals
(
value
))
{
IOMove
(
IoType
,
value
);
}
}
public
void
IOMove
(
string
IoType
,
IO_VALUE
value
)
{
IOManager
.
IOMove
(
IoType
,
value
,
baseConfig
.
Id
);
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论