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.12 2019/03/25 17:57:36 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
49 /* @} */
50 
51 
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 
371 TDC_API int TDC_CC TDC_enableMarkers( Int32 markerMask );
372 
373 
380 TDC_API int TDC_CC TDC_getMarkersEnabled( Int32 * markerMask );
381 
382 
400  TDC_SignalCond conditioning,
401  Bln32 edge,
402  double threshold );
403 
404 
420  Bln32 * edge,
421  double * threshold );
422 
423 
433  Bln32 reconstruct );
434 
435 
444 TDC_API int TDC_CC TDC_getSyncDivider( Int32 * divider,
445  Bln32 * reconstruct );
446 
447 
456 
457 
472  TDC_FilterType type,
473  Int32 chMask );
474 
475 
484 TDC_API int TDC_CC TDC_getFilter( Int32 channel,
485  TDC_FilterType * type,
486  Int32 * chMask );
487 
488 
496 TDC_API int TDC_CC TDC_setExposureTime( Int32 expTime );
497 
498 
507 TDC_API int TDC_CC TDC_getDeviceParams( Int32 * coincWin,
508  Int32 * expTime );
509 
510 
523 TDC_API int TDC_CC TDC_setChannelDelays( const Int32 * delays );
524 
525 
533 TDC_API int TDC_CC TDC_getChannelDelays( Int32 * delays );
534 
535 
545 TDC_API int TDC_CC TDC_setDeadTime( Int32 channel,
546  Int32 dTime );
547 
548 
556 TDC_API int TDC_CC TDC_getDeadTime( Int32 channel,
557  Int32 * dTime );
558 
559 
570 TDC_API int TDC_CC TDC_configureSelftest( Int32 channelMask,
571  Int32 period,
572  Int32 burstSize,
573  Int32 burstDist );
574 
589 TDC_API int TDC_CC TDC_getDataLost( Bln32 * lost );
590 
591 
602 
603 
611 
612 
626 TDC_API int TDC_CC TDC_enableTdcInput( Bln32 enable );
627 
628 
640 TDC_API int TDC_CC TDC_freezeBuffers( Bln32 freeze );
641 
642 
662 TDC_API int TDC_CC TDC_getCoincCounters( Int32 * data, Int32 * updates );
663 
664 
687  Int64 * timestamps,
688  Int8 * channels,
689  Int32 * valid );
690 
691 
739 TDC_API int TDC_CC TDC_writeTimestamps( const char * filename,
740  TDC_FileFormat format );
741 
742 
756 TDC_API int TDC_CC TDC_inputTimestamps( const Int64 * timestamps,
757  const Int8 * channels,
758  Int32 count );
759 
760 
780 TDC_API int TDC_CC TDC_readTimestamps( const char * filename,
781  TDC_FileFormat format );
782 
783 
800  double * par,
801  Int32 count );
802 
803 #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_getLastTimestamps(Bln32 reset, Int64 *timestamps, Int8 *channels, Int32 *valid)
Retrieve Last Timestamp Values.
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
__int8 Int8
8 bit integer for MSVC
Definition: tdcdecl.h:53
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_inputTimestamps(const Int64 *timestamps, const Int8 *channels, Int32 count)
Input Synthetic 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_configureSelftest(Int32 channelMask, Int32 period, Int32 burstSize, Int32 burstDist)
Configure Selftest.
__int32 Bln32
integer used as boolean
Definition: tdcdecl.h:56
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
__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
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.