发表于:2003-11-25 16:41:00
楼主
ADLink PCI9112数据采集卡,用C++ Builder 5编程实现电压量采集,使用Double Buffer进行连续采集,由一个按钮控制开始采集StartContAI(),一个按钮控制停止采集StopContAI并使用DAQBench的DChart控件显示电压波形,在C++ Builder下编译执行无任何问题,但独立执行可编译好的可执行程序时(.exe),刚一开始采集没有问题,但执行一下就停止了,波形显示也没有变化,按停止按钮后,再点开始按钮进行采集时,出现一个提示“必须加载一个dll!”,不知道这是什么原因,具体应加载哪一个dll,请李老师及各仁兄指教,小弟将感激不尽!
附:部分源程序
#include <vcl.h>
#pragma hdrstop
#include "MainPro.h"
#include "DeviceName.h"
#include "DBGRAPHLib_OCX.h"
#include "MULTIPLELib_OCX.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma link "DBGRAPHLib_OCX"
#pragma link "MULTIPLELib_OCX"
#pragma link "DBUILib_OCX"
#pragma resource "*.dfm"
TForm1 *Form1;
AnsiString DeviceName;int ScRat;
void __fastcall TForm1::FormShow(TObject *Sender)
{
Application->CreateForm(__classid(TForm2), &Form2);
int res = Form2->ShowModal();
if (res == 1)
{
Pci91121->DeviceName = DeviceName;
Pci91121->Open((short)1);
}
}
//---------------------------------------------------------------------------
void __fastcall TForm1::BitBtn1Click(TObject *Sender)
{
BitBtn1->Enabled = false;
BitBtn3->Enabled = false;
ComboBox1->Enabled = false;
Pci91121->StartContAI();
}
//---------------------------------------------------------------------------
void __fastcall TForm1::BitBtn2Click(TObject *Sender)
{
Pci91121->StopContAI();
BitBtn1->Enabled = true;
BitBtn3->Enabled = true;
ComboBox1->Enabled = true;
}
//---------------------------------------------------------------------------
void __fastcall TForm1::BitBtn3Click(TObject *Sender)
{
Close();
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Pci9112AiHalfReady(TObject *Sender,
TVariant *ScaledData, TVariant *BinaryCodes)
{
DChart1->ClearPlots();
DChart1->PlotChart(ScaledData);
}