ADL-GPIB · menu (Visual C/C++ 4.0). Remember to link ADL-GPIB’s import library GPIB-32.LIB....

116
Advance Technologies; Automate the World. Manual Rev. 2.00 Revision Date: April 14, 2005 Part No: 50-15043-1000 ADL-GPIB IEEE 488 commands Function Reference Manual

Transcript of ADL-GPIB · menu (Visual C/C++ 4.0). Remember to link ADL-GPIB’s import library GPIB-32.LIB....

Page 1: ADL-GPIB · menu (Visual C/C++ 4.0). Remember to link ADL-GPIB’s import library GPIB-32.LIB. Creating a Windows 2000/NT/98 ADL-GPIB Application Using Microsoft Visual Basic To create

Advance Technologies; Automate the World.

Manual Rev. 2.00

Revision Date: April 14, 2005

Part No: 50-15043-1000

ADL-GPIB IEEE 488 commands

Function Reference Manual

Page 2: ADL-GPIB · menu (Visual C/C++ 4.0). Remember to link ADL-GPIB’s import library GPIB-32.LIB. Creating a Windows 2000/NT/98 ADL-GPIB Application Using Microsoft Visual Basic To create

Copyright 2005 ADLINK TECHNOLOGY INC.

All Rights Reserved.

The information in this document is subject to change without priornotice in order to improve reliability, design, and function and doesnot represent a commitment on the part of the manufacturer.

In no event will the manufacturer be liable for direct, indirect, spe-cial, incidental, or consequential damages arising out of the use orinability to use the product or documentation, even if advised ofthe possibility of such damages.

This document contains proprietary information protected by copy-right. All rights are reserved. No part of this manual may be repro-duced by any mechanical, electronic, or other means in any formwithout prior written permission of the manufacturer.

Trademarks

Product names mentioned herein are used for identification pur-poses only and may be trademarks and/or registered trademarksof their respective companies.

Page 3: ADL-GPIB · menu (Visual C/C++ 4.0). Remember to link ADL-GPIB’s import library GPIB-32.LIB. Creating a Windows 2000/NT/98 ADL-GPIB Application Using Microsoft Visual Basic To create

Getting Service from ADLINKCustomer Satisfaction is top priority for ADLINK Technology Inc.Please contact us should you require any service or assistance.

ADLINK TECHNOLOGY INC.Web Site: http://www.adlinktech.comSales & Service: [email protected]: +886-2-82265877FAX: +886-2-82265717Address: 9F, No. 166, Jian Yi Road, Chungho City,

Taipei, 235 Taiwan

Please email or FAX this completed service form for prompt andsatisfactory service.

Company Information

Company/OrganizationContact PersonE-mail AddressAddressCountryTEL FAX:Web Site

Product InformationProduct Model

EnvironmentOS:M/B: CPU:Chipset: Bios:

Please give a detailed description of the problem(s):

Page 4: ADL-GPIB · menu (Visual C/C++ 4.0). Remember to link ADL-GPIB’s import library GPIB-32.LIB. Creating a Windows 2000/NT/98 ADL-GPIB Application Using Microsoft Visual Basic To create
Page 5: ADL-GPIB · menu (Visual C/C++ 4.0). Remember to link ADL-GPIB’s import library GPIB-32.LIB. Creating a Windows 2000/NT/98 ADL-GPIB Application Using Microsoft Visual Basic To create

Table of Contents i

Table of Contents1 Using ADL-GPIB Functions............................................... 1

1.1 The Fundamentals of Building Windows 2000/NT/98 Applica-tion with ADL-GPIB.................................................... 1

1.2 ADL-GPIB Functions Overview ........................................... 41.3 Data Types ........................................................................ 10

2 IEEE 488 Function Reference.......................................... 112.1 ibask .................................................................................. 112.2 ibbna .................................................................................. 152.3 ibcac .................................................................................. 152.4 ibclr .................................................................................... 172.5 ibcmd ................................................................................. 182.6 ibcmda ............................................................................... 192.7 ibconfig .............................................................................. 212.8 ibdev .................................................................................. 282.9 ibdma ................................................................................. 302.10 ibeot ................................................................................... 312.11 ibeos .................................................................................. 322.12 ibfind .................................................................................. 342.13 ibgts ................................................................................... 352.14 ibist .................................................................................... 362.15 iblines................................................................................. 372.16 ibln ..................................................................................... 392.17 ibloc ................................................................................... 412.18 ibonl ................................................................................... 422.19 ibnotify ............................................................................... 432.20 ibpad .................................................................................. 462.21 ibsad .................................................................................. 472.22 ibpct ................................................................................... 482.23 ibppc .................................................................................. 492.24 ibrd..................................................................................... 512.25 ibrda................................................................................... 532.26 ibrdf.................................................................................... 552.27 ibrpp................................................................................... 572.28 ibrsc ................................................................................... 582.29 ibrsp ................................................................................... 592.30 ibrsv ................................................................................... 602.31 ibsic.................................................................................... 61

Page 6: ADL-GPIB · menu (Visual C/C++ 4.0). Remember to link ADL-GPIB’s import library GPIB-32.LIB. Creating a Windows 2000/NT/98 ADL-GPIB Application Using Microsoft Visual Basic To create

ii Table of Contents

2.32 ibsre ................................................................................... 622.33 ibstop ................................................................................. 632.34 ibtmo .................................................................................. 642.35 ibtrg .................................................................................... 662.36 ibwait.................................................................................. 672.37 ibwrt ................................................................................... 692.38 ibwrta ................................................................................. 712.39 ibwrtf .................................................................................. 73

3 Multi-Device IEEE 488 Function Reference .................... 753.1 AllSpoll ............................................................................... 753.2 DevClear ............................................................................ 763.3 DevClearList ...................................................................... 773.4 EnableLocal ....................................................................... 783.5 EnableRemote ................................................................... 793.6 FindLstn ............................................................................. 803.7 FindRQS ............................................................................ 813.8 PassControl ....................................................................... 823.9 PPoll .................................................................................. 833.10 PPollConfig ........................................................................ 843.11 PPollUnConfig.................................................................... 853.12 RcvRespMsg...................................................................... 863.13 ReadStatusByte................................................................. 873.14 Receive.............................................................................. 883.15 ReceiveSetup..................................................................... 893.16 ResetSys............................................................................ 903.17 Send .................................................................................. 913.18 SendCmds ......................................................................... 923.19 SendDataBytes.................................................................. 933.20 SendList ............................................................................. 943.21 SendIFC............................................................................. 953.22 SendLLO............................................................................ 963.23 SendSetup ......................................................................... 973.24 SetRWLS ........................................................................... 983.25 TestSRQ ............................................................................ 993.26 TestSys............................................................................ 1003.27 Trigger.............................................................................. 1013.28 TriggerList ........................................................................ 1023.29 WaitSRQ.......................................................................... 103

Appendix A: Status Codes............................................... 105

Page 7: ADL-GPIB · menu (Visual C/C++ 4.0). Remember to link ADL-GPIB’s import library GPIB-32.LIB. Creating a Windows 2000/NT/98 ADL-GPIB Application Using Microsoft Visual Basic To create

Table of Contents iii

Appendix B: Error Codes ................................................. 106

Page 8: ADL-GPIB · menu (Visual C/C++ 4.0). Remember to link ADL-GPIB’s import library GPIB-32.LIB. Creating a Windows 2000/NT/98 ADL-GPIB Application Using Microsoft Visual Basic To create

iv List of Tables

List of TablesTable 1-1: IEEE 488 Device Level Function Group ................... 4Table 1-2: IEEE 488 Board Level Function Group ..................... 6Table 1-3: IEEE 488.2 Function Group ...................................... 8Table 1-4: Data Types ............................................................. 10Table 2-1: ibask Board Configuration Parameter Options ....... 12Table 2-2: ibask Device Configuration Parameter Options ...... 14Table 2-3: Board Configuration Parameter Options ................. 22Table 2-4: Board Configuration Parameter Options ................. 24Table 2-5: Device Configuration Parameter Options ............... 26Table 4-1: Status Codes ........................................................ 105Table 4-2: Error Codes .......................................................... 106

Page 9: ADL-GPIB · menu (Visual C/C++ 4.0). Remember to link ADL-GPIB’s import library GPIB-32.LIB. Creating a Windows 2000/NT/98 ADL-GPIB Application Using Microsoft Visual Basic To create

List of Figures v

List of FiguresFigure 1-1: Open Project dialog box ............................................ 2

Page 10: ADL-GPIB · menu (Visual C/C++ 4.0). Remember to link ADL-GPIB’s import library GPIB-32.LIB. Creating a Windows 2000/NT/98 ADL-GPIB Application Using Microsoft Visual Basic To create
Page 11: ADL-GPIB · menu (Visual C/C++ 4.0). Remember to link ADL-GPIB’s import library GPIB-32.LIB. Creating a Windows 2000/NT/98 ADL-GPIB Application Using Microsoft Visual Basic To create

Using ADL-GPIB Functions 1

1 Using ADL-GPIB FunctionsADL-GPIB is a software driver for ADLINK GPIB interface.

1.1 The Fundamentals of Building Windows 2000/NT/98 Application with ADL-GPIB

Creating a Windows 2000/NT/98 ADL-GPIB Application Using Microsoft Visual C/C++To create a data acquisition application using ADL-GPIB andMicrosoft Visual C/C++, follow these steps after entering Visual C/C++:

1. Open the project in which you want to use ADL-GPIB.This can be a new or existing project

2. Include header file ADGPIB.H in the C/C++ source filesthat call ADL-GPIB functions. ADGPIB.H contains all thefunction declarations and constants that you can use todevelop your data acquisition application. Incorporatethe following statement in your code to include theheader file.

#include “ADGPIB.H”

3. Build your application.

Setting the appropriate compile and link options, then buildyour application by selecting the Build command from Buildmenu (Visual C/C++ 4.0). Remember to link ADL-GPIB’simport library GPIB-32.LIB.

Creating a Windows 2000/NT/98 ADL-GPIB Application Using Microsoft Visual BasicTo create a data acquisition application using ADL-GPIB andVisual Basic, follow these steps after entering Visual Basic:

1. Open the project in which you want to use ADL-GPIB.This can be a new or existing project

Open a new project by selecting the New Project commandfrom the File menu. If it is an existing project, open it by select-

Page 12: ADL-GPIB · menu (Visual C/C++ 4.0). Remember to link ADL-GPIB’s import library GPIB-32.LIB. Creating a Windows 2000/NT/98 ADL-GPIB Application Using Microsoft Visual Basic To create

2 Using ADL-GPIB Functions

ing the Open Project command from the File menu. Then theOpen Project dialog box appears.

Figure 1-1: Open Project dialog box

Chang directory to the place the project file located. Double-click the project file name in the File Name list to load theproject.

2. Add file ADGPIB.BAS into the project if this file is notincluded in the project. This file contains all the proce-dure declarations and constants that you can use todevelop your data acquisition application.

3. Design the interface for the application.

To design the interface, you place the desired elements, suchas command button, list box, text box, etc., on the Visual Basicform. These are standard controls from the Visual Basic Tool-box. To place a control on a form, you just move pointer to Tool-box, select the desired control and draw it on the form. Or youcan double-click the control icon in the Toolbox to place it onthe form.

4. Set properties for the controls.

Page 13: ADL-GPIB · menu (Visual C/C++ 4.0). Remember to link ADL-GPIB’s import library GPIB-32.LIB. Creating a Windows 2000/NT/98 ADL-GPIB Application Using Microsoft Visual Basic To create

Using ADL-GPIB Functions 3

To view the property list, click the desired control and thenchoose the Properties command from the View menu or press

F4, or you can also click the Properties button on the tool-bar.

5. Write the event code.

The event code defines the action you want to perform whenan event occurs. To write the event code, double-click thedesired control or form to view the code module and then addcode you want. You can call the functions that declared in thefile ADGPIB.BAS to perform data acquisition operations.

6. Run your application.

To run the application, choose Start from the Run menu, or

click the Start icon on the toolbar (you can also press F5).

7. Distribute your application.

Once you have finished a project, you can save the applicationas an executable (.EXE) file by using the Make EXE File com-mand on the File menu. And once you have saved your appli-cation as an executable file, you've ready to distribute it. Whenyou distribute your application, remember also to include theADL-GPIB’s DLL and driver files.

Page 14: ADL-GPIB · menu (Visual C/C++ 4.0). Remember to link ADL-GPIB’s import library GPIB-32.LIB. Creating a Windows 2000/NT/98 ADL-GPIB Application Using Microsoft Visual Basic To create

4 Using ADL-GPIB Functions

1.2 ADL-GPIB Functions OverviewADL-GPIB functions are grouped to the following classes:

IEEE 488 Device Level Function Group

Function Description

ibask Return the current setting value of the selected configuration itemibbna Set the access board of a deviceibclr Clear a specific device

ibconfig Set the software configuration parametersibdev Open and initialize a deviceibeos Configure the end-of-string (EOS) termination mode or character

ibeot Enable or disable the automatic assertion of the GPIB EOI line atthe end of write I/O operations

ibln Check for the presence of a device on the busibloc Go to localibonl Place the device online or offlineibpad Set the primary addressibpct Pass control to another GPIB device with Controller capabilityibppc Configure Parallel pollingibrd Read data from a device into a buffer

ibrda Read data asynchronously from a device into a bufferibrdf Read data from a device into a fileibrdi Read data from a device into a buffer

ibrdia Read data asynchronously from a device into a bufferibrpp Perform a parallel pollibrsp Perform a serial pollibsad Set or disable the secondary addressibstop Abort asynchronous I/O operationibtmo Set or disable the I/O timeout periodibtrg Trigger selected device

ibwait Wait for GPIB events

Table 1-1: IEEE 488 Device Level Function Group

Page 15: ADL-GPIB · menu (Visual C/C++ 4.0). Remember to link ADL-GPIB’s import library GPIB-32.LIB. Creating a Windows 2000/NT/98 ADL-GPIB Application Using Microsoft Visual Basic To create

Using ADL-GPIB Functions 5

ibwrt Write data to a device from a bufferibwrta Write data asynchronously to a device from a bufferibwrtf Write data to a device from a file

Function Description

Table 1-1: IEEE 488 Device Level Function Group

Page 16: ADL-GPIB · menu (Visual C/C++ 4.0). Remember to link ADL-GPIB’s import library GPIB-32.LIB. Creating a Windows 2000/NT/98 ADL-GPIB Application Using Microsoft Visual Basic To create

6 Using ADL-GPIB Functions

IEEE 488 Board Level Function Group

Function Purpose

ibask Return the current setting value of the selected configuration itemibcac Become Active Controller stateibcmd Send GPIB commands

ibcmda Send GPIB commands asynchronouslyibconfig Set the software configuration parametersibdma Enable or disable DMAibeos Configure the end-of-string (EOS) termination mode or character

ibeot Enable or disable the automatic assertion of the GPIB EOI line atthe end of write I/O operations

ibfind Open and initialize a GPIB boardibgts Go from Active Controller state to Standby Controller stateibist Set or clear the board individual status bit for parallel polls

iblines Return the status of the GPIB control linesibln Check for the presence of a device on the busibloc Go to localibonl Place the interface board online or offlineibpad Set the primary addressibppc Configure Parallel pollingibrd Read data from a device into a buffer

