Keithley KPCI-488 LPA User Manual

KPCI-488LPA GPIB Controller Interface Card
User’s Manual
KPCI-488LPA-900-01 Rev. A / December 2008
www.keithley.com
G
A
T
E
E
A
R
AEM
R
RUS
C F
O
IF
NO
ECNED

WARRANTY

Keithley Instruments, Inc. warrants this product to be free from defects in material and workmanship for a period of one (1) year from date of shipment.
Keithley Instruments, Inc. warrants the following items for 90 days from the date of shipment: probes, cables, software, rechargeable batteries, diskettes, and documentation.
During the warranty period, Keithley Instruments will, at its option, either repair or replace any product that proves to be defective.
To exercise this warranty, write or call your local Keithley Instruments representative, or contact Keithley Instruments headquarters in Cleveland, Ohio. You will be given prompt assistance and return instructions. Send the product, transportation prepaid, to the indicated service facility. Repairs will be made and the product returned, transportation prepaid. Repaired or replaced products are warranted for the balance of the original warranty period, or at least 90 days.
LIMITATION OF WARRANTY
This warranty does not apply to defects resulting from product modification without Keithley Instruments’ express written consent, or misuse of any product or part. This warranty also does not apply to fuses, software, non-rechargeable batteries, damage from battery leakage, or problems arising from normal wear or failure to follow instructions.
THIS WARRANTY IS IN LIEU OF ALL OTHER WARRANTIES, EXPRESSED OR IMPLIED, INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR USE. THE REMEDIES PROVIDED HEREIN ARE BUYER’S SOLE AND EXCLUSIVE REMEDIES.
NEITHER KEITHLEY INSTRUMENTS, INC. NOR ANY OF ITS EMPLOYEES SHALL BE LIABLE FOR ANY DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OF ITS INSTRUMENTS AND SOFTWARE, EVEN IF KEITHLEY INSTRUMENTS, INC. HAS BEEN ADVISED IN ADVANCE OF THE POSSIBILITY OF SUCH DAMAGES. SUCH EXCLUDED DAMAGES SHALL INCLUDE, BUT ARE NOT LIMITED TO: COST OF REMOVAL AND INSTALLATION, LOSSES SUSTAINED AS THE RESULT OF INJURY TO ANY PERSON, OR DAMAGE TO PROPERTY.
A G R E A T E R M E A S U R E O F C O N F I D E N C E
Keithley Instruments, Inc.
Corporate Headquarters • 28775 Aurora Road • Cleveland, Ohio 44139
440-248-0400 • Fax: 440-248-6168 • 1-888-KEITHLEY (1-888-534-8453) • www.keithley.com
3/07
The following safety precautions should be observed before using this product and any associated instrumentation. Although some instruments an d access ories would n ormally be used with non-h azardous voltag es, there are situ ations where h azardous condition s may be present.
This product is inte nded for us e by qual ified person nel who recognize s hock haz ards and are famili ar with the s afety prec autions requ ired to avoid possible in jury. Rea d and fo llow all inst a llatio n, opera tion, an d mai ntenanc e info rmatio n carefu lly b efore us ing the product. Ref er to the user documentation for complete product specifications.
If the product is used in a manner not specified, the protection provided by the product warranty may be impaired. The types of product users are: Responsible body is the individual or group responsible for the use and maintenance of equipment, for ensuring that the equipment is
operated within its specifications and operating limits, and for ensuring that operators are adequately trained. Operators use the product for its inten ded function. T hey must be trained in e lectrical safe ty procedures a nd proper us e of the inst rument.
They must be protected from electric shock and contact with hazardous live circuits. Maintenance personnel perform routine procedures on the product to keep it op era tin g p r op erly, fo r e xam pl e, se tting the line voltage or
replacing consuma ble ma terials . Main tenanc e proc edures are descri bed in t he u ser docum ent ation. The proced ures expl icitly st ate if th e operator may perform them. Otherwise, they should be performed only by service personnel.

Safety Precautions

