Hermes SDK 1.0.1A
SDK_Example.c
/*
#######################################
Copyright 2022 Micro-Photon-Devices s.r.l.
SOFTWARE PRODUCT: Hermes_SDK
Micro-Photon-Devices (MPD) expressly disclaims any warranty for the SOFTWARE PRODUCT.
The SOFTWARE PRODUCT is provided 'As Is' without any express or implied warranty of any kind,
including but not limited to any warranties of merchantability, noninfringement, or
fitness of a particular purpose. MPD does not warrant or assume responsibility for the
accuracy or completeness of any information, text, graphics, links or other items contained
within the SOFTWARE PRODUCT. MPD further expressly disclaims any warranty or representation
to Authorized Users or to any third party.
In no event shall MPD be liable for any damages (including, without limitation, lost profits,
business interruption, or lost information) rising out of 'Authorized Users' use of or inability
to use the SOFTWARE PRODUCT, even if MPD has been advised of the possibility of such damages.
In no event will MPD be liable for loss of data or for indirect, special, incidental,
consequential (including lost profit), or other damages based in contract, tort
or otherwise. MPD shall have no liability with respect to the content of the
SOFTWARE PRODUCT or any part thereof, including but not limited to errors or omissions contained
therein, libel, infringements of rights of publicity, privacy, trademark rights, business
interruption, personal injury, loss of privacy, moral rights or the disclosure of confidential
information.
#######################################
*/
#include "Hermes_SDK.h"
#include <stdio.h>
#include <math.h>
#include <time.h>
#include <stdlib.h>
#include <string.h>
#if defined(__linux__)
#define SLEEP usleep
#define MILLIS 1000
#elif defined(__APPLE__)
#define SLEEP usleep
#define MILLIS 1000
#include <unistd.h>
#elif defined(_WIN32)
#include <Windows.h>
#define SLEEP Sleep
#define MILLIS 1
#endif
//*************************************//
// //
// Support functions //
// //
//*************************************//
// Calculate the mean value of a UInt16 image
double mean(UInt16 * Img, UInt16 NPixel)
{
int i=0;
double res =0.0;
for(i=0;i<NPixel;i++)
res+= (double)Img[i];
return res/(double)NPixel;
}
// Calculate the mean value of a double image
double mean_double(double * Img, UInt16 NPixel)
{
int i=0;
double res =0.0;
for(i=0;i<NPixel;i++)
res+= Img[i];
return res/(double)NPixel;
}
// Create an histogram of the distribution of photon counts over the imager
void Hist(UInt16* Img, UInt16* hist)
{
int i=0;
memset(hist,'\0',65535*sizeof(UInt16));
for(i=0;i<2048;i++)
hist[Img[i]]++;
}
//***********************************//
// //
// Main code //
// //
//***********************************//
int main(void)
{
// variables definition //
Hermes_H Hermes= NULL;
UInt16* Img= NULL,hist[65535],AppliedDT=0;
int loop = 1;
int i_c;
char header[1024]="";
int integFrames=10;
double read_bytes=0,total_bytes=0;
int i=0,j=0,k=0,out=0;
short trig=0;
double gateoff=0;
double gateoff_array[3] = { 0 };
double counts[3] = {0};
double *x = NULL,*y= NULL, *z = NULL, *Imgd=NULL;
double* data= NULL;
char c=0,*fname=NULL;
BUFFER_H buffer = NULL;
int counter = 0, aggressor=0;
HermesReturn error = OK;
FILE* f= NULL;
time_t start,stop,leap;
char *menu_strings[] = { "Live mode: write on stdout 10 images", //a
"Holdoff: mean number of photons at different holdoff values", //b
"Dead-time corrector improves the image quality", //c
"Background subtraction: 2 output files, with and without BG", //d
"Gate: 1000 images normal, 1000 images with gate 3 ns shift 5 ns", //e
"Synchronization output", //f
"Background statistics", //g
"Gate: calibrate the length of the gate signal", //h
"Triple gate mode", //i
"Read and write test images", //j
"Continuous acquisition on file", //k
"Continuous acquisition in memory", //l
"Reset overcurrent protection" //m
};
Imgd =(double*) calloc(1, 2048* sizeof(double));
Img =(UInt16*) calloc(1, 2048* sizeof(UInt16));
data =(double*) calloc(1, 2048* sizeof(double));
x =(double*) calloc(1, 65535* sizeof(double));
y =(double*) calloc(1, 65535* sizeof(double));
z = (double*)calloc(1, 65535 * sizeof(double));
// Simple menu for test selection //
HermesConstr(&Hermes, Normal, "");
while (loop) {
// ------ MENU --------------------------------------------------------
printf("\n*******************************************************************************\n");
printf(" Hermes Test program\n");
printf("*******************************************************************************\n");
for (i = 0; i < sizeof(menu_strings) / sizeof(char*); i++) {
printf("\t%c) %s\n", i + 'a', menu_strings[i]);
}
printf("\tq) Quit\n> ");
c = getchar();
getchar();
if (c >= 'a' && c <= 'a' + sizeof(menu_strings) / sizeof(char*) - 1) {
printf("*******************************************************************************\n");
printf("%s\n", menu_strings[c - 'a']);
printf("*******************************************************************************\n");
}
switch (c)
{
case 'a'://Test live mode
//Hermes parameter setting
HermesSetCameraPar(Hermes, 100, 30000, 300, 1, Disabled, Disabled, Disabled);
//Acquistion of 10 live images
for (i = 0; i < 10; i++)
{
printf("Image %d:\n", i);
error = HermesLiveGetImg(Hermes, Img);
if (error == OK)
for (j = 0; j < 32; j++)
{
for (k = 0; k < 32; k++)
printf("%d ", Img[32 * j + k]);
printf("\n");
}
else
break;
}
//Live mode off
break;
case 'b'://Test dead-time
//Hermes parameter setting
HermesSetCameraPar(Hermes, 1040, 10, 1, 1, Disabled, Disabled, Disabled);
k = 0;
printf("Acquiring:\n");
//Open file
if ((f = fopen("DTValues.txt", "w")) == NULL)
{
printf("Unable to open the output file.\n");
break;
}
//set deadtime, acquire snap, calculate mean photon count value and save results
for (i = MAX_DEAD_TIME; i >= MIN_DEAD_TIME; i -= 30)
{
data[k] = 0.0;
HermesSetDeadTime(Hermes, i);
HermesGetDeadTime(Hermes, i, &AppliedDT);
x[k] = (double)AppliedDT;
HermesAverageImg(Hermes, Imgd, 1);
data[k] = mean_double(Imgd, 2048);
printf("%d ns, Applied %d ns, %f\n", i, AppliedDT, data[k]);
fprintf(f, "%d %f\n", i, data[k]);
k++;
}
//print summary
printf("\nDead-time calibration\n");
for (i = 0; i < k; i++)
{
printf("%f %f\n", x[i], data[i]);
}
fclose(f);
break;
case 'c': //Dead-time corrector effect
//Hermes parameter setting
HermesSetCameraPar(Hermes, 4096, 1000, 100, 1, Disabled, Disabled, Disabled);
HermesSetDeadTime(Hermes, 100);
//acquisition with DTC on
printf("Acquire the image using the dead-time correction\n");
//Acquire the BG image first
printf("\n\n\nClose the camera shutter and press ENTER...\n");
getchar();
//Calculate the average image
HermesAverageImg(Hermes, data, 1);
for (i = 0; i < 2048; i++)
if (data[i] <= 65535)
Img[i] = (UInt16)floor(data[i] + 0.5);
else
Img[i] = 65535; // Avoid overflow
HermesSetBackgroundImg(Hermes, Img);
//now acquire the image with shutter open
printf("\n\n\nOpen the camera shutter and press ENTER...\n");
getchar();
HermesSaveImgDisk(Hermes, 1, 100, "Im_DeadTimeCorrected", TIFF_NO_COMPRESSION);
printf("The the dead-time corrected image was acquired and stored on the hard disk succesfully!\n");
//acquisition with DTC off
printf("\n\nAcquire the reference image without the dead-time correction\n");
//Acquire the BG image first
printf("\n\n\nClose the camera shutter and press ENTER...\n");
getchar();
//Calculate the average image
HermesAverageImg(Hermes, data, 1);
for (i = 0; i < 2048; i++)
if (data[i] <= 65535)
Img[i] = (UInt16)floor(data[i] + 0.5);
else
Img[i] = 65535; // Avoid overflow
HermesSetBackgroundImg(Hermes, Img);
//now acquire the image with shutter open
printf("\n\n\nOpen the camera shutter and press ENTER...\n");
getchar();
HermesSaveImgDisk(Hermes, 1, 100, "Im_DeadTimeReference", TIFF_NO_COMPRESSION);
printf("The the dead-time corrected image was acquired and stored on the hard disk succesfully!\n");
break;
case 'd'://Test background subtraction
//Hermes parameter setting
HermesSetCameraPar(Hermes, 4096, 1000, 100, 1, Disabled, Disabled, Disabled);
//acquire background image
printf("\n\n\nClose the camera shutter and press ENTER...\n");
getchar();
HermesSaveImgDisk(Hermes, 1, 1, "Bg", TIFF_NO_COMPRESSION);
HermesAverageImg(Hermes, data, 1);
for (i = 0; i < 2048; i++)
if (data[i] <= 65535)
Img[i] = (UInt16)floor(data[i] + 0.5);
else
Img[i] = 65535; // Avoid overflow
HermesSetBackgroundImg(Hermes, Img);
//acquire image with background subtration off
printf("Open the camera shutter and press ENTER ...\n");
getchar();
HermesSaveImgDisk(Hermes, 1, 1, "Normal", TIFF_NO_COMPRESSION);
//acquire image with background subtration on
HermesSaveImgDisk(Hermes, 1, 1, "BgSubt", TIFF_NO_COMPRESSION);
break;
case 'e': // Test gate
//Hermes parameter setting
HermesSetCameraPar(Hermes, 4096, 1000, 100, 1, Disabled, Disabled, Disabled);
HermesSetDeadTime(Hermes, 100);
//Normal image
printf("Acquiring the reference image ...\n");
printf("Save the reference image ...\n");
HermesSaveImgDisk(Hermes, 1, 1000, "GateNormal", TIFF_NO_COMPRESSION);
//gated image
HermesSetGateValues(Hermes, 10, 15); //Shift -10% of 20 ns --> 120 ns, Length 15% of 20 ns --> 3ns
printf("Acquiring the gated image ...\n");
printf("Save the gated image ...\n");
HermesSaveImgDisk(Hermes, 1, 1000, "GatePulsed", TIFF_NO_COMPRESSION);
break;
case 'f': // Test synchronization output
//Hermes parameter setting
HermesSetCameraPar(Hermes, 8192, 0xFFFF, 5, 1, Disabled, Disabled, Disabled);
HermesSetDeadTime(Hermes, 100);
//no output
printf("\n\nNo output ...\n");
printf("Press ENTER to continue\n");
getchar();
//gate clock output
HermesSetCameraPar(Hermes, 8192, 0xFFFF, 5, 1, Disabled, Disabled, Disabled);
printf("\n\nGate synchronization signal ...\n");
printf("Press ENTER to continue\n");
getchar();
//frame sync output
HermesSetCameraPar(Hermes, 8192, 0xFFFF, 5, 1, Disabled, Disabled, Disabled);
printf("\n\nFrame synchronization signal ...\n");
printf("Press ENTER to continue\n");
getchar();
printf("\n\nWait for the trigger input ...\n");
//trigger in enabled
HermesSetCameraPar(Hermes, 4096, 10, 2, 1, Disabled, Disabled, Disabled);
while (trig != 1)
HermesIsTriggered(Hermes, &trig);
printf("Trigger signal received!\n");
break;
case 'g': // Test background statistics
//The output file "BgHist.txt" contains the number of pixels which had a total number of counts given by the column index for each row.
//For example, column 3 contains the /number of pixels which had 3 dark-counts.
//Several rows are present because the histogram is calculated for several dead-time values.
//Hermes parameter setting
HermesSetCameraPar(Hermes, 1040, 100, 10000, 1, Disabled, Disabled, Disabled);
f = fopen("BgHist.txt", "w");
printf("Close the camera shutter and press ENTER ...\n");
getchar();
printf("Acquiring: ");
for (i = 150; i >= 50; i -= 50) //different hold-off values
{
printf("%d ns ", i);
HermesSetDeadTime(Hermes, i);
HermesAverageImg(Hermes, data, 1);
for (k = 0; k < 2048; k++)
if (data[k] <= 65535)
Img[k] = (UInt16)floor(data[k] + 0.5);
else
Img[k] = 65535; // Avoid overflow
Hist(Img, hist);
for (j = 0; j < 65535; j++)
fprintf(f, "%hd ", hist[j]);
fprintf(f, "\n");
}
printf("\n");
fclose(f);
HermesSaveImgDisk(Hermes, 1, 100, "DCR_50ns_movie", HERMES_FILEFORMAT);
HermesSaveAveragedImgDisk(Hermes, 1, "DCR_50ns_averaged", HERMES_FILEFORMAT,1);
HermesSaveAveragedImgDisk(Hermes, 1, "DCR_50ns_averaged", TIFF_NO_COMPRESSION, 1);
break;
case 'h': // Calibrate gate
//Hermes parameter setting
HermesSetCameraPar(Hermes, 1040 * 3, 10000, 5, 3, Disabled, Disabled, Disabled);
HermesSetDeadTime(Hermes, 100);
printf("Which counter do you want to acquire?\n");
scanf("%d", &counter);
if ((counter < 1) || (counter > 3))
{
printf("Insert a value between 1 and 3!\n");
break;
}
printf("Expose the Hermes camera to a time-independent luminous signal\n(room light might oscillate at 50 or 60 Hz)\nPress ENTER to continue ...\n");
getchar();
getchar();
if ((f = fopen("GateValues.txt", "w")) == NULL)
{
printf("Unable to open the output file.\n");
break;
}
//photon counts without any gate
HermesAverageImg(Hermes, data, 1);
gateoff = mean_double(data, 2048);
printf("Gate OFF counts: %.2f\n", gateoff);
fprintf(f, "Gate OFF counts: %.2f\n", gateoff);
printf("Acquiring:\n\nGate\t\tMean\t\tActual Gate\t\t\n");
//photon counts for gate witdh ranging from 0% to 100%
for (i = 0; i <= 100; i += 1)
{
HermesSetGateValues(Hermes, 0, i);
HermesAverageImg(Hermes, data, 1);
y[i] = mean_double(data, 2048);
y[i + 101] = y[i] / gateoff * 100; //actual gate width calculated from photon counts
x[i] = (double)i;
printf("%3.0f\t\t%.2f\t\t%.2f\n", x[i], y[i], y[i + 101]);
fprintf(f, "%.0f %.2f %.2f\n", x[i], y[i], y[i + 101]);
}
fclose(f);
printf("\n");
break;
case 'i': // Triple gate mode
//Hermes parameter setting
fname = (char*)calloc(256, sizeof(char));
HermesSetCameraPar(Hermes, 1040 * 3, 1000, 20, 3, Disabled, Disabled, Disabled);
HermesSetDeadTime(Hermes, 45);
printf("Expose the Hermes camera to a luminuos signal (pulsed or constant)\nPress ENTER to continue ...\n");
getchar();
printf("Acquiring...\n");
sprintf(fname, "Triple gate mode.txt");
if ((f = fopen(fname, "w")) == NULL)
{
printf("Unable to open the file %s.\n", fname);
break;
}
HermesSetTripleGate(Hermes, Disabled, -400, 10, 10, 10, 0, 100);
for (counter = 1; counter <= 3; counter++)
{
HermesAverageImg(Hermes, data, counter);
gateoff_array[counter - 1] = mean_double(data, 2048);
printf("\nGate OFF counts on counter %d: %.2f\n", counter, gateoff_array[counter - 1]);
fprintf(f, "Gate OFF counts on counter %d: %.2f\n", counter, gateoff_array[counter - 1]);
}
for (j = -400; j < 400; j++)
{
error = HermesSetTripleGate(Hermes, Enabled, j, 10, 10, 10, 0, 100);
if (error < 0) break;
for (counter = 1; counter <= 3; counter++)
{
HermesAverageImg(Hermes, data, counter);
counts[counter - 1] = mean_double(data, 2048);
}
printf("%d\t\t%.4f\t\t%.4f\t\t%.4f\n", j, counts[0] / gateoff_array[0] * 100, counts[2] / gateoff_array[2] * 100, counts[1] / gateoff_array[1] * 100);
fprintf(f, "%d\t\t%.4f\t\t%.4f\t\t%.4f\n", j, counts[0] / gateoff_array[0] * 100, counts[2] / gateoff_array[2] * 100, counts[1] / gateoff_array[1] * 100);
}
fclose(f);
printf("\n");
free(fname);
break;
case 'j': // Save and Read images
//Hermes parameter setting
HermesSetCameraPar(Hermes, 1040, 20, 2, 1, Disabled, Disabled, Disabled);
HermesSetDeadTime(Hermes, 100);
//acquiring and saving images
printf("Acquiring 20 images and save them on the hard drive in the Hermes file format.\n");
HermesSaveImgDisk(Hermes, 1, 20, "Test20_Im", HERMES_FILEFORMAT);
//reading images from file
printf("Read the images from the disk and print the value of the top-left-corner pixel for each frame.\n(Press ENTER to continue)\n");
getchar();
HermesReadHermesFileFormatImage("Test20_Im.Hermes", 1, 1, Img, header);
printf("Rows: %d, Columns: %d\n", header[100], header[101]);
for (i = 1; i <= 20; i++)
{
HermesReadHermesFileFormatImage("Test20_Im.Hermes", i, 1, Img, header);
printf("Image %d, pixel value = %hu\n", i, Img[0]);
}
break;
case 'k': //Continuous acquisition, number of integration frames selection.
//Hermes parameter setting
printf("\n");
printf("Input the number of frames of 10.40us to be integrated (suggested > 10 to avoid data loss):\n");
scanf("%d", &integFrames);
printf("Total integration time: %.2fus\n", (float)(10.40*integFrames));
HermesSetCameraPar(Hermes, 1050, 1, integFrames, 1, Disabled, Disabled, Disabled);
HermesSetDeadTime(Hermes, 100);
//acquire images
printf("Continuous acquisition will be started and 10 memory dumps performed.\n");
printf("Press ENTER to start continuous acquisition...\n");
getchar();
getchar();
HermesContAcqToFileStart(Hermes, "contacq");
for (i = 1; i < 10; i++)
{
if (HermesContAcqToFileGetMemory(Hermes, &read_bytes) == OK)
{
total_bytes = total_bytes + read_bytes;
printf("Acquired %f bytes in %d readout operation\n", total_bytes, i);
SLEEP(1 * MILLIS);
}
else
break;
}
printf("Acquisition saved to contacq.Hermes.\n");
break;
case 'l': //Continuous acquisition in memory, number of integration frames selection.
//Hermes parameter setting
printf("\n");
printf("Input the number of frames of 10.40us to be integrated (suggested > 10 to avoid data loss):\n");
scanf("%d", &integFrames);
printf("Total integration time: %.2fus\n", (float)(10.40*integFrames));
HermesSetCameraPar(Hermes, 1050, 1, integFrames, 1, Disabled, Disabled, Disabled);
HermesSetDeadTime(Hermes, 100);
//acquire images
printf("Continuous acquisition will be started and 10 memory dumps performed.\n");
printf("Press ENTER to start continuous acquisition...\n");
getchar();
getchar();
i = 1;
start = clock();
leap = start;
for (i = 1; i<11; i++)
{
if (HermesContAcqToMemoryGetBuffer(Hermes, &read_bytes, &buffer) == OK)
{
total_bytes = total_bytes + read_bytes;
stop = clock();
printf("Acquired %.2f MB in %d readout operation, last rate %.2fMB/s, average rate %.2fMB/s\n", total_bytes / 1000000.0, i, (read_bytes / 1000000.0 / ((stop - leap) / (float)CLOCKS_PER_SEC)), (total_bytes / 1000000.0 / ((stop - start) / (float)CLOCKS_PER_SEC)));
leap = clock();
SLEEP(1 * MILLIS);
}
else
{
printf("ERROR!");
break;
}
}
break;
case 'm': //Reset overcurrent protection
break;
case 'q':
loop = 0;
break;
}
}
// Destructors //
if(Hermes)
HermesDestr(Hermes);
Hermes = NULL;
free(Img);
free(Imgd);
free(data);
free(y);
free(x);
free(z);
printf("Press ENTER to continue\n");
getchar();
return 0;
}
Hermes software development kit.
#define MAX_DEAD_TIME
Maximum allowed dead-time in nanoseconds.
Definition: Hermes_SDK.h:87
unsigned short UInt16
Unsigned short integer (16 bit)
Definition: Hermes_SDK.h:70
#define MIN_DEAD_TIME
Minimum allowed dead-time in nanoseconds.
Definition: Hermes_SDK.h:83
HermesReturn HermesContAcqToMemoryGetBuffer(Hermes_H Hermes, double *total_bytes, BUFFER_H *buffer)
Dump the camera memory to the PC and pass the pointer to the image buffer in which acquisition is sto...
HermesReturn HermesContAcqToMemoryStop(Hermes_H Hermes)
Stop the continuous acquisition of data.
HermesReturn HermesContAcqToFileGetMemory(Hermes_H Hermes, double *total_bytes)
Dump the camera memory to the PC and save data to the file specified with the HermesContAcqToFileStar...
HermesReturn HermesContAcqToFileStart(Hermes_H Hermes, char *filename)
Put the camera in "continuous acquisition" mode.
HermesReturn HermesLiveSetModeON(Hermes_H Hermes)
Turn on the Live mode.
HermesReturn HermesContAcqToMemoryStart(Hermes_H Hermes)
Put the camera in "continuous acquisition" mode.
HermesReturn HermesContAcqToFileStop(Hermes_H Hermes)
Stop the continuous acquisition of data and close the output file.
HermesReturn HermesLiveSetModeOFF(Hermes_H Hermes)
Turn off the Live mode.
HermesReturn HermesLiveGetImg(Hermes_H Hermes, UInt16 *Img)
Get a Live image.
HermesReturn HermesSnapPrepare(Hermes_H Hermes)
Prepare the camera to the acquisition of a snap.
HermesReturn HermesSnapAcquire(Hermes_H Hermes)
Get a selected number of images.
HermesReturn HermesAverageImg(Hermes_H Hermes, double *Img, UInt16 counter)
Calculate the average image.
HermesReturn HermesSaveImgDisk(Hermes_H Hermes, UInt32 Start_Img, UInt32 End_Img, char *filename, OutFileFormat mode)
Save the selected images on the hard disk.
HermesReturn HermesSaveAveragedImgDisk(Hermes_H Hermes, UInt16 counter, char *filename, OutFileFormat mode, short isDouble)
Save the selected images on the hard disk.
HermesReturn HermesReadHermesFileFormatImage(char *filename, UInt32 ImgIdx, UInt16 counter, UInt16 *Img, char header[1024])
Read an integer (8 - 16 bit) Hermes image from file.
HermesReturn HermesResetOverilluminationProtection(Hermes_H Hermes)
Reset the internal overillumination protection circuit.
HermesReturn HermesConstr(Hermes_H *Hermes_in, CameraMode m, char *Device_ID)
Constructor.
HermesReturn HermesDestr(Hermes_H Hermes)
Destructor.
struct _Hermes_H * Hermes_H
Handle to the Hermes structure.
Definition: Hermes_SDK.h:192
HermesReturn
Error table.
Definition: Hermes_SDK.h:113
unsigned char * BUFFER_H
Handle to the Hermes buffer.
Definition: Hermes_SDK.h:195
@ Enabled
The function is enabled.
Definition: Hermes_SDK.h:177
@ Disabled
The function is disabled.
Definition: Hermes_SDK.h:176
@ HERMES_FILEFORMAT
Hermes custom file format.
Definition: Hermes_SDK.h:140
@ TIFF_NO_COMPRESSION
Multipage TIFF without compression.
Definition: Hermes_SDK.h:141
@ Continuous
The gate signal is always "ON".
Definition: Hermes_SDK.h:150
@ Pulsed
The gate signal is a square wave at 50MHz.
Definition: Hermes_SDK.h:151
@ OK
The function returned successfully.
Definition: Hermes_SDK.h:114
@ Frame
A 60 ns pulse every time a new frame is acquired.
Definition: Hermes_SDK.h:171
@ Gate_Clk
A square wave of 50 MHz and 50% duty cycle synchronized with the software gate signal and the camera ...
Definition: Hermes_SDK.h:170
@ None
No output signal.
Definition: Hermes_SDK.h:169
@ Normal
The camera settings are tuned by the software to avoid the overflow of the counters.
Definition: Hermes_SDK.h:161
HermesReturn HermesIsTriggered(Hermes_H Hermes, short *isTriggered)
Poll the camera for external trigger status.
HermesReturn HermesGetDeadTime(Hermes_H Hermes, UInt16 Val, UInt16 *ReturnVal)
Get the calibrated dead-time value.
HermesReturn HermesSetGateMode(Hermes_H Hermes, UInt16 counter, GateMode Mode)
Set the gate mode to continuous, coarse or pulsed (only counter 1)
HermesReturn HermesSetTripleGate(Hermes_H Hermes, State TripleGate_State, int StartShift, int FirstGateWidth, int SecondGateWidth, int ThirdGateWidth, int Gap1, int Gap2)
Set parameters for TripleGate mode.
HermesReturn HermesApplySettings(Hermes_H Hermes)
Apply settings to the camera.
HermesReturn HermesSetBackgroundSubtraction(Hermes_H Hermes, State s)
Enable or disable the hardware background subtraction.
HermesReturn HermesSetGateValues(Hermes_H Hermes, Int16 Shift, Int16 Length)
Change the fast Gate settings for counter 1.
HermesReturn HermesSetSyncInState(Hermes_H Hermes, State s, int frames)
Set the sync-in state.
HermesReturn HermesSetCameraPar(Hermes_H Hermes, UInt16 Exposure, UInt32 NFrames, UInt16 NIntegFrames, UInt16 NCounters, State Force8bit, State Half_array, State Signed_data)
Set the acquisition parameters for the camera.
HermesReturn HermesSetTriggerOutState(Hermes_H Hermes, TriggerMode Mode)
Select the output signal.
HermesReturn HermesSetBackgroundImg(Hermes_H Hermes, UInt16 *Img)
Load a background image to perform hardware background subtraction.
HermesReturn HermesSetAdvancedMode(Hermes_H Hermes, State s)
Change the operating mode.
HermesReturn HermesSetDeadTime(Hermes_H Hermes, UInt16 Val)
Update the dead-time setting.
HermesReturn HermesSetDeadTimeCorrection(Hermes_H Hermes, State s)
Enable or disable the dead-time correction.