ibrda Read data asynchronously from a device into a bufferibrdf Read data from a device into a fileibrdi Read data from a device into a bufferibrdia Read data asynchronously from a device into a bufferibrpp Perform a parallel pollibrsc Request or release system controlibrsv Request service and change the serial poll status byteibsad Set or disable the secondary addressibsic Assert interface clearibsre Set or clear the Remote Enable (REN) lineibstop Abort asynchronous I/O operation

Table 1-2: IEEE 488 Board Level Function Group

Page 17: ADL-GPIB · menu (Visual C/C++ 4.0). Remember to link ADL-GPIB’s import library GPIB-32.LIB. Creating a Windows 2000/NT/98 ADL-GPIB Application Using Microsoft Visual Basic To create

Using ADL-GPIB Functions 7

ibtmo Set or disable the I/O timeout periodibwait Wait for GPIB eventsibwrt Write data to a device from a user bufferibwrta Write data asynchronously to a device from a user bufferibwrtf Write data to a device from a file

Function Purpose

Table 1-2: IEEE 488 Board Level Function Group

Page 18: ADL-GPIB · menu (Visual C/C++ 4.0). Remember to link ADL-GPIB’s import library GPIB-32.LIB. Creating a Windows 2000/NT/98 ADL-GPIB Application Using Microsoft Visual Basic To create

8 Using ADL-GPIB Functions

IEEE 488.2 Function Group

Routine Purpose

AllSpoll Serial polling all devicesDevClear Clear a single device

DevClearList Clear multiple devices

EnableLocal Enable operations from the front panel of devices (leave remote programming mode)

EnableRemote Enable remote GPIB programming for devicesFindLstn Find listening devices on the GPIBFindRQS Determine which device is requesting service

PassControl Pass control to another device with Controller capabilityPPoll Perform a parallel poll on the GPIB

PPollConfig Configure a device for parallel pollsPPollUnconfig Unconfigure devices for parallel pollsRcvRespMsg Read data bytes from a device addressed to talk

ReadStatusByte Conduct serial polling single deviceReceive Read data bytes from a device

ReceiveSetup Address a device to be a Talker and the interface board to bea Listener

ResetSys Reset and initialize devicesSend Send data bytes to a device

SendCmds Send GPIB command bytesSendDataBytes Send data bytes to devices addressed to listen

SendIFC Reset the GPIB by sending interface clearSendList Send data bytes to multiple GPIB devicesSendLLO Send the Local Lockout (LLO) message to all devices

SendSetup Set up devices to receive data in preparation for Send-DataBytes

SetRWLS Place devices in remote with lockout state

TestSRQ Determine the current state of the GPIB Service Request (SRQ) line

TestSys Trigger a devices to conduct self-testsTrigger Trigger a device

Table 1-3: IEEE 488.2 Function Group

Page 19: ADL-GPIB · menu (Visual C/C++ 4.0). Remember to link ADL-GPIB’s import library GPIB-32.LIB. Creating a Windows 2000/NT/98 ADL-GPIB Application Using Microsoft Visual Basic To create

Using ADL-GPIB Functions 9

TriggerList Trigger multiple devices

WaitSRQ Wait until a device asserts the GPIB Service Request (SRQ) line

Routine Purpose

Table 1-3: IEEE 488.2 Function Group

Page 20: ADL-GPIB · menu (Visual C/C++ 4.0). Remember to link ADL-GPIB’s import library GPIB-32.LIB. Creating a Windows 2000/NT/98 ADL-GPIB Application Using Microsoft Visual Basic To create

10 Using ADL-GPIB Functions

1.3 Data Types We defined some data types in ADGPIB.H. These data types areused by ADL-GPIB library. We suggest you to use these datatypes in your application programs. The following table shows thedata type names, their ranges and the corresponding data types inC/C++, Visual Basic and Delphi (We didn’t define these data typesin ADGPIB.BAS and ADGPIB.PAS. Here they are just listed forreference)

Type Name Description RangeType

C/C++( for 32-bit compiler) Visual Basic Pascal

(Delphi)

U8 8-bit ASCII character 0 to 255 unsigned char Byte Byte

I16 16-bit signed integer -32768 to 32767 short Integer SmallInt

U16 Addr4882_t 16-bit unsigned integer 0 to 65535 unsigned short

Not supported by BASIC,

use the signed

integer (I16) instead

Word

I32 ssize_t 32-bit signed integer -2147483648 to 2147483647 long Long LongInt

U32 size_t 32-bit unsigned integer 0 to 4294967295 unsigned long

Not supported by BASIC,

use the signed long integer (I32)

instead

Cardinal

F32 32-bit single-precision floating-point -3.402823E38 to 3.402823E38 float Single Single

F64 64-bit double-precision floating-point

-1.797683134862315E308 to 1.797683134862315E309 double Double Double

Table 1-4: Data Types

Page 21: ADL-GPIB · menu (Visual C/C++ 4.0). Remember to link ADL-GPIB’s import library GPIB-32.LIB. Creating a Windows 2000/NT/98 ADL-GPIB Application Using Microsoft Visual Basic To create

IEEE 488 Function Reference 11

2 IEEE 488 Function Reference2.1 ibask

@ DescriptionReturn the current setting value of the selected configuration item.

@ Support LevelBoard / Device level

@ SyntaxMicrosoft C/C++ and Borland C++

int ibask (int ud, int option, int *value )Visual Basic

ilask (ByVal ud As Integer, ByVal opt As Integer, rval As Integer) As Integer

orcall ibask (ByVal ud As Integer, ByVal opt As

Integer, rval As Integer)

@ Parameterud: board or device unit descriptor

option: the configuration item whose value is being returned.The valid option items are listed in the table 2.1 and 2.2.

value: returns current value of the specified configuration item.

@ Return CodeThe value of ibsta.

@ Possiable Error CodesEARG, ECAP, EDVR

Page 22: ADL-GPIB · menu (Visual C/C++ 4.0). Remember to link ADL-GPIB’s import library GPIB-32.LIB. Creating a Windows 2000/NT/98 ADL-GPIB Application Using Microsoft Visual Basic To create

12 IEEE 488 Function Reference

Options (Constants)

Options (Values) Returned Information

ibaPAD 0x0001 The current primary address of the boardibaSAD 0x0002 The current secondary address of the board.ibaTMO 0x0003 The current I/O timeout of the board.

ibaEOT 0x00040: The GPIB EOI line is not asserted at the end of a write operation.1: EOI is asserted at the end of a write.

ibaPPC 0x0005 The current parallel poll configuration settings the board

ibaAUTOPOLL 0x00070: Automatic serial polling is disabled.1: Automatic serial polling is enabled.

ibaCICPROT 0x00080: The CIC protocol is disabled. 1: The CIC protocol is enabled.

ibaIRQ 0x00090: Interrupts are not enabled.1: Interrupts are enabled.

ibaSC 0x000A0: The board is not the GPIB SystemController.1: The board is the System Controller..

ibaSRE 0x000B

0: The board does not automatically assert the GPIB REN line when it becomes the System Controller. 1: The board automatically asserts REN when it becomes the System Controller.

ibaEOSrd 0x000C

0: The EOS character is ignored during read opera-tions.1: Read operation is terminated by the EOS charac-ter.

ibaEOSwrt 0x000D

0: The EOI line is not asserted when the EOS char-acter is sent during a write operation. 1: The EOI line is asserted when the EOS character is sent during a write operation.

ibaEOScmp 0x000E0: A 7-bit compare is used for all EOS comparisons. 1: An 8-bit compare is used for all EOS comparisons.

ibaEOSchar 0x000F The current EOS character of the board.

Table 2-1: ibask Board Configuration Parameter Options

Page 23: ADL-GPIB · menu (Visual C/C++ 4.0). Remember to link ADL-GPIB’s import library GPIB-32.LIB. Creating a Windows 2000/NT/98 ADL-GPIB Application Using Microsoft Visual Basic To create

IEEE 488 Function Reference 13

ibaPP2 0x0010

0: The board is in PP1 mode–remote parallel poll configuration. 1: The board is in PP2 mode–local parallel poll con-figuration.

ibaTIMING 0x0011

The current bus timing of the board.1: Normal timing (T1 delay of 2 µs.)2: High speed timing (T1 delay of 500 ns.)3: Very high speed timing (T1 delay of 350 ns.)

ibaDMA 0x00120: The board will not use DMA for GPIB transfers. 1: The board will use DMA for GPIB transfers

ibaSpollBit 0x00160: The SPOLL bit of ibsta is disabled. 1: The SPOLL bit of ibsta is enabled.

ibaSendLLO 0x00170: The GPIB LLO command is not sent when a device is put online-ibfind or ibdev. 1: The LLO command is sent.

ibaPPollTime 0x0019

0: The board uses the standard duration (2 µs) when conducting a parallel poll.1 to 17 = The board uses a variable length duration when conducting a parallel poll. The duration values correspond to the ibtmo timing values.

ibaEndBitIs-Normal

al0x001A

0: The END bit of ibsta is set only when EOI or EOI plus the EOS character is received. If the EOS char-acter is received without EOI, the END bit is not set. 1: The END bit is set whenever EOI, EOS, or EOI plus EOS is received.

ibaist 0x0020 The individual status (ist) bit of the board.ibaRsv 0x0021 The current serial poll status byte of the board.

Options (Constants)

Options (Values) Returned Information

Table 2-1: ibask Board Configuration Parameter Options

Page 24: ADL-GPIB · menu (Visual C/C++ 4.0). Remember to link ADL-GPIB’s import library GPIB-32.LIB. Creating a Windows 2000/NT/98 ADL-GPIB Application Using Microsoft Visual Basic To create

14 IEEE 488 Function Reference

Options (Constants)

Options (Values) Returned Information

ibaPAD 0x0001 The current primary address of the device.ibaSAD 0x0002 The current secondary address of the device.ibaTMO 0x0003 The current I/O timeout of the device.

ibaEOT 0x00040: The GPIB EOI line is not asserted at the end of a write operation.1: EOI is asserted at the end of a write.

ibaREADDR 0x0006

0: No unnecessary addressing is performed between device-level read and write operations. 1: Addressing is always performed before a device-level read or write operation.

ibaEOSrd 0x000C

0: The EOS character is ignored during read opera-tions.1: Read operation is terminated by the EOS charac-ter.

ibaEOSwrt 0x000D

0: The EOI line is not asserted when the EOS char-acter is sent during a write operation. 1: The EOI line is asserted when the EOS character is sent during a write operation.

ibaEOScmp 0x000E0: A 7-bit compare is used for all EOS comparisons. 1: An 8-bit compare is used for all EOS comparisons.

ibaEOSchar 0x000F The current EOS character of the board.

ibaSPollTime 0x0018The length of time the driver waits for a serial poll response when polling the device. The length of time is represented by the ibtmo timing values.

ibaEndBitIs-Normal al0x001A

0: The END bit of ibsta is set only when EOI or EOI plus the EOS character is received. If the EOS char-acter is received without EOI, the END bit is not set. 1: The END bit is set whenever EOI, EOS, or EOI plus EOS is received.

ibaBNA 0x0200 The index of the GPIB access board used by the given device descriptor.

Table 2-2: ibask Device Configuration Parameter Options

Page 25: ADL-GPIB · menu (Visual C/C++ 4.0). Remember to link ADL-GPIB’s import library GPIB-32.LIB. Creating a Windows 2000/NT/98 ADL-GPIB Application Using Microsoft Visual Basic To create

IEEE 488 Function Reference 15

2.2 ibbna

@ DescriptionAssign the access board of the specified device.

@ Support LevelDevice level

@ SyntaxMicrosoft C/C++ and Borland C++

int ibbna( int ud, char *board_name )Visual Basic

ilbna (ByVal ud As Integer, ByVal udname As String) As Integer

orcall ibbna(ByVal ud As Integer, ByVal udname As

String)

@ Parameterud: device unit descriptor

board_name: the name of the access board, e.g. gpib0.

@ Return CodeThe value of ibsta.

@ Possiable Error CodesEARG, ECAP, EDVR, EOIP, ENEB

2.3 ibcac

@ DescriptionSet the specified gpib board to be active controller by assertingATN. Before you call ibcac, the GPIB board must already be CIC.To make the board CIC, use the ibsic function.

Page 26: ADL-GPIB · menu (Visual C/C++ 4.0). Remember to link ADL-GPIB’s import library GPIB-32.LIB. Creating a Windows 2000/NT/98 ADL-GPIB Application Using Microsoft Visual Basic To create

16 IEEE 488 Function Reference

The board can take control synchronously or asynchronously. Totake control synchronously, the GPIB board attempts to assert theATN signal without corrupting transferred data. If this is not possi-ble, the board takes control asynchronously. To take control asyn-chronously, the GPIB board asserts ATN immediately withoutregard for any data transfer currently in progress.

@ Support Levelboard level

@ SyntaxMicrosoft C/C++ and Borland C++

Int ibcac( int ud, int synchronous )Visual Basic

ilcac(ByVal ud As Integer, ByVal v As Integer) As Integer

orcall ibcac(ByVal ud As Integer, ByVal v As

Integer)

@ Parameterud: board unit descriptor

v: takes control asynchronously or synchronously

0: asynchronously

1: synchronously

@ Return CodeThe value of ibsta.

@ Possiable Error CodesEARG, ECIC, EDVR, EOIP, ENEB

Page 27: ADL-GPIB · menu (Visual C/C++ 4.0). Remember to link ADL-GPIB’s import library GPIB-32.LIB. Creating a Windows 2000/NT/98 ADL-GPIB Application Using Microsoft Visual Basic To create

IEEE 488 Function Reference 17

2.4 ibclr

@ DescriptionSend the GPIB Selected Device Clear (SDC) message to thespecified device.

@ Support LevelDevice level

@ SyntaxMicrosoft C/C++ and Borland C++

Int ibclr( int ud )Visual Basic

ilclr(ByVal ud As Integer) As Integerorcall ibclr(ByVal ud As Integer)

@ Parameterud: device unit descriptor

@ Return CodeThe value of ibsta.

@ Possiable Error CodesEARG, EBUS, ECIC, EDVR, EOIP, ENEB

Page 28: ADL-GPIB · menu (Visual C/C++ 4.0). Remember to link ADL-GPIB’s import library GPIB-32.LIB. Creating a Windows 2000/NT/98 ADL-GPIB Application Using Microsoft Visual Basic To create

18 IEEE 488 Function Reference

2.5 ibcmd

@ DescriptionSend GPIB commands. Command bytes are used to configure thestate of the GPIB. They are not used to send instructions to GPIBdevices. Use ibwrt to send device-specific instructions. The num-ber of command bytes transferred is returned in the global variableibcntl.

@ Support LevelBoard level

@ SyntaxMicrosoft C/C++ and Borland C++

Int ibcmd( int ud, const void *cmd, long cnt )Visual Basic

ilcmd(ByVal ud As Integer, ByVal buf As String, ByVal cnt As Long) As Integer

orcall ibcmd(ByVal ud As Integer, ByVal buf As

String)

@ Parameterud: device unit descriptor

buf: the buffer contains command string to sent

cnt: number of command bytes to sent

@ Return CodeThe value of ibsta.

@ Possiable Error CodesEARG, ECIC, EDVR, EOIP, ENEB, EABO, ENOL

Page 29: ADL-GPIB · menu (Visual C/C++ 4.0). Remember to link ADL-GPIB’s import library GPIB-32.LIB. Creating a Windows 2000/NT/98 ADL-GPIB Application Using Microsoft Visual Basic To create

IEEE 488 Function Reference 19

2.6 ibcmda

