Tdrsdk description, 1 description of tdrcom.dll, 1 using the call-back method – Campbell Scientific TDRSDK Software Developement Kit User Manual
Page 6: 2 using the state machine method, Tdr100 command set
 
TDRSDK Software Development Kit for TDR100
2
2. TDRSDK Description
2.1 Description of TDRCOM.DLL
TDRCOM.DLL is a dynamically linked library, DLL, comprised of functions 
that allow control and monitoring of a TDR100 using PC serial 
communications. The DLL functions are called by a program written by the 
user, and the TDR100 communication protocol is transparent. Each DLL 
function is defined with a name and a number. The functions perform a range 
of TDR100 tasks including setting measurement parameters and collecting 
waveform data. 
2.2 Task complete or data available notification after command
issued
To enhance PC performance, query methods are used to determine if 
information is available from the TDR100. Many of the TDRCOM.DLL API 
functions only initiate commands to the TDR100 and do not continue to 
execute while the TDR100 is running the assigned task. The Call-back and 
State Machine methods are used to determine when the TDR100 has completed 
a task. 
2.2.1 Using the Call-back method
When programming in C++ or Pascal, a call-back procedure can be used to 
notify the user program that data is available from the TDR100. The call-back 
procedure uses 2 two parameters, (1) DLL command number and (2) error 
code, to determine which command to execute and which part of the user 
program to notify when data is available from TDR100. DLL function 
RegCallBack is used to pass the address of the procedure in the user program 
that will be notified when data available. 
2.2.2 Using the State Machine method
The State Machine method is used in Visual Basic (including Excel). The 
main part of the DLL will be implemented as a state machine, incrementally 
stepping through short blocks of functionality (states). At regular time 
intervals an Application Program Interface (API) function queries the state 
machine to determine if data is available from the TDR100. When the data is 
signaled to be available, a separate command is issued to retrieve the data from 
the DLL to the user program 
3. TDR100 Command Set
The TDR100 command set is also called the TDR100COM Application 
Program Interface (API). Each command has an associated command number 
that is used in DLL execution.