SensL © 2011
57
USER MANUAL
HRM-TDC
SensL © 2011
57
> Appendix > Dll Application Examples
DLL APPLICATION EXAMPLES
Streaming Time-Tags to file
Description
The following example streams Time-Tags to a binary file and then creates a TEXT file from the RAW binary file. If
there is no additional argument (argc = 1) then streaming will be carried out in FIFO Time-Tagging mode. If there
is an additional argument (argc > 1) then streaming will be carried out in FIFO TCSPC with MACRO time mode.
Source Code
#include
<stdio.h>
#include
<stdlib.h>
#include
<windows.h>
#include
“HRM-TDCAPI.h”
typedef unsigned char
Ubyte;
/* Unsigned byte */
typedef char Sbyte;
/* Signed byte */
typedef unsigned short Uword;
/* Unsigned 16 bits */
typedef short Sword;
/* Signed 16 bits */
typedef unsigned int Ulong;
/* Unsigned 32 bits */
typedef int Slong;
/* Signed 32 bits */
typedef double Sdoub;
/* Double */
void main(
Sword
argc,
Sbyte
*argv[])
{
HANDLE
hdl[10];
HRM_STATUS
error;
FILE
*fi, *fo;
Sbyte
ch;
Sword
i, flag;
Ulong
moduleCount, ttag[2], pMAC, pMIC, cMAC, cMIC, Num;
Sdoub
gapT, Tot, mac, mic;
error = HRM_OK;
pMAC = 0;
pMIC = 0;
fi = NULL;
fo = NULL;
/*
Detect the number of HRM-TDC modules
*/
HRM_RefreshConnectedModuleList();
moduleCount = HRM_GetConnectedModuleCount();