@ DescriptionSend GPIB commands asynchronously. Command bytes are usedto configure the state of the GPIB. They are not used to sendinstructions to GPIB devices. Use ibwrt to send device-specificinstructions. The number of command bytes transferred isreturned in the global variable ibcntl.

The asynchronous I/O calls (ibcmda, ibrda, ibwrta) are designedso that applications can perform other non-GPIB operations whilethe I/O is in progress. Once the asynchronous I/O has begun, fur-ther GPIB calls are strictly limited. Any calls that would interferewith the I/O in progress are not allowed, the driver returns EOIP inthis case.

Once the I/O is complete, the application must resynchronize withthe adlgpib driver.

Resynchronization is accomplished by using one of the followingthree functions:

ibwait If the returned ibsta mask has the CMPL bit set, the driverand application are resynchronized.

ibnotify If the ibsta value passed to the ibnotify callback containsCMPL, the driver and application are resynchronized.

ibstop The I/O is canceled; the driver and application are resyn-chronized.

ibonl The I/O is canceled and the interface is reset; the driver andapplication are resynchronized.

@ Support LevelBoard level

@ SyntaxMicrosoft C/C++ and Borland C++

Int ibcmda ( int ud, const void *cmd, long cnt )

Page 30: ADL-GPIB · menu (Visual C/C++ 4.0). Remember to link ADL-GPIB’s import library GPIB-32.LIB. Creating a Windows 2000/NT/98 ADL-GPIB Application Using Microsoft Visual Basic To create

20 IEEE 488 Function Reference

Visual Basic Ilcmda (ByVal ud As Integer, ByVal buf As String,

ByVal cnt As Long) As Integerorcall ibcmda (ByVal ud As Integer, ByVal buf As

String)

@ Parameterud: device unit descriptor

buf: the buffer contains command string to sent

cnt: number of command bytes to sent

@ Return CodeThe value of ibsta.

@ Possiable Error CodesEARG, ECIC, EDVR, EOIP, ENEB, EABO, ENOL

Page 31: ADL-GPIB · menu (Visual C/C++ 4.0). Remember to link ADL-GPIB’s import library GPIB-32.LIB. Creating a Windows 2000/NT/98 ADL-GPIB Application Using Microsoft Visual Basic To create

IEEE 488 Function Reference 21

2.7 ibconfig

@ DescriptionSet the setting value of the selected configuration item.

@ Support LevelBoard / Device level

@ SyntaxMicrosoft C/C++ and Borland C++

Int ibconfig( int ud, int option, int value )Visual Basic

ilconfig(ByVal ud As Integer, ByVal opt As Integer, ByVal v As Integer) As Integer

orcall ibconfig(ByVal ud As Integer, ByVal opt As

Integer, ByVal v As Integer)

@ Parameterud: board or device unit descriptor

opt: the configuration item which wish to be changed. The validoption items are listed in the following tables.

Page 32: ADL-GPIB · menu (Visual C/C++ 4.0). Remember to link ADL-GPIB’s import library GPIB-32.LIB. Creating a Windows 2000/NT/98 ADL-GPIB Application Using Microsoft Visual Basic To create

22 IEEE 488 Function Reference

Options (Constants)

Options (Values) Legal Values

ibcPAD 0x0001 Set the primary address of the board. ibcSAD 0x0002 Set the secondary address of the board.ibcTMO 0x0003 Set the I/O timeout limit of the board. ibcEOT 0x0004 Set the data termination mode for write operations.ibcPPC 0x0005 Configures the board for parallel polls. Default: zero

ibcAUTOPOLL 0x00070: Disable automatic serial polling.1: Enable automatic serial polling.

ibcSC 0x000A Request or release system control. Identical to ibrsc.

ibcSRE 0x000BAssert the Remote Enable (REN) line. Identical to ibsre. Default: zero.

ibcEOSrd 0x000C0: Ignore EOS character during read operations.1: Terminate reads when the EOS character is read match occurs.

ibcEOSwrt 0x000D

0: Do not assert EOI with the EOS character during write operations. 1: Assert EOI with the EOS character during writes operations.

ibcEOScmp 0x000E0: Use 7 bits for the EOS character comparison. 1: Use 8 bits for the EOS character comparison.

ibcEOSchar 0x000F Any 8-bit value. This byte becomes the new EOS character.

ibcPP2 0x00100: PP1 mode-remote parallel poll configuration. 1: PP2 mode-local parallel poll configuration. Default: zero.

ibcTIMING 0x0011

1: Normal timing (T1 delay of 2 µs.)2: High speed timing (T1 delay of 500 ns.)3: Very high speed timing (T1 delay of 350 ns.).The T1 delay is the GPIB source handshake timing. Default : 3

Table 2-3: Board Configuration Parameter Options

Page 33: ADL-GPIB · menu (Visual C/C++ 4.0). Remember to link ADL-GPIB’s import library GPIB-32.LIB. Creating a Windows 2000/NT/98 ADL-GPIB Application Using Microsoft Visual Basic To create

IEEE 488 Function Reference 23

ibcReadAdjust 0x00130 = No byte swapping.1 = Swap pairs of bytes during a read. Default: zero.

ibcWriteAdjust 0x00140 = No byte swapping.1 = Swap pairs of bytes during a write.Default: zero.

ibcSpollBit 0x00160: The SPOLL bit of ibsta is disabled.1: The SPOLL bit of ibsta is enabled.Default: zero.

ibcSendLLO 0x0017

0: Do not send LLO when putting a device online –ibfind or ibdev.1: Send LLO when putting a device online–ibfind or ibdev. Default: zero.

ibcPPollTime 0x0019

0: Use the standard duration (2 µs) when conducting a parallel poll.1 to 17: Use a variable length duration when con-ducting a parallel poll. The duration represented by 1 to 17 corresponds to the ibtmo values. Default: zero.

ibcEndBitIs-Normal 0x001A

0: Do not set the END bit of ibsta when an EOS match occurs during a read. 1: Set the END bit of ibsta when an EOS match occurs during a read.Default: 1.

ibcIst 0x0020 Sets the individual status (ist) bit of the board.

ibcRsv 0x0021Sets the serial poll status byte of the board.Default: zero.

Options (Constants)

Options (Values) Legal Values

Table 2-3: Board Configuration Parameter Options

Page 34: ADL-GPIB · menu (Visual C/C++ 4.0). Remember to link ADL-GPIB’s import library GPIB-32.LIB. Creating a Windows 2000/NT/98 ADL-GPIB Application Using Microsoft Visual Basic To create

24 IEEE 488 Function Reference

value: the value wish to be changed to the specified configura-tion item.

@ Return CodeThe value of ibsta.

Options (Constants)

Options (Values) Legal Values

ibcPAD 0x0001 Set the primary address of the board. ibcSAD 0x0002 Set the secondary address of the board.ibcTMO 0x0003 Set the I/O timeout limit of the board. ibcEOT 0x0004 Set the data termination mode for write operations.

IbcREADDR 0x0006

0: No unnecessary readdressing is performed between device-level reads and writes. 1: Addressing is always performed before a device-level read or write.

ibcEOSrd 0x000C0: Ignore EOS character during read operations.1: Terminate reads when the EOS character is read match occurs.

ibcEOSwrt 0x000D

0: Do not assert EOI with the EOS character during write operations. 1: Assert EOI with the EOS character during writes operations.

ibcEOScmp 0x000E0: Use 7 bits for the EOS character comparison. 1: Use 8 bits for the EOS character comparison.

ibcEOSchar 0x000F Any 8-bit value. This byte becomes the new EOS character.

ibcSPollTime 0x0018

0 to 17 : Sets the length of time the driver waits for a serial poll response byte when polling the given device. The length of time represented by 0 to 17 corresponds to the ibtmo values. Default: 11.

ibcEndBitIs-Normal 0x001A

0: Do not set the END bit of ibsta when an EOS match occurs during a read. 1: Set the END bit of ibsta when an EOS match occurs during a read. Default: 1.

Table 2-4: Device Configuration Parameter Options

Page 35: ADL-GPIB · menu (Visual C/C++ 4.0). Remember to link ADL-GPIB’s import library GPIB-32.LIB. Creating a Windows 2000/NT/98 ADL-GPIB Application Using Microsoft Visual Basic To create

IEEE 488 Function Reference 25

@ Possiable Error CodesEARG, ECAP, EDVR, EOIP

Page 36: ADL-GPIB · menu (Visual C/C++ 4.0). Remember to link ADL-GPIB’s import library GPIB-32.LIB. Creating a Windows 2000/NT/98 ADL-GPIB Application Using Microsoft Visual Basic To create

26 IEEE 488 Function Reference

2.8 ibdev

@ DescriptionOpen and initialize a device descriptor. If ibdev is unable to get avalid device descriptor, a -1 is returned; the ERR bit is set in ibstaand iberr contains EDVR.

@ Support LevelDevice level

@ SyntaxMicrosoft C/C++ and Borland C++

Int ibdev( int board_index, int pad, int sad, int timo, int send_eoi, int eosmode )

Visual Basic ildev(ByVal bdid As Integer, ByVal pad As

Integer, ByVal sad As Integer, ByVal tmo As Integer, ByVal eot As Integer, ByVal eos As Integer) As Integer

orcall ibdev(ByVal bdid As Integer, ByVal pad As

Integer, ByVal sad As Integer, ByVal tmo As Integer, ByVal eot As Integer, ByVal eos As Integer, ud As Integer)

@ Parameterboard_index :the index of the access board for the device

pad: the primary GPIB address of the device

sad: the second GPIB address of the device

tmo: the I/O timeout value

eot: enable or disable EOI mode of the devcie

eos: configure EOS character and EOS modes of the devcie

@ Return CodeThe device descriptor or -1.

Page 37: ADL-GPIB · menu (Visual C/C++ 4.0). Remember to link ADL-GPIB’s import library GPIB-32.LIB. Creating a Windows 2000/NT/98 ADL-GPIB Application Using Microsoft Visual Basic To create

IEEE 488 Function Reference 27

@ Possiable Error CodesEARG, EDVR, ENEB,

Page 38: ADL-GPIB · menu (Visual C/C++ 4.0). Remember to link ADL-GPIB’s import library GPIB-32.LIB. Creating a Windows 2000/NT/98 ADL-GPIB Application Using Microsoft Visual Basic To create

28 IEEE 488 Function Reference

2.9 ibdma

@ DescriptionThis fucntion is not supported in adlgpib.

@ Support LevelBoard level

@ SyntaxMicrosoft C/C++ and Borland C++

Int ibdma( int ud, int v )Visual Basic

ildma(ByVal ud As Integer, ByVal v As Integer) As Integer

orcall ibdma(ByVal ud As Integer, ByVal v As

Integer)

@ Parameterud: the board descriptor

dma: enable or disable dma mode

@ Return CodeThe value of ibsta.

@ Possiable Error CodesEARG, ECAP, EDVR, ENEB, EOIP

Page 39: ADL-GPIB · menu (Visual C/C++ 4.0). Remember to link ADL-GPIB’s import library GPIB-32.LIB. Creating a Windows 2000/NT/98 ADL-GPIB Application Using Microsoft Visual Basic To create

IEEE 488 Function Reference 29

2.10 ibeot

@ DescriptionEnable or disable the automatic assertion of the GPIB EOI line atthe end of write I/O operations.

If EOT mode is enabled, EOI is asserted when the last byte of aGPIB write is sent; otherwise, nothing occurs when the last byte issent.

@ Support LevelBoard / Device level

@ SyntaxMicrosoft C/C++ and Borland C++

Int ibeot ( int ud, int v )Visual Basic

Ileot (ByVal ud As Integer, ByVal v As Integer) As Integer

orcall ibeot (ByVal ud As Integer, ByVal v As

Integer)

@ Parameterud: the board or device descriptor

v: enable or disable eot mode

@ Return CodeThe value of ibsta.

@ Possiable Error CodesEDVR, ENEB, EOIP

Page 40: ADL-GPIB · menu (Visual C/C++ 4.0). Remember to link ADL-GPIB’s import library GPIB-32.LIB. Creating a Windows 2000/NT/98 ADL-GPIB Application Using Microsoft Visual Basic To create

30 IEEE 488 Function Reference

2.11 ibeos

@ DescriptionConfigure the end-of-string (EOS) termination mode or character.

Note: Defining an EOS byte does not cause the driver to automat-ically send that byte at the end of write I/O operations. Your application is responsible for placing the EOS byte at the end of the data strings that it defines.

@ Support LevelBoard / Device level

@ SyntaxMicrosoft C/C++ and Borland C++

Int ibeot (int ud, int v)Visual Basic

ileos (ByVal ud As Integer, ByVal v As Integer) As Integer

orcall ibeos (ByVal ud As Integer, ByVal v As

Integer)

@ Parameterud: the board or device descriptor

v: EOS mode and character information. If v is zero, the EOS con-figuration is disabled. Otherwise, the low byte is the EOS charac-ter and the upper byte contains flags defining the EOS mode. Thedifferent EOS configurations and the corresponding values of v asthe following table:

EOS modeValue of v

Bit High Byte Low ByteTerminate read when EOS is detected. A 00000100 EOS character

Set EOI with EOS on write function. B 00001000 EOS characterCompare all 8 bits of EOS byte rather than low 7

bits (all read and write functions). C 00010000 EOS character

Page 41: ADL-GPIB · menu (Visual C/C++ 4.0). Remember to link ADL-GPIB’s import library GPIB-32.LIB. Creating a Windows 2000/NT/98 ADL-GPIB Application Using Microsoft Visual Basic To create

IEEE 488 Function Reference 31

Configuration bits A and C determine how to terminate read I/Ooperations. If bit A is set and bit C is clear, a read ends when abyte that matches the low seven bits of the EOS character isreceived. If bits A and C are both set, a read ends when a byte thatmatches all eight bits of the EOS character is received.

Configuration bits B and C determine when a write I/O operationasserts the GPIB EOI line. If bit B is set and bit C is clear, EOI isasserted when the written character matches the low seven bits ofthe EOS character. If bits B and C are both set, EOI is assertedwhen the written character matches all eight bits of the EOS char-acter.

@ Return CodeThe value of ibsta.

@ Possiable Error CodesEARG, EDVR, ENEB, EOIP

Page 42: ADL-GPIB · menu (Visual C/C++ 4.0). Remember to link ADL-GPIB’s import library GPIB-32.LIB. Creating a Windows 2000/NT/98 ADL-GPIB Application Using Microsoft Visual Basic To create

32 IEEE 488 Function Reference

2.12 ibfind

@ DescriptionOpen and initialize a GPIB board descriptor. The returned boarddescriptor can be used in subsequent calls. ibfind performs theequivalent of an ibonl 1 to initialize the board descriptor. Thedescriptor returned by ibfind is valid until the board is put offlineusing ibonl 0. If ibfind is unable to get a valid descriptor, a -1 isreturned; the ERR bit is set in ibsta and iberr contains EDVR.

@ Support LevelBoard level

@ SyntaxMicrosoft C/C++ and Borland C++

Int ibfind (const char *boardname )Visual Basic

ilfind(ByVal boardname As String) As Integerorcall ibfind (ByVal boardname As String, ud As

Integer)

@ Parameterboardname: the board name, e.g. gpib0.

@ Return CodeThe board descriptor or -1.

@ Possiable Error CodesEBUS, ECIC, EDVR, ENEB

Page 43: ADL-GPIB · menu (Visual C/C++ 4.0). Remember to link ADL-GPIB’s import library GPIB-32.LIB. Creating a Windows 2000/NT/98 ADL-GPIB Application Using Microsoft Visual Basic To create

