VC_OPC_Client

所属分类:Windows编程
开发工具:Visual C++
文件大小:385KB
下载次数:545
上传日期:2009-02-11 14:36:41
上 传 者literal
说明:  OPC 客户端开发的例子,包括opc服务列举,连接,数据刷新等
(OPC client development examples, including the services listed opc, connectivity, data refresh, etc.)

文件列表:
Visual C++ OPC Client Example\advisesink.cpp (23420, 2007-02-13)
Visual C++ OPC Client Example\advisesink.h (1852, 2007-02-13)
Visual C++ OPC Client Example\datasink20.cpp (17809, 2007-02-13)
Visual C++ OPC Client Example\datasink20.h (3455, 2007-02-13)
Visual C++ OPC Client Example\document.cpp (36339, 2007-02-13)
Visual C++ OPC Client Example\document.h (4604, 2007-02-13)
Visual C++ OPC Client Example\editfilters.cpp (14218, 2007-02-13)
Visual C++ OPC Client Example\editfilters.h (3956, 2007-02-13)
Visual C++ OPC Client Example\eventview.cpp (25098, 2007-02-13)
Visual C++ OPC Client Example\eventview.h (4091, 2007-02-13)
Visual C++ OPC Client Example\fixedsharedfile.h (2731, 2007-02-13)
Visual C++ OPC Client Example\globals.cpp (8305, 2007-02-13)
Visual C++ OPC Client Example\globals.h (4681, 2007-02-13)
Visual C++ OPC Client Example\group.cpp (119956, 2007-02-13)
Visual C++ OPC Client Example\group.h (7772, 2007-02-13)
Visual C++ OPC Client Example\grouppropertysheet.cpp (24208, 2007-02-13)
Visual C++ OPC Client Example\grouppropertysheet.h (4655, 2007-02-13)
Visual C++ OPC Client Example\groupview.cpp (53462, 2007-02-13)
Visual C++ OPC Client Example\groupview.h (3465, 2007-02-13)
Visual C++ OPC Client Example\imagebutton.cpp (4429, 2007-02-13)
Visual C++ OPC Client Example\imagebutton.h (1699, 2007-02-13)
Visual C++ OPC Client Example\item.cpp (25014, 2007-02-13)
Visual C++ OPC Client Example\item.h (4302, 2007-02-13)
Visual C++ OPC Client Example\itemadddlg.cpp (65972, 2007-02-13)
Visual C++ OPC Client Example\itemadddlg.h (4810, 2007-02-13)
Visual C++ OPC Client Example\itempropertiesdlg.cpp (32624, 2007-02-13)
Visual C++ OPC Client Example\itempropertiesdlg.h (2901, 2007-02-13)
Visual C++ OPC Client Example\itemview.cpp (81825, 2007-02-13)
Visual C++ OPC Client Example\itemview.h (4663, 2007-02-13)
Visual C++ OPC Client Example\itemwritedlg.cpp (16104, 2007-02-13)
Visual C++ OPC Client Example\itemwritedlg.h (2813, 2007-02-13)
Visual C++ OPC Client Example\listeditctrl.cpp (18582, 2007-02-13)
Visual C++ OPC Client Example\listeditctrl.h (3287, 2007-02-13)
Visual C++ OPC Client Example\mainwnd.cpp (42137, 2007-02-13)
Visual C++ OPC Client Example\mainwnd.h (3778, 2007-02-13)
Visual C++ OPC Client Example\opccomn.h (24718, 2007-02-13)
Visual C++ OPC Client Example\opccomn_i.c (2362, 2007-02-13)
Visual C++ OPC Client Example\opcda.h (94734, 2007-02-13)
Visual C++ OPC Client Example\opcda_i.c (3217, 2007-02-13)
Visual C++ OPC Client Example\opcerrors.h (4972, 2007-02-13)
... ...

///////////////////////////////////////////////////////////////////////////// -- OPC Quick Client Distributed Source Code Version -- ///////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////// INTRODUCTION: ///////////////////////////////////////////////////////////////////////////// The source code provide here is for a slightly stripped down version of our OPC Quick Client application. (None of the code removed is central to understanding how to use OPC.) This application has been around for a few years and is used extensively by our developers and testers - it's proven code. In it, you will see how to browse OPC servers, connect to them, add groups and items, and read and write data. OPC versions 1.0 and 2.0 are both supported. You may borrow freely from this code to create your own OPC client applications. The workspace and project files were created using Microsoft Visual C++ 6.0. Several project configurations are provided: Win32 Release, Win32 Debug, Unicode Release, and Unicode Debug. Before you dive into the code, it is recommended that you first familiarize yourself with the OPC Specification. This information is contained in the "Data Access Custom Interface Standard" document publicly available for download from opcfoundation.org. It is also recommended that you be fairly proficient with the C++ programming language, MFC, and COM. Though a great deal of internal documentation is included in the code, you may need to refer to the Microsoft Developer's Network (MSDN) documentation for additional information on Windows specific functions, structures, and MFC classes. There is a one-to-one relationship between certain object in a server and here in this client. For example, the client may maintain a CKGroup object which is associated with an OPC Group object in a server. To prevent confusion, objects on the server side are referred to as OPC and the associated objects on the client side are given by their class name, which generally start with "CK" for Class Kepware, or simply "object". When you begin examining the code, we suggest that you look at the COM interface classes first: advisesink.cpp, datasink20.cpp, and shutdownsink.cpp. From there, you should look at server.cpp, group.cpp, then item.cpp. This covers all of the OPC stuff. Having done that, all of the Windows GUI code will make more sense. Look at document.cpp first, then the associated views: groupview.cpp, itemview.cpp, and eventview.cpp. You can look at incidental dialog and property sheet classes and the miscellaneous utility classes like those in editfilters.cpp as you go. Markers used by the Visual C++ class wizard ("//{{AFX_VIRTUAL(CKDocument)", "//{{AFX_DATA_MAP(CKServerEnumerateGroupsDlg)", etc.) are scattered throughout the code. If you wish to make your "borrowed" code a bit more "pretty", you can remove them. Just be aware that the class wizard will no longer work if you do. You will need to have the VC++ UNICODE libraries installed on your system in order to build the application. These libraries are NOT installed by default, so make sure you have them using the steps below: 1) Run the VC++ 6.0 install program and allow it to detect the components installed on your system. 2) Click the "Add/Remove" button. 3) Select the "VC++ MFC and Template Libraries" item and click the "Change Options" button. 4) Select the "MS Foundation Class Libraries" item and click the "Change Options" button. 5) Make sure "Shared Libraries for UNICODE" is checked. You might also want to check "Static Libraries for UNICODE" while you're at it, though you won't need them to build the Quick Client project as is. ///////////////////////////////////////////////////////////////////////////// LEGAL STUFF: ///////////////////////////////////////////////////////////////////////////// This programming example is provided "AS IS". As such Kepware, Inc. makes no claims to the worthiness of the code and does not warranty the code to be error free. It is provided freely and can be used in your own projects. If you do find this code useful, place a little marketing plug for Kepware in your code. While we would love to help every one who is trying to write a great OPC client application, the uniqueness of every project and the limited number of hours in a day simply prevents us from doing so. If you really find yourself in a bind, please contact Kepware's technical support. We will not be able to assist you with server related problems unless you are using KepServer or KepServerEx.

近期下载者

相关文件


收藏者