Service personnel are trained to wor k on live circuits, perform safe installations, and repair products. Only properly trained service
personnel may perform installation and service procedures. Keithley Instruments products are designed for use with electrical signals that are rated Measurement Category I and Measurement
Category II, as described in the International Electrotechnical Commission (IEC) Standard IEC 60664. Most measurement, control, and data I/O signals are Measurement Ca tegory I and must not be dire ctly connected to ma ins voltag e or to voltage sourc es with high transient over-voltages. Measurement Category II connections require protection for high transient over-voltages often a s sociated with local AC mains connect ions. Assume all measurement, co ntrol, and dat a I/O connec tions are for conn ection to Cate gory I sources u nless otherwise marked or described in the user documentation.
Exercise extreme caution when a shock hazard is present. Lethal voltage may be present on cable connector jacks or test fixtures. The American National Standards Institute (ANSI) states that a shock hazard exists when voltage levels greater than 30V RMS, 42.4V peak, or 60VDC are present. A good safety practice is to expect that hazardous voltage is present in any unknown circuit before measuring.
Operators of this product must be protected from electric shock at all times. The responsible body must ensure that operators are prevented acces s and/or insul ated from ev ery connect ion point . In some c ases, conne ctions mus t be expos ed to potenti al human c ontact. Product operators in th ese ci rcu ms t ances must be train ed t o p r otec t themselves from the ri sk of electric shock. If the ci rcu it is capable of operating at or above 1000V, no conductive part of the circuit may be exposed.
Do not connect switc hing cards direc tly to unlim ited power circui ts. They ar e intended to b e used with im pedance-lim ited sources. NEVER connect switching cards directly to AC mains. When connecting sources to switching cards, install protective devices to limit fault current and voltage to the card.
Before operating an instrument, ensure that the line cord is connected to a properly-grounded power receptacle. Inspect the connecting cables, test leads, and jumpers for possible wear, cracks, or breaks before each use.
11/07
When installing equipment where access to the main power cord is restricted, such as rack mounting, a separate main input power
!
disconnect device must be provided in close proximity to the equipment and within easy reach of the operator. For maximum safety, do not touch the product, test cables, or any other instruments while power is applied to the circuit under test.
AL W AYS remove powe r from the entire te st system and d ischarge an y capa citors befo re: connecting or disconne cting cab les or jumpers, installing or removing switching cards, or making internal changes, such as installing or removing jumpers.
Do not touch any o bject that could pro vide a c urrent p ath to the com mon sid e of the c ircuit under t est or p ower line (e arth) ground . Always make measurements with dry hands while standing on a dry, insulated surface capable of withstanding the voltage being measured.
The instrument and accessories must be used in accordance with its specifications and operating instructions, or the safety of the equipment may be impaired.
Do not exceed the maxi mum s ignal levels of the ins tru ment s and acces sories , as defi ned in th e spec ifica tion s and op erating information, and as shown on the instrument or test fixture panels, or switching card.
When fuses are used in a product, replace with the same type and rating for continued protection against fire hazard. Chassis connections must only be used as shield connections for measuring circuits, NOT as safety earth ground connections. If you are using a test fixture, keep the lid closed while power is applied to the device under test. Safe operation requires the use of a lid
interlock. If a screw is present, connect it to safety earth ground using the wire recommended in the user documentation. The symbol on an instrument indicates that the user should refer to the operating instructions located in the user documentation. The symbol on an instrument shows that it can source or measure 1000V or more, including the combined effect of normal and
common mode voltages. Use standard safety precautions to avoid personal contact with these voltages. The symbol on an instrument shows that the surface may be hot. Avoid personal contact to prevent burns. The symbol indicates a connection terminal to the equipment frame.
If this symbol is on a product, it indicates that mercury is present in the display lamp. Please note that the lamp must be properly disposed of according to federal, state, and local laws.
The WARNING heading in the user documentation explains dangers that might result in personal injury or death. Always read the associated information very carefully before performing the indicated procedure.
The CAUTION heading in th e u se r do cu me ntation explains ha za rds th at could damage the i nstrument. Such dama ge ma y inv al idate the warranty.
Instrumentation and accessories shall not be connected to humans. Before performing any maintenance, disconnect the line cord and all test cables. T o main tain protecti on from electric sho ck and fire, replacem ent component s in mains circu its - includi ng the power trans former, tes t leads,
and input jacks - must be purchased from Keithley Instruments. Standard fuses with applicable national safety approvals may be used if the rating and type are the same. Other components that are not safety-related may be purchased from other suppliers as long as they are equivalent to the original component (note that selected parts should be purchased only through Keithley Instruments to maintain accuracy and function ality of the product). If you ar e unsure about the applicabi lity of a replacement co mponent, call a Keithley Ins truments office for information.
To clean an instrument, use a damp cloth or mild, water-based cleaner. Clean the exterior of the instrument only. Do not apply cleaner directly to the instrumen t or allow liqui ds to enter or spi ll on the inst rument. Produ cts tha t consist of a circuit board wi th no case or chassis (e.g., a data acquisition board for installation into a computer) should never require cleaning if handled according to instructions. If the board becomes contaminated and operation is affected, the board should be returned to the factory for proper cleaning/servicing.
Model KPCI-488LPA
GPIB Controller Interface Card
User’s Manual
©2008, Keithley Instruments, Inc.
All rights reserved.
Cleveland, Ohio, U.S.A.
Document Number: KPCI-488LPA-900-01 Rev. A / December 2008

