文章目录
- 一.研华I/O板卡 Win10+Qt+Cmake 开发环境搭建
一.研华I/O板卡 Win10+Qt+Cmake 开发环境搭建
- 参考这个链接安装研华I/O板卡驱动程序
- 系统环境变量添加研华板卡dll
- Qt新建一个c++项目
- cmakeList.txt中添加研华库文件
cmake_minimum_required(VERSION 3.5)project(advantechDAQTest LANGUAGES CXX)#气阀控制板卡 set(ADVANTECH_DIR "C:\\Advantech\\") set(ADVANTECH_INCLUDE_DIRS ${ADVANTECH_DIR}\\DAQNavi\\Inc) include_directories(${ADVANTECH_INCLUDE_DIRS})set(CMAKE_CXX_STANDARD 17) set(CMAKE_CXX_STANDARD_REQUIRED ON)add_executable(advantechDAQTest main.cpp)install(TARGETS advantechDAQTestLIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})
- main.cpp中使用如下代码:
#include <iostream> #include "bdaqctrl.h"using namespace std; using namespace Automation::BDaq;int main() {InstantDoCtrl* instantDoCtrl; // 设备实例instantDoCtrl = InstantDoCtrl::Create(); // 创建设备实例cout << "DAQ ok" << endl;return 0; }
- 运行不报错则说明研华板卡环境搭建完成