{"id":28137,"date":"2024-05-10T20:44:50","date_gmt":"2024-05-10T12:44:50","guid":{"rendered":"https:\/\/www.modbus.cn\/?p=28137"},"modified":"2024-05-10T20:44:58","modified_gmt":"2024-05-10T12:44:58","slug":"s7-net-zhuan-wei-xi-men-zi-plc-she-ji-de-yi-tai-wang-tong-xin-qu-dong","status":"publish","type":"post","link":"https:\/\/www.modbus.cn\/en\/28137.html","title":{"rendered":"S7.Net\uff1a\u4e13\u4e3a\u897f\u95e8\u5b50PLC\u8bbe\u8ba1\u7684\u4ee5\u592a\u7f51\u901a\u4fe1\u9a71\u52a8"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\"><strong>\u6982\u8ff0<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">S7.Net\u662f\u4e00\u4e2a\u4e13\u4e3a\u897f\u95e8\u5b50PLC\u8bbe\u8ba1\u7684PLC\u9a71\u52a8\u7a0b\u5e8f\uff0c\u4ec5\u652f\u6301\u901a\u8fc7\u4ee5\u592a\u7f51\u8fde\u63a5\u3002\u8fd9\u610f\u5473\u7740\u60a8\u7684PLC\u5fc5\u987b\u5177\u5907Profinet CPU\u6216Profinet\u5916\u90e8\u5361\uff08\u5982CPxxx\u5361\uff09\u3002S7.Net\u5b8c\u5168\u4f7f\u7528C#\u7f16\u5199\uff0c\u56e0\u6b64\u60a8\u53ef\u4ee5\u8f7b\u677e\u5730\u8fdb\u884c\u8c03\u8bd5\uff0c\u800c\u65e0\u9700\u5904\u7406\u672c\u5730DLL\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>\u652f\u6301\u7684PLC\u578b\u53f7<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">S7.Net\u4e0e\u4ee5\u4e0b\u578b\u53f7\u7684\u897f\u95e8\u5b50PLC\u517c\u5bb9\uff1aS7-200\u3001S7-300\u3001S7-400\u3001S7-1200\u548cS7-1500\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>\u5f00\u59cb\u4f7f\u7528S7.Net<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u8981\u5f00\u59cb\u4f7f\u7528S7.Net\uff0c\u60a8\u9700\u8981\u4e0b\u8f7d\u5e76\u5305\u542bS7.Net.dll\u5230\u60a8\u7684\u9879\u76ee\u4e2d\u3002\u60a8\u53ef\u4ee5\u901a\u8fc7\u4e0b\u8f7dNuGet\u5305\u6216\u4e0b\u8f7d\u6e90\u4ee3\u7801\u5e76\u7f16\u8bd1\u6765\u5b9e\u73b0\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>\u521b\u5efaPLC\u5b9e\u4f8b\u3001\u8fde\u63a5\u4e0e\u65ad\u5f00<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u521b\u5efa\u9a71\u52a8\u7a0b\u5e8f\u5b9e\u4f8b\u65f6\uff0c\u60a8\u9700\u8981\u4f7f\u7528\u4ee5\u4e0b\u6784\u9020\u51fd\u6570\uff1a<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;clike&quot;,&quot;mime&quot;:&quot;text\/x-csharp&quot;,&quot;theme&quot;:&quot;material&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;C#&quot;,&quot;TrpContentRestriction&quot;:{&quot;restriction_type&quot;:&quot;exclude&quot;,&quot;selected_languages&quot;:[],&quot;panel_open&quot;:true},&quot;language&quot;:&quot;C#&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;csharp&quot;}\">public Plc(CpuType cpu, string ip, Int16 rack, Int16 slot)<\/pre><\/div>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>cpu<\/code>\uff1a\u6307\u5b9a\u60a8\u8981\u8fde\u63a5\u7684CPU\u7c7b\u578b\u3002\u652f\u6301\u7684CPU\u7c7b\u578b\u6709\uff1a<\/li>\n<\/ul>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;clike&quot;,&quot;mime&quot;:&quot;text\/x-csharp&quot;,&quot;theme&quot;:&quot;material&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;C#&quot;,&quot;TrpContentRestriction&quot;:{&quot;restriction_type&quot;:&quot;exclude&quot;,&quot;selected_languages&quot;:[],&quot;panel_open&quot;:true},&quot;language&quot;:&quot;C#&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;csharp&quot;}\">  public enum CpuType {\n      S7200 = 0,\n      S7300 = 10,\n      S7400 = 20,\n      S71200 = 30,\n      S71500 = 40,\n  }<\/pre><\/div>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>ip<\/code>\uff1a\u6307\u5b9aCPU\u6216\u5916\u90e8\u4ee5\u592a\u7f51\u5361\u7684IP\u5730\u5740\u3002<\/li>\n\n\n\n<li><code>rack<\/code>\uff1a\u5305\u542bPLC\u7684\u673a\u67b6\u53f7\uff0c\u60a8\u53ef\u4ee5\u5728Step7\u7684\u786c\u4ef6\u914d\u7f6e\u4e2d\u627e\u5230\u3002<\/li>\n\n\n\n<li><code>slot<\/code>\uff1a\u8fd9\u662fCPU\u7684\u63d2\u69fd\u53f7\uff0c\u540c\u6837\u53ef\u4ee5\u5728Step7\u7684\u786c\u4ef6\u914d\u7f6e\u4e2d\u627e\u5230\u3002<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">\u4f8b\u5982\uff0c\u4ee5\u4e0b\u4ee3\u7801\u4e3aIP\u5730\u5740\u4e3a127.0.0.1\u7684S7-300 PLC\u521b\u5efa\u4e86\u4e00\u4e2aPLC\u5bf9\u8c61\uff0cPLC\u4f4d\u4e8e0\u53f7\u673a\u67b6\uff0cCPU\u4f4d\u4e8e2\u53f7\u63d2\u69fd\uff1a<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;clike&quot;,&quot;mime&quot;:&quot;text\/x-csharp&quot;,&quot;theme&quot;:&quot;material&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;C#&quot;,&quot;TrpContentRestriction&quot;:{&quot;restriction_type&quot;:&quot;exclude&quot;,&quot;selected_languages&quot;:[],&quot;panel_open&quot;:true},&quot;language&quot;:&quot;C#&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;csharp&quot;}\">Plc plc = new Plc(CpuType.S7300, &quot;127.0.0.1&quot;, 0, 2);<\/pre><\/div>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>\u8fde\u63a5\u5230PLC<\/strong><\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;clike&quot;,&quot;mime&quot;:&quot;text\/x-csharp&quot;,&quot;theme&quot;:&quot;material&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;C#&quot;,&quot;TrpContentRestriction&quot;:{&quot;restriction_type&quot;:&quot;exclude&quot;,&quot;selected_languages&quot;:[],&quot;panel_open&quot;:true},&quot;language&quot;:&quot;C#&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;csharp&quot;}\">public void Open()<\/pre><\/div>\n\n\n\n<p class=\"wp-block-paragraph\">\u4f8b\u5982\uff0c\u4ee5\u4e0b\u4ee3\u7801\u884c\u6253\u5f00\u8fde\u63a5\uff1a<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;clike&quot;,&quot;mime&quot;:&quot;text\/x-csharp&quot;,&quot;theme&quot;:&quot;material&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;C#&quot;,&quot;TrpContentRestriction&quot;:{&quot;restriction_type&quot;:&quot;exclude&quot;,&quot;selected_languages&quot;:[],&quot;panel_open&quot;:true},&quot;language&quot;:&quot;C#&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;csharp&quot;}\">plc.Open();<\/pre><\/div>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>\u4ecePLC\u65ad\u5f00\u8fde\u63a5<\/strong><\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;clike&quot;,&quot;mime&quot;:&quot;text\/x-csharp&quot;,&quot;theme&quot;:&quot;material&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;C#&quot;,&quot;TrpContentRestriction&quot;:{&quot;restriction_type&quot;:&quot;exclude&quot;,&quot;selected_languages&quot;:[],&quot;panel_open&quot;:true},&quot;language&quot;:&quot;C#&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;csharp&quot;}\">public void Close()<\/pre><\/div>\n\n\n\n<p class=\"wp-block-paragraph\">\u4f8b\u5982\uff0c\u4ee5\u4e0b\u4ee3\u7801\u5173\u95ed\u8fde\u63a5\uff1a<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;clike&quot;,&quot;mime&quot;:&quot;text\/x-csharp&quot;,&quot;theme&quot;:&quot;material&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;C#&quot;,&quot;TrpContentRestriction&quot;:{&quot;restriction_type&quot;:&quot;exclude&quot;,&quot;selected_languages&quot;:[],&quot;panel_open&quot;:true},&quot;language&quot;:&quot;C#&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;csharp&quot;}\">plc.Close();<\/pre><\/div>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>\u9519\u8bef\u5904\u7406<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u4efb\u4f55\u65b9\u6cd5\u90fd\u53ef\u80fd\u56e0\u4e3a\u5404\u79cd\u9519\u8bef\u800c\u5f15\u53d1<code>PlcException<\/code>\u3002\u60a8\u5e94\u8be5\u5b9e\u73b0\u9002\u5f53\u7684\u9519\u8bef\u5904\u7406\u3002<code>PlcException<\/code>\u63d0\u4f9b\u4e86\u4e00\u4e2a<code>ErrorCode<\/code>\u548c\u4e00\u4e2a\u9002\u5f53\u7684\u9519\u8bef\u6d88\u606f\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u4ee5\u4e0b\u662f\u9519\u8bef\u7c7b\u578b\u7684\u679a\u4e3e\uff1a<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;clike&quot;,&quot;mime&quot;:&quot;text\/x-csharp&quot;,&quot;theme&quot;:&quot;material&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;C#&quot;,&quot;TrpContentRestriction&quot;:{&quot;restriction_type&quot;:&quot;exclude&quot;,&quot;selected_languages&quot;:[],&quot;panel_open&quot;:true},&quot;language&quot;:&quot;C#&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;csharp&quot;}\">public enum ErrorCode\n{\n    NoError = 0,\n    WrongCPU_Type = 1,\n    ConnectionError = 2,\n    IPAddressNotAvailable, \n    WrongVarFormat = 10,\n    WrongNumberReceivedBytes = 11, \n    SendData = 20,\n    ReadData = 30, \n    WriteData = 50\n}<\/pre><\/div>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>\u68c0\u67e5PLC\u53ef\u7528\u6027<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u8981\u68c0\u67e5PLC\u662f\u5426\u53ef\u7528\uff08\u6253\u5f00\u4e00\u4e2aSocket\uff09\uff0c\u60a8\u53ef\u4ee5\u4f7f\u7528\u5c5e\u6027\uff1a<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;clike&quot;,&quot;mime&quot;:&quot;text\/x-csharp&quot;,&quot;theme&quot;:&quot;material&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;C#&quot;,&quot;TrpContentRestriction&quot;:{&quot;restriction_type&quot;:&quot;exclude&quot;,&quot;selected_languages&quot;:[],&quot;panel_open&quot;:true},&quot;language&quot;:&quot;C#&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;csharp&quot;}\">public bool IsAvailable<\/pre><\/div>\n\n\n\n<p class=\"wp-block-paragraph\">\u5f53\u60a8\u68c0\u67e5\u6b64\u5c5e\u6027\u65f6\uff0c\u9a71\u52a8\u7a0b\u5e8f\u5c06\u5c1d\u8bd5\u8fde\u63a5\u5230PLC\uff0c\u5e76\u5728\u80fd\u591f\u8fde\u63a5\u65f6\u8fd4\u56detrue\uff0c\u5426\u5219\u8fd4\u56defalse\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>\u68c0\u67e5PLC\u8fde\u63a5<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u68c0\u67e5PLC\u8fde\u63a5\u5f88\u7b80\u5355\uff0c\u56e0\u4e3a\u60a8\u9700\u8981\u68c0\u67e5PC\u5957\u63a5\u5b57\u662f\u5426\u5df2\u8fde\u63a5\uff0c\u8fd8\u8981\u68c0\u67e5PLC\u662f\u5426\u4ecd\u7136\u8fde\u63a5\u5728\u5957\u63a5\u5b57\u7684\u53e6\u4e00\u7aef\u3002\u5728\u8fd9\u79cd\u60c5\u51b5\u4e0b\uff0c\u60a8\u9700\u8981\u68c0\u67e5\u7684\u5c5e\u6027\u662f\uff1a<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;clike&quot;,&quot;mime&quot;:&quot;text\/x-csharp&quot;,&quot;theme&quot;:&quot;material&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;C#&quot;,&quot;TrpContentRestriction&quot;:{&quot;restriction_type&quot;:&quot;exclude&quot;,&quot;selected_languages&quot;:[],&quot;panel_open&quot;:true},&quot;language&quot;:&quot;C#&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;csharp&quot;}\">public bool IsConnected<\/pre><\/div>\n\n\n\n<p class=\"wp-block-paragraph\">\u60a8\u53ef\u4ee5\u5728\u8c03\u7528<code>Open()<\/code>\u65b9\u6cd5\u5e76\u6210\u529f\u540e\u68c0\u67e5\u6b64\u5c5e\u6027\uff0c\u4ee5\u67e5\u770b\u8fde\u63a5\u662f\u5426\u4ecd\u7136\u6d3b\u8dc3\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>\u8bfb\u53d6\u5b57\u8282\/\u5199\u5165\u5b57\u8282<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u8be5\u5e93\u63d0\u4f9b\u4e86\u591a\u79cd\u8bfb\u53d6\u53d8\u91cf\u7684\u65b9\u6cd5\u3002\u6700\u57fa\u672c\u4e14\u6700\u5e38\u7528\u7684\u65b9\u6cd5\u662f<code>ReadBytes<\/code>\u3002<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;clike&quot;,&quot;mime&quot;:&quot;text\/x-csharp&quot;,&quot;theme&quot;:&quot;material&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;C#&quot;,&quot;TrpContentRestriction&quot;:{&quot;restriction_type&quot;:&quot;exclude&quot;,&quot;selected_languages&quot;:[],&quot;panel_open&quot;:true},&quot;language&quot;:&quot;C#&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;csharp&quot;}\">public byte[] ReadBytes(DataType dataType, int db, int startByteAdr, int count)\n\npublic void WriteBytes(DataType dataType, int db, int startByteAdr, byte[] value)<\/pre><\/div>\n\n\n\n<p class=\"wp-block-paragraph\">\u6b64\u65b9\u6cd5\u4ece\u7ed9\u5b9a\u7684\u5185\u5b58\u4f4d\u7f6e\u8bfb\u53d6\u60a8\u6307\u5b9a\u7684\u6240\u6709\u5b57\u8282\u3002\u5982\u679c\u5b57\u8282\u6570\u8d85\u8fc7\u4e86\u5355\u6b21\u8bf7\u6c42\u53ef\u4ee5\u4f20\u8f93\u7684\u6700\u5927\u5b57\u8282\u6570\uff0c\u6b64\u65b9\u6cd5\u4f1a\u81ea\u52a8\u5904\u7406\u591a\u4e2a\u8bf7\u6c42\u3002<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>dataType<\/code>\uff1a\u60a8\u5fc5\u987b\u4f7f\u7528\u679a\u4e3e<code>DataType<\/code>\u6307\u5b9a\u5185\u5b58\u4f4d\u7f6e\uff1a<\/li>\n<\/ul>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;clike&quot;,&quot;mime&quot;:&quot;text\/x-csharp&quot;,&quot;theme&quot;:&quot;material&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;C#&quot;,&quot;TrpContentRestriction&quot;:{&quot;restriction_type&quot;:&quot;exclude&quot;,&quot;selected_languages&quot;:[],&quot;panel_open&quot;:true},&quot;language&quot;:&quot;C#&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;csharp&quot;}\">  public enum DataType\n  {\n      Input = 129,\n      Output = 130,\n      Memory = 131,\n      DataBlock = 132,\n      Timer = 29,\n      Counter = 28\n  }<\/pre><\/div>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>db<\/code>\uff1adataType\u7684\u5730\u5740\uff0c\u4f8b\u5982\uff0c\u5982\u679c\u60a8\u60f3\u8bfb\u53d6DB1\uff0c\u5219\u6b64\u5b57\u6bb5\u4e3a\u201c1\u201d\uff1b\u5982\u679c\u60a8\u60f3\u8bfb\u53d6T45\uff0c\u5219\u6b64\u5b57\u6bb5\u4e3a45\u3002<\/li>\n\n\n\n<li><code>startByteAdr<\/code>\uff1a\u60a8\u8981\u8bfb\u53d6\u7684\u7b2c\u4e00\u4e2a\u5b57\u8282\u7684\u5730\u5740\uff0c\u4f8b\u5982\uff0c\u5982\u679c\u60a8\u60f3\u8bfb\u53d6DB1.DBW200\uff0c\u5219\u6b64\u4e3a200\u3002<\/li>\n\n\n\n<li><code>count<\/code>\uff1a\u5305\u542b\u60a8\u60f3\u8981\u8bfb\u53d6\u7684\u5b57\u8282\u6570\u3002<\/li>\n\n\n\n<li><code>value[]<\/code>\uff1a\u8981\u4ecePLC\u8bfb\u53d6\u7684\u5b57\u8282\u6570\u7ec4\u3002<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">\u793a\u4f8b\uff1a\u6b64\u65b9\u6cd5\u8bfb\u53d6DB1\u7684\u524d200\u4e2a\u5b57\u8282\uff1a<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;clike&quot;,&quot;mime&quot;:&quot;text\/x-csharp&quot;,&quot;theme&quot;:&quot;material&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;C#&quot;,&quot;TrpContentRestriction&quot;:{&quot;restriction_type&quot;:&quot;exclude&quot;,&quot;selected_languages&quot;:[],&quot;panel_open&quot;:true},&quot;language&quot;:&quot;C#&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;csharp&quot;}\">var bytes = plc.ReadBytes(DataType.DataBlock, 1, 0, 200);<\/pre><\/div>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>\u8bfb\u53d6\u548c\u89e3\u7801\/\u5199\u5165\u5df2\u89e3\u7801<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u6b64\u65b9\u6cd5\u5141\u8bb8\u60a8\u8bfb\u53d6\u5e76\u63a5\u6536\u57fa\u4e8e\u63d0\u4f9b\u7684varType\u7684\u5df2\u89e3\u7801\u7ed3\u679c\u3002\u8fd9\u5728\u60a8\u8bfb\u53d6\u591a\u4e2a\u76f8\u540c\u7c7b\u578b\u7684\u5b57\u6bb5\u65f6\u975e\u5e38\u6709\u7528\uff08\u4f8b\u598220\u4e2a\u8fde\u7eed\u7684DBW\uff09\u3002\u5982\u679c\u60a8\u6307\u5b9aVarType.Byte\uff0c\u5b83\u4e0eReadBytes\u5177\u6709\u76f8\u540c\u7684\u529f\u80fd\u3002<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;clike&quot;,&quot;mime&quot;:&quot;text\/x-csharp&quot;,&quot;theme&quot;:&quot;material&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;C#&quot;,&quot;TrpContentRestriction&quot;:{&quot;restriction_type&quot;:&quot;exclude&quot;,&quot;selected_languages&quot;:[],&quot;panel_open&quot;:true},&quot;language&quot;:&quot;C#&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;csharp&quot;}\">public object Read(DataType dataType, int db, int startByteAdr, VarType varType, int varCount)\n\npublic void Write(DataType dataType, int db, int startByteAdr, object value)<\/pre><\/div>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>dataType<\/code>\uff1a\u60a8\u5fc5\u987b\u4f7f\u7528\u679a\u4e3e<code>DataType<\/code>\u6307\u5b9a\u5185\u5b58\u4f4d\u7f6e\u3002<\/li>\n\n\n\n<li><code>db<\/code>\uff1adataType\u7684\u5730\u5740\uff0c\u4f8b\u5982\uff0c\u5982\u679c\u60a8\u60f3\u8bfb\u53d6DB1\uff0c\u5219\u6b64\u5b57\u6bb5\u4e3a\u201c1\u201d\uff1b\u5982\u679c\u60a8\u60f3\u8bfb\u53d6T45\uff0c\u5219\u6b64\u5b57\u6bb5\u4e3a45\u3002<\/li>\n\n\n\n<li><code>startByteAdr<\/code>\uff1a\u60a8\u8981\u8bfb\u53d6\u7684\u7b2c\u4e00\u4e2a\u5b57\u8282\u7684\u5730\u5740\uff0c\u4f8b\u5982\uff0c\u5982\u679c\u60a8\u60f3\u8bfb\u53d6DB1.DBW200\uff0c\u5219\u6b64\u4e3a200\u3002<\/li>\n\n\n\n<li><code>varType<\/code>\uff1a\u6307\u5b9a\u60a8\u60f3\u8981\u5c06\u5b57\u8282\u8f6c\u6362\u4e3a\u7684\u6570\u636e\u3002<\/li>\n<\/ul>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;clike&quot;,&quot;mime&quot;:&quot;text\/x-csharp&quot;,&quot;theme&quot;:&quot;material&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;C#&quot;,&quot;TrpContentRestriction&quot;:{&quot;restriction_type&quot;:&quot;exclude&quot;,&quot;selected_languages&quot;:[],&quot;panel_open&quot;:true},&quot;language&quot;:&quot;C#&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;csharp&quot;}\">  public enum VarType\n  {\n      Bit,\n      Byte,\n      Word,\n      DWord,\n      Int,\n      DInt,\n      Real,\n      String,\n      StringEx,\n      Timer,\n      Counter\n  }<\/pre><\/div>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>count<\/code>\uff1a\u5305\u542b\u60a8\u60f3\u8981\u8bfb\u53d6\u7684\u53d8\u91cf\u6570\u91cf\u3002<\/li>\n\n\n\n<li><code>value<\/code>\uff1a\u8981\u5199\u5165PLC\u7684\u503c\u6570\u7ec4\u3002\u5b83\u53ef\u4ee5\u662f\u5355\u4e2a\u503c\u6216\u6570\u7ec4\uff0c\u53ea\u662f\u8bf7\u8bb0\u4f4f\u7c7b\u578b\u662f\u552f\u4e00\u7684\uff08\u4f8b\u5982\uff0cdouble\u6570\u7ec4\uff0cint\u6570\u7ec4\uff0cshorts\u6570\u7ec4\u7b49\uff09\u3002<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">\u793a\u4f8b\uff1a\u6b64\u65b9\u6cd5\u8bfb\u53d6DB1\u7684\u524d20\u4e2aDWord\uff1a<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;clike&quot;,&quot;mime&quot;:&quot;text\/x-csharp&quot;,&quot;theme&quot;:&quot;material&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;C#&quot;,&quot;TrpContentRestriction&quot;:{&quot;restriction_type&quot;:&quot;exclude&quot;,&quot;selected_languages&quot;:[],&quot;panel_open&quot;:true},&quot;language&quot;:&quot;C#&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;csharp&quot;}\">var dwords = plc.Read(DataType.DataBlock, 1, 0, VarType.DWord, 20);<\/pre><\/div>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>\u8bfb\u53d6\u5355\u4e2a\u53d8\u91cf\/\u5199\u5165\u5355\u4e2a\u53d8\u91cf<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u6b64\u65b9\u6cd5\u901a\u8fc7\u89e3\u6790\u5b57\u7b26\u4e32\u5e76\u8fd4\u56de\u6b63\u786e\u7684\u7ed3\u679c\uff0c\u4ecePLC\u8bfb\u53d6\u5355\u4e2a\u53d8\u91cf\u3002\u867d\u7136\u8fd9\u662f\u6700\u7b80\u5355\u7684\u5165\u95e8\u65b9\u6cd5\uff0c\u4f46\u7531\u4e8e\u9a71\u52a8\u7a0b\u5e8f\u4e3a\u6bcf\u4e2a\u53d8\u91cf\u53d1\u9001TCP\u8bf7\u6c42\uff0c\u56e0\u6b64\u975e\u5e38\u4f4e\u6548\u3002<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;clike&quot;,&quot;mime&quot;:&quot;text\/x-csharp&quot;,&quot;theme&quot;:&quot;material&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;C#&quot;,&quot;TrpContentRestriction&quot;:{&quot;restriction_type&quot;:&quot;exclude&quot;,&quot;selected_languages&quot;:[],&quot;panel_open&quot;:true},&quot;language&quot;:&quot;C#&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;csharp&quot;}\">public object Read(string variable)\n\npublic void Write(string variable, object value)<\/pre><\/div>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>variable<\/code>\uff1a\u901a\u8fc7\u4f7f\u7528\u5b57\u7b26\u4e32\u5982\u201cDB1.DBW20\u201d\uff0c\u201cT45\u201d\uff0c\u201cC21\u201d\uff0c\u201cDB1.DBD400\u201d\u7b49\u6765\u6307\u5b9a\u8981\u8bfb\u53d6\u7684\u53d8\u91cf\u3002<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">\u793a\u4f8b\uff1a\u8fd9\u8bfb\u53d6\u53d8\u91cfDB1.DBW0\u3002\u7ed3\u679c\u5fc5\u987b\u8f6c\u6362\u4e3aushort\u4ee5\u83b7\u5f97C#\u4e2d\u6b63\u786e\u768416\u4f4d\u683c\u5f0f\u3002<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;clike&quot;,&quot;mime&quot;:&quot;text\/x-csharp&quot;,&quot;theme&quot;:&quot;material&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;C#&quot;,&quot;TrpContentRestriction&quot;:{&quot;restriction_type&quot;:&quot;exclude&quot;,&quot;selected_languages&quot;:[],&quot;panel_open&quot;:true},&quot;language&quot;:&quot;C#&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;csharp&quot;}\">ushort result = (ushort)plc.Read(&quot;DB1.DBW0&quot;);<\/pre><\/div>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>\u8bfb\u53d6\u7ed3\u6784\u4f53\/\u5199\u5165\u7ed3\u6784\u4f53<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u6b64\u65b9\u6cd5\u4ece\u6307\u5b9a\u7684DB\u8bfb\u53d6\u6240\u6709\u5b57\u8282\uff0c\u4ee5\u586b\u5145C#\u4e2d\u7684\u7ed3\u6784\u4f53\uff0c\u5e76\u8fd4\u56de\u5305\u542b\u503c\u7684\u7ed3\u6784\u4f53\u3002\u5f53\u60a8\u60f3\u8981\u8bfb\u53d6\u5355\u4e2a\u6570\u636e\u5757\u4e2d\u7684\u591a\u4e2a\u53d8\u91cf\u65f6\uff0c\u5efa\u8bae\u4f7f\u7528\u5b83\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u201c\u8bfb\u53d6\u7ed3\u6784\u4f53\u201d\u548c\u201c\u5199\u5165\u7ed3\u6784\u4f53\u201d\u65b9\u6cd5\u4e0d\u652f\u6301\u5b57\u7b26\u4e32\u3002<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;clike&quot;,&quot;mime&quot;:&quot;text\/x-csharp&quot;,&quot;theme&quot;:&quot;material&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;C#&quot;,&quot;TrpContentRestriction&quot;:{&quot;restriction_type&quot;:&quot;exclude&quot;,&quot;selected_languages&quot;:[],&quot;panel_open&quot;:true},&quot;language&quot;:&quot;C#&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;csharp&quot;}\">public object ReadStruct(Type structType, int db, int startByteAdr = 0)\n\npublic void WriteStruct(object structValue, int db, int startByteAdr = 0)<\/pre><\/div>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>structType<\/code>\uff1a\u8981\u8bfb\u53d6\u7684\u7ed3\u6784\u4f53\u7c7b\u578b\uff0c\u4f8b\u5982\uff1atypeof(MyStruct)<\/li>\n\n\n\n<li><code>db<\/code>\uff1a\u8981\u8bfb\u53d6\u7684DB\u7684\u7d22\u5f15<\/li>\n\n\n\n<li><code>startByteAdr<\/code>\uff1a\u6307\u5b9a\u8981\u8bfb\u53d6\u7684\u5b57\u8282\u7684\u7b2c\u4e00\u4e2a\u5730\u5740\uff08\u9ed8\u8ba4\u4e3a\u96f6\uff09\u3002<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">\u793a\u4f8b\uff1a\u5728PLC\u4e2d\u5b9a\u4e49\u4e00\u4e2aDataBlock\uff0c\u7136\u540e\u5728.Net\u5e94\u7528\u7a0b\u5e8f\u4e2d\u6dfb\u52a0\u4e00\u4e2a\u7c7b\u4f3c\u4e8ePLC\u4e2dDB\u7684\u7ed3\u6784\u4f53\uff1a<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;clike&quot;,&quot;mime&quot;:&quot;text\/x-csharp&quot;,&quot;theme&quot;:&quot;material&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;C#&quot;,&quot;TrpContentRestriction&quot;:{&quot;restriction_type&quot;:&quot;exclude&quot;,&quot;selected_languages&quot;:[],&quot;panel_open&quot;:true},&quot;language&quot;:&quot;C#&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;csharp&quot;}\">public struct testStruct\n{\n    public bool varBool0;\n    public bool varBool1;\n    public bool varBool2;\n    public bool varBool3;\n    public bool varBool4;\n    public bool varBool5;\n    public bool varBool6;\n    public byte varByte0;\n    public byte varByte1;\n    public ushort varWord0;\n    public float varReal0;\n    public bool varBool7;\n    public float varReal1;\n    public byte varByte2;\n    public UInt32 varDWord;\n}<\/pre><\/div>\n\n\n\n<p class=\"wp-block-paragraph\">\u7136\u540e\u6dfb\u52a0\u4ee3\u7801\u4ee5\u8bfb\u53d6\u6216\u5199\u5165\u5b8c\u6574\u7684\u7ed3\u6784\u4f53\uff1a<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;clike&quot;,&quot;mime&quot;:&quot;text\/x-csharp&quot;,&quot;theme&quot;:&quot;material&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;C#&quot;,&quot;TrpContentRestriction&quot;:{&quot;restriction_type&quot;:&quot;exclude&quot;,&quot;selected_languages&quot;:[],&quot;panel_open&quot;:true},&quot;language&quot;:&quot;C#&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;csharp&quot;}\">\/\/ \u4ece\u8d77\u59cb\u5730\u57400\u8bfb\u53d6DataBlock 1\u4e2d\u7684\u7ed3\u6784\u4f53\ntestStruct myTestStruct = (testStruct) plc.ReadStruct(typeof(testStruct), 1, 0);<\/pre><\/div>\n\n\n\n<p class=\"wp-block-paragraph\">**\u8bfb\u53d6\u7c7b\/\u5199<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u5165\u7c7b**<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u6b64\u65b9\u6cd5\u4ece\u6307\u5b9a\u7684DB\u8bfb\u53d6\u6240\u6709\u5b57\u8282\uff0c\u4ee5\u586b\u5145C#\u4e2d\u7684\u7c7b\u3002\u7c7b\u4f5c\u4e3a\u5f15\u7528\u4f20\u9012\uff0c\u4f7f\u7528\u53cd\u5c04\u5206\u914d\u503c\u3002\u5f53\u60a8\u60f3\u8981\u8bfb\u53d6\u5355\u4e2a\u6570\u636e\u5757\u4e2d\u7684\u591a\u4e2a\u53d8\u91cf\u65f6\uff0c\u5efa\u8bae\u4f7f\u7528\u5b83\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u201c\u8bfb\u53d6\u7c7b\u201d\u548c\u201c\u5199\u5165\u7c7b\u201d\u65b9\u6cd5\u4e0d\u652f\u6301\u5b57\u7b26\u4e32\u3002<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;clike&quot;,&quot;mime&quot;:&quot;text\/x-csharp&quot;,&quot;theme&quot;:&quot;material&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;C#&quot;,&quot;TrpContentRestriction&quot;:{&quot;restriction_type&quot;:&quot;exclude&quot;,&quot;selected_languages&quot;:[],&quot;panel_open&quot;:true},&quot;language&quot;:&quot;C#&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;csharp&quot;}\">public void ReadClass(object sourceClass, int db, int startByteAdr = 0)\n\npublic void WriteClass(object classValue, int db, int startByteAdr = 0)<\/pre><\/div>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>sourceClass<\/code>\uff1a\u60a8\u60f3\u8981\u5206\u914d\u503c\u7684\u7c7b\u7684\u5b9e\u4f8b<\/li>\n\n\n\n<li><code>db<\/code>\uff1a\u8981\u8bfb\u53d6\u7684DB\u7684\u7d22\u5f15<\/li>\n\n\n\n<li><code>startByteAdr<\/code>\uff1a\u6307\u5b9a\u8981\u8bfb\u53d6\u7684\u5b57\u8282\u7684\u7b2c\u4e00\u4e2a\u5730\u5740\uff08\u9ed8\u8ba4\u4e3a\u96f6\uff09\u3002<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">\u793a\u4f8b\uff1a\u5728PLC\u4e2d\u5b9a\u4e49\u4e00\u4e2aDataBlock\uff0c\u7136\u540e\u5728.Net\u5e94\u7528\u7a0b\u5e8f\u4e2d\u6dfb\u52a0\u4e00\u4e2a\u7c7b\u4f3c\u4e8ePLC\u4e2dDB\u7684\u7c7b\uff1a<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;clike&quot;,&quot;mime&quot;:&quot;text\/x-csharp&quot;,&quot;theme&quot;:&quot;material&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;C#&quot;,&quot;TrpContentRestriction&quot;:{&quot;restriction_type&quot;:&quot;exclude&quot;,&quot;selected_languages&quot;:[],&quot;panel_open&quot;:true},&quot;language&quot;:&quot;C#&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;csharp&quot;}\">public class TestClass\n{\n    public bool varBool0 { get; set;}\n    public bool varBool1 { get; set;}\n    public bool varBool2 { get; set;}\n    public bool varBool3 { get; set;}\n    public bool varBool4 { get; set;}\n    public bool varBool5 { get; set;}\n    public bool varBool6 { get; set;}\n\n    public byte varByte0 { get; set;}\n    public byte varByte1 { get; set;}\n\n    public ushort varWord0 { get; set;}\n\n    public float varReal0 { get; set;}\n    public bool varBool7 { get; set;}\n    public float varReal1 { get; set;}\n\n    public byte varByte2 { get; set;}\n    public UInt32 varDWord { get; set;}\n}<\/pre><\/div>\n\n\n\n<p class=\"wp-block-paragraph\">\u7136\u540e\u6dfb\u52a0\u4ee3\u7801\u4ee5\u8bfb\u53d6\u6216\u5199\u5165\u5b8c\u6574\u7684\u7c7b\uff1a<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;clike&quot;,&quot;mime&quot;:&quot;text\/x-csharp&quot;,&quot;theme&quot;:&quot;material&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;C#&quot;,&quot;TrpContentRestriction&quot;:{&quot;restriction_type&quot;:&quot;exclude&quot;,&quot;selected_languages&quot;:[],&quot;panel_open&quot;:true},&quot;language&quot;:&quot;C#&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;csharp&quot;}\">\/\/ \u4ece\u8d77\u59cb\u5730\u57400\u8bfb\u53d6DataBlock 1\u4e2d\u7684\u7c7b\nTestClass myTestClass = new TestClass();\nplc.ReadClass(myTestClass, 1, 0);<\/pre><\/div>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>\u8bfb\u53d6\u591a\u4e2a\u53d8\u91cf<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u6b64\u65b9\u6cd5\u5728\u5355\u4e2a\u8bf7\u6c42\u4e2d\u8bfb\u53d6\u591a\u4e2a\u53d8\u91cf\u3002\u53d8\u91cf\u53ef\u4ee5\u4f4d\u4e8e\u76f8\u540c\u6216\u4e0d\u540c\u7684\u6570\u636e\u5757\u4e2d\u3002<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;clike&quot;,&quot;mime&quot;:&quot;text\/x-csharp&quot;,&quot;theme&quot;:&quot;material&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;C#&quot;,&quot;TrpContentRestriction&quot;:{&quot;restriction_type&quot;:&quot;exclude&quot;,&quot;selected_languages&quot;:[],&quot;panel_open&quot;:true},&quot;language&quot;:&quot;C#&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;csharp&quot;}\">public void Plc.ReadMultibleVars(List&lt;DataItem&gt; dataItems);<\/pre><\/div>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>List&lt;><\/code>\uff1a\u60a8\u5fc5\u987b\u6307\u5b9a\u5305\u542b\u6240\u6709\u8981\u8bfb\u53d6\u7684\u6570\u636e\u9879\u7684DataItem\u5217\u8868\u3002<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">\u793a\u4f8b\uff1a\u6b64\u65b9\u6cd5\u4ece\u6570\u636e\u5757\u4e2d\u8bfb\u53d6\u51e0\u4e2a\u53d8\u91cf\uff1a<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u9996\u5148\u5b9a\u4e49\u6570\u636e\u9879\uff1a<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;clike&quot;,&quot;mime&quot;:&quot;text\/x-csharp&quot;,&quot;theme&quot;:&quot;material&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;C#&quot;,&quot;TrpContentRestriction&quot;:{&quot;restriction_type&quot;:&quot;exclude&quot;,&quot;selected_languages&quot;:[],&quot;panel_open&quot;:true},&quot;language&quot;:&quot;C#&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;csharp&quot;}\">private static DataItem varBit = new DataItem()\n{\n    DataType = DataType.DataBlock,\n    VarType = VarType.Bit,\n    DB = 83,\n    BitAdr = 0,\n    Count = 1,\n    StartByteAdr = 0,\n    Value = new object()\n};<\/pre><\/div>\n\n\n\n<p class=\"wp-block-paragraph\">\u2026\uff08\u4e2d\u95f4\u7701\u7565\u4e86\u4e0e\u4e0a\u6587\u91cd\u590d\u7684\u6570\u636e\u9879\u5b9a\u4e49\uff09<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u7136\u540e\u5b9a\u4e49\u4e00\u4e2a\u5217\u8868\u6765\u5b58\u50a8DataItems\uff1a<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;clike&quot;,&quot;mime&quot;:&quot;text\/x-csharp&quot;,&quot;theme&quot;:&quot;material&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;C#&quot;,&quot;TrpContentRestriction&quot;:{&quot;restriction_type&quot;:&quot;exclude&quot;,&quot;selected_languages&quot;:[],&quot;panel_open&quot;:true},&quot;language&quot;:&quot;C#&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;csharp&quot;}\">private static List&lt;DataItem&gt; dataItemsRead = new List&lt;DataItem&gt;();<\/pre><\/div>\n\n\n\n<p class=\"wp-block-paragraph\">\u5c06\u6570\u636e\u9879\u6dfb\u52a0\u5230\u5217\u8868\u4e2d\uff1a<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;clike&quot;,&quot;mime&quot;:&quot;text\/x-csharp&quot;,&quot;theme&quot;:&quot;material&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;C#&quot;,&quot;TrpContentRestriction&quot;:{&quot;restriction_type&quot;:&quot;exclude&quot;,&quot;selected_languages&quot;:[],&quot;panel_open&quot;:true},&quot;language&quot;:&quot;C#&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;csharp&quot;}\">dataItemsRead.Add(varBit);\ndataItemsRead.Add(varByteArray);\ndataItemsRead.Add(varInt);\ndataItemsRead.Add(varReal);\ndataItemsRead.Add(varString);\ndataItemsRead.Add(varDateTime);<\/pre><\/div>\n\n\n\n<p class=\"wp-block-paragraph\">\u6253\u5f00PLC\u8fde\u63a5\u5e76\u7acb\u5373\u8bfb\u53d6\u9879\u76ee\u5217\u8868\uff1a<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;clike&quot;,&quot;mime&quot;:&quot;text\/x-csharp&quot;,&quot;theme&quot;:&quot;material&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;C#&quot;,&quot;TrpContentRestriction&quot;:{&quot;restriction_type&quot;:&quot;exclude&quot;,&quot;selected_languages&quot;:[],&quot;panel_open&quot;:true},&quot;language&quot;:&quot;C#&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;csharp&quot;}\">myPLC.Open();\n\n\/\/ \u8bfb\u53d6\u53d8\u91cf\u5217\u8868\nmyPLC.ReadMultipleVars(dataItemsRead);\n\n\/\/ \u5173\u95ed\u8fde\u63a5\nmyPLC.Close();\n\n\/\/ \u8bbf\u95ee\u5217\u8868\u7684\u503c\nConsole.WriteLine(&quot;Int:&quot; + dataItemsRead[2].Value);<\/pre><\/div>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>\u5199\u5165\u591a\u4e2a\u53d8\u91cf<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u6b64\u65b9\u6cd5\u5728\u5355\u4e2a\u8bf7\u6c42\u4e2d\u5199\u5165\u591a\u4e2a\u53d8\u91cf\u3002<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;clike&quot;,&quot;mime&quot;:&quot;text\/x-csharp&quot;,&quot;theme&quot;:&quot;material&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;C#&quot;,&quot;TrpContentRestriction&quot;:{&quot;restriction_type&quot;:&quot;exclude&quot;,&quot;selected_languages&quot;:[],&quot;panel_open&quot;:true},&quot;language&quot;:&quot;C#&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;csharp&quot;}\">public void Plc.Write(Array[DataItem] dataItems);<\/pre><\/div>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>Array[]<\/code> \u60a8\u5fc5\u987b\u6307\u5b9a\u5305\u542b\u6240\u6709\u8981\u5199\u5165\u7684\u9879\u76ee\u7684DataItem\u6570\u7ec4\u3002<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">\u793a\u4f8b\uff1a\u6b64\u65b9\u6cd5\u5c06\u591a\u4e2a\u53d8\u91cf\u5199\u5165\u4e00\u4e2a\u6570\u636e\u5757\uff1a<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u5b9a\u4e49\u6570\u636e\u9879\uff1a<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;clike&quot;,&quot;mime&quot;:&quot;text\/x-csharp&quot;,&quot;theme&quot;:&quot;material&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;C#&quot;,&quot;TrpContentRestriction&quot;:{&quot;restriction_type&quot;:&quot;exclude&quot;,&quot;selected_languages&quot;:[],&quot;panel_open&quot;:true},&quot;language&quot;:&quot;C#&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;csharp&quot;}\">private static DataItem varWordWrite = new DataItem()\n{\n    \/\/ ... (\u4e0e\u4e0a\u6587\u91cd\u590d\u7684\u6570\u636e\u9879\u5b9a\u4e49\u7701\u7565)\n};<\/pre><\/div>\n\n\n\n<p class=\"wp-block-paragraph\">\u2026\uff08\u4e2d\u95f4\u7701\u7565\u4e86\u4e0e\u4e0a\u6587\u91cd\u590d\u7684\u6570\u636e\u9879\u5b9a\u4e49\uff09<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u4e3a\u6570\u636e\u9879\u5206\u914d\u503c\u3002\u6ce8\u610f\u4f7f\u7528\u6b63\u786e\u7684\u6570\u636e\u8f6c\u6362\uff0c\u4ee5\u9002\u5e94S7\u6570\u636e\u7c7b\u578b\uff1a<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;clike&quot;,&quot;mime&quot;:&quot;text\/x-csharp&quot;,&quot;theme&quot;:&quot;material&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;C#&quot;,&quot;TrpContentRestriction&quot;:{&quot;restriction_type&quot;:&quot;exclude&quot;,&quot;selected_languages&quot;:[],&quot;panel_open&quot;:true},&quot;language&quot;:&quot;C#&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;csharp&quot;}\">varWordWrite.Value = (ushort)67;\nvarIntWrite.Value = (ushort)33;\nvarDWordWrite.Value = (uint)444;\nvarDIntWrite.Value = 6666;\nvarRealWrite.Value = 77.89;\nvarStringWrite.Value = &quot;Writting&quot;;<\/pre><\/div>\n\n\n\n<p class=\"wp-block-paragraph\">\u7136\u540e\u5b9a\u4e49\u4e00\u4e2a\u5217\u8868\u6765\u5b58\u50a8\u6570\u636e\u9879\uff0c\u5e76\u5c06\u521b\u5efa\u7684\u9879\u76ee\u6dfb\u52a0\u5230\u5217\u8868\u4e2d\uff1a<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;clike&quot;,&quot;mime&quot;:&quot;text\/x-csharp&quot;,&quot;theme&quot;:&quot;material&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;C#&quot;,&quot;TrpContentRestriction&quot;:{&quot;restriction_type&quot;:&quot;exclude&quot;,&quot;selected_languages&quot;:[],&quot;panel_open&quot;:true},&quot;language&quot;:&quot;C#&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;csharp&quot;}\">private static List&lt;DataItem&gt; dataItemsWrite = new List&lt;DataItem&gt;();\n\n\/\/ \u5c06\u6570\u636e\u9879\u6dfb\u52a0\u5230\u8981\u5199\u5165\u7684\u6570\u636e\u9879\u5217\u8868\u4e2d\ndataItemsWrite.Add(varWordWrite);\ndataItemsWrite.Add(varIntWrite);\ndataItemsWrite.Add(varDWordWrite);\ndataItemsWrite.Add(varDIntWrite);\ndataItemsWrite.Add(varRealWrite);\ndataItemsWrite.Add(varStringWrite);<\/pre><\/div>\n\n\n\n<p class=\"wp-block-paragraph\">\u6700\u540e\uff0c\u6253\u5f00PLC\u8fde\u63a5\u5e76\u4e00\u6b21\u6027\u5199\u5165\u9879\u76ee\u3002\u4f7f\u7528.ToArray()\u5c06\u5217\u8868\u8f6c\u6362\u4e3a\u6570\u7ec4\uff1a<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;clike&quot;,&quot;mime&quot;:&quot;text\/x-csharp&quot;,&quot;theme&quot;:&quot;material&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;C#&quot;,&quot;TrpContentRestriction&quot;:{&quot;restriction_type&quot;:&quot;exclude&quot;,&quot;selected_languages&quot;:[],&quot;panel_open&quot;:true},&quot;language&quot;:&quot;C#&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;csharp&quot;}\">\/\/ \u6253\u5f00\u8fde\u63a5\nmyPLC.Open();\n\n\/\/ \u5199\u5165\u9879\u76ee\nmyPLC.Write(dataItemsWrite.ToArray());\n\n\/\/ \u5173\u95ed\u8fde\u63a5\nmyPLC.Close();<\/pre><\/div>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<p class=\"wp-block-paragraph\">\u8fd9\u7bc7\u6587\u7ae0\u63d0\u4f9b\u4e86S7.Net\u8f6f\u4ef6\u7684\u8be6\u7ec6\u4ecb\u7ecd\uff0c\u5305\u62ec\u5176\u529f\u80fd\u3001\u5982\u4f55\u5f00\u59cb\u4f7f\u7528\u3001\u5982\u4f55\u521b\u5efaPLC\u5b9e\u4f8b\u3001\u8fde\u63a5\u4e0e\u65ad\u5f00\u3001\u9519\u8bef\u5904\u7406\u3001\u68c0\u67e5PLC\u7684\u53ef\u7528\u6027\u548c\u8fde\u63a5\u72b6\u6001\u3001\u8bfb\u53d6\u548c\u5199\u5165\u5b57\u8282\u3001\u8bfb\u53d6\u548c\u5199\u5165\u7ed3\u6784\u4f53\u548c\u7c7b\u3001\u4ee5\u53ca\u5982\u4f55\u4e00\u6b21\u6027\u8bfb\u53d6\u548c\u5199\u5165\u591a\u4e2a\u53d8\u91cf\u3002\u5e0c\u671b\u8fd9\u7bc7\u6587\u7ae0\u80fd\u5e2e\u52a9\u60a8\u66f4\u597d\u5730\u4e86\u89e3S7.Net\u3002<\/p>\n\n\n<div class=\"wp-block-wpcom-premium-download\"><div class=\"hidden-content-wrap premium-download-wrap\" id=\"eb6dfd6b-d09f-45be-873d-44e5e12b1985\">\n    <svg class=\"hidden-content-bg\" width=\"879\" height=\"205\" viewBox=\"0 45 820 160\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\">\n        <defs>\n            <linearGradient x1=\"100%\" y1=\"23.013%\" x2=\"9.11%\" y2=\"68.305%\" id=\"la\"><stop stop-color=\"var(--member-color, var(--theme-color))\" stop-opacity=\".01\" offset=\".533%\"\/><stop stop-color=\"var(--member-color, var(--theme-color))\" stop-opacity=\".15\" offset=\"100%\"\/><\/linearGradient>\n            <linearGradient x1=\"81.006%\" y1=\"27.662%\" x2=\".899%\" y2=\"69.383%\" id=\"lb\"><stop stop-color=\"var(--member-color, var(--theme-color))\" stop-opacity=\".15\" offset=\"0%\"\/><stop stop-color=\"var(--member-color, var(--theme-color))\" stop-opacity=\".01\" offset=\"100%\"\/><\/linearGradient>\n        <\/defs>\n        <g fill=\"none\" fill-rule=\"evenodd\"><path d=\"M9.871 124.063c7.9 9.12 28.19 21.598 46.66 5.41 19.19-16.818 27.986-42.87 15.531-51.971-12.454-9.102-37.594-6.819-59.32 1.62-21.727 8.44-10.77 35.822-2.87 44.941z\" fill=\"url(#la)\" transform=\"translate(67.938 .937)\"\/><path d=\"M610.783 44.063c-25.145 39.42-47.054 78.134-30.12 105.532 16.932 27.398 74.377 30.672 171.4 6.468 97.021-24.203 52.5-112.016 17.794-141.793-34.705-29.777-133.929-9.626-159.074 29.793z\" fill=\"url(#lb)\" transform=\"translate(67.938 .937)\"\/><path fill-opacity=\".06\" fill=\"var(--member-color, var(--theme-color))\" d=\"M325.477 101.51l-11.132 16.084-1.86-1.118L323.96 100.2z\"\/><path fill-opacity=\".06\" fill=\"var(--member-color, var(--theme-color))\" d=\"M363.904 94.28l-1.494 1.24 8.566 10.255 1.487-1.383z\"\/><path fill-opacity=\".06\" fill=\"var(--member-color, var(--theme-color))\" d=\"M215.386 150.719v.88l14.355 2.179v-.821z\"\/><path fill-opacity=\".06\" fill=\"var(--member-color, var(--theme-color))\" d=\"M144.006 125.22l.63.83 11.67-6.978-.569-.758-11.38 6.686\"\/><path fill-opacity=\".06\" fill=\"var(--member-color, var(--theme-color))\" d=\"M530.724 87.128l-.41.92 13.227 4.995.396-.942z\"\/><path fill-opacity=\".06\" fill=\"var(--member-color, var(--theme-color))\" d=\"M613.697 99.184l.65.711 13.93-15.484-.8-.593z\"\/><path fill-opacity=\".06\" fill=\"var(--member-color, var(--theme-color))\" d=\"M605.186 140.762l-.794.433 6.098 17.285.821-.419z\"\/><\/g>\n    <\/svg>    <div class=\"premium-download cols-3\">\n                    <div class=\"wpcom-premium-download-thumb\"><img decoding=\"async\" src=\"https:\/\/image.modbus.cn\/wp-content\/uploads\/2024\/05\/20240510202556135.webp\" style=\"width:1071px;aspect-ratio:1071 \/ 1009;\" loading=\"lazy\" title=\"S7.Net\uff1a\u4e13\u4e3a\u897f\u95e8\u5b50PLC\u8bbe\u8ba1\u7684\u4ee5\u592a\u7f51\u901a\u4fe1\u9a71\u52a8\u63d2\u56fe\" alt=\"S7.Net\uff1a\u4e13\u4e3a\u897f\u95e8\u5b50PLC\u8bbe\u8ba1\u7684\u4ee5\u592a\u7f51\u901a\u4fe1\u9a71\u52a8\u63d2\u56fe\" \/><\/div>\n                <div class=\"wpcom-premium-download-content\">\n                        <h3 class=\"wpcom-premium-download-title\">S7.Net\u6e90\u7801\u4e0b\u8f7d<\/h3>\n            <div class=\"vip-price-notice premium-download-vip-price\"><div class=\"vip-price-item\" vip-index=\"0\" vip-id=\"vip1\"><img decoding=\"async\" class=\"vip-flag-icon j-lazy no-lightbox\" src=\"https:\/\/image.modbus.cn\/wp-content\/uploads\/2023\/08\/20230818114436591.svg\" loading=\"lazy\" title=\"S7.Net\uff1a\u4e13\u4e3a\u897f\u95e8\u5b50PLC\u8bbe\u8ba1\u7684\u4ee5\u592a\u7f51\u901a\u4fe1\u9a71\u52a8\u63d2\u56fe1\" alt=\"S7.Net\uff1a\u4e13\u4e3a\u897f\u95e8\u5b50PLC\u8bbe\u8ba1\u7684\u4ee5\u592a\u7f51\u901a\u4fe1\u9a71\u52a8\u63d2\u56fe1\" \/>\u661f\u8000\u4f1a\u5458<span class=\"vip-price\">\u514d\u8d39<\/span><\/div><div class=\"vip-price-item\" vip-index=\"1\" vip-id=\"vip2\"><img decoding=\"async\" class=\"vip-flag-icon j-lazy no-lightbox\" src=\"https:\/\/image.modbus.cn\/wp-content\/uploads\/2023\/08\/20230818114919315.svg\" loading=\"lazy\" title=\"S7.Net\uff1a\u4e13\u4e3a\u897f\u95e8\u5b50PLC\u8bbe\u8ba1\u7684\u4ee5\u592a\u7f51\u901a\u4fe1\u9a71\u52a8\u63d2\u56fe2\" alt=\"S7.Net\uff1a\u4e13\u4e3a\u897f\u95e8\u5b50PLC\u8bbe\u8ba1\u7684\u4ee5\u592a\u7f51\u901a\u4fe1\u9a71\u52a8\u63d2\u56fe2\" \/>\u7480\u74a8\u4f1a\u5458<span class=\"vip-price\">\u514d\u8d39<\/span><\/div><div class=\"vip-price-item\" vip-index=\"2\" vip-id=\"vip3\">\u66dc\u94bb\u4f1a\u5458<span class=\"vip-price\">\u514d\u8d39<\/span><\/div><\/div>                        <div class=\"wpcom-premium-download-info\">\n                                    <span class=\"wpcom-premium-download-info-label\">\u8d44\u6e90\u4ef7\u683c<\/span>\n                    <span class=\"wpcom-premium-download-info-value\"><span class=\"premium-download-price\">\u00a50.00<\/span><\/span>\n                                    <span class=\"wpcom-premium-download-info-label\">\u9500\u552e\u6570\u91cf<\/span>\n                    <span class=\"wpcom-premium-download-info-value\"><span class=\"premium-download-sales\"><i class=\"wpcom-icon wi\"><\/i>16<\/span><\/span>\n                                    <span class=\"wpcom-premium-download-info-label\">\u53d1\u5e03\u65f6\u95f4<\/span>\n                    <span class=\"wpcom-premium-download-info-value\">2024\u5e745\u670810\u65e5<\/span>\n                                    <span class=\"wpcom-premium-download-info-label\">\u66f4\u65b0\u65f6\u95f4<\/span>\n                    <span class=\"wpcom-premium-download-info-value\">2024\u5e745\u670810\u65e5<\/span>\n                            <\/div>\n                    <\/div>\n                <div class=\"wpcom-premium-download-action\">\n                                                            <button class=\"wpcom-btn btn-danger btn-sm btn-block premium-download-vip-btn j-vip-new\" type=\"button\"><i class=\"wpcom-icon wi\"><svg aria-hidden=\"true\"><use xlink:href=\"#wi-vip-crown\"><\/use><\/svg><\/i>\u7acb\u5373\u89e3\u9501\u7279\u6743<\/button>\n                                    <\/div>\n                <div class=\"hidden-content-refresh\">\n            <i class=\"wpcom-icon wi refresh-help\"><svg aria-hidden=\"true\"><use xlink:href=\"#wi-help\"><\/use><\/svg><\/i>            <div class=\"refresh-action\">\n                <div class=\"refresh-action-inner\">\n                    \u5df2\u4ed8\u8d39\uff1f<a class=\"refresh-url\" href=\"https:\/\/www.modbus.cn\/en\/login?modal-type=login\">\u767b\u5f55<i class=\"wpcom-icon wi\"><svg aria-hidden=\"true\"><use xlink:href=\"#wi-user\"><\/use><\/svg><\/i><\/a> \u6216 <a class=\"refresh-url j-refresh-premium-download\" href=\"#\">\u5237\u65b0<i class=\"wpcom-icon wi\"><svg aria-hidden=\"true\"><use xlink:href=\"#wi-refresh\"><\/use><\/svg><\/i><\/a>\n                <\/div>\n            <\/div>\n        <\/div>\n    <\/div>\n<\/div><\/div><span id=\"magicpostMarker\"><\/span>","protected":false},"excerpt":{"rendered":"<p>\u6982\u8ff0 S7.Net\u662f\u4e00\u4e2a\u4e13\u4e3a\u897f\u95e8\u5b50PLC\u8bbe\u8ba1\u7684PLC\u9a71\u52a8\u7a0b\u5e8f&#8230;<\/p>","protected":false},"author":1,"featured_media":27977,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":"","_members_access_role":[],"_members_access_error":""},"categories":[691],"tags":[1131,1952,1953,1741,281],"class_list":["post-28137","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-modbus-code-base","tag-plc","tag-1952","tag-1953","tag-281"],"_links":{"self":[{"href":"https:\/\/www.modbus.cn\/en\/wp-json\/wp\/v2\/posts\/28137","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.modbus.cn\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.modbus.cn\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.modbus.cn\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.modbus.cn\/en\/wp-json\/wp\/v2\/comments?post=28137"}],"version-history":[{"count":0,"href":"https:\/\/www.modbus.cn\/en\/wp-json\/wp\/v2\/posts\/28137\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.modbus.cn\/en\/wp-json\/wp\/v2\/media\/27977"}],"wp:attachment":[{"href":"https:\/\/www.modbus.cn\/en\/wp-json\/wp\/v2\/media?parent=28137"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.modbus.cn\/en\/wp-json\/wp\/v2\/categories?post=28137"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.modbus.cn\/en\/wp-json\/wp\/v2\/tags?post=28137"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}