1.6  INES ドライバ・ライブラリ

        1.  C/C++でのプログラミング
        2.  Visual Basicでのプログラミング
        3.  Borland Delphiでのプログラミング
        4.  TransEra HTBasicでのプログラミング
        5.  関数
            1.  AbortIo
            2.  Clear
            3.  Disable
            4.  Enable
            5.  EntByte
            6.  Enter
            7.  EntFile
            8.  Help
            9.  Init
            10.  LAG
            11.  LLO
            12.  Loc
            13.  Local
            14.  Mode
            15.  MyStat
            16.  OnSrq
            17.  OutByte
            18.  OutCmd
            19.  OutCmdByte
            20.  OutFile
            21.  Output
            22.  PasCnt
            23.  PPD
            24.  PPE
            25.  PPoll
            26.  PPU
            27.  RecCnt
            28.  Remote
            29.  Resume
            30.  Set
            31.  Shadow
            32.  SPoll
            33.  Status
            34.  TAG
            35.  Trigger
            36.  UNL
            37.  UnSet
            38.  UNT

GPIBバスをコントロールするプログラムを書くために、GPIBハードウェアへのインターフェースがあります。 多くのプログラミング言語でGPIBバスを使えるようにinesでは、ドライバーと付属ライブラリをサポートしております。

ines社の新しいGPIBドライバーと付属ライブラリ   The ines IEEE488インターフェース・システムは、GPIBバスをコントロールできるWindowsのアプリケーションが作成できるようにするために、開発者に提供されます。 アプリケーションへのインターフェースは、ダイナミック・リンク・ライブラリー(DLLs)として設計されています。これはWindowsにとっては標準的な方法です。 これらのDLLは関数リファレンスの章にあるIeEnter(),IeOutput(),IeInpt()といったGPIB関数を含んでいます。 これらの関数は、使用されたハードウェア・インターフェースならびにプログラミング言語から独立しています。 GPIB関数は、基礎をなすインターフェース/デバイス・ドライバーと呼ばれています。 ドライバーとその組み込みは、使用されるインターフェース・ハードウェアとWindowsのバージョンによって変わります。

 IEEE-488コマンドがすべての機能の詳細な説明されているとして、以下GPIB関数の一般的な使い方を説明します。 GPIB機能のインプリメンテーションが使っているDLLsによるいつものWindowsの技法であるので、外部のDLLsと呼ぶために考慮するいくらかアプリケーションまたはプログラミング言語経由でGPIBバスをコントロールすることができます。     GPIB関数の組み込みに、DLLを使用した通常のWindowsの技法を使用すると、いろいろなアプリケーションとかexternal DLLコールが許されたプログラミング言語を介在してGPIBバスをコントロールすることが可能です。  マルチスレッドを使用したアプリケーションに対しては特別な注意があります。  GPIB関数は、このような環境で別々のスレッドから同時に呼ばれることから守られなくてはいけません。 アプリケーションは、一度には1つのGPIB関数だけ呼ばれるようにしなくてはいけません。

サンプルファイルは、GPIBバスにアクセスの早い取っ掛かりとしてご利用ください。 このプログラムは、装置/機器が、データバッファを送り出す準備が出来、SRQ割り込みによってコンピュータにデータを渡す様に作られています。 そして、コンピュータのバッファにデータが取り込まれ、表示します。 このサンプルアプリケーションでは、Keithley Instrument社の K195A DMMまたはコンパチブル器(NSCモードのPCでも可)を使用しプライマリーGPIBアドレスは「9」を使用します。

1.6.1  C/C++でのプログラミング

The ines IEEE488 interface for C and C++ supplies the developer with import libraries and include files to access the DLL functions. The GPIB functions are simple C functions. For C++, the declaration is nested in an extern "C" declaration automatically in the include file. In order to use the correct data types and values, the file IEEE488.H must be included. This file includes other necessary files like types488.h itself and contains the necessary function declarations. It is strongly recommended to use the types shown in the command reference to write portable applications. Before including the ines IEEE488.H header file, the WINDOWS.H include file must be included and WINDOWS has to be defined:

#include "windows.h" 
#define WINDOWS      
#include "ieee488.h" 

All functions return an error code. This error code should be evaluated for non zero, which indicates the occurrence of an error.

WORD devPad; 
devPad = 709; 
ret = IeInit(736, 0, 5, 1); if(ret) ...
ret = IeClear(devPad); 
...

On occurrence of an error a messagebox appears with the error message. If the application handles this error by itself, this effect is not desired most times. In this case the function IeMode() may be called to turn off the error messages:

E488 retVal;    
IeMode(99);     
if((retVal = IeInit(736,0,5,1)) != 0)    
  { showError(retVal); return; }     
...      

The C/C++ interface is supplied with import library files which must be linked to the application. The library names are IE488F3W.LIB and IE488H3W.LIB for 32-bit applications. The library IE488F3W.LIB is the import library for the GPIB functions and IE488H3W.LIB contain the error messages and some error related function references. For C/C++ compilers that cannot access the library functions via the supplied import libraries this library may be recreated from the DLLs by using a tool (like 'implib') which is supplied with the compiler.

1.6.2  Visual Basicでのプログラミング

The ines function DLL and help DLL may be accessed from Visual Basic directly. The necessary declarations are found in the IEEE488W.BAS (IEEE488.TXT for Visual Basic 1.0) file. This file has to be included in the Visual Basic project or in the GLOBAL.BAS file. GPIB functions may be called in the usual manner:

ierr% = IeInit(736, 0, 5, 1)  
ierr% = IeSet(709, 10000, 900, 9010) 
ierr% = IeRemote(709)  

