Example Code

Archived: Language Interface: 16-bit Turbo Pascal for Windows

Code and Documents

Attachment

Overview


This document has been archived and is no longer updated by National Instruments.

This is the GPIB language interface for Turbo Pascal for Windows, a Windows 3.x programming environment for creating 16-bit applications. Download the Turbopas.zip file (in the example.zip file, below). This file contains the declaration file TPWGPIB.TPU (which is also the language interface file), TPWGPIB.PAS (the Turbo Pascal for Windows source code for TPWGPIB.TPU), and some sample programs.


How to Use the 16-bit Turbo Pascal for Windows Language Interface:

I. Overview

The 16-bit GPIB language interface for Turbo Pascal contains the following files:

TPWGPIB.TPU: Win16 unit containing constant declaration and initialization, function and procedure prototypes, and direct entry points to the GPIB driver (GPIB.DLL)
TPWGPIB.PAS: Turbo Pascal for Windows source code for TPWGPIB.TPU


II. Items to Include in Your GPIB Application

You must include the following line at the beginning of your application:

Uses TPWGPIB;


III. Formal Parameters for Board, Device, and File Names

The formal parameters for board or device names and filenames are of type PChar. Therefore, the corresponding actual parameters must be of type PChar as illustrated below:

var flname,devname : PChar;
dvm : Integer;
devname := 'DVM';
dvm := ibfind(devname); (* or dvm := ibfind('DVM'); *)
flname := 'B:DGS';
ibwrtf(dvm, flname); (* or ibwrtf(dvm, 'B:DGS'); *)

Because formal parameters for command, read, and write buffers are untyped, Turbo Pascal variables of a user-specified array type or of type cbuf are compatible with the Turbo Pascal language interface. Turbo Pascal applications that use parameter types nbuf and flbuf must be changed to use the Turbo Pascal predefined array type PChar.


IV. Protected Mode Issue

The Turbo Pascal for Windows language interface cannot be used for protected-mode applications.

Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.

Contributors