⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 counterfrm.h

📁 16 relay output channels and 16 isolated digital input channels LED indicators to show activated
💻 H
字号:
//---------------------------------------------------------------------------

#ifndef CounterfrmH
#define CounterfrmH
//---------------------------------------------------------------------------
#include <Classes.hpp>
#include <Controls.hpp>
#include <StdCtrls.hpp>
#include <Forms.hpp>
#include <ExtCtrls.hpp>
#include "..\..\..\..\include\driver.h"
#include "EventThread.h"
//---------------------------------------------------------------------------
class TForm1 : public TForm
{
__published:	// IDE-managed Components
        TGroupBox *grpDeviceSelection;
        TLabel *labDeviceName;
        TButton *btnDeviceSelect;
        TGroupBox *grpChannel;
        TGroupBox *grpCntMode;
        TGroupBox *grpCntSrc;
        TGroupBox *grpIniVal;
        TRadioGroup *rdgCountEdg;
        TRadioGroup *rdgCntDir;
        TRadioGroup *rdgOPCrtl;
        TGroupBox *grpGateMode;
        TGroupBox *grpGateSrc;
        TRadioGroup *rdgGatePl;
        TRadioGroup *rdgTCInt;
        TGroupBox *grpOutputMode;
        TStaticText *stResult;
        TButton *btnStart;
        TButton *btnStop;
        TComboBox *cmbChannel;
        TComboBox *cmbCntMode;
        TComboBox *cmbCntSrc;
        TComboBox *cmbGateSrc;
        TComboBox *cmbOutputMode;
        TEdit *txtIniVal;
        TTimer *ReadTimer;
        TMemo *MemoCTRead;
        void __fastcall FormCreate(TObject *Sender);
        void __fastcall btnDeviceSelectClick(TObject *Sender);
        void __fastcall btnStartClick(TObject *Sender);
        void __fastcall ReadTimerTimer(TObject *Sender);
        void __fastcall btnStopClick(TObject *Sender);
        void __fastcall cmbCntModeChange(TObject *Sender);
        void __fastcall rdgOPCrtlClick(TObject *Sender);
        void __fastcall FormClose(TObject *Sender, TCloseAction &Action);
private:	// User declarations
public:		// User declarations
         LONG lDriverHandle;                   //Driver handle
         char szErrMsg[80];                    // Use for MESSAGEBOX function
         LRESULT     ErrCde;                   // Return error code
         ULONG lDeviceNum;                    //Advantech Device Number in your system
         char szDescription[80];              //description for Select Device
         DEVFEATURES     DevFeatures;         // structure for device features
         PT_DeviceGetFeatures  ptDevGetFeatures;
         BOOL bRun;
         BOOL bGateEnable;
         USHORT usChannel;      // input port
         USHORT usMode;         // counter mode
         USHORT usCountSrc ;    // count source
	 USHORT usInitValue;    // initial value
	 USHORT usOutputMode;   // output mode
	 USHORT usCntEdge;      // count edge
	 USHORT usCntDir;       // count direction
	 USHORT usOutputEnable; // output enable
	 USHORT usGateSrc;      // gate source
	 USHORT usGatePl;       // gate polarity
         PT_EnableEvent ptEnableEvent;
	 HANDLE hReadThread;    // thread handle
         DWORD dwThreadID;
         PT_CounterConfig     ptCounterConfig;
         PT_CounterEventStart ptCounterEventStart;
         TEventThread *EventThread;

         // device features
         USHORT usMaxCntNum;
         DWORD  dwBoardID;

        __fastcall TForm1(TComponent* Owner);
};
//---------------------------------------------------------------------------
extern PACKAGE TForm1 *Form1;
//---------------------------------------------------------------------------
#endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -