修改plc

master
nodyang 1 year ago
parent df5758ff0c
commit dd9fcefccf

@ -153,6 +153,9 @@
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\PlugInPlatform\Mesnac.PlugIn.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Office.Interop.Excel">
<HintPath>..\Microsoft.Office.Interop.Excel.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Configuration" />
<Reference Include="System.Core" />

@ -1,3 +1,3 @@
<DataSources>
<DataSourceItem Name="DataSource1" Driver="MS SQL Server" Server="10.11.41.1" UserName="sa" Password="123456" DataBase="CWSSHG" ConnectionTimeout="5" DriverAssembly="ICSharpCode.Data.SQLServer, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" DriverClass="ICSharpCode.Data.Core.DatabaseDrivers.SQLServer.SQLServerDatabaseDriver" DataSourceClass="ICSharpCode.Data.Core.DatabaseObjects.Database" />
<DataSourceItem Name="DataSource1" Driver="MS SQL Server" Server="192.168.0.125" UserName="sa" Password="123456" DataBase="CWSSHG" ConnectionTimeout="5" DriverAssembly="ICSharpCode.Data.SQLServer, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" DriverClass="ICSharpCode.Data.Core.DatabaseDrivers.SQLServer.SQLServerDatabaseDriver" DataSourceClass="ICSharpCode.Data.Core.DatabaseObjects.Database" />
</DataSources>

@ -100,7 +100,10 @@ namespace MCEdit
//Mesnac.Basic.UserInfo.Instance.UserName = "mesnac";
//退出系统之前,关闭相关文档
WorkbenchSingleton.Workbench.ShutDown += delegate(object sender, EventArgs e) { Mesnac.Gui.Edit.ViewContent.DisplayUtil<Mesnac.Gui.Edit.Pad.ProjectWindow>.ClearProject(); };
WorkbenchSingleton.Workbench.ShutDown += delegate(object sender, EventArgs e)
{
Mesnac.Gui.Edit.ViewContent.DisplayUtil<Mesnac.Gui.Edit.Pad.ProjectWindow>.ClearProject();
};
Form frmMain = WorkbenchSingleton.Workbench as Form;
Application.Run(frmMain);

@ -3,7 +3,9 @@ using System.Collections.Generic;
using System.Reflection;
using System.Text;
using System.IO;
using System.Linq;
using System.Windows.Forms;
using System.Xml;
using ICSharpCode.Core;
using ICSharpCode.Core.Services;
using Mesnac.Gui.Run.Global;
@ -103,8 +105,20 @@ namespace MCRun
{
AppConfigHandler.Instance.InitCustomerMenuAndToolStrip(WorkbenchSingleton.Workbench.TopMenu, WorkbenchSingleton.Workbench.ToolStrip); //初始化自定义系统菜单和工具栏
try
{
var instance = Mesnac.Equips.Factory.Instance.ConfigFile;
XmlDocument doc = new XmlDocument();
doc.Load(instance);
var nodes = doc.ChildNodes[1].ChildNodes[0].ChildNodes[0].ChildNodes[4].ChildNodes[0];
var ip = nodes.Attributes["value"].Value;
//初始化HslCommunication 11.0.6.0
PlcBusiness.Instance.InitPlcConnect(PlcType.SiemensPlc, "127.0.0.1", 12);
PlcBusiness.Instance.InitPlcConnect(PlcType.SiemensPlc,ip, 102);
}
catch (Exception exception)
{
ICSharpCode.Core.LoggingService<Program>.Debug("HSLPlc读取失败");
}
//初始化连接报警器
DoControl.Instance.ComOn();
}

Loading…
Cancel
Save