TDCBase
tdcbase.h
Go to the documentation of this file.
1 /******************************************************************************
2  *
3  * Project: quTAG 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.15 2019/11/29 13:25:13 trurl Exp $ */
37 
38 #ifndef __TDCBASE_H
39 #define __TDCBASE_H
40 
41 #include "tdcdecl.h"
42 
46 #define TDC_QUTAG_CHANNELS 5
47 #define TDC_COINC_CHANNELS 31
48 #define TDC_MAX_CHANNEL_NO 20
53 typedef enum {
56 } TDC_DevType;
57 
58 
60 typedef enum {
61  FEATURE_HBT = 0x0001, /*< HBT software functions */
62  FEATURE_LIFETIME = 0x0002, /*< Lifetime software functions */
63  FEATURE_3_CHAN = 0x0004, /*< Input channel 3 enabled */
64  FEATURE_4_CHAN = 0x0008, /*< Input channels 3 & 4 enabled */
65  FEATURE_5_CHAN = 0x0010, /*< Start channel may be used as channel 5 */
66  FEATURE_MARKERS = 0x0020, /*< Marker input */
67  FEATURE_FILTERS = 0x0040, /*< Event filters for timestamp stream */
68  FEATURE_EXTCLK = 0x0080, /*< External clock enabled */
69  FEATURE_DEVSYNC = 0x0100, /*< Synchronisation of multiple devices */
70  FEATURE_HIRES = 0x0200 /*< Jitter upgrade / high resolution */
72 
75 
76 
78 typedef enum {
85 
86 
88 typedef enum {
91  SCOND_NIM = 2,
93  SCOND_MISC = 3,
96 
97 
99 typedef enum {
106 
107 
109 typedef enum {
117 } TDC_SimType;
118 
119 
120 
128 TDC_API double TDC_CC TDC_getVersion();
129 
130 
137 TDC_API const char * TDC_CC TDC_perror( int rc );
138 
139 
151 TDC_API int TDC_CC TDC_getTimebase( double * timebase );
152 
153 
174 TDC_API int TDC_CC TDC_init( int deviceId );
175 
176 
183 
184 
191 
192 
202 
203 
213 
214 
222 
223 
232 TDC_API int TDC_CC TDC_getClockState( Bln32 * locked,
233  Bln32 * uplink );
234 
235 
246 TDC_API int TDC_CC TDC_getChainPosition( Int32 * position,
247  Int32 * length );
248 
249 
261 
262 
270 
271 
284 
285 
293 
294 
307 
308 
316 
317 
326 
327 
335 
336 
348 TDC_API int TDC_CC TDC_enableChannels( Int32 channelMask );
349 
350 
357 TDC_API int TDC_CC TDC_getChannelsEnabled( Int32 * channelMask );
358 
359 
373 TDC_API int TDC_CC TDC_enableMarkers( Int32 markerMask );
374 
375 
382 TDC_API int TDC_CC TDC_getMarkersEnabled( Int32 * markerMask );
383 
384 
402  TDC_SignalCond conditioning,
403  Bln32 edge,
404  double threshold );
405 
406 
422  Bln32 * edge,
423  double * threshold );
424 
425 
435  Bln32 reconstruct );
436 
437 
446 TDC_API int TDC_CC TDC_getSyncDivider( Int32 * divider,
447  Bln32 * reconstruct );
448 
449 
458 
459 
474  TDC_FilterType type,
475  Int32 chMask );
476 
477 
486 TDC_API int TDC_CC TDC_getFilter( Int32 channel,
487  TDC_FilterType * type,
488  Int32 * chMask );
489 
490 
498 TDC_API int TDC_CC TDC_setExposureTime( Int32 expTime );
499 
500 
509 TDC_API int TDC_CC TDC_getDeviceParams( Int32 * coincWin,
510  Int32 * expTime );
511 
512 
525 TDC_API int TDC_CC TDC_setChannelDelays( const Int32 * delays );
526 
527 
535 TDC_API int TDC_CC TDC_getChannelDelays( Int32 * delays );
536 
537 
547 TDC_API int TDC_CC TDC_setDeadTime( Int32 channel,
548  Int32 dTime );
549 
550 
558 TDC_API int TDC_CC TDC_getDeadTime( Int32 channel,
559  Int32 * dTime );
560 
561 
572 TDC_API int TDC_CC TDC_configureSelftest( Int32 channelMask,
573  Int32 period,
574  Int32 burstSize,
575  Int32 burstDist );
576 
591 TDC_API int TDC_CC TDC_getDataLost( Bln32 * lost );
592 
593 
604 
605 
613 
614 
628 TDC_API int TDC_CC TDC_enableTdcInput( Bln32 enable );
629 
630 
642 TDC_API int TDC_CC TDC_freezeBuffers( Bln32 freeze );
643 
644 
664 TDC_API int TDC_CC TDC_getCoincCounters( Int32 * data, Int32 * updates );
665 
666 
689  Int64 * timestamps,
690  Uint8 * channels,
691  Int32 * valid );
692 
693 
741 TDC_API int TDC_CC TDC_writeTimestamps( const char * filename,
742  TDC_FileFormat format );
743 
744 
758 TDC_API int TDC_CC TDC_inputTimestamps( const Int64 * timestamps,
759  const Uint8 * channels,
760  Int32 count );
761 
762 
782 TDC_API int TDC_CC TDC_readTimestamps( const char * filename,
783  TDC_FileFormat format );
784 
785 
802  double * par,
803  Int32 count );
804 
805 #endif
TDC_API int TDC_CC TDC_getTimestampBufferSize(Int32 *size)
Read back Timestamp Buffer Size.
TDC_API int TDC_CC TDC_setChannelLink(Bln32 on)
Enable channel link.
TDC_API int TDC_CC TDC_getChannelDelays(Int32 *delays)
Read back Channel Delay Times.
TDC_SimType
Type of generated timestamps.
Definition: tdcbase.h:109
TDC_API int TDC_CC TDC_getFiveChannelMode(Bln32 *on)
Retrieve five channel mode.
Time diffs and channel numbers uniformly distributed.
Definition: tdcbase.h:110
TDC_API int TDC_CC TDC_getClockState(Bln32 *locked, Bln32 *uplink)
Inquire Clock Sync State.
TDC_API int TDC_CC TDC_getChannelsEnabled(Int32 *channelMask)
Retrieve active channels.
#define TDC_CC
Calling convention.
Definition: tdcdecl.h:34
TDC_API int TDC_CC TDC_setFiveChannelMode(Bln32 on)
Enable five channel mode.
TDC_API int TDC_CC TDC_deInit()
Disconnect and uninitialize.
No type / invalid.
Definition: tdcbase.h:116
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:82
TDC_DevType
Type of the TDC device.
Definition: tdcbase.h:53
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_setDeadTime(Int32 channel, Int32 dTime)
Set Dead Time.
TDC_API int TDC_CC TDC_writeTimestamps(const char *filename, TDC_FileFormat format)
Write Timestamp Values to File.
Mute filter.
Definition: tdcbase.h:101
__int64 Int64
64 bit integer for MSVC
Definition: tdcdecl.h:55
TDC_API int TDC_CC TDC_getSyncDivider(Int32 *divider, Bln32 *reconstruct)
Read back Signal Conditioning Input Divider.
Compressed binary format (40B header, 5B/time tag)
Definition: tdcbase.h:81
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:93
No signal / invalid.
Definition: tdcbase.h:94
TDC_API int TDC_CC TDC_startCalibration()
Internal Calibration.
TDC_FileFormat
Output file format.
Definition: tdcbase.h:78
TDC_SignalCond
Type of signal conditioning.
Definition: tdcbase.h:88
TDC_API int TDC_CC TDC_getDeviceParams(Int32 *coincWin, Int32 *expTime)
Read Back Device Parameters.
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:99
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:74
TDC_API int TDC_CC TDC_configureSyncDivider(Int32 divider, Bln32 reconstruct)
Configure Signal Conditioning 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:80
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
TDC_API int TDC_CC TDC_setChannelDelays(const Int32 *delays)
Set Channel Delay Times.
No format / invalid.
Definition: tdcbase.h:83
quTAG device
Definition: tdcbase.h:54
For LVTTL signals: Trigger at 2V rising edge, termination optional.
Definition: tdcbase.h:89
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.
TDC_API int TDC_CC TDC_getChannelLink(Bln32 *on)
Retrieve channel link.
For NIM signals: Trigger at -0.6V falling edge, termination fixed on.
Definition: tdcbase.h:91
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:102
TDC_API int TDC_CC TDC_enableChannels(Int32 channelMask)
Enable TDC Channels.
TDC_API int TDC_CC TDC_getSingleStopPreselection(Bln32 *single)
Preselection mode.
TDC_API int TDC_CC TDC_getChainPosition(Int32 *position, Int32 *length)
Retrieve Position in Chain.
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:104
TDC_API int TDC_CC TDC_getSignalConditioning(Int32 channel, Bln32 *edge, double *threshold)
Read back Signal Conditioning Parameters.
Sync filter.
Definition: tdcbase.h:103
Time diffs normally distributed, channels uniformly.
Definition: tdcbase.h:113
No filter.
Definition: tdcbase.h:100
TDC_API int TDC_CC TDC_enableTdcInput(Bln32 enable)
Enable Physical Input.
ASCII format.
Definition: tdcbase.h:79
Technical declarations for the DLL interface and basic type defs.
TDC_API int TDC_CC TDC_getDeadTime(Int32 channel, Int32 *dTime)
Read back Dead Time.
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.