IEEE 488 Function Reference 33

2.13 ibgts

@ DescriptionSet the board from active controller state to Standby Controllerstate. ibgts causes the GPIB interface to go to Standby Controllerand the GPIB ATN line to be unasserted.

@ Support LevelBoard level

@ SyntaxMicrosoft C/C++ and Borland C++

Int ibgts (int ud, int shadow_handshake)Visual Basic

ilgts (ByVal ud As Integer, ByVal v As Integer) As Integer

orcall ibgts (ByVal ud As Integer, ByVal v As

Integer)

@ Parameterud: the board descriptor

v: determines whether to perform acceptor handshaking

@ Return CodeThe value of ibsta.

@ Possiable Error CodesEADR , EARG, ECIC, EDVR, ENEB, EOIP

Page 44: ADL-GPIB · menu (Visual C/C++ 4.0). Remember to link ADL-GPIB’s import library GPIB-32.LIB. Creating a Windows 2000/NT/98 ADL-GPIB Application Using Microsoft Visual Basic To create

34 IEEE 488 Function Reference

2.14 ibist

@ DescriptionSet or clear the board individual status (ist) bit for parallel polls.

@ Support LevelBoard level

@ SyntaxMicrosoft C/C++ and Borland C++

Int ibist ( int ud, int ist )Visual Basic

ilist (ByVal ud As Integer, ByVal v As Integer) As Integer

orcall ibist (ByVal ud As Integer, ByVal v As

Integer)

@ Parameterud: the board descriptor

v: indicates whether to set or clear the ist bit

@ Return CodeThe value of ibsta.

@ Possiable Error CodesEARG, EDVR, ENEB, EOIP

Page 45: ADL-GPIB · menu (Visual C/C++ 4.0). Remember to link ADL-GPIB’s import library GPIB-32.LIB. Creating a Windows 2000/NT/98 ADL-GPIB Application Using Microsoft Visual Basic To create

IEEE 488 Function Reference 35

2.15 iblines

@ DescriptionReturn the status of the GPIB control lines. The low-order byte(bits 0 through 7) of lines indicating the capability of the GPIBinterface to sense the status of each GPIB control line. The upperbyte (bits 8 through 15) indicates the GPIB control line state infor-mation. The following is the description of each byte.

To determine if a GPIB control line is asserted, first check theappropriate bit in the lower byte to determine if the line can bemonitored. If the line can be monitored (indicated by a 1 in theappropriate bit position), check the corresponding bit in the upperbyte. If the bit is set (1), the corresponding control line is asserted.If the bit is clear (0), the control line is unasserted.

@ Support LevelBoard level

@ SyntaxMicrosoft C/C++ and Borland C++

Int iblines( int ud, short *line_status )Visual Basic

illines(ByVal ud As Integer, lines As Integer) As Integer

orcall iblines(ByVal ud As Integer, lines As

Integer)

@ Parameterud: the board descriptor

line_status: return GPIB control line state information

7 6 5 4 3 2 1 0EOI ATN SRQ REN IFC NRFD NDAC DAV

Page 46: ADL-GPIB · menu (Visual C/C++ 4.0). Remember to link ADL-GPIB’s import library GPIB-32.LIB. Creating a Windows 2000/NT/98 ADL-GPIB Application Using Microsoft Visual Basic To create

36 IEEE 488 Function Reference

@ Return CodeThe value of ibsta.

@ Possiable Error CodesEARG, EDVR, ENEB, EOIP

Page 47: ADL-GPIB · menu (Visual C/C++ 4.0). Remember to link ADL-GPIB’s import library GPIB-32.LIB. Creating a Windows 2000/NT/98 ADL-GPIB Application Using Microsoft Visual Basic To create

IEEE 488 Function Reference 37

2.16 ibln

@ DescriptionChecks whether a device is present on the bus.

@ Support LevelBoard / Device level

@ SyntaxMicrosoft C/C++ and Borland C++

Int ibln( int ud, int pad, int sad, short *found_listener )

Visual Basic illn (ByVal ud As Integer, ByVal pad As Integer,

ByVal sad As Integer, found_listener As Integer) As Integer

orcall ibln (ByVal ud As Integer, ByVal pad As

Integer, ByVal sad As Integer, found_listener As Integer)

@ Parameterud: the board or device descriptor. If ud is a board descriptor, thebus associated with that board is tested for Listeners. If ud is adevice descriptor, ibln uses the access board associated with thatdevice to test for Listeners. If a Listener is detected, a non-zerovalue is returned in found_listener. If no Listener is found, zero isreturned

pad: the primary address of the device (a value between 0 and30).

sad: the secondary address of the device (a value between 96 to126 or NO_SAD or ALL_SAD, where NO_SAD is no secondaryaddress is to be tested, i.e. only a primary address is tested andALL_SAD designates that all secondary addresses are to betested),

found_listener: indicates if a device is present

Page 48: ADL-GPIB · menu (Visual C/C++ 4.0). Remember to link ADL-GPIB’s import library GPIB-32.LIB. Creating a Windows 2000/NT/98 ADL-GPIB Application Using Microsoft Visual Basic To create

38 IEEE 488 Function Reference

@ Return CodeThe value of ibsta.

@ Possiable Error CodesEARG, ECIC, EDVR, ENEB, EOIP

Page 49: ADL-GPIB · menu (Visual C/C++ 4.0). Remember to link ADL-GPIB’s import library GPIB-32.LIB. Creating a Windows 2000/NT/98 ADL-GPIB Application Using Microsoft Visual Basic To create

IEEE 488 Function Reference 39

2.17 ibloc

@ DescriptionFor a board, ibloc place the board in local mode, if it is not in alockout state. The board is in a lockout state if LOK does notappear in the status word ibsta. If the board is in a lockout state,the call has no effect.

The ibloc function is used to simulate a front panel RTL (Return toLocal) switch if the computer is used as an instrument.

For a device, unless the REN (Remote Enable) line has beenunasserted with the ibsre function, all device-level calls automati-cally place the specified device in remote program mode. ibloc isused to move devices temporarily from a remote program mode toa local mode until the next device function is executed on thatdevice.

@ Support LevelBoard / Device level

@ SyntaxMicrosoft C/C++ and Borland C++

Int ibloc ( int ud )Visual Basic

illoc(ByVal ud As Integer) As Integerorcall ibloc (ByVal ud As Integer)

@ Parameterud: the board or device descriptor.

@ Return CodeThe value of ibsta.

@ Possiable Error CodesEBUS, ECIC, EDVR, ENEB, EOIP

Page 50: ADL-GPIB · menu (Visual C/C++ 4.0). Remember to link ADL-GPIB’s import library GPIB-32.LIB. Creating a Windows 2000/NT/98 ADL-GPIB Application Using Microsoft Visual Basic To create

40 IEEE 488 Function Reference

2.18 ibonl

@ DescriptionResets the board or device, sets all its software configurationparameters in their pre-configured state and place the deviceonline or offline. If a device or an interface is taken offline, theboard or device descriptor is no longer valid. You have to callibdev or ibfind to access the board or device again.

@ Support LevelBoard / Device level

@ SyntaxMicrosoft C/C++ and Borland C++

Int ibonl ( int ud, int onl )Visual Basic

ilonl (ByVal ud As Integer, ByVal onl As Integer) As Integer

orcall ibonl (ByVal ud As Integer, ByVal onl As

Integer)

@ Parameterud: the board or device descriptor.

onl: online (1) or offfline (0).

@ Return CodeThe value of ibsta.

@ Possiable Error CodesEARG, ENEB

Page 51: ADL-GPIB · menu (Visual C/C++ 4.0). Remember to link ADL-GPIB’s import library GPIB-32.LIB. Creating a Windows 2000/NT/98 ADL-GPIB Application Using Microsoft Visual Basic To create

IEEE 488 Function Reference 41

2.19 ibnotify

@ DescriptionNotify user of one or more GPIB events by invoking the user spec-ified callback.

After an asynchronous I/O operation has completed, resynchroni-zation of the handler is required and the global variables passedinto the Callback after I/O has completed contain the status of theI/O operation.

@ Support LevelBoard / Device level

@ SyntaxMicrosoft C/C++ and Borland C++

Int ibnotify (int ud, int mask, GpibNotifyCallback_t Callback, void *RefData)

@ Parameterud: the board or device descriptor.

Page 52: ADL-GPIB · menu (Visual C/C++ 4.0). Remember to link ADL-GPIB’s import library GPIB-32.LIB. Creating a Windows 2000/NT/98 ADL-GPIB Application Using Microsoft Visual Basic To create

42 IEEE 488 Function Reference

mask: bit mask of GPIB events. The valid event mask are the fol-lowing:

0: no maskTIMO: the timeout period (see ibtmo) to limit the notify periodEND: END or EOS is detectedSRQI: SRQ is asserted (board-level only) RQS: Device requested service (device-level only)CMP: I/O is completeLOK: GPIB interface is in Lockout State (board-level only)REM: GPIB interface is in Remote State (board-level only)CIC: GPIB interface is CIC (board-level only)ATN: Attention is asserted (board-level only)TACS: GPIB interface is Talker (board-level only)LACS: GPIB interface is Listener (board-level only)DTAS: GPIB interface is in Device Trigger State (boardlevel only)DCAS: GPIB interface is in Device Clear State (board-level only).

If mask is non-zero, ibnotify monitors the events specified bymask, and when one or more of the events is true, the Callbackis invoked. For a board-level ibnotify call, all mask bits are validexcept for ERR and RQS. For a device-level ibnotify call, theonly valid mask bits are CMPL, TIMO, END, and RQS. If TIMOis set in the notify mask, ibnotify calls the callback functionwhen the timeout period has elapsed, if one or more of theother specified events have not already occurred. If TIMO isnot set in the notify mask, the callback is not called until one ormore of the specified events occur.

Page 53: ADL-GPIB · menu (Visual C/C++ 4.0). Remember to link ADL-GPIB’s import library GPIB-32.LIB. Creating a Windows 2000/NT/98 ADL-GPIB Application Using Microsoft Visual Basic To create

IEEE 488 Function Reference 43

Callback: the address callback function.

Callback Prototype for ibnotifyint __std call Callback (int LocalUd, int LocalIbsta, int LocalIberr, long LocalIbcntl, void *RefData)

Callback ParametersLocalUd : Board or device descriptorLocalIbsta : Value of ibstaLocalIberr : Value of iberrLocalIbcntl : Value of ibcntlRefData : User-defined reference data for the callback

Callback Return ValueBit mask of the GPIB events to notice next.

Possible Error CodeEDVR

RefData: user-defined reference data for the callback.

@ Return CodeThe value of ibsta.

@ Possiable Error CodesEARG, ECAP, EDVR, ENEB, EOIP

Page 54: ADL-GPIB · menu (Visual C/C++ 4.0). Remember to link ADL-GPIB’s import library GPIB-32.LIB. Creating a Windows 2000/NT/98 ADL-GPIB Application Using Microsoft Visual Basic To create

44 IEEE 488 Function Reference

2.20 ibpad

@ DescriptionSet primary GPIB address of a board or a device.

@ Support LevelBoard / Device level

@ SyntaxMicrosoft C/C++ and Borland C++

Int ibpad ( int ud, int v )Visual Basic

ilpad(ByVal ud As Integer, ByVal v As Integer) As Integer

orcall ibpad(ByVal ud As Integer, ByVal v As

Integer)

@ Parameterud: the board or device descriptor.

v: the GPIB primary address. The valid range of value is 0 through30.

@ Return CodeThe value of ibsta.

@ Possiable Error CodesEARG, EDVR, ENEB, EOIP

Page 55: ADL-GPIB · menu (Visual C/C++ 4.0). Remember to link ADL-GPIB’s import library GPIB-32.LIB. Creating a Windows 2000/NT/98 ADL-GPIB Application Using Microsoft Visual Basic To create

IEEE 488 Function Reference 45

2.21 ibsad

@ DescriptionSet or disable secondary GPIB address of a board or a device.

@ Support LevelBoard / Device level

@ SyntaxMicrosoft C/C++ and Borland C++

Int ibsad( int ud, int v )Visual Basic

ilsad(ByVal ud As Integer, ByVal v As Integer) As Integer

orcall ibsad (ByVal ud As Integer, ByVal v As

Integer)

@ Parameterud: the board or device descriptor.

v: set or disable the GPIB secondary address. If If v is zero, sec-ondary addressing is disabled. If v is non-zero, the secondaryaddress is enabled and valid range of value is 96 to 126 (0x60 to0x7E).

@ Return CodeThe value of ibsta.

@ Possiable Error CodesEARG, EDVR, ENEB, EOIP

Page 56: ADL-GPIB · menu (Visual C/C++ 4.0). Remember to link ADL-GPIB’s import library GPIB-32.LIB. Creating a Windows 2000/NT/98 ADL-GPIB Application Using Microsoft Visual Basic To create

46 IEEE 488 Function Reference

2.22 ibpct

@ DescriptionPass Controller-in-Charge (CIC) status to another GPIB devicewith Controller capability. The access board automatically unas-serts the ATN line and goes to Controller Idle State (CIDS).

@ Support LevelDevice level

@ SyntaxMicrosoft C/C++ and Borland C++

Int ibpct ( int ud )Visual Basic

ilpct (ByVal ud As Integer) As Integerorcall ibpct (ByVal ud As Integer)

@ Parameterud: the device descriptor.

@ Return CodeThe value of ibsta.

@ Possiable Error CodesEARG, EBUS, ECIC, EDVR, ENEB, EOIP

Page 57: ADL-GPIB · menu (Visual C/C++ 4.0). Remember to link ADL-GPIB’s import library GPIB-32.LIB. Creating a Windows 2000/NT/98 ADL-GPIB Application Using Microsoft Visual Basic To create

IEEE 488 Function Reference 47

2.23 ibppc

@ DescriptionConfigure Parallel Polling.

If ud is a device descriptor, ibppc enables or disables the devicefrom responding to parallel polls. The device is addressed andsent the appropriate parallel poll message parallel Poll Enable(PPE) or Disable (PPD). Valid parallel poll messages are 96 to 126(hex 60 to hex 7E) or zero to send PPD.

If ud is a board descriptor, ibppc performs a local parallel poll con-figuration using the parallel poll configuration value v. Valid parallelpoll messages are 96 to 126 (hex 60 to hex 7E) or zero to sendPPD. If no error occurs during the call, iberr contains the previousvalue of the local parallel poll configuration.

@ Support LevelBoard / Device level

@ SyntaxMicrosoft C/C++ and Borland C++

Int ibppc ( int ud, int v )Visual Basic

ilppc (ByVal ud As Integer, ByVal v As Integer) As Integer

orcall ibppc (ByVal ud As Integer, ByVal v As

Integer)

@ Parameterud: The device descriptor.

v: parallel poll enable/disable value.

@ Return CodeThe value of ibsta.

Page 58: ADL-GPIB · menu (Visual C/C++ 4.0). Remember to link ADL-GPIB’s import library GPIB-32.LIB. Creating a Windows 2000/NT/98 ADL-GPIB Application Using Microsoft Visual Basic To create

48 IEEE 488 Function Reference

@ Possiable Error CodesEARG, EBUS, ECAP, ECIC, EDVR, ENEB, EOIP

Page 59: ADL-GPIB · menu (Visual C/C++ 4.0). Remember to link ADL-GPIB’s import library GPIB-32.LIB. Creating a Windows 2000/NT/98 ADL-GPIB Application Using Microsoft Visual Basic To create

