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

📄 driver.h

📁 这是我编写的深圳地铁S335型司机控制器的检测程序
💻 H
📖 第 1 页 / 共 5 页
字号:
#define FID_FAOWaveFormStart           102    

//\\\\\\\\\\\\\\\\\\\ V2.0B /////////////////////
#define FID_FreqOutStart              104
#define FID_FreqOutReset              105
#define FID_CounterConfig             106
#define FID_DeviceGetParam            107
///////////////////// V2.0B \\\\\\\\\\\\\\\\\\\\\/

//\\\\\\\\\\\\\\\\\\\ V2.0C /////////////////////
#define FID_DeviceSetProperty	      108	
#define FID_DeviceGetProperty         109
#define FID_WritePortDword            110
#define FID_ReadPortDword             111
#define FID_FDIStart                  112
#define FID_FDICheck                  113
#define FID_FDIStop                   114
#define FID_FDOStart                  115
#define FID_FDOCheck                  116
#define FID_FDOStop                   117
#define FID_ClearFlag                 118
///////////////////// V2.0C /////////////////////

//\\\\\\\\\\\\\\\\\\\ V2.2 /////////////////////
#define FID_WatchdogStart             119
#define FID_WatchdogFeed              120
#define FID_WatchdogStop              121
///////////////////// V2.2/////////////////////

//\\\\\\\\\\\\\\\\\\\ V2.2C /////////////////////
#define FID_DioReadPortWord           122
#define FID_DioWritePortWord          123
#define FID_DioReadPortDword          124
#define FID_DioWritePortDword         125
#define FID_DioGetCurrentDOWord       126
#define FID_DioGetCurrentDODword      127
#define FID_FAODmaExStart             128
#define FID_FAITerminate              129
#define FID_FAOTerminate              130
///////////////////// V2.2C /////////////////////

// Supporting new device driver structure
//\\\\\\\\\\\\\\\\\\\ V2.3a /////////////////////
#define FID_DioEnableEventAndSpecifyDiPorts     131
#define FID_DioDisableEvent                     132
#define FID_DioGetLatestEventDiPortsState       133
#define FID_DioReadDiPorts                      134
#define FID_DioWriteDoPorts                     135
#define FID_DioGetCurrentDoPortsState           136
///////////////////// V2.3a /////////////////////
// End of new device driver structure.

// For new Unified FAO functions
#define FID_FAOCheckEx                          137 

#define FID_DioEnableEventAndSpecifyEventCounter     138
#define FID_CntrEnableEventAndSpecifyEventCounter    139
#define FID_CntrGetLatestEventCounterValue      140
#define FID_CntrDisableEvent                    141
typedef struct _DRIVERINFO
{
    struct      _DRIVERINFO far * pNext;  // next device info. address
    ULONG       ulDeviceNum;              // device number
    HGLOBAL     hDriverInfo;              // driver info. handle
    USHORT      usUsageCount;             // usage count
    HINSTANCE   hDriverInstance;          // driver instance handle
    FARPROC     lpfnDriverEntry;          // driver entry address
    LONG        hDeviceInfo;              // deivce info. (Lock data)
} DRIVERINFO, FAR * LPDRIVERINFO;

/*************************************************************************
    define gain listing
*************************************************************************/
typedef  struct tagGAINLIST
{
   USHORT   usGainCde;
   FLOAT    fMaxGainVal;
   FLOAT    fMinGainVal;
   
#ifndef _WIN32_WCE
   CHAR     szGainStr[16];
#else
   TCHAR     szGainStr[16];
#endif

} GAINLIST;

