![Signametrics SMX2040 Operator'S Manual Download Page 50](http://html1.mh-extra.com/html/signametrics/smx2040/smx2040_operators-manual_1268484050.webp)
49
Signametrics
he source code file
GLOBAL.BAS
(in the
V_BASIC
directory of the distribution diskette) contains the function
e
uplicates of the “C” header files required to write Visual Basic applications which interact with the driver DLL,
along wi
ables required for this particular front-panel application.
3
Basic Simple Application
The
le panel application for VisualBasic that includes two files, Global.Bas and
Sim
P
ontains two objects; a
Text Box
to display the DMM readings, and a
Com a
ding trigger.
Glo
.b
contents:
Option Explicit
' Declare all functions we are going to be using: From SM204032.H file.
s String) As Long
ate As Long) As Long
on DMMRead Lib "sm204032.dll" (ByVal nDmm As Long, dResult As Double) As Long
Global Const Range0 = 0
Glob
Glob
Glob
ding rates
Global Const RATE_5 = 5 '5 rps
'Glo
Glob
l store for the DMM number
Private Sub Form_Load()
'Fomr_Load allways gets executed first.
Dim i As Long
nDmm = 0
‘Set to first DMM in the system
i = DMMInit(nDmm,"C:\sm40cal.dat") 'Initialize and load cal file
i = DMMSetFunction(nDmm, VDCFunc) 'Set DMM to DCV function
i = DMMSetRange(nDmm, Range2) 'Select the 33V range
i = DMMSetRate(nDmm, RATE_10) 'Set measurement rate to 10 rps
End Sub
Private Sub ReadBotton_Click()
'Read Botton Click action.
Dim i As Long
'Any time this botton is pressed
Dim dReading As Double
'the DMM takes a reading and displays it.
i = DMMRead(nDmm, dReading)
'Take a reading
TextReading.Text = dReading
'display it in a Text box.
End Sub
5.4 Windows DLL Default Modes and Parameters
T
declarations and the various ranges, rates and other parameters, which are required. These definitions are th
d
th some global vari
5. .1 Visual
following is a simp
ple anel.frm. It has a panel that c
m nd Button
that acts as a rea
bal as module file
Declare Function DMMInit Lib "sm204032.dll" (ByVal nDmm as long, ByVal calFile A
Declare Function DMMSetRate Lib "sm204032.dll" (ByVal nDmm As Long, ByVal nR
Declare Function DMMSetFunction Lib "sm204032.dll" (ByVal nDmm As Long, ByVal nFunc As Long) As Long
Declare Function DMMSetRange Lib "sm204032.dll" (ByVal nDmm As Long, ByVal nRange As Long) As Long
Declare Functi
' Definitions from UserDMM.H
' for DMMSetFunction()
Global Const VDCFunc = 0
Global Const VACFunc = 4
Global Const Ohm2Func = 21
Global nDmm as Long
' for DMMSetRange()
al Const Range1 = 1
al Const Range2 = 2
al Const Range3 = 3
'for DMMSetRate(): Rea
Global Const RATE_10 = 10 '10 rps
Global Const RATE_30 = 30
bal variables
al nDmm As Long ' Globa
S
anel.frm Form file contents:
impleP
Artisan Technology Group - Quality Instrumentation ... Guaranteed | (888) 88-SOURCE | www.artisantg.com