IEEE 488 Function Reference 49

2.24 ibrd

@ DescriptionReads data from a device into the user specified buffer.

If ud is a device descriptor, ibrd addresses the GPIB, reads up tocount bytes of data, and places the data into the user buffer. Theoperation terminates normally when count bytes have beenreceived or END is received. The operation terminates with anerror if the transfer could not complete within the timeout period.The actual number of bytes transferred is returned in the globalvariable ibcntl.

If ud is a board descriptor, ibrd reads up to count bytes of data andplaces the data into the buffer. A board-level ibrd assumes that theGPIB is already properly addressed. The operation terminatesnormally when count bytes have been received or END isreceived. The operation terminates with an error if the transfercould not complete within the timeout period or, if the board is notCIC, the CIC sends a Device Clear on the GPIB. The actual num-ber of bytes transferred is returned in the global variable ibcntl.

@ Support LevelBoard / Device level

@ SyntaxMicrosoft C/C++ and Borland C++

Int ibrd ( int ud, void *buf, long cnt )Visual Basic

ilrd (ByVal ud As Integer, buf As String, ByVal cnt As Long) As Integer

orcall ibrd (ByVal ud As Integer, buf As String)

@ Parameterud: the device descriptor.

buf: the buffer to store the data read from the GPIB.

cnt: number of bytes to be read from the GPIB.

Page 60: ADL-GPIB · menu (Visual C/C++ 4.0). Remember to link ADL-GPIB’s import library GPIB-32.LIB. Creating a Windows 2000/NT/98 ADL-GPIB Application Using Microsoft Visual Basic To create

50 IEEE 488 Function Reference

@ Return CodeThe value of ibsta.

@ Possiable Error CodesEABO, EADR, EBUS, ECIC, EDVR, ENEB, EOIP

Page 61: ADL-GPIB · menu (Visual C/C++ 4.0). Remember to link ADL-GPIB’s import library GPIB-32.LIB. Creating a Windows 2000/NT/98 ADL-GPIB Application Using Microsoft Visual Basic To create

IEEE 488 Function Reference 51

2.25 ibrda

@ DescriptionReads data asynchronously from a device into the user specifiedbuffer .

If ud is a device descriptor, ibrda addresses the GPIB, reads up tocount bytes of data, and places the data into the buffer. The opera-tion terminates normally when count bytes have been received orEND is received. The operation terminates with an error if thetransfer could not complete within the timeout period. The actualnumber of bytes transferred is returned in the global variableibcntl.

If ud is a board descriptor, ibrda reads up to count bytes of dataand places the data into the buffer. A board-level ibrda assumesthat the GPIB is already properly addressed. The operation termi-nates normally when count bytes have been received or END isreceived. The operation terminates with an error if the transfercould not complete within the timeout period or, if the board is notCIC, the CIC sends a Device Clear on the GPIB. The actual num-ber of bytes transferred is returned in the global variable ibcntl.

The asynchronous I/O calls (ibcmda, ibrda, ibwrta) are designedso that applications can perform other non-GPIB operations whilethe I/O is in progress. Once the asynchronous I/O has begun, fur-ther GPIB calls are strictly limited. Any calls that would interferewith the I/O in progress are not allowed, the driver returns EOIP inthis case.

Once the I/O is complete, the application must resynchronize withthe adlgpib driver.

Page 62: ADL-GPIB · menu (Visual C/C++ 4.0). Remember to link ADL-GPIB’s import library GPIB-32.LIB. Creating a Windows 2000/NT/98 ADL-GPIB Application Using Microsoft Visual Basic To create

52 IEEE 488 Function Reference

Resynchronization is accomplished by using one of the followingthree functions:

ibwait: If the returned ibsta mask has the CMPL bit set, the driver and application are resynchronized.ibnotify: If the ibsta value passed to the ibnotify callback contains CMPL, the driver and application are resynchro-nized.ibstop: The I/O is canceled; the driver and application are resynchronized.ibonl: The I/O is canceled and the interface is reset; the driver and application are resynchronized.

@ Support LevelBoard / Device level

@ SyntaxMicrosoft C/C++ and Borland C++

Int ibrda ( int ud, void *buf, long cnt )Visual Basic

ilrda (ByVal ud As Integer, buf As String, ByVal cnt As Long) As Integer

orcall ibrda (ByVal ud As Integer, buf As String)

@ Parameterud: the device descriptor.

buf: the buffer to store the data read from the GPIB.

cnt: number of bytes to be read from the GPIB.

@ Return CodeThe value of ibsta.

@ Possiable Error CodesEABO, EADR, EBUS, ECIC, EDVR, ENEB, EOIP

Page 63: ADL-GPIB · menu (Visual C/C++ 4.0). Remember to link ADL-GPIB’s import library GPIB-32.LIB. Creating a Windows 2000/NT/98 ADL-GPIB Application Using Microsoft Visual Basic To create

IEEE 488 Function Reference 53

2.26 ibrdf

@ DescriptionReads data from a device into a file.

If ud is a device descriptor, ibrdf addresses the GPIB, reads datafrom a GPIB device, and places the data into the file. The opera-tion terminates normally when END is received. The operation ter-minates with an error if the transfer could not complete within thetimeout period. The actual number of bytes transferred is returnedin the global variable ibcntl.

If ud is a board descriptor, ibrdf reads data from a GPIB deviceand places the data into the file. A board-level ibrdf assumes thatthe GPIB is already properly addressed. The operation terminatesnormally when END is received. The operation terminates with anerror if the transfer could not complete within the timeout period or,if the board is not CIC, the CIC sends a Device Clear on the GPIB.The actual number of bytes transferred is returned in the globalvariable ibcntl.

@ Support LevelBoard / Device level

@ SyntaxMicrosoft C/C++ and Borland C++

Int ibrdf ( int ud, const char *filename )Visual Basic

ilrdf (ByVal ud As Integer, ByVal filename As String) As Integer

orcall ibrdf (ByVal ud As Integer, ByVal filename

As String)

@ Parameterud: the device descriptor.

filename: the name of the file where the read data are stored.

Page 64: ADL-GPIB · menu (Visual C/C++ 4.0). Remember to link ADL-GPIB’s import library GPIB-32.LIB. Creating a Windows 2000/NT/98 ADL-GPIB Application Using Microsoft Visual Basic To create

54 IEEE 488 Function Reference

@ Return CodeThe value of ibsta.

@ Possiable Error CodesEABO, EADR, EBUS, ECIC, EDVR, EFSO, ENEB, EOIP

Page 65: ADL-GPIB · menu (Visual C/C++ 4.0). Remember to link ADL-GPIB’s import library GPIB-32.LIB. Creating a Windows 2000/NT/98 ADL-GPIB Application Using Microsoft Visual Basic To create

IEEE 488 Function Reference 55

2.27 ibrpp

@ DescriptionPerform a parallel poll.

@ Support LevelBoard / Device level

@ SyntaxMicrosoft C/C++ and Borland C++

Int ibrpp ( int ud, char *ppr )Visual Basic

ilrpp (ByVal ud As Integer, ppr As Integer) As Integer

orcall ibrpp (ByVal ud As Integer, ppr As Integer)

@ Parameterud: the device descriptor.

ppr: the result of parallel poll.

@ Return CodeThe value of ibsta.

@ Possiable Error CodesEBUS, ECIC, EDVR, ENEB, EOIP

Page 66: ADL-GPIB · menu (Visual C/C++ 4.0). Remember to link ADL-GPIB’s import library GPIB-32.LIB. Creating a Windows 2000/NT/98 ADL-GPIB Application Using Microsoft Visual Basic To create

56 IEEE 488 Function Reference

2.28 ibrsc

@ DescriptionRequest or release the System Controller capability by sendingInterface Clear (IFC) and Remote Enable (REN) messages todevices. If the board releases system control, perforn opertionsrequiring System Controller capability are not allowed. If the boardrequests system control, calls operation requiring System Control-ler capability are subsequently allowed.

@ Support LevelBoard level

@ SyntaxMicrosoft C/C++ and Borland C++

Int ibrsc ( int ud, int v )Visual Basic

ilrsc (ByVal ud As Integer, ByVal v As Integer) As Integer

orcall ibrsc(ByVal ud As Integer, ByVal v As

Integer)

@ Parameterud: the device descriptor.

v: 0: release system control

1: request system control.

@ Return CodeThe value of ibsta.

@ Possiable Error CodesEARG, EDVR, ENEB, EOIP

Page 67: ADL-GPIB · menu (Visual C/C++ 4.0). Remember to link ADL-GPIB’s import library GPIB-32.LIB. Creating a Windows 2000/NT/98 ADL-GPIB Application Using Microsoft Visual Basic To create

IEEE 488 Function Reference 57

2.29 ibrsp

@ DescriptionPerform a serial poll. If bit 6 (hex 40) of the response is set, thedevice is requesting service. When the automatic serial pollingfeature is enabled, the device might have already been polled. Inthis case, ibrsp returns the previously acquired status byte.

@ Support LevelDevice level

@ SyntaxMicrosoft C/C++ and Borland C++

Int ibrsp ( int ud, char *spr )Visual Basic

ilrsp (ByVal ud As Integer, spr As Integer) As Integer

orcall ibrsp(ByVal ud As Integer, spr As Integer)

@ Parameterud: the device descriptor.

spr: the result of serial poll.

@ Return CodeThe value of ibsta.

@ Possiable Error CodesEABO, EARG, EBUS, ECIC, EDVR, ENEB, EOIP, ESTB

Page 68: ADL-GPIB · menu (Visual C/C++ 4.0). Remember to link ADL-GPIB’s import library GPIB-32.LIB. Creating a Windows 2000/NT/98 ADL-GPIB Application Using Microsoft Visual Basic To create

58 IEEE 488 Function Reference

2.30 ibrsv

@ DescriptionRequest service and change the serial poll status byte.

@ Support LevelBoard level

@ SyntaxMicrosoft C/C++ and Borland C++

ibrsv ( int ud, int v )Visual Basic

ilrsv (ByVal ud As Integer, ByVal v As Integer) As Integer

orcall ibrsv (ByVal ud As Integer, ByVal v As

Integer)

@ Parameterud: the device descriptor.

v: Serial poll status byte.

@ Return CodeThe value of ibsta.

@ Possiable Error CodesEARG, EDVR, ENEB, EOIP

Page 69: ADL-GPIB · menu (Visual C/C++ 4.0). Remember to link ADL-GPIB’s import library GPIB-32.LIB. Creating a Windows 2000/NT/98 ADL-GPIB Application Using Microsoft Visual Basic To create

IEEE 488 Function Reference 59

2.31 ibsic

@ DescriptionAsserts the GPIB interfaces clear (IFC) line for at least 100 ns ifthe GPIB interface is System Controller. This initializes the GPIBand makes the interface CIC and Active Controller with ATNasserted.

@ Support LevelBoard level

@ SyntaxMicrosoft C/C++ and Borland C++

Int ibsic ( int ud )Visual Basic

ilsic (ByVal ud As Integer) As Integerorcall ibsic (ByVal ud As Integer)

@ Parameterud: the device descriptor.

@ Return CodeThe value of ibsta.

@ Possiable Error CodesEARG, EDVR, ENEB, EOIP, ESAC

Page 70: ADL-GPIB · menu (Visual C/C++ 4.0). Remember to link ADL-GPIB’s import library GPIB-32.LIB. Creating a Windows 2000/NT/98 ADL-GPIB Application Using Microsoft Visual Basic To create

60 IEEE 488 Function Reference

2.32 ibsre

@ DescriptionSet or clear the Remote Enable (REN) line. If remote enable line isset, the GPIB Remote Enable (REN) line is asserted. If remoteenable line is cleared, REN is unasserted. REN is used by devicesto choose between local and remote modes of operation. A deviceshould not actually enter remote mode until it receives its listenaddress and REN is asserted.

@ Support LevelBoard level

@ SyntaxMicrosoft C/C++ and Borland C++

Int ibsre( int ud, int v )Visual Basic

ilsre (ByVal ud As Integer, ByVal v As Integer) As Integer

orcall ibsre(ByVal ud As Integer, ByVal v As

Integer)

@ Parameterud: the board descriptor.

v: 0: clear REN line.

1: set REN line

@ Return CodeThe value of ibsta.

@ Possiable Error CodesEARG, EDVR, ENEB, EOIP, ESAC

Page 71: ADL-GPIB · menu (Visual C/C++ 4.0). Remember to link ADL-GPIB’s import library GPIB-32.LIB. Creating a Windows 2000/NT/98 ADL-GPIB Application Using Microsoft Visual Basic To create

IEEE 488 Function Reference 61

2.33 ibstop

@ DescriptionAbort asynchronous mode of I/O operation. If asynchronous I/O isin progress, the error bit is set in the status word, ibsta, and EABOis returned, indicating that the I/O was successfully stopped.

@ Support LevelBoard / Device level

@ SyntaxMicrosoft C/C++ and Borland C++

Int ibstop( int ud )Visual Basic

ilstop (ByVal ud As Integer) As Integerorcall ibstop(ByVal ud As Integer)

@ Parameterud: the board or device descriptor.

@ Return CodeThe value of ibsta.

@ Possiable Error CodesEABO, EBUS, EDVR, ENEB

Page 72: ADL-GPIB · menu (Visual C/C++ 4.0). Remember to link ADL-GPIB’s import library GPIB-32.LIB. Creating a Windows 2000/NT/98 ADL-GPIB Application Using Microsoft Visual Basic To create

62 IEEE 488 Function Reference

2.34 ibtmo

@ DescriptionSet the timeout period of the board or device. The timeout periodis the maximum duration allowed for a synchronous I/O operation(for example, ibrd and ibwrt) or for an ibwait or ibnotify operationwith TIMO in the wait mask. If the operation does not completebefore the timeout period elapses, the operation is aborted andTIMO is returned in ibsta.

@ Support LevelBoard / Device level

@ SyntaxMicrosoft C/C++ and Borland C++

Int ibtmo( int ud, int v )Visual Basic

iltmo (ByVal ud As Integer, ByVal v As Integer) As Integer

orcall ibtmo (ByVal ud As Integer, ByVal v As

Integer)

@ Parameterud: the board or device descriptor.

v: timeout code. The valid timeout codes are the following:

Constant Value of v MinimumTimeout

TNONE 0 Disabled - no timeoutT10us 1 10 µsT30us 2 30 µsT100us 3 100 µsT300us 4 300 µsT1ms 5 1 msT3ms 6 3 ms

Page 73: ADL-GPIB · menu (Visual C/C++ 4.0). Remember to link ADL-GPIB’s import library GPIB-32.LIB. Creating a Windows 2000/NT/98 ADL-GPIB Application Using Microsoft Visual Basic To create

IEEE 488 Function Reference 63

@ Return CodeThe value of ibsta.

@ Possiable Error CodesEARG, EDVR, ENEB, EOIP

T10ms 7 10 msT30ms 8 30 msT100ms 9 100 msT300ms 10 300 msT1s 11 1 sT3s 12 3 sT10s 13 10 sT30s 14 30 sT100s 15 100 sT300s 16 300 sT1000s 17 1000 s

Constant Value of v MinimumTimeout

Page 74: ADL-GPIB · menu (Visual C/C++ 4.0). Remember to link ADL-GPIB’s import library GPIB-32.LIB. Creating a Windows 2000/NT/98 ADL-GPIB Application Using Microsoft Visual Basic To create

