在好例子网,分享、交流、成长!
您当前所在位置:首页C# 开发实例C#语言基础 → 西门子系列PLC与上位通讯实例

西门子系列PLC与上位通讯实例

C#语言基础

下载此实例
  • 开发语言:C#
  • 实例大小:5.47M
  • 下载次数:114
  • 浏览次数:582
  • 发布时间:2021-08-12
  • 实例类别:C#语言基础
  • 发 布 人:yun27989
  • 文件格式:.rar
  • 所需积分:20

实例介绍

【实例简介】本实例可以自动加载已配置好的PLC个数,数量没有限制。如有疑问,可加QQ:492901633

【实例截图】可以通过Postman来读写数据

from clipboard


from clipboard

【源码目录】

s7netplus-0.9.0github源码读写测试0811

└── s7netplus-0.9.0github源码读写测试0811
    ├── Documentation
    │   ├── Documentation.docx
    │   ├── Documentation.pdf
    │   ├── protection 2.png
    │   ├── protection.png
    │   └── struct.png
    ├── S7.Net
    │   ├── COTP.cs
    │   ├── Compat
    │   │   └── TcpClientMixins.cs
    │   ├── Conversion.cs
    │   ├── Enums.cs
    │   ├── Helper
    │   │   └── MemoryStreamExtension.cs
    │   ├── InvalidDataException.cs
    │   ├── PLC.cs
    │   ├── PLCAddress.cs
    │   ├── PLCExceptions.cs
    │   ├── PLCHelpers.cs
    │   ├── PlcAsynchronous.cs
    │   ├── PlcException.cs
    │   ├── PlcSynchronous.cs
    │   ├── Properties
    │   │   ├── AssemblyInfo.cs
    │   │   └── S7.Net.snk
    │   ├── Protocol
    │   │   ├── ConnectionRequest.cs
    │   │   ├── ReadWriteErrorCode.cs
    │   │   ├── S7
    │   │   │   └── DataItemAddress.cs
    │   │   ├── S7WriteMultiple.cs
    │   │   └── Serialization.cs
    │   ├── S7.Net.csproj
    │   ├── StreamExtensions.cs
    │   ├── TPKT.cs
    │   ├── Types
    │   │   ├── Bit.cs
    │   │   ├── Boolean.cs
    │   │   ├── Byte.cs
    │   │   ├── ByteArray.cs
    │   │   ├── Class.cs
    │   │   ├── Counter.cs
    │   │   ├── DInt.cs
    │   │   ├── DWord.cs
    │   │   ├── DataItem.cs
    │   │   ├── DateTime.cs
    │   │   ├── DateTimeLong.cs
    │   │   ├── Double.cs
    │   │   ├── Int.cs
    │   │   ├── LReal.cs
    │   │   ├── Real.cs
    │   │   ├── S7String.cs
    │   │   ├── S7StringAttribute.cs
    │   │   ├── S7WString.cs
    │   │   ├── Single.cs
    │   │   ├── String.cs
    │   │   ├── StringEx.cs
    │   │   ├── Struct.cs
    │   │   ├── Timer.cs
    │   │   ├── TypeHelper.cs
    │   │   └── Word.cs
    │   ├── bin
    │   │   └── Debug
    │   │       ├── net452
    │   │       │   ├── S7.Net.dll
    │   │       │   ├── S7.Net.pdb
    │   │       │   └── S7.Net.xml
    │   │       ├── netstandard1.3
    │   │       │   ├── S7.Net.deps.json
    │   │       │   ├── S7.Net.dll
    │   │       │   ├── S7.Net.pdb
    │   │       │   └── S7.Net.xml
    │   │       └── netstandard2.0
    │   │           ├── S7.Net.deps.json
    │   │           ├── S7.Net.dll
    │   │           ├── S7.Net.pdb
    │   │           └── S7.Net.xml
    │   └── obj
    │       ├── Debug
    │       │   ├── net452
    │       │   │   ├── S7.Net.AssemblyInfo.cs
    │       │   │   ├── S7.Net.AssemblyInfoInputs.cache
    │       │   │   ├── S7.Net.assets.cache
    │       │   │   ├── S7.Net.csproj.AssemblyReference.cache
    │       │   │   ├── S7.Net.csproj.CoreCompileInputs.cache
    │       │   │   ├── S7.Net.csproj.FileListAbsolute.txt
    │       │   │   ├── S7.Net.dll
    │       │   │   ├── S7.Net.pdb
    │       │   │   ├── S7.Net.sourcelink.json
    │       │   │   └── S7.Net.xml
    │       │   ├── netstandard1.3
    │       │   │   ├── S7.Net.AssemblyInfo.cs
    │       │   │   ├── S7.Net.AssemblyInfoInputs.cache
    │       │   │   ├── S7.Net.assets.cache
    │       │   │   ├── S7.Net.csproj.AssemblyReference.cache
    │       │   │   ├── S7.Net.csproj.CoreCompileInputs.cache
    │       │   │   ├── S7.Net.csproj.FileListAbsolute.txt
    │       │   │   ├── S7.Net.dll
    │       │   │   ├── S7.Net.pdb
    │       │   │   ├── S7.Net.sourcelink.json
    │       │   │   └── S7.Net.xml
    │       │   └── netstandard2.0
    │       │       ├── S7.Net.AssemblyInfo.cs
    │       │       ├── S7.Net.AssemblyInfoInputs.cache
    │       │       ├── S7.Net.assets.cache
    │       │       ├── S7.Net.csproj.AssemblyReference.cache
    │       │       ├── S7.Net.csproj.CoreCompileInputs.cache
    │       │       ├── S7.Net.csproj.FileListAbsolute.txt
    │       │       ├── S7.Net.dll
    │       │       ├── S7.Net.pdb
    │       │       ├── S7.Net.sourcelink.json
    │       │       └── S7.Net.xml
    │       ├── S7.Net.csproj.nuget.dgspec.json
    │       ├── S7.Net.csproj.nuget.g.props
    │       ├── S7.Net.csproj.nuget.g.targets
    │       ├── project.assets.json
    │       └── project.nuget.cache
    ├── S7.Net.UnitTest
    │   ├── ConnectionRequestTest.cs
    │   ├── ConvertersUnitTest.cs
    │   ├── Helpers
    │   │   ├── ConsoleManager.cs
    │   │   ├── NativeMethods.cs
    │   │   ├── S7TestServer.cs
    │   │   ├── TestClass.cs
    │   │   ├── TestClassWithArrays.cs
    │   │   ├── TestClassWithCustomType.cs
    │   │   ├── TestClassWithNestedClass.cs
    │   │   ├── TestClassWithPrivateSetters.cs
    │   │   ├── TestLongClass.cs
    │   │   ├── TestLongStruct.cs
    │   │   ├── TestSmallClass.cs
    │   │   └── TestStruct.cs
    │   ├── PLCAddressParsingTests.cs
    │   ├── Properties
    │   │   └── S7.Net.snk
    │   ├── ProtocolTests.cs
    │   ├── S7.Net.UnitTest.csproj
    │   ├── S7NetTestsAsync.cs
    │   ├── S7NetTestsSync.cs
    │   ├── Snap7
    │   │   └── snap7.net.cs
    │   ├── StreamTests.cs
    │   ├── TypeTests
    │   │   ├── ClassTests.cs
    │   │   ├── DateTimeLongTests.cs
    │   │   ├── DateTimeTests.cs
    │   │   ├── S7StringTests.cs
    │   │   ├── S7WStringTests.cs
    │   │   └── StringTests.cs
    │   ├── bin
    │   │   └── Debug
    │   │       ├── net452
    │   │       │   ├── GitHubActionsTestLogger.dll
    │   │       │   ├── Microsoft.TestPlatform.CoreUtilities.dll
    │   │       │   ├── Microsoft.TestPlatform.PlatformAbstractions.dll
    │   │       │   ├── Microsoft.VisualStudio.CodeCoverage.Shim.dll
    │   │       │   ├── Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.dll
    │   │       │   ├── Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.Interface.dll
    │   │       │   ├── Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.dll
    │   │       │   ├── Microsoft.VisualStudio.TestPlatform.ObjectModel.dll
    │   │       │   ├── Microsoft.VisualStudio.TestPlatform.TestFramework.Extensions.dll
    │   │       │   ├── Microsoft.VisualStudio.TestPlatform.TestFramework.dll
    │   │       │   ├── S7.Net.UnitTest.dll
    │   │       │   ├── S7.Net.UnitTest.pdb
    │   │       │   ├── S7.Net.dll
    │   │       │   ├── S7.Net.pdb
    │   │       │   ├── S7.Net.xml
    │   │       │   ├── System.Collections.Immutable.dll
    │   │       │   ├── System.Reflection.Metadata.dll
    │   │       │   ├── System.Runtime.InteropServices.RuntimeInformation.dll
    │   │       │   ├── cs
    │   │       │   │   ├── Microsoft.TestPlatform.CoreUtilities.resources.dll
    │   │       │   │   └── Microsoft.VisualStudio.TestPlatform.ObjectModel.resources.dll
    │   │       │   ├── de
    │   │       │   │   ├── Microsoft.TestPlatform.CoreUtilities.resources.dll
    │   │       │   │   └── Microsoft.VisualStudio.TestPlatform.ObjectModel.resources.dll
    │   │       │   ├── es
    │   │       │   │   ├── Microsoft.TestPlatform.CoreUtilities.resources.dll
    │   │       │   │   └── Microsoft.VisualStudio.TestPlatform.ObjectModel.resources.dll
    │   │       │   ├── fr
    │   │       │   │   ├── Microsoft.TestPlatform.CoreUtilities.resources.dll
    │   │       │   │   └── Microsoft.VisualStudio.TestPlatform.ObjectModel.resources.dll
    │   │       │   ├── it
    │   │       │   │   ├── Microsoft.TestPlatform.CoreUtilities.resources.dll
    │   │       │   │   └── Microsoft.VisualStudio.TestPlatform.ObjectModel.resources.dll
    │   │       │   ├── ja
    │   │       │   │   ├── Microsoft.TestPlatform.CoreUtilities.resources.dll
    │   │       │   │   └── Microsoft.VisualStudio.TestPlatform.ObjectModel.resources.dll
    │   │       │   ├── ko
    │   │       │   │   ├── Microsoft.TestPlatform.CoreUtilities.resources.dll
    │   │       │   │   └── Microsoft.VisualStudio.TestPlatform.ObjectModel.resources.dll
    │   │       │   ├── pl
    │   │       │   │   ├── Microsoft.TestPlatform.CoreUtilities.resources.dll
    │   │       │   │   └── Microsoft.VisualStudio.TestPlatform.ObjectModel.resources.dll
    │   │       │   ├── pt-BR
    │   │       │   │   ├── Microsoft.TestPlatform.CoreUtilities.resources.dll
    │   │       │   │   └── Microsoft.VisualStudio.TestPlatform.ObjectModel.resources.dll
    │   │       │   ├── ru
    │   │       │   │   ├── Microsoft.TestPlatform.CoreUtilities.resources.dll
    │   │       │   │   └── Microsoft.VisualStudio.TestPlatform.ObjectModel.resources.dll
    │   │       │   ├── snap7.dll
    │   │       │   ├── tr
    │   │       │   │   ├── Microsoft.TestPlatform.CoreUtilities.resources.dll
    │   │       │   │   └── Microsoft.VisualStudio.TestPlatform.ObjectModel.resources.dll
    │   │       │   ├── zh-Hans
    │   │       │   │   ├── Microsoft.TestPlatform.CoreUtilities.resources.dll
    │   │       │   │   ├── Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.resources.dll
    │   │       │   │   ├── Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.resources.dll
    │   │       │   │   ├── Microsoft.VisualStudio.TestPlatform.ObjectModel.resources.dll
    │   │       │   │   └── Microsoft.VisualStudio.TestPlatform.TestFramework.resources.dll
    │   │       │   └── zh-Hant
    │   │       │       ├── Microsoft.TestPlatform.CoreUtilities.resources.dll
    │   │       │       └── Microsoft.VisualStudio.TestPlatform.ObjectModel.resources.dll
    │   │       └── netcoreapp3.1
    │   │           ├── GitHubActionsTestLogger.dll
    │   │           ├── Microsoft.TestPlatform.CommunicationUtilities.dll
    │   │           ├── Microsoft.TestPlatform.CoreUtilities.dll
    │   │           ├── Microsoft.TestPlatform.CrossPlatEngine.dll
    │   │           ├── Microsoft.TestPlatform.PlatformAbstractions.dll
    │   │           ├── Microsoft.TestPlatform.Utilities.dll
    │   │           ├── Microsoft.VisualStudio.CodeCoverage.Shim.dll
    │   │           ├── Microsoft.VisualStudio.TestPlatform.Common.dll
    │   │           ├── Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.dll
    │   │           ├── Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.Interface.dll
    │   │           ├── Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.dll
    │   │           ├── Microsoft.VisualStudio.TestPlatform.ObjectModel.dll
    │   │           ├── Microsoft.VisualStudio.TestPlatform.TestFramework.Extensions.dll
    │   │           ├── Microsoft.VisualStudio.TestPlatform.TestFramework.dll
    │   │           ├── Newtonsoft.Json.dll
    │   │           ├── NuGet.Frameworks.dll
    │   │           ├── S7.Net.UnitTest.deps.json
    │   │           ├── S7.Net.UnitTest.dll
    │   │           ├── S7.Net.UnitTest.pdb
    │   │           ├── S7.Net.UnitTest.runtimeconfig.dev.json
    │   │           ├── S7.Net.UnitTest.runtimeconfig.json
    │   │           ├── S7.Net.dll
    │   │           ├── S7.Net.pdb
    │   │           ├── S7.Net.xml
    │   │           ├── cs
    │   │           │   ├── Microsoft.TestPlatform.CommunicationUtilities.resources.dll
    │   │           │   ├── Microsoft.TestPlatform.CoreUtilities.resources.dll
    │   │           │   ├── Microsoft.TestPlatform.CrossPlatEngine.resources.dll
    │   │           │   ├── Microsoft.VisualStudio.TestPlatform.Common.resources.dll
    │   │           │   └── Microsoft.VisualStudio.TestPlatform.ObjectModel.resources.dll
    │   │           ├── de
    │   │           │   ├── Microsoft.TestPlatform.CommunicationUtilities.resources.dll
    │   │           │   ├── Microsoft.TestPlatform.CoreUtilities.resources.dll
    │   │           │   ├── Microsoft.TestPlatform.CrossPlatEngine.resources.dll
    │   │           │   ├── Microsoft.VisualStudio.TestPlatform.Common.resources.dll
    │   │           │   └── Microsoft.VisualStudio.TestPlatform.ObjectModel.resources.dll
    │   │           ├── es
    │   │           │   ├── Microsoft.TestPlatform.CommunicationUtilities.resources.dll
    │   │           │   ├── Microsoft.TestPlatform.CoreUtilities.resources.dll
    │   │           │   ├── Microsoft.TestPlatform.CrossPlatEngine.resources.dll
    │   │           │   ├── Microsoft.VisualStudio.TestPlatform.Common.resources.dll
    │   │           │   └── Microsoft.VisualStudio.TestPlatform.ObjectModel.resources.dll
    │   │           ├── fr
    │   │           │   ├── Microsoft.TestPlatform.CommunicationUtilities.resources.dll
    │   │           │   ├── Microsoft.TestPlatform.CoreUtilities.resources.dll
    │   │           │   ├── Microsoft.TestPlatform.CrossPlatEngine.resources.dll
    │   │           │   ├── Microsoft.VisualStudio.TestPlatform.Common.resources.dll
    │   │           │   └── Microsoft.VisualStudio.TestPlatform.ObjectModel.resources.dll
    │   │           ├── it
    │   │           │   ├── Microsoft.TestPlatform.CommunicationUtilities.resources.dll
    │   │           │   ├── Microsoft.TestPlatform.CoreUtilities.resources.dll
    │   │           │   ├── Microsoft.TestPlatform.CrossPlatEngine.resources.dll
    │   │           │   ├── Microsoft.VisualStudio.TestPlatform.Common.resources.dll
    │   │           │   └── Microsoft.VisualStudio.TestPlatform.ObjectModel.resources.dll
    │   │           ├── ja
    │   │           │   ├── Microsoft.TestPlatform.CommunicationUtilities.resources.dll
    │   │           │   ├── Microsoft.TestPlatform.CoreUtilities.resources.dll
    │   │           │   ├── Microsoft.TestPlatform.CrossPlatEngine.resources.dll
    │   │           │   ├── Microsoft.VisualStudio.TestPlatform.Common.resources.dll
    │   │           │   └── Microsoft.VisualStudio.TestPlatform.ObjectModel.resources.dll
    │   │           ├── ko
    │   │           │   ├── Microsoft.TestPlatform.CommunicationUtilities.resources.dll
    │   │           │   ├── Microsoft.TestPlatform.CoreUtilities.resources.dll
    │   │           │   ├── Microsoft.TestPlatform.CrossPlatEngine.resources.dll
    │   │           │   ├── Microsoft.VisualStudio.TestPlatform.Common.resources.dll
    │   │           │   └── Microsoft.VisualStudio.TestPlatform.ObjectModel.resources.dll
    │   │           ├── pl
    │   │           │   ├── Microsoft.TestPlatform.CommunicationUtilities.resources.dll
    │   │           │   ├── Microsoft.TestPlatform.CoreUtilities.resources.dll
    │   │           │   ├── Microsoft.TestPlatform.CrossPlatEngine.resources.dll
    │   │           │   ├── Microsoft.VisualStudio.TestPlatform.Common.resources.dll
    │   │           │   └── Microsoft.VisualStudio.TestPlatform.ObjectModel.resources.dll
    │   │           ├── pt-BR
    │   │           │   ├── Microsoft.TestPlatform.CommunicationUtilities.resources.dll
    │   │           │   ├── Microsoft.TestPlatform.CoreUtilities.resources.dll
    │   │           │   ├── Microsoft.TestPlatform.CrossPlatEngine.resources.dll
    │   │           │   ├── Microsoft.VisualStudio.TestPlatform.Common.resources.dll
    │   │           │   └── Microsoft.VisualStudio.TestPlatform.ObjectModel.resources.dll
    │   │           ├── ru
    │   │           │   ├── Microsoft.TestPlatform.CommunicationUtilities.resources.dll
    │   │           │   ├── Microsoft.TestPlatform.CoreUtilities.resources.dll
    │   │           │   ├── Microsoft.TestPlatform.CrossPlatEngine.resources.dll
    │   │           │   ├── Microsoft.VisualStudio.TestPlatform.Common.resources.dll
    │   │           │   └── Microsoft.VisualStudio.TestPlatform.ObjectModel.resources.dll
    │   │           ├── snap7.dll
    │   │           ├── testhost.dll
    │   │           ├── testhost.exe
    │   │           ├── tr
    │   │           │   ├── Microsoft.TestPlatform.CommunicationUtilities.resources.dll
    │   │           │   ├── Microsoft.TestPlatform.CoreUtilities.resources.dll
    │   │           │   ├── Microsoft.TestPlatform.CrossPlatEngine.resources.dll
    │   │           │   ├── Microsoft.VisualStudio.TestPlatform.Common.resources.dll
    │   │           │   └── Microsoft.VisualStudio.TestPlatform.ObjectModel.resources.dll
    │   │           ├── zh-Hans
    │   │           │   ├── Microsoft.TestPlatform.CommunicationUtilities.resources.dll
    │   │           │   ├── Microsoft.TestPlatform.CoreUtilities.resources.dll
    │   │           │   ├── Microsoft.TestPlatform.CrossPlatEngine.resources.dll
    │   │           │   ├── Microsoft.VisualStudio.TestPlatform.Common.resources.dll
    │   │           │   └── Microsoft.VisualStudio.TestPlatform.ObjectModel.resources.dll
    │   │           └── zh-Hant
    │   │               ├── Microsoft.TestPlatform.CommunicationUtilities.resources.dll
    │   │               ├── Microsoft.TestPlatform.CoreUtilities.resources.dll
    │   │               ├── Microsoft.TestPlatform.CrossPlatEngine.resources.dll
    │   │               ├── Microsoft.VisualStudio.TestPlatform.Common.resources.dll
    │   │               └── Microsoft.VisualStudio.TestPlatform.ObjectModel.resources.dll
    │   ├── obj
    │   │   ├── Debug
    │   │   │   ├── net452
    │   │   │   │   ├── S7.Net.UnitTest.AssemblyInfo.cs
    │   │   │   │   ├── S7.Net.UnitTest.AssemblyInfoInputs.cache
    │   │   │   │   ├── S7.Net.UnitTest.assets.cache
    │   │   │   │   ├── S7.Net.UnitTest.csproj.AssemblyReference.cache
    │   │   │   │   ├── S7.Net.UnitTest.csproj.CopyComplete
    │   │   │   │   ├── S7.Net.UnitTest.csproj.CoreCompileInputs.cache
    │   │   │   │   ├── S7.Net.UnitTest.csproj.FileListAbsolute.txt
    │   │   │   │   ├── S7.Net.UnitTest.dll
    │   │   │   │   └── S7.Net.UnitTest.pdb
    │   │   │   └── netcoreapp3.1
    │   │   │       ├── S7.Net.UnitTest.AssemblyInfo.cs
    │   │   │       ├── S7.Net.UnitTest.AssemblyInfoInputs.cache
    │   │   │       ├── S7.Net.UnitTest.assets.cache
    │   │   │       ├── S7.Net.UnitTest.csproj.AssemblyReference.cache
    │   │   │       ├── S7.Net.UnitTest.csproj.CopyComplete
    │   │   │       ├── S7.Net.UnitTest.csproj.CoreCompileInputs.cache
    │   │   │       ├── S7.Net.UnitTest.csproj.FileListAbsolute.txt
    │   │   │       ├── S7.Net.UnitTest.dll
    │   │   │       ├── S7.Net.UnitTest.genruntimeconfig.cache
    │   │   │       └── S7.Net.UnitTest.pdb
    │   │   ├── S7.Net.UnitTest.csproj.nuget.dgspec.json
    │   │   ├── S7.Net.UnitTest.csproj.nuget.g.props
    │   │   ├── S7.Net.UnitTest.csproj.nuget.g.targets
    │   │   ├── project.assets.json
    │   │   └── project.nuget.cache
    │   └── runtimes
    │       └── win-x64
    │           └── native
    │               └── snap7.dll
    ├── S7.sln
    ├── S7.v12.suo
    ├── S7_PRO
    │   ├── App.config
    │   ├── Core
    │   │   ├── ISPlcparameter.cs
    │   │   ├── ISocketInfo.cs
    │   │   ├── Plcparameter.cs
    │   │   ├── Plcsendmassage.cs
    │   │   ├── SocketInfo.cs
    │   │   └── plcdata.cs
    │   ├── Program.cs
    │   ├── Properties
    │   │   └── AssemblyInfo.cs
    │   ├── S7Clent.cs
    │   ├── S7_PRO.csproj
    │   ├── Util
    │   │   ├── Class1.cs
    │   │   ├── LogHelper.cs
    │   │   ├── MySerializer.cs
    │   │   ├── PingHelp.cs
    │   │   ├── ToJsonAPP.cs
    │   │   └── WebPOSTContextCallBack.cs
    │   ├── bin
    │   │   ├── Debug
    │   │   │   ├── Logs
    │   │   │   │   ├── Debug
    │   │   │   │   │   ├── debug.log
    │   │   │   │   │   └── debug20210811.log
    │   │   │   │   ├── Error
    │   │   │   │   │   ├── err.log
    │   │   │   │   │   └── err20210811.log
    │   │   │   │   └── Info
    │   │   │   │       ├── info.log
    │   │   │   │       └── info20210811.log
    │   │   │   ├── Newtonsoft.Json.dll
    │   │   │   ├── S7.Net.dll
    │   │   │   ├── S7_PRO.exe
    │   │   │   ├── S7_PRO.exe.config
    │   │   │   ├── S7_PRO.pdb
    │   │   │   ├── Web_Service.ini
    │   │   │   ├── log4net.dll
    │   │   │   ├── nssm.exe
    │   │   │   ├── socketinfo.xml
    │   │   │   ├── 开启AGVMServer.txt
    │   │   │   └── 客户端发送数据格式.txt
    │   │   └── Release
    │   └── obj
    │       └── Debug
    │           ├── DesignTimeResolveAssemblyReferencesInput.cache
    │           ├── S7_PRO.csproj.AssemblyReference.cache
    │           ├── S7_PRO.csproj.CopyComplete
    │           ├── S7_PRO.csproj.CoreCompileInputs.cache
    │           ├── S7_PRO.csproj.FileListAbsolute.txt
    │           ├── S7_PRO.exe
    │           ├── S7_PRO.pdb
    │           ├── TempPE
    │           ├── TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs
    │           ├── TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs
    │           └── TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs
    ├── WinFormS71200
    │   ├── App.config
    │   ├── Form1.Designer.cs
    │   ├── Form1.cs
    │   ├── Form1.resx
    │   ├── Program.cs
    │   ├── Properties
    │   │   ├── AssemblyInfo.cs
    │   │   ├── Resources.Designer.cs
    │   │   ├── Resources.resx
    │   │   ├── Settings.Designer.cs
    │   │   └── Settings.settings
    │   ├── WinFormS71200.csproj
    │   ├── bin
    │   │   └── Debug
    │   │       ├── S7.Net.dll
    │   │       ├── S7.Net.xml
    │   │       ├── WinFormS71200.exe
    │   │       ├── WinFormS71200.exe.config
    │   │       ├── WinFormS71200.pdb
    │   │       ├── WinFormS71200.vshost.exe
    │   │       ├── WinFormS71200.vshost.exe.config
    │   │       ├── WinFormS71200.vshost.exe.manifest
    │   │       └── socketinfo.xml
    │   ├── obj
    │   │   └── Debug
    │   │       ├── DesignTimeResolveAssemblyReferences.cache
    │   │       ├── DesignTimeResolveAssemblyReferencesInput.cache
    │   │       ├── TempPE
    │   │       │   └── Properties.Resources.Designer.cs.dll
    │   │       ├── TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs
    │   │       ├── TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs
    │   │       ├── TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs
    │   │       ├── WinFormS71200.Form1.resources
    │   │       ├── WinFormS71200.Properties.Resources.resources
    │   │       ├── WinFormS71200.csproj.AssemblyReference.cache
    │   │       ├── WinFormS71200.csproj.CopyComplete
    │   │       ├── WinFormS71200.csproj.CoreCompileInputs.cache
    │   │       ├── WinFormS71200.csproj.FileListAbsolute.txt
    │   │       ├── WinFormS71200.csproj.GenerateResource.cache
    │   │       ├── WinFormS71200.csprojAssemblyReference.cache
    │   │       ├── WinFormS71200.exe
    │   │       └── WinFormS71200.pdb
    │   └── packages.config
    ├── WinForms71200multiple
    │   ├── App.config
    │   ├── Core
    │   │   ├── ISocketInfo.cs
    │   │   └── SocketInfo.cs
    │   ├── Form1.Designer.cs
    │   ├── Form1.cs
    │   ├── Form1.resx
    │   ├── Frm_s7-1200.Designer.cs
    │   ├── Frm_s7-1200.cs
    │   ├── Frm_s7-1200.resx
    │   ├── Program.cs
    │   ├── Properties
    │   │   ├── AssemblyInfo.cs
    │   │   ├── Resources.Designer.cs
    │   │   ├── Resources.resx
    │   │   ├── Settings.Designer.cs
    │   │   └── Settings.settings
    │   ├── Util
    │   │   └── MySerializer.cs
    │   ├── WinForms71200multiple.csproj
    │   ├── bin
    │   │   └── Debug
    │   │       ├── S7.Net.dll
    │   │       ├── WinForms71200multiple.exe
    │   │       ├── WinForms71200multiple.exe.config
    │   │       ├── WinForms71200multiple.pdb
    │   │       ├── socketinfo
    │   │       │   ├── socketinfo.xml
    │   │       │   └── socketinfo无服务.xml
    │   │       ├── socketinfo.rar
    │   │       └── socketinfo.xml
    │   └── obj
    │       └── Debug
    │           ├── DesignTimeResolveAssemblyReferences.cache
    │           ├── DesignTimeResolveAssemblyReferencesInput.cache
    │           ├── TempPE
    │           ├── TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs
    │           ├── TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs
    │           ├── TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs
    │           ├── WinForms71200multiple.Frm_s7_1200.resources
    │           ├── WinForms71200multiple.Properties.Resources.resources
    │           ├── WinForms71200multiple.admin.resources
    │           ├── WinForms71200multiple.csproj.AssemblyReference.cache
    │           ├── WinForms71200multiple.csproj.CopyComplete
    │           ├── WinForms71200multiple.csproj.CoreCompileInputs.cache
    │           ├── WinForms71200multiple.csproj.FileListAbsolute.txt
    │           ├── WinForms71200multiple.csproj.GenerateResource.cache
    │           ├── WinForms71200multiple.csprojAssemblyReference.cache
    │           ├── WinForms71200multiple.exe
    │           └── WinForms71200multiple.pdb
    ├── packages
    │   └── S7netplus.0.9.0
    │       ├── S7netplus.0.9.0.nupkg
    │       └── lib
    │           ├── net452
    │           │   ├── S7.Net.dll
    │           │   └── S7.Net.xml
    │           ├── netstandard1.3
    │           │   ├── S7.Net.dll
    │           │   └── S7.Net.xml
    │           └── netstandard2.0
    │               ├── S7.Net.dll
    │               └── S7.Net.xml
    └── 前端下发.txt

