#ifdef __MSDOS__ #include "licel_re.h" #else #include "licel_nidaq.h" #endif #undef SHOTS64K #define NI_CARD 1 #ifdef SHOTS64K #define MSW_MASK 0x0FFF #else #define MSW_MASK 0x00FF #endif /* Command List*/ #define RESET 0 #define START 8 #define STOP 16 #define SET_MEMORY 24 #define SELECT_DATASET 32 #define ADVANCE_BIN 40 #define SET_RANGE 48 #define RESET_RANGE 56 #define DECREASE_DISCR 56 #define RESET_DISCR 64 #define STATUS 80 #define RESET_DAMPING 88 #define HIGH_TRESH 96 #define RESET_ACQ 104 #define ADVANCE_SHOT 112 #define GROUP_II 128 /* Input Ranges */ #define MILLIVOLT500 0 #define MILLIVOLT100 1 #define MILLIVOLT20 2 /* Threshold Modes */ #define THRESHOLD_LOW 1 #define THRESHOLD_HIGH 0 /* Timeoutparameter*/ #define START_LOOP 30000 /* Datasets*/ #define PHOTON 0 #define LSW 1 #define MSW 2 /*Prototypes*/ /*Configuration*/ /*Set the discriminator level between 0 and 63*/ int HS_Licel_Set_Discriminator_Level(short int ,int); /* Changes the input voltage range (20,100,500mV)*/ int HS_Licel_Set_Range(short int,int); /* Set Threshold Mode sets the scale of the discriminator level, in the low threshold mode the discriminator level 63 corresponds to -25mV, while in the high threshold mode it corresponds to -100mV */ int HS_Licel_Set_Threshold_Mode(short int ,int ); /*Action Status*/ /*Returns the status information for the specified device (cycles ,memory, acqusition state and whether the device is just recording*/ int HS_Licel_Get_Status(short int ,long int *, int *, int *, int *); /* Continues the recording process for the specified device without a new initialisation of the memeory*/ int HS_Licel_Continue_Acquisition(short int ); /* The acquissition process will be stopped after the next received trigger*/ int HS_Licel_Stop_Acquisition(short int ); /*Clears both memories (A and B) of the specified device */ int HS_Licel_Clear_Memory(short int ); /* Clears both Memories (A and B) and the device is in the armed state */ int HS_Licel_Start_Acquisition(short int ); /* Acquires one shot for the specified device */ int HS_Licel_Single_Shot(short int ); /* Waits for the return of the device from the armed state. If the waiting time is longer than the time specified by imDelay, then the device will return to the idle state with the next reading of binary data */ int HS_Licel_Wait_For_Ready(short int , int) ; /*Data*/ int HS_Licel_Read_16bit_wide(short int , int , int , int ,unsigned short *); /* Function arguments */ /* iDevice - Hardware address of the transient recorder Valid values 0:7 iDiscrLevel - Photon counting discriminator level Valid values 0:63 iRange - Analog input range Valid values 0:2 Please use symbolic constants, as defined above. iMode - Photon counting threshold mode Valid values 0:1 Please use symbolic constants, as defined above. iCycles - Number of already acuired traces. Pleace note that there are two cycles used for memory initialization, so that the current shotnumber is iCycle-2 if iCycle >=2. Valid values: 0:4095 iMemory - Indicates to which memory bank the last shot was added Valid values: 0:1 iAcq_State - Is 0 if there is an acquisition currently running, and 1 otherwise. iRecording - Is 1 if the ADC is aquiring values, when the status command was issued and 0 otherwise. imDelay - Delay in milliseconds to wait. iDataset - Selects the dataset to be transferred. Valid values: 0:2. Please use symbolic constants, as defined above. iNumber - Number of Datapoints. The maximum value depends from the transient recorder type for TR xx:80 8192 for TR xx:160 16380 uPortData - array for the datarray. i_lsw - array containing the LSW of the analog data i_msw - array containing the MSW of the analog data lAccumulated- array for the combination of the analog data. iClipping - array with the clipping(out of range) information, 1 if there was at least once fullfilled the overange condition, for the specific datapoint, 0 otherwise. photon_raw - array containing the rar photon counting data photon_c - array with photon counting data without clipping information iPurePhoton - If there is no analog there is no need to remove the clipping bit. dNormalized - array normalized to the shotnumber. dmVData - array converted to mV. */