Multiple Card Operations Under Windows. Artison SMX2040, S-LCR-DM, SMX2042, SMX2044
Add to My manuals127 Pages
advertisement
the DMM hardware. DMMInit accepts the name and location of the calibration file. A qualified technician may modify individual entries in the calibration file, then reload them using th e DMMLoadCalFile command.
5.2 Using the SMX2040 Driver Wit h C++ or Similar Software
Install the SM204032.H and UserDMM.H header file in a directory th at will be searched by your C/C++ compiler for header files. This header file is known t o work with Microso ft Visual C++™. To compile using Borland, you will need to convert the SM 204032.DEF an d SM204032.LIB using ImpDef.exe and ImpLib.exe, provided with the co mpiler.. Install SM204032.LIB in a directory that will be searched by the linker for import libraries. The
SMX2040 software must be installed prior to running any executable code. Install the SM204032.DLL in a location where either your program will do a LoadLibrary call to load it, or on the PATH so that W indows will load the
DLL au tomatically.
In using the SMX2040 driver, first call DMMInit to read the ca libration information. Call DMMSetFunction to set the DMM function. The DM M function constants are defined in the UserDMM.H header file, and have names that clearly indicate the fun ction t hey invoke. Use DMMSetRate 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 doubleprecision (double) re sult, and DMMReadStr returns the next reading as a formatted string ready to be displayed.
M -numb er parameter, which must be set to the value nDmm, which w as returned by
DMMInit() fu nction. F or multiple DMMs this value will be 0,1,2..n. Most functions return an er ror code which can b e retrie ved as a string using DMM ErrStr().
Multiple Card Operations U nd er Windows
Single .EXE operation
A ccessin g multiple DMMs from a single e xe cutable is the most common w ay for running up to 10 DMMs using the
W indow s DLL. A combination of several SMX 2040s and SMX2044s can be cont rolled, as long as the single .EXE
( Thread) is used to control all of the units. Make sure that prior to issuin g comman ds to any DMM, it is initialized using DMMInit(). The nDmm parameter is passed with each DLL co m mand to define the DMM to be accessed.
Since this configuration utilizes the DLL to service all DMMs, it must handle a single reading or control command o ne at a tim e. For example, when one DMM reads DCV, and another reads Ca pacitan ce, the DLL must finish reading the DCV be fore it will proceed to take a Capacitance reading. Being a relatively slow measurement,
Capacitance will dictate the measurement throughput. For improved performance, one can use the following:
Multiple .EXE operation
By having several copies of SM204032.DLL, and renaming them, y ou can run multiple DMMs with separate e xecutables. For instance, having a copy named SM204032A.DLL i n C:\windows\system (Win98/95), and having two executable files, MultiExe0.exe and MultiExe1.exe, each of the executables will run independently, making calls to the respective DLL. This can provide an execution throughput advantage over the method mentioned abov e.
If using VisualBasic, the MultiExe.exe source code should define nDmm = 0, and MultiExe1.exe should define n Dmm = 1. In addition, the first should declare the SM204032.DLL and the second should declare
SM204432.DLL:
MultiExe0.exe VB function declarations:
Declare Function DMMInit Lib "sm204032.dll" (ByVal calFile As String) As Long
Declare Function DMMRead Lib "sm204032.dll" (ByVal nDmm As Long, dResult As Double) As Long
NDmm = 0
MultiExe1.exe VB function declarations:
Declare Function DMMInit Lib "sm20432A.dll" (ByVal calFile As String) As Long
Declare Function DMMRead Lib "sm20432A.dll" (ByVal nDmm As Long, dResult As Double) As Long
NDmm = 1
/* ************************* *********************************************
* Exmp2040.C Exmp2040.EXE
47 Signametrics
Artisan Technology Group - Quality Instrumentation ... Guaranteed | (888) 88-SOURCE | www.artisantg.com
*
* A simple Windows .EXE example for demonstrating the SMX2040,44
* DMMs using "C"
* Sets Function to VDC, Range to 33V, rate to 10rps.
* Display five measurements using a Message box.
* **** ******************************************************************
* M ake sure SM204032.lib is included in the libraries. For Microsoft
* Version 4.0 C++ and above, place under 'Source Files' in the
* Workspace, along side with Exmp2040.c
* PROJECT SETTINGS:
*
* /nologo /ML /W3 /GX /O2 /D "WIN32" /D "NDEBUG " /D "_CONSOLE" /D "_MBCS"
* /FR"Release/" /Fp"Release/Exmp2 040.pch" /YX /Fo"Release/" /Fd"Release/" /FD /c
*
* C opy both SM204 032.DLL and SM204032.LIB to the project directory.
*
**** *******************************************************************/
// #d efine WINAPI __stdcall
#inc lude <windows.h>
#inc lude <string.h>
#ifde f _Windows
#define _W INDOWS
#end if
#inc lude "sm204032.h"
#inc lude "UserDMM.h" int m ain(void){ int I, nDmm = 0;
Read[16];
// functions declarations and error codes.
// All functions, range and rate info and function declarations.
// Address first DMM in the system i = DMMInit(nDmm ,"C:\\sm40cal.dat"); if(i<0)
// initialize SMX2044, and read calibration file
MessageBox(0,"Initi alization ERROR !", "Startup SM204032 DLL",MB_OK);
DMMSetFunction(nDm
DMMSetRange(nDmm m,VDC); // Set to DCV function
,_30V); // and to 33V range
// Error
DMMSetRate(nDmm,RAT E_10); strcpy(strMsg,""); for(i=1; i<= 5; i++){
// 60 samples per sec
// take 5 readings
R ead); read strcat(strMsg," ");
}
// reading
// insert space between readings
MessageBox(0,strMsg, "SM204032.DLL Read Resistance & V DC",MB_OK); return
}
// Show readings
5.3
Visual Basic Fr l lication
The Visual Basic front panel application, SM2044.EXE, is an interactiv e control panel for the SMX2040 DMM.
Dur ing loading, which takes a few seconds, it initializes and self calibrates t he hardware before the front panel is displ ayed.
The push buttons l abeled V, I, etc. control the DMM function. As you push a function, the front panel application will sw itch the DMM to the selected ran ge an d function. Autorange mo de is selected by pushing the AutoRange chec k box. The S-Cal t the D MM, leaving the DMM in the sa me state prior to operation. (This is an inte er t from the external calibration, which uses external stan dards and writes to the
SM 40CAL.DAT file. S-Cal is used to co rrect fo r any internal offset a nd gain drifts du e to changes in operating temp erature). 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 SMX2044 panel has additional capabilitie s, which are disabled if an
SMX2040 is detected.
Signametrics 48
Artisan Technology Group - Quality Instrumentation ... Guaranteed | (888) 88-SOURCE | www.artisantg.com
advertisement
Related manuals
advertisement
Table of contents
- 8 1.0 INTRODUCTION
- 10 2.0 SPECIFICATIONS
- 10 2.3.1 AC Voltage True RMS Measurement
- 11 2.3.2 AC Peak-to-Peak Measurement (SMX2044)
- 11 2.3.3 AC Crest Factor Measurement (SMX2044)
- 12 2.3.4 AC Median Value Measurement (SMX2044)
- 13 2.5.1 2-wire and 4-wire
- 13 2.5.2 6-wire Guarded Resistance Measurement (SMX2044)
- 13 (SMX2044)
- 14 2.8.1 Diode Characterization
- 14 2.8.2 Capacitance Measurement (SMX2042, 44)
- 14 2.8.3 Inductance Measurement (SMX2044)
- 14 2.8.4 In Circuit AC-Based Capacitance Measurements (SM2044)
- 15 2.9.1 Threshold DAC
- 15 2.9.2 Frequency and Period Measurement
- 15 2.9.3 Duty Cycle Measurement
- 15 2.9.4 Pulse Width
- 16 2.9.5 Totalizer
- 16 2.10.1 External Hardware Trigger (at DIN-7 connector)
- 16 2.10.2 PXI Bus Hardware Trigger Inputs (at PXI J2)
- 16 2.10.3 PXI Bus Hardware Trigger Output (to PXI J2)
- 16 2.10.4 Analog Threshold Trigger
- 17 (SMX2044)
- 17 2.11.1 DC Voltage Source
- 17 2.11.2 AC Voltage Source
- 17 2.11.3 DC Current Source
- 20 3.0 GETTING STARTED
- 25 4.0 DMM OPERATIONS AND MEASUREMENTS
- 25 4.1.1 DC Voltage Measurements
- 26 4.1.2 True RMS AC Voltage Measurements
- 26 4.1.3 AC Peak-to-Peak and Crest Factor Measurement (SMX2044)
- 27 4.1.4 AC Median Value Measurement (SMX2044)
- 27 4.2.1 Improving Current Measurements
- 28 4.2.2 Low Level DC Current Measurements
- 28 4.2.3 Extended DC Current Measurements (SM2044)
- 28 4.3.1 2-wire Ohm Measurements
- 28 4.3.2 4-wire Ohm Measurements
- 29 4.3.3 Using Offset Ohms function
- 29 4.3.4 6-wire Guarded Resistance Measurement (SMX2044)
- 30 4.3.5 Leakage Measurements (SMX2044)
- 31 4.3.6 Extended Resistance Measurements (SMX2044)
- 32 4.3.7 Effects of Thermo-Voltaic Offset
- 33 4.3.8 Guarding High Value Resistance Measurements (SMX2044)
- 33 (SMX2044)
- 35 4.11.1 External Hardware Trigger
- 36 4.11.2 Analog Threshold Trigger
- 36 4.11.3 Software Issued Triggered Operations
- 36 4.11.4 Using the PXI bus Trigger Facilities
- 37 4.12.1 Threshold DAC
- 38 4.12.2 Frequency and Period Measurements
- 39 4.12.3 Duty Cycle Measurement
- 39 4.12.4 Pulse Width
- 39 4.12.5 Totalizer Event Counter
- 40 (SMX2044)
- 40 4.13.1 DC Voltage Source
- 41 4.13.2 AC Voltage Source
- 41 4.13.3 DC Current Source
- 41 4.13.4 Source Current - Measure Voltage
- 42 (SMX2044)
- 43 4.15.1 Triggering the SMX2040 DMMs
- 44 4.15.2 Multiplexing with the SMX2040 DMMs
- 44 4.15.3 Interface Commands and Timing
- 47 5.1.1 The SM40CAL.DAT file
- 48 Multiple Card Operations Under Windows
- 50 5.3.1 Visual Basic Simple Application
- 52 DMMArmAnalogTrigger
- 53 DMMArmTrigger
- 54 DMMBurstBuffRead
- 55 DMMBurstRead
- 56 DMMCalibrate
- 56 DMMCleanRelay
- 57 DMMClearMinMax
- 57 DMMClosePCI
- 58 DMMDelay
- 58 DMMDisableTrimDAC
- 59 DMMDisArmTrigger
- 59 DMMDutyCycleStr
- 60 DMMErrString
- 60 DMMFrequencyStr
- 62 DMMGetACCapsR
- 62 DMMGetBusInfo
- 63 DMMGetCalDate
- 63 DMMGetdB
- 64 DMMGetdBStr
- 64 DMMGetCJTemp
- 65 DMMGetDeviation
- 66 DMMGetDeviatStr
- 66 DMMGetFuncRange
- 67 DMMGetFunction
- 67 DMMGetGrdVer
- 68 DMMGetHwVer
- 68 DMMGetID
- 69 DMMGetManDate
- 69 DMMGetMax
- 70 DMMGetMaxStr
- 70 DMMGetMin
- 71 DMMGetMinStr
- 71 DMMGetRange
- 72 DMMGetRate
- 72 DMMGetSourceFreq
- 73 DMMGetTCType
- 73 DMMGetType
- 74 DMMGetVer
- 74 DMMInit
- 75 DMMIsAutoRange
- 76 DMMIsInitialized
- 76 DMMIsRelative
- 77 DMMLoadCalFile
- 78 DMMOpenPCI
- 78 DMMOpenCalACCaps
- 79 DMMOpenTerminalCal
- 79 DMMPeriodStr
- 81 DMMPolledRead
- 81 DMMPolledReadCmd
- 82 DMMPolledReadStr
- 82 DMMRead
- 83 DMMReadBuffer
- 84 DMMReadBufferStr
- 84 DMMReadCJTemp
- 85 DMMReadCrestFactor
- 86 DMMReadDutyCycle
- 86 DMMReadFrequency
- 87 DMMReadFrequencyStr
- 88 DMMReadInductorQ
- 88 DMMReadMeasurement
- 89 DMMReadMedian
- 89 DMMReadNorm
- 90 DMMReadPeakToPeak
- 90 DMMReadPeriod
- 91 DMMReadStr
- 92 DMMReadTotalizer
- 93 DMMReadWidth
- 93 DMMReady
- 94 DMMSetACCapsDelay
- 94 DMMSetACCapsLevel
- 95 DMMSetACVSource
- 96 DMMSetAutoRange
- 96 DMMSetBuffTrigRead
- 97 DMMSetCapsAveSamp
- 98 DMMSetCJTemp
- 99 DMMSetCompThreshold
- 99 DMMSetCounterRng
- 100 DMMSetDCISource
- 100 DMMSetDCVSource
- 101 DMMSetExternalShunt
- 102 DMMSetFuncRange
- 102 DMMSetFunction
- 103 DMMSetInductFreq
- 103 DMMSetOffsetOhms
- 104 DMMSetRange
- 104 DMMSetRate
- 105 DMMSetRelative
- 107 DMMSetResistance
- 107 DMMSetRTD
- 108 DMMSetSensoreParams
- 108 DMMSetSourceMode
- 109 DMMSetSynchronized
- 110 DMMSetTCType
- 110 DMMSetTempUnits
- 111 DMMSetTrigRead
- 112 DMMSetTrimDAC
- 112 DMMStartTotalizer
- 114 DMMStopTotalizer
- 114 DMMTerminate
- 115 DMMTrigger
- 115 DMMWidthStr
- 116 SetACCapsFreq
- 117 6.0 MAINTENANCE
- 126 7.0 WARRANTY AND SERVICE
- 126 8.0 ACCESSORIES