Operator`s manual
31 Signametrics
of the executables will run independently, making calls to the respective DLL. This can provide an execution
throughput advantage over the method mentioned above. If using VisualBasic, the MultiExeA.exe source code
should define iScan = 0, and MultiExeB.exe should define iScan = 1. In addition, the first EXE should declare the
SM4040A.DLL and the second should declare SM4040B.DLL:
/***********************************************************************
* Exmp4032.C Exmp4032.EXE
*
* A simple Windows .EXE example for demonstrating the SMX4032
* Scanners using "C"
* Sets Configuration to TwoWire, and select a channel.
*
***********************************************************************
* Make sure SMX4032.lib is included in the libraries. For Microsoft
* Version 4.0 C++ and above, place under 'Source Files' in the
* Workspace, along side with Exmp4032.c
* PROJECT SETTINGS:
*
* /nologo /ML /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS"
* /FR"Release/" /Fp"Release/Exmp4040.pch" /YX /Fo"Release/" /Fd"Release/" /FD /c
*
* Copy both SMX4032.DLL and SMX4032.LIB to the project directory.
*
***********************************************************************/
// #define WINAPI __stdcall
#include <windows.h>
#include <string.h>
#ifdef _Windows
#define _WINDOWS
#endif
#include “SMX4032.H” // functions declarations and error codes.
#include “ScanUser.H” // All functions, range and rate info and function declarations.
int main(void){
int I, iScan = 0; // Address first Scanner in the system
char Read[16];
char strMsg[256];
i = SCANInit(iScan"); // initialize SMX4032
if(i<0)
MessageBox(0,"Initialization ERROR !", "Startup SMX4032 DLL",MB_OK); // Show Error
SCANSetConfig(iScan,TwoWire); // Set to TwoWire configuration
SCANSelectChannel(iScan,32); // Close Channel 32 relay, and necessary path relays
MessageBox(0,strMsg, "Channel 32 is closed and settled",MB_OK); // Show status
return 0L;
5.3 Visual Basic Front Panel Application
The Visual Basic front panel application, SMX4032.EXE, is an interactive control panel for the SMX4032
Scanners. When it loads it will take a few seconds to initialize before the front panel is displayed.
The push buttons labeled and menus provide means to configure the Scanner and select channels. The panel has
several capabilities which are enabled and disabled according to the type of Scanner detected, and the current
configuration.
The source code file GLOBAL.BAS (in the installed VisBasic sub directory) 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 very simple panel application for VisualBasic, which is included with the installed software. The
two files, Global.Bas and SimplePanel.frm are presented here. This GUI panel contains six objects; a text box to
input channel to select, three option buttons to set configuration, a button to apply the channel selection and a text
line for displaying errors.