Table of Contents

Section Topic Page
1 Keithley Command Compatible Functions ................................... 1-1
Introduction ................................................................................................. 1-2
Using Keithley Command Compatible functions......................................... 1-2
Microsoft® Visual Basic (Version 6.0)................................................... 1-2
Microsoft Visual C/C++......................................................................... 1-4
Keithley Command Compatible function reference .................................... 1-5
GPIBBOARDPRESENT....................................................................... 1-5
BOARDSELECT .................................................................................. 1-5
DMACHANNEL .................................................................................... 1-5
ENTER ................................................................................................. 1-5
FEATURE............................................................................................. 1-6
INITIALIZE ........................................................................................... 1-6
LISTENERPRESENT........................................................................... 1-7
PPOLL.................................................................................................. 1-7
RARRAY............................................................................................... 1-7
RECEIVE ............................................................................................. 1-8
SEND ................................................................................................... 1-8
SETINPUTEOS.................................................................................... 1-8
SETOUTPUTEOS................................................................................ 1-9
SETPORT ............................................................................................ 1-9
SETTIMEOUT ...................................................................................... 1-9
SPOLL.................................................................................................. 1-9
SRQ ................................................................................................... 1-10
TARR AY ............................................................................................. 1-10
TRANSMIT......................................................................................... 1-10
WAITSRQDEVICE ............................................................................. 1-12
2 NI Command Compatible Functions................................................. 2-1
Introduction ................................................................................................. 2-3
Using NI Command Compatible functions.................................................. 2-3
Microsoft Visual Basic (Version 6.0)..................................................... 2-3
Microsoft Visual C/C++......................................................................... 2-5
Overview of NI command compatible functions.......................................... 2-5
IEEE 488 device-level functions........................................................... 2-5
IEEE 488 board-level functions............................................................ 2-6
IEEE 488.2 functions............................................................................ 2-7
Data Types ........................................................................................... 2-8
NI command compatible function reference ............................................... 2-9
ibask..................................................................................................... 2-9
ibbna .................................................................................................. 2-11
ibcac................................................................................................... 2-12
ibclr..................................................................................................... 2-12
ibcmd.................................................................................................. 2-13
ibcmda................................................................................................ 2-13
ibconfig............................................................................................... 2-14
ibdev................................................................................................... 2-16
ibdma ................................................................................................. 2-17
ibeot ................................................................................................... 2-17
ibeos................................................................................................... 2-18
ibfind................................................................................................... 2-19
ibgts.................................................................................................... 2-19
Table of Contents Model KPCI-488LPA GPIB Controller Interface Card User’s Manual
ibist ..................................................................................................... 2-20
iblines ................................................................................................. 2-20
ibln ...................................................................................................... 2-21
ibloc .................................................................................................... 2-21
ibonl .................................................................................................... 2-22
ibnotify ................................................................................................ 2-22
ibpad................................................................................................... 2-24
ibsad ................................................................................................... 2-24
ibpct .................................................................................................... 2-24
ibppc ................................................................................................... 2-25
ibrd...................................................................................................... 2-26
ibrda.................................................................................................... 2-26
ibrdf..................................................................................................... 2-27
ibrpp.................................................................................................... 2-28
ibrsc .................................................................................................... 2-28
ibrsp.................................................................................................... 2-29
ibrsv .................................................................................................... 2-29
ibsic .................................................................................................... 2-30
ibsre.................................................................................................... 2-30
ibstop .................................................................................................. 2-31
ibtmo................................................................................................... 2-31
ibtrg..................................................................................................... 2-32
ibwait .................................................................................................. 2-32
ibwrt .................................................................................................... 2-33
ibwrta .................................................................................................. 2-34
ibwrtf ................................................................................................... 2-35
Multi-device functions................................................................................ 2-36
AllSpoll................................................................................................ 2-36
DevClear............................................................................................. 2-36
DevClearList ....................................................................................... 2-37
EnableLocal........................................................................................ 2-37
EnableRemote.................................................................................... 2-37
FindLstn .............................................................................................. 2-38
FindRQS............................................................................................. 2-38
PassControl ........................................................................................ 2-39
PPoll ................................................................................................... 2-39
PPollConfig......................................................................................... 2-39
PPollUnConfig .................................................................................... 2-40
RcvRespMsg ...................................................................................... 2-40
ReadStatusByte .................................................................................. 2-41
Receive............................................................................................... 2-41
ReceiveSetup ..................................................................................... 2-42
ResetSys ............................................................................................ 2-42
Send ................................................................................................... 2-42
SendCmds .......................................................................................... 2-43
SendDataBytes................................................................................... 2-43
SendList.............................................................................................. 2-44
SendIFC ............................................................................................. 2-45
SendLLO ............................................................................................ 2-45
SendSetup.......................................................................................... 2-45
SetRWLS............................................................................................ 2-46
TestSRQ ............................................................................................. 2-46
TestSys ............................................................................................... 2-46
Trigger ................................................................................................ 2-47
TriggerList........................................................................................... 2-47
WaitSRQ ............................................................................................. 2-48
A Status/Error Codes ............................................................................. A-1
NI command compatible status codes ....................................................... A-2
NI command compatible function error codes............................................ A-3
ii KPCI-488LPA-900-01 Rev. A / December 2008