64 IEEE 488 Function Reference

2.35 ibtrg

@ DescriptionSend the Group Execute Trigger (GET) message to the device.

@ Support LevelDevice level

@ SyntaxMicrosoft C/C++ and Borland C++

Int ibtrg ( int ud )Visual Basic

iltrg (ByVal ud As Integer) As Integerorcall ibtrg(ByVal ud As Integer)

@ Parameterud: the device descriptor.

@ Return CodeThe value of ibsta.

@ Possiable Error CodesEARG, EBUS, ECIC, EDVR, ENEB, EOIP

Page 75: ADL-GPIB · menu (Visual C/C++ 4.0). Remember to link ADL-GPIB’s import library GPIB-32.LIB. Creating a Windows 2000/NT/98 ADL-GPIB Application Using Microsoft Visual Basic To create

IEEE 488 Function Reference 65

2.36 ibwait@ Description

Monitor the events specified by mask and delays processing untilone or more of the events occurs. If the wait mask is zero, ibwaitreturns immediately with the updated ibsta. If TIMO is set in thewait mask, ibwait returns when the timeout period has elapsed, ifone or more of the other specified events have not alreadyoccurred. If TIMO is not set in the wait mask, the function waitsindefinitely for one or more of the specified events to occur. Theexisting ibwait mask bits are identical to the ibsta bits. If ud is adevice descriptor, the only valid wait mask bits are TIMO, END,RQS, and CMPL. If ud is a board descriptor, all wait mask bits arevalid except for RQS. You can configure the timeout period usingthe ibtmo function.

@ Support LevelBoard / Device level

@ SyntaxMicrosoft C/C++ and Borland C++

Int ibwait ( int ud, int mask )Visual Basic

ilwait (ByVal ud As Integer, ByVal mask As Integer) As Integer

orcall ibwait (ByVal ud As Integer, ByVal mask As

Integer)

@ Parameterud: the board or device descriptor.

mask: GPIB events to wait for. The valid mask codes are listed inthe following table:

Mask Bit Pos. Hex Value Description

ERR 15 8000 GPIB errorTIMO 14 4000 Time limit exceeded

Page 76: ADL-GPIB · menu (Visual C/C++ 4.0). Remember to link ADL-GPIB’s import library GPIB-32.LIB. Creating a Windows 2000/NT/98 ADL-GPIB Application Using Microsoft Visual Basic To create

66 IEEE 488 Function Reference

@ Return CodeThe value of ibsta.

@ Possiable Error CodesEARG, EBUS, ECIC, EDVR, ENEB, ESRQ

END 13 2000 GPIB board detected END or EOSSRQI 12 1000 SRQ asserted (board only)RQS 11 800 Device requesting service (device only)

SPOLL 10 400 The board has been serial polled by theControllerEVENT 9 200 A DTAS, DCAS, or IFC event has occurredCMPL 8 100 I/O completedLOK 7 80 GPIB board is in Lockout StateREM 6 40 GPIB board is in Remote StateCIC 5 20 GPIB board is CICATN 4 10 Attention is asserted

TACS 3 8 GPIB board is TalkerLACS 2 4 GPIB board is ListenerDTAS 1 2 GPIB board is in Device Trigger StateDCAS 0 1 GPIB board is in Device Clear State

Mask Bit Pos. Hex Value Description

Page 77: ADL-GPIB · menu (Visual C/C++ 4.0). Remember to link ADL-GPIB’s import library GPIB-32.LIB. Creating a Windows 2000/NT/98 ADL-GPIB Application Using Microsoft Visual Basic To create

IEEE 488 Function Reference 67

2.37 ibwrt

@ DescriptionWrite data to a device from a data buffer.

If ud is a device descriptor, ibwrt addresses the GPIB and writescount bytes from the memory to a GPIB device. The operation ter-minates normally when count bytes have been sent. The operationterminates with an error if count bytes could not be sent within thetimeout period. The actual number of bytes transferred is returnedin the global variable ibcntl.

If ud is a board descriptor, ibwrt writes count bytes of data from thebuffer to a GPIB device; a board-level ibwrt assumes that theGPIB is already properly addressed. The operation terminatesnormally when count bytes have been sent. The operation termi-nates with an error if count bytes could not be sent within the time-out period or, if the board is not CIC, the CIC sends Device Clearon the GPIB. The actual number of bytes transferred is returned inthe global variable ibcntl.

@ Support LevelBoard / Device level

@ SyntaxMicrosoft C/C++ and Borland C++

Int ibwrt ( int ud, const void *buf, long count )Visual Basic

ilwrt (ByVal ud As Integer, ByVal buf As String, ByVal cnt As Long) As Integer

orcall ibwrt (ByVal ud As Integer, ByVal buf As

String)

@ Parameterud: device unit descriptor

buf: the buffer contains data bytes to sent

cnt: number of data bytes to sent

Page 78: ADL-GPIB · menu (Visual C/C++ 4.0). Remember to link ADL-GPIB’s import library GPIB-32.LIB. Creating a Windows 2000/NT/98 ADL-GPIB Application Using Microsoft Visual Basic To create

68 IEEE 488 Function Reference

@ Return CodeThe value of ibsta.

@ Possiable Error CodesEADR, EABO, EBUS, ECIC, EDVR, EOIP, ENEB, ENOL

Page 79: ADL-GPIB · menu (Visual C/C++ 4.0). Remember to link ADL-GPIB’s import library GPIB-32.LIB. Creating a Windows 2000/NT/98 ADL-GPIB Application Using Microsoft Visual Basic To create

IEEE 488 Function Reference 69

2.38 ibwrta

@ DescriptionWrite data asynchronously to a device from a data buffer.

If ud is a device descriptor, ibwrt addresses the GPIB and writescount bytes from the memory to a GPIB device. The operation ter-minates normally when count bytes have been sent. The operationterminates with an error if count bytes could not be sent within thetimeout period. The actual number of bytes transferred is returnedin the global variable ibcntl.

If ud is a board descriptor, ibwrt writes count bytes of data from thebuffer to a GPIB device; a board-level ibwrt assumes that theGPIB is already properly addressed. The operation terminatesnormally when count bytes have been sent. The operation termi-nates with an error if count bytes could not be sent within the time-out period or, if the board is not CIC, the CIC sends Device Clearon the GPIB. The actual number of bytes transferred is returned inthe global variable ibcntl.

The asynchronous I/O calls (ibcmda, ibrda, ibwrta) are designedso that applications can perform other non-GPIB operations whilethe I/O is in progress. Once the asynchronous I/O has begun, fur-ther GPIB calls are strictly limited. Any calls that would interferewith the I/O in progress are not allowed, the driver returns EOIP inthis case.

Once the I/O is complete, the application must resynchronize withthe adlgpib driver.

Page 80: ADL-GPIB · menu (Visual C/C++ 4.0). Remember to link ADL-GPIB’s import library GPIB-32.LIB. Creating a Windows 2000/NT/98 ADL-GPIB Application Using Microsoft Visual Basic To create

70 IEEE 488 Function Reference

Resynchronization is accomplished by using one of the followingthree functions:

ibwait: If the returned ibsta mask has the CMPL bit set, the driver and application are resynchronized.ibnotify: If the ibsta value passed to the ibnotify callback contains CMPL, the driver and application are resynchro-nized.ibstop: The I/O is canceled; the driver and application are resynchronized.ibonl: The I/O is canceled and the interface is reset; the driver and application are resynchronized.

@ Support LevelBoard / Device level

@ SyntaxMicrosoft C/C++ and Borland C++

Int ibwrta ( int ud, const void *buf, long count )

Visual Basic ilwrta (ByVal ud As Integer, ByVal buf As String,

ByVal cnt As Long) As Integerorcall ibwrta (ByVal ud As Integer, ByVal buf As

String)

@ Parameterud: device unit descriptor

buf: the buffer contains data bytes to sent

cnt: number of data bytes to sent

@ Return CodeThe value of ibsta.

@ Possiable Error CodesEADR, EABO, EBUS, ECIC, EDVR, EOIP, ENEB, ENOL

Page 81: ADL-GPIB · menu (Visual C/C++ 4.0). Remember to link ADL-GPIB’s import library GPIB-32.LIB. Creating a Windows 2000/NT/98 ADL-GPIB Application Using Microsoft Visual Basic To create

IEEE 488 Function Reference 71

2.39 ibwrtf

@ DescriptionWrite data to a device from a file.

If ud is a device descriptor, ibwrtf addresses the GPIB and writesall of the bytes from the file flname to a GPIB device. The opera-tion terminates normally when all of the bytes have been sent. Theoperation terminates with an error if all of the bytes could not besent within the timeout period. The actual number of bytes trans-ferred is returned in the global variable ibcntl.

If ud is a board descriptor, ibwrtf writes all of the bytes of data fromthe file flname to a GPIB device. A board-level ibwrtf assumes thatthe GPIB is already properly addressed. The operation terminatesnormally when all of the bytes have been sent. The operation ter-minates with an error if all of the bytes could not be sent within thetimeout period, or if the board is not CIC, the CIC sends a DeviceClear on the GPIB. The actual number of bytes transferred isreturned in the global variable ibcntl.

@ Support LevelBoard / Device level

@ SyntaxMicrosoft C/C++ and Borland C++

Int ibwrtf( int ud, const char *file_path )Visual Basic

ilwrtf (ByVal ud As Integer, ByVal filename As String) As Integer

orcall ibwrtf (ByVal ud As Integer, ByVal filename

As String)

@ Parameterud: the device descriptor.

filename: the name of the file containing the data to write.

Page 82: ADL-GPIB · menu (Visual C/C++ 4.0). Remember to link ADL-GPIB’s import library GPIB-32.LIB. Creating a Windows 2000/NT/98 ADL-GPIB Application Using Microsoft Visual Basic To create

72 IEEE 488 Function Reference

@ Return CodeThe value of ibsta.

@ Possiable Error CodesEABO, EADR, EBUS, ECIC, EDVR, EFSO, ENEB, EOIP

Page 83: ADL-GPIB · menu (Visual C/C++ 4.0). Remember to link ADL-GPIB’s import library GPIB-32.LIB. Creating a Windows 2000/NT/98 ADL-GPIB Application Using Microsoft Visual Basic To create

Multi-Device IEEE 488 Function Reference 75

3 Multi-Device IEEE 488 Function Reference

3.1 AllSpoll

@ DescriptionPerform serial poll one or more devices. The poll responses arestores in resultList and the number of responses in ibcntl.

@ SyntaxMicrosoft C/C++ and Borland C++

void AllSpoll( int board_desc, const Addr4882_t addressList[], short resultList[] )

Visual Basic call AllSpoll (ByVal board_desc As Integer,

addressList () As Integer, resultList () As Integer)

@ Parameterboard_desc: board id

addressList: the list of device addresses that is terminated byNOADDR

resultList: the list of serial poll response bytes correspondingto device addresses in addrlist

@ Possiable Error CodesEARG, EABO, EBUS, ECIC, EDVR, EOIP, ENEB

Page 84: ADL-GPIB · menu (Visual C/C++ 4.0). Remember to link ADL-GPIB’s import library GPIB-32.LIB. Creating a Windows 2000/NT/98 ADL-GPIB Application Using Microsoft Visual Basic To create

76 Multi-Device IEEE 488 Function Reference

3.2 DevClear

@ DescriptionSend the Selected Device Clear (SDC) GPIB message to clear adevice. If address is the constant NOADDR, the Universal DeviceClear (DCL) message is sent to all devices.

@ SyntaxMicrosoft C/C++ and Borland C++

void DevClear( int board_desc, Addr4882_t address )

Visual Basic call DevClear(ByVal board_desc As Integer, ByVal

address As Integer)

@ Parameterboard_desc: board id

address: the device address wishing to be cleared

@ Possiable Error CodesEARG, EBUS, ECIC, EDVR, EOIP, ENEB

Page 85: ADL-GPIB · menu (Visual C/C++ 4.0). Remember to link ADL-GPIB’s import library GPIB-32.LIB. Creating a Windows 2000/NT/98 ADL-GPIB Application Using Microsoft Visual Basic To create

Multi-Device IEEE 488 Function Reference 77

3.3 DevClearList

@ DescriptionClear mutiple devices. If address is the constant NOADDR, theUniversal Device Clear (DCL) message is sent to all devices.

@ SyntaxMicrosoft C/C++ and Borland C++

void DevClearList ( int board_desc, const Addr4882_t addressList[] )

Visual Basic call DevClearList (ByVal ud As Integer,

addressList () As Integer)

@ Parameterboard_desc: board id

addressList: a list of the device addresses terminated byNOADDR wishing to be cleared

@ Possiable Error CodesEARG, EBUS, ECIC, EDVR, EOIP, ENEB

Page 86: ADL-GPIB · menu (Visual C/C++ 4.0). Remember to link ADL-GPIB’s import library GPIB-32.LIB. Creating a Windows 2000/NT/98 ADL-GPIB Application Using Microsoft Visual Basic To create

78 Multi-Device IEEE 488 Function Reference

3.4 EnableLocal

@ DescriptionEnable operations from the front panel of devices by sending theGo To Local (GTL) GPIB message to multiple devices. This placesthe devices into local mode. If addrlist contains only the constantNOADDR, the Remote Enable (REN) GPIB line is unasserted.

@ SyntaxMicrosoft C/C++ and Borland C++

void EnableLocal( int board_desc, const Addr4882_t addressList[] )

Visual Basic call EnableLocal(ByVal ud As Integer, addressList

() As Integer)

@ Parameterboard_desc: board id

addressList: a list of the device addresses terminated byNOADDR wishing to go to local.

@ Possiable Error CodesEARG, EBUS, ECIC, EDVR, EOIP, ENEB, ESAC

Page 87: ADL-GPIB · menu (Visual C/C++ 4.0). Remember to link ADL-GPIB’s import library GPIB-32.LIB. Creating a Windows 2000/NT/98 ADL-GPIB Application Using Microsoft Visual Basic To create

Multi-Device IEEE 488 Function Reference 79

3.5 EnableRemote

@ DescriptionEnable remote GPIB programming for devices by asserting theRemote Enable (REN) GPIB line. The devices are put into a listen-active state.

@ SyntaxMicrosoft C/C++ and Borland C++

void EnableRemote ( int board_desc, const Addr4882_t addressList[] )

Visual Basic call EnableRemote (ByVal ud As Integer,

addressList () As Integer)

@ Parameterboard_desc: board id

addressList: a list of the device addresses terminated byNOADDR wishing to go to local.

@ Possiable Error CodesEARG, EBUS, ECIC, EDVR, EOIP, ENEB, ESAC

Page 88: ADL-GPIB · menu (Visual C/C++ 4.0). Remember to link ADL-GPIB’s import library GPIB-32.LIB. Creating a Windows 2000/NT/98 ADL-GPIB Application Using Microsoft Visual Basic To create

80 Multi-Device IEEE 488 Function Reference

3.6 FindLstn

@ DescriptionFind listening devices on the GPIB bus. This function tests all ofthe primary addresses in padlist as follows: If a device is presentat a primary address given in padlist, the primary address is storedin resultlist. Otherwise, all secondary addresses of the primaryaddress are tested, and the addresses of any devices found arestored in resultlist. ibcntl contains the actual number of addressesstored in resultlist.

@ SyntaxMicrosoft C/C++ and Borland C++

void FindLstn( int board_desc, const Addr4882_t padList[], Addr4882_t resultList[], int maxNumResults )

