#ifndef CONSTH #define CONSTH #define uw8 unsigned char #define sw8 char #define uw16 unsigned short #define sw16 short #define uw32 unsigned long #define uw64 unsigned __int64 typedef struct Tuw8Val { uw8 V; //Value uw16 Q; //Quality char TSt[20]; //Time Stamp } Buw8Val; typedef struct TGenStat { uw8 V; uw16 Q; uw16 iQ; //internalQuality char TSt[20]; //Time Stamp (file Time) } BGenStat; typedef struct Tuw16Val { uw16 V; //Value uw16 Q; //Quality char TSt[20]; //Time Stamp } Buw16Val; typedef struct Tuw32Val { uw32 V; //Value uw16 Q; //Quality char TSt[20]; //Time Stamp } Buw32Val; typedef struct Tsw16Val { sw16 V; //Value uw16 Q; //Quality char TSt[20]; //Time Stamp } Bsw16Val; typedef struct TChVal { uw32 V; uw16 Q; char TSt[20]; } BChVal; typedef struct TChFloatVal { float V; uw16 Q; char TSt[20]; } BChFloatVal; typedef struct TFloatVal { float V; uw16 Q; char TSt[20]; } BFloatVal; typedef struct TNominals { float V; float I; uw16 Q; char TSt[20]; } BNom; typedef struct TChFloatNominals { float V; float I; uw16 Q; char TSt[20]; } BNominal; typedef struct TDevIDR { char GID[7]; // Device ID with software release bool Active; char SID[5]; uw8 ChNb; uw16 Q; char TSt[20]; } BDevIDR; typedef struct TChStatVal { union { uw16 Word; struct {uw8 High, Low; } Byte; struct { uw16 ErrT: 1; uw16 ErrS: 1; uw16 Rest1: 7; uw16 IErr: 1; uw16 isOn: 1; uw16 isRamp: 1; uw16 isEmcyOff: 1; uw16 Rest2: 1; uw16 ErrI: 1; uw16 ErrU: 1; } Bit; } Stat; uw16 Q; //Quality char TSt[20]; //Time StampBChStatusVal; } BChStatVal; typedef struct TChStatusVal { union { uw16 Word; struct {uw8 High, Low; } Byte; struct { uw16 bisPOS: 1; uw16 bisREG: 1; uw16 bIERR: 1; uw16 bisON: 1; uw16 bisRAMP: 1; uw16 bisEMCY: 1; uw16 bisCC: 1; uw16 bisCV: 1; uw16 brsv2: 2; uw16 bisCBND: 1; uw16 bisVBND: 1; uw16 bisEINH: 1; uw16 bisTRP: 1; uw16 bisCLIM: 1; uw16 bisVLIM: 1; } Bit; } Stat; uw16 Q; //Quality char TSt[20]; //Time StampBChStatusVal; } BChStatusVal; typedef struct TChEventStatusVal { union { uw16 Word; struct {uw8 High, Low; } Byte; struct { uw16 brsv1: 1; uw16 bEREG: 1; uw16 bEIERR: 1; uw16 bEON: 1; uw16 bERAMP: 1; uw16 bEEMCY: 1; uw16 bECC: 1; uw16 bECV: 1; uw16 brsv2: 2; uw16 bECBND: 1; uw16 bEVBND: 1; uw16 bEEINH: 1; uw16 bETRP: 1; uw16 bECLIM: 1; uw16 bEVLIM: 1; } Bit; } Stat; uw16 Q; //Quality char TSt[20]; //Time StampBChStatusVal; } BChEventStatusVal; typedef struct TChEventMaskVal { union { uw16 Word; struct {uw8 High, Low; } Byte; struct { uw16 brsv1: 1; uw16 bMEREG: 1; uw16 bMEIERR: 1; uw16 bMEON: 1; uw16 bMERAMP: 1; uw16 bMEEMCY: 1; uw16 bMECC: 1; uw16 bMECV: 1; uw16 brsv2: 2; uw16 bMECBND: 1; uw16 bMEVBND: 1; uw16 bMEEINH: 1; uw16 bMETRP: 1; uw16 bMECLIM: 1; uw16 bMEVLIM: 1; } Bit; } Stat; uw16 Q; //Quality char TSt[20]; //Time StampBChStatusVal; } BChEventMaskVal; typedef struct TChControlVal { union { uw16 Word; struct { uw8 Low, High; } Byte; struct { uw16 brsv1: 3; uw16 bsetON: 1; //uw16 bstaRAMP: 1; uw16 brsv2: 1; uw16 bsetEMCY: 1; uw16 brsv3: 10; } Bit; } Ctrl; uw16 Q; //Quality char TSt[20]; //Time StampBChStatusVal; } BChControlVal; typedef struct TModStatusVal { union { uw16 Word; struct {uw8 High, Low; } Byte; struct { uw16 Rest1: 8; uw16 bStGes: 1; // Summenbit über den ErrStatus aller Kanaele d.h. // mindestens ein Kanal- alle Kanaele ok uw16 bNoRamp: 1; // mindestens eine Rampe alle Kanäle gestartet uw16 bSupply: 1; uw16 bSloop: 1; // geöffnet geschlossen uw16 bFiltfr: 1; // kleine Filterfrequenz grosse uw16 bAdjust: 1; // nein Feinjustierung ja uw16 Rest2: 1; // disable enable uw16 bEEPisWr: 1; //momentan Aufzeichnung aller set values to EEP } Bit; } Status; } BModStatusVal; typedef struct TModControlVal { union { uw16 Word; struct {uw8 High, Low; } Byte; struct { uw16 Rest1: 8; uw16 bStGes: 1; // Summenbit über den ErrStatus aller Kanaele d.h. // mindestens ein Kanal- alle Kanaele ok uw16 bNoRamp: 1; // mindestens eine Rampe alle Kanäle gestartet uw16 bSupply: 1; uw16 bSloop: 1; // geöffnet geschlossen uw16 bFiltfr: 1; // kleine Filterfrequenz grosse uw16 bAdjust: 1; // nein Feinjustierung ja uw16 bKilEna: 1; // disable enable uw16 bEEPwr: 1; //momentan Aufzeichnung aller set values to EEP } Bit; } Control; } BModControlVal; /*typedef struct { TEdcpModOption Val; uw8 Spec; uw16 Q; char TSt[20]; //Time StampBChStatusVal; } TEdcpModOptionVal;*/ typedef enum { EHQ=0, ECH } TType; typedef enum { EHQ200=0, EHQ80_1kV_F=1, EHQ82_1kV_F=2, EHQ80_MIX_F=3, EHQ80_6kV=6, EHQ80_6kV_F=7, E16D0=21, E08C0=24, E08F0=25, E08F2=26, E08C2=27, E08B0=28 }; #define b0 0x01 #define b1 0x02 #define b2 0x04 #define b3 0x08 #define b4 0x10 #define b5 0x20 #define b6 0x40 #define b7 0x80 #define sp 0x20 #define esc 0x1b #define enter 0x0d #define lf 0x0a #define bell 0x07 #define bs 0x08 #define DLC 0x0f #define ChannelValue 16 #define bconnect 0x01 #define DATA_DIR 1 #define EXT_INSTR 2 //GesamtStatus #define b_avad 0x10 #define b_kill 0x40 #define b_ew 0x80 //Quality #define QUALITY_BAD 0 #define QUALITY_GOOD 192 //Resolution #define StandardRes 50000 //50E+3 #define HhighRes 10000000 //10E+6 //Keys #define Enter 13 #define ESC 27 #define PCAN_USB 3 #define PCAN_PCI 4 #endif