Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
刘韬
/
SO815-AutoInOutStore
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
图表
网络
创建新的问题
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit eb12d2ed
由
刘韬
编写于
2021-05-08 10:58:58 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
基于汇川伺服
修复重复出库问题
1 个父辈
fab3aa85
隐藏空白字符变更
内嵌
并排
正在显示
15 个修改的文件
包含
176 行增加
和
115 行删除
source/ACSingleStore/App.config
source/ACSingleStore/AutoInOutStore.csproj
source/ACSingleStore/FrmStoreBox.cs
source/Common/Common.csproj
source/Common/Setting_Init.cs
source/DeviceLibrary/DeviceLibrary.csproj
source/DeviceLibrary/DeviceLibrary/AxisManager.cs
source/DeviceLibrary/DeviceLibrary/HC/HCAxisManager.cs
source/DeviceLibrary/DeviceLibrary/halcon/CodeManager.cs
source/DeviceLibrary/acSingleStore/AC_SA_BoxBean.cs
source/DeviceLibrary/acSingleStore/AC_SA_BoxBean_Partial.cs
source/DeviceLibrary/acSingleStore/AutomaticBaiting.cs
source/DeviceLibrary/acSingleStore/AutomaticBaiting_Partial.cs
source/LoadCVSLibrary/LoadCSVLibrary.csproj
source/LoadCVSLibrary/storeConfig/config/AUTO_SA_Config.cs
source/ACSingleStore/App.config
查看文件 @
eb12d2e
...
...
@@ -9,6 +9,7 @@
<
add
key
=
"App_Title"
value
=
"料仓_批量上下料"
/>
<
add
key
=
"Server_Log_Open"
value
=
"0"
/>
<
add
key
=
"scanner_start_command"
value
=
"S"
/>
<
add
key
=
"code_block_size_list"
value
=
"19,21"
/>
<!-- 开始吹气的判断值(配置值=服务器发送的湿度值-开始吹气值)-->
<
add
key
=
"StartBlowValue"
value
=
"0.5"
/>
<!-- 停止吹气的判断值(配置值=服务器发送的湿度值-停止吹气值)-->
...
...
source/ACSingleStore/AutoInOutStore.csproj
查看文件 @
eb12d2e
...
...
@@ -49,8 +49,9 @@
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\HuichuanLibrary\HuichuanLibrary\bin\Debug\HuichuanLibrary.dll</HintPath>
</Reference>
<Reference Include="log4net">
<HintPath>..\..\..\AutoCountMachine\RC1266-AutoCountMachine\dll\log4net.dll</HintPath>
<Reference Include="log4net, Version=2.0.8.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\增广夹爪\Rmaxis\bin\Debug\log4net.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
...
...
source/ACSingleStore/FrmStoreBox.cs
查看文件 @
eb12d2e
...
...
@@ -367,7 +367,7 @@ namespace OnlineStore.AutoInOutStore
}
//string deviceMsg = "叉子上有料盘,请打开仓门检查";
if
(
store
.
storeRunStatus
.
Equals
(
StoreRunStatus
.
Runing
)
&&
store
.
StoreMove
.
MoveType
.
Equals
(
StoreMoveType
.
None
)
&&
IOManager
.
IOValue
(
IO_Type
.
TrayCheck_Fixture
).
Equals
(
IO_VALUE
.
HIGH
))
if
(
StoreManager
.
Store
.
Config
.
IsUse_Tray_Check
.
Equals
(
1
)
&&
store
.
storeRunStatus
.
Equals
(
StoreRunStatus
.
Runing
)
&&
store
.
StoreMove
.
MoveType
.
Equals
(
StoreMoveType
.
None
)
&&
IOManager
.
IOValue
(
IO_Type
.
TrayCheck_Fixture
).
Equals
(
IO_VALUE
.
HIGH
))
{
lblWarnMsg
.
Text
=
lblWarnMsg
.
Text
+
HasWare
;
}
...
...
@@ -879,6 +879,7 @@ namespace OnlineStore.AutoInOutStore
private
void
btnClearLog_Click
(
object
sender
,
EventArgs
e
)
{
LogUtil
.
ClearLog
();
richTextBox1
.
Text
=
""
;
}
private
void
料仓运转
ONToolStripMenuItem_Click
(
object
sender
,
EventArgs
e
)
...
...
source/Common/Common.csproj
查看文件 @
eb12d2e
...
...
@@ -33,8 +33,9 @@
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<ItemGroup>
<Reference Include="log4net">
<HintPath>..\..\..\AutoCountMachine\RC1266-AutoCountMachine\dll\log4net.dll</HintPath>
<Reference Include="log4net, Version=2.0.8.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\增广夹爪\Rmaxis\bin\Debug\log4net.dll</HintPath>
</Reference>
<Reference Include="Newtonsoft.Json">
<HintPath>..\..\dll\Newtonsoft.Json.dll</HintPath>
...
...
source/Common/Setting_Init.cs
查看文件 @
eb12d2e
...
...
@@ -115,7 +115,6 @@ namespace OnlineStore.Common
public
static
string
Tool_TargetSpeed
=
"Tool_TargetSpeed"
;
public
static
string
Tool_TargetPosition
=
"Tool_TargetPosition"
;
public
static
string
code_block_size_list
=
"code_block_size_list"
;
}
}
source/DeviceLibrary/DeviceLibrary.csproj
查看文件 @
eb12d2e
...
...
@@ -50,8 +50,9 @@
<Reference Include="HuichuanLibrary">
<HintPath>..\..\..\HuichuanLibrary\HuichuanLibrary\bin\Debug\HuichuanLibrary.dll</HintPath>
</Reference>
<Reference Include="log4net">
<HintPath>..\..\..\AutoCountMachine\RC1266-AutoCountMachine\dll\log4net.dll</HintPath>
<Reference Include="log4net, Version=2.0.8.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\增广夹爪\Rmaxis\bin\Debug\log4net.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
...
...
source/DeviceLibrary/DeviceLibrary/AxisManager.cs
查看文件 @
eb12d2e
...
...
@@ -64,7 +64,7 @@ namespace OnlineStore.DeviceLibrary
public
abstract
bool
IsHomeMoveEnd
(
string
portName
,
short
slvAddr
);
public
abstract
bool
AbsMoveIsEnd
(
string
portName
,
short
axisNo
,
int
targetPosition
,
int
canErrorCount
,
out
bool
countError
);
public
abstract
bool
AbsMoveIsEnd
(
string
portName
,
short
axisNo
,
int
targetPosition
,
int
canErrorCount
,
out
bool
countError
,
out
int
IMP
);
public
abstract
void
ServoOn
(
string
portName
,
short
slvAddr
);
public
abstract
void
ServoOff
(
string
portName
,
short
slvAddr
);
public
abstract
void
RelMove
(
string
portName
,
short
slvAddr
,
int
position
,
int
targetSpeed
,
int
ptpAcc
,
int
ptpDec
);
...
...
source/DeviceLibrary/DeviceLibrary/HC/HCAxisManager.cs
查看文件 @
eb12d2e
...
...
@@ -137,10 +137,10 @@ namespace OnlineStore.DeviceLibrary
{
HCBoardManager
.
AxisStop
(
slvAddr
);
}
public
override
bool
AbsMoveIsEnd
(
string
portName
,
short
axisNo
,
int
targetPosition
,
int
canErrorCount
,
out
bool
countError
)
public
override
bool
AbsMoveIsEnd
(
string
portName
,
short
axisNo
,
int
targetPosition
,
int
canErrorCount
,
out
bool
countError
,
out
int
INP
)
{
countError
=
false
;
bool
isOk
=
HCBoardManager
.
MoveIsEnd
(
axisNo
);
bool
isOk
=
HCBoardManager
.
MoveIsEnd
(
axisNo
,
out
INP
);
if
(
isOk
)
{
if
(
HCBoardManager
.
IsInPosition
(
axisNo
,
targetPosition
,
canErrorCount
))
...
...
source/DeviceLibrary/DeviceLibrary/halcon/CodeManager.cs
查看文件 @
eb12d2e
...
...
@@ -24,7 +24,7 @@ namespace OnlineStore.DeviceLibrary
public
static
List
<
string
>
codeTypeList
=
new
List
<
string
>();
//public static List<string> balserNameList = new List<string>();
public
static
List
<
string
>
hikNameList
=
new
List
<
string
>();
public
static
List
<
int
>
Code_Block_Size_List
=
new
List
<
int
>();
private
static
char
spiltChar
=
'#'
;
/// <summary>
/// 初始化摄像机名称和二维码类型
...
...
@@ -35,6 +35,16 @@ namespace OnlineStore.DeviceLibrary
{
QRCodeCount
=
1
;
}
string
code_block_size_list
=
ConfigAppSettings
.
GetValue
(
Setting_Init
.
code_block_size_list
);
var
cl
=
code_block_size_list
.
Split
(
','
);
foreach
(
string
s
in
cl
)
{
int
i
;
if
(
int
.
TryParse
(
s
,
out
i
))
{
Code_Block_Size_List
.
Add
(
i
);
}
}
if
(
Code_Block_Size_List
.
Count
==
0
)
Code_Block_Size_List
.
Add
(
19
);
string
nameStr
=
ConfigAppSettings
.
GetValue
(
Setting_Init
.
CameraName
);
string
codeStr
=
ConfigAppSettings
.
GetValue
(
Setting_Init
.
CodeType
);
codeTypeList
=
new
List
<
string
>();
...
...
@@ -160,22 +170,25 @@ namespace OnlineStore.DeviceLibrary
LogUtil
.
info
(
" 【"
+
cameraName
+
"】开始取图片"
);
HalconDotNet
.
HObject
ho_Image
=
null
;
Bitmap
bmp
=
null
;
try
try
{
bool
nohalcon
=
true
;
ho_Image
=
Camera
.
_cam
.
CaptureOnImage
(
cameraName
,
out
bmp
,
nohalcon
);
if
(
ho_Image
==
null
&&
!
nohalcon
)
{
bool
nohalcon
=
true
;
ho_Image
=
Camera
.
_cam
.
CaptureOnImage
(
cameraName
,
out
bmp
,
nohalcon
);
if
(
ho_Image
==
null
&&
!
nohalcon
)
{
LogUtil
.
error
(
" 【"
+
cameraName
+
"】取图片失败["
+
Camera
.
_cam
.
ErrInfo
+
"],关闭相机"
);
CloseCamera
(
cameraName
);
LogUtil
.
error
(
" 【"
+
cameraName
+
"】取图片失败["
+
Camera
.
_cam
.
ErrInfo
+
"],关闭相机"
);
CloseCamera
(
cameraName
);
continue
;
}
LogUtil
.
info
(
" 【"
+
cameraName
+
"】取图片完成,开始扫码"
);
string
r
=
""
;
}
LogUtil
.
info
(
" 【"
+
cameraName
+
"】取图片完成,开始扫码"
);
string
r
=
""
;
List
<
CodeInfo
>
tlci
=
EyemDecode
.
Decoder
(
ref
bmp
);
foreach
(
int
codesize
in
Code_Block_Size_List
)
{
if
(
codeList
.
Count
>
0
)
break
;
List
<
CodeInfo
>
tlci
=
EyemDecode
.
Decoder
(
ref
bmp
,
null
,
codesize
);
foreach
(
CodeInfo
code
in
tlci
)
{
LogUtil
.
info
(
" 【"
+
cameraName
+
"】[eyemDecode]"
+
code
.
CodeType
+
"(X: "
+
code
.
X
+
",Y: "
+
code
.
Y
+
") "
+
code
.
CodeStr
);
...
...
@@ -189,59 +202,59 @@ namespace OnlineStore.DeviceLibrary
}
}
}
/*
* List<CodeInfo> cc = new List<CodeInfo>();
foreach (string codeType in codeTypeList)
}
/*
* List<CodeInfo> cc = new List<CodeInfo>();
foreach (string codeType in codeTypeList)
{
//判断是否是一维码
if (codeType.ToLower().Equals("barcode"))
{
//判断是否是一维码
if (codeType.ToLower().Equals("barcode"))
{
cc = HDCodeHelper.DecodeBarCode(ho_Image);
}
else
{
cc = HDCodeHelper.DecodeCode(ho_Image, codeType, GetCodeParamFilePath(codeType), codeCount, 2000);
}
foreach (CodeInfo c in cc
)
cc = HDCodeHelper.DecodeBarCode(ho_Image);
}
else
{
cc = HDCodeHelper.DecodeCode(ho_Image, codeType, GetCodeParamFilePath(codeType), codeCount, 2000);
}
foreach (CodeInfo c in cc)
{
string str = CodeManager.ReplaceCode(c.CodeStr);
lock (codeList
)
{
string str = CodeManager.ReplaceCode(c.CodeStr);
lock (codeList)
if (!codeList.Contains(str))
{
if (!codeList.Contains(str))
{
codeList.Add(str);
r = r + "##" + str;
}
codeList.Add(str);
r = r + "##" + str;
}
}
}
*/
if
(
codeList
.
Count
()==
0
)
{
SaveImageToFile
(
"mimo"
,
cameraName
,
bmp
);
}
LogUtil
.
info
(
" 【"
+
cameraName
+
"】"
+
" 扫码完成【"
+
FormUtil
.
GetSpanStr
(
DateTime
.
Now
-
startTime
)
+
"】 :"
+
r
);
}
catch
(
AccessViolationException
e
)
{
LogUtil
.
error
(
" 扫码出现AccessViolationException异常,关闭相机【"
+
cameraName
+
"】:"
+
e
.
ToString
());
Camera
.
_cam
.
Close
(
cameraName
);
// GC.Collect();
}
catch
(
Exception
ex
)
*/
if
(
codeList
.
Count
()
==
0
)
{
LogUtil
.
error
(
" 扫码出错:"
+
ex
.
ToString
()
);
SaveImageToFile
(
"mimo"
,
cameraName
,
bmp
);
}
finally
LogUtil
.
info
(
" 【"
+
cameraName
+
"】"
+
" 扫码完成【"
+
FormUtil
.
GetSpanStr
(
DateTime
.
Now
-
startTime
)
+
"】 :"
+
r
);
}
catch
(
AccessViolationException
e
)
{
LogUtil
.
error
(
" 扫码出现AccessViolationException异常,关闭相机【"
+
cameraName
+
"】:"
+
e
.
ToString
());
Camera
.
_cam
.
Close
(
cameraName
);
// GC.Collect();
}
catch
(
Exception
ex
)
{
LogUtil
.
error
(
" 扫码出错:"
+
ex
.
ToString
());
}
finally
{
if
(
ho_Image
!=
null
)
{
if
(
ho_Image
!=
null
)
{
ho_Image
.
Dispose
();
}
if
(
bmp
!=
null
)
bmp
.
Dispose
();
ho_Image
.
Dispose
();
}
if
(
bmp
!=
null
)
bmp
.
Dispose
();
}
// });
//cameraTask[i].Wait();
...
...
source/DeviceLibrary/acSingleStore/AC_SA_BoxBean.cs
查看文件 @
eb12d2e
...
...
@@ -446,7 +446,7 @@ namespace OnlineStore.DeviceLibrary
ResetCloseDoor
();
break
;
case
StoreMoveStep
.
BOX_H_OtherAxisBack
:
Thread
.
Sleep
(
200
);
StoreMove
.
NextMoveStep
(
StoreMoveStep
.
BOX_H_MiddleAxisToP1
);
ResetLog
(
"复位中:旋转轴到P1,上下轴到P7门口位置,压紧轴到P1"
);
ACAxisMove
(
Config
.
Middle_Axis
,
Config
.
MiddleAxis_P1_Position
,
Config
.
MiddleAxis_P1_Speed
);
...
...
@@ -531,7 +531,7 @@ namespace OnlineStore.DeviceLibrary
private
bool
StartResetOut
()
{
if
(
IOManager
.
IOValue
(
IO_Type
.
TrayCheck_Fixture
).
Equals
(
IO_VALUE
.
HIGH
))
if
(
Config
.
IsUse_Tray_Check
.
Equals
(
1
)
&&
IOManager
.
IOValue
(
IO_Type
.
TrayCheck_Fixture
).
Equals
(
IO_VALUE
.
HIGH
))
{
if
(
IOManager
.
IOValue
(
IO_Type
.
ClampingDisc_Down
).
Equals
(
IO_VALUE
.
HIGH
)
||
IOManager
.
IOValue
(
IO_Type
.
ClampingDisc_Up
).
Equals
(
IO_VALUE
.
LOW
))
...
...
@@ -688,6 +688,7 @@ namespace OnlineStore.DeviceLibrary
break
;
case
StoreMoveStep
.
BOX_H_OtherAxisBack
:
Thread
.
Sleep
(
200
);
StoreMove
.
NextMoveStep
(
StoreMoveStep
.
BOX_H_MiddleAxisToP1
);
ResetLog
(
"回原点:旋转轴到P1,上下轴到门口位置P7,压紧轴到P1"
);
ACAxisMove
(
Config
.
Middle_Axis
,
Config
.
MiddleAxis_P1_Position
,
Config
.
MiddleAxis_P1_Speed
);
...
...
@@ -1330,6 +1331,9 @@ namespace OnlineStore.DeviceLibrary
LogUtil
.
info
(
LOGGER
,
StoreName
+
" 执行排队中的出库【"
+
currInOutFixture
.
ToStr
()
+
"】失败,重新加入等待队列"
);
AddWaitOutInfo
(
currInOutFixture
);
}
else
{
TestADelWaitOutInfo
(
currInOutFixture
);
}
}
}
}
...
...
@@ -1721,7 +1725,7 @@ namespace OnlineStore.DeviceLibrary
}
if
(
CodeOrInoutMsg
.
Equals
(
""
))
{
if
(
storeRunStatus
.
Equals
(
StoreRunStatus
.
Runing
)
&&
AutomaticBaiting
.
AutoBaitingStatus
.
Equals
(
StoreRunStatus
.
Runing
)
if
(
Config
.
IsUse_Tray_Check
.
Equals
(
1
)
&&
storeRunStatus
.
Equals
(
StoreRunStatus
.
Runing
)
&&
AutomaticBaiting
.
AutoBaitingStatus
.
Equals
(
StoreRunStatus
.
Runing
)
&&
IOManager
.
IOValue
(
IO_Type
.
TrayCheck_Fixture
).
Equals
(
IO_VALUE
.
HIGH
))
{
boxStatus
.
SetMsg
(
ResourceControl
.
GetString
(
ResourceControl
.
HasWare
,
"叉子料盘检测有料,请检查"
),
ResourceControl
.
HasWare
);
...
...
@@ -1913,7 +1917,7 @@ namespace OnlineStore.DeviceLibrary
LogUtil
.
error
(
"发送定时消息时,服务器返回Op=1 【"
+
json
+
"】"
);
}
else
if
(
resultOperation
.
data
!=
null
)
if
(
resultOperation
.
data
!=
null
)
{
string
result
=
""
;
Dictionary
<
string
,
string
>
dataMap
=
resultOperation
.
data
;
...
...
@@ -2034,6 +2038,10 @@ namespace OnlineStore.DeviceLibrary
LogUtil
.
info
(
LOGGER
,
StoreName
+
" 执行出库【"
+
currInOutFixture
.
ToStr
()
+
"】失败,加入等待队列"
);
AddWaitOutInfo
(
currInOutFixture
);
}
else
{
TestADelWaitOutInfo
(
currInOutFixture
);
}
if
(
autoNext
)
{
autoMsg
=
ResourceControl
.
GetString
(
"自动出库"
,
"自动出库"
)
+
":"
+
posId
;
...
...
source/DeviceLibrary/acSingleStore/AC_SA_BoxBean_Partial.cs
查看文件 @
eb12d2e
...
...
@@ -311,7 +311,7 @@ namespace OnlineStore.DeviceLibrary
UpdateInOutMsg
(
logMsg
+
"失败,找不到库位信息"
);
return
false
;
}
if
(
IOManager
.
IOValue
(
IO_Type
.
TrayCheck_Fixture
).
Equals
(
IO_VALUE
.
HIGH
))
if
(
Config
.
IsUse_Tray_Check
.
Equals
(
1
)
&&
IOManager
.
IOValue
(
IO_Type
.
TrayCheck_Fixture
).
Equals
(
IO_VALUE
.
HIGH
))
{
UpdateInOutMsg
(
logMsg
+
"失败,叉子料盘检测有料"
);
return
false
;
...
...
@@ -457,7 +457,8 @@ namespace OnlineStore.DeviceLibrary
InStoreLog
(
"入库:SI_07 叉子返回,进出轴至P1,检测料仓料盘检测信号 "
);
StoreMove
.
NextMoveStep
(
StoreMoveStep
.
SI_07_InoutToP1
);
InOutBackToP1
(
moveP
.
InOut_P1
);
StoreMove
.
WaitList
.
Add
(
WaitResultInfo
.
WaitIO
(
IO_Type
.
TrayCheck_Fixture
,
IO_VALUE
.
HIGH
));
if
(
Config
.
IsUse_Tray_Check
.
Equals
(
1
))
StoreMove
.
WaitList
.
Add
(
WaitResultInfo
.
WaitIO
(
IO_Type
.
TrayCheck_Fixture
,
IO_VALUE
.
HIGH
));
}
}
}
...
...
@@ -811,7 +812,7 @@ namespace OnlineStore.DeviceLibrary
UpdateInOutMsg
(
logMsg
+
"失败,找不到库位信息"
);
return
false
;
}
if
(
IOManager
.
IOValue
(
IO_Type
.
TrayCheck_Fixture
).
Equals
(
IO_VALUE
.
HIGH
))
if
(
Config
.
IsUse_Tray_Check
.
Equals
(
1
)
&&
IOManager
.
IOValue
(
IO_Type
.
TrayCheck_Fixture
).
Equals
(
IO_VALUE
.
HIGH
))
{
UpdateInOutMsg
(
logMsg
+
"失败,叉子料盘检测有料"
);
return
false
;
...
...
@@ -972,7 +973,7 @@ namespace OnlineStore.DeviceLibrary
}
else
if
(
StoreMove
.
MoveStep
==
StoreMoveStep
.
SO_06_BagDeviceBack
)
{
if
(
IOManager
.
IOValue
(
IO_Type
.
TrayCheck_Fixture
).
Equals
(
IO_VALUE
.
LOW
))
if
(
Config
.
IsUse_Tray_Check
.
Equals
(
1
)
&&
IOManager
.
IOValue
(
IO_Type
.
TrayCheck_Fixture
).
Equals
(
IO_VALUE
.
LOW
))
{
string
posId
=
StoreMove
.
MoveParam
!=
null
?
StoreMove
.
MoveParam
.
PositionNum
:
""
;
LogUtil
.
error
(
"出库【"
+
posId
+
"】取料完成后,未检测到叉子料盘信号 "
);
...
...
@@ -1248,7 +1249,20 @@ namespace OnlineStore.DeviceLibrary
}
}
}
public
void
TestADelWaitOutInfo
(
FixtureCodeInfo
code
)
{
lock
(
waitOutListLock
)
{
//判断已经有此库位号的出库信息,直接抛弃不处理
List
<
FixtureCodeInfo
>
list
=
(
from
m
in
waitOutStoreList
where
m
.
PosId
.
Equals
(
code
.
PosId
)
select
m
).
ToList
<
FixtureCodeInfo
>();
if
(
list
.
Count
>
0
)
{
LogUtil
.
info
(
$
"当前队列任务数:{waitOutStoreList.Count} 【"
+
code
.
ToStr
()
+
"】 【"
+
code
.
PosId
+
"】发现出库队列有重复任务,删除该队列任务"
);
waitOutStoreList
.
Remove
(
list
[
0
]);
LogUtil
.
info
(
$
"waitOutStoreList:{waitOutStoreList.Count}"
);
}
}
}
#
region
自动出入库循环代码
public
string
GetAutoPosid
(
bool
isNext
)
{
...
...
source/DeviceLibrary/acSingleStore/AutomaticBaiting.cs
查看文件 @
eb12d2e
...
...
@@ -273,6 +273,7 @@ namespace OnlineStore.DeviceLibrary
}
break
;
case
StoreMoveStep
.
AUTO_R04_AutoBack
:
Thread
.
Sleep
(
200
);
StoreMove
.
NextMoveStep
(
StoreMoveStep
.
AUTO_R05_ToP2
);
LogUtil
.
info
(
Name
+
"复位中:上料轴移动到p1点【"
+
StoreManager
.
Config
.
BatchAxis_P2
+
"】"
);
ACAxisAbsMove
(
StoreManager
.
Config
.
Batch_Axis
,
StoreManager
.
Config
.
BatchAxis_P2
,
StoreManager
.
Config
.
BatchAxis_P2_Speed
);
...
...
@@ -408,7 +409,8 @@ namespace OnlineStore.DeviceLibrary
InStoreLog
(
" 批量轴匀速上升【"
+
StoreManager
.
Config
.
BatchAxis_SlowSpeed
+
"】"
);
ACAxisSpeedMove
(
StoreManager
.
Config
.
Batch_Axis
,
StoreManager
.
Config
.
BatchAxis_P3
,
StoreManager
.
Config
.
BatchAxis_SlowSpeed
,
IO_Type
.
TrayCheck_LoadMaterial
);
CylinderMove
(
IO_Type
.
ClampingDisc_Up
,
IO_Type
.
ClampingDisc_Down
,
true
);
StoreMove
.
WaitList
.
Add
(
WaitResultInfo
.
WaitIO
(
IO_Type
.
TrayCheck_Fixture
,
IO_VALUE
.
LOW
));
if
(
StoreManager
.
Store
.
Config
.
IsUse_Tray_Check
.
Equals
(
1
))
StoreMove
.
WaitList
.
Add
(
WaitResultInfo
.
WaitIO
(
IO_Type
.
TrayCheck_Fixture
,
IO_VALUE
.
LOW
));
if
(
StoreManager
.
Config
.
Default_TrayWidth
.
Equals
(
7
))
{
StoreMove
.
WaitList
.
Add
(
WaitResultInfo
.
WaitIO
(
IO_Type
.
WidthCheck1
,
IO_VALUE
.
HIGH
));
...
...
@@ -564,15 +566,20 @@ namespace OnlineStore.DeviceLibrary
addHeight
=
StoreManager
.
Config
.
LastTrayAddHeight
;
}
LastHeight
+=
addHeight
;
string
msg
=
Name
+
StoreMove
.
MoveStep
+
" 计算盘高:脉冲值 ["
+
EndMovePosition
+
"-"
+
StartMovePosition
+
"]=["
+
cha
+
"] ,补充["
+
addHeight
+
"]
计算后["
+
LastHeight
+
"]
"
;
string
msg
=
Name
+
StoreMove
.
MoveStep
+
" 计算盘高:脉冲值 ["
+
EndMovePosition
+
"-"
+
StartMovePosition
+
"]=["
+
cha
+
"] ,补充["
+
addHeight
+
"]"
;
if
(
LastHeight
<
0
)
{
LastHeight
=
StoreManager
.
Config
.
GetDefaultHeight
();
msg
+=
"使用默认值["
+
LastHeight
+
"]"
;
}
if
(
LastHeight
<=
8
)
{
LastHeight
=
8
;
}
if
(
LastHeight
<=
8
)
{
LastHeight
=
8
;
msg
+=
"小于8["
+
LastHeight
+
"]"
;
}
else
{
LastHeight
=
(
int
)
Math
.
Floor
(
1F
*
(
LastHeight
-
1
)
/
4
)
*
4
;
msg
+=
"计算后["
+
LastHeight
+
"]"
;
//LastHeight = (int)Math.Floor(1F * (LastHeight-1) / 4) * 4;
LastHeight
=
LastHeight
-
LastHeight
%
4
;
}
LogUtil
.
info
(
msg
+
",归类为"
+
LastHeight
+
"【"
+
LastCode
+
"】"
);
return
LastHeight
;
...
...
source/DeviceLibrary/acSingleStore/AutomaticBaiting_Partial.cs
查看文件 @
eb12d2e
using
OnlineStore.Common
;
using
HuichuanLibrary
;
using
OnlineStore.Common
;
using
OnlineStore.LoadCSVLibrary
;
using
System
;
using
System.Collections.Generic
;
...
...
@@ -46,28 +47,37 @@ namespace OnlineStore.DeviceLibrary
if
(
ACServerManager
.
IsHomeMoveEnd
(
moveAxis
.
DeviceName
,
moveAxis
.
GetAxisValue
()))
{
//原点完成并且位置=0
int
outCount
=
A
CServerManager
.
GetActualtPosition
(
moveAxis
.
DeviceName
,
moveAxis
.
GetAxisValue
());
int
outCount
=
A
xisManager
.
instance
.
GetActualtPosition
(
moveAxis
.
DeviceName
,
moveAxis
.
GetAxisValue
());
int
errorCount
=
Math
.
Abs
(
outCount
);
if
(
errorCount
>
moveAxis
.
CanErrorCountMax
)
//if (outCount < 0)
//{
// ACServerManager.RelMove(moveAxis.DeviceName, moveAxis.GetAxisValue(), 200, moveAxis.HomeHighSpeed, moveAxis.HomeLowSpeed, moveAxis.HomeAddSpeed);
// LogUtil.info(Name + moveAxis.DisplayStr + "回原过头["+ outCount + "],相对移动200");
// return false;
//}
//else
if
(
errorCount
<=
moveAxis
.
CanErrorCountMax
)
{
//判断是否需要重新运动
if
(
StoreMove
.
CanWhileCount
>
0
)
{
LogUtil
.
error
(
Name
+
moveAxis
.
DisplayStr
+
"收到原点完成信号,当前位置["
+
outCount
+
"],重新回原点,剩余["
+
StoreMove
.
CanWhileCount
+
"]次"
);
ACServerManager
.
HomeMove
(
moveAxis
.
DeviceName
,
moveAxis
.
GetAxisValue
(),
moveAxis
.
HomeHighSpeed
,
moveAxis
.
HomeLowSpeed
,
moveAxis
.
HomeAddSpeed
);
StoreMove
.
CanWhileCount
--;
}
else
{
// msg = Name + " storeMoveStep=" + StoreMove.MoveStep + moveAxis.DisplayStr + "收到原点完成信号,当前位置[" + outCount + "],误差过大,需要报警";
SetWarnMsgAndLog
(
ResourceControl
.
AxisHomeMoveAlarm
,
StoreMove
.
MoveStep
+
""
,
moveAxis
.
GetNameStr
(),
outCount
+
""
);
msg
=
WarnObj
.
WarnMsg
;
LogUtil
.
error
(
msg
,
100
);
return
false
;
}
LogUtil
.
info
(
Name
+
moveAxis
.
DisplayStr
+
"回原已到位,当前位置["
+
outCount
+
"]最大允许误差["
+
moveAxis
.
CanErrorCountMax
+
"]"
);
//ACServerManager.SuddenStop(moveAxis);
return
true
;
}
return
true
;
//判断是否需要重新运动
if
(
StoreMove
.
CanWhileCount
>
0
)
{
LogUtil
.
error
(
Name
+
moveAxis
.
DisplayStr
+
"收到原点完成信号,当前位置["
+
outCount
+
"],最大允许误差["
+
moveAxis
.
CanErrorCountMax
+
"],重新回原点,剩余["
+
StoreMove
.
CanWhileCount
+
"]次"
);
ACServerManager
.
HomeMove
(
moveAxis
.
DeviceName
,
moveAxis
.
GetAxisValue
(),
moveAxis
.
HomeHighSpeed
,
moveAxis
.
HomeLowSpeed
,
moveAxis
.
HomeAddSpeed
);
StoreMove
.
CanWhileCount
--;
}
else
{
// msg = Name + " storeMoveStep=" + StoreMove.MoveStep + moveAxis.DisplayStr + "收到原点完成信号,当前位置[" + outCount + "],误差过大,需要报警";
SetWarnMsgAndLog
(
ResourceControl
.
AxisHomeMoveAlarm
,
StoreMove
.
MoveStep
+
""
,
moveAxis
.
GetNameStr
(),
outCount
+
""
);
msg
=
WarnObj
.
WarnMsg
;
LogUtil
.
error
(
msg
,
100
);
return
false
;
}
}
/*
else if (IOManager.IOValue(IO_Type.BatchAxis_Limit).Equals(IO_VALUE.HIGH))
...
...
@@ -77,6 +87,8 @@ namespace OnlineStore.DeviceLibrary
}*/
return
false
;
}
protected
static
DateTime
preRWTime
=
DateTime
.
Now
;
private
static
void
CheckWait
()
{
...
...
@@ -224,21 +236,23 @@ namespace OnlineStore.DeviceLibrary
private
static
bool
ACAxisMoveIsEnd
(
ConfigMoveAxis
moveAxis
,
int
targetPosition
,
int
targetSpeed
,
out
string
msg
)
{
msg
=
""
;
bool
isOk
=
ACServerManager
.
GetBusyStatus
(
moveAxis
.
DeviceName
,
moveAxis
.
GetAxisValue
()).
Equals
(
0
);
if
(
isOk
)
string
deviceName
=
moveAxis
.
DeviceName
;
short
axisNo
=
moveAxis
.
GetAxisValue
();
bool
countError
=
false
;
bool
IsOk
=
AxisManager
.
instance
.
AbsMoveIsEnd
(
deviceName
,
axisNo
,
targetPosition
,
moveAxis
.
CanErrorCountMax
,
out
countError
,
out
int
IMP
);
if
(
IsOk
)
{
int
outCount
=
ACServerManager
.
GetActualtPosition
(
moveAxis
.
DeviceName
,
moveAxis
.
GetAxisValue
());
int
errorCount
=
Math
.
Abs
(
outCount
-
targetPosition
);
if
(
errorCount
<=
moveAxis
.
CanErrorCountMax
)
{
return
true
;
}
return
true
;
}
if
(
countError
)
{
int
outCount
=
AxisManager
.
instance
.
GetActualtPosition
(
deviceName
,
axisNo
);
//判断是否需要重新运动
if
(
StoreMove
.
CanWhileCount
>
0
)
{
LogUtil
.
error
(
Name
+
moveAxis
.
DisplayStr
+
"目标["
+
targetPosition
+
"]当前["
+
outCount
+
LogUtil
.
error
(
Name
+
moveAxis
.
DisplayStr
+
"
IMP["
+
IMP
+
"]
目标["
+
targetPosition
+
"]当前["
+
outCount
+
"],误差过大,重新运动,剩余["
+
StoreMove
.
CanWhileCount
+
"]次"
);
ACServerManager
.
SuddenStop
(
moveAxis
.
DeviceName
,
moveAxis
.
GetAxisValue
());
//
ACServerManager.SuddenStop(moveAxis.DeviceName, moveAxis.GetAxisValue());
ACServerManager
.
AbsMove
(
moveAxis
.
DeviceName
,
moveAxis
.
GetAxisValue
(),
targetPosition
,
targetSpeed
,
moveAxis
.
AddSpeed
,
moveAxis
.
DelSpeed
);
StoreMove
.
CanWhileCount
--;
}
...
...
@@ -653,7 +667,7 @@ namespace OnlineStore.DeviceLibrary
{
return
ResourceControl
.
GetString
(
ResourceControl
.
batchInError
,
"Batch storing Error: Close feeding device"
);
}
if
(
IOManager
.
IOValue
(
IO_Type
.
TrayCheck_Fixture
).
Equals
(
IO_VALUE
.
HIGH
))
if
(
StoreManager
.
Store
.
Config
.
IsUse_Tray_Check
.
Equals
(
1
)
&&
IOManager
.
IOValue
(
IO_Type
.
TrayCheck_Fixture
).
Equals
(
IO_VALUE
.
HIGH
))
{
return
ResourceControl
.
GetString
(
ResourceControl
.
batchInError2
,
"Batch storing Error: gripper full, check before restoring"
);
}
...
...
source/LoadCVSLibrary/LoadCSVLibrary.csproj
查看文件 @
eb12d2e
...
...
@@ -33,8 +33,9 @@
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<ItemGroup>
<Reference Include="log4net">
<HintPath>..\..\..\AutoCountMachine\RC1266-AutoCountMachine\dll\log4net.dll</HintPath>
<Reference Include="log4net, Version=2.0.8.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\增广夹爪\Rmaxis\bin\Debug\log4net.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
...
...
source/LoadCVSLibrary/storeConfig/config/AUTO_SA_Config.cs
查看文件 @
eb12d2e
...
...
@@ -655,12 +655,12 @@ namespace OnlineStore.LoadCSVLibrary
/// PRO (轴四)压紧轴加速度 CompAxis_AddSpeed 300
/// </summary>
[
ConfigProAttribute
(
"CompAxis_AddSpeed"
)]
public
shor
t
CompAxis_AddSpeed
{
get
;
set
;
}
public
in
t
CompAxis_AddSpeed
{
get
;
set
;
}
/// <summary>
/// PRO (轴四)压紧轴减速度 CompAxis_DelSpeed 300
/// </summary>
[
ConfigProAttribute
(
"CompAxis_DelSpeed"
)]
public
shor
t
CompAxis_DelSpeed
{
get
;
set
;
}
public
in
t
CompAxis_DelSpeed
{
get
;
set
;
}
/// <summary>
/// PRO (轴四)压紧轴原点低速 CompAxis_HomeLowSpeed 20
/// </summary>
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论