Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
刘韬
/
1069_MIMO_PlUS
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit 2e627ea5
由
刘韬
编写于
2022-10-27 09:04:12 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
1
1 个父辈
63b54a68
全部展开
显示空白字符变更
内嵌
并排
正在显示
20 个修改的文件
包含
224 行增加
和
108 行删除
DeviceLibrary/DeviceLibrary/CodeManager.cs
DeviceLibrary/DeviceLibrary/LiftMonitor.cs
DeviceLibrary/theMachine/BoxTransport.cs
DeviceLibrary/theMachine/LabelParam.cs
DeviceLibrary/theMachine/MainMachine _AutoInOutTest.cs
DeviceLibrary/theMachine/MainMachine _Common.cs
DeviceLibrary/theMachine/MainMachine.cs
DeviceLibrary/theMachine/MainMachine_Clamp.cs
DeviceLibrary/theMachine/MainMachine_String.cs
DeviceLibrary/theMachine/MoveStep.cs
LoadCVSLibrary/Config/Config.csv
LoadCVSLibrary/storeConfig/config/IO_Type.cs
LoadCVSLibrary/storeConfig/config/Robot_Config.cs
TheMachine/AxisControl.Designer.cs
TheMachine/Form1.cs
TheMachine/IOControls.Designer.cs
TheMachine/IOControls.cs
TheMachine/LogControl.cs
TheMachine/TheMachine.csproj
TheMachine/positionTool/FrmPositionTool.cs
DeviceLibrary/DeviceLibrary/CodeManager.cs
查看文件 @
2e627ea
...
@@ -36,22 +36,11 @@ namespace DeviceLibrary
...
@@ -36,22 +36,11 @@ namespace DeviceLibrary
ConfigHelper
.
Config
.
Set
(
"CamTestReel_Test"
,
"Click To Test"
);
ConfigHelper
.
Config
.
Set
(
"CamTestReel_Test"
,
"Click To Test"
);
ConfigHelper
.
AdvanceConfigForm
.
AddCustomEditor
<
CameraTest
>(
"CamTestReel_Test"
);
ConfigHelper
.
AdvanceConfigForm
.
AddCustomEditor
<
CameraTest
>(
"CamTestReel_Test"
);
string
nameStr
=
ConfigHelper
.
Config
.
Get
(
Setting_Init
.
CameraName
);
codeTypeList
=
new
List
<
string
>();
codeTypeList
=
new
List
<
string
>();
HDLogUtil
.
LogName
=
"RollingLogFileAppender"
;
HDLogUtil
.
LogName
=
"RollingLogFileAppender"
;
try
try
{
{
string
[]
nameArray
=
nameStr
.
Split
(
spiltChar
);
LoadCamera
(
true
);
foreach
(
string
str
in
nameArray
)
{
if
(
str
.
Trim
().
Equals
(
""
))
{
continue
;
}
//LogUtil.info("加载到配置摄像机名称:" + str.Trim());
cameraNameList
.
Add
(
str
.
Trim
());
}
LoadCamera
(
false
);
codeTypeList
=
new
List
<
string
>();
codeTypeList
=
new
List
<
string
>();
string
[]
codeArray
=
CodeType
.
Split
(
spiltChar
);
string
[]
codeArray
=
CodeType
.
Split
(
spiltChar
);
...
@@ -71,71 +60,16 @@ namespace DeviceLibrary
...
@@ -71,71 +60,16 @@ namespace DeviceLibrary
if
(
cameraNameList
.
Count
<=
0
&&
hikNameList
.
Count
>
0
)
if
(
cameraNameList
.
Count
<=
0
&&
hikNameList
.
Count
>
0
)
{
{
cameraNameList
=
new
List
<
string
>(
hikNameList
);
cameraNameList
=
new
List
<
string
>(
hikNameList
);
string
cameraStr
=
""
;
foreach
(
string
name
in
hikNameList
)
{
cameraStr
+=
name
+
spiltChar
;
}
cameraStr
=
cameraStr
.
Substring
(
0
,
cameraStr
.
Length
-
1
);
//ConfigAppSettings.SaveValue(Setting_Init.CameraName, cameraStr);
LogUtil
.
info
(
"未配置扫码相机,默认【"
+
Setting_Init
.
CameraName
+
"】=【"
+
cameraStr
+
"】"
);
}
}
catch
(
Exception
ex
)
{
LogUtil
.
error
(
"解析摄像机配置出错:"
+
ex
.
StackTrace
);
}
}
/// <summary>
/// 初始化摄像机名称和二维码类型
/// </summary>
public
static
bool
LoadSingle
()
{
codeTypeList
=
new
List
<
string
>();
HDLogUtil
.
LogName
=
"RollingLogFileAppender"
;
try
{
codeTypeList
=
new
List
<
string
>();
string
[]
codeArray
=
CodeType
.
Split
(
spiltChar
);
foreach
(
string
str
in
codeArray
)
{
if
(
str
.
Trim
().
Equals
(
""
))
{
continue
;
}
string
file
=
GetCodeParamFilePath
(
str
.
Trim
());
LogUtil
.
info
(
"加载到配置二维码类型:"
+
str
.
Trim
()
+
",配置文件:"
+
file
);
codeTypeList
.
Add
(
str
.
Trim
());
}
CodeLibrary
.
HDCodeLearnHelper
.
LoadConfig
(
""
,
CodeType
);
LoadCamera
(
false
);
//如果未加载到配置相机,自动配置
if
(
hikNameList
.
Count
>
0
)
{
cameraNameList
=
new
List
<
string
>(
hikNameList
);
string
cameraStr
=
""
;
foreach
(
string
name
in
hikNameList
)
{
cameraStr
+=
name
+
spiltChar
;
}
cameraStr
=
cameraStr
.
Substring
(
0
,
cameraStr
.
Length
-
1
);
//ConfigAppSettings.SaveValue(Setting_Init.CameraName, cameraStr);
LogUtil
.
info
(
"未配置扫码相机,默认【"
+
Setting_Init
.
CameraName
+
"】=【"
+
cameraStr
+
"】"
);
return
true
;
}
}
return
false
;
}
}
catch
(
Exception
ex
)
catch
(
Exception
ex
)
{
{
LogUtil
.
error
(
"解析摄像机配置出错:"
+
ex
.
StackTrace
);
LogUtil
.
error
(
"解析摄像机配置出错:"
+
ex
.
StackTrace
);
}
}
return
false
;
}
}
p
rivate
static
void
LoadCamera
(
bool
isReLoad
)
p
ublic
static
void
LoadCamera
(
bool
isReLoad
)
{
{
if
(
isReLoad
||
Camera
.
_cam
==
null
)
if
(
isReLoad
||
Camera
.
_cam
==
null
)
{
{
...
...
DeviceLibrary/DeviceLibrary/LiftMonitor.cs
查看文件 @
2e627ea
...
@@ -18,6 +18,7 @@ namespace DeviceLibrary
...
@@ -18,6 +18,7 @@ namespace DeviceLibrary
int
upspeed
;
int
upspeed
;
int
downspeed
;
int
downspeed
;
int
StrokeLength
=
270000
;
int
StrokeLength
=
270000
;
bool
paused
=
false
;
public
LiftMonitor
(
string
_up
,
string
_down
,
string
_break
,
AxisBean
_axisBean
,
int
_StrokeLength
,
int
_upspeed
,
int
_downspeed
=
0
)
{
public
LiftMonitor
(
string
_up
,
string
_down
,
string
_break
,
AxisBean
_axisBean
,
int
_StrokeLength
,
int
_upspeed
,
int
_downspeed
=
0
)
{
up
=
_up
;
up
=
_up
;
down
=
_down
;
down
=
_down
;
...
@@ -47,6 +48,12 @@ namespace DeviceLibrary
...
@@ -47,6 +48,12 @@ namespace DeviceLibrary
if
(
moveInfo
==
null
)
if
(
moveInfo
==
null
)
moveInfo
=
new
MoveInfo
(
"界面"
,
false
);
moveInfo
=
new
MoveInfo
(
"界面"
,
false
);
if
(
IOManager
.
IOValue
(
IO_Type
.
SuddenStop_BTN
).
Equals
(
IO_VALUE
.
LOW
))
{
moveInfo
.
log
(
$
"急停未解除"
);
return
;
}
paused
=
false
;
if
(
IOManager
.
IOValue
(
up
.
ToString
()).
Equals
(
IO_VALUE
.
HIGH
))
{
if
(
IOManager
.
IOValue
(
up
.
ToString
()).
Equals
(
IO_VALUE
.
HIGH
))
{
moveInfo
.
log
(
$
"{axisBean.AxisName},已在位置,无需上升"
);
moveInfo
.
log
(
$
"{axisBean.AxisName},已在位置,无需上升"
);
return
;
return
;
...
@@ -66,10 +73,24 @@ namespace DeviceLibrary
...
@@ -66,10 +73,24 @@ namespace DeviceLibrary
Task
.
Run
(()=>
{
Task
.
Run
(()=>
{
while
(!
IOManager
.
IOValue
(
up
.
ToString
()).
Equals
(
IO_VALUE
.
HIGH
))
{
while
(!
IOManager
.
IOValue
(
up
.
ToString
()).
Equals
(
IO_VALUE
.
HIGH
))
{
Task
.
Delay
(
30
);
Task
.
Delay
(
30
);
if
(
paused
)
{
paused
=
false
;
return
;
}
if
(
IOManager
.
IOValue
(
IO_Type
.
SuddenStop_BTN
).
Equals
(
IO_VALUE
.
LOW
))
{
LogUtil
.
info
(
"设备急停"
);
Pause
();
return
;
}
}
}
axisBean
.
SuddenStop
();
axisBean
.
SuddenStop
();
if
(!
string
.
IsNullOrEmpty
(
axisbreak
))
if
(!
string
.
IsNullOrEmpty
(
axisbreak
))
{
IOManager
.
IOMove
(
axisbreak
,
IO_VALUE
.
LOW
);
IOManager
.
IOMove
(
axisbreak
,
IO_VALUE
.
LOW
);
axisBean
.
ServoOff
();
}
var
t
=
(
DateTime
.
Now
-
d
).
TotalSeconds
;
var
t
=
(
DateTime
.
Now
-
d
).
TotalSeconds
;
moveInfo
.
log
(
$
"{axisBean.AxisName},上升到位,s:{t}"
);
moveInfo
.
log
(
$
"{axisBean.AxisName},上升到位,s:{t}"
);
});
});
...
@@ -79,13 +100,18 @@ namespace DeviceLibrary
...
@@ -79,13 +100,18 @@ namespace DeviceLibrary
if
(
IOManager
.
IOValue
(
up
.
ToString
()).
Equals
(
IO_VALUE
.
HIGH
))
if
(
IOManager
.
IOValue
(
up
.
ToString
()).
Equals
(
IO_VALUE
.
HIGH
))
{
{
axisBean
.
SuddenStop
();
axisBean
.
SuddenStop
();
if
(!
string
.
IsNullOrEmpty
(
axisbreak
))
if
(!
string
.
IsNullOrEmpty
(
axisbreak
))
{
IOManager
.
IOMove
(
axisbreak
,
IO_VALUE
.
LOW
);
IOManager
.
IOMove
(
axisbreak
,
IO_VALUE
.
LOW
);
axisBean
.
ServoOff
();
}
return
true
;
return
true
;
}
}
if
(!
axisBean
.
IsBusy
)
{
if
(!
axisBean
.
IsBusy
)
{
axisBean
.
RelMove
(
StrokeLength
,
(
double
)
upspeed
);
LogUtil
.
info
(
"恢复继续上升"
);
LiftUp
(
null
);
}
}
return
false
;
return
false
;
}
}
...
@@ -93,6 +119,12 @@ namespace DeviceLibrary
...
@@ -93,6 +119,12 @@ namespace DeviceLibrary
{
{
if
(
moveInfo
==
null
)
if
(
moveInfo
==
null
)
moveInfo
=
new
MoveInfo
(
"界面"
,
false
);
moveInfo
=
new
MoveInfo
(
"界面"
,
false
);
if
(
IOManager
.
IOValue
(
IO_Type
.
SuddenStop_BTN
).
Equals
(
IO_VALUE
.
LOW
))
{
moveInfo
.
log
(
$
"急停未解除"
);
return
;
}
paused
=
false
;
if
(
IOManager
.
IOValue
(
down
.
ToString
()).
Equals
(
IO_VALUE
.
HIGH
))
if
(
IOManager
.
IOValue
(
down
.
ToString
()).
Equals
(
IO_VALUE
.
HIGH
))
{
{
moveInfo
.
log
(
$
"{axisBean.AxisName},已在位置,无需下降"
);
moveInfo
.
log
(
$
"{axisBean.AxisName},已在位置,无需下降"
);
...
@@ -115,10 +147,24 @@ namespace DeviceLibrary
...
@@ -115,10 +147,24 @@ namespace DeviceLibrary
while
(!
IOManager
.
IOValue
(
down
.
ToString
()).
Equals
(
IO_VALUE
.
HIGH
))
while
(!
IOManager
.
IOValue
(
down
.
ToString
()).
Equals
(
IO_VALUE
.
HIGH
))
{
{
Task
.
Delay
(
30
);
Task
.
Delay
(
30
);
if
(
paused
)
{
paused
=
false
;
return
;
}
if
(
IOManager
.
IOValue
(
IO_Type
.
SuddenStop_BTN
).
Equals
(
IO_VALUE
.
LOW
))
{
LogUtil
.
info
(
"设备急停"
);
Pause
();
return
;
}
}
}
axisBean
.
SuddenStop
();
axisBean
.
SuddenStop
();
if
(!
string
.
IsNullOrEmpty
(
axisbreak
))
if
(!
string
.
IsNullOrEmpty
(
axisbreak
))
{
IOManager
.
IOMove
(
axisbreak
,
IO_VALUE
.
LOW
);
IOManager
.
IOMove
(
axisbreak
,
IO_VALUE
.
LOW
);
axisBean
.
ServoOff
();
}
var
t
=
(
DateTime
.
Now
-
d
).
TotalSeconds
;
var
t
=
(
DateTime
.
Now
-
d
).
TotalSeconds
;
moveInfo
.
log
(
$
"{axisBean.AxisName},下降到位,s:{t}"
);
moveInfo
.
log
(
$
"{axisBean.AxisName},下降到位,s:{t}"
);
});
});
...
@@ -128,21 +174,33 @@ namespace DeviceLibrary
...
@@ -128,21 +174,33 @@ namespace DeviceLibrary
if
(
IOManager
.
IOValue
(
down
.
ToString
()).
Equals
(
IO_VALUE
.
HIGH
))
if
(
IOManager
.
IOValue
(
down
.
ToString
()).
Equals
(
IO_VALUE
.
HIGH
))
{
{
axisBean
.
SuddenStop
();
axisBean
.
SuddenStop
();
if
(!
string
.
IsNullOrEmpty
(
axisbreak
))
if
(!
string
.
IsNullOrEmpty
(
axisbreak
))
{
IOManager
.
IOMove
(
axisbreak
,
IO_VALUE
.
LOW
);
IOManager
.
IOMove
(
axisbreak
,
IO_VALUE
.
LOW
);
axisBean
.
ServoOff
();
}
return
true
;
return
true
;
}
}
if
(!
axisBean
.
IsBusy
)
if
(!
axisBean
.
IsBusy
)
{
{
axisBean
.
RelMove
(-
StrokeLength
,
(
double
)
downspeed
);
LogUtil
.
info
(
"恢复继续下降"
);
LiftDown
(
null
);
}
}
return
false
;
return
false
;
}
}
public
void
Pause
()
public
void
Pause
()
{
{
paused
=
true
;
axisBean
.
SuddenStop
();
axisBean
.
SuddenStop
();
if
(!
string
.
IsNullOrEmpty
(
axisbreak
))
{
IOManager
.
IOMove
(
axisbreak
,
IO_VALUE
.
LOW
);
axisBean
.
ServoOff
();
}
}
}
public
void
Resume
()
public
void
Resume
()
...
...
DeviceLibrary/theMachine/BoxTransport.cs
查看文件 @
2e627ea
...
@@ -181,7 +181,7 @@ namespace DeviceLibrary
...
@@ -181,7 +181,7 @@ namespace DeviceLibrary
Msg
.
add
(
""
,
MsgLevel
.
info
,
ErrInfo
.
X09_Clear
);
Msg
.
add
(
""
,
MsgLevel
.
info
,
ErrInfo
.
X09_Clear
);
IgnoreX09
=
false
;
IgnoreX09
=
false
;
if
(
To
.
posid
==
BoxStorePosition
.
strings
&&
ConfigHelper
.
Config
.
Get
(
"Device_Use_Fixpos"
,
false
)
&&
Fix
!=
null
)
if
(
!
RobotManage
.
mainMachine
.
AutoInOutTest
&&
To
.
posid
==
BoxStorePosition
.
strings
&&
ConfigHelper
.
Config
.
Get
(
"Device_Use_Fixpos"
,
false
)
&&
Fix
!=
null
)
MoveInfo
.
NextMoveStep
(
MoveStep
.
StoreFIX01
);
MoveInfo
.
NextMoveStep
(
MoveStep
.
StoreFIX01
);
else
else
MoveInfo
.
NextMoveStep
(
MoveStep
.
StoreTS10
);
MoveInfo
.
NextMoveStep
(
MoveStep
.
StoreTS10
);
...
...
DeviceLibrary/theMachine/LabelParam.cs
查看文件 @
2e627ea
...
@@ -147,14 +147,14 @@ namespace DeviceLibrary
...
@@ -147,14 +147,14 @@ namespace DeviceLibrary
UpDown_PH
=
aCStorePosition
.
UpDownAxis_IHPosition_P3
;
UpDown_PH
=
aCStorePosition
.
UpDownAxis_IHPosition_P3
;
UpDown_PL
=
aCStorePosition
.
UpDownAxis_ILPosition_P4
;
UpDown_PL
=
aCStorePosition
.
UpDownAxis_ILPosition_P4
;
Comp_PH
=
Config
.
Comp_P2
-
Config
.
C
la
mp_PoToMM
*
(
aCStorePosition
.
BagHigh
-
8
+
Config
.
Comp_PH_MM
);
Comp_PH
=
Config
.
Comp_P2
-
Config
.
C
o
mp_PoToMM
*
(
aCStorePosition
.
BagHigh
-
8
+
Config
.
Comp_PH_MM
);
Comp_PL
=
Config
.
Comp_P2
-
Config
.
C
lamp_PoToMM
*
(
reel
.
PlateH
-
8
)
-
(
reel
.
PlateH
>
8
?
Config
.
Cla
mp_PoToMM
*
Config
.
Comp_PL_MM
:
0
);
Comp_PL
=
Config
.
Comp_P2
-
Config
.
C
omp_PoToMM
*
(
reel
.
PlateH
-
8
)
-
(
reel
.
PlateH
>
8
?
Config
.
Co
mp_PoToMM
*
Config
.
Comp_PL_MM
:
0
);
Comp_PH
=
Comp_PH
<
0
?
0
:
Comp_PH
;
Comp_PH
=
Comp_PH
<
0
?
0
:
Comp_PH
;
Comp_PL
=
Comp_PL
<
0
?
0
:
Comp_PL
;
Comp_PL
=
Comp_PL
<
0
?
0
:
Comp_PL
;
posid
=
aCStorePosition
.
PositionNum
;
posid
=
aCStorePosition
.
PositionNum
;
Reel
=
reel
.
clone
();
Reel
=
reel
.
clone
();
LogUtil
.
info
(
$
"BSP:{posid},Comp_PH:{Comp_PH}={Config.Comp_P2}-({aCStorePosition.BagHigh}-{8}+{Config.Comp_PH_MM})*{Config.C
la
mp_PoToMM},Comp_PL:{Comp_PL}={reel.PlateH},Comp_PL_MM:{Config.Comp_PL_MM},{JsonHelper.SerializeObject(this)}"
);
LogUtil
.
info
(
$
"BSP:{posid},Comp_PH:{Comp_PH}={Config.Comp_P2}-({aCStorePosition.BagHigh}-{8}+{Config.Comp_PH_MM})*{Config.C
o
mp_PoToMM},Comp_PL:{Comp_PL}={reel.PlateH},Comp_PL_MM:{Config.Comp_PL_MM},{JsonHelper.SerializeObject(this)}"
);
}
}
public
const
string
ngdoor
=
"单料口"
;
public
const
string
ngdoor
=
"单料口"
;
public
const
string
strings
=
"料串口"
;
public
const
string
strings
=
"料串口"
;
...
@@ -168,6 +168,9 @@ namespace DeviceLibrary
...
@@ -168,6 +168,9 @@ namespace DeviceLibrary
UpDown_PH
=
Config
.
UpDown_P2
;
UpDown_PH
=
Config
.
UpDown_P2
;
UpDown_PL
=
Config
.
UpDown_P3
;
UpDown_PL
=
Config
.
UpDown_P3
;
posid
=
ngdoor
;
posid
=
ngdoor
;
if
(
reel
.
PlateW
>
7
&&
Config
.
InOut_P5
>
0
)
InOut_P2
=
Config
.
InOut_P5
;
}
}
else
if
(
storeSide
==
StoreSide
.
String
)
else
if
(
storeSide
==
StoreSide
.
String
)
{
{
...
@@ -176,9 +179,11 @@ namespace DeviceLibrary
...
@@ -176,9 +179,11 @@ namespace DeviceLibrary
UpDown_PH
=
Config
.
UpDown_P4
;
UpDown_PH
=
Config
.
UpDown_P4
;
UpDown_PL
=
Config
.
UpDown_P5
;
UpDown_PL
=
Config
.
UpDown_P5
;
posid
=
strings
;
posid
=
strings
;
if
(
reel
.
PlateW
>
7
&&
Config
.
InOut_P4
>
0
)
InOut_P2
=
Config
.
InOut_P4
;
}
}
Comp_PH
=
Config
.
Comp_P2
-
Config
.
C
la
mp_PoToMM
*
(
reel
.
PlateH
-
8
+
Config
.
Comp_PH_MM
);
Comp_PH
=
Config
.
Comp_P2
-
Config
.
C
o
mp_PoToMM
*
(
reel
.
PlateH
-
8
+
Config
.
Comp_PH_MM
);
Comp_PL
=
Config
.
Comp_P2
-
Config
.
C
lamp_PoToMM
*
(
reel
.
PlateH
-
8
)
-
(
reel
.
PlateH
>
8
?
Config
.
Cla
mp_PoToMM
*
Config
.
Comp_PL_MM
:
0
);
Comp_PL
=
Config
.
Comp_P2
-
Config
.
C
omp_PoToMM
*
(
reel
.
PlateH
-
8
)
-
(
reel
.
PlateH
>
8
?
Config
.
Co
mp_PoToMM
*
Config
.
Comp_PL_MM
:
0
);
Comp_PH
=
Comp_PH
<
0
?
0
:
Comp_PH
;
Comp_PH
=
Comp_PH
<
0
?
0
:
Comp_PH
;
Comp_PL
=
Comp_PL
<
0
?
0
:
Comp_PL
;
Comp_PL
=
Comp_PL
<
0
?
0
:
Comp_PL
;
Reel
=
reel
.
clone
();
Reel
=
reel
.
clone
();
...
...
DeviceLibrary/theMachine/MainMachine _AutoInOutTest.cs
查看文件 @
2e627ea
...
@@ -26,7 +26,7 @@ namespace DeviceLibrary
...
@@ -26,7 +26,7 @@ namespace DeviceLibrary
errmsg
=
crc
.
GetString
(
"Res0003"
,
"入库料盘没有准备好,无法启动"
);
errmsg
=
crc
.
GetString
(
"Res0003"
,
"入库料盘没有准备好,无法启动"
);
return
false
;
return
false
;
}
}
poslist
=
CSVPositionReader
<
ACStorePosition
>.
getPositionList
();
poslist
=
RobotManage
.
PositionNumList
.
Select
(
a
=>
{
return
CSVPositionReader
<
ACStorePosition
>.
allPositionMap
[
a
];
}).
ToList
();
//
CSVPositionReader<ACStorePosition>.getPositionList();
AutoInOutTest
=
true
;
AutoInOutTest
=
true
;
StopAutoInOut
=
false
;
StopAutoInOut
=
false
;
CurrentPosIndex
=
posindex
;
CurrentPosIndex
=
posindex
;
...
...
DeviceLibrary/theMachine/MainMachine _Common.cs
查看文件 @
2e627ea
...
@@ -85,7 +85,7 @@ namespace DeviceLibrary
...
@@ -85,7 +85,7 @@ namespace DeviceLibrary
else
if
(
wait
.
WaitType
.
Equals
(
WaitEnum
.
W002_IOValue
))
else
if
(
wait
.
WaitType
.
Equals
(
WaitEnum
.
W002_IOValue
))
{
{
ConfigIO
io
=
RobotManage
.
Config
.
getWaitIO
(
wait
.
IoType
);
ConfigIO
io
=
RobotManage
.
Config
.
getWaitIO
(
wait
.
IoType
);
NotOkMsg
=
MoveInfo
.
Name
+
$
" {crc.GetString(L.wait, "
等待
")}【"
+
io
.
DisplayStr
+
"】=【"
+
wait
.
IoValue
+
"】"
;
NotOkMsg
=
MoveInfo
.
Name
+
$
" {crc.GetString(L.wait, "
等待
")}【"
+
crc
.
GetString
(
io
.
ProName
,
io
.
Explain
)
+
"】=【"
+
wait
.
IoValue
+
"】"
;
wait
.
IsEnd
=
IOManager
.
IOValue
(
wait
.
IoType
).
Equals
(
wait
.
IoValue
);
wait
.
IsEnd
=
IOManager
.
IOValue
(
wait
.
IoType
).
Equals
(
wait
.
IoValue
);
if
(!
wait
.
IsEnd
)
if
(!
wait
.
IsEnd
)
{
{
...
@@ -93,7 +93,7 @@ namespace DeviceLibrary
...
@@ -93,7 +93,7 @@ namespace DeviceLibrary
if
(
span
.
TotalMilliseconds
>
timeOutMs
&&
NoAlarm
())
if
(
span
.
TotalMilliseconds
>
timeOutMs
&&
NoAlarm
())
{
{
WarnMsg
=
MoveInfo
.
Name
+
"["
+
MoveInfo
.
MoveStep
+
$
"] {crc.GetString(L.wait, "
等待
")}("
+
io
.
DisplayStr
+
"="
+
wait
.
IoValue
+
$
") {crc.GetString(L.timeout, "
超时
")}"
;
WarnMsg
=
MoveInfo
.
Name
+
"["
+
MoveInfo
.
MoveStep
+
$
"] {crc.GetString(L.wait, "
等待
")}("
+
crc
.
GetString
(
io
.
ProName
,
io
.
Explain
)
+
"="
+
wait
.
IoValue
+
$
") {crc.GetString(L.timeout, "
超时
")}"
;
Msg
.
add
(
WarnMsg
,
MsgLevel
.
alarm
);
Msg
.
add
(
WarnMsg
,
MsgLevel
.
alarm
);
if
(
NoAlarm
())
if
(
NoAlarm
())
...
@@ -303,10 +303,11 @@ namespace DeviceLibrary
...
@@ -303,10 +303,11 @@ namespace DeviceLibrary
/// </summary>
/// </summary>
/// <param name="moveInfo"></param>
/// <param name="moveInfo"></param>
public
void
CloseFlipDoor
(
MoveInfo
moveInfo
)
{
public
void
CloseFlipDoor
(
MoveInfo
moveInfo
)
{
if
(
moveInfo
==
null
)
LogUtil
.
info
(
"关闭翻板门"
);
LogUtil
.
info
(
"关闭翻板门"
);
//IOMove(IO_Type.ReelFlipDoor_Home, IO_VALUE.LOW);
else
//IOMove(IO_Type.ReelFlipDoor_Work, IO_VALUE.HIGH
);
moveInfo
.
log
(
"关闭翻板门"
);
if
(
ConfigHelper
.
Config
.
Get
(
"Device_FlipDoorType"
,
FlipDoorTypeE
.
Cylinder
)
==
FlipDoorTypeE
.
Cylinder
)
if
(
MotorFlipDoorA
==
null
)
{
{
FlipDoor
.
ToHigh
(
null
);
FlipDoor
.
ToHigh
(
null
);
}
}
...
...
DeviceLibrary/theMachine/MainMachine.cs
查看文件 @
2e627ea
...
@@ -135,7 +135,7 @@ namespace DeviceLibrary
...
@@ -135,7 +135,7 @@ namespace DeviceLibrary
if
(
Config
.
StringDoor_Axis
!=
null
)
{
if
(
Config
.
StringDoor_Axis
!=
null
)
{
RobotManage
.
Config
.
DOList
.
Remove
(
IO_Type
.
StringDoor_Open
);
RobotManage
.
Config
.
DOList
.
Remove
(
IO_Type
.
StringDoor_Open
);
RobotManage
.
Config
.
DOList
.
Remove
(
IO_Type
.
StringDoor_Close
);
RobotManage
.
Config
.
DOList
.
Remove
(
IO_Type
.
StringDoor_Close
);
StringDoor
=
new
LiftMonitor
(
IO_Type
.
StringDoor_Open
,
IO_Type
.
StringDoor_Close
,
null
,
new
AxisBean
(
Config
.
StringDoor_Axis
,
Name
),
Config
.
StringDoorLength
,
Config
.
StringDoorLength_speed
);
StringDoor
=
new
LiftMonitor
(
IO_Type
.
StringDoor_Open
,
IO_Type
.
StringDoor_Close
,
IO_Type
.
StringDoor_Axis_Break
,
new
AxisBean
(
Config
.
StringDoor_Axis
,
Name
),
Config
.
StringDoorLength
,
Config
.
StringDoorLength_speed
);
LogUtil
.
info
(
"加载料串门类型为:步进"
);
LogUtil
.
info
(
"加载料串门类型为:步进"
);
//此版本同步删除其他IO
//此版本同步删除其他IO
...
@@ -153,6 +153,14 @@ namespace DeviceLibrary
...
@@ -153,6 +153,14 @@ namespace DeviceLibrary
RobotManage
.
Config
.
DOList
.
Remove
(
IO_Type
.
DoorSafe_Disable
);
RobotManage
.
Config
.
DOList
.
Remove
(
IO_Type
.
DoorSafe_Disable
);
}
}
if
(!
ConfigHelper
.
Config
.
Get
(
"Device_IO_HasX29"
,
true
))
{
RobotManage
.
Config
.
DIList
.
Remove
(
IO_Type
.
NGDoor_Tray_Check
);
}
if
(!
ConfigHelper
.
Config
.
Get
(
"Device_IO_HasX20"
,
true
))
{
RobotManage
.
Config
.
DIList
.
Remove
(
IO_Type
.
WidthCheck_15
);
}
boxTransport
=
new
ReelTransport
(
Config
,
this
);
boxTransport
=
new
ReelTransport
(
Config
,
this
);
...
@@ -399,9 +407,7 @@ namespace DeviceLibrary
...
@@ -399,9 +407,7 @@ namespace DeviceLibrary
break
;
break
;
case
MoveStep
.
H07_HomeReset
:
case
MoveStep
.
H07_HomeReset
:
if
(
IOValue
(
IO_Type
.
WidthCheck_7
).
Equals
(
IO_VALUE
.
HIGH
)
||
if
(
GetWidth
()>
0
)
IOValue
(
IO_Type
.
WidthCheck_13
).
Equals
(
IO_VALUE
.
HIGH
)
||
IOValue
(
IO_Type
.
WidthCheck_15
).
Equals
(
IO_VALUE
.
HIGH
))
{
{
ResetMoveInfo
.
NextMoveStep
(
MoveStep
.
H08_HomeReset
);
ResetMoveInfo
.
NextMoveStep
(
MoveStep
.
H08_HomeReset
);
ResetMoveInfo
.
log
(
"夹爪上有料盘,送到NG口"
);
ResetMoveInfo
.
log
(
"夹爪上有料盘,送到NG口"
);
...
@@ -447,8 +453,8 @@ namespace DeviceLibrary
...
@@ -447,8 +453,8 @@ namespace DeviceLibrary
ResetMoveInfo
.
NextMoveStep
(
MoveStep
.
H14_HomeReset
);
ResetMoveInfo
.
NextMoveStep
(
MoveStep
.
H14_HomeReset
);
if
(!
NGDoor_Tray_Test_Reel
)
if
(!
NGDoor_Tray_Test_Reel
)
{
{
Msg
.
add
(
crc
.
GetString
(
L
.
x29_low_no_reel
,
"传感器
X29
未检测到单料口料盘."
),
MsgLevel
.
alarm
);
Msg
.
add
(
crc
.
GetString
(
L
.
x29_low_no_reel
,
"传感器未检测到单料口料盘."
),
MsgLevel
.
alarm
);
RobotManage
.
UserPause
(
crc
.
GetString
(
"x29_low_no_reel"
,
"传感器
X29
未检测到单料口料盘."
));
RobotManage
.
UserPause
(
crc
.
GetString
(
"x29_low_no_reel"
,
"传感器未检测到单料口料盘."
));
}
}
//CylinderMove(ResetMoveInfo, IO_Type.NGDoor_Close, IO_Type.NGDoor_Open, IO_VALUE.HIGH);
//CylinderMove(ResetMoveInfo, IO_Type.NGDoor_Close, IO_Type.NGDoor_Open, IO_VALUE.HIGH);
SingleDoor
.
ToHigh
(
ResetMoveInfo
);
SingleDoor
.
ToHigh
(
ResetMoveInfo
);
...
@@ -456,7 +462,7 @@ namespace DeviceLibrary
...
@@ -456,7 +462,7 @@ namespace DeviceLibrary
case
MoveStep
.
H14_HomeReset
:
case
MoveStep
.
H14_HomeReset
:
if
(
NGDoor_Tray_Test_Reel
)
if
(
NGDoor_Tray_Test_Reel
)
{
{
Msg
.
add
(
crc
.
GetString
(
L
.
x29_higt_has_reel
,
"系统启动
X29
检测到有无信息料盘,等待取走单料口料盘"
),
MsgLevel
.
alarm
);
Msg
.
add
(
crc
.
GetString
(
L
.
x29_higt_has_reel
,
"系统启动检测到有无信息料盘,等待取走单料口料盘"
),
MsgLevel
.
alarm
);
if
(
ConfigHelper
.
Config
.
Get
(
"CamTestReel_Ability"
,
false
))
if
(
ConfigHelper
.
Config
.
Get
(
"CamTestReel_Ability"
,
false
))
{
{
//ResetMoveInfo.NextMoveStep(MoveStep.H14_HomeReset);
//ResetMoveInfo.NextMoveStep(MoveStep.H14_HomeReset);
...
@@ -466,7 +472,7 @@ namespace DeviceLibrary
...
@@ -466,7 +472,7 @@ namespace DeviceLibrary
}
}
else
else
{
{
RobotManage
.
UserPause
(
$
"系统启动
X29
检测到有无信息料盘,等待取走单料口料盘"
);
RobotManage
.
UserPause
(
$
"系统启动检测到有无信息料盘,等待取走单料口料盘"
);
}
}
}
}
else
{
else
{
...
@@ -490,7 +496,7 @@ namespace DeviceLibrary
...
@@ -490,7 +496,7 @@ namespace DeviceLibrary
ResetMoveInfo
.
log
(
"NG口还是检测到料盘"
);
ResetMoveInfo
.
log
(
"NG口还是检测到料盘"
);
ResetMoveInfo
.
NextMoveStep
(
MoveStep
.
H14_HomeReset
);
ResetMoveInfo
.
NextMoveStep
(
MoveStep
.
H14_HomeReset
);
}
}
else
if
(
IOValue
(
IO_Type
.
SafetyLightCurtains
).
Equals
(
IO_VALUE
.
HIGH
)
&&
IOValue
(
IO_Type
.
NGDoor_Tray_Check
).
Equals
(
IO_VALUE
.
LOW
)
)
else
if
(
IOValue
(
IO_Type
.
SafetyLightCurtains
).
Equals
(
IO_VALUE
.
HIGH
)
&&
!
NGDoor_Tray_Test_Reel
)
{
{
ResetMoveInfo
.
NextMoveStep
(
MoveStep
.
HEND_HomeReset
);
ResetMoveInfo
.
NextMoveStep
(
MoveStep
.
HEND_HomeReset
);
ResetMoveInfo
.
log
(
"关门NG口门"
);
ResetMoveInfo
.
log
(
"关门NG口门"
);
...
@@ -542,6 +548,8 @@ namespace DeviceLibrary
...
@@ -542,6 +548,8 @@ namespace DeviceLibrary
}
}
Msg
.
add
(
crc
.
GetString
(
L
.
SafetyLight_is_block
,
"安全光栅被遮挡"
)
+
(
ok
?
ignorestring
:
""
),
MsgLevel
.
warning
);
Msg
.
add
(
crc
.
GetString
(
L
.
SafetyLight_is_block
,
"安全光栅被遮挡"
)
+
(
ok
?
ignorestring
:
""
),
MsgLevel
.
warning
);
}
}
if
(!
ConfigHelper
.
Config
.
Get
(
"Device_Disable_DoorSafeCheck"
,
false
))
{
if
(
IOValue
(
IO_Type
.
LeftDoorClose_Check
).
Equals
(
IO_VALUE
.
LOW
))
if
(
IOValue
(
IO_Type
.
LeftDoorClose_Check
).
Equals
(
IO_VALUE
.
LOW
))
{
{
if
(!
IgnoreSafecheck
)
if
(!
IgnoreSafecheck
)
...
@@ -569,6 +577,7 @@ namespace DeviceLibrary
...
@@ -569,6 +577,7 @@ namespace DeviceLibrary
}
}
Msg
.
add
(
crc
.
GetString
(
L
.
back_safedoor_not_close
,
"后侧防护门没有关闭"
)
+
(
ok
?
ignorestring
:
""
),
MsgLevel
.
warning
);
Msg
.
add
(
crc
.
GetString
(
L
.
back_safedoor_not_close
,
"后侧防护门没有关闭"
)
+
(
ok
?
ignorestring
:
""
),
MsgLevel
.
warning
);
}
}
}
if
(!
lastSafeCheckStatus
&&
ok
)
if
(!
lastSafeCheckStatus
&&
ok
)
{
{
SafetyDevice
.
ResumeAll
();
SafetyDevice
.
ResumeAll
();
...
@@ -611,6 +620,8 @@ namespace DeviceLibrary
...
@@ -611,6 +620,8 @@ namespace DeviceLibrary
{
{
Alarm
(
AlarmType
.
SuddenStop
);
Alarm
(
AlarmType
.
SuddenStop
);
Msg
.
add
(
crc
.
GetString
(
L
.
in_suddenstop
,
"急停中"
),
MsgLevel
.
alarm
);
Msg
.
add
(
crc
.
GetString
(
L
.
in_suddenstop
,
"急停中"
),
MsgLevel
.
alarm
);
DeviceSuddenStop
();
lastSafeCheckStatus
=
false
;
ok
=
false
;
ok
=
false
;
}
}
else
if
(
alarmType
!=
AlarmType
.
None
)
{
else
if
(
alarmType
!=
AlarmType
.
None
)
{
...
...
DeviceLibrary/theMachine/MainMachine_Clamp.cs
查看文件 @
2e627ea
...
@@ -256,7 +256,7 @@ namespace DeviceLibrary
...
@@ -256,7 +256,7 @@ namespace DeviceLibrary
break
;
break
;
case
MoveStep
.
NGOUT_03
:
case
MoveStep
.
NGOUT_03
:
Msg
.
add
(
ClampMoveInfo
.
MoveParam
.
NgMsg
,
MsgLevel
.
warning
);
Msg
.
add
(
ClampMoveInfo
.
MoveParam
.
NgMsg
,
MsgLevel
.
warning
);
if
(
!
ConfigHelper
.
Config
.
Get
(
"CamTestReel_Ability"
,
false
)
||
NGDoor_Tray_Test_Reel
)
if
(
NGDoor_Tray_Test_Reel
)
{
{
Msg
.
add
(
crc
.
GetString
(
L
.
please_take_ngdoor_reel
,
"等待取走单料口料盘"
),
MsgLevel
.
alarm
);
Msg
.
add
(
crc
.
GetString
(
L
.
please_take_ngdoor_reel
,
"等待取走单料口料盘"
),
MsgLevel
.
alarm
);
if
(
ConfigHelper
.
Config
.
Get
(
"CamTestReel_Ability"
,
false
))
if
(
ConfigHelper
.
Config
.
Get
(
"CamTestReel_Ability"
,
false
))
...
@@ -289,14 +289,15 @@ namespace DeviceLibrary
...
@@ -289,14 +289,15 @@ namespace DeviceLibrary
}
}
break
;
break
;
case
MoveStep
.
NGOUT_05
:
case
MoveStep
.
NGOUT_05
:
if
(
IOValue
(
IO_Type
.
SafetyLightCurtains
).
Equals
(
IO_VALUE
.
HIGH
)
&&
NGDoor_Tray_Test_Reel
)
//if (IOValue(IO_Type.SafetyLightCurtains).Equals(IO_VALUE.HIGH) && NGDoor_Tray_Test_Reel)
{
//{
ClampMoveInfo
.
log
(
"NG口还是检测到料盘"
);
// ClampMoveInfo.log("NG口还是检测到料盘");
ClampMoveInfo
.
NextMoveStep
(
MoveStep
.
NGOUT_03
);
// ClampMoveInfo.NextMoveStep(MoveStep.NGOUT_03);
}
//}
else
if
(
IOValue
(
IO_Type
.
SafetyLightCurtains
).
Equals
(
IO_VALUE
.
HIGH
)
&&
IOValue
(
IO_Type
.
NGDoor_Tray_Check
).
Equals
(
IO_VALUE
.
LOW
))
//else
if
(
IOValue
(
IO_Type
.
SafetyLightCurtains
).
Equals
(
IO_VALUE
.
HIGH
))
{
{
ClampMoveInfo
.
NextMoveStep
(
MoveStep
.
Wait
);
ClampMoveInfo
.
NextMoveStep
(
MoveStep
.
NGOUT_06
);
ClampMoveInfo
.
log
(
"关门NG口门"
);
ClampMoveInfo
.
log
(
"关门NG口门"
);
//CylinderMove(ClampMoveInfo, IO_Type.NGDoor_Close, IO_Type.NGDoor_Open, IO_VALUE.LOW);
//CylinderMove(ClampMoveInfo, IO_Type.NGDoor_Close, IO_Type.NGDoor_Open, IO_VALUE.LOW);
SingleDoor
.
ToLow
(
ClampMoveInfo
);
SingleDoor
.
ToLow
(
ClampMoveInfo
);
...
@@ -307,6 +308,9 @@ namespace DeviceLibrary
...
@@ -307,6 +308,9 @@ namespace DeviceLibrary
Msg
.
add
(
crc
.
GetString
(
L
.
wait_put_reel_into_ngdoor
,
"等待阻挡物离开光栅"
),
MsgLevel
.
warning
);
Msg
.
add
(
crc
.
GetString
(
L
.
wait_put_reel_into_ngdoor
,
"等待阻挡物离开光栅"
),
MsgLevel
.
warning
);
}
}
break
;
break
;
case
MoveStep
.
NGOUT_06
:
ClampMoveInfo
.
NextMoveStep
(
MoveStep
.
Wait
);
break
;
case
MoveStep
.
SingleIn
:
case
MoveStep
.
SingleIn
:
ClampMoveInfo
.
NextMoveStep
(
MoveStep
.
SingleIn_01
);
ClampMoveInfo
.
NextMoveStep
(
MoveStep
.
SingleIn_01
);
ClampMoveInfo
.
log
(
"开始单盘入库, 合拢托盘"
);
ClampMoveInfo
.
log
(
"开始单盘入库, 合拢托盘"
);
...
@@ -344,14 +348,14 @@ namespace DeviceLibrary
...
@@ -344,14 +348,14 @@ namespace DeviceLibrary
get
get
{
{
if
(
ConfigHelper
.
Config
.
Get
(
"CamTestReel_Ability"
,
false
))
if
(
ConfigHelper
.
Config
.
Get
(
"CamTestReel_Ability"
,
false
))
return
IOValue
(
IO_Type
.
NGDoor_Tray_Check
).
Equals
(
IO_VALUE
.
HIGH
)
||
CodeManager
.
TestHasReel
(
CodeManager
.
hikNameList
[
0
]);
return
CodeManager
.
TestHasReel
(
CodeManager
.
hikNameList
[
0
]);
else
else
return
IOValue
(
IO_Type
.
NGDoor_Tray_Check
).
Equals
(
IO_VALUE
.
HIGH
);
return
IOValue
(
IO_Type
.
NGDoor_Tray_Check
).
Equals
(
IO_VALUE
.
HIGH
);
}
}
}
}
private
int
GetWidth
()
private
int
GetWidth
()
{
{
if
(
IOManager
.
IOValue
(
IO_Type
.
WidthCheck_15
).
Equals
(
IO_VALUE
.
HIGH
))
if
(
ConfigHelper
.
Config
.
Get
(
"Device_IO_HasX20"
,
true
)
&&
IOManager
.
IOValue
(
IO_Type
.
WidthCheck_15
).
Equals
(
IO_VALUE
.
HIGH
))
{
{
return
15
;
return
15
;
}
}
...
...
DeviceLibrary/theMachine/MainMachine_String.cs
查看文件 @
2e627ea
...
@@ -79,6 +79,11 @@ namespace DeviceLibrary
...
@@ -79,6 +79,11 @@ namespace DeviceLibrary
bool
downCheck2
=
false
;
bool
downCheck2
=
false
;
bool
downCheck3
=
false
;
bool
downCheck3
=
false
;
int
ReelGetFail
=
0
;
int
ReelGetFail
=
0
;
/// <summary>
/// 出库下降对射触发位置高度
/// </summary>
int
LastOutDownPosition
=
0
;
void
StringProcess
()
void
StringProcess
()
{
{
if
(
CheckWait
(
StringMoveInfo
))
if
(
CheckWait
(
StringMoveInfo
))
...
@@ -159,6 +164,7 @@ namespace DeviceLibrary
...
@@ -159,6 +164,7 @@ namespace DeviceLibrary
break
;
break
;
case
MoveStep
.
StringLoad_04
:
case
MoveStep
.
StringLoad_04
:
StringMoveInfo
.
NextMoveStep
(
MoveStep
.
StringLoad_04b
);
StringMoveInfo
.
NextMoveStep
(
MoveStep
.
StringLoad_04b
);
LastOutDownPosition
=
Batch_Axis
.
GetAclPosition
();
if
(
LastStringState
==
StringStateE
.
OutStore
)
if
(
LastStringState
==
StringStateE
.
OutStore
)
{
{
StringMoveInfo
.
log
(
$
"恢复上次料串信息为出库料串"
);
StringMoveInfo
.
log
(
$
"恢复上次料串信息为出库料串"
);
...
@@ -220,8 +226,8 @@ namespace DeviceLibrary
...
@@ -220,8 +226,8 @@ namespace DeviceLibrary
{
{
StringMoveInfo
.
NextMoveStep
(
MoveStep
.
StringReadyGet
);
StringMoveInfo
.
NextMoveStep
(
MoveStep
.
StringReadyGet
);
StringMoveInfo
.
log
(
$
"料串有盘上升5mm"
);
StringMoveInfo
.
log
(
$
"料串有盘上升5mm"
);
var
tpos
3
=
Batch_Axis
.
GetAclPosition
()
+
Config
.
Batch_PoToMM
*
(
Config
.
Batch_DetectDownMM
+
2
);
var
tpos
4
=
Batch_Axis
.
GetAclPosition
()
+
Config
.
Batch_PoToMM
*
(
Config
.
Batch_DetectDownMM
+
2
);
Batch_Axis
.
AbsMove
(
StringMoveInfo
,
tpos
3
,
Config
.
Batch_P1
);
Batch_Axis
.
AbsMove
(
StringMoveInfo
,
tpos
4
,
Config
.
Batch_P1
);
CylinderMove
(
StringMoveInfo
,
IO_Type
.
Clamping_Relax
,
IO_Type
.
Clamping_Work
,
IO_VALUE
.
LOW
);
CylinderMove
(
StringMoveInfo
,
IO_Type
.
Clamping_Relax
,
IO_Type
.
Clamping_Work
,
IO_VALUE
.
LOW
);
//OpenFlipDoor(StringMoveInfo);
//OpenFlipDoor(StringMoveInfo);
StringType
=
StringTypeE
.
In
;
StringType
=
StringTypeE
.
In
;
...
@@ -267,6 +273,13 @@ namespace DeviceLibrary
...
@@ -267,6 +273,13 @@ namespace DeviceLibrary
break
;
break
;
case
MoveStep
.
StringReelPut
:
case
MoveStep
.
StringReelPut
:
LastStringState
=
StringStateE
.
OutStore
;
LastStringState
=
StringStateE
.
OutStore
;
if
(
ConfigHelper
.
Config
.
Get
(
"Device_OutStoreStringReelCheck"
,
false
))
{
StringMoveInfo
.
NextMoveStep
(
MoveStep
.
StringReelPut_03
);
StringMoveInfo
.
log
(
$
"检测阻挡工作"
);
CylinderMove
(
StringMoveInfo
,
IO_Type
.
StringPosChecker_Home
,
IO_Type
.
StringPosChecker_Work
,
IO_VALUE
.
HIGH
);
return
;
}
var
tpos
=
Batch_Axis
.
GetAclPosition
()
-
Config
.
Batch_PoToMM
*
(
StringMoveInfo
.
MoveParam
.
PlateH
+
Config
.
Batch_OutPlateDownMM
);
var
tpos
=
Batch_Axis
.
GetAclPosition
()
-
Config
.
Batch_PoToMM
*
(
StringMoveInfo
.
MoveParam
.
PlateH
+
Config
.
Batch_OutPlateDownMM
);
if
(
tpos
<
0
)
if
(
tpos
<
0
)
tpos
=
0
;
tpos
=
0
;
...
@@ -303,7 +316,6 @@ namespace DeviceLibrary
...
@@ -303,7 +316,6 @@ namespace DeviceLibrary
break
;
break
;
case
MoveStep
.
StringReelPut_01
:
case
MoveStep
.
StringReelPut_01
:
StringMoveInfo
.
NextMoveStep
(
MoveStep
.
StringReelPut_02
);
StringMoveInfo
.
NextMoveStep
(
MoveStep
.
StringReelPut_02
);
StringMoveInfo
.
log
(
$
"检测阻挡工作"
);
StringMoveInfo
.
log
(
$
"检测阻挡工作"
);
CylinderMove
(
StringMoveInfo
,
IO_Type
.
StringPosChecker_Home
,
IO_Type
.
StringPosChecker_Work
,
IO_VALUE
.
HIGH
);
CylinderMove
(
StringMoveInfo
,
IO_Type
.
StringPosChecker_Home
,
IO_Type
.
StringPosChecker_Work
,
IO_VALUE
.
HIGH
);
break
;
break
;
...
@@ -312,6 +324,38 @@ namespace DeviceLibrary
...
@@ -312,6 +324,38 @@ namespace DeviceLibrary
StringMoveInfo
.
log
(
$
"批量轴到顶部检测点"
);
StringMoveInfo
.
log
(
$
"批量轴到顶部检测点"
);
BatchAxisToP2
(
StringMoveInfo
);
BatchAxisToP2
(
StringMoveInfo
);
break
;
break
;
case
MoveStep
.
StringReelPut_03
:
StringMoveInfo
.
NextMoveStep
(
MoveStep
.
StringReelPut_04
);
StringMoveInfo
.
log
(
$
"批量轴到顶部检测点"
);
BatchAxisToP2
(
StringMoveInfo
,
true
);
break
;
case
MoveStep
.
StringReelPut_04
:
StringMoveInfo
.
NextMoveStep
(
MoveStep
.
StringReelPut_05
);
var
heightcheck
=
(
LastOutDownPosition
-
Batch_Axis
.
GetAclPosition
())
/
Config
.
Batch_PoToMM
;
StringMoveInfo
.
log
(
$
"LastOutDownPosition={LastOutDownPosition},CurrentPosition={Batch_Axis.GetAclPosition()},heightcheck={heightcheck}"
);
if
(
heightcheck
<=
5
)
{
Msg
.
add
(
"出库时料盘未成功放入料串,请检查"
,
MsgLevel
.
alarm
);
RobotManage
.
UserPause
(
"出库时料盘未成功放入料串,请检查"
);
}
break
;
case
MoveStep
.
StringReelPut_05
:
LastOutDownPosition
=
Batch_Axis
.
GetAclPosition
();
var
tpos3
=
Batch_Axis
.
GetAclPosition
()
-
Config
.
Batch_PoToMM
*
Config
.
Batch_OutPlateDownMM
;
if
(
tpos3
<
0
)
tpos3
=
0
;
if
(
tpos3
>
Config
.
Batch_P1
)
{
StringMoveInfo
.
NextMoveStep
(
MoveStep
.
StringLoad_04b
);
}
else
{
StringMoveInfo
.
NextMoveStep
(
MoveStep
.
StringOut_01
);
StringState
=
StringStateE
.
Full
;
Batch_Axis
.
AbsMove
(
StringMoveInfo
,
Config
.
Batch_P1
,
Config
.
Batch_P1_speed
);
StringMoveInfo
.
log
(
$
"料串已满可以送出"
);
}
break
;
case
MoveStep
.
StringOut_01
:
case
MoveStep
.
StringOut_01
:
StringMoveInfo
.
NextMoveStep
(
MoveStep
.
StringOut_02
);
StringMoveInfo
.
NextMoveStep
(
MoveStep
.
StringOut_02
);
StringMoveInfo
.
log
(
$
"料串下降到P1点"
);
StringMoveInfo
.
log
(
$
"料串下降到P1点"
);
...
...
DeviceLibrary/theMachine/MoveStep.cs
查看文件 @
2e627ea
...
@@ -48,6 +48,9 @@ namespace DeviceLibrary
...
@@ -48,6 +48,9 @@ namespace DeviceLibrary
StringReelPut
,
StringReelPut
,
StringReelPut_01
,
StringReelPut_01
,
StringReelPut_02
,
StringReelPut_02
,
StringReelPut_03
,
StringReelPut_04
,
StringReelPut_05
,
StringOut_01
,
StringOut_01
,
StringOut_02
,
StringOut_02
,
StringOut_03
,
StringOut_03
,
...
@@ -77,6 +80,7 @@ namespace DeviceLibrary
...
@@ -77,6 +80,7 @@ namespace DeviceLibrary
NGOUT_03
,
NGOUT_03
,
NGOUT_04
,
NGOUT_04
,
NGOUT_05
,
NGOUT_05
,
NGOUT_06
,
SingleIn
,
SingleIn
,
SingleIn_01
,
SingleIn_01
,
SingleInReady
,
SingleInReady
,
...
...
LoadCVSLibrary/Config/Config.csv
查看文件 @
2e627ea
...
@@ -7,11 +7,13 @@ AXIS,,上料提升机构,Batch_Axis,4,HC,,40000,0,0,0,20000,0,10,700,0,0
...
@@ -7,11 +7,13 @@ AXIS,,上料提升机构,Batch_Axis,4,HC,,40000,0,0,0,20000,0,10,700,0,0
AXIS,,取料机构,Clamp_Axis,5,HC,,40000,0,0,0,30000,0,10,700,0,0
AXIS,,取料机构,Clamp_Axis,5,HC,,40000,0,0,0,30000,0,10,700,0,0
AXIS,,左翻转托盘,FlipDoor_L_Axis,6,HC,,40000,0,0,0,30000,0,10,700,0,0
AXIS,,左翻转托盘,FlipDoor_L_Axis,6,HC,,40000,0,0,0,30000,0,10,700,0,0
AXIS,,右翻转托盘,FlipDoor_R_Axis,7,HC,,40000,0,0,0,30000,0,10,700,0,0
AXIS,,右翻转托盘,FlipDoor_R_Axis,7,HC,,40000,0,0,0,30000,0,10,700,0,0
AXIS,,料串口折叠门,StringDoor_Axis,8,HC,,40000,0,0,0,30000,0,10,700,0,0
,,,,,,,,,,,,,,,,
,,,,,,,,,,,,,,,,
PRO,50,IO信号超时时间(秒),IOSingle_TimerOut,5,,,,,,,,,,,,
PRO,50,IO信号超时时间(秒),IOSingle_TimerOut,5,,,,,,,,,,,,
PRO,0,气压检测超时,AirCheckSeconds,5,,,,,,,,,,,,
PRO,0,气压检测超时,AirCheckSeconds,5,,,,,,,,,,,,
PRO,50,最后一盘料补充高度mm,LastTrayAddHeight,3,,,,,,,,,,,,
PRO,50,最后一盘料补充高度mm,LastTrayAddHeight,3,,,,,,,,,,,,
PRO,50,翻转托盘行程,FlipDoorLength,20000,,,20000,,,,,,,,,
PRO,50,翻转托盘行程,FlipDoorLength,20000,,,20000,,,,,,,,,
PRO,50,折叠门行程,StringDoorLength,700000,,,200000,,,,,,,,,
,,,,,,,,,,,,,,,,
,,,,,,,,,,,,,,,,
PRO,10,旋转机构待机点P1,Middle_P1,168460,,,50000,,,,,,,,,
PRO,10,旋转机构待机点P1,Middle_P1,168460,,,50000,,,,,,,,,
PRO,10,旋转机构单料口P2,Middle_P2,168460,,,50000,,,,,,,,,
PRO,10,旋转机构单料口P2,Middle_P2,168460,,,50000,,,,,,,,,
...
@@ -26,6 +28,8 @@ PRO,11,升降轴料串放料低点P4,UpDown_P5,659963,,,280000,,,,,,,,,
...
@@ -26,6 +28,8 @@ PRO,11,升降轴料串放料低点P4,UpDown_P5,659963,,,280000,,,,,,,,,
PRO,12,进出机构待机点P1,InOut_P1,0,,,500000,,,,,,,,,
PRO,12,进出机构待机点P1,InOut_P1,0,,,500000,,,,,,,,,
PRO,12,进出机构单料口P2,InOut_P2,234184,,,500000,,,,,,,,,
PRO,12,进出机构单料口P2,InOut_P2,234184,,,500000,,,,,,,,,
PRO,12,进出机构料串放料P3,InOut_P3,234184,,,500000,,,,,,,,,
PRO,12,进出机构料串放料P3,InOut_P3,234184,,,500000,,,,,,,,,
PRO,12,进出机构13/15寸料串放料P4,InOut_P4,234184,,,500000,,,,,,,,,
PRO,12,进出机构13/15寸单料口P5,InOut_P5,234184,,,500000,,,,,,,,,
,,,,,,,,,,,,,,,,
,,,,,,,,,,,,,,,,
PRO,13,压紧机构待机点P1,Comp_P1,12190,,,280000,,,,,,,,,
PRO,13,压紧机构待机点P1,Comp_P1,12190,,,280000,,,,,,,,,
PRO,13,压紧机构8mm盘压紧点P2,Comp_P2,46000,,,280000,,,,,,,,,
PRO,13,压紧机构8mm盘压紧点P2,Comp_P2,46000,,,280000,,,,,,,,,
...
@@ -102,3 +106,4 @@ DO,0,上料定位旋转气缸定位,StringPosChecker_Work,18,HC,Y18,,,,,,,,,,
...
@@ -102,3 +106,4 @@ DO,0,上料定位旋转气缸定位,StringPosChecker_Work,18,HC,Y18,,,,,,,,,,
DO,0,上料定位旋转气缸避让,StringPosChecker_Home,19,HC,Y19,,,,,,,,,,
DO,0,上料定位旋转气缸避让,StringPosChecker_Home,19,HC,Y19,,,,,,,,,,
DO,0,料口翻板旋转,ReelFlipDoor_Home,20,HC,Y20,,,,,,,,,,
DO,0,料口翻板旋转,ReelFlipDoor_Home,20,HC,Y20,,,,,,,,,,
DO,0,料口翻板水平,ReelFlipDoor_Work,21,HC,Y21,,,,,,,,,,
DO,0,料口翻板水平,ReelFlipDoor_Work,21,HC,Y21,,,,,,,,,,
DO,0,上料机构折叠门刹车解除,StringDoor_Axis_Break,22,HC,Y22,,,,,,,,,,
LoadCVSLibrary/storeConfig/config/IO_Type.cs
查看文件 @
2e627ea
...
@@ -244,6 +244,10 @@ namespace OnlineStore.LoadCSVLibrary
...
@@ -244,6 +244,10 @@ namespace OnlineStore.LoadCSVLibrary
/// DO,0,料口翻板水平,ReelFlipDoor_Work,21,HC,Y21,,,,,,,,,,
/// DO,0,料口翻板水平,ReelFlipDoor_Work,21,HC,Y21,,,,,,,,,,
/// </summary>
/// </summary>
public
static
string
ReelFlipDoor_Work
=
"ReelFlipDoor_Work"
;
public
static
string
ReelFlipDoor_Work
=
"ReelFlipDoor_Work"
;
/// <summary>
/// DO,0,上料机构折叠门刹车,ReelFlipDoor_Work,22,HC,Y22,,,,,,,,,,
/// </summary>
public
static
string
StringDoor_Axis_Break
=
"StringDoor_Axis_Break"
;
}
}
public
enum
IO_VALUE
public
enum
IO_VALUE
...
...
LoadCVSLibrary/storeConfig/config/Robot_Config.cs
查看文件 @
2e627ea
...
@@ -63,7 +63,7 @@ namespace OnlineStore.LoadCSVLibrary
...
@@ -63,7 +63,7 @@ namespace OnlineStore.LoadCSVLibrary
[
ConfigProAttribute
(
"FlipDoor_R_Axis"
,
false
)]
[
ConfigProAttribute
(
"FlipDoor_R_Axis"
,
false
)]
public
ConfigMoveAxis
FlipDoor_R_Axis
{
get
;
set
;
}
public
ConfigMoveAxis
FlipDoor_R_Axis
{
get
;
set
;
}
/// <summary>
/// <summary>
/// AXIS,,料串口折叠门,
FlipDoor_R_Axis,7
,HC,,40000,0,0,0,30000,0,10,700,0,0
/// AXIS,,料串口折叠门,
StringDoor_Axis,8
,HC,,40000,0,0,0,30000,0,10,700,0,0
/// </summary>
/// </summary>
[
ConfigProAttribute
(
"StringDoor_Axis"
,
false
)]
[
ConfigProAttribute
(
"StringDoor_Axis"
,
false
)]
public
ConfigMoveAxis
StringDoor_Axis
{
get
;
set
;
}
public
ConfigMoveAxis
StringDoor_Axis
{
get
;
set
;
}
...
@@ -222,7 +222,16 @@ namespace OnlineStore.LoadCSVLibrary
...
@@ -222,7 +222,16 @@ namespace OnlineStore.LoadCSVLibrary
public
int
Comp_PL_MM
{
get
;
set
;
}
public
int
Comp_PL_MM
{
get
;
set
;
}
/// <summary>
/// PRO,12,进出机构13/15寸料串放料P4,InOut_P4,234184,,,500000,,,,,,,,,
/// </summary>
[
ConfigProAttribute
(
"InOut_P4"
,
false
)]
public
int
InOut_P4
{
get
;
set
;
}
/// <summary>
/// PRO,12,进出机构13/15寸单料口P5,InOut_P5,234184,,,500000,,,,,,,,,
/// </summary>
[
ConfigProAttribute
(
"InOut_P5"
,
false
)]
public
int
InOut_P5
{
get
;
set
;
}
...
@@ -325,6 +334,16 @@ namespace OnlineStore.LoadCSVLibrary
...
@@ -325,6 +334,16 @@ namespace OnlineStore.LoadCSVLibrary
[
ConfigProAttribute
(
"Clamp_P3_speed"
)]
[
ConfigProAttribute
(
"Clamp_P3_speed"
)]
public
int
Clamp_P3_speed
{
get
;
set
;
}
public
int
Clamp_P3_speed
{
get
;
set
;
}
/// <summary>
/// PRO,12,进出机构13/15寸料串放料P4,InOut_P4,234184,,,500000,,,,,,,,,
/// </summary>
[
ConfigProAttribute
(
"InOut_P4_speed"
)]
public
int
InOut_P4_speed
{
get
;
set
;
}
/// <summary>
/// PRO,12,进出机构13/15寸单料口P5,InOut_P5,234184,,,500000,,,,,,,,,
/// </summary>
[
ConfigProAttribute
(
"InOut_P5_speed"
)]
public
int
InOut_P5_speed
{
get
;
set
;
}
/// <summary>
/// <summary>
/// PRO,50,翻转托盘行程,FlipDoorLength,20000,,,20000,,,,,,,,,
/// PRO,50,翻转托盘行程,FlipDoorLength,20000,,,20000,,,,,,,,,
...
...
TheMachine/AxisControl.Designer.cs
查看文件 @
2e627ea
...
@@ -59,7 +59,7 @@ namespace TheMachine
...
@@ -59,7 +59,7 @@ namespace TheMachine
this
.
configControl1
.
Config
=
null
;
this
.
configControl1
.
Config
=
null
;
this
.
configControl1
.
Location
=
new
System
.
Drawing
.
Point
(
568
,
3
);
this
.
configControl1
.
Location
=
new
System
.
Drawing
.
Point
(
568
,
3
);
this
.
configControl1
.
Name
=
"configControl1"
;
this
.
configControl1
.
Name
=
"configControl1"
;
this
.
configControl1
.
Size
=
new
System
.
Drawing
.
Size
(
647
,
553
);
this
.
configControl1
.
Size
=
new
System
.
Drawing
.
Size
(
647
,
688
);
this
.
configControl1
.
TabIndex
=
1
;
this
.
configControl1
.
TabIndex
=
1
;
this
.
configControl1
.
Tag
=
"not"
;
this
.
configControl1
.
Tag
=
"not"
;
//
//
...
...
TheMachine/Form1.cs
查看文件 @
2e627ea
...
@@ -290,6 +290,19 @@ namespace TheMachine
...
@@ -290,6 +290,19 @@ namespace TheMachine
pnl
.
Enabled
=
true
;
pnl
.
Enabled
=
true
;
if
(
state
)
if
(
state
)
{
{
CodeManager
.
LoadCamera
(
true
);
foreach
(
var
cameraName
in
CodeManager
.
hikNameList
)
{
try
{
Camera
.
_cam
.
CaptureOnImage
(
cameraName
,
out
Bitmap
bmp
,
true
);
LogUtil
.
error
(
$
"测试拍照:{cameraName}完成"
);
bmp
.
Dispose
();
}
catch
(
Exception
ex
)
{
LogUtil
.
error
(
$
"测试拍照错误:{cameraName}:"
+
ex
.
ToString
());
}
}
btn_run
.
Enabled
=
true
;
btn_run
.
Enabled
=
true
;
//btn_stop.Enabled = true;
//btn_stop.Enabled = true;
RobotManage
.
mainMachine
.
ProcessMsgEvent
+=
MainMachine_ProcessMsgEvent
;
RobotManage
.
mainMachine
.
ProcessMsgEvent
+=
MainMachine_ProcessMsgEvent
;
...
...
TheMachine/IOControls.Designer.cs
查看文件 @
2e627ea
此文件的差异被折叠,
点击展开。
TheMachine/IOControls.cs
查看文件 @
2e627ea
...
@@ -61,5 +61,17 @@ namespace TheMachine
...
@@ -61,5 +61,17 @@ namespace TheMachine
private
void
ioControl1_Load
(
object
sender
,
EventArgs
e
)
private
void
ioControl1_Load
(
object
sender
,
EventArgs
e
)
{
{
}
}
private
void
btn_stringdooropen_Click
(
object
sender
,
EventArgs
e
)
{
LogUtil
.
info
(
"手动控制:折叠门门打开"
);
RobotManage
.
mainMachine
.
StringDoorOpen
(
null
);
}
private
void
btn_stringdoorclose_Click
(
object
sender
,
EventArgs
e
)
{
LogUtil
.
info
(
"手动控制:折叠门门关闭"
);
RobotManage
.
mainMachine
.
StringDoorClose
(
null
);
}
}
}
}
}
TheMachine/LogControl.cs
查看文件 @
2e627ea
...
@@ -17,7 +17,7 @@ namespace TheMachine
...
@@ -17,7 +17,7 @@ namespace TheMachine
{
{
InitializeComponent
();
InitializeComponent
();
showLogProDelegate
=
new
ShowLogProDelegate
(
ShowLogPro
);
showLogProDelegate
=
new
ShowLogProDelegate
(
ShowLogPro
);
LogUtil
.
ShowLog
+=
LogUtil_ShowLog
;
//
LogUtil.ShowLog += LogUtil_ShowLog;
}
}
delegate
void
ShowLogProDelegate
(
string
msg
,
Color
color
);
delegate
void
ShowLogProDelegate
(
string
msg
,
Color
color
);
...
...
TheMachine/TheMachine.csproj
查看文件 @
2e627ea
...
@@ -52,6 +52,7 @@
...
@@ -52,6 +52,7 @@
<Reference Include="ConfigHelper">
<Reference Include="ConfigHelper">
<HintPath>..\..\ConfigHelper\ConfigHelper\bin\Debug\ConfigHelper.dll</HintPath>
<HintPath>..\..\ConfigHelper\ConfigHelper\bin\Debug\ConfigHelper.dll</HintPath>
</Reference>
</Reference>
<Reference Include="halcondotnet, Version=12.0.0.0, Culture=neutral, PublicKeyToken=4973bed59ddbf2b8" />
<Reference Include="log4net, Version=2.0.12.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a, processorArchitecture=MSIL">
<Reference Include="log4net, Version=2.0.12.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\增广夹爪\Rmaxis\bin\Debug\log4net.dll</HintPath>
<HintPath>..\..\增广夹爪\Rmaxis\bin\Debug\log4net.dll</HintPath>
...
...
TheMachine/positionTool/FrmPositionTool.cs
查看文件 @
2e627ea
...
@@ -308,6 +308,7 @@ namespace OnlineStore.ACSingleStore
...
@@ -308,6 +308,7 @@ namespace OnlineStore.ACSingleStore
private
void
FrmPositionTool_FormClosing
(
object
sender
,
FormClosingEventArgs
e
)
private
void
FrmPositionTool_FormClosing
(
object
sender
,
FormClosingEventArgs
e
)
{
{
LogUtil
.
ShowLog
-=
LogUtil_ShowLog
;
timer1
.
Stop
();
timer1
.
Stop
();
if
(
btnServoOff
.
Enabled
)
if
(
btnServoOff
.
Enabled
)
{
{
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论