{"id":42,"date":"2019-06-18T08:22:31","date_gmt":"2019-06-18T00:22:31","guid":{"rendered":"http:\/\/151.236.221.165\/?p=42"},"modified":"2019-06-18T14:33:43","modified_gmt":"2019-06-18T06:33:43","slug":"make-open62541-and-opcua","status":"publish","type":"post","link":"https:\/\/www.sanburs.xyz\/index.php\/2019\/06\/18\/make-open62541-and-opcua\/","title":{"rendered":"Make open62541 and opcua"},"content":{"rendered":"<p><div class=\"has-toc have-toc\"><\/div><br \/>\n\u6700\u8fd1\u5728\u770bOPC UA\u7684\u76f8\u5173\u77e5\u8bc6\uff0c\u5c31\u53bbQt\u4e0a\u67e5\u4e86\u4e00\u4e0b\uff0c\u53d1\u73b0\u4ed6\u4eec\u5728\u5f00\u53d1OPCUA\u6a21\u5757\uff0c\u51c6\u5907\u57282018\u5e745\u6708\u7684Qt5.11\u7248\u672c\u91cc\u53d1\u5e03\u3002\u867d\u7136\u8fd8\u6ca1\u6709\u53d1\u5e03\uff0c\u4f46\u662f\u53ef\u4ee5\u63d0\u524d\u8bd5\u7528\u4e0b\u3002\u53c2\u8003\u8fd9\u7bc7\u6587\u7ae0:<a href=\"http:\/\/blog.basyskom.com\/2018\/want-to-give-qt-opcua-a-try\/\" target=\"_blank\"  rel=\"nofollow\" >Want to give Qt OpcUa a try?<\/a><\/p>\n<blockquote><p>\n  Two things are needed: Qt OpcUa itself and an OPC UA library. In this<br \/>\n  article, we use open62541 as it has very little dependencies (and is<br \/>\n  the more complete implementation anyway).<\/p>\n<p>  The following recipes assume that you have cmake, python\/pip, perl,<br \/>\n  git and other essential build tools installed. Paths used with the<br \/>\n  examples need to be adjusted to reflect your local situation.\n<\/p><\/blockquote>\n<p>\u5199\u8fd9\u7bc7\u6587\u7ae0\u4e3b\u8981\u662f\u60f3\u770b\u4e0bcmake\uff0cqmake\uff0cmake\u7684\u8fc7\u7a0b\uff0c\u539f\u7406\u53ef\u4ee5\u53c2\u8003\u77e5\u4e4e\u8fd9\u4e2a\u63d0\u95ee<a href=\"https:\/\/www.zhihu.com\/question\/27455963\" target=\"_blank\"  rel=\"nofollow\" >make makefile cmake qmake\u90fd\u662f\u4ec0\u4e48\uff0c\u6709\u4ec0\u4e48\u533a\u522b\uff1f<\/a><\/p>\n<hr \/>\n<p>\u6211\u7528\u7684\u662fMinGW\u56e0\u6b64\u811a\u672c\u9009\u62e9Installation on Windows (MinGW as shipped with Qt 5.10)<\/p>\n<pre><code>pip install six\ngit clone https:\/\/github.com\/open62541\/open62541.git\ncd open62541\ngit checkout 302003d\nmkdir build\ncd build\ncmake.exe -G \"MinGW Makefiles\" -DUA_ENABLE_AMALGAMATION=ON ..\nmingw32-make.exe\n\ngit clone http:\/\/code.qt.io\/qt\/qtopcua.git\ncd qtopcua\nmkdir build\ncd build\nset CPLUS_INCLUDE_PATH=c:\\path\\to\\open62541\\build\nset LIBRARY_PATH=c:\\path\\to\\open62541\\build\\bin\nqmake.exe ..\nmingw32-make.exe\nmingw32-make.exe install\n<\/code><\/pre>\n<p>\u524d\u63d0\u8f6f\u4ef6\u90fd\u51c6\u5907\u597d\u4ee5\u540e\uff0c\u8fd0\u884c\u4e0b\u8fd9\u4e2a\u811a\u672c\u5c31\u53ef\u4ee5\u4e86\u3002<\/p>\n<hr \/>\n<pre><code>    pip install six\n    git clone https:\/\/github.com\/open62541\/open62541.git\n    cd open62541\n    git checkout 302003d\n    mkdir build\n    cd build\n    cmake.exe -G \"MinGW Makefiles\" -DUA_ENABLE_AMALGAMATION=ON ..\n    mingw32-make.exe\n<\/code><\/pre>\n<ol>\n<li>\u5148\u6267\u884ccmake\u751f\u6210makefile<\/li>\n<li>\u7136\u540e\u6267\u884cmake\uff0c\u53ef\u4ee5\u6839\u636emakefile\u751f\u6210\u76ee\u6807\u6587\u4ef6<\/li>\n<\/ol>\n<hr \/>\n<pre><code>    git clone http:\/\/code.qt.io\/qt\/qtopcua.git\n    cd qtopcua\n    mkdir build\n    cd build\n    set CPLUS_INCLUDE_PATH=c:\\path\\to\\open62541\\build\n    set LIBRARY_PATH=c:\\path\\to\\open62541\\build\\bin\n    qmake.exe ..\n    mingw32-make.exe\n    mingw32-make.exe install\n<\/code><\/pre>\n<p>\u8fd9\u4e00\u6bb5<br \/>\n1. \u5148\u6267\u884cqmake\u751f\u6210makefile<br \/>\n2. \u7136\u540e\u6267\u884cmake\uff0c\u6839\u636emakefile\u751f\u6210\u76ee\u6807\u6587\u4ef6<br \/>\n3. \u6700\u540e\u6267\u884cmake install\uff0c\u5c06\u7f16\u8bd1\u597d\u7684\u76ee\u6807\u6587\u4ef6\u4ee5\u53ca\u6587\u6863copy\u5230\u5bf9\u5e94\u7684\u7cfb\u7edf\u76ee\u5f55(Qt\u76ee\u5f55)<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6700\u8fd1\u5728\u770bOPC UA\u7684\u76f8\u5173\u77e5\u8bc6\uff0c\u5c31\u53bbQt\u4e0a\u67e5\u4e86\u4e00\u4e0b\uff0c\u53d1\u73b0\u4ed6\u4eec\u5728\u5f00\u53d1OPCUA\u6a21\u5757\uff0c\u51c6\u5907\u57282018\u5e745\u6708\u7684Qt5.11\u7248\u672c\u91cc\u53d1\u5e03\u3002\u867d &#8230;<\/p>","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[],"_links":{"self":[{"href":"https:\/\/www.sanburs.xyz\/index.php\/wp-json\/wp\/v2\/posts\/42"}],"collection":[{"href":"https:\/\/www.sanburs.xyz\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.sanburs.xyz\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.sanburs.xyz\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.sanburs.xyz\/index.php\/wp-json\/wp\/v2\/comments?post=42"}],"version-history":[{"count":3,"href":"https:\/\/www.sanburs.xyz\/index.php\/wp-json\/wp\/v2\/posts\/42\/revisions"}],"predecessor-version":[{"id":49,"href":"https:\/\/www.sanburs.xyz\/index.php\/wp-json\/wp\/v2\/posts\/42\/revisions\/49"}],"wp:attachment":[{"href":"https:\/\/www.sanburs.xyz\/index.php\/wp-json\/wp\/v2\/media?parent=42"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.sanburs.xyz\/index.php\/wp-json\/wp\/v2\/categories?post=42"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.sanburs.xyz\/index.php\/wp-json\/wp\/v2\/tags?post=42"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}