Academic Company Events NI Developer Zone Support Solutions Products & Services Contact NI MyNI

Document Type: Tutorial
NI Supported: Yes
Publish Date: Sep 6, 2006


Feedback


Yes No

Related Categories

Related Links - Developer Zone

Related Links - Products and Services

Running Existing DOS and Win16 GPIB Applications in Windows NT and Windows 98/95

13 ratings | 3.31 out of 5
Print

Overview

Technologies like Windows NT, Windows 95, PCI, and Plug and Play offer new and exciting opportunities for increasing productivity while enhancing the performance and stability of existing GPIB applications. Who knows what tomorrow may bring. With this in mind, you need a development strategy that ensures your ability to take full advantage of the latest technologies while minimizing system downtime and the development costs for upgrading your test systems.

The NI-488 software architecture and the NI-488.2 Application Programming Interface (API) accomplishes exactly this by delivering the tools with which you can easily embrace new technology while protecting your existing development investments in application software. With our NI-488 software architecture, you can take existing DOS and Win16 applications and run them without modification under both Windows NT and Windows 95.

Being able to reuse your existing applications gives you options. You can continue to use your existing applications under these new 32-bit operating systems or you can buy yourself time to port your 16-bit applications to 32-bit without having to suffer the costly consequences of taking your GPIB test systems offline while you port, prototype, and test your new 32-bit application software.

Users of National Instruments GPIB products have enjoyed a level of software compatibility unparalleled in the industry today. By design, our NI-488.2 development software has maintained the same API for more than a decade. With NI-488.2 you are assured a stable foundation for developing and deploying GPIB systems, while retaining the ability to leverage new hardware such as PCI, and improved operating systems such as Windows NT, without having to modify and recompile your source code.

Upgrading to New Hardware Technology

Your GPIB applications maintain consistent compatibility with new GPIB controller technology. When you write your GPIB applications using the NI-488.2 API, you can take advantage of a variety of technologies such as PCI, PCMCIA, Ethernet, and Plug and Play by obtaining the appropriate GPIB controller and installing the native driver software for the desired operating system. If you are migrating to Windows NT or Windows 95, you can reuse your existing DOS and Win16 applications as described below. For other operating systems, you can easily port your code by recompiling your applications under the appropriate operating system.

Reusing Your Existing Software with Windows NT


The main components of the NI-488.2M software are a dynamic link library that runs in user mode and a layered NT device driver that runs in kernel mode. The layered NT device driver consists of three drivers – a device class driver that handles device-level calls, a board class driver that handles board-level calls, and a GPIB port driver that uses the Windows NT Hardware Abstraction Layer (HAL) to communicate with the GPIB hardware. The top two layers of the layered NT device driver are accessed from user mode by gpib-32.dll, a 32-bit Windows NT dynamic link library.

GPIB applications access the NI-488.2M software through gpib-32.dll as follows:
  • A 32-bit Windows application can either link with the language interface (gpib-32.obj) or directly access the functions exported by the DLL.
  • If you already have an existing 16-bit Windows application, use the 16-bit DLL (gpib.dll) to access the GPIB virtual device driver (gpib-vdd.dll) which passes the call on to the gpib-32.dll.
  • If you have an existing DOS application, use the DOS device driver (gpib-nt.com) to access the GPIB virtual device driver.

Figure 1 shows how you can use the NI-488.2M software with Windows NT and your GPIB application programs.


Figure 1. How the NI-488.2M Software Works with Windows NT

Running Win16 Applications Under Windows NT
To run Win16 GPIB applications, the system uses the special GPIB dynamic link libraries, gpib.dll and the GPIB Virtual Device Driver, gpib-vdd.dll both of which are included with your NI-488.2M software.

When you install the NI-488.2M software, the gpib.dll and gpib-vdd.dll are copied into the <winnt>\system32 directory, where <winnt> is your Windows NT directory (for example c:\windows). As illustrated above in Figure 1, the GPIB Virtual Device Driver, gpib-vdd.dll, maps 16-bit gpib.dll calls to the native 32-bit gpib-32.dll. As long as gpib.dll is in the <winnt>\system32 directory, it is automatically accessed whenever you launch a Win16 GPIB application.

Running DOS Applications Under Windows NT
To run your existing DOS GPIB applications, load the special GPIB device driver gpib-nt.com instead of gpib.com, which you would normally use with DOS. When you install the NI-488.2M software, gpib-nt.com is copied into a new sub-directory called doswin16. To use gpib-nt.com, you must modify your config.nt file to load gpib-nt.com whenever a DOS application is executed. The config.nt file is located in your <winnt>\system32 directory, where <winnt> is your Windows NT directory, for example c:\windows. To load gpib-nt.com, add the following line to your config.nt file:

