Binary core API: Difference between revisions
No edit summary |
|||
Line 240: | Line 240: | ||
= API auxiliary functions = | = API auxiliary functions = | ||
This chapter describes auxiliary functions. There are need for normal using of the device, but it not measuring. | This chapter describes auxiliary functions. There are need for normal using of the device, but it not measuring or processing data. | ||
== Start-up and end == | == Start-up and end == | ||
Line 1,591: | Line 1,591: | ||
| Exa = | | Exa = | ||
}} | }} | ||
= API frame-based measuring functions = | |||
= API data-driven measuring functions = | |||
= API data processing functions = | |||
= The synchronizing = | |||
= Related = | = Related = | ||
[[Pixet_SDK|Pixet SDK]] | [[Pixet_SDK|Pixet SDK]] |
Revision as of 10:32, 28 June 2023
Core/basic binary (C/C++) API introduction
The PIXet is a multi-platform software developed in ADVACAM company. It is a basic software that allows measurement control and saving of measured data with Medipix detectors. It supports Medipix2, Medipix3, Timepix and Timepix3 detectors and all the readout-devices sold by ADVACAM company such as FitPIX, AdvaPIX, WidePIX, etc. It is written in C++ language and uses multi-platform Qt libraries.
This document describes a developer interface of the PIXet software. This developer interface consists of dynamic linked library pxcore.dll (Windows) or libpxcore.so (Mac or Linux), the corresponding header file for the library pxcapi.h and few other supporting libraries (fitpix.dll, Visual Studio runtime libraries, etc.)
The core API with the pxcore library, allowing basic measurements and device settings.
Files:
- pxcapi.h API header file
- pxcore.dll or pxcore.so binary libraries for Windows or Linux
- pxcore.lib static linging file for easier using on Windows (compile time only)
- common.h common file defining basic types, constatns and usefull macros. It's not necessary, but it can be useful.
And need some auxiliary files and directories:
Requirements
Hardware
This API requires computer with x86 compatible architecture (no ARM), 64bit Windows or Linux and connected some Advacam hardware with imaging chip. Medipix3, Timepix, Timepix2, Timepix3, etc. Some functions are universal for all hardwares (pxcInitialize, pxcGetDeviceName, etc), some is specialized for only one chip type (pxcMeasureSingleFrameTpx3 is Timepix3 only).
Specialized functions have names with chip type included:
- pxcSetTimepixCalibrationEnabled – Timepix only (no Timepix3)
- pxcMeasureTpx3DataDrivenMode – Timepix3 only
- pxcMeasureSingleFrameMpx3 – Medipix3 only
The attempt to use the function if compatible hardware (in initialized state) not present, end with error.
Return code is PXCERR_UNEXPECTED_ERROR.
Software
All the API functions have heads in pxcapi.h, implemented for Windows in the pxcore.dll and for linking must use the pxcore.lib in the linker settings. Implementation for Linux is in the libcore.so.
Compiled program need the pixet.ini file with proper hwlibs list inside, necessary hardware dll files (eq minipix.dll for Minipixes), optional special files (eq zestwpx.bit for Widepixes), subdirectory “factory” with default config files for all present imaging devices (eq MiniPIX-I08-W0060.xml) and the Pixet core will create subdirectory “configs” to save changed configs on exit.
See The Pixet core, additional libraries and other files
Usually, for build, just set the compiler to use 64bit and the linker to use the pxcore.lib file.
In Microsoft visual studio, while creating the C++ CLR project, it is also necessary to insert the use of WIN32 definition into the project settings (C/C++ / Preprocessor / Preprocessor definitions):
The Pixet core, additional libraries and other files
Main files:
- pxcapi.h API header file for importing to C/C++
- pxcore.dll or pxcore.so binary libraries for Windows or Linux
- pxcore.lib static linging file for easier using in C/C++ on Windows
And need some auxiliary files and directories:
Where to get these files?
- All need files except XML configs are located in the zip file with name like us: PIXet_SDK_1.8.0_(Build_22b1f335)_Win.zip
- Download: Advacam: Pixet Pro Software Updates
- And all files except LIB files for Windows compilation are located in the Pixet directory:
Example of the project directory
On the right is a screenshot of the Windows CLR APP project directory in Visual Studio that uses Minipix Tpx3. The marked files were copied from the Advacam SDK and the "factory" directory contains the configuration
XML file for the device. It is important that the name is complete, eg MiniPIX-I08-W0060.xml. This file will be used on first launch.
The directory "configs" is created when Pixet core is terminated and contains a configuration XML file with saved current settings. This file will be used on each subsequent startup and updated on each subsequent exit.
The "logs" directory is created when Pixet core is started for the first time and contains LOG files from device activity and backups of these files for the last 10 starts.
Contents of the pixet.ini file:
[hwlibs] minipix.dll
(x64, Myform... and TPx3-1... are from the MS Visual studio project)
Don't forget to set up WIN32 and pxcore.lib in the project settings as described in the parent chapter.
Tip: How to create the Windows CLR APP:
MSDN:create-c-windows-forms-application-in-visual-studio-2017
Example of the minimalistic program directory
Basic examples
Simple C commandline example and build
Example code
This is simple example of commandline C program, whitch initializes the Pixet core and device, sets it's operation mode, measures single frame, saves the frame to some files and deinitializes the Pixet core with all the connected devices.
(Timepix3 only)
#include "pxcapi.h"
int main() {
int rc; // return code
printf("Initializing...\n");
rc = pxcInitialize();
printf("pxcInitialize: %d (0 is OK)\n", rc);
rc = pxcSetTimepix3Mode(0, PXC_TPX3_OPM_TOATOT); // sets OPM of device with index 0
printf("pxcSetTimepix3Mode: %d (0 is OK)\n", rc);
// pxcMeasureMultipleFrames(deviceIndex, frameCount, acqTime, triggerSettings);
rc = pxcMeasureMultipleFrames(0, 3, 1, PXC_TRG_NO);
printf("pxcMeasureMultipleFrames: %d (0 is OK)\n", rc);
// pxcSaveMeasuredFrame(deviceIndex, frameLastIndex, filename);
rc = pxcSaveMeasuredFrame(0, 0, "testImg0.png");
printf("pxcSaveMeasuredFrame 0: %d (0 is OK)\n", rc);
rc = pxcSaveMeasuredFrame(0, 1, "testImg1.txt");
printf("pxcSaveMeasuredFrame 1: %d (0 is OK)\n", rc);
rc = pxcSaveMeasuredFrame(0, 2, "testImg2.pbf");
printf("pxcSaveMeasuredFrame 2: %d (0 is OK)\n", rc);
rc = pxcExit();
printf("pxcExit: %d (0 is OK)\n", rc);
}
Note: If You want test it in device other than Timepix3, You can comment lines with pxcSetTimepix3Mode. But then it is not clear what will be measured.
Building using cmake on Windows with Visual Studio installed
Example of CMakeLists.txt file for compiling this using cmake (C++ file is named "minipix1.cpp"):
cmake_minimum_required(VERSION 3.10)
project(minipix1)
# include_directories(${CMAKE_SOURCE_DIR})
# link_directories(${CMAKE_SOURCE_DIR})
add_library(pxcore SHARED IMPORTED)
set_property(TARGET pxcore PROPERTY IMPORTED_LOCATION "${CMAKE_SOURCE_DIR}/pxcore.dll")
set_property(TARGET pxcore PROPERTY IMPORTED_IMPLIB "${CMAKE_SOURCE_DIR}/pxcore.lib")
add_executable(minipix1 minipix1.cpp)
target_link_libraries(minipix1 pxcore)
Example of the Cmake building script:
rmdir /s /q build
mkdir build
cd build
cmake -DCMAKE_GENERATOR_PLATFORM=x64 ..
msbuild /P:Configuration=Release ALL_BUILD.vcxproj
cd ..
copy pxcore.dll build\Release\pxcore.dll
copy minipix.dll build\Release\minipix.dll
copy pixet.ini build\Release\pixet.ini
echo build\Release\minipix1.exe > run.cmd
User can finally run the run.cmd to run the program.
Building on Linux using GCC
Example build.sh:
#!/bin/bash
gcc -o build-out minipix1.cpp -Wno-write-strings -L. -lpxcore -lminipix -ldl -lm -lc -g
Example run.sh to run the output executable:
#!/bin/bash
LD_LIBRARY_PATH=. ./build-out
# run last compiled example
C# examples
Notes:
- Use the release/64 bit configuration
- The working directory is directory with the exe file. Typically project\bin\Release. Copy pixet.ini and other auxilliary files here.
- In the MS Visual studio 2019, project first not working. You must click Properties, change .NET version to old, save it, change .NET version back to actual and save. Now project can work.
Simple C# commandline example
using System;
using System.Runtime.InteropServices;
namespace ConsoleApp1 {
class Program {
[DllImport("pxcore.dll", CallingConvention = CallingConvention.Cdecl)]
public static extern int pxcInitialize(Int32 a, UInt64 b);
[DllImport("pxcore.dll", CallingConvention = CallingConvention.Cdecl)]
public static extern int pxcExit();
[DllImport("pxcore.dll", CallingConvention = CallingConvention.Cdecl)]
public static extern int pxcGetDevicesCount();
static void Main(string[] args) {
int rc;
Console.WriteLine("pxcInitialize ...");
rc = pxcInitialize(0, 0);
Console.WriteLine($"rc={rc:D}");
Console.WriteLine("pxcGetDevicesCount...");
rc = pxcGetDevicesCount();
Console.WriteLine("rc={0:D}\n", rc);
if (rc > 0) {
// do something now
} else {
Console.WriteLine("No devices detected\n");
}
Console.WriteLine("pxcExit...");
rc = pxcExit();
Console.WriteLine("rc={0:D}", rc);
Console.ReadKey();
}
}
}
Some more complex imports for inspiration:
[DllImport("pxcore.dll", CallingConvention = CallingConvention.Cdecl)]
public static extern int pxcGetDeviceChipID(UInt32 deviceIndex, UInt32 chipIndex, StringBuilder chipIDBuffer, UInt32 size);
[DllImport("pxcore.dll", CallingConvention = CallingConvention.Cdecl)]
public static extern int pxcGetDeviceDimensions(UInt32 deviceIndex, ref UInt32 width, ref UInt32 height);
[DllImport("pxcore.dll", CallingConvention = CallingConvention.Cdecl)]
public static extern int pxcMeasureSingleFrameTpx3(UInt32 deviceIndex, double frameTime, [Out] double[] frameToaITot, [Out] UInt16[] frameTotEvent, ref UInt32 size, UInt32 trgStg = 0);
C# Windows desktop example
API header definition
All API functions defined in the pxcapi.h file. Each definition starting with the PXCAPI keyword:
#ifndef WIN32 // Linux
#define PXCAPI extern "C" __attribute__ ((visibility("default")))
#else // Windows
#define PXCAPI extern "C" __declspec(dllexport)
#endif
API auxiliary functions
This chapter describes auxiliary functions. There are need for normal using of the device, but it not measuring or processing data.
Start-up and end
pxcInitialize
- This function initializes the Pixet software and all connected devices. This function has to be called first before any other function except pxcGetLastError.
- Definition
PXCAPI int pxcInitialize(int argc = 0, char const* argv[] = NULL);
Parameters
- argc – number of program command line arguments (optional parameter)
- argv – command line program arguments (optional parameter)
- Return value
- 0 if successful, otherwise the return value is a PXCERR_XXX code.
Note
- Can be imported with parameters int32,uint64 and called with 0,0. Usesfull in languages other than C/C++.
Example
int rc = pxcInitialize();
pxcExit
- This function deinitializes Pixet software and all the connected devices. This function has to be called as last function before unloading the pxcore library.
- Definition
PXCAPI int pxcExit();
Parameters
- (no pars)
- Return value
- 0 if successful, otherwise the return value is a PXCERR_XXX code.
Example
int rc = pxcExit();
pxcRefreshDevices
- This function looks for newly connected devices and removed disconnected devices from the device list.
- Definition
PXCAPI int pxcRefreshDevices();
Parameters
- (no pars)
- Return value
- 0 if successful, otherwise the return value is a PXCERR_XXX code.
Example
int rc = pxcRefreshDevices();
pxcReconnectDevice
- If the device was disconnected or experienced communication problems, this function will try to reconnect the device and reinitialize it. Like as do the pxcExit and pxcInitialize, but only for one device index. The process is:
- Saves the device config to the “configs” directory
- Disconnects the device
- Connects the device
- Loads the device config
- Definition
PXCAPI int pxcReconnectDevice(unsigned deviceIndex);
Parameters
- deviceIndex - index of the device, starting from zero
- Return value
- 0 if successful, otherwise the return value is a PXCERR_XXX code.
Example
int rc = pxcReconnectDevice(0); // reconnect device with index 0
Parameter Get/Set functions (direct)
Functions described in this chapter working directly, function name defines parameter name and type.
Example: Setting operation mode
// Set the operating mode
rc = pxcSetTimepix3Mode(deviceIndex, PXC_TPX3_OPM_TOATOT);
printErrors("pxcSetTimepix3Mode", rc);
Example: List of devices with parameters
#include <stdio.h>
#include "pxcapi.h"
#define CHT_Si 0
#define CHT_CdTe 1
char chipType = CHT_Unknown;
int main(int argc, char const* argv[]) { // #######################################
int rc = pxcInitialize();
if (rc) {
printf("Could not initialize Pixet:\n");
printErrors("pxcInitialize", rc, ENTER_ON);
return -1;
}
int connectedDevicesCount = pxcGetDevicesCount();
printf("Connected devices: %d\n", connectedDevicesCount);
if (connectedDevicesCount == 0) return pxcExit();
for (unsigned devIdx = 0; (signed)devIdx < connectedDevicesCount; devIdx++) {
char deviceName[256];
memset(deviceName, 0, 256);
pxcGetDeviceName(devIdx, deviceName, 256);
char chipID[256];
memset(chipID, 0, 256);
pxcGetDeviceChipID(devIdx, 0, chipID, 256);
printf("Device %d: Name %s, (first ChipID: %s)\n", devIdx, deviceName, chipID);
}
double bias;
rc = pxcGetBias(devIdx, &bias);
if (bias < 0.0) {
if (devIdx == 0) chipType = CHT_CdTe;
printf("Chip material detected: CdTe\n");
} else if (bias == 0.0) {
printf("Chip material not detected!\n");
} else {
if (devIdx == 0) chipType = CHT_Si;
printf("Chip material detected: Si\n");
}
printf("=================================================================\n");
// here can be working code (calling some example function from this manual)
return pxcExit();
}
pxcGetLastError
- Returns text of last error. This function can be called even before pxcInitialize()
- Definition
PXCAPI int pxcGetLastError(char* errorMsgBuffer, unsigned size);
Parameters
- errorMsgBuffer - buffer where text will be saved
- size - size of supplied buffer
- Return value
- 0 if successful, otherwise the return value is a PXCERR_XXX code.
Example
char msg[200];
pxcGetLastError(msg, 200);<br> printf("Error msg: %s\n", msg);
Example1 (console)
#define ERRMSG_BUFF_SIZE 512
#define ENTER_ON true
#define ENTER_OFF false
// (the function used in most examples in this manual)
void printErrors(const char* fName, int rc, bool enter) {
char errorMsg[ERRMSG_BUFF_SIZE];
pxcGetLastError(errorMsg, ERRMSG_BUFF_SIZE);
if (errorMsg[0]>0) {
printf("%s %d err: %s", fName, rc, errorMsg);
} else {
printf("%s %d err: ---", fName, rc);
}
if (enter) printf("\n");
}
Now you can use it:
rc = pxcSetTimepix3Mode(deviceIndex, PXC_TPX3_OPM_EVENT_ITOT);
printErrors("pxcSetTimepix3Mode", rc, ENTER_ON);
If mode set was suscessfull, result is:
- pxcSetTimepix3Mode 0 err: ---
If not, you can see some as:
- pxcSetTimepix3Mode -2 err: Invalid device index
Example2 (Windows CLR)
const unsigned cErrBufSize = 512;
// primary use to show function name, return code, last error message
bool errorToList(const char* fName, int rc) {
char errorMsg[cErrBufSize];
char cMsg[cErrBufSize];
String^ eMsg;
pxcGetLastError(errorMsg, cErrBufSize);
if (rc!=0) {
sprintf(cMsg, "%s %d err: %s", fName, rc, errorMsg);
eMsg = gcnew String(errorMsg);
} else {
sprintf(cMsg, "%s %d err: ---", fName, rc);
};
String^ sMsg = gcnew String(cMsg);
listMessages->Items->Add(sMsg);
return (rc!=0);
}
Now you can use it:
rc = pxcSetTimepix3Mode(deviceIndex, PXC_TPX3_OPM_EVENT_ITOT);
if (errorToList("pxcSetTimepix3Mode", rc)) return rc;
pxcGetDevicesCount
- This function returns number of connected and initialized devices.
- Definition
PXCAPI int pxcGetDevicesCount();
Parameters
- (no pars)
- Return value
- Number of devices, otherwise the return value is a PXCERR_XXX code
Example
printf("Connected devices count: %d\n", pxcGetDevicesCount());
pxcListNetworkDevices
- Search for available network devices and store basic information about it to arrary.
- Definition
PXCAPI int pxcListNetworkDevices(NetworkDevInfo* devInfos, unsigned* size);
Parameters
- devInfos - Pointer to array of NetworkDevInfo{char ip[15]; char name[20]; int serial;} structures
- size - [in] Pointer to size of the devInfo (number of elements) / [out] Value overwritten by the number of devices found
- Return value
- Returns 0 if OK or PXCERR_BUFFER_SMALL if the number of devices exceeded the size of the array (the array is still filled and *size is set)
Example
NetworkDevInfo ndi[10];
unsigned size = 10;
int rc = pxcListNetworkDevices(ndi, &size);
printf("Network dev list:\n");
for (int i=0; (rc==0 && i<size) || (rc<0 && i<10); i++) printf(" IP: %s, Name: %s, Serial: %d\n", ndi[i].ip, ndi[i].name, ndi[i].serial);
printf("Devices found: %d\n", *size);
if (rc<0) printf("Warning: Number of devs exceeded the array size\n");
pxcGetDeviceName
- This function returns the full name of the selected device.
- Definition
PXCAPI int pxcGetDeviceName((unsigned deviceIndex, char* nameBuffer, unsigned size);
Parameters
- deviceIndex - index of the device, starting from zero
- nameBuffer - buffer where the name of the device will be saved. Cannot be NULL
- size - size of the supplied name buffer
- Return value
- 0 if successful, otherwise the return value is a PXCERR_XXX code.
Example
char name[100];
pxcGetDeviceName(deviceIndex, name, 100);
printf("Dev %d name: %s\n", deviceIndex, msg);
pxcGetDeviceChipCount
- This function returns number of chips in the device.
- Definition
PXCAPI int pxcGetDeviceChipCount(unsigned deviceIndex);
Parameters
- deviceIndex - index of the device, starting from zero
- {{{8}}}
- Return value
- Number of chips if successful, otherwise the return value is a PXCERR_XXX code.
Example
printf("Dev %d has chip count: %d\n", deviceIndex, pxcGetDeviceChipCount(deviceIndex));
pxcGetDeviceChipID
- This function returns the ID of chip of the detector connected to the readout device.
- Definition
PXCAPI int pxcGetDeviceChipID((unsigned deviceIndex, unsigned chipIndex, char* chipIDBuffer, unsigned size);
Parameters
- deviceIndex - index of the device, starting from zero
- chipIndex – index of the chip in the device, starting from zero
- chipIDBuffer - buffer where the chipID of the detector will be saved. Cannot be NULL
- size - size of the supplied chipID buffer
- Return value
- 0 if successful, otherwise the return value is a PXCERR_XXX code.
Note
- {{{Not}}}
Warning
- {{{War}}}
Example
char id[50];
int rc = pxcGetDeviceChipID(deviceIndex, 0, id, 50);
if (rc==0) printf("Chip 0 of dev %d have ID: %s\n", deviceIndex, msg);
else printf("pxcGetDeviceChipID failed, code: %d\n", rc);
pxcGetDeviceSerial
- This function returns the devise serial number.
- Definition
PXCAPI int pxcGetDeviceSerial(unsigned deviceIndex);
Parameters
- deviceIndex - index of the device, starting from zero
- Return value
- Serial number (>0) if successful, otherwise the return value is a PXCERR_XXX code.
Example
printf("Dev %d has serial number: %d\n", deviceIndex, pxcGetDeviceSerial(deviceIndex));
pxcGetDeviceDimmensions
- This function gets pixel width and height of the device.
- Definition
PXCAPI int pxcGetDeviceDimmensions(unsigned deviceIndex, unsigned *w, unsigned *h);
Parameters
- deviceIndex - index of the device, starting from zero
- w – pointer to unsigned variable where the width of the device will be returned
- h – pointer to unsigned variable where the height of the device will be returned
- Return value
- 0 if successful, otherwise the return value is a PXCERR_XXX code.
Example
unsigned w, h;
int rc = pxcGetDeviceDimmensions(deviceIndex, &w, &h);
if (rc==0) printf("Width: %d, Height %d [px]\n", w, h);
else printf("pxcGetDeviceDimmensions failed, code %d\n", rc);
pxcGetBias
- This function gets the bias voltage (high voltage) of the sensor chip.
- Definition
PXCAPI int pxcGetBias(unsigned deviceIndex, double* bias);
Parameters
- deviceIndex – index of the device, starting from zero
- bias – pointer to double variable where current bias will be returned
- Return value
- 0 if successful, otherwise the return value is a PXCERR_XXX code.
Example
double bias;
int rc = pxcGetBias(deviceIndex, &bias);
if (rc==0) printf("Bias: %f V\n", bias);
else printf("pxcGetBias failed, code %d\n", rc);
pxcGetBiasRange
- This function gets the range of the allowed minimal and maximal bias values.
- Definition
PXCAPI int pxcGetBiasRange(unsigned deviceIndex, double* minBias, double* maxBias);
Parameters
- deviceIndex - index of the device, starting from zero
- minBias – pointer to double variable where minimum allowed bias will be returned
- maxBias – pointer to double variable where maximum allowed bias will be returned
- Return value
- 0 if successful, otherwise the return value is a PXCERR_XXX code.
Example
double min, max;
int rc = pxcGetBiasRange(deviceIndex, &min, &max);
if (rc==0) printf("Bias min: %f, max: %f V\n", min, max);
else printf("pxcGetBiasRange failed, code %d\n", rc);
pxcSetBias
- This function sets the high voltage (bias) of the detector.
- Definition
PXCAPI int pxcSetBias(unsigned deviceIndex, double bias);
Parameters
- deviceIndex - index of the device, starting from zero
- bias – high voltage in volts (limits and polarity depending on the device configuration, see: pxcGetBiasRange)
- Return value
- 0 if successful, otherwise the return value is a PXCERR_XXX code.
Example
int rc = pxcSetBias(0, -350); // set bias -350 V to device with idx 0
pxcGetThreshold
- This function gets the threshold of the detector. Output value is normally in keV, but if the device not properly configurated, output is didital DAC value.
- Definition
PXCAPI int pxcGetThreshold(unsigned deviceIndex, unsigned thresholdIndex, double* threshold);
Parameters
- deviceIndex - index of the device, starting from zero
- thresholdIndex – for all except Medipix3 always 0, for Medipix3 index of corresponding threshold starting from zero
- threshold – pointer to double variable where threshold will be saved. The value is several keVs with decimals or from 0 to a some power of two (depending of device DAC bits depth).
- Return value
- 0 if successful, otherwise the return value is a PXCERR_XXX code.
Example
double thl;
int rc = pxcGetThreshold(deviceIndex, &thl);
if (rc==0) printf("Threshold: %f\n", thl);
else printf("pxcGetThreshold failed, code %d\n", rc);
pxcGetThresholdRange
- This function gets the allowed range of values for threshold. Output values are normally in keV, but if the device not properly configurated, output is didital DAC value.
- Definition
PXCAPI int pxcGetThresholdRange(unsigned deviceIndex, int thresholdIndex, double* minThreshold, double* maxThreshold);
Parameters
- deviceIndex - index of the device, starting from zero
- thresholdIndex – for Timepix and Timepix3 always 0, for Medipix3 index of corresponding threshold starting from zero
- minThreshold – pointer to double variable where the minimal allowed threshold will be returned
- maxThreshold – pointer to double variable where the maximal allowed threshold will be returned
- Return value
- 0 if successful, otherwise the return value is a PXCERR_XXX code.
Example
double min, max;
int rc = pxcGetThresholdRange(deviceIndex, &min, &max);
if (rc==0) printf("Threshold range - min: %f, max: %f\n", min, max);
else printf("pxcGetThresholdRange failed, code %d\n", rc);
pxcSetThreshold
- This function sets the threshold of the detector in KeV.
- Definition
PXCAPI int pxcSetThreshold(unsigned deviceIndex, unsigned thresholdIndex, double threshold);
Parameters
- deviceIndex - index of the device, starting from zero
- thresholdIndex - for Timepix and Timepix3 always 0, for Medipix3 index of corresponding threshold starting from zero
- threshold – detector threshold in keV.
- Return value
- 0 if successful, otherwise the return value is a PXCERR_XXX code.
Warning
- Too low thl value cause many noising pixels with all related problems.
Example
int rc = pxcSetThreshold(1, 0, 4.5); // set threshold with idx 0 on device with idx 1 to the 4.5 keV.
pxcGetDAC
- This function gets a single DAC value of the detector.
- Definition
PXCAPI int pxcGetDAC(unsigned deviceIndex, unsigned chipIndex, unsigned dacIndex, unsigned short* value);
Parameters
- deviceIndex – index of the device, starting from zero
- chipIndex – index of the chip, starting from zero
- dacIndex – index of the DAC, starting from zero
- value – pointer to output value be stored
- Return value
- 0 if successful, otherwise the return value is a PXCERR_XXX code.
Example
unsigned short val;
int rc = pxcGetDAC(deviceIndex, chipIndex, dacIndex, &val);
if (rc==0) printf("Input value of DAC with idx %d, on chip with idx %d, of device with idx %d is: %d\n", deviceIndex, chipIndex, dacIndex, val);
else printf("pxcGetDAC failed, code %d\n", rc);
pxcSetDAC
- This function sets a single DAC value of the detector.
- Definition
PXCAPI int pxcSetDAC(unsigned deviceIndex, unsigned chipIndex, unsigned dacIndex, unsigned short value);
Parameters
- deviceIndex – index of the device, starting from zero
- chipIndex – index of the chip, starting from zero
- dacIndex – index of the DAC, starting from zero
- value – new DAC value
- Return value
- 0 if successful, otherwise the return value is a PXCERR_XXX code.
Example
int rc = pxcSetDAC(0, 1, 2, 123); // set DAC with idx 3 on chip with idx 2 on device with idx 1 to the 123.
pxcGetTimepixClock
- This function gets the current value of measurement clock for Timepix detector (in MHz).
- Definition
PXCAPI int pxcGetTimepixClock(unsigned deviceIndex, double* clock);
Parameters
- deviceIndex – index of the device, starting from zero
- clock – pointer to double variable where the clock will be saved
- {{{8}}}
- Return value
- 0 if successful, otherwise the return value is a PXCERR_XXX code.
Example
double val;
int rc = pxcGetTimepixClock(deviceIndex, &val);
if (rc==0) printf("Timepix clock: %f MHz\n", val);
else printf("pxcGetTimepixClock failed, code %d\n", rc);
pxcSetTimepixClock
- This function sets the value of measurement clock for Timepix detector (in MHz). Not all values are possible, the result will be the closest possible frequency.
- Definition
PXCAPI int pxcSetTimepixClock(unsigned deviceIndex, double clock);
Parameters
- deviceIndex – index of the device, starting from zero
- clock – desired value of the measurement clock for Timepix detector
- Return value
- 0 if successful, otherwise the return value is a PXCERR_XXX code.
Note
- Only for the Timepix devices, not usable on Timepix3 and other TimepixN. Timepix3 has a fixed clock of 40 MHz. Timepix2 has other clocks managenment.
Example
int rc = pxcSetTimepixClock(deviceIndex, 25.0);
pxcGetTimepixMode
- This function gets the current value of the Timepix mode (Counting, Energy,…)
- Definition
PXCAPI int pxcGetTimepixMode(unsigned deviceIndex);
Parameters
- deviceIndex – index of the device, starting from zero
- {{{8}}}
- Return value
- Timepix mode if successful, otherwise the return value is a PXCERR_XXX code.
- Timepix mode can be:
- PXC_TPX_MODE_MEDIPIX – counting mode
- PXC_TPX_MODE_TOT – energy mode
- PXC_TPX_MODE_TIMEPIX – timepix mode if successful.
- Otherwise the return value is a PXCERR_XXX code.
Example
int rc = pxcGetTimepixMode(deviceIndex);
if (rc>=0) printf("Mode of dev. idx %d is: %d\n", rc);
else printf("pxcGetTimepixMode failed, code %d\n", rc);
pxcSetTimepixMode
- This function sets the value of Timepix mode.
- Definition
PXCAPI int pxcSetTimepixMode(unsigned deviceIndex, int mode);
Parameters
- deviceIndex – index of the device, starting from zero
- mode – new value of the Timepix mode. One of the values:
- PXC_TPX_MODE_MEDIPIX – counting mode
- PXC_TPX_MODE_TOT – energy mode
- PXC_TPX_MODE_TIMEPIX – timepix mode
- Return value
- 0 if successful, otherwise the return value is a PXCERR_XXX code.
Note
- Only for the Timepix devices, not usable on Timepix3 and other TimepixN.
Example
int rc = pxcSetTimepixMode(0, PXC_TPX_MODE_MEDIPIX); // set dev 0 to mode counting alias MEDIPIX
pxcSetTimepixCalibrationEnabled
- This function enables or disables the calibration of Timepix ToT counts to energy in keV
- Definition
PXCAPI int pxcSetTimepixCalibrationEnabled(unsigned deviceIndex, bool enabled);
Parameters
- deviceIndex – index of the device, starting from zero
- enabled – if the calibration is enabled or disable
- Return value
- 0 if successful, otherwise the return value is a PXCERR_XXX code.
Note
- Only for the Timepix devices, not usable on Timepix3 and other TimepixN.
Example
int rc = pxcSetTimepixCalibrationEnabled(0, true); // enable ToT calibration to keVs on device with idx 0
pxcIsTimepixCalibrationEnabled
- This function returns if the calibration of Timepix ToT counts to energy in keV is enabled.
- Definition
PXCAPI int pxcIsTimepixCalibrationEnabled(unsigned deviceIndex);
Parameters
- deviceIndex – index of the device, starting from zero
- Return value
- 0 if disabled, greater than 0 enabled, negative value a PXCERR_XXX code
Note
- Only for the Timepix devices, not usable on Timepix3 and other TimepixN.
Example
int rc = pxcIsTimepixCalibrationEnabled(0);
if (rc>=0) printf("Calibration of dev0 is %s\n", (rc==0) ? "disabled" : "enabled");
else printf("pxcIsTimepixCalibrationEnabled failed, code %d\n", rc);
pxcGetTimepix2Clock
- This function gets the current clocks settings in the Timepix2 detector.
- Definition
PXCAPI int pxcGetTimepix2Clock(unsigned deviceIndex, double* totClock, double* toaClock, unsigned* divider);
Parameters
- deviceIndex – index of the device, starting from zero
- totClock – pointer to double variable where the ToT clock (in MHz) will be saved
- toaClock – pointer to double variable where the ToA clock (in MHz) will be saved
- divider – pointer to unsigned int variable where the divider value will be saved
- Return value
- 0 if successful, otherwise the return value is a PXCERR_XXX code.
Note
- Only for the Timepix2 devices, not usable on Timepix3 and other Timepix. Timepix3 have a fixed
clock of 40 MHz.
pxcSetTimepix2Clock
- This function sets Timepix2 detector clocks settings.
- Definition
PXCAPI int pxcSetTimepix2Clock(unsigned deviceIndex, double clock, unsigned divider);
Parameters
- deviceIndex – index of the device, starting from zero
- clock – desired new value of the ToT clock (in MHz) for the Timepix2 detector. The real frequency will be nearest possible division by 2’s power from the 50 MHz. Min is 1.5625 MHz.
- divider – value of the ToA divider index.
- Values means 0: disable, 1: no division, 2-30: div. by 2n-1.
- The ToA clock will be divided from the ToT clock.
- Return value
- 0 if successful, otherwise the return value is a PXCERR_XXX code.
Note
- Only for the Timepix2 devices, not usable on Timepix3 and other Timepix. Timepix3 have a fixed clock of 40 MHz.
Warning
- The factory energy calibration is only for the 50 MHz ToA clock.
pxcSetTimepix2Mode
- This function sets the value of Timepix2 mode
- Definition
PXCAPI int pxcSetTimepix2Mode(unsigned deviceIndex, int mode);
Parameters
- deviceIndex – index of the device, starting from zero
- mode – new value of the Timepix2 mode. One of the values:
- PXC_TPX2_OPM_TOT10_TOA18
- PXC_TPX2_OPM_TOT14_TOA14
- PXC_TPX2_OPM_CONT_TOT10_CNT4
- PXC_TPX2_OPM_CONT_TOT14
- PXC_TPX2_OPM_CONT_TOA10
- PXC_TPX2_OPM_CONT_TOA14
- PXC_TPX2_OPM_CONT_CNT10
- PXC_TPX2_OPM_CONT_CNT14
- PXC_TPX2_OPM_ITOT10_TOA18
- PXC_TPX2_OPM_ITOT14_TOA14
- PXC_TPX2_OPM_CONT_ITOT10_CNT4
- PXC_TPX2_OPM_CONT_ITOT14
- Modes desctiption
- TOT – time of threshold in ToT ticks, or energy if calibrated
- TOA – time of arrival in ToA ticks
- CNT – count of hits
- ITOT – integrated time of threshold in the pixel, or estimate energy if calibrated
- CONT – continual mode: One counter set counting while reading data from other counter set
- Return value
- 0 if successful, otherwise the return value is a PXCERR_XXX code.
Note
- Only for the Timepix2 devices, not usable on Timepix3 and other Timepix.
pxcSetTimepix2AdaptiveGainMode
- This function sets the value of Timepix2 mode.
- Definition
PXCAPI int pxcSetTimepix2AdaptiveGainMode(unsigned deviceIndex, bool adaptiveGainOn);
Parameters
- deviceIndex – index of the device, starting from zero
- adaptiveGainOn – enable the adaptive gain feature
- Return value
- 0 if successful, otherwise the return value is a PXCERR_XXX code.
Note
- Only for the Timepix2 devices, not usable on Timepix3 and other Timepix.
pxcSetTimepix2AnalogueMaskingMode
- This function sets the value of Timepix2 mode
- Definition
PXCAPI int pxcSetTimepix2AnalogueMaskingMode(unsigned deviceIndex, bool analogMaskOn);
Parameters
- deviceIndex – index of the device, starting from zero
- analogMaskOn – enable the analogue masking feature
- Return value
- 0 if successful, otherwise the return value is a PXCERR_XXX code.
Note
- Only for the Timepix2 devices, not usable on Timepix3 and other Timepix.
pxcSetTimepix2CalibrationEnabled
- This function enables or disables the calibration of Timepix ToT counts to energy in keV
- Definition
PXCAPI int pxcSetTimepix2CalibrationEnabled(unsigned deviceIndex, bool enabled);
Parameters
- deviceIndex – index of the device, starting from zero
- enabled – if the calibration is enabled or disable
- Return value
- 0 if successful, otherwise the return value is a PXCERR_XXX code.
Note
- ou need different acquisition or frame reading functions if calibration is on or off.
- Only for the Timepix2 devices, not usable on Timepix3 and other Timepix.
pxcIsTimepix2CalibrationEnabled
- This function returns if the calibration of Timepix ToT counts to energy in keV is enabled
- Definition
PXCAPI int pxcIsTimepix2CalibrationEnabled(unsigned deviceIndex);
Parameters
- deviceIndex – index of the device, starting from zero
- Return value
- 0 if successful, otherwise the return value is a PXCERR_XXX code.
Note
- You need different acquisition or frame reading functions if calibration is on or off.
- Only for the Timepix2 devices, not usable on Timepix3 and other Timepix.
pxcSetTimepix3Mode
- Sets the operation mode of Timepix3 detector
- Definition
PXCAPI int pxcSetTimepix3Mode(unsigned deviceIndex, int mode);
Parameters
- deviceIndex – index of the device, starting from zero
- mode – mode of the detector PXC_TPX3_OPM_XXX values
- Return value
- 0 if successful, otherwise the return value is a PXCERR_XXX code.
Note
- Only for the Timepix3 devices, not usable on other Timepixes or Medipixes.
pxcSetMedipix3OperationMode
- Sets the operation mode of Medipix3 detector
- Definition
PXCAPI int pxcSetMedipix3OperationMode(unsigned deviceIndex, int opMode);
Parameters
- deviceIndex – index of the device, starting from zero
- opMode – mode of the detector PXC_MPX3_OPM_XXX values
- Return value
- 0 if successful, otherwise the return value is a PXCERR_XXX code.
Note
- Only for the Medipix3 devices, not usable on Timepixes or other Medipixes.
pxcSetMedipix3GainMode
- Sets the gain mode of Medipix3 detector
- Definition
PXCAPI int pxcSetMedipix3GainMode(unsigned deviceIndex, int gain);
Parameters
- deviceIndex – index of the device, starting from zero
- gain – mode of the detector PXC_MPX3_GAIN_MOD_XXX values
- Return value
- 0 if successful, otherwise the return value is a PXCERR_XXX code.
Note
- Only for the Medipix3 devices, not usable on Timepixes or other Medipixes.
pxcSetMedipix3AcqParams
- Sets acquisition parameters for Medipix3
- Definition
PXCAPI int pxcSetMedipix3AcqParams(unsigned deviceIndex, bool colorMode, bool csm, int gain, bool equalize);
Parameters
- deviceIndex – index of the device, starting from zero
- colorMode – if color mode is enabled
- csm – if charge sharing mode is enabled
- gain – gain settings (PXC_MPX3_GAIN_XXX values)
- equalize – if equalization bit in Medipix3 is enabled
- Return value
- 0 if successful, otherwise the return value is a PXCERR_XXX code.
Note
- Only for the Medipix3 devices, not usable on Timepixes or other Medipixes.
pxcSetMedipix3MatrixParams
- Sets parameters of the Meidpix3 pixel matrix
- Definition
PXCAPI int pxcSetMedipix3MatrixParams(unsigned deviceIndex, int depth, int counter, int colBlock, int rowBlock);
Parameters
- deviceIndex – index of the device, starting from zero
- depth – depth of the counters PXC_MPX3_CNTD_XXX values
- counter – selected counter (PXC_MPX3_CNT_XXX values)
- colBlock – region of interest readout (PXC_MPX3_COLB_XXX values)
- rowBlock – region of interest readout (PXC_MPX3_ROWB_XXX values)
- Return value
- 0 if successful, otherwise the return value is a PXCERR_XXX code.
Note
- Only for the Medipix3 devices, not usable on Timepix or other Medipixes.
pxcSetPixelMatrix
- Sets the pixel matrix configuration. This is low level function for advanced users.
- Definition
PXCAPI int pxcSetPixelMatrix(unsigned deviceIndex, unsigned char* maskMatrix, unsigned size);
Parameters
- deviceIndex – index of the device, starting from zero
- size – size of the mask matrix
- {{{7}}}
- {{{8}}}
- Return value
- 0 if successful, otherwise the return value is a PXCERR_XXX code.
pxcGetPixelMatrix
- Gets the pixel matrix configuration. This is low level function for advanced users.
- Definition
PXCAPI int pxcGetPixelMatrix(unsigned deviceIndex, unsigned char* maskMatrix, unsigned byteSize);
Parameters
- deviceIndex – index of the device, starting from zero
- size – size of the mask matrix
- {{{7}}}
- {{{8}}}
- Return value
- 0 if successful, otherwise the return value is a PXCERR_XXX code.
Metadata
Various devices, readout chips, detector chips and measurement methods have various metadata. To obtain informations about all relevant metadata for your purphose, set-up and run the testmeasurement with file-saving (using test code or Pixet program). Now you can read the accompanying DSC/INFO files, that contains all metadata for this combination of device/detector/measurement.
- Example DSC records
- "Chips layout" ("Order of chips in matrix"):
- i32[5]
- 4 3 0 1 2
- "Start time" ("Acquisition start time"):
- double[1]
- 1659611081.595321
- "Start time (string)" ("Acquisition start time (string)"):
- char[64]
- Thu Aug 4 13:04:41.595321 2022
pxcGetMetaDataValue
- This function gets measured data meta data value. Output value is converted to char*.
- Definition
PXCAPI int pxcGetMetaDataValue(unsigned deviceIndex, unsigned dataIndex, const char* metaDataName, char* valueBuffer, unsigned* size);
Parameters
- deviceIndex – index of the device, starting from zero
- dataIndex - index of the measured data (frame), starting from zero
- metaDataName – name of the metadata to get, "Start time" for example
- valueBuffer – buffer where the value of the meta data as string will be stored
- size – pointer to size of the supplied buffer
- Return value
- 0 if successful, otherwise the return value is a PXCERR_XXX code.
Example
char mdb[200]; // metadata buffer
unsigned mdbs = 200; // metadata buffer size
char mdn[] = "Start time"; // metadata name
int rc = pxcGetMetaDataValue(deviceIndex, frameLastIndex, mdn, mdb, &mdbs);
if (rc != 0) errorToList("pxcGetMetaDataValue", rc);
else msgToList("Acquisition start time: " + gcnew String(mdb));
Parameter Get/Set functions (using text paramName)
In this chapter are a functions that working with named parameters. Alias readout parameters: Because originally it was only about the parameters of the readout chips. Later, the setting of other device and software parameters was also added.
Example:
// Data Driven Block Size [B], default 66000
rc = pxcSetDeviceParameter(deviceIndex, "DDBlockSize", 6000);
printf("pxcSetDeviceParameter %d", rc);
Warning: Most parameters are for testing purposes only and you will not need them in normal use.
pxcGetDeviceParameter
- Returns the value of integer device parameter (e.g. settings of trigger)
- Definition
PXCAPI int pxcGetDeviceParameter(unsigned deviceIndex, const char* parameterName);
Parameters
- deviceIndex – index of the device, starting from zero
- parameterName – name of the device parameter
- Return value
- 0 if successful, otherwise the return value is a PXCERR_XXX code.
pxcSetDeviceParameter
- Sets a value of the integer device parameter (e.g. settings of trigger)
- Definition
PXCAPI int pxcSetDeviceParameter(unsigned deviceIndex, const char* parameterName, int parameterValue);
Parameters
- deviceIndex – index of the device, starting from zero
- parameterName – name of the device parameter
- parameterValue – new value of the parameter
- Return value
- 0 if successful, otherwise the return value is a PXCERR_XXX code.
pxcGetDeviceParameterDouble
- Returns the value of device double parameter
- Definition
PXCAPI int pxcGetDeviceParameterDouble(unsigned deviceIndex, const char* parameterName, double* parameterValue);
Parameters
- deviceIndex – index of the device, starting from zero
- parameterName – name of the device parameter
- parameterValue – pointer to double variable where the parameter value will be saved
- Return value
- 0 if successful, otherwise the return value is a PXCERR_XXX code.
pxcSetDeviceParameterDouble
- Sets a value of the device double parameter
- Definition
PXCAPI int pxcSetDeviceParameterDouble(unsigned deviceIndex, const char* parameterName, double parameterValue);
Parameters
- deviceIndex – index of the device, starting from zero
- parameterName – name of the device parameter
- parameterValue – new value of the parameter
- Return value
- 0 if successful, otherwise the return value is a PXCERR_XXX code.
pxcGetDeviceParameterString
- Returns the value of device string parameter
- Definition
PXCAPI int pxcGetDeviceParameterString(unsigned deviceIndex, const char* parameterName, const char* parameterValue, unsigned size);
Parameters
- deviceIndex – index of the device, starting from zero
- parameterName – name of the device parameter
- parameterValue – pointer to string buffer where the parameter value will be saved
- size – size of the passed buffer
- Return value
- 0 if successful, otherwise the return value is a PXCERR_XXX code.
pxcSetDeviceParameterString
- Sets a value of the device string parameter
- Definition
PXCAPI int pxcSetDeviceParameterString(unsigned deviceIndex, const char* parameterName, const char* parameterValue);
Parameters
- deviceIndex – index of the device, starting from zero
- parameterName – name of the device parameter
- parameterValue – new value of the parameter
- Return value
- 0 if successful, otherwise the return value is a PXCERR_XXX code.
Tpx3 parameter names list
Warning: Most parameters are for testing purposes only and you will not need them in normal use.
#define PAR_LIBVER "HwLibVer"
#define PAR_DEBUGLOG "DebugLog"
#define PAR_DUMMYACQ "DummyAcqNegativePolarity"
#define PAR_TEMP "Temperature"
#define PAR_TEMP_CHIP "TemperatureChip"
#define PAR_TEMP_CPU "TemperatureCpu" // mimipix/tpx3 only
#define PAR_TEMP_CHIP_CPU "TemperatureChipCpu" // mimipix/tpx3 only
#define PAR_TEMP_READ_ACQSERIE "TemperatureReadBeforeAcqSerie" // mimipix/tpx3 only
#define PAR_TEMP_READ_EVERYACQ "TemperatureReadBeforeEachAcq" // mimipix/tpx3 only
#define PAR_TEMP_CHECK_IN_SW "CheckMaxTempInSW" // mimipix/tpx3 only
#define PAR_TEMP_CHECK_IN_CPU "CheckMaxChipTempInCPU" // mimipix/tpx3 only
#define PAR_TEMP_MAX_ALLOWED_TEMP "MaxAllowedChipTemp" // mimipix/tpx3 only
#define PAR_DAC_BANGAP "DacBandGap"
#define PAR_DAC_TEMP "DacTemp"
#define PAR_BIAS_SENSE_VOLT "BiasSenseVoltage"
#define PAR_BIAS_SENSE_CURR "BiasSenseCurrent"
#define PAR_DD_BUFF_SIZE "DDBuffSize"
#define PAR_DD_BLOCK_SIZE "DDBlockSize"
#define META_SHUTTER_TIME "Shutter open time" // mimipix/tpx3 only
#define PAR_CHAN_MASK "ChanMask" // no net/tpx3
#define PAR_READOUT_CLOCK "ReadoutClock" // no net/tpx3
#define PAR_TRG_STG "TrgStg"
#define PAR_TRG_TIMESTAMP "TrgTimestamp"
#define PAR_TRG_T0SYNC_RESET "TrgT0SyncReset"
#define PAR_TRG_READY "TrgReady" // no net/tpx3
#define PAR_TRG_OUTLEVEL "TrgOutLevel" // mimipix/tpx3 only
#define PAR_TRG_OUT_ENABLE "TrgOutEnable" // mimipix/tpx3 only
#define PAR_TRG_IS_MASTER "IsMaster"
#define PAR_MOTOHOURS "Motohours" // mimipix/tpx3 only
#define PAR_MTX "MTX" // mimipix/tpx3 only
#define PAR_SEND_TOA_PIXELS "SendDummyToaPixels" // mimipix/tpx3 only
#define PAR_DUMMYSPEED "DDDummyDataSpeed" // no mimipix/tpx3
#define PAR_BLOCKCOUNT "BlockCount" // no mimipix/tpx3
#define PAR_PROCESSDATA "ProcessData" // no mimipix/tpx3
#define PAR_TRG_MULTI "TrgMulti" // no mimipix/tpx3
#define PAR_ADVAPIX_ADC "AdvaPixADC" // no mimipix/tpx3
#define PAR_TRG_READY "TrgReady" // zem only
#define PAR_TRG_CMOS "TrgCmos" // zem only
#define PAR_READOUT_CLOCK "ReadoutClock" // zem only
Tpx2 parameter names list
Warning: Most parameters are for testing purposes only and you will not need them in normal use.
const static char* PAR_LIBVER = "HwLibVer";
const static char* PAR_DEBUGLOG = "DebugLog";
const static char* PAR_BIAS_SENSE_VOLT = "BiasSenseVoltage";
const static char* PAR_BIAS_SENSE_CURR = "BiasSenseCurrent";
const static char* PAR_READOUT_CLOCK = "ReadoutClock";
const static char* PAR_TRG_STG = "TrgStg";
const static char* PAR_TRG_IS_MASTER = "IsMaster";
const static char* PAR_MOTOHOURS = "Motohours";
const static char* PAR_TEMP_CPU = "TemperatureCpu";
const static char* PAR_TEMP_MAX_ALLOWED_TEMP = "MaxAllowedChipTemp";
const static char* PAR_POWER_VOLT = "PowerSupplyVoltage";
const static char* PAR_CPU_SUPPLY_VOLT = "CPUSupplyVoltage";
const static char* PAR_CHIP_LDO_VOLT = "ChipLDOVoltage";
const static char* PAR_INPUT_CURRENT = "DeviceInputCurrent";
const static char* PAR_CHIP_CURRENT = "ChipCurrent";
Mpx2 (Timepix) parameter names list
Warning: Most parameters are for testing purposes only and you will not need them in normal use.
#define PAR_LIBVER "HwLibVer" // all, include minipixes
#define PAR_DEBUGLOG "DebugLog" // all, include minipixes
#define CFG_BINPIXCFG "BinaryPixelCfg" // fei-minipix only
#define PAR_FIRMWARE "Firmware" //widepix only
#define PAR_PS_COUNT "PreShutterClockCount"
#define PAR_PS_DIVIDER "PreShutterClockDivider"
#define PAR_PS_DELAY "PreShutterDelayClockCount"
#define PAR_TEMP "Temperature" // no zem
#define PAR_BIASINCPU "BiasInCpu" // widepix only
#define PAR_TRG_STG "TriggerStg"
#define PAR_TRG_WAITREADY "TriggerWaitForReady"
#define PAR_TRG_MASTER "TriggerMaster"
#define PAR_TRG_OUTLEVEL "TriggerOutLevel"
#define PAR_TRG_ALTERNATIVE "TriggerAlternative" // fitpix only
#define PAR_TRG_TWODEVS "TriggerTwoDevs" // fitpix only
#define PAR_BURST_DISABLE "BurstDisable" // fitpix only
#define PAR_CPU_BIAS_SET "*BiasSet" // widepix only
#define PAR_CPU_BIAS_VOLTSENSE "BiasVolt" // widepix only
#define PAR_CPU_BIAS_CURRSENSE "BiasCurr" // widepix only
#define PAR_CPU_TEMP_DET "TempDet" // widepix only
#define PAR_FASTACQ "FastAcq" // zem only
#define PAR_BURST_FRAME_COUNT "BurstFrameCount" // zem only
#define PAR_PIXEL_BUFFSIZE "PixelBuffSize" // zem only
Mpx3 parameter names list
Warning: Most parameters are for testing purposes only and you will not need them in normal use.
#define PAR_LIBVER "HwLibVer"
#define PAR_DEBUGLOG "DebugLog"
#define PAR_TEMP "Temperature"
#define PAR_TRG_STG "TriggerStg"
#define PAR_TRG_WAITREADY "TriggerWaitForReady"
#define PAR_TRG_MASTER "TriggerMaster"
#define PAR_TRG_OUTLEVEL "TriggerOutLevel"
#define PAR_TRG_SERIES "TriggerTdiSeries"
#define PAR_TDI_ROWCOUNT "TdiRowCount"
#define PAR_BIASINCPU "BiasInCpu"
#define PAR_BIAS_DISCHARGE "BiasDischarge"
#define PAR_CPU_BIAS_SET "*BiasSet"
#define PAR_CPU_BIAS_VOLTSENSE "BiasVolt"
#define PAR_CPU_BIAS_CURRSENSE "BiasCurr"
#define PAR_CPU_TEMP_DET "TempDet"
Zest-wpxdev parameter names list
Warning: Most parameters are for testing purposes only and you will not need them in normal use.
const static char* PAR_LIBVER = "HwLibVer";
const static char* PAR_FIRMWARE = "Firmware";
const static char* PAR_FIRMWARE_CPU = "FirmwareCpu";
const static char* PAR_DEBUGLOG = "DebugLog";
const static char* PAR_TEMP = "Temperature";
const static char* PAR_TRG_STG = "TriggerStg";
const static char* PAR_TRG_WAITREADY= "TriggerWaitForReady";
const static char* PAR_TRG_MASTER = "TriggerMaster";
const static char* PAR_TRG_OUTLEVEL = "TriggerOutLevel";
const static char* PAR_BIAS_DISCHARGE = "BiasDischarge";
Zem-wpx7dev parameter names list
Warning: Most parameters are for testing purposes only and you will not need them in normal use.
#define PAR_LIBVER "HwLibVer"
#define PAR_DEBUGLOG "DebugLog"
#define PAR_PS_COUNT "PreShutterClockCount"
#define PAR_PS_DIVIDER "PreShutterClockDivider"
#define PAR_PS_DELAY "PreShutterDelayClockCount"
#define PAR_ENC_PULSE_CNT "EncoderPulseCount"
#define PAR_ENC_PULSE_DIR "EncoderDirection"
#define PAR_ENC_PULSE_COUNTER "EncoderPulseCounter"
Other auxilliary functions
pxcLoadDeviceConfiguration
- This function loads device configuration from xml file
- Definition
PXCAPI int pxcLoadDeviceConfiguration(unsigned deviceIndex, const char* filePath);
Parameters
- deviceIndex – index of the device, starting from zero
- filePath – path to xml configuration file
- Return value
- 0 if successful, otherwise the return value is a PXCERR_XXX code.
pxcSaveDeviceConfiguration
- This function saves device configuration to xml file
- Definition
PXCAPI int pxcSaveDeviceConfiguration(unsigned deviceIndex, const char* filePath);
Parameters
- deviceIndex – index of the device, starting from zero
- filePath – path to xml configuration file
- Return value
- 0 if successful, otherwise the return value is a PXCERR_XXX code.