All functions return an error code as an integer value. Any nonzero value means the an error has occurred. On occurrence of an error a messagebox appears with the error message. If the application handles the error itself, this effect is not desired most times. In this case the function IeMode() may be called to turn off the error messages:

IeMode(99) 
ierr% = IeInit(736,0,5,1) 
if (ierr% <> 0) GoTo ErrHdlr 

1.6.3  Borland Delphiでのプログラミング

The ines function and help DLL may be accessed by Delphi directly. The file IEEE488W.PAS has to be included in the project. This file contains the unit 'ieee488w' where all necessary declarations are found to write applications that are controlling the GPIB bus. Delphi includes the ieee488w unit if the corresponding file 'IEEE488W.PAS' if specified in the project. Common data types are numeric values, which must be declared as Word and pointer to data areas, which have to be declared as array [0..nn] of Byte.

uses ..., ieee488w, ...;

var 
  pad: Word;
	pad := 709;

  ret := IeInit(736,0,5,1); 
  ret := IeSet(pad,10000,900,900); 
  ret := IeClear(pad);

If Pascal strings are used, the StrPCopy should be used. The Send function which is part of the Delphi sample uses this conversion:

(* send a pascal formatted string to the device specified by pad ,sad *)
     
procedure Send(pad, sad: Word; s: string);      
var                     	
  len, ret : Word;      	
  buffer   : array [0..80] of Byte;      
begin      		
  len := Length(s);     	
  StrPCopy(@buffer, s); 	
  ret :=IeOutput(pad,sad,@buffer,@len);      
end;     			

All functions return an error code as an integer value. Any nonzero value means the an error has occurred. On occurrence of an error a messagebox appears with the error message. If the application handles the error itself, the messagebox is not desired most times. In this case the function IeMode() may be called to turn off the error messages:

var 			
  ret: Word;		
     			
	ret := IeMode(99);	(* turn off error messages *) 
	ret := IeInit(736,0,5,1); 			
  if ret <> 0 then 			
        ...               (* handle this error *) 

1.6.4  TransEra HTBasicでのプログラミング

HT Basic is considered an GPIB application because it does not use the INES function library. Please see the HT Basic subsection of the Application Interfaces section.

1.6.5  関数

1.6.5.1  AbortIo

AbortIo Ends communication on the bus

Synopsis

- C/C++

#include <ieee488.h>
E488 FAR PASCAL IeAbortio (UINT16 seven);

- Visual Basic

Declare Function IeAbortio Lib [...] (ByVal seven%) As Integer

- Delphi

function IeAbortio (seven: Word): SmallInt; stdcall;

Parameter Description

seven
→ Selectcode of the interface. Values: only 7 supported yet
return
↑ 0 on success, ines IEEE488 errorcode on failure.

Abortio ends all communication on the bus according to the following priority:

The use of this command sets all the interface functions to an initialized state. A typical use is at the start of a program or use to recover from an error. The command stops all asynchronous transfers (DMA), that may have been started. Note: This command resets the interface functions of the connected devices, but it does not affect the device function for the measurement range (see Clear).

1.6.5.2  Clear

Clear Sets the specified devices to their initial conditions

Synopsis

- C/C++

#include <ieee488.h>
E488 FAR PASCAL IeClear (UINT16 pad);

- Visual Basic

Declare Function IeClear Lib [...] (ByVal pad%) As Integer

- Delphi

function IeClear (pad: Word): SmallInt; stdcall;

Parameter Description

pad
→ Primary bus address of the device. Values: IE_NOADR (7) or 700 + bus address (0-30)
return
↑ 0 on success, ines IEEE488 errorcode on failure.

Clear resets the device functions of the addressed devices to their initial conditions.

pad=IE_NOADR
Specifies all connected devices(does not perform addressing or unaddressing). Sends the universal command DCL.
pad= 700 + bus address
Specifies a single device, which is identified by it's primary address (performs appropriate addressing). Sends selective device clear SDC.

1.6.5.3  Disable

Disable Disable asynchronous interrupts

Synopsis

- C/C++

#include <ieee488.h>
E488 FAR PASCAL IeDisable (void);

- Visual Basic

Declare Function IeDisable Lib [...] () As Integer

- Delphi

function IeDisable (): SmallInt; stdcall;

Parameter Description

return
↑ 0 on success, ines IEEE488 errorcode on failure.

Asynchronous interrupts are disabled. Disable should be used only when entire sections in a program should not be interrupted.

1.6.5.4  Enable

Enable Enable asynchronous interrupts

Synopsis

- C/C++

#include <ieee488.h>
E488 FAR PASCAL IeEnable (void);

- Visual Basic

Declare Function IeEnable Lib [...] () As Integer

- Delphi

function IeEnable (): SmallInt; stdcall;

Parameter Description

return
↑ 0 on success, ines IEEE488 errorcode on failure.

Enables asynchronous interrupts (see Disable).

1.6.5.5  EntByte

EntByte Read a single byte from the bus into a specified program variable

Synopsis

- C/C++

#include <ieee488.h>
E488 FAR PASCAL IeEntByte (UINT16 pad, UNIT16 sad, LPUINT16 bval);

- Visual Basic

Declare Function IeEntByte Lib [...] (ByVal pad%,
	      ByVal sad%, bval%) As Integer

- Delphi

function IeEntByte (pad, sad: Word; bval: PWord): SmallInt; stdcall;

Parameter Description

pad
→ Primary bus address of the device. Values: IE_NOADR (7) or 700 + bus address (0-30)
sad
→ Secondary bus address of the device. Values 0-31 or IE_NOSAD
bval
← Pointer to a variable which will be updated with the received byte on return.
return
↑ 0 on success, ines IEEE488 errorcode on failure.

