/////////////////////////////////////////////////////////////////////////////
-- 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 <Objects>
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.
没有合适的资源?快使用搜索试试~ 我知道了~
温馨提示
【工控老马出品,必属精品,亲测校正,质量保证】 资源名:西门子PLC工程实例源码第259期:一个S7200通过OPCSERVER与用VC++写的上位机通讯的工程实例.rar 资源类型:西门子PLC工程实例源码 源码说明: 全部项目源码都是经过测试校正后百分百成功运行的,如果您下载后不能运行可联系我进行指导或者更换。 适合人群:新手及有一定经验的开发人员
资源详情
资源评论
资源推荐
收起资源包目录
西门子PLC工程实例源码第259期:一个S7200通过OPCSERVER与用VC++写的上位机通讯的工程实例.rar (103个子文件)
opctestclient.aps 83KB
toolbar.bmp 1KB
groupimages.bmp 1KB
itemimages.bmp 630B
components.bmp 566B
checkboxes.bmp 418B
eventimages.bmp 374B
dupitem.bmp 238B
validateitemgray.bmp 238B
previousgray.bmp 238B
deleteitemgray.bmp 238B
deleteitem.bmp 238B
newitem.bmp 238B
newitemgray.bmp 238B
nextgray.bmp 238B
validateitem.bmp 238B
next.bmp 238B
dupitemgray.bmp 238B
previous.bmp 238B
opcda_i.c 3KB
opccomn_i.c 2KB
opctestclient.clw 23KB
group.cpp 117KB
itemview.cpp 80KB
itemadddlg.cpp 64KB
groupview.cpp 52KB
server.cpp 50KB
timestmp.cpp 45KB
mainwnd.cpp 41KB
document.cpp 35KB
itempropertiesdlg.cpp 32KB
serverpropertysheet.cpp 29KB
eventview.cpp 25KB
item.cpp 24KB
grouppropertysheet.cpp 24KB
advisesink.cpp 23KB
listeditctrl.cpp 18KB
datasink20.cpp 17KB
itemwritedlg.cpp 16KB
safearray.cpp 15KB
editfilters.cpp 14KB
serverenumgroupsdlg.cpp 13KB
opctestclient.cpp 13KB
globals.cpp 8KB
shutdownsink.cpp 7KB
servergeterrorstringdlg.cpp 7KB
versioninfo.cpp 6KB
servergroupbynamedlg.cpp 6KB
smarttooltip.cpp 6KB
imagebutton.cpp 4KB
updateintervaldlg.cpp 4KB
statusbartext.cpp 3KB
opctestclient.dsp 13KB
opctestclient.dsw 855B
opcda.h 93KB
resource.h 13KB
opccomn.h 11KB
group.h 8KB
serverpropertysheet.h 5KB
opcerrors.h 5KB
itemadddlg.h 5KB
server.h 5KB
globals.h 5KB
itemview.h 5KB
grouppropertysheet.h 5KB
document.h 4KB
timestmp.h 4KB
item.h 4KB
eventview.h 4KB
editfilters.h 4KB
mainwnd.h 4KB
groupview.h 3KB
datasink20.h 3KB
listeditctrl.h 3KB
itempropertiesdlg.h 3KB
itemwritedlg.h 3KB
fixedsharedfile.h 3KB
opctestclient.h 3KB
serverenumgroupsdlg.h 2KB
opcprops.h 2KB
servergeterrorstringdlg.h 2KB
versioninfo.h 2KB
opcquality.h 2KB
servergroupbynamedlg.h 2KB
safearray.h 2KB
updateintervaldlg.h 2KB
stdafx.h 2KB
advisesink.h 2KB
imagebutton.h 2KB
shutdownsink.h 2KB
safelock.h 1KB
smarttooltip.h 1KB
statusbartext.h 1KB
opctestclient.ico 766B
opctestclient.ncb 409KB
opctestclient.opt 56KB
opctestclient.plg 6KB
opctestclient.rc 52KB
opctestclient.rc2 405B
vssver.scc 1KB
共 103 条
- 1
- 2
工控老马
- 粉丝: 594
- 资源: 2625
下载权益
C知道特权
VIP文章
课程特权
开通VIP
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
评论1