List of Figures

Section Figure Title Page
1 Figure 1-1 Open Project dialog box ................................................................ 1-2
2 Figure 2-1 Open Project dialog box ................................................................ 2-3
List of Figures Model KPCI-488LPA GPIB Controller Interface Card User’s Manual
This page left blank intentionally.
iv KPCI-488LPA-900-01 Rev. A / December 2008

List of Tables

Section Table Title Page
1 Table 1-1 FEATURE parameters ................................................................... 1-6
1 Table 1-2 TRANSMIT command string parameters..................................... 1-11
2 Table 2-1 IEEE 488 device-level functions .................................................... 2-5
2 Table 2-2 IEEE 488 board-level functions ..................................................... 2-6
2 Table 2-3 IEEE 488.2 functions ..................................................................... 2-7
2 Table 2-4 Data types...................................................................................... 2-8
2 Table 2-5 ibask board configuration parameter options................................. 2-9
2 Table 2-6 ibask device configuration parameter options ............................. 2-10
2 Table 2-7 Board configuration parameter options........................................ 2-14
2 Table 2-8 Device configuration parameter options ...................................... 2-15
2 Table 2-9 EOS mode V value ...................................................................... 2-18
2 Table 2-10 iblines........................................................................................... 2-20
2 Table 2-11 GPIB event codes for mask ......................................................... 2-23
2 Table 2-12 Callback description (for ibnotify)................................................. 2-23
2 Table 2-13 ibtmo timeout ............................................................................... 2-31
2 Table 2-14 ibwait valid mask codes ............................................................... 2-33
A Table A-1 NI command compatible status codes........................................... A-2
A Table A-2 NI command compatible function error codes ............................... A-3
List of Tables Model KPCI-488LPA GPIB Controller Interface Card User’s Manual
This page left blank intentionally.
vi KPCI-488LPA-900-01 Rev. A / December 2008
In this section:
Top ic Pa ge
Introduction ........................................................................................ 1-2
Using Keithley Command Compatible functions............................ 1-2
Keithley Command Compatible function reference........................ 1-5
Section 1
Keithley Command Compatible Functions
Microsoft® Visual Basic (Version 6.0)............................................ 1-2
Microsoft Visual C/C++.................................................................. 1-4
GPIBBOARDPRESENT ................................................................ 1-5
BOARDSELECT............................................................................ 1-5
DMACHANNEL ............................................................................. 1-5
ENTER .......................................................................................... 1-5
FEATURE...................................................................................... 1-6
INITIALIZE ..................................................................................... 1-6
LISTENERPRESENT .................................................................... 1-7
PPOLL ........................................................................................... 1-7
RARRAY........................................................................................ 1-7
RECEIVE....................................................................................... 1-8
SEND............................................................................................. 1-8
SETINPUTEOS ............................................................................. 1-8
SETOUTPUTEOS ......................................................................... 1-9
SETPORT...................................................................................... 1-9
SETTIMEOUT ............................................................................... 1-9
SPOLL ........................................................................................... 1-9
SRQ............................................................................................... 1-10
TARR AY......................................................................................... 1-10
TRANSMIT .................................................................................... 1-10
WAITSRQDEVICE......................................................................... 1-12
Section 1: Keithley Command Compatible Functions Model KPCI-488LPA GPIB Controller Interface Card User’s Manual