This function reads a single byte from the bus. EntByte addresses the device specified by pad and sad as talker if pad is unequal to IE_NOADR. If pad is set to IE_NOADR, no addressing will be done. Using the functions, the secondary address has to be specified. If no secondary address is needed, this parameter has to be set to IE_NOSAD. If at the same time as the data byte is received, the valid termination sequence is recognized (EOI active or EOS byte), then the highest bit of bval is set to '1'. To read more than one byte from the bus, use the Enter function.

1.6.5.6  Enter

Enter Transfers data from the bus into a user specified buffer

Synopsis

- C/C++

#include <ieee488.h>
E488 FAR PASCAL IeEnter (UINT16 pad, UNIT16 sad,
	      LPBYTE buffer, LPUINT16 count);

- Visual Basic

Declare Function IeEnter Lib [...] (ByVal pad%,
	      ByVal sad%, ByVal buffer$, count%) As Integer

- Delphi

function IeEnter (pad, sad: Word; buffer: Pbyte; count: PWord): SmallInt; stdcall;

Parameter Description

pad
→ Primary bus address of the device. Values: IE_NOADR (7) or 700 + bus address (0-30)
sad
→ Secondary bus address of the device. Values 0-31 or IE_NOSAD
buffer
? Pointer to a user defined buffer (or 'C'-string) to place the received data in.
count
? Pointer to a variable which contains the maximal count of bytes to read. The variable contains the count of actual read bytes on return.
return
↑ 0 on success, ines IEEE488 errorcode on failure.

This function reads data from the bus until the specified count is reached or the current termination is recognized. Enter addresses the device specified by pad and sad as talker if pad is unequal to IE_NOADR. If pad is set to IE_NOADR, no addressing will be done. The secondary address has to be specified. If no secondary address is required, this parameter has to be set to IE_NOSAD.

A termination sequence can be chosen with the Set function. If the Set function is not properly assigned, the interface cannot identify a termination sequence when the end of transmission is reached. If the error message 13 end of transfer buffer is returned, check the following:

Note: Enter returns "end of transfer buffer" if the specified count has been reached and no termination is recognized. If you don't want to use any termination (i.e. want termination by specified length), this return value has to be interpreted as completion indicator and not as an error.

1.6.5.7  EntFile

EntFileTransfers data from the bus into a file

Synopsis

- C/C++

#include <ieee488.h>
E488 FAR PASCAL IeEntFile (UINT16 pad, UNIT16 sad, LPBYTE path);

- Visual Basic

Declare function IeEntFile Lib [...] (ByVal pad%, ByVal sad%, ByVal path$) As Integer

- Delphi

function IeEntFile (pad, sad: Word; path: PChar): SmallInt; stdcall;

Parameter Description

pad
→ Primary bus address of the device. Values: IE_NOADR (7) or 700 + bus address (0-30)
sad
→ Secondary bus address of the device. Values 0-31 or IE_NOSAD
path
→ is a valid file name
return
↑ 0 on success, ines IEEE488 errorcode on failure.

This function reads data from the bus and writes it into a file until the current termination is recognized. The file will be created if it does not exists. If it exists, then the data will be appended to it. To replace an existing file, erase it first before calling this function. EntFile addresses the device specified by pad and sad as talker if pad is unequal to IE_NOADR. If pad is set to IE_NOADR, no addressing will be done. If no secondary address is needed, sad has to be set to IE_NOSAD. A termination sequence can be chosen with the Set function.

1.6.5.8  Help

Help Provides information about errors

Synopsis

- C/C++

#include <ieee488.h>
E488 FAR PASCAL IeHelp (UINT16 errno);

- Visual Basic

Declare Function IeHelp Lib [...] (ByVal errno%) As
	      Integer

- Delphi

function IeHelp (errno: Word): SmallInt; stdcall;

Parameter Description

errno
→ ines IEEE488 errorcode
return
↑ always 0

The help function appears on the screen when an error occurs. The help message can be suppressed by using the Mode function. It can also be called by a program. This can be useful when an application wants to suppress the help messages for certain errors. Help displays the ines IEEE488 errorcode and a human readable error description. In addition the current locator value is displayed. The locator value will be set using the Loc function and can be used to find errors in complex programs.

1.6.5.9  Init

InitInitializes the interface

Synopsis

- C/C++

#include <ieee488.h>
E488 FAR PASCAL IeInit (UINT16 ioadrs, UINT16 pad, UINT16 intr, UINT16 dma);

- Visual Basic

Declare Function IeInit Lib [...] (ByVal ioadrs%, ByVal pad%, ByVal intr%,ByVal dma%) As Integer

- Delphi

function IeInit (ioadrs, pad, intr, dma: Word): SmallInt; stdcall;

Parameter Description

ioadrs
→ For compatiblity only: set to 0
pad
→ Primary bus address of the interface. Values: 0-30
intr
→ For compatiblity only: set to 0
dma
→ For compatiblity only: set to 0
return
↑ 0 on success, ines IEEE488 errorcode on failure.

The ines board and the software drivers will be initialized with the specified values. This has to be the first function to be called when using the ines IEEE488 interface. The current interface board becomes the system controller(SYSCTL), IFC is sent and REMOTE ENABLE is set to 'true'. After this, the interface is the active controller. With interface errors which cannot be removed by Abortio, it may be necessary to reset the entire interface system using Init. Following to an Init call the values of previous calls to Set are undefined and should be reinitialized.

1.6.5.10  LAG

LAGSends primary and secondary addresses of a listener

Synopsis

- C/C++