Visual Basic call FindLstn (ByVal ud As Integer, padList () As

Integer, resultList () As Integer, ByVal maxNumResults As Integer)

@ Parameterboard_desc: board id

padList: a list of the gpib primary addresses terminated byNOADDR.

resultList: addresses of all listening devices found by FindL-stn.

maxNumResults: maximum count of entries that can be placed inresultList.

@ Possiable Error CodesEARG, EBUS, ECIC, EDVR, EOIP, ENEB, ETAB

Page 89: ADL-GPIB · menu (Visual C/C++ 4.0). Remember to link ADL-GPIB’s import library GPIB-32.LIB. Creating a Windows 2000/NT/98 ADL-GPIB Application Using Microsoft Visual Basic To create

Multi-Device IEEE 488 Function Reference 81

3.7 FindRQS

@ DescriptionSerial poll the devices to determine which device is requestingservice, until it finds a device which is requesting service. Theserial poll response byte is placed in result. ibcntl contains theindex of the device requesting service in addrList. If none of thedevices are requesting service, the index corresponding toNOADDR in addrlist is returned in ibcntl and ETAB is returned iniberr.

@ SyntaxMicrosoft C/C++ and Borland C++

void FindRQS ( int board_desc, const Addr4882_t addressList[], short *result )

Visual Basic call FindRQS (ByVal ud As Integer, addressList ()

As Integer, result As Integer)

@ Parameterboard_desc: board id

addressList: a list of the gpib primary addresses terminated byNOADDR.

result: Serial poll response byte of the device that is requestingservice.

@ Possiable Error CodesEARG, EBUS, ECIC, EDVR, EOIP, ENEB, ETAB

Page 90: ADL-GPIB · menu (Visual C/C++ 4.0). Remember to link ADL-GPIB’s import library GPIB-32.LIB. Creating a Windows 2000/NT/98 ADL-GPIB Application Using Microsoft Visual Basic To create

82 Multi-Device IEEE 488 Function Reference

3.8 PassControl

@ DescriptionPass control to another GPIB device with Controller capability bysending the Take Control (TCT) GPIB message to the device. Thedevice becomes Controller-In-Charge (CIC) and the interface is nolonger CIC.

@ SyntaxMicrosoft C/C++ and Borland C++

void PassControl( int board_desc, Addr4882_t address )

Visual Basic call PassControl (ByVal board_desc As Integer,

ByVal address As Integer)

@ Parameterboard_desc: board id

address: a list of the gpib primary addresses terminated byNOADDR.

@ Possiable Error CodesEARG, EBUS, ECIC, EDVR, EOIP, ENEB

Page 91: ADL-GPIB · menu (Visual C/C++ 4.0). Remember to link ADL-GPIB’s import library GPIB-32.LIB. Creating a Windows 2000/NT/98 ADL-GPIB Application Using Microsoft Visual Basic To create

Multi-Device IEEE 488 Function Reference 83

3.9 PPoll

@ DescriptionPerform a parallel poll. The board sents command to each device(see PPollConfig and PPollUnconfig). The Controller can use par-allel polling to obtain one-bit, device-dependent status messagesfrom up to eight devices simultaneously

@ SyntaxMicrosoft C/C++ and Borland C++

void PPoll( int board_desc, short *result )Visual Basic

call Ppoll(ByVal board_desc As Integer, result As Integer)

@ Parameterboard_desc: board id

result: The parallel poll result.

@ Possiable Error CodesEBUS, ECIC, EDVR, EOIP, ENEB

Page 92: ADL-GPIB · menu (Visual C/C++ 4.0). Remember to link ADL-GPIB’s import library GPIB-32.LIB. Creating a Windows 2000/NT/98 ADL-GPIB Application Using Microsoft Visual Basic To create

84 Multi-Device IEEE 488 Function Reference

3.10 PPollConfig

@ DescriptionConfigures the device to respond to parallel polls by asserting ornot asserting the GPIB data line, dataline. If lineSense equals theindividual status (ist) bit of the device, the assigned GPIB data lineis asserted during a parallel poll. Otherwise, the data line is notasserted during a parallel poll. The Controller can use parallel poll-ing to obtain 1-bit, device-dependent status messages from up toeight devices simultaneously.

@ SyntaxMicrosoft C/C++ and Borland C++

void PPollConfig ( int board_desc, Addr4882_t address, int dataLine, int lineSense )

Visual Basic call PpollConfig (ByVal ud As Integer, ByVal

address As Integer, ByVal dataLine As Integer, ByVal lineSense As Integer)

@ Parameterboard_desc: board id

address: address of the device to be configured.

dataLine: Data line (a value in the range of 1 to 8) on which thedevice responds to parallel polls.

lineSense: Sense (either 0 or 1) of the parallel poll response.

@ Possiable Error CodesEARG, EBUS, ECIC, EDVR, EOIP, ENEB

Page 93: ADL-GPIB · menu (Visual C/C++ 4.0). Remember to link ADL-GPIB’s import library GPIB-32.LIB. Creating a Windows 2000/NT/98 ADL-GPIB Application Using Microsoft Visual Basic To create

Multi-Device IEEE 488 Function Reference 85

3.11 PPollUnConfig

@ DescriptionUnconfigures the device to respond to parallel polls. If addrlistcontains only the constant NOADDR, the Parallel Poll Unconfigure(PPU) GPIB message is sent to all GPIB devices. The devicesunconfigured by this function do not participate in subsequent par-allel polls.

@ SyntaxMicrosoft C/C++ and Borland C++

void PPollUnconfig ( int board_desc, const Addr4882_t addressList[] )

Visual Basic call PpollUnconfig(ByVal ud As Integer,

addressList () As Integer)

@ Parameterboard_desc: board id

addressList: A list of device addresses that is terminated byNOADDR.

@ Possiable Error CodesEARG, EBUS, ECIC, EDVR, EOIP, ENEB

Page 94: ADL-GPIB · menu (Visual C/C++ 4.0). Remember to link ADL-GPIB’s import library GPIB-32.LIB. Creating a Windows 2000/NT/98 ADL-GPIB Application Using Microsoft Visual Basic To create

86 Multi-Device IEEE 488 Function Reference

3.12 RcvRespMsg

@ DescriptionRead data bytes from a device. RcvRespMsg assumes that theinterface is already in its listen-active state and a device is alreadyaddressed to be a Talker. Data are read until either count databytes have been read or the termination condition is detected. Ifthe termination condition is STOPend, the read is stopped when abyte is received with the EOI line asserted. Otherwise, the read isstopped when the 8-bit EOS character is detected. The actualnumber of bytes transferred is returned in the global variable,ibcntl.

@ SyntaxMicrosoft C/C++ and Borland C++

void RcvRespMsg ( int board_desc, void *buffer, long count, inttermination )

Visual Basic call RcvRespMsg (ByVal ud As Integer, buf As String, ByVal termi-nation As Integer)

@ Parameterboard_desc: board id

buffer: the buffer which stores the read data.

count: Number of bytes read.

termination: Description of the data termination mode(STOPend or an 8-bit EOS character).

@ Possiable Error CodesEABO, EADR, EARG, ECIC, EDVR, EOIP, ENEB

Page 95: ADL-GPIB · menu (Visual C/C++ 4.0). Remember to link ADL-GPIB’s import library GPIB-32.LIB. Creating a Windows 2000/NT/98 ADL-GPIB Application Using Microsoft Visual Basic To create

Multi-Device IEEE 488 Function Reference 87

3.13 ReadStatusByte

@ DescriptionConduct serial polling single device. If bit 6 (hex 40) of theresponse is set, the device is requesting service.

@ SyntaxMicrosoft C/C++ and Borland C++

void ReadStatusByte ( int board_desc, Addr4882_t address, short *result )

Visual Basic call ReadStatusByte (ByVal ud As Integer, ByVal

addr As Integer, result As Integer)

@ Parameterboard_desc: board id

address: device address.

result: the serial poll response byte.

@ Possiable Error CodesEABO, EARG, EBUS, ECIC, EDVR, EOIP, ENEB

Page 96: ADL-GPIB · menu (Visual C/C++ 4.0). Remember to link ADL-GPIB’s import library GPIB-32.LIB. Creating a Windows 2000/NT/98 ADL-GPIB Application Using Microsoft Visual Basic To create

88 Multi-Device IEEE 488 Function Reference

3.14 Receive

@ DescriptionReads data from a device into the user specified buffer.

Receive addresses the device described by address to talk andthe interface to listen, reads up to count bytes of data, and placesthe data into the buffer. The operation terminates normally whencount bytes have been received or the termination condition isdetected. If the termination condition is STOPend, the read isstopped when a byte is received with the EOI line asserted. Other-wise, the read is stopped when an 8-bit EOS character isdetected. The actual number of bytes transferred is returned in theglobal variable, ibcntl.

@ SyntaxMicrosoft C/C++ and Borland C++

void Receive( int board_desc, Addr4882_t address, void *buffer, long count, int termination )

Visual Basic call Receive(ByVal ud As Integer, ByVal addr As

Integer, buf As String, ByVal termination As Integer)

@ Parameterboard_desc: board id

address: address of the device to read data.

buffer: the buffer which stores the read data

termination: the data termination mode (STOPend or an EOScharacter)

@ Possiable Error CodesEABO, EARG, EBUS, ECIC, EDVR, EOIP, ENEB

Page 97: ADL-GPIB · menu (Visual C/C++ 4.0). Remember to link ADL-GPIB’s import library GPIB-32.LIB. Creating a Windows 2000/NT/98 ADL-GPIB Application Using Microsoft Visual Basic To create

Multi-Device IEEE 488 Function Reference 89

3.15 ReceiveSetup

@ DescriptionSet a device to be a Talker and the interface to be a Listener. Thisfunciton is usually followed by a call to RcvRespMsg to transferdata from the device to the interface. This call is useful to makemultiple calls to RcvRspMsg; it eliminates the need to readdressthe device to receive every block of data.

@ SyntaxMicrosoft C/C++ and Borland C++

void ReceiveSetup( int board_desc, Addr4882_t address )

Visual Basic call ReceiveSetup(ByVal ud As Integer, ByVal addr

As Integer)

@ Parameterboard_desc: board id

address: address of the device addressed to be a talker

@ Possiable Error CodesEARG, EBUS, ECIC, EDVR, EOIP, ENEB

Page 98: ADL-GPIB · menu (Visual C/C++ 4.0). Remember to link ADL-GPIB’s import library GPIB-32.LIB. Creating a Windows 2000/NT/98 ADL-GPIB Application Using Microsoft Visual Basic To create

90 Multi-Device IEEE 488 Function Reference

3.16 ResetSys

@ DescriptionReset and initialize devices. It includes three steps. The first stepresets the GPIB by asserting the Remote Enable (REN) line andthen the Interface Clear (IFC) line. The second step clears all ofthe devices by sending the Universal Device Clear (DCL) GPIBmessage. The final step causes devices to perform device-specificreset and initialization. This step is accomplished by sending themessage "*RST\n" to the devices described by addrlist.

@ SyntaxMicrosoft C/C++ and Borland C++

void ResetSys ( int board_desc, const Addr4882_t addressList[] )

Visual Basic call ResetSys (ByVal ud As Integer, addressList

() As Integer)

@ Parameterboard_desc: board id

addressList: list of the device addresses that is terminated byNOADDR

@ Possiable Error CodesEABO, EARG, EBUS, ECIC, EDVR, ENOL, EOIP, ENEB,

ESAC

Page 99: ADL-GPIB · menu (Visual C/C++ 4.0). Remember to link ADL-GPIB’s import library GPIB-32.LIB. Creating a Windows 2000/NT/98 ADL-GPIB Application Using Microsoft Visual Basic To create

Multi-Device IEEE 488 Function Reference 91

3.17 Send

@ DescriptionWrite data to a device from a data buffer.

The operation terminates normally when count bytes have beensent. The last byte is sent with the EOI line asserted if eotmode isDABend. The last byte is sent without the EOI line asserted if eot-mode is NULLend. If eotmode is NLend then a new line character('\n') is sent with the EOI line asserted after the last byte of buffer.The actual number of bytes transferred is returned in the globalvariable, ibcntl.

@ SyntaxMicrosoft C/C++ and Borland C++

void Send ( int board_desc, Addr4882_t address, const void *buffer, long count, int eot_mode )

Visual Basic call Send (ByVal ud As Integer, ByVal addr As

Integer, ByVal buf As String, ByVal eot_mode As Integer)

@ Parameterboard_desc: board id

address: device address

buffer: the data bytes to be sent

count: data count

eot_mode: the data termination mode: DABend, NULLend, orNLend

@ Possiable Error CodesEABO, EARG, EBUS, ECIC, EDVR, ENOL, EOIP, ENEB

Page 100: ADL-GPIB · menu (Visual C/C++ 4.0). Remember to link ADL-GPIB’s import library GPIB-32.LIB. Creating a Windows 2000/NT/98 ADL-GPIB Application Using Microsoft Visual Basic To create

92 Multi-Device IEEE 488 Function Reference

3.18 SendCmds

@ DescriptionSend GPIB command. The number of command bytes transferredis returned in the global variable ibcntl

@ SyntaxMicrosoft C/C++ and Borland C++

void SendCmds ( int board_desc, const void * cmdbuf, long count )

Visual Basic call SendCmds(ByVal ud As Integer, ByVal cmdbuf

As String)

@ Parameterboard_desc: board id

cmdbuf: Command bytes to be sent

count: data count

@ Possiable Error CodesEABO, ECIC, EDVR, ENOL, EOIP, ENEB

Page 101: ADL-GPIB · menu (Visual C/C++ 4.0). Remember to link ADL-GPIB’s import library GPIB-32.LIB. Creating a Windows 2000/NT/98 ADL-GPIB Application Using Microsoft Visual Basic To create

Multi-Device IEEE 488 Function Reference 93

3.19 SendDataBytes

@ DescriptionSend number of bytes from the buffer to devices. SendDataBytesassumes that the interface is in talk-active state and that devicesare already addressed as Listeners on the GPIB. The last byte issent with the EOI line asserted if eotmode is DABend; the last byteis sent without the EOI line asserted if eotmode is NULLend. If eot-mode is NLend then a new line character ('\n') is sent with the EOIline asserted after the last byte. The actual number of bytes trans-ferred is returned in the global variable, ibcntl.

@ SyntaxMicrosoft C/C++ and Borland C++

void SendDataBytes ( int board_desc, const void *buffer, long count, int eotmode )

Visual Basic call SendDataBytes(ByVal ud As Integer, ByVal buf

As String, ByVal term As Integer)

@ Parameterboard_desc: board id

buffer: the data bytes to be sent

count: data count

eot_mode: the data termination mode: DABend, NULLend, orNLend

@ Possiable Error CodesEABO, EADR, EARG, EBUS, ECIC, EDVR, ENOL, EOIP,

ENEB

Page 102: ADL-GPIB · menu (Visual C/C++ 4.0). Remember to link ADL-GPIB’s import library GPIB-32.LIB. Creating a Windows 2000/NT/98 ADL-GPIB Application Using Microsoft Visual Basic To create

94 Multi-Device IEEE 488 Function Reference

3.20 SendList

@ DescriptionSend data bytes to multiple GPIB devices. SendList addresses thedevices described by addrlist to listen and the interface to talk andthen data from buffer are sent to the devices. The last byte is sentwith the EOI line asserted if eotmode is DABend. The last byte issent without the EOI line asserted if eotmode is NULLend. If eot-mode is NLend, a new line character ('\n') is sent with the EOI lineasserted after the last byte. The actual number of bytes trans-ferred is returned in the global variable, ibcntl.