/*************************************************************************
    Define hardware board(device) features.

    Note: definition for dwPermutaion member

           Bit 0: Software AI
           Bit 1: DMA AI
           Bit 2: Interrupt AI
           Bit 3: Condition AI
           Bit 4: Software AO
           Bit 5: DMA AO
           Bit 6: Interrupt AO
           Bit 7: Condition AO
           Bit 8: Software DI
           Bit 9: DMA DI
           Bit 10: Interrupt DI
           Bit 11: Condition DI
           Bit 12: Software DO
           Bit 13: DMA DO
           Bit 14: Interrupt DO
           Bit 15: Condition DO
           Bit 16: High Gain
           Bit 17: Auto Channel Scan
           Bit 18: Pacer Trigger
           Bit 19: External Trigger
           Bit 20: Down Counter
           Bit 21: Dual DMA
           Bit 22: Monitoring
           Bit 23: QCounter

************************************************************************/
typedef struct tagDEVFEATURES
{
	
 #ifndef _WIN32_WCE
    CHAR     szDriverVer[8];    // device driver version
    CHAR     szDriverName[MAX_DRIVER_NAME_LEN];  // device driver name
#else
    TCHAR     szDriverVer[8];    // device driver version
    TCHAR     szDriverName[MAX_DRIVER_NAME_LEN];  // device driver name
#endif    

    DWORD    dwBoardID;         // board ID
    USHORT   usMaxAIDiffChl;    // Max. number of differential channel
    USHORT   usMaxAISiglChl;    // Max. number of single-end channel
    USHORT   usMaxAOChl;        // Max. number of D/A channel
    USHORT   usMaxDOChl;        // Max. number of digital out channel
    USHORT   usMaxDIChl;        // Max. number of digital input channel
    USHORT   usDIOPort;         // specifies if programmable or not
    USHORT   usMaxTimerChl;     // Max. number of Counter/Timer channel
    USHORT   usMaxAlarmChl;     // Max number of  alram channel
    USHORT   usNumADBit;        // number of bits for A/D converter
    USHORT   usNumADByte;       // A/D channel width in bytes.
    USHORT   usNumDABit;        // number of bits for D/A converter.
    USHORT   usNumDAByte;       // D/A channel width in bytes.
    USHORT   usNumGain ;        // Max. number of gain code
    GAINLIST glGainList[16];    // Gain listing
    DWORD    dwPermutation[4];  // Permutation
} DEVFEATURES, FAR * LPDEVFEATURES;

/*************************************************************************
    AOSET Definition
*************************************************************************/
typedef  struct tagAOSET
{
    USHORT  usAOSource;     // 0-internal, 1-external
    FLOAT   fAOMaxVol;      // maximum output voltage
    FLOAT   fAOMinVol;      // minimum output voltage
    FLOAT   fAOMaxCur;      // maximum output voltage
    FLOAT   fAOMinCur;      // minimum output voltage

} AOSET, FAR * LPAOSET;

// Set AO range
typedef  struct tagAORANGESET
{
   USHORT  usGainCount;    // how many gains will be suported
   USHORT  usAOSource;     // 0-internal, 1-external   
   USHORT  usAOType;       // 0-voltage, 1-current   
   USHORT  usChan;   
   FLOAT   fAOMax;         // maximum output voltage   
   FLOAT   fAOMin;         // minimum output voltage   
} AORANGESET, FAR * LPAORANGESET;

/* 2.0C mask, declare it later
//\\\\\\\\\\\\\\\\\\\ V2.0B /////////////////////
typedef struct tagPT_DeviceGetParam
{
    USHORT    nID;
    DWORD*    pSize;
    PVOID     pBuffer;
} PT_DeviceGetParam, FAR * LPT_DeviceGetParam;
///////////////////// V2.0B \\\\\\\\\\\\\\\\\\\\\
*/

/*************************************************************************
    DaughterSet Definition
*************************************************************************/
typedef  struct tagDAUGHTERSET
{
    DWORD   dwBoardID;              // expansion board ID
    USHORT  usNum;                  // available expansion channels
    FLOAT   fGain;                  // gain for expansion channel
    USHORT  usCards;                // number of expansion cards
} DAUGHTERSET, FAR * LPDAUGHTERSET;