#include <ieee488.h>
E488 FAR PASCAL IeLAG (UINT16 pad, UINT16 sad);

- Visual Basic

Declare Function IeLAG Lib [...] (ByVal pad%,ByVal sad%) As Integer

- Delphi

function IeLAG (pad, sad: Word): SmallInt; stdcall;

Parameter Description

pad
→ Primary bus address of the device. Values: 700 + bus address (0-30)
sad
→ Secondary bus address of the device. Values 0-31 or IE_NOSAD
return
↑ 0 on success, ines IEEE488 errorcode on failure.

LAG addresses the device specified by pad and sad as listener. The specified device is then able to receive data from the bus. Using the functions, the secondary address has to be specified. If no secondary address is needed, this parameter has to be set to IE_NOSAD.

1.6.5.11  LLO

LLO Sends local lockout

Synopsis

- C/C++

#include <ieee488.h>
E488 FAR PASCAL IeLLO (void);

- Visual Basic

Declare Function IeLLO Lib [...] () As Integer

- Delphi

function IeLLO (): SmallInt; stdcall;

Parameter Description

return
↑ 0 on success, ines IEEE488 errorcode on failure.

Local lockout is a universal command that disables the operation panels of the connected devices on the IEEE488 bus.

1.6.5.12  Loc

LocSets the locator value

Synopsis

- C/C++

#include <ieee488.h>
E488 FAR PASCAL IeLoc (UINT16 locator);

- Visual Basic

Declare Function IeLoc Lib [...] (ByVal locator%) As Integer

- Delphi

function IeLoc (locator: Word): SmallInt; stdcall;

Parameter Description

locator
→ value to set
return
↑ 0 on success, ines IEEE488 errorcode on failure.

locator is an integer value specified by the user. This value can be referenced to locate an error when it occurs and shown through the Help function. The locator value is displayed within the help function. Using this method, an error can be located in the program. Each call of Loc will update the locator value. This method is recommended when searching for an error in large programs.

1.6.5.13  Local

Local Disables remote control of devices

Synopsis

- C/C++

#include <ieee488.h>
E488 FAR PASCAL IeLocal (UINT16 pad);

- Visual Basic

Declare Function IeLocal Lib [...] (ByVal pad%) As Integer

- Delphi

function IeLocal (pad: Word): SmallInt; stdcall;

Parameter Description

pad
→ Primary bus address of the device. Values: IE_NOADR (7) or 700 + bus address (0-30)
return
↑ 0 on success, ines IEEE488 errorcode on failure.

Local disables remote control of devices connected to the bus.

pad=IE_NOADR
Affects all connected devices (i.e. does not perform addressing or unaddressing). Sets the REMOTE ENABLE line to 'FALSE' and thereby disables remote control.
pad = 700 + bus address
Affects a single device, which is identified by it's primary address (i. e. performs appropriate addressing). Returns control to the device through the GTL (GoTo Local) command.

1.6.5.14  Mode

Mode Controls the output of the help function

Synopsis

- C/C++

#include <ieee488.h>
E488 FAR PASCAL IeMode (UINT16 mode);

- Visual Basic

Declare Function IeMode Lib [...] (ByVal mode%) As Integer

- Delphi

function IeMode (mode: Word): SmallInt; stdcall;

Parameter Description

mode
→ Display mode for help function. Values: 0, 9, 90, 99
return
↑ 0 on success, ines IEEE488 errorcode on failure.

The Mode function enables/disables the help message appearing when an error occurs. This is useful when an error shall be handled only by the program itself. A value of 0 or 90 enables the help message, a value of 9 or 99 disables it.

1.6.5.15  MyStat

MyStat Sets the interfaces STATUS BYTE (stb) and REQUEST SERVICE (rqs) messages

Synopsis

- C/C++

#include <ieee488.h>
E488 FAR PASCAL IeMyStat (LPUINT16 stb);

- Visual Basic

Declare Function IeMyStat Lib [...] (stb%) As Integer

- Delphi

function IeMyStat (stb: PWord): SmallInt; stdcall;

Parameter Description

stb
→ Pointer to a variable containing the value of the status byte to set
return
↑ 0 on success, ines IEEE488 errorcode on failure.

The MyStat function is used to set the status byte. The bits 0-5 of stb contain information specific to the device, bit 6 is the 'rqs' message. Setting bit 6 causes the interface to activate the SRQ line. The GPIB CIC (controller-in-charge) can use a SERIAL POLL to poll the device. During the poll, the interface sets the SRQ line to 'FALSE'. When MyStat is used with stb=0, it is possible to determine if a SERVICE REQUEST needs to be performed. When the SRQ does not require service, bit 6 in stb is set to 1.

Typically, MyStat is used only if the interface is not the GPIB CIC.

1.6.5.16  OnSrq

OnSrq SRQ interrupt handling

Synopsis

- C/C++

#include <ieee488.h>
E488 FAR PASCAL IeOnSrq (UINT16 mode, LPUINT16 target1, LPUINT16 target2);

- Visual Basic

not available>

- Delphi

function IeOnSrq (mode: Word; target1, target2: PWord): SmallInt; stdcall;

Parameter Description

mode
→ determines the action to be taken when an SRQ interrupt occurs.
target1
→ mode specific information
target2
→ mode specific information
return
↑ 0 on success, ines IEEE488 errorcode on failure.

OnSrq controls the handling of the asynchronous interrupt that occurs when a SERVICE REQUEST message is sent by a device. Depending on the value of mode the following handlings of an occuring SRQ interrupt are available:

