Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
孙克
/
RC1250-AssemblyLine
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit 5df80339
由
LN
编写于
2019-09-23 11:23:34 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
1
1 个父辈
fd03e0ff
隐藏空白字符变更
内嵌
并排
正在显示
13 个修改的文件
包含
461 行增加
和
263 行删除
source/AssemblyLineClient/FrmFeedingEquip.cs
source/DeviceLibrary/LineConfig/Config_FeedingEquip_1.csv
source/DeviceLibrary/assemblyLine/FeedingEquip.cs
source/DeviceLibrary/assemblyLine/LineBean.cs
source/DeviceLibrary/assemblyLine/LineBean_Partial.cs
source/DeviceLibrary/assemblyLine/MoveEquip.cs
source/DeviceLibrary/assemblyLine/MoveEquip_Partial.cs
source/DeviceLibrary/model/StoreMoveInfo.cs
source/DeviceLibrary/model/StoreStep.cs
source/DeviceLibrary/server/LineServer.cs
source/LoadCVSLibrary/storeConfig/config/FeedingEquip_Config.cs
source/LoadCVSLibrary/storeConfig/config/IO_Type.cs
source/LoadCVSLibrary/storeConfig/config/StoreConfig.cs
source/AssemblyLineClient/FrmFeedingEquip.cs
查看文件 @
5df8033
...
@@ -176,12 +176,12 @@ namespace OnlineStore.AssemblyLine
...
@@ -176,12 +176,12 @@ namespace OnlineStore.AssemblyLine
chbDebug
.
Checked
=
feedEquip
.
IsDebug
;
chbDebug
.
Checked
=
feedEquip
.
IsDebug
;
if
(
feedEquip
.
UpdownUseAxis
)
if
(
feedEquip
.
UpdownUseAxis
)
{
{
portName
=
feedEquip
.
Config
.
UpDown
_Axis
.
DeviceName
;
portName
=
feedEquip
.
Config
.
Batch
_Axis
.
DeviceName
;
SlvAddr
=
feedEquip
.
Config
.
UpDown
_Axis
.
GetAxisValue
();
SlvAddr
=
feedEquip
.
Config
.
Batch
_Axis
.
GetAxisValue
();
txtAxisDeviceName
.
Text
=
portName
;
txtAxisDeviceName
.
Text
=
portName
;
txtSlaveId
.
Text
=
SlvAddr
.
ToString
();
txtSlaveId
.
Text
=
SlvAddr
.
ToString
();
comboBox1
.
Items
.
Clear
();
comboBox1
.
Items
.
Clear
();
comboBox1
.
Items
.
Add
(
feedEquip
.
Config
.
UpDown
_Axis
.
Explain
);
comboBox1
.
Items
.
Add
(
feedEquip
.
Config
.
Batch
_Axis
.
Explain
);
comboBox1
.
SelectedIndex
=
0
;
comboBox1
.
SelectedIndex
=
0
;
txtAxisValue
.
Text
=
SlvAddr
.
ToString
();
txtAxisValue
.
Text
=
SlvAddr
.
ToString
();
...
@@ -200,7 +200,7 @@ namespace OnlineStore.AssemblyLine
...
@@ -200,7 +200,7 @@ namespace OnlineStore.AssemblyLine
cmbSizeList
.
SelectedIndex
=
0
;
cmbSizeList
.
SelectedIndex
=
0
;
lblStoreStatus
.
Text
=
KTK_Store
.
GetRunStr
(
feedEquip
.
lineStatus
,
feedEquip
.
runStatus
);
lblStoreStatus
.
Text
=
KTK_Store
.
GetRunStr
(
feedEquip
.
lineStatus
,
feedEquip
.
runStatus
);
lblThisSta
.
Text
=
feedEquip
.
WarnMsg
;
lblThisSta
.
Text
=
feedEquip
.
WarnMsg
;
txtP1
.
Text
=
feedEquip
.
Config
.
UpDown
AxisP1
.
ToString
();
txtP1
.
Text
=
feedEquip
.
Config
.
Batch
AxisP1
.
ToString
();
IsLoad
=
true
;
IsLoad
=
true
;
}
}
...
@@ -584,7 +584,7 @@ namespace OnlineStore.AssemblyLine
...
@@ -584,7 +584,7 @@ namespace OnlineStore.AssemblyLine
int
position
=
FormUtil
.
GetIntValue
(
txtSizePosition
);
int
position
=
FormUtil
.
GetIntValue
(
txtSizePosition
);
if
(
position
!=
-
1
)
if
(
position
!=
-
1
)
{
{
int
speed
=
feedEquip
.
Config
.
Updown
Axis_DownSpeed
;
int
speed
=
feedEquip
.
Config
.
Batch
Axis_DownSpeed
;
LogUtil
.
info
(
"点击【移栽位置】,料盘高度【"
+
cmbSizeList
.
Text
+
"】 位置【"
+
position
+
"】速度【"
+
speed
+
"】"
);
LogUtil
.
info
(
"点击【移栽位置】,料盘高度【"
+
cmbSizeList
.
Text
+
"】 位置【"
+
position
+
"】速度【"
+
speed
+
"】"
);
ACServerManager
.
AbsMove
(
portName
,
SlvAddr
,
position
,
speed
);
ACServerManager
.
AbsMove
(
portName
,
SlvAddr
,
position
,
speed
);
}
}
...
@@ -614,7 +614,7 @@ namespace OnlineStore.AssemblyLine
...
@@ -614,7 +614,7 @@ namespace OnlineStore.AssemblyLine
int
position
=
FormUtil
.
GetIntValue
(
txtP1
);
int
position
=
FormUtil
.
GetIntValue
(
txtP1
);
if
(
position
!=
-
1
)
if
(
position
!=
-
1
)
{
{
int
speed
=
feedEquip
.
Config
.
Updown
Axis_P1Speed
;
int
speed
=
feedEquip
.
Config
.
Batch
Axis_P1Speed
;
LogUtil
.
info
(
"点击【P1点测试】, 位置【"
+
position
+
"】速度【"
+
speed
+
"】"
);
LogUtil
.
info
(
"点击【P1点测试】, 位置【"
+
position
+
"】速度【"
+
speed
+
"】"
);
ACServerManager
.
AbsMove
(
portName
,
SlvAddr
,
position
,
speed
);
ACServerManager
.
AbsMove
(
portName
,
SlvAddr
,
position
,
speed
);
}
}
...
@@ -623,7 +623,7 @@ namespace OnlineStore.AssemblyLine
...
@@ -623,7 +623,7 @@ namespace OnlineStore.AssemblyLine
private
void
btnSave_Click
(
object
sender
,
EventArgs
e
)
private
void
btnSave_Click
(
object
sender
,
EventArgs
e
)
{
{
int
p1Position
=
FormUtil
.
GetIntValue
(
txtP1
);
int
p1Position
=
FormUtil
.
GetIntValue
(
txtP1
);
feedEquip
.
Config
.
UpDown
AxisP1
=
p1Position
;
feedEquip
.
Config
.
Batch
AxisP1
=
p1Position
;
int
size
=
0
;
int
size
=
0
;
try
{
size
=
Convert
.
ToInt32
(
cmbSizeList
.
Text
);
}
catch
(
Exception
ex
)
{
}
try
{
size
=
Convert
.
ToInt32
(
cmbSizeList
.
Text
);
}
catch
(
Exception
ex
)
{
}
...
@@ -640,7 +640,7 @@ namespace OnlineStore.AssemblyLine
...
@@ -640,7 +640,7 @@ namespace OnlineStore.AssemblyLine
int
position
=
FormUtil
.
GetIntValue
(
txtBoxP
);
int
position
=
FormUtil
.
GetIntValue
(
txtBoxP
);
if
(
position
!=
-
1
)
if
(
position
!=
-
1
)
{
{
int
speed
=
feedEquip
.
Config
.
Updown
Axis_DownSpeed
;
int
speed
=
feedEquip
.
Config
.
Batch
Axis_DownSpeed
;
LogUtil
.
info
(
"点击【料仓门口下降位置】,料盘高度【"
+
cmbSizeList
.
Text
+
"】 位置【"
+
position
+
"】速度【"
+
speed
+
"】"
);
LogUtil
.
info
(
"点击【料仓门口下降位置】,料盘高度【"
+
cmbSizeList
.
Text
+
"】 位置【"
+
position
+
"】速度【"
+
speed
+
"】"
);
ACServerManager
.
AbsMove
(
portName
,
SlvAddr
,
position
,
speed
);
ACServerManager
.
AbsMove
(
portName
,
SlvAddr
,
position
,
speed
);
}
}
...
...
source/DeviceLibrary/LineConfig/Config_FeedingEquip_1.csv
查看文件 @
5df8033
...
@@ -3,7 +3,7 @@ PRO,0,设备是否处于调试状态(1=调试,0=正常),IsDebug,1,,,,,
...
@@ -3,7 +3,7 @@ PRO,0,设备是否处于调试状态(1=调试,0=正常),IsDebug,1,,,,,
,,,,,,,,,
,,,,,,,,,
PRO,0,移栽上下运动是否使用伺服,UpDownUseAxis,0,,,,,
PRO,0,移栽上下运动是否使用伺服,UpDownUseAxis,0,,,,,
PRO,0,移栽上下移动料盘高度对应的上升位置,UpDownPositions,12=1000;16=1300;20=2000;24=2000;36=3000;,,,,,
PRO,0,移栽上下移动料盘高度对应的上升位置,UpDownPositions,12=1000;16=1300;20=2000;24=2000;36=3000;,,,,,
AXIS,0,批量上料轴,
UpDown
_Axis,2,COM1,0,,,
AXIS,0,批量上料轴,
Batch
_Axis,2,COM1,0,,,
PRO,0,批量上料轴待机点 P1,BatchAxisP1,2000,,,,,
PRO,0,批量上料轴待机点 P1,BatchAxisP1,2000,,,,,
PRO,0,批量上料轴目标速度,BatchAxis_TargetSpeed,150,,,,,
PRO,0,批量上料轴目标速度,BatchAxis_TargetSpeed,150,,,,,
PRO,0,批量上料轴加速度,BatchAxis_AddSpeed,400,,,,,
PRO,0,批量上料轴加速度,BatchAxis_AddSpeed,400,,,,,
...
...
source/DeviceLibrary/assemblyLine/FeedingEquip.cs
查看文件 @
5df8033
...
@@ -47,15 +47,15 @@ namespace OnlineStore.DeviceLibrary
...
@@ -47,15 +47,15 @@ namespace OnlineStore.DeviceLibrary
UpdownUseAxis
=
config
.
UpDownUseAxis
.
Equals
(
1
);
UpdownUseAxis
=
config
.
UpDownUseAxis
.
Equals
(
1
);
if
(
UpdownUseAxis
)
if
(
UpdownUseAxis
)
{
{
Config
.
UpDown_Axis
.
TargetSpeed
=
Config
.
Updown
Axis_TargetSpeed
;
Config
.
Batch_Axis
.
TargetSpeed
=
Config
.
Batch
Axis_TargetSpeed
;
Config
.
UpDown_Axis
.
AddSpeed
=
Config
.
Updown
Axis_AddSpeed
;
Config
.
Batch_Axis
.
AddSpeed
=
Config
.
Batch
Axis_AddSpeed
;
Config
.
UpDown_Axis
.
DelSpeed
=
Config
.
Updown
Axis_DelSpeed
;
Config
.
Batch_Axis
.
DelSpeed
=
Config
.
Batch
Axis_DelSpeed
;
Config
.
UpDown_Axis
.
HomeAddSpeed
=
Config
.
Updown
Axis_HomeAddSpeed
;
Config
.
Batch_Axis
.
HomeAddSpeed
=
Config
.
Batch
Axis_HomeAddSpeed
;
Config
.
UpDown_Axis
.
HomeHighSpeed
=
Config
.
Updown
Axis_HomeHighSpeed
;
Config
.
Batch_Axis
.
HomeHighSpeed
=
Config
.
Batch
Axis_HomeHighSpeed
;
Config
.
UpDown_Axis
.
HomeLowSpeed
=
Config
.
Updown
Axis_HomeLowSpeed
;
Config
.
Batch_Axis
.
HomeLowSpeed
=
Config
.
Batch
Axis_HomeLowSpeed
;
portName
=
Config
.
UpDown
_Axis
.
DeviceName
;
portName
=
Config
.
Batch
_Axis
.
DeviceName
;
slvAddr
=
config
.
UpDown
_Axis
.
GetAxisValue
();
slvAddr
=
config
.
Batch
_Axis
.
GetAxisValue
();
}
}
}
}
...
@@ -424,7 +424,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -424,7 +424,7 @@ namespace OnlineStore.DeviceLibrary
if
(
UpdownUseAxis
)
if
(
UpdownUseAxis
)
{
{
LogInfo
(
"停止运动:停止伺服"
);
LogInfo
(
"停止运动:停止伺服"
);
ACServerManager
.
SuddenStop
(
Config
.
UpDown
_Axis
);
ACServerManager
.
SuddenStop
(
Config
.
Batch
_Axis
);
}
}
runStatus
=
LineRunStatus
.
Runing
;
runStatus
=
LineRunStatus
.
Runing
;
MoveInfo
.
EndMove
();
MoveInfo
.
EndMove
();
...
@@ -522,7 +522,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -522,7 +522,7 @@ namespace OnlineStore.DeviceLibrary
{
{
return
true
;
return
true
;
}
}
IOMove
(
IO_Type
.
UpDown
Axis_ServoOn
,
IO_VALUE
.
HIGH
);
IOMove
(
IO_Type
.
Batch
Axis_ServoOn
,
IO_VALUE
.
HIGH
);
Thread
.
Sleep
(
1000
);
Thread
.
Sleep
(
1000
);
//打开所有轴
//打开所有轴
ACServerManager
.
OpenPort
(
portName
);
ACServerManager
.
OpenPort
(
portName
);
...
@@ -530,7 +530,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -530,7 +530,7 @@ namespace OnlineStore.DeviceLibrary
//初始化
//初始化
if
(!
IsIntSlvBlock
)
if
(!
IsIntSlvBlock
)
{
{
ACServerManager
.
InitSlvAddr
(
portName
,
slvAddr
,
Config
.
UpDown_Axis
.
TargetSpeed
,
Config
.
UpDown_Axis
.
AddSpeed
,
Config
.
UpDown
_Axis
.
DelSpeed
);
ACServerManager
.
InitSlvAddr
(
portName
,
slvAddr
,
Config
.
Batch_Axis
.
TargetSpeed
,
Config
.
Batch_Axis
.
AddSpeed
,
Config
.
Batch
_Axis
.
DelSpeed
);
Thread
.
Sleep
(
100
);
Thread
.
Sleep
(
100
);
}
}
ACServerManager
.
AlarmClear
(
portName
,
slvAddr
);
ACServerManager
.
AlarmClear
(
portName
,
slvAddr
);
...
@@ -547,9 +547,15 @@ namespace OnlineStore.DeviceLibrary
...
@@ -547,9 +547,15 @@ namespace OnlineStore.DeviceLibrary
}
}
}
}
IsIntSlvBlock
=
true
;
IsIntSlvBlock
=
true
;
IOMove
(
IO_Type
.
UpDown
Axis_BreakOn
,
IO_VALUE
.
HIGH
);
IOMove
(
IO_Type
.
Batch
Axis_BreakOn
,
IO_VALUE
.
HIGH
);
return
true
;
return
true
;
}
}
private
void
IOMove
(
object
batchAxis_ServoOn
,
IO_VALUE
hIGH
)
{
throw
new
NotImplementedException
();
}
/// <summary>
/// <summary>
/// 打开所有轴
/// 打开所有轴
/// </summary>
/// </summary>
...
@@ -560,24 +566,24 @@ namespace OnlineStore.DeviceLibrary
...
@@ -560,24 +566,24 @@ namespace OnlineStore.DeviceLibrary
if
(
ACServerManager
.
ServerOnStatus
(
portName
,
slvAddr
))
if
(
ACServerManager
.
ServerOnStatus
(
portName
,
slvAddr
))
{
{
LogUtil
.
info
(
Name
+
"成功打开轴:"
+
Config
.
UpDown
_Axis
.
Explain
);
LogUtil
.
info
(
Name
+
"成功打开轴:"
+
Config
.
Batch
_Axis
.
Explain
);
}
}
else
else
{
{
//清理报警,再重新打开一次
//清理报警,再重新打开一次
LogUtil
.
info
(
Name
+
"第一次打开轴"
+
Config
.
UpDown
_Axis
.
Explain
+
"失败,先清理一下报警,再重新打开一次"
);
LogUtil
.
info
(
Name
+
"第一次打开轴"
+
Config
.
Batch
_Axis
.
Explain
+
"失败,先清理一下报警,再重新打开一次"
);
ACServerManager
.
AlarmClear
(
portName
,
slvAddr
);
ACServerManager
.
AlarmClear
(
portName
,
slvAddr
);
System
.
Threading
.
Thread
.
Sleep
(
1200
);
System
.
Threading
.
Thread
.
Sleep
(
1200
);
ACServerManager
.
ServoOn
(
portName
,
slvAddr
);
ACServerManager
.
ServoOn
(
portName
,
slvAddr
);
System
.
Threading
.
Thread
.
Sleep
(
100
);
System
.
Threading
.
Thread
.
Sleep
(
100
);
if
(
ACServerManager
.
ServerOnStatus
(
portName
,
slvAddr
))
if
(
ACServerManager
.
ServerOnStatus
(
portName
,
slvAddr
))
{
{
LogUtil
.
info
(
Name
+
"清理报警后重新打卡轴成功:"
+
Config
.
UpDown
_Axis
.
Explain
);
LogUtil
.
info
(
Name
+
"清理报警后重新打卡轴成功:"
+
Config
.
Batch
_Axis
.
Explain
);
}
}
else
else
{
{
ACServerManager
.
ServoOff
(
portName
,
slvAddr
);
ACServerManager
.
ServoOff
(
portName
,
slvAddr
);
WarnMsg
=
Name
+
"打开轴"
+
Config
.
UpDown
_Axis
.
Explain
+
"失败 "
;
WarnMsg
=
Name
+
"打开轴"
+
Config
.
Batch
_Axis
.
Explain
+
"失败 "
;
LogUtil
.
info
(
Name
+
WarnMsg
);
LogUtil
.
info
(
Name
+
WarnMsg
);
Alarm
(
LineAlarmType
.
AxisAlarm
,
5.
ToString
(),
WarnMsg
,
MoveInfo
.
MoveType
);
Alarm
(
LineAlarmType
.
AxisAlarm
,
5.
ToString
(),
WarnMsg
,
MoveInfo
.
MoveType
);
return
false
;
return
false
;
...
@@ -591,14 +597,14 @@ namespace OnlineStore.DeviceLibrary
...
@@ -591,14 +597,14 @@ namespace OnlineStore.DeviceLibrary
public
void
CloseAxis
()
public
void
CloseAxis
()
{
{
LogUtil
.
info
(
Name
+
"关闭刹车,关闭伺服"
);
LogUtil
.
info
(
Name
+
"关闭刹车,关闭伺服"
);
IOMove
(
IO_Type
.
UpDown
Axis_BreakOn
,
IO_VALUE
.
LOW
);
IOMove
(
IO_Type
.
Batch
Axis_BreakOn
,
IO_VALUE
.
LOW
);
ACServerManager
.
ServoOff
(
portName
,
slvAddr
);
ACServerManager
.
ServoOff
(
portName
,
slvAddr
);
//关闭串口,等下次重新打开
//关闭串口,等下次重新打开
ACServerManager
.
ColsePort
(
portName
);
ACServerManager
.
ColsePort
(
portName
);
Thread
.
Sleep
(
100
);
Thread
.
Sleep
(
100
);
IOMove
(
IO_Type
.
UpDown
Axis_ServoOn
,
IO_VALUE
.
LOW
);
IOMove
(
IO_Type
.
Batch
Axis_ServoOn
,
IO_VALUE
.
LOW
);
}
}
...
@@ -690,7 +696,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -690,7 +696,7 @@ namespace OnlineStore.DeviceLibrary
{
{
if
(
UpdownUseAxis
)
if
(
UpdownUseAxis
)
{
{
ACAxisMove
(
Config
.
UpDown_Axis
,
Config
.
UpDownAxisP1
,
Config
.
Updown
Axis_P1Speed
);
ACAxisMove
(
Config
.
Batch_Axis
,
Config
.
BatchAxisP1
,
Config
.
Batch
Axis_P1Speed
);
}
}
else
else
{
{
...
@@ -703,7 +709,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -703,7 +709,7 @@ namespace OnlineStore.DeviceLibrary
if
(
UpdownUseAxis
)
if
(
UpdownUseAxis
)
{
{
int
position
=
Config
.
GetUpdownPosition
(
trayHeight
);
int
position
=
Config
.
GetUpdownPosition
(
trayHeight
);
ACAxisMove
(
Config
.
UpDown_Axis
,
position
,
Config
.
Updown
Axis_DownSpeed
);
ACAxisMove
(
Config
.
Batch_Axis
,
position
,
Config
.
Batch
Axis_DownSpeed
);
}
}
else
else
{
{
...
@@ -715,7 +721,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -715,7 +721,7 @@ namespace OnlineStore.DeviceLibrary
if
(
UpdownUseAxis
)
if
(
UpdownUseAxis
)
{
{
int
position
=
Config
.
GetUpdownBoxPosition
(
trayHeight
);
int
position
=
Config
.
GetUpdownBoxPosition
(
trayHeight
);
ACAxisMove
(
Config
.
UpDown_Axis
,
position
,
Config
.
Updown
Axis_DownSpeed
);
ACAxisMove
(
Config
.
Batch_Axis
,
position
,
Config
.
Batch
Axis_DownSpeed
);
}
}
else
else
{
{
...
@@ -727,7 +733,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -727,7 +733,7 @@ namespace OnlineStore.DeviceLibrary
if
(
UpdownUseAxis
)
if
(
UpdownUseAxis
)
{
{
MoveInfo
.
NextMoveStep
(
LineMoveStep
.
MH_UpDownHomeMove
);
MoveInfo
.
NextMoveStep
(
LineMoveStep
.
MH_UpDownHomeMove
);
ACAxisHomeMove
(
Config
.
UpDown
_Axis
);
ACAxisHomeMove
(
Config
.
Batch
_Axis
);
}
}
else
else
{
{
...
...
source/DeviceLibrary/assemblyLine/LineBean.cs
查看文件 @
5df8033
...
@@ -596,22 +596,22 @@ namespace OnlineStore.DeviceLibrary
...
@@ -596,22 +596,22 @@ namespace OnlineStore.DeviceLibrary
// FeederProcess();
// FeederProcess();
//如果驱动电机正转过程中,驱动电机INV1状态 驱动电机INV2状态 有信号,需要报警
//如果驱动电机正转过程中,驱动电机INV1状态 驱动电机INV2状态 有信号,需要报警
if
(
IOValue
(
IO_Type
.
DriveMotor_Run
).
Equals
(
IO_VALUE
.
HIGH
))
//
if (IOValue(IO_Type.DriveMotor_Run).Equals(IO_VALUE.HIGH))
{
//
{
if
(
IOValue
(
IO_Type
.
DriveMotor_INV1
).
Equals
(
IO_VALUE
.
LOW
))
//
if (IOValue(IO_Type.DriveMotor_INV1).Equals(IO_VALUE.LOW))
{
//
{
WarnMsg
=
"驱动电机INV1状态异常"
;
//
WarnMsg = "驱动电机INV1状态异常";
LogUtil
.
error
(
"驱动电机正转过程中,DriveMotor_INV1
信号LOW,需要报警"
,
300
);
// LogUtil.error("驱动电机正转过程中,DriveMotor_INV1
信号LOW,需要报警", 300);
Alarm
(
LineAlarmType
.
SuddenStop
,
"1"
,
WarnMsg
,
LineMoveType
.
None
);
// //
Alarm(LineAlarmType.SuddenStop, "1", WarnMsg, LineMoveType.None);
}
//
}
else
if
(
IOValue
(
IO_Type
.
DriveMotor_INV2
).
Equals
(
IO_VALUE
.
LOW
))
//
else if (IOValue(IO_Type.DriveMotor_INV2).Equals(IO_VALUE.LOW))
{
//
{
WarnMsg
=
"驱动电机INV2状态异常"
;
//
WarnMsg = "驱动电机INV2状态异常";
LogUtil
.
error
(
"驱动电机正转过程中,DriveMotor_INV2
信号LOW,需要报警"
,
301
);
// LogUtil.error("驱动电机正转过程中,DriveMotor_INV2
信号LOW,需要报警", 301);
Alarm
(
LineAlarmType
.
SuddenStop
,
"1"
,
WarnMsg
,
LineMoveType
.
None
);
// //
Alarm(LineAlarmType.SuddenStop, "1", WarnMsg, LineMoveType.None);
}
//
}
}
//
}
}
}
}
}
catch
(
Exception
ex
)
catch
(
Exception
ex
)
...
@@ -620,6 +620,21 @@ namespace OnlineStore.DeviceLibrary
...
@@ -620,6 +620,21 @@ namespace OnlineStore.DeviceLibrary
}
}
Thread
.
Sleep
(
1
);
Thread
.
Sleep
(
1
);
}
}
public
string
GetINVMsg
()
{
if
(
IOValue
(
IO_Type
.
DriveMotor_Run
).
Equals
(
IO_VALUE
.
HIGH
))
{
if
(
IOValue
(
IO_Type
.
DriveMotor_INV1
).
Equals
(
IO_VALUE
.
LOW
))
{
return
" 驱动电机INV1状态异常"
;
}
else
if
(
IOValue
(
IO_Type
.
DriveMotor_INV2
).
Equals
(
IO_VALUE
.
LOW
))
{
return
" 驱动电机INV2状态异常"
;
}
}
return
""
;
}
/// <summary>
/// <summary>
/// 定时处理,监听信号,监听IO
/// 定时处理,监听信号,监听IO
/// </summary>
/// </summary>
...
@@ -882,15 +897,12 @@ namespace OnlineStore.DeviceLibrary
...
@@ -882,15 +897,12 @@ namespace OnlineStore.DeviceLibrary
return
;
return
;
}
}
lock
(
moveEquip
.
waitInListLock
)
{
// InOutParam param = new InOutParam(trayCode,wareNum, posId, plateH, plateW );
StartInStoreMove
(
param
);
//如果当前正在出入库中,需要记录下来,等待空闲时执行
LogUtil
.
info
(
moveEquip
.
Name
+
" 收到服务器入库命令: "
+
param
.
ToStr
()
+
" ,写入排队列表中等待!"
);
moveEquip
.
waitInStoreList
.
Add
(
param
);
}
LineServer
.
CheckInStorePos
(
storeId
,
param
);
LineServer
.
CheckInStorePos
(
storeId
,
param
);
StartInStoreMove
(
param
);
}
}
}
}
}
}
...
...
source/DeviceLibrary/assemblyLine/LineBean_Partial.cs
查看文件 @
5df8033
...
@@ -98,7 +98,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -98,7 +98,7 @@ namespace OnlineStore.DeviceLibrary
{
{
//有料盘,直接扫码通过 。如果移栽在出库过程中,不能扫码
//有料盘,直接扫码通过 。如果移栽在出库过程中,不能扫码
IsWaitEmptyGo
=
false
;
IsWaitEmptyGo
=
false
;
if
(!
IsScanCode
&&
CanScanCode
())
if
(!
IsScanCode
&&
CanScanCode
())
{
{
if
(!
IsWaitToScan
)
if
(!
IsWaitToScan
)
{
{
...
@@ -120,7 +120,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -120,7 +120,7 @@ namespace OnlineStore.DeviceLibrary
}
}
else
else
{
{
string
msg
=
Name
+
" 托盘顺序错乱,上个托盘号【"
+
preTrayNum
+
"】当前有料托盘【"
+
trayNum
+
"】最大盘号【"
+
TrayManager
.
MaxTrayNum
+
"】"
;
string
msg
=
Name
+
" 托盘顺序错乱,上个托盘号【"
+
preTrayNum
+
"】当前有料托盘【"
+
trayNum
+
"】最大盘号【"
+
TrayManager
.
MaxTrayNum
+
"】"
;
TrayManager
.
UpdateTrayNumError
(
0
,
msg
);
TrayManager
.
UpdateTrayNumError
(
0
,
msg
);
LogUtil
.
error
(
msg
);
LogUtil
.
error
(
msg
);
}
}
...
@@ -196,7 +196,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -196,7 +196,7 @@ namespace OnlineStore.DeviceLibrary
}
}
/// <summary>
/// <summary>
/// 判断当前是否可以开始扫码
/// 判断当前是否可以开始扫码
/// </summary>
/// </summary>
public
bool
CanScanCode
()
public
bool
CanScanCode
()
{
{
//若有移栽在出库过程中,则不能扫码
//若有移栽在出库过程中,则不能扫码
...
@@ -243,100 +243,103 @@ namespace OnlineStore.DeviceLibrary
...
@@ -243,100 +243,103 @@ namespace OnlineStore.DeviceLibrary
private
DateTime
preRWTime
=
DateTime
.
Now
;
private
DateTime
preRWTime
=
DateTime
.
Now
;
private
void
CheckWait
(
LineMoveInfo
checkWaitInfo
)
private
void
CheckWait
(
LineMoveInfo
checkWaitInfo
)
{
{
List
<
WaitResultInfo
>
list
=
checkWaitInfo
.
WaitList
;
try
if
(
list
.
Count
<=
0
)
{
{
checkWaitInfo
.
EndStepWait
();
List
<
WaitResultInfo
>
list
=
checkWaitInfo
.
WaitList
;
return
;
if
(
list
.
Count
<=
0
)
}
{
checkWaitInfo
.
EndStepWait
();
return
;
}
//当等待超过一分钟时,需要打印提示
//当等待超过一分钟时,需要打印提示
TimeSpan
span
=
DateTime
.
Now
-
checkWaitInfo
.
LastSetpTime
;
TimeSpan
span
=
DateTime
.
Now
-
checkWaitInfo
.
LastSetpTime
;
string
NotOkMsg
=
""
;
string
NotOkMsg
=
""
;
bool
isOk
=
true
;
bool
isOk
=
true
;
if
(
checkWaitInfo
.
OneWaitCanEndStep
)
if
(
checkWaitInfo
.
OneWaitCanEndStep
)
{
isOk
=
false
;
}
foreach
(
WaitResultInfo
wait
in
list
)
{
if
(
wait
.
IsEnd
)
{
{
continu
e
;
isOk
=
fals
e
;
}
}
NotOkMsg
=
wait
.
ToStr
();
foreach
(
WaitResultInfo
wait
in
list
)
if
(
wait
.
WaitType
==
2
)
{
{
wait
.
IsEnd
=
IOValue
(
wait
.
IoType
).
Equals
(
wait
.
IoValue
);
if
(
wait
.
IsEnd
)
{
if
(!
wait
.
IsEnd
)
continue
;
}
NotOkMsg
=
wait
.
ToStr
();
if
(
wait
.
WaitType
==
2
)
{
{
if
(
span
.
TotalMilliseconds
>
LineManager
.
Config
.
IOSingle_TimerOut
)
NotOkMsg
=
" ("
+
Config
.
GetDisplayName
(
wait
.
IoType
)
+
"="
+
wait
.
IoValue
+
") "
;
wait
.
IsEnd
=
IOValue
(
wait
.
IoType
).
Equals
(
wait
.
IoValue
);
if
(!
wait
.
IsEnd
)
{
{
ConfigIO
io
=
Config
.
getWaitIO
(
wait
.
IoType
);
TimeSpan
rwSpan
=
DateTime
.
Now
-
preRWTime
;
if
(
span
.
TotalMilliseconds
>
LineManager
.
Config
.
IOSingle_TimerOut
)
{
ConfigIO
io
=
Config
.
getWaitIO
(
wait
.
IoType
);
WarnMsg
=
Name
+
" 等待信号("
+
io
.
DisplayStr
+
"="
+
wait
.
IoValue
+
")
超时"
;
WarnMsg
=
Name
+
" 等待"
+
NotOkMsg
+
"
超时"
;
Alarm
(
LineAlarmType
.
IoSingleTimeOut
,
io
.
ElectricalDefinition
,
WarnMsg
,
checkWaitInfo
.
MoveType
);
Alarm
(
LineAlarmType
.
IoSingleTimeOut
,
io
.
ElectricalDefinition
,
WarnMsg
,
checkWaitInfo
.
MoveType
);
LogUtil
.
error
(
checkWaitInfo
.
Name
+
":"
+
wait
.
IoType
+
"等待信号("
+
io
.
DisplayStr
+
"="
+
wait
.
IoValue
+
")
超时"
,
14
);
LogUtil
.
error
(
checkWaitInfo
.
Name
+
":"
+
wait
.
IoType
+
"等待"
+
NotOkMsg
+
"
超时"
,
14
);
isOk
=
false
;
isOk
=
false
;
break
;
break
;
}
else
if
(
rwSpan
.
TotalSeconds
>
3
&&
span
.
TotalSeconds
>
3
&&
(
checkWaitInfo
.
WriteIoList
!=
null
)
&&
checkWaitInfo
.
WriteIoList
.
Count
>
0
)
{
List
<
WriteIOInfo
>
wLists
=
new
List
<
WriteIOInfo
>(
checkWaitInfo
.
WriteIoList
);
preRWTime
=
DateTime
.
Now
;
string
msg
=
checkWaitInfo
.
Name
+
" "
+
NotOkMsg
+
" 已等待"
+
Math
.
Abs
(
span
.
TotalSeconds
)
+
"秒,重写DO:"
;
foreach
(
WriteIOInfo
ww
in
wLists
)
{
IOMove
(
ww
.
IoType
,
ww
.
IoValue
);
msg
+=
"["
+
ww
.
IoType
+
"+"
+
ww
.
IoValue
+
"],"
;
}
LogUtil
.
error
(
msg
);
}
}
}
//TimeSpan rwSpan = DateTime.Now - preRWTime;
}
////一分钟还未检测到
else
if
(
wait
.
WaitType
==
3
)
//if (rwSpan.TotalSeconds > 3)
{
//{
wait
.
IsEnd
=
(
span
.
TotalMilliseconds
>=
wait
.
TimeMSeconds
);
// preRWTime = DateTime.Now;
}
// //把IO重置位0
else
if
(
wait
.
WaitType
==
8
)
// string msg = checkWaitInfo.Name + " : " + wait.IoType + " = " + wait.IoValue + " 已等待" + Math.Abs(span.TotalMilliseconds) + ",重写DO信号:";
{
// foreach (WaitResultInfo ww in list)
string
posId
=
checkWaitInfo
.
MoveParam
.
PosId
;
// {
int
id
=
checkWaitInfo
.
MoveParam
.
GetStoreId
();
// if (ww != null && ww.WaitType.Equals(2))
wait
.
IsEnd
=
LineServer
.
RightInPosId
(
id
,
posId
);
// {
}
// if (Config.DOList.ContainsKey(ww.IoType))
else
if
(
wait
.
WaitType
.
Equals
(
9
))
// {
{
// IOMove(wait.IoType, ww.IoValue);
int
storeId
=
checkWaitInfo
.
MoveParam
.
GetStoreId
();
// msg += wait.ToStr() + ",";
wait
.
IsEnd
=
LineServer
.
BoxCanReviceTray
(
storeId
);
// }
}
// }
if
(
wait
.
IsEnd
&&
checkWaitInfo
.
OneWaitCanEndStep
)
// }
{
//}
isOk
=
true
;
break
;
}
else
if
(!
checkWaitInfo
.
OneWaitCanEndStep
&&
wait
.
IsEnd
.
Equals
(
false
))
{
isOk
=
false
;
break
;
}
}
}
}
else
if
(
wait
.
WaitType
==
3
)
if
(
isOk
)
{
wait
.
IsEnd
=
(
span
.
TotalMilliseconds
>=
wait
.
TimeMSeconds
);
}
else
if
(
wait
.
WaitType
==
8
)
{
string
posId
=
checkWaitInfo
.
MoveParam
.
PosId
;
int
id
=
checkWaitInfo
.
MoveParam
.
GetStoreId
();
wait
.
IsEnd
=
LineServer
.
RightInPosId
(
id
,
posId
);
}
else
if
(
wait
.
WaitType
.
Equals
(
9
))
{
int
storeId
=
checkWaitInfo
.
MoveParam
.
GetStoreId
();
wait
.
IsEnd
=
LineServer
.
BoxCanReviceTray
(
storeId
);
}
if
(
wait
.
IsEnd
&&
checkWaitInfo
.
OneWaitCanEndStep
)
{
{
isOk
=
true
;
checkWaitInfo
.
EndStepWait
();
break
;
}
}
else
if
(
!
checkWaitInfo
.
OneWaitCanEndStep
&&
wait
.
IsEnd
.
Equals
(
false
)
)
else
if
(
span
.
TotalSeconds
>
checkWaitInfo
.
TimeOutSeconds
)
{
{
isOk
=
false
;
WarnMsg
=
checkWaitInfo
.
Name
+
"["
+
checkWaitInfo
.
MoveStep
+
"]["
+
NotOkMsg
+
"]已等待["
+
Math
.
Round
(
span
.
TotalSeconds
,
1
)
+
"]秒"
;
break
;
LogUtil
.
error
(
WarnMsg
,
100
);
Alarm
(
LineAlarmType
.
IoSingleTimeOut
,
""
,
WarnMsg
,
checkWaitInfo
.
MoveType
);
}
}
}
}
if
(
isOk
)
catch
(
Exception
ex
)
{
checkWaitInfo
.
EndStepWait
();
}
else
if
(
span
.
TotalSeconds
>
checkWaitInfo
.
TimeOutSeconds
)
{
{
WarnMsg
=
checkWaitInfo
.
Name
+
" 【"
+
checkWaitInfo
.
MoveStep
+
"】 ["
+
NotOkMsg
+
"]已等待["
+
Math
.
Round
(
span
.
TotalSeconds
,
1
)
+
"]秒"
;
LogUtil
.
error
(
checkWaitInfo
.
Name
+
" ["
+
checkWaitInfo
.
MoveStep
+
"] CheckWait 出错:"
+
ex
.
ToString
());
LogUtil
.
error
(
WarnMsg
,
100
);
Alarm
(
LineAlarmType
.
IoSingleTimeOut
,
""
,
WarnMsg
,
checkWaitInfo
.
MoveType
);
}
}
}
}
...
@@ -444,7 +447,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -444,7 +447,7 @@ namespace OnlineStore.DeviceLibrary
//判断是否可以入库
//判断是否可以入库
string
posId
=
MoveInfo
.
MoveParam
.
PosId
;
string
posId
=
MoveInfo
.
MoveParam
.
PosId
;
int
id
=
MoveInfo
.
MoveParam
.
GetStoreId
();
int
id
=
MoveInfo
.
MoveParam
.
GetStoreId
();
bool
result
=
LineServer
.
RightInPosId
(
id
,
posId
);
bool
result
=
LineServer
.
RightInPosId
(
id
,
posId
);
MoveEquip
moveEquip
=
null
;
MoveEquip
moveEquip
=
null
;
MoveEquipMap
.
TryGetValue
(
id
,
out
moveEquip
);
MoveEquipMap
.
TryGetValue
(
id
,
out
moveEquip
);
if
(!
result
||
moveEquip
==
null
)
if
(!
result
||
moveEquip
==
null
)
...
@@ -543,6 +546,8 @@ namespace OnlineStore.DeviceLibrary
...
@@ -543,6 +546,8 @@ namespace OnlineStore.DeviceLibrary
}
}
private
void
SideWayStop
()
private
void
SideWayStop
()
{
{
SideWay12IsWait
=
false
;
SideWay34IsWait
=
false
;
SW12_MoveInfo
.
EndMove
();
SW12_MoveInfo
.
EndMove
();
SW34_MoveInfo
.
EndMove
();
SW34_MoveInfo
.
EndMove
();
...
@@ -565,6 +570,9 @@ namespace OnlineStore.DeviceLibrary
...
@@ -565,6 +570,9 @@ namespace OnlineStore.DeviceLibrary
moveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitIO
(
IO_Type
.
SidesWay1_TopCylinder_Up
,
upValue
));
moveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitIO
(
IO_Type
.
SidesWay1_TopCylinder_Up
,
upValue
));
moveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitIO
(
IO_Type
.
SidesWay2_TopCylinder_Down
,
downValue
));
moveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitIO
(
IO_Type
.
SidesWay2_TopCylinder_Down
,
downValue
));
moveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitIO
(
IO_Type
.
SidesWay2_TopCylinder_Up
,
upValue
));
moveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitIO
(
IO_Type
.
SidesWay2_TopCylinder_Up
,
upValue
));
moveInfo
.
WriteIoList
.
Add
(
WriteIOInfo
.
NInfo
(
IO_Type
.
SidesWay12_TopCylinder_Down
,
downValue
));
moveInfo
.
WriteIoList
.
Add
(
WriteIOInfo
.
NInfo
(
IO_Type
.
SidesWay12_TopCylinder_Up
,
upValue
));
}
}
}
}
public
void
SideWay34TopCylinderMove
(
IO_VALUE
downValue
,
IO_VALUE
upValue
,
LineMoveInfo
moveInfo
=
null
)
public
void
SideWay34TopCylinderMove
(
IO_VALUE
downValue
,
IO_VALUE
upValue
,
LineMoveInfo
moveInfo
=
null
)
...
@@ -578,10 +586,32 @@ namespace OnlineStore.DeviceLibrary
...
@@ -578,10 +586,32 @@ namespace OnlineStore.DeviceLibrary
moveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitIO
(
IO_Type
.
SidesWay3_TopCylinder_Up
,
upValue
));
moveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitIO
(
IO_Type
.
SidesWay3_TopCylinder_Up
,
upValue
));
moveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitIO
(
IO_Type
.
SidesWay4_TopCylinder_Down
,
downValue
));
moveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitIO
(
IO_Type
.
SidesWay4_TopCylinder_Down
,
downValue
));
moveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitIO
(
IO_Type
.
SidesWay4_TopCylinder_Up
,
upValue
));
moveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitIO
(
IO_Type
.
SidesWay4_TopCylinder_Up
,
upValue
));
moveInfo
.
WriteIoList
.
Add
(
WriteIOInfo
.
NInfo
(
IO_Type
.
SidesWay34_TopCylinder_Down
,
downValue
));
moveInfo
.
WriteIoList
.
Add
(
WriteIOInfo
.
NInfo
(
IO_Type
.
SidesWay34_TopCylinder_Up
,
upValue
));
}
}
}
}
/// <summary>
/// 判断横移轨道34是否有托盘
/// </summary>
/// <returns></returns>
public
bool
SideWay34HasTray
()
{
//正在横移中,且托盘顶升气缸未下降
if
(
SW34_MoveInfo
.
MoveType
.
Equals
(
LineMoveType
.
None
).
Equals
(
false
)
&&
SW34_MoveInfo
.
MoveStep
<=
LineMoveStep
.
SW07_TopCylinderDown
)
{
return
true
;
}
if
(
IOValue
(
IO_Type
.
SidesWay3_FixtureCheck
).
Equals
(
IO_VALUE
.
HIGH
))
{
return
true
;
}
return
false
;
}
private
DateTime
SideWay12Ntime
=
DateTime
.
Now
;
private
bool
SideWay12IsWait
=
false
;
private
DateTime
SideWay34Ntime
=
DateTime
.
Now
;
private
bool
SideWay34IsWait
=
false
;
private
void
SideWayTimerProcess
()
private
void
SideWayTimerProcess
()
{
{
//流水线转动中,并且在忙碌或出入库处理中,需要处理移栽
//流水线转动中,并且在忙碌或出入库处理中,需要处理移栽
...
@@ -589,51 +619,88 @@ namespace OnlineStore.DeviceLibrary
...
@@ -589,51 +619,88 @@ namespace OnlineStore.DeviceLibrary
{
{
if
(
SW12_MoveInfo
.
MoveType
.
Equals
(
LineMoveType
.
None
)
&&
IOValue
(
IO_Type
.
SidesWay2_FixtureCheck
).
Equals
(
IO_VALUE
.
LOW
))
if
(
SW12_MoveInfo
.
MoveType
.
Equals
(
LineMoveType
.
None
)
&&
IOValue
(
IO_Type
.
SidesWay2_FixtureCheck
).
Equals
(
IO_VALUE
.
LOW
))
{
{
TimeSpan
span12
=
DateTime
.
Now
-
SideWay12Ntime
;
//检测到阻挡夹具信号后,阻挡气缸下降,等待有夹具信号,阻挡气缸上升,
//检测到阻挡夹具信号后,阻挡气缸下降,等待有夹具信号,阻挡气缸上升,
//顶升气缸上升到位,开始流水线转动,检测到出口信号后,停止转动,顶升气缸下降,阻挡2下降,盘通过
//顶升气缸上升到位,开始流水线转动,检测到出口信号后,停止转动,顶升气缸下降,阻挡2下降,盘通过
if
(
IOValue
(
IO_Type
.
SidesWay1_StopFixtureCheck
).
Equals
(
IO_VALUE
.
HIGH
))
if
(
IOValue
(
IO_Type
.
SidesWay1_StopFixtureCheck
).
Equals
(
IO_VALUE
.
HIGH
))
{
{
SWLog
(
"横移轨道1检测到托盘,开始移动托盘"
);
if
(
SideWay12IsWait
&&
span12
.
TotalSeconds
>
1
)
SW12_MoveInfo
.
NewMove
(
LineMoveType
.
InStore
);
{
SW12_MoveInfo
.
NextMoveStep
(
LineMoveStep
.
SW01_StopCylinderDown
);
SWLog
(
"横移轨道阻挡1检测到托盘,开始移动托盘,下降横移气缸12"
);
SW12_MoveInfo
.
NewMove
(
LineMoveType
.
InStore
);
IOMove
(
IO_Type
.
SidesWay1_StopCylinderDown
,
IO_VALUE
.
HIGH
);
SW12_MoveInfo
.
NextMoveStep
(
LineMoveStep
.
SW00_Wait
);
SideWay12TopCylinderMove
(
IO_VALUE
.
HIGH
,
IO_VALUE
.
LOW
,
SW12_MoveInfo
);
SideWay12TopCylinderMove
(
IO_VALUE
.
HIGH
,
IO_VALUE
.
LOW
,
SW12_MoveInfo
);
}
else
if
(!
SideWay12IsWait
)
{
SideWay12IsWait
=
true
;
SideWay12Ntime
=
DateTime
.
Now
;
}
}
}
else
if
(
IOValue
(
IO_Type
.
SidesWay1_FixtureCheck
).
Equals
(
IO_VALUE
.
HIGH
))
else
if
(
IOValue
(
IO_Type
.
SidesWay1_FixtureCheck
).
Equals
(
IO_VALUE
.
HIGH
))
{
{
SWLog
(
"横移轨道1检测到托盘,开始移动托盘"
);
if
(
SideWay12IsWait
&&
span12
.
TotalSeconds
>
1
)
SW12_MoveInfo
.
NewMove
(
LineMoveType
.
InStore
);
{
SW12_MoveInfo
.
NextMoveStep
(
LineMoveStep
.
SW01_StopCylinderDown
);
SWLog
(
"横移轨道1检测到托盘,阻挡1上升,等待横移1夹具检测信号"
);
SW12_MoveInfo
.
NewMove
(
LineMoveType
.
InStore
);
IOMove
(
IO_Type
.
SidesWay1_StopCylinderDown
,
IO_VALUE
.
HIGH
);
SW12_MoveInfo
.
NextMoveStep
(
LineMoveStep
.
SW02_WaitFixtureCheck
);
SideWay12TopCylinderMove
(
IO_VALUE
.
HIGH
,
IO_VALUE
.
LOW
,
SW12_MoveInfo
);
IOMove
(
IO_Type
.
SidesWay1_StopCylinderDown
,
IO_VALUE
.
LOW
);
SW12_MoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitIO
(
IO_Type
.
SidesWay1_FixtureCheck
,
IO_VALUE
.
HIGH
));
}
else
if
(!
SideWay12IsWait
)
{
SideWay12IsWait
=
true
;
SideWay12Ntime
=
DateTime
.
Now
;
}
}
else
{
SideWay12IsWait
=
false
;
}
}
}
}
else
else
{
{
SideWay12IsWait
=
false
;
SideWay12BusyProcess
();
SideWay12BusyProcess
();
}
}
if
(
SW34_MoveInfo
.
MoveType
.
Equals
(
LineMoveType
.
None
)
&&
IOValue
(
IO_Type
.
SidesWay4_FixtureCheck
).
Equals
(
IO_VALUE
.
LOW
))
if
(
SW34_MoveInfo
.
MoveType
.
Equals
(
LineMoveType
.
None
)
&&
IOValue
(
IO_Type
.
SidesWay4_FixtureCheck
).
Equals
(
IO_VALUE
.
LOW
))
{
{
TimeSpan
span34
=
DateTime
.
Now
-
SideWay34Ntime
;
//检测到阻挡夹具信号后,阻挡气缸下降,等待有夹具信号,阻挡气缸上升,
//检测到阻挡夹具信号后,阻挡气缸下降,等待有夹具信号,阻挡气缸上升,
//顶升气缸上升到位,开始流水线转动,检测到出口信号后,停止转动,顶升气缸下降,阻挡4下降,盘通过
//顶升气缸上升到位,开始流水线转动,检测到出口信号后,停止转动,顶升气缸下降,阻挡4下降,盘通过
if
(
IOValue
(
IO_Type
.
SidesWay3_FixtureCheck
).
Equals
(
IO_VALUE
.
HIGH
))
if
(
IOValue
(
IO_Type
.
SidesWay3_FixtureCheck
).
Equals
(
IO_VALUE
.
HIGH
))
{
{
SWLog
(
"横移轨道3检测到托盘,开始移动托盘"
);
if
(
SideWay34IsWait
&&
span34
.
TotalSeconds
>
1
)
SW34_MoveInfo
.
NewMove
(
LineMoveType
.
InStore
);
{
SW34_MoveInfo
.
NextMoveStep
(
LineMoveStep
.
SW01_StopCylinderDown
);
SWLog
(
"横移轨道3检测到托盘,开始移动托盘"
);
SW34_MoveInfo
.
NewMove
(
LineMoveType
.
InStore
);
IOMove
(
IO_Type
.
SidesWay3_StopCylinderDown
,
IO_VALUE
.
HIGH
);
SW34_MoveInfo
.
NextMoveStep
(
LineMoveStep
.
SW01_StopCylinderDown
);
SideWay34TopCylinderMove
(
IO_VALUE
.
HIGH
,
IO_VALUE
.
LOW
,
SW34_MoveInfo
);
IOMove
(
IO_Type
.
SidesWay3_StopCylinderDown
,
IO_VALUE
.
HIGH
);
SideWay34TopCylinderMove
(
IO_VALUE
.
HIGH
,
IO_VALUE
.
LOW
,
SW34_MoveInfo
);
}
else
if
(!
SideWay34IsWait
)
{
SideWay34IsWait
=
true
;
SideWay34Ntime
=
DateTime
.
Now
;
}
}
else
{
SideWay34IsWait
=
false
;
}
}
}
}
else
else
{
{
SideWay34IsWait
=
false
;
SideWay34BusyProcess
();
SideWay34BusyProcess
();
}
}
}
}
else
{
SideWay34IsWait
=
false
;
SideWay12IsWait
=
false
;
}
}
}
private
void
SideWay12BusyProcess
()
private
void
SideWay12BusyProcess
()
...
@@ -646,52 +713,72 @@ namespace OnlineStore.DeviceLibrary
...
@@ -646,52 +713,72 @@ namespace OnlineStore.DeviceLibrary
{
{
return
;
return
;
}
}
if
(
SW12_MoveInfo
.
MoveStep
.
Equals
(
LineMoveStep
.
SW01_StopCylinderDown
))
if
(
SW12_MoveInfo
.
MoveStep
.
Equals
(
LineMoveStep
.
SW00_Wait
))
{
SW12_MoveInfo
.
NextMoveStep
(
LineMoveStep
.
SW01_StopCylinderDown
);
SWLog
(
"横移轨道12:阻挡1下降,最多下降1000 "
);
IOMove
(
IO_Type
.
SidesWay1_StopCylinderDown
,
IO_VALUE
.
HIGH
);
SW12_MoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitTime
(
1000
));
}
else
if
(
SW12_MoveInfo
.
MoveStep
.
Equals
(
LineMoveStep
.
SW01_StopCylinderDown
))
{
{
SW12_MoveInfo
.
NextMoveStep
(
LineMoveStep
.
SW02_WaitFixtureCheck
);
SW12_MoveInfo
.
NextMoveStep
(
LineMoveStep
.
SW02_WaitFixtureCheck
);
SWLog
(
"横移轨道12:
横移1阻挡
上升,等待横移1夹具检测信号 "
);
SWLog
(
"横移轨道12:
阻挡1
上升,等待横移1夹具检测信号 "
);
IOMove
(
IO_Type
.
SidesWay1_StopCylinderDown
,
IO_VALUE
.
LOW
);
IOMove
(
IO_Type
.
SidesWay1_StopCylinderDown
,
IO_VALUE
.
LOW
);
SW12_MoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitIO
(
IO_Type
.
SidesWay1_FixtureCheck
,
IO_VALUE
.
HIGH
));
SW12_MoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitIO
(
IO_Type
.
SidesWay1_FixtureCheck
,
IO_VALUE
.
HIGH
));
}
}
else
if
(
SW12_MoveInfo
.
MoveStep
.
Equals
(
LineMoveStep
.
SW02_WaitFixtureCheck
))
else
if
(
SW12_MoveInfo
.
MoveStep
.
Equals
(
LineMoveStep
.
SW02_WaitFixtureCheck
))
{
{
SW12_MoveInfo
.
NextMoveStep
(
LineMoveStep
.
SW03_TopCylinderUp
);
SW12_MoveInfo
.
NextMoveStep
(
LineMoveStep
.
SW03_TopCylinderUp
);
SWLog
(
"横移轨道12:顶升气缸上升 ,横移1阻挡上升 "
);
SWLog
(
"横移轨道12:顶升气缸上升 ,横移1阻挡上升 ,至少等待1000 "
);
SW12_MoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitTime
(
1000
));
IOMove
(
IO_Type
.
SidesWay1_StopCylinderDown
,
IO_VALUE
.
LOW
);
IOMove
(
IO_Type
.
SidesWay1_StopCylinderDown
,
IO_VALUE
.
LOW
);
SideWay12TopCylinderMove
(
IO_VALUE
.
LOW
,
IO_VALUE
.
HIGH
,
SW12_MoveInfo
);
SideWay12TopCylinderMove
(
IO_VALUE
.
LOW
,
IO_VALUE
.
HIGH
,
SW12_MoveInfo
);
}
}
else
if
(
SW12_MoveInfo
.
MoveStep
.
Equals
(
LineMoveStep
.
SW03_TopCylinderUp
))
else
if
(
SW12_MoveInfo
.
MoveStep
.
Equals
(
LineMoveStep
.
SW03_TopCylinderUp
))
{
{
SW12_MoveInfo
.
NextMoveStep
(
LineMoveStep
.
SW04_DriveMotorMove
);
SW12_MoveInfo
.
NextMoveStep
(
LineMoveStep
.
SW04_DriveMotorMove
);
SWLog
(
"横移轨道12:开始转动电机 ,等待1000,等待
出口夹具检测信号
"
);
SWLog
(
"横移轨道12:开始转动电机 ,等待1000,等待
SidesWay2_FixtureCheck=1, SidesWay1_FixtureCheck=0
"
);
IOMove
(
IO_Type
.
SidesWay12_DriveMotor
,
IO_VALUE
.
HIGH
);
IOMove
(
IO_Type
.
SidesWay12_DriveMotor
,
IO_VALUE
.
HIGH
);
SW
34
_MoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitTime
(
1000
));
SW
12
_MoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitTime
(
1000
));
SW12_MoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitIO
(
IO_Type
.
SidesWay2_FixtureCheck
,
IO_VALUE
.
HIGH
));
SW12_MoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitIO
(
IO_Type
.
SidesWay2_FixtureCheck
,
IO_VALUE
.
HIGH
));
SW12_MoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitIO
(
IO_Type
.
SidesWay1_FixtureCheck
,
IO_VALUE
.
LOW
));
}
}
else
if
(
SW12_MoveInfo
.
MoveStep
.
Equals
(
LineMoveStep
.
SW04_DriveMotorMove
))
else
if
(
SW12_MoveInfo
.
MoveStep
.
Equals
(
LineMoveStep
.
SW04_DriveMotorMove
))
{
{
SW12_MoveInfo
.
NextMoveStep
(
LineMoveStep
.
SW0
6_TopCylinderDown
);
SW12_MoveInfo
.
NextMoveStep
(
LineMoveStep
.
SW0
5_WaitOutFixtureCheck
);
SWLog
(
"横移轨道12:
料盘已到达出口,顶升气缸下降
"
);
SWLog
(
"横移轨道12:
等待托盘到达出口
"
);
IOMove
(
IO_Type
.
SidesWay12_DriveMotor
,
IO_VALUE
.
LOW
);
SW12_MoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitTime
(
2000
)
);
S
ideWay12TopCylinderMove
(
IO_VALUE
.
HIGH
,
IO_VALUE
.
LOW
,
SW12_MoveInfo
);
S
W12_MoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitIO
(
IO_Type
.
SidesWay2_FixtureCheck
,
IO_VALUE
.
HIGH
)
);
}
}
else
if
(
SW12_MoveInfo
.
MoveStep
.
Equals
(
LineMoveStep
.
SW05_WaitOutFixtureCheck
))
else
if
(
SW12_MoveInfo
.
MoveStep
.
Equals
(
LineMoveStep
.
SW05_WaitOutFixtureCheck
))
{
{
SW12_MoveInfo
.
NextMoveStep
(
LineMoveStep
.
SW06_WatOutFixture2
);
SWLog
(
"横移轨道12:再次验证托盘是否在出口处 "
);
SW12_MoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitTime
(
1000
));
SW12_MoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitIO
(
IO_Type
.
SidesWay2_FixtureCheck
,
IO_VALUE
.
HIGH
));
}
}
else
if
(
SW12_MoveInfo
.
MoveStep
.
Equals
(
LineMoveStep
.
SW06_TopCylinderDown
))
else
if
(
SW12_MoveInfo
.
MoveStep
.
Equals
(
LineMoveStep
.
SW06_WatOutFixture2
))
{
SW12_MoveInfo
.
NextMoveStep
(
LineMoveStep
.
SW07_TopCylinderDown
);
SWLog
(
"横移轨道12:托盘已到达出口,顶升气缸下降 "
);
SideWay12TopCylinderMove
(
IO_VALUE
.
HIGH
,
IO_VALUE
.
LOW
,
SW12_MoveInfo
);
}
else
if
(
SW12_MoveInfo
.
MoveStep
.
Equals
(
LineMoveStep
.
SW07_TopCylinderDown
))
{
{
SW12_MoveInfo
.
NextMoveStep
(
LineMoveStep
.
SW08_WaitTrayGo
);
SW12_MoveInfo
.
NextMoveStep
(
LineMoveStep
.
SW09_WaitTrayGo
);
SWLog
(
"横移轨道12:等待SidesWay2_FixtureCheck=0,最多等待5秒 "
);
SWLog
(
"横移轨道12:等待SidesWay2_FixtureCheck=0,最多等待5秒,关闭横移电机 "
);
IOMove
(
IO_Type
.
SidesWay12_DriveMotor
,
IO_VALUE
.
LOW
);
SW12_MoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitIO
(
IO_Type
.
SidesWay2_FixtureCheck
,
IO_VALUE
.
LOW
));
SW12_MoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitIO
(
IO_Type
.
SidesWay2_FixtureCheck
,
IO_VALUE
.
LOW
));
SW12_MoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitTime
(
5000
));
SW12_MoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitTime
(
5000
));
SW12_MoveInfo
.
OneWaitCanEndStep
=
true
;
SW12_MoveInfo
.
OneWaitCanEndStep
=
true
;
}
}
else
if
(
SW12_MoveInfo
.
MoveStep
.
Equals
(
LineMoveStep
.
SW0
7
_StopDrive
))
else
if
(
SW12_MoveInfo
.
MoveStep
.
Equals
(
LineMoveStep
.
SW0
8
_StopDrive
))
{
{
}
}
else
if
(
SW12_MoveInfo
.
MoveStep
.
Equals
(
LineMoveStep
.
SW0
8
_WaitTrayGo
))
else
if
(
SW12_MoveInfo
.
MoveStep
.
Equals
(
LineMoveStep
.
SW0
9
_WaitTrayGo
))
{
{
SW12_MoveInfo
.
EndMove
();
SW12_MoveInfo
.
EndMove
();
SWLog
(
"横移轨道12:横移结束 "
);
SWLog
(
"横移轨道12:横移结束 "
);
...
@@ -708,7 +795,14 @@ namespace OnlineStore.DeviceLibrary
...
@@ -708,7 +795,14 @@ namespace OnlineStore.DeviceLibrary
{
{
return
;
return
;
}
}
if
(
SW34_MoveInfo
.
MoveStep
.
Equals
(
LineMoveStep
.
SW01_StopCylinderDown
))
if
(
SW34_MoveInfo
.
MoveStep
.
Equals
(
LineMoveStep
.
SW00_Wait
))
{
SW34_MoveInfo
.
NextMoveStep
(
LineMoveStep
.
SW01_StopCylinderDown
);
SWLog
(
"横移轨道34:阻挡3下降,最多下降1000 "
);
IOMove
(
IO_Type
.
SidesWay3_StopCylinderDown
,
IO_VALUE
.
HIGH
);
SW34_MoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitTime
(
1000
));
}
else
if
(
SW34_MoveInfo
.
MoveStep
.
Equals
(
LineMoveStep
.
SW01_StopCylinderDown
))
{
{
SW34_MoveInfo
.
NextMoveStep
(
LineMoveStep
.
SW02_WaitFixtureCheck
);
SW34_MoveInfo
.
NextMoveStep
(
LineMoveStep
.
SW02_WaitFixtureCheck
);
SWLog
(
"横移轨道34:横移3阻挡上升,等待横移3夹具检测信号 "
);
SWLog
(
"横移轨道34:横移3阻挡上升,等待横移3夹具检测信号 "
);
...
@@ -725,35 +819,46 @@ namespace OnlineStore.DeviceLibrary
...
@@ -725,35 +819,46 @@ namespace OnlineStore.DeviceLibrary
else
if
(
SW34_MoveInfo
.
MoveStep
.
Equals
(
LineMoveStep
.
SW03_TopCylinderUp
))
else
if
(
SW34_MoveInfo
.
MoveStep
.
Equals
(
LineMoveStep
.
SW03_TopCylinderUp
))
{
{
SW34_MoveInfo
.
NextMoveStep
(
LineMoveStep
.
SW04_DriveMotorMove
);
SW34_MoveInfo
.
NextMoveStep
(
LineMoveStep
.
SW04_DriveMotorMove
);
SWLog
(
"横移轨道34:开始转动电机 ,等待1000 ,等待SidesWay4_FixtureCheck=1 "
);
SWLog
(
"横移轨道34:开始转动电机 ,等待1000 ,等待SidesWay4_FixtureCheck=1
,SidesWay3_FixtureCheck=0
"
);
IOMove
(
IO_Type
.
SidesWay34_DriveMotor
,
IO_VALUE
.
HIGH
);
IOMove
(
IO_Type
.
SidesWay34_DriveMotor
,
IO_VALUE
.
HIGH
);
SW34_MoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitTime
(
1000
));
SW34_MoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitTime
(
1000
));
SW34_MoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitIO
(
IO_Type
.
SidesWay4_FixtureCheck
,
IO_VALUE
.
HIGH
));
SW34_MoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitIO
(
IO_Type
.
SidesWay4_FixtureCheck
,
IO_VALUE
.
HIGH
));
SW34_MoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitIO
(
IO_Type
.
SidesWay3_FixtureCheck
,
IO_VALUE
.
LOW
));
}
}
else
if
(
SW34_MoveInfo
.
MoveStep
.
Equals
(
LineMoveStep
.
SW04_DriveMotorMove
))
else
if
(
SW34_MoveInfo
.
MoveStep
.
Equals
(
LineMoveStep
.
SW04_DriveMotorMove
))
{
{
SW34_MoveInfo
.
NextMoveStep
(
LineMoveStep
.
SW0
6_TopCylinderDown
);
SW34_MoveInfo
.
NextMoveStep
(
LineMoveStep
.
SW0
5_WaitOutFixtureCheck
);
SWLog
(
"横移轨道34:
料盘已到达出口,顶升气缸下降
"
);
SWLog
(
"横移轨道34:
等待托盘到达出口
"
);
IOMove
(
IO_Type
.
SidesWay34_DriveMotor
,
IO_VALUE
.
LOW
);
SW34_MoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitTime
(
2000
)
);
S
ideWay34TopCylinderMove
(
IO_VALUE
.
HIGH
,
IO_VALUE
.
LOW
,
SW34_MoveInfo
);
S
W34_MoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitIO
(
IO_Type
.
SidesWay4_FixtureCheck
,
IO_VALUE
.
HIGH
)
);
}
}
else
if
(
SW34_MoveInfo
.
MoveStep
.
Equals
(
LineMoveStep
.
SW05_WaitOutFixtureCheck
))
else
if
(
SW34_MoveInfo
.
MoveStep
.
Equals
(
LineMoveStep
.
SW05_WaitOutFixtureCheck
))
{
{
SW34_MoveInfo
.
NextMoveStep
(
LineMoveStep
.
SW06_WatOutFixture2
);
SWLog
(
"横移轨道34:再次验证托盘是否到达出口 "
);
SW34_MoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitTime
(
1000
));
SW34_MoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitIO
(
IO_Type
.
SidesWay4_FixtureCheck
,
IO_VALUE
.
HIGH
));
}
else
if
(
SW34_MoveInfo
.
MoveStep
.
Equals
(
LineMoveStep
.
SW06_WatOutFixture2
))
{
SW34_MoveInfo
.
NextMoveStep
(
LineMoveStep
.
SW07_TopCylinderDown
);
SWLog
(
"横移轨道34:托盘已到达出口,顶升气缸下降 "
);
SideWay34TopCylinderMove
(
IO_VALUE
.
HIGH
,
IO_VALUE
.
LOW
,
SW34_MoveInfo
);
}
}
else
if
(
SW34_MoveInfo
.
MoveStep
.
Equals
(
LineMoveStep
.
SW0
6
_TopCylinderDown
))
else
if
(
SW34_MoveInfo
.
MoveStep
.
Equals
(
LineMoveStep
.
SW0
7
_TopCylinderDown
))
{
{
SW34_MoveInfo
.
NextMoveStep
(
LineMoveStep
.
SW08_WaitTrayGo
);
SW34_MoveInfo
.
NextMoveStep
(
LineMoveStep
.
SW09_WaitTrayGo
);
SWLog
(
"横移轨道34:等待SidesWay4_FixtureCheck=0 ,最多等待5秒 "
);
SWLog
(
"横移轨道34:等待SidesWay4_FixtureCheck=0 ,最多等待5秒,关闭横移电机 "
);
IOMove
(
IO_Type
.
SidesWay34_DriveMotor
,
IO_VALUE
.
LOW
);
SW34_MoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitIO
(
IO_Type
.
SidesWay4_FixtureCheck
,
IO_VALUE
.
LOW
));
SW34_MoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitIO
(
IO_Type
.
SidesWay4_FixtureCheck
,
IO_VALUE
.
LOW
));
SW34_MoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitTime
(
5000
));
SW34_MoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitTime
(
5000
));
SW34_MoveInfo
.
OneWaitCanEndStep
=
true
;
SW34_MoveInfo
.
OneWaitCanEndStep
=
true
;
}
}
else
if
(
SW34_MoveInfo
.
MoveStep
.
Equals
(
LineMoveStep
.
SW0
7
_StopDrive
))
else
if
(
SW34_MoveInfo
.
MoveStep
.
Equals
(
LineMoveStep
.
SW0
8
_StopDrive
))
{
{
}
}
else
if
(
SW34_MoveInfo
.
MoveStep
.
Equals
(
LineMoveStep
.
SW0
8
_WaitTrayGo
))
else
if
(
SW34_MoveInfo
.
MoveStep
.
Equals
(
LineMoveStep
.
SW0
9
_WaitTrayGo
))
{
{
SW34_MoveInfo
.
EndMove
();
SW34_MoveInfo
.
EndMove
();
SWLog
(
"横移轨道34:横移结束 "
);
SWLog
(
"横移轨道34:横移结束 "
);
...
@@ -863,22 +968,25 @@ namespace OnlineStore.DeviceLibrary
...
@@ -863,22 +968,25 @@ namespace OnlineStore.DeviceLibrary
return
false
;
return
false
;
}
}
MoveEquip
move
=
MoveEquipMap
[
id
];
MoveEquip
move
=
MoveEquipMap
[
id
];
if
(!
move
.
alarmType
.
Equals
(
LineAlarmType
.
None
)
||
move
.
waitInStoreList
.
Count
>
0
||
move
.
IsDebug
)
if
(!
move
.
alarmType
.
Equals
(
LineAlarmType
.
None
)
||
move
.
waitInStoreList
.
Count
>
0
||
move
.
IsDebug
||
move
.
waitOutStoreList
.
Count
>
0
)
{
{
return
false
;
return
false
;
}
}
if
(
runStatus
.
Equals
(
LineRunStatus
.
Runing
)
||
runStatus
.
Equals
(
LineRunStatus
.
Busy
))
if
(
runStatus
.
Equals
(
LineRunStatus
.
Runing
)
||
runStatus
.
Equals
(
LineRunStatus
.
Busy
))
{
{
if
((
move
.
MoveInfo
.
MoveType
.
Equals
(
LineMoveType
.
None
)
||
move
.
MoveInfo
.
MoveType
.
Equals
(
LineMoveType
.
OutStore
))
if
(
move
.
MoveInfo
.
MoveType
.
Equals
(
LineMoveType
.
None
)
&&
move
.
runStatus
.
Equals
(
LineRunStatus
.
Runing
))
&&
(
move
.
runStatus
.
Equals
(
LineRunStatus
.
Runing
)
||
move
.
runStatus
.
Equals
(
LineRunStatus
.
Busy
))
)
{
return
true
;
}
else
if
(
move
.
runStatus
.
Equals
(
LineRunStatus
.
Busy
)
&&
move
.
MoveInfo
.
MoveType
.
Equals
(
LineMoveType
.
OutStore
)
&&
move
.
MoveInfo
.
MoveStep
>=
(
LineMoveStep
.
MO_56_BeforeAfterCylinderAfter
))
{
{
return
true
;
return
true
;
}
}
}
}
// LogUtil.error("runStatus【" + runStatus + "】,move.MoveInfo.MoveType【" + move.MoveInfo.MoveType + "】,move.runStatus【" + move.runStatus + "】 ");
return
false
;
return
false
;
}
}
public
bool
CanIntore
(
int
id
)
public
bool
CanIntore
(
int
id
)
{
{
if
(!
alarmType
.
Equals
(
LineAlarmType
.
None
)
||
isInSuddenDown
||
isNoAirCheck
)
if
(!
alarmType
.
Equals
(
LineAlarmType
.
None
)
||
isInSuddenDown
||
isNoAirCheck
)
...
@@ -890,7 +998,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -890,7 +998,7 @@ namespace OnlineStore.DeviceLibrary
return
false
;
return
false
;
}
}
MoveEquip
move
=
MoveEquipMap
[
id
];
MoveEquip
move
=
MoveEquipMap
[
id
];
if
(!
move
.
alarmType
.
Equals
(
LineAlarmType
.
None
)
||
move
.
IsDebug
)
if
(!
move
.
alarmType
.
Equals
(
LineAlarmType
.
None
)
||
move
.
IsDebug
||
move
.
waitOutStoreList
.
Count
>
0
)
{
{
return
false
;
return
false
;
}
}
...
...
source/DeviceLibrary/assemblyLine/MoveEquip.cs
查看文件 @
5df8033
...
@@ -489,13 +489,13 @@ namespace OnlineStore.DeviceLibrary
...
@@ -489,13 +489,13 @@ namespace OnlineStore.DeviceLibrary
}
}
case
LineMoveStep
.
MH_OtherCylinder_Back
:
case
LineMoveStep
.
MH_OtherCylinder_Back
:
{
{
LogInfo
(
"停止运行完成,停止伺服!"
);
LogInfo
(
"停止运行完成!"
);
CloseAxis
();
if
(
UpdownUseAxis
)
if
(
UpdownUseAxis
)
{
{
LogInfo
(
"停止运动:停止伺服"
);
LogInfo
(
"停止运动:停止伺服"
);
ACServerManager
.
SuddenStop
(
Config
.
UpDown_Axis
);
ACServerManager
.
SuddenStop
(
Config
.
UpDown_Axis
);
CloseAxis
();
}
}
runStatus
=
LineRunStatus
.
Runing
;
runStatus
=
LineRunStatus
.
Runing
;
MoveInfo
.
EndMove
();
MoveInfo
.
EndMove
();
...
@@ -660,14 +660,14 @@ namespace OnlineStore.DeviceLibrary
...
@@ -660,14 +660,14 @@ namespace OnlineStore.DeviceLibrary
}
}
public
void
CloseAxis
()
public
void
CloseAxis
()
{
{
LogUtil
.
info
(
Name
+
"关闭刹车,关闭伺服"
);
LogUtil
.
info
(
Name
+
"关闭刹车,关闭伺服"
);
IOMove
(
IO_Type
.
UpDownAxis_BreakOn
,
IO_VALUE
.
LOW
);
IOMove
(
IO_Type
.
UpDownAxis_BreakOn
,
IO_VALUE
.
LOW
);
ACServerManager
.
ServoOff
(
portName
,
slvAddr
);
ACServerManager
.
ServoOff
(
portName
,
slvAddr
);
//关闭串口,等下次重新打开
//关闭串口,等下次重新打开
ACServerManager
.
ColsePort
(
portName
);
//
ACServerManager.ColsePort(portName);
Thread
.
Sleep
(
100
);
Thread
.
Sleep
(
100
);
IOMove
(
IO_Type
.
UpDownAxis_ServoOn
,
IO_VALUE
.
LOW
);
IOMove
(
IO_Type
.
UpDownAxis_ServoOn
,
IO_VALUE
.
LOW
);
...
...
source/DeviceLibrary/assemblyLine/MoveEquip_Partial.cs
查看文件 @
5df8033
...
@@ -65,6 +65,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -65,6 +65,7 @@ namespace OnlineStore.DeviceLibrary
}
}
else
if
(
wait
.
WaitType
.
Equals
(
2
))
else
if
(
wait
.
WaitType
.
Equals
(
2
))
{
{
NotOkMsg
=
" ("
+
Config
.
GetDisplayName
(
wait
.
IoType
)
+
"="
+
wait
.
IoValue
+
") "
;
wait
.
IsEnd
=
IOValue
(
wait
.
IoType
).
Equals
(
wait
.
IoValue
);
wait
.
IsEnd
=
IOValue
(
wait
.
IoType
).
Equals
(
wait
.
IoValue
);
if
(!
wait
.
IsEnd
)
if
(!
wait
.
IsEnd
)
...
@@ -75,9 +76,9 @@ namespace OnlineStore.DeviceLibrary
...
@@ -75,9 +76,9 @@ namespace OnlineStore.DeviceLibrary
LogUtil
.
debug
(
moveInfo
.
Name
+
"未检测到:IsUse_Tray_Check= "
+
wait
.
IoValue
+
",直接跳过检测继续下一步"
);
LogUtil
.
debug
(
moveInfo
.
Name
+
"未检测到:IsUse_Tray_Check= "
+
wait
.
IoValue
+
",直接跳过检测继续下一步"
);
}
}
//夹紧按钮若果超过一秒钟还未收到,默认成功
//夹紧按钮若果超过一秒钟还未收到,默认成功
else
if
(
wait
.
IoType
.
Equals
(
IO_Type
.
ClampCylinder_Slack
)
&&
wait
.
IoValue
.
Equals
(
IO_VALUE
.
HIGH
)
&&
span
.
TotalMilliseconds
>
3
000
)
else
if
(
wait
.
IoType
.
Equals
(
IO_Type
.
ClampCylinder_Slack
)
&&
wait
.
IoValue
.
Equals
(
IO_VALUE
.
HIGH
)
&&
span
.
TotalMilliseconds
>
4
000
)
{
{
LogInfo
(
"未检测到:ClampCylinder_Slack=HIGH,超过
2
秒钟,默认下一步骤"
);
LogInfo
(
"未检测到:ClampCylinder_Slack=HIGH,超过
4
秒钟,默认下一步骤"
);
wait
.
IsEnd
=
true
;
wait
.
IsEnd
=
true
;
}
}
else
else
...
@@ -86,42 +87,30 @@ namespace OnlineStore.DeviceLibrary
...
@@ -86,42 +87,30 @@ namespace OnlineStore.DeviceLibrary
//一分钟还未检测到
//一分钟还未检测到
if
(
span
.
TotalMilliseconds
>
LineManager
.
Config
.
IOSingle_TimerOut
)
if
(
span
.
TotalMilliseconds
>
LineManager
.
Config
.
IOSingle_TimerOut
)
{
{
//把IO重置位0
ConfigIO
io
=
Config
.
getWaitIO
(
wait
.
IoType
);
LogUtil
.
error
(
moveInfo
.
Name
+
" : "
+
wait
.
IoType
+
"="
+
wait
.
IoValue
+
" 已等待"
+
Math
.
Abs
(
span
.
TotalMilliseconds
)
+
",将DO写0"
,
17
);
WarnMsg
=
Name
+
"等待"
+
NotOkMsg
+
" 超时"
;
ConfigIO
io
=
Config
.
getWaitIO
(
wait
.
IoType
);
WarnMsg
=
Name
+
"等待信号("
+
io
.
DisplayStr
+
"="
+
wait
.
IoValue
+
") 超时"
;
Alarm
(
LineAlarmType
.
IoSingleTimeOut
,
io
.
ElectricalDefinition
,
WarnMsg
,
MoveInfo
.
MoveType
);
Alarm
(
LineAlarmType
.
IoSingleTimeOut
,
io
.
ElectricalDefinition
,
WarnMsg
,
MoveInfo
.
MoveType
);
LogUtil
.
error
(
MoveInfo
.
Name
+
" : "
+
wait
.
IoType
+
"等待信号("
+
io
.
DisplayStr
+
"="
+
wait
.
IoValue
+
") 超时"
,
13
);
LogUtil
.
error
(
MoveInfo
.
Name
+
WarnMsg
,
13
);
}
else
if
(
rwSpan
.
TotalSeconds
>
3
&&
span
.
TotalSeconds
>
3
)
{
preRWTime
=
DateTime
.
Now
;
string
msg
=
moveInfo
.
Name
+
" "
+
NotOkMsg
+
"已等待 "
+
Math
.
Abs
(
span
.
TotalSeconds
)
+
"秒,重写DO:"
;
bool
isLog
=
false
;
foreach
(
WaitResultInfo
ww
in
list
)
foreach
(
WaitResultInfo
ww
in
list
)
{
{
if
(
ww
!=
null
&&
ww
.
WaitType
.
Equals
(
2
))
if
(
ww
!=
null
&&
ww
.
WaitType
.
Equals
(
2
)
&&
Config
.
DOList
.
ContainsKey
(
ww
.
IoType
)
)
{
{
if
(
Config
.
DOList
.
ContainsKey
(
ww
.
IoType
))
isLog
=
true
;
{
IOMove
(
ww
.
IoType
,
ww
.
IoValue
);
IOMove
(
wait
.
IoType
,
IO_VALUE
.
LOW
);
msg
+=
ww
.
ToStr
()
+
","
;
}
}
}
}
}
if
(
isLog
)
{
LogUtil
.
error
(
msg
);
}
}
}
//else if (rwSpan.TotalSeconds > 3)
//{
// preRWTime = DateTime.Now;
// //把IO重置位0
// string msg = moveInfo.Name + " : " + wait.IoType + " = " + wait.IoValue + " 已等待" + Math.Abs(span.TotalMilliseconds) + ",重写DO信号:";
// foreach (WaitResultInfo ww in list)
// {
// if (ww != null && ww.WaitType.Equals(2))
// {
// if (Config.DOList.ContainsKey(ww.IoType))
// {
// IOMove(wait.IoType, ww.IoValue);
// msg += wait.ToStr()+",";
// }
// }
// }
// LogUtil.error(msg);
//}
isOk
=
false
;
isOk
=
false
;
break
;
break
;
}
}
...
@@ -141,6 +130,9 @@ namespace OnlineStore.DeviceLibrary
...
@@ -141,6 +130,9 @@ namespace OnlineStore.DeviceLibrary
{
{
int
storeId
=
moveInfo
.
MoveParam
.
GetStoreId
();
int
storeId
=
moveInfo
.
MoveParam
.
GetStoreId
();
wait
.
IsEnd
=
LineServer
.
BoxCanReviceTray
(
storeId
);
wait
.
IsEnd
=
LineServer
.
BoxCanReviceTray
(
storeId
);
}
else
if
(
wait
.
WaitType
.
Equals
(
10
))
{
// wait.IsEnd = LineManager.Line.SideWay34HasTray().Equals(false);
}
}
if
(
wait
.
IsEnd
&&
moveInfo
.
OneWaitCanEndStep
)
if
(
wait
.
IsEnd
&&
moveInfo
.
OneWaitCanEndStep
)
{
{
...
@@ -159,7 +151,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -159,7 +151,7 @@ namespace OnlineStore.DeviceLibrary
}
}
else
if
(
span
.
TotalSeconds
>
moveInfo
.
TimeOutSeconds
)
else
if
(
span
.
TotalSeconds
>
moveInfo
.
TimeOutSeconds
)
{
{
WarnMsg
=
moveInfo
.
Name
+
"
【"
+
moveInfo
.
MoveType
+
"】【"
+
moveInfo
.
MoveStep
+
"】
等待["
+
NotOkMsg
WarnMsg
=
moveInfo
.
Name
+
"
["
+
moveInfo
.
MoveType
+
"]["
+
moveInfo
.
MoveStep
+
"]
等待["
+
NotOkMsg
+
"]超时["
+
Math
.
Round
(
span
.
TotalSeconds
,
1
)
+
"]秒"
;
+
"]超时["
+
Math
.
Round
(
span
.
TotalSeconds
,
1
)
+
"]秒"
;
LogUtil
.
error
(
WarnMsg
,
18
);
LogUtil
.
error
(
WarnMsg
,
18
);
Alarm
(
LineAlarmType
.
IoSingleTimeOut
,
""
,
WarnMsg
,
moveInfo
.
MoveType
);
Alarm
(
LineAlarmType
.
IoSingleTimeOut
,
""
,
WarnMsg
,
moveInfo
.
MoveType
);
...
@@ -317,10 +309,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -317,10 +309,7 @@ namespace OnlineStore.DeviceLibrary
OutStoreLog
(
"出库:(MO_08_UpDownCylinderUp 上下气缸1上升)"
);
OutStoreLog
(
"出库:(MO_08_UpDownCylinderUp 上下气缸1上升)"
);
this
.
MoveInfo
.
NextMoveStep
(
LineMoveStep
.
MO_60_UpDownCylinderUp
);
this
.
MoveInfo
.
NextMoveStep
(
LineMoveStep
.
MO_60_UpDownCylinderUp
);
UpdownUpMove
();
UpdownUpMove
();
// CylinderMove(MoveInfo, IO_Type.UpDownCylinder_Down, IO_Type.UpDownCylinder_Up);
//出库完成
// this.MoveEndEvent.Invoke(DeviceID, MoveInfo.MoveType, MoveInfo.MoveParam);
}
}
else
if
(
MoveInfo
.
MoveStep
.
Equals
(
LineMoveStep
.
MO_60_UpDownCylinderUp
))
else
if
(
MoveInfo
.
MoveStep
.
Equals
(
LineMoveStep
.
MO_60_UpDownCylinderUp
))
{
{
...
@@ -328,17 +317,12 @@ namespace OnlineStore.DeviceLibrary
...
@@ -328,17 +317,12 @@ namespace OnlineStore.DeviceLibrary
TrayManager
.
DelNeedEmptyTrayNum
();
TrayManager
.
DelNeedEmptyTrayNum
();
OutStoreLog
(
"出库 SecondStoreMove:移栽完成,放行托盘"
);
OutStoreLog
(
"出库 SecondStoreMove:移栽完成,放行托盘"
);
SecondMoveInfo
.
NewMove
(
LineMoveType
.
CheckFixture
);
SecondMoveInfo
.
NewMove
(
LineMoveType
.
CheckFixture
);
SecondMoveInfo
.
NextMoveStep
(
LineMoveStep
.
MO_0
9
_TopCylinder_Down
);
SecondMoveInfo
.
NextMoveStep
(
LineMoveStep
.
MO_0
6
_TopCylinder_Down
);
CylinderMove
(
SecondMoveInfo
,
IO_Type
.
TopCylinder_UP
,
IO_Type
.
TopCylinder_Down
);
CylinderMove
(
SecondMoveInfo
,
IO_Type
.
TopCylinder_UP
,
IO_Type
.
TopCylinder_Down
);
LogInfo
(
"【"
+
posId
+
"】出库处理结束,!"
);
LogInfo
(
"【"
+
posId
+
"】出库处理结束,!"
);
//if (GetBox().storeStatus.Equals(LineStatus.OutMoveExecute))
//{
// GetBox().storeStatus = LineStatus.StoreOnline;
//}
lineStatus
=
LineStatus
.
StoreOnline
;
lineStatus
=
LineStatus
.
StoreOnline
;
runStatus
=
LineRunStatus
.
Runing
;
runStatus
=
LineRunStatus
.
Runing
;
//storeStatus = StoreStatus.OutStoreBoxEnd;
MoveInfo
.
EndMove
();
MoveInfo
.
EndMove
();
}
}
...
@@ -424,7 +408,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -424,7 +408,7 @@ namespace OnlineStore.DeviceLibrary
//阻挡气缸移动
//阻挡气缸移动
InStoreLog
(
"放托盘(放开阻挡):SecondStoreMove=MO_09_TopCylinder_Down 物品已移走,顶升气缸1下降)"
);
InStoreLog
(
"放托盘(放开阻挡):SecondStoreMove=MO_09_TopCylinder_Down 物品已移走,顶升气缸1下降)"
);
SecondMoveInfo
.
NewMove
(
LineMoveType
.
CheckFixture
);
SecondMoveInfo
.
NewMove
(
LineMoveType
.
CheckFixture
);
SecondMoveInfo
.
NextMoveStep
(
LineMoveStep
.
MO_0
9
_TopCylinder_Down
);
SecondMoveInfo
.
NextMoveStep
(
LineMoveStep
.
MO_0
6
_TopCylinder_Down
);
CylinderMove
(
SecondMoveInfo
,
IO_Type
.
TopCylinder_UP
,
IO_Type
.
TopCylinder_Down
);
CylinderMove
(
SecondMoveInfo
,
IO_Type
.
TopCylinder_UP
,
IO_Type
.
TopCylinder_Down
);
}
}
else
if
(
MoveInfo
.
MoveStep
.
Equals
(
LineMoveStep
.
MI_10_WaitBox
))
else
if
(
MoveInfo
.
MoveStep
.
Equals
(
LineMoveStep
.
MI_10_WaitBox
))
...
@@ -453,18 +437,26 @@ namespace OnlineStore.DeviceLibrary
...
@@ -453,18 +437,26 @@ namespace OnlineStore.DeviceLibrary
}
}
else
if
(
MoveInfo
.
MoveStep
.
Equals
(
LineMoveStep
.
MI_13_UpdownCylinderUp
))
else
if
(
MoveInfo
.
MoveStep
.
Equals
(
LineMoveStep
.
MI_13_UpdownCylinderUp
))
{
{
InStoreLog
(
"入库:(MI_14_BeforeAfterCylinderAfter,前后气缸1后退 )"
);
InStoreLog
(
"入库:(MI_14_BeforeAfterCylinderAfter,前后气缸1后退
,等待4000
)"
);
MoveInfo
.
NextMoveStep
(
LineMoveStep
.
MI_14_BeforeAfterCylinderAfter
);
MoveInfo
.
NextMoveStep
(
LineMoveStep
.
MI_14_BeforeAfterCylinderAfter
);
CylinderMove
(
MoveInfo
,
IO_Type
.
BeforeAfterCylinder_Before
,
IO_Type
.
BeforeAfterCylinder_After
);
CylinderMove
(
MoveInfo
,
IO_Type
.
BeforeAfterCylinder_Before
,
IO_Type
.
BeforeAfterCylinder_After
);
MoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitTime
(
4000
));
//此时box就可以入库操作了 //触发事件,BOX入库
//此时box就可以入库操作了 //触发事件,BOX入库
LineServer
.
StartInStore
(
DeviceID
,
MoveInfo
.
MoveParam
);
LineServer
.
StartInStore
(
DeviceID
,
MoveInfo
.
MoveParam
);
}
}
else
if
(
MoveInfo
.
MoveStep
.
Equals
(
LineMoveStep
.
MI_14_BeforeAfterCylinderAfter
))
else
if
(
MoveInfo
.
MoveStep
.
Equals
(
LineMoveStep
.
MI_14_BeforeAfterCylinderAfter
))
{
{
InStoreLog
(
"入库:(MI_15_SendEnd , 送料流程完成)"
);
MoveInfo
.
NextMoveStep
(
LineMoveStep
.
MI_15_SendEnd
);
MoveInfo
.
NextMoveStep
(
LineMoveStep
.
MI_15_SendEnd
);
//判断料仓是否在入库中,如果么有在入库中,需要重新发送入库消息
if
(!
LineServer
.
IsInStorePro
(
DeviceID
))
{
InStoreLog
(
"入库:(MI_15_SendEnd , 送料流程完成,料仓还未开始入库,再次发送starIn命令)"
);
LineServer
.
StartInStore
(
DeviceID
,
MoveInfo
.
MoveParam
);
}
else
{
InStoreLog
(
"入库:(MI_15_SendEnd , 送料流程完成,料仓已开始入库)"
);
}
}
}
else
if
(
MoveInfo
.
MoveStep
.
Equals
(
LineMoveStep
.
MI_15_SendEnd
))
else
if
(
MoveInfo
.
MoveStep
.
Equals
(
LineMoveStep
.
MI_15_SendEnd
))
{
{
...
@@ -668,7 +660,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -668,7 +660,7 @@ namespace OnlineStore.DeviceLibrary
}
}
else
else
{
{
string
msg
=
Name
+
" 托盘顺序错乱,上个托盘号【"
+
preTrayNum
+
"】当前托盘号 【"
+
currMoveTrayNum
+
"】最大盘号【"
+
TrayManager
.
MaxTrayNum
+
"】"
;
string
msg
=
Name
+
" 托盘顺序错乱,上个托盘号【"
+
preTrayNum
+
"】当前托盘号 【"
+
currMoveTrayNum
+
"】最大盘号【"
+
TrayManager
.
MaxTrayNum
+
"】"
;
TrayManager
.
UpdateTrayNumError
(
DeviceID
,
msg
);
TrayManager
.
UpdateTrayNumError
(
DeviceID
,
msg
);
LogUtil
.
error
(
msg
);
LogUtil
.
error
(
msg
);
return
;
return
;
...
@@ -687,10 +679,14 @@ namespace OnlineStore.DeviceLibrary
...
@@ -687,10 +679,14 @@ namespace OnlineStore.DeviceLibrary
{
{
TrayManager
.
UpdateTrayNumError
(-
1
,
""
);
TrayManager
.
UpdateTrayNumError
(-
1
,
""
);
}
}
CheckLog
(
"托盘放行 SecondStoreMove:(MO_10_StopCylinder2_Down ,阻挡气缸1-2下降) "
);
CheckLog
(
"托盘放行 SecondStoreMove:(MO_07_WaitCanGo ,移栽2,需要判断是否可以放盘通过,最多等待10000)"
);
SecondMoveInfo
.
NextMoveStep
(
LineMoveStep
.
MO_10_StopCylinder2_Down
);
SecondMoveInfo
.
NextMoveStep
(
LineMoveStep
.
MO_07_WaitCanGo
);
IOMove
(
IO_Type
.
StopCylinder_Down2
,
IO_VALUE
.
HIGH
);
//if (DeviceID.Equals(2))
SecondMoveInfo
.
EndStepWait
();
//{
// SecondMoveInfo.WaitList.Add(WaitResultInfo.WaitTime(10000));
// SecondMoveInfo.WaitList.Add(WaitResultInfo.WaitSideWay());
// SecondMoveInfo.OneWaitCanEndStep = true;
//}
}
}
}
}
catch
(
Exception
ex
)
catch
(
Exception
ex
)
...
@@ -747,7 +743,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -747,7 +743,7 @@ namespace OnlineStore.DeviceLibrary
TrayManager
.
UpdateTrayNumError
(-
1
,
""
);
TrayManager
.
UpdateTrayNumError
(-
1
,
""
);
}
}
CheckLog
(
"托盘检测 SecondStoreMove:(MO_09_TopCylinder_Down ,托盘号【"
+
currMoveTrayNum
+
"】,直接放盘通过,顶升气缸下降)"
);
CheckLog
(
"托盘检测 SecondStoreMove:(MO_09_TopCylinder_Down ,托盘号【"
+
currMoveTrayNum
+
"】,直接放盘通过,顶升气缸下降)"
);
SecondMoveInfo
.
NextMoveStep
(
LineMoveStep
.
MO_0
9
_TopCylinder_Down
);
SecondMoveInfo
.
NextMoveStep
(
LineMoveStep
.
MO_0
6
_TopCylinder_Down
);
CylinderMove
(
SecondMoveInfo
,
IO_Type
.
TopCylinder_UP
,
IO_Type
.
TopCylinder_Down
);
CylinderMove
(
SecondMoveInfo
,
IO_Type
.
TopCylinder_UP
,
IO_Type
.
TopCylinder_Down
);
}
}
...
@@ -761,7 +757,19 @@ namespace OnlineStore.DeviceLibrary
...
@@ -761,7 +757,19 @@ namespace OnlineStore.DeviceLibrary
#
endregion
#
endregion
#
region
不需要出入库,直接放行
#
region
不需要出入库,直接放行
else
if
(
SecondMoveInfo
.
MoveStep
.
Equals
(
LineMoveStep
.
MO_09_TopCylinder_Down
))
else
if
(
SecondMoveInfo
.
MoveStep
.
Equals
(
LineMoveStep
.
MO_06_TopCylinder_Down
))
{
CheckLog
(
"托盘放行 SecondStoreMove:(MO_07_WaitCanGo ,移栽2,需要判断是否可以放盘通过,最多等待10000)"
);
SecondMoveInfo
.
NextMoveStep
(
LineMoveStep
.
MO_07_WaitCanGo
);
//if (DeviceID.Equals(2))
//{
// SecondMoveInfo.WaitList.Add(WaitResultInfo.WaitTime(10000));
// SecondMoveInfo.WaitList.Add(WaitResultInfo.WaitSideWay());
// SecondMoveInfo.OneWaitCanEndStep = true;
//}
}
else
if
(
SecondMoveInfo
.
MoveStep
.
Equals
(
LineMoveStep
.
MO_07_WaitCanGo
))
{
{
CheckLog
(
"托盘放行 SecondStoreMove:(MO_10_StopCylinder2_Down ,阻挡气缸1-2下降)"
);
CheckLog
(
"托盘放行 SecondStoreMove:(MO_10_StopCylinder2_Down ,阻挡气缸1-2下降)"
);
SecondMoveInfo
.
NextMoveStep
(
LineMoveStep
.
MO_10_StopCylinder2_Down
);
SecondMoveInfo
.
NextMoveStep
(
LineMoveStep
.
MO_10_StopCylinder2_Down
);
...
...
source/DeviceLibrary/model/StoreMoveInfo.cs
查看文件 @
5df8033
...
@@ -90,6 +90,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -90,6 +90,7 @@ namespace OnlineStore.DeviceLibrary
LastSetpTime
=
DateTime
.
Now
;
LastSetpTime
=
DateTime
.
Now
;
IsInWait
=
true
;
IsInWait
=
true
;
WaitList
=
new
List
<
WaitResultInfo
>();
WaitList
=
new
List
<
WaitResultInfo
>();
WriteIoList
=
new
List
<
WriteIOInfo
>();
OneWaitCanEndStep
=
false
;
OneWaitCanEndStep
=
false
;
CanWhileCount
=
5
;
CanWhileCount
=
5
;
}
}
...
@@ -100,6 +101,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -100,6 +101,7 @@ namespace OnlineStore.DeviceLibrary
{
{
IsInWait
=
false
;
IsInWait
=
false
;
WaitList
=
new
List
<
WaitResultInfo
>();
WaitList
=
new
List
<
WaitResultInfo
>();
WriteIoList
=
new
List
<
WriteIOInfo
>();
}
}
public
void
NewMove
(
LineMoveType
type
)
public
void
NewMove
(
LineMoveType
type
)
{
{
...
@@ -107,6 +109,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -107,6 +109,7 @@ namespace OnlineStore.DeviceLibrary
this
.
moveType
=
type
;
this
.
moveType
=
type
;
LastSetpTime
=
DateTime
.
Now
;
LastSetpTime
=
DateTime
.
Now
;
WaitList
=
new
List
<
WaitResultInfo
>();
WaitList
=
new
List
<
WaitResultInfo
>();
WriteIoList
=
new
List
<
WriteIOInfo
>();
MoveNum
++;
MoveNum
++;
}
}
public
void
NewMove
(
LineMoveType
type
,
InOutParam
param
)
public
void
NewMove
(
LineMoveType
type
,
InOutParam
param
)
...
@@ -116,6 +119,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -116,6 +119,7 @@ namespace OnlineStore.DeviceLibrary
this
.
MoveParam
=
param
;
this
.
MoveParam
=
param
;
LastSetpTime
=
DateTime
.
Now
;
LastSetpTime
=
DateTime
.
Now
;
WaitList
=
new
List
<
WaitResultInfo
>();
WaitList
=
new
List
<
WaitResultInfo
>();
WriteIoList
=
new
List
<
WriteIOInfo
>();
}
}
public
void
EndMove
()
public
void
EndMove
()
{
{
...
@@ -125,6 +129,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -125,6 +129,7 @@ namespace OnlineStore.DeviceLibrary
LastSetpTime
=
DateTime
.
Now
;
LastSetpTime
=
DateTime
.
Now
;
IsInWait
=
false
;
IsInWait
=
false
;
WaitList
=
new
List
<
WaitResultInfo
>();
WaitList
=
new
List
<
WaitResultInfo
>();
WriteIoList
=
new
List
<
WriteIOInfo
>();
CanWhileCount
=
0
;
CanWhileCount
=
0
;
}
}
public
LineMoveInfo
clone
()
public
LineMoveInfo
clone
()
...
@@ -133,6 +138,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -133,6 +138,7 @@ namespace OnlineStore.DeviceLibrary
}
}
public
List
<
WaitResultInfo
>
WaitList
=
new
List
<
WaitResultInfo
>();
public
List
<
WaitResultInfo
>
WaitList
=
new
List
<
WaitResultInfo
>();
public
List
<
WriteIOInfo
>
WriteIoList
=
new
List
<
WriteIOInfo
>();
/// <summary>
/// <summary>
/// 重置之后继续出入库时,退回上一个步骤执行
/// 重置之后继续出入库时,退回上一个步骤执行
/// </summary>
/// </summary>
...
@@ -142,7 +148,18 @@ namespace OnlineStore.DeviceLibrary
...
@@ -142,7 +148,18 @@ namespace OnlineStore.DeviceLibrary
IsInWait
=
false
;
IsInWait
=
false
;
}
}
}
}
public
class
WriteIOInfo
{
public
static
WriteIOInfo
NInfo
(
string
type
,
IO_VALUE
value
)
{
WriteIOInfo
i
=
new
WriteIOInfo
();
i
.
IoType
=
type
;
i
.
IoValue
=
value
;
return
i
;
}
public
string
IoType
=
""
;
public
IO_VALUE
IoValue
=
IO_VALUE
.
HIGH
;
}
public
class
WaitResultInfo
public
class
WaitResultInfo
{
{
private
WaitResultInfo
()
private
WaitResultInfo
()
...
@@ -256,6 +273,12 @@ namespace OnlineStore.DeviceLibrary
...
@@ -256,6 +273,12 @@ namespace OnlineStore.DeviceLibrary
wait
.
WaitType
=
9
;
wait
.
WaitType
=
9
;
return
wait
;
return
wait
;
}
}
public
static
WaitResultInfo
WaitSideWay
()
{
WaitResultInfo
wait
=
new
WaitResultInfo
();
wait
.
WaitType
=
10
;
return
wait
;
}
public
string
ToStr
()
public
string
ToStr
()
{
{
if
(
WaitType
==
1
)
if
(
WaitType
==
1
)
...
@@ -298,6 +321,9 @@ namespace OnlineStore.DeviceLibrary
...
@@ -298,6 +321,9 @@ namespace OnlineStore.DeviceLibrary
else
if
(
WaitType
==
9
)
else
if
(
WaitType
==
9
)
{
{
return
"BOX可以开始入库"
;
return
"BOX可以开始入库"
;
}
else
if
(
WaitType
==
10
)
{
return
"等待横移34无托盘"
;
}
}
else
else
{
{
...
@@ -354,7 +380,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -354,7 +380,7 @@ namespace OnlineStore.DeviceLibrary
/// </summary>
/// </summary>
public
int
HeightValue
{
get
;
set
;
}
public
int
HeightValue
{
get
;
set
;
}
}
}
public
enum
LineMoveType
public
enum
LineMoveType
{
{
...
...
source/DeviceLibrary/model/StoreStep.cs
查看文件 @
5df8033
...
@@ -238,7 +238,11 @@ namespace OnlineStore.DeviceLibrary
...
@@ -238,7 +238,11 @@ namespace OnlineStore.DeviceLibrary
/// <summary>
/// <summary>
/// 移载(流水线)装置出库处理 ,顶升气缸1下降
/// 移载(流水线)装置出库处理 ,顶升气缸1下降
/// </summary>
/// </summary>
MO_09_TopCylinder_Down
=
3109
,
MO_06_TopCylinder_Down
=
3106
,
/// <summary>
/// 如果是移栽2需要等待托盘是否可以走
/// </summary>
MO_07_WaitCanGo
=
3107
,
/// <summary>
/// <summary>
/// 移载(流水线)装置出库处理, 阻挡气缸1-2下降
/// 移载(流水线)装置出库处理, 阻挡气缸1-2下降
/// </summary>
/// </summary>
...
@@ -374,6 +378,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -374,6 +378,7 @@ namespace OnlineStore.DeviceLibrary
#
region
横移轨道处理
#
region
横移轨道处理
SW00_Wait
=
5000
,
/// <summary>
/// <summary>
/// 阻挡气缸下降
/// 阻挡气缸下降
/// </summary>
/// </summary>
...
@@ -398,18 +403,22 @@ namespace OnlineStore.DeviceLibrary
...
@@ -398,18 +403,22 @@ namespace OnlineStore.DeviceLibrary
/// </summary>
/// </summary>
SW05_WaitOutFixtureCheck
=
5005
,
SW05_WaitOutFixtureCheck
=
5005
,
/// <summary>
/// <summary>
/// 等待出口信号持续一段时间
/// </summary>
SW06_WatOutFixture2
=
5006
,
/// <summary>
/// 停止横移轨道转动,横移轨道顶升气缸下降
/// 停止横移轨道转动,横移轨道顶升气缸下降
/// </summary>
/// </summary>
SW0
6_TopCylinderDown
=
5006
,
SW0
7_TopCylinderDown
=
5007
,
/// <summary>
/// <summary>
/// 阻挡2下降,等待托盘流出
/// 阻挡2下降,等待托盘流出
/// </summary>
/// </summary>
SW0
7_StopDrive
=
5007
,
SW0
8_StopDrive
=
5008
,
/// <summary>
/// <summary>
/// 等待托盘流出,上升阻挡气缸
/// 等待托盘流出,上升阻挡气缸
/// </summary>
/// </summary>
SW0
8_WaitTrayGo
=
5008
,
SW0
9_WaitTrayGo
=
5009
,
#
endregion
#
endregion
...
...
source/DeviceLibrary/server/LineServer.cs
查看文件 @
5df8033
...
@@ -113,6 +113,27 @@ namespace OnlineStore.DeviceLibrary
...
@@ -113,6 +113,27 @@ namespace OnlineStore.DeviceLibrary
}
}
return
false
;
return
false
;
}
}
public
static
bool
IsInStorePro
(
int
id
)
{
BoxInfo
box
=
GetBoxInfo
(
id
);
TimeSpan
span
=
DateTime
.
Now
-
box
.
LastMsgTime
;
if
(
box
!=
null
&&
span
.
TotalSeconds
<
ClientKeepSecond
)
{
LineStatus
status
=
(
LineStatus
)
box
.
SStatus
;
LineRunStatus
runs
=
(
LineRunStatus
)
box
.
SRunStatus
;
if
(
runs
.
Equals
(
LineRunStatus
.
Busy
))
{
if
(
status
.
Equals
(
LineStatus
.
InStoreEnd
)
||
status
.
Equals
(
LineStatus
.
InStoreExecute
))
{
return
true
;
}
}
}
return
false
;
}
/// <summary>
/// <summary>
/// 获取所有在线的CID
/// 获取所有在线的CID
/// </summary>
/// </summary>
...
...
source/LoadCVSLibrary/storeConfig/config/FeedingEquip_Config.cs
查看文件 @
5df8033
...
@@ -51,8 +51,8 @@ namespace OnlineStore.LoadCSVLibrary
...
@@ -51,8 +51,8 @@ namespace OnlineStore.LoadCSVLibrary
/// <summary>
/// <summary>
/// AXIS 0 批量上料轴 UpDown_Axis 2
/// AXIS 0 批量上料轴 UpDown_Axis 2
/// </summary>
/// </summary>
[
ConfigProAttribute
(
"
UpDown
_Axis"
,
false
)]
[
ConfigProAttribute
(
"
Batch
_Axis"
,
false
)]
public
ConfigMoveAxis
UpDown
_Axis
{
get
;
set
;
}
public
ConfigMoveAxis
Batch
_Axis
{
get
;
set
;
}
/// <summary>
/// <summary>
/// PRO 0 批量上料轴待机点 P1 BatchAxisP1 403000
/// PRO 0 批量上料轴待机点 P1 BatchAxisP1 403000
/// </summary>
/// </summary>
...
...
source/LoadCVSLibrary/storeConfig/config/IO_Type.cs
查看文件 @
5df8033
...
@@ -287,11 +287,10 @@ namespace OnlineStore.LoadCSVLibrary
...
@@ -287,11 +287,10 @@ namespace OnlineStore.LoadCSVLibrary
/// DO 0 移载4升降轴伺服ON UpDownAxis_ServoOn 31 移载4升降轴伺服ON Y08 DO-08
/// DO 0 移载4升降轴伺服ON UpDownAxis_ServoOn 31 移载4升降轴伺服ON Y08 DO-08
/// </summary>
/// </summary>
public
static
string
UpDownAxis_ServoOn
=
"UpDownAxis_ServoOn"
;
public
static
string
UpDownAxis_ServoOn
=
"UpDownAxis_ServoOn"
;
///// <summary>
/////
///// </summary>
//public static string Right_Door_LimitSingle = "Right_Door_LimitSingle";
public
static
string
BatchAxis_BreakOn
=
"BatchAxis_BreakOn"
;
public
static
string
BatchAxis_ServoOn
=
"BatchAxis_ServoOn"
;
}
}
public
enum
IO_VALUE
public
enum
IO_VALUE
{
{
...
...
source/LoadCVSLibrary/storeConfig/config/StoreConfig.cs
查看文件 @
5df8033
...
@@ -289,6 +289,15 @@ namespace OnlineStore.LoadCSVLibrary
...
@@ -289,6 +289,15 @@ namespace OnlineStore.LoadCSVLibrary
return
DOList
[
ioType
];
return
DOList
[
ioType
];
}
}
return
null
;
return
null
;
}
}
public
string
GetDisplayName
(
string
ioType
)
{
ConfigIO
io
=
getWaitIO
(
ioType
);
if
(
io
==
null
)
{
return
ioType
;
}
return
io
.
DisplayStr
;
}
}
}
}
}
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论