1 Commits

Author SHA1 Message Date
杰 朱
b1f7a52fd7 1 2022-03-17 16:22:08 +08:00
5 changed files with 46 additions and 31 deletions

View File

@@ -2,63 +2,63 @@
<configuration> <configuration>
<configSections> <configSections>
<!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 --> <!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" /> <section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false"/>
</configSections> </configSections>
<connectionStrings> <connectionStrings>
<add name="NX_CLEAR_MAC_20200915Entities" connectionString="metadata=res://*/Entitys.Model1.csdl|res://*/Entitys.Model1.ssdl|res://*/Entitys.Model1.msl;provider=System.Data.SqlClient;provider connection string=&quot;data source=.;initial catalog=NX_CLEAR_MAC_20200915;persist security info=True;user id=sa;password=1q2w3e4r!@;MultipleActiveResultSets=True;App=EntityFramework&quot;" providerName="System.Data.EntityClient" /> <add name="NX_CLEAR_MAC_20200915Entities" connectionString="metadata=res://*/Entitys.Model1.csdl|res://*/Entitys.Model1.ssdl|res://*/Entitys.Model1.msl;provider=System.Data.SqlClient;provider connection string=&quot;data source=.;initial catalog=NX_CLEAR_MAC_20200915;persist security info=True;user id=sa;password=1q2w3e4r!@;MultipleActiveResultSets=True;App=EntityFramework&quot;" providerName="System.Data.EntityClient"/>
<add name="CleanMachineHMI.Properties.Settings.NX_CLEAR_MAC_20200915ConnectionString" connectionString="Data Source=.;Initial Catalog=NX_CLEAR_MAC_20200915;Persist Security Info=True;User ID=sa;Password=1q2w3e4r!@" providerName="System.Data.SqlClient" /> <add name="CleanMachineHMI.Properties.Settings.NX_CLEAR_MAC_20200915ConnectionString" connectionString="Data Source=.;Initial Catalog=NX_CLEAR_MAC_20200915;Persist Security Info=True;User ID=sa;Password=1q2w3e4r!@" providerName="System.Data.SqlClient"/>
</connectionStrings> </connectionStrings>
<startup> <startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" /> <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6"/>
</startup> </startup>
<appSettings> <appSettings>
<add key="GlobalPaletteMode" value="Professionaloffice2003" /> <add key="GlobalPaletteMode" value="Professionaloffice2003"/>
<!--<add key="LanguageCode" value="Chinese"/>--> <!--<add key="LanguageCode" value="Chinese"/>-->
<add key="LanguageCode" value="English" /> <add key="LanguageCode" value="English"/>
<add key="sqlmapConfigPath" value="Config/sqlmap.config" /> <add key="sqlmapConfigPath" value="Config/sqlmap.config"/>
<!--MySql数据库连接字符串--> <!--MySql数据库连接字符串-->
<add key="LeadMySql" value="Data Source = localhost; Port=3306;Initial Catalog = testasrs; Persist Security Info=True;User ID = root; Password=sa1234567;" /> <add key="LeadMySql" value="Data Source = localhost; Port=3306;Initial Catalog = testasrs; Persist Security Info=True;User ID = root; Password=sa1234567;"/>
<!--SqlServer数据库连接字符串--> <!--SqlServer数据库连接字符串-->
<add key="LeadSqlServer" value="Data Source =localhost;Initial Catalog =NX_CLEAR_MAC;User Id = sa;Password =syl.syl503601;" /> <add key="LeadSqlServer" value="Data Source =localhost;Initial Catalog =NX_CLEAR_MAC;User Id = sa;Password =syl.syl503601;"/>
<!--Oracle数据库连接字符串--> <!--Oracle数据库连接字符串-->
<add key="LeadOracle" value="Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=localhost)(PORT=1521)))(CONNECT_DATA=(SERVICE_NAME=ORCL)));User Id=LEADASRS; Password=LEADASRS;" /> <add key="LeadOracle" value="Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=localhost)(PORT=1521)))(CONNECT_DATA=(SERVICE_NAME=ORCL)));User Id=LEADASRS; Password=LEADASRS;"/>
<!--SQLite数据库连接字符串--> <!--SQLite数据库连接字符串-->
<!--<add key="LeadSQLite" value="Data Source=|DataDirectory|\\clearMac.db;Pooling=true;FailIfMissing=false"/>--> <!--<add key="LeadSQLite" value="Data Source=|DataDirectory|\\clearMac.db;Pooling=true;FailIfMissing=false"/>-->
<add key="LeadSQLite" value="Data Source=DataBase/clearMac.db" /> <add key="LeadSQLite" value="Data Source=DataBase/clearMac.db"/>
<!--串口名称--> <!--串口名称-->
<add key="PortName" value="COM3" /> <add key="PortName" value="COM3"/>
<!--串口波特率--> <!--串口波特率-->
<add key="BaudRate" value="9600" /> <add key="BaudRate" value="9600"/>
<!--串口数据位--> <!--串口数据位-->
<add key="DataBits" value="8" /> <add key="DataBits" value="8"/>
<!--停止位。 0:不使用停止位;1:使用一个停止位;2:使用两个停止位;3:使用 1.5 个停止位。--> <!--停止位。 0:不使用停止位;1:使用一个停止位;2:使用两个停止位;3:使用 1.5 个停止位。-->
<add key="StopBits" value="1" /> <add key="StopBits" value="1"/>
<!--奇偶校验。0:无校验;1:奇校验;2:偶校验;--> <!--奇偶校验。0:无校验;1:奇校验;2:偶校验;-->
<add key="ParityMsg" value="2" /> <add key="ParityMsg" value="2"/>
<!--托盘序列号前缀--> <!--托盘序列号前缀-->
<add key="PalletIndexPrefix" value="Pallet" /> <add key="PalletIndexPrefix" value="Pallet"/>
<!--托盘序列号生成日期--> <!--托盘序列号生成日期-->
<add key="PalletIndexDateMsg" value="20201107" /> <add key="PalletIndexDateMsg" value="20201107"/>
<!--托盘序列号长度--> <!--托盘序列号长度-->
<add key="PalletIndexLen" value="6" /> <add key="PalletIndexLen" value="6"/>
<!--当前托盘序列号值--> <!--当前托盘序列号值-->
<add key="PalletIndexValue" value="1" /> <add key="PalletIndexValue" value="1"/>
<!--记录上一次登录用户名--> <!--记录上一次登录用户名-->
<add key="LastTimeUserCode" value="" /> <add key="LastTimeUserCode" value=""/>
<add key="ClientSettingsProvider.ServiceUri" value="" /> <add key="ClientSettingsProvider.ServiceUri" value=""/>
</appSettings> </appSettings>
<system.web> <system.web>
<membership defaultProvider="ClientAuthenticationMembershipProvider"> <membership defaultProvider="ClientAuthenticationMembershipProvider">
<providers> <providers>
<add name="ClientAuthenticationMembershipProvider" type="System.Web.ClientServices.Providers.ClientFormsAuthenticationMembershipProvider, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" serviceUri="" /> <add name="ClientAuthenticationMembershipProvider" type="System.Web.ClientServices.Providers.ClientFormsAuthenticationMembershipProvider, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" serviceUri=""/>
</providers> </providers>
</membership> </membership>
<roleManager defaultProvider="ClientRoleProvider" enabled="true"> <roleManager defaultProvider="ClientRoleProvider" enabled="true">
<providers> <providers>
<add name="ClientRoleProvider" type="System.Web.ClientServices.Providers.ClientRoleProvider, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" serviceUri="" cacheTimeout="86400" /> <add name="ClientRoleProvider" type="System.Web.ClientServices.Providers.ClientRoleProvider, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" serviceUri="" cacheTimeout="86400"/>
</providers> </providers>
</roleManager> </roleManager>
</system.web> </system.web>
</configuration> </configuration>

