//--------------------------------------------------------------------------- #include #pragma hdrstop #include "Unit1.h" #include "PACSDK.h" //--------------------------------------------------------------------------- #pragma package(smart_init) #pragma resource "*.dfm" TForm1 *Form1; //For counter/frequency modules: //The general SDK, XPacSDK_CE.dll, supports only 87K and 7K series. //8K series counter/frequency modules have their own libraries. //--------------------------------------------------------------------------- __fastcall TForm1::TForm1(TComponent* Owner) : TForm(Owner) { } //--------------------------------------------------------------------------- void __fastcall TForm1::FormCreate(TObject *Sender) { cbbSlot->ItemIndex = 0; cbbChannel->ItemIndex = 0; } //--------------------------------------------------------------------------- void __fastcall TForm1::Button1Click(TObject *Sender) //Read Counts { int slot = cbbSlot->ItemIndex + 1; int channel = StrToInt(cbbChannel->Items->Strings[cbbChannel->ItemIndex]); unsigned long Counter_Value = 0; HANDLE h = uart_Open(""); pac_ReadCNT(h, slot, channel, &Counter_Value); Edit1->Text = IntToStr(Counter_Value); uart_Close(h); } //--------------------------------------------------------------------------- void __fastcall TForm1::Button2Click(TObject *Sender) //Clear Counts { int slot = cbbSlot->ItemIndex + 1; int channel = StrToInt(cbbChannel->Items->Strings[cbbChannel->ItemIndex]); HANDLE h = uart_Open(""); pac_ClearCNT(h, slot, channel); uart_Close(h); } //---------------------------------------------------------------------------