Scientific Solutions ® Inc.

Route488 ® Function Library for DOS

ROUTE488 is a sophisticated memory resident driver that simplifies programming for Scientific Solutions family of IEEE 488 GPIB products. Designed to optimize communication with the GPIB interface, ROUTE488 installs as a BIOS-level, software interrupt. Any language that runs under DOS can access its various functions.

Product Description

Key Features

Applications

Functional Description

Compatible Languages

Program Examples

System Resources


arrow Product Description

ROUTE 488 is a sophisticated memory resident driver that simplifies programming for Scientific Solutions family of IEEE 488 General Purpose Instrumentation Bus (GPIB) products (IEEE488-CL, IEEE488-LM, MC-IEEE488). Designed to optimize communication with the GPIB interface in an IBM PCs or PS/2, ROUTE 488 installs as a BIOS-level, software interrupt. Any language that runs under DOS can access its 35 functions. ROUTE 488 functions transfer data and commands between the PC controlled random access memory, disk or peripheral and the GPIB. The PC can act as the system controller, controller-in-charge or as a standard talker/listener on the GPIB. A timeout period can be set to enhance error detection. Interrupt capability is available to call user defined functions (IRQ sources include Service Request, Trigger, Device Clear, and undefined commands). DMA file transfer allows data to be moved to or from the GPIB for highest throughput. ROUTE 488 can be used in conjunction with Scientific Solutions LabPac software for a complete data acquisition/process control environment.


arrow Key Features


arrow Applications


arrow Functional Description

ROUTE 488 is a memory resident BIOS level device driver. When called from an application program its function is to provide streamlined BIOS routines which facilitate the data acquisition and process control features on the General Purpose Instrumentation Bus (GPIB). Applications access ROUTE 488 functions directly through software interrupt INT66H. Interface modules for calling software interrupts are provided when necessary.

Most drivers for IEEE interfaces are DOS character device drivers. When a command is sent to the driver from the calling language, it passes through DOS software interrupt INT21H, adding a layer between the application language and the driver. When a block of information is transferred to or from DOS, the data is sent to or received from the driver character by character, consuming additional time. In ROUTE 488 applications, command information and data pointers are sent directly to the memory resident driver without passing through DOS. Data is transferred directly to/from the driver, lowering the overhead and increasing speed. In benchmark tests using a C application, a 300K byte RAM buffer was transferred across the GPIB in 8 seconds. The same buffer transferred only to a DOS driver with no GPIB transfer, took 42 seconds, a 525% decrease in the transfer rate.

Another approach to drivers is to use a library of subroutines. In a library environment the entire body of driver code is included in the application, increasing program size and decreasing the available workspace for data and code. In ROUTE 488 applications only one short interface module is required to access all 35 functions. A command parameter within the Call statement determines which function is executed.

ROUTE 488 installs easily at the DOS prompt.

A>ROUTE488 <RET>

The command can be included in the autoexec.bat file for automatic installation. Once installed, ROUTE 488 will be actively available to any application program running under MS DOS until the computer is turned off or reset.

DMA Transfer:

Data files used by ROUTE 488 are MS DOS files in either ASCII or binary format. The information in the files is transferred to/from the GPIB using DMA and DOS file transfer functions. ROUTE 488 utilizes a double buffer structure for fastest transfer rates through the system.

Hardware Interrupts:

ROUTE 488 contains a function that will Call user installed service routines for hardware interrupts (IRQs) on GPIB state change. For example, the SRQ line going active can cause an interrupt. A user supplied service routine is called that conducts Parallel/Serial Poll(s) and processes the request from the GPIB device. When the IEEE interface is an addressed Talker or Listener, user functions can be installed to respond to undefined commands on the GPIB (i.e., secondary addressing, entering addressed state, device clear, local and remote conditions, and the receipt of the device trigger message).

Polled Interrupts:

In addition to hardware interrupt capability, ROUTE 488 provides methods to poll for error conditions and GPIB state change. The state change parameters described under hardware interrupts can be checked within a subroutine using the BUSSTAT function. Error conditions can be identified using the status information returned upon the completion of each ROUTE 488 command. Checking for error conditions is recommended during program development. All ROUTE 488 error codes and the SRQ state change can also be directed to the BIOS light pen status function (BPOLL command). This status can be polled using various techniques to provide background error/SRQ state detection. For example, BASIC provides the ON PEN function to poll the status with each PC clock interrupt.

GPIB Support:

All GPIB functions are supported including Serial Poll, Parallel Poll, Primary/Secondary addressing, Talker and Listener addressed functions, and Controller functions.


arrow Compatible Languages:


arrow Programming Examples:

The sample programs in BASIC, C, And Turbo Pascal illustrate the collecting of four channels of data from a logic analyzer. A command string is transmitted to the analyzer to set its parameters. 1024 samples/channel of 12-bit binary data are stored in files or arrays for later analysis. Every language supported by ROUTE 488 has a header file which predefines key constant or variable labels. Any label used in these examples, which is not explicitly defined, is in the header.

