06-09-2011 10:31 AM
Greeting all,
I'm trying to call SMT (Sepctral Measurement Toolkit) DLLs from TCL environment. The goal is to use FFT function of DLLs to process data we get from TCL. Just wonder, has anybody had successful experience of doing that? If yes, what's the procedure for doing so? Is there any document/example project I could refer to? Would really appreciate for any advice/suggestion.
Thanks,
06-13-2011 02:06 PM
Hi counterzt,
While I do not have expierence using Tcl with the Spectral Measurement Toolkit (SMT), I do believe I can point you to some documentation that can help. First, the SMT toolkit dll is named nismt.dll, and should be in your c:\windows\system32 directory. Secondly, you will need the NI Spectral Measurements Toolkit Function Reference Help. If you installed SMT support for LabWindows/CVI, this documentation should be located in Start»All Programs»National Instruments»Spectral Measurements»CVI Support»Spectral Measurements Online Help. More information about SMT resources can be found in the ReadMe. If you did not install spport for CVI the first time, just re-run the installation media.
As far as calling DLLs in Tcl, there is a good tutorial about integrating scripting languages into TestStand that you might want to take a look at. I think you may find the information in Advanced Scripting in Perl, Python and Tcl useful for getting started. In that same series, Introduction to Scripting in Perl, Python and Tcl may also be useful.
In short, you will need to use the Function Reference Help in order to get the proper syntax. For example, the Averaged FFT Spectrum is called using the following prototype (more information on the terms can be found in the help).
int SmtAveragedFFTSpectrum (SmtHandle handle, double f0, double df, SmtComplexNum spectrum[], int spectrumSize, SmtSpectrumInfo *spectrumInfo, unsigned short averagingType, unsigned short weightingType, double averagingSize, unsigned short linearWeightingMode, int restartAveraging, SmtComplexNum averagedFFTSpectrum[], double *averagesSoFar, short *dataReady);
Once you have the proper syntax for calling the C function, you just have to know how to call a C function contained in a dll using Tcl (the part I am not familiar with).
That should get you started, but if you have any more questions, feel free to post back.
Regards,
Elizabeth K.
National Instruments | Applications Engineer | www.ni.com/support