/**************************************************************************
    Analog Input Configuration Definition
***************************************************************************/
typedef struct tagDEVCONFIG_AI
{
    DWORD   dwBoardID;         // board ID code
    DWORD   ulChanConfig;      // 0-single ended, 1-differential
    USHORT  usGainCtrMode;     // 1-by jumper, 0-programmable
    USHORT  usPolarity;        // 0-bipolar, 1-unipolar
    USHORT  usDasGain;         // not used if GainCtrMode = 1
    USHORT  usNumExpChan;      // DAS channels attached expansion board
    USHORT  usCjcChannel;      // cold junction channel
    DAUGHTERSET Daughter[MAX_DAUGHTER_NUM];   // expansion board settings
    DWORD   ulChanConfigEx[3]; // Extension the channel configuration, so we can max support 128 AI channels' setting.
} DEVCONFIG_AI, FAR * LPDEVCONFIG_AI;

/**************************************************************************
    DEVCONFIG_COM Definition
***************************************************************************/
typedef struct tagDEVCONFIG_COM
{
    USHORT  usCommPort;                     // serial port
    DWORD   dwBaudRate;                     // baud rate
    USHORT  usParity;                       // parity check
    USHORT  usDataBits;                     // data bits
    USHORT  usStopBits;                     // stop bits
    USHORT  usTxMode;                       // transmission mode
    USHORT  usPortAddress;                  // communication port address
} DEVCONFIG_COM, FAR * LPDEVCONFIG_COM;

/**************************************************************************
    TRIGLEVEL Definition
***************************************************************************/
typedef struct tagTRIGLEVEL
{
   FLOAT fLow;
   FLOAT fHigh;
} TRIGLEVEL;


typedef struct tagPT_DEVLIST
{
    DWORD   dwDeviceNum;

#ifndef _WIN32_WCE    
    char szDeviceName[50];    
#else    
    TCHAR  szDeviceName[50];    
#endif

    SHORT   nNumOfSubdevices;
} DEVLIST, FAR *LPDEVLIST;

typedef struct tagPT_DeviceGetFeatures
{
    LPDEVFEATURES  buffer;
    USHORT         size;
} PT_DeviceGetFeatures, FAR * LPT_DeviceGetFeatures;

typedef struct tagPT_AIConfig
{
    USHORT      DasChan;
    USHORT      DasGain;
} PT_AIConfig, FAR * LPT_AIConfig;

typedef struct tagPT_AIGetConfig
{
    LPDEVCONFIG_AI buffer;
    USHORT         size;
} PT_AIGetConfig, FAR * LPT_AIGetConfig;

typedef struct tagPT_AIBinaryIn
{
    USHORT      chan;
    USHORT      TrigMode;
    USHORT far  *reading;
} PT_AIBinaryIn, FAR * LPT_AIBinaryIn;

typedef struct tagPT_AIScale
{
    USHORT      reading;
    FLOAT       MaxVolt;
    USHORT      MaxCount;
    USHORT      offset;
    FLOAT far   *voltage;
} PT_AIScale, FAR * LPT_AIScale;

typedef struct tagPT_AIVoltageIn
{
    USHORT      chan;
    USHORT      gain;
    USHORT      TrigMode;
    FLOAT far   *voltage;
} PT_AIVoltageIn, FAR * LPT_AIVoltageIn;

typedef struct tagPT_AIVoltageInExp
{
    USHORT      DasChan;
    USHORT      DasGain;
    USHORT      ExpChan;
    FLOAT far   *voltage;
} PT_AIVoltageInExp, FAR * LPT_AIVoltageInExp;

typedef struct tagPT_MAIConfig
{
    USHORT      NumChan;
    USHORT      StartChan;
    USHORT far  *GainArray;
} PT_MAIConfig, FAR * LPT_MAIConfig;

typedef struct tagPT_MAIBinaryIn
{
    USHORT      NumChan;
    USHORT      StartChan;
    USHORT      TrigMode;
    USHORT far  *ReadingArray;
} PT_MAIBinaryIn, FAR * LPT_MAIBinaryIn;

typedef struct tagPT_MAIVoltageIn
{
    USHORT      NumChan;
    USHORT      StartChan;
    USHORT far  *GainArray;

⌨️ 快捷键说明

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