mode=0
The OnSrq function is deactivated. The other parameters are ignored. This function must be called before exiting a program.
mode=1
When an SRQ interrupt occurs, the variable specified by target1 and target2 will be set to 1. The parameter target1 must be a pointer to the segment and target2 a pointer to the offset of a user defined variable. Note that the value of the variable specified by target1 and target2 will be changed asynchronously when an interrupt occurs.
mode=2
When an SRQ interrupt occurs, the user defined interrupt function specified by target1 and target2 will be executed. The argument target1 must be a pointer to the segment and target2 a pointer to the offset of the user implemented interrupt function.

1.6.5.17  OutByte

OutByte Send a data byte

Synopsis

- C/C++

#include <ieee488.h>
E488 FAR PASCAL IeOutByte (UINT16 pad, UNIT16 sad, LPUINT16 bval);

- Visual Basic

Declare Function IeOutByte Lib [...] (ByVal pad%, ByVal sad%, bval%) As Integer

- Delphi

function IeOutByte (pad, sad: Word; bval: PWord): SmallInt; stdcall;

Parameter Description

pad
→ Primary bus address of the device. Values: IE_NOADR (7) or 700 + bus address (0-30)
sad
→ Secondary bus address of the device. Values 0-31 or IE_NOSAD
bval
→ Pointer to a variable which contains the value to write
return
↑ 0 on success, ines IEEE488 errorcode on failure.

The OutByte function writes a single data byte to the bus. OutByte addresses the device specified by pad and sad as listener if pad is unequal to IE_NOADR. If pad is set to IE_NOADR, no addressing will be done. If no secondary address is required, this parameter has to be set to IE_NOSAD. The lower byte of bval will be send as data byte over the bus. If the highest bit in the higher byte is set (by adding of 32768 to the value to be send), the termination sequence (EOI and/or EOS byte), that was selected with Set, will be sent (EOI) or appended (EOS byte) at the same time. This signals the end of a message to the addressed listener.

1.6.5.18  OutCmd

OutCmd Send commands (data bytes with ATN asserted)

Synopsis

- C/C++

#include <ieee488.h>
E488 FAR PASCAL IeOutCmd (LPBYTE cmd);

- Visual Basic

Declare Function IeOutCmd Lib [...] (ByVal cmd$) As Integer

- Delphi

function IeOutCmd (cmd: PByte): SmallInt; stdcall;

Parameter Description

cmd
→ Pointer to a buffer which contains a sequence of command bytes to be sent. The command sequence must be null-terminated ('C'-string).
return
↑ 0 on success, ines IEEE488 errorcode on failure.

The function IeOutCmd sends a null-terminated sequence of commands to the bus. This function can generate command sequences which are not defined the standard IEEE488. Note that the interface must be the active controller.

1.6.5.19  OutCmdByte

OutCmdByte Send a command (data byte with ATN asserted)

Synopsis

- C/C++

#include <ieee488.h>
E488 FAR PASCAL IeOutCmdByte (UINT16 cmdbyte);

- Visual Basic

Declare Function IeOutCmdByte Lib [...] (ByVal cmdbyte%) As Integer

- Delphi

function IeOutCmdByte (cmdbyte: Word): SmallInt; stdcall;

Parameter Description

cmdbyte
→ Data byte to be sent as bus command
return
↑ 0 on success, ines IEEE488 errorcode on failure.

The function IeOutCmdByte sends a command over the bus. This function can generate a command which is not defined by the standard IEEE488. Note that the interface must be the active controller.

1.6.5.20  OutFile

OutFile Sends a MS-DOS file to the bus

Synopsis

- C/C++

#include <ieee488.h>
E488 FAR PASCAL IeOutFile (UINT16 pad, UNIT16 sad, LPBYTE path);

- Visual Basic

Declare function IeOutFile Lib [...] (ByVal pad%, ByVal sad%, ByVal path$) As Integer

- Delphi

function IeOutFile (pad, sad: Word; path: PChar): SmallInt; stdcall;

Parameter Description

pad
→ Primary bus address of the device. Values: IE_NOADR (7) or 700 + bus address (0-30)
sad
→ Secondary bus address of the device. Values 0-31 or IE_NOSAD
path
→ a well-formed filename
return
↑ 0 on success, ines IEEE488 errorcode on failure

This function reads data from a file and sends it over the bus. OutFile addresses the device specified by pad and sad as listener if pad is unequal to IE_NOADR. If pad is equal to IE_NOADR, no addressing will be done. If no secondary address is required, sad must be set to IE_NOSAD.

Be aware that OutFile sends the entire file, irrespective of any termination sequences which may be included in the file itself. For this reason, only EOI should be used as termination (see Set) for file transfer.

1.6.5.21  Output

Output Send data over the bus

Synopsis

- C/C++

#include <ieee488.h>
E488 FAR PASCAL IeOutput (UINT16 pad, UNIT16 sad, LPBYTE buffer, LPUINT16 count);

- Visual Basic

Declare Function IeOutput Lib [...] (ByVal pad%, ByVal sad%, ByVal buffer$, count%) As Integer

- Delphi

function IeOutput (pad, sad: Word; buffer: Pbyte; count: PWord): SmallInt; stdcall;

Parameter Description

pad
→ Primary bus address of the device. Values: IE_NOADR (7) or 700 + bus address (0-30)
sad
→ Secondary bus address of the device. Values 0-31 or IE_NOSAD
buffer
→ Pointer to a user defined buffer containing the data to be sent
count
⇔  Pointer to a variable which contains the count of bytes to write. The variable contains the count of actual written bytes on return
return
↑ 0 on success, ines IEEE488 errorcode on failure