@ SyntaxMicrosoft C/C++ and Borland C++

void SendList( int board_desc, const Addr4882_t addressList[], const void *buffer, long count, int eotmode )

Visual Basic call SendList(ByVal ud As Integer, addressList ()

As Integer, ByVal buf As String, ByVal term As Integer)

@ Parameterboard_desc: board id

addresslist: list of device addresses to send data

buffer: the data bytes to be sent

count: data count

eot_mode: the data termination mode: DABend, NULLend, orNLend

@ Possiable Error CodesEABO, EARG, EBUS, ECIC, EDVR, EOIP, ENEB

Page 103: ADL-GPIB · menu (Visual C/C++ 4.0). Remember to link ADL-GPIB’s import library GPIB-32.LIB. Creating a Windows 2000/NT/98 ADL-GPIB Application Using Microsoft Visual Basic To create

Multi-Device IEEE 488 Function Reference 95

3.21 SendIFC

@ DescriptionReset the GPIB by sending interface clear. SendIFC is used aspart of GPIB initialization. It forces the interface to be Controller-In-Charge of the GPIB. It also ensures that the connected devicesare all un-addressed and that the interface calls of the devices arein their idle states.

@ SyntaxMicrosoft C/C++ and Borland C++

void SendIFC( int board_desc )Visual Basic

call SendIFC(ByVal ud As Integer)

@ Parameterboard_desc: board id

@ Possiable Error Codes ENEB, ESAC, EDVR, EOIP

Page 104: ADL-GPIB · menu (Visual C/C++ 4.0). Remember to link ADL-GPIB’s import library GPIB-32.LIB. Creating a Windows 2000/NT/98 ADL-GPIB Application Using Microsoft Visual Basic To create

96 Multi-Device IEEE 488 Function Reference

3.22 SendLLO

@ DescriptionSend the Local Lockout (LLO) message to all devices. While LocalLockout is in effect, only the Controller-In-Charge can alter thestate of the devices by sending appropriate GPIB messages.

SendLLO is reserved for use in unusual local/remote situations. Inthe typical case of placing the devices in Remote With Local Lock-out, use SetRWLS.

@ SyntaxMicrosoft C/C++ and Borland C++

void SendLLO ( int board_desc )Visual Basic

call SendLLO (ByVal ud As Integer)

@ Parameterboard_desc: board id

@ Possiable Error Codes EBUS, ECIC, ENEB, ESAC, EDVR, EOIP

Page 105: ADL-GPIB · menu (Visual C/C++ 4.0). Remember to link ADL-GPIB’s import library GPIB-32.LIB. Creating a Windows 2000/NT/98 ADL-GPIB Application Using Microsoft Visual Basic To create

Multi-Device IEEE 488 Function Reference 97

3.23 SendSetup

@ DescriptionSet up devices to receive data. SendSetup makes the devicesdescribed by addressList listen-active and makes the interfacetalk-active. This call is usually followed by SendDataBytes to actu-ally transfer data from the interface to the devices. SendSetup isparticularly useful to set up the addressing before making multiplecalls to SendDataBytes; it eliminates the need to readdress thedevices for every block of data.

@ SyntaxMicrosoft C/C++ and Borland C++

void SendSetup ( int board_desc, const Addr4882_t addressList[] )

Visual Basic call SendSetup(ByVal ud As Integer, addrs() As

Integer)

@ Parameterboard_desc: board id

addresslist: list of device addresses that is terminated byNOADDR

@ Possiable Error CodesEABO, EARG, EBUS, ECIC, EDVR, EOIP, ENEB

Page 106: ADL-GPIB · menu (Visual C/C++ 4.0). Remember to link ADL-GPIB’s import library GPIB-32.LIB. Creating a Windows 2000/NT/98 ADL-GPIB Application Using Microsoft Visual Basic To create

98 Multi-Device IEEE 488 Function Reference

3.24 SetRWLS

@ DescriptionPlace devices in Remote With Lockout State. SetRWLS places thedevices described by addrlist in remote mode by asserting theRemote Enable (REN) GPIB line. Then those devices are placedin lockout state by the Local Lockout (LLO) GPIB message. Youcannot program those devices locally until the Controller-In-Charge releases the Local Lockout by way of the EnableLocal call.

@ SyntaxMicrosoft C/C++ and Borland C++

void SetRWLS ( int board_desc, const Addr4882_t addressList[] )

Visual Basic call SetRWLS (ByVal ud As Integer, addressList ()

As Integer)

@ Parameterboard_desc: board id

addresslist: list of device addresses that is terminated byNOADDR

@ Possiable Error CodesEARG, EBUS, ECIC, EDVR, EOIP, ENEB, ESAC

Page 107: ADL-GPIB · menu (Visual C/C++ 4.0). Remember to link ADL-GPIB’s import library GPIB-32.LIB. Creating a Windows 2000/NT/98 ADL-GPIB Application Using Microsoft Visual Basic To create

Multi-Device IEEE 488 Function Reference 99

3.25 TestSRQ

@ DescriptionCheck the current state of the GPIB Service Request (SRQ) line. IfSRQ is asserted, result contains a non-zero value. Otherwise,result contains a zero. Use TestSRQ to get the current state of theGPIB SRQ line. Use WaitSRQ to wait until SRQ is asserted.

@ SyntaxMicrosoft C/C++ and Borland C++

void TestSRQ ( int board_desc, short *result )Visual Basic

call TestSRQ (ByVal ud As Integer, result As Integer)

@ Parameterboard_desc: board id

result: State of the SRQ line: non-zero if the line is asserted,zero if the line is not asserted.

@ Possiable Error CodesEDVR, EOIP, ENEB

Page 108: ADL-GPIB · menu (Visual C/C++ 4.0). Remember to link ADL-GPIB’s import library GPIB-32.LIB. Creating a Windows 2000/NT/98 ADL-GPIB Application Using Microsoft Visual Basic To create

100 Multi-Device IEEE 488 Function Reference

3.26 TestSys

@ DescriptionMake the devices to conduct self tests. TestSys sends the "*TST?"message to the devices. The "*TST?" message makes them toconduct their self-test procedures. A 16-bit test result code is readfrom each device. A test result of 0\n indicates that the devicepassed its self test. Refer to the documentation that came with thedevice to determine the meaning of the failure code. Any othervalue indicates that the device failed its self test. If the functionreturns without an error (that is, the ERR bit is not set in ibsta),ibcntl contains the number of services that failed. Otherwise, themeaning of ibcntl depends on the error returned. If a device fails tosend a response before the timeout period expires, a test result of? is reported for it, and the error EABO is returned.

@ SyntaxMicrosoft C/C++ and Borland C++

void TestSys ( int board_desc, Addr4882_t * addrlist, short resultList[] )

Visual Basic call TestSys (ByVal ud As Integer, addrlist () As

Integer, resultList () As Integer)

@ Parameterboard_desc: board id

addrlist: a list of device addresses terminated by NOADDR.

resultList: A list of test results; each entry corresponds to anaddress in addrlist.

@ Possiable Error CodesEABO, EARG, EBUS, EDVR, ECIC, EOIP, ENEB, ENOL

Page 109: ADL-GPIB · menu (Visual C/C++ 4.0). Remember to link ADL-GPIB’s import library GPIB-32.LIB. Creating a Windows 2000/NT/98 ADL-GPIB Application Using Microsoft Visual Basic To create

Multi-Device IEEE 488 Function Reference 101

3.27 Trigger

@ DescriptionSend the Group Execute Trigger (GET) GPIB message to singledevice. If address is the constant NOADDR, the GET message issent to all devices that are currently listen-active on the GPIB.

@ SyntaxMicrosoft C/C++ and Borland C++

void Trigger( int board_desc, Addr4882_t address )

Visual Basic call Trigger (ByVal ud As Integer, ByVal address

As Integer)

@ Parameterboard_desc: board id

address: the address of the device to be triggered.

@ Possiable Error CodesEARG, EBUS, EDVR, ECIC, EOIP, ENEB

Page 110: ADL-GPIB · menu (Visual C/C++ 4.0). Remember to link ADL-GPIB’s import library GPIB-32.LIB. Creating a Windows 2000/NT/98 ADL-GPIB Application Using Microsoft Visual Basic To create

102 Multi-Device IEEE 488 Function Reference

3.28 TriggerList

@ DescriptionSend the Group Execute Trigger (GET) GPIB message to multipledevices. If the only address in addrlist is the constant NOADDR,no addressing is performed and the GET message is sent to alldevices that are currently listen-active on the GPIB.

@ SyntaxMicrosoft C/C++ and Borland C++

void TriggerList ( int board_desc, const Addr4882_t addressList[] )

Visual Basic call TriggerList (ByVal ud As Integer,

addressList () As Integer)

@ Parameterboard_desc: board id

addressList: a list of device addresses terminated byNOADDR.

@ Possiable Error CodesEARG, EBUS, EDVR, ECIC, EOIP, ENEB

Page 111: ADL-GPIB · menu (Visual C/C++ 4.0). Remember to link ADL-GPIB’s import library GPIB-32.LIB. Creating a Windows 2000/NT/98 ADL-GPIB Application Using Microsoft Visual Basic To create

Multi-Device IEEE 488 Function Reference 103

3.29 WaitSRQ

@ DescriptionWait until a device asserts the GPIB Service Request (SRQ) line.When WaitSRQ returns, result contains a non-zero if SRQ isasserted. Otherwise, result contains a zero. Use TestSRQ to getthe current state of the GPIB SRQ line. Use WaitSRQ to wait untilSRQ is asserted.

@ SyntaxMicrosoft C/C++ and Borland C++

void WaitSRQ( int board_desc, short *result )Visual Basic

call WaitSRQ (ByVal ud As Integer, result As Integer)

@ Parameterboard_desc: board id

result: State of the SRQ line: non-zero if line is asserted, zero ifline is not asserted.

@ Possiable Error CodesEDVR, EOIP, ENEB

Page 112: ADL-GPIB · menu (Visual C/C++ 4.0). Remember to link ADL-GPIB’s import library GPIB-32.LIB. Creating a Windows 2000/NT/98 ADL-GPIB Application Using Microsoft Visual Basic To create

104 Multi-Device IEEE 488 Function Reference

Page 113: ADL-GPIB · menu (Visual C/C++ 4.0). Remember to link ADL-GPIB’s import library GPIB-32.LIB. Creating a Windows 2000/NT/98 ADL-GPIB Application Using Microsoft Visual Basic To create

Appendix 105

Appendix

Appendix A: Status CodesAll calls update a global status word, ibsta, which contains infor-mation about the state of the GPIB and your GPIB hardware. Youcan check for errors after each call using the ibsta ERR bit.

ibsta is a 16-bit value. A bit value of one (1) indicates that a certaincondition is happened. A bit value of zero (0) indicates that thecondition is not happened.

Mnemonic BitPos. HexValue Type Description

ERR 15 8000 device, board GPIB errorTIMO 14 4000 device, board TimeoutEND 13 2000 device, board END or EOS detectedSRQI 12 1000 board SRQ interrupt occurredRQS 11 800 device Device requesting service

SPOLL 10 400 board Board has been serial polled by ControllerEVENT 9 200 board DCAS, DTAS, or IFC event has occurredCMPL 8 100 device, board I/O completedLOK 7 80 board Lockout StateREM 6 40 board Remote StateCIC 5 20 board Controller-In-ChargeATN 4 10 board Attention is asserted

TACS 3 8 board TalkerLACS 2 4 board ListenerDTAS 1 2 board Device Trigger StateDCAS 0 1 board Device Clear State

Table 4-1: Status Codes

Page 114: ADL-GPIB · menu (Visual C/C++ 4.0). Remember to link ADL-GPIB’s import library GPIB-32.LIB. Creating a Windows 2000/NT/98 ADL-GPIB Application Using Microsoft Visual Basic To create

106 Appendix

Appendix B: Error Codes The following table lists the ADL-GPIB error codes. Remember thatthe error variable is meaningful only when the ERR bit in the sta-tus variable, ibsta, is set. For a detailed description of each errorand possible solutions, click on the error mnemonic.

ErrorMnemonic iberrValue Meaning

EDVR 0 Operating system errorECIC 1 Function requires GPIB board to be CICENOL 2 No Listeners on the GPIBEADR 3 GPIB board not addressed correctlyEARG 4 Invalid argumentESAC 5 GPIB board not System Controller as requiredEABO 6 I/O operation aborted (timeout)ENEB 7 Nonexistent GPIB boardEDMA 8 DMA errorEOIP 10 Asynchronous I/O in progressECAP 11 No capability for operationEFSO 12 File system errorEBUS 14 GPIB bus errorESTB 15 Serial poll status byte queue overflowESRQ 16 SRQ stuck in ON positionETAB 20 Table problem

Table 4-2: Error Codes

Page 115: ADL-GPIB · menu (Visual C/C++ 4.0). Remember to link ADL-GPIB’s import library GPIB-32.LIB. Creating a Windows 2000/NT/98 ADL-GPIB Application Using Microsoft Visual Basic To create

Warranty Policy 107

Warranty PolicyThank you for choosing ADLINK. To understand your rights andenjoy all the after-sales services we offer, please read the follow-ing carefully.

1. Before using ADLINK’s products please read the user man-ual and follow the instructions exactly. When sending indamaged products for repair, please attach an RMA appli-cation form which can be downloaded from: http://rma.adlinktech.com/policy/.

2. All ADLINK products come with a two-year guarantee:

The warranty period starts from the product’s shipment date from ADLINK’s factory.Peripherals and third-party products not manufactured by ADLINK will be covered by the original manufactur-ers' warranty. For products containing storage devices (hard drives, flash cards, etc.), please back up your data before send-ing them for repair. ADLINK is not responsible for loss of data. Please ensure the use of properly licensed software with our systems. ADLINK does not condone the use of pirated software and will not service systems using such software. ADLINK will not be held legally responsible for products shipped with unlicensed software installed by the user. For general repairs, please do not include peripheral accessories. If peripherals need to be included, be cer-tain to specify which items you sent on the RMA Request & Confirmation Form. ADLINK is not responsible for items not listed on the RMA Request & Confirmation Form.

Page 116: ADL-GPIB · menu (Visual C/C++ 4.0). Remember to link ADL-GPIB’s import library GPIB-32.LIB. Creating a Windows 2000/NT/98 ADL-GPIB Application Using Microsoft Visual Basic To create

108 Warranty Policy

3. Our repair service is not covered by ADLINK's two-yearguarantee in the following situations:

Damage caused by not following instructions in the user's manual.Damage caused by carelessness on the user's part dur-ing product transportation. Damage caused by fire, earthquakes, floods, lightening, pollution, other acts of God, and/or incorrect usage of voltage transformers.Damage caused by unsuitable storage environments (i.e. high temperatures, high humidity, or volatile chemi-cals).Damage caused by leakage of battery fluid during or after change of batteries by customer/user. Damage from improper repair by unauthorized techni-cians. Products with altered and/or damaged serial numbers are not entitled to our service. Other categories not protected under our warranty.

4. Customers are responsible for shipping costs to transportdamaged products to our company or sales office.

5. To ensure the speed and quality of product repair, pleasedownload an RMA application form from our company web-site: http://rma.adlinktech.com/policy. Damaged productswith attached RMA forms receive priority.

If you have any further questions, please email our FAE staff: [email protected].