Page 1
KPCI-488LPA GPIB Controller Interface Card User’s Manual KPCI-488LPA-900-01 Rev. A / December 2008...
Page 3
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.
Page 5
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 Category I and must not be directly connected to mains voltage or to voltage sources with high transient over-voltages.
Page 6
To maintain protection from electric shock and fire, replacement components in mains circuits - including the power transformer, test 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.
Page 11
List of Figures Section Figure Title Page Figure 1-1 Open Project dialog box ..............1-2 Figure 2-1 Open Project dialog box ..............2-3...
Page 12
List of Figures Model KPCI-488LPA GPIB Controller Interface Card User’s Manual This page left blank intentionally. KPCI-488LPA-900-01 Rev. A / December 2008...
Page 14
List of Tables Model KPCI-488LPA GPIB Controller Interface Card User’s Manual This page left blank intentionally. KPCI-488LPA-900-01 Rev. A / December 2008...
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.
Page 17
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.
The project can be a new or existing one. NOTE 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"...
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:...
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.
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...
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.
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)
Section 1: Keithley Command Compatible Functions Model KPCI-488LPA GPIB Controller Interface Card User’s Manual 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...
Page 25
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 "LISTEN 1 2 3" values following LISTEN are the GPIB meaning: config devices whose GPIB addresses of the listeners.
Section 1: Keithley Command Compatible Functions Model KPCI-488LPA GPIB Controller Interface Card User’s Manual WAITSRQDEVICE Description This function waits until a device is requesting service or a timeout error occurs. Syntax Microsoft C/C++ and Borland C++ long int waitSRQDevice (long int addr,...
Keithley Command Compatible Functions. NOTE If you have any questions after reviewing this information, please contact your local Keithley Instruments representative or call one of our Applications Engineers at 1-800-KEITHLEY (US only) or visit our website at www.keithley.com. Using NI Command Compatible functions ®...
Page 30
Section 2: NI Command Compatible Functions Model KPCI-488LPA GPIB Controller Interface Card User’s Manual Step 2: Include function declarations and constants file (GPIB.BAS) If it is not already included in the project, add the GPIB.BAS file. All NI command compatible function declarations and constants are contained in this file.
Model KPCI-488LPA GPIB Controller Interface Card User’s Manual Section 2: NI Command Compatible Functions Microsoft Visual C/C++ To create an application with NI command compatible functions and Microsoft Visual C/C++, follow these steps: Step 1: Enter Microsoft Visual C/C++ and open or create a project in which you wish to use NI command compatible functions The project can be a new or existing one.
Section 2: NI Command Compatible Functions Model KPCI-488LPA GPIB Controller Interface Card User’s Manual Table 2-1 (continued) IEEE 488 device-level functions Function Description ibpct Passes Controller-in-Charge (CIC) status to another GPIB device that has controller capability. ibppc Configures parallel polling. ibrd Reads data from a device to the indicated buffer.
Model KPCI-488LPA GPIB Controller Interface Card User’s Manual Section 2: NI Command Compatible Functions Table 2-2 (continued) IEEE 488 board-level functions Function Description ibrpp Performs parallel polling. ibrsc Sends Interface Clear (IFC) message or Remote Enable (REN) message to request or release the System Control. ibrsv Requests service and changes the status byte of the sequential polling.
NI command compatible function reference Use this section as a function reference for NI command compatible functions. Refer to Section 1 information on Keithley Command Compatible Functions. ibask Description This command returns the current value of the selected configuration item.
Page 36
Section 2: NI Command Compatible Functions Model KPCI-488LPA GPIB Controller Interface Card User’s Manual Table 2-5 (continued) ibask board configuration parameter options Options Options (Constants) (Value) Returned Information 0x000B 0: While the board becomes the System Controller, the GPIB REN ibaSRE line is not set to enable automatically.
Model KPCI-488LPA GPIB Controller Interface Card User’s Manual Section 2: NI Command Compatible Functions Table 2-6 (continued) ibask device configuration parameter options Options Options (Constants) (Values) Returned Information 0x0006 0: The unnecessary addressing is not operated during the device-level ibaREADDR writing or reading.
Section 2: NI Command Compatible Functions Model KPCI-488LPA GPIB Controller Interface Card User’s Manual ibcac Description This command sets the assigned GPIB board to be the active controller by setting the ATN line to enable. The GPIB board must be the CIC (controller in charge) before calling ibcac.
Model KPCI-488LPA GPIB Controller Interface Card User’s Manual Section 2: NI Command Compatible Functions ibcmd Description This command sends GPIB commands. Command words are used to configure the GPIB status. ibwrt is used to send the device self-control command. To return the number of transferred command bytes in the global variable, use ibcntl.
Section 2: NI Command Compatible Functions Model KPCI-488LPA GPIB Controller Interface Card User’s Manual Syntax Visual Basic idcmda (ByVal ud As Integer, ByVal buf As String, ByVal cnt As Long) As Integer - or - call ibcmda (ByVal ud As Integer, ByVal buf As String) Parameters ud: device unit descriptor...
Page 41
Model KPCI-488LPA GPIB Controller Interface Card User’s Manual Section 2: NI Command Compatible Functions Table 2-7 (continued) Board configuration parameter options Options Options (Constants) (Value) Valid Values ibcSC 0x000A Request or release system control. The same as ibrsc. ibcSRE 0x000B Control the Remote Enable (REN) line.
Section 2: NI Command Compatible Functions Model KPCI-488LPA GPIB Controller Interface Card User’s Manual Table 2-8 (continued) Device configuration parameter options Options Options (Constants) (Values) Returned Information ibcREADDR 0x0006 0: Unnecessary addressing is not operated during device-level writing or reading. 1: Addressing is operated continuously during the device-level writing or reading.
Model KPCI-488LPA GPIB Controller Interface Card User’s Manual Section 2: NI Command Compatible Functions Return Value The device descriptor or -1 Error Codes EARG, EDVR, ENEB ibdma Description This command enables or disables DMA. This function is not supported for the Model KPCI-488LPA.
Section 2: NI Command Compatible Functions Model KPCI-488LPA GPIB Controller Interface Card User’s Manual ibeos Description This command configures the EOS termination mode or character. NOTE Defining an EOS byte does not automatically send it when I/O writing is terminated; the user must set the EOS byte after the data strings have been defined by the application.
Model KPCI-488LPA GPIB Controller Interface Card User’s Manual Section 2: NI Command Compatible Functions ibfind Description This command opens and initializes the GPIB board descriptor. The returned board descriptor can be used in later commands. Similar to ibonl 1, ibfind performs a board description initialization.
Section 2: NI Command Compatible Functions Model KPCI-488LPA GPIB Controller Interface Card User’s Manual ibist Description This command sets or clears the board individual status (ist) bit for parallel polling. Support Level Board level Syntax Microsoft C/C++ and Borland C++ int ibist (int ud, int ist) Visual Basic ibist (ByVal ud As Integer, ByVal v As Integer)
Model KPCI-488LPA GPIB Controller Interface Card User’s Manual Section 2: NI Command Compatible Functions Parameters ud: board descriptor line_status: the status information of the returned GPIB control line Return Value The value of the ibsta Error Codes EARG, EDVR, ENEB, EOIP ibln Description This command determines if there is an available device on bus.
Section 2: NI Command Compatible Functions Model KPCI-488LPA GPIB Controller Interface Card User’s Manual Syntax Microsoft C/C++ and Borland C++ int ibloc (int ud) Visual Basic ibloc (ByVal ud As Integer) As Integer - or - call ibloc (ByVal ud As Integer) Parameters ud: board or device descriptor Return Value...
Page 49
Model KPCI-488LPA GPIB Controller Interface Card User’s Manual Section 2: NI Command Compatible Functions Parameters ud: board or device descriptor mask: GPIB event code. Table 2-11 contains the valid event codes. Table 2-11 GPIB event codes for mask Event code Description No mask - TIMO...
Section 2: NI Command Compatible Functions Model KPCI-488LPA GPIB Controller Interface Card User’s Manual ibpad Description This command sets a board or a device primary GPIB address. Support Level Board / device level Syntax Microsoft C/C++ and Borland C++ int ibpad (int ud, int v) Visual Basic ibpad (ByVal ud As Integer, ByVal v As Integer) As Integer...
Model KPCI-488LPA GPIB Controller Interface Card User’s Manual Section 2: NI Command Compatible Functions Syntax Microsoft C/C++ and Borland C++ int ibpct (int ud) Visual Basic ibpct (ByVal ud As Integer) As Integer - or - call ibpct (ByVal ud As Integer) Parameters ud: device descriptor Return Value...
Section 2: NI Command Compatible Functions Model KPCI-488LPA GPIB Controller Interface Card User’s Manual ibrd Description This command reads data from a device to the indicated buffer. The GPIB is addressed by ibrd, which reads count data bytes (count is the counting value in the counter);...
Model KPCI-488LPA GPIB Controller Interface Card User’s Manual Section 2: NI Command Compatible Functions Once the asynchronous I/O has begun, later GPIB commands are strictly limited; any command that would interfere with the I/O in progress will not be allowed. In this case, EOIP is returned by the driver.
Section 2: NI Command Compatible Functions Model KPCI-488LPA GPIB Controller Interface Card User’s Manual Syntax Microsoft C/C++ and Borland C++ int ibrdf (int ud, const char *filename) Visual Basic ibrdf (ByVal ud As Integer, ByVal filename As String ) As Integer - or - call ibrdf (ByVal ud As Integer, ByVal filename As String)
Model KPCI-488LPA GPIB Controller Interface Card User’s Manual Section 2: NI Command Compatible Functions Syntax Microsoft C/C++ and Borland C++ int ibrsc (int ud, int v) Visual Basic ibrsc (ByVal ud As Integer, ByVal v As Integer) As Integer - or - call ibrsc (ByVal ud As Integer, ByVal v As Integer) Parameters ud: device descriptor...
Section 2: NI Command Compatible Functions Model KPCI-488LPA GPIB Controller Interface Card User’s Manual Parameters ud: device descriptor v: the status byte of the sequential polling Return Value The value of the ibsta Error Codes EARG, EDVR, ENEB, EOIP ibsic Description This command enables the GPIB interface clear (IFC) line to allow at least 100ns when the GPIB interface is the system controller by initializing the GPIB interface,...
Model KPCI-488LPA GPIB Controller Interface Card User’s Manual Section 2: NI Command Compatible Functions ibstop Description This command stops asynchronous I/O operation. If the ibsta command is used when asynchronous I/O is operating, the error code EABO is returned to show the I/O was successfully stopped.
Model KPCI-488LPA GPIB Controller Interface Card User’s Manual Section 2: NI Command Compatible Functions Syntax Visual Basic ibwait (ByVal ud As Integer, ByVal mask As Integer) As Integer - or - call ibwait (ByVal ud As Integer, ByVal mask As Integer) Parameters ud: board or device descriptor...
Section 2: NI Command Compatible Functions Model KPCI-488LPA GPIB Controller Interface Card User’s Manual Support Level Board / device level Syntax Microsoft C/C++ and Borland C++ int ibwrt (int ud, const void *buf, long cnt) Visual Basic ibwrt (ByVal ud As Integer, ByVal buf As String, ByVal cnt As Long) As Integer - or - call ibwrt (ByVal ud As Integer, ByVal buf As...
Model KPCI-488LPA GPIB Controller Interface Card User’s Manual Section 2: NI Command Compatible Functions Support Level Board / device level Syntax Microsoft C/C++ and Borland C++ int ibwrta (int ud, const void *buf, long cnt) Visual Basic ibwrta (ByVal ud As Integer, ByVal buf As String, ByVal cnt As Long) As Integer - or - call ibwrta (ByVal ud As Integer, ByVal buf As...
Multi-device functions This section provides a NI command compatible multi-device IEEE 488 function reference. Refer to Section 1 for information on Keithley Command Compatible Functions. AllSpoll Description This command sequentially polls one or more devices. The responses and number of responses of poll are individually stored in resultList and ibcntl.
Model KPCI-488LPA GPIB Controller Interface Card User’s Manual Section 2: NI Command Compatible Functions DevClearList Description This command clears multiple devices. If the address is the constant NOADDR, the DCL message is sent to all devices. Syntax Microsoft C/C++ and Borland C++ void DevClearList (int board_desc, const Addr4882_t addressList[]) Visual Basic...
Section 2: NI Command Compatible Functions Model KPCI-488LPA GPIB Controller Interface Card User’s Manual Parameters board_desc: board ID addressList: the list of the device addresses ended by NOADDR; the devices are waiting to go to remote control mode Error Codes EARG, EBUS, ECIC, EDVR, EOIP, ENEB, ESAC FindLstn Description...
Model KPCI-488LPA GPIB Controller Interface Card User’s Manual Section 2: NI Command Compatible Functions PassControl Description This command sends the Take Control (TCT) GPIB message to the device for passing control to another GPIB device with control capability. The device changes to Controller-In-Charge (CIC) status when the interface is no longer CIC status.
Section 2: NI Command Compatible Functions Model KPCI-488LPA GPIB Controller Interface Card User’s Manual Parameters board_desc: board ID address: the device address of the device is waiting to be configured. dataLine: data line on which the device responds to parallel polling; its range is from 1 to 8.
Model KPCI-488LPA GPIB Controller Interface Card User’s Manual Section 2: NI Command Compatible Functions ReadStatusByte Description This command sequentially polls a device. If the sixth bit (hex 40) of the response is set, the device is requesting service. Syntax Microsoft C/C++ and Borland C++ void ReadStatusByte (int board_desc, Addr4882_t address, short *result) Visual Basic...
Section 2: NI Command Compatible Functions Model KPCI-488LPA GPIB Controller Interface Card User’s Manual ReceiveSetup Description This command configures the device to be a talker and the interface to a receiver. After the function ReceiveSetup, RcvRespMsg function is usually called to transfer the data from the device to the interface.
Model KPCI-488LPA GPIB Controller Interface Card User’s Manual Section 2: NI Command Compatible Functions Syntax Microsoft 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) Parameters...
Section 2: NI Command Compatible Functions Model KPCI-488LPA GPIB Controller Interface Card User’s Manual Syntax Microsoft 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) Parameters board_desc: board ID buffer: the sent data bytes...
Model KPCI-488LPA GPIB Controller Interface Card User’s Manual Section 2: NI Command Compatible Functions SendIFC Description This command sends the Interface Clear command to reset GPIB. SendIFC is used to be a part of GPIB initialization. The function forces the interface to Controller-in- Charge of GPIB.
Section 2: NI Command Compatible Functions Model KPCI-488LPA GPIB Controller Interface Card User’s Manual SetRWLS Description This command configures the device to lockout status of remote control mode. SetRWLS sets the devices listed in addrlist to remote control mode by controlling the Remote Enable (REN) GPIB line.
Model KPCI-488LPA GPIB Controller Interface Card User’s Manual Section 2: NI Command Compatible Functions Syntax Microsoft 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) Parameters board_desc: board ID addrlist: the list of the device addresses ended by NOADDR...
Section 2: NI Command Compatible Functions Model KPCI-488LPA GPIB Controller Interface Card User’s Manual WaitSRQ Description This command waits until the device controls the GPIB SRQ line. When WaitSRQ returns, the result contains a non-zero value if the SRQ line in controlled. Otherwise the result contains a zero value.
Appendix A Status/Error Codes In this section: Topic Page NI command compatible status codes ......... NI command compatible function error codes ......
Appendix A: Status/Error Codes Model KPCI-488LPA GPIB Controller Interface Card User’s Manual NI command compatible status codes This section contains information about possible error codes produced when using the National Instruments™ (NI) command compatible functions. All commands update global status word ibsta which contains the GPIB status and the message from the user's GPIB hardware.
Model KPCI-488LPA GPIB Controller Interface Card User’s Manual Appendix A: Status/Error Codes NI command compatible function error codes NI command compatible function error codes are listed in the following table. Note that, the error variable is meaningful only when the ERR bit of the status variable, ibsta, is placed. Click the error mnemonic, and you can obtain a detailed description and the solution for each error.
Page 78
Appendix A: Status/Error Codes Model KPCI-488LPA GPIB Controller Interface Card User’s Manual This page left blank intentionally. KPCI-488LPA-900-01 Rev. A / December 2008...
Page 79
Service Form Model No. Serial No. Date Name and Telephone No. Company List all control settings, describe problem and check boxes that apply to problem. ❏ ❏ ❏ Intermittent Analog output follows display Particular range or function bad; specify ❏ ❏...
Page 82
M E A S U R E 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 • www.keithley.com 12/06...
Need help?
Do you have a question about the KPCI-488 LPA and is the answer not in the manual?
Questions and answers