关于OPC Client 编写.rar

  • wghshen
    了解作者
  • C#
    开发工具
  • 23KB
    文件大小
  • rar
    文件格式
  • 0
    收藏次数
  • 10 积分
    下载积分
  • 1
    下载次数
  • 2021-03-11 09:08
    上传日期
本人在学习中,个人总结整理的OPC资料,希望对初学者有所帮助
关于OPC Client 编写.rar
  • 关于OPC Client 编写.docx
    26.4KB
内容介绍
<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/627268070f6c4f4c786c9479/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/627268070f6c4f4c786c9479/bg1.jpg"><div class="c x0 y1 w2 h2"><div class="t m0 x1 h3 y2 ff1 fs0 fc0 sc0 ls0 ws0">&#20851;&#20110;<span class="_ _0"> </span><span class="ff2 sc1">OPC Client </span>&#32534;&#20889;</div><div class="t m0 x1 h4 y3 ff1 fs1 fc1 sc1 ls0 ws0">&#26152;&#22825;&#21448;&#26377;&#20154;&#38382;&#25105; <span class="ff3">OPC Client </span>&#32534;&#20889;&#65292;&#23454;&#38469;&#26159;&#20182;&#20204;&#19981;&#20102;&#35299;<span class="_ _0"> </span><span class="ff3">OPC </span>&#23458;&#25143;&#31471;&#30340;&#24037;&#20316;&#21407;&#29702;&#65292;&#35201;&#24819;&#20889;&#23458;&#25143;&#31471;</div><div class="t m0 x1 h4 y4 ff1 fs1 fc1 sc1 ls0 ws0">&#31243;&#24207;&#65292;&#24517;&#39035;&#30693;&#36947;<span class="_ _0"> </span><span class="ff3">OPC<span class="_ _0"> </span></span>&#23545;&#35937;&#65292; <span class="ff3">OPC<span class="_ _1"> </span></span>&#36923;&#36753;&#23545;&#35937;&#27169;&#22411;&#21253;&#25324;&#65299;&#31867;&#23545;&#35937;&#65306;<span class="ff3">OPC server<span class="_ _1"> </span></span>&#23545;&#35937;&#12289;<span class="ff3">OPC </span></div><div class="t m0 x1 h4 y5 ff3 fs1 fc1 sc1 ls0 ws0">group<span class="_ _1"> </span><span class="ff1">&#23545;&#35937;&#12289;</span>OPC item<span class="_ _0"> </span><span class="ff1">&#23545;&#35937;&#65292;&#27599;&#31867;&#23545;&#35937;&#37117;&#21253;&#25324;&#19968;&#31995;&#21015;&#25509;&#21475;&#12290;</span></div><div class="t m0 x1 h4 y6 ff3 fs1 fc1 sc1 ls0 ws0">&#58898;&#58898;&#58898; OPC Server<span class="_ _0"> </span><span class="ff1">&#23545;&#35937;</span></div><div class="t m0 x1 h4 y7 ff3 fs1 fc1 sc1 ls0 ws0">&#58898;&#58898;&#58898; <span class="ff1">&#20027;&#35201;&#21151;&#33021;&#20026;&#65306;</span>1<span class="ff1">&#12289;&#21019;&#24314;&#21644;&#31649;&#29702;<span class="_ _0"> </span></span>OPC Group<span class="_ _1"> </span><span class="ff1">&#23545;&#35937;&#65307;</span></div><div class="t m0 x1 h4 y8 ff3 fs1 fc1 sc1 ls0 ws0">&#58898;&#58898;&#58898;&#58898;&#58898;&#58898;&#58898;&#58898;&#58898;<span class="_ _2"></span>&#58898;&#58898;&#58898;&#58898;&#58898;&#58898; 2<span class="ff1">&#12289;&#31649;&#29702;&#26381;&#21153;&#22120;&#20869;&#37096;&#30340;&#29366;&#24577;&#20449;&#24687;&#65307;</span></div><div class="t m0 x1 h4 y9 ff3 fs1 fc1 sc1 ls0 ws0">&#58898;&#58898;&#58898; OPC Group<span class="_ _0"> </span><span class="ff1">&#23545;&#35937;</span></div><div class="t m0 x1 h4 ya ff3 fs1 fc1 sc1 ls0 ws0">&#58898;&#58898;&#58898; <span class="ff1">&#20027;&#35201;&#21151;&#33021;&#20026;&#65306;</span>1<span class="ff1">&#12289;&#31649;&#29702;<span class="_ _0"> </span></span>OPC Group<span class="_ _1"> </span><span class="ff1">&#23545;&#35937;&#30340;&#20869;&#37096;&#29366;&#24577;&#20449;&#24687;&#65307;</span></div><div class="t m0 x1 h4 yb ff3 fs1 fc1 sc1 ls0 ws0">&#58898;&#58898;&#58898;&#58898;&#58898;&#58898;&#58898;&#58898;&#58898;<span class="_ _2"></span>&#58898;&#58898;&#58898;&#58898;&#58898;&#58898; 2<span class="ff1">&#12289;&#21019;&#24314;&#21644;&#31649;&#29702;<span class="_ _0"> </span></span>Items<span class="_ _0"> </span><span class="ff1">&#23545;&#35937;&#12290;</span></div><div class="t m0 x1 h4 yc ff3 fs1 fc1 sc1 ls0 ws0">&#58898;&#58898;&#58898;&#58898;&#58898;&#58898;&#58898;&#58898;&#58898;<span class="_ _2"></span>&#58898;&#58898;&#58898;&#58898;&#58898;&#58898; 3<span class="ff1">&#12289;</span>O<span class="_ _2"></span>PC<span class="_ _1"> </span><span class="ff1">&#26381;&#21153;&#22120;&#20869;&#37096;&#30340;&#23454;&#26102;&#25968;&#25454;&#23384;&#21462;&#26381;&#21153;&#65288;&#21516;&#27493;&#19982;&#24322;&#27493;&#26041;&#24335;&#65289;&#12290;</span></div><div class="t m0 x1 h4 yd ff3 fs1 fc1 sc1 ls0 ws0">&#58898;&#58898;&#58898; OPC<span class="_ _0"> </span><span class="ff1">&#32452;&#20013;&#26377;&#20197;&#19979;&#20960;&#20010;&#20027;&#35201;&#23646;&#24615;&#65306;</span>Name <span class="ff1">&#65306;&#32452;&#30340;&#21517;&#23383; &#65307;</span>Active<span class="ff1">&#65306;&#32452;&#30340;&#28608;&#27963;&#29366;&#24577;&#26631;&#24535; &#65307;</span></div><div class="t m0 x1 h4 ye ff3 fs1 fc1 sc1 ls0 ws0">Update Rate OPC<span class="ff1">&#65306;&#26381;&#21153;&#22120;&#21521;&#23458;&#25143;&#31243;&#24207;&#25552;&#20132;&#25968;&#25454;&#21464;&#21270;&#30340;&#21047;&#26032;&#36895;&#29575;&#65307;</span>Percent Dead band<span class="ff1">&#65306;&#25968;</span></div><div class="t m0 x1 h4 yf ff1 fs1 fc1 sc1 ls0 ws0">&#25454;&#27515;&#21306;&#65292;&#21363;&#33021;&#24341;&#36215;&#25968;&#25454;&#21464;&#21270;&#30340;&#26368;&#23567;&#25968;&#20540;&#30334;&#20998;&#27604;&#12290;</div><div class="t m0 x1 h4 y10 ff3 fs1 fc1 sc1 ls0 ws0">&#58898;&#58898;&#58898; OPC ITEM <span class="ff1">&#26159;&#38750;<span class="_ _0"> </span></span>COM<span class="_ _1"> </span><span class="ff1">&#23545;&#35937;&#65292;&#22312;<span class="_ _0"> </span></span>OPC<span class="_ _0"> </span><span class="ff1">&#26631;&#20934;&#20013;&#29992;&#26469;&#25551;&#36848;&#23454;&#26102;&#25968;&#25454;&#65292;&#26159;&#23458;&#25143;&#31471;&#19981;&#21487;&#35265;&#30340;&#23545;&#35937;&#12290;</span></div><div class="t m0 x1 h4 y11 ff1 fs1 fc1 sc1 ls0 ws0">&#20195;&#34920;&#20102;&#19982;&#26381;&#21153;&#22120;&#20013;&#30340;&#25968;&#25454;&#30340;&#36830;&#25509;&#65292;&#23427;&#24182;&#19981;&#26159;&#25968;&#25454;&#28304;&#65292;&#32780;&#20165;&#20165;&#26159;&#19982;&#25968;&#25454;&#28304;&#30340;&#36830;&#25509;&#12290;&#27599;&#20010;&#39033;&#37117;&#26377;&#20197;</div><div class="t m0 x1 h4 y12 ff1 fs1 fc1 sc1 ls0 ws0">&#19979;&#20027;&#35201;&#23646;&#24615;&#65306; <span class="ff3">Active<span class="_ _1"> </span></span>&#39033;&#30340;&#28608;&#27963;&#29366;&#24577;&#12289;<span class="ff3">Value<span class="_ _0"> </span></span>&#39033;&#30340;&#25968;&#20540;&#12289;&#31867;&#22411;&#20026;<span class="_ _0"> </span><span class="ff3">VARIANT</span>&#12289;<span class="ff3">Quality<span class="_ _1"> </span></span>&#39033;&#30340;&#21697;&#36136;&#65292;</div><div class="t m0 x1 h4 y13 ff1 fs1 fc1 sc1 ls0 ws0">&#20195;&#34920;&#25968;&#20540;&#30340;&#21487;&#20449;&#24230;&#65292;&#31867;&#22411;&#20026;<span class="_ _1"> </span><span class="ff3">SHORT</span>&#12289;<span class="ff3">TimeStamp<span class="_ _0"> </span></span>&#26102;&#38388;&#25139;&#65292;&#20195;&#34920;&#25968;&#25454;&#30340;&#23384;&#21462;&#26102;&#38388;&#12290;</div><div class="t m0 x1 h4 y14 ff3 fs1 fc1 sc1 ls0 ws0">&#58898;&#58898;&#58898; <span class="ff1">&#20320;&#19981;&#31649;&#29992;&#20160;&#20040;&#24320;&#21457;&#35821;&#35328;&#21482;&#35201;&#20102;&#35299;&#19978;&#38754;&#20960;&#20010;&#23545;&#35937;&#65292;&#23601;&#20250;&#20889;&#31243;&#24207;&#20102;</span></div><div class="t m0 x1 h4 y15 ff3 fs1 fc1 sc1 ls0 ws0">&#58898;&#58898;&#58898; <span class="ff1">&#19979;&#38754;&#20030;&#20010;<span class="_ _0"> </span></span>VC<span class="_ _0"> </span><span class="ff1">&#30340;&#20363;&#23376;</span></div><div class="t m0 x1 h5 y16 ff3 fs1 fc1 sc1 ls0 ws0">&#58898;&#58898;&#58898; HRESULT&#58898;&#58898;r1;</div><div class="t m0 x1 h5 y17 ff3 fs1 fc1 sc1 ls0 ws0">&#58898;CLSID&#58898;&#58898;clsid;</div><div class="t m0 x1 h5 y18 ff3 fs1 fc1 sc1 ls0 ws0">&#58898;LONG&#58898;&#58898;TimeBias = 0;</div><div class="t m0 x1 h5 y19 ff3 fs1 fc1 sc1 ls0 ws0">&#58898;FLOAT&#58898;&#58898;PercentDeadband = 0.0;</div><div class="t m0 x1 h5 y1a ff3 fs1 fc1 sc1 ls0 ws0">&#58898;DWORD&#58898;&#58898;RevisedUpdateRate;</div><div class="t m0 x1 h5 y1b ff3 fs1 fc1 sc1 ls0 ws0">&#58898;LPWSTR&#58898;&#58898;ErrorStr;</div><div class="t m0 x1 h5 y1c ff3 fs1 fc1 sc1 ls0 ws0">&#58898;char&#58898;&#58898;str[100];</div><div class="t m0 x1 h5 y1d ff3 fs1 fc1 sc1 ls0 ws0">&#58898;CString&#58898;&#58898;szErrorText;</div><div class="t m0 x1 h5 y1e ff3 fs1 fc1 sc1 ls0 ws0">&#58898;m_pItemResult = NULL;</div><div class="t m0 x1 h4 y1f ff3 fs1 fc1 sc1 ls0 ws0">&#58898;<span class="ff1">&#23458;&#25143;&#31471;&#31243;&#24207;&#24517;&#39035;&#23545;<span class="_ _1"> </span></span>DCOM<span class="_ _0"> </span><span class="ff1">&#36827;&#34892;&#21021;&#22987;&#21270;&#35774;&#32622;&#65292;&#20197;&#20445;&#35777;<span class="_ _0"> </span></span>OPC<span class="_ _1"> </span><span class="ff1">&#26381;&#21153;&#22120;&#31471;<span class="_ _3"> </span>&#22238;&#35843;&#20989;&#25968;&#19981;&#20250;&#34987;&#22581;&#22622;&#12290;</span></div><div class="t m0 x1 h4 y20 ff1 fs1 fc1 sc1 ls0 ws0"> </div><div class="t m0 x1 h5 y21 ff3 fs1 fc1 sc1 ls0 ws0">&#58898;r1 = CoInitialize(NULL);</div><div class="t m0 x1 h5 y22 ff3 fs1 fc1 sc1 ls0 ws0">&#58898;if (r1 != S_OK)</div><div class="t m0 x1 h5 y23 ff3 fs1 fc1 sc1 ls0 ws0">&#58898;{&#58898;if (r1 == S_FALSE)</div><div class="t m0 x1 h5 y24 ff3 fs1 fc1 sc1 ls0 ws0">&#58898;&#58898;{&#58898;MessageBox("COM Library already initialized",</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>
评论
    相关推荐
    • c# opc client 源码
      c# opc OPC API dll,这次我采用OPCDAAuto.dll
    • c#opcclient
      改程序使用c#开发的opc客服端,程序可以运行,希望有需要的人放心下载!
    • c# OPC.rar
      最近一个MES项目中需要通过opc方式获取PLC实时数据,我用c#通过调用OPCAutomation创建客户端,项目中连接的客户端是 Industry Gateway Server(IGS)(也可使用KepServer),附件为项目源码。
    • C# opc dll
      C#通过opc链接plc所需要的dll,可以方便了解C#程序员能够快速开发基于opc协议程序与plc通讯
    • C# OPC客户端源码
      ///程式使用C#.NET 2005 编写 ///引用类库OPCDAAuto.dll ///OPCServer采用KEPWare ///在windows xp sp2、sp3、windows 2003上测试通过 ///完成于:2008年12月31日 ///测试于:2009年01月05日 /// ///作者:潇洒草 //...
    • C# opc 编程文档
      opc 居多 编程文档 大多是收集网络上面的 有C# 有vb 。net
    • C# OPC 类库
      theSrv = new OpcServer(); //init opc server theSrv.Connect(txtSvrName.Text); Thread.Sleep(100); theSrv.SetClientName("ZDTOPC" + thisprocess.Id); SERVERSTATUS sts; theSrv.GetStatus(out sts); ...
    • C#OPC同步读写
      C#OPC同步读写源码,西门子PLC,工程师的福音
    • C#opc通讯客户端
      可以实现OPC通讯,自动搜索OPC服务器,连接目标服务器,从OPC服务器中读取Item的状态,并且可以给Item赋值,实现OPC变量读写操作
    • C# OPC Client
      C#开发OPC Client,可实现根据IP地址选取局域网内的OPC Server,然后选择该server上的items,进行数据实时采集。