98 directories, 424 files


【核心代码】

/////向PLC写数据



 "hod":"geekCode_geekWarehouseCode_001",
 "id": "192.168.10.242",
 "select":"sendwrite"
  "data":"00-0C-00-02-00-04-00-06-00-08-00-10-00-12-00-07-00-02",
 "request": { 
 "requestId": "9194E002AD324176974AE9438A011EE311",  
  "clientCode": "geekCode",  
  "warehouseCode": "geekWarehouseCode", 
  "userId": "admin",   
 "userKey": "123456",   
 "language": "zh_cn",  
  "version": "3.1.0" 
}
}

/////向后服务器索要PLC数据

 "hod":"geekCode_geekWarehouseCode_001",
 "id": "192.168.10.242",
 "select":"Rope"
  "data":"00-0C-00-02-00-04-00-06-00-08-00-10-00-12-00-07-00-02",
 "request": { 
 "requestId": "9194E002AD324176974AE9438A011EE311",  
  "clientCode": "geekCode",  
  "warehouseCode": "geekWarehouseCode", 
  "userId": "admin",   
 "userKey": "123456",   
 "language": "zh_cn",  
  "version": "3.1.0" 
}
}

实例下载地址

西门子系列PLC与上位通讯实例

不能下载?内容有错? 点击这里报错 + 投诉 + 提问

