GNU Lesser General Public License v3.0

项目介绍

edimetia3d/OPC-Client-X64 是一个托管在 GitHub 上的开源项目,主要使用 C++ 编写,采用 GNU Lesser General Public License v3.0 许可证,目前获得 147 个 Star、82 次 Fork。

仓库全名
edimetia3d/OPC-Client-X64
开源许可证
GNU Lesser General Public License v3.0
Star 数
147
Fork 数
82
未关闭 Issue
10

README 摘要

Description An object oriented OPC DA Client SDK/ToolKit written in C++, Both X86/X64 supported, implementing the OPC DA specification version 2.05A New Features (Compare with the original version) Build with x64 project. Build with MFC. Multithread supported. Connect to server with CLSID.(Hasn't tested) Notes Current master branch contains a huge bug fixes commit from PR#14, which might introduce some new bugs. If…

完整内容见 GitHub 原始 README 或本页 。

常见问题

OPC-Client-X64 用什么语言开发?

主要使用 C++ 编写,采用 GNU Lesser General Public License v3.0 许可证,目前有 147 个 Star。

OPC-Client-X64 可以免费商用吗?

仓库标注的许可证为 GNU Lesser General Public License v3.0,商用前请先阅读仓库 LICENSE 文件确认授权范围。

如何获取 OPC-Client-X64 的源码?

可以直接克隆仓库:git clone https://github.com/edimetia3d/OPC-Client-X64.git,默认分支为 master;安装与运行步骤见仓库 README。

OPC-Client-X64 最近还在维护吗?

仓库最近一次更新为 2024年6月18日,当前有 10 个未关闭 Issue;Star 数为 147,可作为社区活跃度的参考。

关于

GitHub 原始描述(英文)

An open source OPC DA Client SDK/ToolKit written in C++, support both 32 bit and 64 bit.

描述取自 GitHub 官方 API,保持仓库作者书写的原文。

简要分析

热度分
324
价值分
113
活跃状态
活跃

语言占比

C
C++
CMake

Release

README

Description

  • An object oriented OPC DA Client SDK/ToolKit written in C++, Both X86/X64 supported, implementing the OPC DA specification version 2.05A
  • New Features (Compare with the original version)
    • Build with x64 project.
    • Build with MFC.
    • Multithread supported.
    • Connect to server with CLSID.(Hasn’t tested)

Notes

Current master branch contains a huge bug fixes commit from PR#14, which might introduce some new bugs. If the master branch went wrong, you may check release 0.4.1 as a backup.

Basic Guide

  • Install OPC Core Component x64 is NECESSARY if you want to build x64 project, I bundled the 3.0.105.1 version (seems more popular).
  • You can test the Toolkit with MatrikonOPC Simulation Server.
    • You can get it free at offical site after reg.
    • Start OPC Simulation Server, then build project. Run the demo, input hostname, then input server ID, it should work.
    • If you were to commit a issue, you should give a code sample with the Simulation Server. Since this is the only env we can reproduce the error.
  • I advice you to use hostname instead of IP address for reasons below.
    • If you want to access OPC by IP, you have to enable RemoteRegistry service in services.msc
    • Also , for UAC problem after Vista, your program must run as admin to avoid some issue.
  • There is a convenience wrapper class that may help you connect local server easier.

Advanced Guide

  • Multi - Thread Programing Guide
    • Call COPCCLint::initand COPCClinet::stop in every thread. There are two method to init, in one application, different thread could use different method.
      • You can call COPCClient::init(MULTITHREADED) to init thread OLE, then the COPCxxx created in the thread could be accessed from other thread that is also inited with MULTITHREADED.
      • You can call COPCClient::init() to init thread OLE, but all COPCxxx created in the thread can’t be accessed from different thread.
    • Attention: If you are using anything related to MFC GUI, you MUST use COPCClient::init() in main thread (the UI thread) . (See MSDN) .

Detail & ChangeLog

  • Date: 2024-06-18

    • Thanks for kumajaya, the project has been switched to CMake PR#18, you can build it with CMake now.
  • Date: 2021-10-10

    • Thanks for wolfgang.griech ([email protected]), who contributed a huge bug fixes PR#14 that may fix many issues in this project.
  • Date: 2017-07-07

    • Thanks for mzillgith, now the project can connect to remote server with CLSID.(It hasn’t been tested)
  • Date: 2017-04-13

    • Fix a string conversion bug which might lead stack overflow
    • Add a convenience class to connect local server in sync I/O mode
        // connect local server
        LocalSyncOPCCLient* client = new LocalSyncOPCCLient;
        client->Init();
        if (client->Connect("Matrikon.OPC.Simulation.1"))
        {
            // sync write and sync read
            client->WriteUint16("Bucket Brigade.UInt2", 998);
            std::cout << client->ReadUint16("Bucket Brigade.UInt2");
    
            // disconnect and stop
            client->DisConnect();
            client->Stop();
            delete client;
        }
    
    
    • You could rewrite or override the member function IsOPCConnectedPLC() to make connection more safety
    • You could rewrite or override the member function ItemNameFilter(std::string) to avoid adding useless items
    • Since there are too many Variant type, I only add three basic I/O functions as a guidence, it should help you to add what you need
  • Date:2016-12-13

    • Thanks for Tom Loya’s contribution, now the project can work in a multi-threaded environment. You should call COPCClient::init() and COPCClient::stop() in every thread.
  • Date:2016-07-01

    • this std branch tries to move every ATL to STL.
    • the static .lib now works for MFC too.
  • Date:2016-05-31

    • Modified from X86 Version OPC Client 0.4a by beharrell
    • Add some Hint info
    • X64 Version uses includes files form OPC Core Component 3.0.106.

评论

暂无评论