新建windows窗体项目;
添加引用研华的库文件
将库添加using
整个代码如下:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using Automation.BDaq;
using System.IO;
namespace 研华1716L
{
public partial class Form1 : Form
{
WaveformAiCtrl waveformAiCtrl = new WaveformAiCtrl();
int getDataCount = 12000;
short[] sectionBuffer=new short[12000];
void waveformAiCtrl_DataReady(object sender, BfdAiEventArgs e)
{
waveformAiCtrl.GetData(getDataCount, sectionBuffer);
StreamWriter sw = new StreamWriter("1.txt", true, Encoding.Default);
for (int