Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
刘韬
/
MIMO
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit 49c10259
由
刘韬
编写于
2022-09-17 17:25:57 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
1
1 个父辈
58ba6080
隐藏空白字符变更
内嵌
并排
正在显示
9 个修改的文件
包含
60 行增加
和
39 行删除
DeviceLibrary/DeviceLibrary/AxisBean.cs
DeviceLibrary/DeviceLibrary/SocketScanner.cs
DeviceLibrary/theMachine/BoxTransport.cs
DeviceLibrary/theMachine/MainMachine.cs
DeviceLibrary/theMachine/MainMachine_Clamp.cs
DeviceLibrary/theMachine/MainMachine_String.cs
DeviceLibrary/theMachine/MoveStep.cs
DeviceLibrary/theMachine/RobotManage.cs
TheMachine/Form1.cs
DeviceLibrary/DeviceLibrary/AxisBean.cs
查看文件 @
49c1025
...
...
@@ -101,7 +101,8 @@ namespace DeviceLibrary
}
Config
.
TargetPosition
=
0
;
LogUtil
.
info
(
AxisName
+
"speed["
+
Config
.
HomeHighSpeed
+
"]开始原点返回"
);
MoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitAxis
(
Config
,
true
));
if
(
MoveInfo
!=
null
)
MoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitAxis
(
Config
,
true
));
var
HomeLowSpeed
=
Config
.
HomeLowSpeed
>
0
?
Config
.
HomeLowSpeed
:
Config
.
HomeHighSpeed
/
10
;
var
HomeAddSpeed
=
Config
.
HomeAddSpeed
>
0
?
Config
.
HomeAddSpeed
:
Config
.
HomeHighSpeed
*
5
;
...
...
DeviceLibrary/DeviceLibrary/SocketScanner.cs
查看文件 @
49c1025
...
...
@@ -74,7 +74,8 @@ namespace DeviceLibrary
}
while
(
socket
.
Client
.
Available
>
0
)
{
var
tmp
=
new
byte
[
200
];
socket
.
Client
.
Receive
(
tmp
);
var
l
=
socket
.
Client
.
Receive
(
tmp
);
LogUtil
.
error
(
"SocketScanner 读取到缓存区垃圾:"
+
Encoding
.
ASCII
.
GetString
(
tmp
,
0
,
l
));
}
var
bf
=
Encoding
.
ASCII
.
GetBytes
(
trigger
);
socket
.
Client
.
Send
(
bf
);
...
...
DeviceLibrary/theMachine/BoxTransport.cs
查看文件 @
49c1025
...
...
@@ -165,16 +165,17 @@ namespace DeviceLibrary
MoveInfo
.
log
(
$
"{storeMoveType}:进出轴到达取料点{From.InOut_P2}"
);
break
;
case
MoveStep
.
StoreTS06
:
RobotManage
.
CameraA
.
CameraGrabOne
(
RobotManage
.
CameraA
.
GetFixtureStateFilename
(
From
.
posid
,
WareCode
,
storeMoveType
,
FixtureState
.
FromIn
));
MoveInfo
.
NextMoveStep
(
MoveStep
.
StoreTS07
);
if
(
From
.
posid
==
BoxStorePosition
.
clamp
)
{
RobotManage
.
mainMachine
.
CylinderMove
(
MoveInfo
,
IO_Type
.
Clamping_Relax
,
IO_Type
.
Clamping_Work
,
IO_VALUE
.
LOW
);
}
Comp_Axis
.
AbsMove
(
MoveInfo
,
From
.
Comp_PL
,
Config
.
Comp_P2_speed
);
if
(
From
.
posid
==
BoxStorePosition
.
clamp
)
{
RobotManage
.
mainMachine
.
CylinderMove
(
MoveInfo
,
IO_Type
.
Clamping_Relax
,
IO_Type
.
Clamping_Work
,
IO_VALUE
.
LOW
);
}
break
;
case
MoveStep
.
StoreTS07
:
RobotManage
.
CameraA
.
CameraGrabOne
(
RobotManage
.
CameraA
.
GetFixtureStateFilename
(
From
.
posid
,
WareCode
,
storeMoveType
,
FixtureState
.
FromIn
));
MoveInfo
.
NextMoveStep
(
MoveStep
.
StoreTS08
);
UpDown_Axis
.
AbsMove
(
MoveInfo
,
From
.
UpDown_PH
,
Config
.
UpDown_P4_speed
);
Comp_Axis
.
AbsMove
(
MoveInfo
,
From
.
Comp_PL
,
Config
.
Comp_P2_speed
);
MoveInfo
.
log
(
$
"{storeMoveType}:上下轴到达取料高点"
);
break
;
case
MoveStep
.
StoreTS08
:
...
...
@@ -226,8 +227,8 @@ namespace DeviceLibrary
case
MoveStep
.
StoreFIX03
:
RobotManage
.
CameraA
.
CameraGrabOne
(
RobotManage
.
CameraA
.
GetFixtureStateFilename
(
To
.
posid
,
WareCode
,
storeMoveType
,
FixtureState
.
ToFix
));
MoveInfo
.
NextMoveStep
(
MoveStep
.
StoreFIX04
);
Comp_Axis
.
AbsMove
(
MoveInfo
,
Fix
.
Comp_PH
,
Config
.
Comp_P2_speed
);
UpDown_Axis
.
AbsMove
(
MoveInfo
,
Fix
.
UpDown_PL
,
Config
.
UpDown_P3_speed
);
Comp_Axis
.
AbsMove
(
MoveInfo
,
Fix
.
Comp_PH
,
Config
.
Comp_P2_speed
);
MoveInfo
.
log
(
$
"{storeMoveType}:压紧轴高点:{Fix.Comp_PH}"
);
MoveInfo
.
log
(
$
"{storeMoveType}:上下轴到达目的地低点:{Fix.UpDown_PL}"
);
break
;
...
...
@@ -278,9 +279,9 @@ namespace DeviceLibrary
break
;
case
MoveStep
.
StoreTS13
:
RobotManage
.
CameraA
.
CameraGrabOne
(
RobotManage
.
CameraA
.
GetFixtureStateFilename
(
To
.
posid
,
WareCode
,
storeMoveType
,
FixtureState
.
ToIn
));
MoveInfo
.
NextMoveStep
(
MoveStep
.
StoreTS14
);
Comp_Axis
.
AbsMove
(
MoveInfo
,
To
.
Comp_PH
,
Config
.
Comp_P2_speed
);
MoveInfo
.
NextMoveStep
(
MoveStep
.
StoreTS14
);
UpDown_Axis
.
AbsMove
(
MoveInfo
,
To
.
UpDown_PL
,
Config
.
UpDown_P3_speed
);
Comp_Axis
.
AbsMove
(
MoveInfo
,
To
.
Comp_PH
,
Config
.
Comp_P2_speed
);
MoveInfo
.
log
(
$
"{storeMoveType}:压紧轴压紧点:{To.Comp_PH}"
);
MoveInfo
.
log
(
$
"{storeMoveType}:上下轴到达目的地低点:{To.UpDown_PL}"
);
if
(
To
.
posid
==
BoxStorePosition
.
ngdoor
)
{
...
...
@@ -319,10 +320,11 @@ namespace DeviceLibrary
break
;
}
if
(
To
.
posid
==
BoxStorePosition
.
strings
)
UpDown_Axis
.
AbsMove
(
MoveInfo
,
Config
.
UpDown_P5
,
Config
.
UpDown_P1_speed
);
else
UpDown_Axis
.
AbsMove
(
MoveInfo
,
Config
.
UpDown_P2
,
Config
.
UpDown_P1_speed
);
//if (To.posid==BoxStorePosition.strings)
// UpDown_Axis.AbsMove(MoveInfo, Config.UpDown_P5, Config.UpDown_P1_speed);
//else
// UpDown_Axis.AbsMove(MoveInfo, Config.UpDown_P2, Config.UpDown_P1_speed);
UpDown_Axis
.
AbsMove
(
MoveInfo
,
Config
.
UpDown_P1
,
Config
.
UpDown_P1_speed
);
Middle_Axis
.
AbsMove
(
MoveInfo
,
Config
.
Middle_P1
,
Config
.
Middle_P1_speed
);
MoveInfo
.
log
(
$
"{storeMoveType}:上下轴,旋转返回待机点P1"
);
ErrMsgTxt
=
""
;
...
...
DeviceLibrary/theMachine/MainMachine.cs
查看文件 @
49c1025
...
...
@@ -296,7 +296,7 @@ namespace DeviceLibrary
ResetMoveInfo
.
NextMoveStep
(
MoveStep
.
H02_HomeReset
);
ResetMoveInfo
.
log
(
"进出轴,批量轴回原,料串检测杆退回避让端"
);
InOut_Axis
.
HomeMove
(
ResetMoveInfo
,
forceHome
);
Batch_Axis
.
HomeMove
(
ResetMoveInfo
,
forceHome
);
Batch_Axis
.
HomeMove
(
null
,
forceHome
);
SingleDoor
.
ToLow
(
ResetMoveInfo
);
break
;
case
MoveStep
.
H02_HomeReset
:
...
...
@@ -316,8 +316,7 @@ namespace DeviceLibrary
case
MoveStep
.
H04_HomeReset
:
ResetMoveInfo
.
NextMoveStep
(
MoveStep
.
H05_HomeReset
);
CylinderMove
(
ResetMoveInfo
,
IO_Type
.
ClampingDisc_Up
,
IO_Type
.
ClampingDisc_Down
,
IO_VALUE
.
LOW
);
//ResetMoveInfo.log("夹爪轴,P1待机点");
//ResetMoveInfo.WaitList.Add(WaitResultInfo.WaitTime(500));
Batch_Axis
.
HomeMove
(
ResetMoveInfo
,
forceHome
);
break
;
case
MoveStep
.
H05_HomeReset
:
ResetMoveInfo
.
NextMoveStep
(
MoveStep
.
H06_HomeReset
);
...
...
@@ -331,12 +330,19 @@ namespace DeviceLibrary
Comp_Axis
.
HomeMove
(
ResetMoveInfo
,
forceHome
);
break
;
case
MoveStep
.
H07_HomeReset
:
if
(
IOValue
(
IO_Type
.
TrayCheck_Fixture
).
Equals
(
IO_VALUE
.
HIGH
))
{
ResetMoveInfo
.
NextMoveStep
(
MoveStep
.
H12_HomeReset
);
ResetMoveInfo
.
log
(
"料叉上有料,送到NG口"
);
Middle_Axis
.
AbsMove
(
ResetMoveInfo
,
Config
.
Middle_P2
,
Config
.
Middle_P2_speed
);
UpDown_Axis
.
AbsMove
(
ResetMoveInfo
,
Config
.
UpDown_P3
,
Config
.
UpDown_P2_speed
);
}
else
if
(
IOValue
(
IO_Type
.
WidthCheck_7
).
Equals
(
IO_VALUE
.
HIGH
)
||
IOValue
(
IO_Type
.
WidthCheck_13
).
Equals
(
IO_VALUE
.
HIGH
)
)
{
ResetMoveInfo
.
NextMoveStep
(
MoveStep
.
H08_HomeReset
);
ResetMoveInfo
.
log
(
"夹爪上有料盘,送到NG口"
);
}
else
{
...
...
DeviceLibrary/theMachine/MainMachine_Clamp.cs
查看文件 @
49c1025
...
...
@@ -120,7 +120,10 @@ namespace DeviceLibrary
ClampMoveInfo
.
MoveParam
.
NgMsg
=
crc
.
GetString
(
L
.
not_detect_reel_height
,
"未检测到盘宽"
);
ClampMoveInfo
.
log
(
$
"未检测到盘宽"
);
ReelGetted
(
false
);
//RobotManage.UserPause("未检测到盘", true);
ClampMoveInfo
.
NextMoveStep
(
MoveStep
.
Wait
);
SingleDoor
.
ToHigh
(
ClampMoveInfo
);
Msg
.
add
(
ClampMoveInfo
.
MoveParam
.
NgMsg
,
MsgLevel
.
alarm
);
RobotManage
.
UserPause
(
"未检测到盘"
,
true
);
}
else
{
...
...
@@ -414,6 +417,7 @@ namespace DeviceLibrary
ScanTask
=
Task
.
Run
(
new
Func
<
List
<
CodeInfo
>>(()=>
{
IOMove
(
IO_Type
.
Camera_Led
,
IO_VALUE
.
HIGH
);
//Task.Delay(10).Wait();
List
<
CodeInfo
>
LastCodeList
;
...
...
@@ -425,8 +429,12 @@ namespace DeviceLibrary
}
else
{
IOMove
(
IO_Type
.
Device_Led
,
IO_VALUE
.
LOW
);
LastCodeList
=
CodeManager
.
CameraScan
(
CodeManager
.
hikNameList
);
IOMove
(
IO_Type
.
Device_Led
,
IO_VALUE
.
HIGH
);
}
return
LastCodeList
;
}));
}
...
...
DeviceLibrary/theMachine/MainMachine_String.cs
查看文件 @
49c1025
...
...
@@ -148,7 +148,7 @@ namespace DeviceLibrary
if
(
oldtestheight
||
newreel
)
{
StringMoveInfo
.
log
(
$
"批量轴到顶部检测点"
);
BatchAxisToP2
(
StringMoveInfo
);
BatchAxisToP2
(
StringMoveInfo
,
newreel
);
TestHeightTask
=
null
;
}
else
{
...
...
@@ -271,11 +271,16 @@ namespace DeviceLibrary
case
MoveStep
.
StringReelGetFail
:
StringMoveInfo
.
log
(
$
"料盘取走失败,料盘下降"
);
ReelGetFail
++;
StringMoveInfo
.
NextMoveStep
(
MoveStep
.
StringReelGet
);
StringMoveInfo
.
NextMoveStep
(
MoveStep
.
StringReelGet
Fail_02
);
var
tpos1
=
Batch_Axis
.
GetAclPosition
()
-
Config
.
Batch_PoToMM
*
20
;
if
(
tpos1
<
0
)
tpos1
=
0
;
Batch_Axis
.
AbsMove
(
StringMoveInfo
,
tpos1
,
Config
.
Batch_P1
);
Batch_Axis
.
AbsMove
(
StringMoveInfo
,
tpos1
,
Config
.
Batch_P1_speed
);
break
;
case
MoveStep
.
StringReelGetFail_02
:
StringMoveInfo
.
log
(
$
"料盘取走失败,重新上升"
);
StringMoveInfo
.
NextMoveStep
(
MoveStep
.
StringReelGet
);
BatchAxisToP2
(
StringMoveInfo
);
break
;
case
MoveStep
.
StringReadyPut
:
Msg
.
add
(
crc
.
GetString
(
L
.
string_ready_for_put
,
"料串放料准备就绪"
),
MsgLevel
.
info
);
...
...
@@ -393,23 +398,13 @@ namespace DeviceLibrary
int
StartMovePosition
=
0
;
void
BatchAxisToP2
(
MoveInfo
moveInfo
,
bool
isFirstMove
=
tru
e
)
void
BatchAxisToP2
(
MoveInfo
moveInfo
,
bool
isFirstMove
=
fals
e
)
{
int
targetP2
=
Config
.
Batch_P2
;
int
targetSpeed
=
Config
.
Batch_P2_speed
;
if
(
!
isFirstMove
)
if
(
isFirstMove
)
{
int
currPosition
=
Batch_Axis
.
GetAclPosition
();
if
(
currPosition
!=
-
1
)
{
//targetP2 = currPosition + Config.Right_Batch_ChangeValue * 80;
if
(
targetP2
>
Config
.
Batch_P2
)
{
targetP2
=
Config
.
Batch_P2
;
}
//moveInfo.log("BatchAxisToP2 目标P2: " + targetP2 + "(" + currPosition + ")");
}
//targetSpeed = Config.BatchAxis_P3Speed / 2;
targetSpeed
=
Config
.
Batch_P1_speed
;
}
moveInfo
.
log
(
"BatchAxisToP2 目标P2: "
+
targetP2
);
moveInfo
.
TimeOutSeconds
=
200
;
...
...
DeviceLibrary/theMachine/MoveStep.cs
查看文件 @
49c1025
...
...
@@ -43,6 +43,7 @@ namespace DeviceLibrary
StringReadyGet
,
StringReelGet
,
StringReelGetFail
,
StringReelGetFail_02
,
StringReadyPut
,
StringReelPut
,
StringReelPut_01
,
...
...
DeviceLibrary/theMachine/RobotManage.cs
查看文件 @
49c1025
...
...
@@ -26,7 +26,7 @@ namespace DeviceLibrary
public
static
event
LoadFinish
LoadFinishEvent
;
public
static
event
EventHandler
<
bool
>
UserPauseSet
;
public
static
bool
isRunning
=
false
;
public
static
volatile
bool
isRunning
=
false
;
public
static
Dictionary
<
string
,
ACStorePosition
>
allPositionMap
{
get
=>
CSVPositionReader
<
ACStorePosition
>.
allPositionMap
;
}
static
List
<
string
>
_positionNumList
=
null
;
...
...
TheMachine/Form1.cs
查看文件 @
49c1025
...
...
@@ -342,7 +342,12 @@ namespace TheMachine
{
Task
.
Run
(()=>
{
if
(!
RobotManage
.
isRunning
)
btn_run_Click
(
this
,
EventArgs
.
Empty
);
{
this
.
Invoke
((
EventHandler
)
delegate
{
btn_run_Click
(
this
,
EventArgs
.
Empty
);
});
}
});
}
...
...
@@ -350,8 +355,10 @@ namespace TheMachine
{
Task
.
Run
(()=>
{
if
(
RobotManage
.
isRunning
)
//btn_run_Click(this, EventArgs.Empty);
btn_stop_Click
(
this
,
EventArgs
.
Empty
);
this
.
Invoke
((
EventHandler
)
delegate
{
btn_stop_Click
(
this
,
EventArgs
.
Empty
);
});
});
}
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论