TDCBase
tdcbase.h
Go to the documentation of this file.
1 /******************************************************************************
2  *
3  * Project: quTAG MC and HR Control Library
4  *
5  * Filename: tdcbase.h
6  *
7  * Purpose: Control and data acquisition functions for quTAG
8  *
9  * Author: NHands GmbH & Co KG
10  */
11 /*****************************************************************************/
35 /*****************************************************************************/
36 /* $Id: tdcbase.h,v 1.8 2022/02/03 14:44:55 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 {
56 } TDC_DevType;
57 
58 
60 typedef enum {
61  FEATURE_HBT = 0x0001, /*< Cross correlation (HBT) software functions */
62  FEATURE_LIFETIME = 0x0002, /*< Lifetime software functions */
63  FEATURE_MARKERS = 0x0020, /*< Marker input */
64  FEATURE_FILTERS = 0x0040, /*< Event filters for timestamp stream */
65  FEATURE_EXTCLK = 0x0080, /*< External clock enabled */
66  FEATURE_DEVSYNC = 0x0100 /*< Synchronisation of multiple devices */
68 
71 
72 
74 typedef enum {
81 
82 
84 typedef enum {
87  SCOND_NIM = 2,
89  SCOND_MISC = 3,
92 
93 
95 typedef enum {
102 
103 
105 typedef enum {
113 } TDC_SimType;
114 
115 
116 
124 TDC_API double TDC_CC TDC_getVersion();
125 
126 
133 TDC_API const char * TDC_CC TDC_perror( int rc );
134 
135 
147 TDC_API int TDC_CC TDC_getTimebase( double * timebase );
148 
149 
170 TDC_API int TDC_CC TDC_init( int deviceId );
171 
172 
179 
180 
187 
188 
198 
199 
209 
210 
218 
219 
227 
228 
237 TDC_API int TDC_CC TDC_getClockState( Bln32 * locked,
238  Bln32 * uplink );
239 
240 
248 
249 
262 
263 
272 
273 
286 
287 
295 
296 
305 
306 
314 
315 
325 TDC_API int TDC_CC TDC_enableChannels( Bln32 enStart, Int32 channelMask );
326 
327 
335 TDC_API int TDC_CC TDC_getChannelsEnabled( Bln32 * enStart, Int32 * channelMask );
336 
337 
351 TDC_API int TDC_CC TDC_enableMarkers( Int32 markerMask );
352 
353 
360 TDC_API int TDC_CC TDC_getMarkersEnabled( Int32 * markerMask );
361 
362 
380  TDC_SignalCond conditioning,
381  Bln32 edge,
382  double threshold );
383 
384 
400  Bln32 * edge,
401  double * threshold );
402 
403 
414  Bln32 reconstruct );
415 
416 
425 TDC_API int TDC_CC TDC_getSyncDivider( Int32 * divider,
426  Bln32 * reconstruct );
427 
428 
436 
437 
453  TDC_FilterType type,
454  Int32 chMask );
455 
456 
465 TDC_API int TDC_CC TDC_getFilter( Int32 channel,
466  TDC_FilterType * type,
467  Int32 * chMask );
468 
469 
477 TDC_API int TDC_CC TDC_setExposureTime( Int32 expTime );
478 
479 
488 TDC_API int TDC_CC TDC_getDeviceParams( Int32 * coincWin,
489  Int32 * expTime );
490 
491 
503 TDC_API int TDC_CC TDC_setChannelDelay( Int32 channel, Int32 delay );
504 
505 
513 TDC_API int TDC_CC TDC_getChannelDelay( Int32 channel, Int32 * delay );
514 
515 
526 TDC_API int TDC_CC TDC_configureSelftest( Int32 channelMask,
527  Int32 period,
528  Int32 burstSize,
529  Int32 burstDist );
530 
545 TDC_API int TDC_CC TDC_getDataLost( Bln32 * lost );
546 
547 
558 
559 
567 
568 
582 TDC_API int TDC_CC TDC_enableTdcInput( Bln32 enable );
583 
584 
596 TDC_API int TDC_CC TDC_freezeBuffers( Bln32 freeze );
597 
598 
619 TDC_API int TDC_CC TDC_getCoincCounters( Int32 * data, Int32 * updates );
620 
621 
643  Int64 * timestamps,
644  Uint8 * channels,
645  Int32 * valid );
646 
647 
695 TDC_API int TDC_CC TDC_writeTimestamps( const char * filename,
696  TDC_FileFormat format );
697 
698 
712 TDC_API int TDC_CC TDC_inputTimestamps( const Int64 * timestamps,
713  const Uint8 * channels,
714  Int32 count );
715 
716 
736 TDC_API int TDC_CC TDC_readTimestamps( const char * filename,
737  TDC_FileFormat format );
738 
739 
756  double * par,
757  Int32 count );
758 
759 #endif
TDC_API int TDC_CC TDC_getTimestampBufferSize(Int32 *size)
Read back Timestamp Buffer Size.
TDC_SimType
Type of generated timestamps.
Definition: tdcbase.h:105
Time diffs and channel numbers uniformly distributed.
Definition: tdcbase.h:106
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_disableClockReset(Bln32 disable)
Disable Start Input Clock Reset.
TDC_API int TDC_CC TDC_deInit()
Disconnect and uninitialize.
No type / invalid.
Definition: tdcbase.h:112
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:78
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.
quTAG HR device
Definition: tdcbase.h:54
Mute filter.
Definition: tdcbase.h:97
__int64 Int64
64 bit integer for MSVC
Definition: tdcdecl.h:55
TDC_API int TDC_CC TDC_getSyncDivider(Int32 *divider, Bln32 *reconstruct)
Read back Start Input Divider.
Compressed binary format (40B header, 5B/time tag)
Definition: tdcbase.h:77
TDC_API const char *TDC_CC TDC_perror(int rc)
Get Error Message.
TDC_FeatureFlag
Bitmasks for feature inquiry.
Definition: tdcbase.h:60
Other signal type: Conditioning on, everything optional.
Definition: tdcbase.h:89
No signal / invalid.
Definition: tdcbase.h:90
TDC_API int TDC_CC TDC_startCalibration()
Internal Calibration.
TDC_FileFormat
Output file format.
Definition: tdcbase.h:74
TDC_SignalCond
Type of signal conditioning.
Definition: tdcbase.h:84
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:95
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:70
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 int TDC_CC TDC_configureSyncDivider(Int32 divider, Bln32 reconstruct)
Configure Start Input Divider.
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:76
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:79
For LVTTL signals: Trigger at 2V rising edge, termination optional.
Definition: tdcbase.h:85
No device / simulated device.
Definition: tdcbase.h:55
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:87
TDC_API Int32 TDC_CC TDC_getChannelCount()
Get number of channels.
quTAG MC device
Definition: tdcbase.h:53
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_enableExternalClock(Bln32 enable)
Configure external clock.
TDC_API int TDC_CC TDC_getClockResetDisabled(Bln32 *disabled)
Read back Clock Reset Mode.
TDC_API int TDC_CC TDC_getTimebase(double *timebase)
Get Time Base.
Coincidence filter.
Definition: tdcbase.h:98
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:100
TDC_API int TDC_CC TDC_getSignalConditioning(Int32 channel, Bln32 *edge, double *threshold)
Read back Signal Conditioning Parameters.
Sync filter.
Definition: tdcbase.h:99
Time diffs normally distributed, channels uniformly.
Definition: tdcbase.h:109
No filter.
Definition: tdcbase.h:96
TDC_API int TDC_CC TDC_enableTdcInput(Bln32 enable)
Enable Physical Input.
ASCII format.
Definition: tdcbase.h:75
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 Filter.