
Chapter 4: Software
Manual Number: 00650-004-5
Page 4-7
Functionality provided by the MDM is specific to the sub-multiplexer in question except for a few
basic and general functions as follows:
int SetBaseAddress (unsigned integer address):
This routine tells the MDM which address to use when calling the CDM in
order to program the A/D card. When this routine is used, its not necessary
to call each function in the MDM with a base address parameter.
This
function should be the first function called before any other MDM
function
. This function, due to the nature of mixed-language programming,
stores the address in an external variable called BADDR. That variable can
not be used from your application program. It is defined and maintained by
the include files provided with the MDM for each language.
int GETDATA (unsigned integer FirstChannel, unsigned integer LastChannel,
unsigned integer pointer Buffer):
This routine takes buffered data from the sub-multiplexer card, from first
channel to last channel, and stores the data in the array Buffer. The Buffer
must be large enough to contain lastChannel-FirstC1 elements of
two-byte unsigned integer data. This routine performs very little error
checking and is designed as a primitive function to acquire data as fast as
possible using programmed I/O.
The above are the only functions common to all Multiplexer Driver Modules. Although its pos-
sible to program for any multiplexer using just these functions, doing so negates any advanced
features of the multiplexer such as channel-by-channel gain programming, anti-alias filtering, si-
multaneous sample and hold, etc. Therefore, each MDM contains multiplexer-specific functions
to simplify use of the full feature set for its sub-multiplexer card.
Using the MDM Driver
The most common method to use the MDM driver is to begin a program as usual, call SetBaseAddress
with the address of the A/D card and then call the MDM function to acquire data from the card.
Next, the returned data from the buffer is manipulated and/or displayed and the process repeated as
desired.
To use the function calls provided by the MDM, the program must include the interface file (such
as SSH-0x.H). The source program's object file (user.obj) must be linked with the CDM object file
(ADCARD.OBJ, where ADCARD is the 6 character A/D model number such as A1216E), and the
MDM object file (such as SSH-0x.OBJ).