Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
孙克
/
RC1250-AssemblyLine
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit 29f10494
由
LN
编写于
2019-12-19 15:42:25 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
rfid增加日志
1 个父辈
1f248698
显示空白字符变更
内嵌
并排
正在显示
7 个修改的文件
包含
22 行增加
和
17 行删除
dll/RFID/ClassLibrary1.dll
source/DeviceLibrary/assemblyLine/FeedingEquip.cs
source/DeviceLibrary/assemblyLine/LineBean.cs
source/DeviceLibrary/assemblyLine/MoveEquip.cs
source/DeviceLibrary/assemblyLine/ProvidingEquip.cs
source/DeviceLibrary/assemblymanager/RFIDManagercs.cs
source/DeviceLibrary/baan/AxisBean.cs
dll/RFID/ClassLibrary1.dll
查看文件 @
29f1049
此文件类型无法预览
source/DeviceLibrary/assemblyLine/FeedingEquip.cs
查看文件 @
29f1049
...
@@ -29,8 +29,8 @@ namespace OnlineStore.DeviceLibrary
...
@@ -29,8 +29,8 @@ namespace OnlineStore.DeviceLibrary
Init
();
Init
();
UseAxis
=
true
;
UseAxis
=
true
;
Config
.
SetAxisParam
();
Config
.
SetAxisParam
();
UpdownAxis
=
new
AxisBean
(
config
.
UpDown_Axis
);
UpdownAxis
=
new
AxisBean
(
config
.
UpDown_Axis
,
Name
);
BatchAxis
=
new
AxisBean
(
config
.
Batch_Axis
);
BatchAxis
=
new
AxisBean
(
config
.
Batch_Axis
,
Name
);
MoveInfo
=
new
LineMoveInfo
(
DeviceID
,
"入料-"
+
DeviceID
+
"-Move"
);
MoveInfo
=
new
LineMoveInfo
(
DeviceID
,
"入料-"
+
DeviceID
+
"-Move"
);
SecondMoveInfo
=
new
LineMoveInfo
(
DeviceID
,
"入料-"
+
DeviceID
+
"-SecondMove"
);
SecondMoveInfo
=
new
LineMoveInfo
(
DeviceID
,
"入料-"
+
DeviceID
+
"-SecondMove"
);
}
}
...
...
source/DeviceLibrary/assemblyLine/LineBean.cs
查看文件 @
29f1049
...
@@ -10,6 +10,7 @@ using System.Text;
...
@@ -10,6 +10,7 @@ using System.Text;
using
System.Threading
;
using
System.Threading
;
using
System.Threading.Tasks
;
using
System.Threading.Tasks
;
using
System.Timers
;
using
System.Timers
;
using
System.Windows.Forms
;
namespace
OnlineStore.DeviceLibrary
namespace
OnlineStore.DeviceLibrary
{
{
...
@@ -173,6 +174,8 @@ namespace OnlineStore.DeviceLibrary
...
@@ -173,6 +174,8 @@ namespace OnlineStore.DeviceLibrary
Thread
.
Sleep
(
5
);
Thread
.
Sleep
(
5
);
Task
.
Factory
.
StartNew
(
delegate
Task
.
Factory
.
StartNew
(
delegate
{
{
string
path
=
Application
.
StartupPath
+
@"\logs\rfid\"
;
RFIDManager
.
RfidReader
.
LogPath
(
path
);
string
[]
rfidArray
=
rfidList
.
ToArray
();
string
[]
rfidArray
=
rfidList
.
ToArray
();
//连接rfip
//连接rfip
RFIDManager
.
RfidReader
.
Open
(
rfidArray
);
RFIDManager
.
RfidReader
.
Open
(
rfidArray
);
...
@@ -696,9 +699,6 @@ namespace OnlineStore.DeviceLibrary
...
@@ -696,9 +699,6 @@ namespace OnlineStore.DeviceLibrary
Reset
();
Reset
();
}
}
}
}
// FeederProcess();
}
}
}
}
catch
(
Exception
ex
)
catch
(
Exception
ex
)
...
@@ -848,7 +848,6 @@ namespace OnlineStore.DeviceLibrary
...
@@ -848,7 +848,6 @@ namespace OnlineStore.DeviceLibrary
}
}
#
endregion
#
endregion
internal
override
void
StopMove
()
internal
override
void
StopMove
()
{
{
...
@@ -921,8 +920,6 @@ namespace OnlineStore.DeviceLibrary
...
@@ -921,8 +920,6 @@ namespace OnlineStore.DeviceLibrary
}
}
}
}
}
}
public
string
GetMoveStr
()
public
string
GetMoveStr
()
{
{
string
msg
=
""
;
string
msg
=
""
;
...
...
source/DeviceLibrary/assemblyLine/MoveEquip.cs
查看文件 @
29f1049
...
@@ -43,7 +43,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -43,7 +43,7 @@ namespace OnlineStore.DeviceLibrary
Config
.
UpDown_Axis
.
ServerOnDO
=
IO_Type
.
UpDownAxis_ServoOn
;
Config
.
UpDown_Axis
.
ServerOnDO
=
IO_Type
.
UpDownAxis_ServoOn
;
Config
.
UpDown_Axis
.
BreakOnDO
=
IO_Type
.
UpDownAxis_BreakOn
;
Config
.
UpDown_Axis
.
BreakOnDO
=
IO_Type
.
UpDownAxis_BreakOn
;
}
}
UpdownAxis
=
new
AxisBean
(
config
.
UpDown_Axis
);
UpdownAxis
=
new
AxisBean
(
config
.
UpDown_Axis
,
Name
);
}
}
public
override
bool
StartRun
(
bool
isDebug
=
false
)
public
override
bool
StartRun
(
bool
isDebug
=
false
)
...
@@ -132,6 +132,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -132,6 +132,7 @@ namespace OnlineStore.DeviceLibrary
MoveInfo
.
NextMoveStep
(
LineMoveStep
.
MH_UpDownCylinder_Up
);
MoveInfo
.
NextMoveStep
(
LineMoveStep
.
MH_UpDownCylinder_Up
);
DebugInfo
(
MoveInfo
.
MoveType
+
" : (上下轴原点返回完成,上下轴走到待机点 )开始"
);
DebugInfo
(
MoveInfo
.
MoveType
+
" : (上下轴原点返回完成,上下轴走到待机点 )开始"
);
UpdownUpMove
();
UpdownUpMove
();
MoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitTime
(
2000
));
break
;
break
;
case
LineMoveStep
.
MH_UpDownCylinder_Up
:
case
LineMoveStep
.
MH_UpDownCylinder_Up
:
...
...
source/DeviceLibrary/assemblyLine/ProvidingEquip.cs
查看文件 @
29f1049
...
@@ -42,7 +42,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -42,7 +42,7 @@ namespace OnlineStore.DeviceLibrary
Config
.
UpDown_Axis
.
ServerOnDO
=
IO_Type
.
UpDownAxis_ServoOn
;
Config
.
UpDown_Axis
.
ServerOnDO
=
IO_Type
.
UpDownAxis_ServoOn
;
Config
.
UpDown_Axis
.
BreakOnDO
=
IO_Type
.
UpDownAxis_BreakOn
;
Config
.
UpDown_Axis
.
BreakOnDO
=
IO_Type
.
UpDownAxis_BreakOn
;
}
}
UpdownAxis
=
new
AxisBean
(
config
.
UpDown_Axis
);
UpdownAxis
=
new
AxisBean
(
config
.
UpDown_Axis
,
Name
);
}
}
public
override
bool
StartRun
(
bool
isDebug
=
false
)
public
override
bool
StartRun
(
bool
isDebug
=
false
)
...
@@ -123,6 +123,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -123,6 +123,7 @@ namespace OnlineStore.DeviceLibrary
MoveInfo
.
NextMoveStep
(
LineMoveStep
.
MH_UpDownCylinder_Up
);
MoveInfo
.
NextMoveStep
(
LineMoveStep
.
MH_UpDownCylinder_Up
);
LogInfo
(
MoveInfo
.
MoveType
+
" : (上下轴原点返回完成,上下轴走到待机点 )开始"
);
LogInfo
(
MoveInfo
.
MoveType
+
" : (上下轴原点返回完成,上下轴走到待机点 )开始"
);
UpdownUpMove
();
UpdownUpMove
();
MoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitTime
(
2000
));
break
;
break
;
case
LineMoveStep
.
MH_UpDownCylinder_Up
:
case
LineMoveStep
.
MH_UpDownCylinder_Up
:
MoveInfo
.
NextMoveStep
(
LineMoveStep
.
MH_OtherCylinder_Back
);
MoveInfo
.
NextMoveStep
(
LineMoveStep
.
MH_OtherCylinder_Back
);
...
@@ -254,11 +255,13 @@ namespace OnlineStore.DeviceLibrary
...
@@ -254,11 +255,13 @@ namespace OnlineStore.DeviceLibrary
if
(
UseAxis
)
if
(
UseAxis
)
{
{
MoveInfo
.
NextMoveStep
(
LineMoveStep
.
MH_UpDownHomeMove
);
MoveInfo
.
NextMoveStep
(
LineMoveStep
.
MH_UpDownHomeMove
);
MoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitTime
(
2000
));
UpdownAxis
.
HomeMove
(
MoveInfo
);
UpdownAxis
.
HomeMove
(
MoveInfo
);
}
}
else
else
{
{
MoveInfo
.
NextMoveStep
(
LineMoveStep
.
MH_UpDownCylinder_Up
);
MoveInfo
.
NextMoveStep
(
LineMoveStep
.
MH_UpDownCylinder_Up
);
MoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitTime
(
1000
));
CylinderMove
(
MoveInfo
,
IO_Type
.
UpDownCylinder_Down
,
IO_Type
.
UpDownCylinder_Up
);
CylinderMove
(
MoveInfo
,
IO_Type
.
UpDownCylinder_Down
,
IO_Type
.
UpDownCylinder_Up
);
}
}
}
}
...
...
source/DeviceLibrary/assemblymanager/RFIDManagercs.cs
查看文件 @
29f1049
...
@@ -41,6 +41,10 @@ namespace OnlineStore.DeviceLibrary
...
@@ -41,6 +41,10 @@ namespace OnlineStore.DeviceLibrary
{
{
return
data
.
Num
;
return
data
.
Num
;
}
}
else
{
LogUtil
.
error
(
"RFID [ "
+
ip
+
" ] 读到数据 "
+
data
.
ToStr
()
+
" 返回盘号 0"
);
}
return
0
;
return
0
;
}
}
...
...
source/DeviceLibrary/baan/AxisBean.cs
查看文件 @
29f1049
...
@@ -19,10 +19,10 @@ namespace OnlineStore.DeviceLibrary
...
@@ -19,10 +19,10 @@ namespace OnlineStore.DeviceLibrary
public
int
LastPosition
=
0
;
public
int
LastPosition
=
0
;
public
string
AxisName
;
public
string
AxisName
;
public
AxisBean
(
ConfigMoveAxis
axisConfig
)
public
AxisBean
(
ConfigMoveAxis
axisConfig
,
string
deviceName
)
{
{
this
.
Config
=
axisConfig
;
this
.
Config
=
axisConfig
;
AxisName
=
Config
.
Explain
+
"["
+
Config
.
DeviceName
+
"-"
+
Config
.
GetAxisValue
()
+
"]"
;
AxisName
=
deviceName
+
" "
+
Config
.
Explain
+
"["
+
Config
.
DeviceName
+
"-"
+
Config
.
GetAxisValue
()
+
"]"
;
}
}
...
@@ -102,7 +102,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -102,7 +102,7 @@ namespace OnlineStore.DeviceLibrary
public
void
HomeMove
(
LineMoveInfo
MoveInfo
)
public
void
HomeMove
(
LineMoveInfo
MoveInfo
)
{
{
Config
.
TargetPosition
=
0
;
Config
.
TargetPosition
=
0
;
LogUtil
.
info
(
Config
.
DisplayStr
+
"speed["
+
Config
.
TargetSpeed
+
"]开始原点返回"
);
LogUtil
.
info
(
AxisName
+
"speed["
+
Config
.
TargetSpeed
+
"]开始原点返回"
);
MoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitAxis
(
Config
,
true
));
MoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitAxis
(
Config
,
true
));
ACServerManager
.
HomeMove
(
Config
.
DeviceName
,
(
short
)
Config
.
GetAxisValue
(),
Config
.
HomeHighSpeed
);
ACServerManager
.
HomeMove
(
Config
.
DeviceName
,
(
short
)
Config
.
GetAxisValue
(),
Config
.
HomeHighSpeed
);
}
}
...
@@ -145,7 +145,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -145,7 +145,7 @@ namespace OnlineStore.DeviceLibrary
//判断是否需要重新运动
//判断是否需要重新运动
if
(
MoveInfo
.
CanWhileCount
>
0
)
if
(
MoveInfo
.
CanWhileCount
>
0
)
{
{
LogUtil
.
error
(
axis
.
DisplayStr
+
"目标位置["
+
targetPosition
+
"]当前位置["
+
outCount
+
LogUtil
.
error
(
MoveInfo
.
Name
+
axis
.
DisplayStr
+
"目标位置["
+
targetPosition
+
"]当前位置["
+
outCount
+
"],误差过大,重新开始运动,剩余["
+
MoveInfo
.
CanWhileCount
+
"]次"
);
"],误差过大,重新开始运动,剩余["
+
MoveInfo
.
CanWhileCount
+
"]次"
);
ACServerManager
.
SuddenStop
(
axis
.
DeviceName
,
axis
.
GetAxisValue
());
ACServerManager
.
SuddenStop
(
axis
.
DeviceName
,
axis
.
GetAxisValue
());
ACServerManager
.
AbsMove
(
axis
.
DeviceName
,
axis
.
GetAxisValue
(),
targetPosition
,
targetSpeed
);
ACServerManager
.
AbsMove
(
axis
.
DeviceName
,
axis
.
GetAxisValue
(),
targetPosition
,
targetSpeed
);
...
@@ -153,7 +153,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -153,7 +153,7 @@ namespace OnlineStore.DeviceLibrary
}
}
else
else
{
{
msg
=
" "
+
MoveInfo
.
SLog
+
axis
.
DisplayStr
+
",目标位置["
+
targetPosition
+
"]当前位置["
+
outCount
msg
=
" "
+
MoveInfo
.
SLog
+
MoveInfo
.
Name
+
axis
.
DisplayStr
+
",目标位置["
+
targetPosition
+
"]当前位置["
+
outCount
+
"],误差过大,需要报警"
;
+
"],误差过大,需要报警"
;
LogUtil
.
error
(
msg
,
1034
);
LogUtil
.
error
(
msg
,
1034
);
}
}
...
@@ -175,14 +175,14 @@ namespace OnlineStore.DeviceLibrary
...
@@ -175,14 +175,14 @@ namespace OnlineStore.DeviceLibrary
//判断是否需要重新运动
//判断是否需要重新运动
if
(
MoveInfo
.
CanWhileCount
>
0
)
if
(
MoveInfo
.
CanWhileCount
>
0
)
{
{
LogUtil
.
error
(
axis
.
DisplayStr
+
"收到原点完成信号,当前位置["
+
outCount
+
"],重新回原点,剩余["
+
MoveInfo
.
CanWhileCount
+
"]次"
);
LogUtil
.
error
(
MoveInfo
.
Name
+
axis
.
DisplayStr
+
"收到原点完成信号,当前位置["
+
outCount
+
"],重新回原点,剩余["
+
MoveInfo
.
CanWhileCount
+
"]次"
);
//LogUtil.error( StoreName + moveAxis.DisplayStr + "重新回原点");
//LogUtil.error( StoreName + moveAxis.DisplayStr + "重新回原点");
ACServerManager
.
HomeMove
(
axis
.
DeviceName
,
axis
.
GetAxisValue
(),
axis
.
HomeHighSpeed
);
ACServerManager
.
HomeMove
(
axis
.
DeviceName
,
axis
.
GetAxisValue
(),
axis
.
HomeHighSpeed
);
MoveInfo
.
CanWhileCount
--;
MoveInfo
.
CanWhileCount
--;
}
}
else
else
{
{
msg
=
" "
+
MoveInfo
.
SLog
+
axis
.
DisplayStr
+
",收到原点完成信号,当前位置["
+
outCount
+
"],误差过大,需要报警"
;
msg
=
MoveInfo
.
Name
+
" "
+
MoveInfo
.
SLog
+
axis
.
DisplayStr
+
",收到原点完成信号,当前位置["
+
outCount
+
"],误差过大,需要报警"
;
LogUtil
.
error
(
msg
);
LogUtil
.
error
(
msg
);
}
}
}
}
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论