65
Signametrics
Install the
SMU2060.H
and
USBDMMUser.h
header file in a directory that will be searched by your
C/C++ compiler for header files. This header file is known to work with Microsoft Visual C++™. To
compile using Borland, you will need to convert the
SMU2060.DEF
and
SMU2060.LIB
using
ImpDef.exe
and
ImpLib.exe
, provided with the compiler. Install
SMU2060.LIB
in a directory that will
be searched by the linker for import libraries. The SMU2060 software must be installed prior to running
any executable code. Install the
SMU2060.DLL
in a location where either your program will do a
LoadLibrary
call to load it, or on the
PATH
so that Windows will load the DLL automatically.
In using the SMU2060 driver, first call
DMMInit
which read the calibration information, performs self
test and auto-calibration. Call
DMMSetFunction
to set the DMM to a measurement function. The DMM
function constants are defined in the
USBDMMUser.h
header file, and have names that clearly indicate
the function they invoke. Use
DMMSetAperture and DMMSetReadInterval
to set the reading rate
defined in the header file.
Two functions are provided to return DMM readings.
DMMRead
returns the next reading as a scaled
double-precision (
double
) result, and
DMMReadStr
returns the next reading as a formatted string
ready to be displayed.
All functions accept a DMM-number parameter. This value,
nDmm
, is used to identify the DMM number
in a multiple DMM system. This value will be 0,1,2.. n. Most functions return an error or warning code,
which can be retrieved as a string using
DMMErrStr().
5.3 Visual Basic DMM Panel Application
The Visual Basic front panel application,
SMU2064.EXE,
is an interactive control panel for the
SMU2060 DMM. When it loads it will take a few seconds to initialize and self calibrate the hardware
before the front panel is displayed.
The push buttons labeled
V,
I
, etc. control the DMM function. As you push a function, the front panel
application will switch the DMM to the selected range and function. Autorange mode is selected by
pushing the
AutoRange
check box. The
S-Cal
box recalibrates the DMM, leaving the DMM in the same
state prior to operation. (This is an internal calibration only, and is different from the external calibration,
which writes to the
SM60CAL.DAT
file.
S-Cal
is used to correct for any internal offset and gain drifts
due to changes in operating temperature).
The
freq
and
per
check boxes are context sensitive and appear in ACV and ACI. When
freq
is enabled,
the frequency and amplitude are shown at the same time. In this mode, the reading rate is slower than
indicated. When
per
is enabled, the period is shown. The SMU2064 panel has additional capabilities,
which are disabled if an SMU2060 is detected.
The source code file
GLOBAL.BAS
(in the
V_BASIC
directory of the distribution diskette) contains the
function declarations and the various ranges, rates and other parameters that are required. These
definitions are the duplicates of the “C” header files required to write Visual Basic applications which
interact with the driver DLL, along with some global variables required for this particular front-panel
application.
5.3.1 Visual Basic Simple Application
The following is a simple panel application for Visual Basic, which includes two files, Global.Bas and
SimplePanel.frm. It has a panel that contains two objects, a
Text Box
to display the DMM readings, and a
Command Button
that acts as a reading trigger.
Global.bas module file contents:
Option Explicit
' Declare all functions we are going to be using: From SMU2060.H file.
Declare Function DMMInit Lib "SMU2060.dll" (ByVal nDmm as long, ByVal calFile As String) As Long
Содержание SMU2060
Страница 26: ...Signametrics 26 PXI Instrumentation Switching modules SMX4030 SMX4032 IVI COM driver...
Страница 81: ...81 Signametrics Postive Value 100 Warning code Example char cBuf 64 int status status DMMGetCalDate 0 cBuf...
Страница 106: ...Signametrics 106 Postive Value 100 Warning code Example char cBuf 64 int status status DMMPeriodStr 0 cBuf...