TDCBase
tdcbase.h
Go to the documentation of this file.
1 /******************************************************************************
2  *
3  * Project: quTAG MC Control Library
4  *
5  * Filename: tdcbase.h
6  *
7  * Purpose: Control and data acquisition functions for TDC
8  *
9  * Author: NHands GmbH & Co KG
10  */
11 /*****************************************************************************/
35 /*****************************************************************************/
36 /* $Id: tdcbase.h,v 1.4 2021/02/03 13:40:15 trurl Exp $ */
37 
38 #ifndef __TDCBASE_H
39 #define __TDCBASE_H
40 
41 #include "tdcdecl.h"
42 
46 #define TDC_QUTAG_CHANNELS 32
47 #define TDC_COINC_CHANNELS 59
52 typedef enum {
55 } TDC_DevType;
56 
57 
59 typedef enum {
60  FEATURE_HBT = 0x0001, /*< Cross correlation (HBT) software functions */
61  FEATURE_LIFETIME = 0x0002, /*< Lifetime software functions */
62  FEATURE_MARKERS = 0x0020, /*< Marker input */
63  FEATURE_FILTERS = 0x0040, /*< Event filters for timestamp stream */
64  FEATURE_EXTCLK = 0x0080, /*< External clock enabled */
65  FEATURE_DEVSYNC = 0x0100 /*< Synchronisation of multiple devices */
67 
70 
71 
73 typedef enum {
80 
81 
83 typedef enum {
86  SCOND_NIM = 2,
88  SCOND_MISC = 3,
91 
92 
94 typedef enum {
101 
102 
104 typedef enum {
112 } TDC_SimType;
113 
114 
115 
123 TDC_API double TDC_CC TDC_getVersion();
124 
125 
132 TDC_API const char * TDC_CC TDC_perror( int rc );
133 
134 
146 TDC_API int TDC_CC TDC_getTimebase( double * timebase );
147 
148 
169 TDC_API int TDC_CC TDC_init( int deviceId );
170 
171 
178 
179 
186 
187 
197 
198 
208 
209 
217 
218 
226 
227 
236 TDC_API int TDC_CC TDC_getClockState( Bln32 * locked,
237  Bln32 * uplink );
238 
239 
252 
253 
261 
262 
271 
272 
280 
281 
291 TDC_API int TDC_CC TDC_enableChannels( Bln32 enStart, Int32 channelMask );
292 
293 
301 TDC_API int TDC_CC TDC_getChannelsEnabled( Bln32 * enStart, Int32 * channelMask );
302 
303 
317 TDC_API int TDC_CC TDC_enableMarkers( Int32 markerMask );
318 
319 
326 TDC_API int TDC_CC TDC_getMarkersEnabled( Int32 * markerMask );
327 
328 
346  TDC_SignalCond conditioning,
347  Bln32 edge,
348  double threshold );
349 
350 
366  Bln32 * edge,
367  double * threshold );
368 
369 
378 
379 
394  TDC_FilterType type,
395  Int32 chMask );
396 
397 
406 TDC_API int TDC_CC TDC_getFilter( Int32 channel,
407  TDC_FilterType * type,
408  Int32 * chMask );
409 
410 
418 TDC_API int TDC_CC TDC_setExposureTime( Int32 expTime );
419 
420 
429 TDC_API int TDC_CC TDC_getDeviceParams( Int32 * coincWin,
430  Int32 * expTime );
431 
432 
443 TDC_API int TDC_CC TDC_setChannelDelay( Int32 channel, Int32 delay );
444 
445 
453 TDC_API int TDC_CC TDC_getChannelDelay( Int32 channel, Int32 * delay );
454 
455 
466 TDC_API int TDC_CC TDC_configureSelftest( Int32 channelMask,
467  Int32 period,
468  Int32 burstSize,
469  Int32 burstDist );
470 
485 TDC_API int TDC_CC TDC_getDataLost( Bln32 * lost );
486 
487 
498 
499 
507 
508 
522 TDC_API int TDC_CC TDC_enableTdcInput( Bln32 enable );
523 
524 
536 TDC_API int TDC_CC TDC_freezeBuffers( Bln32 freeze );
537 
538 
559 TDC_API int TDC_CC TDC_getCoincCounters( Int32 * data, Int32 * updates );
560 
561 
584  Int64 * timestamps,
585  Uint8 * channels,
586  Int32 * valid );
587 
588 
637 TDC_API int TDC_CC TDC_writeTimestamps( const char * filename,
638  TDC_FileFormat format );
639 
640 
654 TDC_API int TDC_CC TDC_inputTimestamps( const Int64 * timestamps,
655  const Uint8 * channels,
656  Int32 count );
657 
658 
678 TDC_API int TDC_CC TDC_readTimestamps( const char * filename,
679  TDC_FileFormat format );
680 
681 
698  double * par,
699  Int32 count );
700 
701 #endif
TDC_API int TDC_CC TDC_getTimestampBufferSize(Int32 *size)
Read back Timestamp Buffer Size.
TDC_SimType
Type of generated timestamps.
Definition: tdcbase.h:104
Time diffs and channel numbers uniformly distributed.
Definition: tdcbase.h:105
TDC_API int TDC_CC TDC_getClockState(Bln32 *locked, Bln32 *uplink)
Inquire Clock Sync State.
#define TDC_CC
Calling convention.
Definition: tdcdecl.h:34
TDC_API int TDC_CC TDC_deInit()
Disconnect and uninitialize.
No type / invalid.
Definition: tdcbase.h:111
TDC_API int TDC_CC TDC_getChannelsEnabled(Bln32 *enStart, Int32 *channelMask)
Retrieve active channels.
TDC_API int TDC_CC TDC_generateTimestamps(TDC_SimType type, double *par, Int32 count)
Generate Timestamps.
TDC_API int TDC_CC TDC_freezeBuffers(Bln32 freeze)
Freeze internal Buffers.
Uncompressed binary without header (for compatiblity)
Definition: tdcbase.h:77
TDC_DevType
Type of the TDC device.
Definition: tdcbase.h:52
TDC_API int TDC_CC TDC_setTimestampBufferSize(Int32 size)
Set Timestamp Buffer Size.
TDC_API double TDC_CC TDC_getVersion()
Get Library Version.
TDC_API int TDC_CC TDC_preselectSingleStop(Bln32 single)
Preselect histogram mode.
TDC_API int TDC_CC TDC_getCoincCounters(Int32 *data, Int32 *updates)
Retrieve Coincidence Counters.
TDC_API int TDC_CC TDC_writeTimestamps(const char *filename, TDC_FileFormat format)
Write Timestamp Values to File.
Mute filter.
Definition: tdcbase.h:96
__int64 Int64
64 bit integer for MSVC
Definition: tdcdecl.h:55
Compressed binary format (40B header, 5B/time tag)
Definition: tdcbase.h:76
TDC_API const char *TDC_CC TDC_perror(int rc)
Get Error Message.
TDC_FeatureFlag
Bitmasks for feature inquiry.
Definition: tdcbase.h:59
Other signal type: Conditioning on, everything optional.
Definition: tdcbase.h:88
No signal / invalid.
Definition: tdcbase.h:89
TDC_API int TDC_CC TDC_startCalibration()
Internal Calibration.
TDC_FileFormat
Output file format.
Definition: tdcbase.h:73
TDC_SignalCond
Type of signal conditioning.
Definition: tdcbase.h:83
TDC_API int TDC_CC TDC_getDeviceParams(Int32 *coincWin, Int32 *expTime)
Read Back Device Parameters.
TDC_API int TDC_CC TDC_getChannelDelay(Int32 channel, Int32 *delay)
Read back Channel Delay Time.
TDC_API Bln32 TDC_CC TDC_checkFeatureHbt()
Check for HBT feature.
TDC_API int TDC_CC TDC_setCoincidenceWindow(Int32 coincWin)
Set Coincidence Window.
TDC_API TDC_DevType TDC_CC TDC_getDevType()
Get type of connected device.
TDC_FilterType
Type of output filter.
Definition: tdcbase.h:94
TDC_API int TDC_CC TDC_configureSignalConditioning(Int32 channel, TDC_SignalCond conditioning, Bln32 edge, double threshold)
Configure Signal Conditioning.
Int32 TDC_FeatureFlags
A combination of feature Flags.
Definition: tdcbase.h:69
TDC_API int TDC_CC TDC_setChannelDelay(Int32 channel, Int32 delay)
Set Channel Delay Time.
TDC_API int TDC_CC TDC_enableChannels(Bln32 enStart, Int32 channelMask)
Enable TDC Channels.
TDC_API Bln32 TDC_CC TDC_checkFeatureLifeTime()
Check for lifetime feature.
TDC_API int TDC_CC TDC_init(int deviceId)
Initialize and Start.
TDC_API int TDC_CC TDC_readTimestamps(const char *filename, TDC_FileFormat format)
Read Timestamps.
TDC_API int TDC_CC TDC_getFilter(Int32 channel, TDC_FilterType *type, Int32 *chMask)
Read back Output Filters.
Uncompressed binary format (40B header, 10B/time tag)
Definition: tdcbase.h:75
TDC_API int TDC_CC TDC_getLastTimestamps(Bln32 reset, Int64 *timestamps, Uint8 *channels, Int32 *valid)
Retrieve Last Timestamp Values.
TDC_API int TDC_CC TDC_configureSelftest(Int32 channelMask, Int32 period, Int32 burstSize, Int32 burstDist)
Configure Selftest.
__int32 Bln32
integer used as boolean
Definition: tdcdecl.h:57
No format / invalid.
Definition: tdcbase.h:78
quTAG MC device
Definition: tdcbase.h:53
For LVTTL signals: Trigger at 2V rising edge, termination optional.
Definition: tdcbase.h:84
No device / simulated device.
Definition: tdcbase.h:54
TDC_API int TDC_CC TDC_inputTimestamps(const Int64 *timestamps, const Uint8 *channels, Int32 count)
Input Synthetic Timestamps.
__int32 Int32
32 bit integer for MSVC
Definition: tdcdecl.h:54
TDC_API int TDC_CC TDC_enableMarkers(Int32 markerMask)
Enable Markers.
TDC_API TDC_FeatureFlags TDC_CC TDC_checkFeatures()
Check for device features.
For NIM signals: Trigger at -0.6V falling edge, termination fixed on.
Definition: tdcbase.h:86
TDC_API Int32 TDC_CC TDC_getChannelCount()
Get number of channels.
TDC_API int TDC_CC TDC_getCalibrationState(Bln32 *active)
Inquire Calibration State.
#define TDC_API
External DLL interface.
Definition: tdcdecl.h:38
unsigned __int8 Uint8
8-Bit unsigned int for MSVC
Definition: tdcdecl.h:56
TDC_API int TDC_CC TDC_getTimebase(double *timebase)
Get Time Base.
Coincidence filter.
Definition: tdcbase.h:97
TDC_API int TDC_CC TDC_getSingleStopPreselection(Bln32 *single)
Preselection mode.
TDC_API int TDC_CC TDC_getMarkersEnabled(Int32 *markerMask)
Retrieve active markers.
TDC_API int TDC_CC TDC_setExposureTime(Int32 expTime)
Set Exposure Time.
invalid
Definition: tdcbase.h:99
TDC_API int TDC_CC TDC_getSignalConditioning(Int32 channel, Bln32 *edge, double *threshold)
Read back Signal Conditioning Parameters.
Sync filter.
Definition: tdcbase.h:98
Time diffs normally distributed, channels uniformly.
Definition: tdcbase.h:108
No filter.
Definition: tdcbase.h:95
TDC_API int TDC_CC TDC_enableTdcInput(Bln32 enable)
Enable Physical Input.
ASCII format.
Definition: tdcbase.h:74
Technical declarations for the DLL interface and basic type defs.
TDC_API int TDC_CC TDC_getDataLost(Bln32 *lost)
Check for data loss.
TDC_API int TDC_CC TDC_configureFilter(Int32 channel, TDC_FilterType type, Int32 chMask)
Configure Output Filters.