好例子网口号:伸出你的我的手 — 分享

网友评论

发表评论

(您的评论需要经过审核才能显示)

查看所有0条评论>>

小贴士

感谢您为本站写下的评论,您的评论对其它用户来说具有重要的参考价值,所以请认真填写。

  • 类似“顶”、“沙发”之类没有营养的文字,对勤劳贡献的楼主来说是令人沮丧的反馈信息。
  • 相信您也不想看到一排文字/表情墙,所以请不要反馈意义不大的重复字符,也请尽量不要纯表情的回复。
  • 提问之前请再仔细看一遍楼主的说明,或许是您遗漏了。
  • 请勿到处挖坑绊人、招贴广告。既占空间让人厌烦,又没人会搭理,于人于己都无利。

关于好例子网

本站旨在为广大IT学习爱好者提供一个非营利性互相学习交流分享平台。本站所有资源都可以被免费获取学习研究。本站资源来自网友分享,对搜索内容的合法性不具有预见性、识别性、控制性,仅供学习研究,请务必在下载后24小时内给予删除,不得用于其他任何用途,否则后果自负。基于互联网的特殊性,平台无法对用户传输的作品、信息、内容的权属或合法性、安全性、合规性、真实性、科学性、完整权、有效性等进行实质审查;无论平台是否已进行审查,用户均应自行承担因其传输的作品、信息、内容而可能或已经产生的侵权或权属纠纷等法律责任。本站所有资源不代表本站的观点或立场,基于网友分享,根据中国法律《信息网络传播权保护条例》第二十二与二十三条之规定,若资源存在侵权或相关问题请联系本站客服人员,点此联系我们。关于更多版权及免责申明参见 版权及免责申明

;
报警