The Output function writes data to the bus until the specified count is reached. The data given in buffer will be send unmodified and unformatted to the device. Output addresses the device specified by pad and sad as listener if pad is unequal to IE_NOADR. If pad is equal to IE_NOADR, no addressing will be done. If no secondary address is required, the sad parameter has to be set to IE_NOSAD. The termination sequence for the transfer can be specified with the Set function.

1.6.5.22  PasCnt

PasCnt Pass control of the system to another device

Synopsis

- C/C++

#include <ieee488.h>
E488 FAR PASCAL IePasCnt (UINT16 pad);

- Visual Basic

Declare Function IePasCnt Lib [..] (ByVal pad%) As Integer

- Delphi

function IePasCnt (pad: Word): SmallInt; stdcall;

Parameter Description

pad
→ Primary bus address of the device. Values: IE_NOADR (7) or 700 + bus address (0-30)
return
↑ 0 on success, ines IEEE488 errorcode on failure

Pass control of the system to another device. PasCnt addresses the device specified by pad as talker if pad is not IE_NOADR. If pad is equal to IE_NOADR, no addressing will be done (the current active talker will receive system control). The complementary function is RecCnt. If the control needs to be transferred between two ines-ieee488 systems, then RecCnt must first be activated and then the active controller can call the PasCnt function.

1.6.5.23  PPD

PPD Deactivate parallel-poll response of one or more devices

Synopsis

- C/C++

#include <ieee488.h>
E488 FAR PASCAL IePPD (UINT16 pad);

- Visual Basic

Declare Function IePPD Lib [..] (ByVal pad%) As Integer

- Delphi

function IePPD (pad: Word): SmallInt; stdcall;

Parameter Description

pad
→ Primary bus address of the device. Values: IE_NOADR (7) or 700 + bus address (0-30)
return
↑ 0 on success, ines IEEE488 errorcode on failure

Deactivates the parallel-poll response of one or more devices. If pad is unequal to IE_NOADR, the specified device will be addessed as listener, otherwise all active listeners will receive this command.

1.6.5.24  PPE

PPE Configure one or more devices for parallel polling

Synopsis

- C/C++

#include <ieee488.h>
E488 FAR PASCAL IePPE (UINT16 pad,UINT16 ppc);

- Visual Basic

Declare Function IePPE Lib [..] (ByVal pad%, ByVal ppc%) As Integer

- Delphi

function IePPE (pad, ppc: Word): SmallInt; stdcall;

Parameter Description

pad
→ Primary bus address of the device. Values: IE_NOADR (7) or 700 + bus address (0-30)
ppc
→ Response from a questioned device at the single bit level (parallel poll response)
return
↑ 0 on success, ines IEEE488 errorcode on failure

Configures one or more devices for a parallel-poll response. If pad is unequal to IE_NOADR, the specified device will be addressed as listener, otherwise all active listeners will recognize this command. The ppc parameter is specified as follows:

Bits 0-2
specify the line on which the device shall repond to a parallel poll. Any line from 0 to 7 may be specified.
Bit 3
specifies whether there should be a response on a parallel poll for a true condition of the device or for a false condition. Using this feature a number of devices may be configured to use a single line wired-OR or wired AND, respectively

1.6.5.25  PPoll

PPoll Perform a parallel poll

Synopsis

- C/C++

#include <ieee488.h>
E488 FAR PASCAL IePPoll (LPUINT16 resp);

- Visual Basic

Declare Function IePPoll Lib [..] (resp%) As Integer

- Delphi

function IePPoll (resp: PWord): SmallInt; stdcall;

Parameter Description

resp
← Pointer to a variable which is updated with the answer to the parallel poll on return.
return
↑ 0 on success, ines IEEE488 errorcode on failure

Performs a parallel poll and returns the result in resp.

1.6.5.26  PPU

PPU Deactivate the parallel poll function

Synopsis

- C/C++

#include <ieee488.h>
E488 FAR PASCAL IePPU (void);

- Visual Basic

Declare Function IePPU Lib [..] () As Integer

- Delphi

function IePPU: SmallInt; stdcall;
0 on success, ines IEEE488 errorcode on failure Disables all devices from responses to parallel poll.

1.6.5.27  RecCnt

RecCnt Receive Control

Synopsis

- C/C++

#include <ieee488.h>
E488 FAR PASCAL IeRecCnt (void);

- Visual Basic

Declare Function IeRecCnt Lib [..] () As Integer

- Delphi

function IeRecCnt: SmallInt; stdcall;

Parameter Description

return
↑ 0 on success, ines IEEE488 errorcode on failure

Enables the ines-ieee488 to become the active controller when operating as a device (CIDS). The complementary function is PasCnt. If the control needs to be transferred from one ieee488 system to another, then RecCnt must first be activated and then the active controller can issue the PasCnt function.

1.6.5.28  Remote

Remote Set devices in the remote control condition

Synopsis

- C/C++

#include <ieee488.h>
E488 FAR PASCAL IeRemote (UINT16 pad);

- Visual Basic

Declare Function IeRemote Lib [...] (ByVal pad%) As Integer

- Delphi

function IeRemote (pad: Word): SmallInt; stdcall;

Parameter Description

pad
→ Primary bus address of the device. Values: IE_NOADR (7) or 700 + bus address (0-30)
return
↑ 0 on success, ines IEEE488 errorcode on failure

Remote sets the REMOTE ENABLE line true and thereby enables remote control of the attached devices. In addition, if pad is unequal to IE_NOADR, the specified device will be addressed as listener. This command requires the interface to be the system controller.

1.6.5.29  Resume

Resume Place an active controller in the standby status

Synopsis

- C/C++

#include <ieee488.h>
E488 FAR PASCAL IeResume (void);

- Visual Basic

Declare Function IeResume Lib [..] () As Integer

