diff --git a/NA200H/ModBus.Net.Modeling/ModBus.Net.Modeling.modelproj b/NA200H/ModBus.Net.Modeling/ModBus.Net.Modeling.modelproj new file mode 100644 index 0000000..a99bd60 --- /dev/null +++ b/NA200H/ModBus.Net.Modeling/ModBus.Net.Modeling.modelproj @@ -0,0 +1,39 @@ + + + + + Debug + AnyCPU + 2.0 + {fa929e21-544c-444e-b18d-184e98b427c6} + 2.0.0.0 + ModBus.Net.Modeling + ModBus.Net.Modeling + + + bin\Debug\ + + + bin\Release\ + + + 10.0 + $(MSBuildExtensionsPath)\Microsoft\VisualStudio\v$(VisualStudioVersion) + + + + + Content + + + Content + + + Content + + + + Content + + + \ No newline at end of file diff --git a/NA200H/ModBus.Net.Modeling/ModelDefinition/ModBus.Net.Modeling.uml b/NA200H/ModBus.Net.Modeling/ModelDefinition/ModBus.Net.Modeling.uml new file mode 100644 index 0000000..ccfa9f7 --- /dev/null +++ b/NA200H/ModBus.Net.Modeling/ModelDefinition/ModBus.Net.Modeling.uml @@ -0,0 +1,60 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/NA200H/ModBus.Net.Modeling/ModelDefinition/Package1_1514.uml b/NA200H/ModBus.Net.Modeling/ModelDefinition/Package1_1514.uml new file mode 100644 index 0000000..ef05f6d --- /dev/null +++ b/NA200H/ModBus.Net.Modeling/ModelDefinition/Package1_1514.uml @@ -0,0 +1,1947 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 属性 Logger 引用类型 ILog。 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/NA200H/ModBus.Net.Modeling/ModelDefinition/Package2_1514.uml b/NA200H/ModBus.Net.Modeling/ModelDefinition/Package2_1514.uml new file mode 100644 index 0000000..a9b551f --- /dev/null +++ b/NA200H/ModBus.Net.Modeling/ModelDefinition/Package2_1514.uml @@ -0,0 +1,176 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/NA200H/ModBus.Net.Modeling/ModelDefinition/Package_1514.uml b/NA200H/ModBus.Net.Modeling/ModelDefinition/Package_1514.uml new file mode 100644 index 0000000..8dd292b --- /dev/null +++ b/NA200H/ModBus.Net.Modeling/ModelDefinition/Package_1514.uml @@ -0,0 +1,21 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/NA200H/NA200H.UI.Console/App.config b/NA200H/NA200H.UI.Console/App.config new file mode 100644 index 0000000..8e15646 --- /dev/null +++ b/NA200H/NA200H.UI.Console/App.config @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/NA200H/NA200H.UI.Console/NA200H.UI.ConsoleApp.csproj b/NA200H/NA200H.UI.Console/NA200H.UI.ConsoleApp.csproj new file mode 100644 index 0000000..7c88f3e --- /dev/null +++ b/NA200H/NA200H.UI.Console/NA200H.UI.ConsoleApp.csproj @@ -0,0 +1,64 @@ + + + + + Debug + AnyCPU + {D06F6A34-93F6-4139-B485-8F5686E4E2C9} + Exe + Properties + NA200H.UI.ConsoleApp + NA200H.UI.ConsoleApp + v4.5 + 512 + + + AnyCPU + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + AnyCPU + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + + + + + + + + + + + {124ebef2-8960-4447-84cf-1d683b1ef7cc} + ModBus.Net + + + + + \ No newline at end of file diff --git a/NA200H/NA200H.UI.Console/Properties/AssemblyInfo.cs b/NA200H/NA200H.UI.Console/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..355b2c3 --- /dev/null +++ b/NA200H/NA200H.UI.Console/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// 有关程序集的常规信息通过以下 +// 特性集控制。更改这些特性值可修改 +// 与程序集关联的信息。 +[assembly: AssemblyTitle("NA200H.UI.Console")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("NA200H.UI.Console")] +[assembly: AssemblyCopyright("Copyright © 2014")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// 将 ComVisible 设置为 false 使此程序集中的类型 +// 对 COM 组件不可见。 如果需要从 COM 访问此程序集中的类型, +// 则将该类型上的 ComVisible 特性设置为 true。 +[assembly: ComVisible(false)] + +// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID +[assembly: Guid("5cd5ca28-45d0-4c5e-a488-0973d2d4fa51")] + +// 程序集的版本信息由下面四个值组成: +// +// 主版本 +// 次版本 +// 生成号 +// 修订号 +// +// 可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值, +// 方法是按如下所示使用“*”: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/NA200H/NA200H.UI.WPF/App.config b/NA200H/NA200H.UI.WPF/App.config new file mode 100644 index 0000000..8e15646 --- /dev/null +++ b/NA200H/NA200H.UI.WPF/App.config @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/NA200H/NA200H.UI.WPF/App.xaml b/NA200H/NA200H.UI.WPF/App.xaml new file mode 100644 index 0000000..415fa18 --- /dev/null +++ b/NA200H/NA200H.UI.WPF/App.xaml @@ -0,0 +1,8 @@ + + + + + diff --git a/NA200H/NA200H.UI.WPF/App.xaml.cs b/NA200H/NA200H.UI.WPF/App.xaml.cs new file mode 100644 index 0000000..77b3946 --- /dev/null +++ b/NA200H/NA200H.UI.WPF/App.xaml.cs @@ -0,0 +1,17 @@ +using System; +using System.Collections.Generic; +using System.Configuration; +using System.Data; +using System.Linq; +using System.Threading.Tasks; +using System.Windows; + +namespace NA200H.UI.WPF +{ + /// + /// App.xaml 的交互逻辑 + /// + public partial class App : Application + { + } +} diff --git a/NA200H/NA200H.UI.WPF/MainWindow.xaml b/NA200H/NA200H.UI.WPF/MainWindow.xaml new file mode 100644 index 0000000..d9d3a56 --- /dev/null +++ b/NA200H/NA200H.UI.WPF/MainWindow.xaml @@ -0,0 +1,8 @@ + + + + + diff --git a/NA200H/NA200H.UI.WPF/MainWindow.xaml.cs b/NA200H/NA200H.UI.WPF/MainWindow.xaml.cs new file mode 100644 index 0000000..65ff804 --- /dev/null +++ b/NA200H/NA200H.UI.WPF/MainWindow.xaml.cs @@ -0,0 +1,37 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Data; +using System.Windows.Documents; +using System.Windows.Input; +using System.Windows.Media; +using System.Windows.Media.Imaging; +using System.Windows.Navigation; +using System.Windows.Shapes; +using ModBus.Net; + +namespace NA200H.UI.WPF +{ + /// + /// MainWindow.xaml 的交互逻辑 + /// + public partial class MainWindow : Window + { + public MainWindow() + { + InitializeComponent(); + ModbusTCPProtocal wrapper = new ModbusTCPProtocal(); + ReadCoilStatusTCPProtocal.ReadCoilStatusInputStruct readCoilStatusInputStruct = new ReadCoilStatusTCPProtocal.ReadCoilStatusInputStruct(11, "Q1", 3); + ReadCoilStatusTCPProtocal.ReadCoilStatusOutputStruct readCoilStatusOutputStruct = wrapper.Protocals[ReadCoilStatusTCPProtocal.GetType()].SendReceive(readCoilStatusInputStruct); + for (int i = 0; i < readCoilStatusOutputStruct.CoilStatus.Length; i++) + { + System.Console.WriteLine(readCoilStatusOutputStruct.CoilStatus[i]); + } + System.Console.Read(); + } + } +} diff --git a/NA200H/NA200H.UI.WPF/NA200H.UI.WPF.csproj b/NA200H/NA200H.UI.WPF/NA200H.UI.WPF.csproj new file mode 100644 index 0000000..6642d11 --- /dev/null +++ b/NA200H/NA200H.UI.WPF/NA200H.UI.WPF.csproj @@ -0,0 +1,110 @@ + + + + + Debug + AnyCPU + {78916B03-C910-468E-B593-667A3EFF68BE} + WinExe + Properties + NA200H.UI.WPF + NA200H.UI.WPF + v4.5 + 512 + {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + 4 + + + AnyCPU + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + AnyCPU + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + + 4.0 + + + + + + + + MSBuild:Compile + Designer + + + MSBuild:Compile + Designer + + + App.xaml + Code + + + MainWindow.xaml + Code + + + + + Code + + + True + True + Resources.resx + + + True + Settings.settings + True + + + ResXFileCodeGenerator + Resources.Designer.cs + + + SettingsSingleFileGenerator + Settings.Designer.cs + + + + + + + + + {124ebef2-8960-4447-84cf-1d683b1ef7cc} + ModBus.Net + + + + + \ No newline at end of file diff --git a/NA200H/NA200H.UI.WPF/Properties/AssemblyInfo.cs b/NA200H/NA200H.UI.WPF/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..219d8ec --- /dev/null +++ b/NA200H/NA200H.UI.WPF/Properties/AssemblyInfo.cs @@ -0,0 +1,55 @@ +using System.Reflection; +using System.Resources; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Windows; + +// 有关程序集的常规信息通过以下 +// 特性集控制。更改这些特性值可修改 +// 与程序集关联的信息。 +[assembly: AssemblyTitle("NA200H.UI.WPF")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("NA200H.UI.WPF")] +[assembly: AssemblyCopyright("Copyright © 2014")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// 将 ComVisible 设置为 false 使此程序集中的类型 +// 对 COM 组件不可见。 如果需要从 COM 访问此程序集中的类型, +// 则将该类型上的 ComVisible 特性设置为 true。 +[assembly: ComVisible(false)] + +//若要开始生成可本地化的应用程序,请在 +// 中的 .csproj 文件中 +//设置 CultureYouAreCodingWith。 例如,如果您在源文件中 +//使用的是美国英语,请将 设置为 en-US。 然后取消 +//对以下 NeutralResourceLanguage 特性的注释。 更新 +//以下行中的“en-US”以匹配项目文件中的 UICulture 设置。 + +//[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)] + + +[assembly: ThemeInfo( + ResourceDictionaryLocation.None, //主题特定资源词典所处位置 + //(在页面或应用程序资源词典中 + // 未找到某个资源的情况下使用) + ResourceDictionaryLocation.SourceAssembly //常规资源词典所处位置 + //(在页面、应用程序或任何主题特定资源词典中 + // 未找到某个资源的情况下使用) +)] + + +// 程序集的版本信息由下面四个值组成: +// +// 主版本 +// 次版本 +// 生成号 +// 修订号 +// +// 可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值, +// 方法是按如下所示使用“*”: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/NA200H/NA200H.UI.WPF/Properties/Resources.Designer.cs b/NA200H/NA200H.UI.WPF/Properties/Resources.Designer.cs new file mode 100644 index 0000000..b26df0d --- /dev/null +++ b/NA200H/NA200H.UI.WPF/Properties/Resources.Designer.cs @@ -0,0 +1,71 @@ +//------------------------------------------------------------------------------ +// +// 此代码由工具生成。 +// 运行时版本: 4.0.30319.34014 +// +// 对此文件的更改可能会导致不正确的行为,并且如果 +// 重新生成代码,这些更改将丢失。 +// +//------------------------------------------------------------------------------ + +namespace NA200H.UI.WPF.Properties +{ + + + /// + /// 一个强类型的资源类,用于查找本地化的字符串等。 + /// + // 此类是由 StronglyTypedResourceBuilder + // 类通过类似于 ResGen 或 Visual Studio 的工具自动生成的。 + // 若要添加或移除成员,请编辑 .ResX 文件,然后重新运行 ResGen + // (以 /str 作为命令选项),或重新生成 VS 项目。 + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + internal class Resources + { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal Resources() + { + } + + /// + /// 返回此类使用的、缓存的 ResourceManager 实例。 + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Resources.ResourceManager ResourceManager + { + get + { + if ((resourceMan == null)) + { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("NA200H.UI.WPF.Properties.Resources", typeof(Resources).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// 为所有资源查找重写当前线程的 CurrentUICulture 属性, + /// 方法是使用此强类型资源类。 + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture + { + get + { + return resourceCulture; + } + set + { + resourceCulture = value; + } + } + } +} diff --git a/NA200H/NA200H.UI.WPF/Properties/Resources.resx b/NA200H/NA200H.UI.WPF/Properties/Resources.resx new file mode 100644 index 0000000..af7dbeb --- /dev/null +++ b/NA200H/NA200H.UI.WPF/Properties/Resources.resx @@ -0,0 +1,117 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/NA200H/NA200H.UI.WPF/Properties/Settings.Designer.cs b/NA200H/NA200H.UI.WPF/Properties/Settings.Designer.cs new file mode 100644 index 0000000..08fde99 --- /dev/null +++ b/NA200H/NA200H.UI.WPF/Properties/Settings.Designer.cs @@ -0,0 +1,30 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.34014 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace NA200H.UI.WPF.Properties +{ + + + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")] + internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase + { + + private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); + + public static Settings Default + { + get + { + return defaultInstance; + } + } + } +} diff --git a/NA200H/NA200H.UI.WPF/Properties/Settings.settings b/NA200H/NA200H.UI.WPF/Properties/Settings.settings new file mode 100644 index 0000000..033d7a5 --- /dev/null +++ b/NA200H/NA200H.UI.WPF/Properties/Settings.settings @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/NA200H/NA200H.sln b/NA200H/NA200H.sln new file mode 100644 index 0000000..102fb28 --- /dev/null +++ b/NA200H/NA200H.sln @@ -0,0 +1,40 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 2013 +VisualStudioVersion = 12.0.30501.0 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NA200H.UI.ConsoleApp", "NA200H.UI.Console\NA200H.UI.ConsoleApp.csproj", "{D06F6A34-93F6-4139-B485-8F5686E4E2C9}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ModBus.Net", "ModBus.Net\ModBus.Net.csproj", "{124EBEF2-8960-4447-84CF-1D683B1EF7CC}" +EndProject +Project("{F088123C-0E9E-452A-89E6-6BA2F21D5CAC}") = "ModBus.Net.Modeling", "ModBus.Net.Modeling\ModBus.Net.Modeling.modelproj", "{FA929E21-544C-444E-B18D-184E98B427C6}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NA200H.UI.WPF", "NA200H.UI.WPF\NA200H.UI.WPF.csproj", "{78916B03-C910-468E-B593-667A3EFF68BE}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {D06F6A34-93F6-4139-B485-8F5686E4E2C9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {D06F6A34-93F6-4139-B485-8F5686E4E2C9}.Debug|Any CPU.Build.0 = Debug|Any CPU + {D06F6A34-93F6-4139-B485-8F5686E4E2C9}.Release|Any CPU.ActiveCfg = Release|Any CPU + {D06F6A34-93F6-4139-B485-8F5686E4E2C9}.Release|Any CPU.Build.0 = Release|Any CPU + {124EBEF2-8960-4447-84CF-1D683B1EF7CC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {124EBEF2-8960-4447-84CF-1D683B1EF7CC}.Debug|Any CPU.Build.0 = Debug|Any CPU + {124EBEF2-8960-4447-84CF-1D683B1EF7CC}.Release|Any CPU.ActiveCfg = Release|Any CPU + {124EBEF2-8960-4447-84CF-1D683B1EF7CC}.Release|Any CPU.Build.0 = Release|Any CPU + {FA929E21-544C-444E-B18D-184E98B427C6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {FA929E21-544C-444E-B18D-184E98B427C6}.Debug|Any CPU.Build.0 = Debug|Any CPU + {FA929E21-544C-444E-B18D-184E98B427C6}.Release|Any CPU.ActiveCfg = Release|Any CPU + {FA929E21-544C-444E-B18D-184E98B427C6}.Release|Any CPU.Build.0 = Release|Any CPU + {78916B03-C910-468E-B593-667A3EFF68BE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {78916B03-C910-468E-B593-667A3EFF68BE}.Debug|Any CPU.Build.0 = Debug|Any CPU + {78916B03-C910-468E-B593-667A3EFF68BE}.Release|Any CPU.ActiveCfg = Release|Any CPU + {78916B03-C910-468E-B593-667A3EFF68BE}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal