Operator`s manual
47 Signametrics
* Ex
*
* A 44
* D
* Se n to VDC, Range to 33V, rate to 10rps.
* Display five measurements using a Message box.
**** ******
* Make sure SM204032.lib is included in the
* Ve ce nder 'S
* W .c
* P
*
* /nologo /ML /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS"
* /FR"Release/" /Fp"Release/Exmp2040.pch" /YX /Fo"Release/" /Fd"Release/" /FD /c
*
* Copy both SM204032.DLL and SM204032.LIB to the project directory.
*
***********************************************************************/
// #define WINAPI __stdcall
#include <windows.h>
#include <string.h>
#ifdef _Windows
#define _WINDOWS
#endif
#include "sm204032.h" // functions declarations and error codes.
#include "UserDMM.h" // All functions, range and rate info and function declarations.
int main(void){
int I, nDmm = 0; // Address first DMM in the system
char Read[16];
char strMsg[256];
i = DMMInit(nDmm,"C:\\sm40cal.dat"); // initialize SM2044, and read calibration file
if(i<0)
MessageBox(0,"Initialization ERROR !", "Startup SM204032 DLL",MB_OK); // Error
DMMSetFunction(nDmm,VDC); // Set to DCV function
DMMSetRange(nDmm,_30V); // and to 33V range
DMMSetRate(nDmm,RATE_10); // 60 samples per sec
strcpy(strMsg,""); // Clear string store
for(i=1; i<= 5; i++){ // take 5 readings
DMMReadStr(nDmm, Read); // read
strcat(strMsg,Read); // Append each reading
strcat(strMsg," "); // insert space between readings
}
MessageBox(0,strMsg, "SM204032.DLL Read Resistance & VDC",MB_OK); // Show readings
return 0L;
}
mp2040.C Exmp2040.EXE
simple Windows .EXE example for demonstrating the SM2040,42,
MMs using "C"
ts Functio
***************************************** ********************
libraries. For Microsoft
rsion 4.0 C++ and above, pla u ource Files' in the
orkspace, along side with Exmp2040
ROJECT SETTINGS: