栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 软件开发 > 后端开发 > C/C++/C#

libplctag 在Unbuntu下的安装编译

C/C++/C# 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

libplctag 在Unbuntu下的安装编译


前言

项目中用到

libplctag,先在Ubuntu上安装一下


一、libplctag 是什么?

libplctag is an open source C library for Linux, Windows and macOS using EtherNet/IP or Modbus TCP to read and write tags in PLCs. The library has been in production since early 2012 and is used by multiple organizations for many tasks including controlling radio telescopes, large and precision manufacturing, controlling fitness equipment, food handling and many, many more.

Current Stable Version: 2.4

Old Stable Version: 2.3

GitHub - libplctag/libplctag: This C library provides a portable and simple API for accessing Allen-Bradley and Modbus PLC data over Ethernet.

二、使用步骤 1.安装环境工具

Run cmake (use "Release" for a release build and "Debug" for a debug build).

$> cmake .. -DCMAKE_BUILD_TYPE=Release

 

 

编译过程发现如下提示:

-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
 

2.在windows下编译似乎很快

Visual Studio Community 2019 with Windows 10 (19.03)

Microsoft has integrated GitHub and CMake into VS 2019 very nicely. It is highly recommended to use at least this version as the integration
has made the process much easier than in the past!

  • Download at least Visual Studio 2019. I use the Community, free, version.
  • Make sure that you select the C++ command line parts when selecting the components to install. This installs the C part too.
  • After installation, start VS 2019.
  • Select "Clone or Check out code" over on the top right of the splash/start up screen.
  • Enter the link information for the libplctag GitHub project.
  • This churns for a while (at least in a VM on a fast laptop with a NVMe drive, your wait time may vary).
  • VS 2019 will notice that this is a CMake-based project and automatically start setting everything up.
  • Once this is done, you should be able to build the project.
  • Project binaries may take a little bit of a hunt to find. If anyone has any tips on how to instruct VS through CMake to do something a little more obvious here, I would love to know!

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/1009463.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号