C#include <route.h>
main()
{
int indata[4096];
route488(INIT,0,0,0Ox2b8,7,1);
route488(IFCLEAR);
route488(REMOTE);
route488(WRSTR,"24:0”,”W,CLK50m,CHA987.,TR\n);
route488(DET,"24:0’);
route488(RDARRAY,”24:0”,4096,2,indata);
}

Turbo Pascalprogram getdata;
{$i route.btb}
var devadd: ,cmdstr: string[255];
r. PARAMS;indata: integer[4096];
begin
r.ax=INIT;r.bx:=0;r.cx:=0;
r.dx:=$2b8;r.si:=7;r.di:=1;
intr(route488,r);
r.ax:=IFCLEAR;
intr(route488,r);
r.ax:=REMOTE;
intr(route488,r);
devadd:='24:0'*chr(0);r.ax:=WRSTR;
cmdstr:='W,CLK50m,CHA987.,TR'*chr(10);
r.bx:=1+Ofs(devadd);r.ds:=Seg(devadd);
r.di:=1+Ofs(cmdstr);r.es:=Seg(cmdstr);
intr(route488,r);
r.ax:=DET;intr(route488,r);
r.ax:=RDARRAY;r.cx:=4096;r.dx:=2;
r.di:=Ofs(indata);r.es:=Seg(indata);
intr(route488,r);
end.

Driver Comparison

Not only is ROUTE 488 faster in its transfer of data, but it is simpler to use when developing an application. The BASIC programs in this box demonstrate sending a command to a logic analyzer to reset its data collection parameters. Data is transferred into a file. Background error checking is used in the complete ROUTE 488 example via the BASIC OPEN function and the error code identification subroutine in HEADER.BAS. The example BASIC code is the start of the code for a typical BASIC driver.

ROUTE 488
10  CHAIN MERGE "HEADER.BAS”,ALL
410 IRQ=7: MYADD=1: IOADD=696: DMA=1: EMASK=&HFFFF
420 NBYTES=8196: FILE$="LOGIC.DAT":DEVADD$="24:0”
430 CALL ROUTE488(MYADD,MYADD,IOADD,IRQ,DMA,RESULT,INIT)
440 ON PEN GOSUB 1000: PEN ON
450 CALL ROUTE488(RESULT, IFCLEAR)
460 CALL ROUFE488(RESULT, REMOTE)
470 CALL ROUTE488(EMASK, RESULT, BPOLL)
480 CALL ROUTE488(FILE$, HANDLE, LCREATE)
490 OUTSTR$="W,CLK50m,CHA987.,TR”+CHR$(10)
500 CALL ROUTE488(DEVADD$, OUTSTR$, RESULT, WRSTR)
510 CALL ROUTE488(DEVADD$, RESULT, DET)
520 CALL ROUTE488(DEVADD$,NBYTES,HANDLE,RESULT,RDFILE)
530 CALL ROUTE488(HANDLE, RESULT, LCLOSE)
540 END
1000 GOSUB 200: STOP

Standard BASIC Software 10  CLEAR,60000!
20 IBINIT=60000!
30 IBINIT2=IBINIT1+3
40 BLOAD "bib.m”,IBINIT1
50 CALL IBINIT(IBFING,IBTRG,IBCLR,IBPCT,IBSIC,IBLOC,IBPPC,BBNA,IBONLIBRSC,
IBSRE,IBSRV,IBPAD,IBSAD,IBIST,IBDMA,IBEOS,IBTMO,IBEOT)
60 CALL IBINIT2(IBGTS,IBCAC,IBWAIT,IBPOKE,IBWRT,IBWRTA,IBCMD,IBCMDA,IBRD,
IBRAD,IBSTOP,IBRPP,IBRSP,IBDIAG,BXTRC,IBSTA%,IBERR%,IBCNT%)
70 A$="GPIB0”
80 CALL IBFIND(A$,BRD0%)
90 IF IBSTA%<0 THEN 1000
100 A$="DEV24”
110 CALL IBFIND(A$,DEV24%)
120 IF IBSTA%< 0 THEN 1000
130 CALL IBSIC(BRD0%)
140 V%=l
150 CALL IBSRE(BRD0%,V%)
160 EOSV%=&H040A
170 CALL IBEOS(DEV24%,EOSV%)
180 CMD$=“8” 'LAD
190 CALL IBCMD(BRD0%,CMD$)
200 IF IBSTA%< 0 THEN 1000
210 CMD$=“W,CLK50m,CHA987.,TR”+CHR$(10)
220 CALL IBWRT(DEV24%,CMD$)
230 IF IBSTA%< 0 THEN 1000

COMMAND SUMMARY

DCL    Clear all active devices
DET Trigger selected devices
GTL Place selected devices in local control
LLO Place all devices into Local Lockout
SDR Place addressed devices into remote state
PPC Configure devices to Parallel Poll response
PPOLL Conduct a Parallel Poll
PPU Unconfigure devices for Parallel Poll response
Clear addressed devices
SPOLL Conduct a Serial Poll of a device
TCT Pass control over GPIB to another controller
WTCTL Receive control over GPIB

Talker/Listener CPPF Clear Parallel Poll response flag PP2 Set PP2 Parallel Poll response SPPF Set Parallel Poll response flag SRQ Activate Request Service (SRQ) line & configure response for Serial Poll System Controller IFCLEAR Send Interface Clear message LOCAL De-activate the Remote Enable (REN) line REMOTE Activate the REN line Data Transfer SETEND Determine End-of-Sequence Character SETTIME Determine the time out period TRANSFER Transfer data between a remote Talker and remote Listener RDSTR Read data from GPIB into a string variable WRSTR Transfer data to GPIB from a string variable RDFILE Read data from GPIB into a file WRFILE Transfer data to GPIB from a file RDARRAY Read data from GPIB into an array WRARRAY Transfer data to GPIB from array Utility BPOLL Install background error checking BUSSTAT Retrieve GPIB status information GINIT Initialize the IEEE interface in the PC/XT/AT/386 SERVICE Install IRQ service routine to call a user defined function/application CLOSE Close files opened by ROUTE488 CREATE Open a file for saving data from GPIB OPEN Open a file containing data to be sent over GPIB REVERSE Reverses byte ordering of data

System Requirements

Scientific Solutions IEEE-488 card

DOS Ver. 2.0 or higher. Minimum of 96K Bytes free system memory