View File

@@ -8,7 +8,7 @@
<OutputType>WinExe</OutputType> <OutputType>WinExe</OutputType>
<RootNamespace>CleanMachineHMI</RootNamespace> <RootNamespace>CleanMachineHMI</RootNamespace>
<AssemblyName>CleanMachineHMI</AssemblyName> <AssemblyName>CleanMachineHMI</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion> <TargetFrameworkVersion>v4.6</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment> <FileAlignment>512</FileAlignment>
<Deterministic>true</Deterministic> <Deterministic>true</Deterministic>
<TargetFrameworkProfile /> <TargetFrameworkProfile />

View File

@@ -1267,7 +1267,8 @@ namespace CleanMachineHMI.FrmUserControl
{ {
while (GlobalHelper.SysThIsRunFlag) while (GlobalHelper.SysThIsRunFlag)
{ {
try
{
if (Convert.ToBoolean(PlcOperationHelper.Instance.ReadPlcItem("CleanMacRunStatusNew", PlcItemTypeDesc.M))) if (Convert.ToBoolean(PlcOperationHelper.Instance.ReadPlcItem("CleanMacRunStatusNew", PlcItemTypeDesc.M)))
{ {
Invoke(new Action(() => { cbt_RunStatusTran.BackColor = Color.Lime; })); Invoke(new Action(() => { cbt_RunStatusTran.BackColor = Color.Lime; }));
@@ -1530,8 +1531,11 @@ namespace CleanMachineHMI.FrmUserControl
//autoCleanNum = 0; //autoCleanNum = 0;
} }
FinishWorkingPallet(); FinishWorkingPallet();
}
catch
{
}
Thread.Sleep(200); Thread.Sleep(200);
} }
} }

View File

@@ -12,7 +12,7 @@ namespace CleanMachineHMI.Properties {
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "16.7.0.0")] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "16.10.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())));

View File

@@ -792,7 +792,18 @@ namespace CleanMachineHMI
WritePlcItem("PlcHeartbeatWriteData", wcsToPlcHeartDataNew.ToString(), PlcItemTypeDesc.D); WritePlcItem("PlcHeartbeatWriteData", wcsToPlcHeartDataNew.ToString(), PlcItemTypeDesc.D);
} }
if (DateTime.Now > HeartbeatTime.AddSeconds(5))//心跳超时
{
isConn = false;
//报警处理。
frmMainNew.Show_Plc_Alarm("PLC heartbeat data is abnormal, PLC loses connection!");
if (ReConnNum % 5 == 0)
{
ClosePlcConn();
PlcInit();
}
ReConnNum++;
}
} }
catch catch
{ {