Introduction

This section contains information about Keithley Command Compatible Functions. Refer to Section 2 for information on the National Instruments™ (NI)1 command compatible functions.
NOTE Refer to Section 2 for NI Command Compatible Functions.
If you have any questions after reviewing this information, please contact your local Keithley representative or call one of our Applications Engineers at 1-800-KEITHLEY (US only) or visit our website at www.keithley.com.

Using Keithley Command Compatible functions

Microsoft® Visual Basic (Version 6.0)
To create a Windows® XP/2000/Vista Keithley Command Compatible application using the API and Microsoft Visual Basic, follow these steps:
Step 1: Enter Visual Basic and open or create a project to use the Keithley Command Compatible functions
To create a new project, select New Project from the File menu.
To use an existing project:
1. Open the file by selecting Open Project from the File menu. The Open Project dialog box appears (Figure 1-1).
Figure 1-1
Open Project dialog box
2. Load the project by finding and double-clicking the project file name in the applicable directory.
Step 2: Include function declarations and constants file (IEEEVB.BAS)
If it is not already included in the project, add the IEEEVB.BAS file as a module to your project. All Keithley Command Compatible function declarations and constants are contained in this file. These function declarations and constants are used to develop user self-measurement applications.
1. National Instruments and NI are trademarks of the National Instruments Corporation.
1-2 Return to Section Topics KPCI-488LPA-900-01 Rev. A / December 2008
Model KPCI-488LPA GPIB Controller Interface Card User’s Manual Section 1: Keithley Command Compatible Functions
Step 3: Design the application interface
Add elements, such as a command button, list box, or text box, etc., on the Visual Basic form used to design the interface. These elements are standard controls from the Visual Basic Toolbox. To place a needed control on the form:
1. Select the needed control from the Toolbox.
2. Draw the control on the form. Alternatively, to place the default-sized control on the form, click the form. Use the Select Objects tool to reposition or resize controls.
Step 4: Set control properties
Set control properties from the properties list. To view the properties list, select the desired control and do one of the following:
Press F4
Select the Properties command in the View menu
or
Click the Properties button on the Toolbar.
Step 5: Write the event codes
The event codes define the action desired when an event occurs. To write the event codes:
1. Double-click the control or form needing event code (the code module will appear).
2. Add new code as needed. All functions that are declared in IEEEVB.BAS can be called to perform data acquisition operations (refer to Keithley Command Compatible function reference).
Step 6: Run your application
To run the application, either:
Press F5
•Select Start from the Run menu
or
Click the Start icon on the Toolbar
KPCI-488LPA-900-01 Rev. A / December 2008 Return to Section Topics 1-3
Section 1: Keithley Command Compatible Functions Model KPCI-488LPA GPIB Controller Interface Card User’s Manual
Microsoft Visual C/C++
To create a Windows XP/2000/Vista Keithley command compatible library application using the Keithley Command Compatible function library (which is CEC command-compatible) and Microsoft Visual C/C++, follow these steps:
Step 1: Enter Visual C/C++ and open or create a project in which you wish to use Keithley Command Compatible functions
NOTE The project can be a new or existing one.
Step 2: Include function declarations and constants file (IEEE-C.H)
Include IEEE-C.H in the C/C++ source files that call Keithley Command Compatible functions by adding the following statement in the source file:
#include "IEEE-C.H"
NOTE Keithley Command Compatible function declarations and constants are contained in IEEE-
C.H. Use the functions and constants to develop user self data-acquisition applications.
Step 3: Build your application
1. Set suitable compile and link options.
2. Select Build from the Build menu (Visual C/C++ 4.0 and higher).
3. Remember to link the Keithley Command Compatible library ieee_32m.lib.
1-4 Return to Section Topics KPCI-488LPA-900-01 Rev. A / December 2008
Model KPCI-488LPA GPIB Controller Interface Card User’s Manual Section 1: Keithley Command Compatible Functions

