//--------------------------------------------------------------------------- #include #pragma hdrstop #include "PACSDK.h" #include "Unit1.h" //--------------------------------------------------------------------------- #pragma package(smart_init) #pragma resource "*.dfm" TForm1 *Form1; //--------------------------------------------------------------------------- __fastcall TForm1::TForm1(TComponent* Owner) : TForm(Owner) { } //--------------------------------------------------------------------------- void __fastcall TForm1::btnWriteDOClick(TObject *Sender) { char strErr[32] ; unsigned int DO_Value = StrToInt("$" + etDOValue->Text); //HexToInt bool bRet=pac_WriteDO(0,cmbSlot->ItemIndex +1,StrToInt( etTotalChs->Text), DO_Value); if(bRet==false) { pac_GetErrorMessage(pac_GetLastError(), strErr); MessageBox(NULL,strErr,"Write DO error",MB_OK); } } //--------------------------------------------------------------------------- void __fastcall TForm1::btnClearDOClick(TObject *Sender) { char strErr[32] ; bool bRet=pac_WriteDO(0,cmbSlot->ItemIndex +1,StrToInt( etTotalChs->Text),0); if(bRet==false) { pac_GetErrorMessage(pac_GetLastError(), strErr); MessageBox(NULL,strErr,"Clear DO error",MB_OK); } etDOValue->Text ="0"; } //---------------------------------------------------------------------------