device=<path>\doswin16\gpib-nt.com

where <path> is the directory where you installed the GPIB software (the default installation directory is c:\gpib-nt).

You can now successfully execute your DOS GPIB applications.

Reusing Your Existing Software with Windows 95


The NI-488.2M software for Windows 95 includes a multilayered device driver that consists of DLL pieces that run in user mode and VxD pieces that run in kernel mode. User applications access this device driver from user mode through gpib-32.dll, a 32-bit Windows 95 dynamic link library.

GPIB applications access the NI-488.2M software through gpib-32.dll as follows:
  • A Win32 application can either link with the language interface (gpib-32.obj) or directly access the functions exported by the DLL.
  • If you already have an existing Win16 application, use the 16-bit DLL (gpib.dll) to access the GPIB driver.
  • Follow the procedure below to enable DOS application support.

Figure 2 shows how you can use the NI-488.2M software with Windows 95 and your GPIB application programs.


Figure 2. How the NI-488.2M Software Works with Windows 95

Running Win16 Applications Under Windows 95
You can run existing Win16 GPIB applications under Windows 95 by using gpib.dll and gpib32ft.dll, which are installed with your NI-488.2M software. As illustrated above in Figure 2, the gpib32ft.dll maps 16-bit gpib.dll calls to the native 32-bit gpib-32.dll.

To run 16-bit Windows GPIB applications, the system uses the special GPIB dynamic link library, gpib.dll. When you install the NI-488.2M software, gpib.dll and gpib32ft.dll are copied into the Windows System directory. These DLLs are automatically accessed whenever you execute a Win16 GPIB application under Windows 95.

Running DOS Applications Under Windows 95
With the NI-488.2M software properly configured, you can run your existing DOS GPIB applications along with your Win16 and Win32 GPIB applications. No DOS device driver is required. In fact, be sure that no older version of the GPIB DOS device driver is being loaded from your config.sys file, a file located on the boot drive of your computer. The older GPIB DOS device driver is loaded with a command line of the form device=<path>\gpib.com, where <path> is the drive and directory where gpib.com is located. Delete or comment out this line to ensure that the older GPIB DOS driver is not being loaded.

To run DOS GPIB applications, the system uses a Virtual Device Driver (VxD), gpibdosk.vxd, and a Win32 executable, gpibdos.exe. When you install the NI-488.2M software, gpibdosk.vxd and gpibdos.exe are copied into the Windows System directory. These files are loaded when you restart your computer, if the NI-488.2M software has been properly configured to run your existing DOS GPIB applications.

To configure the NI-488.2M software to run your existing DOS GPIB applications, follow these steps after you have installed the NI-488.2M software and your GPIB hardware:
    1. Launch the Windows 95 Device Manager

    2. Select the Device Manager tab.

    3. Click the View devices by type radio button at the top of the page, and click on the National Instruments GPIB Interfaces icon.

    4. Click on the Properties button to display the General property page for the NI-488.2M software.

    5. Select the checkbox labeled Enable Support for DOS GPIB Applications, and then click on the OK button.

    6. Restart your computer.

Now you are ready to run your existing DOS GPIB applications.

Summary


New technology drives instrumentation systems and vice versa. Being able to keep up with new developments in the industry can be very frustrating. Using the NI-488 software architecture and the NI-488.2 API, you have an insurance policy that helps you take advantage of new hardware and software technologies by reusing your current investments in application software.

Today you can still port applications written in 1984 under DOS to new operating systems such as Windows NT and Windows 95. As we move forward into the next 10 years, we are committed to continuing this tradition – always preserving your investment in our products and technology.
13 ratings | 3.31 out of 5
Print

Reader Comments | Submit a comment »

good description of dos driver use.
Is this the limnit of dos driver usefullness under windows nt as I was hoping to write a dos-driver to load with a dos extender to enhance graphics under winNT. Thanks any waaay:)
- gordon wilson, err-unset as at this moment.. gordon.wilson14sv@btyahoo.net - May 17, 2004

 

Legal
This tutorial (this "tutorial") was developed by National Instruments ("NI"). Although technical support of this tutorial may be made available by National Instruments, the content in this tutorial may not be completely tested and verified, and NI does not guarantee its quality in any way or that NI will continue to support this content with each new revision of related products and drivers. THIS TUTORIAL IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND AND SUBJECT TO CERTAIN RESTRICTIONS AS MORE SPECIFICALLY SET FORTH IN NI.COM'S TERMS OF USE (http://ni.com/legal/termsofuse/unitedstates/us/).