Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
孙克
/
ACSingleStore
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit 2373e218
由
刘韬
编写于
2021-08-27 10:53:51 +0800
浏览文件
选项
浏览文件
标签
下载
差异文件
1
2 个父辈
3886d6c2
be188147
全部展开
隐藏空白字符变更
内嵌
并排
正在显示
30 个修改的文件
包含
469 行增加
和
304 行删除
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
查看文件 @
2373e21
此文件类型无法预览
source/ACServoDriveTest/FrmACTest.cs
查看文件 @
2373e21
...
@@ -126,7 +126,7 @@ namespace ACServoDriveTest
...
@@ -126,7 +126,7 @@ namespace ACServoDriveTest
{
{
//bean.closePort();
//bean.closePort();
ACServerManager
.
ServoOff
(
GetPortName
(),
GetSlaveAddr
());
ACServerManager
.
ServoOff
(
GetPortName
(),
GetSlaveAddr
());
ACServerManager
.
ColsePort
(
GetPortName
()
);
//
ACServerManager.ColsePort(GetPortName() );
formStatus
(
false
);
formStatus
(
false
);
}
}
private
void
Form1_Load
(
object
sender
,
EventArgs
e
)
private
void
Form1_Load
(
object
sender
,
EventArgs
e
)
...
...
source/ACSingleStore/ACSingleStore.csproj
查看文件 @
2373e21
...
@@ -9,7 +9,7 @@
...
@@ -9,7 +9,7 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>OnlineStore.ACSingleStore</RootNamespace>
<RootNamespace>OnlineStore.ACSingleStore</RootNamespace>
<AssemblyName>ZHACSingleStore</AssemblyName>
<AssemblyName>ZHACSingleStore</AssemblyName>
<TargetFrameworkVersion>v4.
0
</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.
6.1
</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<FileAlignment>512</FileAlignment>
<TargetFrameworkProfile />
<TargetFrameworkProfile />
</PropertyGroup>
</PropertyGroup>
...
@@ -92,6 +92,12 @@
...
@@ -92,6 +92,12 @@
<DependentUpon>FrmStoreBox.cs</DependentUpon>
<DependentUpon>FrmStoreBox.cs</DependentUpon>
</Compile>
</Compile>
<Compile Include="ManagerUtil.cs" />
<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="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<EmbeddedResource Include="FrmAxisDebug.resx">
<EmbeddedResource Include="FrmAxisDebug.resx">
...
@@ -109,6 +115,9 @@
...
@@ -109,6 +115,9 @@
<EmbeddedResource Include="FrmStoreBox.resx">
<EmbeddedResource Include="FrmStoreBox.resx">
<DependentUpon>FrmStoreBox.cs</DependentUpon>
<DependentUpon>FrmStoreBox.cs</DependentUpon>
</EmbeddedResource>
</EmbeddedResource>
<EmbeddedResource Include="positionTool\FrmPositionTool.resx">
<DependentUpon>FrmPositionTool.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Properties\Resources.resx">
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
...
@@ -128,79 +137,6 @@
...
@@ -128,79 +137,6 @@
<DependentUpon>Settings.settings</DependentUpon>
<DependentUpon>Settings.settings</DependentUpon>
<DesignTimeSharedInput>True</DesignTimeSharedInput>
<DesignTimeSharedInput>True</DesignTimeSharedInput>
</Compile>
</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>
<ItemGroup>
<ItemGroup>
<None Include="App.config">
<None Include="App.config">
...
...
source/ACSingleStore/App.config
查看文件 @
2373e21
<?
xml
version
=
"1.0"
?>
<?
xml
version
=
"1.0"
?>
<
configuration
>
<
configuration
>
<
configSections
>
<
configSections
>
<
section
name
=
"log4net"
type
=
"log4net.Config.Log4NetConfigurationSectionHandler,log4net"
/>
<
section
name
=
"log4net"
type
=
"log4net.Config.Log4NetConfigurationSectionHandler,log4net"
/>
</
configSections
>
</
configSections
>
<
appSettings
>
<
appSettings
>
<!--是否开机自动启动料仓-->
<!--是否开机自动启动料仓-->
<
add
key
=
"App_AutoRun"
value
=
"1"
/>
<
add
key
=
"App_AutoRun"
value
=
"1"
/>
<
add
key
=
"App_Title"
value
=
"AC_SA_料仓_1"
/>
<
add
key
=
"App_Title"
value
=
"AC_SA_料仓_1"
/>
<
add
key
=
"scanner_start_command"
value
=
"S"
/>
<
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
-->
<!--
Server
address
-->
<!--<
add
key
=
"http.server"
value
=
"http://localhost:80/"
/>-->
<!--<
add
key
=
"http.server"
value
=
"http://localhost:80/"
/>-->
<!--
storeType
-->
<!--
storeType
-->
<
add
key
=
"store_count"
value
=
"1"
/>
<
add
key
=
"store_count"
value
=
"1"
/>
<!--
start
one
store
config
-->
<!--
start
one
store
config
-->
<
add
key
=
"Store_Position_Config"
value
=
"\StoreConfig\AC\linePositions.csv"
/>
<
add
key
=
"Store_Position_Config"
value
=
"\StoreConfig\AC\linePositions.csv"
/>
<
add
key
=
"Store_ConfigPath"
value
=
"\StoreConfig\AC\StoreConfig.csv"
/>
<
add
key
=
"Store_ConfigPath"
value
=
"\StoreConfig\AC\StoreConfig.csv"
/>
<
add
key
=
"Store_Type"
value
=
"RC_AC_SA"
/>
<
add
key
=
"Store_Type"
value
=
"RC_AC_SA"
/>
<
add
key
=
"Store_CID"
value
=
"zhac1"
/>
<
add
key
=
"Store_CID"
value
=
"zhac1"
/>
<!--
end
one
store
config
-->
<!--
end
one
store
config
-->
<!--摄像机名称列表配置,用
#分割-->
<!--摄像机名称列表配置,用
#分割-->
<
add
key
=
"CameraName"
value
=
"GigE:MV-CE100-30GC (00C69898484)"
/>
<
add
key
=
"CameraName"
value
=
"GigE:MV-CE100-30GC (00C69898484)"
/>
<!--二维码类型列表配置,用
#分割,一维码=Barcode。-->
<!--二维码类型列表配置,用
#分割,一维码=Barcode。-->
<
add
key
=
"CodeType"
value
=
"Barcode"
/>
<
add
key
=
"CodeType"
value
=
"Barcode"
/>
<!--<
add
key
=
"CodeType"
value
=
"Data Matrix ECC 200"
/>-->
<!--<
add
key
=
"CodeType"
value
=
"Data Matrix ECC 200"
/>-->
<!--二维码参数文件所在路径,文件名与二维码类型名一样-->
<!--二维码参数文件所在路径,文件名与二维码类型名一样-->
<
add
key
=
"CodeParamPath"
value
=
"\CodeParam\"
/>
<
add
key
=
"CodeParamPath"
value
=
"\CodeParam\"
/>
<
add
key
=
"AI_ConvertPosition"
value
=
"55"
/>
<
add
key
=
"AI_ConvertPosition"
value
=
"55"
/>
<
add
key
=
"InOutDefaultPosition"
value
=
"8000"
/>
<
add
key
=
"InOutDefaultPosition"
value
=
"8000"
/>
<
add
key
=
"Config_Pwd"
value
=
"123456"
/>
<
add
key
=
"Config_Pwd"
value
=
"123456"
/>
<!--出库等待料盘拿走的时间,秒-->
<!--出库等待料盘拿走的时间,秒-->
<
add
key
=
"OutStoreWaitSeconds"
value
=
"600"
/>
<
add
key
=
"OutStoreWaitSeconds"
value
=
"600"
/>
<!--压紧轴对应
4
mm
的脉冲-->
<!--压紧轴对应
4
mm
的脉冲-->
<
add
key
=
"ComAxisChangeValue"
value
=
"2400"
/>
<
add
key
=
"ComAxisChangeValue"
value
=
"2400"
/>
<!--伺服波特率-->
<
add
key
=
"ACBaudRate"
value
=
"115200"
/>
</
appSettings
>
</
appSettings
>
<
log4net
>
<
log4net
>
<
appender
name
=
"RollingLogFileAppender"
type
=
"log4net.Appender.RollingFileAppender"
>
<
appender
name
=
"RollingLogFileAppender"
type
=
"log4net.Appender.RollingFileAppender"
>
<
file
value
=
"logs/ZHACStore1.log"
/>
<
file
value
=
"logs/ZHACStore1.log"
/>
<
appendToFile
value
=
"true"
/>
<
appendToFile
value
=
"true"
/>
<
rollingStyle
value
=
"Date"
/>
<
rollingStyle
value
=
"Date"
/>
<
datePattern
value
=
"yyyy-MM-dd"
/>
<
datePattern
value
=
"yyyy-MM-dd"
/>
<
layout
type
=
"log4net.Layout.PatternLayout"
>
<
layout
type
=
"log4net.Layout.PatternLayout"
>
<
conversionPattern
value
=
"[%date][%t]%-5p %m%n"
/>
<
conversionPattern
value
=
"[%date][%t]%-5p %m%n"
/>
</
layout
>
</
layout
>
</
appender
>
</
appender
>
<
root
>
<
root
>
<
level
value
=
"Info"
/>
<
level
value
=
"Info"
/>
<
appender
-
ref
ref
=
"RollingLogFileAppender"
/>
<
appender
-
ref
ref
=
"RollingLogFileAppender"
/>
</
root
>
</
root
>
</
log4net
>
</
log4net
>
<
startup
>
<
startup
>
<
supportedRuntime
version
=
"v4.0"
sku
=
".NETFramework,Version=v4.
0"
/>
<
supportedRuntime
version
=
"v4.0"
sku
=
".NETFramework,Version=v4.
6.1"
/>
</
startup
>
</
startup
>
<!-- 部署服务库项目时,必须将配置文件的内容添加到
<!-- 部署服务库项目时,必须将配置文件的内容添加到
主机的
app
.
config
文件中。
System
.
Configuration
不支持库的配置文件。 -->
主机的
app
.
config
文件中。
System
.
Configuration
不支持库的配置文件。 -->
...
@@ -63,14 +65,14 @@
...
@@ -63,14 +65,14 @@
<
service
name
=
"AcStoreWCF.CWSMDBox"
>
<
service
name
=
"AcStoreWCF.CWSMDBox"
>
<
endpoint
address
=
""
binding
=
"basicHttpBinding"
contract
=
"AcStoreWCF.ICWSMDBox"
>
<
endpoint
address
=
""
binding
=
"basicHttpBinding"
contract
=
"AcStoreWCF.ICWSMDBox"
>
<
identity
>
<
identity
>
<
dns
value
=
"localhost"
/>
<
dns
value
=
"localhost"
/>
</
identity
>
</
identity
>
</
endpoint
>
</
endpoint
>
<
endpoint
address
=
"mex"
binding
=
"mexHttpBinding"
contract
=
"IMetadataExchange"
/>
<
endpoint
address
=
"mex"
binding
=
"mexHttpBinding"
contract
=
"IMetadataExchange"
/>
<
host
>
<
host
>
<
baseAddresses
>
<
baseAddresses
>
<
add
baseAddress
=
"http://localhost:8733/Design_Time_Addresses/AcStoreWCF/CWSMDBox/"
/>
<
add
baseAddress
=
"http://localhost:8733/Design_Time_Addresses/AcStoreWCF/CWSMDBox/"
/>
</
baseAddresses
>
</
baseAddresses
>
</
host
>
</
host
>
</
service
>
</
service
>
...
@@ -80,13 +82,13 @@
...
@@ -80,13 +82,13 @@
<
behavior
>
<
behavior
>
<!-- 为避免泄漏元数据信息,
<!-- 为避免泄漏元数据信息,
请在部署前将以下值设置为
false
-->
请在部署前将以下值设置为
false
-->
<
serviceMetadata
httpGetEnabled
=
"True"
httpsGetEnabled
=
"True"
/>
<
serviceMetadata
httpGetEnabled
=
"True"
httpsGetEnabled
=
"True"
/>
<!-- 要接收故障异常详细信息以进行调试,
<!-- 要接收故障异常详细信息以进行调试,
请将以下值设置为
true
。在部署前设置为
false
请将以下值设置为
true
。在部署前设置为
false
以避免泄漏异常信息 -->
以避免泄漏异常信息 -->
<
serviceDebug
includeExceptionDetailInFaults
=
"False"
/>
<
serviceDebug
includeExceptionDetailInFaults
=
"False"
/>
</
behavior
>
</
behavior
>
</
serviceBehaviors
>
</
serviceBehaviors
>
</
behaviors
>
</
behaviors
>
</
system
.
serviceModel
>
</
system
.
serviceModel
>
</
configuration
>
\ No newline at end of file
\ No newline at end of file
</
configuration
>
source/ACSingleStore/FrmAxisDebug.Designer.cs
查看文件 @
2373e21
此文件的差异被折叠,
点击展开。
source/ACSingleStore/FrmAxisDebug.cs
查看文件 @
2373e21
...
@@ -23,17 +23,19 @@ namespace OnlineStore.ACSingleStore
...
@@ -23,17 +23,19 @@ namespace OnlineStore.ACSingleStore
private
ConfigMoveAxis
updown
=
null
;
private
ConfigMoveAxis
updown
=
null
;
//private ConfigMoveAxis compress = null;
//private ConfigMoveAxis compress = null;
private
ConfigMoveAxis
inout
=
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
static
readonly
ILog
LOGGER
=
LogManager
.
GetLogger
(
MethodBase
.
GetCurrentMethod
().
DeclaringType
);
public
FrmAxisDebug
(
AC_SA_BoxBean
boxBean
)
public
FrmAxisDebug
(
AC_SA_BoxBean
boxBean
)
{
{
middle
=
boxBean
.
Config
.
Middle_Axis
;
middle
=
boxBean
.
Config
.
Middle_Axis
;
updown
=
boxBean
.
Config
.
UpDown_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
;
inout
=
boxBean
.
Config
.
InOut_Axis
;
InitializeComponent
();
InitializeComponent
();
txtComSpeed
.
Text
=
boxBean
.
Config
.
CompressAxis_EndSpeed
.
ToString
();
this
.
Text
=
boxBean
.
StoreName
+
"_轴点动调试"
;
this
.
Text
=
boxBean
.
StoreName
+
"_轴点动调试"
;
}
}
...
@@ -44,11 +46,11 @@ namespace OnlineStore.ACSingleStore
...
@@ -44,11 +46,11 @@ namespace OnlineStore.ACSingleStore
}
}
private
void
FrmAxisDebug_Load
(
object
sender
,
EventArgs
e
)
private
void
FrmAxisDebug_Load
(
object
sender
,
EventArgs
e
)
{
{
txtMiddleSpeed
.
Text
=
(
middle
.
TargetSpeed
/
5
).
ToString
();
txtMiddleSpeed
.
Text
=
(
middle
.
TargetSpeed
/
5
).
ToString
();
txtInOutSpeed
.
Text
=
(
inout
.
TargetSpeed
/
5
).
ToString
();
txtInOutSpeed
.
Text
=
(
inout
.
TargetSpeed
/
5
).
ToString
();
txtUpDownSpeed
.
Text
=
(
updown
.
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
();
timer1
.
Start
();
}
}
/// <summary>
/// <summary>
...
@@ -246,28 +248,26 @@ namespace OnlineStore.ACSingleStore
...
@@ -246,28 +248,26 @@ namespace OnlineStore.ACSingleStore
}
}
private
void
btnComMove_MouseDown
(
object
sender
,
MouseEventArgs
e
)
private
void
btnComMove_MouseDown
(
object
sender
,
MouseEventArgs
e
)
{
{
int
speed
=
FormUtil
.
GetIntValue
(
txtComSpeed
);
if
(
btnComMove
.
BackColor
.
Equals
(
System
.
Drawing
.
SystemColors
.
Control
))
if
(
speed
<=
0
)
{
{
MessageBox
.
Show
(
"提示"
,
"请先输入正确的速度"
);
int
speed
=
FormUtil
.
GetIntValue
(
txtComSpeed
);
return
;
if
(
speed
<=
0
)
{
MessageBox
.
Show
(
"提示"
,
"请先输入正确的速度"
);
return
;
}
this
.
btnComMove
.
BackColor
=
Color
.
Green
;
AxisMove
(
comp
,
speed
);
}
}
this
.
btnComMove
.
BackColor
=
Color
.
Green
;
ShuoKeControls
.
SetSpeed
(
compress_Slv
,
ShuoKeCMD
.
SetEndSpeed
,
speed
);
ShuoKeControls
.
SetSpeed
(
compress_Slv
,
ShuoKeCMD
.
SetMaxSpeed
,
speed
);
ShuoKeControls
.
VolMove
(
compress_Slv
,
speed
);
}
}
private
void
btnComMove_MouseUp
(
object
sender
,
MouseEventArgs
e
)
private
void
btnComMove_MouseUp
(
object
sender
,
MouseEventArgs
e
)
{
{
if
(
this
.
btnComMove
.
BackColor
==
Color
.
Green
)
if
(
this
.
btnComMove
.
BackColor
==
Color
.
Green
)
{
{
btnComMove
.
BackColor
=
System
.
Drawing
.
SystemColors
.
Control
;
btnComMove
.
BackColor
=
System
.
Drawing
.
SystemColors
.
Control
;
ShuoKeControls
.
SuddownStop
(
compress_Slv
);
ACServerManager
.
SuddenStop
(
comp
.
DeviceName
,
comp
.
GetAxisValue
());
// ShuoKeControls.GetABSPosition(compress_Slv);
UpdateCompPosition
();
txtComPosition
.
Text
=
ShuoKeControls
.
GetABSPosition
(
compress_Slv
).
ToString
();
}
}
}
}
private
void
btnComMovej_MouseDown
(
object
sender
,
MouseEventArgs
e
)
private
void
btnComMovej_MouseDown
(
object
sender
,
MouseEventArgs
e
)
...
@@ -279,19 +279,16 @@ namespace OnlineStore.ACSingleStore
...
@@ -279,19 +279,16 @@ namespace OnlineStore.ACSingleStore
return
;
return
;
}
}
this
.
btnComMovej
.
BackColor
=
Color
.
Green
;
this
.
btnComMovej
.
BackColor
=
Color
.
Green
;
ShuoKeControls
.
SetSpeed
(
compress_Slv
,
ShuoKeCMD
.
SetEndSpeed
,
speed
);
AxisMove
(
comp
,
-
speed
);
ShuoKeControls
.
SetSpeed
(
compress_Slv
,
ShuoKeCMD
.
SetMaxSpeed
,
speed
);
ShuoKeControls
.
VolMove
(
compress_Slv
,-
speed
);
}
}
private
void
btnComMovej_MouseUp
(
object
sender
,
MouseEventArgs
e
)
private
void
btnComMovej_MouseUp
(
object
sender
,
MouseEventArgs
e
)
{
{
if
(
btnComMovej
.
BackColor
.
Equals
(
Color
.
Green
))
if
(
btnComMovej
.
BackColor
.
Equals
(
Color
.
Green
))
{
{
btnComMovej
.
BackColor
=
System
.
Drawing
.
SystemColors
.
Control
;
btnComMovej
.
BackColor
=
System
.
Drawing
.
SystemColors
.
Control
;
ShuoKeControls
.
SuddownStop
(
compress_Slv
);
ACServerManager
.
SuddenStop
(
comp
.
DeviceName
,
comp
.
GetAxisValue
());
// ShuoKeControls.GetABSPosition(compress_Slv);
UpdateCompPosition
();
txtComPosition
.
Text
=
ShuoKeControls
.
GetABSPosition
(
compress_Slv
).
ToString
();
}
}
}
}
...
@@ -302,8 +299,7 @@ namespace OnlineStore.ACSingleStore
...
@@ -302,8 +299,7 @@ namespace OnlineStore.ACSingleStore
private
void
FrmAxisDebug_Shown
(
object
sender
,
EventArgs
e
)
private
void
FrmAxisDebug_Shown
(
object
sender
,
EventArgs
e
)
{
{
SetSkin
(
this
);
}
}
private
void
timer1_Tick
(
object
sender
,
EventArgs
e
)
private
void
timer1_Tick
(
object
sender
,
EventArgs
e
)
...
@@ -313,22 +309,18 @@ namespace OnlineStore.ACSingleStore
...
@@ -313,22 +309,18 @@ namespace OnlineStore.ACSingleStore
UpdateMiddlePosition
();
UpdateMiddlePosition
();
UpdateInOutPosition
();
UpdateInOutPosition
();
UpdateUpdownPosition
();
UpdateUpdownPosition
();
UpdateCompPosition
();
txtComPosition
.
Text
=
ShuoKeControls
.
GetABSPosition
(
compress_Slv
).
ToString
();
// txtComPosition.Text = ShuoKeControls.GetLastPosition(compress_Slv).ToString();
}
//ShuoKeInfo info = ShuoKeControls.GetLastPosition(compress_Slv);
}
//if (info != null)
private
void
UpdateCompPosition
()
//{
{
// txtComPosition.Text = info.LastPosition.ToString();
int
compPosition
=
ACServerManager
.
GetTargetPosition
(
comp
.
DeviceName
,
comp
.
GetAxisValue
());
// TimeSpan span = DateTime.Now - info.UpdateTime;
if
(!
txtComPosition
.
Text
.
Equals
(
compPosition
.
ToString
()))
// if (span.TotalSeconds > 1.5)
{
// {
txtComPosition
.
Text
=
compPosition
.
ToString
();
// ShuoKeControls.GetABSPosition(compress_Slv);
// }
//}
}
}
}
}
private
void
UpdateUpdownPosition
()
private
void
UpdateUpdownPosition
()
{
{
int
updownPosition
=
ACServerManager
.
GetTargetPosition
(
updown
.
DeviceName
,
updown
.
GetAxisValue
());
int
updownPosition
=
ACServerManager
.
GetTargetPosition
(
updown
.
DeviceName
,
updown
.
GetAxisValue
());
...
@@ -355,5 +347,35 @@ namespace OnlineStore.ACSingleStore
...
@@ -355,5 +347,35 @@ namespace OnlineStore.ACSingleStore
txtInOutPosition
.
Text
=
inoutPosition
.
ToString
();
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
查看文件 @
2373e21
此文件的差异太大,无法显示。
source/ACSingleStore/FrmStoreBox.cs
查看文件 @
2373e21
此文件的差异被折叠,
点击展开。
source/ACSingleStore/Properties/Resources.Designer.cs
查看文件 @
2373e21
...
@@ -47,7 +47,7 @@ namespace OnlineStore.ACSingleStore.Properties {
...
@@ -47,7 +47,7 @@ namespace OnlineStore.ACSingleStore.Properties {
}
}
/// <summary>
/// <summary>
///
使用此强类型资源类,为所有资源查找
///
重写当前线程的 CurrentUICulture 属性
/// 重写当前线程的 CurrentUICulture 属性。
/// 重写当前线程的 CurrentUICulture 属性。
/// </summary>
/// </summary>
[
global
::
System
.
ComponentModel
.
EditorBrowsableAttribute
(
global
::
System
.
ComponentModel
.
EditorBrowsableState
.
Advanced
)]
[
global
::
System
.
ComponentModel
.
EditorBrowsableAttribute
(
global
::
System
.
ComponentModel
.
EditorBrowsableState
.
Advanced
)]
...
...
source/ACSingleStore/Properties/Settings.Designer.cs
查看文件 @
2373e21
...
@@ -12,7 +12,7 @@ namespace OnlineStore.ACSingleStore.Properties {
...
@@ -12,7 +12,7 @@ namespace OnlineStore.ACSingleStore.Properties {
[
global
::
System
.
Runtime
.
CompilerServices
.
CompilerGeneratedAttribute
()]
[
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
{
internal
sealed
partial
class
Settings
:
global
::
System
.
Configuration
.
ApplicationSettingsBase
{
private
static
Settings
defaultInstance
=
((
Settings
)(
global
::
System
.
Configuration
.
ApplicationSettingsBase
.
Synchronized
(
new
Settings
())));
private
static
Settings
defaultInstance
=
((
Settings
)(
global
::
System
.
Configuration
.
ApplicationSettingsBase
.
Synchronized
(
new
Settings
())));
...
...
source/ACSingleStore/positionTool/FrmPositionTool.Designer.cs
0 → 100644
查看文件 @
2373e21
此文件的差异被折叠,
点击展开。
source/ACSingleStore/positionTool/FrmPositionTool.cs
0 → 100644
查看文件 @
2373e21
此文件的差异被折叠,
点击展开。
source/ACSingleStore/positionTool/FrmPositionTool.resx
0 → 100644
查看文件 @
2373e21
<?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
\ No newline at end of file
source/ACSingleStore/记录.txt
查看文件 @
2373e21
...
@@ -86,4 +86,54 @@ bug修改:压紧轴点动时实时坐标更新。
...
@@ -86,4 +86,54 @@ bug修改:压紧轴点动时实时坐标更新。
20190830:
20190830:
增加压紧轴复位的配置。
增加压紧轴复位的配置。
StoreConfig.csv增加:
StoreConfig.csv增加:
PRO,出入库多少次自动复位压紧轴,Box_ResetCCount,3,,,,,,,
\ No newline at end of file
\ No newline at end of file
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
查看文件 @
2373e21
...
@@ -79,5 +79,15 @@ namespace OnlineStore.Common
...
@@ -79,5 +79,15 @@ namespace OnlineStore.Common
/// 压紧轴1mm对应的脉冲
/// 压紧轴1mm对应的脉冲
/// </summary>
/// </summary>
public
static
string
ComAxisChangeValue
=
"ComAxisChangeValue"
;
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
查看文件 @
2373e21
...
@@ -12,7 +12,7 @@ namespace OnlineStore.Common
...
@@ -12,7 +12,7 @@ namespace OnlineStore.Common
public
class
AcSerialBean
public
class
AcSerialBean
{
{
#
region
全部变量
#
region
全部变量
public
static
readonly
ILog
LOGGER
=
LogManager
.
GetLogger
(
System
.
Reflection
.
MethodBase
.
GetCurrentMethod
().
DeclaringType
);
public
static
readonly
ILog
LOGGER
=
LogManager
.
GetLogger
(
System
.
Reflection
.
MethodBase
.
GetCurrentMethod
().
DeclaringType
);
private
SerialPort
_serialPort
=
null
;
private
SerialPort
_serialPort
=
null
;
private
object
lockObj
=
new
object
();
private
object
lockObj
=
new
object
();
...
@@ -24,7 +24,7 @@ namespace OnlineStore.Common
...
@@ -24,7 +24,7 @@ namespace OnlineStore.Common
//public event SerialErrorReceivedEventHandler Error;
//public event SerialErrorReceivedEventHandler Error;
//接收事件是否有效 false表示有效
//接收事件是否有效 false表示有效
//public bool ReceiveEventFlag = false;
//public bool ReceiveEventFlag = false;
#
endregion
#
endregion
#
region
获取串口名
#
region
获取串口名
...
@@ -52,7 +52,7 @@ namespace OnlineStore.Common
...
@@ -52,7 +52,7 @@ namespace OnlineStore.Common
}
}
}
}
#
endregion
#
endregion
#
region
默认构造函数
#
region
默认构造函数
///// <summary>
///// <summary>
///// 默认构造函数,操作COM1,速度为9600,没有奇偶校验,8位字节,停止位为1 "COM1", 9600, Parity.None, 8, StopBits.One
///// 默认构造函数,操作COM1,速度为9600,没有奇偶校验,8位字节,停止位为1 "COM1", 9600, Parity.None, 8, StopBits.One
...
@@ -62,7 +62,7 @@ namespace OnlineStore.Common
...
@@ -62,7 +62,7 @@ namespace OnlineStore.Common
// _serialPort = new SerialPort();
// _serialPort = new SerialPort();
//}
//}
#
endregion
#
endregion
#
region
构造函数
#
region
构造函数
///// <summary>
///// <summary>
///// 构造函数,
///// 构造函数,
...
@@ -81,7 +81,7 @@ namespace OnlineStore.Common
...
@@ -81,7 +81,7 @@ namespace OnlineStore.Common
// setSerialPort();
// setSerialPort();
//}
//}
#
endregion
#
endregion
#
region
构造函数
,
可以自定义串口的初始化参数
#
region
构造函数
,
可以自定义串口的初始化参数
/// <summary>
/// <summary>
/// 构造函数,可以自定义串口的初始化参数
/// 构造函数,可以自定义串口的初始化参数
...
@@ -99,7 +99,7 @@ namespace OnlineStore.Common
...
@@ -99,7 +99,7 @@ namespace OnlineStore.Common
setSerialPort
();
setSerialPort
();
}
}
#
endregion
#
endregion
#
region
析构函数
#
region
析构函数
/// <summary>
/// <summary>
/// 析构函数,关闭串口
/// 析构函数,关闭串口
...
@@ -110,7 +110,7 @@ namespace OnlineStore.Common
...
@@ -110,7 +110,7 @@ namespace OnlineStore.Common
_serialPort
.
Close
();
_serialPort
.
Close
();
}
}
#
endregion
#
endregion
#
region
设置串口参数
#
region
设置串口参数
/// <summary>
/// <summary>
/// 设置串口参数
/// 设置串口参数
...
@@ -148,7 +148,7 @@ namespace OnlineStore.Common
...
@@ -148,7 +148,7 @@ namespace OnlineStore.Common
//设置触发DataReceived事件的字节数为1
//设置触发DataReceived事件的字节数为1
_serialPort
.
ReceivedBytesThreshold
=
1
;
_serialPort
.
ReceivedBytesThreshold
=
1
;
//接收到一个字节时,也会触发DataReceived事件
//接收到一个字节时,也会触发DataReceived事件
// _serialPort.DataReceived += new SerialDataReceivedEventHandler(_serialPort_DataReceived);
// _serialPort.DataReceived += new SerialDataReceivedEventHandler(_serialPort_DataReceived);
//接收数据出错,触发事件
//接收数据出错,触发事件
_serialPort
.
ErrorReceived
+=
new
SerialErrorReceivedEventHandler
(
_serialPort_ErrorReceived
);
_serialPort
.
ErrorReceived
+=
new
SerialErrorReceivedEventHandler
(
_serialPort_ErrorReceived
);
//打开串口
//打开串口
...
@@ -183,7 +183,7 @@ namespace OnlineStore.Common
...
@@ -183,7 +183,7 @@ namespace OnlineStore.Common
return
ok
;
return
ok
;
}
}
#
endregion
#
endregion
#
region
关闭串口
#
region
关闭串口
/// <summary>
/// <summary>
/// 关闭串口资源,操作完成后,一定要关闭串口
/// 关闭串口资源,操作完成后,一定要关闭串口
...
@@ -211,8 +211,8 @@ namespace OnlineStore.Common
...
@@ -211,8 +211,8 @@ namespace OnlineStore.Common
}
}
#
endregion
#
endregion
#
region
接收数据出错事件
#
region
接收数据出错事件
/// <summary>
/// <summary>
/// 接收数据出错事件
/// 接收数据出错事件
...
@@ -271,7 +271,7 @@ namespace OnlineStore.Common
...
@@ -271,7 +271,7 @@ namespace OnlineStore.Common
// LogUtil.error(LOGGER, "SendData ERROR:" + ex.ToString(), 21);
// LogUtil.error(LOGGER, "SendData ERROR:" + ex.ToString(), 21);
// }
// }
// }
// }
//}
//}
#
endregion
#
endregion
#
region
发送命令
#
region
发送命令
...
@@ -282,13 +282,13 @@ namespace OnlineStore.Common
...
@@ -282,13 +282,13 @@ namespace OnlineStore.Common
/// <param name="ReceiveData">接收数据</param>
/// <param name="ReceiveData">接收数据</param>
/// <param name="Overtime">超时时间</param>
/// <param name="Overtime">超时时间</param>
/// <returns></returns>
/// <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
;
isOk
=
false
;
if
(
_serialPort
.
IsOpen
)
if
(
_serialPort
.
IsOpen
)
{
{
//lock (lockObj)
//lock (lockObj)
if
(
Monitor
.
TryEnter
(
lockObj
,
1
0
))
if
(
Monitor
.
TryEnter
(
lockObj
,
Overtime
+
5
0
))
{
{
//Monitor.Enter(lockObj);
//Monitor.Enter(lockObj);
try
try
...
@@ -326,7 +326,7 @@ namespace OnlineStore.Common
...
@@ -326,7 +326,7 @@ namespace OnlineStore.Common
LogUtil
.
error
(
LOGGER
,
"SendCommand ERROR:"
+
ex
.
ToString
(),
20
);
LogUtil
.
error
(
LOGGER
,
"SendCommand ERROR:"
+
ex
.
ToString
(),
20
);
}
}
finally
finally
{
{
Monitor
.
Exit
(
lockObj
);
Monitor
.
Exit
(
lockObj
);
}
}
}
}
...
@@ -339,7 +339,7 @@ namespace OnlineStore.Common
...
@@ -339,7 +339,7 @@ namespace OnlineStore.Common
return
-
1
;
return
-
1
;
}
}
private
byte
PreSlvAddr
=
0
;
/// <summary>
/// <summary>
/// 发送命令
/// 发送命令
/// </summary>
/// </summary>
...
@@ -348,21 +348,32 @@ namespace OnlineStore.Common
...
@@ -348,21 +348,32 @@ namespace OnlineStore.Common
/// <param name="Overtime">超时时间</param>
/// <param name="Overtime">超时时间</param>
/// <param name="ReceiveLength">接收数据长度</param>
/// <param name="ReceiveLength">接收数据长度</param>
/// <returns></returns>
/// <returns></returns>
public
int
SendCommand
(
byte
[]
SendData
,
ref
byte
[]
ReceiveData
,
int
Overtime
,
int
ReceiveLength
)
public
int
SendCommand
(
byte
[]
SendData
,
ref
byte
[]
ReceiveData
,
int
Overtime
,
int
ReceiveLength
)
{
{
if
(
_serialPort
==
null
)
if
(
_serialPort
==
null
)
{
{
LogUtil
.
error
(
PortName
+
" 发送数据"
+
ByteToString
(
SendData
)
+
"失败,_serialPort=null"
);
LogUtil
.
error
(
PortName
+
" 发送数据"
+
ByteToString
(
SendData
)
+
"失败,_serialPort=null"
);
return
-
1
;
return
-
1
;
}
}
if
(
_serialPort
.
IsOpen
)
if
(
_serialPort
.
IsOpen
)
{
{
if
(
Monitor
.
TryEnter
(
lockObj
,
1
))
if
(
Monitor
.
TryEnter
(
lockObj
,
Overtime
+
80
))
{
{
//Monitor.Enter(lockObj);
//Monitor.Enter(lockObj);
try
try
{
{
//判断是否需要休眠
if
(
SendData
!=
null
&&
SendData
.
Length
>
0
)
{
if
(!
SendData
[
0
].
Equals
(
PreSlvAddr
))
{
Thread
.
Sleep
(
50
);
PreSlvAddr
=
SendData
[
0
];
}
}
_serialPort
.
DiscardInBuffer
();
//清空接收缓冲区
_serialPort
.
DiscardInBuffer
();
//清空接收缓冲区
_serialPort
.
Write
(
SendData
,
0
,
SendData
.
Length
);
_serialPort
.
Write
(
SendData
,
0
,
SendData
.
Length
);
int
num
=
0
,
ret
=
0
;
int
num
=
0
,
ret
=
0
;
...
@@ -370,15 +381,15 @@ namespace OnlineStore.Common
...
@@ -370,15 +381,15 @@ namespace OnlineStore.Common
if
(
ReceiveData
==
null
)
if
(
ReceiveData
==
null
)
{
{
ReceiveData
=
new
byte
[
ReceiveLength
];
ReceiveData
=
new
byte
[
ReceiveLength
];
}
}
while
(
num
++
<
Overtime
)
while
(
num
++
<
Overtime
)
{
{
if
(
_serialPort
.
BytesToRead
>=
ReceiveData
.
Length
)
if
(
_serialPort
.
BytesToRead
>=
ReceiveData
.
Length
)
break
;
break
;
System
.
Threading
.
Thread
.
Sleep
(
1
);
System
.
Threading
.
Thread
.
Sleep
(
1
);
}
}
if
(
num
>=
Overtime
)
if
(
num
>=
Overtime
)
{
{
LogUtil
.
error
(
PortName
+
" 发送数据"
+
ByteToString
(
SendData
)
+
"等待接受数据超时"
);
LogUtil
.
error
(
PortName
+
" 发送数据"
+
ByteToString
(
SendData
)
+
"等待接受数据超时"
);
}
}
if
(
_serialPort
.
BytesToRead
>=
ReceiveData
.
Length
)
if
(
_serialPort
.
BytesToRead
>=
ReceiveData
.
Length
)
...
@@ -390,12 +401,12 @@ namespace OnlineStore.Common
...
@@ -390,12 +401,12 @@ namespace OnlineStore.Common
{
{
ret
=
_serialPort
.
Read
(
ReceiveData
,
0
,
_serialPort
.
BytesToRead
);
ret
=
_serialPort
.
Read
(
ReceiveData
,
0
,
_serialPort
.
BytesToRead
);
}
}
return
ret
;
return
ret
;
}
}
catch
(
Exception
ex
)
catch
(
Exception
ex
)
{
{
LogUtil
.
error
(
PortName
+
" 发送数据"
+
ByteToString
(
SendData
)
+
" 出错:"
+
ex
.
ToString
());
LogUtil
.
error
(
PortName
+
" 发送数据"
+
ByteToString
(
SendData
)
+
" 出错:"
+
ex
.
ToString
());
}
}
finally
finally
{
{
...
@@ -410,8 +421,8 @@ namespace OnlineStore.Common
...
@@ -410,8 +421,8 @@ namespace OnlineStore.Common
}
}
return
-
1
;
return
-
1
;
}
}
#
endregion
#
endregion
#
region
获取串口
#
region
获取串口
...
@@ -457,7 +468,7 @@ namespace OnlineStore.Common
...
@@ -457,7 +468,7 @@ namespace OnlineStore.Common
#
endregion
#
endregion
#
region
十六进制字符串转字节型
#
region
十六进制字符串转字节型
/// <summary>
/// <summary>
/// 打包方法,可以将十六制字符串转成byte[] ,字符串没有空格
/// 打包方法,可以将十六制字符串转成byte[] ,字符串没有空格
/// </summary>
/// </summary>
...
@@ -493,7 +504,7 @@ namespace OnlineStore.Common
...
@@ -493,7 +504,7 @@ namespace OnlineStore.Common
return
putout
;
return
putout
;
}
}
#
endregion
#
endregion
#
region
字节型转十六进制字符串
#
region
字节型转十六进制字符串
/// <summary>
/// <summary>
/// 字节数组转16进制字符串
/// 字节数组转16进制字符串
...
@@ -557,4 +568,4 @@ namespace OnlineStore.Common
...
@@ -557,4 +568,4 @@ namespace OnlineStore.Common
#
endregion
#
endregion
}
}
}
}
source/DeviceLibrary/DeviceLibrary.csproj
查看文件 @
2373e21
...
@@ -9,7 +9,7 @@
...
@@ -9,7 +9,7 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>OnlineStore.DeviceLibrary</RootNamespace>
<RootNamespace>OnlineStore.DeviceLibrary</RootNamespace>
<AssemblyName>DeviceLibrary</AssemblyName>
<AssemblyName>DeviceLibrary</AssemblyName>
<TargetFrameworkVersion>v4.
0
</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.
6.1
</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<FileAlignment>512</FileAlignment>
<TargetFrameworkProfile />
<TargetFrameworkProfile />
</PropertyGroup>
</PropertyGroup>
...
@@ -67,8 +67,6 @@
...
@@ -67,8 +67,6 @@
<Compile Include="PanasonicServo\ACCMDManager.cs" />
<Compile Include="PanasonicServo\ACCMDManager.cs" />
<Compile Include="PanasonicServo\ACServerManager.cs" />
<Compile Include="PanasonicServo\ACServerManager.cs" />
<Compile Include="PanasonicServo\ACServerManager_Partial.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\LineMoveP.cs" />
<Compile Include="store\LineAlarm.cs">
<Compile Include="store\LineAlarm.cs">
<SubType>Code</SubType>
<SubType>Code</SubType>
...
...
source/DeviceLibrary/KangNaiDe/KNDAIManager.cs
查看文件 @
2373e21
...
@@ -128,6 +128,11 @@ namespace OnlineStore.DeviceLibrary
...
@@ -128,6 +128,11 @@ namespace OnlineStore.DeviceLibrary
try
try
{
{
isProcess
=
true
;
isProcess
=
true
;
if
(
StoreManager
.
Store
==
null
)
{
isProcess
=
false
;
return
;
}
bool
IsNeedReadAI
=
StoreManager
.
Store
.
KNDIOValue
(
IO_Type
.
TrayCheck_Door
).
Equals
(
IO_VALUE
.
HIGH
);
bool
IsNeedReadAI
=
StoreManager
.
Store
.
KNDIOValue
(
IO_Type
.
TrayCheck_Door
).
Equals
(
IO_VALUE
.
HIGH
);
IsNeedReadAI
=
(
IsNeedReadAI
||
NeedReadAI
);
IsNeedReadAI
=
(
IsNeedReadAI
||
NeedReadAI
);
TimeSpan
span
=
DateTime
.
Now
-
PreCheckTime
;
TimeSpan
span
=
DateTime
.
Now
-
PreCheckTime
;
...
...
source/DeviceLibrary/KangNaiDe/KNDManager.cs
查看文件 @
2373e21
...
@@ -21,71 +21,70 @@ namespace OnlineStore.DeviceLibrary
...
@@ -21,71 +21,70 @@ namespace OnlineStore.DeviceLibrary
public
static
ushort
DoStartAddress
=
100
;
public
static
ushort
DoStartAddress
=
100
;
public
static
ushort
DefualtLength
=
16
;
public
static
ushort
DefualtLength
=
16
;
private
static
byte
DefualtSlaveID
=
255
;
private
static
byte
DefualtSlaveID
=
255
;
public
static
readonly
ILog
LOGGER
=
LogManager
.
GetLogger
(
MethodBase
.
GetCurrentMethod
().
DeclaringType
);
private
static
readonly
ILog
LOGGER
=
LogManager
.
GetLogger
(
MethodBase
.
GetCurrentMethod
().
DeclaringType
);
public
static
Dictionary
<
string
,
MasterTcpClient
>
mastMap
=
new
Dictionary
<
string
,
MasterTcpClient
>();
private
static
Dictionary
<
string
,
MasterTcpClient
>
mastMap
=
new
Dictionary
<
string
,
MasterTcpClient
>();
public
static
Dictionary
<
string
,
List
<
KNDIO
>>
DIValueMap
=
new
Dictionary
<
string
,
List
<
KNDIO
>>();
private
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
Dictionary
<
string
,
List
<
KNDIO
>>
DOValueMap
=
new
Dictionary
<
string
,
List
<
KNDIO
>>();
private
static
object
DIMapLock
=
""
;
private
static
object
DIMapLock
=
""
;
private
static
object
DOMapLock
=
""
;
private
static
object
DOMapLock
=
""
;
public
static
System
.
Timers
.
Timer
timer
=
null
;
private
static
System
.
Timers
.
Timer
timer
=
null
;
private
static
bool
isWrite
=
false
;
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
))
{
MBmaster
=
mastMap
[
ioIp
];
if
(
null
!=
MBmaster
)
{
MBmaster
.
disconnect
();
MBmaster
.
Dispose
();
MBmaster
=
null
;
//lock (DIMapLock)
//{
// if (DIValueMap.ContainsKey(ioIp))
// {
// DIValueMap.Remove(ioIp);
// }
//}
lock
(
DOMapLock
)
MasterTcpClient
MBmaster
=
null
;
{
if
(
mastMap
.
ContainsKey
(
ioIp
))
if
(
DOValueMap
.
ContainsKey
(
ioIp
))
{
{
MBmaster
=
mastMap
[
ioIp
];
DOValueMap
.
Remove
(
ioIp
);
}
}
}
mastMap
.
Remove
(
ioIp
);
}
try
{
// Create new modbus master and add event functions
MBmaster
=
new
MasterTcpClient
(
ioIp
,
port
);
MBmaster
.
OnResponseData
+=
new
MasterTcpClient
.
ResponseData
(
MBmaster_OnResponseData
);
MBmaster
.
OnException
+=
new
MasterTcpClient
.
ExceptionData
(
MBmaster_OnException
);
MBmaster
.
autoConnectOfBreak
=
false
;
mastMap
.
Add
(
ioIp
,
MBmaster
);
Thread
.
Sleep
(
10
);
if
(
null
!=
MBmaster
)
LogUtil
.
info
(
"连接IO模块["
+
ioIp
+
"]成功"
);
{
//读取所有的DO
MBmaster
.
disconnect
();
ReadMultipleDO
(
ioIp
,
DefualtSlaveID
,
DoStartAddress
,
DefualtLength
);
MBmaster
.
Dispose
();
}
MBmaster
=
null
;
catch
(
Exception
error
)
//lock (DIMapLock)
{
//{
LogUtil
.
error
(
LOGGER
,
"连接IO模块["
+
ioIp
+
"]出错:"
+
error
.
ToString
());
// if (DIValueMap.ContainsKey(ioIp))
}
// {
}
// DIValueMap.Remove(ioIp);
// }
//}
lock
(
DOMapLock
)
{
if
(
DOValueMap
.
ContainsKey
(
ioIp
))
{
DOValueMap
.
Remove
(
ioIp
);
}
}
}
mastMap
.
Remove
(
ioIp
);
}
try
{
// Create new modbus master and add event functions
MBmaster
=
new
MasterTcpClient
(
ioIp
,
port
);
MBmaster
.
OnResponseData
+=
new
MasterTcpClient
.
ResponseData
(
MBmaster_OnResponseData
);
MBmaster
.
OnException
+=
new
MasterTcpClient
.
ExceptionData
(
MBmaster_OnException
);
MBmaster
.
autoConnectOfBreak
=
false
;
mastMap
.
Add
(
ioIp
,
MBmaster
);
Thread
.
Sleep
(
10
);
if
(
MBmaster
.
connected
)
{
LogUtil
.
info
(
"连接IO模块["
+
ioIp
+
"]成功"
);
MBmaster
.
ReadCoils
(
1
,
DoStartAddress
,
DefualtLength
,
DefualtSlaveID
);
}
else
{
LogUtil
.
info
(
"连接IO模块["
+
ioIp
+
"]失败,等待重连"
);
}
}
catch
(
Exception
error
)
{
LogUtil
.
error
(
LOGGER
,
"连接IO模块["
+
ioIp
+
"]出错:"
+
error
.
ToString
());
}
}
/// <summary>
/// <summary>
/// 判断Io模块是否连接
/// 判断Io模块是否连接
/// </summary>
/// </summary>
...
@@ -130,7 +129,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -130,7 +129,7 @@ namespace OnlineStore.DeviceLibrary
}
}
catch
(
Exception
ex
)
catch
(
Exception
ex
)
{
{
LogUtil
.
error
(
LOGGER
,
"出错啦:"
+
ex
.
ToString
()
);
LogUtil
.
error
(
LOGGER
,
"出错啦:"
+
ex
.
StackTrace
);
}
}
Thread
.
Sleep
(
1
);
Thread
.
Sleep
(
1
);
}
}
...
@@ -142,14 +141,22 @@ namespace OnlineStore.DeviceLibrary
...
@@ -142,14 +141,22 @@ namespace OnlineStore.DeviceLibrary
foreach
(
string
ip
in
DIONameList
)
foreach
(
string
ip
in
DIONameList
)
{
{
ConnectionIP
(
ip
,
port
);
ConnectionIP
(
ip
,
port
);
}
}
}
if
(
timer
==
null
)
public
static
void
ConnectionKND
(
string
ip
)
{
{
timer
=
new
System
.
Timers
.
Timer
();
//端口号暂时使用固定的502;
timer
.
Interval
=
1000
;
ushort
port
=
502
;
timer
.
AutoReset
=
true
;
ConnectionIP
(
ip
,
port
);
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
)
public
static
void
ReadMultipleDI
(
string
ioIp
,
byte
slaveId
,
ushort
StartAddress
,
ushort
length
)
{
{
isWrite
=
true
;
isWrite
=
true
;
...
@@ -187,9 +194,15 @@ namespace OnlineStore.DeviceLibrary
...
@@ -187,9 +194,15 @@ namespace OnlineStore.DeviceLibrary
{
{
isWrite
=
true
;
isWrite
=
true
;
foreach
(
string
key
in
mastMap
.
Keys
)
foreach
(
string
key
in
mastMap
.
Keys
)
{
{
byte
[]
data
=
new
byte
[]
{
0
,
0
};
try
WriteMultipleDO
(
key
,
DefualtSlaveID
,
DoStartAddress
,
DefualtLength
,
data
);
{
byte
[]
data
=
new
byte
[]
{
0
,
0
};
WriteMultipleDO
(
key
,
DefualtSlaveID
,
DoStartAddress
,
DefualtLength
,
data
);
}
catch
(
Exception
ex
)
{
LogUtil
.
error
(
"CloseAllDO出错:"
+
ex
.
ToString
());
}
}
}
isWrite
=
false
;
isWrite
=
false
;
}
}
...
...
source/DeviceLibrary/PanasonicServo/ACCMDManager.cs
查看文件 @
2373e21
...
@@ -10,9 +10,17 @@ namespace OnlineStore.DeviceLibrary
...
@@ -10,9 +10,17 @@ namespace OnlineStore.DeviceLibrary
/// <summary>
/// <summary>
/// 0132h 原点接近传感器输入 (HOME) 状态 ReadOnly 0: 输入 OFF 1: 输入 ON
/// 0132h 原点接近传感器输入 (HOME) 状态 ReadOnly 0: 输入 OFF 1: 输入 ON
/// </summary>
/// </summary>
public
static
string
Home_Single
=
"0132"
;
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>
/// <summary>
///速度 4601
///速度 4601
/// </summary>
/// </summary>
...
@@ -320,6 +328,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -320,6 +328,7 @@ namespace OnlineStore.DeviceLibrary
//sendData[4] = dataByte[1];
//sendData[4] = dataByte[1];
//sendData[5] = dataByte[0];
//sendData[5] = dataByte[0];
}
}
sendData
=
buildCheckData
(
sendData
,
sendData
.
Length
-
2
);
sendData
=
buildCheckData
(
sendData
,
sendData
.
Length
-
2
);
...
...
source/DeviceLibrary/PanasonicServo/ACServerManager.cs
查看文件 @
2373e21
此文件的差异被折叠,
点击展开。
source/DeviceLibrary/PanasonicServo/ACServerManager_Partial.cs
查看文件 @
2373e21
此文件的差异被折叠,
点击展开。
source/DeviceLibrary/StoreConfig/AC/StoreConfig.csv
查看文件 @
2373e21
...
@@ -32,8 +32,8 @@ DO,相机照明开,CameraLight_Power,110,192.168.200.11,0,相机照明开,Y11,DO-11,0,
...
@@ -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,允许放料信号,CanPutTray,114,192.168.200.11,0,允许放料信号,Y15,DO-15,0,
DO,可取料信号,CanGetTray,115,192.168.200.11,0,可取料信号,Y16,DO-16,0,
DO,可取料信号,CanGetTray,115,192.168.200.11,0,可取料信号,Y16,DO-16,0,
AXIS,(轴一)旋转轴,Middle_Axis,1,COM6,0,,,,,
AXIS,(轴一)旋转轴,Middle_Axis,1,COM6,0,,,,,
AXIS,(轴二)升降轴轴,UpDown_Axis,
1,COM5
,0,,,,,
AXIS,(轴二)升降轴轴,UpDown_Axis,
2,COM6
,0,,,,,
AXIS,(轴三)进出轴,InOut_Axis,
1,COM4
,0,,,,,
AXIS,(轴三)进出轴,InOut_Axis,
3,COM6
,0,,,,,
,温湿度传感器地址,Temperate_ServerAddress,192.168.200.34,,,,,,,
,温湿度传感器地址,Temperate_ServerAddress,192.168.200.34,,,,,,,
,扫码枪IP,Scanner_Ip,192.168.200.33,,,,,,,
,扫码枪IP,Scanner_Ip,192.168.200.33,,,,,,,
,扫码枪端口号,Scanner_Port,51236,,,,,,,
,扫码枪端口号,Scanner_Port,51236,,,,,,,
...
@@ -43,7 +43,7 @@ PRO,升降轴 进料口取料缓冲点 P7,UpDownAxis_DoorOBPosition_P7,415000,,,,,,,
...
@@ -43,7 +43,7 @@ PRO,升降轴 进料口取料缓冲点 P7,UpDownAxis_DoorOBPosition_P7,415000,,,,,,,
PRO,升降轴 进料口出料缓冲点 P8,UpDownAxis_DoorIBPosition_P8,403000,,,,,,,
PRO,升降轴 进料口出料缓冲点 P8,UpDownAxis_DoorIBPosition_P8,403000,,,,,,,
PRO,旋转轴(轴1)P1 待机原位点,MiddleAxis_P1_Position,268093,,,,,,,
PRO,旋转轴(轴1)P1 待机原位点,MiddleAxis_P1_Position,268093,,,,,,,
PRO,进出轴(轴3)P1待机原位点,InOutAxis_P1_Position,1000,,,,,,,
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,是否使用定位气缸,IsHasLocationCylinder,0,,,,,,,
PRO,是否有左右侧门,IsHasDoorLimit,1,,,,,,,
PRO,是否有左右侧门,IsHasDoorLimit,1,,,,,,,
PRO,是否使用压紧轴(1=使用),IsHasCompress_Axis,1,,,,, ,,
PRO,是否使用压紧轴(1=使用),IsHasCompress_Axis,1,,,,, ,,
...
@@ -70,6 +70,7 @@ PRO,(轴三)进出轴减速度,InoutAxis_DelSpeed,300,,,,,,,
...
@@ -70,6 +70,7 @@ PRO,(轴三)进出轴减速度,InoutAxis_DelSpeed,300,,,,,,,
PRO,(轴三)进出轴原点低速,InoutAxis_HomeLowSpeed,20,,,,,,,
PRO,(轴三)进出轴原点低速,InoutAxis_HomeLowSpeed,20,,,,,,,
PRO,(轴三)进出轴原点高速,InoutAxis_HomeHighSpeed,60,,,,,,,
PRO,(轴三)进出轴原点高速,InoutAxis_HomeHighSpeed,60,,,,,,,
PRO,(轴三)进出轴原点加速度,InoutAxis_HomeAddSpeed,200,,,,,,,
PRO,(轴三)进出轴原点加速度,InoutAxis_HomeAddSpeed,200,,,,,,,
PRO,升降轴(轴2)P1速度,UpDownAxis_P1_Speed,250,,,,,,,
PRO,升降轴(轴2)P1速度,UpDownAxis_P1_Speed,250,,,,,,,
PRO,升降轴(轴2)P2速度,UpDownAxis_P2_Speed,250,,,,,,,
PRO,升降轴(轴2)P2速度,UpDownAxis_P2_Speed,250,,,,,,,
PRO,升降轴(轴2)P3速度,UpDownAxis_P3_Speed,250,,,,,,,
PRO,升降轴(轴2)P3速度,UpDownAxis_P3_Speed,250,,,,,,,
...
@@ -106,18 +107,6 @@ PRO,每次吹气的时间(分钟),BlowAir_Time,10,,,,,,,
...
@@ -106,18 +107,6 @@ PRO,每次吹气的时间(分钟),BlowAir_Time,10,,,,,,,
PRO,两次吹气间隔(分钟),BlowAir_Interval,10,,,,,,,
PRO,两次吹气间隔(分钟),BlowAir_Interval,10,,,,,,,
PRO,温湿度端口号,Humiture_Port,COM1,,,,,,,
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,模拟量IO模块的IP地址,AIDevice_IP,192.168.200.12,,,,,,,
PRO,模拟信号1默认高度,AIDI1_DefaultPosition,2920,,,,,,,
PRO,模拟信号1默认高度,AIDI1_DefaultPosition,2920,,,,,,,
PRO,模拟信号2默认高度,AIDI2_DefaultPosition,2960,,,,,,,
PRO,模拟信号2默认高度,AIDI2_DefaultPosition,2960,,,,,,,
...
@@ -125,3 +114,15 @@ PRO,模拟信号3默认高度,AIDI3_DefaultPosition,2500,,,,,,,
...
@@ -125,3 +114,15 @@ PRO,模拟信号3默认高度,AIDI3_DefaultPosition,2500,,,,,,,
,,,,,,,,, ,
,,,,,,,,, ,
PRO,模拟信号1的地址,AIDI1_Addr,7,,,,,,,
PRO,模拟信号1的地址,AIDI1_Addr,7,,,,,,,
PRO,模拟信号2的地址,AIDI2_Addr,8,,,,,,,
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
查看文件 @
2373e21
此文件的差异被折叠,
点击展开。
source/DeviceLibrary/acSingleStore/AC_SA_BoxBean_Partial.cs
查看文件 @
2373e21
此文件的差异被折叠,
点击展开。
source/DeviceLibrary/acSingleStore/StoreManager.cs
查看文件 @
2373e21
...
@@ -29,24 +29,6 @@ namespace OnlineStore.DeviceLibrary
...
@@ -29,24 +29,6 @@ namespace OnlineStore.DeviceLibrary
public
StoreManager
()
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
)
public
static
void
CheckEnum
(
Type
type
)
{
{
if
(
type
.
IsEnum
)
if
(
type
.
IsEnum
)
...
...
source/DeviceLibrary/halcon/CodeManager.cs
查看文件 @
2373e21
此文件的差异被折叠,
点击展开。
source/DeviceLibrary/store/KTK_Store.cs
查看文件 @
2373e21
...
@@ -254,7 +254,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -254,7 +254,7 @@ namespace OnlineStore.DeviceLibrary
//如果是进出轴,并且光栅被遮挡,直接返回false
//如果是进出轴,并且光栅被遮挡,直接返回false
if
(
NeedCheckSafetyLight
.
Equals
(
2
))
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
))
StoreMove
.
MoveStep
.
Equals
(
StoreMoveStep
.
SI_05_DeviceToDoor
))
{
{
return
false
;
return
false
;
...
...
source/DeviceLibrary/store/StoreStep.cs
查看文件 @
2373e21
...
@@ -259,36 +259,39 @@ namespace OnlineStore.DeviceLibrary
...
@@ -259,36 +259,39 @@ namespace OnlineStore.DeviceLibrary
/// <summary>
/// <summary>
/// 料仓出库,定位气缸退回(有压紧轴的不需要此步骤),,定位气缸退回(Y104-1/PCI5O1-84) (Y104-2/PCI5O1-91) (Y104-2/PCI5O1-96) 退回到位
/// 料仓出库,定位气缸退回(有压紧轴的不需要此步骤),,定位气缸退回(Y104-1/PCI5O1-84) (Y104-2/PCI5O1-91) (Y104-2/PCI5O1-96) 退回到位
/// </summary>
/// </summary>
SO_09_Location
Cylinder_
Down
=
109
,
SO_09_LocationDown
=
109
,
/// <summary>
/// <summary>
/// 等待门口无料盘
/// 等待门口无料盘
/// </summary>
/// </summary>
SO_091_WaitNoTray
=
115
,
SO_11_WaitNoTray
,
/// <summary>
/// 等待门口无料盘
/// </summary>
SO_12_OpenDoor
,
/// <summary>
/// <summary>
/// 料仓出库,,叉子进出料口,,轴3( 叉子) 至P2( 进料口取料点)
/// 料仓出库,,叉子进出料口,,轴3( 叉子) 至P2( 进料口取料点)
/// /// </summary>
/// /// </summary>
SO_1
0_DeviceToDoor
=
110
,
SO_1
3_DeviceToDoor
,
/// <summary>
/// <summary>
/// 料仓出库,,把物品放下,,轴2( 上下) 至P8( 进料口出料缓冲点)轴4( 压紧) 至P1( 待机点)
/// 料仓出库,,把物品放下,,轴2( 上下) 至P8( 进料口出料缓冲点)轴4( 压紧) 至P1( 待机点)
/// </summary>
/// </summary>
SO_1
1_DevicePutWare
=
111
,
SO_1
4_DevicePutWare
,
/// <summary>
/// <summary>
/// 料仓出库,,叉子从出料口返回,,轴3( 叉子) 动作至P1( 待机点)
/// 料仓出库,,叉子从出料口返回,,轴3( 叉子) 动作至P1( 待机点)
/// </summary>
/// </summary>
SO_1
2_DeviceOutFromDoor
=
112
,
SO_1
5_InoutBack
,
/// <summary>
/// <summary>
/// 需要检测到门口有料盘高度
/// 需要检测到门口有料盘高度
/// </summary>
/// </summary>
SO_1
21_CheckHasTray
=
116
,
SO_1
6_CheckHasTray
,
/// <summary>
/// <summary>
/// 料仓出库,,升降轴返回,, 轴2至P1( 待机点)
/// 料仓出库,,升降轴返回,, 轴2至P1( 待机点)
/// </summary>
/// </summary>
SO_1
3_GoBack
=
113
,
SO_1
7_GoBack
,
/// <summary>
/// <summary>
/// 等待拿走物品
/// 等待拿走物品
/// </summary>
/// </summary>
SO_1
4_WaitTake
=
114
,
SO_1
8_WaitTake
,
#
endregion
#
endregion
...
@@ -296,7 +299,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -296,7 +299,7 @@ namespace OnlineStore.DeviceLibrary
/// <summary>
/// <summary>
/// 入库检测
/// 入库检测
/// </summary>
/// </summary>
SI_00_TrayCheck
=
200
,
SI_00_TrayCheck
=
200
,
/// <summary>
/// <summary>
/// 入库,。定位气缸下降
/// 入库,。定位气缸下降
/// </summary>
/// </summary>
...
...
source/LoadCVSLibrary/storeConfig/config/AC_SA_Config.cs
查看文件 @
2373e21
此文件的差异被折叠,
点击展开。
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论