研华DAQ数据采集卡编程

DAQ数据采集卡软件编程-只支持一个程序来访问设备

1、安装软件开发包(SDK)---DAQNAVI_SDK。

2、可识别到数据采集卡片。

3、加载C#编程的动态链接库-dll文件。(Automation.BDaq.dll与Automation.BDaq4.dll区别)。

4、编写软件流程。

4.1DI数字量输入流程图:

描述如下:

1)、创建InstantDiCtrl对象。

Automation.BDaq.InstantDiCtrl ind = new Automation.BDaq.InstantDiCtrl();

2)、选择获取设备。

ind.SelectedDevice = new DeviceInformation(deviceNumber);

3)、读取设备Di信息。

 ind.Read(portStart, portCount, values);//从portStart端口到portCount端口,读取的值存至values数组中。

 

4.2DO数字量输出流程图:

描述如下:

 

1)、创建InstantDoCtrl对象。

 

Automation.BDaq.InstantDoCtrl ind = new Automation.BDaq.InstantDoCtrl();

 

2)、选择获取设备。

 

ind.SelectedDevice = new DeviceInformation(deviceNumber);

 

3)、操作设备DO信息

 

 ind.Write(portStart, portCount, values);//从portStart端口到portCount端口,写入Value的值存至设备中。

4)、读取设备DO信息

ind.Red(portStart, portCount, values);//从portStart端口到portCount端口,读取的值存至values数组中。 

库文件: 

biodaq.dll与bdaqctrl.h---------适用于VC++,在头文件中加入

#include "bdaqctrl.h"
using namespace Automation::BDaq;

 

Automation.BDaq.dll以及Automation.BDaq4.dll-----适用于.NET

添加Dll库引用。

 

posted @ 2017-08-30 17:00  石头龙  阅读(10605)  评论(0编辑  收藏  举报