Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
孙克
/
ACSingleStore
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit be188147
由
LN
编写于
2021-08-16 16:42:18 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
最新代码提交
1 个父辈
f427b7b6
全部展开
显示空白字符变更
内嵌
并排
正在显示
30 个修改的文件
包含
466 行增加
和
287 行删除
dll/CodeLibrary.dll
source/ACServoDriveTest/FrmACTest.cs
source/ACSingleStore/ACSingleStore.csproj
source/ACSingleStore/App.config
source/ACSingleStore/FrmAxisDebug.Designer.cs
source/ACSingleStore/FrmAxisDebug.cs
source/ACSingleStore/FrmStoreBox.Designer.cs
source/ACSingleStore/FrmStoreBox.cs
source/ACSingleStore/Properties/Resources.Designer.cs
source/ACSingleStore/Properties/Settings.Designer.cs
source/ACSingleStore/positionTool/FrmPositionTool.Designer.cs
source/ACSingleStore/positionTool/FrmPositionTool.cs
source/ACSingleStore/positionTool/FrmPositionTool.resx
source/ACSingleStore/记录.txt
source/Common/Setting_Init.cs
source/Common/util/AcSerialBean.cs
source/DeviceLibrary/DeviceLibrary.csproj
source/DeviceLibrary/KangNaiDe/KNDAIManager.cs
source/DeviceLibrary/KangNaiDe/KNDManager.cs
source/DeviceLibrary/PanasonicServo/ACCMDManager.cs
source/DeviceLibrary/PanasonicServo/ACServerManager.cs
source/DeviceLibrary/PanasonicServo/ACServerManager_Partial.cs
source/DeviceLibrary/StoreConfig/AC/StoreConfig.csv
source/DeviceLibrary/acSingleStore/AC_SA_BoxBean.cs
source/DeviceLibrary/acSingleStore/AC_SA_BoxBean_Partial.cs
source/DeviceLibrary/acSingleStore/StoreManager.cs
source/DeviceLibrary/halcon/CodeManager.cs
source/DeviceLibrary/store/KTK_Store.cs
source/DeviceLibrary/store/StoreStep.cs
source/LoadCVSLibrary/storeConfig/config/AC_SA_Config.cs
dll/CodeLibrary.dll
查看文件 @
be18814
此文件类型无法预览
source/ACServoDriveTest/FrmACTest.cs
查看文件 @
be18814
...
...
@@ -126,7 +126,7 @@ namespace ACServoDriveTest
{
//bean.closePort();
ACServerManager
.
ServoOff
(
GetPortName
(),
GetSlaveAddr
());
ACServerManager
.
ColsePort
(
GetPortName
()
);
//
ACServerManager.ColsePort(GetPortName() );
formStatus
(
false
);
}
private
void
Form1_Load
(
object
sender
,
EventArgs
e
)
...
...
source/ACSingleStore/ACSingleStore.csproj
查看文件 @
be18814
...
...
@@ -9,7 +9,7 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>OnlineStore.ACSingleStore</RootNamespace>
<AssemblyName>ZHACSingleStore</AssemblyName>
<TargetFrameworkVersion>v4.
0
</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.
6.1
</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<TargetFrameworkProfile />
</PropertyGroup>
...
...
@@ -92,6 +92,12 @@
<DependentUpon>FrmStoreBox.cs</DependentUpon>
</Compile>
<Compile Include="ManagerUtil.cs" />
<Compile Include="positionTool\FrmPositionTool.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="positionTool\FrmPositionTool.Designer.cs">
<DependentUpon>FrmPositionTool.cs</DependentUpon>
</Compile>
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<EmbeddedResource Include="FrmAxisDebug.resx">
...
...
@@ -109,6 +115,9 @@
<EmbeddedResource Include="FrmStoreBox.resx">
<DependentUpon>FrmStoreBox.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="positionTool\FrmPositionTool.resx">
<DependentUpon>FrmPositionTool.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
...
...
@@ -128,79 +137,6 @@
<DependentUpon>Settings.settings</DependentUpon>
<DesignTimeSharedInput>True</DesignTimeSharedInput>
</Compile>
<None Include="Skins\back\DeepCyan.ssk" />
<None Include="Skins\back\DeepGreen.ssk" />
<None Include="Skins\back\DeepOrange.ssk" />
<None Include="Skins\Calmness.ssk" />
<None Include="Skins\CalmnessColor1.ssk" />
<None Include="Skins\CalmnessColor2.ssk" />
<None Include="Skins\DiamondBlue.ssk" />
<None Include="Skins\DiamondGreen.ssk" />
<None Include="Skins\DiamondOlive.ssk" />
<None Include="Skins\DiamondPurple.ssk" />
<None Include="Skins\DiamondRed.ssk" />
<None Include="Skins\Eighteen.ssk" />
<None Include="Skins\EighteenColor1.ssk" />
<None Include="Skins\EighteenColor2.ssk" />
<None Include="Skins\Emerald.ssk" />
<None Include="Skins\EmeraldColor1.ssk" />
<None Include="Skins\EmeraldColor2.ssk" />
<None Include="Skins\EmeraldColor3.ssk" />
<None Include="Skins\GlassBrown.ssk" />
<None Include="Skins\GlassGreen.ssk" />
<None Include="Skins\GlassOrange.ssk" />
<None Include="Skins\Longhorn.ssk" />
<None Include="Skins\MacOS.ssk" />
<None Include="Skins\Midsummer.ssk" />
<None Include="Skins\MidsummerColor1.ssk" />
<None Include="Skins\MidsummerColor2.ssk" />
<None Include="Skins\MidsummerColor3.ssk" />
<None Include="Skins\mp10.ssk" />
<None Include="Skins\mp10green.ssk" />
<None Include="Skins\mp10maroon.ssk" />
<None Include="Skins\mp10mulberry.ssk" />
<None Include="Skins\mp10pink.ssk" />
<None Include="Skins\mp10purple.ssk" />
<None Include="Skins\MSN.ssk" />
<None Include="Skins\office2007.ssk" />
<None Include="Skins\OneBlue.ssk" />
<None Include="Skins\OneCyan.ssk" />
<None Include="Skins\OneGreen.ssk" />
<None Include="Skins\OneOrange.ssk" />
<None Include="Skins\Page.ssk" />
<None Include="Skins\PageColor1.ssk" />
<None Include="Skins\PageColor2.ssk" />
<None Include="Skins\RealOne.ssk" />
<None Include="Skins\Silver.ssk" />
<None Include="Skins\SilverColor1.ssk" />
<None Include="Skins\SilverColor2.ssk" />
<None Include="Skins\SportsBlack.ssk" />
<None Include="Skins\SportsBlue.ssk" />
<None Include="Skins\SportsCyan.ssk" />
<None Include="Skins\SportsGreen.ssk" />
<None Include="Skins\SportsOrange.ssk" />
<None Include="Skins\SteelBlack.ssk" />
<None Include="Skins\SteelBlue.ssk" />
<None Include="Skins\vista1.ssk" />
<None Include="Skins\vista1_green.ssk" />
<None Include="Skins\Vista2_color1.ssk" />
<None Include="Skins\Vista2_color2.ssk" />
<None Include="Skins\Vista2_color3.ssk" />
<None Include="Skins\Vista2_color4.ssk" />
<None Include="Skins\Vista2_color5.ssk" />
<None Include="Skins\Vista2_color6.ssk" />
<None Include="Skins\Vista2_color7.ssk" />
<None Include="Skins\Warm.ssk" />
<None Include="Skins\WarmColor1.ssk" />
<None Include="Skins\WarmColor2.ssk" />
<None Include="Skins\WarmColor3.ssk" />
<None Include="Skins\Wave.ssk" />
<None Include="Skins\WaveColor1.ssk" />
<None Include="Skins\WaveColor2.ssk" />
<None Include="Skins\XPBlue.ssk" />
<None Include="Skins\XPGreen.ssk" />
<None Include="Skins\XPOrange.ssk" />
<None Include="Skins\XPSilver.ssk" />
</ItemGroup>
<ItemGroup>
<None Include="App.config">
...
...
source/ACSingleStore/App.config
查看文件 @
be18814
<?
xml
version
=
"1.0"
?>
<
configuration
>
<
configSections
>
<
section
name
=
"log4net"
type
=
"log4net.Config.Log4NetConfigurationSectionHandler,log4net"
/>
<
section
name
=
"log4net"
type
=
"log4net.Config.Log4NetConfigurationSectionHandler,log4net"
/>
</
configSections
>
<
appSettings
>
<!--是否开机自动启动料仓-->
<
add
key
=
"App_AutoRun"
value
=
"1"
/>
<
add
key
=
"App_Title"
value
=
"AC_SA_料仓_1"
/>
<
add
key
=
"scanner_start_command"
value
=
"S"
/>
<
add
key
=
"App_AutoRun"
value
=
"1"
/>
<
add
key
=
"App_Title"
value
=
"AC_SA_料仓_1"
/>
<
add
key
=
"scanner_start_command"
value
=
"S"
/>
<!-- 开始吹气的判断值(配置值=服务器发送的湿度值-开始吹气值)-->
<
add
key
=
"StartBlowValue"
value
=
"4"
/>
<
add
key
=
"StartBlowValue"
value
=
"4"
/>
<!-- 停止吹气的判断值(配置值=服务器发送的湿度值-停止吹气值)-->
<
add
key
=
"StopBlowValue"
value
=
"4"
/>
<
add
key
=
"StopBlowValue"
value
=
"4"
/>
<!--
Server
address
-->
<!--<
add
key
=
"http.server"
value
=
"http://localhost:80/"
/>-->
<!--
storeType
-->
<
add
key
=
"store_count"
value
=
"1"
/>
<
add
key
=
"store_count"
value
=
"1"
/>
<!--
start
one
store
config
-->
<
add
key
=
"Store_Position_Config"
value
=
"\StoreConfig\AC\linePositions.csv"
/>
<
add
key
=
"Store_ConfigPath"
value
=
"\StoreConfig\AC\StoreConfig.csv"
/>
<
add
key
=
"Store_Type"
value
=
"RC_AC_SA"
/>
<
add
key
=
"Store_CID"
value
=
"zhac1"
/>
<
add
key
=
"Store_Position_Config"
value
=
"\StoreConfig\AC\linePositions.csv"
/>
<
add
key
=
"Store_ConfigPath"
value
=
"\StoreConfig\AC\StoreConfig.csv"
/>
<
add
key
=
"Store_Type"
value
=
"RC_AC_SA"
/>
<
add
key
=
"Store_CID"
value
=
"zhac1"
/>
<!--
end
one
store
config
-->
<!--摄像机名称列表配置,用
#分割-->
<
add
key
=
"CameraName"
value
=
"GigE:MV-CE100-30GC (00C69898484)"
/>
<
add
key
=
"CameraName"
value
=
"GigE:MV-CE100-30GC (00C69898484)"
/>
<!--二维码类型列表配置,用
#分割,一维码=Barcode。-->
<
add
key
=
"CodeType"
value
=
"Barcode"
/>
<
add
key
=
"CodeType"
value
=
"Barcode"
/>
<!--<
add
key
=
"CodeType"
value
=
"Data Matrix ECC 200"
/>-->
<!--二维码参数文件所在路径,文件名与二维码类型名一样-->
<
add
key
=
"CodeParamPath"
value
=
"\CodeParam\"
/>
<
add
key
=
"AI_ConvertPosition"
value
=
"55"
/>
<
add
key
=
"InOutDefaultPosition"
value
=
"8000"
/>
<
add
key
=
"Config_Pwd"
value
=
"123456"
/>
<
add
key
=
"CodeParamPath"
value
=
"\CodeParam\"
/>
<
add
key
=
"AI_ConvertPosition"
value
=
"55"
/>
<
add
key
=
"InOutDefaultPosition"
value
=
"8000"
/>
<
add
key
=
"Config_Pwd"
value
=
"123456"
/>
<!--出库等待料盘拿走的时间,秒-->
<
add
key
=
"OutStoreWaitSeconds"
value
=
"600"
/>
<
add
key
=
"OutStoreWaitSeconds"
value
=
"600"
/>
<!--压紧轴对应
4
mm
的脉冲-->
<
add
key
=
"ComAxisChangeValue"
value
=
"2400"
/>
<
add
key
=
"ComAxisChangeValue"
value
=
"2400"
/>
<!--伺服波特率-->
<
add
key
=
"ACBaudRate"
value
=
"115200"
/>
</
appSettings
>
<
log4net
>
<
appender
name
=
"RollingLogFileAppender"
type
=
"log4net.Appender.RollingFileAppender"
>
<
file
value
=
"logs/ZHACStore1.log"
/>
<
appendToFile
value
=
"true"
/>
<
rollingStyle
value
=
"Date"
/>
<
datePattern
value
=
"yyyy-MM-dd"
/>
<
file
value
=
"logs/ZHACStore1.log"
/>
<
appendToFile
value
=
"true"
/>
<
rollingStyle
value
=
"Date"
/>
<
datePattern
value
=
"yyyy-MM-dd"
/>
<
layout
type
=
"log4net.Layout.PatternLayout"
>
<
conversionPattern
value
=
"[%date][%t]%-5p %m%n"
/>
<
conversionPattern
value
=
"[%date][%t]%-5p %m%n"
/>
</
layout
>
</
appender
>
<
root
>
<
level
value
=
"Info"
/>
<
appender
-
ref
ref
=
"RollingLogFileAppender"
/>
<
level
value
=
"Info"
/>
<
appender
-
ref
ref
=
"RollingLogFileAppender"
/>
</
root
>
</
log4net
>
<
startup
>
<
supportedRuntime
version
=
"v4.0"
sku
=
".NETFramework,Version=v4.
0"
/>
<
supportedRuntime
version
=
"v4.0"
sku
=
".NETFramework,Version=v4.
6.1"
/>
</
startup
>
<!-- 部署服务库项目时,必须将配置文件的内容添加到
主机的
app
.
config
文件中。
System
.
Configuration
不支持库的配置文件。 -->
...
...
@@ -63,14 +65,14 @@
<
service
name
=
"AcStoreWCF.CWSMDBox"
>
<
endpoint
address
=
""
binding
=
"basicHttpBinding"
contract
=
"AcStoreWCF.ICWSMDBox"
>
<
identity
>
<
dns
value
=
"localhost"
/>
<
dns
value
=
"localhost"
/>
</
identity
>
</
endpoint
>
<
endpoint
address
=
"mex"
binding
=
"mexHttpBinding"
contract
=
"IMetadataExchange"
/>
<
endpoint
address
=
"mex"
binding
=
"mexHttpBinding"
contract
=
"IMetadataExchange"
/>
<
host
>
<
baseAddresses
>
<
add
baseAddress
=
"http://localhost:8733/Design_Time_Addresses/AcStoreWCF/CWSMDBox/"
/>
<
add
baseAddress
=
"http://localhost:8733/Design_Time_Addresses/AcStoreWCF/CWSMDBox/"
/>
</
baseAddresses
>
</
host
>
</
service
>
...
...
@@ -80,11 +82,11 @@
<
behavior
>
<!-- 为避免泄漏元数据信息,
请在部署前将以下值设置为
false
-->
<
serviceMetadata
httpGetEnabled
=
"True"
httpsGetEnabled
=
"True"
/>
<
serviceMetadata
httpGetEnabled
=
"True"
httpsGetEnabled
=
"True"
/>
<!-- 要接收故障异常详细信息以进行调试,
请将以下值设置为
true
。在部署前设置为
false
以避免泄漏异常信息 -->
<
serviceDebug
includeExceptionDetailInFaults
=
"False"
/>
<
serviceDebug
includeExceptionDetailInFaults
=
"False"
/>
</
behavior
>
</
serviceBehaviors
>
</
behaviors
>
...
...
source/ACSingleStore/FrmAxisDebug.Designer.cs
查看文件 @
be18814
此文件的差异被折叠,
点击展开。
source/ACSingleStore/FrmAxisDebug.cs
查看文件 @
be18814
...
...
@@ -23,17 +23,19 @@ namespace OnlineStore.ACSingleStore
private
ConfigMoveAxis
updown
=
null
;
//private ConfigMoveAxis compress = null;
private
ConfigMoveAxis
inout
=
null
;
private
int
compress_Slv
=
0
;
private
ConfigMoveAxis
comp
=
null
;
//private int compress_Slv = 0;
public
static
readonly
ILog
LOGGER
=
LogManager
.
GetLogger
(
MethodBase
.
GetCurrentMethod
().
DeclaringType
);
public
FrmAxisDebug
(
AC_SA_BoxBean
boxBean
)
{
middle
=
boxBean
.
Config
.
Middle_Axis
;
updown
=
boxBean
.
Config
.
UpDown_Axis
;
compress_Slv
=
boxBean
.
Config
.
CompressAxis_Slv
;
//compress_Slv = boxBean.Config.CompressAxis_Slv;
comp
=
boxBean
.
Config
.
Comp_Axis
;
inout
=
boxBean
.
Config
.
InOut_Axis
;
InitializeComponent
();
txtComSpeed
.
Text
=
boxBean
.
Config
.
CompressAxis_EndSpeed
.
ToString
();
this
.
Text
=
boxBean
.
StoreName
+
"_轴点动调试"
;
}
...
...
@@ -48,7 +50,7 @@ namespace OnlineStore.ACSingleStore
txtMiddleSpeed
.
Text
=
(
middle
.
TargetSpeed
/
5
).
ToString
();
txtInOutSpeed
.
Text
=
(
inout
.
TargetSpeed
/
5
).
ToString
();
txtUpDownSpeed
.
Text
=
(
updown
.
TargetSpeed
/
5
).
ToString
();
txtComSpeed
.
Text
=
(
StoreManager
.
Config
.
CompressAxis_End
Speed
/
5
).
ToString
();
txtComSpeed
.
Text
=
(
comp
.
Target
Speed
/
5
).
ToString
();
timer1
.
Start
();
}
/// <summary>
...
...
@@ -246,6 +248,8 @@ namespace OnlineStore.ACSingleStore
}
private
void
btnComMove_MouseDown
(
object
sender
,
MouseEventArgs
e
)
{
if
(
btnComMove
.
BackColor
.
Equals
(
System
.
Drawing
.
SystemColors
.
Control
))
{
int
speed
=
FormUtil
.
GetIntValue
(
txtComSpeed
);
if
(
speed
<=
0
)
{
...
...
@@ -253,10 +257,8 @@ namespace OnlineStore.ACSingleStore
return
;
}
this
.
btnComMove
.
BackColor
=
Color
.
Green
;
ShuoKeControls
.
SetSpeed
(
compress_Slv
,
ShuoKeCMD
.
SetEndSpeed
,
speed
);
ShuoKeControls
.
SetSpeed
(
compress_Slv
,
ShuoKeCMD
.
SetMaxSpeed
,
speed
);
ShuoKeControls
.
VolMove
(
compress_Slv
,
speed
);
AxisMove
(
comp
,
speed
);
}
}
private
void
btnComMove_MouseUp
(
object
sender
,
MouseEventArgs
e
)
...
...
@@ -264,10 +266,8 @@ namespace OnlineStore.ACSingleStore
if
(
this
.
btnComMove
.
BackColor
==
Color
.
Green
)
{
btnComMove
.
BackColor
=
System
.
Drawing
.
SystemColors
.
Control
;
ShuoKeControls
.
SuddownStop
(
compress_Slv
);
// ShuoKeControls.GetABSPosition(compress_Slv);
txtComPosition
.
Text
=
ShuoKeControls
.
GetABSPosition
(
compress_Slv
).
ToString
();
ACServerManager
.
SuddenStop
(
comp
.
DeviceName
,
comp
.
GetAxisValue
());
UpdateCompPosition
();
}
}
private
void
btnComMovej_MouseDown
(
object
sender
,
MouseEventArgs
e
)
...
...
@@ -279,9 +279,7 @@ namespace OnlineStore.ACSingleStore
return
;
}
this
.
btnComMovej
.
BackColor
=
Color
.
Green
;
ShuoKeControls
.
SetSpeed
(
compress_Slv
,
ShuoKeCMD
.
SetEndSpeed
,
speed
);
ShuoKeControls
.
SetSpeed
(
compress_Slv
,
ShuoKeCMD
.
SetMaxSpeed
,
speed
);
ShuoKeControls
.
VolMove
(
compress_Slv
,-
speed
);
AxisMove
(
comp
,
-
speed
);
}
private
void
btnComMovej_MouseUp
(
object
sender
,
MouseEventArgs
e
)
...
...
@@ -289,9 +287,8 @@ namespace OnlineStore.ACSingleStore
if
(
btnComMovej
.
BackColor
.
Equals
(
Color
.
Green
))
{
btnComMovej
.
BackColor
=
System
.
Drawing
.
SystemColors
.
Control
;
ShuoKeControls
.
SuddownStop
(
compress_Slv
);
// ShuoKeControls.GetABSPosition(compress_Slv);
txtComPosition
.
Text
=
ShuoKeControls
.
GetABSPosition
(
compress_Slv
).
ToString
();
ACServerManager
.
SuddenStop
(
comp
.
DeviceName
,
comp
.
GetAxisValue
());
UpdateCompPosition
();
}
}
...
...
@@ -303,7 +300,6 @@ namespace OnlineStore.ACSingleStore
private
void
FrmAxisDebug_Shown
(
object
sender
,
EventArgs
e
)
{
SetSkin
(
this
);
}
private
void
timer1_Tick
(
object
sender
,
EventArgs
e
)
...
...
@@ -313,22 +309,18 @@ namespace OnlineStore.ACSingleStore
UpdateMiddlePosition
();
UpdateInOutPosition
();
UpdateUpdownPosition
();
txtComPosition
.
Text
=
ShuoKeControls
.
GetABSPosition
(
compress_Slv
).
ToString
();
//ShuoKeInfo info = ShuoKeControls.GetLastPosition(compress_Slv);
//if (info != null)
//{
// txtComPosition.Text = info.LastPosition.ToString();
// TimeSpan span = DateTime.Now - info.UpdateTime;
// if (span.TotalSeconds > 1.5)
// {
// ShuoKeControls.GetABSPosition(compress_Slv);
// }
//}
UpdateCompPosition
();
// txtComPosition.Text = ShuoKeControls.GetLastPosition(compress_Slv).ToString();
}
}
private
void
UpdateCompPosition
()
{
int
compPosition
=
ACServerManager
.
GetTargetPosition
(
comp
.
DeviceName
,
comp
.
GetAxisValue
());
if
(!
txtComPosition
.
Text
.
Equals
(
compPosition
.
ToString
()))
{
txtComPosition
.
Text
=
compPosition
.
ToString
();
}
}
private
void
UpdateUpdownPosition
()
{
int
updownPosition
=
ACServerManager
.
GetTargetPosition
(
updown
.
DeviceName
,
updown
.
GetAxisValue
());
...
...
@@ -355,5 +347,35 @@ namespace OnlineStore.ACSingleStore
txtInOutPosition
.
Text
=
inoutPosition
.
ToString
();
}
}
private
void
trackBar1_ValueChanged
(
object
sender
,
EventArgs
e
)
{
int
value
=
trackBar1
.
Value
;
lblSpeed
.
Text
=
"点动速度="
+
(
value
/
10f
)
+
"倍目标速度"
;
txtMiddleSpeed
.
Text
=
(
middle
.
TargetSpeed
*
value
/
10
).
ToString
();
txtInOutSpeed
.
Text
=
(
inout
.
TargetSpeed
*
value
/
10
).
ToString
();
txtUpDownSpeed
.
Text
=
(
updown
.
TargetSpeed
*
value
/
10
).
ToString
();
txtComSpeed
.
Text
=
(
comp
.
TargetSpeed
*
value
/
10
).
ToString
();
}
private
void
btnMCopy_Click
(
object
sender
,
EventArgs
e
)
{
Clipboard
.
SetDataObject
(
txtMiddlePosition
.
Text
,
true
);
}
private
void
btnUCopy_Click
(
object
sender
,
EventArgs
e
)
{
Clipboard
.
SetDataObject
(
txtUpdownPosition
.
Text
,
true
);
}
private
void
btnICopy_Click
(
object
sender
,
EventArgs
e
)
{
Clipboard
.
SetDataObject
(
txtInOutPosition
.
Text
,
true
);
}
private
void
btnCCopy_Click
(
object
sender
,
EventArgs
e
)
{
Clipboard
.
SetDataObject
(
txtComPosition
.
Text
,
true
);
}
}
}
source/ACSingleStore/FrmStoreBox.Designer.cs
查看文件 @
be18814
此文件的差异太大,无法显示。
source/ACSingleStore/FrmStoreBox.cs
查看文件 @
be18814
此文件的差异被折叠,
点击展开。
source/ACSingleStore/Properties/Resources.Designer.cs
查看文件 @
be18814
...
...
@@ -47,7 +47,7 @@ namespace OnlineStore.ACSingleStore.Properties {
}
/// <summary>
///
使用此强类型资源类,为所有资源查找
///
重写当前线程的 CurrentUICulture 属性
/// 重写当前线程的 CurrentUICulture 属性。
/// </summary>
[
global
::
System
.
ComponentModel
.
EditorBrowsableAttribute
(
global
::
System
.
ComponentModel
.
EditorBrowsableState
.
Advanced
)]
...
...
source/ACSingleStore/Properties/Settings.Designer.cs
查看文件 @
be18814
...
...
@@ -12,7 +12,7 @@ namespace OnlineStore.ACSingleStore.Properties {
[
global
::
System
.
Runtime
.
CompilerServices
.
CompilerGeneratedAttribute
()]
[
global
::
System
.
CodeDom
.
Compiler
.
GeneratedCodeAttribute
(
"Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator"
,
"15.
6
.0.0"
)]
[
global
::
System
.
CodeDom
.
Compiler
.
GeneratedCodeAttribute
(
"Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator"
,
"15.
9
.0.0"
)]
internal
sealed
partial
class
Settings
:
global
::
System
.
Configuration
.
ApplicationSettingsBase
{
private
static
Settings
defaultInstance
=
((
Settings
)(
global
::
System
.
Configuration
.
ApplicationSettingsBase
.
Synchronized
(
new
Settings
())));
...
...
source/ACSingleStore/positionTool/FrmPositionTool.Designer.cs
0 → 100644
查看文件 @
be18814
此文件的差异被折叠,
点击展开。
source/ACSingleStore/positionTool/FrmPositionTool.cs
0 → 100644
查看文件 @
be18814
此文件的差异被折叠,
点击展开。
source/ACSingleStore/positionTool/FrmPositionTool.resx
0 → 100644
查看文件 @
be18814
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="timer1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
</root>
\ No newline at end of file
source/ACSingleStore/记录.txt
查看文件 @
be18814
...
...
@@ -87,3 +87,53 @@ bug修改:压紧轴点动时实时坐标更新。
增加压紧轴复位的配置。
StoreConfig.csv增加:
PRO,出入库多少次自动复位压紧轴,Box_ResetCCount,3,,,,,,,
20191210修改:
压紧轴改为伺服控制:
1.以前的三个轴波特率为9600,压紧轴的波特率需要一致.
2.所有压紧轴相关的位置都要重新配置,压紧轴回原点是向上的,位置都是正整数。
配置修改:
StoreConfig.csv删除原来的步进电机配置:
PRO,硕科步进电机(压紧轴)控制端口号,CompressAxis_PortName,COM3,,,,,,,
PRO,硕科步进电机(压紧轴)控制波特率,CompressAxis_PortBaudrate,9600,,,,,,,
PRO,硕科步进电机(压紧轴)控制奇偶校验,CompressAxis_PortParity,0,,,,,,,
PRO,硕科步进电机(压紧轴)控制停止位,CompressAxis_StopBits,1,,,,,,,
PRO,硕科步进电机(压紧轴)控制初速度,CompressAxis_StartSpeed,5000,,,,,,,
PRO,硕科步进电机(压紧轴)控制最大速度,CompressAxis_MaxSpeed,8000,,,,,,,
PRO,硕科步进电机(压紧轴)控制末速度,CompressAxis_EndSpeed,6000,,,,,,,
PRO,硕科步进电机(压紧轴)控制加速度,CompressAxis_AddSpeed,3000,,,,,,,
PRO,硕科步进电机(压紧轴)控制减速度,CompressAxis_DelSpeed,3000,,,,,,,
PRO,硕科步进电机(压紧轴)控制归零速度(原点返回速度),CompressAxis_HomeSpeed,5000,,,,,,,
PRO,硕科步进电机轴地址(压紧轴),CompressAxis_Slv,1,,,,,,,
增加压紧轴配置:
,,,,,,,,, ,
AXIS,(轴四)压紧轴,Comp_Axis,4,COM1,0,,,,,
PRO,(轴四)压紧轴目标速度,CompAxis_TargetSpeed,100,,,,,,,
PRO,(轴四)压紧轴加速度,CompAxis_AddSpeed,300,,,,,,,
PRO,(轴四)压紧轴减速度,CompAxis_DelSpeed,300,,,,,,,
PRO,(轴四)压紧轴原点低速,CompAxis_HomeLowSpeed,20,,,,,,,
PRO,(轴四)压紧轴原点高速,CompAxis_HomeHighSpeed,60,,,,,,,
PRO,(轴四)压紧轴原点加速度,CompAxis_HomeAddSpeed,200,,,,,,,
PRO,压紧轴(轴4)P1速度,CompAxis_P1_Speed,100,,,,,,,
PRO,压紧轴(轴4)P2速度,CompAxis_P2_Speed,100,,,,,,,
PRO,压紧轴(轴4)P3速度,CompAxis_P3_Speed,100,,,,,,,
,,,,,,,
20200301
增加升降轴调试功能
20200305
进出轴回待机点时,原点信号必须亮。
20200311
扫码更新为最新版本。
source/Common/Setting_Init.cs
查看文件 @
be18814
...
...
@@ -79,5 +79,15 @@ namespace OnlineStore.Common
/// 压紧轴1mm对应的脉冲
/// </summary>
public
static
string
ComAxisChangeValue
=
"ComAxisChangeValue"
;
public
static
string
ACBaudRate
=
"ACBaudRate"
;
public
static
string
Tool_P3_Offset
=
"Tool_P3_Offset"
;
public
static
string
Tool_P4_Offset
=
"Tool_P4_Offset"
;
public
static
string
Tool_P5_Offset
=
"Tool_P5_Offset"
;
public
static
string
Tool_P6_Offset
=
"Tool_P6_Offset"
;
public
static
string
Tool_TargetSpeed
=
"Tool_TargetSpeed"
;
public
static
string
Tool_TargetPosition
=
"Tool_TargetPosition"
;
}
}
source/Common/util/AcSerialBean.cs
查看文件 @
be18814
...
...
@@ -282,13 +282,13 @@ namespace OnlineStore.Common
/// <param name="ReceiveData">接收数据</param>
/// <param name="Overtime">超时时间</param>
/// <returns></returns>
public
int
SendCommand
(
byte
[]
SendData
,
ref
byte
[]
ReceiveData
,
int
Overtime
,
out
bool
isOk
)
public
int
SendCommand
(
byte
[]
SendData
,
ref
byte
[]
ReceiveData
,
int
Overtime
,
out
bool
isOk
)
{
isOk
=
false
;
if
(
_serialPort
.
IsOpen
)
{
//lock (lockObj)
if
(
Monitor
.
TryEnter
(
lockObj
,
1
0
))
if
(
Monitor
.
TryEnter
(
lockObj
,
Overtime
+
5
0
))
{
//Monitor.Enter(lockObj);
try
...
...
@@ -339,7 +339,7 @@ namespace OnlineStore.Common
return
-
1
;
}
private
byte
PreSlvAddr
=
0
;
/// <summary>
/// 发送命令
/// </summary>
...
...
@@ -352,17 +352,28 @@ namespace OnlineStore.Common
{
if
(
_serialPort
==
null
)
{
LogUtil
.
error
(
PortName
+
" 发送数据"
+
ByteToString
(
SendData
)
+
"失败,_serialPort=null"
);
LogUtil
.
error
(
PortName
+
" 发送数据"
+
ByteToString
(
SendData
)
+
"失败,_serialPort=null"
);
return
-
1
;
}
if
(
_serialPort
.
IsOpen
)
{
if
(
Monitor
.
TryEnter
(
lockObj
,
1
))
if
(
Monitor
.
TryEnter
(
lockObj
,
Overtime
+
80
))
{
//Monitor.Enter(lockObj);
try
{
//判断是否需要休眠
if
(
SendData
!=
null
&&
SendData
.
Length
>
0
)
{
if
(!
SendData
[
0
].
Equals
(
PreSlvAddr
))
{
Thread
.
Sleep
(
50
);
PreSlvAddr
=
SendData
[
0
];
}
}
_serialPort
.
DiscardInBuffer
();
//清空接收缓冲区
_serialPort
.
Write
(
SendData
,
0
,
SendData
.
Length
);
int
num
=
0
,
ret
=
0
;
...
...
@@ -395,7 +406,7 @@ namespace OnlineStore.Common
}
catch
(
Exception
ex
)
{
LogUtil
.
error
(
PortName
+
" 发送数据"
+
ByteToString
(
SendData
)
+
" 出错:"
+
ex
.
ToString
());
LogUtil
.
error
(
PortName
+
" 发送数据"
+
ByteToString
(
SendData
)
+
" 出错:"
+
ex
.
ToString
());
}
finally
{
...
...
source/DeviceLibrary/DeviceLibrary.csproj
查看文件 @
be18814
...
...
@@ -9,7 +9,7 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>OnlineStore.DeviceLibrary</RootNamespace>
<AssemblyName>DeviceLibrary</AssemblyName>
<TargetFrameworkVersion>v4.
0
</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.
6.1
</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<TargetFrameworkProfile />
</PropertyGroup>
...
...
@@ -67,8 +67,6 @@
<Compile Include="PanasonicServo\ACCMDManager.cs" />
<Compile Include="PanasonicServo\ACServerManager.cs" />
<Compile Include="PanasonicServo\ACServerManager_Partial.cs" />
<Compile Include="ShuoKe\MeteringSignalBean.cs" />
<Compile Include="ShuoKe\ShuoKeController.cs" />
<Compile Include="store\LineMoveP.cs" />
<Compile Include="store\LineAlarm.cs">
<SubType>Code</SubType>
...
...
source/DeviceLibrary/KangNaiDe/KNDAIManager.cs
查看文件 @
be18814
...
...
@@ -128,6 +128,11 @@ namespace OnlineStore.DeviceLibrary
try
{
isProcess
=
true
;
if
(
StoreManager
.
Store
==
null
)
{
isProcess
=
false
;
return
;
}
bool
IsNeedReadAI
=
StoreManager
.
Store
.
KNDIOValue
(
IO_Type
.
TrayCheck_Door
).
Equals
(
IO_VALUE
.
HIGH
);
IsNeedReadAI
=
(
IsNeedReadAI
||
NeedReadAI
);
TimeSpan
span
=
DateTime
.
Now
-
PreCheckTime
;
...
...
source/DeviceLibrary/KangNaiDe/KNDManager.cs
查看文件 @
be18814
...
...
@@ -21,24 +21,17 @@ namespace OnlineStore.DeviceLibrary
public
static
ushort
DoStartAddress
=
100
;
public
static
ushort
DefualtLength
=
16
;
private
static
byte
DefualtSlaveID
=
255
;
public
static
readonly
ILog
LOGGER
=
LogManager
.
GetLogger
(
MethodBase
.
GetCurrentMethod
().
DeclaringType
);
public
static
Dictionary
<
string
,
MasterTcpClient
>
mastMap
=
new
Dictionary
<
string
,
MasterTcpClient
>();
public
static
Dictionary
<
string
,
List
<
KNDIO
>>
DIValueMap
=
new
Dictionary
<
string
,
List
<
KNDIO
>>();
public
static
Dictionary
<
string
,
List
<
KNDIO
>>
DOValueMap
=
new
Dictionary
<
string
,
List
<
KNDIO
>>();
private
static
readonly
ILog
LOGGER
=
LogManager
.
GetLogger
(
MethodBase
.
GetCurrentMethod
().
DeclaringType
);
private
static
Dictionary
<
string
,
MasterTcpClient
>
mastMap
=
new
Dictionary
<
string
,
MasterTcpClient
>();
private
static
Dictionary
<
string
,
List
<
KNDIO
>>
DIValueMap
=
new
Dictionary
<
string
,
List
<
KNDIO
>>();
private
static
Dictionary
<
string
,
List
<
KNDIO
>>
DOValueMap
=
new
Dictionary
<
string
,
List
<
KNDIO
>>();
private
static
object
DIMapLock
=
""
;
private
static
object
DOMapLock
=
""
;
public
static
System
.
Timers
.
Timer
timer
=
null
;
private
static
System
.
Timers
.
Timer
timer
=
null
;
private
static
bool
isWrite
=
false
;
public
static
void
ConnectionIP
(
string
ioIp
,
ushort
port
)
private
static
void
ConnectionIP
(
string
ioIp
,
ushort
port
)
{
if
(
timer
==
null
)
{
timer
=
new
System
.
Timers
.
Timer
();
timer
.
Interval
=
300
;
timer
.
AutoReset
=
true
;
timer
.
Elapsed
+=
timer_Elapsed
;
timer
.
Enabled
=
true
;
}
MasterTcpClient
MBmaster
=
null
;
if
(
mastMap
.
ContainsKey
(
ioIp
))
{
...
...
@@ -77,13 +70,19 @@ namespace OnlineStore.DeviceLibrary
mastMap
.
Add
(
ioIp
,
MBmaster
);
Thread
.
Sleep
(
10
);
if
(
MBmaster
.
connected
)
{
LogUtil
.
info
(
"连接IO模块["
+
ioIp
+
"]成功"
);
//读取所有的DO
ReadMultipleDO
(
ioIp
,
DefualtSlaveID
,
DoStartAddress
,
DefualtLength
);
MBmaster
.
ReadCoils
(
1
,
DoStartAddress
,
DefualtLength
,
DefualtSlaveID
);
}
else
{
LogUtil
.
info
(
"连接IO模块["
+
ioIp
+
"]失败,等待重连"
);
}
}
catch
(
Exception
error
)
{
LogUtil
.
error
(
LOGGER
,
"连接IO模块["
+
ioIp
+
"]出错:"
+
error
.
ToString
());
LogUtil
.
error
(
LOGGER
,
"连接IO模块["
+
ioIp
+
"]出错:"
+
error
.
ToString
());
}
}
/// <summary>
...
...
@@ -130,7 +129,7 @@ namespace OnlineStore.DeviceLibrary
}
catch
(
Exception
ex
)
{
LogUtil
.
error
(
LOGGER
,
"出错啦:"
+
ex
.
ToString
()
);
LogUtil
.
error
(
LOGGER
,
"出错啦:"
+
ex
.
StackTrace
);
}
Thread
.
Sleep
(
1
);
}
...
...
@@ -143,13 +142,21 @@ namespace OnlineStore.DeviceLibrary
{
ConnectionIP
(
ip
,
port
);
}
}
public
static
void
ConnectionKND
(
string
ip
)
if
(
timer
==
null
)
{
//端口号暂时使用固定的502;
ushort
port
=
502
;
ConnectionIP
(
ip
,
port
);
timer
=
new
System
.
Timers
.
Timer
();
timer
.
Interval
=
1000
;
timer
.
AutoReset
=
true
;
timer
.
Elapsed
+=
timer_Elapsed
;
timer
.
Enabled
=
true
;
}
}
//public static void ConnectionKND(string ip)
//{
// //端口号暂时使用固定的502;
// ushort port = 502;
// ConnectionIP(ip, port);
//}
public
static
void
ReadMultipleDI
(
string
ioIp
,
byte
slaveId
,
ushort
StartAddress
,
ushort
length
)
{
isWrite
=
true
;
...
...
@@ -188,8 +195,14 @@ namespace OnlineStore.DeviceLibrary
isWrite
=
true
;
foreach
(
string
key
in
mastMap
.
Keys
)
{
byte
[]
data
=
new
byte
[]
{
0
,
0
};
try
{
byte
[]
data
=
new
byte
[]
{
0
,
0
};
WriteMultipleDO
(
key
,
DefualtSlaveID
,
DoStartAddress
,
DefualtLength
,
data
);
}
catch
(
Exception
ex
)
{
LogUtil
.
error
(
"CloseAllDO出错:"
+
ex
.
ToString
());
}
}
isWrite
=
false
;
}
...
...
source/DeviceLibrary/PanasonicServo/ACCMDManager.cs
查看文件 @
be18814
...
...
@@ -11,8 +11,16 @@ namespace OnlineStore.DeviceLibrary
/// 0132h 原点接近传感器输入 (HOME) 状态 ReadOnly 0: 输入 OFF 1: 输入 ON
/// </summary>
public
static
string
Home_Single
=
"0132"
;
// 0022h 负方向驱动禁止输入(NOT) ReadOnly 0: 输入 OFF、 1: 输入 ON
// 0023h 正方向驱动禁止输入(POT) ReadOnly 0: 输入 OFF、 1: 输入 ON
/// <summary>
/// 0022h 负方向驱动禁止输入(NOT) ReadOnly 0: 输入 OFF、 1: 输入 ON
/// </summary>
public
static
string
Limit_Negative_Single
=
"0022"
;
/// <summary>
/// 0023h 正方向驱动禁止输入(POT) ReadOnly 0: 输入 OFF、 1: 输入 ON
/// </summary>
public
static
string
Limit_Positive_Single
=
"0023"
;
/// <summary>
///速度 4601
/// </summary>
...
...
@@ -320,6 +328,7 @@ namespace OnlineStore.DeviceLibrary
//sendData[4] = dataByte[1];
//sendData[5] = dataByte[0];
}
sendData
=
buildCheckData
(
sendData
,
sendData
.
Length
-
2
);
...
...
source/DeviceLibrary/PanasonicServo/ACServerManager.cs
查看文件 @
be18814
此文件的差异被折叠,
点击展开。
source/DeviceLibrary/PanasonicServo/ACServerManager_Partial.cs
查看文件 @
be18814
此文件的差异被折叠,
点击展开。
source/DeviceLibrary/StoreConfig/AC/StoreConfig.csv
查看文件 @
be18814
...
...
@@ -32,8 +32,8 @@ DO,相机照明开,CameraLight_Power,110,192.168.200.11,0,相机照明开,Y11,DO-11,0,
DO,允许放料信号,CanPutTray,114,192.168.200.11,0,允许放料信号,Y15,DO-15,0,
DO,可取料信号,CanGetTray,115,192.168.200.11,0,可取料信号,Y16,DO-16,0,
AXIS,(轴一)旋转轴,Middle_Axis,1,COM6,0,,,,,
AXIS,(轴二)升降轴轴,UpDown_Axis,
1,COM5
,0,,,,,
AXIS,(轴三)进出轴,InOut_Axis,
1,COM4
,0,,,,,
AXIS,(轴二)升降轴轴,UpDown_Axis,
2,COM6
,0,,,,,
AXIS,(轴三)进出轴,InOut_Axis,
3,COM6
,0,,,,,
,温湿度传感器地址,Temperate_ServerAddress,192.168.200.34,,,,,,,
,扫码枪IP,Scanner_Ip,192.168.200.33,,,,,,,
,扫码枪端口号,Scanner_Port,51236,,,,,,,
...
...
@@ -43,7 +43,7 @@ PRO,升降轴 进料口取料缓冲点 P7,UpDownAxis_DoorOBPosition_P7,415000,,,,,,,
PRO,升降轴 进料口出料缓冲点 P8,UpDownAxis_DoorIBPosition_P8,403000,,,,,,,
PRO,旋转轴(轴1)P1 待机原位点,MiddleAxis_P1_Position,268093,,,,,,,
PRO,进出轴(轴3)P1待机原位点,InOutAxis_P1_Position,1000,,,,,,,
PRO,压紧轴(轴4)P1待机原位点,CompressAxis_P1_Position,
-75
00,,,,,,,
PRO,压紧轴(轴4)P1待机原位点,CompressAxis_P1_Position,
100
00,,,,,,,
PRO,是否使用定位气缸,IsHasLocationCylinder,0,,,,,,,
PRO,是否有左右侧门,IsHasDoorLimit,1,,,,,,,
PRO,是否使用压紧轴(1=使用),IsHasCompress_Axis,1,,,,, ,,
...
...
@@ -70,6 +70,7 @@ PRO,(轴三)进出轴减速度,InoutAxis_DelSpeed,300,,,,,,,
PRO,(轴三)进出轴原点低速,InoutAxis_HomeLowSpeed,20,,,,,,,
PRO,(轴三)进出轴原点高速,InoutAxis_HomeHighSpeed,60,,,,,,,
PRO,(轴三)进出轴原点加速度,InoutAxis_HomeAddSpeed,200,,,,,,,
PRO,升降轴(轴2)P1速度,UpDownAxis_P1_Speed,250,,,,,,,
PRO,升降轴(轴2)P2速度,UpDownAxis_P2_Speed,250,,,,,,,
PRO,升降轴(轴2)P3速度,UpDownAxis_P3_Speed,250,,,,,,,
...
...
@@ -106,18 +107,6 @@ PRO,每次吹气的时间(分钟),BlowAir_Time,10,,,,,,,
PRO,两次吹气间隔(分钟),BlowAir_Interval,10,,,,,,,
PRO,温湿度端口号,Humiture_Port,COM1,,,,,,,
,,,,,,,,, ,
PRO,硕科步进电机(压紧轴)控制端口号,CompressAxis_PortName,COM3,,,,,,,
PRO,硕科步进电机(压紧轴)控制波特率,CompressAxis_PortBaudrate,9600,,,,,,,
PRO,硕科步进电机(压紧轴)控制奇偶校验,CompressAxis_PortParity,0,,,,,,,
PRO,硕科步进电机(压紧轴)控制停止位,CompressAxis_StopBits,1,,,,,,,
PRO,硕科步进电机(压紧轴)控制初速度,CompressAxis_StartSpeed,5000,,,,,,,
PRO,硕科步进电机(压紧轴)控制最大速度,CompressAxis_MaxSpeed,8000,,,,,,,
PRO,硕科步进电机(压紧轴)控制末速度,CompressAxis_EndSpeed,6000,,,,,,,
PRO,硕科步进电机(压紧轴)控制加速度,CompressAxis_AddSpeed,3000,,,,,,,
PRO,硕科步进电机(压紧轴)控制减速度,CompressAxis_DelSpeed,3000,,,,,,,
PRO,硕科步进电机(压紧轴)控制归零速度(原点返回速度),CompressAxis_HomeSpeed,5000,,,,,,,
PRO,硕科步进电机轴地址(压紧轴),CompressAxis_Slv,1,,,,,,,
,,,,,,,,, ,
PRO,模拟量IO模块的IP地址,AIDevice_IP,192.168.200.12,,,,,,,
PRO,模拟信号1默认高度,AIDI1_DefaultPosition,2920,,,,,,,
PRO,模拟信号2默认高度,AIDI2_DefaultPosition,2960,,,,,,,
...
...
@@ -125,3 +114,15 @@ PRO,模拟信号3默认高度,AIDI3_DefaultPosition,2500,,,,,,,
,,,,,,,,, ,
PRO,模拟信号1的地址,AIDI1_Addr,7,,,,,,,
PRO,模拟信号2的地址,AIDI2_Addr,8,,,,,,,
,,,,,,,,, ,
AXIS,(轴四)压紧轴,Comp_Axis,4,COM6,0,,,,,
PRO,(轴四)压紧轴目标速度,CompAxis_TargetSpeed,100,,,,,,,
PRO,(轴四)压紧轴加速度,CompAxis_AddSpeed,300,,,,,,,
PRO,(轴四)压紧轴减速度,CompAxis_DelSpeed,300,,,,,,,
PRO,(轴四)压紧轴原点低速,CompAxis_HomeLowSpeed,20,,,,,,,
PRO,(轴四)压紧轴原点高速,CompAxis_HomeHighSpeed,60,,,,,,,
PRO,(轴四)压紧轴原点加速度,CompAxis_HomeAddSpeed,200,,,,,,,
PRO,压紧轴(轴4)P1速度,CompAxis_P1_Speed,100,,,,,,,
PRO,压紧轴(轴4)P2速度,CompAxis_P2_Speed,100,,,,,,,
PRO,压紧轴(轴4)P3速度,CompAxis_P3_Speed,100,,,,,,,
,,,,,,,
source/DeviceLibrary/acSingleStore/AC_SA_BoxBean.cs
查看文件 @
be18814
此文件的差异被折叠,
点击展开。
source/DeviceLibrary/acSingleStore/AC_SA_BoxBean_Partial.cs
查看文件 @
be18814
此文件的差异被折叠,
点击展开。
source/DeviceLibrary/acSingleStore/StoreManager.cs
查看文件 @
be18814
...
...
@@ -29,24 +29,6 @@ namespace OnlineStore.DeviceLibrary
public
StoreManager
()
{
}
public
static
bool
OpenShuoKe
(
AC_SA_BoxBean
box
)
{
//打开硕科步进驱动器端口
Parity
parity
=
(
Parity
)
box
.
Config
.
CompressAxis_PortParity
;
StopBits
bit
=
(
StopBits
)
box
.
Config
.
CompressAxis_StopBits
;
bool
result
=
ShuoKeControls
.
InitPort
(
box
.
Config
.
CompressAxis_PortName
,
box
.
Config
.
CompressAxis_PortBaudrate
,
box
.
Config
.
CompressAxis_PortParity
,
8
,
bit
);
if
(
result
)
{
LogUtil
.
info
(
box
.
StoreName
+
"打开硕科步进控制器【"
+
box
.
Config
.
CompressAxis_PortName
+
"】成功"
);
return
true
;
}
else
{
LogUtil
.
error
(
box
.
StoreName
+
"打开硕科步进控制器【"
+
box
.
Config
.
CompressAxis_PortName
+
"】失败,启动失败!"
);
return
false
;
}
}
public
static
void
CheckEnum
(
Type
type
)
{
if
(
type
.
IsEnum
)
...
...
source/DeviceLibrary/halcon/CodeManager.cs
查看文件 @
be18814
...
...
@@ -4,6 +4,7 @@ using OnlineStore.Common;
using
System
;
using
System.Collections.Generic
;
using
System.Drawing
;
using
System.Drawing.Imaging
;
using
System.IO
;
using
System.Linq
;
using
System.Runtime.ExceptionServices
;
...
...
@@ -18,7 +19,7 @@ namespace OnlineStore.DeviceLibrary
public
static
List
<
string
>
cameraNameList
=
new
List
<
string
>();
public
static
List
<
string
>
codeTypeList
=
new
List
<
string
>();
public
static
List
<
string
>
balserNameList
=
new
List
<
string
>();
//
public static List<string> balserNameList = new List<string>();
public
static
List
<
string
>
hikNameList
=
new
List
<
string
>();
private
static
char
spiltChar
=
'#'
;
...
...
@@ -43,22 +44,15 @@ namespace OnlineStore.DeviceLibrary
string
[]
codeArray
=
codeStr
.
Split
(
spiltChar
);
foreach
(
string
str
in
codeArray
)
{
if
(
str
.
Trim
().
Equals
(
""
))
{
continue
;
}
LogUtil
.
info
(
"加载到配置二维码类型:"
+
str
.
Trim
());
codeTypeList
.
Add
(
str
.
Trim
());
}
string
[]
names
=
CodeLibrary
.
HIKCamera
.
Instance
.
CameraName
;
hikNameList
.
AddRange
(
names
);
foreach
(
string
str
in
names
)
{
LogUtil
.
info
(
"加载到HIK相机:"
+
str
.
Trim
());
}
names
=
CodeLibrary
.
BaslerCamera
.
Instance
.
CameraName
;
balserNameList
.
AddRange
(
names
);
foreach
(
string
str
in
names
)
{
LogUtil
.
info
(
"加载到Balser相机:"
+
str
.
Trim
());
}
LoadCamera
(
false
);
CodeLibrary
.
HDCodeLearnHelper
.
LoadConfig
(
nameStr
,
codeStr
);
}
...
...
@@ -67,70 +61,70 @@ namespace OnlineStore.DeviceLibrary
LogUtil
.
error
(
"解析摄像机配置出错:"
+
ex
.
ToString
());
}
}
public
static
void
CloseCamera
()
private
static
void
LoadCamera
(
bool
isReLoad
)
{
BaslerCamera
.
Instance
.
Close
();
HIKCamera
.
Instance
.
Close
();
}
public
static
Bitmap
GetCamerImage
(
string
cameraName
)
if
(
isReLoad
||
Camera
.
_cam
==
null
)
{
Bitmap
bitm
=
null
;
try
{
if
(
balserNameList
.
Contains
(
cameraName
))
{
bool
result
=
BaslerCamera
.
Instance
.
IsOpen
;
if
(!
result
)
if
(
Camera
.
_cam
!=
null
)
{
result
=
BaslerCamera
.
Instance
.
Open
(
cameraName
);
LogUtil
.
info
(
"打开相机:"
+
cameraName
+
"("
+
result
+
")"
);
Camera
.
_cam
.
CloseAll
();
}
if
(
result
)
{
BaslerCamera
.
Instance
.
GrabOne
();
bitm
=
BaslerCamera
.
Instance
.
Image
;
//BaslerCamera.Instance.Close();
Camera
.
Type
=
CameraType
.
HIK
;
Camera
.
_cam
.
Load
();
}
else
catch
(
Exception
ex
)
{
LogUtil
.
error
(
"相机【"
+
cameraName
+
"】打开失败:"
+
BaslerCamera
.
Instance
.
ErrInfo
);
LogUtil
.
error
(
"加载HIK相机出错:"
+
ex
.
ToString
()
);
}
}
else
if
(
hikNameList
.
Contains
(
cameraName
))
{
bool
result
=
HIKCamera
.
Instance
.
IsOpen
;
if
(!
result
)
string
[]
names
=
Camera
.
_cam
.
Name
;
if
(
names
!=
null
)
{
result
=
HIKCamera
.
Instance
.
Open
(
cameraName
);
LogUtil
.
info
(
"打开相机:"
+
cameraName
+
"("
+
result
+
")"
);
}
if
(
result
)
foreach
(
string
n
in
names
)
{
HIKCamera
.
Instance
.
GrabOne
();
bitm
=
HIKCamera
.
Instance
.
Image
;
//HIKCamera.Instance.Close();
}
else
if
(!
hikNameList
.
Contains
(
n
))
{
LogUtil
.
error
(
"相机【"
+
cameraName
+
"】打开失败:"
+
HIKCamera
.
Instance
.
ErrInfo
);
hikNameList
.
Add
(
n
);
}
}
else
// hikNameList.AddRange(names);
foreach
(
string
name
in
hikNameList
)
{
LogUtil
.
info
(
"
未找到相机【"
+
cameraName
+
"】无法获取图片"
);
LogUtil
.
info
(
"
加载到HIK相机:"
+
name
);
}
}
catch
(
Exception
ex
)
}
public
static
void
CloseCamera
(
string
cameraName
)
{
LogUtil
.
error
(
"从相机【"
+
cameraName
+
"】获取图片出错:"
+
ex
.
ToString
()
);
Camera
.
_cam
.
Close
(
cameraName
);
}
return
bitm
;
public
static
void
CloseAllCamera
()
{
//BaslerCamera.Instance.Close();
//HIKCamera.Instance.Close();
Camera
.
_cam
.
CloseAll
();
}
//public static Bitmap GetCamerImage(string cameraName)
//{
// Bitmap bitm = null;
// try
// {
// bitm = Camera._cam.GrabOneImage(cameraName);
// }
// catch (Exception ex)
// {
// LogUtil.error(" 【" + cameraName + "】获取图片出错:" + ex.ToString());
// }
// return bitm;
//}
[
HandleProcessCorruptedStateExceptions
]
public
static
List
<
string
>
CameraScan
(
)
public
static
List
<
string
>
CameraScan
()
{
List
<
string
>
codeList
=
new
List
<
string
>();
List
<
CodeInfo
>
allCodeList
=
new
List
<
CodeInfo
>();
...
...
@@ -139,19 +133,21 @@ namespace OnlineStore.DeviceLibrary
{
foreach
(
string
cameraName
in
cameraNameList
)
{
using
(
Bitmap
bitmap
=
GetCamerImage
(
cameraName
))
HalconDotNet
.
HObject
ho_Image
=
null
;
try
{
if
(
bitmap
==
null
)
ho_Image
=
Camera
.
_cam
.
CaptureOnImage
(
cameraName
);
if
(
ho_Image
==
null
)
{
LogUtil
.
error
(
"
摄像机【"
+
cameraName
+
"】获取图片失败
,关闭相机"
);
CloseCamera
();
LogUtil
.
error
(
"
【"
+
cameraName
+
"】取图片失败["
+
Camera
.
_cam
.
ErrInfo
+
"]
,关闭相机"
);
CloseCamera
(
cameraName
);
continue
;
}
LogUtil
.
debug
(
" 摄像机【"
+
cameraName
+
"】获取图片完成"
);
System
.
Threading
.
Thread
.
Sleep
(
1
);
HObject
ho_Image
=
HDCodeHelper
.
Bitmap2HObjectBpp24
(
bitmap
);
LogUtil
.
debug
(
" 摄像机
【"
+
cameraName
+
"】转换图片完成,开始扫码"
);
//Bitmap bit = new Bitmap(bitmap);
//
LogUtil.debug(" 摄像机【" + cameraName + "】获取图片完成");
//
System.Threading.Thread.Sleep(1);
//HObject ho_Image = HDCodeHelper.Bitmap2HObjectBpp24(bit
);
LogUtil
.
info
(
"
【"
+
cameraName
+
"】转换图片完成,开始扫码"
);
List
<
CodeInfo
>
cc
=
new
List
<
CodeInfo
>();
foreach
(
string
codeType
in
codeTypeList
)
{
...
...
@@ -164,22 +160,39 @@ namespace OnlineStore.DeviceLibrary
{
cc
=
HDCodeHelper
.
DecodeCode
(
ho_Image
,
1
,
GetCodeParamFilePath
(
codeType
),
codeType
);
}
//LogUtil.info(" 摄像机
【" + cameraName + "】【"+ codeType + "】扫码完成");
LogUtil
.
info
(
"
【"
+
cameraName
+
"】【"
+
codeType
+
"】扫码完成"
);
}
allCodeList
.
AddRange
(
cc
);
}
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
)
{
ho_Image
.
Dispose
();
}
}
}
}
catch
(
AccessViolationException
e
)
{
LogUtil
.
error
(
"扫码出现AccessViolationException异常:"
+
e
.
ToString
());
GC
.
Collect
();
//
GC.Collect();
}
catch
(
Exception
ex
)
{
LogUtil
.
error
(
"扫码出错:"
+
ex
.
ToString
());
}
foreach
(
CodeInfo
info
in
allCodeList
)
foreach
(
CodeInfo
info
in
allCodeList
)
{
codeList
.
Add
(
info
.
CodeStr
);
}
...
...
@@ -204,3 +217,4 @@ namespace OnlineStore.DeviceLibrary
}
}
source/DeviceLibrary/store/KTK_Store.cs
查看文件 @
be18814
...
...
@@ -254,7 +254,7 @@ namespace OnlineStore.DeviceLibrary
//如果是进出轴,并且光栅被遮挡,直接返回false
if
(
NeedCheckSafetyLight
.
Equals
(
2
))
{
if
(
StoreMove
.
MoveStep
.
Equals
(
StoreMoveStep
.
SO_1
0
_DeviceToDoor
)
||
if
(
StoreMove
.
MoveStep
.
Equals
(
StoreMoveStep
.
SO_1
3
_DeviceToDoor
)
||
StoreMove
.
MoveStep
.
Equals
(
StoreMoveStep
.
SI_05_DeviceToDoor
))
{
return
false
;
...
...
source/DeviceLibrary/store/StoreStep.cs
查看文件 @
be18814
...
...
@@ -259,36 +259,39 @@ namespace OnlineStore.DeviceLibrary
/// <summary>
/// 料仓出库,定位气缸退回(有压紧轴的不需要此步骤),,定位气缸退回(Y104-1/PCI5O1-84) (Y104-2/PCI5O1-91) (Y104-2/PCI5O1-96) 退回到位
/// </summary>
SO_09_Location
Cylinder_
Down
=
109
,
SO_09_LocationDown
=
109
,
/// <summary>
/// 等待门口无料盘
/// </summary>
SO_091_WaitNoTray
=
115
,
SO_11_WaitNoTray
,
/// <summary>
/// 等待门口无料盘
/// </summary>
SO_12_OpenDoor
,
/// <summary>
/// 料仓出库,,叉子进出料口,,轴3( 叉子) 至P2( 进料口取料点)
/// /// </summary>
SO_1
0_DeviceToDoor
=
110
,
SO_1
3_DeviceToDoor
,
/// <summary>
/// 料仓出库,,把物品放下,,轴2( 上下) 至P8( 进料口出料缓冲点)轴4( 压紧) 至P1( 待机点)
/// </summary>
SO_1
1_DevicePutWare
=
111
,
SO_1
4_DevicePutWare
,
/// <summary>
/// 料仓出库,,叉子从出料口返回,,轴3( 叉子) 动作至P1( 待机点)
/// </summary>
SO_1
2_DeviceOutFromDoor
=
112
,
SO_1
5_InoutBack
,
/// <summary>
/// 需要检测到门口有料盘高度
/// </summary>
SO_1
21_CheckHasTray
=
116
,
SO_1
6_CheckHasTray
,
/// <summary>
/// 料仓出库,,升降轴返回,, 轴2至P1( 待机点)
/// </summary>
SO_1
3_GoBack
=
113
,
SO_1
7_GoBack
,
/// <summary>
/// 等待拿走物品
/// </summary>
SO_1
4_WaitTake
=
114
,
SO_1
8_WaitTake
,
#
endregion
...
...
@@ -296,7 +299,7 @@ namespace OnlineStore.DeviceLibrary
/// <summary>
/// 入库检测
/// </summary>
SI_00_TrayCheck
=
200
,
SI_00_TrayCheck
=
200
,
/// <summary>
/// 入库,。定位气缸下降
/// </summary>
...
...
source/LoadCVSLibrary/storeConfig/config/AC_SA_Config.cs
查看文件 @
be18814
此文件的差异被折叠,
点击展开。
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论