Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
刘韬
/
SO20242OutBound
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit 36a8cd24
由
LN
编写于
2023-04-25 15:41:57 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
1
1 个父辈
10e6ad23
显示空白字符变更
内嵌
并排
正在显示
21 个修改的文件
包含
510 行增加
和
383 行删除
Common/Setting_Init.cs
DeviceLibrary/DeviceLibrary/CodeManager.cs
DeviceLibrary/DeviceLibrary/HttpServer.cs
DeviceLibrary/DeviceLibrary/ReelParam.cs
DeviceLibrary/DeviceLibrary/ServerCommunication.cs
DeviceLibrary/theMachine/Common.cs
DeviceLibrary/theMachine/InReelBean.cs
DeviceLibrary/theMachine/LabelParam.cs
DeviceLibrary/theMachine/MainMachine _AutoInOutTest.cs
DeviceLibrary/theMachine/MainMachine _LedProcess.cs
DeviceLibrary/theMachine/MainMachine.cs
DeviceLibrary/theMachine/MainMachine_PutReel.cs
DeviceLibrary/theMachine/MoveStep.cs
DeviceLibrary/theMachine/OutShelfBean.cs
DeviceLibrary/theMachine/ReelTransport.cs
LoadCVSLibrary/Config/Config.csv
LoadCVSLibrary/Config/Magzine.csv
LoadCVSLibrary/storeConfig/config/Robot_Config.cs
TheMachine/TheMachine.csproj
TheMachine/UC/uc_boxdebug.cs
TheMachine/app.manifest
Common/Setting_Init.cs
查看文件 @
36a8cd2
...
...
@@ -20,7 +20,8 @@ namespace OnlineStore.Common
public
static
MyConfig
<
string
>
App_Title
=
"出库机构"
;
[
MyConfigComment
(
"服务器地址"
)]
public
static
MyConfig
<
string
>
Device_Server_Address
=
"http://192.168.1.243/smf-core"
;
public
static
MyConfig
<
string
>
Device_Server_Address
=
""
;
//public static MyConfig<string> Device_Server_Address = "http://192.168.1.243/smf-core";
[
MyConfigComment
(
"设备界面语言"
)]
public
static
MyConfig
<
string
>
Device_Default_Language
=
"zh-CN"
;
...
...
@@ -66,8 +67,9 @@ namespace OnlineStore.Common
public
static
MyConfig
<
bool
>
Runtime_IsInStore
;
public
static
MyConfig
<
string
>
Runtime_PosID
;
public
static
MyConfig
<
bool
>
Runtime_IsPutReel
;
public
static
MyConfig
<
string
>
Runtime_StartPosID
;
public
static
MyConfig
<
string
>
Runtime_TargetPosID
;
public
static
MyConfig
<
string
>
Runtime_WareCode
;
public
static
MyConfig
<
int
>
Runtime_PlateW
;
public
static
MyConfig
<
int
>
Runtime_PlateH
;
...
...
DeviceLibrary/DeviceLibrary/CodeManager.cs
查看文件 @
36a8cd2
...
...
@@ -253,7 +253,7 @@ namespace DeviceLibrary
}
else
{
bitmapfilename
=
SaveImageToFile
(
"
mimo
"
,
cameraName
,
bmp
);
bitmapfilename
=
SaveImageToFile
(
"
outBound
"
,
cameraName
,
bmp
);
}
LogUtil
.
info
(
" 【"
+
cameraName
+
"】"
+
" 扫码完成【"
+
FormUtil
.
GetSpanStr
(
DateTime
.
Now
-
startTime
)
+
"】 :"
+
r
);
}
...
...
@@ -325,9 +325,16 @@ namespace DeviceLibrary
{
Directory
.
CreateDirectory
(
dire
);
}
if
(!
canSavePic
(
dire
))
{
CodeManager
.
DeleteOldFiles
(
dire
,
7
);
}
if
(
canSavePic
(
dire
))
{
bitmap
.
Save
(
dire
+
iamgeName
,
ImageFormat
.
Bmp
);
//bitmap.Dispose();
LogUtil
.
info
(
deviceName
+
" 【"
+
cameraName
+
"】扫码完成,保存图片到【"
+
dire
+
iamgeName
+
"】成功"
);
}
}
catch
(
Exception
ex
)
...
...
@@ -399,5 +406,78 @@ namespace DeviceLibrary
return
""
;
}
}
//public static bool record = false;//是否保存结果图片
public
static
bool
canSavePic
(
string
path
=
""
)
{
if
(
path
==
""
)
{
path
=
"D:\\CameraDebug\\"
;
}
if
(!
Directory
.
Exists
(
path
))
{
Directory
.
CreateDirectory
(
path
);
}
string
volume
=
path
.
Substring
(
0
,
path
.
IndexOf
(
':'
));
long
freespace
=
GetHardDiskSpace
(
volume
);
int
zhao
=
(
int
)(
freespace
/
1024
);
if
(
zhao
<
5
)
{
LogUtil
.
error
(
volume
+
"盘剩余空间:"
+
freespace
+
"G, 不再保存识别图片"
);
return
false
;
}
return
true
;
}
private
static
long
GetHardDiskSpace
(
string
str_HardDiskName
)
{
long
totalSize
=
0
;
str_HardDiskName
=
str_HardDiskName
+
":\\"
;
System
.
IO
.
DriveInfo
[]
drives
=
System
.
IO
.
DriveInfo
.
GetDrives
();
foreach
(
System
.
IO
.
DriveInfo
drive
in
drives
)
{
if
(
drive
.
Name
==
str_HardDiskName
)
{
totalSize
=
drive
.
TotalFreeSpace
/
(
1024
*
1024
);
}
}
return
totalSize
;
}
/// <summary>
/// 删除文件夹strDir中nDays天以前的文件
/// </summary>
/// <param name="dir"></param>
/// <param name="days"></param>
static
void
DeleteOldFiles
(
string
path
=
""
,
int
days
=
7
)
{
if
(
path
==
""
)
{
path
=
"D:\\CameraDebug\\"
;
}
try
{
LogUtil
.
info
(
$
"DeleteOldFiles 开始删除文件夹[{path}][{days}]天前的文件"
);
if
(!
Directory
.
Exists
(
path
)
||
days
<
1
)
return
;
var
now
=
DateTime
.
Now
;
foreach
(
var
f
in
Directory
.
GetFileSystemEntries
(
path
).
Where
(
f
=>
File
.
Exists
(
f
)))
{
DateTime
createTime
=
File
.
GetCreationTime
(
f
);
var
elapsedTicks
=
now
.
Ticks
-
createTime
.
Ticks
;
var
elapsedSpan
=
new
TimeSpan
(
elapsedTicks
);
if
(
elapsedSpan
.
TotalDays
>
days
)
{
File
.
Delete
(
f
);
LogUtil
.
info
(
$
"DeleteOldFiles 删除文件: {f} "
);
}
}
}
catch
(
Exception
ex
)
{
LogUtil
.
error
(
$
"DeleteOldFiles {path} {days} error :"
+
ex
.
ToString
());
}
}
}
}
DeviceLibrary/DeviceLibrary/HttpServer.cs
查看文件 @
36a8cd2
...
...
@@ -144,7 +144,14 @@ namespace DeviceLibrary
}
return
-
1
;
}
/// <summary>
/// 放料到料架完成通知
/// </summary>
/// <param name="rfid"></param>
/// <param name="barcode"></param>
/// <param name="rfidLoc"></param>
/// <param name="robotIndex"></param>
/// <returns></returns>
public
static
ShelfTaskInfo
ShelfFinish
(
string
rfid
,
string
barcode
=
""
,
string
rfidLoc
=
""
,
string
robotIndex
=
"1"
)
{
ShelfTaskInfo
task
=
new
ShelfTaskInfo
();
...
...
@@ -193,7 +200,13 @@ namespace DeviceLibrary
return
task
;
}
/// <summary>
/// 根据条码获取位置
/// </summary>
/// <param name="barcode"></param>
/// <param name="currRFID"></param>
/// <param name="msg"></param>
/// <returns></returns>
public
static
TrayInfo
GetLocation
(
string
barcode
,
string
currRFID
,
out
string
msg
)
{
//getLocation这个接口传入barcode和rfid列表会分配料架
...
...
DeviceLibrary/DeviceLibrary/ReelParam.cs
查看文件 @
36a8cd2
...
...
@@ -74,25 +74,25 @@ public class ReelParam
/// 物料编码
/// </summary>
public
string
PN
{
get
;
set
;
}
/// <summary>
/// 数量
/// </summary>
public
int
QTY
{
get
;
set
;
}
=
0
;
/// <summary>
/// 厂家代码
/// </summary>
public
string
FC
{
get
;
set
;
}
/// <summary>
/// 唯一序列号
/// </summary>
public
string
RI
{
get
;
set
;
}
public
string
DC
{
get
;
set
;
}
/// <summary>
/// 批次号
/// </summary>
public
string
Batch
{
get
;
set
;
}
public
string
cid
{
get
;
set
;
}
public
string
SubCID
{
get
;
set
;
}
///
//
<summary>
///
//
数量
///
//
</summary>
//
public int QTY { get; set; } = 0;
///
//
<summary>
///
//
厂家代码
///
//
</summary>
//
public string FC { get; set; }
///
//
<summary>
///
//
唯一序列号
///
//
</summary>
//
public string RI { get; set; }
//
public string DC { get; set; }
///
//
<summary>
///
//
批次号
///
//
</summary>
//
public string Batch { get; set; }
//
public string cid { get; set; }
//
public string SubCID { get; set; }
...
...
@@ -145,18 +145,14 @@ public class ReelParam
if
(!
File
.
Exists
(
countfile
))
{
StreamWriter
sw1
=
new
StreamWriter
(
countfile
,
true
,
Encoding
.
GetEncoding
(
"GB2312"
));
sw1
.
WriteLine
(
$
"WareCode,S
N,PN
,Date,NgMsg"
);
sw1
.
WriteLine
(
$
"WareCode,S
tartPos,TargetPos,TargetOutShelf,TargetLoc
,Date,NgMsg"
);
sw1
.
Close
();
sw1
.
Dispose
();
}
try
{
var
sw
=
new
StreamWriter
(
countfile
,
true
,
Encoding
.
GetEncoding
(
"GB2312"
));
//var sw = File.Open(countfile, FileMode.Append, FileAccess.Write);
// string s = $"\r\n{ReeID},{PN},{PlateW}x{PlateH},{ReelDest},{NgMsg},{QTY},{WareCode}";
//var b = Encoding.GetEncoding("gb2312").GetBytes(s);
//sw.Write(b, 0, b.Length);
sw
.
WriteLine
(
$
"{WareCode},{RI},{PN},{datetime:yyyy/MM/dd HH:mm:ss},{NgMsg}"
);
sw
.
WriteLine
(
$
"{WareCode},{StartPos},{TargetPos},{TargetOutShelf},{TargetLoc},{datetime:yyyy/MM/dd HH:mm:ss},{NgMsg}"
);
sw
.
Close
();
sw
.
Dispose
();
}
...
...
DeviceLibrary/DeviceLibrary/ServerCommunication.cs
查看文件 @
36a8cd2
...
...
@@ -45,6 +45,7 @@ namespace DeviceLibrary
}
private
void
ServerConnectTimer_Elapsed
(
object
sender
,
System
.
Timers
.
ElapsedEventArgs
e
)
{
return
;
//if (!Monitor.TryEnter(serverConnectTimer))
//{
// LogUtil.error("ServerConnectTimer_Elapsed locked");
...
...
DeviceLibrary/theMachine/Common.cs
查看文件 @
36a8cd2
...
...
@@ -216,81 +216,81 @@ namespace DeviceLibrary
pnreglist
=
File
.
ReadAllLines
(
"config\\pn.list"
).
ToList
().
FindAll
((
s
)
=>
{
return
!
string
.
IsNullOrWhiteSpace
(
s
);
}).
ToArray
();
qtyreglist
=
File
.
ReadAllLines
(
"config\\qty.list"
).
ToList
().
FindAll
((
s
)
=>
{
return
!
string
.
IsNullOrWhiteSpace
(
s
);
}).
ToArray
();
}
public
static
bool
codeProcess
(
ReelParam
labelParam
,
out
string
debugmsg
)
{
if
(
pnreglist
==
null
)
LoadMatchList
();
debugmsg
=
""
;
List
<
CodeInfo
>
newcodeInfos
=
new
List
<
CodeInfo
>();
labelParam
.
PN
=
""
;
foreach
(
var
ci
in
labelParam
.
codeInfos
.
ToArray
())
{
//string[] pnreglist = new string[] {
// @"^P([1-9]\d+)$",
// @"^(\d+)$%Code 128",
// @"^([1-9]\d{7,9})$"
//};
foreach
(
var
qtyreg
in
pnreglist
)
{
var
partrules
=
qtyreg
.
Split
(
'%'
);
if
(
partrules
.
Length
==
2
)
{
if
(
ci
.
CodeType
!=
partrules
[
1
])
break
;
}
var
m
=
Regex
.
Match
(
ci
.
CodeStr
,
partrules
[
0
]);
if
(
m
.
Success
)
{
newcodeInfos
.
Add
(
ci
);
//labelParam.codeInfos.Remove(ci);
labelParam
.
PN
=
m
.
Groups
[
1
].
Value
;
debugmsg
+=
$
"匹配到PN:{labelParam.PN}\r\n命中规则:{qtyreg}\r\n"
;
break
;
}
}
if
(!
string
.
IsNullOrEmpty
(
labelParam
.
PN
))
break
;
}
labelParam
.
QTY
=
0
;
foreach
(
var
ci
in
labelParam
.
codeInfos
.
ToArray
())
{
//string[] qtyreglist = new string[] {
// @"Q(\d{3,5})[^\d]",
// @"^Q(\d{3,5})$",
// @"^\w+\.\d([1-9]+0+)[1-9]+\d*$",
// @"^.+?;.+?;.+?;(\d{3,5}?);.+?;.+?$",
// @"^QUANTITY:(\d*)",
// @"^(\d{6})\s",
// @"\(\w*\s+(\d+)[a-zA-Z]",
//};
foreach
(
var
qtyreg
in
qtyreglist
)
{
var
m
=
Regex
.
Match
(
ci
.
CodeStr
,
qtyreg
);
if
(
m
.
Success
)
{
newcodeInfos
.
Add
(
ci
);
//labelParam.codeInfos.Remove(ci);
labelParam
.
QTY
=
int
.
Parse
(
m
.
Groups
[
1
].
Value
);
debugmsg
+=
$
"匹配到QTY:{labelParam.QTY}\r\n命中规则:{qtyreg}\r\n"
;
break
;
}
}
if
(
labelParam
.
QTY
>
0
)
break
;
}
if
(
string
.
IsNullOrEmpty
(
labelParam
.
PN
)
||
labelParam
.
QTY
==
0
)
return
false
;
//labelParam.codeInfos = newcodeInfos;
labelParam
.
FC
=
"985022"
;
labelParam
.
RI
=
"AL"
+
DateTime
.
Now
.
ToString
(
"yyMMddHHmmssf"
);
labelParam
.
Batch
=
DateTime
.
Now
.
ToString
(
"MMdd"
);
labelParam
.
WareCode
=
labelParam
.
RI
;
LogUtil
.
info
(
$
"匹配成功:{labelParam.PN},{labelParam.QTY},{labelParam.RI}"
);
return
true
;
}
//
public static bool codeProcess(ReelParam labelParam,out string debugmsg) {
//
if (pnreglist == null)
//
LoadMatchList();
//
debugmsg = "";
//
List<CodeInfo> newcodeInfos = new List<CodeInfo>();
//
labelParam.PN = "";
//
foreach (var ci in labelParam.codeInfos.ToArray())
//
{
//
//string[] pnreglist = new string[] {
//
// @"^P([1-9]\d+)$",
//
// @"^(\d+)$%Code 128",
//
// @"^([1-9]\d{7,9})$"
//
//};
//
foreach (var qtyreg in pnreglist)
//
{
//
var partrules = qtyreg.Split('%');
//
if (partrules.Length == 2) {
//
if (ci.CodeType != partrules[1])
//
break;
//
}
//
var m = Regex.Match(ci.CodeStr, partrules[0]);
//
if (m.Success)
//
{
//
newcodeInfos.Add(ci);
//
//labelParam.codeInfos.Remove(ci);
//
labelParam.PN = m.Groups[1].Value;
//
debugmsg += $"匹配到PN:{labelParam.PN}\r\n命中规则:{qtyreg}\r\n";
//
break;
//
}
//
}
//
if (!string.IsNullOrEmpty(labelParam.PN))
//
break;
//
}
//
labelParam.QTY = 0;
//
foreach (var ci in labelParam.codeInfos.ToArray())
//
{
//
//string[] qtyreglist = new string[] {
//
// @"Q(\d{3,5})[^\d]",
//
// @"^Q(\d{3,5})$",
//
// @"^\w+\.\d([1-9]+0+)[1-9]+\d*$",
//
// @"^.+?;.+?;.+?;(\d{3,5}?);.+?;.+?$",
//
// @"^QUANTITY:(\d*)",
//
// @"^(\d{6})\s",
//
// @"\(\w*\s+(\d+)[a-zA-Z]",
//
//};
//
foreach (var qtyreg in qtyreglist)
//
{
//
var m = Regex.Match(ci.CodeStr, qtyreg);
//
if (m.Success)
//
{
//
newcodeInfos.Add(ci);
//
//labelParam.codeInfos.Remove(ci);
//
labelParam.QTY = int.Parse(m.Groups[1].Value);
//
debugmsg += $"匹配到QTY:{labelParam.QTY}\r\n命中规则:{qtyreg}\r\n";
//
break;
//
}
//
}
//
if (labelParam.QTY > 0)
//
break;
//
}
//
if (string.IsNullOrEmpty(labelParam.PN) || labelParam.QTY == 0)
//
return false;
//
//labelParam.codeInfos = newcodeInfos;
//
labelParam.FC = "985022";
//
labelParam.RI = "AL"+DateTime.Now.ToString("yyMMddHHmmssf");
//
labelParam.Batch = DateTime.Now.ToString("MMdd");
//
labelParam.WareCode = labelParam.RI;
//
LogUtil.info($"匹配成功:{labelParam.PN},{labelParam.QTY},{labelParam.RI}");
//
return true;
//
}
public
T
DeepClone
<
T
>(
T
_object
)
{
T
dstobject
;
...
...
DeviceLibrary/theMachine/InReelBean.cs
查看文件 @
36a8cd2
...
...
@@ -151,8 +151,21 @@ namespace DeviceLibrary
{
cameraName
=
Setting_Init
.
CameraScan_IN_1
;
}
LastCode
=
CodeManager
.
CameraScan
(
cameraName
.
ToList
());
MoveInfo
.
log
(
"扫码完成:"
);
//循环扫码,扫到条码才进入下一步
while
(
MoveInfo
.
MoveStep
.
Equals
(
MoveStep
.
IN02_ScanCode
))
{
LastCode
=
CodeManager
.
CameraScan
(
cameraName
.
ToList
());
if
(
LastCode
.
Count
>
0
)
{
MoveInfo
.
log
(
"扫码完成:"
+
CodeManager
.
ProcessCode
(
LastCode
));
}
else
{
SetWarnMsg
(
$
"{Name}: 扫码失败"
);
MoveInfo
.
errlog
(
"扫码失败 , 等待3秒后重新扫码"
);
Thread
.
Sleep
(
1000
);
}
}
});
}
catch
(
Exception
ex
)
...
...
DeviceLibrary/theMachine/LabelParam.cs
查看文件 @
36a8cd2
...
...
@@ -70,7 +70,7 @@ namespace DeviceLibrary
Reel
=
reel
.
clone
();
LogUtil
.
info
(
$
"BSP:{posid},Comp_PH:{Comp_PH}={Config.Comp_P2}-({BagHigh}-{70}+{Config.Comp_PH_MM})*{Config.Comp_PoToMM},Comp_PL:{Comp_PL}={ReelHeight},{JsonHelper.SerializeObject(this)}"
);
}
public
const
string
ngdoor
=
"单料口"
;
//
public const string ngdoor = "单料口";
public
static
BoxStorePosition
GetFixPos
(
Robot_Config
Config
,
ReelParam
reel
)
{
var
fixpos
=
"fix#"
+
reel
.
PlateW
.
ToString
();
...
...
DeviceLibrary/theMachine/MainMachine _AutoInOutTest.cs
查看文件 @
36a8cd2
...
...
@@ -242,7 +242,7 @@ namespace DeviceLibrary
case
MoveStep
.
A07_NextPos
:
if
(
boxTransport
.
IsComplateOrFree
)
{
AIOTMoveInfo
.
NextMoveStep
(
MoveStep
.
StoreIn08
);
AIOTMoveInfo
.
NextMoveStep
(
MoveStep
.
A8_WaitPosEnd
);
if
(
CurrentPosIndex
-
2
<
0
||
StopAutoInOut
)
{
AIOTMoveInfo
.
log
(
$
"A已达到最后一个库位:{CurrentPosIndex},或手动停止{StopAutoInOut},自动出入库停止,将料盘送至出口"
);
...
...
@@ -263,7 +263,7 @@ namespace DeviceLibrary
AIOTMoveInfo
.
log
(
$
"开始交替:【{ac1.PositionNum}】->【{ac2.PositionNum}】"
);
}
break
;
case
MoveStep
.
StoreIn08
:
case
MoveStep
.
A8_WaitPosEnd
:
if
(
boxTransport
.
IsComplateOrFree
)
{
AIOTMoveInfo
.
log
(
$
"料盘已到达目的地"
);
...
...
@@ -279,7 +279,7 @@ namespace DeviceLibrary
}
break
;
case
MoveStep
.
A10_LastPos
:
AIOTMoveInfo
.
NextMoveStep
(
MoveStep
.
StoreOut11
);
AIOTMoveInfo
.
NextMoveStep
(
MoveStep
.
A11_R1StartBack
);
CurrentPosIndex
--;
CurrStartPos
=
GetAutoStartPos
(
1
);
ACStorePosition
start1
=
RobotManage
.
allPositionMap
[
CurrStartPos
];
...
...
@@ -294,24 +294,24 @@ namespace DeviceLibrary
}
AIOTMoveInfo
.
log
(
$
"开始运送料盘【{ac.PositionNum}】->【{start1.PositionNum}】"
);
break
;
case
MoveStep
.
StoreOut11
:
case
MoveStep
.
A11_R1StartBack
:
if
(
boxTransport
.
IsPutOnOut
)
{
AIOTMoveInfo
.
NextMoveStep
(
MoveStep
.
StoreOut12
);
AIOTMoveInfo
.
NextMoveStep
(
MoveStep
.
A12_WR1End
);
AIOTMoveInfo
.
log
(
$
"料盘已到达目的地"
);
//AutoInOutTest = false;
}
break
;
case
MoveStep
.
StoreOut12
:
case
MoveStep
.
A12_WR1End
:
if
(
boxTransport
.
IsComplateOrFree
)
{
AIOTMoveInfo
.
NextMoveStep
(
MoveStep
.
StoreOut13
);
AIOTMoveInfo
.
NextMoveStep
(
MoveStep
.
A13_R1End
);
AIOTMoveInfo
.
log
(
$
"料盘已到取走"
);
//AutoInOutTest = false;
}
break
;
case
MoveStep
.
StoreOut13
:
AIOTMoveInfo
.
NextMoveStep
(
MoveStep
.
StoreOut15
);
case
MoveStep
.
A13_R1End
:
AIOTMoveInfo
.
NextMoveStep
(
MoveStep
.
A15_StartR2Back
);
CurrStartPos
=
GetAutoStartPos
(
2
);
ACStorePosition
start2
=
RobotManage
.
allPositionMap
[
CurrStartPos
];
ac
=
RobotManage
.
allPositionMap
.
Values
.
ToArray
()[
CurrentPosIndex
-
1
];
...
...
@@ -325,14 +325,14 @@ namespace DeviceLibrary
}
AIOTMoveInfo
.
log
(
$
"开始运送料盘【{ac.PositionNum}】->【{start2.PositionNum}】"
);
break
;
case
MoveStep
.
StoreOut15
:
case
MoveStep
.
A15_StartR2Back
:
if
(
boxTransport
.
IsPutOnOut
)
{
AIOTMoveInfo
.
log
(
$
"料盘已到达目的地"
);
AIOTMoveInfo
.
NextMoveStep
(
MoveStep
.
StoreOut16
);
AIOTMoveInfo
.
NextMoveStep
(
MoveStep
.
A15_R2End
);
}
break
;
case
MoveStep
.
StoreOut16
:
case
MoveStep
.
A15_R2End
:
if
(
boxTransport
.
IsComplateOrFree
)
{
AIOTMoveInfo
.
log
(
$
"料盘已取走"
);
...
...
DeviceLibrary/theMachine/MainMachine _LedProcess.cs
查看文件 @
36a8cd2
...
...
@@ -121,7 +121,6 @@ namespace DeviceLibrary
//回原 绿闪
if
(
runStatus
==
RunStatus
.
HomeReset
)
{
//RunningLed.LedState = LedState.blink;
ProcessLefCfg
(
MachineLedStateE
.
HomeReset
);
}
//正常 绿亮
...
...
@@ -131,15 +130,11 @@ namespace DeviceLibrary
//出入库 绿闪 黄闪
if
(
StoreMoveInfo
.
MoveStep
>
MoveStep
.
Wait
)
{
//RunningLed.LedState = LedState.blink;
//StandbyLed.LedState = LedState.blink;
ProcessLefCfg
(
MachineLedStateE
.
InOut
);
}
//系统暂停,说明书未定义, 绿闪, 红闪
if
(!
canRunning
||
UserPause
)
{
//RunningLed.LedState = LedState.blink;
//AlarmLed.LedState = LedState.blink;
ProcessLefCfg
(
MachineLedStateE
.
SystemPause
);
}
}
...
...
@@ -148,23 +143,13 @@ namespace DeviceLibrary
//系统停止时有报警, 红亮
if
(
hasAlarm
)
{
//RunningLed.LedState = LedState.off;
//StandbyLed.LedState = LedState.off;
//AlarmLed.LedState = LedState.on;
ProcessLefCfg
(
MachineLedStateE
.
AlarmStop
);
}
}
//系统运行时报警, 绿亮,红闪
if
(
runStatus
!=
RunStatus
.
Stop
&&
hasAlarm
)
{
//RunningLed.LedState = LedState.on;
//StandbyLed.LedState = LedState.off;
//AlarmLed.LedState = LedState.blink;
ProcessLefCfg
(
MachineLedStateE
.
Alarm
);
//if (UserPause) {
// RunningLed.LedState = LedState.blink;
// StandbyLed.LedState = LedState.blink;
//}
}
Led
.
LedGroup
.
ForEach
((
x
)
=>
{
x
.
run
();
});
}
...
...
DeviceLibrary/theMachine/MainMachine.cs
查看文件 @
36a8cd2
...
...
@@ -338,7 +338,7 @@ namespace DeviceLibrary
break
;
case
MoveStep
.
H03_HomeReset
:
ResetMoveInfo
.
NextMoveStep
(
MoveStep
.
H04_HomeReset
);
ResetMoveInfo
.
log
(
"旋转轴,升降轴,回原,料叉P1
待机点"
);
ResetMoveInfo
.
log
(
$
"旋转轴,升降轴,回原,进出轴到P1{Config.InOut_P1}
待机点"
);
InOut_Axis
.
AbsMove
(
ResetMoveInfo
,
Config
.
InOut_P1
,
Config
.
InOut_P1_speed
);
Middle_Axis
.
HomeMove
(
ResetMoveInfo
,
forceHome
);
UpDown_Axis
.
HomeMove
(
ResetMoveInfo
,
forceHome
);
...
...
@@ -348,7 +348,7 @@ namespace DeviceLibrary
break
;
case
MoveStep
.
H05_HomeReset
:
ResetMoveInfo
.
NextMoveStep
(
MoveStep
.
H06_HomeReset
);
ResetMoveInfo
.
log
(
"旋转轴,升降轴,到P1待机点
"
);
ResetMoveInfo
.
log
(
$
"旋转轴到P1{Config.Middle_P1},升降轴到P1{Config.UpDown_P1}
"
);
Middle_Axis
.
AbsMove
(
ResetMoveInfo
,
Config
.
Middle_P1
,
Config
.
Middle_P1_speed
);
UpDown_Axis
.
AbsMove
(
ResetMoveInfo
,
Config
.
UpDown_P1
,
Config
.
UpDown_P1_speed
);
break
;
...
...
@@ -359,7 +359,7 @@ namespace DeviceLibrary
break
;
case
MoveStep
.
H07_HomeReset
:
ResetMoveInfo
.
NextMoveStep
(
MoveStep
.
H08_HomeReset
);
ResetMoveInfo
.
log
(
"旋转轴,升降轴,到P2,压紧轴p1
"
);
ResetMoveInfo
.
log
(
$
" 压紧轴P1{Config.Comp_P1}
"
);
Comp_Axis
.
AbsMove
(
ResetMoveInfo
,
Config
.
Comp_P1
,
Config
.
Comp_P1_speed
);
break
;
case
MoveStep
.
H08_HomeReset
:
...
...
@@ -514,7 +514,7 @@ namespace DeviceLibrary
}
else
if
(
isInSuddenDown
)
{
//
Alarm(AlarmType.SuddenStop);
Alarm
(
AlarmType
.
SuddenStop
);
Msg
.
add
(
crc
.
GetString
(
L
.
in_suddenstop
,
"急停中"
),
MsgLevel
.
alarm
,
ErrInfo
.
SuddenStop
);
ButtenEvent
?.
Invoke
(
null
,
ErrInfo
.
SuddenStop
);
lastSafeCheckStatus
=
false
;
...
...
@@ -602,6 +602,13 @@ namespace DeviceLibrary
private
string
getNextNgPos
(
int
size
=
7
)
{
if
(
size
==
0
)
{
//默认返回7寸库位
size
=
7
;
}
string
ngType
=
"NG_"
+
size
;
List
<
string
>
allPosList
=
CSVPositionReader
<
ACStorePosition
>.
getPositionKeyList
();
List
<
string
>
leftNgPos
=
(
from
m
in
allPosList
where
m
.
StartsWith
(
ngType
)
select
m
).
ToList
();
...
...
@@ -702,18 +709,26 @@ namespace DeviceLibrary
{
if
(
obj
.
IsRightShelf
(
tray
,
out
targetPosName
))
{
//料架对应位置存在的话使用料架对应位置
string
pName
=
targetPosName
+
"_"
+
tray
.
realRFID
;
ACStorePosition
position
=
CSVPositionReader
<
ACStorePosition
>.
GetPositon
(
pName
);
if
(
position
==
null
)
{
//判断库位号是否存在
ACStorePosition
position
=
CSVPositionReader
<
ACStorePosition
>.
GetPositon
(
targetPosName
);
position
=
CSVPositionReader
<
ACStorePosition
>.
GetPositon
(
targetPosName
);
if
(
position
==
null
)
{
LogUtil
.
error
(
Name
+
" "
+
tray
.
ToStr
()
+
" 找到匹配料架,但未找到库位号:"
+
position
)
;
WarnMsg
=
tray
.
barcode
+
"未找到库位号:"
+
position
;
LogUtil
.
error
(
Name
+
" "
+
tray
.
ToStr
()
+
" 找到匹配料架,但未找到库位号:"
+
position
)
;
WarnMsg
=
tray
.
barcode
+
"未找到库位号:"
+
position
;
targetPosName
=
""
;
break
;
}
obj
.
StartPutReel
();
}
targetPosName
=
position
.
PositionNum
;
LogUtil
.
info
(
Name
+
" "
+
tray
.
ToStr
()
+
" 使用料架:"
+
targetPosName
+
",更改料架为忙碌状态,开始放料"
);
obj
.
StartPutReel
();
break
;
}
}
...
...
DeviceLibrary/theMachine/MainMachine_PutReel.cs
查看文件 @
36a8cd2
...
...
@@ -43,7 +43,7 @@ namespace DeviceLibrary
//NG门关上再放料
if
(
IOManager
.
IOValue
(
IO_Type
.
Left_NGDoor_Close_Check
).
Equals
(
IO_VALUE
.
HIGH
)
&&
IOManager
.
IOValue
(
IO_Type
.
Right_NGDoor_Close_Check
).
Equals
(
IO_VALUE
.
HIGH
))
{
string
ngPos
=
getNextNgPos
();
string
ngPos
=
getNextNgPos
(
tray
.
plateW
);
if
(
ngPos
==
""
)
{
//暂无NG空位
...
...
@@ -75,7 +75,7 @@ namespace DeviceLibrary
else
{
//暂无NG空位
Msg
.
add
(
"["
+
inReel
.
Name
+
"]
获取库位号失败
"
,
MsgLevel
.
warning
,
ErrInfo
.
Empty
);
Msg
.
add
(
"["
+
inReel
.
Name
+
"]
未找到匹配库位
"
,
MsgLevel
.
warning
,
ErrInfo
.
Empty
);
ProcessMsgEvent
?.
Invoke
(
Msg
.
get
());
}
}
...
...
DeviceLibrary/theMachine/MoveStep.cs
查看文件 @
36a8cd2
...
...
@@ -32,86 +32,86 @@ namespace DeviceLibrary
HEND_HomeReset
,
StringLoad_01
,
StringLoad_01a
,
StringLoad_02
,
StringLoad_02a
,
StringLoad_02b
,
StringLoad_03
,
StringLoad_04
,
StringLoad_05
,
StringLoad_06
,
StringLoad_07
,
StringReadyGet
,
StringReelGet
,
StringReelGetFail
,
StringReelGetFail_02
,
StringReadyPut
,
StringReelPut
,
StringReelPut_01
,
StringReelPut_02
,
StringReelPut_03
,
StringReelPut_04
,
StringOut_01
,
StringOut_02
,
StringOut_03
,
StringOut_Released
,
StringOut_05
,
StringOut_06
,
StringOut_07
,
//
StringLoad_01,
//
StringLoad_01a,
//
StringLoad_02,
//
StringLoad_02a,
//
StringLoad_02b,
//
StringLoad_03,
//
StringLoad_04,
//
StringLoad_05,
//
StringLoad_06,
//
StringLoad_07,
//
StringReadyGet,
//
StringReelGet,
//
StringReelGetFail,
//
StringReelGetFail_02,
//
StringReadyPut,
//
StringReelPut,
//
StringReelPut_01,
//
StringReelPut_02,
//
StringReelPut_03,
//
StringReelPut_04,
//
StringOut_01,
//
StringOut_02,
//
StringOut_03,
//
StringOut_Released,
//
StringOut_05,
//
StringOut_06,
//
StringOut_07,
ReelClamp_01
,
ReelClamp_02
,
ReelClamp_03
,
ReelClamp_04
,
ReelClamp_05
,
ReelClamp_WaitGaugeHeight
,
ReelClamp_GetHeight
,
ReelClamp_06
,
ReelClamp_07
,
ReelClamp_08
,
ReelClamp_09
,
ReelClamp_10
,
ReelClamp_11
,
InWaitServerCallback
,
WaitInStore
,
ReelTaked
,
NGOUT_00
,
NGOUT_01
,
NGOUT_02
,
NGOUT_03
,
NGOUT_04
,
NGOUT_05
,
NGOUT_06
,
NGOUT_07
,
NGOUT_08
,
NGOUT_09
,
NGOUT_10
,
NGOUT_11
,
SingleIn
,
SingleIn_01
,
SingleIn_02
,
SingleInReady
,
SingleInRun
,
SingleInRun_01
,
SingleInRun_02
,
SingleInRun_03
,
SingleInRun_04
,
SingleInRun_05
,
//
ReelClamp_01,
//
ReelClamp_02,
//
ReelClamp_03,
//
ReelClamp_04,
//
ReelClamp_05,
//
ReelClamp_WaitGaugeHeight,
//
ReelClamp_GetHeight,
//
ReelClamp_06,
//
ReelClamp_07,
//
ReelClamp_08,
//
ReelClamp_09,
//
ReelClamp_10,
//
ReelClamp_11,
//
InWaitServerCallback,
//
WaitInStore,
//
ReelTaked,
//
NGOUT_00,
//
NGOUT_01,
//
NGOUT_02,
//
NGOUT_03,
//
NGOUT_04,
//
NGOUT_05,
//
NGOUT_06,
//
NGOUT_07,
//
NGOUT_08,
//
NGOUT_09,
//
NGOUT_10,
//
NGOUT_11,
//
SingleIn,
//
SingleIn_01,
//
SingleIn_02,
//
SingleInReady,
//
SingleInRun,
//
SingleInRun_01,
//
SingleInRun_02,
//
SingleInRun_03,
//
SingleInRun_04,
//
SingleInRun_05,
OutBoxPutOn
,
Out01
,
Out02
,
Out03
,
Out04
,
Out05
,
Out06
,
Out07
,
Out08
,
Out09
,
Out10
,
Out11
,
OutReset
,
//
OutBoxPutOn,
//
Out01,
//
Out02,
//
Out03,
//
Out04,
//
Out05,
//
Out06,
//
Out07,
//
Out08,
//
Out09,
//
Out10,
//
Out11,
//
OutReset,
//放料,准备放料
PutReel01_Ready
,
...
...
@@ -124,56 +124,97 @@ namespace DeviceLibrary
//放料:放料全部结束
PutReel05_End
,
/// <summary>
/// 自动测试:等待放入料盘
/// </summary>
A01_WaitReel
,
A01_Ready
,
//入库
/// <summary>
/// 自动测试: 料盘已放入
/// </summary>
A01_Ready
,
/// <summary>
/// 自动测试: 开始放第一盘料
/// </summary>
A02_StartPutOne
,
/// <summary>
/// 自动测试: 等待第二盘料放入入口
/// </summary>
A03_WaitRee2
,
/// <summary>
/// 自动测试: 等待第一盘料放料完成
/// </summary>
A04_WaitOneComplate
,
/// <summary>
/// 自动测试: 开始放第二盘料
/// </summary>
A05_StartPutTwo
,
/// <summary>
/// 自动测试: 等待第二盘料完成
/// </summary>
A06_WaitTwoEnd
,
/// <summary>
/// 自动测试: 开始下一盘物料放料
/// </summary>
A07_NextPos
,
StoreIn08
,
StoreIn09
,
A10_LastPos
,
//出库
StoreOut_NGPre
,
StoreOut11
,
StoreOut12
,
StoreOut13
,
StoreOut14
,
StoreOut15
,
StoreOut16
,
/// <summary>
/// 自动测试: 等待放料完成
/// </summary>
A8_WaitPosEnd
,
/// <summary>
/// 自动测试: 到达最后一盘物料
/// </summary>
A10_LastPos
,
/// <summary>
/// 自动测试: 开始将料盘放回入口
/// </summary>
A11_R1StartBack
,
/// <summary>
/// 自动测试: 等待料盘1返回入口
/// </summary>
A12_WR1End
,
/// <summary>
/// 自动测试:料盘1返回入口完成
/// </summary>
A13_R1End
,
/// <summary>
/// 自动测试:开始第二盘料返回入口
/// </summary>
A15_StartR2Back
,
/// <summary>
/// 自动测试:第二盘料放回入口完成
/// </summary>
A15_R2End
,
StoreOut17
,
StoreOut18
,
StoreOut_WaitMT
,
StoreTS01
,
StoreTS02
,
StoreTS03
,
StoreTS04
,
StoreTS05
,
StoreTS06
,
StoreTS07
,
StoreTS08
,
StoreTS09
,
StoreFIX01
,
StoreFIX02
,
StoreFIX03
,
StoreFIX04
,
StoreFIX05
,
StoreTS10
,
StoreTS11
,
StoreTS12
,
StoreTS13
,
StoreTS14
,
StoreTS15
,
StoreTS16
,
StoreTS17
,
StoreTS_WaitOutProcess
,
StoreTS_Continue
,
TS01
,
TS02_Check
,
TS03_InoutTP1
,
TS04_TSPos
,
TS06_InoutTP2
,
TS08_GetReel
,
TS09_InoutTP1
,
TS10_IOCheck
,
TS11_ToTPos
,
TS13_InoutTP2
,
TS14_PutReel
,
TS15_InoutTP1
,
TS16_Check
,
TS17_AxisBack
,
TS_WaitOutProcess
,
TS_Continue
,
//复位:定位气缸下降
SR01_LocationDown
,
//出料口:AGV检测到小车
S01_AgvDetect
,
//电机正传
...
...
@@ -209,20 +250,25 @@ namespace DeviceLibrary
S28_WaitTime
,
//料盘:等待信号检测
/// <summary>
/// 料盘:等待信号检测
/// </summary>
IN01_WaitCheck
,
//料盘:扫码
/// <summary>
/// 料盘:扫码
/// </summary>
IN02_ScanCode
,
//料盘:获取库位号
/// <summary>
/// 料盘:获取库位号
/// </summary>
IN03_GetPos
,
//
料盘:料盘已准备好,等待取料
/// <summary>
/// 料盘:料盘已准备好,等待取料
//
/ </summary>
IN05_ReelReady
,
//料盘:料盘已拿走
/// <summary>
/// 料盘:料盘已拿走
/// </summary>
IN06_ReelLeave
,
}
...
...
DeviceLibrary/theMachine/OutShelfBean.cs
查看文件 @
36a8cd2
...
...
@@ -386,19 +386,14 @@ namespace DeviceLibrary
#
region
IO
操作
//agv小车检测
private
string
Agv_Detect
=
"Agv_Detect"
;
//出料口前端料格检测
private
string
Shelf_Front_Check
=
"Shelf_Front_Check"
;
//出料口后端料格检测
private
string
Shelf_Back_Check
=
"Shelf_Back_Check"
;
//出料口定位上升端
private
string
Location_Up
=
"Location_Up"
;
//出料口定位下降端,
private
string
Location_Down
=
"Location_Down"
;
//电机正传
private
static
string
Moto_Fwd
=
"Moto_Fwd"
;
//电机反转
...
...
DeviceLibrary/theMachine/ReelTransport.cs
查看文件 @
36a8cd2
using
OnlineStore
;
using
OnlineStore.Common
;
using
OnlineStore.LoadCSVLibrary
;
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Text
;
using
System.Threading
;
using
System.Threading.Tasks
;
namespace
DeviceLibrary
{
...
...
@@ -17,7 +11,6 @@ namespace DeviceLibrary
public
BoxStorePosition
To
;
BoxStorePosition
Fix
;
MainMachine
mainMachine
;
//using static mainMachine;
AxisBean
Middle_Axis
;
AxisBean
UpDown_Axis
;
AxisBean
InOut_Axis
;
...
...
@@ -29,15 +22,15 @@ namespace DeviceLibrary
public
event
Action
<
string
,
StoreMoveType
,
bool
>
InOutEndProcessEvent
;
public
bool
IsComplateOrFree
{
get
=>
MoveInfo
.
MoveStep
==
MoveStep
.
Wait
&&
!
movelock
;
}
public
bool
IsTakedReel
{
get
=>
MoveInfo
.
MoveStep
>=
MoveStep
.
StoreTS10
;
}
public
bool
IsPutOnOut
{
get
=>
MoveInfo
.
MoveStep
>=
MoveStep
.
StoreTS16
;
}
public
bool
IsTakedReel
{
get
=>
MoveInfo
.
MoveStep
>=
MoveStep
.
TS10_IOCheck
;
}
public
bool
IsPutOnOut
{
get
=>
MoveInfo
.
MoveStep
>=
MoveStep
.
TS16_Check
;
}
public
ReelTransport
(
Robot_Config
_Config
,
MainMachine
_mainMachine
)
{
Config
=
_Config
;
mainMachine
=
_mainMachine
;
MoveInfo
=
new
MoveInfo
(
crc
.
GetString
(
"Res0123"
,
"
出入库轴
"
),
false
);
MoveInfo
=
new
MoveInfo
(
crc
.
GetString
(
"Res0123"
,
"
取放料机构
"
),
false
);
To
=
null
;
From
=
null
;
#
region
初始化伺服轴
...
...
@@ -74,7 +67,7 @@ namespace DeviceLibrary
WareCode
=
"NG"
;
plateH
=
56
;
To
=
to
.
clone
();
MoveInfo
.
NewMove
(
MoveStep
.
StoreTS10
);
MoveInfo
.
NewMove
(
MoveStep
.
TS10_IOCheck
);
MoveInfo
.
log
(
$
"{storeMoveType}:开始运输料盘,直接到:{to.posid}"
);
MoveInfo
.
MoveParam
.
TargetPos
=
$
"NA=>{To.posid}"
;
}
...
...
@@ -85,29 +78,18 @@ namespace DeviceLibrary
From
=
from
.
clone
();
To
=
to
.
clone
();
MoveInfo
.
NewMove
(
MoveStep
.
Store
TS01
);
MoveInfo
.
NewMove
(
MoveStep
.
TS01
);
MoveInfo
.
log
(
$
"{storeMoveType}:开始运输料盘,从:{from.posid},到:{to.posid}"
);
MoveInfo
.
MoveParam
.
TargetPos
=
$
"{From.posid}=>{To.posid}"
;
MoveInfo
.
MoveParam
.
ReelOnFixture
=
From
.
Reel
.
ReelOnFixture
;
}
if
(
To
.
posid
==
BoxStorePosition
.
ngdoor
)
{
Fix
=
BoxStorePosition
.
GetFixPos
(
Config
,
To
.
Reel
);
}
MoveInfo
.
MoveParam
.
WareCode
=
WareCode
;
ErrMsgTxt
=
""
;
return
true
;
}
public
bool
ReadyToTakeBox
()
{
if
(
MoveInfo
.
MoveStep
!=
MoveStep
.
StoreTS05
)
return
false
;
MoveInfo
.
NextMoveStep
(
MoveStep
.
StoreTS06
);
return
true
;
}
bool
pause
=
false
;
public
void
Pause
()
{
...
...
@@ -128,7 +110,7 @@ namespace DeviceLibrary
{
case
MoveStep
.
Wait
:
break
;
case
MoveStep
.
Store
TS01
:
case
MoveStep
.
TS01
:
if
(!
IgnoreX09
&&
!
MoveInfo
.
MoveParam
.
ReelOnFixture
&&
IOManager
.
IOValue
(
IO_Type
.
TrayCheck_Fixture
,
Config
).
Equals
(
IO_VALUE
.
HIGH
))
{
if
(!
IgnoreX09
&&
IOMonitor
.
IODebound
(
IO_Type
.
TrayCheck_Fixture
,
Config
,
IO_VALUE
.
HIGH
,
5000
))
...
...
@@ -138,62 +120,51 @@ namespace DeviceLibrary
{
Msg
.
add
(
""
,
MsgLevel
.
info
,
ErrInfo
.
X09_Clear
);
IgnoreX09
=
false
;
MoveInfo
.
NextMoveStep
(
MoveStep
.
StoreTS02
);
MoveInfo
.
NextMoveStep
(
MoveStep
.
TS02_Check
);
MoveInfo
.
log
(
$
"{storeMoveType}:检查安全状态"
);
}
break
;
case
MoveStep
.
StoreTS02
:
case
MoveStep
.
TS02_Check
:
if
(
MoveInfo
.
MoveParam
.
ReelOnFixture
)
{
MoveInfo
.
NextMoveStep
(
MoveStep
.
StoreTS08
);
MoveInfo
.
NextMoveStep
(
MoveStep
.
TS08_GetReel
);
MoveInfo
.
log
(
$
"{storeMoveType}:料盘已在料叉上,压紧轴压紧,Comp_PL:{From.Comp_PL}"
);
Comp_Axis
.
AbsMove
(
MoveInfo
,
From
.
Comp_PL
,
Config
.
Comp_P2_speed
);
}
else
{
MoveInfo
.
NextMoveStep
(
MoveStep
.
StoreTS03
);
MoveInfo
.
NextMoveStep
(
MoveStep
.
TS03_InoutTP1
);
InOut_Axis
.
AbsMove
(
MoveInfo
,
Config
.
InOut_P1
,
Config
.
InOut_P1_speed
);
Comp_Axis
.
AbsMove
(
MoveInfo
,
From
.
Comp_PH
,
Config
.
Comp_P2_speed
);
MoveInfo
.
log
(
$
"{storeMoveType}:进出轴返回待机点P1"
);
MoveInfo
.
log
(
$
"{storeMoveType}:进出轴返回待机点P1
{Config.InOut_P1},压紧轴到高点{From.Comp_PH}
"
);
}
break
;
case
MoveStep
.
StoreTS03
:
MoveInfo
.
NextMoveStep
(
MoveStep
.
StoreTS04
);
case
MoveStep
.
TS03_InoutTP1
:
MoveInfo
.
NextMoveStep
(
MoveStep
.
TS04_TSPos
);
UpDown_Axis
.
AbsMove
(
MoveInfo
,
From
.
UpDown_PL
,
Config
.
UpDown_P1_speed
);
MoveInfo
.
log
(
$
"{storeMoveType}:上下轴到达取料低点{From.UpDown_PL}"
);
Middle_Axis
.
AbsMove
(
MoveInfo
,
From
.
Middle_P2
,
Config
.
Middle_P1_speed
);
MoveInfo
.
log
(
$
"{storeMoveType}:
行走轴到达
取料点{From.Middle_P2}"
);
MoveInfo
.
log
(
$
"{storeMoveType}:
升降轴到取料低点{From.UpDown_PL},旋转轴到
取料点{From.Middle_P2}"
);
break
;
case
MoveStep
.
StoreTS04
:
if
(
From
.
posid
==
BoxStorePosition
.
ngdoor
)
{
case
MoveStep
.
TS04_TSPos
:
}
else
MoveInfo
.
NextMoveStep
(
MoveStep
.
StoreTS05
);
break
;
case
MoveStep
.
StoreTS05
:
MoveInfo
.
NextMoveStep
(
MoveStep
.
StoreTS06
);
MoveInfo
.
NextMoveStep
(
MoveStep
.
TS06_InoutTP2
);
InOut_Axis
.
AbsMove
(
MoveInfo
,
From
.
InOut_P2
,
Config
.
InOut_P1_speed
);
MoveInfo
.
log
(
$
"{storeMoveType}:进出轴到
达取料点
{From.InOut_P2}"
);
MoveInfo
.
log
(
$
"{storeMoveType}:进出轴到
取料点P2
{From.InOut_P2}"
);
break
;
case
MoveStep
.
StoreTS06
:
MoveInfo
.
NextMoveStep
(
MoveStep
.
StoreTS07
);
break
;
case
MoveStep
.
StoreTS07
:
case
MoveStep
.
TS06_InoutTP2
:
RobotManage
.
CameraA
.
CameraGrabOne
(
RobotManage
.
CameraA
.
GetFixtureStateFilename
(
From
.
posid
,
WareCode
,
storeMoveType
,
FixtureState
.
FromIn
));
MoveInfo
.
NextMoveStep
(
MoveStep
.
StoreTS08
);
MoveInfo
.
NextMoveStep
(
MoveStep
.
TS08_GetReel
);
UpDown_Axis
.
AbsMove
(
MoveInfo
,
From
.
UpDown_PH
,
Config
.
UpDown_P1_speed
);
Comp_Axis
.
AbsMove
(
MoveInfo
,
From
.
Comp_PL
,
Config
.
Comp_P2_speed
);
MoveInfo
.
log
(
$
"{storeMoveType}:
上下轴到达取料高点
"
);
MoveInfo
.
log
(
$
"{storeMoveType}:
升降轴到取料高点{From.UpDown_PH},压紧轴到低点{From.Comp_PL}
"
);
break
;
case
MoveStep
.
StoreTS08
:
MoveInfo
.
NextMoveStep
(
MoveStep
.
StoreTS09
);
MoveInfo
.
log
(
$
"{storeMoveType}:进出轴到
达待机点
"
);
case
MoveStep
.
TS08_GetReel
:
MoveInfo
.
NextMoveStep
(
MoveStep
.
TS09_InoutTP1
);
MoveInfo
.
log
(
$
"{storeMoveType}:进出轴到
待机点P1{Config.InOut_P1}
"
);
InOut_Axis
.
AbsMove
(
MoveInfo
,
Config
.
InOut_P1
,
Config
.
InOut_P1_speed
);
IgnoreX09
=
false
;
break
;
case
MoveStep
.
StoreTS09
:
case
MoveStep
.
TS09_InoutTP1
:
RobotManage
.
CameraA
.
CameraGrabOne
(
RobotManage
.
CameraA
.
GetFixtureStateFilename
(
From
.
posid
,
WareCode
,
storeMoveType
,
FixtureState
.
FromOut
));
if
(!
IgnoreX09
&&
IOManager
.
IOValue
(
IO_Type
.
TrayCheck_Fixture
,
Config
).
Equals
(
IO_VALUE
.
LOW
))
{
...
...
@@ -203,44 +174,36 @@ namespace DeviceLibrary
{
Msg
.
add
(
""
,
MsgLevel
.
info
,
ErrInfo
.
X09_Clear
);
IgnoreX09
=
false
;
MoveInfo
.
NextMoveStep
(
MoveStep
.
StoreTS10
)
;
MoveInfo
.
NextMoveStep
(
MoveStep
.
TS10_IOCheck
)
;
MoveInfo
.
log
(
$
"{storeMoveType}:TrayCheck_Fixture取到料"
);
InOutEndProcess
(
StoreMoveType
.
OutStore
,
From
.
posid
);
}
break
;
case
MoveStep
.
StoreTS10
:
MoveInfo
.
NextMoveStep
(
MoveStep
.
StoreTS11
);
case
MoveStep
.
TS10_IOCheck
:
MoveInfo
.
NextMoveStep
(
MoveStep
.
TS11_ToTPos
);
Middle_Axis
.
AbsMove
(
MoveInfo
,
To
.
Middle_P2
,
Config
.
Middle_P1_speed
);
MoveInfo
.
log
(
$
"{storeMoveType}
:行走轴到达目的地:{To.Middle_P2}
"
);
MoveInfo
.
log
(
$
"{storeMoveType}"
);
UpDown_Axis
.
AbsMove
(
MoveInfo
,
To
.
UpDown_PH
,
Config
.
UpDown_P1_speed
);
MoveInfo
.
log
(
$
"{storeMoveType}:上下轴到达目的地高点:{To.UpDown_PH}"
);
break
;
case
MoveStep
.
StoreTS11
:
if
(
To
.
posid
==
BoxStorePosition
.
ngdoor
)
{
}
MoveInfo
.
NextMoveStep
(
MoveStep
.
StoreTS12
);
MoveInfo
.
log
(
$
"{storeMoveType}::旋转轴到目的地P2{To.Middle_P2}升降轴到目的地高点:{To.UpDown_PH}"
);
break
;
case
MoveStep
.
StoreTS12
:
MoveInfo
.
NextMoveStep
(
MoveStep
.
StoreTS13
);
MoveInfo
.
log
(
$
"{storeMoveType}:进出轴到
达目的地
"
);
case
MoveStep
.
TS11_ToTPos
:
MoveInfo
.
NextMoveStep
(
MoveStep
.
TS13_InoutTP2
);
MoveInfo
.
log
(
$
"{storeMoveType}:进出轴到
P2{To.InOut_P2}
"
);
InOut_Axis
.
AbsMove
(
MoveInfo
,
To
.
InOut_P2
,
Config
.
InOut_P1_speed
);
break
;
case
MoveStep
.
StoreTS13
:
case
MoveStep
.
TS13_InoutTP2
:
RobotManage
.
CameraA
.
CameraGrabOne
(
RobotManage
.
CameraA
.
GetFixtureStateFilename
(
To
.
posid
,
WareCode
,
storeMoveType
,
FixtureState
.
ToIn
));
MoveInfo
.
NextMoveStep
(
MoveStep
.
StoreTS14
);
MoveInfo
.
NextMoveStep
(
MoveStep
.
TS14_PutReel
);
Comp_Axis
.
AbsMove
(
MoveInfo
,
To
.
Comp_PH
,
Config
.
Comp_P2_speed
);
UpDown_Axis
.
AbsMove
(
MoveInfo
,
To
.
UpDown_PL
,
Config
.
UpDown_S1_Speed
);
MoveInfo
.
log
(
$
"{storeMoveType}:压紧轴压紧点:{To.Comp_PH}"
);
MoveInfo
.
log
(
$
"{storeMoveType}:上下轴到达目的地低点:{To.UpDown_PL}"
);
MoveInfo
.
log
(
$
"{storeMoveType}:压紧轴到压紧前点:{To.Comp_PH},升降轴到目的地低点:{To.UpDown_PL}"
);
break
;
case
MoveStep
.
StoreTS14
:
MoveInfo
.
NextMoveStep
(
MoveStep
.
StoreTS15
);
case
MoveStep
.
TS14_PutReel
:
MoveInfo
.
NextMoveStep
(
MoveStep
.
TS15_InoutTP1
);
InOut_Axis
.
AbsMove
(
MoveInfo
,
Config
.
InOut_P1
,
Config
.
InOut_P1_speed
);
MoveInfo
.
log
(
$
"{storeMoveType}:进出轴到达待机点"
);
break
;
case
MoveStep
.
StoreTS15
:
case
MoveStep
.
TS15_InoutTP1
:
RobotManage
.
CameraA
.
CameraGrabOne
(
RobotManage
.
CameraA
.
GetFixtureStateFilename
(
To
.
posid
,
WareCode
,
storeMoveType
,
FixtureState
.
ToOut
));
if
(!
IgnoreX09
&&
IOManager
.
IOValue
(
IO_Type
.
TrayCheck_Fixture
,
Config
).
Equals
(
IO_VALUE
.
HIGH
))
{
...
...
@@ -250,32 +213,32 @@ namespace DeviceLibrary
{
Msg
.
add
(
""
,
MsgLevel
.
info
,
ErrInfo
.
X09_Clear
);
IgnoreX09
=
false
;
MoveInfo
.
NextMoveStep
(
MoveStep
.
StoreTS16
);
MoveInfo
.
NextMoveStep
(
MoveStep
.
TS16_Check
);
MoveInfo
.
log
(
$
"{storeMoveType}:安全检查"
);
InOutEndProcess
(
StoreMoveType
.
PutReel
,
To
.
posid
);
}
break
;
case
MoveStep
.
StoreTS16
:
MoveInfo
.
NextMoveStep
(
MoveStep
.
StoreTS17
);
if
(
From
!=
null
&&
From
.
posid
!=
BoxStorePosition
.
ngdoor
&&
From
.
posid
!=
BoxStorePosition
.
ngdoor
)
case
MoveStep
.
TS16_Check
:
MoveInfo
.
NextMoveStep
(
MoveStep
.
TS17_AxisBack
);
if
(
RobotManage
.
mainMachine
.
AutoInOutTest
)
{
MoveInfo
.
log
(
$
"{storeMoveType}:库位测试模式,
上下
轴,旋转不返回待机点"
);
MoveInfo
.
log
(
$
"{storeMoveType}:库位测试模式,
升降
轴,旋转不返回待机点"
);
break
;
}
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
"
);
MoveInfo
.
log
(
$
"{storeMoveType}:
升降轴回P1{Config.UpDown_P1},旋转返回待机点P1{Config.Middle_P1}
"
);
ErrMsgTxt
=
""
;
break
;
case
MoveStep
.
StoreTS17
:
case
MoveStep
.
TS17_AxisBack
:
MoveInfo
.
log
(
$
"{storeMoveType}:转移料盘完成"
);
MoveInfo
.
EndMove
();
ErrMsgTxt
=
""
;
To
.
posid
=
""
;
storeMoveType
=
StoreMoveType
.
None
;
break
;
case
MoveStep
.
Store
TS_Continue
:
MoveInfo
.
NextMoveStep
(
MoveStep
.
StoreTS17
);
case
MoveStep
.
TS_Continue
:
MoveInfo
.
NextMoveStep
(
MoveStep
.
TS17_AxisBack
);
MoveInfo
.
log
(
$
"{storeMoveType}:继续运行进出轴到达待机点"
);
InOut_Axis
.
AbsMove
(
MoveInfo
,
Config
.
InOut_P1
,
Config
.
InOut_P1_speed
);
break
;
...
...
LoadCVSLibrary/Config/Config.csv
查看文件 @
36a8cd2
...
...
@@ -69,7 +69,7 @@ PRO,0,气压检测超时,AirCheckSeconds,5,,,,,,,,,,,,
PRO,15,旋转轴待机点P1,Middle_P1,168460,,,50000,,,,,,,,,
,,,,,,,,,,,,,,,,
PRO,16,升降轴待机点P1,UpDown_P1,1006626,,,500000,,,,,,,,,
PRO
,16,升降轴每毫米脉冲,UpDown_PoToMM,1000,,,,,,,,,,,,
,16,升降轴每毫米脉冲,UpDown_PoToMM,1000,,,,,,,,,,,,
PRO,16,升降轴低速,UpDown_S1_Speed,1006626,,,,,,,,,,,,
,,,,,,,,,,,,,,,,
PRO,17,进出轴待机点P1,InOut_P1,0,,,500000,,,,,,,,,
...
...
LoadCVSLibrary/Config/Magzine.csv
查看文件 @
36a8cd2
位置,类型,备注,优先级,高度,宽度,旋转轴位置P2,升降轴库位入料高点P3,升降轴库位入料低点P4,进出轴库位点取料点P3
U1_
A1,0,出口1_A
1,0,24,7,99198,417323,379066,227002
U1_
A2,0,出口1_A
2,0,24,7,219347,91377,80569,206929
U1_
A3,0,出口1_A
3,0,24,7,99198,417323,-99999999,227002
U1_
A4,0,出口1_A
4,0,24,7,219347,91377,-99999999,206929
U1_
A5,0,出口1_A
5,0,24,7,219347,91377,123,206929
U1_
A6,0,出口1_A
6,0,24,7,219347,91377,1231,206929
U1_
A7,0,出口1_A
7,0,24,7,219347,91377,23,206929
U1_
1,0,出口1_
1,0,24,7,99198,417323,379066,227002
U1_
2,0,出口1_
2,0,24,7,219347,91377,80569,206929
U1_
3,0,出口1_
3,0,24,7,99198,417323,-99999999,227002
U1_
4,0,出口1_
4,0,24,7,219347,91377,-99999999,206929
U1_
5,0,出口1_
5,0,24,7,219347,91377,123,206929
U1_
6,0,出口1_
6,0,24,7,219347,91377,1231,206929
U1_
7,0,出口1_
7,0,24,7,219347,91377,23,206929
,,,,,,,,,
U2_1,0,出口2_1,0,24,7,99198,417323,379066,227002
U2_2,0,出口2_2,0,24,7,219347,91377,80569,206929
U2_3,0,出口2_3,0,24,7,99198,417323,-99999999,227002
U2_4,0,出口2_4,0,24,7,219347,91377,-99999999,206929
U2_5,0,出口2_5,0,24,7,219347,91377,123,206929
U2_6,0,出口2_6,0,24,7,219347,91377,1231,206929
U2_7,0,出口2_7,0,24,7,219347,91377,23,206929
,,,,,,,,,
U2_A1,0,出口2_A1,0,24,7,99198,417323,379066,227002
U2_A2,0,出口2_A2,0,24,7,219347,91377,80569,206929
U2_A3,0,出口2_A3,0,24,7,99198,417323,-99999999,227002
U2_A4,0,出口2_A4,0,24,7,219347,91377,-99999999,206929
U2_A5,0,出口2_A5,0,24,7,219347,91377,123,206929
U2_A6,0,出口2_A6,0,24,7,219347,91377,1231,206929
U2_A7,0,出口2_A7,0,24,7,219347,91377,23,206929
U3_1,0,出口3_1,0,24,7,99198,417323,379066,227002
U3_2,0,出口3_2,0,24,7,219347,91377,80569,206929
U3_3,0,出口3_3,0,24,7,99198,417323,-99999999,227002
U3_4,0,出口3_4,0,24,7,219347,91377,-99999999,206929
U3_5,0,出口3_5,0,24,7,219347,91377,123,206929
U3_6,0,出口3_6,0,24,7,219347,91377,1231,206929
U3_7,0,出口3_7,0,24,7,219347,91377,23,206929
,,,,,,,,,
U4_1,0,出口4_1,0,24,7,99198,417323,379066,227002
U4_2,0,出口4_2,0,24,7,219347,91377,80569,206929
U4_3,0,出口4_3,0,24,7,99198,417323,-99999999,227002
U4_4,0,出口4_4,0,24,7,219347,91377,-99999999,206929
U4_5,0,出口4_5,0,24,7,219347,91377,123,206929
U4_6,0,出口4_6,0,24,7,219347,91377,1231,206929
U4_7,0,出口4_7,0,24,7,219347,91377,23,206929
LoadCVSLibrary/storeConfig/config/Robot_Config.cs
查看文件 @
36a8cd2
...
...
@@ -83,11 +83,11 @@ namespace OnlineStore.LoadCSVLibrary
/// </summary>
[
ConfigProAttribute
(
"UpDown_P1"
)]
public
int
UpDown_P1
{
get
;
set
;
}
/// <summary>
/// PRO,16,升降轴每毫米脉冲,UpDown_PoToMM,1000,,,,,,,,,,,,
/// </summary>
[
ConfigProAttribute
(
"UpDown_PoToMM"
)]
public
int
UpDown_PoToMM
{
get
;
set
;
}
///
//
<summary>
///
//
PRO,16,升降轴每毫米脉冲,UpDown_PoToMM,1000,,,,,,,,,,,,
///
//
</summary>
//
[ConfigProAttribute("UpDown_PoToMM")]
//
public int UpDown_PoToMM { get; set; }
/// <summary>
/// PRO,16,升降轴低速,UpDown_S1_Speed,1006626,,,,,,,,,,,,
/// </summary>
...
...
TheMachine/TheMachine.csproj
查看文件 @
36a8cd2
...
...
@@ -253,6 +253,7 @@
</PreBuildEvent>
</PropertyGroup>
<PropertyGroup>
<PostBuildEvent>start $(TargetDir)</PostBuildEvent>
<PostBuildEvent>
</PostBuildEvent>
</PropertyGroup>
</Project>
\ No newline at end of file
TheMachine/UC/uc_boxdebug.cs
查看文件 @
36a8cd2
...
...
@@ -178,7 +178,7 @@ namespace TheMachine
dataGridView1
.
Rows
.
Clear
();
LoadPosCheck
();
int
colcount
=
9
;
int
colcount
=
6
;
for
(
int
i
=
0
;
i
<
colcount
;
i
++)
{
...
...
TheMachine/app.manifest
查看文件 @
36a8cd2
...
...
@@ -15,7 +15,8 @@
如果你的应用程序需要此虚拟化来实现向后兼容性,则删除此
元素。
-->
<requestedExecutionLevel level="requireAdministrator" uiAccess="false" />
<!--<requestedExecutionLevel level="requireAdministrator" uiAccess="false" />-->
<requestedExecutionLevel level="asInvoker" uiAccess="false" />
</requestedPrivileges>
</security>
</trustInfo>
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论