- Delphi

function IeResume: SmallInt; stdcall;

Parameter Description

return
↑ 0 on success, ines IEEE488 errorcode on failure

Place an active controller in the standby status. 'ATN' is set to FALSE.

1.6.5.30  Set

Set Set the interface parameters for devices on the bus.

Synopsis

- C/C++

#include <ieee488.h>
E488 FAR PASCAL IeSet (UINT16 pad, UINT16 tmo, UINT16 termin, UINT16 termout);

- Visual Basic

Declare Function IeSet Lib [...] (ByVal pad%, ByVal tmo%, ByVal termin%,ByVal termout%) As Integer

- Delphi

function IeSet (pad, tmo, termin, termout: Word): SmallInt; stdcall;

Parameter Description

pad
→ Primary bus address of the device. Values: IE_NOADR (7) or 700 + bus address (0-30)
tmo
→ Timeout in milliseconds if acting as controller, otherwise timeout in units of 10 milliseconds. If tmo is specified as 0 no time limit will be enabled.
termin
→ Termination to use on input.
termout
→ Termination to use on output.
return
↑ 0 on success, ines IEEE488 errorcode on failure

Sets the interface parameters for devices on the bus. If pad is not IE_NOADR the parameters will be set only for the specified device. Otherwise the parameters will be set for all devices that has not been already configured by a call of Set with pad unequal to IE_NOADR.

The setting of a device will be activated if its address is sent. Only the primary address is used for device settings. An activate setting remains active until another device is addressed.

The settings available for termination values (termin/termout) are:

0
The data blocks will not be terminated. During a listener transfer (see Enter), this may result in the error message "unexpected end of transfer buffer". If using a board with FIFO buffer, the FIFO can be activated by adding a 1 to this value.
900
Data blocks will be terminated with EOI. During a talker transfer, the EOI line will be set to 'true' with the last byte of data, and signals the end of the block. During a listener transfer, the input of data is stopped at the first byte with EOI set to 'TRUE'. If using a board with FIFO buffer, the FIFO can be activated by adding a 1 to this value.
1XXX
Data blocks will be delimited by the byte specified by decimal 'XXX'. The listener transfer ends with the reception of this byte. During a talker transfer, the byte specified by 'XXX' is appended to the data. The values allowed are between 1000 (EOS byte 00) and 1255 (EOS byte 0FFH). The EOI line is ignored. If using a board with FIFO buffer, the FIFO can be activated by adding 256 (100H) to this value.
9XXX
Data blocks will be delimited by the byte specified by decimal 'XXX' and/or EOI 'TRUE'. The listener transfer ends with the reception of the EOS byte or recognition of EOI 'TRUE'. During a talker transfer, the byte specified by 'XXX' will be appended to the data and the EOI line will be set to 'TRUE' at the same time. The values allowed are between 9000 (EOS byte 00) and 9255 (EOS byte 0FFH). If using a board with FIFO buffer, the FIFO can be activated by adding 256 (100H) to this value.
1XXXX ATN mode
The interface system is allowed to assert the ATN line immediately after a data transfer. This can be disabled, however, since setting ATN TRUE immediately after a data transfer can sometimes prompt a malfunction of certain devices. By adding 10.000 (decimal) to the termin/termout value you make sure the ATN line remains in the unasserted state after a data transfer. Also, ATN is asserted not earlier than the next ieee488 function call.
Initial Settings (Default Setting) After the initialization of the ines-ieee488, the following values are used as default settings: timeout = 1000 ms, termin = 900 EOI, termout = 9010 EOI/LF. Note: The assignment can be undone (set to the default) with the UnSet function.

1.6.5.31  Shadow

Shadow Performs listener handshaking without reading in data to check for valid termination

Synopsis

- C/C++

#include <ieee488.h>
E488 FAR PASCAL IeShadow (void);

- Visual Basic

Declare Function IeShadow Lib [..] () As Integer

- Delphi

function IeShadow: SmallInt; stdcall;

Parameter Description

return
↑ 0 on success, ines IEEE488 errorcode on failure
Enables the active controller to passively 'listen in' on the bus, so that it can take over control upon recognition of a termination sequence (see Set). Corresponds to the 'Enter 7' function with the exception that data is not transfered to a variable.

1.6.5.32  SPoll

SPoll Perform a Serial Poll

Synopsis

- C/C++

#include <ieee488.h>
E488 FAR PASCAL IeSPoll (UINT16 pad, LPUINT16 resp);

- Visual Basic

Declare Function IeSPoll Lib [..] (ByVal pad%, resp%) As Integer

- Delphi

function IeSPoll (pad:Word; resp: PWord): SmallInt; stdcall;

Parameter Description

pad
→ Primary bus address of the device. Values: IE_NOADR (7) or 700 + bus address (0-30)
resp
← Pointer to a variable which is updated with the answer to the serial poll on return.
return
↑ 0 on success, ines IEEE488 errorcode on failure

The serial poll function allows the questioning of devices as to their momentary status. SPoll addresses the device specified by pad as talker if pad is not IE_NOADR. If pad is equal to IE_NOADR, no addressing will be done.

All devices can be set to a condition that instructs them to send an individual status byte on request. This is made possible with the universal command SPE (Serial Poll Enable). After this, the first polled device is activated by sending its talker address. The device then sends its status byte in return. After receiving this message, it is possible to poll other devices. At the end of such a sequence, the command SPD (Serial Poll Disable) should be sent. The function IeSPoll handles this entire procedure in one call. The serial poll response resp has bit 6 set if the device queried requested service (SRQ).

1.6.5.33  Status

Status Allows the polling of the interface status

Synopsis

- C/C++

