NI LabVIEW,CVI,数据采集等产品讨论区

取消
显示结果 
搜索替代 
您的意思是: 

LabVIEW中如何加载 硬件的驱动

工控机的CAN卡,通过PCI BUS,除了有dll文件外,还有 CANbusApi.lib,WinIo.sys文件。

 

对方给出了在vc下加载这2个文件的方式,如下:

==================

 

1. Copy CANbusAPI to your project:

Copy the 4 files “CANbusAPI.dll” “CANbusAPI.lib” “CANbusAPI.h”

“WinIo.sys” to your project folder. And add the code in your source

file which use the functions of CANbusAPI.dll

#include “CANbusAPI.h”

 

2. Include CANBUSAPI library to your project:

There are two ways to include library (you just need to choice one):

a. on your IDE (ex. VS2005 or VS 2008…), fill “CANbusAPI.lib” to

the editor of “Project -> Properties -> Configuration Properties ->

Linker -> Input -> Additional Dependencies”

Fill library setting at Project Setting

b. Add the following line to your header file of project, which use

the functions of CANbusAPI.dll in source file.

#pragma comment (lib, “CANbusAPI.lib”) 

 

================

 

在LabVIEW 中仅能加载dll文件。目前无法对设备的硬件端口初始化操作。而别人用vc操作的程序,加载了 CANbusApi.lib,WinIo.sys文件后,可以正常操作硬件。

 

问题:1 lv能加在 CANbusApi.lib,WinIo.sys文件 吗? 

           2 若不能,是否需要 将 CANbusApi.lib,WinIo.sys文件 做成驱动文件安装在windows,然后再调用?

0 项奖励
1 条消息(共 7 条)
6,622 次查看

1. No.

2. LabVIEW can only call a dll.  So do whatever you can to create a new dll (which includes all the features in the .lib and winlo.sys), and call it in LabVIEW.

 

George Zou
0 项奖励
2 条消息(共 7 条)
6,609 次查看

非常感谢!!

 

不过还是很好奇,为啥vc可以做到?

0 项奖励
3 条消息(共 7 条)
6,600 次查看

通常 lib 里有的 dll 里都有,不需要重复。

George Zou
0 项奖励
4 条消息(共 7 条)
6,594 次查看

很久不来了,测试一下能否回复

0 项奖励
5 条消息(共 7 条)
6,590 次查看

遇到过一个板子,PC104总线,dll有,但是驱动没有。 他在vc可以包括.lib等文件,实现驱动功能。

0 项奖励
6 条消息(共 7 条)
6,567 次查看

在 VC 中,通常也可以跳过 lib ,直接调用 dll。

 

 

George Zou
0 项奖励
7 条消息(共 7 条)
6,562 次查看