B&B Electronics ATRWDT Benutzerhandbuch

Seite von 23
Documentation Number ATxWDT-1303
13
B&B Electronics Mfg Co – 707 Dayton Rd - PO Box 1040 - Ottawa IL 61350 - Ph 815-433-5100 - Fax 815-433-5104
B&B Electronics Ltd – Westlink Comm. Pk – Oranmore, Galway, Ireland – Ph +353 91-792444 – Fax +353 91-792445
Chapter 4: SOFTWARE
The software shipped with the ATRWDT and ATXWDT includes
example software for Windows 3.11, Windows 95 and Windows NT
written for Borland C++ 5.01, Microsoft Visual C++ 4.0 and Microsoft
Visual BASIC 4.0. Also included is a Windows NT 4.0 device driver.
Windows NT and Windows 95
Windows NT restricts access to the I/O ports of the computer to
device drivers, so a simple OUT command cannot be used to
communicate with the watchdog timer. A device driver, for use with
Windows NT 4.0 or later, is included with the watchdog timer
software to allow access to the watchdog timer under Windows NT.
A dynamic-link library (DLL) is included to hide the details of
communicating with this device driver. These commands are
explained in the Command Reference section of this chapter.
Windows 95 is less restrictive than Windows NT on the access
of the computer’s I/O ports. A simple OUTP command can be used in
Borland C++ or Microsoft Visual C++ to communicate with the
watchdog timer. However, using the DLL will allow the same
program to run under both Windows 95 and Windows NT. Visual
BASIC does not have a command to access the I/O ports of the
computer, so the DLL must be used. A Visual BASIC program must
include definitions for the routines in the DLL in order to call them.
The file, PCWDT.BAS, contains definitions for these function and
can be included in the Visual BASIC project by selecting A
DD
F
ILE
under the F
ILE
menu.
In a Borland C++ or Microsoft Visual C++ program, each module
calling the watchdog timer routines must include the file, PCWDT.H.
This file contains the definitions for the functions in the DLL. The file,
BBPCWDT.LIB, must be included in the project to inform the linker
that it is using a DLL. Note that the BBPCWDT.LIB file for Borland
C++ and Microsoft Visual C++ are not the same, so they are not
interchangeable. A console mode program, written in C, is provided
to demonstrate the use of the DLL functions. Both Borland C++ and
Microsoft Visual C++ project files are included to make it easier to
recompile the example program. The file, MKIMPLIB.BAT, is
provided as an example of how to create the import library,
BBPCWDT.LIB. It may be necessary to recreate the import library if
the application is not compiled with Borland C++ version 5.01 or
Microsoft Visual C++ version 4.0.