#include <ieee488.h>
E488 FAR PASCAL IeStatus (LPUINT16 status);

- Visual Basic

Declare Function IeStatus Lib [..] (status%) As Integer

- Delphi

function IeStatus (status: PWord): SmallInt; stdcall;

Parameter Description

status
? Pointer to a variable which contains the selector for the status call. On return it is updated with the current interface status. This value is interpreted at bit level.
return
↑ 0 on success, ines IEEE488 errorcode on failure.

Status returns the current interface status. The selection of which status will be returned is specified by initializing status to one of the following values before calling the function:

status=1
returns the interface condition and the interface bus address. The information in the lower byte (bits 0-7) at bit level is:
Table 1 
BitMeaning
REMinterface is in a REMOTE condition
LLOLOCAL LOCKOUT is active
ATNthe ATTENTION line is asserted
SRQSERVICE REQUEST line is active
LAinterface is addressed as a Listener
TAinterface is addressed as a Talker
EOIEOI line is active
The high byte (bits 8 - 15) contains the GPIB bus address of the interface, as has been set by Init
status=2
returns the ines-ieee488 internal condition flags as follows:
Table 2 LowByte
BitMeaning
INITSystem was initialized without any errors
CACSController function is active
CSBSController function is in standby
CIDSController function is idle
SYSCThe interface is the system controller
Table 3 HighByte
BitMeaning
DONEAynchronous data transfer has been completed (This bit is 0 after activating an asynchonous transfer)
DMAAsynchronous data transfer was started and is still active
status=3
returns the current condition of a DMA transfer
status=4
number of bytes that are still left to transfer (0=operation is finished)
status=5
returns the event status of the interface. After reading this status value, the bits are reset to '0'.
Table 4 LowByte
BitMeaning
DTAS Set if the ieee488 is operating as a device and the GET(Group Execute Trigger) command has been received. See also the Trigger function.
UNCCommand that cannot be decoded was received
DCASDEVICE CLEAR or SELECTED DEVICE CLEAR command has been received.
ADSCAddress status changed
SRQSRQ has been set to 'true'
The high byte (bit 15-8) is undefined.

1.6.5.34  TAG

TAG Send primary and secondary addresses of a talker

Synopsis

- C/C++

#include <ieee488.h>
E488 FAR PASCAL IeTAG (UINT16 pad, UINT16 sad);

- Visual Basic

Declare Function IeTAG Lib [...] (ByVal pad%,ByVal sad%) As Integer

- Delphi

function IeTAG (pad, sad: Word): SmallInt; stdcall;

Parameter Description

pad
→ Primary bus address of the device. Values: IE_NOADR (7) or 700 + bus address (0-30)
sad
→ Secondary bus address of the device. Values 0-31 or IE_NOSAD
return
↑ 0 on success, ines IEEE488 errorcode on failure

TAG addresses the device specified by pad and sad as talker. The specified device is then able to send data on the bus. If no secondary address is needed, sad parameter must be set to IE_NOSAD. The transfer parameters are activated as specified by the Set command for that device.

1.6.5.35  Trigger

Trigger Send a GROUP EXECUTE TRIGGER

Synopsis

- C/C++

#include <ieee488.h>
E488 FAR PASCAL IeTrigger (UINT16 pad);

- Visual Basic

Declare Function IeTrigger Lib [...] (ByVal pad%) As Integer

- Delphi

function IeTrigger (pad: Word): SmallInt; stdcall;

Parameter Description

pad
→ Primary bus address of the device. Values: IE_NOADR (7) or 700 + bus address (0-30)
return
↑ 0 on success, ines IEEE488 errorcode on failure

Trigger addresses the device specified by pad as listener if pad is not IE_NOADR. If pad is equal to IE_NOADR, no addressing will be done. This command sends a GROUP EXECUTE TRIGGER command to all addressed devices. With devices that have a DEVICE TRIGGER function, the reception of this command causes the start of measurement sequences, etc.

1.6.5.36  UNL

UNL Unaddress all listeners

Synopsis

- C/C++

#include <ieee488.h>
E488 FAR PASCAL IeUNL (void);

- Visual Basic

Declare Function IeUNL Lib [...] () As Integer

- Delphi

function IeUNL (): SmallInt; stdcall;

Parameter Description

return
↑ 0 on success, ines IEEE488 errorcode on failure

This command unaddresses all listener devices by sending the universal command UNL to the bus.

1.6.5.37  UnSet

UnSet Deactivate device settings.

Synopsis

- C/C++

#include <ieee488.h>
E488 FAR PASCAL IeUnSet (UINT16 pad);

- Visual Basic

Declare Function IeUnSet Lib [...] (ByVal pad%) As Integer

- Delphi

function IeUnSet (pad: Word): SmallInt; stdcall;

Parameter Description

pad
→ Primary bus address of the device. Values: IE_NOADR (7) or 700 + bus address (0-30)
return
↑ 0 on success, ines IEEE488 errorcode on failure

The device settings for the specified device are deactivated. This means, the standard values will be used for this device. The standard values are specified by a former call of Set with pad given as IE_NOADR. If no former call of Set with pad=IE_NOADR was made, the default parameters (see Set) are used as standard parameters.

1.6.5.38  UNT

UNT Unaddress the active talker

Synopsis

- C/C++

#include <ieee488.h>
E488 FAR PASCAL IeUNT (void);

- Visual Basic

Declare Function IeUNT Lib [...] () As Integer

- Delphi

function IeUNT (): SmallInt; stdcall;

Parameter Description

return
↑ 0 on success, ines IEEE488 errorcode on failure

This command unaddresses the current talker device by sending the universal command UNT to the bus.