Keithley Command Compatible function reference

This section contains a detailed description of Keithley Command Compatible library functions, including the compatible library data types and function reference. The following functions are arranged alphabetically:
GPIBBOARDPRESENT
Description This function checks if a GPIB board is present in the GPIB system.
Syntax Microsoft C/C++ and Borland C++
char gpib_board_present(void)
Visual Basic
GpibBoardPresent( ) As Long
Return Value 0: if no GPIB is installed
1: if a GPIB board is installed
BOARDSELECT
Description This function selects a board to be the active board.
Syntax Microsoft C/C++ and Borland C++
Parameters board: the board number. The valid value is from 0 to 3
DMACHANNEL
Description This function sets the DMA channel. This function is ignored for the
Syntax Microsoft C/C++ and Borland C++
Parameters chan: DMA channel number
ENTER
void boardselect (long int bd)
Visual Basic
call boardselect (ByVal board As Long)
Model KPCI-488LPA.
void dmachannel (long int c)
Visual Basic
call dmachannel (ByVal chan As Long)
Description This function reads data from a specified device.
Syntax Microsoft C/C++ and Borland C++
long int enter (char *buf, unsigned long maxlen, unsigned long *len, long int addr, long int *status)
KPCI-488LPA-900-01 Rev. A / December 2008 Return to Section Topics 1-5
Section 1: Keithley Command Compatible Functions Model KPCI-488LPA GPIB Controller Interface Card User’s Manual
Visual Basic
call enter(buf As String, maxlen As Integer, len As Integer, addr As Integer, status As Integer)
Parameters buf: the buffer storing the received data
maxlen: the maximum bytes of data to receive. The valid value is from 0 to 65535 len:returns the actual number of received data bytes addr: the GPIB address of the Talker status: 0: read data successfully; 8: timeout error
FEATURE
Description This function returns the GPIB board settings or hardware features.
Syntax Microsoft C/C++ and Borland C++
long int feature (long int f)
Visual Basic
GPIBFeature (ByVal f As Long) As Long
Parameters f: the feature or setting information desired. Valid FEATURE values are contained in
Table 1-1.
Table 1-1
FEATURE parameters
Feature (Constants)
IEEEListener 0 Checking if ListenerPresent function is supported by
IEEEIOBASE 100 the I/O base address of the board IEEETIMEOUT 200 the I/O timeout setting of the board IEEEINPUTEOS 201 the current setting of the input EOS character IEEEOUTPUTEOS1 202 the current setting of the output EOS character 1 IEEEOUTPUTEOS2 203 the current setting of output EOS character 2 IEEEBOARDSELECT 204 the current active board number
Return Value The value of the feature or setting
INITIALIZE
Description This function opens and initializes a GPIB board.
Syntax Microsoft C/C++ and Borland C++
Features (Values) Returned Information
the GPIB board; this information value is always 1.
void initialize (long int addr, long int level)
Visual Basic
call initialize (ByVal addr As Long, ByVal level As Long)
Parameters addr : GPIB address assigned to the board
level: 0: specifies the board as a system controller
1: specifies the board as a device
1-6 Return to Section Topics KPCI-488LPA-900-01 Rev. A / December 2008
Model KPCI-488LPA GPIB Controller Interface Card User’s Manual Section 1: Keithley Command Compatible Functions
LISTENERPRESENT
Description This function checks if a listener is present on the GPIB system.
Syntax Microsoft C/C++ and Borland C++
char listener_present(long int addr)
Visual Basic
ListenerPresent (ByVal addr As Long) As Long
Parameters addr: the listener address to check
Return Value 0: the specified listener is not present
1: the specified listener is on the GPIB system
PPOLL
Description This function performs a parallel poll and reads the status of devices.
Syntax Microsoft C/C++ and Borland C++
int ppoll (char *poll)
Parameters poll: returned parallel polling status
RARRAY
Description This function receives a block of binary data (up to 64K) from a device defined as the
Syntax Microsoft C/C++ and Borland C++
Parameters buf: the buffer storing the received binary data
Return Value 0: read data successfully
Visual Basic
call ppoll(poll As Integer)
talker. The GPIB addressing must be performed using the transmit function.
long int rarray (void *buf, unsigned long count, unsigned long *len, long int *status)
Visual Basic
call rarray(buf As Variant, ByVal count As Long, l As Integer, status As Integer)
count: the maximum data bytes. The valid value is 0 to 65535 len: returns the actual number of received data bytes
8: timeout error 32: data transfer terminated with EOI
KPCI-488LPA-900-01 Rev. A / December 2008 Return to Section Topics 1-7
Section 1: Keithley Command Compatible Functions Model KPCI-488LPA GPIB Controller Interface Card User’s Manual
RECEIVE
Description This function reads data from a specified device, but does not address a talker. The
GPIB addressing must be performed using the transmit function.
Syntax Microsoft C/C++ and Borland C++
long int receive (char *buf, unsigned long maxlen, unsigned long *len, long int *status)
Visual Basic
call receive (buf As String, maxlen As Integer, len As Integer, status As Integer)
Parameters buf: the buffer storing the received data
maxlen: sets maximum bytes of data to receive len: returns the actual number of received data bytes
Return Value 0: read data successfully
8: timeout error
SEND
Description This function sends commands to a specified GPIB device.
Syntax Microsoft C/C++ and Borland C++
Parameters addr: the listener address
Return Value 0: data sent successfully
SETINPUTEOS
Description This function sets the terminating character for input data transfer.
Syntax Microsoft C/C++ and Borland C++
long int send (long int addr, char *buf, unsigned long maxlen, long int *status)
Visual Basic
call send(addr As Integer, buf As String, status As Integer)
buf: the buffer storing the data to send maxlen: sets the maximum number of data bytes to send
8: timeout error
void setinputEOS (long int eos_c)
Visual Basic
call setinputEOS (ByVal eos_c As Long)
Parameters eos_c: the terminating character for input data transfer
1-8 Return to Section Topics KPCI-488LPA-900-01 Rev. A / December 2008
Model KPCI-488LPA GPIB Controller Interface Card User’s Manual Section 1: Keithley Command Compatible Functions
SETOUTPUTEOS
Description This function sets the terminating characters for output data transfer.
Syntax Microsoft C/C++ and Borland C++
void setoutputEOS (long int e1, long int e2)
Visual Basic
call setoutputEOS (ByVal e1 As Long, ByVal e2 As Long)
Parameters e1: the first terminating character for output data transfer
e2: the second terminating character for output data transfer
SETPORT
Description This function sets the I/O address of a GPIB board. This function is not used for the
Model KPCI-488LPA.
Syntax Microsoft C/C++ and Borland C++
void setport (long int bd, unsigned io)
Visual Basic
Parameters bd: the board number
SETTIMEOUT
Description This function sets the timeout period. The timeout period is the maximum duration
Syntax Microsoft C/C++ and Borland C++
Parameters timeout: the timeout value in milli-seconds (msec)
SPOLL
Description This function performs serial polling and a read of the specified device’s status.
Syntax Microsoft C/C++ and Borland C++
call setport (ByVal bd As Long, ByVal io As Long)
io: the I/O base address set to the device
allowed for a read/write operation.
void settimeout (unsigned long int timeout)
Visual Basic
call settimeout (ByVal timeout As Long)
long int spoll (long int addr, char *poll, long int *status)
Visual Basic
call spoll(ByVal addr As Integer, poll As Integer, status As Integer)
Parameters addr: the address of the device to poll
poll: returns result of serial polling
Return Value 0: data sent successfully
8: timeout error
KPCI-488LPA-900-01 Rev. A / December 2008 Return to Section Topics 1-9
Section 1: Keithley Command Compatible Functions Model KPCI-488LPA GPIB Controller Interface Card User’s Manual
SRQ
Description This function checks if a device is requesting service.
Syntax Microsoft C/C++ and Borland C++
char srq(void)
Visual Basic
srq ( ) As Long
Return Value 0: the device is not requesting service
1: the device is requesting service
TARRAY
Description This function sends a block of binary data from memory to the devices defined as lis-
teners. The GPIB addressing must be performed using the transmit function.
Syntax Microsoft C/C++ and Borland C++
long int tarray (void *buf, unsigned long count, long int eoi, long int *status)
Parameters buf: the buffer storing the data to send
Return Value 0: read data successfully
TRANSMIT
Description This function sends GPIB commands and data according to a specified string com-
Syntax Microsoft C/C++ and Borland C++
Parameters cmd: the buffer containing the command string and data to send.
Visual Basic
call tarray (buf as variant, ByVal count As Long, ByVal eoi As Integer, status As Integer)
count: the maximum number of data bytes to be transmitted eoi: enable or disable EOI mode of the device. 0 = disable EOI; 1 = enable EOI
8: timeout error 32: data transfer terminated with EOI
posed a series of GPIB commands and data.
long int transmit (char * cmd, unsigned maxlen, long int * status);
Visual Basic
call transmit(cmd As String, status As Integer)
The valid cmd string values are contained in Table 1-2. maxlen: the maximum number of command string bytes to send.
Return Value status:
0: sent command and data successfully 1: illegal command syntax 8: timeout error 16: unknown command 32: data transfer terminated with EOI
1-10 Return to Section Topics KPCI-488LPA-900-01 Rev. A / December 2008
Model KPCI-488LPA GPIB Controller Interface Card User’s Manual Section 1: Keithley Command Compatible Functions
Table 1-2
TRANSMIT command string parameters
Commands Description Example
LISTEN Sets the addresses of the listeners. The
values following LISTEN are the GPIB addresses of the listeners.
TALK Sets the address of the talker. The
values following TALK are the GPIB addresses of the talker. There is only one talker at a time.
SEC Sets the second address of the talker or
listener. This command should follow TALK or LISTEN.
UNT Untalk. "UNT" UNL Unlisten. "UNL" MTA My Talk Address. Assigns the active
GPIB board as the talker.
MLA My Listen Address. Assigns the active
GPIB board as the listener.
DATA Starts the data part. Before the DATA
command, the GPIB board has to be set as the talker. Strings are enclosed by quotes(') and sent as characters.
"LISTEN 1 2 3" meaning: config devices whose GPIB address are 1, 2 and 3, as listeners.
"TALK 0" meaning: config device whose GPIB address is 0, as talker.
"TALK 0 SEC 1" meaning: config device whose primary GPIB address is 0 and secondary address is 1 as talker.
"MTA"
"MLA"
"DATA 'hello' 13 10"
END Sends terminator characters. DATA
command should be called before this
command. REN Remote Enable "REN" EOI End-or-Identify. The data bytes following
EOI are the last bytes to transmit. The
last byte is sent with the EOI signal. GTL Go To Loc al "GTL " SPE Serial Poll Enable "SPE" SPD Serial Poll Disable "SPD" PPC Parallel Poll Configure "PPC" PPD Parallel Poll Disable "PPD" PPU Parallel Poll Unconfigure "PPU" DCL Device Clear "DCL" LLO Local Lockout "LLO" CMD Starts GPIB command. The values
followed by CMD are treated as GPIB
command messages and sent as binary
values. GET Group Execute Trigger "GET" SDC Selected Device Clear "SDC" TCT Take Control "TCT" IFC Interface Clear "IFC"
"DATA '*IDN?' END" meaning: send data message "*IDN?" and then send terminator bytes
"DATA '*IDN?' EOI 10" meaning: send data message "*IDN?" and then send line feed with EOI signal.
"CMD 20" meaning: send GPIB command message, Device Clear (DCL).
KPCI-488LPA-900-01 Rev. A / December 2008 Return to Section Topics 1-11
Loading...
+ 57 hidden pages