Circuit Sleuth API Toolkit
The Circuit Sleuth API Tool Kit routines offer an alternative solution for users who prefer writing or need to write their own control programs, or have specific application needs for frequency response analysis. The “C” callable routines and DLLs provide direct access to the analyzer, enabling the user to control instrument functions and data management.
The architecture of the interface consists of USB drivers (installed with the Circuit Sleuth application installation disk) that communicate with the analyzer hardware, and a set of function calls from the API Tool Kit.
Export functions are commands that establish communication with the hardware, transfer test parameters from the PC to the instrument, trigger the acquisition and request status.
Callback functions are put into place to receive notification from the instrument that an operation has completed. Callbacks work hand-in-hand with selected Export functions. When test data is transferred from the instrument to the PC, a callback is notified automatically and a function is executed to process the returned data. Only a single line of code is necessary to set up a callback.
Data exchange takes place using pre-defined structures. Communication is first established with the hardware, then the data exchange proceeds by loading the data structures with test parameters. Initiating a capture “triggers” the analyzer, and the test sequence for that frequency begins. When the test sequence has completed, the instrument sends the data back to the PC, and notifies a callback function that the received data is ready for further processing.
// Setup point callback with SleuthProc DLL
// Setup status callback to received status information from the SleuthProc DLL
// Establish communications with the Sleuth hardware
stFreq.dStimulusFreq = 1000;
stFreq.iAmplitude = 142;
stFreq.iProcess_Ctrl_Reg = 2624;
stFreq.iSettlingTime = 1; // Insert the first frequency
stFreq.dStimulusFreq += 60; // Insert a second frequency
//Start a capture event to perform frequency response analysis
These functions are easy to implement and additional programming samples are available in the fully documented API Tool Kit 1.0.