<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta charset="utf-8">
<meta name="generator" content="pdf2htmlEX">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<link rel="stylesheet" href="https://static.pudn.com/base/css/base.min.css">
<link rel="stylesheet" href="https://static.pudn.com/base/css/fancy.min.css">
<link rel="stylesheet" href="https://static.pudn.com/prod/directory_preview_static/62758a5816f2c0769c057b5c/raw.css">
<script src="https://static.pudn.com/base/js/compatibility.min.js"></script>
<script src="https://static.pudn.com/base/js/pdf2htmlEX.min.js"></script>
<script>
try{
pdf2htmlEX.defaultViewer = new pdf2htmlEX.Viewer({});
}catch(e){}
</script>
<title></title>
</head>
<body>
<div id="sidebar" style="display: none">
<div id="outline">
</div>
</div>
<div id="pf1" class="pf w0 h0" data-page-no="1"><div class="pc pc1 w0 h0"><img class="bi x0 y0 w1 h1" alt="" src="https://static.pudn.com/prod/directory_preview_static/62758a5816f2c0769c057b5c/bg1.jpg"><div class="c x0 y1 w2 h2"><div class="t m0 x1 h3 y2 ff1 fs0 fc0 sc0 ls0 ws0">可编程控制器<span class="_ _0"> </span><span class="ff2">PC </span>通讯组件使用说明</div><div class="t m0 x2 h4 y3 ff2 fs1 fc0 sc0 ls0 ws0">1. <span class="ff1">通讯组件概述</span></div><div class="t m0 x2 h4 y4 ff2 fs1 fc0 sc0 ls0 ws0"> <span class="_ _1"></span> <span class="_ _1"></span> <span class="ff1">通<span class="_ _1"></span>讯组<span class="_ _1"></span>件用于<span class="_ _2"> </span></span>PC<span class="_"> </span><span class="ff1">与可编<span class="_ _1"></span>程控制<span class="_ _1"></span>器<span class="_ _1"></span></span>, <span class="_ _1"></span><span class="ff1">可编<span class="_ _1"></span>程控制<span class="_ _1"></span>器</span>(PLC)<span class="_ _1"></span><span class="ff1">、智<span class="_ _1"></span>能仪表<span class="_ _1"></span>等进<span class="_ _1"></span>行数据<span class="_ _1"></span>通讯<span class="_ _1"></span>,适<span class="_ _1"></span>用</span></div><div class="t m0 x2 h4 y5 ff1 fs1 fc0 sc0 ls0 ws0">于基于<span class="_ _2"> </span><span class="ff2">PC<span class="_ _3"> </span></span>高级语言的工<span class="_ _1"></span>业自动化控制系统<span class="_ _1"></span>。组件采用动<span class="_ _1"></span>态链接库文件<span class="_ _4"></span><span class="ff2">(*.DLL)</span>的形,<span class="_ _1"></span>调用相</div><div class="t m0 x2 h4 y6 ff1 fs1 fc0 sc0 ls0 ws0">应的属性与方法函数,即可快速实现<span class="_ _3"> </span><span class="ff2">PC<span class="_"> </span></span>与<span class="_ _3"> </span><span class="ff2">PLC<span class="_ _3"> </span></span>的高效数据交换。</div><div class="t m0 x2 h4 y7 ff2 fs1 fc0 sc0 ls0 ws0">2. <span class="ff1">函数与参数</span></div><div class="t m0 x2 h5 y8 ff3 fs2 fc1 sc0 ls0 ws0">public<span class="fc0"> </span>int<span class="fc0"> ConnectTo(</span>string<span class="fc0"> Address, </span>int<span class="fc0"> Rack, </span>int<span class="fc0"> Slot)</span></div><div class="t m0 x2 h5 y9 ff3 fs2 fc1 sc0 ls0 ws0">public<span class="fc0"> </span>int<span class="fc0"> Disconnect()</span></div><div class="t m0 x2 h5 ya ff3 fs2 fc1 sc0 ls0 ws0"> #region<span class="fc0"> Get/Set the bit at Pos.Bit</span></div><div class="t m0 x2 h5 yb ff3 fs2 fc0 sc0 ls0 ws0"> <span class="fc1">public</span> <span class="fc1">static</span> <span class="fc1">bool</span> GetBitAt<span class="_ _5"></span>(<span class="fc1">byte</span>[] Buffer, <span class="fc1">int</span> Pos, <span class="fc1">int</span> Bit)</div><div class="t m0 x2 h5 yc ff3 fs2 fc0 sc0 ls0 ws0"> <span class="fc1">public</span> <span class="fc1">static</span> <span class="fc1">void</span> SetBitAt<span class="_ _5"></span>(<span class="fc1">ref</span> <span class="fc1">byte</span>[] Buffer, <span class="fc1">int</span> Pos, <span class="fc1">int</span> Bit,</div><div class="t m0 x2 h5 yd ff3 fs2 fc1 sc0 ls0 ws0">bool<span class="fc0"> Value)</span></div><div class="t m0 x2 h5 ye ff3 fs2 fc1 sc0 ls0 ws0"> #region<span class="fc0"> Get/Set 8 bit signed value (S7 SInt) -128..1<span class="_ _5"></span>27</span></div><div class="t m0 x2 h5 yf ff3 fs2 fc0 sc0 ls0 ws0"> <span class="fc1">public</span> <span class="fc1">static</span> <span class="fc1">int</span> GetSIntAt(<span class="fc1">byte</span>[] Buffer, <span class="fc1">int</span> Pos)</div><div class="t m0 x2 h5 y10 ff3 fs2 fc0 sc0 ls0 ws0"> <span class="fc1">public</span> <span class="fc1">static</span> <span class="fc1">void</span> SetSIntA<span class="_ _5"></span>t(<span class="fc1">byte</span>[] Buffer, <span class="fc1">int</span> Pos, <span class="fc1">int</span> Value)</div><div class="t m0 x2 h5 y11 ff3 fs2 fc0 sc0 ls0 ws0"> </div><div class="t m0 x2 h5 y12 ff3 fs2 fc1 sc0 ls0 ws0"> #region<span class="fc0"> Get/Set 16 bit signed value (S7 int) -32768.<span class="_ _5"></span>.32767</span></div><div class="t m0 x2 h5 y13 ff3 fs2 fc0 sc0 ls0 ws0"> <span class="fc1">public</span> <span class="fc1">static</span> <span class="fc1">int</span> GetIntAt(<span class="fc1">byte</span>[] Buffer, <span class="fc1">int</span> Pos)</div><div class="t m0 x2 h5 y14 ff3 fs2 fc0 sc0 ls0 ws0"> <span class="fc1">public</span> <span class="fc1">static</span> <span class="fc1">void</span> SetIntAt<span class="_ _5"></span>(<span class="fc1">byte</span>[] Buffer, <span class="fc1">int</span> Pos, <span class="fc2">Int16</span> Value)</div><div class="t m0 x2 h5 y15 ff3 fs2 fc1 sc0 ls0 ws0"> #region<span class="fc0"> Get/Set 32 bit signed value (S7 DInt) -21474<span class="_ _5"></span>83648..2147483647</span></div><div class="t m0 x2 h5 y16 ff3 fs2 fc0 sc0 ls0 ws0"> <span class="fc1">public</span> <span class="fc1">static</span> <span class="fc1">int</span> GetDIntAt(<span class="fc1">byte</span>[] Buffer, <span class="fc1">int</span> Pos)</div><div class="t m0 x2 h5 y17 ff3 fs2 fc0 sc0 ls0 ws0"> <span class="fc1">public</span> <span class="fc1">static</span> <span class="fc1">void</span> SetDIntA<span class="_ _5"></span>t(<span class="fc1">byte</span>[] Buffer, <span class="fc1">int</span> Pos, <span class="fc1">int</span> Value)</div><div class="t m0 x2 h5 y18 ff3 fs2 fc0 sc0 ls0 ws0"> <span class="fc1">#region</span> Get/Set 64 bit signed value (S7 LInt) -</div><div class="t m0 x2 h5 y19 ff3 fs2 fc0 sc0 ls0 ws0">9223372036854775808..922337203685477580<span class="_ _5"></span>7</div><div class="t m0 x2 h5 y1a ff3 fs2 fc0 sc0 ls0 ws0"> <span class="fc1">public</span> <span class="fc1">static</span> <span class="fc2">Int64</span> GetLIntAt(<span class="fc1">byte</span>[] Buffer, <span class="fc1">int</span> Pos)</div><div class="t m0 x2 h5 y1b ff3 fs2 fc0 sc0 ls0 ws0"> <span class="fc1">public</span> <span class="fc1">static</span> <span class="fc1">void</span> SetLIntA<span class="_ _5"></span>t(<span class="fc1">byte</span>[] Buffer, <span class="fc1">int</span> Pos, <span class="fc2">Int64</span> </div><div class="t m0 x2 h5 y1c ff3 fs2 fc0 sc0 ls0 ws0">Value)</div><div class="t m0 x2 h5 y1d ff3 fs2 fc0 sc0 ls0 ws0"> <span class="fc1"> #region</span> Get/Set 8 bit unsigned value (S7 USInt) 0..255</div><div class="t m0 x2 h5 y1e ff3 fs2 fc0 sc0 ls0 ws0"> <span class="fc1">public</span> <span class="fc1">static</span> <span class="fc1">byte</span> GetUSInt<span class="_ _5"></span>At(<span class="fc1">byte</span>[] Buffer, <span class="fc1">int</span> Pos)</div><div class="t m0 x2 h5 y1f ff3 fs2 fc0 sc0 ls0 ws0"> <span class="fc1">public</span> <span class="fc1">static</span> <span class="fc1">void</span> SetUSInt<span class="_ _5"></span>At(<span class="fc1">byte</span>[] Buffer, <span class="fc1">int</span> Pos, <span class="fc1">byte</span> </div><div class="t m0 x2 h5 y20 ff3 fs2 fc0 sc0 ls0 ws0">Value)</div><div class="t m0 x2 h5 y21 ff3 fs2 fc0 sc0 ls0 ws0"> <span class="fc1"> #region</span> Get/Set 16 bit unsigned value (S7 UInt) 0..65535</div><div class="t m0 x2 h5 y22 ff3 fs2 fc0 sc0 ls0 ws0"> <span class="fc1">public</span> <span class="fc1">static</span> <span class="fc2">UInt16</span> GetUIntAt(<span class="fc1">byte</span>[] Buffer, <span class="fc1">int</span> Pos)</div><div class="t m0 x2 h5 y23 ff3 fs2 fc0 sc0 ls0 ws0"> <span class="fc1">public</span> <span class="fc1">static</span> <span class="fc1">void</span> SetUIntA<span class="_ _5"></span>t(<span class="fc1">byte</span>[] Buffer, <span class="fc1">int</span> Pos, <span class="fc2">UInt16</span> </div><div class="t m0 x2 h5 y24 ff3 fs2 fc0 sc0 ls0 ws0">Value)</div><div class="t m0 x2 h5 y25 ff3 fs2 fc0 sc0 ls0 ws0"> <span class="fc1">#region</span> Get/Set 32 bit unsigned value (S7 UDInt) 0..42949<span class="_ _5"></span>67296</div><div class="t m0 x2 h5 y26 ff3 fs2 fc0 sc0 ls0 ws0"> <span class="fc1">public</span> <span class="fc1">static</span> <span class="fc2">UInt32</span> GetUDIntAt(<span class="fc1">byte</span>[] Buffer, <span class="fc1">int</span> Pos)</div><div class="t m0 x2 h5 y27 ff3 fs2 fc0 sc0 ls0 ws0"> <span class="fc1">public</span> <span class="fc1">static</span> <span class="fc1">void</span> SetUDInt<span class="_ _5"></span>At(<span class="fc1">byte</span>[] Buffer, <span class="fc1">int</span> Pos, <span class="fc2">UInt32</span> </div><div class="t m0 x2 h5 y28 ff3 fs2 fc0 sc0 ls0 ws0">Value)</div><div class="t m0 x2 h5 y29 ff3 fs2 fc0 sc0 ls0 ws0"> <span class="fc1">#region</span> Get/Set 64 bit unsigned value (S7 ULint) </div><div class="t m0 x2 h5 y2a ff3 fs2 fc0 sc0 ls0 ws0">0..18446744073709551616</div><div class="t m0 x2 h5 y2b ff3 fs2 fc0 sc0 ls0 ws0"> <span class="fc1">public</span> <span class="fc1">static</span> <span class="fc2">UInt64</span> GetULIntAt(<span class="fc1">byte</span>[] Buffer, <span class="fc1">int</span> Pos)</div></div></div><div class="pi" data-data='{"ctm":[1.611850,0.000000,0.000000,1.611850,0.000000,0.000000]}'></div></div>
</body>
</html>