Braun MCA166-USB Network Card User Manual


 
APPENDIX 3 - Description of the communication DLLs
8
A3.1 MS-Windows DLL for communication with one MCA166-USB
The Dynamic Link Library exists as a 16-bit variant (mca_comm.dll) and as a 32-bit variant (mca32com.dll). The DLL must reside in
the system directory of Windows or in the same directory as the calling application. In order to include the DLL in your program, you
have to use in Visual Basic the file MCA32COM.BAS (valid only for Win32 applications) or in C/C++ the files MCA_COMM.H and
MCA_COMM.LIB or MCA32COM.LIB. All functions and structures are declared in these files.
A3.1.1 Initializing and closing the serial communication port
Before you can use any function, the serial communication port must be initialized. Pass to the function COMM_INIT a string with
the name of the serial communication port (e.g. ”COM1”). If the return value is unequal zero, the initialization was successful. The
serial communication port is unable to initialize if another device (or program) is already using this one. Before you exit your
program, you have to close the serial communication port so that it can be used from other programs now. You can use only one
communication port at the same time. If you want to change the communication port, you have to close the used communication
port before you can initialize another one.
A3.1.2 Sending commands to the MCA
With the function MCA_COMM you can send single firmware commands
9
to the MCA. This function is only intended for testing. For
the real work with the MCA you should use the other functions (MMCA_ ...) described in chapter A3.1.3. The function MCA_COMM
is declared as follows:
in C/C++
ERROR_FLAG FAR PASCAL MCA_COMM( LPSTR command,
LPSTR rec_data,
unsigned long param1=0,
unsigned long param2=0,
unsigned long param3=0,
unsigned long param4=0);
in Visual Basic
Declare Function MCA_COMM Lib "Mca32com" ( ByVal Command$,
Received As RECDATA,
ByVal Param1&,
ByVal Param2&,
ByVal Param3&,
ByVal Param4&) As Integer
8 MCA_COMM.DLL (16 Bit) and MCA32COM.DLL (32 Bit) Version 1.04.0006 for MCA166 Firmware #9901
MCA_COMX.DLL (16 Bit) and MCA32CMX.DLL (32 Bit) Version 1.00.0006 for MCA166 Firmware #9901
9 The firmware commands are described in Appendix 4.
35